git: 8722e05ae149 - main - twa: Remove
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 25 Nov 2021 07:46:57 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8722e05ae1496968114f4be1a68bf5ea62cdbd78 commit 8722e05ae1496968114f4be1a68bf5ea62cdbd78 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-11-25 07:21:41 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-11-25 07:45:13 +0000 twa: Remove Belatedly remove twa(4). It was supposed to go before 13.0, but was overlooked. Sponsored by: Netflix Relnotes: yes Reviewed by: scottl Differential Revision: https://reviews.freebsd.org/D33114 --- share/man/man4/Makefile | 1 - share/man/man4/twa.4 | 140 --- sys/amd64/conf/GENERIC | 1 - sys/amd64/conf/NOTES | 7 - sys/conf/files | 12 - sys/conf/options | 2 - sys/dev/twa/tw_cl.h | 324 ------ sys/dev/twa/tw_cl_externs.h | 191 ---- sys/dev/twa/tw_cl_fwif.h | 418 -------- sys/dev/twa/tw_cl_init.c | 696 ------------- sys/dev/twa/tw_cl_intr.c | 724 -------------- sys/dev/twa/tw_cl_io.c | 1407 -------------------------- sys/dev/twa/tw_cl_ioctl.h | 104 -- sys/dev/twa/tw_cl_misc.c | 991 ------------------ sys/dev/twa/tw_cl_share.h | 535 ---------- sys/dev/twa/tw_osl.h | 298 ------ sys/dev/twa/tw_osl_cam.c | 663 ------------ sys/dev/twa/tw_osl_externs.h | 86 -- sys/dev/twa/tw_osl_freebsd.c | 1661 ------------------------------- sys/dev/twa/tw_osl_includes.h | 76 -- sys/dev/twa/tw_osl_inline.h | 309 ------ sys/dev/twa/tw_osl_ioctl.h | 108 -- sys/dev/twa/tw_osl_share.h | 107 -- sys/dev/twa/tw_osl_types.h | 60 -- sys/i386/conf/GENERIC | 1 - sys/i386/conf/NOTES | 7 - sys/modules/Makefile | 2 - sys/modules/twa/Makefile | 47 - tools/kerneldoc/subsys/Doxyfile-dev_twa | 21 - 29 files changed, 8999 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index ce2ce1ec8640..9504cde7626e 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -552,7 +552,6 @@ MAN= aac.4 \ ${_tpm.4} \ tty.4 \ tun.4 \ - twa.4 \ twe.4 \ tws.4 \ udp.4 \ diff --git a/share/man/man4/twa.4 b/share/man/man4/twa.4 deleted file mode 100644 index 64e3e37f7da0..000000000000 --- a/share/man/man4/twa.4 +++ /dev/null @@ -1,140 +0,0 @@ -.\" -.\" Copyright (c) 2004 3ware, Inc. -.\" Copyright (c) 2000 BSDi -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd May 9, 2007 -.Dt TWA 4 -.Os -.Sh NAME -.Nm twa -.Nd 3ware 9000/9500/9550/9650 series SATA RAID controllers driver -.Sh DEPRECATION NOTICE -The -.Nm -driver is not present in -.Fx 13.0 . -.Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device scbus" -.Cd "device twa" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -twa_load="YES" -.Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for AMCC's 3ware 9000/9500/9550/9650 series -SATA controllers. -.Pp -These controllers are available in 4, 8, 12 or 16-port configurations, -and support the following RAID levels: 0, 1, 10, 5, 50. -The device nodes for the controllers are of the form -.Pa /dev/twa Ns Ar X , -where -.Ar X -is the controller number. -The driver is implemented as a SCSI SIM -under CAM, and, as such, the logical units that it controls are accessible -via the device nodes, -.Pa /dev/da Ns Ar Y , -where -.Ar Y -is the logical unit number. -.Sh HARDWARE -The -.Nm -driver supports the following SATA RAID controllers: -.Pp -.Bl -bullet -compact -.It -AMCC's 3ware 9500S-4LP -.It -AMCC's 3ware 9500S-8 -.It -AMCC's 3ware 9500S-8MI -.It -AMCC's 3ware 9500S-12 -.It -AMCC's 3ware 9500S-12MI -.It -AMCC's 3ware 9500SX-4LP -.It -AMCC's 3ware 9500SX-8LP -.It -AMCC's 3ware 9500SX-12 -.It -AMCC's 3ware 9500SX-12MI -.It -AMCC's 3ware 9500SX-16ML -.It -AMCC's 3ware 9550SX-4LP -.It -AMCC's 3ware 9550SX-8LP -.It -AMCC's 3ware 9550SX-12 -.It -AMCC's 3ware 9550SX-12MI -.It -AMCC's 3ware 9550SX-16ML -.It -AMCC's 3ware 9650SE-2LP -.It -AMCC's 3ware 9650SE-4LPML -.It -AMCC's 3ware 9650SE-8LPML -.It -AMCC's 3ware 9650SE-12ML -.It -AMCC's 3ware 9650SE-16ML -.It -AMCC's 3ware 9650SE-24M8 -.El -.Sh DIAGNOSTICS -Whenever the driver encounters a command failure, it prints out an error code in -the format: -.Qq Li "ERROR: (<error source>: <error code>):" , -followed by a text description of the error. -There are other error messages and warnings that the -driver prints out, depending on the kinds of errors that it encounters. -If the driver is compiled with -.Dv TWA_DEBUG -defined, it prints out a whole bunch of debug -messages, the quantity of which varies depending on the value assigned to -.Dv TWA_DEBUG -(0 to 10). -.Sh AUTHORS -The -.Nm -driver and manpage were written by -.An Vinod Kashyap Aq Mt vkashyap@FreeBSD.org . diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index f0bc090e376e..60d2d0376aac 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -182,7 +182,6 @@ device ses # Enclosure Services (SES and SAF-TE) device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* device ips # IBM (Adaptec) ServeRAID -device twa # 3ware 9000 series PATA/SATA RAID device smartpqi # Microsemi smartpqi driver device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index ce1cf6bb76ce..8cb84d6248c2 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -406,13 +406,6 @@ device arcmsr # Areca SATA II RAID # device smartpqi -# -# 3ware 9000 series PATA/SATA RAID controller driver and options. -# The driver is implemented as a SIM, and so, needs the CAM infrastructure. -# -options TWA_DEBUG # 0-10; 10 prints the most messages. -device twa # 3ware 9000 series PATA/SATA RAID - # # Adaptec FSA RAID controllers, including integrated DELL controllers, # the Dell PERC 2/QC and the HP NetRAID-4M diff --git a/sys/conf/files b/sys/conf/files index 4f084a2733a7..0c54622e2563 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3205,18 +3205,6 @@ dev/syscons/warp/warp_saver.c optional warp_saver dev/tcp_log/tcp_log_dev.c optional tcp_blackbox inet | tcp_blackbox inet6 dev/tdfx/tdfx_pci.c optional tdfx pci dev/ti/if_ti.c optional ti pci -dev/twa/tw_cl_init.c optional twa \ - compile-with "${NORMAL_C} -I$S/dev/twa" -dev/twa/tw_cl_intr.c optional twa \ - compile-with "${NORMAL_C} -I$S/dev/twa" -dev/twa/tw_cl_io.c optional twa \ - compile-with "${NORMAL_C} -I$S/dev/twa" -dev/twa/tw_cl_misc.c optional twa \ - compile-with "${NORMAL_C} -I$S/dev/twa" -dev/twa/tw_osl_cam.c optional twa \ - compile-with "${NORMAL_C} -I$S/dev/twa" -dev/twa/tw_osl_freebsd.c optional twa \ - compile-with "${NORMAL_C} -I$S/dev/twa" dev/twe/twe.c optional twe dev/twe/twe_freebsd.c optional twe dev/tws/tws.c optional tws diff --git a/sys/conf/options b/sys/conf/options index 58cb6458b656..123a770ed74c 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -43,8 +43,6 @@ AHD_DEBUG_OPTS opt_aic79xx.h AHD_TMODE_ENABLE opt_aic79xx.h AHD_REG_PRETTY_PRINT opt_aic79xx.h -TWA_DEBUG opt_twa.h - # Debugging options. ALT_BREAK_TO_DEBUGGER opt_kdb.h BREAK_TO_DEBUGGER opt_kdb.h diff --git a/sys/dev/twa/tw_cl.h b/sys/dev/twa/tw_cl.h deleted file mode 100644 index 8f047329c318..000000000000 --- a/sys/dev/twa/tw_cl.h +++ /dev/null @@ -1,324 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2004-07 Applied Micro Circuits Corporation. - * Copyright (c) 2004-05 Vinod Kashyap - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * AMCC'S 3ware driver for 9000 series storage controllers. - * - * Author: Vinod Kashyap - * Modifications by: Adam Radford - */ - -#ifndef TW_CL_H - -#define TW_CL_H - -/* - * Common Layer internal macros, structures and functions. - */ - -#define TW_CLI_SECTOR_SIZE 0x200 -#define TW_CLI_REQUEST_TIMEOUT_PERIOD 60 /* seconds */ -#define TW_CLI_RESET_TIMEOUT_PERIOD 60 /* seconds */ -#define TW_CLI_MAX_RESET_ATTEMPTS 2 - -/* Possible values of ctlr->ioctl_lock.lock. */ -#define TW_CLI_LOCK_FREE 0x0 /* lock is free */ -#define TW_CLI_LOCK_HELD 0x1 /* lock is held */ - -/* Possible values of req->state. */ -#define TW_CLI_REQ_STATE_INIT 0x0 /* being initialized */ -#define TW_CLI_REQ_STATE_BUSY 0x1 /* submitted to controller */ -#define TW_CLI_REQ_STATE_PENDING 0x2 /* in pending queue */ -#define TW_CLI_REQ_STATE_COMPLETE 0x3 /* completed by controller */ - -/* Possible values of req->flags. */ -#define TW_CLI_REQ_FLAGS_7K (1<<0) /* 7000 cmd pkt */ -#define TW_CLI_REQ_FLAGS_9K (1<<1) /* 9000 cmd pkt */ -#define TW_CLI_REQ_FLAGS_INTERNAL (1<<2) /* internal request */ -#define TW_CLI_REQ_FLAGS_PASSTHRU (1<<3) /* passthru request */ -#define TW_CLI_REQ_FLAGS_EXTERNAL (1<<4) /* external request */ - -#ifdef TW_OSL_PCI_CONFIG_ACCESSIBLE -/* Register offsets in PCI config space. */ -#define TW_CLI_PCI_CONFIG_COMMAND_OFFSET 0x4 /* cmd register offset */ -#define TW_CLI_PCI_CONFIG_STATUS_OFFSET 0x6 /* status register offset */ -#endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */ - -#ifdef TW_OSL_DEBUG -struct tw_cli_q_stats { - TW_UINT32 cur_len;/* current # of entries in q */ - TW_UINT32 max_len; /* max # of entries in q, ever reached */ -}; -#endif /* TW_OSL_DEBUG */ - -/* Queues of CL internal request context packets. */ -#define TW_CLI_FREE_Q 0 /* free q */ -#define TW_CLI_BUSY_Q 1 /* q of reqs submitted to fw */ -#define TW_CLI_PENDING_Q 2 /* q of reqs deferred due to 'q full' */ -#define TW_CLI_COMPLETE_Q 3 /* q of reqs completed by fw */ -#define TW_CLI_RESET_Q 4 /* q of reqs reset by timeout */ -#define TW_CLI_Q_COUNT 5 /* total number of queues */ - -/* CL's internal request context. */ -struct tw_cli_req_context { - struct tw_cl_req_handle *req_handle;/* handle to track requests between - OSL & CL */ - struct tw_cli_ctlr_context *ctlr; /* ptr to CL's controller context */ - struct tw_cl_command_packet *cmd_pkt;/* ptr to ctlr cmd pkt */ - TW_UINT64 cmd_pkt_phys; /* cmd pkt physical address */ - TW_VOID *data; /* ptr to data being passed to fw */ - TW_UINT32 length; /* length of data being passed to fw */ - TW_UINT64 data_phys; /* physical address of data */ - - TW_UINT32 state; /* request state */ - TW_UINT32 flags; /* request flags */ - - TW_UINT32 error_code; /* error encountered before submission - of request to fw, if any */ - - TW_VOID *orig_req; /* ptr to original request for use - during callback */ - TW_VOID (*tw_cli_callback)(struct tw_cli_req_context *req); - /* CL internal callback */ - TW_UINT32 request_id; /* request id for tracking with fw */ - struct tw_cl_link link; /* to link this request in a list */ -}; - -/* CL's internal controller context. */ -struct tw_cli_ctlr_context { - struct tw_cl_ctlr_handle *ctlr_handle; /* handle to track ctlr between - OSL & CL. */ - struct tw_cli_req_context *req_ctxt_buf;/* pointer to the array of CL's - internal request context pkts */ - struct tw_cl_command_packet *cmd_pkt_buf;/* ptr to array of cmd pkts */ - - TW_UINT64 cmd_pkt_phys; /* phys addr of cmd_pkt_buf */ - - TW_UINT32 device_id; /* controller device id */ - TW_UINT32 arch_id; /* controller architecture id */ - TW_UINT8 active; /* Initialization done, and controller is active. */ - TW_UINT8 interrupts_enabled; /* Interrupts on controller enabled. */ - TW_UINT8 internal_req_busy; /* Data buffer for internal requests in use. */ - TW_UINT8 get_more_aens; /* More AEN's need to be retrieved. */ - TW_UINT8 reset_needed; /* Controller needs a soft reset. */ - TW_UINT8 reset_in_progress; /* Controller is being reset. */ - TW_UINT8 reset_phase1_in_progress; /* In 'phase 1' of reset. */ - TW_UINT32 flags; /* controller settings */ - TW_UINT32 sg_size_factor; /* SG element size should be a - multiple of this */ - - /* Request queues and arrays. */ - struct tw_cl_link req_q_head[TW_CLI_Q_COUNT]; - - TW_UINT8 *internal_req_data;/* internal req data buf */ - TW_UINT64 internal_req_data_phys;/* phys addr of internal - req data buf */ - TW_UINT32 max_simult_reqs; /* max simultaneous requests - supported */ - TW_UINT32 max_aens_supported;/* max AEN's supported */ - /* AEN handler fields. */ - struct tw_cl_event_packet *aen_queue; /* circular queue of AENs from - firmware/CL/OSL */ - TW_UINT32 aen_head; /* AEN queue head */ - TW_UINT32 aen_tail; /* AEN queue tail */ - TW_UINT32 aen_cur_seq_id; /* index of the last event+1 */ - TW_UINT32 aen_q_overflow; /* indicates if unretrieved - events were overwritten */ - TW_UINT32 aen_q_wrapped; /* indicates if AEN queue ever - wrapped */ - - TW_UINT16 working_srl; /* driver & firmware negotiated - srl */ - TW_UINT16 working_branch; /* branch # of the firmware - that the driver is compatible with */ - TW_UINT16 working_build; /* build # of the firmware - that the driver is compatible with */ - TW_UINT16 fw_on_ctlr_srl; /* srl of running firmware */ - TW_UINT16 fw_on_ctlr_branch;/* branch # of running - firmware */ - TW_UINT16 fw_on_ctlr_build;/* build # of running - firmware */ - TW_UINT32 operating_mode; /* base mode/current mode */ - - TW_INT32 host_intr_pending;/* host intr processing - needed */ - TW_INT32 attn_intr_pending;/* attn intr processing - needed */ - TW_INT32 cmd_intr_pending;/* cmd intr processing - needed */ - TW_INT32 resp_intr_pending;/* resp intr processing - needed */ - - TW_LOCK_HANDLE gen_lock_handle;/* general purpose lock */ - TW_LOCK_HANDLE *gen_lock;/* ptr to general purpose lock */ - TW_LOCK_HANDLE io_lock_handle; /* lock held during cmd - submission */ - TW_LOCK_HANDLE *io_lock;/* ptr to lock held during cmd - submission */ - -#ifdef TW_OSL_CAN_SLEEP - TW_SLEEP_HANDLE sleep_handle; /* handle to co-ordinate sleeps - & wakeups */ -#endif /* TW_OSL_CAN_SLEEP */ - - struct { - TW_UINT32 lock; /* lock state */ - TW_TIME timeout; /* time at which the lock will - become available, even if not - explicitly released */ - } ioctl_lock; /* lock for use by user applications, for - synchronization between ioctl calls */ -#ifdef TW_OSL_DEBUG - struct tw_cli_q_stats q_stats[TW_CLI_Q_COUNT];/* queue statistics */ -#endif /* TW_OSL_DEBUG */ -}; - -/* - * Queue primitives - */ - -#ifdef TW_OSL_DEBUG - -#define TW_CLI_Q_INIT(ctlr, q_type) do { \ - (ctlr)->q_stats[q_type].cur_len = 0; \ - (ctlr)->q_stats[q_type].max_len = 0; \ -} while (0) - -#define TW_CLI_Q_INSERT(ctlr, q_type) do { \ - struct tw_cli_q_stats *q_stats = &((ctlr)->q_stats[q_type]); \ - \ - if (++(q_stats->cur_len) > q_stats->max_len) \ - q_stats->max_len = q_stats->cur_len; \ -} while (0) - -#define TW_CLI_Q_REMOVE(ctlr, q_type) \ - (ctlr)->q_stats[q_type].cur_len-- - -#else /* TW_OSL_DEBUG */ - -#define TW_CLI_Q_INIT(ctlr, q_index) -#define TW_CLI_Q_INSERT(ctlr, q_index) -#define TW_CLI_Q_REMOVE(ctlr, q_index) - -#endif /* TW_OSL_DEBUG */ - -/* Initialize a queue of requests. */ -static __inline TW_VOID -tw_cli_req_q_init(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type) -{ - TW_CL_Q_INIT(&(ctlr->req_q_head[q_type])); - TW_CLI_Q_INIT(ctlr, q_type); -} - -/* Insert the given request at the head of the given queue (q_type). */ -static __inline TW_VOID -tw_cli_req_q_insert_head(struct tw_cli_req_context *req, TW_UINT8 q_type) -{ - struct tw_cli_ctlr_context *ctlr = req->ctlr; - - tw_osl_get_lock(ctlr->ctlr_handle, ctlr->gen_lock); - TW_CL_Q_INSERT_HEAD(&(ctlr->req_q_head[q_type]), &(req->link)); - TW_CLI_Q_INSERT(ctlr, q_type); - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock); -} - -/* Insert the given request at the tail of the given queue (q_type). */ -static __inline TW_VOID -tw_cli_req_q_insert_tail(struct tw_cli_req_context *req, TW_UINT8 q_type) -{ - struct tw_cli_ctlr_context *ctlr = req->ctlr; - - tw_osl_get_lock(ctlr->ctlr_handle, ctlr->gen_lock); - TW_CL_Q_INSERT_TAIL(&(ctlr->req_q_head[q_type]), &(req->link)); - TW_CLI_Q_INSERT(ctlr, q_type); - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock); -} - -/* Remove and return the request at the head of the given queue (q_type). */ -static __inline struct tw_cli_req_context * -tw_cli_req_q_remove_head(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type) -{ - struct tw_cli_req_context *req = TW_CL_NULL; - struct tw_cl_link *link; - - tw_osl_get_lock(ctlr->ctlr_handle, ctlr->gen_lock); - if ((link = TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[q_type]))) != - TW_CL_NULL) { - req = TW_CL_STRUCT_HEAD(link, - struct tw_cli_req_context, link); - TW_CL_Q_REMOVE_ITEM(&(ctlr->req_q_head[q_type]), &(req->link)); - TW_CLI_Q_REMOVE(ctlr, q_type); - } - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock); - return(req); -} - -/* Remove the given request from the given queue (q_type). */ -static __inline TW_VOID -tw_cli_req_q_remove_item(struct tw_cli_req_context *req, TW_UINT8 q_type) -{ - struct tw_cli_ctlr_context *ctlr = req->ctlr; - - tw_osl_get_lock(ctlr->ctlr_handle, ctlr->gen_lock); - TW_CL_Q_REMOVE_ITEM(&(ctlr->req_q_head[q_type]), &(req->link)); - TW_CLI_Q_REMOVE(ctlr, q_type); - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock); -} - -/* Create an event packet for an event/error posted by the controller. */ -#define tw_cli_create_ctlr_event(ctlr, event_src, cmd_hdr) do { \ - TW_UINT8 severity = \ - GET_SEVERITY((cmd_hdr)->status_block.res__severity); \ - \ - tw_cl_create_event(ctlr->ctlr_handle, TW_CL_TRUE, event_src, \ - (cmd_hdr)->status_block.error, \ - severity, \ - tw_cli_severity_string_table[severity], \ - (cmd_hdr)->err_specific_desc + \ - tw_osl_strlen((cmd_hdr)->err_specific_desc) + 1, \ - (cmd_hdr)->err_specific_desc); \ - /* Print 18 bytes of sense information. */ \ - tw_cli_dbg_printf(2, ctlr->ctlr_handle, \ - tw_osl_cur_func(), \ - "sense info: %x %x %x %x %x %x %x %x %x " \ - "%x %x %x %x %x %x %x %x %x", \ - (cmd_hdr)->sense_data[0], (cmd_hdr)->sense_data[1], \ - (cmd_hdr)->sense_data[2], (cmd_hdr)->sense_data[3], \ - (cmd_hdr)->sense_data[4], (cmd_hdr)->sense_data[5], \ - (cmd_hdr)->sense_data[6], (cmd_hdr)->sense_data[7], \ - (cmd_hdr)->sense_data[8], (cmd_hdr)->sense_data[9], \ - (cmd_hdr)->sense_data[10], (cmd_hdr)->sense_data[11], \ - (cmd_hdr)->sense_data[12], (cmd_hdr)->sense_data[13], \ - (cmd_hdr)->sense_data[14], (cmd_hdr)->sense_data[15], \ - (cmd_hdr)->sense_data[16], (cmd_hdr)->sense_data[17]); \ -} while (0) - -#endif /* TW_CL_H */ diff --git a/sys/dev/twa/tw_cl_externs.h b/sys/dev/twa/tw_cl_externs.h deleted file mode 100644 index 30ad4a297e06..000000000000 --- a/sys/dev/twa/tw_cl_externs.h +++ /dev/null @@ -1,191 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2004-07 Applied Micro Circuits Corporation. - * Copyright (c) 2004-05 Vinod Kashyap - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * AMCC'S 3ware driver for 9000 series storage controllers. - * - * Author: Vinod Kashyap - * Modifications by: Adam Radford - */ - -#ifndef TW_CL_EXTERNS_H - -#define TW_CL_EXTERNS_H - -/* - * Data structures and functions global to the Common Layer. - */ - -extern TW_INT8 tw_cli_fw_img[]; -extern TW_INT32 tw_cli_fw_img_size; -extern TW_INT8 *tw_cli_severity_string_table[]; - -/* Do controller initialization. */ -extern TW_INT32 tw_cli_start_ctlr(struct tw_cli_ctlr_context *ctlr); - -/* Establish a logical connection with the firmware on the controller. */ -extern TW_INT32 tw_cli_init_connection(struct tw_cli_ctlr_context *ctlr, - TW_UINT16 message_credits, TW_UINT32 set_features, - TW_UINT16 current_fw_srl, TW_UINT16 current_fw_arch_id, - TW_UINT16 current_fw_branch, TW_UINT16 current_fw_build, - TW_UINT16 *fw_on_ctlr_srl, TW_UINT16 *fw_on_ctlr_arch_id, - TW_UINT16 *fw_on_ctlr_branch, TW_UINT16 *fw_on_ctlr_build, - TW_UINT32 *init_connect_result); - -/* Functions in tw_cl_io.c */ - -/* Submit a command packet to the firmware on the controller. */ -extern TW_INT32 tw_cli_submit_cmd(struct tw_cli_req_context *req); - -/* Get a firmware parameter. */ -extern TW_INT32 tw_cli_get_param(struct tw_cli_ctlr_context *ctlr, - TW_INT32 table_id, TW_INT32 parameter_id, TW_VOID *param_data, - TW_INT32 size, TW_VOID (* callback)(struct tw_cli_req_context *req)); - -/* Set a firmware parameter. */ -extern TW_INT32 tw_cli_set_param(struct tw_cli_ctlr_context *ctlr, - TW_INT32 table_id, TW_INT32 param_id, TW_INT32 param_size, - TW_VOID *data, TW_VOID (* callback)(struct tw_cli_req_context *req)); - -/* Submit a command to the firmware and poll for completion. */ -extern TW_INT32 tw_cli_submit_and_poll_request(struct tw_cli_req_context *req, - TW_UINT32 timeout); - -/* Soft reset the controller. */ -extern TW_INT32 tw_cli_soft_reset(struct tw_cli_ctlr_context *ctlr); -extern int twa_setup_intr(struct twa_softc *sc); -extern int twa_teardown_intr(struct twa_softc *sc); - -/* Send down a SCSI command to the firmware (usually, an internal Req Sense. */ -extern TW_INT32 tw_cli_send_scsi_cmd(struct tw_cli_req_context *req, - TW_INT32 cmd); - -/* Get an AEN from the firmware (by sending down a Req Sense). */ -extern TW_INT32 tw_cli_get_aen(struct tw_cli_ctlr_context *ctlr); - -/* Fill in the scatter/gather list. */ -extern TW_VOID tw_cli_fill_sg_list(struct tw_cli_ctlr_context *ctlr, - TW_VOID *sgl_src, TW_VOID *sgl_dest, TW_INT32 num_sgl_entries); - -/* Functions in tw_cl_intr.c */ - -/* Process a host interrupt. */ -extern TW_VOID tw_cli_process_host_intr(struct tw_cli_ctlr_context *ctlr); - -/* Process an attention interrupt. */ -extern TW_VOID tw_cli_process_attn_intr(struct tw_cli_ctlr_context *ctlr); - -/* Process a command interrupt. */ -extern TW_VOID tw_cli_process_cmd_intr(struct tw_cli_ctlr_context *ctlr); - -/* Process a response interrupt from the controller. */ -extern TW_INT32 tw_cli_process_resp_intr(struct tw_cli_ctlr_context *ctlr); - -/* Submit any requests in the pending queue to the firmware. */ -extern TW_INT32 tw_cli_submit_pending_queue(struct tw_cli_ctlr_context *ctlr); - -/* Process all requests in the complete queue. */ -extern TW_VOID tw_cli_process_complete_queue(struct tw_cli_ctlr_context *ctlr); - -/* CL internal callback for SCSI/fw passthru requests. */ -extern TW_VOID tw_cli_complete_io(struct tw_cli_req_context *req); - -/* Completion routine for SCSI requests. */ -extern TW_VOID tw_cli_scsi_complete(struct tw_cli_req_context *req); - -/* Callback for get/set param requests. */ -extern TW_VOID tw_cli_param_callback(struct tw_cli_req_context *req); - -/* Callback for Req Sense commands to get AEN's. */ -extern TW_VOID tw_cli_aen_callback(struct tw_cli_req_context *req); - -/* Decide what to do with a retrieved AEN. */ -extern TW_UINT16 tw_cli_manage_aen(struct tw_cli_ctlr_context *ctlr, - struct tw_cli_req_context *req); - -/* Enable controller interrupts. */ -extern TW_VOID - tw_cli_enable_interrupts(struct tw_cli_ctlr_context *ctlr_handle); - -/* Disable controller interrupts. */ -extern TW_VOID - tw_cli_disable_interrupts(struct tw_cli_ctlr_context *ctlr_handle); - -/* Functions in tw_cl_misc.c */ - -/* Print if dbg_level is appropriate (by calling OS Layer). */ -extern TW_VOID tw_cli_dbg_printf(TW_UINT8 dbg_level, - struct tw_cl_ctlr_handle *ctlr_handle, const TW_INT8 *cur_func, - TW_INT8 *fmt, ...); - -/* Describe meaning of each set bit in the given register. */ -extern TW_INT8 *tw_cli_describe_bits(TW_UINT32 reg, TW_INT8 *str); - -/* Complete all requests in the complete queue with a RESET status. */ -extern TW_VOID tw_cli_drain_complete_queue(struct tw_cli_ctlr_context *ctlr); - -/* Complete all requests in the busy queue with a RESET status. */ -extern TW_VOID tw_cli_drain_busy_queue(struct tw_cli_ctlr_context *ctlr); - -/* Complete all requests in the pending queue with a RESET status. */ -extern TW_VOID tw_cli_drain_pending_queue(struct tw_cli_ctlr_context *ctlr); - -/* Drain the controller response queue. */ -extern TW_INT32 tw_cli_drain_response_queue(struct tw_cli_ctlr_context *ctlr); - -/* Find a particular response in the controller response queue. */ -extern TW_INT32 tw_cli_find_response(struct tw_cli_ctlr_context *ctlr, - TW_INT32 req_id); - -/* Drain the controller AEN queue. */ -extern TW_INT32 tw_cli_drain_aen_queue(struct tw_cli_ctlr_context *ctlr); - -/* Determine if a given AEN has been posted by the firmware. */ -extern TW_INT32 tw_cli_find_aen(struct tw_cli_ctlr_context *ctlr, - TW_UINT16 aen_code); - -/* Poll for a given status to show up in the firmware status register. */ -extern TW_INT32 tw_cli_poll_status(struct tw_cli_ctlr_context *ctlr, - TW_UINT32 status, TW_UINT32 timeout); - -/* Get a free CL internal request context packet. */ -extern struct tw_cli_req_context * - tw_cli_get_request(struct tw_cli_ctlr_context *ctlr - ); - -/* Notify OSL of controller info (fw/BIOS versions, etc.). */ -extern TW_VOID tw_cli_notify_ctlr_info(struct tw_cli_ctlr_context *ctlr); - -/* Make sure that the firmware status register reports a proper status. */ -extern TW_INT32 tw_cli_check_ctlr_state(struct tw_cli_ctlr_context *ctlr, - TW_UINT32 status_reg); - -#endif /* TW_CL_EXTERNS_H */ diff --git a/sys/dev/twa/tw_cl_fwif.h b/sys/dev/twa/tw_cl_fwif.h deleted file mode 100644 index cade2249d820..000000000000 --- a/sys/dev/twa/tw_cl_fwif.h +++ /dev/null @@ -1,418 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2004-07 Applied Micro Circuits Corporation. - * Copyright (c) 2004-05 Vinod Kashyap - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * AMCC'S 3ware driver for 9000 series storage controllers. - * - * Author: Vinod Kashyap - * Modifications by: Adam Radford - */ - -#ifndef TW_CL_FWIF_H - -#define TW_CL_FWIF_H - -/* - * Macros and data structures for interfacing with the firmware. - */ - -/* Register offsets from base address. */ -#define TWA_CONTROL_REGISTER_OFFSET 0x0 -#define TWA_STATUS_REGISTER_OFFSET 0x4 -#define TWA_COMMAND_QUEUE_OFFSET 0x8 -#define TWA_RESPONSE_QUEUE_OFFSET 0xC -#define TWA_COMMAND_QUEUE_OFFSET_LOW 0x20 -#define TWA_COMMAND_QUEUE_OFFSET_HIGH 0x24 -#define TWA_LARGE_RESPONSE_QUEUE_OFFSET 0x30 - -/* Control register bit definitions. */ -#define TWA_CONTROL_ISSUE_HOST_INTERRUPT 0x00000020 -#define TWA_CONTROL_DISABLE_INTERRUPTS 0x00000040 -#define TWA_CONTROL_ENABLE_INTERRUPTS 0x00000080 -#define TWA_CONTROL_ISSUE_SOFT_RESET 0x00000100 -#define TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT 0x00004000 -#define TWA_CONTROL_UNMASK_COMMAND_INTERRUPT 0x00008000 -#define TWA_CONTROL_MASK_RESPONSE_INTERRUPT 0x00010000 -#define TWA_CONTROL_MASK_COMMAND_INTERRUPT 0x00020000 -#define TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT 0x00040000 -#define TWA_CONTROL_CLEAR_HOST_INTERRUPT 0x00080000 -#define TWA_CONTROL_CLEAR_PCI_ABORT 0x00100000 -#define TWA_CONTROL_CLEAR_QUEUE_ERROR 0x00400000 -#define TWA_CONTROL_CLEAR_PARITY_ERROR 0x00800000 - -/* Status register bit definitions. */ -#define TWA_STATUS_ROM_BIOS_IN_SBUF 0x00000002 -#define TWA_STATUS_COMMAND_QUEUE_EMPTY 0x00001000 -#define TWA_STATUS_MICROCONTROLLER_READY 0x00002000 -#define TWA_STATUS_RESPONSE_QUEUE_EMPTY 0x00004000 -#define TWA_STATUS_COMMAND_QUEUE_FULL 0x00008000 -#define TWA_STATUS_RESPONSE_INTERRUPT 0x00010000 -#define TWA_STATUS_COMMAND_INTERRUPT 0x00020000 -#define TWA_STATUS_ATTENTION_INTERRUPT 0x00040000 -#define TWA_STATUS_HOST_INTERRUPT 0x00080000 -#define TWA_STATUS_PCI_ABORT_INTERRUPT 0x00100000 -#define TWA_STATUS_MICROCONTROLLER_ERROR 0x00200000 -#define TWA_STATUS_QUEUE_ERROR_INTERRUPT 0x00400000 -#define TWA_STATUS_PCI_PARITY_ERROR_INTERRUPT 0x00800000 -#define TWA_STATUS_MINOR_VERSION_MASK 0x0F000000 -#define TWA_STATUS_MAJOR_VERSION_MASK 0xF0000000 - -#define TWA_STATUS_UNEXPECTED_BITS 0x00D00000 - -/* PCI related defines. */ -#define TWA_IO_CONFIG_REG 0x10 - -#define TWA_PCI_CONFIG_CLEAR_PARITY_ERROR 0xc100 -#define TWA_PCI_CONFIG_CLEAR_PCI_ABORT 0x2000 - -#define TWA_RESET_PHASE1_NOTIFICATION_RESPONSE 0xFFFF -#define TWA_RESET_PHASE1_WAIT_TIME_MS 500 - -/* Command packet opcodes. */ -#define TWA_FW_CMD_NOP 0x00 -#define TWA_FW_CMD_INIT_CONNECTION 0x01 -#define TWA_FW_CMD_READ 0x02 -#define TWA_FW_CMD_WRITE 0x03 -#define TWA_FW_CMD_READVERIFY 0x04 -#define TWA_FW_CMD_VERIFY 0x05 -#define TWA_FW_CMD_ZEROUNIT 0x08 -#define TWA_FW_CMD_REPLACEUNIT 0x09 -#define TWA_FW_CMD_HOTSWAP 0x0A -#define TWA_FW_CMD_SELFTESTS 0x0B -#define TWA_FW_CMD_SYNC_PARAM 0x0C -#define TWA_FW_CMD_REORDER_UNITS 0x0D - -#define TWA_FW_CMD_EXECUTE_SCSI 0x10 -#define TWA_FW_CMD_ATA_PASSTHROUGH 0x11 -#define TWA_FW_CMD_GET_PARAM 0x12 -#define TWA_FW_CMD_SET_PARAM 0x13 -#define TWA_FW_CMD_CREATEUNIT 0x14 -#define TWA_FW_CMD_DELETEUNIT 0x15 -#define TWA_FW_CMD_DOWNLOAD_FIRMWARE 0x16 -#define TWA_FW_CMD_REBUILDUNIT 0x17 -#define TWA_FW_CMD_POWER_MANAGEMENT 0x18 - -#define TWA_FW_CMD_REMOTE_PRINT 0x1B -#define TWA_FW_CMD_HARD_RESET_FIRMWARE 0x1C -#define TWA_FW_CMD_DEBUG 0x1D - -#define TWA_FW_CMD_DIAGNOSTICS 0x1F - -/* Misc defines. */ -#define TWA_SHUTDOWN_MESSAGE_CREDITS 0x001 -#define TWA_64BIT_SG_ADDRESSES 0x00000001 -#define TWA_EXTENDED_INIT_CONNECT 0x00000002 -#define TWA_BASE_MODE 1 -#define TWA_BASE_FW_SRL 24 -#define TWA_BASE_FW_BRANCH 0 -#define TWA_BASE_FW_BUILD 1 -#define TWA_CURRENT_FW_SRL 41 -#define TWA_CURRENT_FW_BRANCH_9K 4 -#define TWA_CURRENT_FW_BUILD_9K 8 -#define TWA_CURRENT_FW_BRANCH_9K_X 8 -#define TWA_CURRENT_FW_BUILD_9K_X 4 -#define TWA_MULTI_LUN_FW_SRL 28 -#define TWA_ARCH_ID_9K 0x5 /* 9000 PCI controllers */ -#define TWA_ARCH_ID_9K_X 0x6 /* 9000 PCI-X controllers */ -#define TWA_CTLR_FW_SAME_OR_NEWER 0x00000001 -#define TWA_CTLR_FW_COMPATIBLE 0x00000002 -#define TWA_SENSE_DATA_LENGTH 18 - -#define TWA_ARCH_ID(device_id) \ - (((device_id) == TW_CL_DEVICE_ID_9K) ? TWA_ARCH_ID_9K : \ - TWA_ARCH_ID_9K_X) -#define TWA_CURRENT_FW_BRANCH(arch_id) \ - (((arch_id) == TWA_ARCH_ID_9K) ? TWA_CURRENT_FW_BRANCH_9K : \ - TWA_CURRENT_FW_BRANCH_9K_X) -#define TWA_CURRENT_FW_BUILD(arch_id) \ - (((arch_id) == TWA_ARCH_ID_9K) ? TWA_CURRENT_FW_BUILD_9K : \ - TWA_CURRENT_FW_BUILD_9K_X) - -/* - * All SG addresses and DMA'able memory allocated by the OSL should be - * TWA_ALIGNMENT bytes aligned, and have a size that is a multiple of - * TWA_SG_ELEMENT_SIZE_FACTOR. - */ -#define TWA_ALIGNMENT(device_id) 0x4 -#define TWA_SG_ELEMENT_SIZE_FACTOR(device_id) \ - (((device_id) == TW_CL_DEVICE_ID_9K) ? 512 : 4) - -/* - * Some errors of interest (in cmd_hdr->status_block.error) when a command - * is completed by the firmware with a bad status. - */ -#define TWA_ERROR_LOGICAL_UNIT_NOT_SUPPORTED 0x010a -#define TWA_ERROR_UNIT_OFFLINE 0x0128 -#define TWA_ERROR_MORE_DATA 0x0231 - -/* AEN codes of interest. */ -#define TWA_AEN_QUEUE_EMPTY 0x00 -#define TWA_AEN_SOFT_RESET 0x01 -#define TWA_AEN_SYNC_TIME_WITH_HOST 0x31 *** 8284 LINES SKIPPED ***