diff options
Diffstat (limited to 'drivers/message')
41 files changed, 5246 insertions, 2559 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 @@ | |||
| 2 | menu "Fusion MPT device support" | 2 | menu "Fusion MPT device support" |
| 3 | 3 | ||
| 4 | config FUSION | 4 | config FUSION |
| 5 | tristate "Fusion MPT (base + ScsiHost) drivers" | 5 | bool |
| 6 | default n | ||
| 7 | |||
| 8 | config 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 | |||
| 22 | config 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 | ||
| 17 | config FUSION_MAX_SGE | 38 | config 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 | ||
| 30 | config FUSION_CTL | 50 | config 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 | ||
| 49 | config FUSION_LAN | 69 | config 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 | |||
| 16 | EXTRA_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 | ||
| 50 | obj-$(CONFIG_FUSION) += mptbase.o mptscsih.o | 35 | obj-$(CONFIG_FUSION_SPI) += mptbase.o mptscsih.o mptspi.o |
| 36 | obj-$(CONFIG_FUSION_FC) += mptbase.o mptscsih.o mptfc.o | ||
| 51 | obj-$(CONFIG_FUSION_CTL) += mptctl.o | 37 | obj-$(CONFIG_FUSION_CTL) += mptctl.o |
| 52 | obj-$(CONFIG_FUSION_LAN) += mptlan.o | 38 | obj-$(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 | ||
| 170 | typedef union _CONFIG_PAGE_HEADER_UNION | 257 | typedef 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 | ||
| 179 | typedef struct _CONFIG_EXTENDED_PAGE_HEADER | 266 | typedef 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 | ||
| 363 | typedef struct _CONFIG_PAGE_MANUFACTURING_0 | 498 | typedef 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 | ||
| 378 | typedef struct _CONFIG_PAGE_MANUFACTURING_1 | 513 | typedef 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 | ||
| 405 | typedef struct _CONFIG_PAGE_MANUFACTURING_2 | 540 | typedef 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 | ||
| 424 | typedef struct _CONFIG_PAGE_MANUFACTURING_3 | 559 | typedef 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 | ||
| 435 | typedef struct _CONFIG_PAGE_MANUFACTURING_4 | 570 | typedef 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 | ||
| 459 | typedef struct _CONFIG_PAGE_MANUFACTURING_5 | 607 | typedef 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 | ||
| 469 | typedef struct _CONFIG_PAGE_MANUFACTURING_6 | 623 | typedef 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 | ||
| 483 | typedef struct _CONFIG_PAGE_IO_UNIT_0 | 637 | typedef 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 | ||
| 493 | typedef struct _CONFIG_PAGE_IO_UNIT_1 | 647 | typedef 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 | ||
| 525 | typedef struct _CONFIG_PAGE_IO_UNIT_2 | 679 | typedef 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 | ||
| 555 | typedef struct _CONFIG_PAGE_IO_UNIT_3 | 710 | typedef 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 | ||
| 728 | typedef 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 | ||
| 577 | typedef struct _CONFIG_PAGE_IOC_0 | 743 | typedef 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 | ||
| 595 | typedef struct _CONFIG_PAGE_IOC_1 | 761 | typedef 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 | ||
| 649 | typedef struct _CONFIG_PAGE_IOC_2 | 811 | typedef 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 | ||
| 690 | typedef struct _CONFIG_PAGE_IOC_3 | 852 | typedef 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 | ||
| 719 | typedef struct _CONFIG_PAGE_IOC_4 | 881 | typedef 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 | ||
| 752 | typedef struct _CONFIG_PAGE_IOC_5 | 914 | typedef 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 | ||
| 770 | typedef struct _CONFIG_PAGE_BIOS_1 | 932 | typedef 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 | ||
| 986 | typedef 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 | |||
| 1007 | typedef 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 | |||
| 1030 | typedef 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 | |||
| 1052 | typedef 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 | |||
| 1075 | typedef 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 | |||
| 1094 | typedef 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 | |||
| 1113 | typedef 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 | |||
| 1134 | typedef 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 | |||
| 1145 | typedef 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 | ||
| 822 | typedef struct _CONFIG_PAGE_SCSI_PORT_0 | 1176 | typedef 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 | ||
| 870 | typedef struct _CONFIG_PAGE_SCSI_PORT_1 | 1225 | typedef 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 | ||
| 901 | typedef struct _CONFIG_PAGE_SCSI_PORT_2 | 1256 | typedef 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 | ||
| 954 | typedef struct _CONFIG_PAGE_SCSI_DEVICE_0 | 1309 | typedef 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 | ||
| 985 | typedef struct _CONFIG_PAGE_SCSI_DEVICE_1 | 1341 | typedef 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 | ||
| 1017 | typedef struct _CONFIG_PAGE_SCSI_DEVICE_2 | 1374 | typedef 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 | ||
| 1058 | typedef struct _CONFIG_PAGE_SCSI_DEVICE_3 | 1415 | typedef 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 | ||
| 1078 | typedef struct _CONFIG_PAGE_FC_PORT_0 | 1435 | typedef 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 | |||
| 1168 | typedef struct _CONFIG_PAGE_FC_PORT_1 | 1524 | typedef 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 | ||
| 1232 | typedef struct _CONFIG_PAGE_FC_PORT_2 | 1590 | typedef 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 | ||
| 1281 | typedef struct _CONFIG_PAGE_FC_PORT_3 | 1639 | typedef 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 | ||
| 1291 | typedef struct _CONFIG_PAGE_FC_PORT_4 | 1649 | typedef 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 | ||
| 1323 | typedef struct _CONFIG_PAGE_FC_PORT_5 | 1681 | typedef 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 | ||
| 1338 | typedef struct _CONFIG_PAGE_FC_PORT_6 | 1696 | typedef 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 | ||
| 1364 | typedef struct _CONFIG_PAGE_FC_PORT_7 | 1722 | typedef 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 | ||
| 1375 | typedef struct _CONFIG_PAGE_FC_PORT_8 | 1733 | typedef 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 | ||
| 1385 | typedef struct _CONFIG_PAGE_FC_PORT_9 | 1743 | typedef 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 | ||
| 1497 | typedef struct _CONFIG_PAGE_FC_PORT_10 | 1857 | typedef 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 | ||
| 1535 | typedef struct _CONFIG_PAGE_FC_DEVICE_0 | 1895 | typedef 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 | ||
| 1610 | typedef struct _RAID_VOL0_SETTINGS | 1971 | typedef 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 | ||
| 1645 | typedef struct _CONFIG_PAGE_RAID_VOL_0 | 2006 | typedef 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 | |||
| 2040 | typedef 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 | ||
| 1727 | typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_0 | 2117 | typedef 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 | |||
| 2138 | typedef 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 | |||
| 2155 | typedef 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 | ||
| 1797 | typedef struct _CONFIG_PAGE_INBAND_0 | 2217 | typedef 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 | ||
| 1835 | typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 | 2255 | typedef 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 | ||
| 1871 | typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA | 2304 | typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA |
| 1872 | { | 2305 | { |
| @@ -1889,52 +2322,75 @@ typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA | |||
| 1889 | 2322 | ||
| 1890 | typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1 | 2323 | typedef 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 | ||
| 1925 | typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2 | 2381 | typedef 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 | ||
| 1947 | typedef struct _CONFIG_PAGE_SAS_IO_UNIT_3 | 2411 | typedef 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 | |||
| 1965 | typedef struct _CONFIG_PAGE_SAS_EXPANDER_0 | 2433 | typedef 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 | ||
| 2473 | typedef 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 | |||
| 1989 | typedef struct _CONFIG_PAGE_SAS_DEVICE_0 | 2526 | typedef 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 | ||
| 2015 | typedef struct _CONFIG_PAGE_SAS_DEVICE_1 | 2567 | typedef 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 | ||
| 2583 | typedef 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 | |||
| 2031 | typedef struct _CONFIG_PAGE_SAS_PHY_0 | 2598 | typedef 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 | ||
| 2090 | typedef struct _CONFIG_PAGE_SAS_PHY_1 | 2657 | typedef 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 | |||
| 2675 | typedef 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 | |||
| 2720 | typedef 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 | |||
| 2735 | typedef 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 | ||
| 58 | mpi_ioc.h | 93 | mpi_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 | ||
| 86 | mpi_cnfg.h | 164 | mpi_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 | ||
| 147 | mpi_init.h | 385 | mpi_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 | ||
| 159 | mpi_targ.h | 423 | mpi_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 | ||
| 175 | mpi_fc.h | 466 | mpi_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 | ||
| 197 | mpi_lan.h | 495 | mpi_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 | ||
| 214 | mpi_raid.h | 515 | mpi_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 | |||
| 538 | mpi_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 | |||
| 553 | mpi_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 | |||
| 558 | mpi_sas.h | ||
| 559 | * 08-19-04 01.05.01 Original release. | ||
| 217 | * -------------------------------------------------------------------------- | 560 | * -------------------------------------------------------------------------- |
| 218 | 561 | ||
| 219 | mpi_type.h | 562 | mpi_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 | ||
| 226 | mpi_history.txt Parts list history | 572 | mpi_history.txt Parts list history |
| 227 | 573 | ||
| 228 | Filename 01.01.10 | 574 | Filename 01.05.09 |
| 229 | ---------- -------- | 575 | ---------- -------- |
| 230 | mpi.h 01.01.07 | 576 | mpi.h 01.05.07 |
| 231 | mpi_ioc.h 01.01.07 | 577 | mpi_ioc.h 01.05.08 |
| 232 | mpi_cnfg.h 01.01.11 | 578 | mpi_cnfg.h 01.05.08 |
| 233 | mpi_init.h 01.01.05 | 579 | mpi_init.h 01.05.04 |
| 234 | mpi_targ.h 01.01.04 | 580 | mpi_targ.h 01.05.04 |
| 235 | mpi_fc.h 01.01.07 | 581 | mpi_fc.h 01.05.01 |
| 236 | mpi_lan.h 01.01.03 | 582 | mpi_lan.h 01.05.01 |
| 237 | mpi_raid.h 01.01.02 | 583 | mpi_raid.h 01.05.02 |
| 238 | mpi_type.h 01.01.02 | 584 | mpi_tool.h 01.05.03 |
| 585 | mpi_inb.h 01.05.01 | ||
| 586 | mpi_sas.h 01.05.01 | ||
| 587 | mpi_type.h 01.05.01 | ||
| 588 | |||
| 589 | Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 | ||
| 590 | ---------- -------- -------- -------- -------- -------- -------- | ||
| 591 | mpi.h 01.05.06 01.05.05 01.05.04 01.05.03 01.05.02 01.05.01 | ||
| 592 | mpi_ioc.h 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 01.05.02 | ||
| 593 | mpi_cnfg.h 01.05.07 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 | ||
| 594 | mpi_init.h 01.05.03 01.05.03 01.05.03 01.05.02 01.05.02 01.05.01 | ||
| 595 | mpi_targ.h 01.05.03 01.05.02 01.05.02 01.05.02 01.05.02 01.05.02 | ||
| 596 | mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 | ||
| 597 | mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 | ||
| 598 | mpi_raid.h 01.05.02 01.05.02 01.05.02 01.05.01 01.05.01 01.05.01 | ||
| 599 | mpi_tool.h 01.05.03 01.05.03 01.05.02 01.05.02 01.05.02 01.05.02 | ||
| 600 | mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 | ||
| 601 | mpi_sas.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 | ||
| 602 | mpi_type.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 | ||
| 603 | |||
| 604 | Filename 01.05.02 01.05.01 01.03.01 01.02.14 01.02.13 01.02.12 | ||
| 605 | ---------- -------- -------- -------- -------- -------- -------- | ||
| 606 | mpi.h 01.05.01 01.05.01 01.03.01 01.02.12 01.02.11 01.02.10 | ||
| 607 | mpi_ioc.h 01.05.02 01.05.01 01.03.01 01.02.09 01.02.08 01.02.08 | ||
| 608 | mpi_cnfg.h 01.05.02 01.05.01 01.03.01 01.02.14 01.02.13 01.02.12 | ||
| 609 | mpi_init.h 01.05.01 01.05.01 01.03.01 01.02.07 01.02.07 01.02.07 | ||
| 610 | mpi_targ.h 01.05.02 01.05.01 01.03.01 01.02.09 01.02.09 01.02.09 | ||
| 611 | mpi_fc.h 01.05.01 01.05.01 01.03.01 01.02.04 01.02.04 01.02.03 | ||
| 612 | mpi_lan.h 01.05.01 01.05.01 01.03.01 01.02.01 01.02.01 01.02.01 | ||
| 613 | mpi_raid.h 01.05.01 01.05.01 01.03.01 01.02.09 01.02.09 01.02.09 | ||
| 614 | mpi_tool.h 01.05.02 01.05.01 01.03.01 01.02.01 01.02.01 01.02.01 | ||
| 615 | mpi_inb.h 01.05.01 01.05.01 01.03.01 | ||
| 616 | mpi_sas.h 01.05.01 01.05.01 | ||
| 617 | mpi_type.h 01.05.01 01.05.01 01.03.01 01.02.04 01.02.03 01.02.02 | ||
| 618 | |||
| 619 | Filename 01.02.11 01.02.10 01.02.09 01.02.08 01.02.07 01.02.06 | ||
| 620 | ---------- -------- -------- -------- -------- -------- -------- | ||
| 621 | mpi.h 01.02.09 01.02.08 01.02.07 01.02.06 01.02.05 01.02.04 | ||
| 622 | mpi_ioc.h 01.02.07 01.02.06 01.02.06 01.02.06 01.02.06 01.02.05 | ||
| 623 | mpi_cnfg.h 01.02.11 01.02.10 01.02.09 01.02.08 01.02.07 01.02.06 | ||
| 624 | mpi_init.h 01.02.06 01.02.06 01.02.05 01.02.05 01.02.05 01.02.04 | ||
| 625 | mpi_targ.h 01.02.09 01.02.08 01.02.07 01.02.06 01.02.06 01.02.05 | ||
| 626 | mpi_fc.h 01.02.03 01.02.03 01.02.03 01.02.03 01.02.03 01.02.02 | ||
| 627 | mpi_lan.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 | ||
| 628 | mpi_raid.h 01.02.09 01.02.08 01.02.07 01.02.07 01.02.06 01.02.05 | ||
| 629 | mpi_tool.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 | ||
| 630 | mpi_type.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.02 01.02.02 | ||
| 631 | |||
| 632 | Filename 01.02.05 01.02.04 01.02.03 01.02.02 01.02.01 01.01.10 | ||
| 633 | ---------- -------- -------- -------- -------- -------- -------- | ||
| 634 | mpi.h 01.02.03 01.02.02 01.02.02 01.02.01 01.02.01 01.01.07 | ||
| 635 | mpi_ioc.h 01.02.04 01.02.03 01.02.03 01.02.02 01.02.01 01.01.07 | ||
| 636 | mpi_cnfg.h 01.02.05 01.02.04 01.02.03 01.02.02 01.02.01 01.01.11 | ||
| 637 | mpi_init.h 01.02.04 01.02.04 01.02.03 01.02.02 01.02.01 01.01.05 | ||
| 638 | mpi_targ.h 01.02.04 01.02.03 01.02.02 01.02.01 01.02.01 01.01.04 | ||
| 639 | mpi_fc.h 01.02.02 01.02.02 01.02.02 01.02.01 01.02.01 01.01.07 | ||
| 640 | mpi_lan.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.01.03 | ||
| 641 | mpi_raid.h 01.02.04 01.02.03 01.02.02 01.02.01 01.02.01 01.01.02 | ||
| 642 | mpi_tool.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.01 | ||
| 643 | mpi_type.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.01 01.01.02 | ||
| 239 | 644 | ||
| 240 | Filename 01.01.09 01.01.08 01.01.07 01.01.06 01.01.05 01.01.04 | 645 | Filename 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 | |||
| 198 | typedef 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 | ||
| 108 | typedef struct _MSG_IOC_INIT_REPLY | 149 | typedef 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 | |||
| 549 | typedef 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 | ||
| 493 | typedef struct _EVENT_DATA_LINK_STATUS | 578 | typedef 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 */ | 625 | typedef struct _EVENT_DATA_SAS_SES |
| 540 | |||
| 541 | typedef 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) | 636 | typedef 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 | |||
| 659 | typedef 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 | ||
| 599 | typedef struct _FWDownloadTCSGE | 714 | typedef 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 | ||
| 651 | typedef struct _FWUploadTCSGE | 767 | typedef 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 | ||
| 751 | typedef struct _MPI_EXT_IMAGE_HEADER | 871 | typedef 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 | |||
| 138 | typedef 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 */ | ||
| 175 | typedef 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 | |||
| 147 | typedef 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 | ||
| 149 | typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY | 178 | /****************************************************************************/ |
| 179 | /* Target Command Buffer Post Base Request */ | ||
| 180 | /****************************************************************************/ | ||
| 181 | |||
| 182 | typedef 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 | |||
| 205 | typedef 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 | |||
| 227 | typedef 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 | |||
| 168 | typedef struct _MPI_TARGET_FCP_CMD_BUFFER | 249 | typedef 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 | ||
| 285 | typedef 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 | |||
| 303 | typedef 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 | */ | ||
| 436 | typedef 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 */ | ||
| 200 | typedef 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 */ |
| 189 | typedef union _MPI_TB_FC_MANAGE_AI_UNION | 209 | typedef 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 | |||
| 245 | typedef 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; | |||
| 50 | typedef int32_t S32; | 52 | typedef int32_t S32; |
| 51 | typedef u_int32_t U32; | 53 | typedef 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 | |||
| 58 | typedef struct _S64 | 55 | typedef 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); | |||
| 218 | static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info); | 177 | static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info); |
| 219 | 178 | ||
| 220 | /* module entry point */ | 179 | /* module entry point */ |
| 221 | static int __devinit mptbase_probe (struct pci_dev *, const struct pci_device_id *); | ||
| 222 | static void __devexit mptbase_remove(struct pci_dev *); | ||
| 223 | static void mptbase_shutdown(struct device * ); | ||
| 224 | static int __init fusion_init (void); | 180 | static int __init fusion_init (void); |
| 225 | static void __exit fusion_exit (void); | 181 | static void __exit fusion_exit (void); |
| 226 | 182 | ||
| 227 | /**************************************************************************** | ||
| 228 | * Supported hardware | ||
| 229 | */ | ||
| 230 | |||
| 231 | static 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 | }; | ||
| 248 | MODULE_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 | ||
| 189 | static void | ||
| 190 | pci_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 | |||
| 199 | static void | ||
| 200 | pci_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 | |||
| 725 | mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx) | 668 | mpt_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 | */ |
| 1076 | static int __devinit | 1015 | int |
| 1077 | mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 1016 | mpt_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 | ||
| 1362 | static void __devexit | 1312 | void |
| 1363 | mptbase_remove(struct pci_dev *pdev) | 1313 | mpt_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 | */ | ||
| 1405 | static void | ||
| 1406 | mptbase_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 | */ |
| 1431 | static int | 1360 | int |
| 1432 | mptbase_suspend(struct pci_dev *pdev, pm_message_t state) | 1361 | mpt_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 | */ |
| 1491 | static int | 1411 | int |
| 1492 | mptbase_resume(struct pci_dev *pdev) | 1412 | mpt_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) | |||
| 1829 | static void | 1738 | static void |
| 1830 | mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev) | 1739 | mpt_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 | |||
| 5130 | procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) | 5038 | procmpt_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 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 5749 | EXPORT_SYMBOL(mpt_attach); | ||
| 5750 | EXPORT_SYMBOL(mpt_detach); | ||
| 5751 | #ifdef CONFIG_PM | ||
| 5752 | EXPORT_SYMBOL(mpt_resume); | ||
| 5753 | EXPORT_SYMBOL(mpt_suspend); | ||
| 5754 | #endif | ||
| 5835 | EXPORT_SYMBOL(ioc_list); | 5755 | EXPORT_SYMBOL(ioc_list); |
| 5836 | EXPORT_SYMBOL(mpt_proc_root_dir); | 5756 | EXPORT_SYMBOL(mpt_proc_root_dir); |
| 5837 | EXPORT_SYMBOL(mpt_register); | 5757 | EXPORT_SYMBOL(mpt_register); |
| @@ -5860,19 +5780,6 @@ EXPORT_SYMBOL(mpt_read_ioc_pg_3); | |||
| 5860 | EXPORT_SYMBOL(mpt_alloc_fw_memory); | 5780 | EXPORT_SYMBOL(mpt_alloc_fw_memory); |
| 5861 | EXPORT_SYMBOL(mpt_free_fw_memory); | 5781 | EXPORT_SYMBOL(mpt_free_fw_memory); |
| 5862 | 5782 | ||
| 5863 | static 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 | |||
| 5884 | fusion_init(void) | 5791 | fusion_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 | |||
| 5945 | module_init(fusion_init); | 5844 | module_init(fusion_init); |
| 5946 | module_exit(fusion_exit); | 5845 | module_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 @@ | |||
| 203 | typedef enum { | 196 | typedef 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 { | |||
| 212 | struct mpt_pci_driver{ | 207 | struct 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 | */ |
| 934 | extern int mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id); | ||
| 935 | extern void mpt_detach(struct pci_dev *pdev); | ||
| 936 | #ifdef CONFIG_PM | ||
| 937 | extern int mpt_suspend(struct pci_dev *pdev, pm_message_t state); | ||
| 938 | extern int mpt_resume(struct pci_dev *pdev); | ||
| 939 | #endif | ||
| 934 | extern int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass); | 940 | extern int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass); |
| 935 | extern void mpt_deregister(int cb_idx); | 941 | extern void mpt_deregister(int cb_idx); |
| 936 | extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc); | 942 | extern 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 | */ |
| 129 | static int mptctl_fw_download(unsigned long arg); | 101 | static int mptctl_fw_download(unsigned long arg); |
| 130 | static int mptctl_getiocinfo (unsigned long arg, unsigned int cmd); | 102 | static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd); |
| 131 | static int mptctl_gettargetinfo (unsigned long arg); | 103 | static int mptctl_gettargetinfo(unsigned long arg); |
| 132 | static int mptctl_readtest (unsigned long arg); | 104 | static int mptctl_readtest(unsigned long arg); |
| 133 | static int mptctl_mpt_command (unsigned long arg); | 105 | static int mptctl_mpt_command(unsigned long arg); |
| 134 | static int mptctl_eventquery (unsigned long arg); | 106 | static int mptctl_eventquery(unsigned long arg); |
| 135 | static int mptctl_eventenable (unsigned long arg); | 107 | static int mptctl_eventenable(unsigned long arg); |
| 136 | static int mptctl_eventreport (unsigned long arg); | 108 | static int mptctl_eventreport(unsigned long arg); |
| 137 | static int mptctl_replace_fw (unsigned long arg); | 109 | static int mptctl_replace_fw(unsigned long arg); |
| 138 | 110 | ||
| 139 | static int mptctl_do_reset(unsigned long arg); | 111 | static int mptctl_do_reset(unsigned long arg); |
| 140 | static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd); | 112 | static 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 | */ |
| 152 | static int mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr); | 124 | static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr); |
| 153 | static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen); | 125 | static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen); |
| 154 | static MptSge_t *kbuf_alloc_2_sgl( int bytes, u32 dir, int sge_offset, int *frags, | 126 | static 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); |
| 156 | static void kfree_sgl( MptSge_t *sgl, dma_addr_t sgl_dma, | 128 | static 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); |
| 158 | static void mptctl_timeout_expired (MPT_IOCTL *ioctl); | 130 | static void mptctl_timeout_expired (MPT_IOCTL *ioctl); |
| 159 | static int mptctl_bus_reset(MPT_IOCTL *ioctl); | 131 | static 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 | |||
| 73 | MODULE_AUTHOR(MODULEAUTHOR); | ||
| 74 | MODULE_DESCRIPTION(my_NAME); | ||
| 75 | MODULE_LICENSE("GPL"); | ||
| 76 | |||
| 77 | /* Command line args */ | ||
| 78 | static int mpt_pq_filter = 0; | ||
| 79 | module_param(mpt_pq_filter, int, 0); | ||
| 80 | MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)"); | ||
| 81 | |||
| 82 | static int mptfcDoneCtx = -1; | ||
| 83 | static int mptfcTaskCtx = -1; | ||
| 84 | static int mptfcInternalCtx = -1; /* Used only for internal commands */ | ||
| 85 | |||
| 86 | static 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 | |||
| 94 | static struct device_attribute *mptfc_dev_attrs[] = { | ||
| 95 | &mptfc_queue_depth_attr, | ||
| 96 | NULL, | ||
| 97 | }; | ||
| 98 | |||
| 99 | static 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 | |||
| 126 | static 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 | }; | ||
| 143 | MODULE_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 | */ | ||
| 154 | static int | ||
| 155 | mptfc_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 | |||
| 356 | mptfc_probe_failed: | ||
| 357 | |||
| 358 | mptscsih_remove(pdev); | ||
| 359 | return error; | ||
| 360 | } | ||
| 361 | |||
| 362 | static 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 | */ | ||
| 383 | static int __init | ||
| 384 | mptfc_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 | */ | ||
| 412 | static void __exit | ||
| 413 | mptfc_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 | |||
| 430 | module_init(mptfc_init); | ||
| 431 | module_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..a0078ae5b9b8 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); | |||
| 96 | MODULE_DESCRIPTION(my_NAME); | 75 | MODULE_DESCRIPTION(my_NAME); |
| 97 | MODULE_LICENSE("GPL"); | 76 | MODULE_LICENSE("GPL"); |
| 98 | 77 | ||
| 99 | /* Command line args */ | ||
| 100 | static int mpt_dv = MPTSCSIH_DOMAIN_VALIDATION; | ||
| 101 | MODULE_PARM(mpt_dv, "i"); | ||
| 102 | MODULE_PARM_DESC(mpt_dv, " DV Algorithm: enhanced=1, basic=0 (default=MPTSCSIH_DOMAIN_VALIDATION=1)"); | ||
| 103 | |||
| 104 | static int mpt_width = MPTSCSIH_MAX_WIDTH; | ||
| 105 | MODULE_PARM(mpt_width, "i"); | ||
| 106 | MODULE_PARM_DESC(mpt_width, " Max Bus Width: wide=1, narrow=0 (default=MPTSCSIH_MAX_WIDTH=1)"); | ||
| 107 | |||
| 108 | static int mpt_factor = MPTSCSIH_MIN_SYNC; | ||
| 109 | MODULE_PARM(mpt_factor, "h"); | ||
| 110 | MODULE_PARM_DESC(mpt_factor, " Min Sync Factor (default=MPTSCSIH_MIN_SYNC=0x08)"); | ||
| 111 | |||
| 112 | static int mpt_saf_te = MPTSCSIH_SAF_TE; | ||
| 113 | MODULE_PARM(mpt_saf_te, "i"); | ||
| 114 | MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1 (default=MPTSCSIH_SAF_TE=0)"); | ||
| 115 | |||
| 116 | static int mpt_pq_filter = 0; | ||
| 117 | MODULE_PARM(mpt_pq_filter, "i"); | ||
| 118 | MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)"); | ||
| 119 | |||
| 120 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 78 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 121 | 79 | ||
| 122 | typedef struct _BIG_SENSE_BUF { | 80 | typedef 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 | */ |
| 176 | static int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); | 133 | int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); |
| 177 | static void mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq); | 134 | static void mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq); |
| 178 | static int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); | 135 | int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); |
| 179 | 136 | ||
| 180 | static int mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt, | 137 | static int mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt, |
| 181 | SCSIIORequest_t *pReq, int req_idx); | 138 | SCSIIORequest_t *pReq, int req_idx); |
| 182 | static void mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx); | 139 | static void mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx); |
| 183 | static void copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); | 140 | static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); |
| 184 | static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd); | 141 | static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd); |
| 185 | static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout ); | 142 | static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout ); |
| 186 | static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc); | 143 | static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc); |
| @@ -188,8 +145,8 @@ static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc); | |||
| 188 | static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); | 145 | static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); |
| 189 | static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); | 146 | static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); |
| 190 | 147 | ||
| 191 | static int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); | 148 | int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); |
| 192 | static int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); | 149 | int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); |
| 193 | 150 | ||
| 194 | static void mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen); | 151 | static void mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen); |
| 195 | static void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56); | 152 | static 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 | |||
| 198 | static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id); | 155 | static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id); |
| 199 | static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags); | 156 | static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags); |
| 200 | static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus); | 157 | static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus); |
| 201 | static int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); | 158 | int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); |
| 202 | static void mptscsih_timer_expired(unsigned long data); | ||
| 203 | static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd); | 159 | static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd); |
| 204 | static int mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum); | 160 | static 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); | |||
| 212 | static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage); | 168 | static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage); |
| 213 | static void mptscsih_fillbuf(char *buffer, int size, int index, int width); | 169 | static void mptscsih_fillbuf(char *buffer, int size, int index, int width); |
| 214 | #endif | 170 | #endif |
| 215 | /* module entry point */ | ||
| 216 | static int __init mptscsih_init (void); | ||
| 217 | static void __exit mptscsih_exit (void); | ||
| 218 | 171 | ||
| 219 | static int mptscsih_probe (struct pci_dev *, const struct pci_device_id *); | 172 | void mptscsih_remove(struct pci_dev *); |
| 220 | static void mptscsih_remove(struct pci_dev *); | 173 | void mptscsih_shutdown(struct device *); |
| 221 | static void mptscsih_shutdown(struct device *); | ||
| 222 | #ifdef CONFIG_PM | 174 | #ifdef CONFIG_PM |
| 223 | static int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); | 175 | int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); |
| 224 | static int mptscsih_resume(struct pci_dev *pdev); | 176 | int mptscsih_resume(struct pci_dev *pdev); |
| 225 | #endif | 177 | #endif |
| 226 | 178 | ||
| 227 | |||
| 228 | /* | ||
| 229 | * Private data... | ||
| 230 | */ | ||
| 231 | |||
| 232 | static int mpt_scsi_hosts = 0; | ||
| 233 | |||
| 234 | static int ScsiDoneCtx = -1; | ||
| 235 | static int ScsiTaskCtx = -1; | ||
| 236 | static 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 */ | |||
| 244 | static DEFINE_SPINLOCK(dvtaskQ_lock); | 185 | static DEFINE_SPINLOCK(dvtaskQ_lock); |
| 245 | static int dvtaskQ_active = 0; | 186 | static int dvtaskQ_active = 0; |
| 246 | static int dvtaskQ_release = 0; | 187 | static int dvtaskQ_release = 0; |
| 247 | static struct work_struct mptscsih_dvTask; | 188 | static struct work_struct dvTaskQ_task; |
| 248 | #endif | 189 | #endif |
| 249 | 190 | ||
| 250 | /* | ||
| 251 | * Wait Queue setup | ||
| 252 | */ | ||
| 253 | static DECLARE_WAIT_QUEUE_HEAD (scandv_waitq); | ||
| 254 | static int scandv_wait_done = 1; | ||
| 255 | |||
| 256 | |||
| 257 | /* Driver command line structure | ||
| 258 | */ | ||
| 259 | static 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 | */ |
| 622 | static int | 552 | int |
| 623 | mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | 553 | mptscsih_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 | */ | ||
| 988 | static long last_queue_full = 0; | ||
| 989 | 912 | ||
| 990 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 913 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 991 | /* | 914 | /* |
| @@ -1003,280 +926,20 @@ static void | |||
| 1003 | mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq) | 926 | mptscsih_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 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | ||
| 1019 | static 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 | |||
| 1031 | static int | ||
| 1032 | mptscsih_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 | |||
| 1275 | mptscsih_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 | */ |
| 1289 | static void | 952 | void |
| 1290 | mptscsih_remove(struct pci_dev *pdev) | 953 | mptscsih_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 | */ |
| 1365 | static void | 1028 | void |
| 1366 | mptscsih_shutdown(struct device * dev) | 1029 | mptscsih_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 | */ |
| 1391 | static int | 1054 | int |
| 1392 | mptscsih_suspend(struct pci_dev *pdev, pm_message_t state) | 1055 | mptscsih_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 | */ |
| 1404 | static int | 1067 | int |
| 1405 | mptscsih_resume(struct pci_dev *pdev) | 1068 | mptscsih_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 | ||
| 1438 | static 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 | */ | ||
| 1456 | static int __init | ||
| 1457 | mptscsih_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 | */ | ||
| 1492 | static void __exit | ||
| 1493 | mptscsih_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 | */ |
| 1523 | static const char * | 1112 | const char * |
| 1524 | mptscsih_info(struct Scsi_Host *SChost) | 1113 | mptscsih_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 | ||
| 1543 | struct info_str { | 1133 | struct info_str { |
| @@ -1547,7 +1137,8 @@ struct info_str { | |||
| 1547 | int pos; | 1137 | int pos; |
| 1548 | }; | 1138 | }; |
| 1549 | 1139 | ||
| 1550 | static void copy_mem_info(struct info_str *info, char *data, int len) | 1140 | static void |
| 1141 | mptscsih_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 | ||
| 1571 | static int copy_info(struct info_str *info, char *fmt, ...) | 1162 | static int |
| 1163 | mptscsih_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 | ||
| 1585 | static int mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int len) | 1177 | static int |
| 1178 | mptscsih_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 | */ |
| 1615 | static int | 1208 | int |
| 1616 | mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, | 1209 | mptscsih_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 | */ |
| 1652 | static int | 1245 | int |
| 1653 | mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 1246 | mptscsih_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 | */ |
| 2110 | static int | 1702 | int |
| 2111 | mptscsih_abort(struct scsi_cmnd * SCpnt) | 1703 | mptscsih_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 | */ |
| 2213 | static int | 1800 | int |
| 2214 | mptscsih_dev_reset(struct scsi_cmnd * SCpnt) | 1801 | mptscsih_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 | */ |
| 2263 | static int | 1846 | int |
| 2264 | mptscsih_bus_reset(struct scsi_cmnd * SCpnt) | 1847 | mptscsih_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 | */ |
| 2315 | static int | 1897 | int |
| 2316 | mptscsih_host_reset(struct scsi_cmnd *SCpnt) | 1898 | mptscsih_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 | */ |
| 2429 | static int | 2007 | int |
| 2430 | mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | 2008 | mptscsih_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 | */ |
| 2512 | static int | 2090 | int |
| 2513 | mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, | 2091 | mptscsih_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 | */ |
| 2559 | static int | 2137 | int |
| 2560 | mptscsih_slave_alloc(struct scsi_device *device) | 2138 | mptscsih_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 | ||
| 2602 | static int mptscsih_is_raid_volume(MPT_SCSI_HOST *hd, uint id) | 2180 | static int |
| 2181 | mptscsih_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 | */ |
| 2621 | static void | 2200 | void |
| 2622 | mptscsih_slave_destroy(struct scsi_device *device) | 2201 | mptscsih_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 | */ |
| 2698 | static int | 2277 | int |
| 2699 | mptscsih_slave_configure(struct scsi_device *device) | 2278 | mptscsih_slave_configure(struct scsi_device *device) |
| 2700 | { | 2279 | { |
| 2701 | struct Scsi_Host *sh = device->host; | 2280 | struct Scsi_Host *sh = device->host; |
| @@ -2758,8 +2337,8 @@ slave_configure_exit: | |||
| 2758 | return 0; | 2337 | return 0; |
| 2759 | } | 2338 | } |
| 2760 | 2339 | ||
| 2761 | static ssize_t | 2340 | ssize_t |
| 2762 | mptscsih_store_queue_depth(struct device *dev, const char *buf, size_t count) | 2341 | mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
| 2763 | { | 2342 | { |
| 2764 | int depth; | 2343 | int depth; |
| 2765 | struct scsi_device *sdev = to_scsi_device(dev); | 2344 | struct scsi_device *sdev = to_scsi_device(dev); |
| @@ -2788,7 +2367,7 @@ mptscsih_store_queue_depth(struct device *dev, const char *buf, size_t count) | |||
| 2788 | * | 2367 | * |
| 2789 | */ | 2368 | */ |
| 2790 | static void | 2369 | static void |
| 2791 | copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply) | 2370 | mptscsih_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 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 2857 | static int | 2436 | int |
| 2858 | mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | 2437 | mptscsih_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 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 2972 | static int | 2551 | int |
| 2973 | mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) | 2552 | mptscsih_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 | ||
| 3088 | static 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 | |||
| 3096 | static struct device_attribute *mptscsih_dev_attrs[] = { | ||
| 3097 | &mptscsih_queue_depth_attr, | ||
| 3098 | NULL, | ||
| 3099 | }; | ||
| 3100 | |||
| 3101 | static 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 | */ |
| 3429 | static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq) | 2972 | static void |
| 2973 | mptscsih_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 | */ |
| 3467 | static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id) | 3011 | static void |
| 3012 | mptscsih_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 | */ |
| 3827 | static int | 3372 | int |
| 3828 | mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | 3373 | mptscsih_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 | */ |
| 3987 | static void mptscsih_timer_expired(unsigned long data) | 3533 | void |
| 3534 | mptscsih_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 | */ |
| 4643 | static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id) | 4190 | static int |
| 4191 | mptscsih_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 | */ |
| 4662 | static void mptscsih_qas_check(MPT_SCSI_HOST *hd, int id) | 4210 | static void |
| 4211 | mptscsih_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 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 5567 | EXPORT_SYMBOL(mptscsih_remove); |
| 5568 | EXPORT_SYMBOL(mptscsih_shutdown); | ||
| 5569 | #ifdef CONFIG_PM | ||
| 5570 | EXPORT_SYMBOL(mptscsih_suspend); | ||
| 5571 | EXPORT_SYMBOL(mptscsih_resume); | ||
| 5572 | #endif | ||
| 5573 | EXPORT_SYMBOL(mptscsih_proc_info); | ||
| 5574 | EXPORT_SYMBOL(mptscsih_info); | ||
| 5575 | EXPORT_SYMBOL(mptscsih_qcmd); | ||
| 5576 | EXPORT_SYMBOL(mptscsih_slave_alloc); | ||
| 5577 | EXPORT_SYMBOL(mptscsih_slave_destroy); | ||
| 5578 | EXPORT_SYMBOL(mptscsih_slave_configure); | ||
| 5579 | EXPORT_SYMBOL(mptscsih_abort); | ||
| 5580 | EXPORT_SYMBOL(mptscsih_dev_reset); | ||
| 5581 | EXPORT_SYMBOL(mptscsih_bus_reset); | ||
| 5582 | EXPORT_SYMBOL(mptscsih_host_reset); | ||
| 5583 | EXPORT_SYMBOL(mptscsih_bios_param); | ||
| 5584 | EXPORT_SYMBOL(mptscsih_io_done); | ||
| 5585 | EXPORT_SYMBOL(mptscsih_taskmgmt_complete); | ||
| 5586 | EXPORT_SYMBOL(mptscsih_scandv_complete); | ||
| 5587 | EXPORT_SYMBOL(mptscsih_event_process); | ||
| 5588 | EXPORT_SYMBOL(mptscsih_ioc_reset); | ||
| 5589 | EXPORT_SYMBOL(mptscsih_store_queue_depth); | ||
| 5590 | EXPORT_SYMBOL(mptscsih_timer_expired); | ||
| 6019 | 5591 | ||
| 6020 | module_init(mptscsih_init); | 5592 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 6021 | module_exit(mptscsih_exit); | ||
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index 5cb2fd45c38f..d73aec33e16a 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 | |||
| 84 | extern void mptscsih_remove(struct pci_dev *); | ||
| 85 | extern void mptscsih_shutdown(struct device *); | ||
| 86 | #ifdef CONFIG_PM | ||
| 87 | extern int mptscsih_suspend(struct pci_dev *pdev, u32 state); | ||
| 88 | extern int mptscsih_resume(struct pci_dev *pdev); | ||
| 94 | #endif | 89 | #endif |
| 90 | extern int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int func); | ||
| 91 | extern const char * mptscsih_info(struct Scsi_Host *SChost); | ||
| 92 | extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)); | ||
| 93 | extern int mptscsih_slave_alloc(struct scsi_device *device); | ||
| 94 | extern void mptscsih_slave_destroy(struct scsi_device *device); | ||
| 95 | extern int mptscsih_slave_configure(struct scsi_device *device); | ||
| 96 | extern int mptscsih_abort(struct scsi_cmnd * SCpnt); | ||
| 97 | extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt); | ||
| 98 | extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt); | ||
| 99 | extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt); | ||
| 100 | extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]); | ||
| 101 | extern int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); | ||
| 102 | extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); | ||
| 103 | extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); | ||
| 104 | extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); | ||
| 105 | extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); | ||
| 106 | extern ssize_t mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); | ||
| 107 | extern 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 | |||
| 74 | MODULE_AUTHOR(MODULEAUTHOR); | ||
| 75 | MODULE_DESCRIPTION(my_NAME); | ||
| 76 | MODULE_LICENSE("GPL"); | ||
| 77 | |||
| 78 | /* Command line args */ | ||
| 79 | #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION | ||
| 80 | static int mpt_dv = MPTSCSIH_DOMAIN_VALIDATION; | ||
| 81 | module_param(mpt_dv, int, 0); | ||
| 82 | MODULE_PARM_DESC(mpt_dv, " DV Algorithm: enhanced=1, basic=0 (default=MPTSCSIH_DOMAIN_VALIDATION=1)"); | ||
| 83 | |||
| 84 | static int mpt_width = MPTSCSIH_MAX_WIDTH; | ||
| 85 | module_param(mpt_width, int, 0); | ||
| 86 | MODULE_PARM_DESC(mpt_width, " Max Bus Width: wide=1, narrow=0 (default=MPTSCSIH_MAX_WIDTH=1)"); | ||
| 87 | |||
| 88 | static ushort mpt_factor = MPTSCSIH_MIN_SYNC; | ||
| 89 | module_param(mpt_factor, ushort, 0); | ||
| 90 | MODULE_PARM_DESC(mpt_factor, " Min Sync Factor (default=MPTSCSIH_MIN_SYNC=0x08)"); | ||
| 91 | #endif | ||
| 92 | |||
| 93 | static int mpt_saf_te = MPTSCSIH_SAF_TE; | ||
| 94 | module_param(mpt_saf_te, int, 0); | ||
| 95 | MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1 (default=MPTSCSIH_SAF_TE=0)"); | ||
| 96 | |||
| 97 | static int mpt_pq_filter = 0; | ||
| 98 | module_param(mpt_pq_filter, int, 0); | ||
| 99 | MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)"); | ||
| 100 | |||
| 101 | static int mptspiDoneCtx = -1; | ||
| 102 | static int mptspiTaskCtx = -1; | ||
| 103 | static int mptspiInternalCtx = -1; /* Used only for internal commands */ | ||
| 104 | |||
| 105 | static 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 | |||
| 113 | static struct device_attribute *mptspi_dev_attrs[] = { | ||
| 114 | &mptspi_queue_depth_attr, | ||
| 115 | NULL, | ||
| 116 | }; | ||
| 117 | |||
| 118 | static 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 | |||
| 146 | static 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 | }; | ||
| 153 | MODULE_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 | */ | ||
| 164 | static int | ||
| 165 | mptspi_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 | |||
| 411 | mptspi_probe_failed: | ||
| 412 | |||
| 413 | mptscsih_remove(pdev); | ||
| 414 | return error; | ||
| 415 | } | ||
| 416 | |||
| 417 | static 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 | */ | ||
| 438 | static int __init | ||
| 439 | mptspi_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 | */ | ||
| 467 | static void __exit | ||
| 468 | mptspi_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 | |||
| 485 | module_init(mptspi_init); | ||
| 486 | module_exit(mptspi_exit); | ||
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index 8d132b0d6b12..06e8eb19a05c 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig | |||
| @@ -24,10 +24,28 @@ config I2O | |||
| 24 | 24 | ||
| 25 | If unsure, say N. | 25 | If unsure, say N. |
| 26 | 26 | ||
| 27 | config I2O_EXT_ADAPTEC | ||
| 28 | bool "Enable Adaptec extensions" | ||
| 29 | depends on I2O | ||
| 30 | default y | ||
| 31 | ---help--- | ||
| 32 | Say Y for support of raidutils for Adaptec I2O controllers. You also | ||
| 33 | have to say Y to "I2O Configuration support", "I2O SCSI OSM" below | ||
| 34 | and to "SCSI generic support" under "SCSI device configuration". | ||
| 35 | |||
| 36 | config I2O_EXT_ADAPTEC_DMA64 | ||
| 37 | bool "Enable 64-bit DMA" | ||
| 38 | depends on I2O_EXT_ADAPTEC && ( 64BIT || HIGHMEM64G ) | ||
| 39 | default y | ||
| 40 | ---help--- | ||
| 41 | Say Y for support of 64-bit DMA transfer mode on Adaptec I2O | ||
| 42 | controllers. | ||
| 43 | Note: You need at least firmware version 3709. | ||
| 44 | |||
| 27 | config I2O_CONFIG | 45 | config I2O_CONFIG |
| 28 | tristate "I2O Configuration support" | 46 | tristate "I2O Configuration support" |
| 29 | depends on PCI && I2O | 47 | depends on I2O |
| 30 | help | 48 | ---help--- |
| 31 | Say Y for support of the configuration interface for the I2O adapters. | 49 | Say Y for support of the configuration interface for the I2O adapters. |
| 32 | If you have a RAID controller from Adaptec and you want to use the | 50 | If you have a RAID controller from Adaptec and you want to use the |
| 33 | raidutils to manage your RAID array, you have to say Y here. | 51 | raidutils to manage your RAID array, you have to say Y here. |
| @@ -35,10 +53,28 @@ config I2O_CONFIG | |||
| 35 | To compile this support as a module, choose M here: the | 53 | To compile this support as a module, choose M here: the |
| 36 | module will be called i2o_config. | 54 | module will be called i2o_config. |
| 37 | 55 | ||
| 56 | config I2O_CONFIG_OLD_IOCTL | ||
| 57 | bool "Enable ioctls (OBSOLETE)" | ||
| 58 | depends on I2O_CONFIG | ||
| 59 | default y | ||
| 60 | ---help--- | ||
| 61 | Enables old ioctls. | ||
| 62 | |||
| 63 | config I2O_BUS | ||
| 64 | tristate "I2O Bus Adapter OSM" | ||
| 65 | depends on I2O | ||
| 66 | ---help--- | ||
| 67 | Include support for the I2O Bus Adapter OSM. The Bus Adapter OSM | ||
| 68 | provides access to the busses on the I2O controller. The main purpose | ||
| 69 | is to rescan the bus to find new devices. | ||
| 70 | |||
| 71 | To compile this support as a module, choose M here: the | ||
| 72 | module will be called i2o_bus. | ||
| 73 | |||
| 38 | config I2O_BLOCK | 74 | config I2O_BLOCK |
| 39 | tristate "I2O Block OSM" | 75 | tristate "I2O Block OSM" |
| 40 | depends on I2O | 76 | depends on I2O |
| 41 | help | 77 | ---help--- |
| 42 | Include support for the I2O Block OSM. The Block OSM presents disk | 78 | Include support for the I2O Block OSM. The Block OSM presents disk |
| 43 | and other structured block devices to the operating system. If you | 79 | and other structured block devices to the operating system. If you |
| 44 | are using an RAID controller, you could access the array only by | 80 | are using an RAID controller, you could access the array only by |
| @@ -51,7 +87,7 @@ config I2O_BLOCK | |||
| 51 | config I2O_SCSI | 87 | config I2O_SCSI |
| 52 | tristate "I2O SCSI OSM" | 88 | tristate "I2O SCSI OSM" |
| 53 | depends on I2O && SCSI | 89 | depends on I2O && SCSI |
| 54 | help | 90 | ---help--- |
| 55 | Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel | 91 | Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel |
| 56 | I2O controller. You can use both the SCSI and Block OSM together if | 92 | I2O controller. You can use both the SCSI and Block OSM together if |
| 57 | you wish. To access a RAID array, you must use the Block OSM driver. | 93 | you wish. To access a RAID array, you must use the Block OSM driver. |
| @@ -63,7 +99,7 @@ config I2O_SCSI | |||
| 63 | config I2O_PROC | 99 | config I2O_PROC |
| 64 | tristate "I2O /proc support" | 100 | tristate "I2O /proc support" |
| 65 | depends on I2O | 101 | depends on I2O |
| 66 | help | 102 | ---help--- |
| 67 | If you say Y here and to "/proc file system support", you will be | 103 | If you say Y here and to "/proc file system support", you will be |
| 68 | able to read I2O related information from the virtual directory | 104 | able to read I2O related information from the virtual directory |
| 69 | /proc/i2o. | 105 | /proc/i2o. |
diff --git a/drivers/message/i2o/Makefile b/drivers/message/i2o/Makefile index aabc6cdc3fce..2c2e39aa1efa 100644 --- a/drivers/message/i2o/Makefile +++ b/drivers/message/i2o/Makefile | |||
| @@ -6,8 +6,11 @@ | |||
| 6 | # | 6 | # |
| 7 | 7 | ||
| 8 | i2o_core-y += iop.o driver.o device.o debug.o pci.o exec-osm.o | 8 | i2o_core-y += iop.o driver.o device.o debug.o pci.o exec-osm.o |
| 9 | i2o_bus-y += bus-osm.o | ||
| 10 | i2o_config-y += config-osm.o | ||
| 9 | obj-$(CONFIG_I2O) += i2o_core.o | 11 | obj-$(CONFIG_I2O) += i2o_core.o |
| 10 | obj-$(CONFIG_I2O_CONFIG)+= i2o_config.o | 12 | obj-$(CONFIG_I2O_CONFIG)+= i2o_config.o |
| 13 | obj-$(CONFIG_I2O_BUS) += i2o_bus.o | ||
| 11 | obj-$(CONFIG_I2O_BLOCK) += i2o_block.o | 14 | obj-$(CONFIG_I2O_BLOCK) += i2o_block.o |
| 12 | obj-$(CONFIG_I2O_SCSI) += i2o_scsi.o | 15 | obj-$(CONFIG_I2O_SCSI) += i2o_scsi.o |
| 13 | obj-$(CONFIG_I2O_PROC) += i2o_proc.o | 16 | obj-$(CONFIG_I2O_PROC) += i2o_proc.o |
diff --git a/drivers/message/i2o/bus-osm.c b/drivers/message/i2o/bus-osm.c new file mode 100644 index 000000000000..151b228e1cb3 --- /dev/null +++ b/drivers/message/i2o/bus-osm.c | |||
| @@ -0,0 +1,164 @@ | |||
| 1 | /* | ||
| 2 | * Bus Adapter OSM | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 Markus Lidel <Markus.Lidel@shadowconnect.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | * | ||
| 11 | * Fixes/additions: | ||
| 12 | * Markus Lidel <Markus.Lidel@shadowconnect.com> | ||
| 13 | * initial version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include <linux/module.h> | ||
| 17 | #include <linux/i2o.h> | ||
| 18 | |||
| 19 | #define OSM_NAME "bus-osm" | ||
| 20 | #define OSM_VERSION "$Rev$" | ||
| 21 | #define OSM_DESCRIPTION "I2O Bus Adapter OSM" | ||
| 22 | |||
| 23 | static struct i2o_driver i2o_bus_driver; | ||
| 24 | |||
| 25 | /* Bus OSM class handling definition */ | ||
| 26 | static struct i2o_class_id i2o_bus_class_id[] = { | ||
| 27 | {I2O_CLASS_BUS_ADAPTER}, | ||
| 28 | {I2O_CLASS_END} | ||
| 29 | }; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * i2o_bus_scan - Scan the bus for new devices | ||
| 33 | * @dev: I2O device of the bus, which should be scanned | ||
| 34 | * | ||
| 35 | * Scans the bus dev for new / removed devices. After the scan a new LCT | ||
| 36 | * will be fetched automatically. | ||
| 37 | * | ||
| 38 | * Returns 0 on success or negative error code on failure. | ||
| 39 | */ | ||
| 40 | static int i2o_bus_scan(struct i2o_device *dev) | ||
| 41 | { | ||
| 42 | struct i2o_message __iomem *msg; | ||
| 43 | u32 m; | ||
| 44 | |||
| 45 | m = i2o_msg_get_wait(dev->iop, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
| 46 | if (m == I2O_QUEUE_EMPTY) | ||
| 47 | return -ETIMEDOUT; | ||
| 48 | |||
| 49 | writel(FIVE_WORD_MSG_SIZE | SGL_OFFSET_0, &msg->u.head[0]); | ||
| 50 | writel(I2O_CMD_BUS_SCAN << 24 | HOST_TID << 12 | dev->lct_data.tid, | ||
| 51 | &msg->u.head[1]); | ||
| 52 | |||
| 53 | return i2o_msg_post_wait(dev->iop, m, 60); | ||
| 54 | }; | ||
| 55 | |||
| 56 | /** | ||
| 57 | * i2o_bus_store_scan - Scan the I2O Bus Adapter | ||
| 58 | * @d: device which should be scanned | ||
| 59 | * | ||
| 60 | * Returns count. | ||
| 61 | */ | ||
| 62 | static ssize_t i2o_bus_store_scan(struct device *d, struct device_attribute *attr, const char *buf, | ||
| 63 | size_t count) | ||
| 64 | { | ||
| 65 | struct i2o_device *i2o_dev = to_i2o_device(d); | ||
| 66 | int rc; | ||
| 67 | |||
| 68 | if ((rc = i2o_bus_scan(i2o_dev))) | ||
| 69 | osm_warn("bus scan failed %d\n", rc); | ||
| 70 | |||
| 71 | return count; | ||
| 72 | } | ||
| 73 | |||
| 74 | /* Bus Adapter OSM device attributes */ | ||
| 75 | static DEVICE_ATTR(scan, S_IWUSR, NULL, i2o_bus_store_scan); | ||
| 76 | |||
| 77 | /** | ||
| 78 | * i2o_bus_probe - verify if dev is a I2O Bus Adapter device and install it | ||
| 79 | * @dev: device to verify if it is a I2O Bus Adapter device | ||
| 80 | * | ||
| 81 | * Because we want all Bus Adapters always return 0. | ||
| 82 | * | ||
| 83 | * Returns 0. | ||
| 84 | */ | ||
| 85 | static int i2o_bus_probe(struct device *dev) | ||
| 86 | { | ||
| 87 | struct i2o_device *i2o_dev = to_i2o_device(get_device(dev)); | ||
| 88 | |||
| 89 | device_create_file(dev, &dev_attr_scan); | ||
| 90 | |||
| 91 | osm_info("device added (TID: %03x)\n", i2o_dev->lct_data.tid); | ||
| 92 | |||
| 93 | return 0; | ||
| 94 | }; | ||
| 95 | |||
| 96 | /** | ||
| 97 | * i2o_bus_remove - remove the I2O Bus Adapter device from the system again | ||
| 98 | * @dev: I2O Bus Adapter device which should be removed | ||
| 99 | * | ||
| 100 | * Always returns 0. | ||
| 101 | */ | ||
| 102 | static int i2o_bus_remove(struct device *dev) | ||
| 103 | { | ||
| 104 | struct i2o_device *i2o_dev = to_i2o_device(dev); | ||
| 105 | |||
| 106 | device_remove_file(dev, &dev_attr_scan); | ||
| 107 | |||
| 108 | put_device(dev); | ||
| 109 | |||
| 110 | osm_info("device removed (TID: %03x)\n", i2o_dev->lct_data.tid); | ||
| 111 | |||
| 112 | return 0; | ||
| 113 | }; | ||
| 114 | |||
| 115 | /* Bus Adapter OSM driver struct */ | ||
| 116 | static struct i2o_driver i2o_bus_driver = { | ||
| 117 | .name = OSM_NAME, | ||
| 118 | .classes = i2o_bus_class_id, | ||
| 119 | .driver = { | ||
| 120 | .probe = i2o_bus_probe, | ||
| 121 | .remove = i2o_bus_remove, | ||
| 122 | }, | ||
| 123 | }; | ||
| 124 | |||
| 125 | /** | ||
| 126 | * i2o_bus_init - Bus Adapter OSM initialization function | ||
| 127 | * | ||
| 128 | * Only register the Bus Adapter OSM in the I2O core. | ||
| 129 | * | ||
| 130 | * Returns 0 on success or negative error code on failure. | ||
| 131 | */ | ||
| 132 | static int __init i2o_bus_init(void) | ||
| 133 | { | ||
| 134 | int rc; | ||
| 135 | |||
| 136 | printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n"); | ||
| 137 | |||
| 138 | /* Register Bus Adapter OSM into I2O core */ | ||
| 139 | rc = i2o_driver_register(&i2o_bus_driver); | ||
| 140 | if (rc) { | ||
| 141 | osm_err("Could not register Bus Adapter OSM\n"); | ||
| 142 | return rc; | ||
| 143 | } | ||
| 144 | |||
| 145 | return 0; | ||
| 146 | }; | ||
| 147 | |||
| 148 | /** | ||
| 149 | * i2o_bus_exit - Bus Adapter OSM exit function | ||
| 150 | * | ||
| 151 | * Unregisters Bus Adapter OSM from I2O core. | ||
| 152 | */ | ||
| 153 | static void __exit i2o_bus_exit(void) | ||
| 154 | { | ||
| 155 | i2o_driver_unregister(&i2o_bus_driver); | ||
| 156 | }; | ||
| 157 | |||
| 158 | MODULE_AUTHOR("Markus Lidel <Markus.Lidel@shadowconnect.com>"); | ||
| 159 | MODULE_LICENSE("GPL"); | ||
| 160 | MODULE_DESCRIPTION(OSM_DESCRIPTION); | ||
| 161 | MODULE_VERSION(OSM_VERSION); | ||
| 162 | |||
| 163 | module_init(i2o_bus_init); | ||
| 164 | module_exit(i2o_bus_exit); | ||
diff --git a/drivers/message/i2o/config-osm.c b/drivers/message/i2o/config-osm.c new file mode 100644 index 000000000000..d0267609a949 --- /dev/null +++ b/drivers/message/i2o/config-osm.c | |||
| @@ -0,0 +1,579 @@ | |||
| 1 | /* | ||
| 2 | * Configuration OSM | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 Markus Lidel <Markus.Lidel@shadowconnect.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | * | ||
| 11 | * Fixes/additions: | ||
| 12 | * Markus Lidel <Markus.Lidel@shadowconnect.com> | ||
| 13 | * initial version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include <linux/module.h> | ||
| 17 | #include <linux/i2o.h> | ||
| 18 | #include <linux/namei.h> | ||
| 19 | |||
| 20 | #include <asm/uaccess.h> | ||
| 21 | |||
| 22 | #define OSM_NAME "config-osm" | ||
| 23 | #define OSM_VERSION "1.248" | ||
| 24 | #define OSM_DESCRIPTION "I2O Configuration OSM" | ||
| 25 | |||
| 26 | /* access mode user rw */ | ||
| 27 | #define S_IWRSR (S_IRUSR | S_IWUSR) | ||
| 28 | |||
| 29 | static struct i2o_driver i2o_config_driver; | ||
| 30 | |||
| 31 | /* Special file operations for sysfs */ | ||
| 32 | struct fops_attribute { | ||
| 33 | struct bin_attribute bin; | ||
| 34 | struct file_operations fops; | ||
| 35 | }; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * sysfs_read_dummy | ||
| 39 | */ | ||
| 40 | static ssize_t sysfs_read_dummy(struct kobject *kobj, char *buf, loff_t offset, | ||
| 41 | size_t count) | ||
| 42 | { | ||
| 43 | return 0; | ||
| 44 | }; | ||
| 45 | |||
| 46 | /** | ||
| 47 | * sysfs_write_dummy | ||
| 48 | */ | ||
| 49 | static ssize_t sysfs_write_dummy(struct kobject *kobj, char *buf, loff_t offset, | ||
| 50 | size_t count) | ||
| 51 | { | ||
| 52 | return 0; | ||
| 53 | }; | ||
| 54 | |||
| 55 | /** | ||
| 56 | * sysfs_create_fops_file - Creates attribute with special file operations | ||
| 57 | * @kobj: kobject which should contains the attribute | ||
| 58 | * @attr: attributes which should be used to create file | ||
| 59 | * | ||
| 60 | * First creates attribute @attr in kobject @kobj. If it is the first time | ||
| 61 | * this function is called, merge old fops from sysfs with new one and | ||
| 62 | * write it back. Afterwords the new fops will be set for the created | ||
| 63 | * attribute. | ||
| 64 | * | ||
| 65 | * Returns 0 on success or negative error code on failure. | ||
| 66 | */ | ||
| 67 | static int sysfs_create_fops_file(struct kobject *kobj, | ||
| 68 | struct fops_attribute *attr) | ||
| 69 | { | ||
| 70 | struct file_operations tmp, *fops; | ||
| 71 | struct dentry *d; | ||
| 72 | struct qstr qstr; | ||
| 73 | int rc; | ||
| 74 | |||
| 75 | fops = &attr->fops; | ||
| 76 | |||
| 77 | if (fops->read) | ||
| 78 | attr->bin.read = sysfs_read_dummy; | ||
| 79 | |||
| 80 | if (fops->write) | ||
| 81 | attr->bin.write = sysfs_write_dummy; | ||
| 82 | |||
| 83 | if ((rc = sysfs_create_bin_file(kobj, &attr->bin))) | ||
| 84 | return rc; | ||
| 85 | |||
| 86 | qstr.name = attr->bin.attr.name; | ||
| 87 | qstr.len = strlen(qstr.name); | ||
| 88 | qstr.hash = full_name_hash(qstr.name, qstr.len); | ||
| 89 | |||
| 90 | if ((d = lookup_hash(&qstr, kobj->dentry))) { | ||
| 91 | if (!fops->owner) { | ||
| 92 | memcpy(&tmp, d->d_inode->i_fop, sizeof(tmp)); | ||
| 93 | if (fops->read) | ||
| 94 | tmp.read = fops->read; | ||
| 95 | if (fops->write) | ||
| 96 | tmp.write = fops->write; | ||
| 97 | memcpy(fops, &tmp, sizeof(tmp)); | ||
| 98 | } | ||
| 99 | |||
| 100 | d->d_inode->i_fop = fops; | ||
| 101 | } else | ||
| 102 | sysfs_remove_bin_file(kobj, &attr->bin); | ||
| 103 | |||
| 104 | return -ENOENT; | ||
| 105 | }; | ||
| 106 | |||
| 107 | /** | ||
| 108 | * sysfs_remove_fops_file - Remove attribute with special file operations | ||
| 109 | * @kobj: kobject which contains the attribute | ||
| 110 | * @attr: attributes which are used to create file | ||
| 111 | * | ||
| 112 | * Only wrapper arround sysfs_remove_bin_file() | ||
| 113 | * | ||
| 114 | * Returns 0 on success or negative error code on failure. | ||
| 115 | */ | ||
| 116 | static inline int sysfs_remove_fops_file(struct kobject *kobj, | ||
| 117 | struct fops_attribute *attr) | ||
| 118 | { | ||
| 119 | return sysfs_remove_bin_file(kobj, &attr->bin); | ||
| 120 | }; | ||
| 121 | |||
| 122 | /** | ||
| 123 | * i2o_config_read_hrt - Returns the HRT of the controller | ||
| 124 | * @kob: kernel object handle | ||
| 125 | * @buf: buffer into which the HRT should be copied | ||
| 126 | * @off: file offset | ||
| 127 | * @count: number of bytes to read | ||
| 128 | * | ||
| 129 | * Put @count bytes starting at @off into @buf from the HRT of the I2O | ||
| 130 | * controller corresponding to @kobj. | ||
| 131 | * | ||
| 132 | * Returns number of bytes copied into buffer. | ||
| 133 | */ | ||
| 134 | static ssize_t i2o_config_read_hrt(struct kobject *kobj, char *buf, | ||
| 135 | loff_t offset, size_t count) | ||
| 136 | { | ||
| 137 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
| 138 | i2o_hrt *hrt = c->hrt.virt; | ||
| 139 | |||
| 140 | u32 size = (hrt->num_entries * hrt->entry_len + 2) * 4; | ||
| 141 | |||
| 142 | if (offset > size) | ||
| 143 | return 0; | ||
| 144 | |||
| 145 | if (offset + count > size) | ||
| 146 | count = size - offset; | ||
| 147 | |||
| 148 | memcpy(buf, (u8 *) hrt + offset, count); | ||
| 149 | |||
| 150 | return count; | ||
| 151 | }; | ||
| 152 | |||
| 153 | /** | ||
| 154 | * i2o_config_read_lct - Returns the LCT of the controller | ||
| 155 | * @kob: kernel object handle | ||
| 156 | * @buf: buffer into which the LCT should be copied | ||
| 157 | * @off: file offset | ||
| 158 | * @count: number of bytes to read | ||
| 159 | * | ||
| 160 | * Put @count bytes starting at @off into @buf from the LCT of the I2O | ||
| 161 | * controller corresponding to @kobj. | ||
| 162 | * | ||
| 163 | * Returns number of bytes copied into buffer. | ||
| 164 | */ | ||
| 165 | static ssize_t i2o_config_read_lct(struct kobject *kobj, char *buf, | ||
| 166 | loff_t offset, size_t count) | ||
| 167 | { | ||
| 168 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
| 169 | u32 size = c->lct->table_size * 4; | ||
| 170 | |||
| 171 | if (offset > size) | ||
| 172 | return 0; | ||
| 173 | |||
| 174 | if (offset + count > size) | ||
| 175 | count = size - offset; | ||
| 176 | |||
| 177 | memcpy(buf, (u8 *) c->lct + offset, count); | ||
| 178 | |||
| 179 | return count; | ||
| 180 | }; | ||
| 181 | |||
| 182 | #define I2O_CONFIG_SW_ATTR(_name,_mode,_type,_swid) \ | ||
| 183 | static ssize_t i2o_config_##_name##_read(struct file *file, char __user *buf, size_t count, loff_t * offset) { \ | ||
| 184 | return i2o_config_sw_read(file, buf, count, offset, _type, _swid); \ | ||
| 185 | };\ | ||
| 186 | \ | ||
| 187 | static ssize_t i2o_config_##_name##_write(struct file *file, const char __user *buf, size_t count, loff_t * offset) { \ | ||
| 188 | return i2o_config_sw_write(file, buf, count, offset, _type, _swid); \ | ||
| 189 | }; \ | ||
| 190 | \ | ||
| 191 | static struct fops_attribute i2o_config_attr_##_name = { \ | ||
| 192 | .bin = { .attr = { .name = __stringify(_name), .mode = _mode, \ | ||
| 193 | .owner = THIS_MODULE }, \ | ||
| 194 | .size = 0, }, \ | ||
| 195 | .fops = { .write = i2o_config_##_name##_write, \ | ||
| 196 | .read = i2o_config_##_name##_read} \ | ||
| 197 | }; | ||
| 198 | |||
| 199 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 200 | |||
| 201 | /** | ||
| 202 | * i2o_config_dpt_reagion - Converts type and id to flash region | ||
| 203 | * @swtype: type of software module reading | ||
| 204 | * @swid: id of software which should be read | ||
| 205 | * | ||
| 206 | * Converts type and id from I2O spec to the matching region for DPT / | ||
| 207 | * Adaptec controllers. | ||
| 208 | * | ||
| 209 | * Returns region which match type and id or -1 on error. | ||
| 210 | */ | ||
| 211 | static u32 i2o_config_dpt_region(u8 swtype, u8 swid) | ||
| 212 | { | ||
| 213 | switch (swtype) { | ||
| 214 | case I2O_SOFTWARE_MODULE_IRTOS: | ||
| 215 | /* | ||
| 216 | * content: operation firmware | ||
| 217 | * region size: | ||
| 218 | * 0xbc000 for 2554, 3754, 2564, 3757 | ||
| 219 | * 0x170000 for 2865 | ||
| 220 | * 0x17c000 for 3966 | ||
| 221 | */ | ||
| 222 | if (!swid) | ||
| 223 | return 0; | ||
| 224 | |||
| 225 | break; | ||
| 226 | |||
| 227 | case I2O_SOFTWARE_MODULE_IOP_PRIVATE: | ||
| 228 | /* | ||
| 229 | * content: BIOS and SMOR | ||
| 230 | * BIOS size: first 0x8000 bytes | ||
| 231 | * region size: | ||
| 232 | * 0x40000 for 2554, 3754, 2564, 3757 | ||
| 233 | * 0x80000 for 2865, 3966 | ||
| 234 | */ | ||
| 235 | if (!swid) | ||
| 236 | return 1; | ||
| 237 | |||
| 238 | break; | ||
| 239 | |||
| 240 | case I2O_SOFTWARE_MODULE_IOP_CONFIG: | ||
| 241 | switch (swid) { | ||
| 242 | case 0: | ||
| 243 | /* | ||
| 244 | * content: NVRAM defaults | ||
| 245 | * region size: 0x2000 bytes | ||
| 246 | */ | ||
| 247 | return 2; | ||
| 248 | case 1: | ||
| 249 | /* | ||
| 250 | * content: serial number | ||
| 251 | * region size: 0x2000 bytes | ||
| 252 | */ | ||
| 253 | return 3; | ||
| 254 | } | ||
| 255 | break; | ||
| 256 | } | ||
| 257 | |||
| 258 | return -1; | ||
| 259 | }; | ||
| 260 | |||
| 261 | #endif | ||
| 262 | |||
| 263 | /** | ||
| 264 | * i2o_config_sw_read - Read a software module from controller | ||
| 265 | * @file: file pointer | ||
| 266 | * @buf: buffer into which the data should be copied | ||
| 267 | * @count: number of bytes to read | ||
| 268 | * @off: file offset | ||
| 269 | * @swtype: type of software module reading | ||
| 270 | * @swid: id of software which should be read | ||
| 271 | * | ||
| 272 | * Transfers @count bytes at offset @offset from IOP into buffer using | ||
| 273 | * type @swtype and id @swid as described in I2O spec. | ||
| 274 | * | ||
| 275 | * Returns number of bytes copied into buffer or error code on failure. | ||
| 276 | */ | ||
| 277 | static ssize_t i2o_config_sw_read(struct file *file, char __user * buf, | ||
| 278 | size_t count, loff_t * offset, u8 swtype, | ||
| 279 | u32 swid) | ||
| 280 | { | ||
| 281 | struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; | ||
| 282 | struct kobject *kobj = sd->s_element; | ||
| 283 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
| 284 | u32 m, function = I2O_CMD_SW_UPLOAD; | ||
| 285 | struct i2o_dma buffer; | ||
| 286 | struct i2o_message __iomem *msg; | ||
| 287 | u32 __iomem *mptr; | ||
| 288 | int rc, status; | ||
| 289 | |||
| 290 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
| 291 | if (m == I2O_QUEUE_EMPTY) | ||
| 292 | return -EBUSY; | ||
| 293 | |||
| 294 | mptr = &msg->body[3]; | ||
| 295 | |||
| 296 | if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) { | ||
| 297 | i2o_msg_nop(c, m); | ||
| 298 | return rc; | ||
| 299 | } | ||
| 300 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 301 | if (c->adaptec) { | ||
| 302 | mptr = &msg->body[4]; | ||
| 303 | function = I2O_CMD_PRIVATE; | ||
| 304 | |||
| 305 | writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); | ||
| 306 | |||
| 307 | writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_READ, | ||
| 308 | &msg->body[0]); | ||
| 309 | writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); | ||
| 310 | writel(*offset, &msg->body[2]); | ||
| 311 | writel(count, &msg->body[3]); | ||
| 312 | } else | ||
| 313 | #endif | ||
| 314 | writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); | ||
| 315 | |||
| 316 | writel(0xD0000000 | count, mptr++); | ||
| 317 | writel(buffer.phys, mptr); | ||
| 318 | |||
| 319 | writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); | ||
| 320 | writel(i2o_config_driver.context, &msg->u.head[2]); | ||
| 321 | writel(0, &msg->u.head[3]); | ||
| 322 | |||
| 323 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 324 | if (!c->adaptec) | ||
| 325 | #endif | ||
| 326 | { | ||
| 327 | writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); | ||
| 328 | writel(0, &msg->body[1]); | ||
| 329 | writel(swid, &msg->body[2]); | ||
| 330 | } | ||
| 331 | |||
| 332 | status = i2o_msg_post_wait_mem(c, m, 60, &buffer); | ||
| 333 | |||
| 334 | if (status == I2O_POST_WAIT_OK) { | ||
| 335 | if (!(rc = copy_to_user(buf, buffer.virt, count))) { | ||
| 336 | rc = count; | ||
| 337 | *offset += count; | ||
| 338 | } | ||
| 339 | } else | ||
| 340 | rc = -EIO; | ||
| 341 | |||
| 342 | if (status != -ETIMEDOUT) | ||
| 343 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
| 344 | |||
| 345 | return rc; | ||
| 346 | }; | ||
| 347 | |||
| 348 | /** | ||
| 349 | * i2o_config_sw_write - Write a software module to controller | ||
| 350 | * @file: file pointer | ||
| 351 | * @buf: buffer into which the data should be copied | ||
| 352 | * @count: number of bytes to read | ||
| 353 | * @off: file offset | ||
| 354 | * @swtype: type of software module writing | ||
| 355 | * @swid: id of software which should be written | ||
| 356 | * | ||
| 357 | * Transfers @count bytes at offset @offset from buffer to IOP using | ||
| 358 | * type @swtype and id @swid as described in I2O spec. | ||
| 359 | * | ||
| 360 | * Returns number of bytes copied from buffer or error code on failure. | ||
| 361 | */ | ||
| 362 | static ssize_t i2o_config_sw_write(struct file *file, const char __user * buf, | ||
| 363 | size_t count, loff_t * offset, u8 swtype, | ||
| 364 | u32 swid) | ||
| 365 | { | ||
| 366 | struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; | ||
| 367 | struct kobject *kobj = sd->s_element; | ||
| 368 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
| 369 | u32 m, function = I2O_CMD_SW_DOWNLOAD; | ||
| 370 | struct i2o_dma buffer; | ||
| 371 | struct i2o_message __iomem *msg; | ||
| 372 | u32 __iomem *mptr; | ||
| 373 | int rc, status; | ||
| 374 | |||
| 375 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
| 376 | if (m == I2O_QUEUE_EMPTY) | ||
| 377 | return -EBUSY; | ||
| 378 | |||
| 379 | mptr = &msg->body[3]; | ||
| 380 | |||
| 381 | if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) | ||
| 382 | goto nop_msg; | ||
| 383 | |||
| 384 | if ((rc = copy_from_user(buffer.virt, buf, count))) | ||
| 385 | goto free_buffer; | ||
| 386 | |||
| 387 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 388 | if (c->adaptec) { | ||
| 389 | mptr = &msg->body[4]; | ||
| 390 | function = I2O_CMD_PRIVATE; | ||
| 391 | |||
| 392 | writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); | ||
| 393 | |||
| 394 | writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_WRITE, | ||
| 395 | &msg->body[0]); | ||
| 396 | writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); | ||
| 397 | writel(*offset, &msg->body[2]); | ||
| 398 | writel(count, &msg->body[3]); | ||
| 399 | } else | ||
| 400 | #endif | ||
| 401 | writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); | ||
| 402 | |||
| 403 | writel(0xD4000000 | count, mptr++); | ||
| 404 | writel(buffer.phys, mptr); | ||
| 405 | |||
| 406 | writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); | ||
| 407 | writel(i2o_config_driver.context, &msg->u.head[2]); | ||
| 408 | writel(0, &msg->u.head[3]); | ||
| 409 | |||
| 410 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 411 | if (!c->adaptec) | ||
| 412 | #endif | ||
| 413 | { | ||
| 414 | writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); | ||
| 415 | writel(0, &msg->body[1]); | ||
| 416 | writel(swid, &msg->body[2]); | ||
| 417 | } | ||
| 418 | |||
| 419 | status = i2o_msg_post_wait_mem(c, m, 60, &buffer); | ||
| 420 | |||
| 421 | if (status != -ETIMEDOUT) | ||
| 422 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
| 423 | |||
| 424 | if (status != I2O_POST_WAIT_OK) | ||
| 425 | return -EIO; | ||
| 426 | |||
| 427 | *offset += count; | ||
| 428 | |||
| 429 | return count; | ||
| 430 | |||
| 431 | free_buffer: | ||
| 432 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
| 433 | |||
| 434 | nop_msg: | ||
| 435 | i2o_msg_nop(c, m); | ||
| 436 | |||
| 437 | return rc; | ||
| 438 | }; | ||
| 439 | |||
| 440 | /* attribute for HRT in sysfs */ | ||
| 441 | static struct bin_attribute i2o_config_hrt_attr = { | ||
| 442 | .attr = { | ||
| 443 | .name = "hrt", | ||
| 444 | .mode = S_IRUGO, | ||
| 445 | .owner = THIS_MODULE}, | ||
| 446 | .size = 0, | ||
| 447 | .read = i2o_config_read_hrt | ||
| 448 | }; | ||
| 449 | |||
| 450 | /* attribute for LCT in sysfs */ | ||
| 451 | static struct bin_attribute i2o_config_lct_attr = { | ||
| 452 | .attr = { | ||
| 453 | .name = "lct", | ||
| 454 | .mode = S_IRUGO, | ||
| 455 | .owner = THIS_MODULE}, | ||
| 456 | .size = 0, | ||
| 457 | .read = i2o_config_read_lct | ||
| 458 | }; | ||
| 459 | |||
| 460 | /* IRTOS firmware access */ | ||
| 461 | I2O_CONFIG_SW_ATTR(irtos, S_IWRSR, I2O_SOFTWARE_MODULE_IRTOS, 0); | ||
| 462 | |||
| 463 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 464 | |||
| 465 | /* | ||
| 466 | * attribute for BIOS / SMOR, nvram and serial number access on DPT / Adaptec | ||
| 467 | * controllers | ||
| 468 | */ | ||
| 469 | I2O_CONFIG_SW_ATTR(bios, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_PRIVATE, 0); | ||
| 470 | I2O_CONFIG_SW_ATTR(nvram, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 0); | ||
| 471 | I2O_CONFIG_SW_ATTR(serial, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 1); | ||
| 472 | |||
| 473 | #endif | ||
| 474 | |||
| 475 | /** | ||
| 476 | * i2o_config_notify_controller_add - Notify of added controller | ||
| 477 | * @c: the controller which was added | ||
| 478 | * | ||
| 479 | * If a I2O controller is added, we catch the notification to add sysfs | ||
| 480 | * entries. | ||
| 481 | */ | ||
| 482 | static void i2o_config_notify_controller_add(struct i2o_controller *c) | ||
| 483 | { | ||
| 484 | struct kobject *kobj = &c->exec->device.kobj; | ||
| 485 | |||
| 486 | sysfs_create_bin_file(kobj, &i2o_config_hrt_attr); | ||
| 487 | sysfs_create_bin_file(kobj, &i2o_config_lct_attr); | ||
| 488 | |||
| 489 | sysfs_create_fops_file(kobj, &i2o_config_attr_irtos); | ||
| 490 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 491 | if (c->adaptec) { | ||
| 492 | sysfs_create_fops_file(kobj, &i2o_config_attr_bios); | ||
| 493 | sysfs_create_fops_file(kobj, &i2o_config_attr_nvram); | ||
| 494 | sysfs_create_fops_file(kobj, &i2o_config_attr_serial); | ||
| 495 | } | ||
| 496 | #endif | ||
| 497 | }; | ||
| 498 | |||
| 499 | /** | ||
| 500 | * i2o_config_notify_controller_remove - Notify of removed controller | ||
| 501 | * @c: the controller which was removed | ||
| 502 | * | ||
| 503 | * If a I2O controller is removed, we catch the notification to remove the | ||
| 504 | * sysfs entries. | ||
| 505 | */ | ||
| 506 | static void i2o_config_notify_controller_remove(struct i2o_controller *c) | ||
| 507 | { | ||
| 508 | struct kobject *kobj = &c->exec->device.kobj; | ||
| 509 | |||
| 510 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 511 | if (c->adaptec) { | ||
| 512 | sysfs_remove_fops_file(kobj, &i2o_config_attr_serial); | ||
| 513 | sysfs_remove_fops_file(kobj, &i2o_config_attr_nvram); | ||
| 514 | sysfs_remove_fops_file(kobj, &i2o_config_attr_bios); | ||
| 515 | } | ||
| 516 | #endif | ||
| 517 | sysfs_remove_fops_file(kobj, &i2o_config_attr_irtos); | ||
| 518 | |||
| 519 | sysfs_remove_bin_file(kobj, &i2o_config_lct_attr); | ||
| 520 | sysfs_remove_bin_file(kobj, &i2o_config_hrt_attr); | ||
| 521 | }; | ||
| 522 | |||
| 523 | /* Config OSM driver struct */ | ||
| 524 | static struct i2o_driver i2o_config_driver = { | ||
| 525 | .name = OSM_NAME, | ||
| 526 | .notify_controller_add = i2o_config_notify_controller_add, | ||
| 527 | .notify_controller_remove = i2o_config_notify_controller_remove | ||
| 528 | }; | ||
| 529 | |||
| 530 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL | ||
| 531 | #include "i2o_config.c" | ||
| 532 | #endif | ||
| 533 | |||
| 534 | /** | ||
| 535 | * i2o_config_init - Configuration OSM initialization function | ||
| 536 | * | ||
| 537 | * Registers Configuration OSM in the I2O core and if old ioctl's are | ||
| 538 | * compiled in initialize them. | ||
| 539 | * | ||
| 540 | * Returns 0 on success or negative error code on failure. | ||
| 541 | */ | ||
| 542 | static int __init i2o_config_init(void) | ||
| 543 | { | ||
| 544 | printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n"); | ||
| 545 | |||
| 546 | if (i2o_driver_register(&i2o_config_driver)) { | ||
| 547 | osm_err("handler register failed.\n"); | ||
| 548 | return -EBUSY; | ||
| 549 | } | ||
| 550 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL | ||
| 551 | if (i2o_config_old_init()) | ||
| 552 | i2o_driver_unregister(&i2o_config_driver); | ||
| 553 | #endif | ||
| 554 | |||
| 555 | return 0; | ||
| 556 | } | ||
| 557 | |||
| 558 | /** | ||
| 559 | * i2o_config_exit - Configuration OSM exit function | ||
| 560 | * | ||
| 561 | * If old ioctl's are compiled in exit remove them and unregisters | ||
| 562 | * Configuration OSM from I2O core. | ||
| 563 | */ | ||
| 564 | static void i2o_config_exit(void) | ||
| 565 | { | ||
| 566 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL | ||
| 567 | i2o_config_old_exit(); | ||
| 568 | #endif | ||
| 569 | |||
| 570 | i2o_driver_unregister(&i2o_config_driver); | ||
| 571 | } | ||
| 572 | |||
| 573 | MODULE_AUTHOR("Markus Lidel <Markus.Lidel@shadowconnect.com>"); | ||
| 574 | MODULE_LICENSE("GPL"); | ||
| 575 | MODULE_DESCRIPTION(OSM_DESCRIPTION); | ||
| 576 | MODULE_VERSION(OSM_VERSION); | ||
| 577 | |||
| 578 | module_init(i2o_config_init); | ||
| 579 | module_exit(i2o_config_exit); | ||
diff --git a/drivers/message/i2o/core.h b/drivers/message/i2o/core.h new file mode 100644 index 000000000000..c5bcfd70f711 --- /dev/null +++ b/drivers/message/i2o/core.h | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | /* | ||
| 2 | * I2O core internal declarations | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 Markus Lidel <Markus.Lidel@shadowconnect.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | * | ||
| 11 | * Fixes/additions: | ||
| 12 | * Markus Lidel <Markus.Lidel@shadowconnect.com> | ||
| 13 | * initial version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | /* Exec-OSM */ | ||
| 17 | extern struct bus_type i2o_bus_type; | ||
| 18 | |||
| 19 | extern struct i2o_driver i2o_exec_driver; | ||
| 20 | extern int i2o_exec_lct_get(struct i2o_controller *); | ||
| 21 | |||
| 22 | extern int __init i2o_exec_init(void); | ||
| 23 | extern void __exit i2o_exec_exit(void); | ||
| 24 | |||
| 25 | /* driver */ | ||
| 26 | extern int i2o_driver_dispatch(struct i2o_controller *, u32); | ||
| 27 | |||
| 28 | extern int __init i2o_driver_init(void); | ||
| 29 | extern void __exit i2o_driver_exit(void); | ||
| 30 | |||
| 31 | /* PCI */ | ||
| 32 | extern int __init i2o_pci_init(void); | ||
| 33 | extern void __exit i2o_pci_exit(void); | ||
| 34 | |||
| 35 | /* device */ | ||
| 36 | extern void i2o_device_remove(struct i2o_device *); | ||
| 37 | extern int i2o_device_parse_lct(struct i2o_controller *); | ||
| 38 | |||
| 39 | extern int i2o_device_init(void); | ||
| 40 | extern void i2o_device_exit(void); | ||
| 41 | |||
| 42 | /* IOP */ | ||
| 43 | extern struct i2o_controller *i2o_iop_alloc(void); | ||
| 44 | extern void i2o_iop_free(struct i2o_controller *); | ||
| 45 | |||
| 46 | extern int i2o_iop_add(struct i2o_controller *); | ||
| 47 | extern void i2o_iop_remove(struct i2o_controller *); | ||
| 48 | |||
| 49 | /* config */ | ||
| 50 | extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); | ||
| 51 | |||
| 52 | /* control registers relative to c->base */ | ||
| 53 | #define I2O_IRQ_STATUS 0x30 | ||
| 54 | #define I2O_IRQ_MASK 0x34 | ||
| 55 | #define I2O_IN_PORT 0x40 | ||
| 56 | #define I2O_OUT_PORT 0x44 | ||
| 57 | |||
| 58 | #define I2O_IRQ_OUTBOUND_POST 0x00000008 | ||
diff --git a/drivers/message/i2o/debug.c b/drivers/message/i2o/debug.c index 2a5d478fc60e..018ca887ca85 100644 --- a/drivers/message/i2o/debug.c +++ b/drivers/message/i2o/debug.c | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | #include <linux/pci.h> | 4 | #include <linux/pci.h> |
| 5 | #include <linux/i2o.h> | 5 | #include <linux/i2o.h> |
| 6 | 6 | ||
| 7 | extern struct i2o_driver **i2o_drivers; | ||
| 8 | extern unsigned int i2o_max_drivers; | ||
| 9 | static void i2o_report_util_cmd(u8 cmd); | 7 | static void i2o_report_util_cmd(u8 cmd); |
| 10 | static void i2o_report_exec_cmd(u8 cmd); | 8 | static void i2o_report_exec_cmd(u8 cmd); |
| 11 | static void i2o_report_fail_status(u8 req_status, u32 * msg); | 9 | static void i2o_report_fail_status(u8 req_status, u32 * msg); |
| @@ -23,7 +21,6 @@ void i2o_report_status(const char *severity, const char *str, | |||
| 23 | u8 cmd = (msg[1] >> 24) & 0xFF; | 21 | u8 cmd = (msg[1] >> 24) & 0xFF; |
| 24 | u8 req_status = (msg[4] >> 24) & 0xFF; | 22 | u8 req_status = (msg[4] >> 24) & 0xFF; |
| 25 | u16 detailed_status = msg[4] & 0xFFFF; | 23 | u16 detailed_status = msg[4] & 0xFFFF; |
| 26 | //struct i2o_driver *h = i2o_drivers[msg[2] & (i2o_max_drivers-1)]; | ||
| 27 | 24 | ||
| 28 | if (cmd == I2O_CMD_UTIL_EVT_REGISTER) | 25 | if (cmd == I2O_CMD_UTIL_EVT_REGISTER) |
| 29 | return; // No status in this reply | 26 | return; // No status in this reply |
diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index eb907e87bc7b..21f16ba3ac38 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c | |||
| @@ -16,9 +16,7 @@ | |||
| 16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 17 | #include <linux/i2o.h> | 17 | #include <linux/i2o.h> |
| 18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
| 19 | 19 | #include "core.h" | |
| 20 | /* Exec OSM functions */ | ||
| 21 | extern struct bus_type i2o_bus_type; | ||
| 22 | 20 | ||
| 23 | /** | 21 | /** |
| 24 | * i2o_device_issue_claim - claim or release a device | 22 | * i2o_device_issue_claim - claim or release a device |
| @@ -282,8 +280,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) | |||
| 282 | 280 | ||
| 283 | down(&c->lct_lock); | 281 | down(&c->lct_lock); |
| 284 | 282 | ||
| 285 | if (c->lct) | 283 | kfree(c->lct); |
| 286 | kfree(c->lct); | ||
| 287 | 284 | ||
| 288 | lct = c->dlct.virt; | 285 | lct = c->dlct.virt; |
| 289 | 286 | ||
| @@ -294,12 +291,12 @@ int i2o_device_parse_lct(struct i2o_controller *c) | |||
| 294 | } | 291 | } |
| 295 | 292 | ||
| 296 | if (lct->table_size * 4 > c->dlct.len) { | 293 | if (lct->table_size * 4 > c->dlct.len) { |
| 297 | memcpy_fromio(c->lct, c->dlct.virt, c->dlct.len); | 294 | memcpy(c->lct, c->dlct.virt, c->dlct.len); |
| 298 | up(&c->lct_lock); | 295 | up(&c->lct_lock); |
| 299 | return -EAGAIN; | 296 | return -EAGAIN; |
| 300 | } | 297 | } |
| 301 | 298 | ||
| 302 | memcpy_fromio(c->lct, c->dlct.virt, lct->table_size * 4); | 299 | memcpy(c->lct, c->dlct.virt, lct->table_size * 4); |
| 303 | 300 | ||
| 304 | lct = c->lct; | 301 | lct = c->lct; |
| 305 | 302 | ||
| @@ -354,7 +351,7 @@ static ssize_t i2o_device_class_show_class_id(struct class_device *cd, | |||
| 354 | { | 351 | { |
| 355 | struct i2o_device *dev = to_i2o_device(cd->dev); | 352 | struct i2o_device *dev = to_i2o_device(cd->dev); |
| 356 | 353 | ||
| 357 | sprintf(buf, "%03x\n", dev->lct_data.class_id); | 354 | sprintf(buf, "0x%03x\n", dev->lct_data.class_id); |
| 358 | return strlen(buf) + 1; | 355 | return strlen(buf) + 1; |
| 359 | }; | 356 | }; |
| 360 | 357 | ||
| @@ -369,7 +366,7 @@ static ssize_t i2o_device_class_show_tid(struct class_device *cd, char *buf) | |||
| 369 | { | 366 | { |
| 370 | struct i2o_device *dev = to_i2o_device(cd->dev); | 367 | struct i2o_device *dev = to_i2o_device(cd->dev); |
| 371 | 368 | ||
| 372 | sprintf(buf, "%03x\n", dev->lct_data.tid); | 369 | sprintf(buf, "0x%03x\n", dev->lct_data.tid); |
| 373 | return strlen(buf) + 1; | 370 | return strlen(buf) + 1; |
| 374 | }; | 371 | }; |
| 375 | 372 | ||
| @@ -401,25 +398,27 @@ static int i2o_device_class_add(struct class_device *cd) | |||
| 401 | 398 | ||
| 402 | /* create user entries for this device */ | 399 | /* create user entries for this device */ |
| 403 | tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.user_tid); | 400 | tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.user_tid); |
| 404 | if (tmp) | 401 | if (tmp && (tmp != i2o_dev)) |
| 405 | sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, | 402 | sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, |
| 406 | "user"); | 403 | "user"); |
| 407 | 404 | ||
| 408 | /* create user entries refering to this device */ | 405 | /* create user entries refering to this device */ |
| 409 | list_for_each_entry(tmp, &c->devices, list) | 406 | list_for_each_entry(tmp, &c->devices, list) |
| 410 | if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid) | 407 | if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid) |
| 408 | && (tmp != i2o_dev)) | ||
| 411 | sysfs_create_link(&tmp->device.kobj, | 409 | sysfs_create_link(&tmp->device.kobj, |
| 412 | &i2o_dev->device.kobj, "user"); | 410 | &i2o_dev->device.kobj, "user"); |
| 413 | 411 | ||
| 414 | /* create parent entries for this device */ | 412 | /* create parent entries for this device */ |
| 415 | tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.parent_tid); | 413 | tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.parent_tid); |
| 416 | if (tmp) | 414 | if (tmp && (tmp != i2o_dev)) |
| 417 | sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, | 415 | sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, |
| 418 | "parent"); | 416 | "parent"); |
| 419 | 417 | ||
| 420 | /* create parent entries refering to this device */ | 418 | /* create parent entries refering to this device */ |
| 421 | list_for_each_entry(tmp, &c->devices, list) | 419 | list_for_each_entry(tmp, &c->devices, list) |
| 422 | if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) | 420 | if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) |
| 421 | && (tmp != i2o_dev)) | ||
| 423 | sysfs_create_link(&tmp->device.kobj, | 422 | sysfs_create_link(&tmp->device.kobj, |
| 424 | &i2o_dev->device.kobj, "parent"); | 423 | &i2o_dev->device.kobj, "parent"); |
| 425 | 424 | ||
| @@ -444,9 +443,8 @@ static struct class_interface i2o_device_class_interface = { | |||
| 444 | * Note that the minimum sized reslist is 8 bytes and contains | 443 | * Note that the minimum sized reslist is 8 bytes and contains |
| 445 | * ResultCount, ErrorInfoSize, BlockStatus and BlockSize. | 444 | * ResultCount, ErrorInfoSize, BlockStatus and BlockSize. |
| 446 | */ | 445 | */ |
| 447 | |||
| 448 | int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist, | 446 | int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist, |
| 449 | int oplen, void *reslist, int reslen) | 447 | int oplen, void *reslist, int reslen) |
| 450 | { | 448 | { |
| 451 | struct i2o_message __iomem *msg; | 449 | struct i2o_message __iomem *msg; |
| 452 | u32 m; | 450 | u32 m; |
| @@ -489,7 +487,7 @@ int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist, | |||
| 489 | if (rc == -ETIMEDOUT) | 487 | if (rc == -ETIMEDOUT) |
| 490 | return rc; | 488 | return rc; |
| 491 | 489 | ||
| 492 | memcpy_fromio(reslist, res.virt, res.len); | 490 | memcpy(reslist, res.virt, res.len); |
| 493 | i2o_dma_free(dev, &res); | 491 | i2o_dma_free(dev, &res); |
| 494 | 492 | ||
| 495 | /* Query failed */ | 493 | /* Query failed */ |
| @@ -531,17 +529,23 @@ int i2o_parm_field_get(struct i2o_device *i2o_dev, int group, int field, | |||
| 531 | void *buf, int buflen) | 529 | void *buf, int buflen) |
| 532 | { | 530 | { |
| 533 | u16 opblk[] = { 1, 0, I2O_PARAMS_FIELD_GET, group, 1, field }; | 531 | u16 opblk[] = { 1, 0, I2O_PARAMS_FIELD_GET, group, 1, field }; |
| 534 | u8 resblk[8 + buflen]; /* 8 bytes for header */ | 532 | u8 *resblk; /* 8 bytes for header */ |
| 535 | int size; | 533 | int size; |
| 536 | 534 | ||
| 537 | if (field == -1) /* whole group */ | 535 | if (field == -1) /* whole group */ |
| 538 | opblk[4] = -1; | 536 | opblk[4] = -1; |
| 539 | 537 | ||
| 538 | resblk = kmalloc(buflen + 8, GFP_KERNEL | GFP_ATOMIC); | ||
| 539 | if (!resblk) | ||
| 540 | return -ENOMEM; | ||
| 541 | |||
| 540 | size = i2o_parm_issue(i2o_dev, I2O_CMD_UTIL_PARAMS_GET, opblk, | 542 | size = i2o_parm_issue(i2o_dev, I2O_CMD_UTIL_PARAMS_GET, opblk, |
| 541 | sizeof(opblk), resblk, sizeof(resblk)); | 543 | sizeof(opblk), resblk, buflen + 8); |
| 542 | 544 | ||
| 543 | memcpy(buf, resblk + 8, buflen); /* cut off header */ | 545 | memcpy(buf, resblk + 8, buflen); /* cut off header */ |
| 544 | 546 | ||
| 547 | kfree(resblk); | ||
| 548 | |||
| 545 | if (size > buflen) | 549 | if (size > buflen) |
| 546 | return buflen; | 550 | return buflen; |
| 547 | 551 | ||
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index 91f4edbb2a27..739bfdef0c6d 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c | |||
| @@ -17,9 +17,12 @@ | |||
| 17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 18 | #include <linux/rwsem.h> | 18 | #include <linux/rwsem.h> |
| 19 | #include <linux/i2o.h> | 19 | #include <linux/i2o.h> |
| 20 | #include "core.h" | ||
| 21 | |||
| 22 | #define OSM_NAME "i2o" | ||
| 20 | 23 | ||
| 21 | /* max_drivers - Maximum I2O drivers (OSMs) which could be registered */ | 24 | /* max_drivers - Maximum I2O drivers (OSMs) which could be registered */ |
| 22 | unsigned int i2o_max_drivers = I2O_MAX_DRIVERS; | 25 | static unsigned int i2o_max_drivers = I2O_MAX_DRIVERS; |
| 23 | module_param_named(max_drivers, i2o_max_drivers, uint, 0); | 26 | module_param_named(max_drivers, i2o_max_drivers, uint, 0); |
| 24 | MODULE_PARM_DESC(max_drivers, "maximum number of OSM's to support"); | 27 | MODULE_PARM_DESC(max_drivers, "maximum number of OSM's to support"); |
| 25 | 28 | ||
| @@ -76,17 +79,16 @@ int i2o_driver_register(struct i2o_driver *drv) | |||
| 76 | int rc = 0; | 79 | int rc = 0; |
| 77 | unsigned long flags; | 80 | unsigned long flags; |
| 78 | 81 | ||
| 79 | pr_debug("i2o: Register driver %s\n", drv->name); | 82 | osm_debug("Register driver %s\n", drv->name); |
| 80 | 83 | ||
| 81 | if (drv->event) { | 84 | if (drv->event) { |
| 82 | drv->event_queue = create_workqueue(drv->name); | 85 | drv->event_queue = create_workqueue(drv->name); |
| 83 | if (!drv->event_queue) { | 86 | if (!drv->event_queue) { |
| 84 | printk(KERN_ERR "i2o: Could not initialize event queue " | 87 | osm_err("Could not initialize event queue for driver " |
| 85 | "for driver %s\n", drv->name); | 88 | "%s\n", drv->name); |
| 86 | return -EFAULT; | 89 | return -EFAULT; |
| 87 | } | 90 | } |
| 88 | pr_debug("i2o: Event queue initialized for driver %s\n", | 91 | osm_debug("Event queue initialized for driver %s\n", drv->name); |
| 89 | drv->name); | ||
| 90 | } else | 92 | } else |
| 91 | drv->event_queue = NULL; | 93 | drv->event_queue = NULL; |
| 92 | 94 | ||
| @@ -97,8 +99,8 @@ int i2o_driver_register(struct i2o_driver *drv) | |||
| 97 | 99 | ||
| 98 | for (i = 0; i2o_drivers[i]; i++) | 100 | for (i = 0; i2o_drivers[i]; i++) |
| 99 | if (i >= i2o_max_drivers) { | 101 | if (i >= i2o_max_drivers) { |
| 100 | printk(KERN_ERR "i2o: too many drivers registered, " | 102 | osm_err("too many drivers registered, increase " |
| 101 | "increase max_drivers\n"); | 103 | "max_drivers\n"); |
| 102 | spin_unlock_irqrestore(&i2o_drivers_lock, flags); | 104 | spin_unlock_irqrestore(&i2o_drivers_lock, flags); |
| 103 | return -EFAULT; | 105 | return -EFAULT; |
| 104 | } | 106 | } |
| @@ -108,18 +110,16 @@ int i2o_driver_register(struct i2o_driver *drv) | |||
| 108 | 110 | ||
| 109 | spin_unlock_irqrestore(&i2o_drivers_lock, flags); | 111 | spin_unlock_irqrestore(&i2o_drivers_lock, flags); |
| 110 | 112 | ||
| 111 | pr_debug("i2o: driver %s gets context id %d\n", drv->name, | 113 | osm_debug("driver %s gets context id %d\n", drv->name, drv->context); |
| 112 | drv->context); | ||
| 113 | 114 | ||
| 114 | list_for_each_entry(c, &i2o_controllers, list) { | 115 | list_for_each_entry(c, &i2o_controllers, list) { |
| 115 | struct i2o_device *i2o_dev; | 116 | struct i2o_device *i2o_dev; |
| 116 | 117 | ||
| 117 | i2o_driver_notify_controller_add(drv, c); | 118 | i2o_driver_notify_controller_add(drv, c); |
| 118 | list_for_each_entry(i2o_dev, &c->devices, list) | 119 | list_for_each_entry(i2o_dev, &c->devices, list) |
| 119 | i2o_driver_notify_device_add(drv, i2o_dev); | 120 | i2o_driver_notify_device_add(drv, i2o_dev); |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | |||
| 123 | rc = driver_register(&drv->driver); | 123 | rc = driver_register(&drv->driver); |
| 124 | if (rc) | 124 | if (rc) |
| 125 | destroy_workqueue(drv->event_queue); | 125 | destroy_workqueue(drv->event_queue); |
| @@ -139,7 +139,7 @@ void i2o_driver_unregister(struct i2o_driver *drv) | |||
| 139 | struct i2o_controller *c; | 139 | struct i2o_controller *c; |
| 140 | unsigned long flags; | 140 | unsigned long flags; |
| 141 | 141 | ||
| 142 | pr_debug("i2o: unregister driver %s\n", drv->name); | 142 | osm_debug("unregister driver %s\n", drv->name); |
| 143 | 143 | ||
| 144 | driver_unregister(&drv->driver); | 144 | driver_unregister(&drv->driver); |
| 145 | 145 | ||
| @@ -159,7 +159,7 @@ void i2o_driver_unregister(struct i2o_driver *drv) | |||
| 159 | if (drv->event_queue) { | 159 | if (drv->event_queue) { |
| 160 | destroy_workqueue(drv->event_queue); | 160 | destroy_workqueue(drv->event_queue); |
| 161 | drv->event_queue = NULL; | 161 | drv->event_queue = NULL; |
| 162 | pr_debug("i2o: event queue removed for %s\n", drv->name); | 162 | osm_debug("event queue removed for %s\n", drv->name); |
| 163 | } | 163 | } |
| 164 | }; | 164 | }; |
| 165 | 165 | ||
| @@ -176,68 +176,70 @@ void i2o_driver_unregister(struct i2o_driver *drv) | |||
| 176 | * on success and if the message should be flushed afterwords. Returns | 176 | * on success and if the message should be flushed afterwords. Returns |
| 177 | * negative error code on failure (the message will be flushed too). | 177 | * negative error code on failure (the message will be flushed too). |
| 178 | */ | 178 | */ |
| 179 | int i2o_driver_dispatch(struct i2o_controller *c, u32 m, | 179 | int i2o_driver_dispatch(struct i2o_controller *c, u32 m) |
| 180 | struct i2o_message __iomem *msg) | ||
| 181 | { | 180 | { |
| 182 | struct i2o_driver *drv; | 181 | struct i2o_driver *drv; |
| 183 | u32 context = readl(&msg->u.s.icntxt); | 182 | struct i2o_message *msg = i2o_msg_out_to_virt(c, m); |
| 183 | u32 context = le32_to_cpu(msg->u.s.icntxt); | ||
| 184 | unsigned long flags; | ||
| 184 | 185 | ||
| 185 | if (likely(context < i2o_max_drivers)) { | 186 | if (unlikely(context >= i2o_max_drivers)) { |
| 186 | spin_lock(&i2o_drivers_lock); | 187 | osm_warn("%s: Spurious reply to unknown driver %d\n", c->name, |
| 187 | drv = i2o_drivers[context]; | 188 | context); |
| 188 | spin_unlock(&i2o_drivers_lock); | 189 | return -EIO; |
| 190 | } | ||
| 189 | 191 | ||
| 190 | if (unlikely(!drv)) { | 192 | spin_lock_irqsave(&i2o_drivers_lock, flags); |
| 191 | printk(KERN_WARNING "%s: Spurious reply to unknown " | 193 | drv = i2o_drivers[context]; |
| 192 | "driver %d\n", c->name, context); | 194 | spin_unlock_irqrestore(&i2o_drivers_lock, flags); |
| 193 | return -EIO; | ||
| 194 | } | ||
| 195 | 195 | ||
| 196 | if ((readl(&msg->u.head[1]) >> 24) == I2O_CMD_UTIL_EVT_REGISTER) { | 196 | if (unlikely(!drv)) { |
| 197 | struct i2o_device *dev, *tmp; | 197 | osm_warn("%s: Spurious reply to unknown driver %d\n", c->name, |
| 198 | struct i2o_event *evt; | 198 | context); |
| 199 | u16 size; | 199 | return -EIO; |
| 200 | u16 tid; | 200 | } |
| 201 | 201 | ||
| 202 | tid = readl(&msg->u.head[1]) & 0x1fff; | 202 | if ((le32_to_cpu(msg->u.head[1]) >> 24) == I2O_CMD_UTIL_EVT_REGISTER) { |
| 203 | struct i2o_device *dev, *tmp; | ||
| 204 | struct i2o_event *evt; | ||
| 205 | u16 size; | ||
| 206 | u16 tid = le32_to_cpu(msg->u.head[1]) & 0xfff; | ||
| 203 | 207 | ||
| 204 | pr_debug("%s: event received from device %d\n", c->name, | 208 | osm_debug("event received from device %d\n", tid); |
| 205 | tid); | ||
| 206 | 209 | ||
| 207 | /* cut of header from message size (in 32-bit words) */ | 210 | if (!drv->event) |
| 208 | size = (readl(&msg->u.head[0]) >> 16) - 5; | 211 | return -EIO; |
| 209 | 212 | ||
| 210 | evt = kmalloc(size * 4 + sizeof(*evt), GFP_ATOMIC); | 213 | /* cut of header from message size (in 32-bit words) */ |
| 211 | if (!evt) | 214 | size = (le32_to_cpu(msg->u.head[0]) >> 16) - 5; |
| 212 | return -ENOMEM; | ||
| 213 | memset(evt, 0, size * 4 + sizeof(*evt)); | ||
| 214 | 215 | ||
| 215 | evt->size = size; | 216 | evt = kmalloc(size * 4 + sizeof(*evt), GFP_ATOMIC | __GFP_ZERO); |
| 216 | memcpy_fromio(&evt->tcntxt, &msg->u.s.tcntxt, | 217 | if (!evt) |
| 217 | (size + 2) * 4); | 218 | return -ENOMEM; |
| 218 | 219 | ||
| 219 | list_for_each_entry_safe(dev, tmp, &c->devices, list) | 220 | evt->size = size; |
| 220 | if (dev->lct_data.tid == tid) { | 221 | evt->tcntxt = le32_to_cpu(msg->u.s.tcntxt); |
| 221 | evt->i2o_dev = dev; | 222 | evt->event_indicator = le32_to_cpu(msg->body[0]); |
| 222 | break; | 223 | memcpy(&evt->tcntxt, &msg->u.s.tcntxt, size * 4); |
| 223 | } | ||
| 224 | 224 | ||
| 225 | INIT_WORK(&evt->work, (void (*)(void *))drv->event, | 225 | list_for_each_entry_safe(dev, tmp, &c->devices, list) |
| 226 | evt); | 226 | if (dev->lct_data.tid == tid) { |
| 227 | queue_work(drv->event_queue, &evt->work); | 227 | evt->i2o_dev = dev; |
| 228 | return 1; | 228 | break; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | if (likely(drv->reply)) | 231 | INIT_WORK(&evt->work, (void (*)(void *))drv->event, evt); |
| 232 | return drv->reply(c, m, msg); | 232 | queue_work(drv->event_queue, &evt->work); |
| 233 | else | 233 | return 1; |
| 234 | pr_debug("%s: Reply to driver %s, but no reply function" | 234 | } |
| 235 | " defined!\n", c->name, drv->name); | 235 | |
| 236 | if (unlikely(!drv->reply)) { | ||
| 237 | osm_debug("%s: Reply to driver %s, but no reply function" | ||
| 238 | " defined!\n", c->name, drv->name); | ||
| 236 | return -EIO; | 239 | return -EIO; |
| 237 | } else | 240 | } |
| 238 | printk(KERN_WARNING "%s: Spurious reply to unknown driver " | 241 | |
| 239 | "%d\n", c->name, readl(&msg->u.s.icntxt)); | 242 | return drv->reply(c, m, msg); |
| 240 | return -EIO; | ||
| 241 | } | 243 | } |
| 242 | 244 | ||
| 243 | /** | 245 | /** |
| @@ -334,11 +336,11 @@ int __init i2o_driver_init(void) | |||
| 334 | if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64) || | 336 | if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64) || |
| 335 | ((i2o_max_drivers ^ (i2o_max_drivers - 1)) != | 337 | ((i2o_max_drivers ^ (i2o_max_drivers - 1)) != |
| 336 | (2 * i2o_max_drivers - 1))) { | 338 | (2 * i2o_max_drivers - 1))) { |
| 337 | printk(KERN_WARNING "i2o: max_drivers set to %d, but must be " | 339 | osm_warn("max_drivers set to %d, but must be >=2 and <= 64 and " |
| 338 | ">=2 and <= 64 and a power of 2\n", i2o_max_drivers); | 340 | "a power of 2\n", i2o_max_drivers); |
| 339 | i2o_max_drivers = I2O_MAX_DRIVERS; | 341 | i2o_max_drivers = I2O_MAX_DRIVERS; |
| 340 | } | 342 | } |
| 341 | printk(KERN_INFO "i2o: max drivers = %d\n", i2o_max_drivers); | 343 | osm_info("max drivers = %d\n", i2o_max_drivers); |
| 342 | 344 | ||
| 343 | i2o_drivers = | 345 | i2o_drivers = |
| 344 | kmalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL); | 346 | kmalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL); |
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index 79c1cbfb8f44..bda2c62648ba 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
| 31 | #include <linux/i2o.h> | 31 | #include <linux/i2o.h> |
| 32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
| 33 | #include "core.h" | ||
| 33 | 34 | ||
| 34 | #define OSM_NAME "exec-osm" | 35 | #define OSM_NAME "exec-osm" |
| 35 | 36 | ||
| @@ -37,9 +38,6 @@ struct i2o_driver i2o_exec_driver; | |||
| 37 | 38 | ||
| 38 | static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind); | 39 | static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind); |
| 39 | 40 | ||
| 40 | /* Module internal functions from other sources */ | ||
| 41 | extern int i2o_device_parse_lct(struct i2o_controller *); | ||
| 42 | |||
| 43 | /* global wait list for POST WAIT */ | 41 | /* global wait list for POST WAIT */ |
| 44 | static LIST_HEAD(i2o_exec_wait_list); | 42 | static LIST_HEAD(i2o_exec_wait_list); |
| 45 | 43 | ||
| @@ -50,7 +48,7 @@ struct i2o_exec_wait { | |||
| 50 | u32 tcntxt; /* transaction context from reply */ | 48 | u32 tcntxt; /* transaction context from reply */ |
| 51 | int complete; /* 1 if reply received otherwise 0 */ | 49 | int complete; /* 1 if reply received otherwise 0 */ |
| 52 | u32 m; /* message id */ | 50 | u32 m; /* message id */ |
| 53 | struct i2o_message __iomem *msg; /* pointer to the reply message */ | 51 | struct i2o_message *msg; /* pointer to the reply message */ |
| 54 | struct list_head list; /* node in global wait list */ | 52 | struct list_head list; /* node in global wait list */ |
| 55 | }; | 53 | }; |
| 56 | 54 | ||
| @@ -108,7 +106,8 @@ static void i2o_exec_wait_free(struct i2o_exec_wait *wait) | |||
| 108 | * buffer must not be freed. Instead the event completion will free them | 106 | * buffer must not be freed. Instead the event completion will free them |
| 109 | * for you. In all other cases the buffer are your problem. | 107 | * for you. In all other cases the buffer are your problem. |
| 110 | * | 108 | * |
| 111 | * Returns 0 on success or negative error code on failure. | 109 | * Returns 0 on success, negative error code on timeout or positive error |
| 110 | * code from reply. | ||
| 112 | */ | 111 | */ |
| 113 | int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long | 112 | int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long |
| 114 | timeout, struct i2o_dma *dma) | 113 | timeout, struct i2o_dma *dma) |
| @@ -116,7 +115,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long | |||
| 116 | DECLARE_WAIT_QUEUE_HEAD(wq); | 115 | DECLARE_WAIT_QUEUE_HEAD(wq); |
| 117 | struct i2o_exec_wait *wait; | 116 | struct i2o_exec_wait *wait; |
| 118 | static u32 tcntxt = 0x80000000; | 117 | static u32 tcntxt = 0x80000000; |
| 119 | struct i2o_message __iomem *msg = c->in_queue.virt + m; | 118 | struct i2o_message __iomem *msg = i2o_msg_in_to_virt(c, m); |
| 120 | int rc = 0; | 119 | int rc = 0; |
| 121 | 120 | ||
| 122 | wait = i2o_exec_wait_alloc(); | 121 | wait = i2o_exec_wait_alloc(); |
| @@ -153,7 +152,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long | |||
| 153 | list_add(&wait->list, &i2o_exec_wait_list); | 152 | list_add(&wait->list, &i2o_exec_wait_list); |
| 154 | 153 | ||
| 155 | wait_event_interruptible_timeout(wq, wait->complete, | 154 | wait_event_interruptible_timeout(wq, wait->complete, |
| 156 | timeout * HZ); | 155 | timeout * HZ); |
| 157 | 156 | ||
| 158 | wait->wq = NULL; | 157 | wait->wq = NULL; |
| 159 | } | 158 | } |
| @@ -161,8 +160,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long | |||
| 161 | barrier(); | 160 | barrier(); |
| 162 | 161 | ||
| 163 | if (wait->complete) { | 162 | if (wait->complete) { |
| 164 | if (readl(&wait->msg->body[0]) >> 24) | 163 | rc = le32_to_cpu(wait->msg->body[0]) >> 24; |
| 165 | rc = readl(&wait->msg->body[0]) & 0xff; | ||
| 166 | i2o_flush_reply(c, wait->m); | 164 | i2o_flush_reply(c, wait->m); |
| 167 | i2o_exec_wait_free(wait); | 165 | i2o_exec_wait_free(wait); |
| 168 | } else { | 166 | } else { |
| @@ -187,6 +185,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long | |||
| 187 | * @c: I2O controller which answers | 185 | * @c: I2O controller which answers |
| 188 | * @m: message id | 186 | * @m: message id |
| 189 | * @msg: pointer to the I2O reply message | 187 | * @msg: pointer to the I2O reply message |
| 188 | * @context: transaction context of request | ||
| 190 | * | 189 | * |
| 191 | * This function is called in interrupt context only. If the reply reached | 190 | * This function is called in interrupt context only. If the reply reached |
| 192 | * before the timeout, the i2o_exec_wait struct is filled with the message | 191 | * before the timeout, the i2o_exec_wait struct is filled with the message |
| @@ -201,16 +200,12 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long | |||
| 201 | * message must also be given back to the controller. | 200 | * message must also be given back to the controller. |
| 202 | */ | 201 | */ |
| 203 | static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m, | 202 | static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m, |
| 204 | struct i2o_message __iomem *msg) | 203 | struct i2o_message *msg, u32 context) |
| 205 | { | 204 | { |
| 206 | struct i2o_exec_wait *wait, *tmp; | 205 | struct i2o_exec_wait *wait, *tmp; |
| 207 | static spinlock_t lock; | 206 | unsigned long flags; |
| 207 | static spinlock_t lock = SPIN_LOCK_UNLOCKED; | ||
| 208 | int rc = 1; | 208 | int rc = 1; |
| 209 | u32 context; | ||
| 210 | |||
| 211 | spin_lock_init(&lock); | ||
| 212 | |||
| 213 | context = readl(&msg->u.s.tcntxt); | ||
| 214 | 209 | ||
| 215 | /* | 210 | /* |
| 216 | * We need to search through the i2o_exec_wait_list to see if the given | 211 | * We need to search through the i2o_exec_wait_list to see if the given |
| @@ -219,11 +214,13 @@ static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m, | |||
| 219 | * already expired. Not much we can do about that except log it for | 214 | * already expired. Not much we can do about that except log it for |
| 220 | * debug purposes, increase timeout, and recompile. | 215 | * debug purposes, increase timeout, and recompile. |
| 221 | */ | 216 | */ |
| 222 | spin_lock(&lock); | 217 | spin_lock_irqsave(&lock, flags); |
| 223 | list_for_each_entry_safe(wait, tmp, &i2o_exec_wait_list, list) { | 218 | list_for_each_entry_safe(wait, tmp, &i2o_exec_wait_list, list) { |
| 224 | if (wait->tcntxt == context) { | 219 | if (wait->tcntxt == context) { |
| 225 | list_del(&wait->list); | 220 | list_del(&wait->list); |
| 226 | 221 | ||
| 222 | spin_unlock_irqrestore(&lock, flags); | ||
| 223 | |||
| 227 | wait->m = m; | 224 | wait->m = m; |
| 228 | wait->msg = msg; | 225 | wait->msg = msg; |
| 229 | wait->complete = 1; | 226 | wait->complete = 1; |
| @@ -245,21 +242,63 @@ static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m, | |||
| 245 | rc = -1; | 242 | rc = -1; |
| 246 | } | 243 | } |
| 247 | 244 | ||
| 248 | spin_unlock(&lock); | ||
| 249 | |||
| 250 | return rc; | 245 | return rc; |
| 251 | } | 246 | } |
| 252 | } | 247 | } |
| 253 | 248 | ||
| 254 | spin_unlock(&lock); | 249 | spin_unlock_irqrestore(&lock, flags); |
| 255 | 250 | ||
| 256 | pr_debug("%s: Bogus reply in POST WAIT (tr-context: %08x)!\n", c->name, | 251 | osm_warn("%s: Bogus reply in POST WAIT (tr-context: %08x)!\n", c->name, |
| 257 | context); | 252 | context); |
| 258 | 253 | ||
| 259 | return -1; | 254 | return -1; |
| 260 | }; | 255 | }; |
| 261 | 256 | ||
| 262 | /** | 257 | /** |
| 258 | * i2o_exec_show_vendor_id - Displays Vendor ID of controller | ||
| 259 | * @d: device of which the Vendor ID should be displayed | ||
| 260 | * @buf: buffer into which the Vendor ID should be printed | ||
| 261 | * | ||
| 262 | * Returns number of bytes printed into buffer. | ||
| 263 | */ | ||
| 264 | static ssize_t i2o_exec_show_vendor_id(struct device *d, struct device_attribute *attr, char *buf) | ||
| 265 | { | ||
| 266 | struct i2o_device *dev = to_i2o_device(d); | ||
| 267 | u16 id; | ||
| 268 | |||
| 269 | if (i2o_parm_field_get(dev, 0x0000, 0, &id, 2)) { | ||
| 270 | sprintf(buf, "0x%04x", id); | ||
| 271 | return strlen(buf) + 1; | ||
| 272 | } | ||
| 273 | |||
| 274 | return 0; | ||
| 275 | }; | ||
| 276 | |||
| 277 | /** | ||
| 278 | * i2o_exec_show_product_id - Displays Product ID of controller | ||
| 279 | * @d: device of which the Product ID should be displayed | ||
| 280 | * @buf: buffer into which the Product ID should be printed | ||
| 281 | * | ||
| 282 | * Returns number of bytes printed into buffer. | ||
| 283 | */ | ||
| 284 | static ssize_t i2o_exec_show_product_id(struct device *d, struct device_attribute *attr, char *buf) | ||
| 285 | { | ||
| 286 | struct i2o_device *dev = to_i2o_device(d); | ||
| 287 | u16 id; | ||
| 288 | |||
| 289 | if (i2o_parm_field_get(dev, 0x0000, 1, &id, 2)) { | ||
| 290 | sprintf(buf, "0x%04x", id); | ||
| 291 | return strlen(buf) + 1; | ||
| 292 | } | ||
| 293 | |||
| 294 | return 0; | ||
| 295 | }; | ||
| 296 | |||
| 297 | /* Exec-OSM device attributes */ | ||
| 298 | static DEVICE_ATTR(vendor_id, S_IRUGO, i2o_exec_show_vendor_id, NULL); | ||
| 299 | static DEVICE_ATTR(product_id, S_IRUGO, i2o_exec_show_product_id, NULL); | ||
| 300 | |||
| 301 | /** | ||
| 263 | * i2o_exec_probe - Called if a new I2O device (executive class) appears | 302 | * i2o_exec_probe - Called if a new I2O device (executive class) appears |
| 264 | * @dev: I2O device which should be probed | 303 | * @dev: I2O device which should be probed |
| 265 | * | 304 | * |
| @@ -271,10 +310,16 @@ static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m, | |||
| 271 | static int i2o_exec_probe(struct device *dev) | 310 | static int i2o_exec_probe(struct device *dev) |
| 272 | { | 311 | { |
| 273 | struct i2o_device *i2o_dev = to_i2o_device(dev); | 312 | struct i2o_device *i2o_dev = to_i2o_device(dev); |
| 313 | struct i2o_controller *c = i2o_dev->iop; | ||
| 274 | 314 | ||
| 275 | i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff); | 315 | i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff); |
| 276 | 316 | ||
| 277 | i2o_dev->iop->exec = i2o_dev; | 317 | c->exec = i2o_dev; |
| 318 | |||
| 319 | i2o_exec_lct_notify(c, c->lct->change_ind + 1); | ||
| 320 | |||
| 321 | device_create_file(dev, &dev_attr_vendor_id); | ||
| 322 | device_create_file(dev, &dev_attr_product_id); | ||
| 278 | 323 | ||
| 279 | return 0; | 324 | return 0; |
| 280 | }; | 325 | }; |
| @@ -289,6 +334,9 @@ static int i2o_exec_probe(struct device *dev) | |||
| 289 | */ | 334 | */ |
| 290 | static int i2o_exec_remove(struct device *dev) | 335 | static int i2o_exec_remove(struct device *dev) |
| 291 | { | 336 | { |
| 337 | device_remove_file(dev, &dev_attr_product_id); | ||
| 338 | device_remove_file(dev, &dev_attr_vendor_id); | ||
| 339 | |||
| 292 | i2o_event_register(to_i2o_device(dev), &i2o_exec_driver, 0, 0); | 340 | i2o_event_register(to_i2o_device(dev), &i2o_exec_driver, 0, 0); |
| 293 | 341 | ||
| 294 | return 0; | 342 | return 0; |
| @@ -300,12 +348,16 @@ static int i2o_exec_remove(struct device *dev) | |||
| 300 | * | 348 | * |
| 301 | * This function handles asynchronus LCT NOTIFY replies. It parses the | 349 | * This function handles asynchronus LCT NOTIFY replies. It parses the |
| 302 | * new LCT and if the buffer for the LCT was to small sends a LCT NOTIFY | 350 | * new LCT and if the buffer for the LCT was to small sends a LCT NOTIFY |
| 303 | * again. | 351 | * again, otherwise send LCT NOTIFY to get informed on next LCT change. |
| 304 | */ | 352 | */ |
| 305 | static void i2o_exec_lct_modified(struct i2o_controller *c) | 353 | static void i2o_exec_lct_modified(struct i2o_controller *c) |
| 306 | { | 354 | { |
| 307 | if (i2o_device_parse_lct(c) == -EAGAIN) | 355 | u32 change_ind = 0; |
| 308 | i2o_exec_lct_notify(c, 0); | 356 | |
| 357 | if (i2o_device_parse_lct(c) != -EAGAIN) | ||
| 358 | change_ind = c->lct->change_ind + 1; | ||
| 359 | |||
| 360 | i2o_exec_lct_notify(c, change_ind); | ||
| 309 | }; | 361 | }; |
| 310 | 362 | ||
| 311 | /** | 363 | /** |
| @@ -325,8 +377,14 @@ static void i2o_exec_lct_modified(struct i2o_controller *c) | |||
| 325 | static int i2o_exec_reply(struct i2o_controller *c, u32 m, | 377 | static int i2o_exec_reply(struct i2o_controller *c, u32 m, |
| 326 | struct i2o_message *msg) | 378 | struct i2o_message *msg) |
| 327 | { | 379 | { |
| 328 | if (le32_to_cpu(msg->u.head[0]) & MSG_FAIL) { // Fail bit is set | 380 | u32 context; |
| 329 | struct i2o_message __iomem *pmsg; /* preserved message */ | 381 | |
| 382 | if (le32_to_cpu(msg->u.head[0]) & MSG_FAIL) { | ||
| 383 | /* | ||
| 384 | * If Fail bit is set we must take the transaction context of | ||
| 385 | * the preserved message to find the right request again. | ||
| 386 | */ | ||
| 387 | struct i2o_message __iomem *pmsg; | ||
| 330 | u32 pm; | 388 | u32 pm; |
| 331 | 389 | ||
| 332 | pm = le32_to_cpu(msg->body[3]); | 390 | pm = le32_to_cpu(msg->body[3]); |
| @@ -335,15 +393,15 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, | |||
| 335 | 393 | ||
| 336 | i2o_report_status(KERN_INFO, "i2o_core", msg); | 394 | i2o_report_status(KERN_INFO, "i2o_core", msg); |
| 337 | 395 | ||
| 338 | /* Release the preserved msg by resubmitting it as a NOP */ | 396 | context = readl(&pmsg->u.s.tcntxt); |
| 339 | i2o_msg_nop(c, pm); | ||
| 340 | 397 | ||
| 341 | /* If reply to i2o_post_wait failed, return causes a timeout */ | 398 | /* Release the preserved msg */ |
| 342 | return -1; | 399 | i2o_msg_nop(c, pm); |
| 343 | } | 400 | } else |
| 401 | context = le32_to_cpu(msg->u.s.tcntxt); | ||
| 344 | 402 | ||
| 345 | if (le32_to_cpu(msg->u.s.tcntxt) & 0x80000000) | 403 | if (context & 0x80000000) |
| 346 | return i2o_msg_post_wait_complete(c, m, msg); | 404 | return i2o_msg_post_wait_complete(c, m, msg, context); |
| 347 | 405 | ||
| 348 | if ((le32_to_cpu(msg->u.head[1]) >> 24) == I2O_CMD_LCT_NOTIFY) { | 406 | if ((le32_to_cpu(msg->u.head[1]) >> 24) == I2O_CMD_LCT_NOTIFY) { |
| 349 | struct work_struct *work; | 407 | struct work_struct *work; |
| @@ -381,8 +439,9 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, | |||
| 381 | */ | 439 | */ |
| 382 | static void i2o_exec_event(struct i2o_event *evt) | 440 | static void i2o_exec_event(struct i2o_event *evt) |
| 383 | { | 441 | { |
| 384 | osm_info("Event received from device: %d\n", | 442 | if (likely(evt->i2o_dev)) |
| 385 | evt->i2o_dev->lct_data.tid); | 443 | osm_debug("Event received from device: %d\n", |
| 444 | evt->i2o_dev->lct_data.tid); | ||
| 386 | kfree(evt); | 445 | kfree(evt); |
| 387 | }; | 446 | }; |
| 388 | 447 | ||
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index 7b74c87b569e..f283b5bafdd3 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
| @@ -62,7 +62,7 @@ | |||
| 62 | #include "i2o_block.h" | 62 | #include "i2o_block.h" |
| 63 | 63 | ||
| 64 | #define OSM_NAME "block-osm" | 64 | #define OSM_NAME "block-osm" |
| 65 | #define OSM_VERSION "$Rev$" | 65 | #define OSM_VERSION "1.287" |
| 66 | #define OSM_DESCRIPTION "I2O Block Device OSM" | 66 | #define OSM_DESCRIPTION "I2O Block Device OSM" |
| 67 | 67 | ||
| 68 | static struct i2o_driver i2o_block_driver; | 68 | static struct i2o_driver i2o_block_driver; |
| @@ -104,7 +104,8 @@ static int i2o_block_remove(struct device *dev) | |||
| 104 | struct i2o_device *i2o_dev = to_i2o_device(dev); | 104 | struct i2o_device *i2o_dev = to_i2o_device(dev); |
| 105 | struct i2o_block_device *i2o_blk_dev = dev_get_drvdata(dev); | 105 | struct i2o_block_device *i2o_blk_dev = dev_get_drvdata(dev); |
| 106 | 106 | ||
| 107 | osm_info("Device removed %s\n", i2o_blk_dev->gd->disk_name); | 107 | osm_info("device removed (TID: %03x): %s\n", i2o_dev->lct_data.tid, |
| 108 | i2o_blk_dev->gd->disk_name); | ||
| 108 | 109 | ||
| 109 | i2o_event_register(i2o_dev, &i2o_block_driver, 0, 0); | 110 | i2o_event_register(i2o_dev, &i2o_block_driver, 0, 0); |
| 110 | 111 | ||
| @@ -146,6 +147,29 @@ static int i2o_block_device_flush(struct i2o_device *dev) | |||
| 146 | }; | 147 | }; |
| 147 | 148 | ||
| 148 | /** | 149 | /** |
| 150 | * i2o_block_issue_flush - device-flush interface for block-layer | ||
| 151 | * @queue: the request queue of the device which should be flushed | ||
| 152 | * @disk: gendisk | ||
| 153 | * @error_sector: error offset | ||
| 154 | * | ||
| 155 | * Helper function to provide flush functionality to block-layer. | ||
| 156 | * | ||
| 157 | * Returns 0 on success or negative error code on failure. | ||
| 158 | */ | ||
| 159 | |||
| 160 | static int i2o_block_issue_flush(request_queue_t * queue, struct gendisk *disk, | ||
| 161 | sector_t * error_sector) | ||
| 162 | { | ||
| 163 | struct i2o_block_device *i2o_blk_dev = queue->queuedata; | ||
| 164 | int rc = -ENODEV; | ||
| 165 | |||
| 166 | if (likely(i2o_blk_dev)) | ||
| 167 | rc = i2o_block_device_flush(i2o_blk_dev->i2o_dev); | ||
| 168 | |||
| 169 | return rc; | ||
| 170 | } | ||
| 171 | |||
| 172 | /** | ||
| 149 | * i2o_block_device_mount - Mount (load) the media of device dev | 173 | * i2o_block_device_mount - Mount (load) the media of device dev |
| 150 | * @dev: I2O device which should receive the mount request | 174 | * @dev: I2O device which should receive the mount request |
| 151 | * @media_id: Media Identifier | 175 | * @media_id: Media Identifier |
| @@ -298,28 +322,31 @@ static inline void i2o_block_request_free(struct i2o_block_request *ireq) | |||
| 298 | 322 | ||
| 299 | /** | 323 | /** |
| 300 | * i2o_block_sglist_alloc - Allocate the SG list and map it | 324 | * i2o_block_sglist_alloc - Allocate the SG list and map it |
| 325 | * @c: I2O controller to which the request belongs | ||
| 301 | * @ireq: I2O block request | 326 | * @ireq: I2O block request |
| 302 | * | 327 | * |
| 303 | * Builds the SG list and map it into to be accessable by the controller. | 328 | * Builds the SG list and map it to be accessable by the controller. |
| 304 | * | 329 | * |
| 305 | * Returns the number of elements in the SG list or 0 on failure. | 330 | * Returns 0 on failure or 1 on success. |
| 306 | */ | 331 | */ |
| 307 | static inline int i2o_block_sglist_alloc(struct i2o_block_request *ireq) | 332 | static inline int i2o_block_sglist_alloc(struct i2o_controller *c, |
| 333 | struct i2o_block_request *ireq, | ||
| 334 | u32 __iomem ** mptr) | ||
| 308 | { | 335 | { |
| 309 | struct device *dev = &ireq->i2o_blk_dev->i2o_dev->iop->pdev->dev; | ||
| 310 | int nents; | 336 | int nents; |
| 337 | enum dma_data_direction direction; | ||
| 311 | 338 | ||
| 339 | ireq->dev = &c->pdev->dev; | ||
| 312 | nents = blk_rq_map_sg(ireq->req->q, ireq->req, ireq->sg_table); | 340 | nents = blk_rq_map_sg(ireq->req->q, ireq->req, ireq->sg_table); |
| 313 | 341 | ||
| 314 | if (rq_data_dir(ireq->req) == READ) | 342 | if (rq_data_dir(ireq->req) == READ) |
| 315 | ireq->sg_dma_direction = PCI_DMA_FROMDEVICE; | 343 | direction = PCI_DMA_FROMDEVICE; |
| 316 | else | 344 | else |
| 317 | ireq->sg_dma_direction = PCI_DMA_TODEVICE; | 345 | direction = PCI_DMA_TODEVICE; |
| 318 | 346 | ||
| 319 | ireq->sg_nents = dma_map_sg(dev, ireq->sg_table, nents, | 347 | ireq->sg_nents = nents; |
| 320 | ireq->sg_dma_direction); | ||
| 321 | 348 | ||
| 322 | return ireq->sg_nents; | 349 | return i2o_dma_map_sg(c, ireq->sg_table, nents, direction, mptr); |
| 323 | }; | 350 | }; |
| 324 | 351 | ||
| 325 | /** | 352 | /** |
| @@ -330,10 +357,14 @@ static inline int i2o_block_sglist_alloc(struct i2o_block_request *ireq) | |||
| 330 | */ | 357 | */ |
| 331 | static inline void i2o_block_sglist_free(struct i2o_block_request *ireq) | 358 | static inline void i2o_block_sglist_free(struct i2o_block_request *ireq) |
| 332 | { | 359 | { |
| 333 | struct device *dev = &ireq->i2o_blk_dev->i2o_dev->iop->pdev->dev; | 360 | enum dma_data_direction direction; |
| 334 | 361 | ||
| 335 | dma_unmap_sg(dev, ireq->sg_table, ireq->sg_nents, | 362 | if (rq_data_dir(ireq->req) == READ) |
| 336 | ireq->sg_dma_direction); | 363 | direction = PCI_DMA_FROMDEVICE; |
| 364 | else | ||
| 365 | direction = PCI_DMA_TODEVICE; | ||
| 366 | |||
| 367 | dma_unmap_sg(ireq->dev, ireq->sg_table, ireq->sg_nents, direction); | ||
| 337 | }; | 368 | }; |
| 338 | 369 | ||
| 339 | /** | 370 | /** |
| @@ -351,6 +382,11 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req) | |||
| 351 | struct i2o_block_device *i2o_blk_dev = q->queuedata; | 382 | struct i2o_block_device *i2o_blk_dev = q->queuedata; |
| 352 | struct i2o_block_request *ireq; | 383 | struct i2o_block_request *ireq; |
| 353 | 384 | ||
| 385 | if (unlikely(!i2o_blk_dev)) { | ||
| 386 | osm_err("block device already removed\n"); | ||
| 387 | return BLKPREP_KILL; | ||
| 388 | } | ||
| 389 | |||
| 354 | /* request is already processed by us, so return */ | 390 | /* request is already processed by us, so return */ |
| 355 | if (req->flags & REQ_SPECIAL) { | 391 | if (req->flags & REQ_SPECIAL) { |
| 356 | osm_debug("REQ_SPECIAL already set!\n"); | 392 | osm_debug("REQ_SPECIAL already set!\n"); |
| @@ -400,71 +436,65 @@ static void i2o_block_delayed_request_fn(void *delayed_request) | |||
| 400 | }; | 436 | }; |
| 401 | 437 | ||
| 402 | /** | 438 | /** |
| 403 | * i2o_block_reply - Block OSM reply handler. | 439 | * i2o_block_end_request - Post-processing of completed commands |
| 404 | * @c: I2O controller from which the message arrives | 440 | * @req: request which should be completed |
| 405 | * @m: message id of reply | 441 | * @uptodate: 1 for success, 0 for I/O error, < 0 for specific error |
| 406 | * qmsg: the actuall I2O message reply | 442 | * @nr_bytes: number of bytes to complete |
| 407 | * | 443 | * |
| 408 | * This function gets all the message replies. | 444 | * Mark the request as complete. The lock must not be held when entering. |
| 409 | * | 445 | * |
| 410 | */ | 446 | */ |
| 411 | static int i2o_block_reply(struct i2o_controller *c, u32 m, | 447 | static void i2o_block_end_request(struct request *req, int uptodate, |
| 412 | struct i2o_message *msg) | 448 | int nr_bytes) |
| 413 | { | 449 | { |
| 414 | struct i2o_block_request *ireq; | 450 | struct i2o_block_request *ireq = req->special; |
| 415 | struct request *req; | 451 | struct i2o_block_device *dev = ireq->i2o_blk_dev; |
| 416 | struct i2o_block_device *dev; | 452 | request_queue_t *q = req->q; |
| 417 | struct request_queue *q; | ||
| 418 | u8 st; | ||
| 419 | unsigned long flags; | 453 | unsigned long flags; |
| 420 | 454 | ||
| 421 | /* FAILed message */ | 455 | if (end_that_request_chunk(req, uptodate, nr_bytes)) { |
| 422 | if (unlikely(le32_to_cpu(msg->u.head[0]) & (1 << 13))) { | 456 | int leftover = (req->hard_nr_sectors << KERNEL_SECTOR_SHIFT); |
| 423 | struct i2o_message *pmsg; | ||
| 424 | u32 pm; | ||
| 425 | 457 | ||
| 426 | /* | 458 | if (blk_pc_request(req)) |
| 427 | * FAILed message from controller | 459 | leftover = req->data_len; |
| 428 | * We increment the error count and abort it | ||
| 429 | * | ||
| 430 | * In theory this will never happen. The I2O block class | ||
| 431 | * specification states that block devices never return | ||
| 432 | * FAILs but instead use the REQ status field...but | ||
| 433 | * better be on the safe side since no one really follows | ||
| 434 | * the spec to the book :) | ||
| 435 | */ | ||
| 436 | pm = le32_to_cpu(msg->body[3]); | ||
| 437 | pmsg = i2o_msg_in_to_virt(c, pm); | ||
| 438 | 460 | ||
| 439 | req = i2o_cntxt_list_get(c, le32_to_cpu(pmsg->u.s.tcntxt)); | 461 | if (end_io_error(uptodate)) |
| 440 | if (unlikely(!req)) { | 462 | end_that_request_chunk(req, 0, leftover); |
| 441 | osm_err("NULL reply received!\n"); | 463 | } |
| 442 | return -1; | ||
| 443 | } | ||
| 444 | 464 | ||
| 445 | ireq = req->special; | 465 | add_disk_randomness(req->rq_disk); |
| 446 | dev = ireq->i2o_blk_dev; | ||
| 447 | q = dev->gd->queue; | ||
| 448 | 466 | ||
| 449 | req->errors++; | 467 | spin_lock_irqsave(q->queue_lock, flags); |
| 450 | |||
| 451 | spin_lock_irqsave(q->queue_lock, flags); | ||
| 452 | 468 | ||
| 453 | while (end_that_request_chunk(req, !req->errors, | 469 | end_that_request_last(req); |
| 454 | le32_to_cpu(pmsg->body[1]))) ; | ||
| 455 | end_that_request_last(req); | ||
| 456 | 470 | ||
| 471 | if (likely(dev)) { | ||
| 457 | dev->open_queue_depth--; | 472 | dev->open_queue_depth--; |
| 458 | list_del(&ireq->queue); | 473 | list_del(&ireq->queue); |
| 459 | blk_start_queue(q); | 474 | } |
| 460 | 475 | ||
| 461 | spin_unlock_irqrestore(q->queue_lock, flags); | 476 | blk_start_queue(q); |
| 462 | 477 | ||
| 463 | /* Now flush the message by making it a NOP */ | 478 | spin_unlock_irqrestore(q->queue_lock, flags); |
| 464 | i2o_msg_nop(c, pm); | ||
| 465 | 479 | ||
| 466 | return -1; | 480 | i2o_block_sglist_free(ireq); |
| 467 | } | 481 | i2o_block_request_free(ireq); |
| 482 | }; | ||
| 483 | |||
| 484 | /** | ||
| 485 | * i2o_block_reply - Block OSM reply handler. | ||
| 486 | * @c: I2O controller from which the message arrives | ||
| 487 | * @m: message id of reply | ||
| 488 | * qmsg: the actuall I2O message reply | ||
| 489 | * | ||
| 490 | * This function gets all the message replies. | ||
| 491 | * | ||
| 492 | */ | ||
| 493 | static int i2o_block_reply(struct i2o_controller *c, u32 m, | ||
| 494 | struct i2o_message *msg) | ||
| 495 | { | ||
| 496 | struct request *req; | ||
| 497 | int uptodate = 1; | ||
| 468 | 498 | ||
| 469 | req = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt)); | 499 | req = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt)); |
| 470 | if (unlikely(!req)) { | 500 | if (unlikely(!req)) { |
| @@ -472,61 +502,13 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, | |||
| 472 | return -1; | 502 | return -1; |
| 473 | } | 503 | } |
| 474 | 504 | ||
| 475 | ireq = req->special; | ||
| 476 | dev = ireq->i2o_blk_dev; | ||
| 477 | q = dev->gd->queue; | ||
| 478 | |||
| 479 | if (unlikely(!dev->i2o_dev)) { | ||
| 480 | /* | ||
| 481 | * This is HACK, but Intel Integrated RAID allows user | ||
| 482 | * to delete a volume that is claimed, locked, and in use | ||
| 483 | * by the OS. We have to check for a reply from a | ||
| 484 | * non-existent device and flag it as an error or the system | ||
| 485 | * goes kaput... | ||
| 486 | */ | ||
| 487 | req->errors++; | ||
| 488 | osm_warn("Data transfer to deleted device!\n"); | ||
| 489 | spin_lock_irqsave(q->queue_lock, flags); | ||
| 490 | while (end_that_request_chunk | ||
| 491 | (req, !req->errors, le32_to_cpu(msg->body[1]))) ; | ||
| 492 | end_that_request_last(req); | ||
| 493 | |||
| 494 | dev->open_queue_depth--; | ||
| 495 | list_del(&ireq->queue); | ||
| 496 | blk_start_queue(q); | ||
| 497 | |||
| 498 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
| 499 | return -1; | ||
| 500 | } | ||
| 501 | |||
| 502 | /* | 505 | /* |
| 503 | * Lets see what is cooking. We stuffed the | 506 | * Lets see what is cooking. We stuffed the |
| 504 | * request in the context. | 507 | * request in the context. |
| 505 | */ | 508 | */ |
| 506 | 509 | ||
| 507 | st = le32_to_cpu(msg->body[0]) >> 24; | 510 | if ((le32_to_cpu(msg->body[0]) >> 24) != 0) { |
| 508 | 511 | u32 status = le32_to_cpu(msg->body[0]); | |
| 509 | if (st != 0) { | ||
| 510 | int err; | ||
| 511 | char *bsa_errors[] = { | ||
| 512 | "Success", | ||
| 513 | "Media Error", | ||
| 514 | "Failure communicating to device", | ||
| 515 | "Device Failure", | ||
| 516 | "Device is not ready", | ||
| 517 | "Media not present", | ||
| 518 | "Media is locked by another user", | ||
| 519 | "Media has failed", | ||
| 520 | "Failure communicating to device", | ||
| 521 | "Device bus failure", | ||
| 522 | "Device is locked by another user", | ||
| 523 | "Device is write protected", | ||
| 524 | "Device has reset", | ||
| 525 | "Volume has changed, waiting for acknowledgement" | ||
| 526 | }; | ||
| 527 | |||
| 528 | err = le32_to_cpu(msg->body[0]) & 0xffff; | ||
| 529 | |||
| 530 | /* | 512 | /* |
| 531 | * Device not ready means two things. One is that the | 513 | * Device not ready means two things. One is that the |
| 532 | * the thing went offline (but not a removal media) | 514 | * the thing went offline (but not a removal media) |
| @@ -539,40 +521,24 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, | |||
| 539 | * Don't stick a supertrak100 into cache aggressive modes | 521 | * Don't stick a supertrak100 into cache aggressive modes |
| 540 | */ | 522 | */ |
| 541 | 523 | ||
| 542 | osm_err("block-osm: /dev/%s error: %s", dev->gd->disk_name, | 524 | osm_err("TID %03x error status: 0x%02x, detailed status: " |
| 543 | bsa_errors[le32_to_cpu(msg->body[0]) & 0xffff]); | 525 | "0x%04x\n", (le32_to_cpu(msg->u.head[1]) >> 12 & 0xfff), |
| 544 | if (le32_to_cpu(msg->body[0]) & 0x00ff0000) | 526 | status >> 24, status & 0xffff); |
| 545 | printk(KERN_ERR " - DDM attempted %d retries", | ||
| 546 | (le32_to_cpu(msg->body[0]) >> 16) & 0x00ff); | ||
| 547 | printk(KERN_ERR ".\n"); | ||
| 548 | req->errors++; | ||
| 549 | } else | ||
| 550 | req->errors = 0; | ||
| 551 | 527 | ||
| 552 | if (!end_that_request_chunk | 528 | req->errors++; |
| 553 | (req, !req->errors, le32_to_cpu(msg->body[1]))) { | ||
| 554 | add_disk_randomness(req->rq_disk); | ||
| 555 | spin_lock_irqsave(q->queue_lock, flags); | ||
| 556 | |||
| 557 | end_that_request_last(req); | ||
| 558 | 529 | ||
| 559 | dev->open_queue_depth--; | 530 | uptodate = 0; |
| 560 | list_del(&ireq->queue); | 531 | } |
| 561 | blk_start_queue(q); | ||
| 562 | 532 | ||
| 563 | spin_unlock_irqrestore(q->queue_lock, flags); | 533 | i2o_block_end_request(req, uptodate, le32_to_cpu(msg->body[1])); |
| 564 | |||
| 565 | i2o_block_sglist_free(ireq); | ||
| 566 | i2o_block_request_free(ireq); | ||
| 567 | } else | ||
| 568 | osm_err("still remaining chunks\n"); | ||
| 569 | 534 | ||
| 570 | return 1; | 535 | return 1; |
| 571 | }; | 536 | }; |
| 572 | 537 | ||
| 573 | static void i2o_block_event(struct i2o_event *evt) | 538 | static void i2o_block_event(struct i2o_event *evt) |
| 574 | { | 539 | { |
| 575 | osm_info("block-osm: event received\n"); | 540 | osm_debug("event received\n"); |
| 541 | kfree(evt); | ||
| 576 | }; | 542 | }; |
| 577 | 543 | ||
| 578 | /* | 544 | /* |
| @@ -777,18 +743,25 @@ static int i2o_block_media_changed(struct gendisk *disk) | |||
| 777 | static int i2o_block_transfer(struct request *req) | 743 | static int i2o_block_transfer(struct request *req) |
| 778 | { | 744 | { |
| 779 | struct i2o_block_device *dev = req->rq_disk->private_data; | 745 | struct i2o_block_device *dev = req->rq_disk->private_data; |
| 780 | struct i2o_controller *c = dev->i2o_dev->iop; | 746 | struct i2o_controller *c; |
| 781 | int tid = dev->i2o_dev->lct_data.tid; | 747 | int tid = dev->i2o_dev->lct_data.tid; |
| 782 | struct i2o_message __iomem *msg; | 748 | struct i2o_message __iomem *msg; |
| 783 | void __iomem *mptr; | 749 | u32 __iomem *mptr; |
| 784 | struct i2o_block_request *ireq = req->special; | 750 | struct i2o_block_request *ireq = req->special; |
| 785 | struct scatterlist *sg; | ||
| 786 | int sgnum; | ||
| 787 | int i; | ||
| 788 | u32 m; | 751 | u32 m; |
| 789 | u32 tcntxt; | 752 | u32 tcntxt; |
| 790 | u32 sg_flags; | 753 | u32 sgl_offset = SGL_OFFSET_8; |
| 754 | u32 ctl_flags = 0x00000000; | ||
| 791 | int rc; | 755 | int rc; |
| 756 | u32 cmd; | ||
| 757 | |||
| 758 | if (unlikely(!dev->i2o_dev)) { | ||
| 759 | osm_err("transfer to removed drive\n"); | ||
| 760 | rc = -ENODEV; | ||
| 761 | goto exit; | ||
| 762 | } | ||
| 763 | |||
| 764 | c = dev->i2o_dev->iop; | ||
| 792 | 765 | ||
| 793 | m = i2o_msg_get(c, &msg); | 766 | m = i2o_msg_get(c, &msg); |
| 794 | if (m == I2O_QUEUE_EMPTY) { | 767 | if (m == I2O_QUEUE_EMPTY) { |
| @@ -802,82 +775,109 @@ static int i2o_block_transfer(struct request *req) | |||
| 802 | goto nop_msg; | 775 | goto nop_msg; |
| 803 | } | 776 | } |
| 804 | 777 | ||
| 805 | if ((sgnum = i2o_block_sglist_alloc(ireq)) <= 0) { | ||
| 806 | rc = -ENOMEM; | ||
| 807 | goto context_remove; | ||
| 808 | } | ||
| 809 | |||
| 810 | /* Build the message based on the request. */ | ||
| 811 | writel(i2o_block_driver.context, &msg->u.s.icntxt); | 778 | writel(i2o_block_driver.context, &msg->u.s.icntxt); |
| 812 | writel(tcntxt, &msg->u.s.tcntxt); | 779 | writel(tcntxt, &msg->u.s.tcntxt); |
| 813 | writel(req->nr_sectors << 9, &msg->body[1]); | ||
| 814 | |||
| 815 | writel((((u64) req->sector) << 9) & 0xffffffff, &msg->body[2]); | ||
| 816 | writel(req->sector >> 23, &msg->body[3]); | ||
| 817 | 780 | ||
| 818 | mptr = &msg->body[4]; | 781 | mptr = &msg->body[0]; |
| 819 | |||
| 820 | sg = ireq->sg_table; | ||
| 821 | 782 | ||
| 822 | if (rq_data_dir(req) == READ) { | 783 | if (rq_data_dir(req) == READ) { |
| 823 | writel(I2O_CMD_BLOCK_READ << 24 | HOST_TID << 12 | tid, | 784 | cmd = I2O_CMD_BLOCK_READ << 24; |
| 824 | &msg->u.head[1]); | 785 | |
| 825 | sg_flags = 0x10000000; | ||
| 826 | switch (dev->rcache) { | 786 | switch (dev->rcache) { |
| 827 | case CACHE_NULL: | ||
| 828 | writel(0, &msg->body[0]); | ||
| 829 | break; | ||
| 830 | case CACHE_PREFETCH: | 787 | case CACHE_PREFETCH: |
| 831 | writel(0x201F0008, &msg->body[0]); | 788 | ctl_flags = 0x201F0008; |
| 832 | break; | 789 | break; |
| 790 | |||
| 833 | case CACHE_SMARTFETCH: | 791 | case CACHE_SMARTFETCH: |
| 834 | if (req->nr_sectors > 16) | 792 | if (req->nr_sectors > 16) |
| 835 | writel(0x201F0008, &msg->body[0]); | 793 | ctl_flags = 0x201F0008; |
| 836 | else | 794 | else |
| 837 | writel(0x001F0000, &msg->body[0]); | 795 | ctl_flags = 0x001F0000; |
| 796 | break; | ||
| 797 | |||
| 798 | default: | ||
| 838 | break; | 799 | break; |
| 839 | } | 800 | } |
| 840 | } else { | 801 | } else { |
| 841 | writel(I2O_CMD_BLOCK_WRITE << 24 | HOST_TID << 12 | tid, | 802 | cmd = I2O_CMD_BLOCK_WRITE << 24; |
| 842 | &msg->u.head[1]); | 803 | |
| 843 | sg_flags = 0x14000000; | ||
| 844 | switch (dev->wcache) { | 804 | switch (dev->wcache) { |
| 845 | case CACHE_NULL: | ||
| 846 | writel(0, &msg->body[0]); | ||
| 847 | break; | ||
| 848 | case CACHE_WRITETHROUGH: | 805 | case CACHE_WRITETHROUGH: |
| 849 | writel(0x001F0008, &msg->body[0]); | 806 | ctl_flags = 0x001F0008; |
| 850 | break; | 807 | break; |
| 851 | case CACHE_WRITEBACK: | 808 | case CACHE_WRITEBACK: |
| 852 | writel(0x001F0010, &msg->body[0]); | 809 | ctl_flags = 0x001F0010; |
| 853 | break; | 810 | break; |
| 854 | case CACHE_SMARTBACK: | 811 | case CACHE_SMARTBACK: |
| 855 | if (req->nr_sectors > 16) | 812 | if (req->nr_sectors > 16) |
| 856 | writel(0x001F0004, &msg->body[0]); | 813 | ctl_flags = 0x001F0004; |
| 857 | else | 814 | else |
| 858 | writel(0x001F0010, &msg->body[0]); | 815 | ctl_flags = 0x001F0010; |
| 859 | break; | 816 | break; |
| 860 | case CACHE_SMARTTHROUGH: | 817 | case CACHE_SMARTTHROUGH: |
| 861 | if (req->nr_sectors > 16) | 818 | if (req->nr_sectors > 16) |
| 862 | writel(0x001F0004, &msg->body[0]); | 819 | ctl_flags = 0x001F0004; |
| 863 | else | 820 | else |
| 864 | writel(0x001F0010, &msg->body[0]); | 821 | ctl_flags = 0x001F0010; |
| 822 | default: | ||
| 823 | break; | ||
| 824 | } | ||
| 825 | } | ||
| 826 | |||
| 827 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 828 | if (c->adaptec) { | ||
| 829 | u8 cmd[10]; | ||
| 830 | u32 scsi_flags; | ||
| 831 | u16 hwsec = queue_hardsect_size(req->q) >> KERNEL_SECTOR_SHIFT; | ||
| 832 | |||
| 833 | memset(cmd, 0, 10); | ||
| 834 | |||
| 835 | sgl_offset = SGL_OFFSET_12; | ||
| 836 | |||
| 837 | writel(I2O_CMD_PRIVATE << 24 | HOST_TID << 12 | tid, | ||
| 838 | &msg->u.head[1]); | ||
| 839 | |||
| 840 | writel(I2O_VENDOR_DPT << 16 | I2O_CMD_SCSI_EXEC, mptr++); | ||
| 841 | writel(tid, mptr++); | ||
| 842 | |||
| 843 | /* | ||
| 844 | * ENABLE_DISCONNECT | ||
| 845 | * SIMPLE_TAG | ||
| 846 | * RETURN_SENSE_DATA_IN_REPLY_MESSAGE_FRAME | ||
| 847 | */ | ||
| 848 | if (rq_data_dir(req) == READ) { | ||
| 849 | cmd[0] = 0x28; | ||
| 850 | scsi_flags = 0x60a0000a; | ||
| 851 | } else { | ||
| 852 | cmd[0] = 0x2A; | ||
| 853 | scsi_flags = 0xa0a0000a; | ||
| 865 | } | 854 | } |
| 855 | |||
| 856 | writel(scsi_flags, mptr++); | ||
| 857 | |||
| 858 | *((u32 *) & cmd[2]) = cpu_to_be32(req->sector * hwsec); | ||
| 859 | *((u16 *) & cmd[7]) = cpu_to_be16(req->nr_sectors * hwsec); | ||
| 860 | |||
| 861 | memcpy_toio(mptr, cmd, 10); | ||
| 862 | mptr += 4; | ||
| 863 | writel(req->nr_sectors << KERNEL_SECTOR_SHIFT, mptr++); | ||
| 864 | } else | ||
| 865 | #endif | ||
| 866 | { | ||
| 867 | writel(cmd | HOST_TID << 12 | tid, &msg->u.head[1]); | ||
| 868 | writel(ctl_flags, mptr++); | ||
| 869 | writel(req->nr_sectors << KERNEL_SECTOR_SHIFT, mptr++); | ||
| 870 | writel((u32) (req->sector << KERNEL_SECTOR_SHIFT), mptr++); | ||
| 871 | writel(req->sector >> (32 - KERNEL_SECTOR_SHIFT), mptr++); | ||
| 866 | } | 872 | } |
| 867 | 873 | ||
| 868 | for (i = sgnum; i > 0; i--) { | 874 | if (!i2o_block_sglist_alloc(c, ireq, &mptr)) { |
| 869 | if (i == 1) | 875 | rc = -ENOMEM; |
| 870 | sg_flags |= 0x80000000; | 876 | goto context_remove; |
| 871 | writel(sg_flags | sg_dma_len(sg), mptr); | ||
| 872 | writel(sg_dma_address(sg), mptr + 4); | ||
| 873 | mptr += 8; | ||
| 874 | sg++; | ||
| 875 | } | 877 | } |
| 876 | 878 | ||
| 877 | writel(I2O_MESSAGE_SIZE | 879 | writel(I2O_MESSAGE_SIZE(mptr - &msg->u.head[0]) | |
| 878 | (((unsigned long)mptr - | 880 | sgl_offset, &msg->u.head[0]); |
| 879 | (unsigned long)&msg->u.head[0]) >> 2) | SGL_OFFSET_8, | ||
| 880 | &msg->u.head[0]); | ||
| 881 | 881 | ||
| 882 | list_add_tail(&ireq->queue, &dev->open_queue); | 882 | list_add_tail(&ireq->queue, &dev->open_queue); |
| 883 | dev->open_queue_depth++; | 883 | dev->open_queue_depth++; |
| @@ -920,11 +920,13 @@ static void i2o_block_request_fn(struct request_queue *q) | |||
| 920 | 920 | ||
| 921 | queue_depth = ireq->i2o_blk_dev->open_queue_depth; | 921 | queue_depth = ireq->i2o_blk_dev->open_queue_depth; |
| 922 | 922 | ||
| 923 | if (queue_depth < I2O_BLOCK_MAX_OPEN_REQUESTS) | 923 | if (queue_depth < I2O_BLOCK_MAX_OPEN_REQUESTS) { |
| 924 | if (!i2o_block_transfer(req)) { | 924 | if (!i2o_block_transfer(req)) { |
| 925 | blkdev_dequeue_request(req); | 925 | blkdev_dequeue_request(req); |
| 926 | continue; | 926 | continue; |
| 927 | } | 927 | } else |
| 928 | osm_info("transfer error\n"); | ||
| 929 | } | ||
| 928 | 930 | ||
| 929 | if (queue_depth) | 931 | if (queue_depth) |
| 930 | break; | 932 | break; |
| @@ -938,7 +940,6 @@ static void i2o_block_request_fn(struct request_queue *q) | |||
| 938 | INIT_WORK(&dreq->work, i2o_block_delayed_request_fn, | 940 | INIT_WORK(&dreq->work, i2o_block_delayed_request_fn, |
| 939 | dreq); | 941 | dreq); |
| 940 | 942 | ||
| 941 | osm_info("transfer error\n"); | ||
| 942 | if (!queue_delayed_work(i2o_block_driver.event_queue, | 943 | if (!queue_delayed_work(i2o_block_driver.event_queue, |
| 943 | &dreq->work, | 944 | &dreq->work, |
| 944 | I2O_BLOCK_RETRY_TIME)) | 945 | I2O_BLOCK_RETRY_TIME)) |
| @@ -1007,6 +1008,7 @@ static struct i2o_block_device *i2o_block_device_alloc(void) | |||
| 1007 | } | 1008 | } |
| 1008 | 1009 | ||
| 1009 | blk_queue_prep_rq(queue, i2o_block_prep_req_fn); | 1010 | blk_queue_prep_rq(queue, i2o_block_prep_req_fn); |
| 1011 | blk_queue_issue_flush_fn(queue, i2o_block_issue_flush); | ||
| 1010 | 1012 | ||
| 1011 | gd->major = I2O_MAJOR; | 1013 | gd->major = I2O_MAJOR; |
| 1012 | gd->queue = queue; | 1014 | gd->queue = queue; |
| @@ -1039,17 +1041,27 @@ static struct i2o_block_device *i2o_block_device_alloc(void) | |||
| 1039 | static int i2o_block_probe(struct device *dev) | 1041 | static int i2o_block_probe(struct device *dev) |
| 1040 | { | 1042 | { |
| 1041 | struct i2o_device *i2o_dev = to_i2o_device(dev); | 1043 | struct i2o_device *i2o_dev = to_i2o_device(dev); |
| 1042 | struct i2o_block_device *i2o_blk_dev; | ||
| 1043 | struct i2o_controller *c = i2o_dev->iop; | 1044 | struct i2o_controller *c = i2o_dev->iop; |
| 1045 | struct i2o_block_device *i2o_blk_dev; | ||
| 1044 | struct gendisk *gd; | 1046 | struct gendisk *gd; |
| 1045 | struct request_queue *queue; | 1047 | struct request_queue *queue; |
| 1046 | static int unit = 0; | 1048 | static int unit = 0; |
| 1047 | int rc; | 1049 | int rc; |
| 1048 | u64 size; | 1050 | u64 size; |
| 1049 | u32 blocksize; | 1051 | u32 blocksize; |
| 1050 | u16 power; | ||
| 1051 | u32 flags, status; | 1052 | u32 flags, status; |
| 1052 | int segments; | 1053 | u16 body_size = 4; |
| 1054 | unsigned short max_sectors; | ||
| 1055 | |||
| 1056 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 1057 | if (c->adaptec) | ||
| 1058 | body_size = 8; | ||
| 1059 | #endif | ||
| 1060 | |||
| 1061 | if (c->limit_sectors) | ||
| 1062 | max_sectors = I2O_MAX_SECTORS_LIMITED; | ||
| 1063 | else | ||
| 1064 | max_sectors = I2O_MAX_SECTORS; | ||
| 1053 | 1065 | ||
| 1054 | /* skip devices which are used by IOP */ | 1066 | /* skip devices which are used by IOP */ |
| 1055 | if (i2o_dev->lct_data.user_tid != 0xfff) { | 1067 | if (i2o_dev->lct_data.user_tid != 0xfff) { |
| @@ -1057,8 +1069,6 @@ static int i2o_block_probe(struct device *dev) | |||
| 1057 | return -ENODEV; | 1069 | return -ENODEV; |
| 1058 | } | 1070 | } |
| 1059 | 1071 | ||
| 1060 | osm_info("New device detected (TID: %03x)\n", i2o_dev->lct_data.tid); | ||
| 1061 | |||
| 1062 | if (i2o_device_claim(i2o_dev)) { | 1072 | if (i2o_device_claim(i2o_dev)) { |
| 1063 | osm_warn("Unable to claim device. Installation aborted\n"); | 1073 | osm_warn("Unable to claim device. Installation aborted\n"); |
| 1064 | rc = -EFAULT; | 1074 | rc = -EFAULT; |
| @@ -1086,50 +1096,44 @@ static int i2o_block_probe(struct device *dev) | |||
| 1086 | queue = gd->queue; | 1096 | queue = gd->queue; |
| 1087 | queue->queuedata = i2o_blk_dev; | 1097 | queue->queuedata = i2o_blk_dev; |
| 1088 | 1098 | ||
| 1089 | blk_queue_max_phys_segments(queue, I2O_MAX_SEGMENTS); | 1099 | blk_queue_max_phys_segments(queue, I2O_MAX_PHYS_SEGMENTS); |
| 1090 | blk_queue_max_sectors(queue, I2O_MAX_SECTORS); | 1100 | blk_queue_max_sectors(queue, max_sectors); |
| 1091 | 1101 | blk_queue_max_hw_segments(queue, i2o_sg_tablesize(c, body_size)); | |
| 1092 | if (c->short_req) | ||
| 1093 | segments = 8; | ||
| 1094 | else { | ||
| 1095 | i2o_status_block *sb; | ||
| 1096 | 1102 | ||
| 1097 | sb = c->status_block.virt; | 1103 | osm_debug("max sectors = %d\n", queue->max_phys_segments); |
| 1098 | 1104 | osm_debug("phys segments = %d\n", queue->max_sectors); | |
| 1099 | segments = (sb->inbound_frame_size - | 1105 | osm_debug("max hw segments = %d\n", queue->max_hw_segments); |
| 1100 | sizeof(struct i2o_message) / 4 - 4) / 2; | ||
| 1101 | } | ||
| 1102 | |||
| 1103 | blk_queue_max_hw_segments(queue, segments); | ||
| 1104 | |||
| 1105 | osm_debug("max sectors = %d\n", I2O_MAX_SECTORS); | ||
| 1106 | osm_debug("phys segments = %d\n", I2O_MAX_SEGMENTS); | ||
| 1107 | osm_debug("hw segments = %d\n", segments); | ||
| 1108 | 1106 | ||
| 1109 | /* | 1107 | /* |
| 1110 | * Ask for the current media data. If that isn't supported | 1108 | * Ask for the current media data. If that isn't supported |
| 1111 | * then we ask for the device capacity data | 1109 | * then we ask for the device capacity data |
| 1112 | */ | 1110 | */ |
| 1113 | if (i2o_parm_field_get(i2o_dev, 0x0004, 1, &blocksize, 4) != 0 | 1111 | if (i2o_parm_field_get(i2o_dev, 0x0004, 1, &blocksize, 4) || |
| 1114 | || i2o_parm_field_get(i2o_dev, 0x0004, 0, &size, 8) != 0) { | 1112 | i2o_parm_field_get(i2o_dev, 0x0000, 3, &blocksize, 4)) { |
| 1115 | i2o_parm_field_get(i2o_dev, 0x0000, 3, &blocksize, 4); | 1113 | blk_queue_hardsect_size(queue, blocksize); |
| 1116 | i2o_parm_field_get(i2o_dev, 0x0000, 4, &size, 8); | 1114 | } else |
| 1117 | } | 1115 | osm_warn("unable to get blocksize of %s\n", gd->disk_name); |
| 1118 | osm_debug("blocksize = %d\n", blocksize); | ||
| 1119 | 1116 | ||
| 1120 | if (i2o_parm_field_get(i2o_dev, 0x0000, 2, &power, 2)) | 1117 | if (i2o_parm_field_get(i2o_dev, 0x0004, 0, &size, 8) || |
| 1121 | power = 0; | 1118 | i2o_parm_field_get(i2o_dev, 0x0000, 4, &size, 8)) { |
| 1119 | set_capacity(gd, size >> KERNEL_SECTOR_SHIFT); | ||
| 1120 | } else | ||
| 1121 | osm_warn("could not get size of %s\n", gd->disk_name); | ||
| 1122 | |||
| 1123 | if (!i2o_parm_field_get(i2o_dev, 0x0000, 2, &i2o_blk_dev->power, 2)) | ||
| 1124 | i2o_blk_dev->power = 0; | ||
| 1122 | i2o_parm_field_get(i2o_dev, 0x0000, 5, &flags, 4); | 1125 | i2o_parm_field_get(i2o_dev, 0x0000, 5, &flags, 4); |
| 1123 | i2o_parm_field_get(i2o_dev, 0x0000, 6, &status, 4); | 1126 | i2o_parm_field_get(i2o_dev, 0x0000, 6, &status, 4); |
| 1124 | 1127 | ||
| 1125 | set_capacity(gd, size >> 9); | ||
| 1126 | |||
| 1127 | i2o_event_register(i2o_dev, &i2o_block_driver, 0, 0xffffffff); | 1128 | i2o_event_register(i2o_dev, &i2o_block_driver, 0, 0xffffffff); |
| 1128 | 1129 | ||
| 1129 | add_disk(gd); | 1130 | add_disk(gd); |
| 1130 | 1131 | ||
| 1131 | unit++; | 1132 | unit++; |
| 1132 | 1133 | ||
| 1134 | osm_info("device added (TID: %03x): %s\n", i2o_dev->lct_data.tid, | ||
| 1135 | i2o_blk_dev->gd->disk_name); | ||
| 1136 | |||
| 1133 | return 0; | 1137 | return 0; |
| 1134 | 1138 | ||
| 1135 | claim_release: | 1139 | claim_release: |
| @@ -1177,7 +1181,7 @@ static int __init i2o_block_init(void) | |||
| 1177 | goto exit; | 1181 | goto exit; |
| 1178 | } | 1182 | } |
| 1179 | 1183 | ||
| 1180 | i2o_blk_req_pool.pool = mempool_create(I2O_REQ_MEMPOOL_SIZE, | 1184 | i2o_blk_req_pool.pool = mempool_create(I2O_BLOCK_REQ_MEMPOOL_SIZE, |
| 1181 | mempool_alloc_slab, | 1185 | mempool_alloc_slab, |
| 1182 | mempool_free_slab, | 1186 | mempool_free_slab, |
| 1183 | i2o_blk_req_pool.slab); | 1187 | i2o_blk_req_pool.slab); |
diff --git a/drivers/message/i2o/i2o_block.h b/drivers/message/i2o/i2o_block.h index ddd9a15679c0..4fdaa5bda412 100644 --- a/drivers/message/i2o/i2o_block.h +++ b/drivers/message/i2o/i2o_block.h | |||
| @@ -56,42 +56,46 @@ | |||
| 56 | #define I2O_BLOCK_RETRY_TIME HZ/4 | 56 | #define I2O_BLOCK_RETRY_TIME HZ/4 |
| 57 | #define I2O_BLOCK_MAX_OPEN_REQUESTS 50 | 57 | #define I2O_BLOCK_MAX_OPEN_REQUESTS 50 |
| 58 | 58 | ||
| 59 | /* request queue sizes */ | ||
| 60 | #define I2O_BLOCK_REQ_MEMPOOL_SIZE 32 | ||
| 61 | |||
| 62 | #define KERNEL_SECTOR_SHIFT 9 | ||
| 63 | #define KERNEL_SECTOR_SIZE (1 << KERNEL_SECTOR_SHIFT) | ||
| 64 | |||
| 59 | /* I2O Block OSM mempool struct */ | 65 | /* I2O Block OSM mempool struct */ |
| 60 | struct i2o_block_mempool { | 66 | struct i2o_block_mempool { |
| 61 | kmem_cache_t *slab; | 67 | kmem_cache_t *slab; |
| 62 | mempool_t *pool; | 68 | mempool_t *pool; |
| 63 | }; | 69 | }; |
| 64 | 70 | ||
| 65 | /* I2O Block device descriptor */ | 71 | /* I2O Block device descriptor */ |
| 66 | struct i2o_block_device { | 72 | struct i2o_block_device { |
| 67 | struct i2o_device *i2o_dev; /* pointer to I2O device */ | 73 | struct i2o_device *i2o_dev; /* pointer to I2O device */ |
| 68 | struct gendisk *gd; | 74 | struct gendisk *gd; |
| 69 | spinlock_t lock; /* queue lock */ | 75 | spinlock_t lock; /* queue lock */ |
| 70 | struct list_head open_queue; /* list of transfered, but unfinished | 76 | struct list_head open_queue; /* list of transfered, but unfinished |
| 71 | requests */ | 77 | requests */ |
| 72 | unsigned int open_queue_depth; /* number of requests in the queue */ | 78 | unsigned int open_queue_depth; /* number of requests in the queue */ |
| 73 | 79 | ||
| 74 | int rcache; /* read cache flags */ | 80 | int rcache; /* read cache flags */ |
| 75 | int wcache; /* write cache flags */ | 81 | int wcache; /* write cache flags */ |
| 76 | int flags; | 82 | int flags; |
| 77 | int power; /* power state */ | 83 | u16 power; /* power state */ |
| 78 | int media_change_flag; /* media changed flag */ | 84 | int media_change_flag; /* media changed flag */ |
| 79 | }; | 85 | }; |
| 80 | 86 | ||
| 81 | /* I2O Block device request */ | 87 | /* I2O Block device request */ |
| 82 | struct i2o_block_request | 88 | struct i2o_block_request { |
| 83 | { | ||
| 84 | struct list_head queue; | 89 | struct list_head queue; |
| 85 | struct request *req; /* corresponding request */ | 90 | struct request *req; /* corresponding request */ |
| 86 | struct i2o_block_device *i2o_blk_dev; /* I2O block device */ | 91 | struct i2o_block_device *i2o_blk_dev; /* I2O block device */ |
| 87 | int sg_dma_direction; /* direction of DMA buffer read/write */ | 92 | struct device *dev; /* device used for DMA */ |
| 88 | int sg_nents; /* number of SG elements */ | 93 | int sg_nents; /* number of SG elements */ |
| 89 | struct scatterlist sg_table[I2O_MAX_SEGMENTS]; /* SG table */ | 94 | struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */ |
| 90 | }; | 95 | }; |
| 91 | 96 | ||
| 92 | /* I2O Block device delayed request */ | 97 | /* I2O Block device delayed request */ |
| 93 | struct i2o_block_delayed_request | 98 | struct i2o_block_delayed_request { |
| 94 | { | ||
| 95 | struct work_struct work; | 99 | struct work_struct work; |
| 96 | struct request_queue *queue; | 100 | struct request_queue *queue; |
| 97 | }; | 101 | }; |
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 1fb5cdf67f8f..3c3a7abebb1b 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
| @@ -30,29 +30,15 @@ | |||
| 30 | * 2 of the License, or (at your option) any later version. | 30 | * 2 of the License, or (at your option) any later version. |
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| 33 | #include <linux/module.h> | ||
| 34 | #include <linux/kernel.h> | ||
| 35 | #include <linux/pci.h> | ||
| 36 | #include <linux/i2o.h> | ||
| 37 | #include <linux/errno.h> | ||
| 38 | #include <linux/init.h> | ||
| 39 | #include <linux/slab.h> | ||
| 40 | #include <linux/miscdevice.h> | 33 | #include <linux/miscdevice.h> |
| 41 | #include <linux/mm.h> | ||
| 42 | #include <linux/spinlock.h> | ||
| 43 | #include <linux/smp_lock.h> | 34 | #include <linux/smp_lock.h> |
| 44 | #include <linux/ioctl32.h> | ||
| 45 | #include <linux/compat.h> | 35 | #include <linux/compat.h> |
| 46 | #include <linux/syscalls.h> | ||
| 47 | 36 | ||
| 48 | #include <asm/uaccess.h> | 37 | #include <asm/uaccess.h> |
| 49 | #include <asm/io.h> | ||
| 50 | 38 | ||
| 51 | #define OSM_NAME "config-osm" | 39 | #include "core.h" |
| 52 | #define OSM_VERSION "$Rev$" | ||
| 53 | #define OSM_DESCRIPTION "I2O Configuration OSM" | ||
| 54 | 40 | ||
| 55 | extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); | 41 | #define SG_TABLESIZE 30 |
| 56 | 42 | ||
| 57 | static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, | 43 | static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, |
| 58 | unsigned long arg); | 44 | unsigned long arg); |
| @@ -80,15 +66,6 @@ struct i2o_cfg_info { | |||
| 80 | static struct i2o_cfg_info *open_files = NULL; | 66 | static struct i2o_cfg_info *open_files = NULL; |
| 81 | static ulong i2o_cfg_info_id = 0; | 67 | static ulong i2o_cfg_info_id = 0; |
| 82 | 68 | ||
| 83 | /* | ||
| 84 | * Each of these describes an i2o message handler. They are | ||
| 85 | * multiplexed by the i2o_core code | ||
| 86 | */ | ||
| 87 | |||
| 88 | static struct i2o_driver i2o_config_driver = { | ||
| 89 | .name = OSM_NAME | ||
| 90 | }; | ||
| 91 | |||
| 92 | static int i2o_cfg_getiops(unsigned long arg) | 69 | static int i2o_cfg_getiops(unsigned long arg) |
| 93 | { | 70 | { |
| 94 | struct i2o_controller *c; | 71 | struct i2o_controller *c; |
| @@ -391,9 +368,9 @@ static int i2o_cfg_swul(unsigned long arg) | |||
| 391 | 368 | ||
| 392 | i2o_dma_free(&c->pdev->dev, &buffer); | 369 | i2o_dma_free(&c->pdev->dev, &buffer); |
| 393 | 370 | ||
| 394 | return_ret: | 371 | return_ret: |
| 395 | return ret; | 372 | return ret; |
| 396 | return_fault: | 373 | return_fault: |
| 397 | ret = -EFAULT; | 374 | ret = -EFAULT; |
| 398 | goto return_ret; | 375 | goto return_ret; |
| 399 | }; | 376 | }; |
| @@ -540,8 +517,10 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp) | |||
| 540 | return 0; | 517 | return 0; |
| 541 | } | 518 | } |
| 542 | 519 | ||
| 520 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 543 | #ifdef CONFIG_COMPAT | 521 | #ifdef CONFIG_COMPAT |
| 544 | static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long arg) | 522 | static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, |
| 523 | unsigned long arg) | ||
| 545 | { | 524 | { |
| 546 | struct i2o_cmd_passthru32 __user *cmd; | 525 | struct i2o_cmd_passthru32 __user *cmd; |
| 547 | struct i2o_controller *c; | 526 | struct i2o_controller *c; |
| @@ -555,6 +534,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 555 | u32 sg_offset = 0; | 534 | u32 sg_offset = 0; |
| 556 | u32 sg_count = 0; | 535 | u32 sg_count = 0; |
| 557 | u32 i = 0; | 536 | u32 i = 0; |
| 537 | u32 sg_index = 0; | ||
| 558 | i2o_status_block *sb; | 538 | i2o_status_block *sb; |
| 559 | struct i2o_message *msg; | 539 | struct i2o_message *msg; |
| 560 | u32 m; | 540 | u32 m; |
| @@ -634,8 +614,8 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 634 | if (sg_count > SG_TABLESIZE) { | 614 | if (sg_count > SG_TABLESIZE) { |
| 635 | printk(KERN_DEBUG "%s:IOCTL SG List too large (%u)\n", | 615 | printk(KERN_DEBUG "%s:IOCTL SG List too large (%u)\n", |
| 636 | c->name, sg_count); | 616 | c->name, sg_count); |
| 637 | kfree(reply); | 617 | rcode = -EINVAL; |
| 638 | return -EINVAL; | 618 | goto cleanup; |
| 639 | } | 619 | } |
| 640 | 620 | ||
| 641 | for (i = 0; i < sg_count; i++) { | 621 | for (i = 0; i < sg_count; i++) { |
| @@ -651,7 +631,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 651 | goto cleanup; | 631 | goto cleanup; |
| 652 | } | 632 | } |
| 653 | sg_size = sg[i].flag_count & 0xffffff; | 633 | sg_size = sg[i].flag_count & 0xffffff; |
| 654 | p = &(sg_list[i]); | 634 | p = &(sg_list[sg_index++]); |
| 655 | /* Allocate memory for the transfer */ | 635 | /* Allocate memory for the transfer */ |
| 656 | if (i2o_dma_alloc | 636 | if (i2o_dma_alloc |
| 657 | (&c->pdev->dev, p, sg_size, | 637 | (&c->pdev->dev, p, sg_size, |
| @@ -660,20 +640,21 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 660 | "%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n", | 640 | "%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n", |
| 661 | c->name, sg_size, i, sg_count); | 641 | c->name, sg_size, i, sg_count); |
| 662 | rcode = -ENOMEM; | 642 | rcode = -ENOMEM; |
| 663 | goto cleanup; | 643 | goto sg_list_cleanup; |
| 664 | } | 644 | } |
| 665 | /* Copy in the user's SG buffer if necessary */ | 645 | /* Copy in the user's SG buffer if necessary */ |
| 666 | if (sg[i]. | 646 | if (sg[i]. |
| 667 | flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { | 647 | flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { |
| 668 | // TODO 64bit fix | 648 | // TODO 64bit fix |
| 669 | if (copy_from_user | 649 | if (copy_from_user |
| 670 | (p->virt, (void __user *)(unsigned long)sg[i].addr_bus, | 650 | (p->virt, |
| 671 | sg_size)) { | 651 | (void __user *)(unsigned long)sg[i]. |
| 652 | addr_bus, sg_size)) { | ||
| 672 | printk(KERN_DEBUG | 653 | printk(KERN_DEBUG |
| 673 | "%s: Could not copy SG buf %d FROM user\n", | 654 | "%s: Could not copy SG buf %d FROM user\n", |
| 674 | c->name, i); | 655 | c->name, i); |
| 675 | rcode = -EFAULT; | 656 | rcode = -EFAULT; |
| 676 | goto cleanup; | 657 | goto sg_list_cleanup; |
| 677 | } | 658 | } |
| 678 | } | 659 | } |
| 679 | //TODO 64bit fix | 660 | //TODO 64bit fix |
| @@ -683,10 +664,10 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 683 | 664 | ||
| 684 | rcode = i2o_msg_post_wait(c, m, 60); | 665 | rcode = i2o_msg_post_wait(c, m, 60); |
| 685 | if (rcode) | 666 | if (rcode) |
| 686 | goto cleanup; | 667 | goto sg_list_cleanup; |
| 687 | 668 | ||
| 688 | if (sg_offset) { | 669 | if (sg_offset) { |
| 689 | u32 msg[128]; | 670 | u32 msg[I2O_OUTBOUND_MSG_FRAME_SIZE]; |
| 690 | /* Copy back the Scatter Gather buffers back to user space */ | 671 | /* Copy back the Scatter Gather buffers back to user space */ |
| 691 | u32 j; | 672 | u32 j; |
| 692 | // TODO 64bit fix | 673 | // TODO 64bit fix |
| @@ -694,18 +675,18 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 694 | int sg_size; | 675 | int sg_size; |
| 695 | 676 | ||
| 696 | // re-acquire the original message to handle correctly the sg copy operation | 677 | // re-acquire the original message to handle correctly the sg copy operation |
| 697 | memset(&msg, 0, MSG_FRAME_SIZE * 4); | 678 | memset(&msg, 0, I2O_OUTBOUND_MSG_FRAME_SIZE * 4); |
| 698 | // get user msg size in u32s | 679 | // get user msg size in u32s |
| 699 | if (get_user(size, &user_msg[0])) { | 680 | if (get_user(size, &user_msg[0])) { |
| 700 | rcode = -EFAULT; | 681 | rcode = -EFAULT; |
| 701 | goto cleanup; | 682 | goto sg_list_cleanup; |
| 702 | } | 683 | } |
| 703 | size = size >> 16; | 684 | size = size >> 16; |
| 704 | size *= 4; | 685 | size *= 4; |
| 705 | /* Copy in the user's I2O command */ | 686 | /* Copy in the user's I2O command */ |
| 706 | if (copy_from_user(msg, user_msg, size)) { | 687 | if (copy_from_user(msg, user_msg, size)) { |
| 707 | rcode = -EFAULT; | 688 | rcode = -EFAULT; |
| 708 | goto cleanup; | 689 | goto sg_list_cleanup; |
| 709 | } | 690 | } |
| 710 | sg_count = | 691 | sg_count = |
| 711 | (size - sg_offset * 4) / sizeof(struct sg_simple_element); | 692 | (size - sg_offset * 4) / sizeof(struct sg_simple_element); |
| @@ -727,7 +708,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 727 | c->name, sg_list[j].virt, | 708 | c->name, sg_list[j].virt, |
| 728 | sg[j].addr_bus); | 709 | sg[j].addr_bus); |
| 729 | rcode = -EFAULT; | 710 | rcode = -EFAULT; |
| 730 | goto cleanup; | 711 | goto sg_list_cleanup; |
| 731 | } | 712 | } |
| 732 | } | 713 | } |
| 733 | } | 714 | } |
| @@ -741,6 +722,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 741 | "%s: Could not copy message context FROM user\n", | 722 | "%s: Could not copy message context FROM user\n", |
| 742 | c->name); | 723 | c->name); |
| 743 | rcode = -EFAULT; | 724 | rcode = -EFAULT; |
| 725 | goto sg_list_cleanup; | ||
| 744 | } | 726 | } |
| 745 | if (copy_to_user(user_reply, reply, reply_size)) { | 727 | if (copy_to_user(user_reply, reply, reply_size)) { |
| 746 | printk(KERN_WARNING | 728 | printk(KERN_WARNING |
| @@ -749,16 +731,21 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar | |||
| 749 | } | 731 | } |
| 750 | } | 732 | } |
| 751 | 733 | ||
| 734 | sg_list_cleanup: | ||
| 735 | for (i = 0; i < sg_index; i++) | ||
| 736 | i2o_dma_free(&c->pdev->dev, &sg_list[i]); | ||
| 737 | |||
| 752 | cleanup: | 738 | cleanup: |
| 753 | kfree(reply); | 739 | kfree(reply); |
| 754 | return rcode; | 740 | return rcode; |
| 755 | } | 741 | } |
| 756 | 742 | ||
| 757 | static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) | 743 | static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, |
| 744 | unsigned long arg) | ||
| 758 | { | 745 | { |
| 759 | int ret; | 746 | int ret; |
| 760 | lock_kernel(); | 747 | lock_kernel(); |
| 761 | switch (cmd) { | 748 | switch (cmd) { |
| 762 | case I2OGETIOPS: | 749 | case I2OGETIOPS: |
| 763 | ret = i2o_cfg_ioctl(NULL, file, cmd, arg); | 750 | ret = i2o_cfg_ioctl(NULL, file, cmd, arg); |
| 764 | break; | 751 | break; |
| @@ -862,8 +849,8 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 862 | if (sg_count > SG_TABLESIZE) { | 849 | if (sg_count > SG_TABLESIZE) { |
| 863 | printk(KERN_DEBUG "%s:IOCTL SG List too large (%u)\n", | 850 | printk(KERN_DEBUG "%s:IOCTL SG List too large (%u)\n", |
| 864 | c->name, sg_count); | 851 | c->name, sg_count); |
| 865 | kfree(reply); | 852 | rcode = -EINVAL; |
| 866 | return -EINVAL; | 853 | goto cleanup; |
| 867 | } | 854 | } |
| 868 | 855 | ||
| 869 | for (i = 0; i < sg_count; i++) { | 856 | for (i = 0; i < sg_count; i++) { |
| @@ -875,7 +862,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 875 | "%s:Bad SG element %d - not simple (%x)\n", | 862 | "%s:Bad SG element %d - not simple (%x)\n", |
| 876 | c->name, i, sg[i].flag_count); | 863 | c->name, i, sg[i].flag_count); |
| 877 | rcode = -EINVAL; | 864 | rcode = -EINVAL; |
| 878 | goto cleanup; | 865 | goto sg_list_cleanup; |
| 879 | } | 866 | } |
| 880 | sg_size = sg[i].flag_count & 0xffffff; | 867 | sg_size = sg[i].flag_count & 0xffffff; |
| 881 | /* Allocate memory for the transfer */ | 868 | /* Allocate memory for the transfer */ |
| @@ -885,7 +872,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 885 | "%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n", | 872 | "%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n", |
| 886 | c->name, sg_size, i, sg_count); | 873 | c->name, sg_size, i, sg_count); |
| 887 | rcode = -ENOMEM; | 874 | rcode = -ENOMEM; |
| 888 | goto cleanup; | 875 | goto sg_list_cleanup; |
| 889 | } | 876 | } |
| 890 | sg_list[sg_index++] = p; // sglist indexed with input frame, not our internal frame. | 877 | sg_list[sg_index++] = p; // sglist indexed with input frame, not our internal frame. |
| 891 | /* Copy in the user's SG buffer if necessary */ | 878 | /* Copy in the user's SG buffer if necessary */ |
| @@ -899,7 +886,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 899 | "%s: Could not copy SG buf %d FROM user\n", | 886 | "%s: Could not copy SG buf %d FROM user\n", |
| 900 | c->name, i); | 887 | c->name, i); |
| 901 | rcode = -EFAULT; | 888 | rcode = -EFAULT; |
| 902 | goto cleanup; | 889 | goto sg_list_cleanup; |
| 903 | } | 890 | } |
| 904 | } | 891 | } |
| 905 | //TODO 64bit fix | 892 | //TODO 64bit fix |
| @@ -909,7 +896,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 909 | 896 | ||
| 910 | rcode = i2o_msg_post_wait(c, m, 60); | 897 | rcode = i2o_msg_post_wait(c, m, 60); |
| 911 | if (rcode) | 898 | if (rcode) |
| 912 | goto cleanup; | 899 | goto sg_list_cleanup; |
| 913 | 900 | ||
| 914 | if (sg_offset) { | 901 | if (sg_offset) { |
| 915 | u32 msg[128]; | 902 | u32 msg[128]; |
| @@ -920,18 +907,18 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 920 | int sg_size; | 907 | int sg_size; |
| 921 | 908 | ||
| 922 | // re-acquire the original message to handle correctly the sg copy operation | 909 | // re-acquire the original message to handle correctly the sg copy operation |
| 923 | memset(&msg, 0, MSG_FRAME_SIZE * 4); | 910 | memset(&msg, 0, I2O_OUTBOUND_MSG_FRAME_SIZE * 4); |
| 924 | // get user msg size in u32s | 911 | // get user msg size in u32s |
| 925 | if (get_user(size, &user_msg[0])) { | 912 | if (get_user(size, &user_msg[0])) { |
| 926 | rcode = -EFAULT; | 913 | rcode = -EFAULT; |
| 927 | goto cleanup; | 914 | goto sg_list_cleanup; |
| 928 | } | 915 | } |
| 929 | size = size >> 16; | 916 | size = size >> 16; |
| 930 | size *= 4; | 917 | size *= 4; |
| 931 | /* Copy in the user's I2O command */ | 918 | /* Copy in the user's I2O command */ |
| 932 | if (copy_from_user(msg, user_msg, size)) { | 919 | if (copy_from_user(msg, user_msg, size)) { |
| 933 | rcode = -EFAULT; | 920 | rcode = -EFAULT; |
| 934 | goto cleanup; | 921 | goto sg_list_cleanup; |
| 935 | } | 922 | } |
| 936 | sg_count = | 923 | sg_count = |
| 937 | (size - sg_offset * 4) / sizeof(struct sg_simple_element); | 924 | (size - sg_offset * 4) / sizeof(struct sg_simple_element); |
| @@ -953,7 +940,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 953 | c->name, sg_list[j], | 940 | c->name, sg_list[j], |
| 954 | sg[j].addr_bus); | 941 | sg[j].addr_bus); |
| 955 | rcode = -EFAULT; | 942 | rcode = -EFAULT; |
| 956 | goto cleanup; | 943 | goto sg_list_cleanup; |
| 957 | } | 944 | } |
| 958 | } | 945 | } |
| 959 | } | 946 | } |
| @@ -975,10 +962,15 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 975 | } | 962 | } |
| 976 | } | 963 | } |
| 977 | 964 | ||
| 965 | sg_list_cleanup: | ||
| 966 | for (i = 0; i < sg_index; i++) | ||
| 967 | kfree(sg_list[i]); | ||
| 968 | |||
| 978 | cleanup: | 969 | cleanup: |
| 979 | kfree(reply); | 970 | kfree(reply); |
| 980 | return rcode; | 971 | return rcode; |
| 981 | } | 972 | } |
| 973 | #endif | ||
| 982 | 974 | ||
| 983 | /* | 975 | /* |
| 984 | * IOCTL Handler | 976 | * IOCTL Handler |
| @@ -1033,9 +1025,11 @@ static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, | |||
| 1033 | ret = i2o_cfg_evt_get(arg, fp); | 1025 | ret = i2o_cfg_evt_get(arg, fp); |
| 1034 | break; | 1026 | break; |
| 1035 | 1027 | ||
| 1028 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 1036 | case I2OPASSTHRU: | 1029 | case I2OPASSTHRU: |
| 1037 | ret = i2o_cfg_passthru(arg); | 1030 | ret = i2o_cfg_passthru(arg); |
| 1038 | break; | 1031 | break; |
| 1032 | #endif | ||
| 1039 | 1033 | ||
| 1040 | default: | 1034 | default: |
| 1041 | osm_debug("unknown ioctl called!\n"); | 1035 | osm_debug("unknown ioctl called!\n"); |
| @@ -1137,37 +1131,21 @@ static struct miscdevice i2o_miscdev = { | |||
| 1137 | &config_fops | 1131 | &config_fops |
| 1138 | }; | 1132 | }; |
| 1139 | 1133 | ||
| 1140 | static int __init i2o_config_init(void) | 1134 | static int __init i2o_config_old_init(void) |
| 1141 | { | 1135 | { |
| 1142 | printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n"); | ||
| 1143 | |||
| 1144 | spin_lock_init(&i2o_config_lock); | 1136 | spin_lock_init(&i2o_config_lock); |
| 1145 | 1137 | ||
| 1146 | if (misc_register(&i2o_miscdev) < 0) { | 1138 | if (misc_register(&i2o_miscdev) < 0) { |
| 1147 | osm_err("can't register device.\n"); | 1139 | osm_err("can't register device.\n"); |
| 1148 | return -EBUSY; | 1140 | return -EBUSY; |
| 1149 | } | 1141 | } |
| 1150 | /* | 1142 | |
| 1151 | * Install our handler | ||
| 1152 | */ | ||
| 1153 | if (i2o_driver_register(&i2o_config_driver)) { | ||
| 1154 | osm_err("handler register failed.\n"); | ||
| 1155 | misc_deregister(&i2o_miscdev); | ||
| 1156 | return -EBUSY; | ||
| 1157 | } | ||
| 1158 | return 0; | 1143 | return 0; |
| 1159 | } | 1144 | } |
| 1160 | 1145 | ||
| 1161 | static void i2o_config_exit(void) | 1146 | static void i2o_config_old_exit(void) |
| 1162 | { | 1147 | { |
| 1163 | misc_deregister(&i2o_miscdev); | 1148 | misc_deregister(&i2o_miscdev); |
| 1164 | i2o_driver_unregister(&i2o_config_driver); | ||
| 1165 | } | 1149 | } |
| 1166 | 1150 | ||
| 1167 | MODULE_AUTHOR("Red Hat Software"); | 1151 | MODULE_AUTHOR("Red Hat Software"); |
| 1168 | MODULE_LICENSE("GPL"); | ||
| 1169 | MODULE_DESCRIPTION(OSM_DESCRIPTION); | ||
| 1170 | MODULE_VERSION(OSM_VERSION); | ||
| 1171 | |||
| 1172 | module_init(i2o_config_init); | ||
| 1173 | module_exit(i2o_config_exit); | ||
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c index b176d0eeff7f..d559a1758363 100644 --- a/drivers/message/i2o/i2o_proc.c +++ b/drivers/message/i2o/i2o_proc.c | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | */ | 28 | */ |
| 29 | 29 | ||
| 30 | #define OSM_NAME "proc-osm" | 30 | #define OSM_NAME "proc-osm" |
| 31 | #define OSM_VERSION "$Rev$" | 31 | #define OSM_VERSION "1.145" |
| 32 | #define OSM_DESCRIPTION "I2O ProcFS OSM" | 32 | #define OSM_DESCRIPTION "I2O ProcFS OSM" |
| 33 | 33 | ||
| 34 | #define I2O_MAX_MODULES 4 | 34 | #define I2O_MAX_MODULES 4 |
| @@ -228,7 +228,7 @@ static const char *i2o_get_class_name(int class) | |||
| 228 | case I2O_CLASS_FLOPPY_DEVICE: | 228 | case I2O_CLASS_FLOPPY_DEVICE: |
| 229 | idx = 12; | 229 | idx = 12; |
| 230 | break; | 230 | break; |
| 231 | case I2O_CLASS_BUS_ADAPTER_PORT: | 231 | case I2O_CLASS_BUS_ADAPTER: |
| 232 | idx = 13; | 232 | idx = 13; |
| 233 | break; | 233 | break; |
| 234 | case I2O_CLASS_PEER_TRANSPORT_AGENT: | 234 | case I2O_CLASS_PEER_TRANSPORT_AGENT: |
| @@ -490,7 +490,7 @@ static int i2o_seq_show_lct(struct seq_file *seq, void *v) | |||
| 490 | seq_printf(seq, ", Unknown Device Type"); | 490 | seq_printf(seq, ", Unknown Device Type"); |
| 491 | break; | 491 | break; |
| 492 | 492 | ||
| 493 | case I2O_CLASS_BUS_ADAPTER_PORT: | 493 | case I2O_CLASS_BUS_ADAPTER: |
| 494 | if (lct->lct_entry[i].sub_class < BUS_TABLE_SIZE) | 494 | if (lct->lct_entry[i].sub_class < BUS_TABLE_SIZE) |
| 495 | seq_printf(seq, ", %s", | 495 | seq_printf(seq, ", %s", |
| 496 | bus_ports[lct->lct_entry[i]. | 496 | bus_ports[lct->lct_entry[i]. |
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c index 43f5875e0be5..9f1744c3933b 100644 --- a/drivers/message/i2o/i2o_scsi.c +++ b/drivers/message/i2o/i2o_scsi.c | |||
| @@ -54,6 +54,7 @@ | |||
| 54 | #include <linux/pci.h> | 54 | #include <linux/pci.h> |
| 55 | #include <linux/blkdev.h> | 55 | #include <linux/blkdev.h> |
| 56 | #include <linux/i2o.h> | 56 | #include <linux/i2o.h> |
| 57 | #include <linux/scatterlist.h> | ||
| 57 | 58 | ||
| 58 | #include <asm/dma.h> | 59 | #include <asm/dma.h> |
| 59 | #include <asm/system.h> | 60 | #include <asm/system.h> |
| @@ -64,19 +65,23 @@ | |||
| 64 | #include <scsi/scsi_host.h> | 65 | #include <scsi/scsi_host.h> |
| 65 | #include <scsi/scsi_device.h> | 66 | #include <scsi/scsi_device.h> |
| 66 | #include <scsi/scsi_cmnd.h> | 67 | #include <scsi/scsi_cmnd.h> |
| 68 | #include <scsi/scsi_request.h> | ||
| 69 | #include <scsi/sg.h> | ||
| 70 | #include <scsi/sg_request.h> | ||
| 67 | 71 | ||
| 68 | #define OSM_NAME "scsi-osm" | 72 | #define OSM_NAME "scsi-osm" |
| 69 | #define OSM_VERSION "$Rev$" | 73 | #define OSM_VERSION "1.282" |
| 70 | #define OSM_DESCRIPTION "I2O SCSI Peripheral OSM" | 74 | #define OSM_DESCRIPTION "I2O SCSI Peripheral OSM" |
| 71 | 75 | ||
| 72 | static struct i2o_driver i2o_scsi_driver; | 76 | static struct i2o_driver i2o_scsi_driver; |
| 73 | 77 | ||
| 74 | static int i2o_scsi_max_id = 16; | 78 | static unsigned int i2o_scsi_max_id = 16; |
| 75 | static int i2o_scsi_max_lun = 8; | 79 | static unsigned int i2o_scsi_max_lun = 255; |
| 76 | 80 | ||
| 77 | struct i2o_scsi_host { | 81 | struct i2o_scsi_host { |
| 78 | struct Scsi_Host *scsi_host; /* pointer to the SCSI host */ | 82 | struct Scsi_Host *scsi_host; /* pointer to the SCSI host */ |
| 79 | struct i2o_controller *iop; /* pointer to the I2O controller */ | 83 | struct i2o_controller *iop; /* pointer to the I2O controller */ |
| 84 | unsigned int lun; /* lun's used for block devices */ | ||
| 80 | struct i2o_device *channel[0]; /* channel->i2o_dev mapping table */ | 85 | struct i2o_device *channel[0]; /* channel->i2o_dev mapping table */ |
| 81 | }; | 86 | }; |
| 82 | 87 | ||
| @@ -99,11 +104,17 @@ static struct i2o_scsi_host *i2o_scsi_host_alloc(struct i2o_controller *c) | |||
| 99 | u8 type; | 104 | u8 type; |
| 100 | int i; | 105 | int i; |
| 101 | size_t size; | 106 | size_t size; |
| 102 | i2o_status_block *sb; | 107 | u16 body_size = 6; |
| 108 | |||
| 109 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 110 | if (c->adaptec) | ||
| 111 | body_size = 8; | ||
| 112 | #endif | ||
| 103 | 113 | ||
| 104 | list_for_each_entry(i2o_dev, &c->devices, list) | 114 | list_for_each_entry(i2o_dev, &c->devices, list) |
| 105 | if (i2o_dev->lct_data.class_id == I2O_CLASS_BUS_ADAPTER_PORT) { | 115 | if (i2o_dev->lct_data.class_id == I2O_CLASS_BUS_ADAPTER) { |
| 106 | if (i2o_parm_field_get(i2o_dev, 0x0000, 0, &type, 1) || (type == 1)) /* SCSI bus */ | 116 | if (i2o_parm_field_get(i2o_dev, 0x0000, 0, &type, 1) |
| 117 | && (type == 0x01)) /* SCSI bus */ | ||
| 107 | max_channel++; | 118 | max_channel++; |
| 108 | } | 119 | } |
| 109 | 120 | ||
| @@ -125,20 +136,18 @@ static struct i2o_scsi_host *i2o_scsi_host_alloc(struct i2o_controller *c) | |||
| 125 | scsi_host->max_id = i2o_scsi_max_id; | 136 | scsi_host->max_id = i2o_scsi_max_id; |
| 126 | scsi_host->max_lun = i2o_scsi_max_lun; | 137 | scsi_host->max_lun = i2o_scsi_max_lun; |
| 127 | scsi_host->this_id = c->unit; | 138 | scsi_host->this_id = c->unit; |
| 128 | 139 | scsi_host->sg_tablesize = i2o_sg_tablesize(c, body_size); | |
| 129 | sb = c->status_block.virt; | ||
| 130 | |||
| 131 | scsi_host->sg_tablesize = (sb->inbound_frame_size - | ||
| 132 | sizeof(struct i2o_message) / 4 - 6) / 2; | ||
| 133 | 140 | ||
| 134 | i2o_shost = (struct i2o_scsi_host *)scsi_host->hostdata; | 141 | i2o_shost = (struct i2o_scsi_host *)scsi_host->hostdata; |
| 135 | i2o_shost->scsi_host = scsi_host; | 142 | i2o_shost->scsi_host = scsi_host; |
| 136 | i2o_shost->iop = c; | 143 | i2o_shost->iop = c; |
| 144 | i2o_shost->lun = 1; | ||
| 137 | 145 | ||
| 138 | i = 0; | 146 | i = 0; |
| 139 | list_for_each_entry(i2o_dev, &c->devices, list) | 147 | list_for_each_entry(i2o_dev, &c->devices, list) |
| 140 | if (i2o_dev->lct_data.class_id == I2O_CLASS_BUS_ADAPTER_PORT) { | 148 | if (i2o_dev->lct_data.class_id == I2O_CLASS_BUS_ADAPTER) { |
| 141 | if (i2o_parm_field_get(i2o_dev, 0x0000, 0, &type, 1) || (type == 1)) /* only SCSI bus */ | 149 | if (i2o_parm_field_get(i2o_dev, 0x0000, 0, &type, 1) |
| 150 | && (type == 0x01)) /* only SCSI bus */ | ||
| 142 | i2o_shost->channel[i++] = i2o_dev; | 151 | i2o_shost->channel[i++] = i2o_dev; |
| 143 | 152 | ||
| 144 | if (i >= max_channel) | 153 | if (i >= max_channel) |
| @@ -178,10 +187,13 @@ static int i2o_scsi_remove(struct device *dev) | |||
| 178 | struct i2o_scsi_host *i2o_shost; | 187 | struct i2o_scsi_host *i2o_shost; |
| 179 | struct scsi_device *scsi_dev; | 188 | struct scsi_device *scsi_dev; |
| 180 | 189 | ||
| 190 | osm_info("device removed (TID: %03x)\n", i2o_dev->lct_data.tid); | ||
| 191 | |||
| 181 | i2o_shost = i2o_scsi_get_host(c); | 192 | i2o_shost = i2o_scsi_get_host(c); |
| 182 | 193 | ||
| 183 | shost_for_each_device(scsi_dev, i2o_shost->scsi_host) | 194 | shost_for_each_device(scsi_dev, i2o_shost->scsi_host) |
| 184 | if (scsi_dev->hostdata == i2o_dev) { | 195 | if (scsi_dev->hostdata == i2o_dev) { |
| 196 | sysfs_remove_link(&i2o_dev->device.kobj, "scsi"); | ||
| 185 | scsi_remove_device(scsi_dev); | 197 | scsi_remove_device(scsi_dev); |
| 186 | scsi_device_put(scsi_dev); | 198 | scsi_device_put(scsi_dev); |
| 187 | break; | 199 | break; |
| @@ -207,8 +219,8 @@ static int i2o_scsi_probe(struct device *dev) | |||
| 207 | struct Scsi_Host *scsi_host; | 219 | struct Scsi_Host *scsi_host; |
| 208 | struct i2o_device *parent; | 220 | struct i2o_device *parent; |
| 209 | struct scsi_device *scsi_dev; | 221 | struct scsi_device *scsi_dev; |
| 210 | u32 id; | 222 | u32 id = -1; |
| 211 | u64 lun; | 223 | u64 lun = -1; |
| 212 | int channel = -1; | 224 | int channel = -1; |
| 213 | int i; | 225 | int i; |
| 214 | 226 | ||
| @@ -218,8 +230,56 @@ static int i2o_scsi_probe(struct device *dev) | |||
| 218 | 230 | ||
| 219 | scsi_host = i2o_shost->scsi_host; | 231 | scsi_host = i2o_shost->scsi_host; |
| 220 | 232 | ||
| 221 | if (i2o_parm_field_get(i2o_dev, 0, 3, &id, 4) < 0) | 233 | switch (i2o_dev->lct_data.class_id) { |
| 234 | case I2O_CLASS_RANDOM_BLOCK_STORAGE: | ||
| 235 | case I2O_CLASS_EXECUTIVE: | ||
| 236 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 237 | if (c->adaptec) { | ||
| 238 | u8 type; | ||
| 239 | struct i2o_device *d = i2o_shost->channel[0]; | ||
| 240 | |||
| 241 | if (i2o_parm_field_get(d, 0x0000, 0, &type, 1) | ||
| 242 | && (type == 0x01)) /* SCSI bus */ | ||
| 243 | if (i2o_parm_field_get(d, 0x0200, 4, &id, 4)) { | ||
| 244 | channel = 0; | ||
| 245 | if (i2o_dev->lct_data.class_id == | ||
| 246 | I2O_CLASS_RANDOM_BLOCK_STORAGE) | ||
| 247 | lun = i2o_shost->lun++; | ||
| 248 | else | ||
| 249 | lun = 0; | ||
| 250 | } | ||
| 251 | } | ||
| 252 | #endif | ||
| 253 | break; | ||
| 254 | |||
| 255 | case I2O_CLASS_SCSI_PERIPHERAL: | ||
| 256 | if (i2o_parm_field_get(i2o_dev, 0x0000, 3, &id, 4) < 0) | ||
| 257 | return -EFAULT; | ||
| 258 | |||
| 259 | if (i2o_parm_field_get(i2o_dev, 0x0000, 4, &lun, 8) < 0) | ||
| 260 | return -EFAULT; | ||
| 261 | |||
| 262 | parent = i2o_iop_find_device(c, i2o_dev->lct_data.parent_tid); | ||
| 263 | if (!parent) { | ||
| 264 | osm_warn("can not find parent of device %03x\n", | ||
| 265 | i2o_dev->lct_data.tid); | ||
| 266 | return -EFAULT; | ||
| 267 | } | ||
| 268 | |||
| 269 | for (i = 0; i <= i2o_shost->scsi_host->max_channel; i++) | ||
| 270 | if (i2o_shost->channel[i] == parent) | ||
| 271 | channel = i; | ||
| 272 | break; | ||
| 273 | |||
| 274 | default: | ||
| 222 | return -EFAULT; | 275 | return -EFAULT; |
| 276 | } | ||
| 277 | |||
| 278 | if (channel == -1) { | ||
| 279 | osm_warn("can not find channel of device %03x\n", | ||
| 280 | i2o_dev->lct_data.tid); | ||
| 281 | return -EFAULT; | ||
| 282 | } | ||
| 223 | 283 | ||
| 224 | if (id >= scsi_host->max_id) { | 284 | if (id >= scsi_host->max_id) { |
| 225 | osm_warn("SCSI device id (%d) >= max_id of I2O host (%d)", id, | 285 | osm_warn("SCSI device id (%d) >= max_id of I2O host (%d)", id, |
| @@ -227,42 +287,26 @@ static int i2o_scsi_probe(struct device *dev) | |||
| 227 | return -EFAULT; | 287 | return -EFAULT; |
| 228 | } | 288 | } |
| 229 | 289 | ||
| 230 | if (i2o_parm_field_get(i2o_dev, 0, 4, &lun, 8) < 0) | ||
| 231 | return -EFAULT; | ||
| 232 | if (lun >= scsi_host->max_lun) { | 290 | if (lun >= scsi_host->max_lun) { |
| 233 | osm_warn("SCSI device id (%d) >= max_lun of I2O host (%d)", | 291 | osm_warn("SCSI device id (%d) >= max_lun of I2O host (%d)", |
| 234 | (unsigned int)lun, scsi_host->max_lun); | 292 | (unsigned int)lun, scsi_host->max_lun); |
| 235 | return -EFAULT; | 293 | return -EFAULT; |
| 236 | } | 294 | } |
| 237 | 295 | ||
| 238 | parent = i2o_iop_find_device(c, i2o_dev->lct_data.parent_tid); | ||
| 239 | if (!parent) { | ||
| 240 | osm_warn("can not find parent of device %03x\n", | ||
| 241 | i2o_dev->lct_data.tid); | ||
| 242 | return -EFAULT; | ||
| 243 | } | ||
| 244 | |||
| 245 | for (i = 0; i <= i2o_shost->scsi_host->max_channel; i++) | ||
| 246 | if (i2o_shost->channel[i] == parent) | ||
| 247 | channel = i; | ||
| 248 | |||
| 249 | if (channel == -1) { | ||
| 250 | osm_warn("can not find channel of device %03x\n", | ||
| 251 | i2o_dev->lct_data.tid); | ||
| 252 | return -EFAULT; | ||
| 253 | } | ||
| 254 | |||
| 255 | scsi_dev = | 296 | scsi_dev = |
| 256 | __scsi_add_device(i2o_shost->scsi_host, channel, id, lun, i2o_dev); | 297 | __scsi_add_device(i2o_shost->scsi_host, channel, id, lun, i2o_dev); |
| 257 | 298 | ||
| 258 | if (!scsi_dev) { | 299 | if (IS_ERR(scsi_dev)) { |
| 259 | osm_warn("can not add SCSI device %03x\n", | 300 | osm_warn("can not add SCSI device %03x\n", |
| 260 | i2o_dev->lct_data.tid); | 301 | i2o_dev->lct_data.tid); |
| 261 | return -EFAULT; | 302 | return PTR_ERR(scsi_dev); |
| 262 | } | 303 | } |
| 263 | 304 | ||
| 264 | osm_debug("added new SCSI device %03x (cannel: %d, id: %d, lun: %d)\n", | 305 | sysfs_create_link(&i2o_dev->device.kobj, &scsi_dev->sdev_gendev.kobj, |
| 265 | i2o_dev->lct_data.tid, channel, id, (unsigned int)lun); | 306 | "scsi"); |
| 307 | |||
| 308 | osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %d\n", | ||
| 309 | i2o_dev->lct_data.tid, channel, id, (unsigned int)lun); | ||
| 266 | 310 | ||
| 267 | return 0; | 311 | return 0; |
| 268 | }; | 312 | }; |
| @@ -293,162 +337,89 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m, | |||
| 293 | struct i2o_message *msg) | 337 | struct i2o_message *msg) |
| 294 | { | 338 | { |
| 295 | struct scsi_cmnd *cmd; | 339 | struct scsi_cmnd *cmd; |
| 340 | u32 error; | ||
| 296 | struct device *dev; | 341 | struct device *dev; |
| 297 | u8 as, ds, st; | ||
| 298 | 342 | ||
| 299 | cmd = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt)); | 343 | cmd = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt)); |
| 300 | 344 | if (unlikely(!cmd)) { | |
| 301 | if (msg->u.head[0] & (1 << 13)) { | 345 | osm_err("NULL reply received!\n"); |
| 302 | struct i2o_message __iomem *pmsg; /* preserved message */ | 346 | return -1; |
| 303 | u32 pm; | ||
| 304 | int err = DID_ERROR; | ||
| 305 | |||
| 306 | pm = le32_to_cpu(msg->body[3]); | ||
| 307 | |||
| 308 | pmsg = i2o_msg_in_to_virt(c, pm); | ||
| 309 | |||
| 310 | osm_err("IOP fail.\n"); | ||
| 311 | osm_err("From %d To %d Cmd %d.\n", | ||
| 312 | (msg->u.head[1] >> 12) & 0xFFF, | ||
| 313 | msg->u.head[1] & 0xFFF, msg->u.head[1] >> 24); | ||
| 314 | osm_err("Failure Code %d.\n", msg->body[0] >> 24); | ||
| 315 | if (msg->body[0] & (1 << 16)) | ||
| 316 | osm_err("Format error.\n"); | ||
| 317 | if (msg->body[0] & (1 << 17)) | ||
| 318 | osm_err("Path error.\n"); | ||
| 319 | if (msg->body[0] & (1 << 18)) | ||
| 320 | osm_err("Path State.\n"); | ||
| 321 | if (msg->body[0] & (1 << 18)) | ||
| 322 | { | ||
| 323 | osm_err("Congestion.\n"); | ||
| 324 | err = DID_BUS_BUSY; | ||
| 325 | } | ||
| 326 | |||
| 327 | osm_debug("Failing message is %p.\n", pmsg); | ||
| 328 | |||
| 329 | cmd = i2o_cntxt_list_get(c, readl(&pmsg->u.s.tcntxt)); | ||
| 330 | if (!cmd) | ||
| 331 | return 1; | ||
| 332 | |||
| 333 | cmd->result = err << 16; | ||
| 334 | cmd->scsi_done(cmd); | ||
| 335 | |||
| 336 | /* Now flush the message by making it a NOP */ | ||
| 337 | i2o_msg_nop(c, pm); | ||
| 338 | |||
| 339 | return 1; | ||
| 340 | } | 347 | } |
| 341 | 348 | ||
| 342 | /* | 349 | /* |
| 343 | * Low byte is device status, next is adapter status, | 350 | * Low byte is device status, next is adapter status, |
| 344 | * (then one byte reserved), then request status. | 351 | * (then one byte reserved), then request status. |
| 345 | */ | 352 | */ |
| 346 | ds = (u8) le32_to_cpu(msg->body[0]); | 353 | error = le32_to_cpu(msg->body[0]); |
| 347 | as = (u8) (le32_to_cpu(msg->body[0]) >> 8); | 354 | |
| 348 | st = (u8) (le32_to_cpu(msg->body[0]) >> 24); | 355 | osm_debug("Completed %ld\n", cmd->serial_number); |
| 349 | 356 | ||
| 357 | cmd->result = error & 0xff; | ||
| 350 | /* | 358 | /* |
| 351 | * Is this a control request coming back - eg an abort ? | 359 | * if DeviceStatus is not SCSI_SUCCESS copy over the sense data and let |
| 360 | * the SCSI layer handle the error | ||
| 352 | */ | 361 | */ |
| 362 | if (cmd->result) | ||
| 363 | memcpy(cmd->sense_buffer, &msg->body[3], | ||
| 364 | min(sizeof(cmd->sense_buffer), (size_t) 40)); | ||
| 353 | 365 | ||
| 354 | if (!cmd) { | 366 | /* only output error code if AdapterStatus is not HBA_SUCCESS */ |
| 355 | if (st) | 367 | if ((error >> 8) & 0xff) |
| 356 | osm_warn("SCSI abort: %08X", le32_to_cpu(msg->body[0])); | 368 | osm_err("SCSI error %08x\n", error); |
| 357 | osm_info("SCSI abort completed.\n"); | ||
| 358 | return -EFAULT; | ||
| 359 | } | ||
| 360 | 369 | ||
| 361 | osm_debug("Completed %ld\n", cmd->serial_number); | 370 | dev = &c->pdev->dev; |
| 371 | if (cmd->use_sg) | ||
| 372 | dma_unmap_sg(dev, cmd->request_buffer, cmd->use_sg, | ||
| 373 | cmd->sc_data_direction); | ||
| 374 | else if (cmd->SCp.dma_handle) | ||
| 375 | dma_unmap_single(dev, cmd->SCp.dma_handle, cmd->request_bufflen, | ||
| 376 | cmd->sc_data_direction); | ||
| 362 | 377 | ||
| 363 | if (st) { | 378 | cmd->scsi_done(cmd); |
| 364 | u32 count, error; | ||
| 365 | /* An error has occurred */ | ||
| 366 | |||
| 367 | switch (st) { | ||
| 368 | case 0x06: | ||
| 369 | count = le32_to_cpu(msg->body[1]); | ||
| 370 | if (count < cmd->underflow) { | ||
| 371 | int i; | ||
| 372 | |||
| 373 | osm_err("SCSI underflow 0x%08X 0x%08X\n", count, | ||
| 374 | cmd->underflow); | ||
| 375 | osm_debug("Cmd: "); | ||
| 376 | for (i = 0; i < 15; i++) | ||
| 377 | pr_debug("%02X ", cmd->cmnd[i]); | ||
| 378 | pr_debug(".\n"); | ||
| 379 | cmd->result = (DID_ERROR << 16); | ||
| 380 | } | ||
| 381 | break; | ||
| 382 | 379 | ||
| 383 | default: | 380 | return 1; |
| 384 | error = le32_to_cpu(msg->body[0]); | 381 | }; |
| 385 | |||
| 386 | osm_err("SCSI error %08x\n", error); | ||
| 387 | |||
| 388 | if ((error & 0xff) == 0x02 /*CHECK_CONDITION */ ) { | ||
| 389 | int i; | ||
| 390 | u32 len = sizeof(cmd->sense_buffer); | ||
| 391 | len = (len > 40) ? 40 : len; | ||
| 392 | // Copy over the sense data | ||
| 393 | memcpy(cmd->sense_buffer, (void *)&msg->body[3], | ||
| 394 | len); | ||
| 395 | for (i = 0; i <= len; i++) | ||
| 396 | osm_info("%02x\n", | ||
| 397 | cmd->sense_buffer[i]); | ||
| 398 | if (cmd->sense_buffer[0] == 0x70 | ||
| 399 | && cmd->sense_buffer[2] == DATA_PROTECT) { | ||
| 400 | /* This is to handle an array failed */ | ||
| 401 | cmd->result = (DID_TIME_OUT << 16); | ||
| 402 | printk(KERN_WARNING "%s: SCSI Data " | ||
| 403 | "Protect-Device (%d,%d,%d) " | ||
| 404 | "hba_status=0x%x, dev_status=" | ||
| 405 | "0x%x, cmd=0x%x\n", c->name, | ||
| 406 | (u32) cmd->device->channel, | ||
| 407 | (u32) cmd->device->id, | ||
| 408 | (u32) cmd->device->lun, | ||
| 409 | (error >> 8) & 0xff, | ||
| 410 | error & 0xff, cmd->cmnd[0]); | ||
| 411 | } else | ||
| 412 | cmd->result = (DID_ERROR << 16); | ||
| 413 | |||
| 414 | break; | ||
| 415 | } | ||
| 416 | |||
| 417 | switch (as) { | ||
| 418 | case 0x0E: | ||
| 419 | /* SCSI Reset */ | ||
| 420 | cmd->result = DID_RESET << 16; | ||
| 421 | break; | ||
| 422 | |||
| 423 | case 0x0F: | ||
| 424 | cmd->result = DID_PARITY << 16; | ||
| 425 | break; | ||
| 426 | |||
| 427 | default: | ||
| 428 | cmd->result = DID_ERROR << 16; | ||
| 429 | break; | ||
| 430 | } | ||
| 431 | 382 | ||
| 432 | break; | 383 | /** |
| 433 | } | 384 | * i2o_scsi_notify_device_add - Retrieve notifications of added devices |
| 385 | * @i2o_dev: the I2O device which was added | ||
| 386 | * | ||
| 387 | * If a I2O device is added we catch the notification, because I2O classes | ||
| 388 | * other then SCSI peripheral will not be received through | ||
| 389 | * i2o_scsi_probe(). | ||
| 390 | */ | ||
| 391 | static void i2o_scsi_notify_device_add(struct i2o_device *i2o_dev) | ||
| 392 | { | ||
| 393 | switch (i2o_dev->lct_data.class_id) { | ||
| 394 | case I2O_CLASS_EXECUTIVE: | ||
| 395 | case I2O_CLASS_RANDOM_BLOCK_STORAGE: | ||
| 396 | i2o_scsi_probe(&i2o_dev->device); | ||
| 397 | break; | ||
| 434 | 398 | ||
| 435 | cmd->scsi_done(cmd); | 399 | default: |
| 436 | return 1; | 400 | break; |
| 437 | } | 401 | } |
| 402 | }; | ||
| 438 | 403 | ||
| 439 | cmd->result = DID_OK << 16 | ds; | 404 | /** |
| 440 | 405 | * i2o_scsi_notify_device_remove - Retrieve notifications of removed | |
| 441 | cmd->scsi_done(cmd); | 406 | * devices |
| 442 | 407 | * @i2o_dev: the I2O device which was removed | |
| 443 | dev = &c->pdev->dev; | 408 | * |
| 444 | if (cmd->use_sg) | 409 | * If a I2O device is removed, we catch the notification to remove the |
| 445 | dma_unmap_sg(dev, (struct scatterlist *)cmd->buffer, | 410 | * corresponding SCSI device. |
| 446 | cmd->use_sg, cmd->sc_data_direction); | 411 | */ |
| 447 | else if (cmd->request_bufflen) | 412 | static void i2o_scsi_notify_device_remove(struct i2o_device *i2o_dev) |
| 448 | dma_unmap_single(dev, (dma_addr_t) ((long)cmd->SCp.ptr), | 413 | { |
| 449 | cmd->request_bufflen, cmd->sc_data_direction); | 414 | switch (i2o_dev->lct_data.class_id) { |
| 415 | case I2O_CLASS_EXECUTIVE: | ||
| 416 | case I2O_CLASS_RANDOM_BLOCK_STORAGE: | ||
| 417 | i2o_scsi_remove(&i2o_dev->device); | ||
| 418 | break; | ||
| 450 | 419 | ||
| 451 | return 1; | 420 | default: |
| 421 | break; | ||
| 422 | } | ||
| 452 | }; | 423 | }; |
| 453 | 424 | ||
| 454 | /** | 425 | /** |
| @@ -501,7 +472,7 @@ static void i2o_scsi_notify_controller_remove(struct i2o_controller *c) | |||
| 501 | 472 | ||
| 502 | scsi_remove_host(i2o_shost->scsi_host); | 473 | scsi_remove_host(i2o_shost->scsi_host); |
| 503 | scsi_host_put(i2o_shost->scsi_host); | 474 | scsi_host_put(i2o_shost->scsi_host); |
| 504 | pr_info("I2O SCSI host removed\n"); | 475 | osm_debug("I2O SCSI host removed\n"); |
| 505 | }; | 476 | }; |
| 506 | 477 | ||
| 507 | /* SCSI OSM driver struct */ | 478 | /* SCSI OSM driver struct */ |
| @@ -509,6 +480,8 @@ static struct i2o_driver i2o_scsi_driver = { | |||
| 509 | .name = OSM_NAME, | 480 | .name = OSM_NAME, |
| 510 | .reply = i2o_scsi_reply, | 481 | .reply = i2o_scsi_reply, |
| 511 | .classes = i2o_scsi_class_id, | 482 | .classes = i2o_scsi_class_id, |
| 483 | .notify_device_add = i2o_scsi_notify_device_add, | ||
| 484 | .notify_device_remove = i2o_scsi_notify_device_remove, | ||
| 512 | .notify_controller_add = i2o_scsi_notify_controller_add, | 485 | .notify_controller_add = i2o_scsi_notify_controller_add, |
| 513 | .notify_controller_remove = i2o_scsi_notify_controller_remove, | 486 | .notify_controller_remove = i2o_scsi_notify_controller_remove, |
| 514 | .driver = { | 487 | .driver = { |
| @@ -535,26 +508,26 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 535 | void (*done) (struct scsi_cmnd *)) | 508 | void (*done) (struct scsi_cmnd *)) |
| 536 | { | 509 | { |
| 537 | struct i2o_controller *c; | 510 | struct i2o_controller *c; |
| 538 | struct Scsi_Host *host; | ||
| 539 | struct i2o_device *i2o_dev; | 511 | struct i2o_device *i2o_dev; |
| 540 | struct device *dev; | ||
| 541 | int tid; | 512 | int tid; |
| 542 | struct i2o_message __iomem *msg; | 513 | struct i2o_message __iomem *msg; |
| 543 | u32 m; | 514 | u32 m; |
| 544 | u32 scsi_flags, sg_flags; | 515 | /* |
| 516 | * ENABLE_DISCONNECT | ||
| 517 | * SIMPLE_TAG | ||
| 518 | * RETURN_SENSE_DATA_IN_REPLY_MESSAGE_FRAME | ||
| 519 | */ | ||
| 520 | u32 scsi_flags = 0x20a00000; | ||
| 521 | u32 sgl_offset; | ||
| 545 | u32 __iomem *mptr; | 522 | u32 __iomem *mptr; |
| 546 | u32 __iomem *lenptr; | 523 | u32 cmd = I2O_CMD_SCSI_EXEC << 24; |
| 547 | u32 len, reqlen; | 524 | int rc = 0; |
| 548 | int i; | ||
| 549 | 525 | ||
| 550 | /* | 526 | /* |
| 551 | * Do the incoming paperwork | 527 | * Do the incoming paperwork |
| 552 | */ | 528 | */ |
| 553 | |||
| 554 | i2o_dev = SCpnt->device->hostdata; | 529 | i2o_dev = SCpnt->device->hostdata; |
| 555 | host = SCpnt->device->host; | ||
| 556 | c = i2o_dev->iop; | 530 | c = i2o_dev->iop; |
| 557 | dev = &c->pdev->dev; | ||
| 558 | 531 | ||
| 559 | SCpnt->scsi_done = done; | 532 | SCpnt->scsi_done = done; |
| 560 | 533 | ||
| @@ -562,7 +535,7 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 562 | osm_warn("no I2O device in request\n"); | 535 | osm_warn("no I2O device in request\n"); |
| 563 | SCpnt->result = DID_NO_CONNECT << 16; | 536 | SCpnt->result = DID_NO_CONNECT << 16; |
| 564 | done(SCpnt); | 537 | done(SCpnt); |
| 565 | return 0; | 538 | goto exit; |
| 566 | } | 539 | } |
| 567 | 540 | ||
| 568 | tid = i2o_dev->lct_data.tid; | 541 | tid = i2o_dev->lct_data.tid; |
| @@ -571,44 +544,85 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 571 | osm_debug("Real scsi messages.\n"); | 544 | osm_debug("Real scsi messages.\n"); |
| 572 | 545 | ||
| 573 | /* | 546 | /* |
| 574 | * Obtain an I2O message. If there are none free then | ||
| 575 | * throw it back to the scsi layer | ||
| 576 | */ | ||
| 577 | |||
| 578 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
| 579 | if (m == I2O_QUEUE_EMPTY) | ||
| 580 | return SCSI_MLQUEUE_HOST_BUSY; | ||
| 581 | |||
| 582 | /* | ||
| 583 | * Put together a scsi execscb message | 547 | * Put together a scsi execscb message |
| 584 | */ | 548 | */ |
| 585 | |||
| 586 | len = SCpnt->request_bufflen; | ||
| 587 | |||
| 588 | switch (SCpnt->sc_data_direction) { | 549 | switch (SCpnt->sc_data_direction) { |
| 589 | case PCI_DMA_NONE: | 550 | case PCI_DMA_NONE: |
| 590 | scsi_flags = 0x00000000; // DATA NO XFER | 551 | /* DATA NO XFER */ |
| 591 | sg_flags = 0x00000000; | 552 | sgl_offset = SGL_OFFSET_0; |
| 592 | break; | 553 | break; |
| 593 | 554 | ||
| 594 | case PCI_DMA_TODEVICE: | 555 | case PCI_DMA_TODEVICE: |
| 595 | scsi_flags = 0x80000000; // DATA OUT (iop-->dev) | 556 | /* DATA OUT (iop-->dev) */ |
| 596 | sg_flags = 0x14000000; | 557 | scsi_flags |= 0x80000000; |
| 558 | sgl_offset = SGL_OFFSET_10; | ||
| 597 | break; | 559 | break; |
| 598 | 560 | ||
| 599 | case PCI_DMA_FROMDEVICE: | 561 | case PCI_DMA_FROMDEVICE: |
| 600 | scsi_flags = 0x40000000; // DATA IN (iop<--dev) | 562 | /* DATA IN (iop<--dev) */ |
| 601 | sg_flags = 0x10000000; | 563 | scsi_flags |= 0x40000000; |
| 564 | sgl_offset = SGL_OFFSET_10; | ||
| 602 | break; | 565 | break; |
| 603 | 566 | ||
| 604 | default: | 567 | default: |
| 605 | /* Unknown - kill the command */ | 568 | /* Unknown - kill the command */ |
| 606 | SCpnt->result = DID_NO_CONNECT << 16; | 569 | SCpnt->result = DID_NO_CONNECT << 16; |
| 607 | done(SCpnt); | 570 | done(SCpnt); |
| 608 | return 0; | 571 | goto exit; |
| 609 | } | 572 | } |
| 610 | 573 | ||
| 611 | writel(I2O_CMD_SCSI_EXEC << 24 | HOST_TID << 12 | tid, &msg->u.head[1]); | 574 | /* |
| 575 | * Obtain an I2O message. If there are none free then | ||
| 576 | * throw it back to the scsi layer | ||
| 577 | */ | ||
| 578 | |||
| 579 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
| 580 | if (m == I2O_QUEUE_EMPTY) { | ||
| 581 | rc = SCSI_MLQUEUE_HOST_BUSY; | ||
| 582 | goto exit; | ||
| 583 | } | ||
| 584 | |||
| 585 | mptr = &msg->body[0]; | ||
| 586 | |||
| 587 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
| 588 | if (c->adaptec) { | ||
| 589 | u32 adpt_flags = 0; | ||
| 590 | |||
| 591 | if (SCpnt->sc_request && SCpnt->sc_request->upper_private_data) { | ||
| 592 | i2o_sg_io_hdr_t __user *usr_ptr = | ||
| 593 | ((Sg_request *) (SCpnt->sc_request-> | ||
| 594 | upper_private_data))->header. | ||
| 595 | usr_ptr; | ||
| 596 | |||
| 597 | if (usr_ptr) | ||
| 598 | get_user(adpt_flags, &usr_ptr->flags); | ||
| 599 | } | ||
| 600 | |||
| 601 | switch (i2o_dev->lct_data.class_id) { | ||
| 602 | case I2O_CLASS_EXECUTIVE: | ||
| 603 | case I2O_CLASS_RANDOM_BLOCK_STORAGE: | ||
| 604 | /* interpret flag has to be set for executive */ | ||
| 605 | adpt_flags ^= I2O_DPT_SG_FLAG_INTERPRET; | ||
| 606 | break; | ||
| 607 | |||
| 608 | default: | ||
| 609 | break; | ||
| 610 | } | ||
| 611 | |||
| 612 | /* | ||
| 613 | * for Adaptec controllers we use the PRIVATE command, because | ||
| 614 | * the normal SCSI EXEC doesn't support all SCSI commands on | ||
| 615 | * all controllers (for example READ CAPACITY). | ||
| 616 | */ | ||
| 617 | if (sgl_offset == SGL_OFFSET_10) | ||
| 618 | sgl_offset = SGL_OFFSET_12; | ||
| 619 | cmd = I2O_CMD_PRIVATE << 24; | ||
| 620 | writel(I2O_VENDOR_DPT << 16 | I2O_CMD_SCSI_EXEC, mptr++); | ||
| 621 | writel(adpt_flags | tid, mptr++); | ||
| 622 | } | ||
| 623 | #endif | ||
| 624 | |||
| 625 | writel(cmd | HOST_TID << 12 | tid, &msg->u.head[1]); | ||
| 612 | writel(i2o_scsi_driver.context, &msg->u.s.icntxt); | 626 | writel(i2o_scsi_driver.context, &msg->u.s.icntxt); |
| 613 | 627 | ||
| 614 | /* We want the SCSI control block back */ | 628 | /* We want the SCSI control block back */ |
| @@ -626,7 +640,7 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 626 | */ | 640 | */ |
| 627 | 641 | ||
| 628 | /* Attach tags to the devices */ | 642 | /* Attach tags to the devices */ |
| 629 | /* | 643 | /* FIXME: implement |
| 630 | if(SCpnt->device->tagged_supported) { | 644 | if(SCpnt->device->tagged_supported) { |
| 631 | if(SCpnt->tag == HEAD_OF_QUEUE_TAG) | 645 | if(SCpnt->tag == HEAD_OF_QUEUE_TAG) |
| 632 | scsi_flags |= 0x01000000; | 646 | scsi_flags |= 0x01000000; |
| @@ -635,67 +649,35 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 635 | } | 649 | } |
| 636 | */ | 650 | */ |
| 637 | 651 | ||
| 638 | /* Direction, disconnect ok, tag, CDBLen */ | 652 | writel(scsi_flags | SCpnt->cmd_len, mptr++); |
| 639 | writel(scsi_flags | 0x20200000 | SCpnt->cmd_len, &msg->body[0]); | ||
| 640 | |||
| 641 | mptr = &msg->body[1]; | ||
| 642 | 653 | ||
| 643 | /* Write SCSI command into the message - always 16 byte block */ | 654 | /* Write SCSI command into the message - always 16 byte block */ |
| 644 | memcpy_toio(mptr, SCpnt->cmnd, 16); | 655 | memcpy_toio(mptr, SCpnt->cmnd, 16); |
| 645 | mptr += 4; | 656 | mptr += 4; |
| 646 | lenptr = mptr++; /* Remember me - fill in when we know */ | ||
| 647 | |||
| 648 | reqlen = 12; // SINGLE SGE | ||
| 649 | |||
| 650 | /* Now fill in the SGList and command */ | ||
| 651 | if (SCpnt->use_sg) { | ||
| 652 | struct scatterlist *sg; | ||
| 653 | int sg_count; | ||
| 654 | |||
| 655 | sg = SCpnt->request_buffer; | ||
| 656 | len = 0; | ||
| 657 | |||
| 658 | sg_count = dma_map_sg(dev, sg, SCpnt->use_sg, | ||
| 659 | SCpnt->sc_data_direction); | ||
| 660 | 657 | ||
| 661 | if (unlikely(sg_count <= 0)) | 658 | if (sgl_offset != SGL_OFFSET_0) { |
| 662 | return -ENOMEM; | 659 | /* write size of data addressed by SGL */ |
| 663 | 660 | writel(SCpnt->request_bufflen, mptr++); | |
| 664 | for (i = SCpnt->use_sg; i > 0; i--) { | 661 | |
| 665 | if (i == 1) | 662 | /* Now fill in the SGList and command */ |
| 666 | sg_flags |= 0xC0000000; | 663 | if (SCpnt->use_sg) { |
| 667 | writel(sg_flags | sg_dma_len(sg), mptr++); | 664 | if (!i2o_dma_map_sg(c, SCpnt->request_buffer, |
| 668 | writel(sg_dma_address(sg), mptr++); | 665 | SCpnt->use_sg, |
| 669 | len += sg_dma_len(sg); | 666 | SCpnt->sc_data_direction, &mptr)) |
| 670 | sg++; | 667 | goto nomem; |
| 668 | } else { | ||
| 669 | SCpnt->SCp.dma_handle = | ||
| 670 | i2o_dma_map_single(c, SCpnt->request_buffer, | ||
| 671 | SCpnt->request_bufflen, | ||
| 672 | SCpnt->sc_data_direction, &mptr); | ||
| 673 | if (dma_mapping_error(SCpnt->SCp.dma_handle)) | ||
| 674 | goto nomem; | ||
| 671 | } | 675 | } |
| 672 | |||
| 673 | reqlen = mptr - &msg->u.head[0]; | ||
| 674 | writel(len, lenptr); | ||
| 675 | } else { | ||
| 676 | len = SCpnt->request_bufflen; | ||
| 677 | |||
| 678 | writel(len, lenptr); | ||
| 679 | |||
| 680 | if (len > 0) { | ||
| 681 | dma_addr_t dma_addr; | ||
| 682 | |||
| 683 | dma_addr = dma_map_single(dev, SCpnt->request_buffer, | ||
| 684 | SCpnt->request_bufflen, | ||
| 685 | SCpnt->sc_data_direction); | ||
| 686 | if (!dma_addr) | ||
| 687 | return -ENOMEM; | ||
| 688 | |||
| 689 | SCpnt->SCp.ptr = (void *)(unsigned long)dma_addr; | ||
| 690 | sg_flags |= 0xC0000000; | ||
| 691 | writel(sg_flags | SCpnt->request_bufflen, mptr++); | ||
| 692 | writel(dma_addr, mptr++); | ||
| 693 | } else | ||
| 694 | reqlen = 9; | ||
| 695 | } | 676 | } |
| 696 | 677 | ||
| 697 | /* Stick the headers on */ | 678 | /* Stick the headers on */ |
| 698 | writel(reqlen << 16 | SGL_OFFSET_10, &msg->u.head[0]); | 679 | writel(I2O_MESSAGE_SIZE(mptr - &msg->u.head[0]) | sgl_offset, |
| 680 | &msg->u.head[0]); | ||
| 699 | 681 | ||
| 700 | /* Queue the message */ | 682 | /* Queue the message */ |
| 701 | i2o_msg_post(c, m); | 683 | i2o_msg_post(c, m); |
| @@ -703,6 +685,13 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 703 | osm_debug("Issued %ld\n", SCpnt->serial_number); | 685 | osm_debug("Issued %ld\n", SCpnt->serial_number); |
| 704 | 686 | ||
| 705 | return 0; | 687 | return 0; |
| 688 | |||
| 689 | nomem: | ||
| 690 | rc = -ENOMEM; | ||
| 691 | i2o_msg_nop(c, m); | ||
| 692 | |||
| 693 | exit: | ||
| 694 | return rc; | ||
| 706 | }; | 695 | }; |
| 707 | 696 | ||
| 708 | /** | 697 | /** |
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 50c8cedf7a2d..42f8b810d6e5 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c | |||
| @@ -28,8 +28,10 @@ | |||
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/i2o.h> | 29 | #include <linux/i2o.h> |
| 30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
| 31 | #include "core.h" | ||
| 31 | 32 | ||
| 32 | #define OSM_VERSION "$Rev$" | 33 | #define OSM_NAME "i2o" |
| 34 | #define OSM_VERSION "1.288" | ||
| 33 | #define OSM_DESCRIPTION "I2O subsystem" | 35 | #define OSM_DESCRIPTION "I2O subsystem" |
| 34 | 36 | ||
| 35 | /* global I2O controller list */ | 37 | /* global I2O controller list */ |
| @@ -43,20 +45,6 @@ static struct i2o_dma i2o_systab; | |||
| 43 | 45 | ||
| 44 | static int i2o_hrt_get(struct i2o_controller *c); | 46 | static int i2o_hrt_get(struct i2o_controller *c); |
| 45 | 47 | ||
| 46 | /* Module internal functions from other sources */ | ||
| 47 | extern struct i2o_driver i2o_exec_driver; | ||
| 48 | extern int i2o_exec_lct_get(struct i2o_controller *); | ||
| 49 | extern void i2o_device_remove(struct i2o_device *); | ||
| 50 | |||
| 51 | extern int __init i2o_driver_init(void); | ||
| 52 | extern void __exit i2o_driver_exit(void); | ||
| 53 | extern int __init i2o_exec_init(void); | ||
| 54 | extern void __exit i2o_exec_exit(void); | ||
| 55 | extern int __init i2o_pci_init(void); | ||
| 56 | extern void __exit i2o_pci_exit(void); | ||
| 57 | extern int i2o_device_init(void); | ||
| 58 | extern void i2o_device_exit(void); | ||
| 59 | |||
| 60 | /** | 48 | /** |
| 61 | * i2o_msg_nop - Returns a message which is not used | 49 | * i2o_msg_nop - Returns a message which is not used |
| 62 | * @c: I2O controller from which the message was created | 50 | * @c: I2O controller from which the message was created |
| @@ -68,7 +56,7 @@ extern void i2o_device_exit(void); | |||
| 68 | */ | 56 | */ |
| 69 | void i2o_msg_nop(struct i2o_controller *c, u32 m) | 57 | void i2o_msg_nop(struct i2o_controller *c, u32 m) |
| 70 | { | 58 | { |
| 71 | struct i2o_message __iomem *msg = c->in_queue.virt + m; | 59 | struct i2o_message __iomem *msg = i2o_msg_in_to_virt(c, m); |
| 72 | 60 | ||
| 73 | writel(THREE_WORD_MSG_SIZE | SGL_OFFSET_0, &msg->u.head[0]); | 61 | writel(THREE_WORD_MSG_SIZE | SGL_OFFSET_0, &msg->u.head[0]); |
| 74 | writel(I2O_CMD_UTIL_NOP << 24 | HOST_TID << 12 | ADAPTER_TID, | 62 | writel(I2O_CMD_UTIL_NOP << 24 | HOST_TID << 12 | ADAPTER_TID, |
| @@ -92,16 +80,16 @@ void i2o_msg_nop(struct i2o_controller *c, u32 m) | |||
| 92 | * address from the read port (see the i2o spec). If no message is | 80 | * address from the read port (see the i2o spec). If no message is |
| 93 | * available returns I2O_QUEUE_EMPTY and msg is leaved untouched. | 81 | * available returns I2O_QUEUE_EMPTY and msg is leaved untouched. |
| 94 | */ | 82 | */ |
| 95 | u32 i2o_msg_get_wait(struct i2o_controller *c, struct i2o_message __iomem **msg, | 83 | u32 i2o_msg_get_wait(struct i2o_controller *c, |
| 96 | int wait) | 84 | struct i2o_message __iomem ** msg, int wait) |
| 97 | { | 85 | { |
| 98 | unsigned long timeout = jiffies + wait * HZ; | 86 | unsigned long timeout = jiffies + wait * HZ; |
| 99 | u32 m; | 87 | u32 m; |
| 100 | 88 | ||
| 101 | while ((m = i2o_msg_get(c, msg)) == I2O_QUEUE_EMPTY) { | 89 | while ((m = i2o_msg_get(c, msg)) == I2O_QUEUE_EMPTY) { |
| 102 | if (time_after(jiffies, timeout)) { | 90 | if (time_after(jiffies, timeout)) { |
| 103 | pr_debug("%s: Timeout waiting for message frame.\n", | 91 | osm_debug("%s: Timeout waiting for message frame.\n", |
| 104 | c->name); | 92 | c->name); |
| 105 | return I2O_QUEUE_EMPTY; | 93 | return I2O_QUEUE_EMPTY; |
| 106 | } | 94 | } |
| 107 | set_current_state(TASK_UNINTERRUPTIBLE); | 95 | set_current_state(TASK_UNINTERRUPTIBLE); |
| @@ -129,13 +117,13 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr) | |||
| 129 | unsigned long flags; | 117 | unsigned long flags; |
| 130 | 118 | ||
| 131 | if (!ptr) | 119 | if (!ptr) |
| 132 | printk(KERN_ERR "%s: couldn't add NULL pointer to context list!" | 120 | osm_err("%s: couldn't add NULL pointer to context list!\n", |
| 133 | "\n", c->name); | 121 | c->name); |
| 134 | 122 | ||
| 135 | entry = kmalloc(sizeof(*entry), GFP_ATOMIC); | 123 | entry = kmalloc(sizeof(*entry), GFP_ATOMIC); |
| 136 | if (!entry) { | 124 | if (!entry) { |
| 137 | printk(KERN_ERR "%s: Could not allocate memory for context " | 125 | osm_err("%s: Could not allocate memory for context list element" |
| 138 | "list element\n", c->name); | 126 | "\n", c->name); |
| 139 | return 0; | 127 | return 0; |
| 140 | } | 128 | } |
| 141 | 129 | ||
| @@ -154,7 +142,7 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr) | |||
| 154 | 142 | ||
| 155 | spin_unlock_irqrestore(&c->context_list_lock, flags); | 143 | spin_unlock_irqrestore(&c->context_list_lock, flags); |
| 156 | 144 | ||
| 157 | pr_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context); | 145 | osm_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context); |
| 158 | 146 | ||
| 159 | return entry->context; | 147 | return entry->context; |
| 160 | }; | 148 | }; |
| @@ -186,11 +174,11 @@ u32 i2o_cntxt_list_remove(struct i2o_controller * c, void *ptr) | |||
| 186 | spin_unlock_irqrestore(&c->context_list_lock, flags); | 174 | spin_unlock_irqrestore(&c->context_list_lock, flags); |
| 187 | 175 | ||
| 188 | if (!context) | 176 | if (!context) |
| 189 | printk(KERN_WARNING "%s: Could not remove nonexistent ptr " | 177 | osm_warn("%s: Could not remove nonexistent ptr %p\n", c->name, |
| 190 | "%p\n", c->name, ptr); | 178 | ptr); |
| 191 | 179 | ||
| 192 | pr_debug("%s: remove ptr from context list %d -> %p\n", c->name, | 180 | osm_debug("%s: remove ptr from context list %d -> %p\n", c->name, |
| 193 | context, ptr); | 181 | context, ptr); |
| 194 | 182 | ||
| 195 | return context; | 183 | return context; |
| 196 | }; | 184 | }; |
| @@ -220,11 +208,10 @@ void *i2o_cntxt_list_get(struct i2o_controller *c, u32 context) | |||
| 220 | spin_unlock_irqrestore(&c->context_list_lock, flags); | 208 | spin_unlock_irqrestore(&c->context_list_lock, flags); |
| 221 | 209 | ||
| 222 | if (!ptr) | 210 | if (!ptr) |
| 223 | printk(KERN_WARNING "%s: context id %d not found\n", c->name, | 211 | osm_warn("%s: context id %d not found\n", c->name, context); |
| 224 | context); | ||
| 225 | 212 | ||
| 226 | pr_debug("%s: get ptr from context list %d -> %p\n", c->name, context, | 213 | osm_debug("%s: get ptr from context list %d -> %p\n", c->name, context, |
| 227 | ptr); | 214 | ptr); |
| 228 | 215 | ||
| 229 | return ptr; | 216 | return ptr; |
| 230 | }; | 217 | }; |
| @@ -252,11 +239,11 @@ u32 i2o_cntxt_list_get_ptr(struct i2o_controller * c, void *ptr) | |||
| 252 | spin_unlock_irqrestore(&c->context_list_lock, flags); | 239 | spin_unlock_irqrestore(&c->context_list_lock, flags); |
| 253 | 240 | ||
| 254 | if (!context) | 241 | if (!context) |
| 255 | printk(KERN_WARNING "%s: Could not find nonexistent ptr " | 242 | osm_warn("%s: Could not find nonexistent ptr %p\n", c->name, |
| 256 | "%p\n", c->name, ptr); | 243 | ptr); |
| 257 | 244 | ||
| 258 | pr_debug("%s: get context id from context list %p -> %d\n", c->name, | 245 | osm_debug("%s: get context id from context list %p -> %d\n", c->name, |
| 259 | ptr, context); | 246 | ptr, context); |
| 260 | 247 | ||
| 261 | return context; | 248 | return context; |
| 262 | }; | 249 | }; |
| @@ -336,10 +323,9 @@ static int i2o_iop_quiesce(struct i2o_controller *c) | |||
| 336 | 323 | ||
| 337 | /* Long timeout needed for quiesce if lots of devices */ | 324 | /* Long timeout needed for quiesce if lots of devices */ |
| 338 | if ((rc = i2o_msg_post_wait(c, m, 240))) | 325 | if ((rc = i2o_msg_post_wait(c, m, 240))) |
| 339 | printk(KERN_INFO "%s: Unable to quiesce (status=%#x).\n", | 326 | osm_info("%s: Unable to quiesce (status=%#x).\n", c->name, -rc); |
| 340 | c->name, -rc); | ||
| 341 | else | 327 | else |
| 342 | pr_debug("%s: Quiesced.\n", c->name); | 328 | osm_debug("%s: Quiesced.\n", c->name); |
| 343 | 329 | ||
| 344 | i2o_status_get(c); // Entered READY state | 330 | i2o_status_get(c); // Entered READY state |
| 345 | 331 | ||
| @@ -377,10 +363,9 @@ static int i2o_iop_enable(struct i2o_controller *c) | |||
| 377 | 363 | ||
| 378 | /* How long of a timeout do we need? */ | 364 | /* How long of a timeout do we need? */ |
| 379 | if ((rc = i2o_msg_post_wait(c, m, 240))) | 365 | if ((rc = i2o_msg_post_wait(c, m, 240))) |
| 380 | printk(KERN_ERR "%s: Could not enable (status=%#x).\n", | 366 | osm_err("%s: Could not enable (status=%#x).\n", c->name, -rc); |
| 381 | c->name, -rc); | ||
| 382 | else | 367 | else |
| 383 | pr_debug("%s: Enabled.\n", c->name); | 368 | osm_debug("%s: Enabled.\n", c->name); |
| 384 | 369 | ||
| 385 | i2o_status_get(c); // entered OPERATIONAL state | 370 | i2o_status_get(c); // entered OPERATIONAL state |
| 386 | 371 | ||
| @@ -444,20 +429,78 @@ static int i2o_iop_clear(struct i2o_controller *c) | |||
| 444 | &msg->u.head[1]); | 429 | &msg->u.head[1]); |
| 445 | 430 | ||
| 446 | if ((rc = i2o_msg_post_wait(c, m, 30))) | 431 | if ((rc = i2o_msg_post_wait(c, m, 30))) |
| 447 | printk(KERN_INFO "%s: Unable to clear (status=%#x).\n", | 432 | osm_info("%s: Unable to clear (status=%#x).\n", c->name, -rc); |
| 448 | c->name, -rc); | ||
| 449 | else | 433 | else |
| 450 | pr_debug("%s: Cleared.\n", c->name); | 434 | osm_debug("%s: Cleared.\n", c->name); |
| 451 | 435 | ||
| 452 | /* Enable all IOPs */ | 436 | /* Enable all IOPs */ |
| 453 | i2o_iop_enable_all(); | 437 | i2o_iop_enable_all(); |
| 454 | 438 | ||
| 455 | i2o_status_get(c); | ||
| 456 | |||
| 457 | return rc; | 439 | return rc; |
| 458 | } | 440 | } |
| 459 | 441 | ||
| 460 | /** | 442 | /** |
| 443 | * i2o_iop_init_outbound_queue - setup the outbound message queue | ||
| 444 | * @c: I2O controller | ||
| 445 | * | ||
| 446 | * Clear and (re)initialize IOP's outbound queue and post the message | ||
| 447 | * frames to the IOP. | ||
| 448 | * | ||
| 449 | * Returns 0 on success or a negative errno code on failure. | ||
| 450 | */ | ||
| 451 | static int i2o_iop_init_outbound_queue(struct i2o_controller *c) | ||
| 452 | { | ||
| 453 | volatile u8 *status = c->status.virt; | ||
| 454 | u32 m; | ||
| 455 | struct i2o_message __iomem *msg; | ||
| 456 | ulong timeout; | ||
| 457 | int i; | ||
| 458 | |||
| 459 | osm_debug("%s: Initializing Outbound Queue...\n", c->name); | ||
| 460 | |||
| 461 | memset(c->status.virt, 0, 4); | ||
| 462 | |||
| 463 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
| 464 | if (m == I2O_QUEUE_EMPTY) | ||
| 465 | return -ETIMEDOUT; | ||
| 466 | |||
| 467 | writel(EIGHT_WORD_MSG_SIZE | SGL_OFFSET_6, &msg->u.head[0]); | ||
| 468 | writel(I2O_CMD_OUTBOUND_INIT << 24 | HOST_TID << 12 | ADAPTER_TID, | ||
| 469 | &msg->u.head[1]); | ||
| 470 | writel(i2o_exec_driver.context, &msg->u.s.icntxt); | ||
| 471 | writel(0x00000000, &msg->u.s.tcntxt); | ||
| 472 | writel(PAGE_SIZE, &msg->body[0]); | ||
| 473 | /* Outbound msg frame size in words and Initcode */ | ||
| 474 | writel(I2O_OUTBOUND_MSG_FRAME_SIZE << 16 | 0x80, &msg->body[1]); | ||
| 475 | writel(0xd0000004, &msg->body[2]); | ||
| 476 | writel(i2o_dma_low(c->status.phys), &msg->body[3]); | ||
| 477 | writel(i2o_dma_high(c->status.phys), &msg->body[4]); | ||
| 478 | |||
| 479 | i2o_msg_post(c, m); | ||
| 480 | |||
| 481 | timeout = jiffies + I2O_TIMEOUT_INIT_OUTBOUND_QUEUE * HZ; | ||
| 482 | while (*status <= I2O_CMD_IN_PROGRESS) { | ||
| 483 | if (time_after(jiffies, timeout)) { | ||
| 484 | osm_warn("%s: Timeout Initializing\n", c->name); | ||
| 485 | return -ETIMEDOUT; | ||
| 486 | } | ||
| 487 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
| 488 | schedule_timeout(1); | ||
| 489 | } | ||
| 490 | |||
| 491 | m = c->out_queue.phys; | ||
| 492 | |||
| 493 | /* Post frames */ | ||
| 494 | for (i = 0; i < I2O_MAX_OUTBOUND_MSG_FRAMES; i++) { | ||
| 495 | i2o_flush_reply(c, m); | ||
| 496 | udelay(1); /* Promise */ | ||
| 497 | m += I2O_OUTBOUND_MSG_FRAME_SIZE * sizeof(u32); | ||
| 498 | } | ||
| 499 | |||
| 500 | return 0; | ||
| 501 | } | ||
| 502 | |||
| 503 | /** | ||
| 461 | * i2o_iop_reset - reset an I2O controller | 504 | * i2o_iop_reset - reset an I2O controller |
| 462 | * @c: controller to reset | 505 | * @c: controller to reset |
| 463 | * | 506 | * |
| @@ -468,20 +511,20 @@ static int i2o_iop_clear(struct i2o_controller *c) | |||
| 468 | */ | 511 | */ |
| 469 | static int i2o_iop_reset(struct i2o_controller *c) | 512 | static int i2o_iop_reset(struct i2o_controller *c) |
| 470 | { | 513 | { |
| 471 | u8 *status = c->status.virt; | 514 | volatile u8 *status = c->status.virt; |
| 472 | struct i2o_message __iomem *msg; | 515 | struct i2o_message __iomem *msg; |
| 473 | u32 m; | 516 | u32 m; |
| 474 | unsigned long timeout; | 517 | unsigned long timeout; |
| 475 | i2o_status_block *sb = c->status_block.virt; | 518 | i2o_status_block *sb = c->status_block.virt; |
| 476 | int rc = 0; | 519 | int rc = 0; |
| 477 | 520 | ||
| 478 | pr_debug("%s: Resetting controller\n", c->name); | 521 | osm_debug("%s: Resetting controller\n", c->name); |
| 479 | 522 | ||
| 480 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | 523 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); |
| 481 | if (m == I2O_QUEUE_EMPTY) | 524 | if (m == I2O_QUEUE_EMPTY) |
| 482 | return -ETIMEDOUT; | 525 | return -ETIMEDOUT; |
| 483 | 526 | ||
| 484 | memset(status, 0, 8); | 527 | memset(c->status_block.virt, 0, 8); |
| 485 | 528 | ||
| 486 | /* Quiesce all IOPs first */ | 529 | /* Quiesce all IOPs first */ |
| 487 | i2o_iop_quiesce_all(); | 530 | i2o_iop_quiesce_all(); |
| @@ -493,49 +536,43 @@ static int i2o_iop_reset(struct i2o_controller *c) | |||
| 493 | writel(0, &msg->u.s.tcntxt); //FIXME: use reasonable transaction context | 536 | writel(0, &msg->u.s.tcntxt); //FIXME: use reasonable transaction context |
| 494 | writel(0, &msg->body[0]); | 537 | writel(0, &msg->body[0]); |
| 495 | writel(0, &msg->body[1]); | 538 | writel(0, &msg->body[1]); |
| 496 | writel(i2o_ptr_low((void *)c->status.phys), &msg->body[2]); | 539 | writel(i2o_dma_low(c->status.phys), &msg->body[2]); |
| 497 | writel(i2o_ptr_high((void *)c->status.phys), &msg->body[3]); | 540 | writel(i2o_dma_high(c->status.phys), &msg->body[3]); |
| 498 | 541 | ||
| 499 | i2o_msg_post(c, m); | 542 | i2o_msg_post(c, m); |
| 500 | 543 | ||
| 501 | /* Wait for a reply */ | 544 | /* Wait for a reply */ |
| 502 | timeout = jiffies + I2O_TIMEOUT_RESET * HZ; | 545 | timeout = jiffies + I2O_TIMEOUT_RESET * HZ; |
| 503 | while (!*status) { | 546 | while (!*status) { |
| 504 | if (time_after(jiffies, timeout)) { | 547 | if (time_after(jiffies, timeout)) |
| 505 | printk(KERN_ERR "%s: IOP reset timeout.\n", c->name); | ||
| 506 | rc = -ETIMEDOUT; | ||
| 507 | goto exit; | ||
| 508 | } | ||
| 509 | |||
| 510 | /* Promise bug */ | ||
| 511 | if (status[1] || status[4]) { | ||
| 512 | *status = 0; | ||
| 513 | break; | 548 | break; |
| 514 | } | ||
| 515 | 549 | ||
| 516 | set_current_state(TASK_UNINTERRUPTIBLE); | 550 | set_current_state(TASK_UNINTERRUPTIBLE); |
| 517 | schedule_timeout(1); | 551 | schedule_timeout(1); |
| 518 | |||
| 519 | rmb(); | ||
| 520 | } | 552 | } |
| 521 | 553 | ||
| 522 | if (*status == I2O_CMD_IN_PROGRESS) { | 554 | switch (*status) { |
| 555 | case I2O_CMD_REJECTED: | ||
| 556 | osm_warn("%s: IOP reset rejected\n", c->name); | ||
| 557 | rc = -EPERM; | ||
| 558 | break; | ||
| 559 | |||
| 560 | case I2O_CMD_IN_PROGRESS: | ||
| 523 | /* | 561 | /* |
| 524 | * Once the reset is sent, the IOP goes into the INIT state | 562 | * Once the reset is sent, the IOP goes into the INIT state |
| 525 | * which is indeterminate. We need to wait until the IOP | 563 | * which is indeterminate. We need to wait until the IOP has |
| 526 | * has rebooted before we can let the system talk to | 564 | * rebooted before we can let the system talk to it. We read |
| 527 | * it. We read the inbound Free_List until a message is | 565 | * the inbound Free_List until a message is available. If we |
| 528 | * available. If we can't read one in the given ammount of | 566 | * can't read one in the given ammount of time, we assume the |
| 529 | * time, we assume the IOP could not reboot properly. | 567 | * IOP could not reboot properly. |
| 530 | */ | 568 | */ |
| 531 | pr_debug("%s: Reset in progress, waiting for reboot...\n", | 569 | osm_debug("%s: Reset in progress, waiting for reboot...\n", |
| 532 | c->name); | 570 | c->name); |
| 533 | 571 | ||
| 534 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); | 572 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); |
| 535 | while (m == I2O_QUEUE_EMPTY) { | 573 | while (m == I2O_QUEUE_EMPTY) { |
| 536 | if (time_after(jiffies, timeout)) { | 574 | if (time_after(jiffies, timeout)) { |
| 537 | printk(KERN_ERR "%s: IOP reset timeout.\n", | 575 | osm_err("%s: IOP reset timeout.\n", c->name); |
| 538 | c->name); | ||
| 539 | rc = -ETIMEDOUT; | 576 | rc = -ETIMEDOUT; |
| 540 | goto exit; | 577 | goto exit; |
| 541 | } | 578 | } |
| @@ -545,19 +582,26 @@ static int i2o_iop_reset(struct i2o_controller *c) | |||
| 545 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); | 582 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); |
| 546 | } | 583 | } |
| 547 | i2o_msg_nop(c, m); | 584 | i2o_msg_nop(c, m); |
| 548 | } | ||
| 549 | 585 | ||
| 550 | /* from here all quiesce commands are safe */ | 586 | /* from here all quiesce commands are safe */ |
| 551 | c->no_quiesce = 0; | 587 | c->no_quiesce = 0; |
| 552 | 588 | ||
| 553 | /* If IopReset was rejected or didn't perform reset, try IopClear */ | 589 | /* verify if controller is in state RESET */ |
| 554 | i2o_status_get(c); | 590 | i2o_status_get(c); |
| 555 | if (*status == I2O_CMD_REJECTED || sb->iop_state != ADAPTER_STATE_RESET) { | 591 | |
| 556 | printk(KERN_WARNING "%s: Reset rejected, trying to clear\n", | 592 | if (!c->promise && (sb->iop_state != ADAPTER_STATE_RESET)) |
| 557 | c->name); | 593 | osm_warn("%s: reset completed, but adapter not in RESET" |
| 558 | i2o_iop_clear(c); | 594 | " state.\n", c->name); |
| 559 | } else | 595 | else |
| 560 | pr_debug("%s: Reset completed.\n", c->name); | 596 | osm_debug("%s: reset completed.\n", c->name); |
| 597 | |||
| 598 | break; | ||
| 599 | |||
| 600 | default: | ||
| 601 | osm_err("%s: IOP reset timeout.\n", c->name); | ||
| 602 | rc = -ETIMEDOUT; | ||
| 603 | break; | ||
| 604 | } | ||
| 561 | 605 | ||
| 562 | exit: | 606 | exit: |
| 563 | /* Enable all IOPs */ | 607 | /* Enable all IOPs */ |
| @@ -567,88 +611,6 @@ static int i2o_iop_reset(struct i2o_controller *c) | |||
| 567 | }; | 611 | }; |
| 568 | 612 | ||
| 569 | /** | 613 | /** |
| 570 | * i2o_iop_init_outbound_queue - setup the outbound message queue | ||
| 571 | * @c: I2O controller | ||
| 572 | * | ||
| 573 | * Clear and (re)initialize IOP's outbound queue and post the message | ||
| 574 | * frames to the IOP. | ||
| 575 | * | ||
| 576 | * Returns 0 on success or a negative errno code on failure. | ||
| 577 | */ | ||
| 578 | static int i2o_iop_init_outbound_queue(struct i2o_controller *c) | ||
| 579 | { | ||
| 580 | u8 *status = c->status.virt; | ||
| 581 | u32 m; | ||
| 582 | struct i2o_message __iomem *msg; | ||
| 583 | ulong timeout; | ||
| 584 | int i; | ||
| 585 | |||
| 586 | pr_debug("%s: Initializing Outbound Queue...\n", c->name); | ||
| 587 | |||
| 588 | memset(status, 0, 4); | ||
| 589 | |||
| 590 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
| 591 | if (m == I2O_QUEUE_EMPTY) | ||
| 592 | return -ETIMEDOUT; | ||
| 593 | |||
| 594 | writel(EIGHT_WORD_MSG_SIZE | TRL_OFFSET_6, &msg->u.head[0]); | ||
| 595 | writel(I2O_CMD_OUTBOUND_INIT << 24 | HOST_TID << 12 | ADAPTER_TID, | ||
| 596 | &msg->u.head[1]); | ||
| 597 | writel(i2o_exec_driver.context, &msg->u.s.icntxt); | ||
| 598 | writel(0x0106, &msg->u.s.tcntxt); /* FIXME: why 0x0106, maybe in | ||
| 599 | Spec? */ | ||
| 600 | writel(PAGE_SIZE, &msg->body[0]); | ||
| 601 | writel(MSG_FRAME_SIZE << 16 | 0x80, &msg->body[1]); /* Outbound msg frame | ||
| 602 | size in words and Initcode */ | ||
| 603 | writel(0xd0000004, &msg->body[2]); | ||
| 604 | writel(i2o_ptr_low((void *)c->status.phys), &msg->body[3]); | ||
| 605 | writel(i2o_ptr_high((void *)c->status.phys), &msg->body[4]); | ||
| 606 | |||
| 607 | i2o_msg_post(c, m); | ||
| 608 | |||
| 609 | timeout = jiffies + I2O_TIMEOUT_INIT_OUTBOUND_QUEUE * HZ; | ||
| 610 | while (*status <= I2O_CMD_IN_PROGRESS) { | ||
| 611 | if (time_after(jiffies, timeout)) { | ||
| 612 | printk(KERN_WARNING "%s: Timeout Initializing\n", | ||
| 613 | c->name); | ||
| 614 | return -ETIMEDOUT; | ||
| 615 | } | ||
| 616 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
| 617 | schedule_timeout(1); | ||
| 618 | |||
| 619 | rmb(); | ||
| 620 | } | ||
| 621 | |||
| 622 | m = c->out_queue.phys; | ||
| 623 | |||
| 624 | /* Post frames */ | ||
| 625 | for (i = 0; i < NMBR_MSG_FRAMES; i++) { | ||
| 626 | i2o_flush_reply(c, m); | ||
| 627 | udelay(1); /* Promise */ | ||
| 628 | m += MSG_FRAME_SIZE * 4; | ||
| 629 | } | ||
| 630 | |||
| 631 | return 0; | ||
| 632 | } | ||
| 633 | |||
| 634 | /** | ||
| 635 | * i2o_iop_send_nop - send a core NOP message | ||
| 636 | * @c: controller | ||
| 637 | * | ||
| 638 | * Send a no-operation message with a reply set to cause no | ||
| 639 | * action either. Needed for bringing up promise controllers. | ||
| 640 | */ | ||
| 641 | static int i2o_iop_send_nop(struct i2o_controller *c) | ||
| 642 | { | ||
| 643 | struct i2o_message __iomem *msg; | ||
| 644 | u32 m = i2o_msg_get_wait(c, &msg, HZ); | ||
| 645 | if (m == I2O_QUEUE_EMPTY) | ||
| 646 | return -ETIMEDOUT; | ||
| 647 | i2o_msg_nop(c, m); | ||
| 648 | return 0; | ||
| 649 | } | ||
| 650 | |||
| 651 | /** | ||
| 652 | * i2o_iop_activate - Bring controller up to HOLD | 614 | * i2o_iop_activate - Bring controller up to HOLD |
| 653 | * @c: controller | 615 | * @c: controller |
| 654 | * | 616 | * |
| @@ -659,78 +621,62 @@ static int i2o_iop_send_nop(struct i2o_controller *c) | |||
| 659 | */ | 621 | */ |
| 660 | static int i2o_iop_activate(struct i2o_controller *c) | 622 | static int i2o_iop_activate(struct i2o_controller *c) |
| 661 | { | 623 | { |
| 662 | struct pci_dev *i960 = NULL; | ||
| 663 | i2o_status_block *sb = c->status_block.virt; | 624 | i2o_status_block *sb = c->status_block.virt; |
| 664 | int rc; | 625 | int rc; |
| 665 | 626 | int state; | |
| 666 | if (c->promise) { | ||
| 667 | /* Beat up the hardware first of all */ | ||
| 668 | i960 = | ||
| 669 | pci_find_slot(c->pdev->bus->number, | ||
| 670 | PCI_DEVFN(PCI_SLOT(c->pdev->devfn), 0)); | ||
| 671 | if (i960) | ||
| 672 | pci_write_config_word(i960, 0x42, 0); | ||
| 673 | |||
| 674 | /* Follow this sequence precisely or the controller | ||
| 675 | ceases to perform useful functions until reboot */ | ||
| 676 | if ((rc = i2o_iop_send_nop(c))) | ||
| 677 | return rc; | ||
| 678 | |||
| 679 | if ((rc = i2o_iop_reset(c))) | ||
| 680 | return rc; | ||
| 681 | } | ||
| 682 | 627 | ||
| 683 | /* In INIT state, Wait Inbound Q to initialize (in i2o_status_get) */ | 628 | /* In INIT state, Wait Inbound Q to initialize (in i2o_status_get) */ |
| 684 | /* In READY state, Get status */ | 629 | /* In READY state, Get status */ |
| 685 | 630 | ||
| 686 | rc = i2o_status_get(c); | 631 | rc = i2o_status_get(c); |
| 687 | if (rc) { | 632 | if (rc) { |
| 688 | printk(KERN_INFO "%s: Unable to obtain status, " | 633 | osm_info("%s: Unable to obtain status, attempting a reset.\n", |
| 689 | "attempting a reset.\n", c->name); | 634 | c->name); |
| 690 | if (i2o_iop_reset(c)) | 635 | rc = i2o_iop_reset(c); |
| 636 | if (rc) | ||
| 691 | return rc; | 637 | return rc; |
| 692 | } | 638 | } |
| 693 | 639 | ||
| 694 | if (sb->i2o_version > I2OVER15) { | 640 | if (sb->i2o_version > I2OVER15) { |
| 695 | printk(KERN_ERR "%s: Not running version 1.5 of the I2O " | 641 | osm_err("%s: Not running version 1.5 of the I2O Specification." |
| 696 | "Specification.\n", c->name); | 642 | "\n", c->name); |
| 697 | return -ENODEV; | 643 | return -ENODEV; |
| 698 | } | 644 | } |
| 699 | 645 | ||
| 700 | switch (sb->iop_state) { | 646 | switch (sb->iop_state) { |
| 701 | case ADAPTER_STATE_FAULTED: | 647 | case ADAPTER_STATE_FAULTED: |
| 702 | printk(KERN_CRIT "%s: hardware fault\n", c->name); | 648 | osm_err("%s: hardware fault\n", c->name); |
| 703 | return -ENODEV; | 649 | return -EFAULT; |
| 704 | 650 | ||
| 705 | case ADAPTER_STATE_READY: | 651 | case ADAPTER_STATE_READY: |
| 706 | case ADAPTER_STATE_OPERATIONAL: | 652 | case ADAPTER_STATE_OPERATIONAL: |
| 707 | case ADAPTER_STATE_HOLD: | 653 | case ADAPTER_STATE_HOLD: |
| 708 | case ADAPTER_STATE_FAILED: | 654 | case ADAPTER_STATE_FAILED: |
| 709 | pr_debug("%s: already running, trying to reset...\n", c->name); | 655 | osm_debug("%s: already running, trying to reset...\n", c->name); |
| 710 | if (i2o_iop_reset(c)) | 656 | rc = i2o_iop_reset(c); |
| 711 | return -ENODEV; | 657 | if (rc) |
| 658 | return rc; | ||
| 712 | } | 659 | } |
| 713 | 660 | ||
| 661 | /* preserve state */ | ||
| 662 | state = sb->iop_state; | ||
| 663 | |||
| 714 | rc = i2o_iop_init_outbound_queue(c); | 664 | rc = i2o_iop_init_outbound_queue(c); |
| 715 | if (rc) | 665 | if (rc) |
| 716 | return rc; | 666 | return rc; |
| 717 | 667 | ||
| 718 | if (c->promise) { | 668 | /* if adapter was not in RESET state clear now */ |
| 719 | if ((rc = i2o_iop_send_nop(c))) | 669 | if (state != ADAPTER_STATE_RESET) |
| 720 | return rc; | 670 | i2o_iop_clear(c); |
| 721 | 671 | ||
| 722 | if ((rc = i2o_status_get(c))) | 672 | i2o_status_get(c); |
| 723 | return rc; | ||
| 724 | 673 | ||
| 725 | if (i960) | 674 | if (sb->iop_state != ADAPTER_STATE_HOLD) { |
| 726 | pci_write_config_word(i960, 0x42, 0x3FF); | 675 | osm_err("%s: failed to bring IOP into HOLD state\n", c->name); |
| 676 | return -EIO; | ||
| 727 | } | 677 | } |
| 728 | 678 | ||
| 729 | /* In HOLD state */ | 679 | return i2o_hrt_get(c); |
| 730 | |||
| 731 | rc = i2o_hrt_get(c); | ||
| 732 | |||
| 733 | return rc; | ||
| 734 | }; | 680 | }; |
| 735 | 681 | ||
| 736 | /** | 682 | /** |
| @@ -756,20 +702,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c) | |||
| 756 | res->flags = IORESOURCE_MEM; | 702 | res->flags = IORESOURCE_MEM; |
| 757 | res->start = 0; | 703 | res->start = 0; |
| 758 | res->end = 0; | 704 | res->end = 0; |
| 759 | printk(KERN_INFO "%s: requires private memory resources.\n", | 705 | osm_info("%s: requires private memory resources.\n", c->name); |
| 760 | c->name); | ||
| 761 | root = pci_find_parent_resource(c->pdev, res); | 706 | root = pci_find_parent_resource(c->pdev, res); |
| 762 | if (root == NULL) | 707 | if (root == NULL) |
| 763 | printk(KERN_WARNING "%s: Can't find parent resource!\n", | 708 | osm_warn("%s: Can't find parent resource!\n", c->name); |
| 764 | c->name); | ||
| 765 | if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ | 709 | if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ |
| 766 | NULL, NULL) >= 0) { | 710 | NULL, NULL) >= 0) { |
| 767 | c->mem_alloc = 1; | 711 | c->mem_alloc = 1; |
| 768 | sb->current_mem_size = 1 + res->end - res->start; | 712 | sb->current_mem_size = 1 + res->end - res->start; |
| 769 | sb->current_mem_base = res->start; | 713 | sb->current_mem_base = res->start; |
| 770 | printk(KERN_INFO "%s: allocated %ld bytes of PCI memory" | 714 | osm_info("%s: allocated %ld bytes of PCI memory at " |
| 771 | " at 0x%08lX.\n", c->name, | 715 | "0x%08lX.\n", c->name, |
| 772 | 1 + res->end - res->start, res->start); | 716 | 1 + res->end - res->start, res->start); |
| 773 | } | 717 | } |
| 774 | } | 718 | } |
| 775 | 719 | ||
| @@ -779,20 +723,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c) | |||
| 779 | res->flags = IORESOURCE_IO; | 723 | res->flags = IORESOURCE_IO; |
| 780 | res->start = 0; | 724 | res->start = 0; |
| 781 | res->end = 0; | 725 | res->end = 0; |
| 782 | printk(KERN_INFO "%s: requires private memory resources.\n", | 726 | osm_info("%s: requires private memory resources.\n", c->name); |
| 783 | c->name); | ||
| 784 | root = pci_find_parent_resource(c->pdev, res); | 727 | root = pci_find_parent_resource(c->pdev, res); |
| 785 | if (root == NULL) | 728 | if (root == NULL) |
| 786 | printk(KERN_WARNING "%s: Can't find parent resource!\n", | 729 | osm_warn("%s: Can't find parent resource!\n", c->name); |
| 787 | c->name); | ||
| 788 | if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ | 730 | if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ |
| 789 | NULL, NULL) >= 0) { | 731 | NULL, NULL) >= 0) { |
| 790 | c->io_alloc = 1; | 732 | c->io_alloc = 1; |
| 791 | sb->current_io_size = 1 + res->end - res->start; | 733 | sb->current_io_size = 1 + res->end - res->start; |
| 792 | sb->current_mem_base = res->start; | 734 | sb->current_mem_base = res->start; |
| 793 | printk(KERN_INFO "%s: allocated %ld bytes of PCI I/O at" | 735 | osm_info("%s: allocated %ld bytes of PCI I/O at 0x%08lX" |
| 794 | " 0x%08lX.\n", c->name, | 736 | ".\n", c->name, 1 + res->end - res->start, |
| 795 | 1 + res->end - res->start, res->start); | 737 | res->start); |
| 796 | } | 738 | } |
| 797 | } | 739 | } |
| 798 | 740 | ||
| @@ -836,10 +778,10 @@ static int i2o_iop_systab_set(struct i2o_controller *c) | |||
| 836 | PCI_DMA_TODEVICE); | 778 | PCI_DMA_TODEVICE); |
| 837 | 779 | ||
| 838 | if (rc < 0) | 780 | if (rc < 0) |
| 839 | printk(KERN_ERR "%s: Unable to set SysTab (status=%#x).\n", | 781 | osm_err("%s: Unable to set SysTab (status=%#x).\n", c->name, |
| 840 | c->name, -rc); | 782 | -rc); |
| 841 | else | 783 | else |
| 842 | pr_debug("%s: SysTab set.\n", c->name); | 784 | osm_debug("%s: SysTab set.\n", c->name); |
| 843 | 785 | ||
| 844 | i2o_status_get(c); // Entered READY state | 786 | i2o_status_get(c); // Entered READY state |
| 845 | 787 | ||
| @@ -863,7 +805,7 @@ static int i2o_iop_online(struct i2o_controller *c) | |||
| 863 | return rc; | 805 | return rc; |
| 864 | 806 | ||
| 865 | /* In READY state */ | 807 | /* In READY state */ |
| 866 | pr_debug("%s: Attempting to enable...\n", c->name); | 808 | osm_debug("%s: Attempting to enable...\n", c->name); |
| 867 | rc = i2o_iop_enable(c); | 809 | rc = i2o_iop_enable(c); |
| 868 | if (rc) | 810 | if (rc) |
| 869 | return rc; | 811 | return rc; |
| @@ -882,7 +824,7 @@ void i2o_iop_remove(struct i2o_controller *c) | |||
| 882 | { | 824 | { |
| 883 | struct i2o_device *dev, *tmp; | 825 | struct i2o_device *dev, *tmp; |
| 884 | 826 | ||
| 885 | pr_debug("%s: deleting controller\n", c->name); | 827 | osm_debug("%s: deleting controller\n", c->name); |
| 886 | 828 | ||
| 887 | i2o_driver_notify_controller_remove_all(c); | 829 | i2o_driver_notify_controller_remove_all(c); |
| 888 | 830 | ||
| @@ -891,8 +833,12 @@ void i2o_iop_remove(struct i2o_controller *c) | |||
| 891 | list_for_each_entry_safe(dev, tmp, &c->devices, list) | 833 | list_for_each_entry_safe(dev, tmp, &c->devices, list) |
| 892 | i2o_device_remove(dev); | 834 | i2o_device_remove(dev); |
| 893 | 835 | ||
| 836 | device_del(&c->device); | ||
| 837 | |||
| 894 | /* Ask the IOP to switch to RESET state */ | 838 | /* Ask the IOP to switch to RESET state */ |
| 895 | i2o_iop_reset(c); | 839 | i2o_iop_reset(c); |
| 840 | |||
| 841 | put_device(&c->device); | ||
| 896 | } | 842 | } |
| 897 | 843 | ||
| 898 | /** | 844 | /** |
| @@ -927,8 +873,7 @@ static int i2o_systab_build(void) | |||
| 927 | 873 | ||
| 928 | systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL); | 874 | systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL); |
| 929 | if (!systab) { | 875 | if (!systab) { |
| 930 | printk(KERN_ERR "i2o: unable to allocate memory for System " | 876 | osm_err("unable to allocate memory for System Table\n"); |
| 931 | "Table\n"); | ||
| 932 | return -ENOMEM; | 877 | return -ENOMEM; |
| 933 | } | 878 | } |
| 934 | memset(systab, 0, i2o_systab.len); | 879 | memset(systab, 0, i2o_systab.len); |
| @@ -940,8 +885,8 @@ static int i2o_systab_build(void) | |||
| 940 | i2o_status_block *sb; | 885 | i2o_status_block *sb; |
| 941 | 886 | ||
| 942 | if (count >= num_controllers) { | 887 | if (count >= num_controllers) { |
| 943 | printk(KERN_ERR "i2o: controller added while building " | 888 | osm_err("controller added while building system table" |
| 944 | "system table\n"); | 889 | "\n"); |
| 945 | break; | 890 | break; |
| 946 | } | 891 | } |
| 947 | 892 | ||
| @@ -955,9 +900,8 @@ static int i2o_systab_build(void) | |||
| 955 | * it is techninically not part of the I2O subsystem... | 900 | * it is techninically not part of the I2O subsystem... |
| 956 | */ | 901 | */ |
| 957 | if (unlikely(i2o_status_get(c))) { | 902 | if (unlikely(i2o_status_get(c))) { |
| 958 | printk(KERN_ERR "%s: Deleting b/c could not get status" | 903 | osm_err("%s: Deleting b/c could not get status while " |
| 959 | " while attempting to build system table\n", | 904 | "attempting to build system table\n", c->name); |
| 960 | c->name); | ||
| 961 | i2o_iop_remove(c); | 905 | i2o_iop_remove(c); |
| 962 | continue; // try the next one | 906 | continue; // try the next one |
| 963 | } | 907 | } |
| @@ -971,8 +915,10 @@ static int i2o_systab_build(void) | |||
| 971 | systab->iops[count].frame_size = sb->inbound_frame_size; | 915 | systab->iops[count].frame_size = sb->inbound_frame_size; |
| 972 | systab->iops[count].last_changed = change_ind; | 916 | systab->iops[count].last_changed = change_ind; |
| 973 | systab->iops[count].iop_capabilities = sb->iop_capabilities; | 917 | systab->iops[count].iop_capabilities = sb->iop_capabilities; |
| 974 | systab->iops[count].inbound_low = i2o_ptr_low(c->post_port); | 918 | systab->iops[count].inbound_low = |
| 975 | systab->iops[count].inbound_high = i2o_ptr_high(c->post_port); | 919 | i2o_dma_low(c->base.phys + I2O_IN_PORT); |
| 920 | systab->iops[count].inbound_high = | ||
| 921 | i2o_dma_high(c->base.phys + I2O_IN_PORT); | ||
| 976 | 922 | ||
| 977 | count++; | 923 | count++; |
| 978 | } | 924 | } |
| @@ -1010,11 +956,11 @@ int i2o_status_get(struct i2o_controller *c) | |||
| 1010 | { | 956 | { |
| 1011 | struct i2o_message __iomem *msg; | 957 | struct i2o_message __iomem *msg; |
| 1012 | u32 m; | 958 | u32 m; |
| 1013 | u8 *status_block; | 959 | volatile u8 *status_block; |
| 1014 | unsigned long timeout; | 960 | unsigned long timeout; |
| 1015 | 961 | ||
| 1016 | status_block = (u8 *) c->status_block.virt; | 962 | status_block = (u8 *) c->status_block.virt; |
| 1017 | memset(status_block, 0, sizeof(i2o_status_block)); | 963 | memset(c->status_block.virt, 0, sizeof(i2o_status_block)); |
| 1018 | 964 | ||
| 1019 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | 965 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); |
| 1020 | if (m == I2O_QUEUE_EMPTY) | 966 | if (m == I2O_QUEUE_EMPTY) |
| @@ -1027,8 +973,8 @@ int i2o_status_get(struct i2o_controller *c) | |||
| 1027 | writel(0, &msg->u.s.tcntxt); // FIXME: use resonable transaction context | 973 | writel(0, &msg->u.s.tcntxt); // FIXME: use resonable transaction context |
| 1028 | writel(0, &msg->body[0]); | 974 | writel(0, &msg->body[0]); |
| 1029 | writel(0, &msg->body[1]); | 975 | writel(0, &msg->body[1]); |
| 1030 | writel(i2o_ptr_low((void *)c->status_block.phys), &msg->body[2]); | 976 | writel(i2o_dma_low(c->status_block.phys), &msg->body[2]); |
| 1031 | writel(i2o_ptr_high((void *)c->status_block.phys), &msg->body[3]); | 977 | writel(i2o_dma_high(c->status_block.phys), &msg->body[3]); |
| 1032 | writel(sizeof(i2o_status_block), &msg->body[4]); /* always 88 bytes */ | 978 | writel(sizeof(i2o_status_block), &msg->body[4]); /* always 88 bytes */ |
| 1033 | 979 | ||
| 1034 | i2o_msg_post(c, m); | 980 | i2o_msg_post(c, m); |
| @@ -1037,14 +983,12 @@ int i2o_status_get(struct i2o_controller *c) | |||
| 1037 | timeout = jiffies + I2O_TIMEOUT_STATUS_GET * HZ; | 983 | timeout = jiffies + I2O_TIMEOUT_STATUS_GET * HZ; |
| 1038 | while (status_block[87] != 0xFF) { | 984 | while (status_block[87] != 0xFF) { |
| 1039 | if (time_after(jiffies, timeout)) { | 985 | if (time_after(jiffies, timeout)) { |
| 1040 | printk(KERN_ERR "%s: Get status timeout.\n", c->name); | 986 | osm_err("%s: Get status timeout.\n", c->name); |
| 1041 | return -ETIMEDOUT; | 987 | return -ETIMEDOUT; |
| 1042 | } | 988 | } |
| 1043 | 989 | ||
| 1044 | set_current_state(TASK_UNINTERRUPTIBLE); | 990 | set_current_state(TASK_UNINTERRUPTIBLE); |
| 1045 | schedule_timeout(1); | 991 | schedule_timeout(1); |
| 1046 | |||
| 1047 | rmb(); | ||
| 1048 | } | 992 | } |
| 1049 | 993 | ||
| 1050 | #ifdef DEBUG | 994 | #ifdef DEBUG |
| @@ -1088,8 +1032,8 @@ static int i2o_hrt_get(struct i2o_controller *c) | |||
| 1088 | rc = i2o_msg_post_wait_mem(c, m, 20, &c->hrt); | 1032 | rc = i2o_msg_post_wait_mem(c, m, 20, &c->hrt); |
| 1089 | 1033 | ||
| 1090 | if (rc < 0) { | 1034 | if (rc < 0) { |
| 1091 | printk(KERN_ERR "%s: Unable to get HRT (status=%#x)\n", | 1035 | osm_err("%s: Unable to get HRT (status=%#x)\n", c->name, |
| 1092 | c->name, -rc); | 1036 | -rc); |
| 1093 | return rc; | 1037 | return rc; |
| 1094 | } | 1038 | } |
| 1095 | 1039 | ||
| @@ -1103,13 +1047,41 @@ static int i2o_hrt_get(struct i2o_controller *c) | |||
| 1103 | return i2o_parse_hrt(c); | 1047 | return i2o_parse_hrt(c); |
| 1104 | } | 1048 | } |
| 1105 | 1049 | ||
| 1106 | printk(KERN_ERR "%s: Unable to get HRT after %d tries, giving up\n", | 1050 | osm_err("%s: Unable to get HRT after %d tries, giving up\n", c->name, |
| 1107 | c->name, I2O_HRT_GET_TRIES); | 1051 | I2O_HRT_GET_TRIES); |
| 1108 | 1052 | ||
| 1109 | return -EBUSY; | 1053 | return -EBUSY; |
| 1110 | } | 1054 | } |
| 1111 | 1055 | ||
| 1112 | /** | 1056 | /** |
| 1057 | * i2o_iop_free - Free the i2o_controller struct | ||
| 1058 | * @c: I2O controller to free | ||
| 1059 | */ | ||
| 1060 | void i2o_iop_free(struct i2o_controller *c) | ||
| 1061 | { | ||
| 1062 | kfree(c); | ||
| 1063 | }; | ||
| 1064 | |||
| 1065 | /** | ||
| 1066 | * i2o_iop_release - release the memory for a I2O controller | ||
| 1067 | * @dev: I2O controller which should be released | ||
| 1068 | * | ||
| 1069 | * Release the allocated memory. This function is called if refcount of | ||
| 1070 | * device reaches 0 automatically. | ||
| 1071 | */ | ||
| 1072 | static void i2o_iop_release(struct device *dev) | ||
| 1073 | { | ||
| 1074 | struct i2o_controller *c = to_i2o_controller(dev); | ||
| 1075 | |||
| 1076 | i2o_iop_free(c); | ||
| 1077 | }; | ||
| 1078 | |||
| 1079 | /* I2O controller class */ | ||
| 1080 | static struct class i2o_controller_class = { | ||
| 1081 | .name = "i2o_controller", | ||
| 1082 | }; | ||
| 1083 | |||
| 1084 | /** | ||
| 1113 | * i2o_iop_alloc - Allocate and initialize a i2o_controller struct | 1085 | * i2o_iop_alloc - Allocate and initialize a i2o_controller struct |
| 1114 | * | 1086 | * |
| 1115 | * Allocate the necessary memory for a i2o_controller struct and | 1087 | * Allocate the necessary memory for a i2o_controller struct and |
| @@ -1125,8 +1097,8 @@ struct i2o_controller *i2o_iop_alloc(void) | |||
| 1125 | 1097 | ||
| 1126 | c = kmalloc(sizeof(*c), GFP_KERNEL); | 1098 | c = kmalloc(sizeof(*c), GFP_KERNEL); |
| 1127 | if (!c) { | 1099 | if (!c) { |
| 1128 | printk(KERN_ERR "i2o: Insufficient memory to allocate a I2O " | 1100 | osm_err("i2o: Insufficient memory to allocate a I2O controller." |
| 1129 | "controller.\n"); | 1101 | "\n"); |
| 1130 | return ERR_PTR(-ENOMEM); | 1102 | return ERR_PTR(-ENOMEM); |
| 1131 | } | 1103 | } |
| 1132 | memset(c, 0, sizeof(*c)); | 1104 | memset(c, 0, sizeof(*c)); |
| @@ -1137,6 +1109,16 @@ struct i2o_controller *i2o_iop_alloc(void) | |||
| 1137 | c->unit = unit++; | 1109 | c->unit = unit++; |
| 1138 | sprintf(c->name, "iop%d", c->unit); | 1110 | sprintf(c->name, "iop%d", c->unit); |
| 1139 | 1111 | ||
| 1112 | device_initialize(&c->device); | ||
| 1113 | class_device_initialize(&c->classdev); | ||
| 1114 | |||
| 1115 | c->device.release = &i2o_iop_release; | ||
| 1116 | c->classdev.class = &i2o_controller_class; | ||
| 1117 | c->classdev.dev = &c->device; | ||
| 1118 | |||
| 1119 | snprintf(c->device.bus_id, BUS_ID_SIZE, "iop%d", c->unit); | ||
| 1120 | snprintf(c->classdev.class_id, BUS_ID_SIZE, "iop%d", c->unit); | ||
| 1121 | |||
| 1140 | #if BITS_PER_LONG == 64 | 1122 | #if BITS_PER_LONG == 64 |
| 1141 | spin_lock_init(&c->context_list_lock); | 1123 | spin_lock_init(&c->context_list_lock); |
| 1142 | atomic_set(&c->context_list_counter, 0); | 1124 | atomic_set(&c->context_list_counter, 0); |
| @@ -1147,15 +1129,6 @@ struct i2o_controller *i2o_iop_alloc(void) | |||
| 1147 | }; | 1129 | }; |
| 1148 | 1130 | ||
| 1149 | /** | 1131 | /** |
| 1150 | * i2o_iop_free - Free the i2o_controller struct | ||
| 1151 | * @c: I2O controller to free | ||
| 1152 | */ | ||
| 1153 | void i2o_iop_free(struct i2o_controller *c) | ||
| 1154 | { | ||
| 1155 | kfree(c); | ||
| 1156 | }; | ||
| 1157 | |||
| 1158 | /** | ||
| 1159 | * i2o_iop_add - Initialize the I2O controller and add him to the I2O core | 1132 | * i2o_iop_add - Initialize the I2O controller and add him to the I2O core |
| 1160 | * @c: controller | 1133 | * @c: controller |
| 1161 | * | 1134 | * |
| @@ -1168,45 +1141,58 @@ int i2o_iop_add(struct i2o_controller *c) | |||
| 1168 | { | 1141 | { |
| 1169 | int rc; | 1142 | int rc; |
| 1170 | 1143 | ||
| 1171 | printk(KERN_INFO "%s: Activating I2O controller...\n", c->name); | 1144 | if ((rc = device_add(&c->device))) { |
| 1172 | printk(KERN_INFO "%s: This may take a few minutes if there are many " | 1145 | osm_err("%s: could not add controller\n", c->name); |
| 1173 | "devices\n", c->name); | 1146 | goto iop_reset; |
| 1147 | } | ||
| 1174 | 1148 | ||
| 1175 | if ((rc = i2o_iop_activate(c))) { | 1149 | if ((rc = class_device_add(&c->classdev))) { |
| 1176 | printk(KERN_ERR "%s: could not activate controller\n", | 1150 | osm_err("%s: could not add controller class\n", c->name); |
| 1177 | c->name); | 1151 | goto device_del; |
| 1178 | i2o_iop_reset(c); | ||
| 1179 | return rc; | ||
| 1180 | } | 1152 | } |
| 1181 | 1153 | ||
| 1182 | pr_debug("%s: building sys table...\n", c->name); | 1154 | osm_info("%s: Activating I2O controller...\n", c->name); |
| 1155 | osm_info("%s: This may take a few minutes if there are many devices\n", | ||
| 1156 | c->name); | ||
| 1183 | 1157 | ||
| 1184 | if ((rc = i2o_systab_build())) { | 1158 | if ((rc = i2o_iop_activate(c))) { |
| 1185 | i2o_iop_reset(c); | 1159 | osm_err("%s: could not activate controller\n", c->name); |
| 1186 | return rc; | 1160 | goto class_del; |
| 1187 | } | 1161 | } |
| 1188 | 1162 | ||
| 1189 | pr_debug("%s: online controller...\n", c->name); | 1163 | osm_debug("%s: building sys table...\n", c->name); |
| 1190 | 1164 | ||
| 1191 | if ((rc = i2o_iop_online(c))) { | 1165 | if ((rc = i2o_systab_build())) |
| 1192 | i2o_iop_reset(c); | 1166 | goto class_del; |
| 1193 | return rc; | ||
| 1194 | } | ||
| 1195 | 1167 | ||
| 1196 | pr_debug("%s: getting LCT...\n", c->name); | 1168 | osm_debug("%s: online controller...\n", c->name); |
| 1197 | 1169 | ||
| 1198 | if ((rc = i2o_exec_lct_get(c))) { | 1170 | if ((rc = i2o_iop_online(c))) |
| 1199 | i2o_iop_reset(c); | 1171 | goto class_del; |
| 1200 | return rc; | 1172 | |
| 1201 | } | 1173 | osm_debug("%s: getting LCT...\n", c->name); |
| 1174 | |||
| 1175 | if ((rc = i2o_exec_lct_get(c))) | ||
| 1176 | goto class_del; | ||
| 1202 | 1177 | ||
| 1203 | list_add(&c->list, &i2o_controllers); | 1178 | list_add(&c->list, &i2o_controllers); |
| 1204 | 1179 | ||
| 1205 | i2o_driver_notify_controller_add_all(c); | 1180 | i2o_driver_notify_controller_add_all(c); |
| 1206 | 1181 | ||
| 1207 | printk(KERN_INFO "%s: Controller added\n", c->name); | 1182 | osm_info("%s: Controller added\n", c->name); |
| 1208 | 1183 | ||
| 1209 | return 0; | 1184 | return 0; |
| 1185 | |||
| 1186 | class_del: | ||
| 1187 | class_device_del(&c->classdev); | ||
| 1188 | |||
| 1189 | device_del: | ||
| 1190 | device_del(&c->device); | ||
| 1191 | |||
| 1192 | iop_reset: | ||
| 1193 | i2o_iop_reset(c); | ||
| 1194 | |||
| 1195 | return rc; | ||
| 1210 | }; | 1196 | }; |
| 1211 | 1197 | ||
| 1212 | /** | 1198 | /** |
| @@ -1264,16 +1250,18 @@ static int __init i2o_iop_init(void) | |||
| 1264 | if (rc) | 1250 | if (rc) |
| 1265 | goto exit; | 1251 | goto exit; |
| 1266 | 1252 | ||
| 1267 | rc = i2o_driver_init(); | 1253 | if ((rc = class_register(&i2o_controller_class))) { |
| 1268 | if (rc) | 1254 | osm_err("can't register class i2o_controller\n"); |
| 1269 | goto device_exit; | 1255 | goto device_exit; |
| 1256 | } | ||
| 1270 | 1257 | ||
| 1271 | rc = i2o_exec_init(); | 1258 | if ((rc = i2o_driver_init())) |
| 1272 | if (rc) | 1259 | goto class_exit; |
| 1260 | |||
| 1261 | if ((rc = i2o_exec_init())) | ||
| 1273 | goto driver_exit; | 1262 | goto driver_exit; |
| 1274 | 1263 | ||
| 1275 | rc = i2o_pci_init(); | 1264 | if ((rc = i2o_pci_init())) |
| 1276 | if (rc < 0) | ||
| 1277 | goto exec_exit; | 1265 | goto exec_exit; |
| 1278 | 1266 | ||
| 1279 | return 0; | 1267 | return 0; |
| @@ -1284,6 +1272,9 @@ static int __init i2o_iop_init(void) | |||
| 1284 | driver_exit: | 1272 | driver_exit: |
| 1285 | i2o_driver_exit(); | 1273 | i2o_driver_exit(); |
| 1286 | 1274 | ||
| 1275 | class_exit: | ||
| 1276 | class_unregister(&i2o_controller_class); | ||
| 1277 | |||
| 1287 | device_exit: | 1278 | device_exit: |
| 1288 | i2o_device_exit(); | 1279 | i2o_device_exit(); |
| 1289 | 1280 | ||
| @@ -1301,6 +1292,7 @@ static void __exit i2o_iop_exit(void) | |||
| 1301 | i2o_pci_exit(); | 1292 | i2o_pci_exit(); |
| 1302 | i2o_exec_exit(); | 1293 | i2o_exec_exit(); |
| 1303 | i2o_driver_exit(); | 1294 | i2o_driver_exit(); |
| 1295 | class_unregister(&i2o_controller_class); | ||
| 1304 | i2o_device_exit(); | 1296 | i2o_device_exit(); |
| 1305 | }; | 1297 | }; |
| 1306 | 1298 | ||
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c index e772752f056d..7a60fd7be8ad 100644 --- a/drivers/message/i2o/pci.c +++ b/drivers/message/i2o/pci.c | |||
| @@ -30,53 +30,18 @@ | |||
| 30 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
| 31 | #include <linux/interrupt.h> | 31 | #include <linux/interrupt.h> |
| 32 | #include <linux/i2o.h> | 32 | #include <linux/i2o.h> |
| 33 | 33 | #include "core.h" | |
| 34 | #ifdef CONFIG_MTRR | ||
| 35 | #include <asm/mtrr.h> | ||
| 36 | #endif // CONFIG_MTRR | ||
| 37 | |||
| 38 | /* Module internal functions from other sources */ | ||
| 39 | extern struct i2o_controller *i2o_iop_alloc(void); | ||
| 40 | extern void i2o_iop_free(struct i2o_controller *); | ||
| 41 | |||
| 42 | extern int i2o_iop_add(struct i2o_controller *); | ||
| 43 | extern void i2o_iop_remove(struct i2o_controller *); | ||
| 44 | |||
| 45 | extern int i2o_driver_dispatch(struct i2o_controller *, u32, | ||
| 46 | struct i2o_message *); | ||
| 47 | 34 | ||
| 48 | /* PCI device id table for all I2O controllers */ | 35 | /* PCI device id table for all I2O controllers */ |
| 49 | static struct pci_device_id __devinitdata i2o_pci_ids[] = { | 36 | static struct pci_device_id __devinitdata i2o_pci_ids[] = { |
| 50 | {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, | 37 | {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, |
| 51 | {PCI_DEVICE(PCI_VENDOR_ID_DPT, 0xa511)}, | 38 | {PCI_DEVICE(PCI_VENDOR_ID_DPT, 0xa511)}, |
| 39 | {.vendor = PCI_VENDOR_ID_INTEL,.device = 0x1962, | ||
| 40 | .subvendor = PCI_VENDOR_ID_PROMISE,.subdevice = PCI_ANY_ID}, | ||
| 52 | {0} | 41 | {0} |
| 53 | }; | 42 | }; |
| 54 | 43 | ||
| 55 | /** | 44 | /** |
| 56 | * i2o_dma_realloc - Realloc DMA memory | ||
| 57 | * @dev: struct device pointer to the PCI device of the I2O controller | ||
| 58 | * @addr: pointer to a i2o_dma struct DMA buffer | ||
| 59 | * @len: new length of memory | ||
| 60 | * @gfp_mask: GFP mask | ||
| 61 | * | ||
| 62 | * If there was something allocated in the addr, free it first. If len > 0 | ||
| 63 | * than try to allocate it and write the addresses back to the addr | ||
| 64 | * structure. If len == 0 set the virtual address to NULL. | ||
| 65 | * | ||
| 66 | * Returns the 0 on success or negative error code on failure. | ||
| 67 | */ | ||
| 68 | int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, size_t len, | ||
| 69 | unsigned int gfp_mask) | ||
| 70 | { | ||
| 71 | i2o_dma_free(dev, addr); | ||
| 72 | |||
| 73 | if (len) | ||
| 74 | return i2o_dma_alloc(dev, addr, len, gfp_mask); | ||
| 75 | |||
| 76 | return 0; | ||
| 77 | }; | ||
| 78 | |||
| 79 | /** | ||
| 80 | * i2o_pci_free - Frees the DMA memory for the I2O controller | 45 | * i2o_pci_free - Frees the DMA memory for the I2O controller |
| 81 | * @c: I2O controller to free | 46 | * @c: I2O controller to free |
| 82 | * | 47 | * |
| @@ -91,19 +56,11 @@ static void i2o_pci_free(struct i2o_controller *c) | |||
| 91 | 56 | ||
| 92 | i2o_dma_free(dev, &c->out_queue); | 57 | i2o_dma_free(dev, &c->out_queue); |
| 93 | i2o_dma_free(dev, &c->status_block); | 58 | i2o_dma_free(dev, &c->status_block); |
| 94 | if (c->lct) | 59 | kfree(c->lct); |
| 95 | kfree(c->lct); | ||
| 96 | i2o_dma_free(dev, &c->dlct); | 60 | i2o_dma_free(dev, &c->dlct); |
| 97 | i2o_dma_free(dev, &c->hrt); | 61 | i2o_dma_free(dev, &c->hrt); |
| 98 | i2o_dma_free(dev, &c->status); | 62 | i2o_dma_free(dev, &c->status); |
| 99 | 63 | ||
| 100 | #ifdef CONFIG_MTRR | ||
| 101 | if (c->mtrr_reg0 >= 0) | ||
| 102 | mtrr_del(c->mtrr_reg0, 0, 0); | ||
| 103 | if (c->mtrr_reg1 >= 0) | ||
| 104 | mtrr_del(c->mtrr_reg1, 0, 0); | ||
| 105 | #endif | ||
| 106 | |||
| 107 | if (c->raptor && c->in_queue.virt) | 64 | if (c->raptor && c->in_queue.virt) |
| 108 | iounmap(c->in_queue.virt); | 65 | iounmap(c->in_queue.virt); |
| 109 | 66 | ||
| @@ -178,14 +135,15 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
| 178 | c->name, (unsigned long)c->base.phys, | 135 | c->name, (unsigned long)c->base.phys, |
| 179 | (unsigned long)c->base.len); | 136 | (unsigned long)c->base.len); |
| 180 | 137 | ||
| 181 | c->base.virt = ioremap(c->base.phys, c->base.len); | 138 | c->base.virt = ioremap_nocache(c->base.phys, c->base.len); |
| 182 | if (!c->base.virt) { | 139 | if (!c->base.virt) { |
| 183 | printk(KERN_ERR "%s: Unable to map controller.\n", c->name); | 140 | printk(KERN_ERR "%s: Unable to map controller.\n", c->name); |
| 184 | return -ENOMEM; | 141 | return -ENOMEM; |
| 185 | } | 142 | } |
| 186 | 143 | ||
| 187 | if (c->raptor) { | 144 | if (c->raptor) { |
| 188 | c->in_queue.virt = ioremap(c->in_queue.phys, c->in_queue.len); | 145 | c->in_queue.virt = |
| 146 | ioremap_nocache(c->in_queue.phys, c->in_queue.len); | ||
| 189 | if (!c->in_queue.virt) { | 147 | if (!c->in_queue.virt) { |
| 190 | printk(KERN_ERR "%s: Unable to map controller.\n", | 148 | printk(KERN_ERR "%s: Unable to map controller.\n", |
| 191 | c->name); | 149 | c->name); |
| @@ -195,43 +153,10 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
| 195 | } else | 153 | } else |
| 196 | c->in_queue = c->base; | 154 | c->in_queue = c->base; |
| 197 | 155 | ||
| 198 | c->irq_mask = c->base.virt + 0x34; | 156 | c->irq_status = c->base.virt + I2O_IRQ_STATUS; |
| 199 | c->post_port = c->base.virt + 0x40; | 157 | c->irq_mask = c->base.virt + I2O_IRQ_MASK; |
| 200 | c->reply_port = c->base.virt + 0x44; | 158 | c->in_port = c->base.virt + I2O_IN_PORT; |
| 201 | 159 | c->out_port = c->base.virt + I2O_OUT_PORT; | |
| 202 | #ifdef CONFIG_MTRR | ||
| 203 | /* Enable Write Combining MTRR for IOP's memory region */ | ||
| 204 | c->mtrr_reg0 = mtrr_add(c->in_queue.phys, c->in_queue.len, | ||
| 205 | MTRR_TYPE_WRCOMB, 1); | ||
| 206 | c->mtrr_reg1 = -1; | ||
| 207 | |||
| 208 | if (c->mtrr_reg0 < 0) | ||
| 209 | printk(KERN_WARNING "%s: could not enable write combining " | ||
| 210 | "MTRR\n", c->name); | ||
| 211 | else | ||
| 212 | printk(KERN_INFO "%s: using write combining MTRR\n", c->name); | ||
| 213 | |||
| 214 | /* | ||
| 215 | * If it is an INTEL i960 I/O processor then set the first 64K to | ||
| 216 | * Uncacheable since the region contains the messaging unit which | ||
| 217 | * shouldn't be cached. | ||
| 218 | */ | ||
| 219 | if ((pdev->vendor == PCI_VENDOR_ID_INTEL || | ||
| 220 | pdev->vendor == PCI_VENDOR_ID_DPT) && !c->raptor) { | ||
| 221 | printk(KERN_INFO "%s: MTRR workaround for Intel i960 processor" | ||
| 222 | "\n", c->name); | ||
| 223 | c->mtrr_reg1 = mtrr_add(c->base.phys, 0x10000, | ||
| 224 | MTRR_TYPE_UNCACHABLE, 1); | ||
| 225 | |||
| 226 | if (c->mtrr_reg1 < 0) { | ||
| 227 | printk(KERN_WARNING "%s: Error in setting " | ||
| 228 | "MTRR_TYPE_UNCACHABLE\n", c->name); | ||
| 229 | mtrr_del(c->mtrr_reg0, c->in_queue.phys, | ||
| 230 | c->in_queue.len); | ||
| 231 | c->mtrr_reg0 = -1; | ||
| 232 | } | ||
| 233 | } | ||
| 234 | #endif | ||
| 235 | 160 | ||
| 236 | if (i2o_dma_alloc(dev, &c->status, 8, GFP_KERNEL)) { | 161 | if (i2o_dma_alloc(dev, &c->status, 8, GFP_KERNEL)) { |
| 237 | i2o_pci_free(c); | 162 | i2o_pci_free(c); |
| @@ -254,7 +179,10 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
| 254 | return -ENOMEM; | 179 | return -ENOMEM; |
| 255 | } | 180 | } |
| 256 | 181 | ||
| 257 | if (i2o_dma_alloc(dev, &c->out_queue, MSG_POOL_SIZE, GFP_KERNEL)) { | 182 | if (i2o_dma_alloc |
| 183 | (dev, &c->out_queue, | ||
| 184 | I2O_MAX_OUTBOUND_MSG_FRAMES * I2O_OUTBOUND_MSG_FRAME_SIZE * | ||
| 185 | sizeof(u32), GFP_KERNEL)) { | ||
| 258 | i2o_pci_free(c); | 186 | i2o_pci_free(c); |
| 259 | return -ENOMEM; | 187 | return -ENOMEM; |
| 260 | } | 188 | } |
| @@ -276,51 +204,30 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
| 276 | static irqreturn_t i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r) | 204 | static irqreturn_t i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r) |
| 277 | { | 205 | { |
| 278 | struct i2o_controller *c = dev_id; | 206 | struct i2o_controller *c = dev_id; |
| 279 | struct device *dev = &c->pdev->dev; | 207 | u32 m; |
| 280 | struct i2o_message *m; | 208 | irqreturn_t rc = IRQ_NONE; |
| 281 | u32 mv; | 209 | |
| 282 | 210 | while (readl(c->irq_status) & I2O_IRQ_OUTBOUND_POST) { | |
| 283 | /* | 211 | m = readl(c->out_port); |
| 284 | * Old 960 steppings had a bug in the I2O unit that caused | 212 | if (m == I2O_QUEUE_EMPTY) { |
| 285 | * the queue to appear empty when it wasn't. | 213 | /* |
| 286 | */ | 214 | * Old 960 steppings had a bug in the I2O unit that |
| 287 | mv = I2O_REPLY_READ32(c); | 215 | * caused the queue to appear empty when it wasn't. |
| 288 | if (mv == I2O_QUEUE_EMPTY) { | 216 | */ |
| 289 | mv = I2O_REPLY_READ32(c); | 217 | m = readl(c->out_port); |
| 290 | if (unlikely(mv == I2O_QUEUE_EMPTY)) { | 218 | if (unlikely(m == I2O_QUEUE_EMPTY)) |
| 291 | return IRQ_NONE; | 219 | break; |
| 292 | } else | 220 | } |
| 293 | pr_debug("%s: 960 bug detected\n", c->name); | ||
| 294 | } | ||
| 295 | |||
| 296 | while (mv != I2O_QUEUE_EMPTY) { | ||
| 297 | /* | ||
| 298 | * Map the message from the page frame map to kernel virtual. | ||
| 299 | * Because bus_to_virt is deprecated, we have calculate the | ||
| 300 | * location by ourself! | ||
| 301 | */ | ||
| 302 | m = i2o_msg_out_to_virt(c, mv); | ||
| 303 | |||
| 304 | /* | ||
| 305 | * Ensure this message is seen coherently but cachably by | ||
| 306 | * the processor | ||
| 307 | */ | ||
| 308 | dma_sync_single_for_cpu(dev, mv, MSG_FRAME_SIZE * 4, | ||
| 309 | PCI_DMA_FROMDEVICE); | ||
| 310 | 221 | ||
| 311 | /* dispatch it */ | 222 | /* dispatch it */ |
| 312 | if (i2o_driver_dispatch(c, mv, m)) | 223 | if (i2o_driver_dispatch(c, m)) |
| 313 | /* flush it if result != 0 */ | 224 | /* flush it if result != 0 */ |
| 314 | i2o_flush_reply(c, mv); | 225 | i2o_flush_reply(c, m); |
| 315 | 226 | ||
| 316 | /* | 227 | rc = IRQ_HANDLED; |
| 317 | * That 960 bug again... | ||
| 318 | */ | ||
| 319 | mv = I2O_REPLY_READ32(c); | ||
| 320 | if (mv == I2O_QUEUE_EMPTY) | ||
| 321 | mv = I2O_REPLY_READ32(c); | ||
| 322 | } | 228 | } |
| 323 | return IRQ_HANDLED; | 229 | |
| 230 | return rc; | ||
| 324 | } | 231 | } |
| 325 | 232 | ||
| 326 | /** | 233 | /** |
| @@ -336,7 +243,7 @@ static int i2o_pci_irq_enable(struct i2o_controller *c) | |||
| 336 | struct pci_dev *pdev = c->pdev; | 243 | struct pci_dev *pdev = c->pdev; |
| 337 | int rc; | 244 | int rc; |
| 338 | 245 | ||
| 339 | I2O_IRQ_WRITE32(c, 0xffffffff); | 246 | writel(0xffffffff, c->irq_mask); |
| 340 | 247 | ||
| 341 | if (pdev->irq) { | 248 | if (pdev->irq) { |
| 342 | rc = request_irq(pdev->irq, i2o_pci_interrupt, SA_SHIRQ, | 249 | rc = request_irq(pdev->irq, i2o_pci_interrupt, SA_SHIRQ, |
| @@ -348,7 +255,7 @@ static int i2o_pci_irq_enable(struct i2o_controller *c) | |||
| 348 | } | 255 | } |
| 349 | } | 256 | } |
| 350 | 257 | ||
| 351 | I2O_IRQ_WRITE32(c, 0x00000000); | 258 | writel(0x00000000, c->irq_mask); |
| 352 | 259 | ||
| 353 | printk(KERN_INFO "%s: Installed at IRQ %d\n", c->name, pdev->irq); | 260 | printk(KERN_INFO "%s: Installed at IRQ %d\n", c->name, pdev->irq); |
| 354 | 261 | ||
| @@ -363,7 +270,7 @@ static int i2o_pci_irq_enable(struct i2o_controller *c) | |||
| 363 | */ | 270 | */ |
| 364 | static void i2o_pci_irq_disable(struct i2o_controller *c) | 271 | static void i2o_pci_irq_disable(struct i2o_controller *c) |
| 365 | { | 272 | { |
| 366 | I2O_IRQ_WRITE32(c, 0xffffffff); | 273 | writel(0xffffffff, c->irq_mask); |
| 367 | 274 | ||
| 368 | if (c->pdev->irq > 0) | 275 | if (c->pdev->irq > 0) |
| 369 | free_irq(c->pdev->irq, c); | 276 | free_irq(c->pdev->irq, c); |
| @@ -385,28 +292,25 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, | |||
| 385 | { | 292 | { |
| 386 | struct i2o_controller *c; | 293 | struct i2o_controller *c; |
| 387 | int rc; | 294 | int rc; |
| 295 | struct pci_dev *i960 = NULL; | ||
| 388 | 296 | ||
| 389 | printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n"); | 297 | printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n"); |
| 390 | 298 | ||
| 391 | if ((pdev->class & 0xff) > 1) { | 299 | if ((pdev->class & 0xff) > 1) { |
| 392 | printk(KERN_WARNING "i2o: I2O controller found but does not " | 300 | printk(KERN_WARNING "i2o: %s does not support I2O 1.5 " |
| 393 | "support I2O 1.5 (skipping).\n"); | 301 | "(skipping).\n", pci_name(pdev)); |
| 394 | return -ENODEV; | 302 | return -ENODEV; |
| 395 | } | 303 | } |
| 396 | 304 | ||
| 397 | if ((rc = pci_enable_device(pdev))) { | 305 | if ((rc = pci_enable_device(pdev))) { |
| 398 | printk(KERN_WARNING "i2o: I2O controller found but could not be" | 306 | printk(KERN_WARNING "i2o: couldn't enable device %s\n", |
| 399 | " enabled.\n"); | 307 | pci_name(pdev)); |
| 400 | return rc; | 308 | return rc; |
| 401 | } | 309 | } |
| 402 | 310 | ||
| 403 | printk(KERN_INFO "i2o: I2O controller found on bus %d at %d.\n", | ||
| 404 | pdev->bus->number, pdev->devfn); | ||
| 405 | |||
| 406 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { | 311 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { |
| 407 | printk(KERN_WARNING "i2o: I2O controller on bus %d at %d: No " | 312 | printk(KERN_WARNING "i2o: no suitable DMA found for %s\n", |
| 408 | "suitable DMA available!\n", pdev->bus->number, | 313 | pci_name(pdev)); |
| 409 | pdev->devfn); | ||
| 410 | rc = -ENODEV; | 314 | rc = -ENODEV; |
| 411 | goto disable; | 315 | goto disable; |
| 412 | } | 316 | } |
| @@ -415,14 +319,16 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, | |||
| 415 | 319 | ||
| 416 | c = i2o_iop_alloc(); | 320 | c = i2o_iop_alloc(); |
| 417 | if (IS_ERR(c)) { | 321 | if (IS_ERR(c)) { |
| 418 | printk(KERN_ERR "i2o: memory for I2O controller could not be " | 322 | printk(KERN_ERR "i2o: couldn't allocate memory for %s\n", |
| 419 | "allocated\n"); | 323 | pci_name(pdev)); |
| 420 | rc = PTR_ERR(c); | 324 | rc = PTR_ERR(c); |
| 421 | goto disable; | 325 | goto disable; |
| 422 | } | 326 | } else |
| 327 | printk(KERN_INFO "%s: controller found (%s)\n", c->name, | ||
| 328 | pci_name(pdev)); | ||
| 423 | 329 | ||
| 424 | c->pdev = pdev; | 330 | c->pdev = pdev; |
| 425 | c->device = pdev->dev; | 331 | c->device.parent = get_device(&pdev->dev); |
| 426 | 332 | ||
| 427 | /* Cards that fall apart if you hit them with large I/O loads... */ | 333 | /* Cards that fall apart if you hit them with large I/O loads... */ |
| 428 | if (pdev->vendor == PCI_VENDOR_ID_NCR && pdev->device == 0x0630) { | 334 | if (pdev->vendor == PCI_VENDOR_ID_NCR && pdev->device == 0x0630) { |
| @@ -432,16 +338,48 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, | |||
| 432 | } | 338 | } |
| 433 | 339 | ||
| 434 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_PROMISE) { | 340 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_PROMISE) { |
| 341 | /* | ||
| 342 | * Expose the ship behind i960 for initialization, or it will | ||
| 343 | * failed | ||
| 344 | */ | ||
| 345 | i960 = | ||
| 346 | pci_find_slot(c->pdev->bus->number, | ||
| 347 | PCI_DEVFN(PCI_SLOT(c->pdev->devfn), 0)); | ||
| 348 | |||
| 349 | if (i960) | ||
| 350 | pci_write_config_word(i960, 0x42, 0); | ||
| 351 | |||
| 435 | c->promise = 1; | 352 | c->promise = 1; |
| 436 | printk(KERN_INFO "%s: Promise workarounds activated.\n", | 353 | c->limit_sectors = 1; |
| 437 | c->name); | ||
| 438 | } | 354 | } |
| 439 | 355 | ||
| 356 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_DPT) | ||
| 357 | c->adaptec = 1; | ||
| 358 | |||
| 440 | /* Cards that go bananas if you quiesce them before you reset them. */ | 359 | /* Cards that go bananas if you quiesce them before you reset them. */ |
| 441 | if (pdev->vendor == PCI_VENDOR_ID_DPT) { | 360 | if (pdev->vendor == PCI_VENDOR_ID_DPT) { |
| 442 | c->no_quiesce = 1; | 361 | c->no_quiesce = 1; |
| 443 | if (pdev->device == 0xa511) | 362 | if (pdev->device == 0xa511) |
| 444 | c->raptor = 1; | 363 | c->raptor = 1; |
| 364 | |||
| 365 | if (pdev->subsystem_device == 0xc05a) { | ||
| 366 | c->limit_sectors = 1; | ||
| 367 | printk(KERN_INFO | ||
| 368 | "%s: limit sectors per request to %d\n", c->name, | ||
| 369 | I2O_MAX_SECTORS_LIMITED); | ||
| 370 | } | ||
| 371 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
| 372 | if (sizeof(dma_addr_t) > 4) { | ||
| 373 | if (pci_set_dma_mask(pdev, DMA_64BIT_MASK)) | ||
| 374 | printk(KERN_INFO "%s: 64-bit DMA unavailable\n", | ||
| 375 | c->name); | ||
| 376 | else { | ||
| 377 | c->pae_support = 1; | ||
| 378 | printk(KERN_INFO "%s: using 64-bit DMA\n", | ||
| 379 | c->name); | ||
| 380 | } | ||
| 381 | } | ||
| 382 | #endif | ||
| 445 | } | 383 | } |
| 446 | 384 | ||
| 447 | if ((rc = i2o_pci_alloc(c))) { | 385 | if ((rc = i2o_pci_alloc(c))) { |
| @@ -459,6 +397,11 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, | |||
| 459 | if ((rc = i2o_iop_add(c))) | 397 | if ((rc = i2o_iop_add(c))) |
| 460 | goto uninstall; | 398 | goto uninstall; |
| 461 | 399 | ||
| 400 | get_device(&c->device); | ||
| 401 | |||
| 402 | if (i960) | ||
| 403 | pci_write_config_word(i960, 0x42, 0x03ff); | ||
| 404 | |||
| 462 | return 0; | 405 | return 0; |
| 463 | 406 | ||
| 464 | uninstall: | 407 | uninstall: |
| @@ -469,6 +412,7 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, | |||
| 469 | 412 | ||
| 470 | free_controller: | 413 | free_controller: |
| 471 | i2o_iop_free(c); | 414 | i2o_iop_free(c); |
| 415 | put_device(c->device.parent); | ||
| 472 | 416 | ||
| 473 | disable: | 417 | disable: |
| 474 | pci_disable_device(pdev); | 418 | pci_disable_device(pdev); |
| @@ -492,15 +436,17 @@ static void __devexit i2o_pci_remove(struct pci_dev *pdev) | |||
| 492 | i2o_pci_irq_disable(c); | 436 | i2o_pci_irq_disable(c); |
| 493 | i2o_pci_free(c); | 437 | i2o_pci_free(c); |
| 494 | 438 | ||
| 439 | pci_disable_device(pdev); | ||
| 440 | |||
| 495 | printk(KERN_INFO "%s: Controller removed.\n", c->name); | 441 | printk(KERN_INFO "%s: Controller removed.\n", c->name); |
| 496 | 442 | ||
| 497 | i2o_iop_free(c); | 443 | put_device(c->device.parent); |
| 498 | pci_disable_device(pdev); | 444 | put_device(&c->device); |
| 499 | }; | 445 | }; |
| 500 | 446 | ||
| 501 | /* PCI driver for I2O controller */ | 447 | /* PCI driver for I2O controller */ |
| 502 | static struct pci_driver i2o_pci_driver = { | 448 | static struct pci_driver i2o_pci_driver = { |
| 503 | .name = "I2O controller", | 449 | .name = "PCI_I2O", |
| 504 | .id_table = i2o_pci_ids, | 450 | .id_table = i2o_pci_ids, |
| 505 | .probe = i2o_pci_probe, | 451 | .probe = i2o_pci_probe, |
| 506 | .remove = __devexit_p(i2o_pci_remove), | 452 | .remove = __devexit_p(i2o_pci_remove), |
| @@ -523,6 +469,4 @@ void __exit i2o_pci_exit(void) | |||
| 523 | { | 469 | { |
| 524 | pci_unregister_driver(&i2o_pci_driver); | 470 | pci_unregister_driver(&i2o_pci_driver); |
| 525 | }; | 471 | }; |
| 526 | |||
| 527 | EXPORT_SYMBOL(i2o_dma_realloc); | ||
| 528 | MODULE_DEVICE_TABLE(pci, i2o_pci_ids); | 472 | MODULE_DEVICE_TABLE(pci, i2o_pci_ids); |
