aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-06-17 19:42:23 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-06-17 19:42:23 -0400
commit3237ee78fc00f786d5f5aec6f9310b0e39069f15 (patch)
tree4c94e70ab846ffcb8bb5715fb3c8d8473358a323 /drivers/message
parent9ee1c939d1cb936b1f98e8d81aeffab57bae46ab (diff)
parentdf0ae2497ddefd72a87f3a3b34ff32455d7d4ae0 (diff)
merge by hand (fix up qla_os.c merge error)
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/Kconfig56
-rw-r--r--drivers/message/fusion/Makefile44
-rw-r--r--drivers/message/fusion/lsi/mpi.h70
-rw-r--r--drivers/message/fusion/lsi/mpi_cnfg.h1007
-rw-r--r--drivers/message/fusion/lsi/mpi_fc.h7
-rw-r--r--drivers/message/fusion/lsi/mpi_history.txt451
-rw-r--r--drivers/message/fusion/lsi/mpi_inb.h7
-rw-r--r--drivers/message/fusion/lsi/mpi_init.h88
-rw-r--r--drivers/message/fusion/lsi/mpi_ioc.h246
-rw-r--r--drivers/message/fusion/lsi/mpi_lan.h6
-rw-r--r--drivers/message/fusion/lsi/mpi_raid.h17
-rw-r--r--drivers/message/fusion/lsi/mpi_sas.h171
-rw-r--r--drivers/message/fusion/lsi/mpi_targ.h160
-rw-r--r--drivers/message/fusion/lsi/mpi_tool.h57
-rw-r--r--drivers/message/fusion/lsi/mpi_type.h11
-rw-r--r--drivers/message/fusion/mptbase.c343
-rw-r--r--drivers/message/fusion/mptbase.h52
-rw-r--r--drivers/message/fusion/mptctl.c68
-rw-r--r--drivers/message/fusion/mptctl.h15
-rw-r--r--drivers/message/fusion/mptfc.c431
-rw-r--r--drivers/message/fusion/mptlan.c37
-rw-r--r--drivers/message/fusion/mptlan.h48
-rw-r--r--drivers/message/fusion/mptscsih.c793
-rw-r--r--drivers/message/fusion/mptscsih.h43
-rw-r--r--drivers/message/fusion/mptspi.c486
25 files changed, 3294 insertions, 1420 deletions
diff --git a/drivers/message/fusion/Kconfig b/drivers/message/fusion/Kconfig
index 452418b24d7b..33f209a39cb6 100644
--- a/drivers/message/fusion/Kconfig
+++ b/drivers/message/fusion/Kconfig
@@ -2,34 +2,54 @@
2menu "Fusion MPT device support" 2menu "Fusion MPT device support"
3 3
4config FUSION 4config FUSION
5 tristate "Fusion MPT (base + ScsiHost) drivers" 5 bool
6 default n
7
8config FUSION_SPI
9 tristate "Fusion MPT ScsiHost drivers for SPI"
10 depends on PCI && SCSI
11 select FUSION
12 ---help---
13 SCSI HOST support for a parallel SCSI host adapters.
14
15 List of supported controllers:
16
17 LSI53C1020
18 LSI53C1020A
19 LSI53C1030
20 LSI53C1035
21
22config FUSION_FC
23 tristate "Fusion MPT ScsiHost drivers for FC"
6 depends on PCI && SCSI 24 depends on PCI && SCSI
25 select FUSION
7 ---help--- 26 ---help---
8 LSI Logic Fusion(TM) Message Passing Technology (MPT) device support 27 SCSI HOST support for a Fiber Channel host adapters.
9 provides high performance SCSI host initiator, and LAN [1] interface
10 services to a host system. The Fusion architecture is capable of
11 duplexing these protocols on high-speed Fibre Channel
12 (up to 2 GHz x 2 ports = 4 GHz) and parallel SCSI (up to Ultra-320)
13 physical medium.
14 28
15 [1] LAN is not supported on parallel SCSI medium. 29 List of supported controllers:
30
31 LSIFC909
32 LSIFC919
33 LSIFC919X
34 LSIFC929
35 LSIFC929X
36 LSIFC929XL
16 37
17config FUSION_MAX_SGE 38config FUSION_MAX_SGE
18 int "Maximum number of scatter gather entries" 39 int "Maximum number of scatter gather entries (16 - 128)"
19 depends on FUSION 40 depends on FUSION
20 default "40" 41 default "128"
42 range 16 128
21 help 43 help
22 This option allows you to specify the maximum number of scatter- 44 This option allows you to specify the maximum number of scatter-
23 gather entries per I/O. The driver defaults to 40, a reasonable number 45 gather entries per I/O. The driver default is 128, which matches
24 for most systems. However, the user may increase this up to 128. 46 SCSI_MAX_PHYS_SEGMENTS. However, it may decreased down to 16.
25 Increasing this parameter will require significantly more memory 47 Decreasing this parameter will reduce memory requirements
26 on a per controller instance. Increasing the parameter is not 48 on a per controller instance.
27 necessary (or recommended) unless the user will be running
28 large I/O's via the raw interface.
29 49
30config FUSION_CTL 50config FUSION_CTL
31 tristate "Fusion MPT misc device (ioctl) driver" 51 tristate "Fusion MPT misc device (ioctl) driver"
32 depends on FUSION 52 depends on FUSION_SPI || FUSION_FC
33 ---help--- 53 ---help---
34 The Fusion MPT misc device driver provides specialized control 54 The Fusion MPT misc device driver provides specialized control
35 of MPT adapters via system ioctl calls. Use of ioctl calls to 55 of MPT adapters via system ioctl calls. Use of ioctl calls to
@@ -48,7 +68,7 @@ config FUSION_CTL
48 68
49config FUSION_LAN 69config FUSION_LAN
50 tristate "Fusion MPT LAN driver" 70 tristate "Fusion MPT LAN driver"
51 depends on FUSION && NET_FC 71 depends on FUSION_FC && NET_FC
52 ---help--- 72 ---help---
53 This module supports LAN IP traffic over Fibre Channel port(s) 73 This module supports LAN IP traffic over Fibre Channel port(s)
54 on Fusion MPT compatible hardware (LSIFC9xx chips). 74 on Fusion MPT compatible hardware (LSIFC9xx chips).
diff --git a/drivers/message/fusion/Makefile b/drivers/message/fusion/Makefile
index f6fdcaaefc89..1d2f9db813c1 100644
--- a/drivers/message/fusion/Makefile
+++ b/drivers/message/fusion/Makefile
@@ -1,52 +1,38 @@
1#
2# Makefile for the LSI Logic Fusion MPT (Message Passing Technology) drivers.
3#
4# Note! If you want to turn on various debug defines for an extended period of
5# time but don't want them lingering around in the Makefile when you pass it on
6# to someone else, use the MPT_CFLAGS env variable (thanks Steve). -nromer
7
8#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-{ LSI_LOGIC
9
10# Architecture-specific...
11# # intel
12#EXTRA_CFLAGS += -g
13# # sparc64
14#EXTRA_CFLAGS += -gstabs+
15
16EXTRA_CFLAGS += ${MPT_CFLAGS}
17
18# Fusion MPT drivers; recognized debug defines... 1# Fusion MPT drivers; recognized debug defines...
19# MPT general: 2# MPT general:
20#EXTRA_CFLAGS += -DMPT_DEBUG_SCSI
21#EXTRA_CFLAGS += -DMPT_DEBUG 3#EXTRA_CFLAGS += -DMPT_DEBUG
22#EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME 4#EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME
23#EXTRA_CFLAGS += -DMPT_DEBUG_SG 5#EXTRA_CFLAGS += -DMPT_DEBUG_SG
6#EXTRA_CFLAGS += -DMPT_DEBUG_EVENTS
7#EXTRA_CFLAGS += -DMPT_DEBUG_INIT
8#EXTRA_CFLAGS += -DMPT_DEBUG_EXIT
9#EXTRA_CFLAGS += -DMPT_DEBUG_FAIL
10
24 11
25# 12#
26# driver/module specifics... 13# driver/module specifics...
27# 14#
28# For mptbase: 15# For mptbase:
29#CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE 16#CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE
17#CFLAGS_mptbase.o += -DMPT_DEBUG_CONFIG
18#CFLAGS_mptbase.o += -DMPT_DEBUG_DL
30#CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ 19#CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ
20#CFLAGS_mptbase.o += -DMPT_DEBUG_RESET
31# 21#
32# For mptscsih: 22# For mptscsih:
33#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCANDV 23#CFLAGS_mptscsih.o += -DMPT_DEBUG_DV
34#CFLAGS_mptscsih.o += -DMPT_DEBUG_RESET 24#CFLAGS_mptscsih.o += -DMPT_DEBUG_NEGO
35#CFLAGS_mptscsih.o += -DMPT_DEBUG_NEH 25#CFLAGS_mptscsih.o += -DMPT_DEBUG_TM
26#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCSI
27#CFLAGS_mptscsih.o += -DMPT_DEBUG_REPLY
36# 28#
37# For mptctl: 29# For mptctl:
38#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL 30#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL
39# 31#
40# For mptlan:
41#CFLAGS_mptlan.o += -DMPT_LAN_IO_DEBUG
42#
43# For isense:
44
45# EXP...
46##mptscsih-objs := scsihost.o scsiherr.o
47 32
48#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC 33#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
49 34
50obj-$(CONFIG_FUSION) += mptbase.o mptscsih.o 35obj-$(CONFIG_FUSION_SPI) += mptbase.o mptscsih.o mptspi.o
36obj-$(CONFIG_FUSION_FC) += mptbase.o mptscsih.o mptfc.o
51obj-$(CONFIG_FUSION_CTL) += mptctl.o 37obj-$(CONFIG_FUSION_CTL) += mptctl.o
52obj-$(CONFIG_FUSION_LAN) += mptlan.o 38obj-$(CONFIG_FUSION_LAN) += mptlan.o
diff --git a/drivers/message/fusion/lsi/mpi.h b/drivers/message/fusion/lsi/mpi.h
index 9dbb061265fe..9f98334e5076 100644
--- a/drivers/message/fusion/lsi/mpi.h
+++ b/drivers/message/fusion/lsi/mpi.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi.h 5 * Name: mpi.h
6 * Title: MPI Message independent structures and definitions 6 * Title: MPI Message independent structures and definitions
7 * Creation Date: July 27, 2000 7 * Creation Date: July 27, 2000
8 * 8 *
9 * mpi.h Version: 01.05.xx 9 * mpi.h Version: 01.05.07
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -52,6 +52,25 @@
52 * obsoleted define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX. 52 * obsoleted define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX.
53 * 04-01-03 01.02.09 New IOCStatus code: MPI_IOCSTATUS_FC_EXCHANGE_CANCELED 53 * 04-01-03 01.02.09 New IOCStatus code: MPI_IOCSTATUS_FC_EXCHANGE_CANCELED
54 * 06-26-03 01.02.10 Bumped MPI_HEADER_VERSION_UNIT value. 54 * 06-26-03 01.02.10 Bumped MPI_HEADER_VERSION_UNIT value.
55 * 01-16-04 01.02.11 Added define for MPI_IOCLOGINFO_TYPE_SHIFT.
56 * 04-29-04 01.02.12 Added function codes for MPI_FUNCTION_DIAG_BUFFER_POST
57 * and MPI_FUNCTION_DIAG_RELEASE.
58 * Added MPI_IOCSTATUS_DIAGNOSTIC_RELEASED define.
59 * Bumped MPI_HEADER_VERSION_UNIT value.
60 * 05-11-04 01.03.01 Bumped MPI_VERSION_MINOR for MPI v1.3.
61 * Added codes for Inband.
62 * 08-19-04 01.05.01 Added defines for Host Buffer Access Control doorbell.
63 * Added define for offset of High Priority Request Queue.
64 * Added new function codes and new IOCStatus codes.
65 * Added a IOCLogInfo type of SAS.
66 * 12-07-04 01.05.02 Bumped MPI_HEADER_VERSION_UNIT.
67 * 12-09-04 01.05.03 Bumped MPI_HEADER_VERSION_UNIT.
68 * 01-15-05 01.05.04 Bumped MPI_HEADER_VERSION_UNIT.
69 * 02-09-05 01.05.05 Bumped MPI_HEADER_VERSION_UNIT.
70 * 02-22-05 01.05.06 Bumped MPI_HEADER_VERSION_UNIT.
71 * 03-11-05 01.05.07 Removed function codes for SCSI IO 32 and
72 * TargetAssistExtended requests.
73 * Removed EEDP IOCStatus codes.
55 * -------------------------------------------------------------------------- 74 * --------------------------------------------------------------------------
56 */ 75 */
57 76
@@ -82,7 +101,7 @@
82/* Note: The major versions of 0xe0 through 0xff are reserved */ 101/* Note: The major versions of 0xe0 through 0xff are reserved */
83 102
84/* versioning for this MPI header set */ 103/* versioning for this MPI header set */
85#define MPI_HEADER_VERSION_UNIT (0x00) 104#define MPI_HEADER_VERSION_UNIT (0x09)
86#define MPI_HEADER_VERSION_DEV (0x00) 105#define MPI_HEADER_VERSION_DEV (0x00)
87#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) 106#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
88#define MPI_HEADER_VERSION_UNIT_SHIFT (8) 107#define MPI_HEADER_VERSION_UNIT_SHIFT (8)
@@ -122,7 +141,11 @@
122* 141*
123*****************************************************************************/ 142*****************************************************************************/
124 143
125/* S y s t e m D o o r b e l l */ 144/*
145 * Defines for working with the System Doorbell register.
146 * Values for doorbell function codes are included in the section that defines
147 * all the function codes (further on in this file).
148 */
126#define MPI_DOORBELL_OFFSET (0x00000000) 149#define MPI_DOORBELL_OFFSET (0x00000000)
127#define MPI_DOORBELL_ACTIVE (0x08000000) /* DoorbellUsed */ 150#define MPI_DOORBELL_ACTIVE (0x08000000) /* DoorbellUsed */
128#define MPI_DOORBELL_USED (MPI_DOORBELL_ACTIVE) 151#define MPI_DOORBELL_USED (MPI_DOORBELL_ACTIVE)
@@ -134,6 +157,13 @@
134#define MPI_DOORBELL_ADD_DWORDS_MASK (0x00FF0000) 157#define MPI_DOORBELL_ADD_DWORDS_MASK (0x00FF0000)
135#define MPI_DOORBELL_ADD_DWORDS_SHIFT (16) 158#define MPI_DOORBELL_ADD_DWORDS_SHIFT (16)
136#define MPI_DOORBELL_DATA_MASK (0x0000FFFF) 159#define MPI_DOORBELL_DATA_MASK (0x0000FFFF)
160#define MPI_DOORBELL_FUNCTION_SPECIFIC_MASK (0x0000FFFF)
161
162/* values for Host Buffer Access Control doorbell function */
163#define MPI_DB_HPBAC_VALUE_MASK (0x0000F000)
164#define MPI_DB_HPBAC_ENABLE_ACCESS (0x01)
165#define MPI_DB_HPBAC_DISABLE_ACCESS (0x02)
166#define MPI_DB_HPBAC_FREE_BUFFER (0x03)
137 167
138 168
139#define MPI_WRITE_SEQUENCE_OFFSET (0x00000004) 169#define MPI_WRITE_SEQUENCE_OFFSET (0x00000004)
@@ -257,16 +287,18 @@
257 287
258#define MPI_FUNCTION_SMP_PASSTHROUGH (0x1A) 288#define MPI_FUNCTION_SMP_PASSTHROUGH (0x1A)
259#define MPI_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) 289#define MPI_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B)
290#define MPI_FUNCTION_SATA_PASSTHROUGH (0x1C)
260 291
261#define MPI_DIAG_BUFFER_POST (0x1D) 292#define MPI_FUNCTION_DIAG_BUFFER_POST (0x1D)
262#define MPI_DIAG_RELEASE (0x1E) 293#define MPI_FUNCTION_DIAG_RELEASE (0x1E)
263
264#define MPI_FUNCTION_SCSI_IO_32 (0x1F)
265 294
266#define MPI_FUNCTION_LAN_SEND (0x20) 295#define MPI_FUNCTION_LAN_SEND (0x20)
267#define MPI_FUNCTION_LAN_RECEIVE (0x21) 296#define MPI_FUNCTION_LAN_RECEIVE (0x21)
268#define MPI_FUNCTION_LAN_RESET (0x22) 297#define MPI_FUNCTION_LAN_RESET (0x22)
269 298
299#define MPI_FUNCTION_TARGET_CMD_BUF_BASE_POST (0x24)
300#define MPI_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25)
301
270#define MPI_FUNCTION_INBAND_BUFFER_POST (0x28) 302#define MPI_FUNCTION_INBAND_BUFFER_POST (0x28)
271#define MPI_FUNCTION_INBAND_SEND (0x29) 303#define MPI_FUNCTION_INBAND_SEND (0x29)
272#define MPI_FUNCTION_INBAND_RSP (0x2A) 304#define MPI_FUNCTION_INBAND_RSP (0x2A)
@@ -276,6 +308,7 @@
276#define MPI_FUNCTION_IO_UNIT_RESET (0x41) 308#define MPI_FUNCTION_IO_UNIT_RESET (0x41)
277#define MPI_FUNCTION_HANDSHAKE (0x42) 309#define MPI_FUNCTION_HANDSHAKE (0x42)
278#define MPI_FUNCTION_REPLY_FRAME_REMOVAL (0x43) 310#define MPI_FUNCTION_REPLY_FRAME_REMOVAL (0x43)
311#define MPI_FUNCTION_HOST_PAGEBUF_ACCESS_CONTROL (0x44)
279 312
280 313
281/* standard version format */ 314/* standard version format */
@@ -328,8 +361,8 @@ typedef struct _SGE_SIMPLE_UNION
328 U32 Address32; 361 U32 Address32;
329 U64 Address64; 362 U64 Address64;
330 }u; 363 }u;
331} SGESimpleUnion_t, MPI_POINTER pSGESimpleUnion_t, 364} SGE_SIMPLE_UNION, MPI_POINTER PTR_SGE_SIMPLE_UNION,
332 SGE_SIMPLE_UNION, MPI_POINTER PTR_SGE_SIMPLE_UNION; 365 SGESimpleUnion_t, MPI_POINTER pSGESimpleUnion_t;
333 366
334/****************************************************************************/ 367/****************************************************************************/
335/* Chain element structures */ 368/* Chain element structures */
@@ -648,27 +681,21 @@ typedef struct _MSG_DEFAULT_REPLY
648#define MPI_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C) 681#define MPI_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C)
649 682
650/****************************************************************************/ 683/****************************************************************************/
651/* For use by SCSI Initiator and SCSI Target end-to-end data protection */ 684/* SCSI Target values */
652/****************************************************************************/
653
654#define MPI_IOCSTATUS_EEDP_CRC_ERROR (0x004D)
655#define MPI_IOCSTATUS_EEDP_LBA_TAG_ERROR (0x004E)
656#define MPI_IOCSTATUS_EEDP_APP_TAG_ERROR (0x004F)
657
658
659/****************************************************************************/
660/* SCSI (SPI & FCP) target values */
661/****************************************************************************/ 685/****************************************************************************/
662 686
663#define MPI_IOCSTATUS_TARGET_PRIORITY_IO (0x0060) 687#define MPI_IOCSTATUS_TARGET_PRIORITY_IO (0x0060)
664#define MPI_IOCSTATUS_TARGET_INVALID_PORT (0x0061) 688#define MPI_IOCSTATUS_TARGET_INVALID_PORT (0x0061)
665#define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX (0x0062) /* obsolete */ 689#define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX (0x0062) /* obsolete name */
666#define MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX (0x0062) 690#define MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX (0x0062)
667#define MPI_IOCSTATUS_TARGET_ABORTED (0x0063) 691#define MPI_IOCSTATUS_TARGET_ABORTED (0x0063)
668#define MPI_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064) 692#define MPI_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064)
669#define MPI_IOCSTATUS_TARGET_NO_CONNECTION (0x0065) 693#define MPI_IOCSTATUS_TARGET_NO_CONNECTION (0x0065)
670#define MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006A) 694#define MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006A)
671#define MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT (0x006B) 695#define MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT (0x006B)
696#define MPI_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006D)
697#define MPI_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006E)
698#define MPI_IOCSTATUS_TARGET_IU_TOO_SHORT (0x006F)
672 699
673/****************************************************************************/ 700/****************************************************************************/
674/* Additional FCP target values (obsolete) */ 701/* Additional FCP target values (obsolete) */
@@ -707,6 +734,7 @@ typedef struct _MSG_DEFAULT_REPLY
707/****************************************************************************/ 734/****************************************************************************/
708 735
709#define MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090) 736#define MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090)
737#define MPI_IOCSTATUS_SAS_SMP_DATA_OVERRUN (0x0091)
710 738
711/****************************************************************************/ 739/****************************************************************************/
712/* Inband values */ 740/* Inband values */
diff --git a/drivers/message/fusion/lsi/mpi_cnfg.h b/drivers/message/fusion/lsi/mpi_cnfg.h
index a5680d864bf0..15b12b06799d 100644
--- a/drivers/message/fusion/lsi/mpi_cnfg.h
+++ b/drivers/message/fusion/lsi/mpi_cnfg.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_cnfg.h 5 * Name: mpi_cnfg.h
6 * Title: MPI Config message, structures, and Pages 6 * Title: MPI Config message, structures, and Pages
7 * Creation Date: July 27, 2000 7 * Creation Date: July 27, 2000
8 * 8 *
9 * mpi_cnfg.h Version: 01.05.xx 9 * mpi_cnfg.h Version: 01.05.08
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -145,6 +145,93 @@
145 * In CONFIG_PAGE_FC_DEVICE_0, replaced Reserved1 field 145 * In CONFIG_PAGE_FC_DEVICE_0, replaced Reserved1 field
146 * with ADISCHardALPA. 146 * with ADISCHardALPA.
147 * Added MPI_FC_DEVICE_PAGE0_PROT_FCP_RETRY define. 147 * Added MPI_FC_DEVICE_PAGE0_PROT_FCP_RETRY define.
148 * 01-16-04 01.02.13 Added InitiatorDeviceTimeout and InitiatorIoPendTimeout
149 * fields and related defines to CONFIG_PAGE_FC_PORT_1.
150 * Added define for
151 * MPI_FCPORTPAGE1_FLAGS_SOFT_ALPA_FALLBACK.
152 * Added new fields to the substructures of
153 * CONFIG_PAGE_FC_PORT_10.
154 * 04-29-04 01.02.14 Added define for IDP bit for CONFIG_PAGE_SCSI_PORT_0,
155 * CONFIG_PAGE_SCSI_DEVICE_0, and
156 * CONFIG_PAGE_SCSI_DEVICE_1. Also bumped Page Version for
157 * these pages.
158 * 05-11-04 01.03.01 Added structure for CONFIG_PAGE_INBAND_0.
159 * 08-19-04 01.05.01 Modified MSG_CONFIG request to support extended config
160 * pages.
161 * Added a new structure for extended config page header.
162 * Added new extended config pages types and structures for
163 * SAS IO Unit, SAS Expander, SAS Device, and SAS PHY.
164 * Replaced a reserved byte in CONFIG_PAGE_MANUFACTURING_4
165 * to add a Flags field.
166 * Two new Manufacturing config pages (5 and 6).
167 * Two new bits defined for IO Unit Page 1 Flags field.
168 * Modified CONFIG_PAGE_IO_UNIT_2 to add three new fields
169 * to specify the BIOS boot device.
170 * Four new Flags bits defined for IO Unit Page 2.
171 * Added IO Unit Page 4.
172 * Added EEDP Flags settings to IOC Page 1.
173 * Added new BIOS Page 1 config page.
174 * 10-05-04 01.05.02 Added define for
175 * MPI_IOCPAGE1_INITIATOR_CONTEXT_REPLY_DISABLE.
176 * Added new Flags field to CONFIG_PAGE_MANUFACTURING_5 and
177 * associated defines.
178 * Added more defines for SAS IO Unit Page 0
179 * DiscoveryStatus field.
180 * Added define for MPI_SAS_IOUNIT0_DS_SUBTRACTIVE_LINK
181 * and MPI_SAS_IOUNIT0_DS_TABLE_LINK.
182 * Added defines for Physical Mapping Modes to SAS IO Unit
183 * Page 2.
184 * Added define for
185 * MPI_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH.
186 * 10-27-04 01.05.03 Added defines for new SAS PHY page addressing mode.
187 * Added defines for MaxTargetSpinUp to BIOS Page 1.
188 * Added 5 new ControlFlags defines for SAS IO Unit
189 * Page 1.
190 * Added MaxNumPhysicalMappedIDs field to SAS IO Unit
191 * Page 2.
192 * Added AccessStatus field to SAS Device Page 0 and added
193 * new Flags bits for supported SATA features.
194 * 12-07-04 01.05.04 Added config page structures for BIOS Page 2, RAID
195 * Volume Page 1, and RAID Physical Disk Page 1.
196 * Replaced IO Unit Page 1 BootTargetID,BootBus, and
197 * BootAdapterNum with reserved field.
198 * Added DataScrubRate and ResyncRate to RAID Volume
199 * Page 0.
200 * Added MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT
201 * define.
202 * 12-09-04 01.05.05 Added Target Mode Large CDB Enable to FC Port Page 1
203 * Flags field.
204 * Added Auto Port Config flag define for SAS IOUNIT
205 * Page 1 ControlFlags.
206 * Added Disabled bad Phy define to Expander Page 1
207 * Discovery Info field.
208 * Added SAS/SATA device support to SAS IOUnit Page 1
209 * ControlFlags.
210 * Added Unsupported device to SAS Dev Page 0 Flags field
211 * Added disable use SATA Hash Address for SAS IOUNIT
212 * page 1 in ControlFields.
213 * 01-15-05 01.05.06 Added defaults for data scrub rate and resync rate to
214 * Manufacturing Page 4.
215 * Added new defines for BIOS Page 1 IOCSettings field.
216 * Added ExtDiskIdentifier field to RAID Physical Disk
217 * Page 0.
218 * Added new defines for SAS IO Unit Page 1 ControlFlags
219 * and to SAS Device Page 0 Flags to control SATA devices.
220 * Added defines and structures for the new Log Page 0, a
221 * new type of configuration page.
222 * 02-09-05 01.05.07 Added InactiveStatus field to RAID Volume Page 0.
223 * Added WWID field to RAID Volume Page 1.
224 * Added PhysicalPort field to SAS Expander pages 0 and 1.
225 * 03-11-05 01.05.08 Removed the EEDP flags from IOC Page 1.
226 * Added Enclosure/Slot boot device format to BIOS Page 2.
227 * New status value for RAID Volume Page 0 VolumeStatus
228 * (VolumeState subfield).
229 * New value for RAID Physical Page 0 InactiveStatus.
230 * Added Inactive Volume Member flag RAID Physical Disk
231 * Page 0 PhysDiskStatus field.
232 * New physical mapping mode in SAS IO Unit Page 2.
233 * Added CONFIG_PAGE_SAS_ENCLOSURE_0.
234 * Added Slot and Enclosure fields to SAS Device Page 0.
148 * -------------------------------------------------------------------------- 235 * --------------------------------------------------------------------------
149 */ 236 */
150 237
@@ -164,7 +251,7 @@ typedef struct _CONFIG_PAGE_HEADER
164 U8 PageLength; /* 01h */ 251 U8 PageLength; /* 01h */
165 U8 PageNumber; /* 02h */ 252 U8 PageNumber; /* 02h */
166 U8 PageType; /* 03h */ 253 U8 PageType; /* 03h */
167} fCONFIG_PAGE_HEADER, MPI_POINTER PTR_CONFIG_PAGE_HEADER, 254} CONFIG_PAGE_HEADER, MPI_POINTER PTR_CONFIG_PAGE_HEADER,
168 ConfigPageHeader_t, MPI_POINTER pConfigPageHeader_t; 255 ConfigPageHeader_t, MPI_POINTER pConfigPageHeader_t;
169 256
170typedef union _CONFIG_PAGE_HEADER_UNION 257typedef union _CONFIG_PAGE_HEADER_UNION
@@ -174,7 +261,7 @@ typedef union _CONFIG_PAGE_HEADER_UNION
174 U16 Word16[2]; 261 U16 Word16[2];
175 U32 Word32; 262 U32 Word32;
176} ConfigPageHeaderUnion, MPI_POINTER pConfigPageHeaderUnion, 263} ConfigPageHeaderUnion, MPI_POINTER pConfigPageHeaderUnion,
177 fCONFIG_PAGE_HEADER_UNION, MPI_POINTER PTR_CONFIG_PAGE_HEADER_UNION; 264 CONFIG_PAGE_HEADER_UNION, MPI_POINTER PTR_CONFIG_PAGE_HEADER_UNION;
178 265
179typedef struct _CONFIG_EXTENDED_PAGE_HEADER 266typedef struct _CONFIG_EXTENDED_PAGE_HEADER
180{ 267{
@@ -185,7 +272,7 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
185 U16 ExtPageLength; /* 04h */ 272 U16 ExtPageLength; /* 04h */
186 U8 ExtPageType; /* 06h */ 273 U8 ExtPageType; /* 06h */
187 U8 Reserved2; /* 07h */ 274 U8 Reserved2; /* 07h */
188} fCONFIG_EXTENDED_PAGE_HEADER, MPI_POINTER PTR_CONFIG_EXTENDED_PAGE_HEADER, 275} CONFIG_EXTENDED_PAGE_HEADER, MPI_POINTER PTR_CONFIG_EXTENDED_PAGE_HEADER,
189 ConfigExtendedPageHeader_t, MPI_POINTER pConfigExtendedPageHeader_t; 276 ConfigExtendedPageHeader_t, MPI_POINTER pConfigExtendedPageHeader_t;
190 277
191 278
@@ -224,6 +311,8 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
224#define MPI_CONFIG_EXTPAGETYPE_SAS_EXPANDER (0x11) 311#define MPI_CONFIG_EXTPAGETYPE_SAS_EXPANDER (0x11)
225#define MPI_CONFIG_EXTPAGETYPE_SAS_DEVICE (0x12) 312#define MPI_CONFIG_EXTPAGETYPE_SAS_DEVICE (0x12)
226#define MPI_CONFIG_EXTPAGETYPE_SAS_PHY (0x13) 313#define MPI_CONFIG_EXTPAGETYPE_SAS_PHY (0x13)
314#define MPI_CONFIG_EXTPAGETYPE_LOG (0x14)
315#define MPI_CONFIG_EXTPAGETYPE_ENCLOSURE (0x15)
227 316
228 317
229/**************************************************************************** 318/****************************************************************************
@@ -231,10 +320,19 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
231****************************************************************************/ 320****************************************************************************/
232#define MPI_SCSI_PORT_PGAD_PORT_MASK (0x000000FF) 321#define MPI_SCSI_PORT_PGAD_PORT_MASK (0x000000FF)
233 322
323#define MPI_SCSI_DEVICE_FORM_MASK (0xF0000000)
324#define MPI_SCSI_DEVICE_FORM_BUS_TID (0x00000000)
234#define MPI_SCSI_DEVICE_TARGET_ID_MASK (0x000000FF) 325#define MPI_SCSI_DEVICE_TARGET_ID_MASK (0x000000FF)
235#define MPI_SCSI_DEVICE_TARGET_ID_SHIFT (0) 326#define MPI_SCSI_DEVICE_TARGET_ID_SHIFT (0)
236#define MPI_SCSI_DEVICE_BUS_MASK (0x0000FF00) 327#define MPI_SCSI_DEVICE_BUS_MASK (0x0000FF00)
237#define MPI_SCSI_DEVICE_BUS_SHIFT (8) 328#define MPI_SCSI_DEVICE_BUS_SHIFT (8)
329#define MPI_SCSI_DEVICE_FORM_TARGET_MODE (0x10000000)
330#define MPI_SCSI_DEVICE_TM_RESPOND_ID_MASK (0x000000FF)
331#define MPI_SCSI_DEVICE_TM_RESPOND_ID_SHIFT (0)
332#define MPI_SCSI_DEVICE_TM_BUS_MASK (0x0000FF00)
333#define MPI_SCSI_DEVICE_TM_BUS_SHIFT (8)
334#define MPI_SCSI_DEVICE_TM_INIT_ID_MASK (0x00FF0000)
335#define MPI_SCSI_DEVICE_TM_INIT_ID_SHIFT (16)
238 336
239#define MPI_FC_PORT_PGAD_PORT_MASK (0xF0000000) 337#define MPI_FC_PORT_PGAD_PORT_MASK (0xF0000000)
240#define MPI_FC_PORT_PGAD_PORT_SHIFT (28) 338#define MPI_FC_PORT_PGAD_PORT_SHIFT (28)
@@ -260,6 +358,20 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
260#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_MASK (0x000000FF) 358#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_MASK (0x000000FF)
261#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_SHIFT (0) 359#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_SHIFT (0)
262 360
361#define MPI_SAS_EXPAND_PGAD_FORM_MASK (0xF0000000)
362#define MPI_SAS_EXPAND_PGAD_FORM_SHIFT (28)
363#define MPI_SAS_EXPAND_PGAD_FORM_GET_NEXT_HANDLE (0x00000000)
364#define MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM (0x00000001)
365#define MPI_SAS_EXPAND_PGAD_FORM_HANDLE (0x00000002)
366#define MPI_SAS_EXPAND_PGAD_GNH_MASK_HANDLE (0x0000FFFF)
367#define MPI_SAS_EXPAND_PGAD_GNH_SHIFT_HANDLE (0)
368#define MPI_SAS_EXPAND_PGAD_HPN_MASK_PHY (0x00FF0000)
369#define MPI_SAS_EXPAND_PGAD_HPN_SHIFT_PHY (16)
370#define MPI_SAS_EXPAND_PGAD_HPN_MASK_HANDLE (0x0000FFFF)
371#define MPI_SAS_EXPAND_PGAD_HPN_SHIFT_HANDLE (0)
372#define MPI_SAS_EXPAND_PGAD_H_MASK_HANDLE (0x0000FFFF)
373#define MPI_SAS_EXPAND_PGAD_H_SHIFT_HANDLE (0)
374
263#define MPI_SAS_DEVICE_PGAD_FORM_MASK (0xF0000000) 375#define MPI_SAS_DEVICE_PGAD_FORM_MASK (0xF0000000)
264#define MPI_SAS_DEVICE_PGAD_FORM_SHIFT (28) 376#define MPI_SAS_DEVICE_PGAD_FORM_SHIFT (28)
265#define MPI_SAS_DEVICE_PGAD_FORM_GET_NEXT_HANDLE (0x00000000) 377#define MPI_SAS_DEVICE_PGAD_FORM_GET_NEXT_HANDLE (0x00000000)
@@ -274,10 +386,24 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
274#define MPI_SAS_DEVICE_PGAD_H_HANDLE_MASK (0x0000FFFF) 386#define MPI_SAS_DEVICE_PGAD_H_HANDLE_MASK (0x0000FFFF)
275#define MPI_SAS_DEVICE_PGAD_H_HANDLE_SHIFT (0) 387#define MPI_SAS_DEVICE_PGAD_H_HANDLE_SHIFT (0)
276 388
277#define MPI_SAS_PHY_PGAD_PHY_NUMBER_MASK (0x00FF0000) 389#define MPI_SAS_PHY_PGAD_FORM_MASK (0xF0000000)
278#define MPI_SAS_PHY_PGAD_PHY_NUMBER_SHIFT (16) 390#define MPI_SAS_PHY_PGAD_FORM_SHIFT (28)
279#define MPI_SAS_PHY_PGAD_DEVHANDLE_MASK (0x0000FFFF) 391#define MPI_SAS_PHY_PGAD_FORM_PHY_NUMBER (0x0)
280#define MPI_SAS_PHY_PGAD_DEVHANDLE_SHIFT (0) 392#define MPI_SAS_PHY_PGAD_FORM_PHY_TBL_INDEX (0x1)
393#define MPI_SAS_PHY_PGAD_PHY_NUMBER_MASK (0x000000FF)
394#define MPI_SAS_PHY_PGAD_PHY_NUMBER_SHIFT (0)
395#define MPI_SAS_PHY_PGAD_PHY_TBL_INDEX_MASK (0x0000FFFF)
396#define MPI_SAS_PHY_PGAD_PHY_TBL_INDEX_SHIFT (0)
397
398#define MPI_SAS_ENCLOS_PGAD_FORM_MASK (0xF0000000)
399#define MPI_SAS_ENCLOS_PGAD_FORM_SHIFT (28)
400#define MPI_SAS_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE (0x00000000)
401#define MPI_SAS_ENCLOS_PGAD_FORM_HANDLE (0x00000001)
402#define MPI_SAS_ENCLOS_PGAD_GNH_HANDLE_MASK (0x0000FFFF)
403#define MPI_SAS_ENCLOS_PGAD_GNH_HANDLE_SHIFT (0)
404#define MPI_SAS_ENCLOS_PGAD_H_HANDLE_MASK (0x0000FFFF)
405#define MPI_SAS_ENCLOS_PGAD_H_HANDLE_SHIFT (0)
406
281 407
282 408
283/**************************************************************************** 409/****************************************************************************
@@ -294,7 +420,7 @@ typedef struct _MSG_CONFIG
294 U8 MsgFlags; /* 07h */ 420 U8 MsgFlags; /* 07h */
295 U32 MsgContext; /* 08h */ 421 U32 MsgContext; /* 08h */
296 U8 Reserved2[8]; /* 0Ch */ 422 U8 Reserved2[8]; /* 0Ch */
297 fCONFIG_PAGE_HEADER Header; /* 14h */ 423 CONFIG_PAGE_HEADER Header; /* 14h */
298 U32 PageAddress; /* 18h */ 424 U32 PageAddress; /* 18h */
299 SGE_IO_UNION PageBufferSGE; /* 1Ch */ 425 SGE_IO_UNION PageBufferSGE; /* 1Ch */
300} MSG_CONFIG, MPI_POINTER PTR_MSG_CONFIG, 426} MSG_CONFIG, MPI_POINTER PTR_MSG_CONFIG,
@@ -327,7 +453,7 @@ typedef struct _MSG_CONFIG_REPLY
327 U8 Reserved2[2]; /* 0Ch */ 453 U8 Reserved2[2]; /* 0Ch */
328 U16 IOCStatus; /* 0Eh */ 454 U16 IOCStatus; /* 0Eh */
329 U32 IOCLogInfo; /* 10h */ 455 U32 IOCLogInfo; /* 10h */
330 fCONFIG_PAGE_HEADER Header; /* 14h */ 456 CONFIG_PAGE_HEADER Header; /* 14h */
331} MSG_CONFIG_REPLY, MPI_POINTER PTR_MSG_CONFIG_REPLY, 457} MSG_CONFIG_REPLY, MPI_POINTER PTR_MSG_CONFIG_REPLY,
332 ConfigReply_t, MPI_POINTER pConfigReply_t; 458 ConfigReply_t, MPI_POINTER pConfigReply_t;
333 459
@@ -349,6 +475,8 @@ typedef struct _MSG_CONFIG_REPLY
349#define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622) 475#define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622)
350#define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628) 476#define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628)
351#define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) 477#define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626)
478#define MPI_MANUFACTPAGE_DEVICEID_FC939X (0x0642)
479#define MPI_MANUFACTPAGE_DEVICEID_FC949X (0x0640)
352/* SCSI */ 480/* SCSI */
353#define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) 481#define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030)
354#define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) 482#define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031)
@@ -358,18 +486,25 @@ typedef struct _MSG_CONFIG_REPLY
358#define MPI_MANUFACTPAGE_DEVID_53C1035ZC (0x0041) 486#define MPI_MANUFACTPAGE_DEVID_53C1035ZC (0x0041)
359/* SAS */ 487/* SAS */
360#define MPI_MANUFACTPAGE_DEVID_SAS1064 (0x0050) 488#define MPI_MANUFACTPAGE_DEVID_SAS1064 (0x0050)
489#define MPI_MANUFACTPAGE_DEVID_SAS1064A (0x005C)
490#define MPI_MANUFACTPAGE_DEVID_SAS1064E (0x0056)
491#define MPI_MANUFACTPAGE_DEVID_SAS1066 (0x005E)
492#define MPI_MANUFACTPAGE_DEVID_SAS1066E (0x005A)
493#define MPI_MANUFACTPAGE_DEVID_SAS1068 (0x0054)
494#define MPI_MANUFACTPAGE_DEVID_SAS1068E (0x0058)
495#define MPI_MANUFACTPAGE_DEVID_SAS1078 (0x0060)
361 496
362 497
363typedef struct _CONFIG_PAGE_MANUFACTURING_0 498typedef struct _CONFIG_PAGE_MANUFACTURING_0
364{ 499{
365 fCONFIG_PAGE_HEADER Header; /* 00h */ 500 CONFIG_PAGE_HEADER Header; /* 00h */
366 U8 ChipName[16]; /* 04h */ 501 U8 ChipName[16]; /* 04h */
367 U8 ChipRevision[8]; /* 14h */ 502 U8 ChipRevision[8]; /* 14h */
368 U8 BoardName[16]; /* 1Ch */ 503 U8 BoardName[16]; /* 1Ch */
369 U8 BoardAssembly[16]; /* 2Ch */ 504 U8 BoardAssembly[16]; /* 2Ch */
370 U8 BoardTracerNumber[16]; /* 3Ch */ 505 U8 BoardTracerNumber[16]; /* 3Ch */
371 506
372} fCONFIG_PAGE_MANUFACTURING_0, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_0, 507} CONFIG_PAGE_MANUFACTURING_0, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_0,
373 ManufacturingPage0_t, MPI_POINTER pManufacturingPage0_t; 508 ManufacturingPage0_t, MPI_POINTER pManufacturingPage0_t;
374 509
375#define MPI_MANUFACTURING0_PAGEVERSION (0x00) 510#define MPI_MANUFACTURING0_PAGEVERSION (0x00)
@@ -377,9 +512,9 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_0
377 512
378typedef struct _CONFIG_PAGE_MANUFACTURING_1 513typedef struct _CONFIG_PAGE_MANUFACTURING_1
379{ 514{
380 fCONFIG_PAGE_HEADER Header; /* 00h */ 515 CONFIG_PAGE_HEADER Header; /* 00h */
381 U8 VPD[256]; /* 04h */ 516 U8 VPD[256]; /* 04h */
382} fCONFIG_PAGE_MANUFACTURING_1, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_1, 517} CONFIG_PAGE_MANUFACTURING_1, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_1,
383 ManufacturingPage1_t, MPI_POINTER pManufacturingPage1_t; 518 ManufacturingPage1_t, MPI_POINTER pManufacturingPage1_t;
384 519
385#define MPI_MANUFACTURING1_PAGEVERSION (0x00) 520#define MPI_MANUFACTURING1_PAGEVERSION (0x00)
@@ -404,10 +539,10 @@ typedef struct _MPI_CHIP_REVISION_ID
404 539
405typedef struct _CONFIG_PAGE_MANUFACTURING_2 540typedef struct _CONFIG_PAGE_MANUFACTURING_2
406{ 541{
407 fCONFIG_PAGE_HEADER Header; /* 00h */ 542 CONFIG_PAGE_HEADER Header; /* 00h */
408 MPI_CHIP_REVISION_ID ChipId; /* 04h */ 543 MPI_CHIP_REVISION_ID ChipId; /* 04h */
409 U32 HwSettings[MPI_MAN_PAGE_2_HW_SETTINGS_WORDS];/* 08h */ 544 U32 HwSettings[MPI_MAN_PAGE_2_HW_SETTINGS_WORDS];/* 08h */
410} fCONFIG_PAGE_MANUFACTURING_2, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_2, 545} CONFIG_PAGE_MANUFACTURING_2, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_2,
411 ManufacturingPage2_t, MPI_POINTER pManufacturingPage2_t; 546 ManufacturingPage2_t, MPI_POINTER pManufacturingPage2_t;
412 547
413#define MPI_MANUFACTURING2_PAGEVERSION (0x00) 548#define MPI_MANUFACTURING2_PAGEVERSION (0x00)
@@ -423,10 +558,10 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_2
423 558
424typedef struct _CONFIG_PAGE_MANUFACTURING_3 559typedef struct _CONFIG_PAGE_MANUFACTURING_3
425{ 560{
426 fCONFIG_PAGE_HEADER Header; /* 00h */ 561 CONFIG_PAGE_HEADER Header; /* 00h */
427 MPI_CHIP_REVISION_ID ChipId; /* 04h */ 562 MPI_CHIP_REVISION_ID ChipId; /* 04h */
428 U32 Info[MPI_MAN_PAGE_3_INFO_WORDS];/* 08h */ 563 U32 Info[MPI_MAN_PAGE_3_INFO_WORDS];/* 08h */
429} fCONFIG_PAGE_MANUFACTURING_3, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_3, 564} CONFIG_PAGE_MANUFACTURING_3, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_3,
430 ManufacturingPage3_t, MPI_POINTER pManufacturingPage3_t; 565 ManufacturingPage3_t, MPI_POINTER pManufacturingPage3_t;
431 566
432#define MPI_MANUFACTURING3_PAGEVERSION (0x00) 567#define MPI_MANUFACTURING3_PAGEVERSION (0x00)
@@ -434,7 +569,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_3
434 569
435typedef struct _CONFIG_PAGE_MANUFACTURING_4 570typedef struct _CONFIG_PAGE_MANUFACTURING_4
436{ 571{
437 fCONFIG_PAGE_HEADER Header; /* 00h */ 572 CONFIG_PAGE_HEADER Header; /* 00h */
438 U32 Reserved1; /* 04h */ 573 U32 Reserved1; /* 04h */
439 U8 InfoOffset0; /* 08h */ 574 U8 InfoOffset0; /* 08h */
440 U8 InfoSize0; /* 09h */ 575 U8 InfoSize0; /* 09h */
@@ -447,10 +582,23 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
447 U32 ISVolumeSettings; /* 48h */ 582 U32 ISVolumeSettings; /* 48h */
448 U32 IMEVolumeSettings; /* 4Ch */ 583 U32 IMEVolumeSettings; /* 4Ch */
449 U32 IMVolumeSettings; /* 50h */ 584 U32 IMVolumeSettings; /* 50h */
450} fCONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, 585 U32 Reserved3; /* 54h */
586 U32 Reserved4; /* 58h */
587 U8 ISDataScrubRate; /* 5Ch */
588 U8 ISResyncRate; /* 5Dh */
589 U16 Reserved5; /* 5Eh */
590 U8 IMEDataScrubRate; /* 60h */
591 U8 IMEResyncRate; /* 61h */
592 U16 Reserved6; /* 62h */
593 U8 IMDataScrubRate; /* 64h */
594 U8 IMResyncRate; /* 65h */
595 U16 Reserved7; /* 66h */
596 U32 Reserved8; /* 68h */
597 U32 Reserved9; /* 6Ch */
598} CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4,
451 ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; 599 ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t;
452 600
453#define MPI_MANUFACTURING4_PAGEVERSION (0x01) 601#define MPI_MANUFACTURING4_PAGEVERSION (0x02)
454 602
455/* defines for the Flags field */ 603/* defines for the Flags field */
456#define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) 604#define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01)
@@ -458,19 +606,25 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
458 606
459typedef struct _CONFIG_PAGE_MANUFACTURING_5 607typedef struct _CONFIG_PAGE_MANUFACTURING_5
460{ 608{
461 fCONFIG_PAGE_HEADER Header; /* 00h */ 609 CONFIG_PAGE_HEADER Header; /* 00h */
462 U64 BaseWWID; /* 04h */ 610 U64 BaseWWID; /* 04h */
463} fCONFIG_PAGE_MANUFACTURING_5, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_5, 611 U8 Flags; /* 0Ch */
612 U8 Reserved1; /* 0Dh */
613 U16 Reserved2; /* 0Eh */
614} CONFIG_PAGE_MANUFACTURING_5, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_5,
464 ManufacturingPage5_t, MPI_POINTER pManufacturingPage5_t; 615 ManufacturingPage5_t, MPI_POINTER pManufacturingPage5_t;
465 616
466#define MPI_MANUFACTURING5_PAGEVERSION (0x00) 617#define MPI_MANUFACTURING5_PAGEVERSION (0x01)
618
619/* defines for the Flags field */
620#define MPI_MANPAGE5_TWO_WWID_PER_PHY (0x01)
467 621
468 622
469typedef struct _CONFIG_PAGE_MANUFACTURING_6 623typedef struct _CONFIG_PAGE_MANUFACTURING_6
470{ 624{
471 fCONFIG_PAGE_HEADER Header; /* 00h */ 625 CONFIG_PAGE_HEADER Header; /* 00h */
472 U32 ProductSpecificInfo;/* 04h */ 626 U32 ProductSpecificInfo;/* 04h */
473} fCONFIG_PAGE_MANUFACTURING_6, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_6, 627} CONFIG_PAGE_MANUFACTURING_6, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_6,
474 ManufacturingPage6_t, MPI_POINTER pManufacturingPage6_t; 628 ManufacturingPage6_t, MPI_POINTER pManufacturingPage6_t;
475 629
476#define MPI_MANUFACTURING6_PAGEVERSION (0x00) 630#define MPI_MANUFACTURING6_PAGEVERSION (0x00)
@@ -482,9 +636,9 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_6
482 636
483typedef struct _CONFIG_PAGE_IO_UNIT_0 637typedef struct _CONFIG_PAGE_IO_UNIT_0
484{ 638{
485 fCONFIG_PAGE_HEADER Header; /* 00h */ 639 CONFIG_PAGE_HEADER Header; /* 00h */
486 U64 UniqueValue; /* 04h */ 640 U64 UniqueValue; /* 04h */
487} fCONFIG_PAGE_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_0, 641} CONFIG_PAGE_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_0,
488 IOUnitPage0_t, MPI_POINTER pIOUnitPage0_t; 642 IOUnitPage0_t, MPI_POINTER pIOUnitPage0_t;
489 643
490#define MPI_IOUNITPAGE0_PAGEVERSION (0x00) 644#define MPI_IOUNITPAGE0_PAGEVERSION (0x00)
@@ -492,9 +646,9 @@ typedef struct _CONFIG_PAGE_IO_UNIT_0
492 646
493typedef struct _CONFIG_PAGE_IO_UNIT_1 647typedef struct _CONFIG_PAGE_IO_UNIT_1
494{ 648{
495 fCONFIG_PAGE_HEADER Header; /* 00h */ 649 CONFIG_PAGE_HEADER Header; /* 00h */
496 U32 Flags; /* 04h */ 650 U32 Flags; /* 04h */
497} fCONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1, 651} CONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1,
498 IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t; 652 IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t;
499 653
500#define MPI_IOUNITPAGE1_PAGEVERSION (0x01) 654#define MPI_IOUNITPAGE1_PAGEVERSION (0x01)
@@ -524,14 +678,15 @@ typedef struct _MPI_ADAPTER_INFO
524 678
525typedef struct _CONFIG_PAGE_IO_UNIT_2 679typedef struct _CONFIG_PAGE_IO_UNIT_2
526{ 680{
527 fCONFIG_PAGE_HEADER Header; /* 00h */ 681 CONFIG_PAGE_HEADER Header; /* 00h */
528 U32 Flags; /* 04h */ 682 U32 Flags; /* 04h */
529 U32 BiosVersion; /* 08h */ 683 U32 BiosVersion; /* 08h */
530 MPI_ADAPTER_INFO AdapterOrder[4]; /* 0Ch */ 684 MPI_ADAPTER_INFO AdapterOrder[4]; /* 0Ch */
531} fCONFIG_PAGE_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_2, 685 U32 Reserved1; /* 1Ch */
686} CONFIG_PAGE_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_2,
532 IOUnitPage2_t, MPI_POINTER pIOUnitPage2_t; 687 IOUnitPage2_t, MPI_POINTER pIOUnitPage2_t;
533 688
534#define MPI_IOUNITPAGE2_PAGEVERSION (0x00) 689#define MPI_IOUNITPAGE2_PAGEVERSION (0x02)
535 690
536#define MPI_IOUNITPAGE2_FLAGS_PAUSE_ON_ERROR (0x00000002) 691#define MPI_IOUNITPAGE2_FLAGS_PAUSE_ON_ERROR (0x00000002)
537#define MPI_IOUNITPAGE2_FLAGS_VERBOSE_ENABLE (0x00000004) 692#define MPI_IOUNITPAGE2_FLAGS_VERBOSE_ENABLE (0x00000004)
@@ -554,12 +709,12 @@ typedef struct _CONFIG_PAGE_IO_UNIT_2
554 709
555typedef struct _CONFIG_PAGE_IO_UNIT_3 710typedef struct _CONFIG_PAGE_IO_UNIT_3
556{ 711{
557 fCONFIG_PAGE_HEADER Header; /* 00h */ 712 CONFIG_PAGE_HEADER Header; /* 00h */
558 U8 GPIOCount; /* 04h */ 713 U8 GPIOCount; /* 04h */
559 U8 Reserved1; /* 05h */ 714 U8 Reserved1; /* 05h */
560 U16 Reserved2; /* 06h */ 715 U16 Reserved2; /* 06h */
561 U16 GPIOVal[MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX]; /* 08h */ 716 U16 GPIOVal[MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX]; /* 08h */
562} fCONFIG_PAGE_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_3, 717} CONFIG_PAGE_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_3,
563 IOUnitPage3_t, MPI_POINTER pIOUnitPage3_t; 718 IOUnitPage3_t, MPI_POINTER pIOUnitPage3_t;
564 719
565#define MPI_IOUNITPAGE3_PAGEVERSION (0x01) 720#define MPI_IOUNITPAGE3_PAGEVERSION (0x01)
@@ -570,13 +725,24 @@ typedef struct _CONFIG_PAGE_IO_UNIT_3
570#define MPI_IOUNITPAGE3_GPIO_SETTING_ON (0x01) 725#define MPI_IOUNITPAGE3_GPIO_SETTING_ON (0x01)
571 726
572 727
728typedef struct _CONFIG_PAGE_IO_UNIT_4
729{
730 CONFIG_PAGE_HEADER Header; /* 00h */
731 U32 Reserved1; /* 04h */
732 SGE_SIMPLE_UNION FWImageSGE; /* 08h */
733} CONFIG_PAGE_IO_UNIT_4, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_4,
734 IOUnitPage4_t, MPI_POINTER pIOUnitPage4_t;
735
736#define MPI_IOUNITPAGE4_PAGEVERSION (0x00)
737
738
573/**************************************************************************** 739/****************************************************************************
574* IOC Config Pages 740* IOC Config Pages
575****************************************************************************/ 741****************************************************************************/
576 742
577typedef struct _CONFIG_PAGE_IOC_0 743typedef struct _CONFIG_PAGE_IOC_0
578{ 744{
579 fCONFIG_PAGE_HEADER Header; /* 00h */ 745 CONFIG_PAGE_HEADER Header; /* 00h */
580 U32 TotalNVStore; /* 04h */ 746 U32 TotalNVStore; /* 04h */
581 U32 FreeNVStore; /* 08h */ 747 U32 FreeNVStore; /* 08h */
582 U16 VendorID; /* 0Ch */ 748 U16 VendorID; /* 0Ch */
@@ -586,7 +752,7 @@ typedef struct _CONFIG_PAGE_IOC_0
586 U32 ClassCode; /* 14h */ 752 U32 ClassCode; /* 14h */
587 U16 SubsystemVendorID; /* 18h */ 753 U16 SubsystemVendorID; /* 18h */
588 U16 SubsystemID; /* 1Ah */ 754 U16 SubsystemID; /* 1Ah */
589} fCONFIG_PAGE_IOC_0, MPI_POINTER PTR_CONFIG_PAGE_IOC_0, 755} CONFIG_PAGE_IOC_0, MPI_POINTER PTR_CONFIG_PAGE_IOC_0,
590 IOCPage0_t, MPI_POINTER pIOCPage0_t; 756 IOCPage0_t, MPI_POINTER pIOCPage0_t;
591 757
592#define MPI_IOCPAGE0_PAGEVERSION (0x01) 758#define MPI_IOCPAGE0_PAGEVERSION (0x01)
@@ -594,23 +760,19 @@ typedef struct _CONFIG_PAGE_IOC_0
594 760
595typedef struct _CONFIG_PAGE_IOC_1 761typedef struct _CONFIG_PAGE_IOC_1
596{ 762{
597 fCONFIG_PAGE_HEADER Header; /* 00h */ 763 CONFIG_PAGE_HEADER Header; /* 00h */
598 U32 Flags; /* 04h */ 764 U32 Flags; /* 04h */
599 U32 CoalescingTimeout; /* 08h */ 765 U32 CoalescingTimeout; /* 08h */
600 U8 CoalescingDepth; /* 0Ch */ 766 U8 CoalescingDepth; /* 0Ch */
601 U8 PCISlotNum; /* 0Dh */ 767 U8 PCISlotNum; /* 0Dh */
602 U8 Reserved[2]; /* 0Eh */ 768 U8 Reserved[2]; /* 0Eh */
603} fCONFIG_PAGE_IOC_1, MPI_POINTER PTR_CONFIG_PAGE_IOC_1, 769} CONFIG_PAGE_IOC_1, MPI_POINTER PTR_CONFIG_PAGE_IOC_1,
604 IOCPage1_t, MPI_POINTER pIOCPage1_t; 770 IOCPage1_t, MPI_POINTER pIOCPage1_t;
605 771
606#define MPI_IOCPAGE1_PAGEVERSION (0x01) 772#define MPI_IOCPAGE1_PAGEVERSION (0x02)
607 773
608/* defines for the Flags field */ 774/* defines for the Flags field */
609#define MPI_IOCPAGE1_EEDP_HOST_SUPPORTS_DIF (0x08000000) 775#define MPI_IOCPAGE1_INITIATOR_CONTEXT_REPLY_DISABLE (0x00000010)
610#define MPI_IOCPAGE1_EEDP_MODE_MASK (0x07000000)
611#define MPI_IOCPAGE1_EEDP_MODE_OFF (0x00000000)
612#define MPI_IOCPAGE1_EEDP_MODE_T10 (0x01000000)
613#define MPI_IOCPAGE1_EEDP_MODE_LSI_1 (0x02000000)
614#define MPI_IOCPAGE1_REPLY_COALESCING (0x00000001) 776#define MPI_IOCPAGE1_REPLY_COALESCING (0x00000001)
615 777
616#define MPI_IOCPAGE1_PCISLOTNUM_UNKNOWN (0xFF) 778#define MPI_IOCPAGE1_PCISLOTNUM_UNKNOWN (0xFF)
@@ -625,7 +787,7 @@ typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL
625 U8 VolumeType; /* 04h */ 787 U8 VolumeType; /* 04h */
626 U8 Flags; /* 05h */ 788 U8 Flags; /* 05h */
627 U16 Reserved3; /* 06h */ 789 U16 Reserved3; /* 06h */
628} fCONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL, 790} CONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL,
629 ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t; 791 ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t;
630 792
631/* IOC Page 2 Volume RAID Type values, also used in RAID Volume pages */ 793/* IOC Page 2 Volume RAID Type values, also used in RAID Volume pages */
@@ -648,14 +810,14 @@ typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL
648 810
649typedef struct _CONFIG_PAGE_IOC_2 811typedef struct _CONFIG_PAGE_IOC_2
650{ 812{
651 fCONFIG_PAGE_HEADER Header; /* 00h */ 813 CONFIG_PAGE_HEADER Header; /* 00h */
652 U32 CapabilitiesFlags; /* 04h */ 814 U32 CapabilitiesFlags; /* 04h */
653 U8 NumActiveVolumes; /* 08h */ 815 U8 NumActiveVolumes; /* 08h */
654 U8 MaxVolumes; /* 09h */ 816 U8 MaxVolumes; /* 09h */
655 U8 NumActivePhysDisks; /* 0Ah */ 817 U8 NumActivePhysDisks; /* 0Ah */
656 U8 MaxPhysDisks; /* 0Bh */ 818 U8 MaxPhysDisks; /* 0Bh */
657 fCONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[MPI_IOC_PAGE_2_RAID_VOLUME_MAX];/* 0Ch */ 819 CONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[MPI_IOC_PAGE_2_RAID_VOLUME_MAX];/* 0Ch */
658} fCONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2, 820} CONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2,
659 IOCPage2_t, MPI_POINTER pIOCPage2_t; 821 IOCPage2_t, MPI_POINTER pIOCPage2_t;
660 822
661#define MPI_IOCPAGE2_PAGEVERSION (0x02) 823#define MPI_IOCPAGE2_PAGEVERSION (0x02)
@@ -689,12 +851,12 @@ typedef struct _IOC_3_PHYS_DISK
689 851
690typedef struct _CONFIG_PAGE_IOC_3 852typedef struct _CONFIG_PAGE_IOC_3
691{ 853{
692 fCONFIG_PAGE_HEADER Header; /* 00h */ 854 CONFIG_PAGE_HEADER Header; /* 00h */
693 U8 NumPhysDisks; /* 04h */ 855 U8 NumPhysDisks; /* 04h */
694 U8 Reserved1; /* 05h */ 856 U8 Reserved1; /* 05h */
695 U16 Reserved2; /* 06h */ 857 U16 Reserved2; /* 06h */
696 IOC_3_PHYS_DISK PhysDisk[MPI_IOC_PAGE_3_PHYSDISK_MAX]; /* 08h */ 858 IOC_3_PHYS_DISK PhysDisk[MPI_IOC_PAGE_3_PHYSDISK_MAX]; /* 08h */
697} fCONFIG_PAGE_IOC_3, MPI_POINTER PTR_CONFIG_PAGE_IOC_3, 859} CONFIG_PAGE_IOC_3, MPI_POINTER PTR_CONFIG_PAGE_IOC_3,
698 IOCPage3_t, MPI_POINTER pIOCPage3_t; 860 IOCPage3_t, MPI_POINTER pIOCPage3_t;
699 861
700#define MPI_IOCPAGE3_PAGEVERSION (0x00) 862#define MPI_IOCPAGE3_PAGEVERSION (0x00)
@@ -718,12 +880,12 @@ typedef struct _IOC_4_SEP
718 880
719typedef struct _CONFIG_PAGE_IOC_4 881typedef struct _CONFIG_PAGE_IOC_4
720{ 882{
721 fCONFIG_PAGE_HEADER Header; /* 00h */ 883 CONFIG_PAGE_HEADER Header; /* 00h */
722 U8 ActiveSEP; /* 04h */ 884 U8 ActiveSEP; /* 04h */
723 U8 MaxSEP; /* 05h */ 885 U8 MaxSEP; /* 05h */
724 U16 Reserved1; /* 06h */ 886 U16 Reserved1; /* 06h */
725 IOC_4_SEP SEP[MPI_IOC_PAGE_4_SEP_MAX]; /* 08h */ 887 IOC_4_SEP SEP[MPI_IOC_PAGE_4_SEP_MAX]; /* 08h */
726} fCONFIG_PAGE_IOC_4, MPI_POINTER PTR_CONFIG_PAGE_IOC_4, 888} CONFIG_PAGE_IOC_4, MPI_POINTER PTR_CONFIG_PAGE_IOC_4,
727 IOCPage4_t, MPI_POINTER pIOCPage4_t; 889 IOCPage4_t, MPI_POINTER pIOCPage4_t;
728 890
729#define MPI_IOCPAGE4_PAGEVERSION (0x00) 891#define MPI_IOCPAGE4_PAGEVERSION (0x00)
@@ -751,25 +913,25 @@ typedef struct _IOC_5_HOT_SPARE
751 913
752typedef struct _CONFIG_PAGE_IOC_5 914typedef struct _CONFIG_PAGE_IOC_5
753{ 915{
754 fCONFIG_PAGE_HEADER Header; /* 00h */ 916 CONFIG_PAGE_HEADER Header; /* 00h */
755 U32 Reserved1; /* 04h */ 917 U32 Reserved1; /* 04h */
756 U8 NumHotSpares; /* 08h */ 918 U8 NumHotSpares; /* 08h */
757 U8 Reserved2; /* 09h */ 919 U8 Reserved2; /* 09h */
758 U16 Reserved3; /* 0Ah */ 920 U16 Reserved3; /* 0Ah */
759 IOC_5_HOT_SPARE HotSpare[MPI_IOC_PAGE_5_HOT_SPARE_MAX]; /* 0Ch */ 921 IOC_5_HOT_SPARE HotSpare[MPI_IOC_PAGE_5_HOT_SPARE_MAX]; /* 0Ch */
760} fCONFIG_PAGE_IOC_5, MPI_POINTER PTR_CONFIG_PAGE_IOC_5, 922} CONFIG_PAGE_IOC_5, MPI_POINTER PTR_CONFIG_PAGE_IOC_5,
761 IOCPage5_t, MPI_POINTER pIOCPage5_t; 923 IOCPage5_t, MPI_POINTER pIOCPage5_t;
762 924
763#define MPI_IOCPAGE5_PAGEVERSION (0x00) 925#define MPI_IOCPAGE5_PAGEVERSION (0x00)
764 926
765 927
766/**************************************************************************** 928/****************************************************************************
767* BIOS Port Config Pages 929* BIOS Config Pages
768****************************************************************************/ 930****************************************************************************/
769 931
770typedef struct _CONFIG_PAGE_BIOS_1 932typedef struct _CONFIG_PAGE_BIOS_1
771{ 933{
772 fCONFIG_PAGE_HEADER Header; /* 00h */ 934 CONFIG_PAGE_HEADER Header; /* 00h */
773 U32 BiosOptions; /* 04h */ 935 U32 BiosOptions; /* 04h */
774 U32 IOCSettings; /* 08h */ 936 U32 IOCSettings; /* 08h */
775 U32 Reserved1; /* 0Ch */ 937 U32 Reserved1; /* 0Ch */
@@ -780,10 +942,10 @@ typedef struct _CONFIG_PAGE_BIOS_1
780 U16 IOTimeoutSequential; /* 1Ah */ 942 U16 IOTimeoutSequential; /* 1Ah */
781 U16 IOTimeoutOther; /* 1Ch */ 943 U16 IOTimeoutOther; /* 1Ch */
782 U16 IOTimeoutBlockDevicesRM; /* 1Eh */ 944 U16 IOTimeoutBlockDevicesRM; /* 1Eh */
783} fCONFIG_PAGE_BIOS_1, MPI_POINTER PTR_CONFIG_PAGE_BIOS_1, 945} CONFIG_PAGE_BIOS_1, MPI_POINTER PTR_CONFIG_PAGE_BIOS_1,
784 BIOSPage1_t, MPI_POINTER pBIOSPage1_t; 946 BIOSPage1_t, MPI_POINTER pBIOSPage1_t;
785 947
786#define MPI_BIOSPAGE1_PAGEVERSION (0x00) 948#define MPI_BIOSPAGE1_PAGEVERSION (0x01)
787 949
788/* values for the BiosOptions field */ 950/* values for the BiosOptions field */
789#define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400) 951#define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400)
@@ -792,6 +954,13 @@ typedef struct _CONFIG_PAGE_BIOS_1
792#define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) 954#define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001)
793 955
794/* values for the IOCSettings field */ 956/* values for the IOCSettings field */
957#define MPI_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000)
958#define MPI_BIOSPAGE1_IOCSET_ENCLOSURE_SLOT_BOOT (0x00000000)
959#define MPI_BIOSPAGE1_IOCSET_SAS_ADDRESS_BOOT (0x00010000)
960
961#define MPI_BIOSPAGE1_IOCSET_MASK_MAX_TARGET_SPIN_UP (0x0000F000)
962#define MPI_BIOSPAGE1_IOCSET_SHIFT_MAX_TARGET_SPIN_UP (12)
963
795#define MPI_BIOSPAGE1_IOCSET_MASK_SPINUP_DELAY (0x00000F00) 964#define MPI_BIOSPAGE1_IOCSET_MASK_SPINUP_DELAY (0x00000F00)
796#define MPI_BIOSPAGE1_IOCSET_SHIFT_SPINUP_DELAY (8) 965#define MPI_BIOSPAGE1_IOCSET_SHIFT_SPINUP_DELAY (8)
797 966
@@ -814,6 +983,191 @@ typedef struct _CONFIG_PAGE_BIOS_1
814#define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002) 983#define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002)
815#define MPI_BIOSPAGE1_DEVSET_DISABLE_OTHER_LUN (0x00000001) 984#define MPI_BIOSPAGE1_DEVSET_DISABLE_OTHER_LUN (0x00000001)
816 985
986typedef struct _MPI_BOOT_DEVICE_ADAPTER_ORDER
987{
988 U32 Reserved1; /* 00h */
989 U32 Reserved2; /* 04h */
990 U32 Reserved3; /* 08h */
991 U32 Reserved4; /* 0Ch */
992 U32 Reserved5; /* 10h */
993 U32 Reserved6; /* 14h */
994 U32 Reserved7; /* 18h */
995 U32 Reserved8; /* 1Ch */
996 U32 Reserved9; /* 20h */
997 U32 Reserved10; /* 24h */
998 U32 Reserved11; /* 28h */
999 U32 Reserved12; /* 2Ch */
1000 U32 Reserved13; /* 30h */
1001 U32 Reserved14; /* 34h */
1002 U32 Reserved15; /* 38h */
1003 U32 Reserved16; /* 3Ch */
1004 U32 Reserved17; /* 40h */
1005} MPI_BOOT_DEVICE_ADAPTER_ORDER, MPI_POINTER PTR_MPI_BOOT_DEVICE_ADAPTER_ORDER;
1006
1007typedef struct _MPI_BOOT_DEVICE_ADAPTER_NUMBER
1008{
1009 U8 TargetID; /* 00h */
1010 U8 Bus; /* 01h */
1011 U8 AdapterNumber; /* 02h */
1012 U8 Reserved1; /* 03h */
1013 U32 Reserved2; /* 04h */
1014 U32 Reserved3; /* 08h */
1015 U32 Reserved4; /* 0Ch */
1016 U8 LUN[8]; /* 10h */
1017 U32 Reserved5; /* 18h */
1018 U32 Reserved6; /* 1Ch */
1019 U32 Reserved7; /* 20h */
1020 U32 Reserved8; /* 24h */
1021 U32 Reserved9; /* 28h */
1022 U32 Reserved10; /* 2Ch */
1023 U32 Reserved11; /* 30h */
1024 U32 Reserved12; /* 34h */
1025 U32 Reserved13; /* 38h */
1026 U32 Reserved14; /* 3Ch */
1027 U32 Reserved15; /* 40h */
1028} MPI_BOOT_DEVICE_ADAPTER_NUMBER, MPI_POINTER PTR_MPI_BOOT_DEVICE_ADAPTER_NUMBER;
1029
1030typedef struct _MPI_BOOT_DEVICE_PCI_ADDRESS
1031{
1032 U8 TargetID; /* 00h */
1033 U8 Bus; /* 01h */
1034 U16 PCIAddress; /* 02h */
1035 U32 Reserved1; /* 04h */
1036 U32 Reserved2; /* 08h */
1037 U32 Reserved3; /* 0Ch */
1038 U8 LUN[8]; /* 10h */
1039 U32 Reserved4; /* 18h */
1040 U32 Reserved5; /* 1Ch */
1041 U32 Reserved6; /* 20h */
1042 U32 Reserved7; /* 24h */
1043 U32 Reserved8; /* 28h */
1044 U32 Reserved9; /* 2Ch */
1045 U32 Reserved10; /* 30h */
1046 U32 Reserved11; /* 34h */
1047 U32 Reserved12; /* 38h */
1048 U32 Reserved13; /* 3Ch */
1049 U32 Reserved14; /* 40h */
1050} MPI_BOOT_DEVICE_PCI_ADDRESS, MPI_POINTER PTR_MPI_BOOT_DEVICE_PCI_ADDRESS;
1051
1052typedef struct _MPI_BOOT_DEVICE_SLOT_NUMBER
1053{
1054 U8 TargetID; /* 00h */
1055 U8 Bus; /* 01h */
1056 U8 PCISlotNumber; /* 02h */
1057 U8 Reserved1; /* 03h */
1058 U32 Reserved2; /* 04h */
1059 U32 Reserved3; /* 08h */
1060 U32 Reserved4; /* 0Ch */
1061 U8 LUN[8]; /* 10h */
1062 U32 Reserved5; /* 18h */
1063 U32 Reserved6; /* 1Ch */
1064 U32 Reserved7; /* 20h */
1065 U32 Reserved8; /* 24h */
1066 U32 Reserved9; /* 28h */
1067 U32 Reserved10; /* 2Ch */
1068 U32 Reserved11; /* 30h */
1069 U32 Reserved12; /* 34h */
1070 U32 Reserved13; /* 38h */
1071 U32 Reserved14; /* 3Ch */
1072 U32 Reserved15; /* 40h */
1073} MPI_BOOT_DEVICE_PCI_SLOT_NUMBER, MPI_POINTER PTR_MPI_BOOT_DEVICE_PCI_SLOT_NUMBER;
1074
1075typedef struct _MPI_BOOT_DEVICE_FC_WWN
1076{
1077 U64 WWPN; /* 00h */
1078 U32 Reserved1; /* 08h */
1079 U32 Reserved2; /* 0Ch */
1080 U8 LUN[8]; /* 10h */
1081 U32 Reserved3; /* 18h */
1082 U32 Reserved4; /* 1Ch */
1083 U32 Reserved5; /* 20h */
1084 U32 Reserved6; /* 24h */
1085 U32 Reserved7; /* 28h */
1086 U32 Reserved8; /* 2Ch */
1087 U32 Reserved9; /* 30h */
1088 U32 Reserved10; /* 34h */
1089 U32 Reserved11; /* 38h */
1090 U32 Reserved12; /* 3Ch */
1091 U32 Reserved13; /* 40h */
1092} MPI_BOOT_DEVICE_FC_WWN, MPI_POINTER PTR_MPI_BOOT_DEVICE_FC_WWN;
1093
1094typedef struct _MPI_BOOT_DEVICE_SAS_WWN
1095{
1096 U64 SASAddress; /* 00h */
1097 U32 Reserved1; /* 08h */
1098 U32 Reserved2; /* 0Ch */
1099 U8 LUN[8]; /* 10h */
1100 U32 Reserved3; /* 18h */
1101 U32 Reserved4; /* 1Ch */
1102 U32 Reserved5; /* 20h */
1103 U32 Reserved6; /* 24h */
1104 U32 Reserved7; /* 28h */
1105 U32 Reserved8; /* 2Ch */
1106 U32 Reserved9; /* 30h */
1107 U32 Reserved10; /* 34h */
1108 U32 Reserved11; /* 38h */
1109 U32 Reserved12; /* 3Ch */
1110 U32 Reserved13; /* 40h */
1111} MPI_BOOT_DEVICE_SAS_WWN, MPI_POINTER PTR_MPI_BOOT_DEVICE_SAS_WWN;
1112
1113typedef struct _MPI_BOOT_DEVICE_ENCLOSURE_SLOT
1114{
1115 U64 EnclosureLogicalID; /* 00h */
1116 U32 Reserved1; /* 08h */
1117 U32 Reserved2; /* 0Ch */
1118 U8 LUN[8]; /* 10h */
1119 U16 SlotNumber; /* 18h */
1120 U16 Reserved3; /* 1Ah */
1121 U32 Reserved4; /* 1Ch */
1122 U32 Reserved5; /* 20h */
1123 U32 Reserved6; /* 24h */
1124 U32 Reserved7; /* 28h */
1125 U32 Reserved8; /* 2Ch */
1126 U32 Reserved9; /* 30h */
1127 U32 Reserved10; /* 34h */
1128 U32 Reserved11; /* 38h */
1129 U32 Reserved12; /* 3Ch */
1130 U32 Reserved13; /* 40h */
1131} MPI_BOOT_DEVICE_ENCLOSURE_SLOT,
1132 MPI_POINTER PTR_MPI_BOOT_DEVICE_ENCLOSURE_SLOT;
1133
1134typedef union _MPI_BIOSPAGE2_BOOT_DEVICE
1135{
1136 MPI_BOOT_DEVICE_ADAPTER_ORDER AdapterOrder;
1137 MPI_BOOT_DEVICE_ADAPTER_NUMBER AdapterNumber;
1138 MPI_BOOT_DEVICE_PCI_ADDRESS PCIAddress;
1139 MPI_BOOT_DEVICE_PCI_SLOT_NUMBER PCISlotNumber;
1140 MPI_BOOT_DEVICE_FC_WWN FcWwn;
1141 MPI_BOOT_DEVICE_SAS_WWN SasWwn;
1142 MPI_BOOT_DEVICE_ENCLOSURE_SLOT EnclosureSlot;
1143} MPI_BIOSPAGE2_BOOT_DEVICE, MPI_POINTER PTR_MPI_BIOSPAGE2_BOOT_DEVICE;
1144
1145typedef struct _CONFIG_PAGE_BIOS_2
1146{
1147 CONFIG_PAGE_HEADER Header; /* 00h */
1148 U32 Reserved1; /* 04h */
1149 U32 Reserved2; /* 08h */
1150 U32 Reserved3; /* 0Ch */
1151 U32 Reserved4; /* 10h */
1152 U32 Reserved5; /* 14h */
1153 U32 Reserved6; /* 18h */
1154 U8 BootDeviceForm; /* 1Ch */
1155 U8 Reserved7; /* 1Dh */
1156 U16 Reserved8; /* 1Eh */
1157 MPI_BIOSPAGE2_BOOT_DEVICE BootDevice; /* 20h */
1158} CONFIG_PAGE_BIOS_2, MPI_POINTER PTR_CONFIG_PAGE_BIOS_2,
1159 BIOSPage2_t, MPI_POINTER pBIOSPage2_t;
1160
1161#define MPI_BIOSPAGE2_PAGEVERSION (0x01)
1162
1163#define MPI_BIOSPAGE2_FORM_MASK (0x0F)
1164#define MPI_BIOSPAGE2_FORM_ADAPTER_ORDER (0x00)
1165#define MPI_BIOSPAGE2_FORM_ADAPTER_NUMBER (0x01)
1166#define MPI_BIOSPAGE2_FORM_PCI_ADDRESS (0x02)
1167#define MPI_BIOSPAGE2_FORM_PCI_SLOT_NUMBER (0x03)
1168#define MPI_BIOSPAGE2_FORM_FC_WWN (0x04)
1169#define MPI_BIOSPAGE2_FORM_SAS_WWN (0x05)
1170
817 1171
818/**************************************************************************** 1172/****************************************************************************
819* SCSI Port Config Pages 1173* SCSI Port Config Pages
@@ -821,13 +1175,13 @@ typedef struct _CONFIG_PAGE_BIOS_1
821 1175
822typedef struct _CONFIG_PAGE_SCSI_PORT_0 1176typedef struct _CONFIG_PAGE_SCSI_PORT_0
823{ 1177{
824 fCONFIG_PAGE_HEADER Header; /* 00h */ 1178 CONFIG_PAGE_HEADER Header; /* 00h */
825 U32 Capabilities; /* 04h */ 1179 U32 Capabilities; /* 04h */
826 U32 PhysicalInterface; /* 08h */ 1180 U32 PhysicalInterface; /* 08h */
827} fCONFIG_PAGE_SCSI_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_0, 1181} CONFIG_PAGE_SCSI_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_0,
828 SCSIPortPage0_t, MPI_POINTER pSCSIPortPage0_t; 1182 SCSIPortPage0_t, MPI_POINTER pSCSIPortPage0_t;
829 1183
830#define MPI_SCSIPORTPAGE0_PAGEVERSION (0x01) 1184#define MPI_SCSIPORTPAGE0_PAGEVERSION (0x02)
831 1185
832#define MPI_SCSIPORTPAGE0_CAP_IU (0x00000001) 1186#define MPI_SCSIPORTPAGE0_CAP_IU (0x00000001)
833#define MPI_SCSIPORTPAGE0_CAP_DT (0x00000002) 1187#define MPI_SCSIPORTPAGE0_CAP_DT (0x00000002)
@@ -854,6 +1208,7 @@ typedef struct _CONFIG_PAGE_SCSI_PORT_0
854 ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MAX_SYNC_OFFSET) \ 1208 ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MAX_SYNC_OFFSET) \
855 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET \ 1209 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET \
856 ) 1210 )
1211#define MPI_SCSIPORTPAGE0_CAP_IDP (0x08000000)
857#define MPI_SCSIPORTPAGE0_CAP_WIDE (0x20000000) 1212#define MPI_SCSIPORTPAGE0_CAP_WIDE (0x20000000)
858#define MPI_SCSIPORTPAGE0_CAP_AIP (0x80000000) 1213#define MPI_SCSIPORTPAGE0_CAP_AIP (0x80000000)
859 1214
@@ -869,13 +1224,13 @@ typedef struct _CONFIG_PAGE_SCSI_PORT_0
869 1224
870typedef struct _CONFIG_PAGE_SCSI_PORT_1 1225typedef struct _CONFIG_PAGE_SCSI_PORT_1
871{ 1226{
872 fCONFIG_PAGE_HEADER Header; /* 00h */ 1227 CONFIG_PAGE_HEADER Header; /* 00h */
873 U32 Configuration; /* 04h */ 1228 U32 Configuration; /* 04h */
874 U32 OnBusTimerValue; /* 08h */ 1229 U32 OnBusTimerValue; /* 08h */
875 U8 TargetConfig; /* 0Ch */ 1230 U8 TargetConfig; /* 0Ch */
876 U8 Reserved1; /* 0Dh */ 1231 U8 Reserved1; /* 0Dh */
877 U16 IDConfig; /* 0Eh */ 1232 U16 IDConfig; /* 0Eh */
878} fCONFIG_PAGE_SCSI_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_1, 1233} CONFIG_PAGE_SCSI_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_1,
879 SCSIPortPage1_t, MPI_POINTER pSCSIPortPage1_t; 1234 SCSIPortPage1_t, MPI_POINTER pSCSIPortPage1_t;
880 1235
881#define MPI_SCSIPORTPAGE1_PAGEVERSION (0x03) 1236#define MPI_SCSIPORTPAGE1_PAGEVERSION (0x03)
@@ -900,11 +1255,11 @@ typedef struct _MPI_DEVICE_INFO
900 1255
901typedef struct _CONFIG_PAGE_SCSI_PORT_2 1256typedef struct _CONFIG_PAGE_SCSI_PORT_2
902{ 1257{
903 fCONFIG_PAGE_HEADER Header; /* 00h */ 1258 CONFIG_PAGE_HEADER Header; /* 00h */
904 U32 PortFlags; /* 04h */ 1259 U32 PortFlags; /* 04h */
905 U32 PortSettings; /* 08h */ 1260 U32 PortSettings; /* 08h */
906 MPI_DEVICE_INFO DeviceSettings[16]; /* 0Ch */ 1261 MPI_DEVICE_INFO DeviceSettings[16]; /* 0Ch */
907} fCONFIG_PAGE_SCSI_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_2, 1262} CONFIG_PAGE_SCSI_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_2,
908 SCSIPortPage2_t, MPI_POINTER pSCSIPortPage2_t; 1263 SCSIPortPage2_t, MPI_POINTER pSCSIPortPage2_t;
909 1264
910#define MPI_SCSIPORTPAGE2_PAGEVERSION (0x02) 1265#define MPI_SCSIPORTPAGE2_PAGEVERSION (0x02)
@@ -953,13 +1308,13 @@ typedef struct _CONFIG_PAGE_SCSI_PORT_2
953 1308
954typedef struct _CONFIG_PAGE_SCSI_DEVICE_0 1309typedef struct _CONFIG_PAGE_SCSI_DEVICE_0
955{ 1310{
956 fCONFIG_PAGE_HEADER Header; /* 00h */ 1311 CONFIG_PAGE_HEADER Header; /* 00h */
957 U32 NegotiatedParameters; /* 04h */ 1312 U32 NegotiatedParameters; /* 04h */
958 U32 Information; /* 08h */ 1313 U32 Information; /* 08h */
959} fCONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0, 1314} CONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0,
960 SCSIDevicePage0_t, MPI_POINTER pSCSIDevicePage0_t; 1315 SCSIDevicePage0_t, MPI_POINTER pSCSIDevicePage0_t;
961 1316
962#define MPI_SCSIDEVPAGE0_PAGEVERSION (0x03) 1317#define MPI_SCSIDEVPAGE0_PAGEVERSION (0x04)
963 1318
964#define MPI_SCSIDEVPAGE0_NP_IU (0x00000001) 1319#define MPI_SCSIDEVPAGE0_NP_IU (0x00000001)
965#define MPI_SCSIDEVPAGE0_NP_DT (0x00000002) 1320#define MPI_SCSIDEVPAGE0_NP_DT (0x00000002)
@@ -973,6 +1328,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_0
973#define MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_PERIOD (8) 1328#define MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_PERIOD (8)
974#define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000) 1329#define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000)
975#define MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_OFFSET (16) 1330#define MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_OFFSET (16)
1331#define MPI_SCSIDEVPAGE0_NP_IDP (0x08000000)
976#define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000) 1332#define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000)
977#define MPI_SCSIDEVPAGE0_NP_AIP (0x80000000) 1333#define MPI_SCSIDEVPAGE0_NP_AIP (0x80000000)
978 1334
@@ -984,14 +1340,14 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_0
984 1340
985typedef struct _CONFIG_PAGE_SCSI_DEVICE_1 1341typedef struct _CONFIG_PAGE_SCSI_DEVICE_1
986{ 1342{
987 fCONFIG_PAGE_HEADER Header; /* 00h */ 1343 CONFIG_PAGE_HEADER Header; /* 00h */
988 U32 RequestedParameters; /* 04h */ 1344 U32 RequestedParameters; /* 04h */
989 U32 Reserved; /* 08h */ 1345 U32 Reserved; /* 08h */
990 U32 Configuration; /* 0Ch */ 1346 U32 Configuration; /* 0Ch */
991} fCONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1, 1347} CONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1,
992 SCSIDevicePage1_t, MPI_POINTER pSCSIDevicePage1_t; 1348 SCSIDevicePage1_t, MPI_POINTER pSCSIDevicePage1_t;
993 1349
994#define MPI_SCSIDEVPAGE1_PAGEVERSION (0x04) 1350#define MPI_SCSIDEVPAGE1_PAGEVERSION (0x05)
995 1351
996#define MPI_SCSIDEVPAGE1_RP_IU (0x00000001) 1352#define MPI_SCSIDEVPAGE1_RP_IU (0x00000001)
997#define MPI_SCSIDEVPAGE1_RP_DT (0x00000002) 1353#define MPI_SCSIDEVPAGE1_RP_DT (0x00000002)
@@ -1005,6 +1361,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_1
1005#define MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD (8) 1361#define MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD (8)
1006#define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000) 1362#define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000)
1007#define MPI_SCSIDEVPAGE1_RP_SHIFT_MAX_SYNC_OFFSET (16) 1363#define MPI_SCSIDEVPAGE1_RP_SHIFT_MAX_SYNC_OFFSET (16)
1364#define MPI_SCSIDEVPAGE1_RP_IDP (0x08000000)
1008#define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000) 1365#define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000)
1009#define MPI_SCSIDEVPAGE1_RP_AIP (0x80000000) 1366#define MPI_SCSIDEVPAGE1_RP_AIP (0x80000000)
1010 1367
@@ -1016,11 +1373,11 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_1
1016 1373
1017typedef struct _CONFIG_PAGE_SCSI_DEVICE_2 1374typedef struct _CONFIG_PAGE_SCSI_DEVICE_2
1018{ 1375{
1019 fCONFIG_PAGE_HEADER Header; /* 00h */ 1376 CONFIG_PAGE_HEADER Header; /* 00h */
1020 U32 DomainValidation; /* 04h */ 1377 U32 DomainValidation; /* 04h */
1021 U32 ParityPipeSelect; /* 08h */ 1378 U32 ParityPipeSelect; /* 08h */
1022 U32 DataPipeSelect; /* 0Ch */ 1379 U32 DataPipeSelect; /* 0Ch */
1023} fCONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2, 1380} CONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2,
1024 SCSIDevicePage2_t, MPI_POINTER pSCSIDevicePage2_t; 1381 SCSIDevicePage2_t, MPI_POINTER pSCSIDevicePage2_t;
1025 1382
1026#define MPI_SCSIDEVPAGE2_PAGEVERSION (0x01) 1383#define MPI_SCSIDEVPAGE2_PAGEVERSION (0x01)
@@ -1057,12 +1414,12 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_2
1057 1414
1058typedef struct _CONFIG_PAGE_SCSI_DEVICE_3 1415typedef struct _CONFIG_PAGE_SCSI_DEVICE_3
1059{ 1416{
1060 fCONFIG_PAGE_HEADER Header; /* 00h */ 1417 CONFIG_PAGE_HEADER Header; /* 00h */
1061 U16 MsgRejectCount; /* 04h */ 1418 U16 MsgRejectCount; /* 04h */
1062 U16 PhaseErrorCount; /* 06h */ 1419 U16 PhaseErrorCount; /* 06h */
1063 U16 ParityErrorCount; /* 08h */ 1420 U16 ParityErrorCount; /* 08h */
1064 U16 Reserved; /* 0Ah */ 1421 U16 Reserved; /* 0Ah */
1065} fCONFIG_PAGE_SCSI_DEVICE_3, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_3, 1422} CONFIG_PAGE_SCSI_DEVICE_3, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_3,
1066 SCSIDevicePage3_t, MPI_POINTER pSCSIDevicePage3_t; 1423 SCSIDevicePage3_t, MPI_POINTER pSCSIDevicePage3_t;
1067 1424
1068#define MPI_SCSIDEVPAGE3_PAGEVERSION (0x00) 1425#define MPI_SCSIDEVPAGE3_PAGEVERSION (0x00)
@@ -1077,7 +1434,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_3
1077 1434
1078typedef struct _CONFIG_PAGE_FC_PORT_0 1435typedef struct _CONFIG_PAGE_FC_PORT_0
1079{ 1436{
1080 fCONFIG_PAGE_HEADER Header; /* 00h */ 1437 CONFIG_PAGE_HEADER Header; /* 00h */
1081 U32 Flags; /* 04h */ 1438 U32 Flags; /* 04h */
1082 U8 MPIPortNumber; /* 08h */ 1439 U8 MPIPortNumber; /* 08h */
1083 U8 LinkType; /* 09h */ 1440 U8 LinkType; /* 09h */
@@ -1098,7 +1455,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_0
1098 U8 MaxHardAliasesSupported; /* 49h */ 1455 U8 MaxHardAliasesSupported; /* 49h */
1099 U8 NumCurrentAliases; /* 4Ah */ 1456 U8 NumCurrentAliases; /* 4Ah */
1100 U8 Reserved1; /* 4Bh */ 1457 U8 Reserved1; /* 4Bh */
1101} fCONFIG_PAGE_FC_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_0, 1458} CONFIG_PAGE_FC_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_0,
1102 FCPortPage0_t, MPI_POINTER pFCPortPage0_t; 1459 FCPortPage0_t, MPI_POINTER pFCPortPage0_t;
1103 1460
1104#define MPI_FCPORTPAGE0_PAGEVERSION (0x02) 1461#define MPI_FCPORTPAGE0_PAGEVERSION (0x02)
@@ -1164,10 +1521,9 @@ typedef struct _CONFIG_PAGE_FC_PORT_0
1164#define MPI_FCPORTPAGE0_CURRENT_SPEED_NOT_NEGOTIATED (0x00008000) /* (SNIA)HBA_PORTSPEED_NOT_NEGOTIATED (1<<15) Speed not established */ 1521#define MPI_FCPORTPAGE0_CURRENT_SPEED_NOT_NEGOTIATED (0x00008000) /* (SNIA)HBA_PORTSPEED_NOT_NEGOTIATED (1<<15) Speed not established */
1165 1522
1166 1523
1167
1168typedef struct _CONFIG_PAGE_FC_PORT_1 1524typedef struct _CONFIG_PAGE_FC_PORT_1
1169{ 1525{
1170 fCONFIG_PAGE_HEADER Header; /* 00h */ 1526 CONFIG_PAGE_HEADER Header; /* 00h */
1171 U32 Flags; /* 04h */ 1527 U32 Flags; /* 04h */
1172 U64 NoSEEPROMWWNN; /* 08h */ 1528 U64 NoSEEPROMWWNN; /* 08h */
1173 U64 NoSEEPROMWWPN; /* 10h */ 1529 U64 NoSEEPROMWWPN; /* 10h */
@@ -1179,7 +1535,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_1
1179 U8 RR_TOV; /* 1Dh */ 1535 U8 RR_TOV; /* 1Dh */
1180 U8 InitiatorDeviceTimeout; /* 1Eh */ 1536 U8 InitiatorDeviceTimeout; /* 1Eh */
1181 U8 InitiatorIoPendTimeout; /* 1Fh */ 1537 U8 InitiatorIoPendTimeout; /* 1Fh */
1182} fCONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1, 1538} CONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1,
1183 FCPortPage1_t, MPI_POINTER pFCPortPage1_t; 1539 FCPortPage1_t, MPI_POINTER pFCPortPage1_t;
1184 1540
1185#define MPI_FCPORTPAGE1_PAGEVERSION (0x06) 1541#define MPI_FCPORTPAGE1_PAGEVERSION (0x06)
@@ -1191,6 +1547,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_1
1191#define MPI_FCPORTPAGE1_FLAGS_TARGET_MODE_OXID (0x00800000) 1547#define MPI_FCPORTPAGE1_FLAGS_TARGET_MODE_OXID (0x00800000)
1192#define MPI_FCPORTPAGE1_FLAGS_PORT_OFFLINE (0x00400000) 1548#define MPI_FCPORTPAGE1_FLAGS_PORT_OFFLINE (0x00400000)
1193#define MPI_FCPORTPAGE1_FLAGS_SOFT_ALPA_FALLBACK (0x00200000) 1549#define MPI_FCPORTPAGE1_FLAGS_SOFT_ALPA_FALLBACK (0x00200000)
1550#define MPI_FCPORTPAGE1_FLAGS_TARGET_LARGE_CDB_ENABLE (0x00000080)
1194#define MPI_FCPORTPAGE1_FLAGS_MASK_RR_TOV_UNITS (0x00000070) 1551#define MPI_FCPORTPAGE1_FLAGS_MASK_RR_TOV_UNITS (0x00000070)
1195#define MPI_FCPORTPAGE1_FLAGS_SUPPRESS_PROT_REG (0x00000008) 1552#define MPI_FCPORTPAGE1_FLAGS_SUPPRESS_PROT_REG (0x00000008)
1196#define MPI_FCPORTPAGE1_FLAGS_PLOGI_ON_LOGO (0x00000004) 1553#define MPI_FCPORTPAGE1_FLAGS_PLOGI_ON_LOGO (0x00000004)
@@ -1227,14 +1584,15 @@ typedef struct _CONFIG_PAGE_FC_PORT_1
1227#define MPI_FCPORTPAGE1_ALT_CONN_UNKNOWN (0x00) 1584#define MPI_FCPORTPAGE1_ALT_CONN_UNKNOWN (0x00)
1228 1585
1229#define MPI_FCPORTPAGE1_INITIATOR_DEV_TIMEOUT_MASK (0x7F) 1586#define MPI_FCPORTPAGE1_INITIATOR_DEV_TIMEOUT_MASK (0x7F)
1587#define MPI_FCPORTPAGE1_INITIATOR_DEV_UNIT_16 (0x80)
1230 1588
1231 1589
1232typedef struct _CONFIG_PAGE_FC_PORT_2 1590typedef struct _CONFIG_PAGE_FC_PORT_2
1233{ 1591{
1234 fCONFIG_PAGE_HEADER Header; /* 00h */ 1592 CONFIG_PAGE_HEADER Header; /* 00h */
1235 U8 NumberActive; /* 04h */ 1593 U8 NumberActive; /* 04h */
1236 U8 ALPA[127]; /* 05h */ 1594 U8 ALPA[127]; /* 05h */
1237} fCONFIG_PAGE_FC_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_2, 1595} CONFIG_PAGE_FC_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_2,
1238 FCPortPage2_t, MPI_POINTER pFCPortPage2_t; 1596 FCPortPage2_t, MPI_POINTER pFCPortPage2_t;
1239 1597
1240#define MPI_FCPORTPAGE2_PAGEVERSION (0x01) 1598#define MPI_FCPORTPAGE2_PAGEVERSION (0x01)
@@ -1280,9 +1638,9 @@ typedef struct _FC_PORT_PERSISTENT
1280 1638
1281typedef struct _CONFIG_PAGE_FC_PORT_3 1639typedef struct _CONFIG_PAGE_FC_PORT_3
1282{ 1640{
1283 fCONFIG_PAGE_HEADER Header; /* 00h */ 1641 CONFIG_PAGE_HEADER Header; /* 00h */
1284 FC_PORT_PERSISTENT Entry[MPI_FC_PORT_PAGE_3_ENTRY_MAX]; /* 04h */ 1642 FC_PORT_PERSISTENT Entry[MPI_FC_PORT_PAGE_3_ENTRY_MAX]; /* 04h */
1285} fCONFIG_PAGE_FC_PORT_3, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_3, 1643} CONFIG_PAGE_FC_PORT_3, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_3,
1286 FCPortPage3_t, MPI_POINTER pFCPortPage3_t; 1644 FCPortPage3_t, MPI_POINTER pFCPortPage3_t;
1287 1645
1288#define MPI_FCPORTPAGE3_PAGEVERSION (0x01) 1646#define MPI_FCPORTPAGE3_PAGEVERSION (0x01)
@@ -1290,10 +1648,10 @@ typedef struct _CONFIG_PAGE_FC_PORT_3
1290 1648
1291typedef struct _CONFIG_PAGE_FC_PORT_4 1649typedef struct _CONFIG_PAGE_FC_PORT_4
1292{ 1650{
1293 fCONFIG_PAGE_HEADER Header; /* 00h */ 1651 CONFIG_PAGE_HEADER Header; /* 00h */
1294 U32 PortFlags; /* 04h */ 1652 U32 PortFlags; /* 04h */
1295 U32 PortSettings; /* 08h */ 1653 U32 PortSettings; /* 08h */
1296} fCONFIG_PAGE_FC_PORT_4, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_4, 1654} CONFIG_PAGE_FC_PORT_4, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_4,
1297 FCPortPage4_t, MPI_POINTER pFCPortPage4_t; 1655 FCPortPage4_t, MPI_POINTER pFCPortPage4_t;
1298 1656
1299#define MPI_FCPORTPAGE4_PAGEVERSION (0x00) 1657#define MPI_FCPORTPAGE4_PAGEVERSION (0x00)
@@ -1316,15 +1674,15 @@ typedef struct _CONFIG_PAGE_FC_PORT_5_ALIAS_INFO
1316 U16 Reserved; /* 02h */ 1674 U16 Reserved; /* 02h */
1317 U64 AliasWWNN; /* 04h */ 1675 U64 AliasWWNN; /* 04h */
1318 U64 AliasWWPN; /* 0Ch */ 1676 U64 AliasWWPN; /* 0Ch */
1319} fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO, 1677} CONFIG_PAGE_FC_PORT_5_ALIAS_INFO,
1320 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO, 1678 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO,
1321 FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t; 1679 FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t;
1322 1680
1323typedef struct _CONFIG_PAGE_FC_PORT_5 1681typedef struct _CONFIG_PAGE_FC_PORT_5
1324{ 1682{
1325 fCONFIG_PAGE_HEADER Header; /* 00h */ 1683 CONFIG_PAGE_HEADER Header; /* 00h */
1326 fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo; /* 04h */ 1684 CONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo; /* 04h */
1327} fCONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5, 1685} CONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5,
1328 FCPortPage5_t, MPI_POINTER pFCPortPage5_t; 1686 FCPortPage5_t, MPI_POINTER pFCPortPage5_t;
1329 1687
1330#define MPI_FCPORTPAGE5_PAGEVERSION (0x02) 1688#define MPI_FCPORTPAGE5_PAGEVERSION (0x02)
@@ -1337,7 +1695,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_5
1337 1695
1338typedef struct _CONFIG_PAGE_FC_PORT_6 1696typedef struct _CONFIG_PAGE_FC_PORT_6
1339{ 1697{
1340 fCONFIG_PAGE_HEADER Header; /* 00h */ 1698 CONFIG_PAGE_HEADER Header; /* 00h */
1341 U32 Reserved; /* 04h */ 1699 U32 Reserved; /* 04h */
1342 U64 TimeSinceReset; /* 08h */ 1700 U64 TimeSinceReset; /* 08h */
1343 U64 TxFrames; /* 10h */ 1701 U64 TxFrames; /* 10h */
@@ -1355,7 +1713,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_6
1355 U64 InvalidTxWordCount; /* 70h */ 1713 U64 InvalidTxWordCount; /* 70h */
1356 U64 InvalidCrcCount; /* 78h */ 1714 U64 InvalidCrcCount; /* 78h */
1357 U64 FcpInitiatorIoCount; /* 80h */ 1715 U64 FcpInitiatorIoCount; /* 80h */
1358} fCONFIG_PAGE_FC_PORT_6, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_6, 1716} CONFIG_PAGE_FC_PORT_6, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_6,
1359 FCPortPage6_t, MPI_POINTER pFCPortPage6_t; 1717 FCPortPage6_t, MPI_POINTER pFCPortPage6_t;
1360 1718
1361#define MPI_FCPORTPAGE6_PAGEVERSION (0x00) 1719#define MPI_FCPORTPAGE6_PAGEVERSION (0x00)
@@ -1363,10 +1721,10 @@ typedef struct _CONFIG_PAGE_FC_PORT_6
1363 1721
1364typedef struct _CONFIG_PAGE_FC_PORT_7 1722typedef struct _CONFIG_PAGE_FC_PORT_7
1365{ 1723{
1366 fCONFIG_PAGE_HEADER Header; /* 00h */ 1724 CONFIG_PAGE_HEADER Header; /* 00h */
1367 U32 Reserved; /* 04h */ 1725 U32 Reserved; /* 04h */
1368 U8 PortSymbolicName[256]; /* 08h */ 1726 U8 PortSymbolicName[256]; /* 08h */
1369} fCONFIG_PAGE_FC_PORT_7, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_7, 1727} CONFIG_PAGE_FC_PORT_7, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_7,
1370 FCPortPage7_t, MPI_POINTER pFCPortPage7_t; 1728 FCPortPage7_t, MPI_POINTER pFCPortPage7_t;
1371 1729
1372#define MPI_FCPORTPAGE7_PAGEVERSION (0x00) 1730#define MPI_FCPORTPAGE7_PAGEVERSION (0x00)
@@ -1374,9 +1732,9 @@ typedef struct _CONFIG_PAGE_FC_PORT_7
1374 1732
1375typedef struct _CONFIG_PAGE_FC_PORT_8 1733typedef struct _CONFIG_PAGE_FC_PORT_8
1376{ 1734{
1377 fCONFIG_PAGE_HEADER Header; /* 00h */ 1735 CONFIG_PAGE_HEADER Header; /* 00h */
1378 U32 BitVector[8]; /* 04h */ 1736 U32 BitVector[8]; /* 04h */
1379} fCONFIG_PAGE_FC_PORT_8, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_8, 1737} CONFIG_PAGE_FC_PORT_8, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_8,
1380 FCPortPage8_t, MPI_POINTER pFCPortPage8_t; 1738 FCPortPage8_t, MPI_POINTER pFCPortPage8_t;
1381 1739
1382#define MPI_FCPORTPAGE8_PAGEVERSION (0x00) 1740#define MPI_FCPORTPAGE8_PAGEVERSION (0x00)
@@ -1384,7 +1742,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_8
1384 1742
1385typedef struct _CONFIG_PAGE_FC_PORT_9 1743typedef struct _CONFIG_PAGE_FC_PORT_9
1386{ 1744{
1387 fCONFIG_PAGE_HEADER Header; /* 00h */ 1745 CONFIG_PAGE_HEADER Header; /* 00h */
1388 U32 Reserved; /* 04h */ 1746 U32 Reserved; /* 04h */
1389 U64 GlobalWWPN; /* 08h */ 1747 U64 GlobalWWPN; /* 08h */
1390 U64 GlobalWWNN; /* 10h */ 1748 U64 GlobalWWNN; /* 10h */
@@ -1396,7 +1754,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_9
1396 U8 IPAddress[16]; /* 28h */ 1754 U8 IPAddress[16]; /* 28h */
1397 U16 Reserved1; /* 38h */ 1755 U16 Reserved1; /* 38h */
1398 U16 TopologyDiscoveryFlags; /* 3Ah */ 1756 U16 TopologyDiscoveryFlags; /* 3Ah */
1399} fCONFIG_PAGE_FC_PORT_9, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_9, 1757} CONFIG_PAGE_FC_PORT_9, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_9,
1400 FCPortPage9_t, MPI_POINTER pFCPortPage9_t; 1758 FCPortPage9_t, MPI_POINTER pFCPortPage9_t;
1401 1759
1402#define MPI_FCPORTPAGE9_PAGEVERSION (0x00) 1760#define MPI_FCPORTPAGE9_PAGEVERSION (0x00)
@@ -1422,10 +1780,10 @@ typedef struct _CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA
1422 U8 VendorOUI[3]; /* 35h */ 1780 U8 VendorOUI[3]; /* 35h */
1423 U8 VendorPN[16]; /* 38h */ 1781 U8 VendorPN[16]; /* 38h */
1424 U8 VendorRev[4]; /* 48h */ 1782 U8 VendorRev[4]; /* 48h */
1425 U16 Reserved4; /* 4Ch */ 1783 U16 Wavelength; /* 4Ch */
1426 U8 Reserved5; /* 4Eh */ 1784 U8 Reserved4; /* 4Eh */
1427 U8 CC_BASE; /* 4Fh */ 1785 U8 CC_BASE; /* 4Fh */
1428} fCONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA, 1786} CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA,
1429 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA, 1787 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA,
1430 FCPortPage10BaseSfpData_t, MPI_POINTER pFCPortPage10BaseSfpData_t; 1788 FCPortPage10BaseSfpData_t, MPI_POINTER pFCPortPage10BaseSfpData_t;
1431 1789
@@ -1481,9 +1839,11 @@ typedef struct _CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA
1481 U8 BitRateMin; /* 53h */ 1839 U8 BitRateMin; /* 53h */
1482 U8 VendorSN[16]; /* 54h */ 1840 U8 VendorSN[16]; /* 54h */
1483 U8 DateCode[8]; /* 64h */ 1841 U8 DateCode[8]; /* 64h */
1484 U8 Reserved5[3]; /* 6Ch */ 1842 U8 DiagMonitoringType; /* 6Ch */
1843 U8 EnhancedOptions; /* 6Dh */
1844 U8 SFF8472Compliance; /* 6Eh */
1485 U8 CC_EXT; /* 6Fh */ 1845 U8 CC_EXT; /* 6Fh */
1486} fCONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA, 1846} CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA,
1487 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA, 1847 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA,
1488 FCPortPage10ExtendedSfpData_t, MPI_POINTER pFCPortPage10ExtendedSfpData_t; 1848 FCPortPage10ExtendedSfpData_t, MPI_POINTER pFCPortPage10ExtendedSfpData_t;
1489 1849
@@ -1496,19 +1856,19 @@ typedef struct _CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA
1496 1856
1497typedef struct _CONFIG_PAGE_FC_PORT_10 1857typedef struct _CONFIG_PAGE_FC_PORT_10
1498{ 1858{
1499 fCONFIG_PAGE_HEADER Header; /* 00h */ 1859 CONFIG_PAGE_HEADER Header; /* 00h */
1500 U8 Flags; /* 04h */ 1860 U8 Flags; /* 04h */
1501 U8 Reserved1; /* 05h */ 1861 U8 Reserved1; /* 05h */
1502 U16 Reserved2; /* 06h */ 1862 U16 Reserved2; /* 06h */
1503 U32 HwConfig1; /* 08h */ 1863 U32 HwConfig1; /* 08h */
1504 U32 HwConfig2; /* 0Ch */ 1864 U32 HwConfig2; /* 0Ch */
1505 fCONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA Base; /* 10h */ 1865 CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA Base; /* 10h */
1506 fCONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA Extended; /* 50h */ 1866 CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA Extended; /* 50h */
1507 U8 VendorSpecific[32]; /* 70h */ 1867 U8 VendorSpecific[32]; /* 70h */
1508} fCONFIG_PAGE_FC_PORT_10, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10, 1868} CONFIG_PAGE_FC_PORT_10, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10,
1509 FCPortPage10_t, MPI_POINTER pFCPortPage10_t; 1869 FCPortPage10_t, MPI_POINTER pFCPortPage10_t;
1510 1870
1511#define MPI_FCPORTPAGE10_PAGEVERSION (0x00) 1871#define MPI_FCPORTPAGE10_PAGEVERSION (0x01)
1512 1872
1513/* standard MODDEF pin definitions (from GBIC spec.) */ 1873/* standard MODDEF pin definitions (from GBIC spec.) */
1514#define MPI_FCPORTPAGE10_FLAGS_MODDEF_MASK (0x00000007) 1874#define MPI_FCPORTPAGE10_FLAGS_MODDEF_MASK (0x00000007)
@@ -1534,7 +1894,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_10
1534 1894
1535typedef struct _CONFIG_PAGE_FC_DEVICE_0 1895typedef struct _CONFIG_PAGE_FC_DEVICE_0
1536{ 1896{
1537 fCONFIG_PAGE_HEADER Header; /* 00h */ 1897 CONFIG_PAGE_HEADER Header; /* 00h */
1538 U64 WWNN; /* 04h */ 1898 U64 WWNN; /* 04h */
1539 U64 WWPN; /* 0Ch */ 1899 U64 WWPN; /* 0Ch */
1540 U32 PortIdentifier; /* 14h */ 1900 U32 PortIdentifier; /* 14h */
@@ -1548,7 +1908,7 @@ typedef struct _CONFIG_PAGE_FC_DEVICE_0
1548 U8 FcPhHighestVersion; /* 21h */ 1908 U8 FcPhHighestVersion; /* 21h */
1549 U8 CurrentTargetID; /* 22h */ 1909 U8 CurrentTargetID; /* 22h */
1550 U8 CurrentBus; /* 23h */ 1910 U8 CurrentBus; /* 23h */
1551} fCONFIG_PAGE_FC_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_FC_DEVICE_0, 1911} CONFIG_PAGE_FC_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_FC_DEVICE_0,
1552 FCDevicePage0_t, MPI_POINTER pFCDevicePage0_t; 1912 FCDevicePage0_t, MPI_POINTER pFCDevicePage0_t;
1553 1913
1554#define MPI_FC_DEVICE_PAGE0_PAGEVERSION (0x03) 1914#define MPI_FC_DEVICE_PAGE0_PAGEVERSION (0x03)
@@ -1606,6 +1966,7 @@ typedef struct _RAID_VOL0_STATUS
1606#define MPI_RAIDVOL0_STATUS_STATE_OPTIMAL (0x00) 1966#define MPI_RAIDVOL0_STATUS_STATE_OPTIMAL (0x00)
1607#define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01) 1967#define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01)
1608#define MPI_RAIDVOL0_STATUS_STATE_FAILED (0x02) 1968#define MPI_RAIDVOL0_STATUS_STATE_FAILED (0x02)
1969#define MPI_RAIDVOL0_STATUS_STATE_MISSING (0x03)
1609 1970
1610typedef struct _RAID_VOL0_SETTINGS 1971typedef struct _RAID_VOL0_SETTINGS
1611{ 1972{
@@ -1616,11 +1977,11 @@ typedef struct _RAID_VOL0_SETTINGS
1616 RaidVol0Settings, MPI_POINTER pRaidVol0Settings; 1977 RaidVol0Settings, MPI_POINTER pRaidVol0Settings;
1617 1978
1618/* RAID Volume Page 0 VolumeSettings defines */ 1979/* RAID Volume Page 0 VolumeSettings defines */
1619
1620#define MPI_RAIDVOL0_SETTING_WRITE_CACHING_ENABLE (0x0001) 1980#define MPI_RAIDVOL0_SETTING_WRITE_CACHING_ENABLE (0x0001)
1621#define MPI_RAIDVOL0_SETTING_OFFLINE_ON_SMART (0x0002) 1981#define MPI_RAIDVOL0_SETTING_OFFLINE_ON_SMART (0x0002)
1622#define MPI_RAIDVOL0_SETTING_AUTO_CONFIGURE (0x0004) 1982#define MPI_RAIDVOL0_SETTING_AUTO_CONFIGURE (0x0004)
1623#define MPI_RAIDVOL0_SETTING_PRIORITY_RESYNC (0x0008) 1983#define MPI_RAIDVOL0_SETTING_PRIORITY_RESYNC (0x0008)
1984#define MPI_RAIDVOL0_SETTING_FAST_DATA_SCRUBBING_0102 (0x0020) /* obsolete */
1624#define MPI_RAIDVOL0_SETTING_USE_PRODUCT_ID_SUFFIX (0x0010) 1985#define MPI_RAIDVOL0_SETTING_USE_PRODUCT_ID_SUFFIX (0x0010)
1625#define MPI_RAIDVOL0_SETTING_USE_DEFAULTS (0x8000) 1986#define MPI_RAIDVOL0_SETTING_USE_DEFAULTS (0x8000)
1626 1987
@@ -1644,7 +2005,7 @@ typedef struct _RAID_VOL0_SETTINGS
1644 2005
1645typedef struct _CONFIG_PAGE_RAID_VOL_0 2006typedef struct _CONFIG_PAGE_RAID_VOL_0
1646{ 2007{
1647 fCONFIG_PAGE_HEADER Header; /* 00h */ 2008 CONFIG_PAGE_HEADER Header; /* 00h */
1648 U8 VolumeID; /* 04h */ 2009 U8 VolumeID; /* 04h */
1649 U8 VolumeBus; /* 05h */ 2010 U8 VolumeBus; /* 05h */
1650 U8 VolumeIOC; /* 06h */ 2011 U8 VolumeIOC; /* 06h */
@@ -1657,13 +2018,41 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
1657 U32 Reserved2; /* 1Ch */ 2018 U32 Reserved2; /* 1Ch */
1658 U32 Reserved3; /* 20h */ 2019 U32 Reserved3; /* 20h */
1659 U8 NumPhysDisks; /* 24h */ 2020 U8 NumPhysDisks; /* 24h */
1660 U8 Reserved4; /* 25h */ 2021 U8 DataScrubRate; /* 25h */
1661 U16 Reserved5; /* 26h */ 2022 U8 ResyncRate; /* 26h */
2023 U8 InactiveStatus; /* 27h */
1662 RAID_VOL0_PHYS_DISK PhysDisk[MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX];/* 28h */ 2024 RAID_VOL0_PHYS_DISK PhysDisk[MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX];/* 28h */
1663} fCONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0, 2025} CONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0,
1664 RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t; 2026 RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t;
1665 2027
1666#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x01) 2028#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x04)
2029
2030/* values for RAID Volume Page 0 InactiveStatus field */
2031#define MPI_RAIDVOLPAGE0_UNKNOWN_INACTIVE (0x00)
2032#define MPI_RAIDVOLPAGE0_STALE_METADATA_INACTIVE (0x01)
2033#define MPI_RAIDVOLPAGE0_FOREIGN_VOLUME_INACTIVE (0x02)
2034#define MPI_RAIDVOLPAGE0_INSUFFICIENT_RESOURCE_INACTIVE (0x03)
2035#define MPI_RAIDVOLPAGE0_CLONE_VOLUME_INACTIVE (0x04)
2036#define MPI_RAIDVOLPAGE0_INSUFFICIENT_METADATA_INACTIVE (0x05)
2037#define MPI_RAIDVOLPAGE0_PREVIOUSLY_DELETED (0x06)
2038
2039
2040typedef struct _CONFIG_PAGE_RAID_VOL_1
2041{
2042 CONFIG_PAGE_HEADER Header; /* 00h */
2043 U8 VolumeID; /* 01h */
2044 U8 VolumeBus; /* 02h */
2045 U8 VolumeIOC; /* 03h */
2046 U8 Reserved0; /* 04h */
2047 U8 GUID[24]; /* 05h */
2048 U8 Name[32]; /* 20h */
2049 U64 WWID; /* 40h */
2050 U32 Reserved1; /* 48h */
2051 U32 Reserved2; /* 4Ch */
2052} CONFIG_PAGE_RAID_VOL_1, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_1,
2053 RaidVolumePage1_t, MPI_POINTER pRaidVolumePage1_t;
2054
2055#define MPI_RAIDVOLPAGE1_PAGEVERSION (0x01)
1667 2056
1668 2057
1669/**************************************************************************** 2058/****************************************************************************
@@ -1714,6 +2103,7 @@ typedef struct _RAID_PHYS_DISK0_STATUS
1714 2103
1715#define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01) 2104#define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01)
1716#define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02) 2105#define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02)
2106#define MPI_PHYSDISK0_STATUS_FLAG_INACTIVE_VOLUME (0x04)
1717 2107
1718#define MPI_PHYSDISK0_STATUS_ONLINE (0x00) 2108#define MPI_PHYSDISK0_STATUS_ONLINE (0x00)
1719#define MPI_PHYSDISK0_STATUS_MISSING (0x01) 2109#define MPI_PHYSDISK0_STATUS_MISSING (0x01)
@@ -1726,24 +2116,54 @@ typedef struct _RAID_PHYS_DISK0_STATUS
1726 2116
1727typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_0 2117typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_0
1728{ 2118{
1729 fCONFIG_PAGE_HEADER Header; /* 00h */ 2119 CONFIG_PAGE_HEADER Header; /* 00h */
1730 U8 PhysDiskID; /* 04h */ 2120 U8 PhysDiskID; /* 04h */
1731 U8 PhysDiskBus; /* 05h */ 2121 U8 PhysDiskBus; /* 05h */
1732 U8 PhysDiskIOC; /* 06h */ 2122 U8 PhysDiskIOC; /* 06h */
1733 U8 PhysDiskNum; /* 07h */ 2123 U8 PhysDiskNum; /* 07h */
1734 RAID_PHYS_DISK0_SETTINGS PhysDiskSettings; /* 08h */ 2124 RAID_PHYS_DISK0_SETTINGS PhysDiskSettings; /* 08h */
1735 U32 Reserved1; /* 0Ch */ 2125 U32 Reserved1; /* 0Ch */
1736 U32 Reserved2; /* 10h */ 2126 U8 ExtDiskIdentifier[8]; /* 10h */
1737 U32 Reserved3; /* 14h */
1738 U8 DiskIdentifier[16]; /* 18h */ 2127 U8 DiskIdentifier[16]; /* 18h */
1739 RAID_PHYS_DISK0_INQUIRY_DATA InquiryData; /* 28h */ 2128 RAID_PHYS_DISK0_INQUIRY_DATA InquiryData; /* 28h */
1740 RAID_PHYS_DISK0_STATUS PhysDiskStatus; /* 64h */ 2129 RAID_PHYS_DISK0_STATUS PhysDiskStatus; /* 64h */
1741 U32 MaxLBA; /* 68h */ 2130 U32 MaxLBA; /* 68h */
1742 RAID_PHYS_DISK0_ERROR_DATA ErrorData; /* 6Ch */ 2131 RAID_PHYS_DISK0_ERROR_DATA ErrorData; /* 6Ch */
1743} fCONFIG_PAGE_RAID_PHYS_DISK_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_0, 2132} CONFIG_PAGE_RAID_PHYS_DISK_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_0,
1744 RaidPhysDiskPage0_t, MPI_POINTER pRaidPhysDiskPage0_t; 2133 RaidPhysDiskPage0_t, MPI_POINTER pRaidPhysDiskPage0_t;
1745 2134
1746#define MPI_RAIDPHYSDISKPAGE0_PAGEVERSION (0x00) 2135#define MPI_RAIDPHYSDISKPAGE0_PAGEVERSION (0x01)
2136
2137
2138typedef struct _RAID_PHYS_DISK1_PATH
2139{
2140 U8 PhysDiskID; /* 00h */
2141 U8 PhysDiskBus; /* 01h */
2142 U16 Reserved1; /* 02h */
2143 U64 WWID; /* 04h */
2144 U64 OwnerWWID; /* 0Ch */
2145 U8 OwnerIdentifier; /* 14h */
2146 U8 Reserved2; /* 15h */
2147 U16 Flags; /* 16h */
2148} RAID_PHYS_DISK1_PATH, MPI_POINTER PTR_RAID_PHYS_DISK1_PATH,
2149 RaidPhysDisk1Path_t, MPI_POINTER pRaidPhysDisk1Path_t;
2150
2151/* RAID Physical Disk Page 1 Flags field defines */
2152#define MPI_RAID_PHYSDISK1_FLAG_BROKEN (0x0002)
2153#define MPI_RAID_PHYSDISK1_FLAG_INVALID (0x0001)
2154
2155typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1
2156{
2157 CONFIG_PAGE_HEADER Header; /* 00h */
2158 U8 NumPhysDiskPaths; /* 04h */
2159 U8 PhysDiskNum; /* 05h */
2160 U16 Reserved2; /* 06h */
2161 U32 Reserved1; /* 08h */
2162 RAID_PHYS_DISK1_PATH Path[1]; /* 0Ch */
2163} CONFIG_PAGE_RAID_PHYS_DISK_1, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_1,
2164 RaidPhysDiskPage1_t, MPI_POINTER pRaidPhysDiskPage1_t;
2165
2166#define MPI_RAIDPHYSDISKPAGE1_PAGEVERSION (0x00)
1747 2167
1748 2168
1749/**************************************************************************** 2169/****************************************************************************
@@ -1756,7 +2176,7 @@ typedef struct _CONFIG_PAGE_LAN_0
1756 U16 TxRxModes; /* 04h */ 2176 U16 TxRxModes; /* 04h */
1757 U16 Reserved; /* 06h */ 2177 U16 Reserved; /* 06h */
1758 U32 PacketPrePad; /* 08h */ 2178 U32 PacketPrePad; /* 08h */
1759} fCONFIG_PAGE_LAN_0, MPI_POINTER PTR_CONFIG_PAGE_LAN_0, 2179} CONFIG_PAGE_LAN_0, MPI_POINTER PTR_CONFIG_PAGE_LAN_0,
1760 LANPage0_t, MPI_POINTER pLANPage0_t; 2180 LANPage0_t, MPI_POINTER pLANPage0_t;
1761 2181
1762#define MPI_LAN_PAGE0_PAGEVERSION (0x01) 2182#define MPI_LAN_PAGE0_PAGEVERSION (0x01)
@@ -1781,7 +2201,7 @@ typedef struct _CONFIG_PAGE_LAN_1
1781 U32 MaxReplySize; /* 24h */ 2201 U32 MaxReplySize; /* 24h */
1782 U32 NegWireSpeedLow; /* 28h */ 2202 U32 NegWireSpeedLow; /* 28h */
1783 U32 NegWireSpeedHigh; /* 2Ch */ 2203 U32 NegWireSpeedHigh; /* 2Ch */
1784} fCONFIG_PAGE_LAN_1, MPI_POINTER PTR_CONFIG_PAGE_LAN_1, 2204} CONFIG_PAGE_LAN_1, MPI_POINTER PTR_CONFIG_PAGE_LAN_1,
1785 LANPage1_t, MPI_POINTER pLANPage1_t; 2205 LANPage1_t, MPI_POINTER pLANPage1_t;
1786 2206
1787#define MPI_LAN_PAGE1_PAGEVERSION (0x03) 2207#define MPI_LAN_PAGE1_PAGEVERSION (0x03)
@@ -1796,11 +2216,11 @@ typedef struct _CONFIG_PAGE_LAN_1
1796 2216
1797typedef struct _CONFIG_PAGE_INBAND_0 2217typedef struct _CONFIG_PAGE_INBAND_0
1798{ 2218{
1799 fCONFIG_PAGE_HEADER Header; /* 00h */ 2219 CONFIG_PAGE_HEADER Header; /* 00h */
1800 MPI_VERSION_FORMAT InbandVersion; /* 04h */ 2220 MPI_VERSION_FORMAT InbandVersion; /* 04h */
1801 U16 MaximumBuffers; /* 08h */ 2221 U16 MaximumBuffers; /* 08h */
1802 U16 Reserved1; /* 0Ah */ 2222 U16 Reserved1; /* 0Ah */
1803} fCONFIG_PAGE_INBAND_0, MPI_POINTER PTR_CONFIG_PAGE_INBAND_0, 2223} CONFIG_PAGE_INBAND_0, MPI_POINTER PTR_CONFIG_PAGE_INBAND_0,
1804 InbandPage0_t, MPI_POINTER pInbandPage0_t; 2224 InbandPage0_t, MPI_POINTER pInbandPage0_t;
1805 2225
1806#define MPI_INBAND_PAGEVERSION (0x00) 2226#define MPI_INBAND_PAGEVERSION (0x00)
@@ -1820,7 +2240,7 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA
1820 U32 ControllerPhyDeviceInfo;/* 04h */ 2240 U32 ControllerPhyDeviceInfo;/* 04h */
1821 U16 AttachedDeviceHandle; /* 08h */ 2241 U16 AttachedDeviceHandle; /* 08h */
1822 U16 ControllerDevHandle; /* 0Ah */ 2242 U16 ControllerDevHandle; /* 0Ah */
1823 U32 Reserved2; /* 0Ch */ 2243 U32 DiscoveryStatus; /* 0Ch */
1824} MPI_SAS_IO_UNIT0_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT0_PHY_DATA, 2244} MPI_SAS_IO_UNIT0_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT0_PHY_DATA,
1825 SasIOUnit0PhyData, MPI_POINTER pSasIOUnit0PhyData; 2245 SasIOUnit0PhyData, MPI_POINTER pSasIOUnit0PhyData;
1826 2246
@@ -1834,22 +2254,21 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA
1834 2254
1835typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 2255typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
1836{ 2256{
1837 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2257 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1838 U32 Reserved1; /* 08h */ 2258 U32 Reserved1; /* 08h */
1839 U8 NumPhys; /* 0Ch */ 2259 U8 NumPhys; /* 0Ch */
1840 U8 Reserved2; /* 0Dh */ 2260 U8 Reserved2; /* 0Dh */
1841 U16 Reserved3; /* 0Eh */ 2261 U16 Reserved3; /* 0Eh */
1842 MPI_SAS_IO_UNIT0_PHY_DATA PhyData[MPI_SAS_IOUNIT0_PHY_MAX]; /* 10h */ 2262 MPI_SAS_IO_UNIT0_PHY_DATA PhyData[MPI_SAS_IOUNIT0_PHY_MAX]; /* 10h */
1843} fCONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0, 2263} CONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0,
1844 SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t; 2264 SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t;
1845 2265
1846#define MPI_SASIOUNITPAGE0_PAGEVERSION (0x00) 2266#define MPI_SASIOUNITPAGE0_PAGEVERSION (0x02)
1847 2267
1848/* values for SAS IO Unit Page 0 PortFlags */ 2268/* values for SAS IO Unit Page 0 PortFlags */
1849#define MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS (0x08) 2269#define MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS (0x08)
1850#define MPI_SAS_IOUNIT0_PORT_FLAGS_0_TARGET_IOC_NUM (0x00) 2270#define MPI_SAS_IOUNIT0_PORT_FLAGS_0_TARGET_IOC_NUM (0x00)
1851#define MPI_SAS_IOUNIT0_PORT_FLAGS_1_TARGET_IOC_NUM (0x04) 2271#define MPI_SAS_IOUNIT0_PORT_FLAGS_1_TARGET_IOC_NUM (0x04)
1852#define MPI_SAS_IOUNIT0_PORT_FLAGS_WAIT_FOR_PORTENABLE (0x02)
1853#define MPI_SAS_IOUNIT0_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) 2272#define MPI_SAS_IOUNIT0_PORT_FLAGS_AUTO_PORT_CONFIG (0x01)
1854 2273
1855/* values for SAS IO Unit Page 0 PhyFlags */ 2274/* values for SAS IO Unit Page 0 PhyFlags */
@@ -1867,6 +2286,20 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
1867 2286
1868/* see mpi_sas.h for values for SAS IO Unit Page 0 ControllerPhyDeviceInfo values */ 2287/* see mpi_sas.h for values for SAS IO Unit Page 0 ControllerPhyDeviceInfo values */
1869 2288
2289/* values for SAS IO Unit Page 0 DiscoveryStatus */
2290#define MPI_SAS_IOUNIT0_DS_LOOP_DETECTED (0x00000001)
2291#define MPI_SAS_IOUNIT0_DS_UNADDRESSABLE_DEVICE (0x00000002)
2292#define MPI_SAS_IOUNIT0_DS_MULTIPLE_PORTS (0x00000004)
2293#define MPI_SAS_IOUNIT0_DS_EXPANDER_ERR (0x00000008)
2294#define MPI_SAS_IOUNIT0_DS_SMP_TIMEOUT (0x00000010)
2295#define MPI_SAS_IOUNIT0_DS_OUT_ROUTE_ENTRIES (0x00000020)
2296#define MPI_SAS_IOUNIT0_DS_INDEX_NOT_EXIST (0x00000040)
2297#define MPI_SAS_IOUNIT0_DS_SMP_FUNCTION_FAILED (0x00000080)
2298#define MPI_SAS_IOUNIT0_DS_SMP_CRC_ERROR (0x00000100)
2299#define MPI_SAS_IOUNIT0_DS_SUBTRACTIVE_LINK (0x00000200)
2300#define MPI_SAS_IOUNIT0_DS_TABLE_LINK (0x00000400)
2301#define MPI_SAS_IOUNIT0_DS_UNSUPPORTED_DEVICE (0x00000800)
2302
1870 2303
1871typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA 2304typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA
1872{ 2305{
@@ -1889,52 +2322,75 @@ typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA
1889 2322
1890typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1 2323typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1
1891{ 2324{
1892 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2325 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1893 U32 Reserved1; /* 08h */ 2326 U16 ControlFlags; /* 08h */
1894 U8 NumPhys; /* 0Ch */ 2327 U16 MaxNumSATATargets; /* 0Ah */
1895 U8 Reserved2; /* 0Dh */ 2328 U32 Reserved1; /* 0Ch */
1896 U16 Reserved3; /* 0Eh */ 2329 U8 NumPhys; /* 10h */
1897 MPI_SAS_IO_UNIT1_PHY_DATA PhyData[MPI_SAS_IOUNIT1_PHY_MAX]; /* 10h */ 2330 U8 SATAMaxQDepth; /* 11h */
1898} fCONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1, 2331 U16 Reserved2; /* 12h */
2332 MPI_SAS_IO_UNIT1_PHY_DATA PhyData[MPI_SAS_IOUNIT1_PHY_MAX]; /* 14h */
2333} CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1,
1899 SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t; 2334 SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t;
1900 2335
1901#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x00) 2336#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x04)
1902 2337
1903/* values for SAS IO Unit Page 0 PortFlags */ 2338/* values for SAS IO Unit Page 1 ControlFlags */
1904#define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00) 2339#define MPI_SAS_IOUNIT1_CONTROL_SATA_3_0_MAX (0x4000)
1905#define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04) 2340#define MPI_SAS_IOUNIT1_CONTROL_SATA_1_5_MAX (0x2000)
1906#define MPI_SAS_IOUNIT1_PORT_FLAGS_WAIT_FOR_PORTENABLE (0x02) 2341#define MPI_SAS_IOUNIT1_CONTROL_SATA_SW_PRESERVE (0x1000)
1907#define MPI_SAS_IOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) 2342#define MPI_SAS_IOUNIT1_CONTROL_DISABLE_SAS_HASH (0x0800)
2343
2344#define MPI_SAS_IOUNIT1_CONTROL_MASK_DEV_SUPPORT (0x0600)
2345#define MPI_SAS_IOUNIT1_CONTROL_SHIFT_DEV_SUPPORT (9)
2346#define MPI_SAS_IOUNIT1_CONTROL_DEV_SUPPORT_BOTH (0x00)
2347#define MPI_SAS_IOUNIT1_CONTROL_DEV_SAS_SUPPORT (0x01)
2348#define MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT (0x10)
2349
2350#define MPI_SAS_IOUNIT1_CONTROL_AUTO_PORT_SAME_SAS_ADDR (0x0100)
2351#define MPI_SAS_IOUNIT1_CONTROL_SATA_48BIT_LBA_REQUIRED (0x0080)
2352#define MPI_SAS_IOUNIT1_CONTROL_SATA_SMART_REQUIRED (0x0040)
2353#define MPI_SAS_IOUNIT1_CONTROL_SATA_NCQ_REQUIRED (0x0020)
2354#define MPI_SAS_IOUNIT1_CONTROL_SATA_FUA_REQUIRED (0x0010)
2355#define MPI_SAS_IOUNIT1_CONTROL_PHY_ENABLE_ORDER_HIGH (0x0008)
2356#define MPI_SAS_IOUNIT1_CONTROL_SUBTRACTIVE_ILLEGAL (0x0004)
2357#define MPI_SAS_IOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY (0x0002)
2358#define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001)
2359
2360/* values for SAS IO Unit Page 1 PortFlags */
2361#define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00)
2362#define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04)
2363#define MPI_SAS_IOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01)
1908 2364
1909/* values for SAS IO Unit Page 0 PhyFlags */ 2365/* values for SAS IO Unit Page 0 PhyFlags */
1910#define MPI_SAS_IOUNIT1_PHY_FLAGS_PHY_DISABLE (0x04) 2366#define MPI_SAS_IOUNIT1_PHY_FLAGS_PHY_DISABLE (0x04)
1911#define MPI_SAS_IOUNIT1_PHY_FLAGS_TX_INVERT (0x02) 2367#define MPI_SAS_IOUNIT1_PHY_FLAGS_TX_INVERT (0x02)
1912#define MPI_SAS_IOUNIT1_PHY_FLAGS_RX_INVERT (0x01) 2368#define MPI_SAS_IOUNIT1_PHY_FLAGS_RX_INVERT (0x01)
1913 2369
1914/* values for SAS IO Unit Page 0 MaxMinLinkRate */ 2370/* values for SAS IO Unit Page 0 MaxMinLinkRate */
1915#define MPI_SAS_IOUNIT1_MAX_RATE_MASK (0xF0) 2371#define MPI_SAS_IOUNIT1_MAX_RATE_MASK (0xF0)
1916#define MPI_SAS_IOUNIT1_MAX_RATE_1_5 (0x80) 2372#define MPI_SAS_IOUNIT1_MAX_RATE_1_5 (0x80)
1917#define MPI_SAS_IOUNIT1_MAX_RATE_3_0 (0x90) 2373#define MPI_SAS_IOUNIT1_MAX_RATE_3_0 (0x90)
1918#define MPI_SAS_IOUNIT1_MIN_RATE_MASK (0x0F) 2374#define MPI_SAS_IOUNIT1_MIN_RATE_MASK (0x0F)
1919#define MPI_SAS_IOUNIT1_MIN_RATE_1_5 (0x08) 2375#define MPI_SAS_IOUNIT1_MIN_RATE_1_5 (0x08)
1920#define MPI_SAS_IOUNIT1_MIN_RATE_3_0 (0x09) 2376#define MPI_SAS_IOUNIT1_MIN_RATE_3_0 (0x09)
1921 2377
1922/* see mpi_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */ 2378/* see mpi_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */
1923 2379
1924 2380
1925typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2 2381typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2
1926{ 2382{
1927 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2383 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1928 U32 Reserved1; /* 08h */ 2384 U32 Reserved1; /* 08h */
1929 U16 MaxPersistentIDs; /* 0Ch */ 2385 U16 MaxPersistentIDs; /* 0Ch */
1930 U16 NumPersistentIDsUsed; /* 0Eh */ 2386 U16 NumPersistentIDsUsed; /* 0Eh */
1931 U8 Status; /* 10h */ 2387 U8 Status; /* 10h */
1932 U8 Flags; /* 11h */ 2388 U8 Flags; /* 11h */
1933 U16 Reserved2; /* 12h */ 2389 U16 MaxNumPhysicalMappedIDs;/* 12h */ /* 12h */
1934} fCONFIG_PAGE_SAS_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_2, 2390} CONFIG_PAGE_SAS_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_2,
1935 SasIOUnitPage2_t, MPI_POINTER pSasIOUnitPage2_t; 2391 SasIOUnitPage2_t, MPI_POINTER pSasIOUnitPage2_t;
1936 2392
1937#define MPI_SASIOUNITPAGE2_PAGEVERSION (0x00) 2393#define MPI_SASIOUNITPAGE2_PAGEVERSION (0x03)
1938 2394
1939/* values for SAS IO Unit Page 2 Status field */ 2395/* values for SAS IO Unit Page 2 Status field */
1940#define MPI_SAS_IOUNIT2_STATUS_DISABLED_PERSISTENT_MAPPINGS (0x02) 2396#define MPI_SAS_IOUNIT2_STATUS_DISABLED_PERSISTENT_MAPPINGS (0x02)
@@ -1942,11 +2398,19 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2
1942 2398
1943/* values for SAS IO Unit Page 2 Flags field */ 2399/* values for SAS IO Unit Page 2 Flags field */
1944#define MPI_SAS_IOUNIT2_FLAGS_DISABLE_PERSISTENT_MAPPINGS (0x01) 2400#define MPI_SAS_IOUNIT2_FLAGS_DISABLE_PERSISTENT_MAPPINGS (0x01)
2401/* Physical Mapping Modes */
2402#define MPI_SAS_IOUNIT2_FLAGS_MASK_PHYS_MAP_MODE (0x0E)
2403#define MPI_SAS_IOUNIT2_FLAGS_SHIFT_PHYS_MAP_MODE (1)
2404#define MPI_SAS_IOUNIT2_FLAGS_NO_PHYS_MAP (0x00)
2405#define MPI_SAS_IOUNIT2_FLAGS_DIRECT_ATTACH_PHYS_MAP (0x01)
2406#define MPI_SAS_IOUNIT2_FLAGS_ENCLOSURE_SLOT_PHYS_MAP (0x02)
2407
2408#define MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT (0x10)
1945 2409
1946 2410
1947typedef struct _CONFIG_PAGE_SAS_IO_UNIT_3 2411typedef struct _CONFIG_PAGE_SAS_IO_UNIT_3
1948{ 2412{
1949 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2413 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1950 U32 Reserved1; /* 08h */ 2414 U32 Reserved1; /* 08h */
1951 U32 MaxInvalidDwordCount; /* 0Ch */ 2415 U32 MaxInvalidDwordCount; /* 0Ch */
1952 U32 InvalidDwordCountTime; /* 10h */ 2416 U32 InvalidDwordCountTime; /* 10h */
@@ -1956,18 +2420,24 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_3
1956 U32 LossDwordSynchCountTime; /* 20h */ 2420 U32 LossDwordSynchCountTime; /* 20h */
1957 U32 MaxPhyResetProblemCount; /* 24h */ 2421 U32 MaxPhyResetProblemCount; /* 24h */
1958 U32 PhyResetProblemTime; /* 28h */ 2422 U32 PhyResetProblemTime; /* 28h */
1959} fCONFIG_PAGE_SAS_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_3, 2423} CONFIG_PAGE_SAS_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_3,
1960 SasIOUnitPage3_t, MPI_POINTER pSasIOUnitPage3_t; 2424 SasIOUnitPage3_t, MPI_POINTER pSasIOUnitPage3_t;
1961 2425
1962#define MPI_SASIOUNITPAGE3_PAGEVERSION (0x00) 2426#define MPI_SASIOUNITPAGE3_PAGEVERSION (0x00)
1963 2427
1964 2428
2429/****************************************************************************
2430* SAS Expander Config Pages
2431****************************************************************************/
2432
1965typedef struct _CONFIG_PAGE_SAS_EXPANDER_0 2433typedef struct _CONFIG_PAGE_SAS_EXPANDER_0
1966{ 2434{
1967 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2435 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1968 U32 Reserved1; /* 08h */ 2436 U8 PhysicalPort; /* 08h */
2437 U8 Reserved1; /* 09h */
2438 U16 Reserved2; /* 0Ah */
1969 U64 SASAddress; /* 0Ch */ 2439 U64 SASAddress; /* 0Ch */
1970 U32 Reserved2; /* 14h */ 2440 U32 DiscoveryStatus; /* 14h */
1971 U16 DevHandle; /* 18h */ 2441 U16 DevHandle; /* 18h */
1972 U16 ParentDevHandle; /* 1Ah */ 2442 U16 ParentDevHandle; /* 1Ah */
1973 U16 ExpanderChangeCount; /* 1Ch */ 2443 U16 ExpanderChangeCount; /* 1Ch */
@@ -1976,45 +2446,127 @@ typedef struct _CONFIG_PAGE_SAS_EXPANDER_0
1976 U8 SASLevel; /* 21h */ 2446 U8 SASLevel; /* 21h */
1977 U8 Flags; /* 22h */ 2447 U8 Flags; /* 22h */
1978 U8 Reserved3; /* 23h */ 2448 U8 Reserved3; /* 23h */
1979} fCONFIG_PAGE_SAS_EXPANDER_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_0, 2449} CONFIG_PAGE_SAS_EXPANDER_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_0,
1980 SasExpanderPage0_t, MPI_POINTER pSasExpanderPage0_t; 2450 SasExpanderPage0_t, MPI_POINTER pSasExpanderPage0_t;
1981 2451
1982#define MPI_SASEXPANDER0_PAGEVERSION (0x00) 2452#define MPI_SASEXPANDER0_PAGEVERSION (0x02)
2453
2454/* values for SAS Expander Page 0 DiscoveryStatus field */
2455#define MPI_SAS_EXPANDER0_DS_LOOP_DETECTED (0x00000001)
2456#define MPI_SAS_EXPANDER0_DS_UNADDRESSABLE_DEVICE (0x00000002)
2457#define MPI_SAS_EXPANDER0_DS_MULTIPLE_PORTS (0x00000004)
2458#define MPI_SAS_EXPANDER0_DS_EXPANDER_ERR (0x00000008)
2459#define MPI_SAS_EXPANDER0_DS_SMP_TIMEOUT (0x00000010)
2460#define MPI_SAS_EXPANDER0_DS_OUT_ROUTE_ENTRIES (0x00000020)
2461#define MPI_SAS_EXPANDER0_DS_INDEX_NOT_EXIST (0x00000040)
2462#define MPI_SAS_EXPANDER0_DS_SMP_FUNCTION_FAILED (0x00000080)
2463#define MPI_SAS_EXPANDER0_DS_SMP_CRC_ERROR (0x00000100)
2464#define MPI_SAS_EXPANDER0_DS_SUBTRACTIVE_LINK (0x00000200)
2465#define MPI_SAS_EXPANDER0_DS_TABLE_LINK (0x00000400)
2466#define MPI_SAS_EXPANDER0_DS_UNSUPPORTED_DEVICE (0x00000800)
1983 2467
1984/* values for SAS Expander Page 0 Flags field */ 2468/* values for SAS Expander Page 0 Flags field */
1985#define MPI_SAS_EXPANDER0_FLAGS_ROUTE_TABLE_CONFIG (0x02) 2469#define MPI_SAS_EXPANDER0_FLAGS_ROUTE_TABLE_CONFIG (0x02)
1986#define MPI_SAS_EXPANDER0_FLAGS_CONFIG_IN_PROGRESS (0x01) 2470#define MPI_SAS_EXPANDER0_FLAGS_CONFIG_IN_PROGRESS (0x01)
1987 2471
1988 2472
2473typedef struct _CONFIG_PAGE_SAS_EXPANDER_1
2474{
2475 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2476 U8 PhysicalPort; /* 08h */
2477 U8 Reserved1; /* 09h */
2478 U16 Reserved2; /* 0Ah */
2479 U8 NumPhys; /* 0Ch */
2480 U8 Phy; /* 0Dh */
2481 U16 NumTableEntriesProgrammed; /* 0Eh */
2482 U8 ProgrammedLinkRate; /* 10h */
2483 U8 HwLinkRate; /* 11h */
2484 U16 AttachedDevHandle; /* 12h */
2485 U32 PhyInfo; /* 14h */
2486 U32 AttachedDeviceInfo; /* 18h */
2487 U16 OwnerDevHandle; /* 1Ch */
2488 U8 ChangeCount; /* 1Eh */
2489 U8 NegotiatedLinkRate; /* 1Fh */
2490 U8 PhyIdentifier; /* 20h */
2491 U8 AttachedPhyIdentifier; /* 21h */
2492 U8 NumTableEntriesProg; /* 22h */
2493 U8 DiscoveryInfo; /* 23h */
2494 U32 Reserved3; /* 24h */
2495} CONFIG_PAGE_SAS_EXPANDER_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_1,
2496 SasExpanderPage1_t, MPI_POINTER pSasExpanderPage1_t;
2497
2498#define MPI_SASEXPANDER1_PAGEVERSION (0x01)
2499
2500/* use MPI_SAS_PHY0_PRATE_ defines for ProgrammedLinkRate */
2501
2502/* use MPI_SAS_PHY0_HWRATE_ defines for HwLinkRate */
2503
2504/* use MPI_SAS_PHY0_PHYINFO_ defines for PhyInfo */
2505
2506/* see mpi_sas.h for values for SAS Expander Page 1 AttachedDeviceInfo values */
2507
2508/* values for SAS Expander Page 1 DiscoveryInfo field */
2509#define MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY DISABLED (0x04)
2510#define MPI_SAS_EXPANDER1_DISCINFO_LINK_STATUS_CHANGE (0x02)
2511#define MPI_SAS_EXPANDER1_DISCINFO_NO_ROUTING_ENTRIES (0x01)
2512
2513/* values for SAS Expander Page 1 NegotiatedLinkRate field */
2514#define MPI_SAS_EXPANDER1_NEG_RATE_UNKNOWN (0x00)
2515#define MPI_SAS_EXPANDER1_NEG_RATE_PHY_DISABLED (0x01)
2516#define MPI_SAS_EXPANDER1_NEG_RATE_FAILED_NEGOTIATION (0x02)
2517#define MPI_SAS_EXPANDER1_NEG_RATE_SATA_OOB_COMPLETE (0x03)
2518#define MPI_SAS_EXPANDER1_NEG_RATE_1_5 (0x08)
2519#define MPI_SAS_EXPANDER1_NEG_RATE_3_0 (0x09)
2520
2521
2522/****************************************************************************
2523* SAS Device Config Pages
2524****************************************************************************/
2525
1989typedef struct _CONFIG_PAGE_SAS_DEVICE_0 2526typedef struct _CONFIG_PAGE_SAS_DEVICE_0
1990{ 2527{
1991 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2528 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1992 U32 Reserved1; /* 08h */ 2529 U16 Slot; /* 08h */
2530 U16 EnclosureHandle; /* 0Ah */
1993 U64 SASAddress; /* 0Ch */ 2531 U64 SASAddress; /* 0Ch */
1994 U32 Reserved2; /* 14h */ 2532 U16 ParentDevHandle; /* 14h */
2533 U8 PhyNum; /* 16h */
2534 U8 AccessStatus; /* 17h */
1995 U16 DevHandle; /* 18h */ 2535 U16 DevHandle; /* 18h */
1996 U8 TargetID; /* 1Ah */ 2536 U8 TargetID; /* 1Ah */
1997 U8 Bus; /* 1Bh */ 2537 U8 Bus; /* 1Bh */
1998 U32 DeviceInfo; /* 1Ch */ 2538 U32 DeviceInfo; /* 1Ch */
1999 U16 Flags; /* 20h */ 2539 U16 Flags; /* 20h */
2000 U8 PhysicalPort; /* 22h */ 2540 U8 PhysicalPort; /* 22h */
2001 U8 Reserved3; /* 23h */ 2541 U8 Reserved2; /* 23h */
2002} fCONFIG_PAGE_SAS_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_0, 2542} CONFIG_PAGE_SAS_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_0,
2003 SasDevicePage0_t, MPI_POINTER pSasDevicePage0_t; 2543 SasDevicePage0_t, MPI_POINTER pSasDevicePage0_t;
2004 2544
2005#define MPI_SASDEVICE0_PAGEVERSION (0x00) 2545#define MPI_SASDEVICE0_PAGEVERSION (0x04)
2546
2547/* values for SAS Device Page 0 AccessStatus field */
2548#define MPI_SAS_DEVICE0_ASTATUS_NO_ERRORS (0x00)
2549#define MPI_SAS_DEVICE0_ASTATUS_SATA_INIT_FAILED (0x01)
2550#define MPI_SAS_DEVICE0_ASTATUS_SATA_CAPABILITY_FAILED (0x02)
2006 2551
2007/* values for SAS Device Page 0 Flags field */ 2552/* values for SAS Device Page 0 Flags field */
2008#define MPI_SAS_DEVICE0_FLAGS_MAPPING_PERSISTENT (0x04) 2553#define MPI_SAS_DEVICE0_FLAGS_SATA_SW_PRESERVE (0x0200)
2009#define MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED (0x02) 2554#define MPI_SAS_DEVICE0_FLAGS_UNSUPPORTED_DEVICE (0x0100)
2010#define MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT (0x01) 2555#define MPI_SAS_DEVICE0_FLAGS_SATA_48BIT_LBA_SUPPORTED (0x0080)
2556#define MPI_SAS_DEVICE0_FLAGS_SATA_SMART_SUPPORTED (0x0040)
2557#define MPI_SAS_DEVICE0_FLAGS_SATA_NCQ_SUPPORTED (0x0020)
2558#define MPI_SAS_DEVICE0_FLAGS_SATA_FUA_SUPPORTED (0x0010)
2559#define MPI_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH (0x0008)
2560#define MPI_SAS_DEVICE0_FLAGS_MAPPING_PERSISTENT (0x0004)
2561#define MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED (0x0002)
2562#define MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT (0x0001)
2011 2563
2012/* see mpi_sas.h for values for SAS Device Page 0 DeviceInfo values */ 2564/* see mpi_sas.h for values for SAS Device Page 0 DeviceInfo values */
2013 2565
2014 2566
2015typedef struct _CONFIG_PAGE_SAS_DEVICE_1 2567typedef struct _CONFIG_PAGE_SAS_DEVICE_1
2016{ 2568{
2017 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2569 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2018 U32 Reserved1; /* 08h */ 2570 U32 Reserved1; /* 08h */
2019 U64 SASAddress; /* 0Ch */ 2571 U64 SASAddress; /* 0Ch */
2020 U32 Reserved2; /* 14h */ 2572 U32 Reserved2; /* 14h */
@@ -2022,15 +2574,30 @@ typedef struct _CONFIG_PAGE_SAS_DEVICE_1
2022 U8 TargetID; /* 1Ah */ 2574 U8 TargetID; /* 1Ah */
2023 U8 Bus; /* 1Bh */ 2575 U8 Bus; /* 1Bh */
2024 U8 InitialRegDeviceFIS[20];/* 1Ch */ 2576 U8 InitialRegDeviceFIS[20];/* 1Ch */
2025} fCONFIG_PAGE_SAS_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_1, 2577} CONFIG_PAGE_SAS_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_1,
2026 SasDevicePage1_t, MPI_POINTER pSasDevicePage1_t; 2578 SasDevicePage1_t, MPI_POINTER pSasDevicePage1_t;
2027 2579
2028#define MPI_SASDEVICE1_PAGEVERSION (0x00) 2580#define MPI_SASDEVICE1_PAGEVERSION (0x00)
2029 2581
2030 2582
2583typedef struct _CONFIG_PAGE_SAS_DEVICE_2
2584{
2585 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2586 U64 PhysicalIdentifier; /* 08h */
2587 U32 Reserved1; /* 10h */
2588} CONFIG_PAGE_SAS_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_2,
2589 SasDevicePage2_t, MPI_POINTER pSasDevicePage2_t;
2590
2591#define MPI_SASDEVICE2_PAGEVERSION (0x00)
2592
2593
2594/****************************************************************************
2595* SAS PHY Config Pages
2596****************************************************************************/
2597
2031typedef struct _CONFIG_PAGE_SAS_PHY_0 2598typedef struct _CONFIG_PAGE_SAS_PHY_0
2032{ 2599{
2033 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2600 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2034 U32 Reserved1; /* 08h */ 2601 U32 Reserved1; /* 08h */
2035 U64 SASAddress; /* 0Ch */ 2602 U64 SASAddress; /* 0Ch */
2036 U16 AttachedDevHandle; /* 14h */ 2603 U16 AttachedDevHandle; /* 14h */
@@ -2042,7 +2609,7 @@ typedef struct _CONFIG_PAGE_SAS_PHY_0
2042 U8 ChangeCount; /* 22h */ 2609 U8 ChangeCount; /* 22h */
2043 U8 Reserved3; /* 23h */ 2610 U8 Reserved3; /* 23h */
2044 U32 PhyInfo; /* 24h */ 2611 U32 PhyInfo; /* 24h */
2045} fCONFIG_PAGE_SAS_PHY_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_0, 2612} CONFIG_PAGE_SAS_PHY_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_0,
2046 SasPhyPage0_t, MPI_POINTER pSasPhyPage0_t; 2613 SasPhyPage0_t, MPI_POINTER pSasPhyPage0_t;
2047 2614
2048#define MPI_SASPHY0_PAGEVERSION (0x00) 2615#define MPI_SASPHY0_PAGEVERSION (0x00)
@@ -2089,17 +2656,95 @@ typedef struct _CONFIG_PAGE_SAS_PHY_0
2089 2656
2090typedef struct _CONFIG_PAGE_SAS_PHY_1 2657typedef struct _CONFIG_PAGE_SAS_PHY_1
2091{ 2658{
2092 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2659 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2093 U32 Reserved1; /* 08h */ 2660 U32 Reserved1; /* 08h */
2094 U32 InvalidDwordCount; /* 0Ch */ 2661 U32 InvalidDwordCount; /* 0Ch */
2095 U32 RunningDisparityErrorCount; /* 10h */ 2662 U32 RunningDisparityErrorCount; /* 10h */
2096 U32 LossDwordSynchCount; /* 14h */ 2663 U32 LossDwordSynchCount; /* 14h */
2097 U32 PhyResetProblemCount; /* 18h */ 2664 U32 PhyResetProblemCount; /* 18h */
2098} fCONFIG_PAGE_SAS_PHY_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_1, 2665} CONFIG_PAGE_SAS_PHY_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_1,
2099 SasPhyPage1_t, MPI_POINTER pSasPhyPage1_t; 2666 SasPhyPage1_t, MPI_POINTER pSasPhyPage1_t;
2100 2667
2101#define MPI_SASPHY1_PAGEVERSION (0x00) 2668#define MPI_SASPHY1_PAGEVERSION (0x00)
2102 2669
2103 2670
2671/****************************************************************************
2672* SAS Enclosure Config Pages
2673****************************************************************************/
2674
2675typedef struct _CONFIG_PAGE_SAS_ENCLOSURE_0
2676{
2677 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2678 U32 Reserved1; /* 08h */
2679 U64 EnclosureLogicalID; /* 0Ch */
2680 U16 Flags; /* 14h */
2681 U16 EnclosureHandle; /* 16h */
2682 U16 NumSlots; /* 18h */
2683 U16 StartSlot; /* 1Ah */
2684 U8 StartTargetID; /* 1Ch */
2685 U8 StartBus; /* 1Dh */
2686 U8 SEPTargetID; /* 1Eh */
2687 U8 SEPBus; /* 1Fh */
2688 U32 Reserved2; /* 20h */
2689 U32 Reserved3; /* 24h */
2690} CONFIG_PAGE_SAS_ENCLOSURE_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_ENCLOSURE_0,
2691 SasEnclosurePage0_t, MPI_POINTER pSasEnclosurePage0_t;
2692
2693#define MPI_SASENCLOSURE0_PAGEVERSION (0x00)
2694
2695/* values for SAS Enclosure Page 0 Flags field */
2696#define MPI_SAS_ENCLS0_FLAGS_SEP_BUS_ID_VALID (0x0020)
2697#define MPI_SAS_ENCLS0_FLAGS_START_BUS_ID_VALID (0x0010)
2698
2699#define MPI_SAS_ENCLS0_FLAGS_MNG_MASK (0x000F)
2700#define MPI_SAS_ENCLS0_FLAGS_MNG_UNKNOWN (0x0000)
2701#define MPI_SAS_ENCLS0_FLAGS_MNG_IOC_SES (0x0001)
2702#define MPI_SAS_ENCLS0_FLAGS_MNG_IOC_SGPIO (0x0002)
2703#define MPI_SAS_ENCLS0_FLAGS_MNG_EXP_SGPIO (0x0003)
2704#define MPI_SAS_ENCLS0_FLAGS_MNG_SES_ENCLOSURE (0x0004)
2705
2706
2707/****************************************************************************
2708* Log Config Pages
2709****************************************************************************/
2710/*
2711 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2712 * one and check NumLogEntries at runtime.
2713 */
2714#ifndef MPI_LOG_0_NUM_LOG_ENTRIES
2715#define MPI_LOG_0_NUM_LOG_ENTRIES (1)
2716#endif
2717
2718#define MPI_LOG_0_LOG_DATA_LENGTH (20)
2719
2720typedef struct _MPI_LOG_0_ENTRY
2721{
2722 U64 WWID; /* 00h */
2723 U32 TimeStamp; /* 08h */
2724 U32 Reserved1; /* 0Ch */
2725 U16 LogSequence; /* 10h */
2726 U16 LogEntryQualifier; /* 12h */
2727 U8 LogData[MPI_LOG_0_LOG_DATA_LENGTH]; /* 14h */
2728} MPI_LOG_0_ENTRY, MPI_POINTER PTR_MPI_LOG_0_ENTRY,
2729 MpiLog0Entry_t, MPI_POINTER pMpiLog0Entry_t;
2730
2731/* values for Log Page 0 LogEntry LogEntryQualifier field */
2732#define MPI_LOG_0_ENTRY_QUAL_ENTRY_UNUSED (0x0000)
2733#define MPI_LOG_0_ENTRY_QUAL_POWER_ON_RESET (0x0001)
2734
2735typedef struct _CONFIG_PAGE_LOG_0
2736{
2737 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2738 U32 Reserved1; /* 08h */
2739 U32 Reserved2; /* 0Ch */
2740 U16 NumLogEntries; /* 10h */
2741 U16 Reserved3; /* 12h */
2742 MPI_LOG_0_ENTRY LogEntry[MPI_LOG_0_NUM_LOG_ENTRIES]; /* 14h */
2743} CONFIG_PAGE_LOG_0, MPI_POINTER PTR_CONFIG_PAGE_LOG_0,
2744 LogPage0_t, MPI_POINTER pLogPage0_t;
2745
2746#define MPI_LOG_0_PAGEVERSION (0x00)
2747
2748
2104#endif 2749#endif
2105 2750
diff --git a/drivers/message/fusion/lsi/mpi_fc.h b/drivers/message/fusion/lsi/mpi_fc.h
index ea266b236c1f..51a6aeb990ba 100644
--- a/drivers/message/fusion/lsi/mpi_fc.h
+++ b/drivers/message/fusion/lsi/mpi_fc.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_fc.h 5 * Name: mpi_fc.h
6 * Title: MPI Fibre Channel messages and structures 6 * Title: MPI Fibre Channel messages and structures
7 * Creation Date: June 12, 2000 7 * Creation Date: June 12, 2000
8 * 8 *
9 * mpi_fc.h Version: 01.05.xx 9 * mpi_fc.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -36,6 +36,9 @@
36 * 09-28-01 01.02.02 Change name of reserved field in 36 * 09-28-01 01.02.02 Change name of reserved field in
37 * MSG_LINK_SERVICE_RSP_REPLY. 37 * MSG_LINK_SERVICE_RSP_REPLY.
38 * 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests. 38 * 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests.
39 * 01-16-04 01.02.04 Added define for MPI_FC_PRIM_SEND_FLAGS_ML_RESET_LINK.
40 * 05-11-04 01.03.01 Original release for MPI v1.3.
41 * 08-19-04 01.05.01 Original release for MPI v1.5.
39 * -------------------------------------------------------------------------- 42 * --------------------------------------------------------------------------
40 */ 43 */
41 44
diff --git a/drivers/message/fusion/lsi/mpi_history.txt b/drivers/message/fusion/lsi/mpi_history.txt
index 0deb7721e936..c9edbee41edf 100644
--- a/drivers/message/fusion/lsi/mpi_history.txt
+++ b/drivers/message/fusion/lsi/mpi_history.txt
@@ -3,25 +3,28 @@
3 MPI Header File Change History 3 MPI Header File Change History
4 ============================== 4 ==============================
5 5
6 Copyright (c) 2000-2001 LSI Logic Corporation. 6 Copyright (c) 2000-2005 LSI Logic Corporation.
7 7
8 --------------------------------------- 8 ---------------------------------------
9 Header Set Release Version: 01.01.10 9 Header Set Release Version: 01.05.09
10 Header Set Release Date: 04-09-01 10 Header Set Release Date: 03-11-05
11 --------------------------------------- 11 ---------------------------------------
12 12
13 Filename Current version Prior version 13 Filename Current version Prior version
14 ---------- --------------- ------------- 14 ---------- --------------- -------------
15 mpi.h 01.01.07 01.01.06 15 mpi.h 01.05.07 01.05.06
16 mpi_ioc.h 01.01.07 01.01.06 16 mpi_ioc.h 01.05.08 01.05.07
17 mpi_cnfg.h 01.01.11 01.01.10 17 mpi_cnfg.h 01.05.08 01.05.07
18 mpi_init.h 01.01.05 01.01.04 18 mpi_init.h 01.05.04 01.05.03
19 mpi_targ.h 01.01.04 01.01.04 19 mpi_targ.h 01.05.04 01.05.03
20 mpi_fc.h 01.01.07 01.01.06 20 mpi_fc.h 01.05.01 01.05.01
21 mpi_lan.h 01.01.03 01.01.03 21 mpi_lan.h 01.05.01 01.05.01
22 mpi_raid.h 01.01.02 01.01.02 22 mpi_raid.h 01.05.02 01.05.02
23 mpi_type.h 01.01.02 01.01.02 23 mpi_tool.h 01.05.03 01.05.03
24 mpi_history.txt 01.01.09 01.01.09 24 mpi_inb.h 01.05.01 01.05.01
25 mpi_sas.h 01.05.01 01.05.01
26 mpi_type.h 01.05.01 01.05.01
27 mpi_history.txt 01.05.09 01.05.08
25 28
26 29
27 * Date Version Description 30 * Date Version Description
@@ -53,6 +56,38 @@ mpi.h
53 * Added function codes for RAID. 56 * Added function codes for RAID.
54 * 04-09-01 01.01.07 Added alternate define for MPI_DOORBELL_ACTIVE, 57 * 04-09-01 01.01.07 Added alternate define for MPI_DOORBELL_ACTIVE,
55 * MPI_DOORBELL_USED, to better match the spec. 58 * MPI_DOORBELL_USED, to better match the spec.
59 * 08-08-01 01.02.01 Original release for v1.2 work.
60 * Changed MPI_VERSION_MINOR from 0x01 to 0x02.
61 * Added define MPI_FUNCTION_TOOLBOX.
62 * 09-28-01 01.02.02 New function code MPI_SCSI_ENCLOSURE_PROCESSOR.
63 * 11-01-01 01.02.03 Changed name to MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR.
64 * 03-14-02 01.02.04 Added MPI_HEADER_VERSION_ defines.
65 * 05-31-02 01.02.05 Bumped MPI_HEADER_VERSION_UNIT.
66 * 07-12-02 01.02.06 Added define for MPI_FUNCTION_MAILBOX.
67 * 09-16-02 01.02.07 Bumped value for MPI_HEADER_VERSION_UNIT.
68 * 11-15-02 01.02.08 Added define MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX and
69 * obsoleted define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX.
70 * 04-01-03 01.02.09 New IOCStatus code: MPI_IOCSTATUS_FC_EXCHANGE_CANCELED
71 * 06-26-03 01.02.10 Bumped MPI_HEADER_VERSION_UNIT value.
72 * 01-16-04 01.02.11 Added define for MPI_IOCLOGINFO_TYPE_SHIFT.
73 * 04-29-04 01.02.12 Added function codes for MPI_FUNCTION_DIAG_BUFFER_POST
74 * and MPI_FUNCTION_DIAG_RELEASE.
75 * Added MPI_IOCSTATUS_DIAGNOSTIC_RELEASED define.
76 * Bumped MPI_HEADER_VERSION_UNIT value.
77 * 05-11-04 01.03.01 Bumped MPI_VERSION_MINOR for MPI v1.3.
78 * Added codes for Inband.
79 * 08-19-04 01.05.01 Added defines for Host Buffer Access Control doorbell.
80 * Added define for offset of High Priority Request Queue.
81 * Added new function codes and new IOCStatus codes.
82 * Added a IOCLogInfo type of SAS.
83 * 12-07-04 01.05.02 Bumped MPI_HEADER_VERSION_UNIT.
84 * 12-09-04 01.05.03 Bumped MPI_HEADER_VERSION_UNIT.
85 * 01-15-05 01.05.04 Bumped MPI_HEADER_VERSION_UNIT.
86 * 02-09-05 01.05.05 Bumped MPI_HEADER_VERSION_UNIT.
87 * 02-22-05 01.05.06 Bumped MPI_HEADER_VERSION_UNIT.
88 * 03-11-05 01.05.07 Removed function codes for SCSI IO 32 and
89 * TargetAssistExtended requests.
90 * Removed EEDP IOCStatus codes.
56 * -------------------------------------------------------------------------- 91 * --------------------------------------------------------------------------
57 92
58mpi_ioc.h 93mpi_ioc.h
@@ -81,6 +116,49 @@ mpi_ioc.h
81 * 03-27-01 01.01.06 Added defines for ProductId field of MPI_FW_HEADER. 116 * 03-27-01 01.01.06 Added defines for ProductId field of MPI_FW_HEADER.
82 * Added structure offset comments. 117 * Added structure offset comments.
83 * 04-09-01 01.01.07 Added structure EVENT_DATA_EVENT_CHANGE. 118 * 04-09-01 01.01.07 Added structure EVENT_DATA_EVENT_CHANGE.
119 * 08-08-01 01.02.01 Original release for v1.2 work.
120 * New format for FWVersion and ProductId in
121 * MSG_IOC_FACTS_REPLY and MPI_FW_HEADER.
122 * 08-31-01 01.02.02 Addded event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and
123 * related structure and defines.
124 * Added event MPI_EVENT_ON_BUS_TIMER_EXPIRED.
125 * Added MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE.
126 * Replaced a reserved field in MSG_IOC_FACTS_REPLY with
127 * IOCExceptions and changed DataImageSize to reserved.
128 * Added MPI_FW_DOWNLOAD_ITYPE_NVSTORE_DATA and
129 * MPI_FW_UPLOAD_ITYPE_NVDATA.
130 * 09-28-01 01.02.03 Modified Event Data for Integrated RAID.
131 * 11-01-01 01.02.04 Added defines for MPI_EXT_IMAGE_HEADER ImageType field.
132 * 03-14-02 01.02.05 Added HeaderVersion field to MSG_IOC_FACTS_REPLY.
133 * 05-31-02 01.02.06 Added define for
134 * MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID.
135 * Added AliasIndex to EVENT_DATA_LOGOUT structure.
136 * 04-01-03 01.02.07 Added defines for MPI_FW_HEADER_SIGNATURE_.
137 * 06-26-03 01.02.08 Added new values to the product family defines.
138 * 04-29-04 01.02.09 Added IOCCapabilities field to MSG_IOC_FACTS_REPLY and
139 * added related defines.
140 * 05-11-04 01.03.01 Original release for MPI v1.3.
141 * 08-19-04 01.05.01 Added four new fields to MSG_IOC_INIT.
142 * Added three new fields to MSG_IOC_FACTS_REPLY.
143 * Defined four new bits for the IOCCapabilities field of
144 * the IOCFacts reply.
145 * Added two new PortTypes for the PortFacts reply.
146 * Added six new events along with their EventData
147 * structures.
148 * Added a new MsgFlag to the FwDownload request to
149 * indicate last segment.
150 * Defined a new image type of boot loader.
151 * Added FW family codes for SAS product families.
152 * 10-05-04 01.05.02 Added ReplyFifoHostSignalingAddr field to
153 * MSG_IOC_FACTS_REPLY.
154 * 12-07-04 01.05.03 Added more defines for SAS Discovery Error event.
155 * 12-09-04 01.05.04 Added Unsupported device to SAS Device event.
156 * 01-15-05 01.05.05 Added event data for SAS SES Event.
157 * 02-09-05 01.05.06 Added MPI_FW_UPLOAD_ITYPE_FW_BACKUP define.
158 * 02-22-05 01.05.07 Added Host Page Buffer Persistent flag to IOC Facts
159 * Reply and IOC Init Request.
160 * 03-11-05 01.05.08 Added family code for 1068E family.
161 * Removed IOCFacts Reply EEDP Capability bit.
84 * -------------------------------------------------------------------------- 162 * --------------------------------------------------------------------------
85 163
86mpi_cnfg.h 164mpi_cnfg.h
@@ -142,6 +220,166 @@ mpi_cnfg.h
142 * Added IO Unit Page 3. 220 * Added IO Unit Page 3.
143 * Modified defines for Scsi Port Page 2. 221 * Modified defines for Scsi Port Page 2.
144 * Modified RAID Volume Pages. 222 * Modified RAID Volume Pages.
223 * 08-08-01 01.02.01 Original release for v1.2 work.
224 * Added SepID and SepBus to RVP2 IMPhysicalDisk struct.
225 * Added defines for the SEP bits in RVP2 VolumeSettings.
226 * Modified the DeviceSettings field in RVP2 to use the
227 * proper structure.
228 * Added defines for SES, SAF-TE, and cross channel for
229 * IOCPage2 CapabilitiesFlags.
230 * Removed define for MPI_IOUNITPAGE2_FLAGS_RAID_DISABLE.
231 * Removed define for
232 * MPI_SCSIPORTPAGE2_PORT_FLAGS_PARITY_ENABLE.
233 * Added define for MPI_CONFIG_PAGEATTR_RO_PERSISTENT.
234 * 08-29-01 01.02.02 Fixed value for MPI_MANUFACTPAGE_DEVID_53C1035.
235 * Added defines for MPI_FCPORTPAGE1_FLAGS_HARD_ALPA_ONLY
236 * and MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY.
237 * Removed MPI_SCSIPORTPAGE0_CAP_PACING_TRANSFERS,
238 * MPI_SCSIDEVPAGE0_NP_PACING_TRANSFERS, and
239 * MPI_SCSIDEVPAGE1_RP_PACING_TRANSFERS, and
240 * MPI_SCSIDEVPAGE1_CONF_PPR_ALLOWED.
241 * Added defines for MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED
242 * and MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED.
243 * Added OnBusTimerValue to CONFIG_PAGE_SCSI_PORT_1.
244 * Added rejected bits to SCSI Device Page 0 Information.
245 * Increased size of ALPA array in FC Port Page 2 by one
246 * and removed a one byte reserved field.
247 * 09-28-01 01.02.03 Swapped NegWireSpeedLow and NegWireSpeedLow in
248 * CONFIG_PAGE_LAN_1 to match preferred 64-bit ordering.
249 * Added structures for Manufacturing Page 4, IO Unit
250 * Page 3, IOC Page 3, IOC Page 4, RAID Volume Page 0, and
251 * RAID PhysDisk Page 0.
252 * 10-04-01 01.02.04 Added define for MPI_CONFIG_PAGETYPE_RAID_PHYSDISK.
253 * Modified some of the new defines to make them 32
254 * character unique.
255 * Modified how variable length pages (arrays) are defined.
256 * Added generic defines for hot spare pools and RAID
257 * volume types.
258 * 11-01-01 01.02.05 Added define for MPI_IOUNITPAGE1_DISABLE_IR.
259 * 03-14-02 01.02.06 Added PCISlotNum field to CONFIG_PAGE_IOC_1 along with
260 * related define, and bumped the page version define.
261 * 05-31-02 01.02.07 Added a Flags field to CONFIG_PAGE_IOC_2_RAID_VOL in a
262 * reserved byte and added a define.
263 * Added define for
264 * MPI_RAIDVOL0_STATUS_FLAG_VOLUME_INACTIVE.
265 * Added new config page: CONFIG_PAGE_IOC_5.
266 * Added MaxAliases, MaxHardAliases, and NumCurrentAliases
267 * fields to CONFIG_PAGE_FC_PORT_0.
268 * Added AltConnector and NumRequestedAliases fields to
269 * CONFIG_PAGE_FC_PORT_1.
270 * Added new config page: CONFIG_PAGE_FC_PORT_10.
271 * 07-12-02 01.02.08 Added more MPI_MANUFACTPAGE_DEVID_ defines.
272 * Added additional MPI_SCSIDEVPAGE0_NP_ defines.
273 * Added more MPI_SCSIDEVPAGE1_RP_ defines.
274 * Added define for
275 * MPI_SCSIDEVPAGE1_CONF_EXTENDED_PARAMS_ENABLE.
276 * Added new config page: CONFIG_PAGE_SCSI_DEVICE_3.
277 * Modified MPI_FCPORTPAGE5_FLAGS_ defines.
278 * 09-16-02 01.02.09 Added MPI_SCSIDEVPAGE1_CONF_FORCE_PPR_MSG define.
279 * 11-15-02 01.02.10 Added ConnectedID defines for CONFIG_PAGE_SCSI_PORT_0.
280 * Added more Flags defines for CONFIG_PAGE_FC_PORT_1.
281 * Added more Flags defines for CONFIG_PAGE_FC_DEVICE_0.
282 * 04-01-03 01.02.11 Added RR_TOV field and additional Flags defines for
283 * CONFIG_PAGE_FC_PORT_1.
284 * Added define MPI_FCPORTPAGE5_FLAGS_DISABLE to disable
285 * an alias.
286 * Added more device id defines.
287 * 06-26-03 01.02.12 Added MPI_IOUNITPAGE1_IR_USE_STATIC_VOLUME_ID define.
288 * Added TargetConfig and IDConfig fields to
289 * CONFIG_PAGE_SCSI_PORT_1.
290 * Added more PortFlags defines for CONFIG_PAGE_SCSI_PORT_2
291 * to control DV.
292 * Added more Flags defines for CONFIG_PAGE_FC_PORT_1.
293 * In CONFIG_PAGE_FC_DEVICE_0, replaced Reserved1 field
294 * with ADISCHardALPA.
295 * Added MPI_FC_DEVICE_PAGE0_PROT_FCP_RETRY define.
296 * 01-16-04 01.02.13 Added InitiatorDeviceTimeout and InitiatorIoPendTimeout
297 * fields and related defines to CONFIG_PAGE_FC_PORT_1.
298 * Added define for
299 * MPI_FCPORTPAGE1_FLAGS_SOFT_ALPA_FALLBACK.
300 * Added new fields to the substructures of
301 * CONFIG_PAGE_FC_PORT_10.
302 * 04-29-04 01.02.14 Added define for IDP bit for CONFIG_PAGE_SCSI_PORT_0,
303 * CONFIG_PAGE_SCSI_DEVICE_0, and
304 * CONFIG_PAGE_SCSI_DEVICE_1. Also bumped Page Version for
305 * these pages.
306 * 05-11-04 01.03.01 Added structure for CONFIG_PAGE_INBAND_0.
307 * 08-19-04 01.05.01 Modified MSG_CONFIG request to support extended config
308 * pages.
309 * Added a new structure for extended config page header.
310 * Added new extended config pages types and structures for
311 * SAS IO Unit, SAS Expander, SAS Device, and SAS PHY.
312 * Replaced a reserved byte in CONFIG_PAGE_MANUFACTURING_4
313 * to add a Flags field.
314 * Two new Manufacturing config pages (5 and 6).
315 * Two new bits defined for IO Unit Page 1 Flags field.
316 * Modified CONFIG_PAGE_IO_UNIT_2 to add three new fields
317 * to specify the BIOS boot device.
318 * Four new Flags bits defined for IO Unit Page 2.
319 * Added IO Unit Page 4.
320 * Added EEDP Flags settings to IOC Page 1.
321 * Added new BIOS Page 1 config page.
322 * 10-05-04 01.05.02 Added define for
323 * MPI_IOCPAGE1_INITIATOR_CONTEXT_REPLY_DISABLE.
324 * Added new Flags field to CONFIG_PAGE_MANUFACTURING_5 and
325 * associated defines.
326 * Added more defines for SAS IO Unit Page 0
327 * DiscoveryStatus field.
328 * Added define for MPI_SAS_IOUNIT0_DS_SUBTRACTIVE_LINK
329 * and MPI_SAS_IOUNIT0_DS_TABLE_LINK.
330 * Added defines for Physical Mapping Modes to SAS IO Unit
331 * Page 2.
332 * Added define for
333 * MPI_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH.
334 * 10-27-04 01.05.03 Added defines for new SAS PHY page addressing mode.
335 * Added defines for MaxTargetSpinUp to BIOS Page 1.
336 * Added 5 new ControlFlags defines for SAS IO Unit
337 * Page 1.
338 * Added MaxNumPhysicalMappedIDs field to SAS IO Unit
339 * Page 2.
340 * Added AccessStatus field to SAS Device Page 0 and added
341 * new Flags bits for supported SATA features.
342 * 12-07-04 01.05.04 Added config page structures for BIOS Page 2, RAID
343 * Volume Page 1, and RAID Physical Disk Page 1.
344 * Replaced IO Unit Page 1 BootTargetID,BootBus, and
345 * BootAdapterNum with reserved field.
346 * Added DataScrubRate and ResyncRate to RAID Volume
347 * Page 0.
348 * Added MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT
349 * define.
350 * 12-09-04 01.05.05 Added Target Mode Large CDB Enable to FC Port Page 1
351 * Flags field.
352 * Added Auto Port Config flag define for SAS IOUNIT
353 * Page 1 ControlFlags.
354 * Added Disabled bad Phy define to Expander Page 1
355 * Discovery Info field.
356 * Added SAS/SATA device support to SAS IOUnit Page 1
357 * ControlFlags.
358 * Added Unsupported device to SAS Dev Page 0 Flags field
359 * Added disable use SATA Hash Address for SAS IOUNIT
360 * page 1 in ControlFields.
361 * 01-15-05 01.05.06 Added defaults for data scrub rate and resync rate to
362 * Manufacturing Page 4.
363 * Added new defines for BIOS Page 1 IOCSettings field.
364 * Added ExtDiskIdentifier field to RAID Physical Disk
365 * Page 0.
366 * Added new defines for SAS IO Unit Page 1 ControlFlags
367 * and to SAS Device Page 0 Flags to control SATA devices.
368 * Added defines and structures for the new Log Page 0, a
369 * new type of configuration page.
370 * 02-09-05 01.05.07 Added InactiveStatus field to RAID Volume Page 0.
371 * Added WWID field to RAID Volume Page 1.
372 * Added PhysicalPort field to SAS Expander pages 0 and 1.
373 * 03-11-05 01.05.08 Removed the EEDP flags from IOC Page 1.
374 * Added Enclosure/Slot boot device format to BIOS Page 2.
375 * New status value for RAID Volume Page 0 VolumeStatus
376 * (VolumeState subfield).
377 * New value for RAID Physical Page 0 InactiveStatus.
378 * Added Inactive Volume Member flag RAID Physical Disk
379 * Page 0 PhysDiskStatus field.
380 * New physical mapping mode in SAS IO Unit Page 2.
381 * Added CONFIG_PAGE_SAS_ENCLOSURE_0.
382 * Added Slot and Enclosure fields to SAS Device Page 0.
145 * -------------------------------------------------------------------------- 383 * --------------------------------------------------------------------------
146 384
147mpi_init.h 385mpi_init.h
@@ -154,6 +392,32 @@ mpi_init.h
154 * 02-20-01 01.01.03 Started using MPI_POINTER. 392 * 02-20-01 01.01.03 Started using MPI_POINTER.
155 * 03-27-01 01.01.04 Added structure offset comments. 393 * 03-27-01 01.01.04 Added structure offset comments.
156 * 04-10-01 01.01.05 Added new MsgFlag for MSG_SCSI_TASK_MGMT. 394 * 04-10-01 01.01.05 Added new MsgFlag for MSG_SCSI_TASK_MGMT.
395 * 08-08-01 01.02.01 Original release for v1.2 work.
396 * 08-29-01 01.02.02 Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET.
397 * Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for
398 * MSG_SCSI_IO_REPLY.
399 * 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure
400 * Processor messages.
401 * 10-04-01 01.02.04 Added defines for SEP request Action field.
402 * 05-31-02 01.02.05 Added MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR define
403 * for SCSI IO requests.
404 * 11-15-02 01.02.06 Added special extended SCSI Status defines for FCP.
405 * 06-26-03 01.02.07 Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
406 * 05-11-04 01.03.01 Original release for MPI v1.3.
407 * 08-19-04 01.05.01 Added MsgFlags defines for EEDP to SCSI IO request.
408 * Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
409 * and a reserved U16.
410 * Added new MSG_SCSI_IO32_REQUEST structure.
411 * Added a TaskType of Clear Task Set to SCSI
412 * Task Management request.
413 * 12-07-04 01.05.02 Added support for Task Management Query Task.
414 * 01-15-05 01.05.03 Modified SCSI Enclosure Processor Request to support
415 * WWID addressing.
416 * 03-11-05 01.05.04 Removed EEDP flags from SCSI IO Request.
417 * Removed SCSI IO 32 Request.
418 * Modified SCSI Enclosure Processor Request and Reply to
419 * support Enclosure/Slot addressing rather than WWID
420 * addressing.
157 * -------------------------------------------------------------------------- 421 * --------------------------------------------------------------------------
158 422
159mpi_targ.h 423mpi_targ.h
@@ -170,6 +434,33 @@ mpi_targ.h
170 * Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and 434 * Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
171 * MPI_TARGET_FCP_CMD_BUFFER. 435 * MPI_TARGET_FCP_CMD_BUFFER.
172 * 03-27-01 01.01.04 Added structure offset comments. 436 * 03-27-01 01.01.04 Added structure offset comments.
437 * 08-08-01 01.02.01 Original release for v1.2 work.
438 * 09-28-01 01.02.02 Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU.
439 * Added PriorityReason field to some replies and
440 * defined more PriorityReason codes.
441 * Added some defines for to support previous version
442 * of MPI.
443 * 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY.
444 * 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.
445 * 03-14-02 01.02.05 Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper
446 * byte ordering.
447 * 05-31-02 01.02.06 Modified TARGET_MODE_REPLY_ALIAS_MASK to only include
448 * one bit.
449 * Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.
450 * 09-16-02 01.02.07 Added flags for confirmed completion.
451 * Added PRIORITY_REASON_TARGET_BUSY.
452 * 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.
453 * 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.
454 * 05-11-04 01.03.01 Original release for MPI v1.3.
455 * 08-19-04 01.05.01 Added new request message structures for
456 * MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
457 * MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and
458 * MSG_TARGET_ASSIST_EXT_REQUEST.
459 * Added new structures for SAS SSP Command buffer, SSP
460 * Task buffer, and SSP Status IU.
461 * 10-05-04 01.05.02 MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.
462 * 02-22-05 01.05.03 Changed a comment.
463 * 03-11-05 01.05.04 Removed TargetAssistExtended Request.
173 * -------------------------------------------------------------------------- 464 * --------------------------------------------------------------------------
174 465
175mpi_fc.h 466mpi_fc.h
@@ -192,6 +483,13 @@ mpi_fc.h
192 * Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define. 483 * Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define.
193 * Added structure offset comments. 484 * Added structure offset comments.
194 * 04-09-01 01.01.07 Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST. 485 * 04-09-01 01.01.07 Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST.
486 * 08-08-01 01.02.01 Original release for v1.2 work.
487 * 09-28-01 01.02.02 Change name of reserved field in
488 * MSG_LINK_SERVICE_RSP_REPLY.
489 * 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests.
490 * 01-16-04 01.02.04 Added define for MPI_FC_PRIM_SEND_FLAGS_ML_RESET_LINK.
491 * 05-11-04 01.03.01 Original release for MPI v1.3.
492 * 08-19-04 01.05.01 Original release for MPI v1.5.
195 * -------------------------------------------------------------------------- 493 * --------------------------------------------------------------------------
196 494
197mpi_lan.h 495mpi_lan.h
@@ -209,11 +507,56 @@ mpi_lan.h
209 * 11-02-00 01.01.01 Original release for post 1.0 work 507 * 11-02-00 01.01.01 Original release for post 1.0 work
210 * 02-20-01 01.01.02 Started using MPI_POINTER. 508 * 02-20-01 01.01.02 Started using MPI_POINTER.
211 * 03-27-01 01.01.03 Added structure offset comments. 509 * 03-27-01 01.01.03 Added structure offset comments.
510 * 08-08-01 01.02.01 Original release for v1.2 work.
511 * 05-11-04 01.03.01 Original release for MPI v1.3.
512 * 08-19-04 01.05.01 Original release for MPI v1.5.
212 * -------------------------------------------------------------------------- 513 * --------------------------------------------------------------------------
213 514
214mpi_raid.h 515mpi_raid.h
215 * 02-27-01 01.01.01 Original release for this file. 516 * 02-27-01 01.01.01 Original release for this file.
216 * 03-27-01 01.01.02 Added structure offset comments. 517 * 03-27-01 01.01.02 Added structure offset comments.
518 * 08-08-01 01.02.01 Original release for v1.2 work.
519 * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines.
520 * 09-28-01 01.02.02 Major rework for MPI v1.2 Integrated RAID changes.
521 * 10-04-01 01.02.03 Added ActionData defines for
522 * MPI_RAID_ACTION_DELETE_VOLUME action.
523 * 11-01-01 01.02.04 Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC.
524 * 03-14-02 01.02.05 Added define for MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT.
525 * 05-07-02 01.02.06 Added define for MPI_RAID_ACTION_ACTIVATE_VOLUME,
526 * MPI_RAID_ACTION_INACTIVATE_VOLUME, and
527 * MPI_RAID_ACTION_ADATA_INACTIVATE_ALL.
528 * 07-12-02 01.02.07 Added structures for Mailbox request and reply.
529 * 11-15-02 01.02.08 Added missing MsgContext field to MSG_MAILBOX_REQUEST.
530 * 04-01-03 01.02.09 New action data option flag for
531 * MPI_RAID_ACTION_DELETE_VOLUME.
532 * 05-11-04 01.03.01 Original release for MPI v1.3.
533 * 08-19-04 01.05.01 Original release for MPI v1.5.
534 * 01-15-05 01.05.02 Added defines for the two new RAID Actions for
535 * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
536 * --------------------------------------------------------------------------
537
538mpi_tool.h
539 * 08-08-01 01.02.01 Original release.
540 * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines.
541 * 01-16-04 01.02.03 Added defines and structures for new tools
542 *. MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL and
543 * MPI_TOOLBOX_FC_MANAGEMENT_TOOL.
544 * 04-29-04 01.02.04 Added message structures for Diagnostic Buffer Post and
545 * Diagnostic Release requests and replies.
546 * 05-11-04 01.03.01 Original release for MPI v1.3.
547 * 08-19-04 01.05.01 Original release for MPI v1.5.
548 * 10-06-04 01.05.02 Added define for MPI_DIAG_BUF_TYPE_COUNT.
549 * 02-09-05 01.05.03 Added frame size option to FC management tool.
550 * Added Beacon tool to the Toolbox.
551 * --------------------------------------------------------------------------
552
553mpi_inb.h
554 * 05-11-04 01.03.01 Original release.
555 * 08-19-04 01.05.01 Original release for MPI v1.5.
556 * --------------------------------------------------------------------------
557
558mpi_sas.h
559 * 08-19-04 01.05.01 Original release.
217 * -------------------------------------------------------------------------- 560 * --------------------------------------------------------------------------
218 561
219mpi_type.h 562mpi_type.h
@@ -221,21 +564,83 @@ mpi_type.h
221 * 06-06-00 01.00.01 Update version number for 1.0 release. 564 * 06-06-00 01.00.01 Update version number for 1.0 release.
222 * 11-02-00 01.01.01 Original release for post 1.0 work 565 * 11-02-00 01.01.01 Original release for post 1.0 work
223 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER. 566 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER.
567 * 08-08-01 01.02.01 Original release for v1.2 work.
568 * 05-11-04 01.03.01 Original release for MPI v1.3.
569 * 08-19-04 01.05.01 Original release for MPI v1.5.
224 * -------------------------------------------------------------------------- 570 * --------------------------------------------------------------------------
225 571
226mpi_history.txt Parts list history 572mpi_history.txt Parts list history
227 573
228Filename 01.01.10 574Filename 01.05.09
229---------- -------- 575---------- --------
230mpi.h 01.01.07 576mpi.h 01.05.07
231mpi_ioc.h 01.01.07 577mpi_ioc.h 01.05.08
232mpi_cnfg.h 01.01.11 578mpi_cnfg.h 01.05.08
233mpi_init.h 01.01.05 579mpi_init.h 01.05.04
234mpi_targ.h 01.01.04 580mpi_targ.h 01.05.04
235mpi_fc.h 01.01.07 581mpi_fc.h 01.05.01
236mpi_lan.h 01.01.03 582mpi_lan.h 01.05.01
237mpi_raid.h 01.01.02 583mpi_raid.h 01.05.02
238mpi_type.h 01.01.02 584mpi_tool.h 01.05.03
585mpi_inb.h 01.05.01
586mpi_sas.h 01.05.01
587mpi_type.h 01.05.01
588
589Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03
590---------- -------- -------- -------- -------- -------- --------
591mpi.h 01.05.06 01.05.05 01.05.04 01.05.03 01.05.02 01.05.01
592mpi_ioc.h 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 01.05.02
593mpi_cnfg.h 01.05.07 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03
594mpi_init.h 01.05.03 01.05.03 01.05.03 01.05.02 01.05.02 01.05.01
595mpi_targ.h 01.05.03 01.05.02 01.05.02 01.05.02 01.05.02 01.05.02
596mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
597mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
598mpi_raid.h 01.05.02 01.05.02 01.05.02 01.05.01 01.05.01 01.05.01
599mpi_tool.h 01.05.03 01.05.03 01.05.02 01.05.02 01.05.02 01.05.02
600mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
601mpi_sas.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
602mpi_type.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
603
604Filename 01.05.02 01.05.01 01.03.01 01.02.14 01.02.13 01.02.12
605---------- -------- -------- -------- -------- -------- --------
606mpi.h 01.05.01 01.05.01 01.03.01 01.02.12 01.02.11 01.02.10
607mpi_ioc.h 01.05.02 01.05.01 01.03.01 01.02.09 01.02.08 01.02.08
608mpi_cnfg.h 01.05.02 01.05.01 01.03.01 01.02.14 01.02.13 01.02.12
609mpi_init.h 01.05.01 01.05.01 01.03.01 01.02.07 01.02.07 01.02.07
610mpi_targ.h 01.05.02 01.05.01 01.03.01 01.02.09 01.02.09 01.02.09
611mpi_fc.h 01.05.01 01.05.01 01.03.01 01.02.04 01.02.04 01.02.03
612mpi_lan.h 01.05.01 01.05.01 01.03.01 01.02.01 01.02.01 01.02.01
613mpi_raid.h 01.05.01 01.05.01 01.03.01 01.02.09 01.02.09 01.02.09
614mpi_tool.h 01.05.02 01.05.01 01.03.01 01.02.01 01.02.01 01.02.01
615mpi_inb.h 01.05.01 01.05.01 01.03.01
616mpi_sas.h 01.05.01 01.05.01
617mpi_type.h 01.05.01 01.05.01 01.03.01 01.02.04 01.02.03 01.02.02
618
619Filename 01.02.11 01.02.10 01.02.09 01.02.08 01.02.07 01.02.06
620---------- -------- -------- -------- -------- -------- --------
621mpi.h 01.02.09 01.02.08 01.02.07 01.02.06 01.02.05 01.02.04
622mpi_ioc.h 01.02.07 01.02.06 01.02.06 01.02.06 01.02.06 01.02.05
623mpi_cnfg.h 01.02.11 01.02.10 01.02.09 01.02.08 01.02.07 01.02.06
624mpi_init.h 01.02.06 01.02.06 01.02.05 01.02.05 01.02.05 01.02.04
625mpi_targ.h 01.02.09 01.02.08 01.02.07 01.02.06 01.02.06 01.02.05
626mpi_fc.h 01.02.03 01.02.03 01.02.03 01.02.03 01.02.03 01.02.02
627mpi_lan.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01
628mpi_raid.h 01.02.09 01.02.08 01.02.07 01.02.07 01.02.06 01.02.05
629mpi_tool.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01
630mpi_type.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.02 01.02.02
631
632Filename 01.02.05 01.02.04 01.02.03 01.02.02 01.02.01 01.01.10
633---------- -------- -------- -------- -------- -------- --------
634mpi.h 01.02.03 01.02.02 01.02.02 01.02.01 01.02.01 01.01.07
635mpi_ioc.h 01.02.04 01.02.03 01.02.03 01.02.02 01.02.01 01.01.07
636mpi_cnfg.h 01.02.05 01.02.04 01.02.03 01.02.02 01.02.01 01.01.11
637mpi_init.h 01.02.04 01.02.04 01.02.03 01.02.02 01.02.01 01.01.05
638mpi_targ.h 01.02.04 01.02.03 01.02.02 01.02.01 01.02.01 01.01.04
639mpi_fc.h 01.02.02 01.02.02 01.02.02 01.02.01 01.02.01 01.01.07
640mpi_lan.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.01.03
641mpi_raid.h 01.02.04 01.02.03 01.02.02 01.02.01 01.02.01 01.01.02
642mpi_tool.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.01
643mpi_type.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.01 01.01.02
239 644
240Filename 01.01.09 01.01.08 01.01.07 01.01.06 01.01.05 01.01.04 645Filename 01.01.09 01.01.08 01.01.07 01.01.06 01.01.05 01.01.04
241---------- -------- -------- -------- -------- -------- -------- 646---------- -------- -------- -------- -------- -------- --------
diff --git a/drivers/message/fusion/lsi/mpi_inb.h b/drivers/message/fusion/lsi/mpi_inb.h
index dae29fbed56f..ff167309ba27 100644
--- a/drivers/message/fusion/lsi/mpi_inb.h
+++ b/drivers/message/fusion/lsi/mpi_inb.h
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (c) 2003 LSI Logic Corporation. 2 * Copyright (c) 2003-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_inb.h 5 * Name: mpi_inb.h
6 * Title: MPI Inband structures and definitions 6 * Title: MPI Inband structures and definitions
7 * Creation Date: September 30, 2003 7 * Creation Date: September 30, 2003
8 * 8 *
9 * mpi_inb.h Version: 01.03.xx 9 * mpi_inb.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
13 * 13 *
14 * Date Version Description 14 * Date Version Description
15 * -------- -------- ------------------------------------------------------ 15 * -------- -------- ------------------------------------------------------
16 * ??-??-?? 01.03.01 Original release. 16 * 05-11-04 01.03.01 Original release.
17 * 08-19-04 01.05.01 Original release for MPI v1.5.
17 * -------------------------------------------------------------------------- 18 * --------------------------------------------------------------------------
18 */ 19 */
19 20
diff --git a/drivers/message/fusion/lsi/mpi_init.h b/drivers/message/fusion/lsi/mpi_init.h
index b3c95fd7256f..aca035801a86 100644
--- a/drivers/message/fusion/lsi/mpi_init.h
+++ b/drivers/message/fusion/lsi/mpi_init.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_init.h 5 * Name: mpi_init.h
6 * Title: MPI initiator mode messages and structures 6 * Title: MPI initiator mode messages and structures
7 * Creation Date: June 8, 2000 7 * Creation Date: June 8, 2000
8 * 8 *
9 * mpi_init.h Version: 01.05.xx 9 * mpi_init.h Version: 01.05.04
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -33,6 +33,21 @@
33 * for SCSI IO requests. 33 * for SCSI IO requests.
34 * 11-15-02 01.02.06 Added special extended SCSI Status defines for FCP. 34 * 11-15-02 01.02.06 Added special extended SCSI Status defines for FCP.
35 * 06-26-03 01.02.07 Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define. 35 * 06-26-03 01.02.07 Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
36 * 05-11-04 01.03.01 Original release for MPI v1.3.
37 * 08-19-04 01.05.01 Added MsgFlags defines for EEDP to SCSI IO request.
38 * Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
39 * and a reserved U16.
40 * Added new MSG_SCSI_IO32_REQUEST structure.
41 * Added a TaskType of Clear Task Set to SCSI
42 * Task Management request.
43 * 12-07-04 01.05.02 Added support for Task Management Query Task.
44 * 01-15-05 01.05.03 Modified SCSI Enclosure Processor Request to support
45 * WWID addressing.
46 * 03-11-05 01.05.04 Removed EEDP flags from SCSI IO Request.
47 * Removed SCSI IO 32 Request.
48 * Modified SCSI Enclosure Processor Request and Reply to
49 * support Enclosure/Slot addressing rather than WWID
50 * addressing.
36 * -------------------------------------------------------------------------- 51 * --------------------------------------------------------------------------
37 */ 52 */
38 53
@@ -76,20 +91,12 @@ typedef struct _MSG_SCSI_IO_REQUEST
76#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01) 91#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01)
77#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00) 92#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00)
78#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01) 93#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01)
94
79#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02) 95#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02)
80#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00) 96#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00)
81#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02) 97#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02)
82#define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR (0x04)
83#define MPI_SCSIIO_MSGFLGS_EEDP_TYPE_MASK (0xE0)
84#define MPI_SCSIIO_MSGFLGS_EEDP_NONE (0x00)
85#define MPI_SCSIIO_MSGFLGS_EEDP_RDPROTECT_T10 (0x20)
86#define MPI_SCSIIO_MSGFLGS_EEDP_VRPROTECT_T10 (0x40)
87#define MPI_SCSIIO_MSGFLGS_EEDP_WRPROTECT_T10 (0x60)
88#define MPI_SCSIIO_MSGFLGS_EEDP_520_READ_MODE1 (0x20)
89#define MPI_SCSIIO_MSGFLGS_EEDP_520_WRITE_MODE1 (0x40)
90#define MPI_SCSIIO_MSGFLGS_EEDP_8_9_READ_MODE1 (0x60)
91#define MPI_SCSIIO_MSGFLGS_EEDP_8_9_WRITE_MODE1 (0x80)
92 98
99#define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR (0x04)
93 100
94/* SCSI IO LUN fields */ 101/* SCSI IO LUN fields */
95 102
@@ -148,6 +155,8 @@ typedef struct _MSG_SCSI_IO_REPLY
148 U32 TransferCount; /* 14h */ 155 U32 TransferCount; /* 14h */
149 U32 SenseCount; /* 18h */ 156 U32 SenseCount; /* 18h */
150 U32 ResponseInfo; /* 1Ch */ 157 U32 ResponseInfo; /* 1Ch */
158 U16 TaskTag; /* 20h */
159 U16 Reserved1; /* 22h */
151} MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY, 160} MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
152 SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t; 161 SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
153 162
@@ -190,32 +199,7 @@ typedef struct _MSG_SCSI_IO_REPLY
190#define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED (0x05000000) 199#define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED (0x05000000)
191#define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE (0x06000000) 200#define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE (0x06000000)
192 201
193 202#define MPI_SCSI_TASKTAG_UNKNOWN (0xFFFF)
194/****************************************************************************/
195/* SCSI IO 32 Request message structure */
196/****************************************************************************/
197
198typedef struct _MSG_SCSI_IO32_REQUEST
199{
200 U8 TargetID; /* 00h */
201 U8 Bus; /* 01h */
202 U8 ChainOffset; /* 02h */
203 U8 Function; /* 03h */
204 U8 CDBLength; /* 04h */
205 U8 SenseBufferLength; /* 05h */
206 U8 Reserved; /* 06h */
207 U8 MsgFlags; /* 07h */
208 U32 MsgContext; /* 08h */
209 U8 LUN[8]; /* 0Ch */
210 U32 Control; /* 14h */
211 U8 CDB[32]; /* 18h */
212 U32 DataLength; /* 38h */
213 U32 SenseBufferLowAddr; /* 3Ch */
214 SGE_IO_UNION SGL; /* 40h */
215} MSG_SCSI_IO32_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO32_REQUEST,
216 SCSIIO32Request_t, MPI_POINTER pSCSIIO32Request_t;
217
218/* SCSI IO 32 uses the same defines as above for SCSI IO */
219 203
220 204
221/****************************************************************************/ 205/****************************************************************************/
@@ -247,6 +231,7 @@ typedef struct _MSG_SCSI_TASK_MGMT
247#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04) 231#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04)
248#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) 232#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05)
249#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) 233#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06)
234#define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07)
250 235
251/* MsgFlags bits */ 236/* MsgFlags bits */
252#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00) 237#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00)
@@ -260,7 +245,7 @@ typedef struct _MSG_SCSI_TASK_MGMT_REPLY
260 U8 Bus; /* 01h */ 245 U8 Bus; /* 01h */
261 U8 MsgLength; /* 02h */ 246 U8 MsgLength; /* 02h */
262 U8 Function; /* 03h */ 247 U8 Function; /* 03h */
263 U8 Reserved; /* 04h */ 248 U8 ResponseCode; /* 04h */
264 U8 TaskType; /* 05h */ 249 U8 TaskType; /* 05h */
265 U8 Reserved1; /* 06h */ 250 U8 Reserved1; /* 06h */
266 U8 MsgFlags; /* 07h */ 251 U8 MsgFlags; /* 07h */
@@ -272,6 +257,15 @@ typedef struct _MSG_SCSI_TASK_MGMT_REPLY
272} MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY, 257} MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
273 SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t; 258 SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
274 259
260/* ResponseCode values */
261#define MPI_SCSITASKMGMT_RSP_TM_COMPLETE (0x00)
262#define MPI_SCSITASKMGMT_RSP_INVALID_FRAME (0x02)
263#define MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED (0x04)
264#define MPI_SCSITASKMGMT_RSP_TM_FAILED (0x05)
265#define MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED (0x08)
266#define MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN (0x09)
267#define MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC (0x80)
268
275 269
276/****************************************************************************/ 270/****************************************************************************/
277/* SCSI Enclosure Processor messages */ 271/* SCSI Enclosure Processor messages */
@@ -284,11 +278,16 @@ typedef struct _MSG_SEP_REQUEST
284 U8 ChainOffset; /* 02h */ 278 U8 ChainOffset; /* 02h */
285 U8 Function; /* 03h */ 279 U8 Function; /* 03h */
286 U8 Action; /* 04h */ 280 U8 Action; /* 04h */
287 U8 Reserved1; /* 05h */ 281 U8 Flags; /* 05h */
288 U8 Reserved2; /* 06h */ 282 U8 Reserved1; /* 06h */
289 U8 MsgFlags; /* 07h */ 283 U8 MsgFlags; /* 07h */
290 U32 MsgContext; /* 08h */ 284 U32 MsgContext; /* 08h */
291 U32 SlotStatus; /* 0Ch */ 285 U32 SlotStatus; /* 0Ch */
286 U32 Reserved2; /* 10h */
287 U32 Reserved3; /* 14h */
288 U32 Reserved4; /* 18h */
289 U16 Slot; /* 1Ch */
290 U16 EnclosureHandle; /* 1Eh */
292} MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST, 291} MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST,
293 SEPRequest_t, MPI_POINTER pSEPRequest_t; 292 SEPRequest_t, MPI_POINTER pSEPRequest_t;
294 293
@@ -296,6 +295,10 @@ typedef struct _MSG_SEP_REQUEST
296#define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00) 295#define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00)
297#define MPI_SEP_REQ_ACTION_READ_STATUS (0x01) 296#define MPI_SEP_REQ_ACTION_READ_STATUS (0x01)
298 297
298/* Flags defines */
299#define MPI_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS (0x01)
300#define MPI_SEP_REQ_FLAGS_BUS_TARGETID_ADDRESS (0x00)
301
299/* SlotStatus bits for MSG_SEP_REQUEST */ 302/* SlotStatus bits for MSG_SEP_REQUEST */
300#define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001) 303#define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001)
301#define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002) 304#define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002)
@@ -332,6 +335,9 @@ typedef struct _MSG_SEP_REPLY
332 U16 IOCStatus; /* 0Eh */ 335 U16 IOCStatus; /* 0Eh */
333 U32 IOCLogInfo; /* 10h */ 336 U32 IOCLogInfo; /* 10h */
334 U32 SlotStatus; /* 14h */ 337 U32 SlotStatus; /* 14h */
338 U32 Reserved4; /* 18h */
339 U16 Slot; /* 1Ch */
340 U16 EnclosureHandle; /* 1Eh */
335} MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY, 341} MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
336 SEPReply_t, MPI_POINTER pSEPReply_t; 342 SEPReply_t, MPI_POINTER pSEPReply_t;
337 343
diff --git a/drivers/message/fusion/lsi/mpi_ioc.h b/drivers/message/fusion/lsi/mpi_ioc.h
index 82445d18b4d5..f91eb4efe8cc 100644
--- a/drivers/message/fusion/lsi/mpi_ioc.h
+++ b/drivers/message/fusion/lsi/mpi_ioc.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_ioc.h 5 * Name: mpi_ioc.h
6 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages 6 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages
7 * Creation Date: August 11, 2000 7 * Creation Date: August 11, 2000
8 * 8 *
9 * mpi_ioc.h Version: 01.05.xx 9 * mpi_ioc.h Version: 01.05.08
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -57,6 +57,30 @@
57 * Added AliasIndex to EVENT_DATA_LOGOUT structure. 57 * Added AliasIndex to EVENT_DATA_LOGOUT structure.
58 * 04-01-03 01.02.07 Added defines for MPI_FW_HEADER_SIGNATURE_. 58 * 04-01-03 01.02.07 Added defines for MPI_FW_HEADER_SIGNATURE_.
59 * 06-26-03 01.02.08 Added new values to the product family defines. 59 * 06-26-03 01.02.08 Added new values to the product family defines.
60 * 04-29-04 01.02.09 Added IOCCapabilities field to MSG_IOC_FACTS_REPLY and
61 * added related defines.
62 * 05-11-04 01.03.01 Original release for MPI v1.3.
63 * 08-19-04 01.05.01 Added four new fields to MSG_IOC_INIT.
64 * Added three new fields to MSG_IOC_FACTS_REPLY.
65 * Defined four new bits for the IOCCapabilities field of
66 * the IOCFacts reply.
67 * Added two new PortTypes for the PortFacts reply.
68 * Added six new events along with their EventData
69 * structures.
70 * Added a new MsgFlag to the FwDownload request to
71 * indicate last segment.
72 * Defined a new image type of boot loader.
73 * Added FW family codes for SAS product families.
74 * 10-05-04 01.05.02 Added ReplyFifoHostSignalingAddr field to
75 * MSG_IOC_FACTS_REPLY.
76 * 12-07-04 01.05.03 Added more defines for SAS Discovery Error event.
77 * 12-09-04 01.05.04 Added Unsupported device to SAS Device event.
78 * 01-15-05 01.05.05 Added event data for SAS SES Event.
79 * 02-09-05 01.05.06 Added MPI_FW_UPLOAD_ITYPE_FW_BACKUP define.
80 * 02-22-05 01.05.07 Added Host Page Buffer Persistent flag to IOC Facts
81 * Reply and IOC Init Request.
82 * 03-11-05 01.05.08 Added family code for 1068E family.
83 * Removed IOCFacts Reply EEDP Capability bit.
60 * -------------------------------------------------------------------------- 84 * --------------------------------------------------------------------------
61 */ 85 */
62 86
@@ -90,20 +114,37 @@ typedef struct _MSG_IOC_INIT
90 U32 HostMfaHighAddr; /* 10h */ 114 U32 HostMfaHighAddr; /* 10h */
91 U32 SenseBufferHighAddr; /* 14h */ 115 U32 SenseBufferHighAddr; /* 14h */
92 U32 ReplyFifoHostSignalingAddr; /* 18h */ 116 U32 ReplyFifoHostSignalingAddr; /* 18h */
117 SGE_SIMPLE_UNION HostPageBufferSGE; /* 1Ch */
118 U16 MsgVersion; /* 28h */
119 U16 HeaderVersion; /* 2Ah */
93} MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT, 120} MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT,
94 IOCInit_t, MPI_POINTER pIOCInit_t; 121 IOCInit_t, MPI_POINTER pIOCInit_t;
95 122
96/* WhoInit values */ 123/* WhoInit values */
97#define MPI_WHOINIT_NO_ONE (0x00) 124#define MPI_WHOINIT_NO_ONE (0x00)
98#define MPI_WHOINIT_SYSTEM_BIOS (0x01) 125#define MPI_WHOINIT_SYSTEM_BIOS (0x01)
99#define MPI_WHOINIT_ROM_BIOS (0x02) 126#define MPI_WHOINIT_ROM_BIOS (0x02)
100#define MPI_WHOINIT_PCI_PEER (0x03) 127#define MPI_WHOINIT_PCI_PEER (0x03)
101#define MPI_WHOINIT_HOST_DRIVER (0x04) 128#define MPI_WHOINIT_HOST_DRIVER (0x04)
102#define MPI_WHOINIT_MANUFACTURER (0x05) 129#define MPI_WHOINIT_MANUFACTURER (0x05)
103 130
104/* Flags values */ 131/* Flags values */
105#define MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE (0x01) 132#define MPI_IOCINIT_FLAGS_HOST_PAGE_BUFFER_PERSISTENT (0x04)
106#define MPI_IOCINIT_FLAGS_REPLY_FIFO_HOST_SIGNAL (0x02) 133#define MPI_IOCINIT_FLAGS_REPLY_FIFO_HOST_SIGNAL (0x02)
134#define MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE (0x01)
135
136/* MsgVersion */
137#define MPI_IOCINIT_MSGVERSION_MAJOR_MASK (0xFF00)
138#define MPI_IOCINIT_MSGVERSION_MAJOR_SHIFT (8)
139#define MPI_IOCINIT_MSGVERSION_MINOR_MASK (0x00FF)
140#define MPI_IOCINIT_MSGVERSION_MINOR_SHIFT (0)
141
142/* HeaderVersion */
143#define MPI_IOCINIT_HEADERVERSION_UNIT_MASK (0xFF00)
144#define MPI_IOCINIT_HEADERVERSION_UNIT_SHIFT (8)
145#define MPI_IOCINIT_HEADERVERSION_DEV_MASK (0x00FF)
146#define MPI_IOCINIT_HEADERVERSION_DEV_SHIFT (0)
147
107 148
108typedef struct _MSG_IOC_INIT_REPLY 149typedef struct _MSG_IOC_INIT_REPLY
109{ 150{
@@ -187,32 +228,39 @@ typedef struct _MSG_IOC_FACTS_REPLY
187 MPI_FW_VERSION FWVersion; /* 38h */ 228 MPI_FW_VERSION FWVersion; /* 38h */
188 U16 HighPriorityQueueDepth; /* 3Ch */ 229 U16 HighPriorityQueueDepth; /* 3Ch */
189 U16 Reserved2; /* 3Eh */ 230 U16 Reserved2; /* 3Eh */
231 SGE_SIMPLE_UNION HostPageBufferSGE; /* 40h */
232 U32 ReplyFifoHostSignalingAddr; /* 4Ch */
190} MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY, 233} MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY,
191 IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t; 234 IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t;
192 235
193#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00) 236#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00)
194#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF) 237#define MPI_IOCFACTS_MSGVERSION_MAJOR_SHIFT (8)
238#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF)
239#define MPI_IOCFACTS_MSGVERSION_MINOR_SHIFT (0)
195 240
196#define MPI_IOCFACTS_HEADERVERSION_UNIT_MASK (0xFF00) 241#define MPI_IOCFACTS_HDRVERSION_UNIT_MASK (0xFF00)
197#define MPI_IOCFACTS_HEADERVERSION_DEV_MASK (0x00FF) 242#define MPI_IOCFACTS_HDRVERSION_UNIT_SHIFT (8)
243#define MPI_IOCFACTS_HDRVERSION_DEV_MASK (0x00FF)
244#define MPI_IOCFACTS_HDRVERSION_DEV_SHIFT (0)
198 245
199#define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0001) 246#define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0001)
200#define MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID (0x0002) 247#define MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID (0x0002)
201#define MPI_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL (0x0004) 248#define MPI_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL (0x0004)
202#define MPI_IOCFACTS_EXCEPT_PERSISTENT_TABLE_FULL (0x0008) 249#define MPI_IOCFACTS_EXCEPT_PERSISTENT_TABLE_FULL (0x0008)
203 250
204#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01) 251#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01)
252#define MPI_IOCFACTS_FLAGS_REPLY_FIFO_HOST_SIGNAL (0x02)
253#define MPI_IOCFACTS_FLAGS_HOST_PAGE_BUFFER_PERSISTENT (0x04)
205 254
206#define MPI_IOCFACTS_EVENTSTATE_DISABLED (0x00) 255#define MPI_IOCFACTS_EVENTSTATE_DISABLED (0x00)
207#define MPI_IOCFACTS_EVENTSTATE_ENABLED (0x01) 256#define MPI_IOCFACTS_EVENTSTATE_ENABLED (0x01)
208 257
209#define MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q (0x00000001) 258#define MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q (0x00000001)
210#define MPI_IOCFACTS_CAPABILITY_REPLY_HOST_SIGNAL (0x00000002) 259#define MPI_IOCFACTS_CAPABILITY_REPLY_HOST_SIGNAL (0x00000002)
211#define MPI_IOCFACTS_CAPABILITY_QUEUE_FULL_HANDLING (0x00000004) 260#define MPI_IOCFACTS_CAPABILITY_QUEUE_FULL_HANDLING (0x00000004)
212#define MPI_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER (0x00000008) 261#define MPI_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER (0x00000008)
213#define MPI_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER (0x00000010) 262#define MPI_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER (0x00000010)
214#define MPI_IOCFACTS_CAPABILITY_EXTENDED_BUFFER (0x00000020) 263#define MPI_IOCFACTS_CAPABILITY_EXTENDED_BUFFER (0x00000020)
215#define MPI_IOCFACTS_CAPABILITY_EEDP (0x00000040)
216 264
217 265
218 266
@@ -408,6 +456,8 @@ typedef struct _MSG_EVENT_ACK_REPLY
408#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F) 456#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F)
409#define MPI_EVENT_SAS_SES (0x00000010) 457#define MPI_EVENT_SAS_SES (0x00000010)
410#define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) 458#define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011)
459#define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012)
460#define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013)
411 461
412/* AckRequired field values */ 462/* AckRequired field values */
413 463
@@ -467,6 +517,10 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
467 U8 ASCQ; /* 05h */ 517 U8 ASCQ; /* 05h */
468 U16 DevHandle; /* 06h */ 518 U16 DevHandle; /* 06h */
469 U32 DeviceInfo; /* 08h */ 519 U32 DeviceInfo; /* 08h */
520 U16 ParentDevHandle; /* 0Ch */
521 U8 PhyNum; /* 0Eh */
522 U8 Reserved1; /* 0Fh */
523 U64 SASAddress; /* 10h */
470} EVENT_DATA_SAS_DEVICE_STATUS_CHANGE, 524} EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
471 MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE, 525 MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
472 MpiEventDataSasDeviceStatusChange_t, 526 MpiEventDataSasDeviceStatusChange_t,
@@ -477,6 +531,8 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
477#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING (0x04) 531#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING (0x04)
478#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) 532#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05)
479#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) 533#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06)
534#define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07)
535
480 536
481/* SCSI Event data for Queue Full event */ 537/* SCSI Event data for Queue Full event */
482 538
@@ -488,6 +544,35 @@ typedef struct _EVENT_DATA_QUEUE_FULL
488} EVENT_DATA_QUEUE_FULL, MPI_POINTER PTR_EVENT_DATA_QUEUE_FULL, 544} EVENT_DATA_QUEUE_FULL, MPI_POINTER PTR_EVENT_DATA_QUEUE_FULL,
489 EventDataQueueFull_t, MPI_POINTER pEventDataQueueFull_t; 545 EventDataQueueFull_t, MPI_POINTER pEventDataQueueFull_t;
490 546
547/* MPI Integrated RAID Event data */
548
549typedef struct _EVENT_DATA_RAID
550{
551 U8 VolumeID; /* 00h */
552 U8 VolumeBus; /* 01h */
553 U8 ReasonCode; /* 02h */
554 U8 PhysDiskNum; /* 03h */
555 U8 ASC; /* 04h */
556 U8 ASCQ; /* 05h */
557 U16 Reserved; /* 06h */
558 U32 SettingsStatus; /* 08h */
559} EVENT_DATA_RAID, MPI_POINTER PTR_EVENT_DATA_RAID,
560 MpiEventDataRaid_t, MPI_POINTER pMpiEventDataRaid_t;
561
562/* MPI Integrated RAID Event data ReasonCode values */
563#define MPI_EVENT_RAID_RC_VOLUME_CREATED (0x00)
564#define MPI_EVENT_RAID_RC_VOLUME_DELETED (0x01)
565#define MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED (0x02)
566#define MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED (0x03)
567#define MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED (0x04)
568#define MPI_EVENT_RAID_RC_PHYSDISK_CREATED (0x05)
569#define MPI_EVENT_RAID_RC_PHYSDISK_DELETED (0x06)
570#define MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED (0x07)
571#define MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED (0x08)
572#define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09)
573#define MPI_EVENT_RAID_RC_SMART_DATA (0x0A)
574#define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B)
575
491/* MPI Link Status Change Event data */ 576/* MPI Link Status Change Event data */
492 577
493typedef struct _EVENT_DATA_LINK_STATUS 578typedef struct _EVENT_DATA_LINK_STATUS
@@ -535,35 +620,63 @@ typedef struct _EVENT_DATA_LOGOUT
535 620
536#define MPI_EVENT_LOGOUT_ALL_ALIASES (0xFF) 621#define MPI_EVENT_LOGOUT_ALL_ALIASES (0xFF)
537 622
623/* SAS SES Event data */
538 624
539/* MPI Integrated RAID Event data */ 625typedef struct _EVENT_DATA_SAS_SES
540
541typedef struct _EVENT_DATA_RAID
542{ 626{
543 U8 VolumeID; /* 00h */ 627 U8 PhyNum; /* 00h */
544 U8 VolumeBus; /* 01h */ 628 U8 Port; /* 01h */
545 U8 ReasonCode; /* 02h */ 629 U8 PortWidth; /* 02h */
546 U8 PhysDiskNum; /* 03h */ 630 U8 Reserved1; /* 04h */
547 U8 ASC; /* 04h */ 631} EVENT_DATA_SAS_SES, MPI_POINTER PTR_EVENT_DATA_SAS_SES,
548 U8 ASCQ; /* 05h */ 632 MpiEventDataSasSes_t, MPI_POINTER pMpiEventDataSasSes_t;
549 U16 Reserved; /* 06h */
550 U32 SettingsStatus; /* 08h */
551} EVENT_DATA_RAID, MPI_POINTER PTR_EVENT_DATA_RAID,
552 MpiEventDataRaid_t, MPI_POINTER pMpiEventDataRaid_t;
553 633
554/* MPI Integrated RAID Event data ReasonCode values */ 634/* SAS Phy Link Status Event data */
555#define MPI_EVENT_RAID_RC_VOLUME_CREATED (0x00) 635
556#define MPI_EVENT_RAID_RC_VOLUME_DELETED (0x01) 636typedef struct _EVENT_DATA_SAS_PHY_LINK_STATUS
557#define MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED (0x02) 637{
558#define MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED (0x03) 638 U8 PhyNum; /* 00h */
559#define MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED (0x04) 639 U8 LinkRates; /* 01h */
560#define MPI_EVENT_RAID_RC_PHYSDISK_CREATED (0x05) 640 U16 DevHandle; /* 02h */
561#define MPI_EVENT_RAID_RC_PHYSDISK_DELETED (0x06) 641 U64 SASAddress; /* 04h */
562#define MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED (0x07) 642} EVENT_DATA_SAS_PHY_LINK_STATUS, MPI_POINTER PTR_EVENT_DATA_SAS_PHY_LINK_STATUS,
563#define MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED (0x08) 643 MpiEventDataSasPhyLinkStatus_t, MPI_POINTER pMpiEventDataSasPhyLinkStatus_t;
564#define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09) 644
565#define MPI_EVENT_RAID_RC_SMART_DATA (0x0A) 645/* defines for the LinkRates field of the SAS PHY Link Status event */
566#define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B) 646#define MPI_EVENT_SAS_PLS_LR_CURRENT_MASK (0xF0)
647#define MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT (4)
648#define MPI_EVENT_SAS_PLS_LR_PREVIOUS_MASK (0x0F)
649#define MPI_EVENT_SAS_PLS_LR_PREVIOUS_SHIFT (0)
650#define MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN (0x00)
651#define MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED (0x01)
652#define MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION (0x02)
653#define MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE (0x03)
654#define MPI_EVENT_SAS_PLS_LR_RATE_1_5 (0x08)
655#define MPI_EVENT_SAS_PLS_LR_RATE_3_0 (0x09)
656
657/* SAS Discovery Errror Event data */
658
659typedef struct _EVENT_DATA_DISCOVERY_ERROR
660{
661 U32 DiscoveryStatus; /* 00h */
662 U8 Port; /* 04h */
663 U8 Reserved1; /* 05h */
664 U16 Reserved2; /* 06h */
665} EVENT_DATA_DISCOVERY_ERROR, MPI_POINTER PTR_EVENT_DATA_DISCOVERY_ERROR,
666 EventDataDiscoveryError_t, MPI_POINTER pEventDataDiscoveryError_t;
667
668#define MPI_EVENT_DSCVRY_ERR_DS_LOOP_DETECTED (0x00000001)
669#define MPI_EVENT_DSCVRY_ERR_DS_UNADDRESSABLE_DEVICE (0x00000002)
670#define MPI_EVENT_DSCVRY_ERR_DS_MULTIPLE_PORTS (0x00000004)
671#define MPI_EVENT_DSCVRY_ERR_DS_EXPANDER_ERR (0x00000008)
672#define MPI_EVENT_DSCVRY_ERR_DS_SMP_TIMEOUT (0x00000010)
673#define MPI_EVENT_DSCVRY_ERR_DS_OUT_ROUTE_ENTRIES (0x00000020)
674#define MPI_EVENT_DSCVRY_ERR_DS_INDEX_NOT_EXIST (0x00000040)
675#define MPI_EVENT_DSCVRY_ERR_DS_SMP_FUNCTION_FAILED (0x00000080)
676#define MPI_EVENT_DSCVRY_ERR_DS_SMP_CRC_ERROR (0x00000100)
677#define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_SUBTRACTIVE (0x00000200)
678#define MPI_EVENT_DSCVRY_ERR_DS_TABLE_TO_TABLE (0x00000400)
679#define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_PATHS (0x00000800)
567 680
568 681
569/***************************************************************************** 682/*****************************************************************************
@@ -589,11 +702,13 @@ typedef struct _MSG_FW_DOWNLOAD
589} MSG_FW_DOWNLOAD, MPI_POINTER PTR_MSG_FW_DOWNLOAD, 702} MSG_FW_DOWNLOAD, MPI_POINTER PTR_MSG_FW_DOWNLOAD,
590 FWDownload_t, MPI_POINTER pFWDownload_t; 703 FWDownload_t, MPI_POINTER pFWDownload_t;
591 704
592#define MPI_FW_DOWNLOAD_ITYPE_RESERVED (0x00) 705#define MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT (0x01)
593#define MPI_FW_DOWNLOAD_ITYPE_FW (0x01) 706
594#define MPI_FW_DOWNLOAD_ITYPE_BIOS (0x02) 707#define MPI_FW_DOWNLOAD_ITYPE_RESERVED (0x00)
595#define MPI_FW_DOWNLOAD_ITYPE_NVDATA (0x03) 708#define MPI_FW_DOWNLOAD_ITYPE_FW (0x01)
596#define MPI_FW_DOWNLOAD_ITYPE_BOOTLOADER (0x04) 709#define MPI_FW_DOWNLOAD_ITYPE_BIOS (0x02)
710#define MPI_FW_DOWNLOAD_ITYPE_NVDATA (0x03)
711#define MPI_FW_DOWNLOAD_ITYPE_BOOTLOADER (0x04)
597 712
598 713
599typedef struct _FWDownloadTCSGE 714typedef struct _FWDownloadTCSGE
@@ -647,6 +762,7 @@ typedef struct _MSG_FW_UPLOAD
647#define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02) 762#define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02)
648#define MPI_FW_UPLOAD_ITYPE_NVDATA (0x03) 763#define MPI_FW_UPLOAD_ITYPE_NVDATA (0x03)
649#define MPI_FW_UPLOAD_ITYPE_BOOTLOADER (0x04) 764#define MPI_FW_UPLOAD_ITYPE_BOOTLOADER (0x04)
765#define MPI_FW_UPLOAD_ITYPE_FW_BACKUP (0x05)
650 766
651typedef struct _FWUploadTCSGE 767typedef struct _FWUploadTCSGE
652{ 768{
@@ -723,6 +839,7 @@ typedef struct _MPI_FW_HEADER
723#define MPI_FW_HEADER_PID_PROD_IM_SCSI (0x0400) 839#define MPI_FW_HEADER_PID_PROD_IM_SCSI (0x0400)
724#define MPI_FW_HEADER_PID_PROD_IS_SCSI (0x0500) 840#define MPI_FW_HEADER_PID_PROD_IS_SCSI (0x0500)
725#define MPI_FW_HEADER_PID_PROD_CTX_SCSI (0x0600) 841#define MPI_FW_HEADER_PID_PROD_CTX_SCSI (0x0600)
842#define MPI_FW_HEADER_PID_PROD_IR_SCSI (0x0700)
726 843
727#define MPI_FW_HEADER_PID_FAMILY_MASK (0x00FF) 844#define MPI_FW_HEADER_PID_FAMILY_MASK (0x00FF)
728/* SCSI */ 845/* SCSI */
@@ -740,13 +857,16 @@ typedef struct _MPI_FW_HEADER
740#define MPI_FW_HEADER_PID_FAMILY_1020TA0_SCSI (0x000C) 857#define MPI_FW_HEADER_PID_FAMILY_1020TA0_SCSI (0x000C)
741/* Fibre Channel */ 858/* Fibre Channel */
742#define MPI_FW_HEADER_PID_FAMILY_909_FC (0x0000) 859#define MPI_FW_HEADER_PID_FAMILY_909_FC (0x0000)
743#define MPI_FW_HEADER_PID_FAMILY_919_FC (0x0001) 860#define MPI_FW_HEADER_PID_FAMILY_919_FC (0x0001) /* 919 and 929 */
744#define MPI_FW_HEADER_PID_FAMILY_919X_FC (0x0002) 861#define MPI_FW_HEADER_PID_FAMILY_919X_FC (0x0002) /* 919X and 929X */
745#define MPI_FW_HEADER_PID_FAMILY_919XL_FC (0x0003) 862#define MPI_FW_HEADER_PID_FAMILY_919XL_FC (0x0003) /* 919XL and 929XL */
746#define MPI_FW_HEADER_PID_FAMILY_949_FC (0x0004) 863#define MPI_FW_HEADER_PID_FAMILY_939X_FC (0x0004) /* 939X and 949X */
747#define MPI_FW_HEADER_PID_FAMILY_959_FC (0x0005) 864#define MPI_FW_HEADER_PID_FAMILY_959_FC (0x0005)
748/* SAS */ 865/* SAS */
749#define MPI_FW_HEADER_PID_FAMILY_1064_SAS (0x0001) 866#define MPI_FW_HEADER_PID_FAMILY_1064_SAS (0x0001)
867#define MPI_FW_HEADER_PID_FAMILY_1068_SAS (0x0002)
868#define MPI_FW_HEADER_PID_FAMILY_1078_SAS (0x0003)
869#define MPI_FW_HEADER_PID_FAMILY_106xE_SAS (0x0004) /* 1068E, 1066E, and 1064E */
750 870
751typedef struct _MPI_EXT_IMAGE_HEADER 871typedef struct _MPI_EXT_IMAGE_HEADER
752{ 872{
diff --git a/drivers/message/fusion/lsi/mpi_lan.h b/drivers/message/fusion/lsi/mpi_lan.h
index 3ced12784ee8..dc0b52ae83dd 100644
--- a/drivers/message/fusion/lsi/mpi_lan.h
+++ b/drivers/message/fusion/lsi/mpi_lan.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_lan.h 5 * Name: mpi_lan.h
6 * Title: MPI LAN messages and structures 6 * Title: MPI LAN messages and structures
7 * Creation Date: June 30, 2000 7 * Creation Date: June 30, 2000
8 * 8 *
9 * mpi_lan.h Version: 01.05.xx 9 * mpi_lan.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -28,6 +28,8 @@
28 * 02-20-01 01.01.02 Started using MPI_POINTER. 28 * 02-20-01 01.01.02 Started using MPI_POINTER.
29 * 03-27-01 01.01.03 Added structure offset comments. 29 * 03-27-01 01.01.03 Added structure offset comments.
30 * 08-08-01 01.02.01 Original release for v1.2 work. 30 * 08-08-01 01.02.01 Original release for v1.2 work.
31 * 05-11-04 01.03.01 Original release for MPI v1.3.
32 * 08-19-04 01.05.01 Original release for MPI v1.5.
31 * -------------------------------------------------------------------------- 33 * --------------------------------------------------------------------------
32 */ 34 */
33 35
diff --git a/drivers/message/fusion/lsi/mpi_raid.h b/drivers/message/fusion/lsi/mpi_raid.h
index 9580a9de7fd2..802255d2747c 100644
--- a/drivers/message/fusion/lsi/mpi_raid.h
+++ b/drivers/message/fusion/lsi/mpi_raid.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2001-2003 LSI Logic Corporation. 2 * Copyright (c) 2001-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_raid.h 5 * Name: mpi_raid.h
6 * Title: MPI RAID message and structures 6 * Title: MPI RAID message and structures
7 * Creation Date: February 27, 2001 7 * Creation Date: February 27, 2001
8 * 8 *
9 * mpi_raid.h Version: 01.05.xx 9 * mpi_raid.h Version: 01.05.02
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -28,6 +28,10 @@
28 * 11-15-02 01.02.08 Added missing MsgContext field to MSG_MAILBOX_REQUEST. 28 * 11-15-02 01.02.08 Added missing MsgContext field to MSG_MAILBOX_REQUEST.
29 * 04-01-03 01.02.09 New action data option flag for 29 * 04-01-03 01.02.09 New action data option flag for
30 * MPI_RAID_ACTION_DELETE_VOLUME. 30 * MPI_RAID_ACTION_DELETE_VOLUME.
31 * 05-11-04 01.03.01 Original release for MPI v1.3.
32 * 08-19-04 01.05.01 Original release for MPI v1.5.
33 * 01-15-05 01.05.02 Added defines for the two new RAID Actions for
34 * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
31 * -------------------------------------------------------------------------- 35 * --------------------------------------------------------------------------
32 */ 36 */
33 37
@@ -84,6 +88,8 @@ typedef struct _MSG_RAID_ACTION
84#define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10) 88#define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10)
85#define MPI_RAID_ACTION_ACTIVATE_VOLUME (0x11) 89#define MPI_RAID_ACTION_ACTIVATE_VOLUME (0x11)
86#define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12) 90#define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12)
91#define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13)
92#define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14)
87 93
88/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */ 94/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
89#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001) 95#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001)
@@ -99,6 +105,13 @@ typedef struct _MSG_RAID_ACTION
99/* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */ 105/* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */
100#define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001) 106#define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001)
101 107
108/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_RESYNC_RATE action */
109#define MPI_RAID_ACTION_ADATA_RESYNC_RATE_MASK (0x000000FF)
110
111/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */
112#define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK (0x000000FF)
113
114
102 115
103/* RAID Action reply message */ 116/* RAID Action reply message */
104 117
diff --git a/drivers/message/fusion/lsi/mpi_sas.h b/drivers/message/fusion/lsi/mpi_sas.h
index cb878f9c65de..230fa69b5353 100644
--- a/drivers/message/fusion/lsi/mpi_sas.h
+++ b/drivers/message/fusion/lsi/mpi_sas.h
@@ -1,25 +1,76 @@
1/* 1/*
2 * Copyright (c) 2003 LSI Logic Corporation. 2 * Copyright (c) 2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_sas.h 5 * Name: mpi_sas.h
6 * Title: MPI Serial Attached SCSI structures and definitions 6 * Title: MPI Serial Attached SCSI structures and definitions
7 * Creation Date: April 23, 2003 7 * Creation Date: August 19, 2004
8 * 8 *
9 * mpi_sas.h Version: 01.05.xx 9 * mpi_sas.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
13 * 13 *
14 * Date Version Description 14 * Date Version Description
15 * -------- -------- ------------------------------------------------------ 15 * -------- -------- ------------------------------------------------------
16 * xx-yy-zz 01.05.01 Original release. 16 * 08-19-04 01.05.01 Original release.
17 * -------------------------------------------------------------------------- 17 * --------------------------------------------------------------------------
18 */ 18 */
19 19
20#ifndef MPI_SAS_H 20#ifndef MPI_SAS_H
21#define MPI_SAS_H 21#define MPI_SAS_H
22 22
23
24/*
25 * Values for SASStatus.
26 */
27#define MPI_SASSTATUS_SUCCESS (0x00)
28#define MPI_SASSTATUS_UNKNOWN_ERROR (0x01)
29#define MPI_SASSTATUS_INVALID_FRAME (0x02)
30#define MPI_SASSTATUS_UTC_BAD_DEST (0x03)
31#define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
32#define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
33#define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
34#define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
35#define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
36#define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
37#define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
38#define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
39#define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
40#define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
41#define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
42#define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
43#define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
44#define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11)
45#define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
46#define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
47#define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
48
49
50/*
51 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event
52 * data and SAS IO Unit Configuration pages.
53 */
54#define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
55#define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
56#define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
57#define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
58#define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
59#define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
60#define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
61#define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
62#define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
63#define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
64#define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
65
66#define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
67#define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
68#define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
69#define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
70#define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
71
72
73
23/***************************************************************************** 74/*****************************************************************************
24* 75*
25* S e r i a l A t t a c h e d S C S I M e s s a g e s 76* S e r i a l A t t a c h e d S C S I M e s s a g e s
@@ -48,8 +99,10 @@ typedef struct _MSG_SMP_PASSTHROUGH_REQUEST
48} MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST, 99} MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST,
49 SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t; 100 SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t;
50 101
102/* values for PassthroughFlags field */
51#define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80) 103#define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80)
52 104
105/* values for ConnectionRate field */
53#define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00) 106#define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
54#define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08) 107#define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08)
55#define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09) 108#define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09)
@@ -77,51 +130,69 @@ typedef struct _MSG_SMP_PASSTHROUGH_REPLY
77 130
78#define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80) 131#define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80)
79 132
80/* values for the SASStatus field */
81#define MPI_SASSTATUS_SUCCESS (0x00)
82#define MPI_SASSTATUS_UNKNOWN_ERROR (0x01)
83#define MPI_SASSTATUS_INVALID_FRAME (0x02)
84#define MPI_SASSTATUS_UTC_BAD_DEST (0x03)
85#define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
86#define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
87#define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
88#define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
89#define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
90#define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
91#define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
92#define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
93#define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
94#define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
95#define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
96#define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
97#define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
98#define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11)
99#define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
100#define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
101#define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
102 133
134/****************************************************************************/
135/* SATA Passthrough Request */
136/****************************************************************************/
137
138typedef struct _MSG_SATA_PASSTHROUGH_REQUEST
139{
140 U8 TargetID; /* 00h */
141 U8 Bus; /* 01h */
142 U8 ChainOffset; /* 02h */
143 U8 Function; /* 03h */
144 U16 PassthroughFlags; /* 04h */
145 U8 ConnectionRate; /* 06h */
146 U8 MsgFlags; /* 07h */
147 U32 MsgContext; /* 08h */
148 U32 Reserved1; /* 0Ch */
149 U32 Reserved2; /* 10h */
150 U32 Reserved3; /* 14h */
151 U32 DataLength; /* 18h */
152 U8 CommandFIS[20]; /* 1Ch */
153 SGE_SIMPLE_UNION SGL; /* 30h */
154} MSG_SATA_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REQUEST,
155 SataPassthroughRequest_t, MPI_POINTER pSataPassthroughRequest_t;
156
157/* values for PassthroughFlags field */
158#define MPI_SATA_PT_REQ_PT_FLAGS_RESET_DEVICE (0x0200)
159#define MPI_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100)
160#define MPI_SATA_PT_REQ_PT_FLAGS_DMA_QUEUED (0x0080)
161#define MPI_SATA_PT_REQ_PT_FLAGS_PACKET_COMMAND (0x0040)
162#define MPI_SATA_PT_REQ_PT_FLAGS_DMA (0x0020)
163#define MPI_SATA_PT_REQ_PT_FLAGS_PIO (0x0010)
164#define MPI_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004)
165#define MPI_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002)
166#define MPI_SATA_PT_REQ_PT_FLAGS_READ (0x0001)
167
168/* values for ConnectionRate field */
169#define MPI_SATA_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
170#define MPI_SATA_PT_REQ_CONNECT_RATE_1_5 (0x08)
171#define MPI_SATA_PT_REQ_CONNECT_RATE_3_0 (0x09)
172
173
174/* SATA Passthrough Reply */
175typedef struct _MSG_SATA_PASSTHROUGH_REPLY
176{
177 U8 TargetID; /* 00h */
178 U8 Bus; /* 01h */
179 U8 MsgLength; /* 02h */
180 U8 Function; /* 03h */
181 U16 PassthroughFlags; /* 04h */
182 U8 Reserved1; /* 06h */
183 U8 MsgFlags; /* 07h */
184 U32 MsgContext; /* 08h */
185 U8 Reserved2; /* 0Ch */
186 U8 SASStatus; /* 0Dh */
187 U16 IOCStatus; /* 0Eh */
188 U32 IOCLogInfo; /* 10h */
189 U8 StatusFIS[20]; /* 14h */
190 U32 StatusControlRegisters; /* 28h */
191 U32 TransferCount; /* 2Ch */
192} MSG_SATA_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REPLY,
193 SataPassthroughReply_t, MPI_POINTER pSataPassthroughReply_t;
103 194
104/*
105 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event
106 * data and SAS IO Unit Configuration pages.
107 */
108#define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
109#define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
110#define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
111#define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
112#define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
113#define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
114#define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
115#define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
116#define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
117#define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
118#define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
119 195
120#define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
121#define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
122#define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
123#define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
124#define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
125 196
126 197
127/****************************************************************************/ 198/****************************************************************************/
@@ -148,15 +219,13 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
148} MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, 219} MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST,
149 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; 220 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t;
150 221
151/* values for the ... field */ 222/* values for the Operation field */
152#define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01) 223#define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01)
153#define MPI_SAS_OP_CLEAR_ALL (0x02) 224#define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02)
154#define MPI_SAS_OP_MAP (0x03)
155#define MPI_SAS_OP_MOVE (0x04)
156#define MPI_SAS_OP_CLEAR (0x05)
157#define MPI_SAS_OP_PHY_LINK_RESET (0x06) 225#define MPI_SAS_OP_PHY_LINK_RESET (0x06)
158#define MPI_SAS_OP_PHY_HARD_RESET (0x07) 226#define MPI_SAS_OP_PHY_HARD_RESET (0x07)
159#define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) 227#define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
228#define MPI_SAS_OP_MAP_CURRENT (0x09)
160 229
161 230
162/* SAS IO Unit Control Reply */ 231/* SAS IO Unit Control Reply */
diff --git a/drivers/message/fusion/lsi/mpi_targ.h b/drivers/message/fusion/lsi/mpi_targ.h
index 804dc85426c1..623901fd82be 100644
--- a/drivers/message/fusion/lsi/mpi_targ.h
+++ b/drivers/message/fusion/lsi/mpi_targ.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_targ.h 5 * Name: mpi_targ.h
6 * Title: MPI Target mode messages and structures 6 * Title: MPI Target mode messages and structures
7 * Creation Date: June 22, 2000 7 * Creation Date: June 22, 2000
8 * 8 *
9 * mpi_targ.h Version: 01.05.xx 9 * mpi_targ.h Version: 01.05.04
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -43,6 +43,16 @@
43 * Added PRIORITY_REASON_TARGET_BUSY. 43 * Added PRIORITY_REASON_TARGET_BUSY.
44 * 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER. 44 * 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.
45 * 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER. 45 * 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.
46 * 05-11-04 01.03.01 Original release for MPI v1.3.
47 * 08-19-04 01.05.01 Added new request message structures for
48 * MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
49 * MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and
50 * MSG_TARGET_ASSIST_EXT_REQUEST.
51 * Added new structures for SAS SSP Command buffer, SSP
52 * Task buffer, and SSP Status IU.
53 * 10-05-04 01.05.02 MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.
54 * 02-22-05 01.05.03 Changed a comment.
55 * 03-11-05 01.05.04 Removed TargetAssistExtended Request.
46 * -------------------------------------------------------------------------- 56 * --------------------------------------------------------------------------
47 */ 57 */
48 58
@@ -133,6 +143,25 @@ typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
133} MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY, 143} MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
134 PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t; 144 PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
135 145
146
147typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
148{
149 U16 Reserved; /* 00h */
150 U8 MsgLength; /* 02h */
151 U8 Function; /* 03h */
152 U16 Reserved1; /* 04h */
153 U8 Reserved2; /* 06h */
154 U8 MsgFlags; /* 07h */
155 U32 MsgContext; /* 08h */
156 U8 PriorityReason; /* 0Ch */
157 U8 Reserved3; /* 0Dh */
158 U16 IOCStatus; /* 0Eh */
159 U32 IOCLogInfo; /* 10h */
160 U32 ReplyWord; /* 14h */
161} MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
162 MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
163 TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
164
136#define PRIORITY_REASON_NO_DISCONNECT (0x00) 165#define PRIORITY_REASON_NO_DISCONNECT (0x00)
137#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01) 166#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01)
138#define PRIORITY_REASON_CMD_PARITY_ERR (0x02) 167#define PRIORITY_REASON_CMD_PARITY_ERR (0x02)
@@ -146,7 +175,34 @@ typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
146#define PRIORITY_REASON_UNKNOWN (0xFF) 175#define PRIORITY_REASON_UNKNOWN (0xFF)
147 176
148 177
149typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY 178/****************************************************************************/
179/* Target Command Buffer Post Base Request */
180/****************************************************************************/
181
182typedef struct _MSG_TARGET_CMD_BUF_POST_BASE_REQUEST
183{
184 U8 BufferPostFlags; /* 00h */
185 U8 PortNumber; /* 01h */
186 U8 ChainOffset; /* 02h */
187 U8 Function; /* 03h */
188 U16 TotalCmdBuffers; /* 04h */
189 U8 Reserved; /* 06h */
190 U8 MsgFlags; /* 07h */
191 U32 MsgContext; /* 08h */
192 U32 Reserved1; /* 0Ch */
193 U16 CmdBufferLength; /* 10h */
194 U16 NextCmdBufferOffset; /* 12h */
195 U32 BaseAddressLow; /* 14h */
196 U32 BaseAddressHigh; /* 18h */
197} MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
198 MPI_POINTER PTR__MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
199 TargetCmdBufferPostBaseRequest_t,
200 MPI_POINTER pTargetCmdBufferPostBaseRequest_t;
201
202#define CMD_BUFFER_POST_BASE_FLAGS_AUTO_POST_ALL (0x01)
203
204
205typedef struct _MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY
150{ 206{
151 U16 Reserved; /* 00h */ 207 U16 Reserved; /* 00h */
152 U8 MsgLength; /* 02h */ 208 U8 MsgLength; /* 02h */
@@ -155,16 +211,41 @@ typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
155 U8 Reserved2; /* 06h */ 211 U8 Reserved2; /* 06h */
156 U8 MsgFlags; /* 07h */ 212 U8 MsgFlags; /* 07h */
157 U32 MsgContext; /* 08h */ 213 U32 MsgContext; /* 08h */
158 U8 PriorityReason; /* 0Ch */ 214 U16 Reserved3; /* 0Ch */
159 U8 Reserved3; /* 0Dh */
160 U16 IOCStatus; /* 0Eh */ 215 U16 IOCStatus; /* 0Eh */
161 U32 IOCLogInfo; /* 10h */ 216 U32 IOCLogInfo; /* 10h */
162 U32 ReplyWord; /* 14h */ 217} MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
163} MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY, 218 MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
164 MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY, 219 TargetCmdBufferPostBaseListReply_t,
165 TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t; 220 MPI_POINTER pTargetCmdBufferPostBaseListReply_t;
221
222
223/****************************************************************************/
224/* Target Command Buffer Post List Request */
225/****************************************************************************/
226
227typedef struct _MSG_TARGET_CMD_BUF_POST_LIST_REQUEST
228{
229 U8 Reserved; /* 00h */
230 U8 PortNumber; /* 01h */
231 U8 ChainOffset; /* 02h */
232 U8 Function; /* 03h */
233 U16 CmdBufferCount; /* 04h */
234 U8 Reserved1; /* 06h */
235 U8 MsgFlags; /* 07h */
236 U32 MsgContext; /* 08h */
237 U32 Reserved2; /* 0Ch */
238 U16 IoIndex[2]; /* 10h */
239} MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
240 MPI_POINTER PTR_MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
241 TargetCmdBufferPostListRequest_t,
242 MPI_POINTER pTargetCmdBufferPostListRequest_t;
166 243
167 244
245/****************************************************************************/
246/* Command Buffer Formats (with 16 byte CDB) */
247/****************************************************************************/
248
168typedef struct _MPI_TARGET_FCP_CMD_BUFFER 249typedef struct _MPI_TARGET_FCP_CMD_BUFFER
169{ 250{
170 U8 FcpLun[8]; /* 00h */ 251 U8 FcpLun[8]; /* 00h */
@@ -201,6 +282,46 @@ typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
201 MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer; 282 MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
202 283
203 284
285typedef struct _MPI_TARGET_SSP_CMD_BUFFER
286{
287 U8 FrameType; /* 00h */
288 U8 Reserved1; /* 01h */
289 U16 Reserved2; /* 02h */
290 U16 InitiatorTag; /* 04h */
291 U16 DevHandle; /* 06h */
292 /* COMMAND information unit starts here */
293 U8 LogicalUnitNumber[8]; /* 08h */
294 U8 Reserved3; /* 10h */
295 U8 TaskAttribute; /* lower 3 bits */ /* 11h */
296 U8 Reserved4; /* 12h */
297 U8 AdditionalCDBLength; /* upper 5 bits */ /* 13h */
298 U8 CDB[16]; /* 14h */
299 /* Additional CDB bytes extend past the CDB field */
300} MPI_TARGET_SSP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_CMD_BUFFER,
301 MpiTargetSspCmdBuffer, MPI_POINTER pMpiTargetSspCmdBuffer;
302
303typedef struct _MPI_TARGET_SSP_TASK_BUFFER
304{
305 U8 FrameType; /* 00h */
306 U8 Reserved1; /* 01h */
307 U16 Reserved2; /* 02h */
308 U16 InitiatorTag; /* 04h */
309 U16 DevHandle; /* 06h */
310 /* TASK information unit starts here */
311 U8 LogicalUnitNumber[8]; /* 08h */
312 U8 Reserved3; /* 10h */
313 U8 Reserved4; /* 11h */
314 U8 TaskManagementFunction; /* 12h */
315 U8 Reserved5; /* 13h */
316 U16 ManagedTaskTag; /* 14h */
317 U16 Reserved6; /* 16h */
318 U32 Reserved7; /* 18h */
319 U32 Reserved8; /* 1Ch */
320 U32 Reserved9; /* 20h */
321} MPI_TARGET_SSP_TASK_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_TASK_BUFFER,
322 MpiTargetSspTaskBuffer, MPI_POINTER pMpiTargetSspTaskBuffer;
323
324
204/****************************************************************************/ 325/****************************************************************************/
205/* Target Assist Request */ 326/* Target Assist Request */
206/****************************************************************************/ 327/****************************************************************************/
@@ -308,6 +429,27 @@ typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
308} MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU, 429} MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,
309 TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t; 430 TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;
310 431
432/*
433 * NOTE: The SSP status IU is big-endian. When used on a little-endian system,
434 * this structure properly orders the bytes.
435 */
436typedef struct _MPI_TARGET_SSP_RSP_IU
437{
438 U32 Reserved0[6]; /* reserved for SSP header */ /* 00h */
439 /* start of RESPONSE information unit */
440 U32 Reserved1; /* 18h */
441 U32 Reserved2; /* 1Ch */
442 U16 Reserved3; /* 20h */
443 U8 DataPres; /* lower 2 bits */ /* 22h */
444 U8 Status; /* 23h */
445 U32 Reserved4; /* 24h */
446 U32 SenseDataLength; /* 28h */
447 U32 ResponseDataLength; /* 2Ch */
448 U8 ResponseSenseData[4]; /* 30h */
449} MPI_TARGET_SSP_RSP_IU, MPI_POINTER PTR_MPI_TARGET_SSP_RSP_IU,
450 MpiTargetSspRspIu_t, MPI_POINTER pMpiTargetSspRspIu_t;
451
452
311/****************************************************************************/ 453/****************************************************************************/
312/* Target Mode Abort Request */ 454/* Target Mode Abort Request */
313/****************************************************************************/ 455/****************************************************************************/
diff --git a/drivers/message/fusion/lsi/mpi_tool.h b/drivers/message/fusion/lsi/mpi_tool.h
index 536d197c4142..aa9053da1f58 100644
--- a/drivers/message/fusion/lsi/mpi_tool.h
+++ b/drivers/message/fusion/lsi/mpi_tool.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2001-2003 LSI Logic Corporation. 2 * Copyright (c) 2001-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_tool.h 5 * Name: mpi_tool.h
6 * Title: MPI Toolbox structures and definitions 6 * Title: MPI Toolbox structures and definitions
7 * Creation Date: July 30, 2001 7 * Creation Date: July 30, 2001
8 * 8 *
9 * mpi_tool.h Version: 01.05.xx 9 * mpi_tool.h Version: 01.05.03
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -15,6 +15,16 @@
15 * -------- -------- ------------------------------------------------------ 15 * -------- -------- ------------------------------------------------------
16 * 08-08-01 01.02.01 Original release. 16 * 08-08-01 01.02.01 Original release.
17 * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines. 17 * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines.
18 * 01-16-04 01.02.03 Added defines and structures for new tools
19 *. MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL and
20 * MPI_TOOLBOX_FC_MANAGEMENT_TOOL.
21 * 04-29-04 01.02.04 Added message structures for Diagnostic Buffer Post and
22 * Diagnostic Release requests and replies.
23 * 05-11-04 01.03.01 Original release for MPI v1.3.
24 * 08-19-04 01.05.01 Original release for MPI v1.5.
25 * 10-06-04 01.05.02 Added define for MPI_DIAG_BUF_TYPE_COUNT.
26 * 02-09-05 01.05.03 Added frame size option to FC management tool.
27 * Added Beacon tool to the Toolbox.
18 * -------------------------------------------------------------------------- 28 * --------------------------------------------------------------------------
19 */ 29 */
20 30
@@ -26,6 +36,7 @@
26#define MPI_TOOLBOX_DIAG_DATA_UPLOAD_TOOL (0x02) 36#define MPI_TOOLBOX_DIAG_DATA_UPLOAD_TOOL (0x02)
27#define MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03) 37#define MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03)
28#define MPI_TOOLBOX_FC_MANAGEMENT_TOOL (0x04) 38#define MPI_TOOLBOX_FC_MANAGEMENT_TOOL (0x04)
39#define MPI_TOOLBOX_BEACON_TOOL (0x05)
29 40
30 41
31/****************************************************************************/ 42/****************************************************************************/
@@ -185,11 +196,21 @@ typedef struct _MPI_TB_FC_MANAGE_PID_AI
185} MPI_TB_FC_MANAGE_PID_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_PID_AI, 196} MPI_TB_FC_MANAGE_PID_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_PID_AI,
186 MpiTbFcManagePidAi_t, MPI_POINTER pMpiTbFcManagePidAi_t; 197 MpiTbFcManagePidAi_t, MPI_POINTER pMpiTbFcManagePidAi_t;
187 198
199/* ActionInfo for set max frame size */
200typedef struct _MPI_TB_FC_MANAGE_FRAME_SIZE_AI
201{
202 U16 FrameSize; /* 00h */
203 U8 PortNum; /* 02h */
204 U8 Reserved1; /* 03h */
205} MPI_TB_FC_MANAGE_FRAME_SIZE_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_FRAME_SIZE_AI,
206 MpiTbFcManageFrameSizeAi_t, MPI_POINTER pMpiTbFcManageFrameSizeAi_t;
207
188/* union of ActionInfo */ 208/* union of ActionInfo */
189typedef union _MPI_TB_FC_MANAGE_AI_UNION 209typedef union _MPI_TB_FC_MANAGE_AI_UNION
190{ 210{
191 MPI_TB_FC_MANAGE_BUS_TID_AI BusTid; 211 MPI_TB_FC_MANAGE_BUS_TID_AI BusTid;
192 MPI_TB_FC_MANAGE_PID_AI Port; 212 MPI_TB_FC_MANAGE_PID_AI Port;
213 MPI_TB_FC_MANAGE_FRAME_SIZE_AI FrameSize;
193} MPI_TB_FC_MANAGE_AI_UNION, MPI_POINTER PTR_MPI_TB_FC_MANAGE_AI_UNION, 214} MPI_TB_FC_MANAGE_AI_UNION, MPI_POINTER PTR_MPI_TB_FC_MANAGE_AI_UNION,
194 MpiTbFcManageAiUnion_t, MPI_POINTER pMpiTbFcManageAiUnion_t; 215 MpiTbFcManageAiUnion_t, MPI_POINTER pMpiTbFcManageAiUnion_t;
195 216
@@ -214,6 +235,32 @@ typedef struct _MSG_TOOLBOX_FC_MANAGE_REQUEST
214#define MPI_TB_FC_MANAGE_ACTION_DISC_ALL (0x00) 235#define MPI_TB_FC_MANAGE_ACTION_DISC_ALL (0x00)
215#define MPI_TB_FC_MANAGE_ACTION_DISC_PID (0x01) 236#define MPI_TB_FC_MANAGE_ACTION_DISC_PID (0x01)
216#define MPI_TB_FC_MANAGE_ACTION_DISC_BUS_TID (0x02) 237#define MPI_TB_FC_MANAGE_ACTION_DISC_BUS_TID (0x02)
238#define MPI_TB_FC_MANAGE_ACTION_SET_MAX_FRAME_SIZE (0x03)
239
240
241/****************************************************************************/
242/* Toolbox Beacon Tool request */
243/****************************************************************************/
244
245typedef struct _MSG_TOOLBOX_BEACON_REQUEST
246{
247 U8 Tool; /* 00h */
248 U8 Reserved; /* 01h */
249 U8 ChainOffset; /* 02h */
250 U8 Function; /* 03h */
251 U16 Reserved1; /* 04h */
252 U8 Reserved2; /* 06h */
253 U8 MsgFlags; /* 07h */
254 U32 MsgContext; /* 08h */
255 U8 ConnectNum; /* 0Ch */
256 U8 PortNum; /* 0Dh */
257 U8 Reserved3; /* 0Eh */
258 U8 Flags; /* 0Fh */
259} MSG_TOOLBOX_BEACON_REQUEST, MPI_POINTER PTR_MSG_TOOLBOX_BEACON_REQUEST,
260 ToolboxBeaconRequest_t, MPI_POINTER pToolboxBeaconRequest_t;
261
262#define MPI_TOOLBOX_FLAGS_BEACON_MODE_OFF (0x00)
263#define MPI_TOOLBOX_FLAGS_BEACON_MODE_ON (0x01)
217 264
218 265
219/****************************************************************************/ 266/****************************************************************************/
@@ -233,14 +280,16 @@ typedef struct _MSG_DIAG_BUFFER_POST_REQUEST
233 U32 ExtendedType; /* 0Ch */ 280 U32 ExtendedType; /* 0Ch */
234 U32 BufferLength; /* 10h */ 281 U32 BufferLength; /* 10h */
235 U32 ProductSpecific[4]; /* 14h */ 282 U32 ProductSpecific[4]; /* 14h */
236 U32 Reserved3; /* 18h */ 283 U32 Reserved3; /* 24h */
237 SGE_SIMPLE_UNION SGL; /* 28h */ 284 U64 BufferAddress; /* 28h */
238} MSG_DIAG_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_DIAG_BUFFER_POST_REQUEST, 285} MSG_DIAG_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_DIAG_BUFFER_POST_REQUEST,
239 DiagBufferPostRequest_t, MPI_POINTER pDiagBufferPostRequest_t; 286 DiagBufferPostRequest_t, MPI_POINTER pDiagBufferPostRequest_t;
240 287
241#define MPI_DIAG_BUF_TYPE_TRACE (0x00) 288#define MPI_DIAG_BUF_TYPE_TRACE (0x00)
242#define MPI_DIAG_BUF_TYPE_SNAPSHOT (0x01) 289#define MPI_DIAG_BUF_TYPE_SNAPSHOT (0x01)
243#define MPI_DIAG_BUF_TYPE_EXTENDED (0x02) 290#define MPI_DIAG_BUF_TYPE_EXTENDED (0x02)
291/* count of the number of buffer types */
292#define MPI_DIAG_BUF_TYPE_COUNT (0x03)
244 293
245#define MPI_DIAG_EXTENDED_QTAG (0x00000001) 294#define MPI_DIAG_EXTENDED_QTAG (0x00000001)
246 295
diff --git a/drivers/message/fusion/lsi/mpi_type.h b/drivers/message/fusion/lsi/mpi_type.h
index 239328a7689c..32cc9b1151b8 100644
--- a/drivers/message/fusion/lsi/mpi_type.h
+++ b/drivers/message/fusion/lsi/mpi_type.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_type.h 5 * Name: mpi_type.h
6 * Title: MPI Basic type definitions 6 * Title: MPI Basic type definitions
7 * Creation Date: June 6, 2000 7 * Creation Date: June 6, 2000
8 * 8 *
9 * mpi_type.h Version: 01.05.xx 9 * mpi_type.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -18,6 +18,8 @@
18 * 11-02-00 01.01.01 Original release for post 1.0 work 18 * 11-02-00 01.01.01 Original release for post 1.0 work
19 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER. 19 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER.
20 * 08-08-01 01.02.01 Original release for v1.2 work. 20 * 08-08-01 01.02.01 Original release for v1.2 work.
21 * 05-11-04 01.03.01 Original release for MPI v1.3.
22 * 08-19-04 01.05.01 Original release for MPI v1.5.
21 * -------------------------------------------------------------------------- 23 * --------------------------------------------------------------------------
22 */ 24 */
23 25
@@ -50,11 +52,6 @@ typedef unsigned short U16;
50typedef int32_t S32; 52typedef int32_t S32;
51typedef u_int32_t U32; 53typedef u_int32_t U32;
52 54
53/*
54 * The only way crap below could work on big-endian boxen would be if it
55 * wasn't used at all.
56 */
57
58typedef struct _S64 55typedef struct _S64
59{ 56{
60 U32 Low; 57 U32 Low;
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 8b22630f1aef..8b623278ccd2 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1,55 +1,13 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptbase.c 2 * linux/drivers/message/fusion/mptbase.c
3 * High performance SCSI + LAN / Fibre Channel device drivers.
4 * This is the Fusion MPT base driver which supports multiple 3 * This is the Fusion MPT base driver which supports multiple
5 * (SCSI + LAN) specialized protocol drivers. 4 * (SCSI + LAN) specialized protocol drivers.
6 * For use with PCI chip/adapter(s): 5 * For use with LSI Logic PCI chip/adapter(s)
7 * LSIFC9xx/LSI409xx Fibre Channel
8 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
9 * 7 *
10 * Credits: 8 * Copyright (c) 1999-2005 LSI Logic Corporation
11 * There are lots of people not mentioned below that deserve credit
12 * and thanks but won't get it here - sorry in advance that you
13 * got overlooked.
14 *
15 * This driver would not exist if not for Alan Cox's development
16 * of the linux i2o driver.
17 *
18 * A special thanks to Noah Romer (LSI Logic) for tons of work
19 * and tough debugging on the LAN driver, especially early on;-)
20 * And to Roger Hickerson (LSI Logic) for tirelessly supporting
21 * this driver project.
22 *
23 * A special thanks to Pamela Delaney (LSI Logic) for tons of work
24 * and countless enhancements while adding support for the 1030
25 * chip family. Pam has been instrumental in the development of
26 * of the 2.xx.xx series fusion drivers, and her contributions are
27 * far too numerous to hope to list in one place.
28 *
29 * All manner of help from Stephen Shirron (LSI Logic):
30 * low-level FC analysis, debug + various fixes in FCxx firmware,
31 * initial port to alpha platform, various driver code optimizations,
32 * being a faithful sounding board on all sorts of issues & ideas,
33 * etc.
34 *
35 * A huge debt of gratitude is owed to David S. Miller (DaveM)
36 * for fixing much of the stupid and broken stuff in the early
37 * driver while porting to sparc64 platform. THANK YOU!
38 *
39 * Special thanks goes to the I2O LAN driver people at the
40 * University of Helsinki, who, unbeknownst to them, provided
41 * the inspiration and initial structure for this driver.
42 *
43 * A really huge debt of gratitude is owed to Eddie C. Dost
44 * for gobs of hard work fixing and optimizing LAN code.
45 * THANK YOU!
46 *
47 * Copyright (c) 1999-2004 LSI Logic Corporation
48 * Originally By: Steven J. Ralston
49 * (mailto:sjralston1@netscape.net)
50 * (mailto:mpt_linux_developer@lsil.com) 9 * (mailto:mpt_linux_developer@lsil.com)
51 * 10 *
52 * $Id: mptbase.c,v 1.126 2002/12/16 15:28:45 pdelaney Exp $
53 */ 11 */
54/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 12/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
55/* 13/*
@@ -101,6 +59,7 @@
101#include <linux/blkdev.h> 59#include <linux/blkdev.h>
102#include <linux/delay.h> 60#include <linux/delay.h>
103#include <linux/interrupt.h> /* needed for in_interrupt() proto */ 61#include <linux/interrupt.h> /* needed for in_interrupt() proto */
62#include <linux/dma-mapping.h>
104#include <asm/io.h> 63#include <asm/io.h>
105#ifdef CONFIG_MTRR 64#ifdef CONFIG_MTRR
106#include <asm/mtrr.h> 65#include <asm/mtrr.h>
@@ -218,41 +177,35 @@ static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info);
218static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info); 177static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info);
219 178
220/* module entry point */ 179/* module entry point */
221static int __devinit mptbase_probe (struct pci_dev *, const struct pci_device_id *);
222static void __devexit mptbase_remove(struct pci_dev *);
223static void mptbase_shutdown(struct device * );
224static int __init fusion_init (void); 180static int __init fusion_init (void);
225static void __exit fusion_exit (void); 181static void __exit fusion_exit (void);
226 182
227/****************************************************************************
228 * Supported hardware
229 */
230
231static struct pci_device_id mptbase_pci_table[] = {
232 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
233 PCI_ANY_ID, PCI_ANY_ID },
234 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
235 PCI_ANY_ID, PCI_ANY_ID },
236 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
237 PCI_ANY_ID, PCI_ANY_ID },
238 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X,
239 PCI_ANY_ID, PCI_ANY_ID },
240 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X,
241 PCI_ANY_ID, PCI_ANY_ID },
242 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,
243 PCI_ANY_ID, PCI_ANY_ID },
244 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035,
245 PCI_ANY_ID, PCI_ANY_ID },
246 {0} /* Terminating entry */
247};
248MODULE_DEVICE_TABLE(pci, mptbase_pci_table);
249
250#define CHIPREG_READ32(addr) readl_relaxed(addr) 183#define CHIPREG_READ32(addr) readl_relaxed(addr)
251#define CHIPREG_READ32_dmasync(addr) readl(addr) 184#define CHIPREG_READ32_dmasync(addr) readl(addr)
252#define CHIPREG_WRITE32(addr,val) writel(val, addr) 185#define CHIPREG_WRITE32(addr,val) writel(val, addr)
253#define CHIPREG_PIO_WRITE32(addr,val) outl(val, (unsigned long)addr) 186#define CHIPREG_PIO_WRITE32(addr,val) outl(val, (unsigned long)addr)
254#define CHIPREG_PIO_READ32(addr) inl((unsigned long)addr) 187#define CHIPREG_PIO_READ32(addr) inl((unsigned long)addr)
255 188
189static void
190pci_disable_io_access(struct pci_dev *pdev)
191{
192 u16 command_reg;
193
194 pci_read_config_word(pdev, PCI_COMMAND, &command_reg);
195 command_reg &= ~1;
196 pci_write_config_word(pdev, PCI_COMMAND, command_reg);
197}
198
199static void
200pci_enable_io_access(struct pci_dev *pdev)
201{
202 u16 command_reg;
203
204 pci_read_config_word(pdev, PCI_COMMAND, &command_reg);
205 command_reg |= 1;
206 pci_write_config_word(pdev, PCI_COMMAND, command_reg);
207}
208
256/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 209/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
257/* 210/*
258 * mpt_interrupt - MPT adapter (IOC) specific interrupt handler. 211 * mpt_interrupt - MPT adapter (IOC) specific interrupt handler.
@@ -330,8 +283,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
330 ioc->name, mr, req_idx)); 283 ioc->name, mr, req_idx));
331 DBG_DUMP_REPLY_FRAME(mr) 284 DBG_DUMP_REPLY_FRAME(mr)
332 285
333 /* NEW! 20010301 -sralston 286 /* Check/log IOC log info
334 * Check/log IOC log info
335 */ 287 */
336 ioc_stat = le16_to_cpu(mr->u.reply.IOCStatus); 288 ioc_stat = le16_to_cpu(mr->u.reply.IOCStatus);
337 if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) { 289 if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) {
@@ -357,9 +309,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
357 mr = (MPT_FRAME_HDR *) CAST_U32_TO_PTR(pa); 309 mr = (MPT_FRAME_HDR *) CAST_U32_TO_PTR(pa);
358 } else if (type == MPI_CONTEXT_REPLY_TYPE_LAN) { 310 } else if (type == MPI_CONTEXT_REPLY_TYPE_LAN) {
359 cb_idx = mpt_lan_index; 311 cb_idx = mpt_lan_index;
360 /* 312 /* Blind set of mf to NULL here was fatal
361 * BUG FIX! 20001218 -sralston
362 * Blind set of mf to NULL here was fatal
363 * after lan_reply says "freeme" 313 * after lan_reply says "freeme"
364 * Fix sort of combined with an optimization here; 314 * Fix sort of combined with an optimization here;
365 * added explicit check for case where lan_reply 315 * added explicit check for case where lan_reply
@@ -430,15 +380,8 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
430 } 380 }
431 381
432 if (freeme) { 382 if (freeme) {
433 unsigned long flags;
434
435 /* Put Request back on FreeQ! */ 383 /* Put Request back on FreeQ! */
436 spin_lock_irqsave(&ioc->FreeQlock, flags); 384 mpt_free_msg_frame(ioc, mf);
437 list_add_tail(&mf->u.frame.linkage.list, &ioc->FreeQ);
438#ifdef MFCNT
439 ioc->mfcnt--;
440#endif
441 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
442 } 385 }
443 386
444 mb(); 387 mb();
@@ -725,11 +668,9 @@ int
725mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx) 668mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
726{ 669{
727 MPT_ADAPTER *ioc; 670 MPT_ADAPTER *ioc;
728 int error=0;
729 671
730 if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS) { 672 if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS) {
731 error= -EINVAL; 673 return -EINVAL;
732 return error;
733 } 674 }
734 675
735 MptDeviceDriverHandlers[cb_idx] = dd_cbfunc; 676 MptDeviceDriverHandlers[cb_idx] = dd_cbfunc;
@@ -737,14 +678,12 @@ mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
737 /* call per pci device probe entry point */ 678 /* call per pci device probe entry point */
738 list_for_each_entry(ioc, &ioc_list, list) { 679 list_for_each_entry(ioc, &ioc_list, list) {
739 if(dd_cbfunc->probe) { 680 if(dd_cbfunc->probe) {
740 error = dd_cbfunc->probe(ioc->pcidev, 681 dd_cbfunc->probe(ioc->pcidev,
741 ioc->pcidev->driver->id_table); 682 ioc->pcidev->driver->id_table);
742 if(error != 0)
743 return error;
744 } 683 }
745 } 684 }
746 685
747 return error; 686 return 0;
748} 687}
749 688
750/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 689/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -809,8 +748,8 @@ mpt_get_msg_frame(int handle, MPT_ADAPTER *ioc)
809 mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */ 748 mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */
810 req_offset = (u8 *)mf - (u8 *)ioc->req_frames; 749 req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
811 /* u16! */ 750 /* u16! */
812 req_idx = cpu_to_le16(req_offset / ioc->req_sz); 751 req_idx = req_offset / ioc->req_sz;
813 mf->u.frame.hwhdr.msgctxu.fld.req_idx = req_idx; 752 mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
814 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; 753 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
815 ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */ 754 ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */
816#ifdef MFCNT 755#ifdef MFCNT
@@ -856,8 +795,8 @@ mpt_put_msg_frame(int handle, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf)
856 mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */ 795 mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */
857 req_offset = (u8 *)mf - (u8 *)ioc->req_frames; 796 req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
858 /* u16! */ 797 /* u16! */
859 req_idx = cpu_to_le16(req_offset / ioc->req_sz); 798 req_idx = req_offset / ioc->req_sz;
860 mf->u.frame.hwhdr.msgctxu.fld.req_idx = req_idx; 799 mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
861 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; 800 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
862 801
863#ifdef MPT_DEBUG_MSG_FRAME 802#ifdef MPT_DEBUG_MSG_FRAME
@@ -1058,7 +997,7 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
1058 997
1059/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 998/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1060/* 999/*
1061 * mptbase_probe - Install a PCI intelligent MPT adapter. 1000 * mpt_attach - Install a PCI intelligent MPT adapter.
1062 * @pdev: Pointer to pci_dev structure 1001 * @pdev: Pointer to pci_dev structure
1063 * 1002 *
1064 * This routine performs all the steps necessary to bring the IOC of 1003 * This routine performs all the steps necessary to bring the IOC of
@@ -1073,8 +1012,8 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
1073 * 1012 *
1074 * TODO: Add support for polled controllers 1013 * TODO: Add support for polled controllers
1075 */ 1014 */
1076static int __devinit 1015int
1077mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id) 1016mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1078{ 1017{
1079 MPT_ADAPTER *ioc; 1018 MPT_ADAPTER *ioc;
1080 u8 __iomem *mem; 1019 u8 __iomem *mem;
@@ -1084,7 +1023,6 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1084 u32 psize; 1023 u32 psize;
1085 int ii; 1024 int ii;
1086 int r = -ENODEV; 1025 int r = -ENODEV;
1087 u64 mask = 0xffffffffffffffffULL;
1088 u8 revision; 1026 u8 revision;
1089 u8 pcixcmd; 1027 u8 pcixcmd;
1090 static int mpt_ids = 0; 1028 static int mpt_ids = 0;
@@ -1097,15 +1035,15 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1097 1035
1098 dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n")); 1036 dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n"));
1099 1037
1100 if (!pci_set_dma_mask(pdev, mask)) { 1038 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
1101 dprintk((KERN_INFO MYNAM 1039 dprintk((KERN_INFO MYNAM
1102 ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n")); 1040 ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n"));
1103 } else if (pci_set_dma_mask(pdev, (u64) 0xffffffff)) { 1041 } else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
1104 printk(KERN_WARNING MYNAM ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n"); 1042 printk(KERN_WARNING MYNAM ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n");
1105 return r; 1043 return r;
1106 } 1044 }
1107 1045
1108 if (!pci_set_consistent_dma_mask(pdev, mask)) 1046 if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))
1109 dprintk((KERN_INFO MYNAM 1047 dprintk((KERN_INFO MYNAM
1110 ": Using 64 bit consistent mask\n")); 1048 ": Using 64 bit consistent mask\n"));
1111 else 1049 else
@@ -1243,6 +1181,16 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1243 pcixcmd &= 0x8F; 1181 pcixcmd &= 0x8F;
1244 pci_write_config_byte(pdev, 0x6a, pcixcmd); 1182 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1245 } 1183 }
1184 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC939X) {
1185 ioc->prod_name = "LSIFC939X";
1186 ioc->bus_type = FC;
1187 ioc->errata_flag_1064 = 1;
1188 }
1189 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC949X) {
1190 ioc->prod_name = "LSIFC949X";
1191 ioc->bus_type = FC;
1192 ioc->errata_flag_1064 = 1;
1193 }
1246 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) { 1194 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) {
1247 ioc->prod_name = "LSI53C1030"; 1195 ioc->prod_name = "LSI53C1030";
1248 ioc->bus_type = SCSI; 1196 ioc->bus_type = SCSI;
@@ -1261,6 +1209,9 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1261 ioc->bus_type = SCSI; 1209 ioc->bus_type = SCSI;
1262 } 1210 }
1263 1211
1212 if (ioc->errata_flag_1064)
1213 pci_disable_io_access(pdev);
1214
1264 sprintf(ioc->name, "ioc%d", ioc->id); 1215 sprintf(ioc->name, "ioc%d", ioc->id);
1265 1216
1266 spin_lock_init(&ioc->FreeQlock); 1217 spin_lock_init(&ioc->FreeQlock);
@@ -1303,8 +1254,7 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1303#endif 1254#endif
1304 } 1255 }
1305 1256
1306 /* NEW! 20010220 -sralston 1257 /* Check for "bound ports" (929, 929X, 1030, 1035) to reduce redundant resets.
1307 * Check for "bound ports" (929, 929X, 1030, 1035) to reduce redundant resets.
1308 */ 1258 */
1309 mpt_detect_bound_ports(ioc, pdev); 1259 mpt_detect_bound_ports(ioc, pdev);
1310 1260
@@ -1354,13 +1304,13 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1354 1304
1355/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1305/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1356/* 1306/*
1357 * mptbase_remove - Remove a PCI intelligent MPT adapter. 1307 * mpt_detach - Remove a PCI intelligent MPT adapter.
1358 * @pdev: Pointer to pci_dev structure 1308 * @pdev: Pointer to pci_dev structure
1359 * 1309 *
1360 */ 1310 */
1361 1311
1362static void __devexit 1312void
1363mptbase_remove(struct pci_dev *pdev) 1313mpt_detach(struct pci_dev *pdev)
1364{ 1314{
1365 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1315 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1366 char pname[32]; 1316 char pname[32];
@@ -1397,43 +1347,21 @@ mptbase_remove(struct pci_dev *pdev)
1397 pci_set_drvdata(pdev, NULL); 1347 pci_set_drvdata(pdev, NULL);
1398} 1348}
1399 1349
1400/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1401/*
1402 * mptbase_shutdown -
1403 *
1404 */
1405static void
1406mptbase_shutdown(struct device * dev)
1407{
1408 int ii;
1409
1410 /* call per device driver shutdown entry point */
1411 for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
1412 if(MptDeviceDriverHandlers[ii] &&
1413 MptDeviceDriverHandlers[ii]->shutdown) {
1414 MptDeviceDriverHandlers[ii]->shutdown(dev);
1415 }
1416 }
1417
1418}
1419
1420
1421/************************************************************************** 1350/**************************************************************************
1422 * Power Management 1351 * Power Management
1423 */ 1352 */
1424#ifdef CONFIG_PM 1353#ifdef CONFIG_PM
1425/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1354/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1426/* 1355/*
1427 * mptbase_suspend - Fusion MPT base driver suspend routine. 1356 * mpt_suspend - Fusion MPT base driver suspend routine.
1428 * 1357 *
1429 * 1358 *
1430 */ 1359 */
1431static int 1360int
1432mptbase_suspend(struct pci_dev *pdev, pm_message_t state) 1361mpt_suspend(struct pci_dev *pdev, pm_message_t state)
1433{ 1362{
1434 u32 device_state; 1363 u32 device_state;
1435 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1364 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1436 int ii;
1437 1365
1438 switch(state) 1366 switch(state)
1439 { 1367 {
@@ -1453,14 +1381,6 @@ mptbase_suspend(struct pci_dev *pdev, pm_message_t state)
1453 "pci-suspend: pdev=0x%p, slot=%s, Entering operating state [D%d]\n", 1381 "pci-suspend: pdev=0x%p, slot=%s, Entering operating state [D%d]\n",
1454 ioc->name, pdev, pci_name(pdev), device_state); 1382 ioc->name, pdev, pci_name(pdev), device_state);
1455 1383
1456 /* call per device driver suspend entry point */
1457 for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
1458 if(MptDeviceDriverHandlers[ii] &&
1459 MptDeviceDriverHandlers[ii]->suspend) {
1460 MptDeviceDriverHandlers[ii]->suspend(pdev, state);
1461 }
1462 }
1463
1464 pci_save_state(pdev); 1384 pci_save_state(pdev);
1465 1385
1466 /* put ioc into READY_STATE */ 1386 /* put ioc into READY_STATE */
@@ -1484,18 +1404,18 @@ mptbase_suspend(struct pci_dev *pdev, pm_message_t state)
1484 1404
1485/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1405/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1486/* 1406/*
1487 * mptbase_resume - Fusion MPT base driver resume routine. 1407 * mpt_resume - Fusion MPT base driver resume routine.
1488 * 1408 *
1489 * 1409 *
1490 */ 1410 */
1491static int 1411int
1492mptbase_resume(struct pci_dev *pdev) 1412mpt_resume(struct pci_dev *pdev)
1493{ 1413{
1494 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1414 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1495 u32 device_state = pdev->current_state; 1415 u32 device_state = pdev->current_state;
1496 int recovery_state; 1416 int recovery_state;
1497 int ii; 1417 int ii;
1498 1418
1499 printk(MYIOC_s_INFO_FMT 1419 printk(MYIOC_s_INFO_FMT
1500 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n", 1420 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
1501 ioc->name, pdev, pci_name(pdev), device_state); 1421 ioc->name, pdev, pci_name(pdev), device_state);
@@ -1533,14 +1453,6 @@ mptbase_resume(struct pci_dev *pdev)
1533 "pci-resume: success\n", ioc->name); 1453 "pci-resume: success\n", ioc->name);
1534 } 1454 }
1535 1455
1536 /* call per device driver resume entry point */
1537 for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
1538 if(MptDeviceDriverHandlers[ii] &&
1539 MptDeviceDriverHandlers[ii]->resume) {
1540 MptDeviceDriverHandlers[ii]->resume(pdev);
1541 }
1542 }
1543
1544 return 0; 1456 return 0;
1545} 1457}
1546#endif 1458#endif
@@ -1719,8 +1631,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1719 ioc->alt_ioc->active = 1; 1631 ioc->alt_ioc->active = 1;
1720 } 1632 }
1721 1633
1722 /* NEW! 20010120 -sralston 1634 /* Enable MPT base driver management of EventNotification
1723 * Enable MPT base driver management of EventNotification
1724 * and EventAck handling. 1635 * and EventAck handling.
1725 */ 1636 */
1726 if ((ret == 0) && (!ioc->facts.EventState)) 1637 if ((ret == 0) && (!ioc->facts.EventState))
@@ -1729,9 +1640,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1729 if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventState) 1640 if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventState)
1730 (void) SendEventNotification(ioc->alt_ioc, 1); /* 1=Enable EventNotification */ 1641 (void) SendEventNotification(ioc->alt_ioc, 1); /* 1=Enable EventNotification */
1731 1642
1732 /* (Bugzilla:fibrebugs, #513) 1643 /* Add additional "reason" check before call to GetLanConfigPages
1733 * Bug fix (part 2)! 20010905 -sralston
1734 * Add additional "reason" check before call to GetLanConfigPages
1735 * (combined with GetIoUnitPage2 call). This prevents a somewhat 1644 * (combined with GetIoUnitPage2 call). This prevents a somewhat
1736 * recursive scenario; GetLanConfigPages times out, timer expired 1645 * recursive scenario; GetLanConfigPages times out, timer expired
1737 * routine calls HardResetHandler, which calls into here again, 1646 * routine calls HardResetHandler, which calls into here again,
@@ -1829,37 +1738,43 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1829static void 1738static void
1830mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev) 1739mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
1831{ 1740{
1832 unsigned int match_lo, match_hi; 1741 struct pci_dev *peer=NULL;
1742 unsigned int slot = PCI_SLOT(pdev->devfn);
1743 unsigned int func = PCI_FUNC(pdev->devfn);
1833 MPT_ADAPTER *ioc_srch; 1744 MPT_ADAPTER *ioc_srch;
1834 1745
1835 match_lo = pdev->devfn-1; 1746 dprintk((MYIOC_s_INFO_FMT "PCI device %s devfn=%x/%x,"
1836 match_hi = pdev->devfn+1; 1747 " searching for devfn match on %x or %x\n",
1837 dprintk((MYIOC_s_INFO_FMT "PCI bus/devfn=%x/%x, searching for devfn match on %x or %x\n", 1748 ioc->name, pci_name(pdev), pdev->devfn,
1838 ioc->name, pdev->bus->number, pdev->devfn, match_lo, match_hi)); 1749 func-1, func+1));
1750
1751 peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1));
1752 if (!peer) {
1753 peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func+1));
1754 if (!peer)
1755 return;
1756 }
1839 1757
1840 list_for_each_entry(ioc_srch, &ioc_list, list) { 1758 list_for_each_entry(ioc_srch, &ioc_list, list) {
1841 struct pci_dev *_pcidev = ioc_srch->pcidev; 1759 struct pci_dev *_pcidev = ioc_srch->pcidev;
1842 1760 if (_pcidev == peer) {
1843 if ((_pcidev->device == pdev->device) &&
1844 (_pcidev->bus->number == pdev->bus->number) &&
1845 (_pcidev->devfn == match_lo || _pcidev->devfn == match_hi) ) {
1846 /* Paranoia checks */ 1761 /* Paranoia checks */
1847 if (ioc->alt_ioc != NULL) { 1762 if (ioc->alt_ioc != NULL) {
1848 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", 1763 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n",
1849 ioc->name, ioc->alt_ioc->name); 1764 ioc->name, ioc->alt_ioc->name);
1850 break; 1765 break;
1851 } else if (ioc_srch->alt_ioc != NULL) { 1766 } else if (ioc_srch->alt_ioc != NULL) {
1852 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", 1767 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n",
1853 ioc_srch->name, ioc_srch->alt_ioc->name); 1768 ioc_srch->name, ioc_srch->alt_ioc->name);
1854 break; 1769 break;
1855 } 1770 }
1856 dprintk((KERN_INFO MYNAM ": FOUND! binding %s <==> %s\n", 1771 dprintk((KERN_INFO MYNAM ": FOUND! binding %s <==> %s\n",
1857 ioc->name, ioc_srch->name)); 1772 ioc->name, ioc_srch->name));
1858 ioc_srch->alt_ioc = ioc; 1773 ioc_srch->alt_ioc = ioc;
1859 ioc->alt_ioc = ioc_srch; 1774 ioc->alt_ioc = ioc_srch;
1860 break;
1861 } 1775 }
1862 } 1776 }
1777 pci_dev_put(peer);
1863} 1778}
1864 1779
1865/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1780/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1922,15 +1837,10 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
1922 ioc->alloc_total -= sz; 1837 ioc->alloc_total -= sz;
1923 } 1838 }
1924 1839
1925 if (ioc->spi_data.nvram != NULL) { 1840 kfree(ioc->spi_data.nvram);
1926 kfree(ioc->spi_data.nvram); 1841 kfree(ioc->spi_data.pIocPg3);
1927 ioc->spi_data.nvram = NULL; 1842 ioc->spi_data.nvram = NULL;
1928 } 1843 ioc->spi_data.pIocPg3 = NULL;
1929
1930 if (ioc->spi_data.pIocPg3 != NULL) {
1931 kfree(ioc->spi_data.pIocPg3);
1932 ioc->spi_data.pIocPg3 = NULL;
1933 }
1934 1844
1935 if (ioc->spi_data.pIocPg4 != NULL) { 1845 if (ioc->spi_data.pIocPg4 != NULL) {
1936 sz = ioc->spi_data.IocPg4Sz; 1846 sz = ioc->spi_data.IocPg4Sz;
@@ -1947,10 +1857,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
1947 ioc->ReqToChain = NULL; 1857 ioc->ReqToChain = NULL;
1948 } 1858 }
1949 1859
1950 if (ioc->ChainToChain != NULL) { 1860 kfree(ioc->ChainToChain);
1951 kfree(ioc->ChainToChain); 1861 ioc->ChainToChain = NULL;
1952 ioc->ChainToChain = NULL;
1953 }
1954} 1862}
1955 1863
1956/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1864/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -2333,7 +2241,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
2333 return -55; 2241 return -55;
2334 } 2242 }
2335 2243
2336 r = sz = le32_to_cpu(facts->BlockSize); 2244 r = sz = facts->BlockSize;
2337 vv = ((63 / (sz * 4)) + 1) & 0x03; 2245 vv = ((63 / (sz * 4)) + 1) & 0x03;
2338 ioc->NB_for_64_byte_frame = vv; 2246 ioc->NB_for_64_byte_frame = vv;
2339 while ( sz ) 2247 while ( sz )
@@ -2785,7 +2693,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
2785 /* prevent a second downloadboot and memory free with alt_ioc */ 2693 /* prevent a second downloadboot and memory free with alt_ioc */
2786 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw) 2694 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw)
2787 ioc->alt_ioc->cached_fw = NULL; 2695 ioc->alt_ioc->cached_fw = NULL;
2788 2696
2789 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF); 2697 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF);
2790 CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE); 2698 CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE);
2791 CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE); 2699 CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE);
@@ -2843,6 +2751,9 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
2843 /* Write the LoadStartAddress to the DiagRw Address Register 2751 /* Write the LoadStartAddress to the DiagRw Address Register
2844 * using Programmed IO 2752 * using Programmed IO
2845 */ 2753 */
2754 if (ioc->errata_flag_1064)
2755 pci_enable_io_access(ioc->pcidev);
2756
2846 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, pFwHeader->LoadStartAddress); 2757 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, pFwHeader->LoadStartAddress);
2847 ddlprintk((MYIOC_s_INFO_FMT "LoadStart addr written 0x%x \n", 2758 ddlprintk((MYIOC_s_INFO_FMT "LoadStart addr written 0x%x \n",
2848 ioc->name, pFwHeader->LoadStartAddress)); 2759 ioc->name, pFwHeader->LoadStartAddress));
@@ -2889,6 +2800,9 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
2889 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000); 2800 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000);
2890 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, diagRwData); 2801 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, diagRwData);
2891 2802
2803 if (ioc->errata_flag_1064)
2804 pci_disable_io_access(ioc->pcidev);
2805
2892 diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); 2806 diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
2893 ddlprintk((MYIOC_s_INFO_FMT "downloadboot diag0val=%x, turning off PREVENT_IOC_BOOT, DISABLE_ARM\n", 2807 ddlprintk((MYIOC_s_INFO_FMT "downloadboot diag0val=%x, turning off PREVENT_IOC_BOOT, DISABLE_ARM\n",
2894 ioc->name, diag0val)); 2808 ioc->name, diag0val));
@@ -4250,7 +4164,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
4250 if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) || 4164 if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) ||
4251 (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) { 4165 (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) {
4252 4166
4253 if (ioc->spi_data.minSyncFactor < MPT_ULTRA) 4167 if (ioc->spi_data.minSyncFactor < MPT_ULTRA)
4254 ioc->spi_data.minSyncFactor = MPT_ULTRA; 4168 ioc->spi_data.minSyncFactor = MPT_ULTRA;
4255 } 4169 }
4256 } 4170 }
@@ -4482,10 +4396,8 @@ mpt_read_ioc_pg_3(MPT_ADAPTER *ioc)
4482 4396
4483 /* Free the old page 4397 /* Free the old page
4484 */ 4398 */
4485 if (ioc->spi_data.pIocPg3) { 4399 kfree(ioc->spi_data.pIocPg3);
4486 kfree(ioc->spi_data.pIocPg3); 4400 ioc->spi_data.pIocPg3 = NULL;
4487 ioc->spi_data.pIocPg3 = NULL;
4488 }
4489 4401
4490 /* There is at least one physical disk. 4402 /* There is at least one physical disk.
4491 * Read and save IOC Page 3 4403 * Read and save IOC Page 3
@@ -4753,9 +4665,7 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
4753 u32 flagsLength; 4665 u32 flagsLength;
4754 int in_isr; 4666 int in_isr;
4755 4667
4756 /* (Bugzilla:fibrebugs, #513) 4668 /* Prevent calling wait_event() (below), if caller happens
4757 * Bug fix (part 1)! 20010905 -sralston
4758 * Prevent calling wait_event() (below), if caller happens
4759 * to be in ISR context, because that is fatal! 4669 * to be in ISR context, because that is fatal!
4760 */ 4670 */
4761 in_isr = in_interrupt(); 4671 in_isr = in_interrupt();
@@ -4861,9 +4771,7 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
4861 u32 flagsLength; 4771 u32 flagsLength;
4862 int in_isr; 4772 int in_isr;
4863 4773
4864 /* (Bugzilla:fibrebugs, #513) 4774 /* Prevent calling wait_event() (below), if caller happens
4865 * Bug fix (part 1)! 20010905 -sralston
4866 * Prevent calling wait_event() (below), if caller happens
4867 * to be in ISR context, because that is fatal! 4775 * to be in ISR context, because that is fatal!
4868 */ 4776 */
4869 in_isr = in_interrupt(); 4777 in_isr = in_interrupt();
@@ -5130,20 +5038,26 @@ static int
5130procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) 5038procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eof, void *data)
5131{ 5039{
5132 int ii; 5040 int ii;
5133 int scsi, lan, ctl, targ, dmp; 5041 int scsi, fc, sas, lan, ctl, targ, dmp;
5134 char *drvname; 5042 char *drvname;
5135 int len; 5043 int len;
5136 5044
5137 len = sprintf(buf, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON); 5045 len = sprintf(buf, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON);
5138 len += sprintf(buf+len, " Fusion MPT base driver\n"); 5046 len += sprintf(buf+len, " Fusion MPT base driver\n");
5139 5047
5140 scsi = lan = ctl = targ = dmp = 0; 5048 scsi = fc = sas = lan = ctl = targ = dmp = 0;
5141 for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) { 5049 for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) {
5142 drvname = NULL; 5050 drvname = NULL;
5143 if (MptCallbacks[ii]) { 5051 if (MptCallbacks[ii]) {
5144 switch (MptDriverClass[ii]) { 5052 switch (MptDriverClass[ii]) {
5145 case MPTSCSIH_DRIVER: 5053 case MPTSPI_DRIVER:
5146 if (!scsi++) drvname = "SCSI host"; 5054 if (!scsi++) drvname = "SPI host";
5055 break;
5056 case MPTFC_DRIVER:
5057 if (!fc++) drvname = "FC host";
5058 break;
5059 case MPTSAS_DRIVER:
5060 if (!sas++) drvname = "SAS host";
5147 break; 5061 break;
5148 case MPTLAN_DRIVER: 5062 case MPTLAN_DRIVER:
5149 if (!lan++) drvname = "LAN"; 5063 if (!lan++) drvname = "LAN";
@@ -5832,6 +5746,12 @@ mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
5832} 5746}
5833 5747
5834/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5748/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
5749EXPORT_SYMBOL(mpt_attach);
5750EXPORT_SYMBOL(mpt_detach);
5751#ifdef CONFIG_PM
5752EXPORT_SYMBOL(mpt_resume);
5753EXPORT_SYMBOL(mpt_suspend);
5754#endif
5835EXPORT_SYMBOL(ioc_list); 5755EXPORT_SYMBOL(ioc_list);
5836EXPORT_SYMBOL(mpt_proc_root_dir); 5756EXPORT_SYMBOL(mpt_proc_root_dir);
5837EXPORT_SYMBOL(mpt_register); 5757EXPORT_SYMBOL(mpt_register);
@@ -5860,19 +5780,6 @@ EXPORT_SYMBOL(mpt_read_ioc_pg_3);
5860EXPORT_SYMBOL(mpt_alloc_fw_memory); 5780EXPORT_SYMBOL(mpt_alloc_fw_memory);
5861EXPORT_SYMBOL(mpt_free_fw_memory); 5781EXPORT_SYMBOL(mpt_free_fw_memory);
5862 5782
5863static struct pci_driver mptbase_driver = {
5864 .name = "mptbase",
5865 .id_table = mptbase_pci_table,
5866 .probe = mptbase_probe,
5867 .remove = __devexit_p(mptbase_remove),
5868 .driver = {
5869 .shutdown = mptbase_shutdown,
5870 },
5871#ifdef CONFIG_PM
5872 .suspend = mptbase_suspend,
5873 .resume = mptbase_resume,
5874#endif
5875};
5876 5783
5877/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5784/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
5878/* 5785/*
@@ -5884,7 +5791,6 @@ static int __init
5884fusion_init(void) 5791fusion_init(void)
5885{ 5792{
5886 int i; 5793 int i;
5887 int r;
5888 5794
5889 show_mptmod_ver(my_NAME, my_VERSION); 5795 show_mptmod_ver(my_NAME, my_VERSION);
5890 printk(KERN_INFO COPYRIGHT "\n"); 5796 printk(KERN_INFO COPYRIGHT "\n");
@@ -5896,8 +5802,7 @@ fusion_init(void)
5896 MptResetHandlers[i] = NULL; 5802 MptResetHandlers[i] = NULL;
5897 } 5803 }
5898 5804
5899 /* NEW! 20010120 -sralston 5805 /* Register ourselves (mptbase) in order to facilitate
5900 * Register ourselves (mptbase) in order to facilitate
5901 * EventNotification handling. 5806 * EventNotification handling.
5902 */ 5807 */
5903 mpt_base_index = mpt_register(mpt_base_reply, MPTBASE_DRIVER); 5808 mpt_base_index = mpt_register(mpt_base_reply, MPTBASE_DRIVER);
@@ -5913,11 +5818,7 @@ fusion_init(void)
5913#ifdef CONFIG_PROC_FS 5818#ifdef CONFIG_PROC_FS
5914 (void) procmpt_create(); 5819 (void) procmpt_create();
5915#endif 5820#endif
5916 r = pci_register_driver(&mptbase_driver); 5821 return 0;
5917 if(r)
5918 return(r);
5919
5920 return r;
5921} 5822}
5922 5823
5923/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5824/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -5933,7 +5834,6 @@ fusion_exit(void)
5933 5834
5934 dexitprintk((KERN_INFO MYNAM ": fusion_exit() called!\n")); 5835 dexitprintk((KERN_INFO MYNAM ": fusion_exit() called!\n"));
5935 5836
5936 pci_unregister_driver(&mptbase_driver);
5937 mpt_reset_deregister(mpt_base_index); 5837 mpt_reset_deregister(mpt_base_index);
5938 5838
5939#ifdef CONFIG_PROC_FS 5839#ifdef CONFIG_PROC_FS
@@ -5941,6 +5841,5 @@ fusion_exit(void)
5941#endif 5841#endif
5942} 5842}
5943 5843
5944
5945module_init(fusion_init); 5844module_init(fusion_init);
5946module_exit(fusion_exit); 5845module_exit(fusion_exit);
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 6d16acc7a179..848fb236b175 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -5,15 +5,9 @@
5 * LSIFC9xx/LSI409xx Fibre Channel 5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 7 *
8 * Credits: 8 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * (see mptbase.c)
10 *
11 * Copyright (c) 1999-2004 LSI Logic Corporation
12 * Originally By: Steven J. Ralston
13 * (mailto:sjralston1@netscape.net)
14 * (mailto:mpt_linux_developer@lsil.com) 9 * (mailto:mpt_linux_developer@lsil.com)
15 * 10 *
16 * $Id: mptbase.h,v 1.144 2003/01/28 21:31:56 pdelaney Exp $
17 */ 11 */
18/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 12/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
19/* 13/*
@@ -71,7 +65,6 @@
71#include "lsi/mpi_fc.h" /* Fibre Channel (lowlevel) support */ 65#include "lsi/mpi_fc.h" /* Fibre Channel (lowlevel) support */
72#include "lsi/mpi_targ.h" /* SCSI/FCP Target protcol support */ 66#include "lsi/mpi_targ.h" /* SCSI/FCP Target protcol support */
73#include "lsi/mpi_tool.h" /* Tools support */ 67#include "lsi/mpi_tool.h" /* Tools support */
74#include "lsi/fc_log.h"
75 68
76/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 69/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
77 70
@@ -80,11 +73,11 @@
80#endif 73#endif
81 74
82#ifndef COPYRIGHT 75#ifndef COPYRIGHT
83#define COPYRIGHT "Copyright (c) 1999-2004 " MODULEAUTHOR 76#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR
84#endif 77#endif
85 78
86#define MPT_LINUX_VERSION_COMMON "3.01.20" 79#define MPT_LINUX_VERSION_COMMON "3.03.02"
87#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.01.20" 80#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.02"
88#define WHAT_MAGIC_STRING "@" "(" "#" ")" 81#define WHAT_MAGIC_STRING "@" "(" "#" ")"
89 82
90#define show_mptmod_ver(s,ver) \ 83#define show_mptmod_ver(s,ver) \
@@ -203,7 +196,9 @@
203typedef enum { 196typedef enum {
204 MPTBASE_DRIVER, /* MPT base class */ 197 MPTBASE_DRIVER, /* MPT base class */
205 MPTCTL_DRIVER, /* MPT ioctl class */ 198 MPTCTL_DRIVER, /* MPT ioctl class */
206 MPTSCSIH_DRIVER, /* MPT SCSI host (initiator) class */ 199 MPTSPI_DRIVER, /* MPT SPI host class */
200 MPTFC_DRIVER, /* MPT FC host class */
201 MPTSAS_DRIVER, /* MPT SAS host class */
207 MPTLAN_DRIVER, /* MPT LAN class */ 202 MPTLAN_DRIVER, /* MPT LAN class */
208 MPTSTM_DRIVER, /* MPT SCSI target mode class */ 203 MPTSTM_DRIVER, /* MPT SCSI target mode class */
209 MPTUNKNOWN_DRIVER 204 MPTUNKNOWN_DRIVER
@@ -212,11 +207,6 @@ typedef enum {
212struct mpt_pci_driver{ 207struct mpt_pci_driver{
213 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); 208 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id);
214 void (*remove) (struct pci_dev *dev); 209 void (*remove) (struct pci_dev *dev);
215 void (*shutdown) (struct device * dev);
216#ifdef CONFIG_PM
217 int (*resume) (struct pci_dev *dev);
218 int (*suspend) (struct pci_dev *dev, pm_message_t state);
219#endif
220}; 210};
221 211
222/* 212/*
@@ -483,6 +473,7 @@ typedef struct _ScsiCfgData {
483 u8 forceDv; /* 1 to force DV scheduling */ 473 u8 forceDv; /* 1 to force DV scheduling */
484 u8 noQas; /* Disable QAS for this adapter */ 474 u8 noQas; /* Disable QAS for this adapter */
485 u8 Saf_Te; /* 1 to force all Processors as SAF-TE if Inquiry data length is too short to check for SAF-TE */ 475 u8 Saf_Te; /* 1 to force all Processors as SAF-TE if Inquiry data length is too short to check for SAF-TE */
476 u8 mpt_dv; /* command line option: enhanced=1, basic=0 */
486 u8 rsvd[1]; 477 u8 rsvd[1];
487} ScsiCfgData; 478} ScsiCfgData;
488 479
@@ -571,11 +562,21 @@ typedef struct _MPT_ADAPTER
571 FCPortPage0_t fc_port_page0[2]; 562 FCPortPage0_t fc_port_page0[2];
572 LANPage0_t lan_cnfg_page0; 563 LANPage0_t lan_cnfg_page0;
573 LANPage1_t lan_cnfg_page1; 564 LANPage1_t lan_cnfg_page1;
565 /*
566 * Description: errata_flag_1064
567 * If a PCIX read occurs within 1 or 2 cycles after the chip receives
568 * a split completion for a read data, an internal address pointer incorrectly
569 * increments by 32 bytes
570 */
571 int errata_flag_1064;
574 u8 FirstWhoInit; 572 u8 FirstWhoInit;
575 u8 upload_fw; /* If set, do a fw upload */ 573 u8 upload_fw; /* If set, do a fw upload */
576 u8 reload_fw; /* Force a FW Reload on next reset */ 574 u8 reload_fw; /* Force a FW Reload on next reset */
577 u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */ 575 u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */
578 u8 pad1[4]; 576 u8 pad1[4];
577 int DoneCtx;
578 int TaskCtx;
579 int InternalCtx;
579 struct list_head list; 580 struct list_head list;
580 struct net_device *netdev; 581 struct net_device *netdev;
581} MPT_ADAPTER; 582} MPT_ADAPTER;
@@ -773,12 +774,6 @@ typedef struct _mpt_sge {
773#define DBG_DUMP_TM_REPLY_FRAME(mfp) 774#define DBG_DUMP_TM_REPLY_FRAME(mfp)
774#endif 775#endif
775 776
776#ifdef MPT_DEBUG_NEH
777#define nehprintk(x) printk x
778#else
779#define nehprintk(x)
780#endif
781
782#if defined(MPT_DEBUG_CONFIG) || defined(MPT_DEBUG) 777#if defined(MPT_DEBUG_CONFIG) || defined(MPT_DEBUG)
783#define dcprintk(x) printk x 778#define dcprintk(x) printk x
784#else 779#else
@@ -898,6 +893,11 @@ typedef struct _MPT_SCSI_HOST {
898 unsigned long soft_resets; /* fw/external bus resets count */ 893 unsigned long soft_resets; /* fw/external bus resets count */
899 unsigned long timeouts; /* cmd timeouts */ 894 unsigned long timeouts; /* cmd timeouts */
900 ushort sel_timeout[MPT_MAX_FC_DEVICES]; 895 ushort sel_timeout[MPT_MAX_FC_DEVICES];
896 char *info_kbuf;
897 wait_queue_head_t scandv_waitq;
898 int scandv_wait_done;
899 long last_queue_full;
900 u8 mpt_pq_filter;
901} MPT_SCSI_HOST; 901} MPT_SCSI_HOST;
902 902
903/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 903/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -931,6 +931,12 @@ typedef struct _x_config_parms {
931/* 931/*
932 * Public entry points... 932 * Public entry points...
933 */ 933 */
934extern int mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id);
935extern void mpt_detach(struct pci_dev *pdev);
936#ifdef CONFIG_PM
937extern int mpt_suspend(struct pci_dev *pdev, pm_message_t state);
938extern int mpt_resume(struct pci_dev *pdev);
939#endif
934extern int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass); 940extern int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass);
935extern void mpt_deregister(int cb_idx); 941extern void mpt_deregister(int cb_idx);
936extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc); 942extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc);
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 70b0cfb5ac5c..05ea5944c487 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -1,40 +1,12 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptctl.c 2 * linux/drivers/message/fusion/mptctl.c
3 * Fusion MPT misc device (ioctl) driver. 3 * mpt Ioctl driver.
4 * For use with PCI chip/adapter(s): 4 * For use with LSI Logic PCI chip/adapters
5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 5 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 6 *
8 * Credits: 7 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 *
12 * A special thanks to Pamela Delaney (LSI Logic) for tons of work
13 * and countless enhancements while adding support for the 1030
14 * chip family. Pam has been instrumental in the development of
15 * of the 2.xx.xx series fusion drivers, and her contributions are
16 * far too numerous to hope to list in one place.
17 *
18 * A huge debt of gratitude is owed to David S. Miller (DaveM)
19 * for fixing much of the stupid and broken stuff in the early
20 * driver while porting to sparc64 platform. THANK YOU!
21 *
22 * A big THANKS to Eddie C. Dost for fixing the ioctl path
23 * and most importantly f/w download on sparc64 platform!
24 * (plus Eddie's other helpful hints and insights)
25 *
26 * Thanks to Arnaldo Carvalho de Melo for finding and patching
27 * a potential memory leak in mptctl_do_fw_download(),
28 * and for some kmalloc insight:-)
29 *
30 * (see also mptbase.c)
31 *
32 * Copyright (c) 1999-2004 LSI Logic Corporation
33 * Originally By: Steven J. Ralston, Noah Romer
34 * (mailto:sjralston1@netscape.net)
35 * (mailto:mpt_linux_developer@lsil.com) 8 * (mailto:mpt_linux_developer@lsil.com)
36 * 9 *
37 * $Id: mptctl.c,v 1.63 2002/12/03 21:26:33 pdelaney Exp $
38 */ 10 */
39/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 11/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
40/* 12/*
@@ -95,8 +67,8 @@
95#include <scsi/scsi_host.h> 67#include <scsi/scsi_host.h>
96#include <scsi/scsi_tcq.h> 68#include <scsi/scsi_tcq.h>
97 69
98#define COPYRIGHT "Copyright (c) 1999-2004 LSI Logic Corporation" 70#define COPYRIGHT "Copyright (c) 1999-2005 LSI Logic Corporation"
99#define MODULEAUTHOR "Steven J. Ralston, Noah Romer, Pamela Delaney" 71#define MODULEAUTHOR "LSI Logic Corporation"
100#include "mptbase.h" 72#include "mptbase.h"
101#include "mptctl.h" 73#include "mptctl.h"
102 74
@@ -127,14 +99,14 @@ struct buflist {
127 * arg contents specific to function. 99 * arg contents specific to function.
128 */ 100 */
129static int mptctl_fw_download(unsigned long arg); 101static int mptctl_fw_download(unsigned long arg);
130static int mptctl_getiocinfo (unsigned long arg, unsigned int cmd); 102static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd);
131static int mptctl_gettargetinfo (unsigned long arg); 103static int mptctl_gettargetinfo(unsigned long arg);
132static int mptctl_readtest (unsigned long arg); 104static int mptctl_readtest(unsigned long arg);
133static int mptctl_mpt_command (unsigned long arg); 105static int mptctl_mpt_command(unsigned long arg);
134static int mptctl_eventquery (unsigned long arg); 106static int mptctl_eventquery(unsigned long arg);
135static int mptctl_eventenable (unsigned long arg); 107static int mptctl_eventenable(unsigned long arg);
136static int mptctl_eventreport (unsigned long arg); 108static int mptctl_eventreport(unsigned long arg);
137static int mptctl_replace_fw (unsigned long arg); 109static int mptctl_replace_fw(unsigned long arg);
138 110
139static int mptctl_do_reset(unsigned long arg); 111static int mptctl_do_reset(unsigned long arg);
140static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd); 112static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd);
@@ -149,11 +121,11 @@ static long compat_mpctl_ioctl(struct file *f, unsigned cmd, unsigned long arg);
149/* 121/*
150 * Private function calls. 122 * Private function calls.
151 */ 123 */
152static int mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr); 124static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr);
153static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen); 125static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen);
154static MptSge_t *kbuf_alloc_2_sgl( int bytes, u32 dir, int sge_offset, int *frags, 126static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags,
155 struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc); 127 struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc);
156static void kfree_sgl( MptSge_t *sgl, dma_addr_t sgl_dma, 128static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma,
157 struct buflist *buflist, MPT_ADAPTER *ioc); 129 struct buflist *buflist, MPT_ADAPTER *ioc);
158static void mptctl_timeout_expired (MPT_IOCTL *ioctl); 130static void mptctl_timeout_expired (MPT_IOCTL *ioctl);
159static int mptctl_bus_reset(MPT_IOCTL *ioctl); 131static int mptctl_bus_reset(MPT_IOCTL *ioctl);
@@ -1119,7 +1091,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1119 int numDevices = 0; 1091 int numDevices = 0;
1120 unsigned int max_id; 1092 unsigned int max_id;
1121 int ii; 1093 int ii;
1122 int port; 1094 unsigned int port;
1123 int cim_rev; 1095 int cim_rev;
1124 u8 revision; 1096 u8 revision;
1125 1097
@@ -1162,9 +1134,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1162 return -ENODEV; 1134 return -ENODEV;
1163 } 1135 }
1164 1136
1165 /* Verify the data transfer size is correct. 1137 /* Verify the data transfer size is correct. */
1166 * Ignore the port setting.
1167 */
1168 if (karg->hdr.maxDataSize != data_size) { 1138 if (karg->hdr.maxDataSize != data_size) {
1169 printk(KERN_ERR "%s@%d::mptctl_getiocinfo - " 1139 printk(KERN_ERR "%s@%d::mptctl_getiocinfo - "
1170 "Structure size mismatch. Command not completed.\n", 1140 "Structure size mismatch. Command not completed.\n",
@@ -1181,6 +1151,8 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1181 else 1151 else
1182 karg->adapterType = MPT_IOCTL_INTERFACE_SCSI; 1152 karg->adapterType = MPT_IOCTL_INTERFACE_SCSI;
1183 1153
1154 if (karg->hdr.port > 1)
1155 return -EINVAL;
1184 port = karg->hdr.port; 1156 port = karg->hdr.port;
1185 1157
1186 karg->port = port; 1158 karg->port = port;
diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h
index cc4ecf0382df..28754a9cb803 100644
--- a/drivers/message/fusion/mptctl.h
+++ b/drivers/message/fusion/mptctl.h
@@ -5,22 +5,9 @@
5 * LSIFC9xx/LSI409xx Fibre Channel 5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 7 *
8 * Credits: 8 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 *
12 * A huge debt of gratitude is owed to David S. Miller (DaveM)
13 * for fixing much of the stupid and broken stuff in the early
14 * driver while porting to sparc64 platform. THANK YOU!
15 *
16 * (see also mptbase.c)
17 *
18 * Copyright (c) 1999-2004 LSI Logic Corporation
19 * Originally By: Steven J. Ralston
20 * (mailto:sjralston1@netscape.net)
21 * (mailto:mpt_linux_developer@lsil.com) 9 * (mailto:mpt_linux_developer@lsil.com)
22 * 10 *
23 * $Id: mptctl.h,v 1.13 2002/12/03 21:26:33 pdelaney Exp $
24 */ 11 */
25/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 12/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
26/* 13/*
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
new file mode 100644
index 000000000000..d8d65397e06e
--- /dev/null
+++ b/drivers/message/fusion/mptfc.c
@@ -0,0 +1,431 @@
1/*
2 * linux/drivers/message/fusion/mptfc.c
3 * For use with LSI Logic PCI chip/adapter(s)
4 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
5 *
6 * Copyright (c) 1999-2005 LSI Logic Corporation
7 * (mailto:mpt_linux_developer@lsil.com)
8 *
9 */
10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
11/*
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; version 2 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 NO WARRANTY
22 THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
23 CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
24 LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
25 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
26 solely responsible for determining the appropriateness of using and
27 distributing the Program and assumes all risks associated with its
28 exercise of rights under this Agreement, including but not limited to
29 the risks and costs of program errors, damage to or loss of data,
30 programs or equipment, and unavailability or interruption of operations.
31
32 DISCLAIMER OF LIABILITY
33 NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
34 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
36 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
37 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
38 USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
39 HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
40
41 You should have received a copy of the GNU General Public License
42 along with this program; if not, write to the Free Software
43 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44*/
45/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
46#include "linux_compat.h" /* linux-2.6 tweaks */
47#include <linux/module.h>
48#include <linux/kernel.h>
49#include <linux/init.h>
50#include <linux/errno.h>
51#include <linux/kdev_t.h>
52#include <linux/blkdev.h>
53#include <linux/delay.h> /* for mdelay */
54#include <linux/interrupt.h> /* needed for in_interrupt() proto */
55#include <linux/reboot.h> /* notifier code */
56#include <linux/sched.h>
57#include <linux/workqueue.h>
58
59#include <scsi/scsi.h>
60#include <scsi/scsi_cmnd.h>
61#include <scsi/scsi_device.h>
62#include <scsi/scsi_host.h>
63#include <scsi/scsi_tcq.h>
64
65#include "mptbase.h"
66#include "mptscsih.h"
67
68/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
69#define my_NAME "Fusion MPT FC Host driver"
70#define my_VERSION MPT_LINUX_VERSION_COMMON
71#define MYNAM "mptfc"
72
73MODULE_AUTHOR(MODULEAUTHOR);
74MODULE_DESCRIPTION(my_NAME);
75MODULE_LICENSE("GPL");
76
77/* Command line args */
78static int mpt_pq_filter = 0;
79module_param(mpt_pq_filter, int, 0);
80MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)");
81
82static int mptfcDoneCtx = -1;
83static int mptfcTaskCtx = -1;
84static int mptfcInternalCtx = -1; /* Used only for internal commands */
85
86static struct device_attribute mptfc_queue_depth_attr = {
87 .attr = {
88 .name = "queue_depth",
89 .mode = S_IWUSR,
90 },
91 .store = mptscsih_store_queue_depth,
92};
93
94static struct device_attribute *mptfc_dev_attrs[] = {
95 &mptfc_queue_depth_attr,
96 NULL,
97};
98
99static struct scsi_host_template mptfc_driver_template = {
100 .proc_name = "mptfc",
101 .proc_info = mptscsih_proc_info,
102 .name = "MPT FC Host",
103 .info = mptscsih_info,
104 .queuecommand = mptscsih_qcmd,
105 .slave_alloc = mptscsih_slave_alloc,
106 .slave_configure = mptscsih_slave_configure,
107 .slave_destroy = mptscsih_slave_destroy,
108 .eh_abort_handler = mptscsih_abort,
109 .eh_device_reset_handler = mptscsih_dev_reset,
110 .eh_bus_reset_handler = mptscsih_bus_reset,
111 .eh_host_reset_handler = mptscsih_host_reset,
112 .bios_param = mptscsih_bios_param,
113 .can_queue = MPT_FC_CAN_QUEUE,
114 .this_id = -1,
115 .sg_tablesize = MPT_SCSI_SG_DEPTH,
116 .max_sectors = 8192,
117 .cmd_per_lun = 7,
118 .use_clustering = ENABLE_CLUSTERING,
119 .sdev_attrs = mptfc_dev_attrs,
120};
121
122/****************************************************************************
123 * Supported hardware
124 */
125
126static struct pci_device_id mptfc_pci_table[] = {
127 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
128 PCI_ANY_ID, PCI_ANY_ID },
129 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
130 PCI_ANY_ID, PCI_ANY_ID },
131 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
132 PCI_ANY_ID, PCI_ANY_ID },
133 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X,
134 PCI_ANY_ID, PCI_ANY_ID },
135 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X,
136 PCI_ANY_ID, PCI_ANY_ID },
137 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC939X,
138 PCI_ANY_ID, PCI_ANY_ID },
139 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949X,
140 PCI_ANY_ID, PCI_ANY_ID },
141 {0} /* Terminating entry */
142};
143MODULE_DEVICE_TABLE(pci, mptfc_pci_table);
144
145/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
146/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
147/*
148 * mptfc_probe - Installs scsi devices per bus.
149 * @pdev: Pointer to pci_dev structure
150 *
151 * Returns 0 for success, non-zero for failure.
152 *
153 */
154static int
155mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
156{
157 struct Scsi_Host *sh;
158 MPT_SCSI_HOST *hd;
159 MPT_ADAPTER *ioc;
160 unsigned long flags;
161 int sz, ii;
162 int numSGE = 0;
163 int scale;
164 int ioc_cap;
165 u8 *mem;
166 int error=0;
167 int r;
168
169 if ((r = mpt_attach(pdev,id)) != 0)
170 return r;
171
172 ioc = pci_get_drvdata(pdev);
173 ioc->DoneCtx = mptfcDoneCtx;
174 ioc->TaskCtx = mptfcTaskCtx;
175 ioc->InternalCtx = mptfcInternalCtx;
176
177 /* Added sanity check on readiness of the MPT adapter.
178 */
179 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
180 printk(MYIOC_s_WARN_FMT
181 "Skipping because it's not operational!\n",
182 ioc->name);
183 return -ENODEV;
184 }
185
186 if (!ioc->active) {
187 printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
188 ioc->name);
189 return -ENODEV;
190 }
191
192 /* Sanity check - ensure at least 1 port is INITIATOR capable
193 */
194 ioc_cap = 0;
195 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
196 if (ioc->pfacts[ii].ProtocolFlags &
197 MPI_PORTFACTS_PROTOCOL_INITIATOR)
198 ioc_cap ++;
199 }
200
201 if (!ioc_cap) {
202 printk(MYIOC_s_WARN_FMT
203 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n",
204 ioc->name, ioc);
205 return -ENODEV;
206 }
207
208 sh = scsi_host_alloc(&mptfc_driver_template, sizeof(MPT_SCSI_HOST));
209
210 if (!sh) {
211 printk(MYIOC_s_WARN_FMT
212 "Unable to register controller with SCSI subsystem\n",
213 ioc->name);
214 return -1;
215 }
216
217 spin_lock_irqsave(&ioc->FreeQlock, flags);
218
219 /* Attach the SCSI Host to the IOC structure
220 */
221 ioc->sh = sh;
222
223 sh->io_port = 0;
224 sh->n_io_port = 0;
225 sh->irq = 0;
226
227 /* set 16 byte cdb's */
228 sh->max_cmd_len = 16;
229
230 sh->max_id = MPT_MAX_FC_DEVICES<256 ? MPT_MAX_FC_DEVICES : 255;
231
232 sh->max_lun = MPT_LAST_LUN + 1;
233 sh->max_channel = 0;
234 sh->this_id = ioc->pfacts[0].PortSCSIID;
235
236 /* Required entry.
237 */
238 sh->unique_id = ioc->id;
239
240 /* Verify that we won't exceed the maximum
241 * number of chain buffers
242 * We can optimize: ZZ = req_sz/sizeof(SGE)
243 * For 32bit SGE's:
244 * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
245 * + (req_sz - 64)/sizeof(SGE)
246 * A slightly different algorithm is required for
247 * 64bit SGEs.
248 */
249 scale = ioc->req_sz/(sizeof(dma_addr_t) + sizeof(u32));
250 if (sizeof(dma_addr_t) == sizeof(u64)) {
251 numSGE = (scale - 1) *
252 (ioc->facts.MaxChainDepth-1) + scale +
253 (ioc->req_sz - 60) / (sizeof(dma_addr_t) +
254 sizeof(u32));
255 } else {
256 numSGE = 1 + (scale - 1) *
257 (ioc->facts.MaxChainDepth-1) + scale +
258 (ioc->req_sz - 64) / (sizeof(dma_addr_t) +
259 sizeof(u32));
260 }
261
262 if (numSGE < sh->sg_tablesize) {
263 /* Reset this value */
264 dprintk((MYIOC_s_INFO_FMT
265 "Resetting sg_tablesize to %d from %d\n",
266 ioc->name, numSGE, sh->sg_tablesize));
267 sh->sg_tablesize = numSGE;
268 }
269
270 /* Set the pci device pointer in Scsi_Host structure.
271 */
272 scsi_set_device(sh, &ioc->pcidev->dev);
273
274 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
275
276 hd = (MPT_SCSI_HOST *) sh->hostdata;
277 hd->ioc = ioc;
278
279 /* SCSI needs scsi_cmnd lookup table!
280 * (with size equal to req_depth*PtrSz!)
281 */
282 sz = ioc->req_depth * sizeof(void *);
283 mem = kmalloc(sz, GFP_ATOMIC);
284 if (mem == NULL) {
285 error = -ENOMEM;
286 goto mptfc_probe_failed;
287 }
288
289 memset(mem, 0, sz);
290 hd->ScsiLookup = (struct scsi_cmnd **) mem;
291
292 dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
293 ioc->name, hd->ScsiLookup, sz));
294
295 /* Allocate memory for the device structures.
296 * A non-Null pointer at an offset
297 * indicates a device exists.
298 * max_id = 1 + maximum id (hosts.h)
299 */
300 sz = sh->max_id * sizeof(void *);
301 mem = kmalloc(sz, GFP_ATOMIC);
302 if (mem == NULL) {
303 error = -ENOMEM;
304 goto mptfc_probe_failed;
305 }
306
307 memset(mem, 0, sz);
308 hd->Targets = (VirtDevice **) mem;
309
310 dprintk((KERN_INFO
311 " Targets @ %p, sz=%d\n", hd->Targets, sz));
312
313 /* Clear the TM flags
314 */
315 hd->tmPending = 0;
316 hd->tmState = TM_STATE_NONE;
317 hd->resetPending = 0;
318 hd->abortSCpnt = NULL;
319
320 /* Clear the pointer used to store
321 * single-threaded commands, i.e., those
322 * issued during a bus scan, dv and
323 * configuration pages.
324 */
325 hd->cmdPtr = NULL;
326
327 /* Initialize this SCSI Hosts' timers
328 * To use, set the timer expires field
329 * and add_timer
330 */
331 init_timer(&hd->timer);
332 hd->timer.data = (unsigned long) hd;
333 hd->timer.function = mptscsih_timer_expired;
334
335 hd->mpt_pq_filter = mpt_pq_filter;
336
337 ddvprintk((MYIOC_s_INFO_FMT
338 "mpt_pq_filter %x\n",
339 ioc->name,
340 mpt_pq_filter));
341
342 init_waitqueue_head(&hd->scandv_waitq);
343 hd->scandv_wait_done = 0;
344 hd->last_queue_full = 0;
345
346 error = scsi_add_host (sh, &ioc->pcidev->dev);
347 if(error) {
348 dprintk((KERN_ERR MYNAM
349 "scsi_add_host failed\n"));
350 goto mptfc_probe_failed;
351 }
352
353 scsi_scan_host(sh);
354 return 0;
355
356mptfc_probe_failed:
357
358 mptscsih_remove(pdev);
359 return error;
360}
361
362static struct pci_driver mptfc_driver = {
363 .name = "mptfc",
364 .id_table = mptfc_pci_table,
365 .probe = mptfc_probe,
366 .remove = __devexit_p(mptscsih_remove),
367 .driver = {
368 .shutdown = mptscsih_shutdown,
369 },
370#ifdef CONFIG_PM
371 .suspend = mptscsih_suspend,
372 .resume = mptscsih_resume,
373#endif
374};
375
376/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
377/**
378 * mptfc_init - Register MPT adapter(s) as SCSI host(s) with
379 * linux scsi mid-layer.
380 *
381 * Returns 0 for success, non-zero for failure.
382 */
383static int __init
384mptfc_init(void)
385{
386
387 show_mptmod_ver(my_NAME, my_VERSION);
388
389 mptfcDoneCtx = mpt_register(mptscsih_io_done, MPTFC_DRIVER);
390 mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER);
391 mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER);
392
393 if (mpt_event_register(mptfcDoneCtx, mptscsih_event_process) == 0) {
394 devtprintk((KERN_INFO MYNAM
395 ": Registered for IOC event notifications\n"));
396 }
397
398 if (mpt_reset_register(mptfcDoneCtx, mptscsih_ioc_reset) == 0) {
399 dprintk((KERN_INFO MYNAM
400 ": Registered for IOC reset notifications\n"));
401 }
402
403 return pci_register_driver(&mptfc_driver);
404}
405
406/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
407/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
408/**
409 * mptfc_exit - Unregisters MPT adapter(s)
410 *
411 */
412static void __exit
413mptfc_exit(void)
414{
415 pci_unregister_driver(&mptfc_driver);
416
417 mpt_reset_deregister(mptfcDoneCtx);
418 dprintk((KERN_INFO MYNAM
419 ": Deregistered for IOC reset notifications\n"));
420
421 mpt_event_deregister(mptfcDoneCtx);
422 dprintk((KERN_INFO MYNAM
423 ": Deregistered for IOC event notifications\n"));
424
425 mpt_deregister(mptfcInternalCtx);
426 mpt_deregister(mptfcTaskCtx);
427 mpt_deregister(mptfcDoneCtx);
428}
429
430module_init(mptfc_init);
431module_exit(mptfc_exit);
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index ef2713b93fab..52794be5a95c 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -1,33 +1,11 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptlan.c 2 * linux/drivers/message/fusion/mptlan.c
3 * IP Over Fibre Channel device driver. 3 * IP Over Fibre Channel device driver.
4 * For use with PCI chip/adapter(s): 4 * For use with LSI Logic Fibre Channel PCI chip/adapters
5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 5 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 6 *
8 * Credits: 7 * Copyright (c) 2000-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 * 8 *
12 * Special thanks goes to the I2O LAN driver people at the
13 * University of Helsinki, who, unbeknownst to them, provided
14 * the inspiration and initial structure for this driver.
15 *
16 * A huge debt of gratitude is owed to David S. Miller (DaveM)
17 * for fixing much of the stupid and broken stuff in the early
18 * driver while porting to sparc64 platform. THANK YOU!
19 *
20 * A really huge debt of gratitude is owed to Eddie C. Dost
21 * for gobs of hard work fixing and optimizing LAN code.
22 * THANK YOU!
23 *
24 * (see also mptbase.c)
25 *
26 * Copyright (c) 2000-2004 LSI Logic Corporation
27 * Originally By: Noah Romer
28 * (mailto:mpt_linux_developer@lsil.com)
29 *
30 * $Id: mptlan.c,v 1.53 2002/10/17 20:15:58 pdelaney Exp $
31 */ 9 */
32/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
33/* 11/*
@@ -221,7 +199,7 @@ lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
221 199
222 // NOTE! (Optimization) First case here is now caught in 200 // NOTE! (Optimization) First case here is now caught in
223 // mptbase.c::mpt_interrupt() routine and callcack here 201 // mptbase.c::mpt_interrupt() routine and callcack here
224 // is now skipped for this case! 20001218 -sralston 202 // is now skipped for this case!
225#if 0 203#if 0
226 case LAN_REPLY_FORM_MESSAGE_CONTEXT: 204 case LAN_REPLY_FORM_MESSAGE_CONTEXT:
227// dioprintk((KERN_INFO MYNAM "/lan_reply: " 205// dioprintk((KERN_INFO MYNAM "/lan_reply: "
@@ -234,7 +212,7 @@ lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
234// dioprintk((MYNAM "/lan_reply: " 212// dioprintk((MYNAM "/lan_reply: "
235// "calling mpt_lan_send_reply (turbo)\n")); 213// "calling mpt_lan_send_reply (turbo)\n"));
236 214
237 // Potential BUG here? -sralston 215 // Potential BUG here?
238 // FreeReqFrame = mpt_lan_send_turbo(dev, tmsg); 216 // FreeReqFrame = mpt_lan_send_turbo(dev, tmsg);
239 // If/when mpt_lan_send_turbo would return 1 here, 217 // If/when mpt_lan_send_turbo would return 1 here,
240 // calling routine (mptbase.c|mpt_interrupt) 218 // calling routine (mptbase.c|mpt_interrupt)
@@ -310,8 +288,7 @@ lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
310 288
311 case MPI_FUNCTION_EVENT_NOTIFICATION: 289 case MPI_FUNCTION_EVENT_NOTIFICATION:
312 case MPI_FUNCTION_EVENT_ACK: 290 case MPI_FUNCTION_EVENT_ACK:
313 /* UPDATE! 20010120 -sralston 291 /* _EVENT_NOTIFICATION should NOT come down this path any more.
314 * _EVENT_NOTIFICATION should NOT come down this path any more.
315 * Should be routed to mpt_lan_event_process(), but just in case... 292 * Should be routed to mpt_lan_event_process(), but just in case...
316 */ 293 */
317 FreeReqFrame = 1; 294 FreeReqFrame = 1;
@@ -561,8 +538,8 @@ mpt_lan_close(struct net_device *dev)
561 } 538 }
562 } 539 }
563 540
564 kfree (priv->RcvCtl); 541 kfree(priv->RcvCtl);
565 kfree (priv->mpt_rxfidx); 542 kfree(priv->mpt_rxfidx);
566 543
567 for (i = 0; i < priv->tx_max_out; i++) { 544 for (i = 0; i < priv->tx_max_out; i++) {
568 if (priv->SendCtl[i].skb != NULL) { 545 if (priv->SendCtl[i].skb != NULL) {
diff --git a/drivers/message/fusion/mptlan.h b/drivers/message/fusion/mptlan.h
index 057904260ab1..750e343eb981 100644
--- a/drivers/message/fusion/mptlan.h
+++ b/drivers/message/fusion/mptlan.h
@@ -1,3 +1,49 @@
1/*
2 * linux/drivers/message/fusion/mptlan.h
3 * IP Over Fibre Channel device driver.
4 * For use with LSI Logic Fibre Channel PCI chip/adapters
5 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
6 *
7 * Copyright (c) 2000-2005 LSI Logic Corporation
8 *
9 */
10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
11/*
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; version 2 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 NO WARRANTY
22 THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
23 CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
24 LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
25 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
26 solely responsible for determining the appropriateness of using and
27 distributing the Program and assumes all risks associated with its
28 exercise of rights under this Agreement, including but not limited to
29 the risks and costs of program errors, damage to or loss of data,
30 programs or equipment, and unavailability or interruption of operations.
31
32 DISCLAIMER OF LIABILITY
33 NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
34 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
36 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
37 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
38 USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
39 HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
40
41 You should have received a copy of the GNU General Public License
42 along with this program; if not, write to the Free Software
43 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44*/
45/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
46
1/* mptlan.h */ 47/* mptlan.h */
2 48
3#ifndef LINUX_MPTLAN_H_INCLUDED 49#ifndef LINUX_MPTLAN_H_INCLUDED
@@ -29,7 +75,7 @@
29#include <asm/io.h> 75#include <asm/io.h>
30 76
31 /* Override mptbase.h by pre-defining these! */ 77 /* Override mptbase.h by pre-defining these! */
32 #define MODULEAUTHOR "Noah Romer, Eddie C. Dost" 78#define MODULEAUTHOR "LSI Logic Corporation"
33 79
34#include "mptbase.h" 80#include "mptbase.h"
35 81
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 3a3ef127df04..48ff314cdfbf 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1,32 +1,11 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptscsih.c 2 * linux/drivers/message/fusion/mptscsih.c
3 * High performance SCSI / Fibre Channel SCSI Host device driver. 3 * For use with LSI Logic PCI chip/adapter(s)
4 * For use with PCI chip/adapter(s):
5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 4 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 5 *
8 * Credits: 6 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 *
12 * A special thanks to Pamela Delaney (LSI Logic) for tons of work
13 * and countless enhancements while adding support for the 1030
14 * chip family. Pam has been instrumental in the development of
15 * of the 2.xx.xx series fusion drivers, and her contributions are
16 * far too numerous to hope to list in one place.
17 *
18 * A huge debt of gratitude is owed to David S. Miller (DaveM)
19 * for fixing much of the stupid and broken stuff in the early
20 * driver while porting to sparc64 platform. THANK YOU!
21 *
22 * (see mptbase.c)
23 *
24 * Copyright (c) 1999-2004 LSI Logic Corporation
25 * Original author: Steven J. Ralston
26 * (mailto:sjralston1@netscape.net)
27 * (mailto:mpt_linux_developer@lsil.com) 7 * (mailto:mpt_linux_developer@lsil.com)
28 * 8 *
29 * $Id: mptscsih.c,v 1.104 2002/12/03 21:26:34 pdelaney Exp $
30 */ 9 */
31/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
32/* 11/*
@@ -96,27 +75,6 @@ MODULE_AUTHOR(MODULEAUTHOR);
96MODULE_DESCRIPTION(my_NAME); 75MODULE_DESCRIPTION(my_NAME);
97MODULE_LICENSE("GPL"); 76MODULE_LICENSE("GPL");
98 77
99/* Command line args */
100static int mpt_dv = MPTSCSIH_DOMAIN_VALIDATION;
101MODULE_PARM(mpt_dv, "i");
102MODULE_PARM_DESC(mpt_dv, " DV Algorithm: enhanced=1, basic=0 (default=MPTSCSIH_DOMAIN_VALIDATION=1)");
103
104static int mpt_width = MPTSCSIH_MAX_WIDTH;
105MODULE_PARM(mpt_width, "i");
106MODULE_PARM_DESC(mpt_width, " Max Bus Width: wide=1, narrow=0 (default=MPTSCSIH_MAX_WIDTH=1)");
107
108static int mpt_factor = MPTSCSIH_MIN_SYNC;
109MODULE_PARM(mpt_factor, "h");
110MODULE_PARM_DESC(mpt_factor, " Min Sync Factor (default=MPTSCSIH_MIN_SYNC=0x08)");
111
112static int mpt_saf_te = MPTSCSIH_SAF_TE;
113MODULE_PARM(mpt_saf_te, "i");
114MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1 (default=MPTSCSIH_SAF_TE=0)");
115
116static int mpt_pq_filter = 0;
117MODULE_PARM(mpt_pq_filter, "i");
118MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)");
119
120/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 78/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
121 79
122typedef struct _BIG_SENSE_BUF { 80typedef struct _BIG_SENSE_BUF {
@@ -169,18 +127,17 @@ typedef struct _dv_parameters {
169 u16 pad1; 127 u16 pad1;
170} DVPARAMETERS; 128} DVPARAMETERS;
171 129
172
173/* 130/*
174 * Other private/forward protos... 131 * Other private/forward protos...
175 */ 132 */
176static int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); 133int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
177static void mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq); 134static void mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq);
178static int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); 135int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
179 136
180static int mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt, 137static int mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt,
181 SCSIIORequest_t *pReq, int req_idx); 138 SCSIIORequest_t *pReq, int req_idx);
182static void mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx); 139static void mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx);
183static void copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); 140static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply);
184static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd); 141static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd);
185static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout ); 142static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout );
186static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc); 143static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc);
@@ -188,8 +145,8 @@ static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc);
188static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); 145static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout);
189static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); 146static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout);
190 147
191static int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); 148int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
192static int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); 149int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
193 150
194static void mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen); 151static void mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen);
195static void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56); 152static void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56);
@@ -198,8 +155,7 @@ static void mptscsih_setDevicePage1Flags (u8 width, u8 factor, u8 offset, int *r
198static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id); 155static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id);
199static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags); 156static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags);
200static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus); 157static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus);
201static int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); 158int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
202static void mptscsih_timer_expired(unsigned long data);
203static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd); 159static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd);
204static int mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum); 160static int mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum);
205 161
@@ -212,29 +168,14 @@ static int mptscsih_doDv(MPT_SCSI_HOST *hd, int channel, int target);
212static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage); 168static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage);
213static void mptscsih_fillbuf(char *buffer, int size, int index, int width); 169static void mptscsih_fillbuf(char *buffer, int size, int index, int width);
214#endif 170#endif
215/* module entry point */
216static int __init mptscsih_init (void);
217static void __exit mptscsih_exit (void);
218 171
219static int mptscsih_probe (struct pci_dev *, const struct pci_device_id *); 172void mptscsih_remove(struct pci_dev *);
220static void mptscsih_remove(struct pci_dev *); 173void mptscsih_shutdown(struct device *);
221static void mptscsih_shutdown(struct device *);
222#ifdef CONFIG_PM 174#ifdef CONFIG_PM
223static int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); 175int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);
224static int mptscsih_resume(struct pci_dev *pdev); 176int mptscsih_resume(struct pci_dev *pdev);
225#endif 177#endif
226 178
227
228/*
229 * Private data...
230 */
231
232static int mpt_scsi_hosts = 0;
233
234static int ScsiDoneCtx = -1;
235static int ScsiTaskCtx = -1;
236static int ScsiScanDvCtx = -1; /* Used only for bus scan and dv */
237
238#define SNS_LEN(scp) sizeof((scp)->sense_buffer) 179#define SNS_LEN(scp) sizeof((scp)->sense_buffer)
239 180
240#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION 181#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
@@ -244,20 +185,9 @@ static int ScsiScanDvCtx = -1; /* Used only for bus scan and dv */
244static DEFINE_SPINLOCK(dvtaskQ_lock); 185static DEFINE_SPINLOCK(dvtaskQ_lock);
245static int dvtaskQ_active = 0; 186static int dvtaskQ_active = 0;
246static int dvtaskQ_release = 0; 187static int dvtaskQ_release = 0;
247static struct work_struct mptscsih_dvTask; 188static struct work_struct dvTaskQ_task;
248#endif 189#endif
249 190
250/*
251 * Wait Queue setup
252 */
253static DECLARE_WAIT_QUEUE_HEAD (scandv_waitq);
254static int scandv_wait_done = 1;
255
256
257/* Driver command line structure
258 */
259static struct scsi_host_template driver_template;
260
261/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 191/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
262/** 192/**
263 * mptscsih_add_sge - Place a simple SGE at address pAddr. 193 * mptscsih_add_sge - Place a simple SGE at address pAddr.
@@ -619,7 +549,7 @@ nextSGEset:
619 * 549 *
620 * Returns 1 indicating alloc'd request frame ptr should be freed. 550 * Returns 1 indicating alloc'd request frame ptr should be freed.
621 */ 551 */
622static int 552int
623mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) 553mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
624{ 554{
625 struct scsi_cmnd *sc; 555 struct scsi_cmnd *sc;
@@ -677,8 +607,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
677 sc->request_bufflen, xfer_cnt)); 607 sc->request_bufflen, xfer_cnt));
678 608
679 if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID) 609 if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID)
680 copy_sense_data(sc, hd, mf, pScsiReply); 610 mptscsih_copy_sense_data(sc, hd, mf, pScsiReply);
681 611
682 /* 612 /*
683 * Look for + dump FCP ResponseInfo[]! 613 * Look for + dump FCP ResponseInfo[]!
684 */ 614 */
@@ -740,7 +670,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
740 } 670 }
741 dreplyprintk((KERN_NOTICE "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->target)); 671 dreplyprintk((KERN_NOTICE "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->target));
742 break; 672 break;
743 673
744 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ 674 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */
745 /* 675 /*
746 * Do upfront check for valid SenseData and give it 676 * Do upfront check for valid SenseData and give it
@@ -773,7 +703,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
773 */ 703 */
774 if (scsi_status == MPI_SCSI_STATUS_TASK_SET_FULL) 704 if (scsi_status == MPI_SCSI_STATUS_TASK_SET_FULL)
775 mptscsih_report_queue_full(sc, pScsiReply, pScsiReq); 705 mptscsih_report_queue_full(sc, pScsiReply, pScsiReq);
776 706
777 break; 707 break;
778 708
779 case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ 709 case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */
@@ -905,18 +835,16 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
905 * Do OS callback 835 * Do OS callback
906 * Free driver resources (chain, msg buffers) 836 * Free driver resources (chain, msg buffers)
907 */ 837 */
908 if (scsi_device_online(SCpnt->device)) { 838 if (SCpnt->use_sg) {
909 if (SCpnt->use_sg) { 839 pci_unmap_sg(ioc->pcidev,
910 pci_unmap_sg(ioc->pcidev, 840 (struct scatterlist *) SCpnt->request_buffer,
911 (struct scatterlist *) SCpnt->request_buffer, 841 SCpnt->use_sg,
912 SCpnt->use_sg, 842 SCpnt->sc_data_direction);
913 SCpnt->sc_data_direction); 843 } else if (SCpnt->request_bufflen) {
914 } else if (SCpnt->request_bufflen) { 844 pci_unmap_single(ioc->pcidev,
915 pci_unmap_single(ioc->pcidev, 845 SCpnt->SCp.dma_handle,
916 SCpnt->SCp.dma_handle, 846 SCpnt->request_bufflen,
917 SCpnt->request_bufflen, 847 SCpnt->sc_data_direction);
918 SCpnt->sc_data_direction);
919 }
920 } 848 }
921 SCpnt->result = DID_RESET << 16; 849 SCpnt->result = DID_RESET << 16;
922 SCpnt->host_scribble = NULL; 850 SCpnt->host_scribble = NULL;
@@ -981,11 +909,6 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, uint target, uint lun)
981} 909}
982 910
983/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 911/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
984/*
985 * Hack! It might be nice to report if a device is returning QUEUE_FULL
986 * but maybe not each and every time...
987 */
988static long last_queue_full = 0;
989 912
990/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 913/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
991/* 914/*
@@ -1003,280 +926,20 @@ static void
1003mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq) 926mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq)
1004{ 927{
1005 long time = jiffies; 928 long time = jiffies;
1006
1007 if (time - last_queue_full > 10 * HZ) {
1008 char *ioc_str = "ioc?";
1009
1010 if (sc->device && sc->device->host != NULL && sc->device->host->hostdata != NULL)
1011 ioc_str = ((MPT_SCSI_HOST *)sc->device->host->hostdata)->ioc->name;
1012 dprintk((MYIOC_s_WARN_FMT "Device (%d:%d:%d) reported QUEUE_FULL!\n",
1013 ioc_str, 0, sc->device->id, sc->device->lun));
1014 last_queue_full = time;
1015 }
1016}
1017
1018/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1019static char *info_kbuf = NULL;
1020
1021/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1022/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1023/*
1024 * mptscsih_probe - Installs scsi devices per bus.
1025 * @pdev: Pointer to pci_dev structure
1026 *
1027 * Returns 0 for success, non-zero for failure.
1028 *
1029 */
1030
1031static int
1032mptscsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1033{
1034 struct Scsi_Host *sh;
1035 MPT_SCSI_HOST *hd; 929 MPT_SCSI_HOST *hd;
1036 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1037 unsigned long flags;
1038 int sz, ii;
1039 int numSGE = 0;
1040 int scale;
1041 int ioc_cap;
1042 u8 *mem;
1043 int error=0;
1044
1045
1046 /* 20010202 -sralston
1047 * Added sanity check on readiness of the MPT adapter.
1048 */
1049 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
1050 printk(MYIOC_s_WARN_FMT
1051 "Skipping because it's not operational!\n",
1052 ioc->name);
1053 return -ENODEV;
1054 }
1055
1056 if (!ioc->active) {
1057 printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
1058 ioc->name);
1059 return -ENODEV;
1060 }
1061
1062 /* Sanity check - ensure at least 1 port is INITIATOR capable
1063 */
1064 ioc_cap = 0;
1065 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
1066 if (ioc->pfacts[ii].ProtocolFlags &
1067 MPI_PORTFACTS_PROTOCOL_INITIATOR)
1068 ioc_cap ++;
1069 }
1070
1071 if (!ioc_cap) {
1072 printk(MYIOC_s_WARN_FMT
1073 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n",
1074 ioc->name, ioc);
1075 return -ENODEV;
1076 }
1077
1078 sh = scsi_host_alloc(&driver_template, sizeof(MPT_SCSI_HOST));
1079
1080 if (!sh) {
1081 printk(MYIOC_s_WARN_FMT
1082 "Unable to register controller with SCSI subsystem\n",
1083 ioc->name);
1084 return -1;
1085 }
1086
1087 spin_lock_irqsave(&ioc->FreeQlock, flags);
1088
1089 /* Attach the SCSI Host to the IOC structure
1090 */
1091 ioc->sh = sh;
1092
1093 sh->io_port = 0;
1094 sh->n_io_port = 0;
1095 sh->irq = 0;
1096
1097 /* set 16 byte cdb's */
1098 sh->max_cmd_len = 16;
1099
1100 /* Yikes! This is important!
1101 * Otherwise, by default, linux
1102 * only scans target IDs 0-7!
1103 * pfactsN->MaxDevices unreliable
1104 * (not supported in early
1105 * versions of the FW).
1106 * max_id = 1 + actual max id,
1107 * max_lun = 1 + actual last lun,
1108 * see hosts.h :o(
1109 */
1110 if (ioc->bus_type == SCSI) {
1111 sh->max_id = MPT_MAX_SCSI_DEVICES;
1112 } else {
1113 /* For FC, increase the queue depth
1114 * from MPT_SCSI_CAN_QUEUE (31)
1115 * to MPT_FC_CAN_QUEUE (63).
1116 */
1117 sh->can_queue = MPT_FC_CAN_QUEUE;
1118 sh->max_id =
1119 MPT_MAX_FC_DEVICES<256 ? MPT_MAX_FC_DEVICES : 255;
1120 }
1121
1122 sh->max_lun = MPT_LAST_LUN + 1;
1123 sh->max_channel = 0;
1124 sh->this_id = ioc->pfacts[0].PortSCSIID;
1125
1126 /* Required entry.
1127 */
1128 sh->unique_id = ioc->id;
1129
1130 /* Verify that we won't exceed the maximum
1131 * number of chain buffers
1132 * We can optimize: ZZ = req_sz/sizeof(SGE)
1133 * For 32bit SGE's:
1134 * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
1135 * + (req_sz - 64)/sizeof(SGE)
1136 * A slightly different algorithm is required for
1137 * 64bit SGEs.
1138 */
1139 scale = ioc->req_sz/(sizeof(dma_addr_t) + sizeof(u32));
1140 if (sizeof(dma_addr_t) == sizeof(u64)) {
1141 numSGE = (scale - 1) *
1142 (ioc->facts.MaxChainDepth-1) + scale +
1143 (ioc->req_sz - 60) / (sizeof(dma_addr_t) +
1144 sizeof(u32));
1145 } else {
1146 numSGE = 1 + (scale - 1) *
1147 (ioc->facts.MaxChainDepth-1) + scale +
1148 (ioc->req_sz - 64) / (sizeof(dma_addr_t) +
1149 sizeof(u32));
1150 }
1151
1152 if (numSGE < sh->sg_tablesize) {
1153 /* Reset this value */
1154 dprintk((MYIOC_s_INFO_FMT
1155 "Resetting sg_tablesize to %d from %d\n",
1156 ioc->name, numSGE, sh->sg_tablesize));
1157 sh->sg_tablesize = numSGE;
1158 }
1159
1160 /* Set the pci device pointer in Scsi_Host structure.
1161 */
1162 scsi_set_device(sh, &ioc->pcidev->dev);
1163
1164 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
1165
1166 hd = (MPT_SCSI_HOST *) sh->hostdata;
1167 hd->ioc = ioc;
1168
1169 /* SCSI needs scsi_cmnd lookup table!
1170 * (with size equal to req_depth*PtrSz!)
1171 */
1172 sz = ioc->req_depth * sizeof(void *);
1173 mem = kmalloc(sz, GFP_ATOMIC);
1174 if (mem == NULL) {
1175 error = -ENOMEM;
1176 goto mptscsih_probe_failed;
1177 }
1178
1179 memset(mem, 0, sz);
1180 hd->ScsiLookup = (struct scsi_cmnd **) mem;
1181
1182 dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
1183 ioc->name, hd->ScsiLookup, sz));
1184
1185 /* Allocate memory for the device structures.
1186 * A non-Null pointer at an offset
1187 * indicates a device exists.
1188 * max_id = 1 + maximum id (hosts.h)
1189 */
1190 sz = sh->max_id * sizeof(void *);
1191 mem = kmalloc(sz, GFP_ATOMIC);
1192 if (mem == NULL) {
1193 error = -ENOMEM;
1194 goto mptscsih_probe_failed;
1195 }
1196
1197 memset(mem, 0, sz);
1198 hd->Targets = (VirtDevice **) mem;
1199
1200 dprintk((KERN_INFO
1201 " Targets @ %p, sz=%d\n", hd->Targets, sz));
1202
1203 /* Clear the TM flags
1204 */
1205 hd->tmPending = 0;
1206 hd->tmState = TM_STATE_NONE;
1207 hd->resetPending = 0;
1208 hd->abortSCpnt = NULL;
1209
1210 /* Clear the pointer used to store
1211 * single-threaded commands, i.e., those
1212 * issued during a bus scan, dv and
1213 * configuration pages.
1214 */
1215 hd->cmdPtr = NULL;
1216 930
1217 /* Initialize this SCSI Hosts' timers 931 if (sc->device == NULL)
1218 * To use, set the timer expires field 932 return;
1219 * and add_timer 933 if (sc->device->host == NULL)
1220 */ 934 return;
1221 init_timer(&hd->timer); 935 if ((hd = (MPT_SCSI_HOST *)sc->device->host->hostdata) == NULL)
1222 hd->timer.data = (unsigned long) hd; 936 return;
1223 hd->timer.function = mptscsih_timer_expired;
1224
1225 if (ioc->bus_type == SCSI) {
1226 /* Update with the driver setup
1227 * values.
1228 */
1229 if (ioc->spi_data.maxBusWidth > mpt_width)
1230 ioc->spi_data.maxBusWidth = mpt_width;
1231 if (ioc->spi_data.minSyncFactor < mpt_factor)
1232 ioc->spi_data.minSyncFactor = mpt_factor;
1233
1234 if (ioc->spi_data.minSyncFactor == MPT_ASYNC) {
1235 ioc->spi_data.maxSyncOffset = 0;
1236 }
1237
1238 ioc->spi_data.Saf_Te = mpt_saf_te;
1239
1240 hd->negoNvram = 0;
1241#ifndef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
1242 hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
1243#endif
1244 ioc->spi_data.forceDv = 0;
1245 ioc->spi_data.noQas = 0;
1246 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
1247 ioc->spi_data.dvStatus[ii] =
1248 MPT_SCSICFG_NEGOTIATE;
1249 }
1250
1251 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
1252 ioc->spi_data.dvStatus[ii] |=
1253 MPT_SCSICFG_DV_NOT_DONE;
1254
1255 dinitprintk((MYIOC_s_INFO_FMT
1256 "dv %x width %x factor %x saf_te %x\n",
1257 ioc->name, mpt_dv,
1258 mpt_width,
1259 mpt_factor,
1260 mpt_saf_te));
1261 }
1262
1263 mpt_scsi_hosts++;
1264 937
1265 error = scsi_add_host (sh, &ioc->pcidev->dev); 938 if (time - hd->last_queue_full > 10 * HZ) {
1266 if(error) { 939 dprintk((MYIOC_s_WARN_FMT "Device (%d:%d:%d) reported QUEUE_FULL!\n",
1267 dprintk((KERN_ERR MYNAM 940 hd->ioc->name, 0, sc->device->id, sc->device->lun));
1268 "scsi_add_host failed\n")); 941 hd->last_queue_full = time;
1269 goto mptscsih_probe_failed;
1270 } 942 }
1271
1272 scsi_scan_host(sh);
1273 return 0;
1274
1275mptscsih_probe_failed:
1276
1277 mptscsih_remove(pdev);
1278 return error;
1279
1280} 943}
1281 944
1282/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 945/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1286,7 +949,7 @@ mptscsih_probe_failed:
1286 * 949 *
1287 * 950 *
1288 */ 951 */
1289static void 952void
1290mptscsih_remove(struct pci_dev *pdev) 953mptscsih_remove(struct pci_dev *pdev)
1291{ 954{
1292 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 955 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
@@ -1294,12 +957,16 @@ mptscsih_remove(struct pci_dev *pdev)
1294 MPT_SCSI_HOST *hd; 957 MPT_SCSI_HOST *hd;
1295 int count; 958 int count;
1296 unsigned long flags; 959 unsigned long flags;
960 int sz1;
1297 961
1298 if(!host) 962 if(!host)
1299 return; 963 return;
1300 964
1301 scsi_remove_host(host); 965 scsi_remove_host(host);
1302 966
967 if((hd = (MPT_SCSI_HOST *)host->hostdata) == NULL)
968 return;
969
1303#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION 970#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
1304 /* Check DV thread active */ 971 /* Check DV thread active */
1305 count = 10 * HZ; 972 count = 10 * HZ;
@@ -1321,40 +988,36 @@ mptscsih_remove(struct pci_dev *pdev)
1321#endif 988#endif
1322#endif 989#endif
1323 990
1324 hd = (MPT_SCSI_HOST *)host->hostdata; 991 mptscsih_shutdown(&pdev->dev);
1325 if (hd != NULL) {
1326 int sz1;
1327 992
1328 mptscsih_shutdown(&pdev->dev); 993 sz1=0;
1329 994
1330 sz1=0; 995 if (hd->ScsiLookup != NULL) {
996 sz1 = hd->ioc->req_depth * sizeof(void *);
997 kfree(hd->ScsiLookup);
998 hd->ScsiLookup = NULL;
999 }
1331 1000
1332 if (hd->ScsiLookup != NULL) { 1001 /*
1333 sz1 = hd->ioc->req_depth * sizeof(void *); 1002 * Free pointer array.
1334 kfree(hd->ScsiLookup); 1003 */
1335 hd->ScsiLookup = NULL; 1004 kfree(hd->Targets);
1336 } 1005 hd->Targets = NULL;
1337 1006
1338 if (hd->Targets != NULL) { 1007 dprintk((MYIOC_s_INFO_FMT
1339 /* 1008 "Free'd ScsiLookup (%d) memory\n",
1340 * Free pointer array. 1009 hd->ioc->name, sz1));
1341 */
1342 kfree(hd->Targets);
1343 hd->Targets = NULL;
1344 }
1345 1010
1346 dprintk((MYIOC_s_INFO_FMT 1011 kfree(hd->info_kbuf);
1347 "Free'd ScsiLookup (%d) memory\n",
1348 hd->ioc->name, sz1));
1349 1012
1350 /* NULL the Scsi_Host pointer 1013 /* NULL the Scsi_Host pointer
1351 */ 1014 */
1352 hd->ioc->sh = NULL; 1015 hd->ioc->sh = NULL;
1353 }
1354 1016
1355 scsi_host_put(host); 1017 scsi_host_put(host);
1356 mpt_scsi_hosts--;
1357 1018
1019 mpt_detach(pdev);
1020
1358} 1021}
1359 1022
1360/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1023/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1362,7 +1025,7 @@ mptscsih_remove(struct pci_dev *pdev)
1362 * mptscsih_shutdown - reboot notifier 1025 * mptscsih_shutdown - reboot notifier
1363 * 1026 *
1364 */ 1027 */
1365static void 1028void
1366mptscsih_shutdown(struct device * dev) 1029mptscsih_shutdown(struct device * dev)
1367{ 1030{
1368 MPT_ADAPTER *ioc = pci_get_drvdata(to_pci_dev(dev)); 1031 MPT_ADAPTER *ioc = pci_get_drvdata(to_pci_dev(dev));
@@ -1384,15 +1047,15 @@ mptscsih_shutdown(struct device * dev)
1384#ifdef CONFIG_PM 1047#ifdef CONFIG_PM
1385/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1048/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1386/* 1049/*
1387 * mptscsih_suspend - Fusion MPT scsie driver suspend routine. 1050 * mptscsih_suspend - Fusion MPT scsi driver suspend routine.
1388 * 1051 *
1389 * 1052 *
1390 */ 1053 */
1391static int 1054int
1392mptscsih_suspend(struct pci_dev *pdev, pm_message_t state) 1055mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
1393{ 1056{
1394 mptscsih_shutdown(&pdev->dev); 1057 mptscsih_shutdown(&pdev->dev);
1395 return 0; 1058 return mpt_suspend(pdev,state);
1396} 1059}
1397 1060
1398/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1061/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1401,13 +1064,15 @@ mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
1401 * 1064 *
1402 * 1065 *
1403 */ 1066 */
1404static int 1067int
1405mptscsih_resume(struct pci_dev *pdev) 1068mptscsih_resume(struct pci_dev *pdev)
1406{ 1069{
1407 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1070 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1408 struct Scsi_Host *host = ioc->sh; 1071 struct Scsi_Host *host = ioc->sh;
1409 MPT_SCSI_HOST *hd; 1072 MPT_SCSI_HOST *hd;
1410 1073
1074 mpt_resume(pdev);
1075
1411 if(!host) 1076 if(!host)
1412 return 0; 1077 return 0;
1413 1078
@@ -1422,9 +1087,9 @@ mptscsih_resume(struct pci_dev *pdev)
1422 if (!dvtaskQ_active) { 1087 if (!dvtaskQ_active) {
1423 dvtaskQ_active = 1; 1088 dvtaskQ_active = 1;
1424 spin_unlock_irqrestore(&dvtaskQ_lock, lflags); 1089 spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
1425 INIT_WORK(&mptscsih_dvTask, 1090 INIT_WORK(&dvTaskQ_task,
1426 mptscsih_domainValidation, (void *) hd); 1091 mptscsih_domainValidation, (void *) hd);
1427 schedule_work(&mptscsih_dvTask); 1092 schedule_work(&dvTaskQ_task);
1428 } else { 1093 } else {
1429 spin_unlock_irqrestore(&dvtaskQ_lock, lflags); 1094 spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
1430 } 1095 }
@@ -1435,82 +1100,6 @@ mptscsih_resume(struct pci_dev *pdev)
1435 1100
1436#endif 1101#endif
1437 1102
1438static struct mpt_pci_driver mptscsih_driver = {
1439 .probe = mptscsih_probe,
1440 .remove = mptscsih_remove,
1441 .shutdown = mptscsih_shutdown,
1442#ifdef CONFIG_PM
1443 .suspend = mptscsih_suspend,
1444 .resume = mptscsih_resume,
1445#endif
1446};
1447
1448/* SCSI host fops start here... */
1449/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1450/**
1451 * mptscsih_init - Register MPT adapter(s) as SCSI host(s) with
1452 * linux scsi mid-layer.
1453 *
1454 * Returns 0 for success, non-zero for failure.
1455 */
1456static int __init
1457mptscsih_init(void)
1458{
1459
1460 show_mptmod_ver(my_NAME, my_VERSION);
1461
1462 ScsiDoneCtx = mpt_register(mptscsih_io_done, MPTSCSIH_DRIVER);
1463 ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSCSIH_DRIVER);
1464 ScsiScanDvCtx = mpt_register(mptscsih_scandv_complete, MPTSCSIH_DRIVER);
1465
1466 if (mpt_event_register(ScsiDoneCtx, mptscsih_event_process) == 0) {
1467 devtprintk((KERN_INFO MYNAM
1468 ": Registered for IOC event notifications\n"));
1469 }
1470
1471 if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) == 0) {
1472 dprintk((KERN_INFO MYNAM
1473 ": Registered for IOC reset notifications\n"));
1474 }
1475
1476 if(mpt_device_driver_register(&mptscsih_driver,
1477 MPTSCSIH_DRIVER) != 0 ) {
1478 dprintk((KERN_INFO MYNAM
1479 ": failed to register dd callbacks\n"));
1480 }
1481
1482 return 0;
1483
1484}
1485
1486/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1487/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1488/**
1489 * mptscsih_exit - Unregisters MPT adapter(s)
1490 *
1491 */
1492static void __exit
1493mptscsih_exit(void)
1494{
1495 mpt_device_driver_deregister(MPTSCSIH_DRIVER);
1496
1497 mpt_reset_deregister(ScsiDoneCtx);
1498 dprintk((KERN_INFO MYNAM
1499 ": Deregistered for IOC reset notifications\n"));
1500
1501 mpt_event_deregister(ScsiDoneCtx);
1502 dprintk((KERN_INFO MYNAM
1503 ": Deregistered for IOC event notifications\n"));
1504
1505 mpt_deregister(ScsiScanDvCtx);
1506 mpt_deregister(ScsiTaskCtx);
1507 mpt_deregister(ScsiDoneCtx);
1508
1509 if (info_kbuf != NULL)
1510 kfree(info_kbuf);
1511
1512}
1513
1514/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1103/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1515/** 1104/**
1516 * mptscsih_info - Return information about MPT adapter 1105 * mptscsih_info - Return information about MPT adapter
@@ -1520,24 +1109,25 @@ mptscsih_exit(void)
1520 * 1109 *
1521 * Returns pointer to buffer where information was written. 1110 * Returns pointer to buffer where information was written.
1522 */ 1111 */
1523static const char * 1112const char *
1524mptscsih_info(struct Scsi_Host *SChost) 1113mptscsih_info(struct Scsi_Host *SChost)
1525{ 1114{
1526 MPT_SCSI_HOST *h; 1115 MPT_SCSI_HOST *h;
1527 int size = 0; 1116 int size = 0;
1528 1117
1529 if (info_kbuf == NULL)
1530 if ((info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL)
1531 return info_kbuf;
1532
1533 h = (MPT_SCSI_HOST *)SChost->hostdata; 1118 h = (MPT_SCSI_HOST *)SChost->hostdata;
1534 info_kbuf[0] = '\0'; 1119
1535 if (h) { 1120 if (h) {
1536 mpt_print_ioc_summary(h->ioc, info_kbuf, &size, 0, 0); 1121 if (h->info_kbuf == NULL)
1537 info_kbuf[size-1] = '\0'; 1122 if ((h->info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL)
1123 return h->info_kbuf;
1124 h->info_kbuf[0] = '\0';
1125
1126 mpt_print_ioc_summary(h->ioc, h->info_kbuf, &size, 0, 0);
1127 h->info_kbuf[size-1] = '\0';
1538 } 1128 }
1539 1129
1540 return info_kbuf; 1130 return h->info_kbuf;
1541} 1131}
1542 1132
1543struct info_str { 1133struct info_str {
@@ -1547,7 +1137,8 @@ struct info_str {
1547 int pos; 1137 int pos;
1548}; 1138};
1549 1139
1550static void copy_mem_info(struct info_str *info, char *data, int len) 1140static void
1141mptscsih_copy_mem_info(struct info_str *info, char *data, int len)
1551{ 1142{
1552 if (info->pos + len > info->length) 1143 if (info->pos + len > info->length)
1553 len = info->length - info->pos; 1144 len = info->length - info->pos;
@@ -1568,7 +1159,8 @@ static void copy_mem_info(struct info_str *info, char *data, int len)
1568 } 1159 }
1569} 1160}
1570 1161
1571static int copy_info(struct info_str *info, char *fmt, ...) 1162static int
1163mptscsih_copy_info(struct info_str *info, char *fmt, ...)
1572{ 1164{
1573 va_list args; 1165 va_list args;
1574 char buf[81]; 1166 char buf[81];
@@ -1578,11 +1170,12 @@ static int copy_info(struct info_str *info, char *fmt, ...)
1578 len = vsprintf(buf, fmt, args); 1170 len = vsprintf(buf, fmt, args);
1579 va_end(args); 1171 va_end(args);
1580 1172
1581 copy_mem_info(info, buf, len); 1173 mptscsih_copy_mem_info(info, buf, len);
1582 return len; 1174 return len;
1583} 1175}
1584 1176
1585static int mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int len) 1177static int
1178mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int len)
1586{ 1179{
1587 struct info_str info; 1180 struct info_str info;
1588 1181
@@ -1591,10 +1184,10 @@ static int mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int le
1591 info.offset = offset; 1184 info.offset = offset;
1592 info.pos = 0; 1185 info.pos = 0;
1593 1186
1594 copy_info(&info, "%s: %s, ", ioc->name, ioc->prod_name); 1187 mptscsih_copy_info(&info, "%s: %s, ", ioc->name, ioc->prod_name);
1595 copy_info(&info, "%s%08xh, ", MPT_FW_REV_MAGIC_ID_STRING, ioc->facts.FWVersion.Word); 1188 mptscsih_copy_info(&info, "%s%08xh, ", MPT_FW_REV_MAGIC_ID_STRING, ioc->facts.FWVersion.Word);
1596 copy_info(&info, "Ports=%d, ", ioc->facts.NumberOfPorts); 1189 mptscsih_copy_info(&info, "Ports=%d, ", ioc->facts.NumberOfPorts);
1597 copy_info(&info, "MaxQ=%d\n", ioc->req_depth); 1190 mptscsih_copy_info(&info, "MaxQ=%d\n", ioc->req_depth);
1598 1191
1599 return ((info.pos > info.offset) ? info.pos - info.offset : 0); 1192 return ((info.pos > info.offset) ? info.pos - info.offset : 0);
1600} 1193}
@@ -1612,7 +1205,7 @@ static int mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int le
1612 * hostno: scsi host number 1205 * hostno: scsi host number
1613 * func: if write = 1; if read = 0 1206 * func: if write = 1; if read = 0
1614 */ 1207 */
1615static int 1208int
1616mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, 1209mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
1617 int length, int func) 1210 int length, int func)
1618{ 1211{
@@ -1649,7 +1242,7 @@ mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t off
1649 * 1242 *
1650 * Returns 0. (rtn value discarded by linux scsi mid-layer) 1243 * Returns 0. (rtn value discarded by linux scsi mid-layer)
1651 */ 1244 */
1652static int 1245int
1653mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1246mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1654{ 1247{
1655 MPT_SCSI_HOST *hd; 1248 MPT_SCSI_HOST *hd;
@@ -1684,7 +1277,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1684 /* 1277 /*
1685 * Put together a MPT SCSI request... 1278 * Put together a MPT SCSI request...
1686 */ 1279 */
1687 if ((mf = mpt_get_msg_frame(ScsiDoneCtx, hd->ioc)) == NULL) { 1280 if ((mf = mpt_get_msg_frame(hd->ioc->DoneCtx, hd->ioc)) == NULL) {
1688 dprintk((MYIOC_s_WARN_FMT "QueueCmd, no msg frames!!\n", 1281 dprintk((MYIOC_s_WARN_FMT "QueueCmd, no msg frames!!\n",
1689 hd->ioc->name)); 1282 hd->ioc->name));
1690 return SCSI_MLQUEUE_HOST_BUSY; 1283 return SCSI_MLQUEUE_HOST_BUSY;
@@ -1696,8 +1289,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1696 1289
1697 ADD_INDEX_LOG(my_idx); 1290 ADD_INDEX_LOG(my_idx);
1698 1291
1699 /* BUG FIX! 19991030 -sralston 1292 /* TUR's being issued with scsictl=0x02000000 (DATA_IN)!
1700 * TUR's being issued with scsictl=0x02000000 (DATA_IN)!
1701 * Seems we may receive a buffer (datalen>0) even when there 1293 * Seems we may receive a buffer (datalen>0) even when there
1702 * will be no data transfer! GRRRRR... 1294 * will be no data transfer! GRRRRR...
1703 */ 1295 */
@@ -1791,9 +1383,9 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1791 if (!dvtaskQ_active) { 1383 if (!dvtaskQ_active) {
1792 dvtaskQ_active = 1; 1384 dvtaskQ_active = 1;
1793 spin_unlock_irqrestore(&dvtaskQ_lock, lflags); 1385 spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
1794 INIT_WORK(&mptscsih_dvTask, mptscsih_domainValidation, (void *) hd); 1386 INIT_WORK(&dvTaskQ_task, mptscsih_domainValidation, (void *) hd);
1795 1387
1796 schedule_work(&mptscsih_dvTask); 1388 schedule_work(&dvTaskQ_task);
1797 } else { 1389 } else {
1798 spin_unlock_irqrestore(&dvtaskQ_lock, lflags); 1390 spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
1799 } 1391 }
@@ -1819,7 +1411,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1819 } 1411 }
1820#endif 1412#endif
1821 1413
1822 mpt_put_msg_frame(ScsiDoneCtx, hd->ioc, mf); 1414 mpt_put_msg_frame(hd->ioc->DoneCtx, hd->ioc, mf);
1823 dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n", 1415 dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n",
1824 hd->ioc->name, SCpnt, mf, my_idx)); 1416 hd->ioc->name, SCpnt, mf, my_idx));
1825 DBG_DUMP_REQUEST_FRAME(mf) 1417 DBG_DUMP_REQUEST_FRAME(mf)
@@ -2036,7 +1628,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
2036 1628
2037 /* Return Fail to calling function if no message frames available. 1629 /* Return Fail to calling function if no message frames available.
2038 */ 1630 */
2039 if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc)) == NULL) { 1631 if ((mf = mpt_get_msg_frame(hd->ioc->TaskCtx, hd->ioc)) == NULL) {
2040 dfailprintk((MYIOC_s_ERR_FMT "IssueTaskMgmt, no msg frames!!\n", 1632 dfailprintk((MYIOC_s_ERR_FMT "IssueTaskMgmt, no msg frames!!\n",
2041 hd->ioc->name)); 1633 hd->ioc->name));
2042 //return FAILED; 1634 //return FAILED;
@@ -2075,7 +1667,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
2075 1667
2076 DBG_DUMP_TM_REQUEST_FRAME((u32 *)pScsiTm); 1668 DBG_DUMP_TM_REQUEST_FRAME((u32 *)pScsiTm);
2077 1669
2078 if ((retval = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc, 1670 if ((retval = mpt_send_handshake_request(hd->ioc->TaskCtx, hd->ioc,
2079 sizeof(SCSITaskMgmt_t), (u32*)pScsiTm, 1671 sizeof(SCSITaskMgmt_t), (u32*)pScsiTm,
2080 CAN_SLEEP)) != 0) { 1672 CAN_SLEEP)) != 0) {
2081 dfailprintk((MYIOC_s_ERR_FMT "_send_handshake FAILED!" 1673 dfailprintk((MYIOC_s_ERR_FMT "_send_handshake FAILED!"
@@ -2107,7 +1699,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
2107 * 1699 *
2108 * Returns SUCCESS or FAILED. 1700 * Returns SUCCESS or FAILED.
2109 */ 1701 */
2110static int 1702int
2111mptscsih_abort(struct scsi_cmnd * SCpnt) 1703mptscsih_abort(struct scsi_cmnd * SCpnt)
2112{ 1704{
2113 MPT_SCSI_HOST *hd; 1705 MPT_SCSI_HOST *hd;
@@ -2115,7 +1707,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2115 MPT_FRAME_HDR *mf; 1707 MPT_FRAME_HDR *mf;
2116 u32 ctx2abort; 1708 u32 ctx2abort;
2117 int scpnt_idx; 1709 int scpnt_idx;
2118 spinlock_t *host_lock = SCpnt->device->host->host_lock;
2119 1710
2120 /* If we can't locate our host adapter structure, return FAILED status. 1711 /* If we can't locate our host adapter structure, return FAILED status.
2121 */ 1712 */
@@ -2163,7 +1754,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2163 1754
2164 hd->abortSCpnt = SCpnt; 1755 hd->abortSCpnt = SCpnt;
2165 1756
2166 spin_unlock_irq(host_lock);
2167 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, 1757 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
2168 SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun, 1758 SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun,
2169 ctx2abort, 2 /* 2 second timeout */) 1759 ctx2abort, 2 /* 2 second timeout */)
@@ -2180,8 +1770,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2180 hd->tmPending = 0; 1770 hd->tmPending = 0;
2181 hd->tmState = TM_STATE_NONE; 1771 hd->tmState = TM_STATE_NONE;
2182 1772
2183 spin_lock_irq(host_lock);
2184
2185 /* Unmap the DMA buffers, if any. */ 1773 /* Unmap the DMA buffers, if any. */
2186 if (SCpnt->use_sg) { 1774 if (SCpnt->use_sg) {
2187 pci_unmap_sg(ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer, 1775 pci_unmap_sg(ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer,
@@ -2197,7 +1785,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2197 mpt_free_msg_frame(ioc, mf); 1785 mpt_free_msg_frame(ioc, mf);
2198 return FAILED; 1786 return FAILED;
2199 } 1787 }
2200 spin_lock_irq(host_lock);
2201 return SUCCESS; 1788 return SUCCESS;
2202} 1789}
2203 1790
@@ -2210,11 +1797,10 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2210 * 1797 *
2211 * Returns SUCCESS or FAILED. 1798 * Returns SUCCESS or FAILED.
2212 */ 1799 */
2213static int 1800int
2214mptscsih_dev_reset(struct scsi_cmnd * SCpnt) 1801mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
2215{ 1802{
2216 MPT_SCSI_HOST *hd; 1803 MPT_SCSI_HOST *hd;
2217 spinlock_t *host_lock = SCpnt->device->host->host_lock;
2218 1804
2219 /* If we can't locate our host adapter structure, return FAILED status. 1805 /* If we can't locate our host adapter structure, return FAILED status.
2220 */ 1806 */
@@ -2231,7 +1817,6 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
2231 printk(KERN_WARNING MYNAM ": %s: >> Attempting target reset! (sc=%p)\n", 1817 printk(KERN_WARNING MYNAM ": %s: >> Attempting target reset! (sc=%p)\n",
2232 hd->ioc->name, SCpnt); 1818 hd->ioc->name, SCpnt);
2233 1819
2234 spin_unlock_irq(host_lock);
2235 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 1820 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
2236 SCpnt->device->channel, SCpnt->device->id, 1821 SCpnt->device->channel, SCpnt->device->id,
2237 0, 0, 5 /* 5 second timeout */) 1822 0, 0, 5 /* 5 second timeout */)
@@ -2243,12 +1828,10 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
2243 hd->ioc->name, SCpnt); 1828 hd->ioc->name, SCpnt);
2244 hd->tmPending = 0; 1829 hd->tmPending = 0;
2245 hd->tmState = TM_STATE_NONE; 1830 hd->tmState = TM_STATE_NONE;
2246 spin_lock_irq(host_lock);
2247 return FAILED; 1831 return FAILED;
2248 } 1832 }
2249 spin_lock_irq(host_lock);
2250 return SUCCESS;
2251 1833
1834 return SUCCESS;
2252} 1835}
2253 1836
2254/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1837/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -2260,7 +1843,7 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
2260 * 1843 *
2261 * Returns SUCCESS or FAILED. 1844 * Returns SUCCESS or FAILED.
2262 */ 1845 */
2263static int 1846int
2264mptscsih_bus_reset(struct scsi_cmnd * SCpnt) 1847mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
2265{ 1848{
2266 MPT_SCSI_HOST *hd; 1849 MPT_SCSI_HOST *hd;
@@ -2282,7 +1865,6 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
2282 hd->timeouts++; 1865 hd->timeouts++;
2283 1866
2284 /* We are now ready to execute the task management request. */ 1867 /* We are now ready to execute the task management request. */
2285 spin_unlock_irq(host_lock);
2286 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, 1868 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS,
2287 SCpnt->device->channel, 0, 0, 0, 5 /* 5 second timeout */) 1869 SCpnt->device->channel, 0, 0, 0, 5 /* 5 second timeout */)
2288 < 0){ 1870 < 0){
@@ -2298,7 +1880,7 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
2298 spin_lock_irq(host_lock); 1880 spin_lock_irq(host_lock);
2299 return FAILED; 1881 return FAILED;
2300 } 1882 }
2301 spin_lock_irq(host_lock); 1883
2302 return SUCCESS; 1884 return SUCCESS;
2303} 1885}
2304 1886
@@ -2312,12 +1894,11 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
2312 * 1894 *
2313 * Returns SUCCESS or FAILED. 1895 * Returns SUCCESS or FAILED.
2314 */ 1896 */
2315static int 1897int
2316mptscsih_host_reset(struct scsi_cmnd *SCpnt) 1898mptscsih_host_reset(struct scsi_cmnd *SCpnt)
2317{ 1899{
2318 MPT_SCSI_HOST * hd; 1900 MPT_SCSI_HOST * hd;
2319 int status = SUCCESS; 1901 int status = SUCCESS;
2320 spinlock_t *host_lock = SCpnt->device->host->host_lock;
2321 1902
2322 /* If we can't locate the host to reset, then we failed. */ 1903 /* If we can't locate the host to reset, then we failed. */
2323 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ 1904 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
@@ -2333,7 +1914,6 @@ mptscsih_host_reset(struct scsi_cmnd *SCpnt)
2333 /* If our attempts to reset the host failed, then return a failed 1914 /* If our attempts to reset the host failed, then return a failed
2334 * status. The host will be taken off line by the SCSI mid-layer. 1915 * status. The host will be taken off line by the SCSI mid-layer.
2335 */ 1916 */
2336 spin_unlock_irq(host_lock);
2337 if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0){ 1917 if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0){
2338 status = FAILED; 1918 status = FAILED;
2339 } else { 1919 } else {
@@ -2343,8 +1923,6 @@ mptscsih_host_reset(struct scsi_cmnd *SCpnt)
2343 hd->tmPending = 0; 1923 hd->tmPending = 0;
2344 hd->tmState = TM_STATE_NONE; 1924 hd->tmState = TM_STATE_NONE;
2345 } 1925 }
2346 spin_lock_irq(host_lock);
2347
2348 1926
2349 dtmprintk( ( KERN_WARNING MYNAM ": mptscsih_host_reset: " 1927 dtmprintk( ( KERN_WARNING MYNAM ": mptscsih_host_reset: "
2350 "Status = %s\n", 1928 "Status = %s\n",
@@ -2426,7 +2004,7 @@ mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout )
2426 * 2004 *
2427 * Returns 1 indicating alloc'd request frame ptr should be freed. 2005 * Returns 1 indicating alloc'd request frame ptr should be freed.
2428 */ 2006 */
2429static int 2007int
2430mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) 2008mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
2431{ 2009{
2432 SCSITaskMgmtReply_t *pScsiTmReply; 2010 SCSITaskMgmtReply_t *pScsiTmReply;
@@ -2509,7 +2087,7 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m
2509/* 2087/*
2510 * This is anyones guess quite frankly. 2088 * This is anyones guess quite frankly.
2511 */ 2089 */
2512static int 2090int
2513mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, 2091mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev,
2514 sector_t capacity, int geom[]) 2092 sector_t capacity, int geom[])
2515{ 2093{
@@ -2556,7 +2134,7 @@ mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev,
2556 * Return non-zero if allocation fails. 2134 * Return non-zero if allocation fails.
2557 * Init memory once per id (not LUN). 2135 * Init memory once per id (not LUN).
2558 */ 2136 */
2559static int 2137int
2560mptscsih_slave_alloc(struct scsi_device *device) 2138mptscsih_slave_alloc(struct scsi_device *device)
2561{ 2139{
2562 struct Scsi_Host *host = device->host; 2140 struct Scsi_Host *host = device->host;
@@ -2599,7 +2177,8 @@ mptscsih_slave_alloc(struct scsi_device *device)
2599 return 0; 2177 return 0;
2600} 2178}
2601 2179
2602static int mptscsih_is_raid_volume(MPT_SCSI_HOST *hd, uint id) 2180static int
2181mptscsih_is_raid_volume(MPT_SCSI_HOST *hd, uint id)
2603{ 2182{
2604 int i; 2183 int i;
2605 2184
@@ -2618,7 +2197,7 @@ static int mptscsih_is_raid_volume(MPT_SCSI_HOST *hd, uint id)
2618 * OS entry point to allow for host driver to free allocated memory 2197 * OS entry point to allow for host driver to free allocated memory
2619 * Called if no device present or device being unloaded 2198 * Called if no device present or device being unloaded
2620 */ 2199 */
2621static void 2200void
2622mptscsih_slave_destroy(struct scsi_device *device) 2201mptscsih_slave_destroy(struct scsi_device *device)
2623{ 2202{
2624 struct Scsi_Host *host = device->host; 2203 struct Scsi_Host *host = device->host;
@@ -2639,7 +2218,7 @@ mptscsih_slave_destroy(struct scsi_device *device)
2639 2218
2640 kfree(hd->Targets[target]); 2219 kfree(hd->Targets[target]);
2641 hd->Targets[target] = NULL; 2220 hd->Targets[target] = NULL;
2642 2221
2643 if (hd->ioc->bus_type == SCSI) { 2222 if (hd->ioc->bus_type == SCSI) {
2644 if (mptscsih_is_raid_volume(hd, target)) { 2223 if (mptscsih_is_raid_volume(hd, target)) {
2645 hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3; 2224 hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3;
@@ -2695,7 +2274,7 @@ mptscsih_set_queue_depth(struct scsi_device *device, MPT_SCSI_HOST *hd,
2695 * member to 1 if a device does not support Q tags. 2274 * member to 1 if a device does not support Q tags.
2696 * Return non-zero if fails. 2275 * Return non-zero if fails.
2697 */ 2276 */
2698static int 2277int
2699mptscsih_slave_configure(struct scsi_device *device) 2278mptscsih_slave_configure(struct scsi_device *device)
2700{ 2279{
2701 struct Scsi_Host *sh = device->host; 2280 struct Scsi_Host *sh = device->host;
@@ -2758,7 +2337,7 @@ slave_configure_exit:
2758 return 0; 2337 return 0;
2759} 2338}
2760 2339
2761static ssize_t 2340ssize_t
2762mptscsih_store_queue_depth(struct device *dev, const char *buf, size_t count) 2341mptscsih_store_queue_depth(struct device *dev, const char *buf, size_t count)
2763{ 2342{
2764 int depth; 2343 int depth;
@@ -2788,7 +2367,7 @@ mptscsih_store_queue_depth(struct device *dev, const char *buf, size_t count)
2788 * 2367 *
2789 */ 2368 */
2790static void 2369static void
2791copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply) 2370mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply)
2792{ 2371{
2793 VirtDevice *target; 2372 VirtDevice *target;
2794 SCSIIORequest_t *pReq; 2373 SCSIIORequest_t *pReq;
@@ -2854,7 +2433,7 @@ SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc)
2854} 2433}
2855 2434
2856/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 2435/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2857static int 2436int
2858mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) 2437mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
2859{ 2438{
2860 MPT_SCSI_HOST *hd; 2439 MPT_SCSI_HOST *hd;
@@ -2949,8 +2528,8 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
2949 */ 2528 */
2950 hd->pLocal = &hd->localReply; 2529 hd->pLocal = &hd->localReply;
2951 hd->pLocal->completion = MPT_SCANDV_DID_RESET; 2530 hd->pLocal->completion = MPT_SCANDV_DID_RESET;
2952 scandv_wait_done = 1; 2531 hd->scandv_wait_done = 1;
2953 wake_up(&scandv_waitq); 2532 wake_up(&hd->scandv_waitq);
2954 hd->cmdPtr = NULL; 2533 hd->cmdPtr = NULL;
2955 } 2534 }
2956 2535
@@ -2969,7 +2548,7 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
2969} 2548}
2970 2549
2971/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 2550/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2972static int 2551int
2973mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) 2552mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
2974{ 2553{
2975 MPT_SCSI_HOST *hd; 2554 MPT_SCSI_HOST *hd;
@@ -3085,42 +2664,6 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
3085 return 1; /* currently means nothing really */ 2664 return 1; /* currently means nothing really */
3086} 2665}
3087 2666
3088static struct device_attribute mptscsih_queue_depth_attr = {
3089 .attr = {
3090 .name = "queue_depth",
3091 .mode = S_IWUSR,
3092 },
3093 .store = mptscsih_store_queue_depth,
3094};
3095
3096static struct device_attribute *mptscsih_dev_attrs[] = {
3097 &mptscsih_queue_depth_attr,
3098 NULL,
3099};
3100
3101static struct scsi_host_template driver_template = {
3102 .proc_name = "mptscsih",
3103 .proc_info = mptscsih_proc_info,
3104 .name = "MPT SCSI Host",
3105 .info = mptscsih_info,
3106 .queuecommand = mptscsih_qcmd,
3107 .slave_alloc = mptscsih_slave_alloc,
3108 .slave_configure = mptscsih_slave_configure,
3109 .slave_destroy = mptscsih_slave_destroy,
3110 .eh_abort_handler = mptscsih_abort,
3111 .eh_device_reset_handler = mptscsih_dev_reset,
3112 .eh_bus_reset_handler = mptscsih_bus_reset,
3113 .eh_host_reset_handler = mptscsih_host_reset,
3114 .bios_param = mptscsih_bios_param,
3115 .can_queue = MPT_SCSI_CAN_QUEUE,
3116 .this_id = -1,
3117 .sg_tablesize = MPT_SCSI_SG_DEPTH,
3118 .max_sectors = 8192,
3119 .cmd_per_lun = 7,
3120 .use_clustering = ENABLE_CLUSTERING,
3121 .sdev_attrs = mptscsih_dev_attrs,
3122};
3123
3124/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 2667/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
3125/* 2668/*
3126 * mptscsih_initTarget - Target, LUN alloc/free functionality. 2669 * mptscsih_initTarget - Target, LUN alloc/free functionality.
@@ -3158,9 +2701,9 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *
3158 * around a bug in th emid-layer in some distributions in which the mid-layer will 2701 * around a bug in th emid-layer in some distributions in which the mid-layer will
3159 * continue to try to communicate to the LUN and evntually create a dummy LUN. 2702 * continue to try to communicate to the LUN and evntually create a dummy LUN.
3160 */ 2703 */
3161 if (mpt_pq_filter && dlen && (data[0] & 0xE0)) 2704 if (hd->mpt_pq_filter && dlen && (data[0] & 0xE0))
3162 data[0] |= 0x40; 2705 data[0] |= 0x40;
3163 2706
3164 /* Is LUN supported? If so, upper 2 bits will be 0 2707 /* Is LUN supported? If so, upper 2 bits will be 0
3165 * in first byte of inquiry data. 2708 * in first byte of inquiry data.
3166 */ 2709 */
@@ -3307,7 +2850,7 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56)
3307 ddvtprintk((KERN_INFO "Enabling QAS on id=%d due to ~TARGET_FLAGS_VALID_56!\n", id)); 2850 ddvtprintk((KERN_INFO "Enabling QAS on id=%d due to ~TARGET_FLAGS_VALID_56!\n", id));
3308 noQas = 0; 2851 noQas = 0;
3309 } 2852 }
3310 2853
3311 offset = pspi_data->maxSyncOffset; 2854 offset = pspi_data->maxSyncOffset;
3312 2855
3313 /* If RAID, never disable QAS 2856 /* If RAID, never disable QAS
@@ -3401,7 +2944,7 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56)
3401 if ( (vdev = hd->Targets[ii]) ) { 2944 if ( (vdev = hd->Targets[ii]) ) {
3402 vdev->negoFlags |= MPT_TARGET_NO_NEGO_QAS; 2945 vdev->negoFlags |= MPT_TARGET_NO_NEGO_QAS;
3403 mptscsih_writeSDP1(hd, 0, ii, vdev->negoFlags); 2946 mptscsih_writeSDP1(hd, 0, ii, vdev->negoFlags);
3404 } 2947 }
3405 } 2948 }
3406 } 2949 }
3407 } 2950 }
@@ -3426,14 +2969,15 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56)
3426 * Tapes, initTarget will set this flag on completion of Inquiry command. 2969 * Tapes, initTarget will set this flag on completion of Inquiry command.
3427 * Called only if DV_NOT_DONE flag is set 2970 * Called only if DV_NOT_DONE flag is set
3428 */ 2971 */
3429static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq) 2972static void
2973mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq)
3430{ 2974{
3431 u8 cmd; 2975 u8 cmd;
3432 ScsiCfgData *pSpi; 2976 ScsiCfgData *pSpi;
3433 2977
3434 ddvtprintk((" set_dvflags: id=%d lun=%d negoNvram=%x cmd=%x\n", 2978 ddvtprintk((" set_dvflags: id=%d lun=%d negoNvram=%x cmd=%x\n",
3435 pReq->TargetID, pReq->LUN[1], hd->negoNvram, pReq->CDB[0])); 2979 pReq->TargetID, pReq->LUN[1], hd->negoNvram, pReq->CDB[0]));
3436 2980
3437 if ((pReq->LUN[1] != 0) || (hd->negoNvram != 0)) 2981 if ((pReq->LUN[1] != 0) || (hd->negoNvram != 0))
3438 return; 2982 return;
3439 2983
@@ -3464,7 +3008,8 @@ static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq)
3464 * If no Target, bus reset on 1st I/O. Set the flag to 3008 * If no Target, bus reset on 1st I/O. Set the flag to
3465 * prevent any future negotiations to this device. 3009 * prevent any future negotiations to this device.
3466 */ 3010 */
3467static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id) 3011static void
3012mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id)
3468{ 3013{
3469 3014
3470 if ((hd->Targets) && (hd->Targets[target_id] == NULL)) 3015 if ((hd->Targets) && (hd->Targets[target_id] == NULL))
@@ -3631,7 +3176,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
3631 offset = pTarget->maxOffset; 3176 offset = pTarget->maxOffset;
3632 negoFlags = pTarget->negoFlags; 3177 negoFlags = pTarget->negoFlags;
3633 } 3178 }
3634 3179
3635#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION 3180#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
3636 /* Force to async and narrow if DV has not been executed 3181 /* Force to async and narrow if DV has not been executed
3637 * for this ID 3182 * for this ID
@@ -3653,7 +3198,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
3653 3198
3654 /* Get a MF for this command. 3199 /* Get a MF for this command.
3655 */ 3200 */
3656 if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc)) == NULL) { 3201 if ((mf = mpt_get_msg_frame(ioc->DoneCtx, ioc)) == NULL) {
3657 dprintk((MYIOC_s_WARN_FMT "write SDP1: no msg frames!\n", 3202 dprintk((MYIOC_s_WARN_FMT "write SDP1: no msg frames!\n",
3658 ioc->name)); 3203 ioc->name));
3659 return -EAGAIN; 3204 return -EAGAIN;
@@ -3717,7 +3262,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
3717 ioc->name, id, (id | (bus<<8)), 3262 ioc->name, id, (id | (bus<<8)),
3718 requested, configuration)); 3263 requested, configuration));
3719 3264
3720 mpt_put_msg_frame(ScsiDoneCtx, ioc, mf); 3265 mpt_put_msg_frame(ioc->DoneCtx, ioc, mf);
3721 } 3266 }
3722 3267
3723 return 0; 3268 return 0;
@@ -3748,7 +3293,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
3748 3293
3749 /* Get a MF for this command. 3294 /* Get a MF for this command.
3750 */ 3295 */
3751 if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc)) == NULL) { 3296 if ((mf = mpt_get_msg_frame(ioc->DoneCtx, ioc)) == NULL) {
3752 dprintk((MYIOC_s_WARN_FMT "writeIOCPage4 : no msg frames!\n", 3297 dprintk((MYIOC_s_WARN_FMT "writeIOCPage4 : no msg frames!\n",
3753 ioc->name)); 3298 ioc->name));
3754 return -EAGAIN; 3299 return -EAGAIN;
@@ -3794,7 +3339,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
3794 "writeIOCPage4: MaxSEP=%d ActiveSEP=%d id=%d bus=%d\n", 3339 "writeIOCPage4: MaxSEP=%d ActiveSEP=%d id=%d bus=%d\n",
3795 ioc->name, IOCPage4Ptr->MaxSEP, IOCPage4Ptr->ActiveSEP, target_id, bus)); 3340 ioc->name, IOCPage4Ptr->MaxSEP, IOCPage4Ptr->ActiveSEP, target_id, bus));
3796 3341
3797 mpt_put_msg_frame(ScsiDoneCtx, ioc, mf); 3342 mpt_put_msg_frame(ioc->DoneCtx, ioc, mf);
3798 3343
3799 return 0; 3344 return 0;
3800} 3345}
@@ -3824,7 +3369,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
3824 * in the IOC member localReply structure. 3369 * in the IOC member localReply structure.
3825 * Used ONLY for DV and other internal commands. 3370 * Used ONLY for DV and other internal commands.
3826 */ 3371 */
3827static int 3372int
3828mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) 3373mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
3829{ 3374{
3830 MPT_SCSI_HOST *hd; 3375 MPT_SCSI_HOST *hd;
@@ -3832,6 +3377,8 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
3832 int completionCode; 3377 int completionCode;
3833 u16 req_idx; 3378 u16 req_idx;
3834 3379
3380 hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
3381
3835 if ((mf == NULL) || 3382 if ((mf == NULL) ||
3836 (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) { 3383 (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) {
3837 printk(MYIOC_s_ERR_FMT 3384 printk(MYIOC_s_ERR_FMT
@@ -3840,7 +3387,6 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
3840 goto wakeup; 3387 goto wakeup;
3841 } 3388 }
3842 3389
3843 hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
3844 del_timer(&hd->timer); 3390 del_timer(&hd->timer);
3845 req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); 3391 req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
3846 hd->ScsiLookup[req_idx] = NULL; 3392 hd->ScsiLookup[req_idx] = NULL;
@@ -3972,8 +3518,8 @@ wakeup:
3972 /* 3518 /*
3973 * Wake up the original calling thread 3519 * Wake up the original calling thread
3974 */ 3520 */
3975 scandv_wait_done = 1; 3521 hd->scandv_wait_done = 1;
3976 wake_up(&scandv_waitq); 3522 wake_up(&hd->scandv_waitq);
3977 3523
3978 return 1; 3524 return 1;
3979} 3525}
@@ -3984,7 +3530,8 @@ wakeup:
3984 * @data: Pointer to MPT_SCSI_HOST recast as an unsigned long 3530 * @data: Pointer to MPT_SCSI_HOST recast as an unsigned long
3985 * 3531 *
3986 */ 3532 */
3987static void mptscsih_timer_expired(unsigned long data) 3533void
3534mptscsih_timer_expired(unsigned long data)
3988{ 3535{
3989 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) data; 3536 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) data;
3990 3537
@@ -4051,7 +3598,7 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
4051 3598
4052 /* Get and Populate a free Frame 3599 /* Get and Populate a free Frame
4053 */ 3600 */
4054 if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc)) == NULL) { 3601 if ((mf = mpt_get_msg_frame(hd->ioc->InternalCtx, hd->ioc)) == NULL) {
4055 ddvprintk((MYIOC_s_WARN_FMT "_do_raid: no msg frames!\n", 3602 ddvprintk((MYIOC_s_WARN_FMT "_do_raid: no msg frames!\n",
4056 hd->ioc->name)); 3603 hd->ioc->name));
4057 return -EAGAIN; 3604 return -EAGAIN;
@@ -4077,7 +3624,7 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
4077 3624
4078 hd->pLocal = NULL; 3625 hd->pLocal = NULL;
4079 hd->timer.expires = jiffies + HZ*10; /* 10 second timeout */ 3626 hd->timer.expires = jiffies + HZ*10; /* 10 second timeout */
4080 scandv_wait_done = 0; 3627 hd->scandv_wait_done = 0;
4081 3628
4082 /* Save cmd pointer, for resource free if timeout or 3629 /* Save cmd pointer, for resource free if timeout or
4083 * FW reload occurs 3630 * FW reload occurs
@@ -4085,8 +3632,8 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
4085 hd->cmdPtr = mf; 3632 hd->cmdPtr = mf;
4086 3633
4087 add_timer(&hd->timer); 3634 add_timer(&hd->timer);
4088 mpt_put_msg_frame(ScsiScanDvCtx, hd->ioc, mf); 3635 mpt_put_msg_frame(hd->ioc->InternalCtx, hd->ioc, mf);
4089 wait_event(scandv_waitq, scandv_wait_done); 3636 wait_event(hd->scandv_waitq, hd->scandv_wait_done);
4090 3637
4091 if ((hd->pLocal == NULL) || (hd->pLocal->completion != MPT_SCANDV_GOOD)) 3638 if ((hd->pLocal == NULL) || (hd->pLocal->completion != MPT_SCANDV_GOOD))
4092 return -1; 3639 return -1;
@@ -4232,7 +3779,7 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
4232 3779
4233 /* Get and Populate a free Frame 3780 /* Get and Populate a free Frame
4234 */ 3781 */
4235 if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc)) == NULL) { 3782 if ((mf = mpt_get_msg_frame(hd->ioc->InternalCtx, hd->ioc)) == NULL) {
4236 ddvprintk((MYIOC_s_WARN_FMT "No msg frames!\n", 3783 ddvprintk((MYIOC_s_WARN_FMT "No msg frames!\n",
4237 hd->ioc->name)); 3784 hd->ioc->name));
4238 return -EBUSY; 3785 return -EBUSY;
@@ -4314,7 +3861,7 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
4314 */ 3861 */
4315 hd->pLocal = NULL; 3862 hd->pLocal = NULL;
4316 hd->timer.expires = jiffies + HZ*cmdTimeout; 3863 hd->timer.expires = jiffies + HZ*cmdTimeout;
4317 scandv_wait_done = 0; 3864 hd->scandv_wait_done = 0;
4318 3865
4319 /* Save cmd pointer, for resource free if timeout or 3866 /* Save cmd pointer, for resource free if timeout or
4320 * FW reload occurs 3867 * FW reload occurs
@@ -4322,8 +3869,8 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
4322 hd->cmdPtr = mf; 3869 hd->cmdPtr = mf;
4323 3870
4324 add_timer(&hd->timer); 3871 add_timer(&hd->timer);
4325 mpt_put_msg_frame(ScsiScanDvCtx, hd->ioc, mf); 3872 mpt_put_msg_frame(hd->ioc->InternalCtx, hd->ioc, mf);
4326 wait_event(scandv_waitq, scandv_wait_done); 3873 wait_event(hd->scandv_waitq, hd->scandv_wait_done);
4327 3874
4328 if (hd->pLocal) { 3875 if (hd->pLocal) {
4329 rc = hd->pLocal->completion; 3876 rc = hd->pLocal->completion;
@@ -4640,7 +4187,8 @@ mptscsih_domainValidation(void *arg)
4640 4187
4641/* Search IOC page 3 to determine if this is hidden physical disk 4188/* Search IOC page 3 to determine if this is hidden physical disk
4642 */ 4189 */
4643static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id) 4190static int
4191mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id)
4644{ 4192{
4645 if (ioc->spi_data.pIocPg3) { 4193 if (ioc->spi_data.pIocPg3) {
4646 Ioc3PhysDisk_t *pPDisk = ioc->spi_data.pIocPg3->PhysDisk; 4194 Ioc3PhysDisk_t *pPDisk = ioc->spi_data.pIocPg3->PhysDisk;
@@ -4659,7 +4207,8 @@ static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id)
4659 4207
4660/* Write SDP1 if no QAS has been enabled 4208/* Write SDP1 if no QAS has been enabled
4661 */ 4209 */
4662static void mptscsih_qas_check(MPT_SCSI_HOST *hd, int id) 4210static void
4211mptscsih_qas_check(MPT_SCSI_HOST *hd, int id)
4663{ 4212{
4664 VirtDevice *pTarget; 4213 VirtDevice *pTarget;
4665 int ii; 4214 int ii;
@@ -5157,7 +4706,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id)
5157 } 4706 }
5158 ddvprintk((MYIOC_s_NOTE_FMT "DV: Basic test on id=%d completed OK.\n", ioc->name, id)); 4707 ddvprintk((MYIOC_s_NOTE_FMT "DV: Basic test on id=%d completed OK.\n", ioc->name, id));
5159 4708
5160 if (mpt_dv == 0) 4709 if (ioc->spi_data.mpt_dv == 0)
5161 goto target_done; 4710 goto target_done;
5162 4711
5163 inq0 = (*pbuf1) & 0x1F; 4712 inq0 = (*pbuf1) & 0x1F;
@@ -6015,7 +5564,29 @@ mptscsih_fillbuf(char *buffer, int size, int index, int width)
6015} 5564}
6016#endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */ 5565#endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */
6017 5566
6018/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5567EXPORT_SYMBOL(mptscsih_remove);
5568EXPORT_SYMBOL(mptscsih_shutdown);
5569#ifdef CONFIG_PM
5570EXPORT_SYMBOL(mptscsih_suspend);
5571EXPORT_SYMBOL(mptscsih_resume);
5572#endif
5573EXPORT_SYMBOL(mptscsih_proc_info);
5574EXPORT_SYMBOL(mptscsih_info);
5575EXPORT_SYMBOL(mptscsih_qcmd);
5576EXPORT_SYMBOL(mptscsih_slave_alloc);
5577EXPORT_SYMBOL(mptscsih_slave_destroy);
5578EXPORT_SYMBOL(mptscsih_slave_configure);
5579EXPORT_SYMBOL(mptscsih_abort);
5580EXPORT_SYMBOL(mptscsih_dev_reset);
5581EXPORT_SYMBOL(mptscsih_bus_reset);
5582EXPORT_SYMBOL(mptscsih_host_reset);
5583EXPORT_SYMBOL(mptscsih_bios_param);
5584EXPORT_SYMBOL(mptscsih_io_done);
5585EXPORT_SYMBOL(mptscsih_taskmgmt_complete);
5586EXPORT_SYMBOL(mptscsih_scandv_complete);
5587EXPORT_SYMBOL(mptscsih_event_process);
5588EXPORT_SYMBOL(mptscsih_ioc_reset);
5589EXPORT_SYMBOL(mptscsih_store_queue_depth);
5590EXPORT_SYMBOL(mptscsih_timer_expired);
6019 5591
6020module_init(mptscsih_init); 5592/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
6021module_exit(mptscsih_exit);
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h
index 5cb2fd45c38f..9f519836effa 100644
--- a/drivers/message/fusion/mptscsih.h
+++ b/drivers/message/fusion/mptscsih.h
@@ -1,26 +1,13 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptscsih.h 2 * linux/drivers/message/fusion/mptscsi.h
3 * High performance SCSI / Fibre Channel SCSI Host device driver. 3 * High performance SCSI / Fibre Channel SCSI Host device driver.
4 * For use with PCI chip/adapter(s): 4 * For use with PCI chip/adapter(s):
5 * LSIFC9xx/LSI409xx Fibre Channel 5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 7 *
8 * Credits: 8 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 *
12 * A huge debt of gratitude is owed to David S. Miller (DaveM)
13 * for fixing much of the stupid and broken stuff in the early
14 * driver while porting to sparc64 platform. THANK YOU!
15 *
16 * (see also mptbase.c)
17 *
18 * Copyright (c) 1999-2004 LSI Logic Corporation
19 * Originally By: Steven J. Ralston
20 * (mailto:netscape.net)
21 * (mailto:mpt_linux_developer@lsil.com) 9 * (mailto:mpt_linux_developer@lsil.com)
22 * 10 *
23 * $Id: mptscsih.h,v 1.21 2002/12/03 21:26:35 pdelaney Exp $
24 */ 11 */
25/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 12/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
26/* 13/*
@@ -91,4 +78,30 @@
91#define MPTSCSIH_MIN_SYNC 0x08 78#define MPTSCSIH_MIN_SYNC 0x08
92#define MPTSCSIH_SAF_TE 0 79#define MPTSCSIH_SAF_TE 0
93 80
81
82#endif
83
84extern void mptscsih_remove(struct pci_dev *);
85extern void mptscsih_shutdown(struct device *);
86#ifdef CONFIG_PM
87extern int mptscsih_suspend(struct pci_dev *pdev, u32 state);
88extern int mptscsih_resume(struct pci_dev *pdev);
94#endif 89#endif
90extern int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int func);
91extern const char * mptscsih_info(struct Scsi_Host *SChost);
92extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *));
93extern int mptscsih_slave_alloc(struct scsi_device *device);
94extern void mptscsih_slave_destroy(struct scsi_device *device);
95extern int mptscsih_slave_configure(struct scsi_device *device);
96extern int mptscsih_abort(struct scsi_cmnd * SCpnt);
97extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt);
98extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt);
99extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt);
100extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]);
101extern int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
102extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
103extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
104extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
105extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
106extern ssize_t mptscsih_store_queue_depth(struct device *dev, const char *buf, size_t count);
107extern void mptscsih_timer_expired(unsigned long data);
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
new file mode 100644
index 000000000000..5f9a61b85b3b
--- /dev/null
+++ b/drivers/message/fusion/mptspi.c
@@ -0,0 +1,486 @@
1/*
2 * linux/drivers/message/fusion/mptspi.c
3 * For use with LSI Logic PCI chip/adapter(s)
4 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
5 *
6 * Copyright (c) 1999-2005 LSI Logic Corporation
7 * (mailto:mpt_linux_developer@lsil.com)
8 *
9 */
10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
11/*
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; version 2 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 NO WARRANTY
22 THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
23 CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
24 LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
25 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
26 solely responsible for determining the appropriateness of using and
27 distributing the Program and assumes all risks associated with its
28 exercise of rights under this Agreement, including but not limited to
29 the risks and costs of program errors, damage to or loss of data,
30 programs or equipment, and unavailability or interruption of operations.
31
32 DISCLAIMER OF LIABILITY
33 NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
34 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
36 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
37 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
38 USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
39 HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
40
41 You should have received a copy of the GNU General Public License
42 along with this program; if not, write to the Free Software
43 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44*/
45/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
46
47#include "linux_compat.h" /* linux-2.6 tweaks */
48#include <linux/module.h>
49#include <linux/kernel.h>
50#include <linux/init.h>
51#include <linux/errno.h>
52#include <linux/kdev_t.h>
53#include <linux/blkdev.h>
54#include <linux/delay.h> /* for mdelay */
55#include <linux/interrupt.h> /* needed for in_interrupt() proto */
56#include <linux/reboot.h> /* notifier code */
57#include <linux/sched.h>
58#include <linux/workqueue.h>
59
60#include <scsi/scsi.h>
61#include <scsi/scsi_cmnd.h>
62#include <scsi/scsi_device.h>
63#include <scsi/scsi_host.h>
64#include <scsi/scsi_tcq.h>
65
66#include "mptbase.h"
67#include "mptscsih.h"
68
69/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
70#define my_NAME "Fusion MPT SPI Host driver"
71#define my_VERSION MPT_LINUX_VERSION_COMMON
72#define MYNAM "mptspi"
73
74MODULE_AUTHOR(MODULEAUTHOR);
75MODULE_DESCRIPTION(my_NAME);
76MODULE_LICENSE("GPL");
77
78/* Command line args */
79#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
80static int mpt_dv = MPTSCSIH_DOMAIN_VALIDATION;
81module_param(mpt_dv, int, 0);
82MODULE_PARM_DESC(mpt_dv, " DV Algorithm: enhanced=1, basic=0 (default=MPTSCSIH_DOMAIN_VALIDATION=1)");
83
84static int mpt_width = MPTSCSIH_MAX_WIDTH;
85module_param(mpt_width, int, 0);
86MODULE_PARM_DESC(mpt_width, " Max Bus Width: wide=1, narrow=0 (default=MPTSCSIH_MAX_WIDTH=1)");
87
88static ushort mpt_factor = MPTSCSIH_MIN_SYNC;
89module_param(mpt_factor, ushort, 0);
90MODULE_PARM_DESC(mpt_factor, " Min Sync Factor (default=MPTSCSIH_MIN_SYNC=0x08)");
91#endif
92
93static int mpt_saf_te = MPTSCSIH_SAF_TE;
94module_param(mpt_saf_te, int, 0);
95MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1 (default=MPTSCSIH_SAF_TE=0)");
96
97static int mpt_pq_filter = 0;
98module_param(mpt_pq_filter, int, 0);
99MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)");
100
101static int mptspiDoneCtx = -1;
102static int mptspiTaskCtx = -1;
103static int mptspiInternalCtx = -1; /* Used only for internal commands */
104
105static struct device_attribute mptspi_queue_depth_attr = {
106 .attr = {
107 .name = "queue_depth",
108 .mode = S_IWUSR,
109 },
110 .store = mptscsih_store_queue_depth,
111};
112
113static struct device_attribute *mptspi_dev_attrs[] = {
114 &mptspi_queue_depth_attr,
115 NULL,
116};
117
118static struct scsi_host_template mptspi_driver_template = {
119 .proc_name = "mptspi",
120 .proc_info = mptscsih_proc_info,
121 .name = "MPT SPI Host",
122 .info = mptscsih_info,
123 .queuecommand = mptscsih_qcmd,
124 .slave_alloc = mptscsih_slave_alloc,
125 .slave_configure = mptscsih_slave_configure,
126 .slave_destroy = mptscsih_slave_destroy,
127 .eh_abort_handler = mptscsih_abort,
128 .eh_device_reset_handler = mptscsih_dev_reset,
129 .eh_bus_reset_handler = mptscsih_bus_reset,
130 .eh_host_reset_handler = mptscsih_host_reset,
131 .bios_param = mptscsih_bios_param,
132 .can_queue = MPT_SCSI_CAN_QUEUE,
133 .this_id = -1,
134 .sg_tablesize = MPT_SCSI_SG_DEPTH,
135 .max_sectors = 8192,
136 .cmd_per_lun = 7,
137 .use_clustering = ENABLE_CLUSTERING,
138 .sdev_attrs = mptspi_dev_attrs,
139};
140
141
142/****************************************************************************
143 * Supported hardware
144 */
145
146static struct pci_device_id mptspi_pci_table[] = {
147 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,
148 PCI_ANY_ID, PCI_ANY_ID },
149 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035,
150 PCI_ANY_ID, PCI_ANY_ID },
151 {0} /* Terminating entry */
152};
153MODULE_DEVICE_TABLE(pci, mptspi_pci_table);
154
155/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
156/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
157/*
158 * mptspi_probe - Installs scsi devices per bus.
159 * @pdev: Pointer to pci_dev structure
160 *
161 * Returns 0 for success, non-zero for failure.
162 *
163 */
164static int
165mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
166{
167 struct Scsi_Host *sh;
168 MPT_SCSI_HOST *hd;
169 MPT_ADAPTER *ioc;
170 unsigned long flags;
171 int sz, ii;
172 int numSGE = 0;
173 int scale;
174 int ioc_cap;
175 u8 *mem;
176 int error=0;
177 int r;
178
179 if ((r = mpt_attach(pdev,id)) != 0)
180 return r;
181
182 ioc = pci_get_drvdata(pdev);
183 ioc->DoneCtx = mptspiDoneCtx;
184 ioc->TaskCtx = mptspiTaskCtx;
185 ioc->InternalCtx = mptspiInternalCtx;
186
187 /* Added sanity check on readiness of the MPT adapter.
188 */
189 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
190 printk(MYIOC_s_WARN_FMT
191 "Skipping because it's not operational!\n",
192 ioc->name);
193 return -ENODEV;
194 }
195
196 if (!ioc->active) {
197 printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
198 ioc->name);
199 return -ENODEV;
200 }
201
202 /* Sanity check - ensure at least 1 port is INITIATOR capable
203 */
204 ioc_cap = 0;
205 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
206 if (ioc->pfacts[ii].ProtocolFlags &
207 MPI_PORTFACTS_PROTOCOL_INITIATOR)
208 ioc_cap ++;
209 }
210
211 if (!ioc_cap) {
212 printk(MYIOC_s_WARN_FMT
213 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n",
214 ioc->name, ioc);
215 return -ENODEV;
216 }
217
218 sh = scsi_host_alloc(&mptspi_driver_template, sizeof(MPT_SCSI_HOST));
219
220 if (!sh) {
221 printk(MYIOC_s_WARN_FMT
222 "Unable to register controller with SCSI subsystem\n",
223 ioc->name);
224 return -1;
225 }
226
227 spin_lock_irqsave(&ioc->FreeQlock, flags);
228
229 /* Attach the SCSI Host to the IOC structure
230 */
231 ioc->sh = sh;
232
233 sh->io_port = 0;
234 sh->n_io_port = 0;
235 sh->irq = 0;
236
237 /* set 16 byte cdb's */
238 sh->max_cmd_len = 16;
239
240 /* Yikes! This is important!
241 * Otherwise, by default, linux
242 * only scans target IDs 0-7!
243 * pfactsN->MaxDevices unreliable
244 * (not supported in early
245 * versions of the FW).
246 * max_id = 1 + actual max id,
247 * max_lun = 1 + actual last lun,
248 * see hosts.h :o(
249 */
250 sh->max_id = MPT_MAX_SCSI_DEVICES;
251
252 sh->max_lun = MPT_LAST_LUN + 1;
253 sh->max_channel = 0;
254 sh->this_id = ioc->pfacts[0].PortSCSIID;
255
256 /* Required entry.
257 */
258 sh->unique_id = ioc->id;
259
260 /* Verify that we won't exceed the maximum
261 * number of chain buffers
262 * We can optimize: ZZ = req_sz/sizeof(SGE)
263 * For 32bit SGE's:
264 * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
265 * + (req_sz - 64)/sizeof(SGE)
266 * A slightly different algorithm is required for
267 * 64bit SGEs.
268 */
269 scale = ioc->req_sz/(sizeof(dma_addr_t) + sizeof(u32));
270 if (sizeof(dma_addr_t) == sizeof(u64)) {
271 numSGE = (scale - 1) *
272 (ioc->facts.MaxChainDepth-1) + scale +
273 (ioc->req_sz - 60) / (sizeof(dma_addr_t) +
274 sizeof(u32));
275 } else {
276 numSGE = 1 + (scale - 1) *
277 (ioc->facts.MaxChainDepth-1) + scale +
278 (ioc->req_sz - 64) / (sizeof(dma_addr_t) +
279 sizeof(u32));
280 }
281
282 if (numSGE < sh->sg_tablesize) {
283 /* Reset this value */
284 dprintk((MYIOC_s_INFO_FMT
285 "Resetting sg_tablesize to %d from %d\n",
286 ioc->name, numSGE, sh->sg_tablesize));
287 sh->sg_tablesize = numSGE;
288 }
289
290 /* Set the pci device pointer in Scsi_Host structure.
291 */
292 scsi_set_device(sh, &ioc->pcidev->dev);
293
294 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
295
296 hd = (MPT_SCSI_HOST *) sh->hostdata;
297 hd->ioc = ioc;
298
299 /* SCSI needs scsi_cmnd lookup table!
300 * (with size equal to req_depth*PtrSz!)
301 */
302 sz = ioc->req_depth * sizeof(void *);
303 mem = kmalloc(sz, GFP_ATOMIC);
304 if (mem == NULL) {
305 error = -ENOMEM;
306 goto mptspi_probe_failed;
307 }
308
309 memset(mem, 0, sz);
310 hd->ScsiLookup = (struct scsi_cmnd **) mem;
311
312 dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
313 ioc->name, hd->ScsiLookup, sz));
314
315 /* Allocate memory for the device structures.
316 * A non-Null pointer at an offset
317 * indicates a device exists.
318 * max_id = 1 + maximum id (hosts.h)
319 */
320 sz = sh->max_id * sizeof(void *);
321 mem = kmalloc(sz, GFP_ATOMIC);
322 if (mem == NULL) {
323 error = -ENOMEM;
324 goto mptspi_probe_failed;
325 }
326
327 memset(mem, 0, sz);
328 hd->Targets = (VirtDevice **) mem;
329
330 dprintk((KERN_INFO
331 " Targets @ %p, sz=%d\n", hd->Targets, sz));
332
333 /* Clear the TM flags
334 */
335 hd->tmPending = 0;
336 hd->tmState = TM_STATE_NONE;
337 hd->resetPending = 0;
338 hd->abortSCpnt = NULL;
339
340 /* Clear the pointer used to store
341 * single-threaded commands, i.e., those
342 * issued during a bus scan, dv and
343 * configuration pages.
344 */
345 hd->cmdPtr = NULL;
346
347 /* Initialize this SCSI Hosts' timers
348 * To use, set the timer expires field
349 * and add_timer
350 */
351 init_timer(&hd->timer);
352 hd->timer.data = (unsigned long) hd;
353 hd->timer.function = mptscsih_timer_expired;
354
355 ioc->spi_data.Saf_Te = mpt_saf_te;
356 hd->mpt_pq_filter = mpt_pq_filter;
357
358#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
359 if (ioc->spi_data.maxBusWidth > mpt_width)
360 ioc->spi_data.maxBusWidth = mpt_width;
361 if (ioc->spi_data.minSyncFactor < mpt_factor)
362 ioc->spi_data.minSyncFactor = mpt_factor;
363 if (ioc->spi_data.minSyncFactor == MPT_ASYNC) {
364 ioc->spi_data.maxSyncOffset = 0;
365 }
366 ioc->spi_data.mpt_dv = mpt_dv;
367 hd->negoNvram = 0;
368
369 ddvprintk((MYIOC_s_INFO_FMT
370 "dv %x width %x factor %x saf_te %x mpt_pq_filter %x\n",
371 ioc->name,
372 mpt_dv,
373 mpt_width,
374 mpt_factor,
375 mpt_saf_te,
376 mpt_pq_filter));
377#else
378 hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
379 ddvprintk((MYIOC_s_INFO_FMT
380 "saf_te %x mpt_pq_filter %x\n",
381 ioc->name,
382 mpt_saf_te,
383 mpt_pq_filter));
384#endif
385
386 ioc->spi_data.forceDv = 0;
387 ioc->spi_data.noQas = 0;
388
389 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
390 ioc->spi_data.dvStatus[ii] =
391 MPT_SCSICFG_NEGOTIATE;
392
393 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
394 ioc->spi_data.dvStatus[ii] |=
395 MPT_SCSICFG_DV_NOT_DONE;
396
397 init_waitqueue_head(&hd->scandv_waitq);
398 hd->scandv_wait_done = 0;
399 hd->last_queue_full = 0;
400
401 error = scsi_add_host (sh, &ioc->pcidev->dev);
402 if(error) {
403 dprintk((KERN_ERR MYNAM
404 "scsi_add_host failed\n"));
405 goto mptspi_probe_failed;
406 }
407
408 scsi_scan_host(sh);
409 return 0;
410
411mptspi_probe_failed:
412
413 mptscsih_remove(pdev);
414 return error;
415}
416
417static struct pci_driver mptspi_driver = {
418 .name = "mptspi",
419 .id_table = mptspi_pci_table,
420 .probe = mptspi_probe,
421 .remove = __devexit_p(mptscsih_remove),
422 .driver = {
423 .shutdown = mptscsih_shutdown,
424 },
425#ifdef CONFIG_PM
426 .suspend = mptscsih_suspend,
427 .resume = mptscsih_resume,
428#endif
429};
430
431/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
432/**
433 * mptspi_init - Register MPT adapter(s) as SCSI host(s) with
434 * linux scsi mid-layer.
435 *
436 * Returns 0 for success, non-zero for failure.
437 */
438static int __init
439mptspi_init(void)
440{
441
442 show_mptmod_ver(my_NAME, my_VERSION);
443
444 mptspiDoneCtx = mpt_register(mptscsih_io_done, MPTSPI_DRIVER);
445 mptspiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSPI_DRIVER);
446 mptspiInternalCtx = mpt_register(mptscsih_scandv_complete, MPTSPI_DRIVER);
447
448 if (mpt_event_register(mptspiDoneCtx, mptscsih_event_process) == 0) {
449 devtprintk((KERN_INFO MYNAM
450 ": Registered for IOC event notifications\n"));
451 }
452
453 if (mpt_reset_register(mptspiDoneCtx, mptscsih_ioc_reset) == 0) {
454 dprintk((KERN_INFO MYNAM
455 ": Registered for IOC reset notifications\n"));
456 }
457
458 return pci_register_driver(&mptspi_driver);
459}
460
461/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
462/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
463/**
464 * mptspi_exit - Unregisters MPT adapter(s)
465 *
466 */
467static void __exit
468mptspi_exit(void)
469{
470 pci_unregister_driver(&mptspi_driver);
471
472 mpt_reset_deregister(mptspiDoneCtx);
473 dprintk((KERN_INFO MYNAM
474 ": Deregistered for IOC reset notifications\n"));
475
476 mpt_event_deregister(mptspiDoneCtx);
477 dprintk((KERN_INFO MYNAM
478 ": Deregistered for IOC event notifications\n"));
479
480 mpt_deregister(mptspiInternalCtx);
481 mpt_deregister(mptspiTaskCtx);
482 mpt_deregister(mptspiDoneCtx);
483}
484
485module_init(mptspi_init);
486module_exit(mptspi_exit);