This updates the Fusion-MPT driver to the latest stable version.
Changes affect the driver source only.
Major Changes:
Reworked the calls save_flags, cli, restore_flags to 2.5 format.
Modified DV invocation and to handle illegal bus configuration
Negotiation settings honor NVRAM
Bug Fix: Pushing F/W onto part during driver unload.
Bug Fix: Force F/W reset for 1030 on driver load.
Bug Fix: F/W download algorithm.
Bug Fix: Found a memory leak in mptctl.c
Bug Fix: Forcing data direction for reads and writes (sg issue)
Bug Fix: Wrong mask in Inquiry data ANSI version
Minor Changes:
Modified the debug and logging statements of the driver
Upgraded the MPI include files (lsi/)
#
# Makefile for the LSI Logic Fusion MPT (Message Passing Technology) drivers.
#
-# Note! If you want to turn on various debug defines for an extended period of
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definition is now inherited from the
+# parent makefile.
+#
+# Note 3! If you want to turn on various debug defines for an extended period of
# time but don't want them lingering around in the Makefile when you pass it on
# to someone else, use the MPT_CFLAGS env variable (thanks Steve). -nromer
#EXTRA_CFLAGS += -DDEBUG
#EXTRA_CFLAGS += -DMPT_DEBUG
#EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME
+#EXTRA_CFLAGS += -DMPT_DEBUG_SG
#
# driver/module specifics...
#
#CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE
#CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ
#
-# For {mptscsih, mptctl}:
-#CFLAGS_mptscsih.o += -DMPT_SCSI_USE_NEW_EH
+# For mptscsih:
#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCANDV
-#CFLAGS_mptscsih.o += -DMPT_DEBUG_SG
-#CFLAGS_mptctl.o += -DMPT_DEBUG_SG
+#CFLAGS_mptscsih.o += -DMPT_DEBUG_RESET
+#CFLAGS_mptscsih.o += -DMPT_DEBUG_NEH
+#
+# For mptctl:
+#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL
#
# For mptlan:
#CFLAGS_mptlan.o += -DMPT_LAN_IO_DEBUG
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
-export-objs := mptbase.o
+O_TARGET := fusion.o
+
+export-objs := mptbase.o mptscsih.o mptlan.o mptctl.o isense.o
+
+# ? what's list-multi for?
+#list-multi := fusion.o mptscsih.o
obj-$(CONFIG_FUSION) += mptbase.o mptscsih.o
obj-$(CONFIG_FUSION_ISENSE) += isense.o
obj-$(CONFIG_FUSION_CTL) += mptctl.o
obj-$(CONFIG_FUSION_LAN) += mptlan.o
+O_OBJS := $(filter-out $(export-objs), $(obj-y))
+OX_OBJS := $(filter $(export-objs), $(obj-y))
+M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
+MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
+
include $(TOPDIR)/Rules.make
+
+
+# EXP...
+## Fusion MPT extra's...
+##mptscsih.o: $(mptscsih-objs)
+## $(LD) -r -o $@ $(mptscsih-objs)
#define MPT_SCSI_USE_NEW_EH
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28)
+#define mptscsih_save_flags(flags) \
+({ local_save_flags(flags); \
+ local_irq_disable(); \
+})
+#else
+#define mptscsih_save_flags(flags) \
+({ save_flags(flags); \
+ cli(); \
+})
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28)
+#define mptscsih_restore_flags(flags) \
+({ local_irq_enable(); \
+ local_irq_restore(flags); \
+})
+#else
+#define mptscsih_restore_flags(flags) restore_flags(flags);
+#endif
+
/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* _LINUX_COMPAT_H */
/*
- * Copyright (c) 2000-2001 LSI Logic Corporation.
+ * Copyright (c) 2000-2002 LSI Logic Corporation.
*
*
* Name: MPI.H
* Title: MPI Message independent structures and definitions
* Creation Date: July 27, 2000
*
- * MPI Version: 01.02.03
+ * MPI.H Version: 01.02.06
*
* Version History
* ---------------
* Added define MPI_FUNCTION_TOOLBOX.
* 09-28-01 01.02.02 New function code MPI_SCSI_ENCLOSURE_PROCESSOR.
* 11-01-01 01.02.03 Changed name to MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR.
+ * 03-14-02 01.02.04 Added MPI_HEADER_VERSION_ defines.
+ * 05-31-02 01.02.05 Bumped MPI_HEADER_VERSION_UNIT.
+ * 07-12-02 01.02.06 Added define for MPI_FUNCTION_MAILBOX.
* --------------------------------------------------------------------------
*/
#define MPI_VERSION_MAJOR (0x01)
#define MPI_VERSION_MINOR (0x02)
-#define MPI_VERSION ((MPI_VERSION_MAJOR << 8) | MPI_VERSION_MINOR)
-
+#define MPI_VERSION_MAJOR_MASK (0xFF00)
+#define MPI_VERSION_MAJOR_SHIFT (8)
+#define MPI_VERSION_MINOR_MASK (0x00FF)
+#define MPI_VERSION_MINOR_SHIFT (0)
+#define MPI_VERSION ((MPI_VERSION_MAJOR << MPI_VERSION_MAJOR_SHIFT) | \
+ MPI_VERSION_MINOR)
+
+#define MPI_VERSION_01_00 (0x0100)
+#define MPI_VERSION_01_01 (0x0101)
+#define MPI_VERSION_01_02 (0x0102)
/* Note: The major versions of 0xe0 through 0xff are reserved */
+/* versioning for this MPI header set */
+#define MPI_HEADER_VERSION_UNIT (0x07)
+#define MPI_HEADER_VERSION_DEV (0x00)
+#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
+#define MPI_HEADER_VERSION_UNIT_SHIFT (8)
+#define MPI_HEADER_VERSION_DEV_MASK (0x00FF)
+#define MPI_HEADER_VERSION_DEV_SHIFT (0)
+#define MPI_HEADER_VERSION ((MPI_HEADER_VERSION_UNIT << 8) | MPI_HEADER_VERSION_DEV)
+
/*****************************************************************************
*
* I O C S t a t e D e f i n i t i o n s
#define MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18)
+#define MPI_FUNCTION_MAILBOX (0x19)
+
#define MPI_FUNCTION_LAN_SEND (0x20)
#define MPI_FUNCTION_LAN_RECEIVE (0x21)
#define MPI_FUNCTION_LAN_RESET (0x22)
/*
- * Copyright (c) 2000-2001 LSI Logic Corporation.
+ * Copyright (c) 2000-2002 LSI Logic Corporation.
*
*
* Name: MPI_CNFG.H
* Title: MPI Config message, structures, and Pages
* Creation Date: July 27, 2000
*
- * MPI Version: 01.02.05
+ * MPI_CNFG.H Version: 01.02.08
*
* Version History
* ---------------
* Added generic defines for hot spare pools and RAID
* volume types.
* 11-01-01 01.02.05 Added define for MPI_IOUNITPAGE1_DISABLE_IR.
+ * 03-14-02 01.02.06 Added PCISlotNum field to CONFIG_PAGE_IOC_1 along with
+ * related define, and bumped the page version define.
+ * 05-31-02 01.02.07 Added a Flags field to CONFIG_PAGE_IOC_2_RAID_VOL in a
+ * reserved byte and added a define.
+ * Added define for
+ * MPI_RAIDVOL0_STATUS_FLAG_VOLUME_INACTIVE.
+ * Added new config page: CONFIG_PAGE_IOC_5.
+ * Added MaxAliases, MaxHardAliases, and NumCurrentAliases
+ * fields to CONFIG_PAGE_FC_PORT_0.
+ * Added AltConnector and NumRequestedAliases fields to
+ * CONFIG_PAGE_FC_PORT_1.
+ * Added new config page: CONFIG_PAGE_FC_PORT_10.
+ * 07-12-02 01.02.08 Added more MPI_MANUFACTPAGE_DEVID_ defines.
+ * Added additional MPI_SCSIDEVPAGE0_NP_ defines.
+ * Added more MPI_SCSIDEVPAGE1_RP_ defines.
+ * Added define for
+ * MPI_SCSIDEVPAGE1_CONF_EXTENDED_PARAMS_ENABLE.
+ * Added new config page: CONFIG_PAGE_SCSI_DEVICE_3.
+ * Modified MPI_FCPORTPAGE5_FLAGS_ defines.
* --------------------------------------------------------------------------
*/
#define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622)
#define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628)
#define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626)
+
#define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030)
#define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031)
#define MPI_MANUFACTPAGE_DEVID_1030_53C1035 (0x0032)
#define MPI_MANUFACTPAGE_DEVID_53C1035 (0x0040)
#define MPI_MANUFACTPAGE_DEVID_53C1035ZC (0x0041)
+#define MPI_MANUFACTPAGE_DEVID_SA2010 (0x0804)
+#define MPI_MANUFACTPAGE_DEVID_SA2010ZC (0x0805)
+#define MPI_MANUFACTPAGE_DEVID_SA2020 (0x0806)
+#define MPI_MANUFACTPAGE_DEVID_SA2020ZC (0x0807)
+
+
typedef struct _CONFIG_PAGE_MANUFACTURING_0
{
fCONFIG_PAGE_HEADER Header; /* 00h */
U32 Flags; /* 04h */
U32 CoalescingTimeout; /* 08h */
U8 CoalescingDepth; /* 0Ch */
- U8 Reserved[3]; /* 0Dh */
+ U8 PCISlotNum; /* 0Dh */
+ U8 Reserved[2]; /* 0Eh */
} fCONFIG_PAGE_IOC_1, MPI_POINTER PTR_CONFIG_PAGE_IOC_1,
IOCPage1_t, MPI_POINTER pIOCPage1_t;
-#define MPI_IOCPAGE1_PAGEVERSION (0x00)
+#define MPI_IOCPAGE1_PAGEVERSION (0x01)
#define MPI_IOCPAGE1_REPLY_COALESCING (0x00000001)
+#define MPI_IOCPAGE1_PCISLOTNUM_UNKNOWN (0xFF)
+
typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL
{
U8 VolumeIOC; /* 02h */
U8 VolumePageNumber; /* 03h */
U8 VolumeType; /* 04h */
- U8 Reserved2; /* 05h */
+ U8 Flags; /* 05h */
U16 Reserved3; /* 06h */
} fCONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL,
ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t;
+/* IOC Page 2 Volume RAID Type values, also used in RAID Volume pages */
+
+#define MPI_RAID_VOL_TYPE_IS (0x00)
+#define MPI_RAID_VOL_TYPE_IME (0x01)
+#define MPI_RAID_VOL_TYPE_IM (0x02)
+
+/* IOC Page 2 Volume Flags values */
+
+#define MPI_IOCPAGE2_FLAG_VOLUME_INACTIVE (0x08)
+
/*
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
* one and check Header.PageLength at runtime.
} fCONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2,
IOCPage2_t, MPI_POINTER pIOCPage2_t;
-#define MPI_IOCPAGE2_PAGEVERSION (0x01)
+#define MPI_IOCPAGE2_PAGEVERSION (0x02)
/* IOC Page 2 Capabilities flags */
#define MPI_IOCPAGE2_CAP_FLAGS_SAFTE_SUPPORT (0x40000000)
#define MPI_IOCPAGE2_CAP_FLAGS_CROSS_CHANNEL_SUPPORT (0x80000000)
-/* IOC Page 2 Volume RAID Type values, also used in RAID Volume pages */
-
-#define MPI_RAID_VOL_TYPE_IS (0x00)
-#define MPI_RAID_VOL_TYPE_IME (0x01)
-#define MPI_RAID_VOL_TYPE_IM (0x02)
-
typedef struct _IOC_3_PHYS_DISK
{
#define MPI_IOCPAGE4_PAGEVERSION (0x00)
+typedef struct _IOC_5_HOT_SPARE
+{
+ U8 PhysDiskNum; /* 00h */
+ U8 Reserved; /* 01h */
+ U8 HotSparePool; /* 02h */
+ U8 Flags; /* 03h */
+} IOC_5_HOT_SPARE, MPI_POINTER PTR_IOC_5_HOT_SPARE,
+ Ioc5HotSpare_t, MPI_POINTER pIoc5HotSpare_t;
+
+/* IOC Page 5 HotSpare Flags */
+#define MPI_IOC_PAGE_5_HOT_SPARE_ACTIVE (0x01)
+
+/*
+ * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
+ * one and check Header.PageLength at runtime.
+ */
+#ifndef MPI_IOC_PAGE_5_HOT_SPARE_MAX
+#define MPI_IOC_PAGE_5_HOT_SPARE_MAX (1)
+#endif
+
+typedef struct _CONFIG_PAGE_IOC_5
+{
+ fCONFIG_PAGE_HEADER Header; /* 00h */
+ U32 Reserved1; /* 04h */
+ U8 NumHotSpares; /* 08h */
+ U8 Reserved2; /* 09h */
+ U16 Reserved3; /* 0Ah */
+ IOC_5_HOT_SPARE HotSpare[MPI_IOC_PAGE_5_HOT_SPARE_MAX]; /* 0Ch */
+} fCONFIG_PAGE_IOC_5, MPI_POINTER PTR_CONFIG_PAGE_IOC_5,
+ IOCPage5_t, MPI_POINTER pIOCPage5_t;
+
+#define MPI_IOCPAGE5_PAGEVERSION (0x00)
+
+
+
/****************************************************************************
* SCSI Port Config Pages
****************************************************************************/
} fCONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0,
SCSIDevicePage0_t, MPI_POINTER pSCSIDevicePage0_t;
-#define MPI_SCSIDEVPAGE0_PAGEVERSION (0x02)
+#define MPI_SCSIDEVPAGE0_PAGEVERSION (0x03)
#define MPI_SCSIDEVPAGE0_NP_IU (0x00000001)
#define MPI_SCSIDEVPAGE0_NP_DT (0x00000002)
#define MPI_SCSIDEVPAGE0_NP_QAS (0x00000004)
+#define MPI_SCSIDEVPAGE0_NP_HOLD_MCS (0x00000008)
+#define MPI_SCSIDEVPAGE0_NP_WR_FLOW (0x00000010)
+#define MPI_SCSIDEVPAGE0_NP_RD_STRM (0x00000020)
+#define MPI_SCSIDEVPAGE0_NP_RTI (0x00000040)
+#define MPI_SCSIDEVPAGE0_NP_PCOMP_EN (0x00000080)
#define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_PERIOD_MASK (0x0000FF00)
#define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000)
#define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000)
} fCONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1,
SCSIDevicePage1_t, MPI_POINTER pSCSIDevicePage1_t;
-#define MPI_SCSIDEVPAGE1_PAGEVERSION (0x03)
+#define MPI_SCSIDEVPAGE1_PAGEVERSION (0x04)
#define MPI_SCSIDEVPAGE1_RP_IU (0x00000001)
#define MPI_SCSIDEVPAGE1_RP_DT (0x00000002)
#define MPI_SCSIDEVPAGE1_RP_QAS (0x00000004)
+#define MPI_SCSIDEVPAGE1_RP_HOLD_MCS (0x00000008)
+#define MPI_SCSIDEVPAGE1_RP_WR_FLOW (0x00000010)
+#define MPI_SCSIDEVPAGE1_RP_RD_STRM (0x00000020)
+#define MPI_SCSIDEVPAGE1_RP_RTI (0x00000040)
+#define MPI_SCSIDEVPAGE1_RP_PCOMP_EN (0x00000080)
#define MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK (0x0000FF00)
#define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000)
#define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000)
#define MPI_SCSIDEVPAGE1_RP_AIP (0x80000000)
-#define MPI_SCSIDEVPAGE1_DV_LVD_DRIVE_STRENGTH_MASK (0x00000003)
-#define MPI_SCSIDEVPAGE1_DV_SE_SLEW_RATE_MASK (0x00000300)
-
#define MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED (0x00000002)
#define MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED (0x00000004)
+#define MPI_SCSIDEVPAGE1_CONF_EXTENDED_PARAMS_ENABLE (0x00000008)
typedef struct _CONFIG_PAGE_SCSI_DEVICE_2
} fCONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2,
SCSIDevicePage2_t, MPI_POINTER pSCSIDevicePage2_t;
-#define MPI_SCSIDEVPAGE2_PAGEVERSION (0x00)
+#define MPI_SCSIDEVPAGE2_PAGEVERSION (0x01)
#define MPI_SCSIDEVPAGE2_DV_ISI_ENABLE (0x00000010)
#define MPI_SCSIDEVPAGE2_DV_SECONDARY_DRIVER_ENABLE (0x00000020)
#define MPI_SCSIDEVPAGE2_DPS_BIT_15_PL_SELECT_MASK (0xC0000000)
+typedef struct _CONFIG_PAGE_SCSI_DEVICE_3
+{
+ fCONFIG_PAGE_HEADER Header; /* 00h */
+ U16 MsgRejectCount; /* 04h */
+ U16 PhaseErrorCount; /* 06h */
+ U16 ParityErrorCount; /* 08h */
+ U16 Reserved; /* 0Ah */
+} fCONFIG_PAGE_SCSI_DEVICE_3, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_3,
+ SCSIDevicePage3_t, MPI_POINTER pSCSIDevicePage3_t;
+
+#define MPI_SCSIDEVPAGE3_PAGEVERSION (0x00)
+
+#define MPI_SCSIDEVPAGE3_MAX_COUNTER (0xFFFE)
+#define MPI_SCSIDEVPAGE3_UNSUPPORTED_COUNTER (0xFFFF)
+
+
/****************************************************************************
* FC Port Config Pages
****************************************************************************/
U64 FabricWWPN; /* 38h */
U32 DiscoveredPortsCount; /* 40h */
U32 MaxInitiators; /* 44h */
+ U8 MaxAliasesSupported; /* 48h */
+ U8 MaxHardAliasesSupported; /* 49h */
+ U8 NumCurrentAliases; /* 4Ah */
+ U8 Reserved1; /* 4Bh */
} fCONFIG_PAGE_FC_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_0,
FCPortPage0_t, MPI_POINTER pFCPortPage0_t;
-#define MPI_FCPORTPAGE0_PAGEVERSION (0x01)
+#define MPI_FCPORTPAGE0_PAGEVERSION (0x02)
#define MPI_FCPORTPAGE0_FLAGS_PROT_MASK (0x0000000F)
#define MPI_FCPORTPAGE0_FLAGS_PROT_FCP_INIT (MPI_PORTFACTS_PROTOCOL_INITIATOR)
U8 HardALPA; /* 18h */
U8 LinkConfig; /* 19h */
U8 TopologyConfig; /* 1Ah */
- U8 Reserved; /* 1Bh */
+ U8 AltConnector; /* 1Bh */
+ U8 NumRequestedAliases; /* 1Ch */
+ U8 Reserved1; /* 1Dh */
+ U16 Reserved2; /* 1Eh */
} fCONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1,
FCPortPage1_t, MPI_POINTER pFCPortPage1_t;
-#define MPI_FCPORTPAGE1_PAGEVERSION (0x02)
+#define MPI_FCPORTPAGE1_PAGEVERSION (0x04)
#define MPI_FCPORTPAGE1_FLAGS_EXT_FCP_STATUS_EN (0x08000000)
#define MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY (0x04000000)
#define MPI_FCPORTPAGE1_TOPOLOGY_NPORT (0x02)
#define MPI_FCPORTPAGE1_TOPOLOGY_AUTO (0x0F)
+#define MPI_FCPORTPAGE1_ALT_CONN_UNKNOWN (0x00)
+
typedef struct _CONFIG_PAGE_FC_PORT_2
{
MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO,
FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t;
-/*
- * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
- * one and check Header.PageLength at runtime.
- */
-#ifndef MPI_FC_PORT_PAGE_5_ALIAS_MAX
-#define MPI_FC_PORT_PAGE_5_ALIAS_MAX (1)
-#endif
-
typedef struct _CONFIG_PAGE_FC_PORT_5
{
- fCONFIG_PAGE_HEADER Header; /* 00h */
- fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo[MPI_FC_PORT_PAGE_5_ALIAS_MAX];/* 04h */
+ fCONFIG_PAGE_HEADER Header; /* 00h */
+ fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo; /* 04h */
} fCONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5,
FCPortPage5_t, MPI_POINTER pFCPortPage5_t;
-#define MPI_FCPORTPAGE5_PAGEVERSION (0x00)
-
-#define MPI_FCPORTPAGE5_FLAGS_ALIAS_ALPA_VALID (0x01)
-#define MPI_FCPORTPAGE5_FLAGS_ALIAS_WWN_VALID (0x02)
+#define MPI_FCPORTPAGE5_PAGEVERSION (0x01)
+#define MPI_FCPORTPAGE5_FLAGS_ALPA_ACQUIRED (0x01)
+#define MPI_FCPORTPAGE5_FLAGS_HARD_ALPA (0x02)
+#define MPI_FCPORTPAGE5_FLAGS_HARD_WWNN (0x04)
+#define MPI_FCPORTPAGE5_FLAGS_HARD_WWPN (0x08)
typedef struct _CONFIG_PAGE_FC_PORT_6
{
#define MPI_FCPORTPAGE9_PAGEVERSION (0x00)
+typedef struct _CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA
+{
+ U8 Id; /* 10h */
+ U8 ExtId; /* 11h */
+ U8 Connector; /* 12h */
+ U8 Transceiver[8]; /* 13h */
+ U8 Encoding; /* 1Bh */
+ U8 BitRate_100mbs; /* 1Ch */
+ U8 Reserved1; /* 1Dh */
+ U8 Length9u_km; /* 1Eh */
+ U8 Length9u_100m; /* 1Fh */
+ U8 Length50u_10m; /* 20h */
+ U8 Length62p5u_10m; /* 21h */
+ U8 LengthCopper_m; /* 22h */
+ U8 Reseverved2; /* 22h */
+ U8 VendorName[16]; /* 24h */
+ U8 Reserved3; /* 34h */
+ U8 VendorOUI[3]; /* 35h */
+ U8 VendorPN[16]; /* 38h */
+ U8 VendorRev[4]; /* 48h */
+ U16 Reserved4; /* 4Ch */
+ U8 Reserved5; /* 4Eh */
+ U8 CC_BASE; /* 4Fh */
+} fCONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA,
+ MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA,
+ FCPortPage10BaseSfpData_t, MPI_POINTER pFCPortPage10BaseSfpData_t;
+
+#define MPI_FCPORT10_BASE_ID_UNKNOWN (0x00)
+#define MPI_FCPORT10_BASE_ID_GBIC (0x01)
+#define MPI_FCPORT10_BASE_ID_FIXED (0x02)
+#define MPI_FCPORT10_BASE_ID_SFP (0x03)
+#define MPI_FCPORT10_BASE_ID_SFP_MIN (0x04)
+#define MPI_FCPORT10_BASE_ID_SFP_MAX (0x7F)
+#define MPI_FCPORT10_BASE_ID_VEND_SPEC_MASK (0x80)
+
+#define MPI_FCPORT10_BASE_EXTID_UNKNOWN (0x00)
+#define MPI_FCPORT10_BASE_EXTID_MODDEF1 (0x01)
+#define MPI_FCPORT10_BASE_EXTID_MODDEF2 (0x02)
+#define MPI_FCPORT10_BASE_EXTID_MODDEF3 (0x03)
+#define MPI_FCPORT10_BASE_EXTID_SEEPROM (0x04)
+#define MPI_FCPORT10_BASE_EXTID_MODDEF5 (0x05)
+#define MPI_FCPORT10_BASE_EXTID_MODDEF6 (0x06)
+#define MPI_FCPORT10_BASE_EXTID_MODDEF7 (0x07)
+#define MPI_FCPORT10_BASE_EXTID_VNDSPC_MASK (0x80)
+
+#define MPI_FCPORT10_BASE_CONN_UNKNOWN (0x00)
+#define MPI_FCPORT10_BASE_CONN_SC (0x01)
+#define MPI_FCPORT10_BASE_CONN_COPPER1 (0x02)
+#define MPI_FCPORT10_BASE_CONN_COPPER2 (0x03)
+#define MPI_FCPORT10_BASE_CONN_BNC_TNC (0x04)
+#define MPI_FCPORT10_BASE_CONN_COAXIAL (0x05)
+#define MPI_FCPORT10_BASE_CONN_FIBERJACK (0x06)
+#define MPI_FCPORT10_BASE_CONN_LC (0x07)
+#define MPI_FCPORT10_BASE_CONN_MT_RJ (0x08)
+#define MPI_FCPORT10_BASE_CONN_MU (0x09)
+#define MPI_FCPORT10_BASE_CONN_SG (0x0A)
+#define MPI_FCPORT10_BASE_CONN_OPT_PIGT (0x0B)
+#define MPI_FCPORT10_BASE_CONN_RSV1_MIN (0x0C)
+#define MPI_FCPORT10_BASE_CONN_RSV1_MAX (0x1F)
+#define MPI_FCPORT10_BASE_CONN_HSSDC_II (0x20)
+#define MPI_FCPORT10_BASE_CONN_CPR_PIGT (0x21)
+#define MPI_FCPORT10_BASE_CONN_RSV2_MIN (0x22)
+#define MPI_FCPORT10_BASE_CONN_RSV2_MAX (0x7F)
+#define MPI_FCPORT10_BASE_CONN_VNDSPC_MASK (0x80)
+
+#define MPI_FCPORT10_BASE_ENCODE_UNSPEC (0x00)
+#define MPI_FCPORT10_BASE_ENCODE_8B10B (0x01)
+#define MPI_FCPORT10_BASE_ENCODE_4B5B (0x02)
+#define MPI_FCPORT10_BASE_ENCODE_NRZ (0x03)
+#define MPI_FCPORT10_BASE_ENCODE_MANCHESTER (0x04)
+
+
+typedef struct _CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA
+{
+ U8 Options[2]; /* 50h */
+ U8 BitRateMax; /* 52h */
+ U8 BitRateMin; /* 53h */
+ U8 VendorSN[16]; /* 54h */
+ U8 DateCode[8]; /* 64h */
+ U8 Reserved5[3]; /* 6Ch */
+ U8 CC_EXT; /* 6Fh */
+} fCONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA,
+ MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA,
+ FCPortPage10ExtendedSfpData_t, MPI_POINTER pFCPortPage10ExtendedSfpData_t;
+
+#define MPI_FCPORT10_EXT_OPTION1_RATESEL (0x20)
+#define MPI_FCPORT10_EXT_OPTION1_TX_DISABLE (0x10)
+#define MPI_FCPORT10_EXT_OPTION1_TX_FAULT (0x08)
+#define MPI_FCPORT10_EXT_OPTION1_LOS_INVERT (0x04)
+#define MPI_FCPORT10_EXT_OPTION1_LOS (0x02)
+
+
+typedef struct _CONFIG_PAGE_FC_PORT_10
+{
+ fCONFIG_PAGE_HEADER Header; /* 00h */
+ U8 Flags; /* 04h */
+ U8 Reserved1; /* 05h */
+ U16 Reserved2; /* 06h */
+ U32 HwConfig1; /* 08h */
+ U32 HwConfig2; /* 0Ch */
+ fCONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA Base; /* 10h */
+ fCONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA Extended; /* 50h */
+ U8 VendorSpecific[32]; /* 70h */
+} fCONFIG_PAGE_FC_PORT_10, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10,
+ FCPortPage10_t, MPI_POINTER pFCPortPage10_t;
+
+#define MPI_FCPORTPAGE10_PAGEVERSION (0x00)
+
+/* standard MODDEF pin definitions (from GBIC spec.) */
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_MASK (0x00000007)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF2 (0x00000001)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF1 (0x00000002)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF0 (0x00000004)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_NOGBIC (0x00000007)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_CPR_IEEE_CX (0x00000006)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_COPPER (0x00000005)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_OPTICAL_LW (0x00000004)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_SEEPROM (0x00000003)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_SW_OPTICAL (0x00000002)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_LX_IEEE_OPT_LW (0x00000001)
+#define MPI_FCPORTPAGE10_FLAGS_MODDEF_SX_IEEE_OPT_SW (0x00000000)
+
+#define MPI_FCPORTPAGE10_FLAGS_CC_BASE_OK (0x00000010)
+#define MPI_FCPORTPAGE10_FLAGS_CC_EXT_OK (0x00000020)
+
+
/****************************************************************************
* FC Device Config Pages
****************************************************************************/
#define MPI_RAIDVOL0_STATUS_FLAG_ENABLED (0x01)
#define MPI_RAIDVOL0_STATUS_FLAG_QUIESCED (0x02)
#define MPI_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS (0x04)
+#define MPI_RAIDVOL0_STATUS_FLAG_VOLUME_INACTIVE (0x08)
#define MPI_RAIDVOL0_STATUS_STATE_OPTIMAL (0x00)
#define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01)
} fCONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0,
RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t;
-#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x00)
+#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x01)
/****************************************************************************
/*
- * Copyright (c) 2000-2001 LSI Logic Corporation.
+ * Copyright (c) 2000-2002 LSI Logic Corporation.
*
*
* Name: MPI_FC.H
* Title: MPI Fibre Channel messages and structures
* Creation Date: June 12, 2000
*
- * MPI Version: 01.02.02
+ * MPI_FC.H Version: 01.02.03
*
* Version History
* ---------------
* 08-08-01 01.02.01 Original release for v1.2 work.
* 09-28-01 01.02.02 Change name of reserved field in
* MSG_LINK_SERVICE_RSP_REPLY.
+ * 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests.
* --------------------------------------------------------------------------
*/
typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST
{
U8 SendFlags; /* 00h */
- U8 Reserved; /* 01h */
+ U8 AliasIndex; /* 01h */
U8 ChainOffset; /* 02h */
U8 Function; /* 03h */
U32 MsgFlags_Did; /* 04h */
/* Extended Link Service Send Reply */
typedef struct _MSG_EXLINK_SERVICE_SEND_REPLY
{
- U16 Reserved; /* 00h */
+ U8 Reserved; /* 00h */
+ U8 AliasIndex; /* 01h */
U8 MsgLength; /* 02h */
U8 Function; /* 03h */
U16 Reserved1; /* 04h */
typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST
{
U8 SendFlags; /* 00h */
- U8 Reserved; /* 01h */
+ U8 AliasIndex; /* 01h */
U8 ChainOffset; /* 02h */
U8 Function; /* 03h */
U32 MsgFlags_Did; /* 04h */
/* FC Common Transport Send Reply */
typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REPLY
{
- U16 Reserved; /* 00h */
+ U8 Reserved; /* 00h */
+ U8 AliasIndex; /* 01h */
U8 MsgLength; /* 02h */
U8 Function; /* 03h */
U16 Reserved1; /* 04h */
/*
- * Copyright (c) 2000-2001 LSI Logic Corporation.
+ * Copyright (c) 2000-2002 LSI Logic Corporation.
*
*
* Name: MPI_INIT.H
* Title: MPI initiator mode messages and structures
* Creation Date: June 8, 2000
*
- * MPI Version: 01.02.04
+ * MPI_INIT.H Version: 01.02.05
*
* Version History
* ---------------
* 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure
* Processor messages.
* 10-04-01 01.02.04 Added defines for SEP request Action field.
+ * 05-31-02 01.02.05 Added MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR define
+ * for SCSI IO requests.
* --------------------------------------------------------------------------
*/
SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
-/* SCSIO MsgFlags bits */
+/* SCSI IO MsgFlags bits */
-#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01)
-#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00)
-#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01)
-#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02)
-#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00)
-#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02)
+#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01)
+#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00)
+#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01)
+#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02)
+#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00)
+#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02)
+#define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR (0x04)
-/* SCSIIO LUN fields */
+/* SCSI IO LUN fields */
#define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING (0x0000FFFF)
#define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000)
#define MPI_SCSIIO_LUN_LEVEL_1_WORD (0xFF00)
#define MPI_SCSIIO_LUN_LEVEL_1_DWORD (0x0000FF00)
-/* SCSIO Control bits */
+/* SCSI IO Control bits */
#define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK (0x03000000)
#define MPI_SCSIIO_CONTROL_NODATATRANSFER (0x00000000)
#define MPI_SCSIIO_CONTROL_RESERVED2 (0x00010000)
-/* SCSIIO reply structure */
+/* SCSI IO reply structure */
typedef struct _MSG_SCSI_IO_REPLY
{
U8 TargetID; /* 00h */
SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
-/* SCSIIO Reply SCSIStatus values (SAM-2 status codes) */
+/* SCSI IO Reply SCSIStatus values (SAM-2 status codes) */
#define MPI_SCSI_STATUS_SUCCESS (0x00)
#define MPI_SCSI_STATUS_CHECK_CONDITION (0x02)
#define MPI_SCSI_STATUS_ACA_ACTIVE (0x30)
-/* SCSIIO Reply SCSIState values */
+/* SCSI IO Reply SCSIState values */
#define MPI_SCSI_STATE_AUTOSENSE_VALID (0x01)
#define MPI_SCSI_STATE_AUTOSENSE_FAILED (0x02)
#define MPI_SCSI_STATE_RESPONSE_INFO_VALID (0x10)
#define MPI_SCSI_STATE_QUEUE_TAG_REJECTED (0x20)
-/* SCSIIO Reply ResponseInfo values */
+/* SCSI IO Reply ResponseInfo values */
/* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
#define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE (0x00000000)
/*
- * Copyright (c) 2000-2001 LSI Logic Corporation.
+ * Copyright (c) 2000-2002 LSI Logic Corporation.
*
*
* Name: MPI_IOC.H
* Title: MPI IOC, Port, Event, FW Download, and FW Upload messages
* Creation Date: August 11, 2000
*
- * MPI Version: 01.02.04
+ * MPI_IOC.H Version: 01.02.06
*
* Version History
* ---------------
* MPI_FW_UPLOAD_ITYPE_NVDATA.
* 09-28-01 01.02.03 Modified Event Data for Integrated RAID.
* 11-01-01 01.02.04 Added defines for MPI_EXT_IMAGE_HEADER ImageType field.
+ * 03-14-02 01.02.05 Added HeaderVersion field to MSG_IOC_FACTS_REPLY.
+ * 05-31-02 01.02.06 Added define for
+ * MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID.
+ * Added AliasIndex to EVENT_DATA_LOGOUT structure.
* --------------------------------------------------------------------------
*/
U16 MsgVersion; /* 00h */
U8 MsgLength; /* 02h */
U8 Function; /* 03h */
- U16 Reserved; /* 04h */
+ U16 HeaderVersion; /* 04h */
U8 IOCNumber; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00)
#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF)
+#define MPI_IOCFACTS_HEADERVERSION_UNIT_MASK (0xFF00)
+#define MPI_IOCFACTS_HEADERVERSION_DEV_MASK (0x00FF)
+
#define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0001)
+#define MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID (0x0002)
#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01)
typedef struct _EVENT_DATA_LOGOUT
{
U32 NPortID; /* 00h */
- U8 Reserved; /* 04h */
+ U8 AliasIndex; /* 04h */
U8 Port; /* 05h */
U16 Reserved1; /* 06h */
} EVENT_DATA_LOGOUT, MPI_POINTER PTR_EVENT_DATA_LOGOUT,
EventDataLogout_t, MPI_POINTER pEventDataLogout_t;
+#define MPI_EVENT_LOGOUT_ALL_ALIASES (0xFF)
+
+
/* MPI Integrated RAID Event data */
typedef struct _EVENT_DATA_RAID
/*
- * Copyright (c) 2000-2001 LSI Logic Corporation.
+ * Copyright (c) 2000-2002 LSI Logic Corporation.
*
*
* Name: MPI_LAN.H
* Title: MPI LAN messages and structures
* Creation Date: June 30, 2000
*
- * MPI Version: 01.02.01
+ * MPI_LAN.H Version: 01.02.01
*
* Version History
* ---------------
/*
- * Copyright (c) 2001 LSI Logic Corporation.
+ * Copyright (c) 2001-2002 LSI Logic Corporation.
*
*
* Name: MPI_RAID.H
* Title: MPI RAID message and structures
* Creation Date: February 27, 2001
*
- * MPI Version: 01.02.04
+ * MPI_RAID.H Version: 01.02.07
*
* Version History
* ---------------
* 10-04-01 01.02.03 Added ActionData defines for
* MPI_RAID_ACTION_DELETE_VOLUME action.
* 11-01-01 01.02.04 Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC.
+ * 03-14-02 01.02.05 Added define for MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT.
+ * 05-07-02 01.02.06 Added define for MPI_RAID_ACTION_ACTIVATE_VOLUME,
+ * MPI_RAID_ACTION_INACTIVATE_VOLUME, and
+ * MPI_RAID_ACTION_ADATA_INACTIVATE_ALL.
+ * 07-12-02 01.02.07 Added structures for Mailbox request and reply.
* --------------------------------------------------------------------------
*/
#define MPI_RAID_ACTION_DELETE_PHYSDISK (0x0E)
#define MPI_RAID_ACTION_FAIL_PHYSDISK (0x0F)
#define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10)
+#define MPI_RAID_ACTION_ACTIVATE_VOLUME (0x11)
+#define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12)
/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001)
+#define MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT (0x00000002)
/* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */
#define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS (0x00000000)
#define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS (0x00000001)
+/* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */
+#define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001)
+
/* RAID Action reply message */
SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t;
+/****************************************************************************/
+/* Mailbox reqeust structure */
+/****************************************************************************/
+
+typedef struct _MSG_MAILBOX_REQUEST
+{
+ U16 Reserved1;
+ U8 ChainOffset;
+ U8 Function;
+ U16 Reserved2;
+ U8 Reserved3;
+ U8 MsgFlags;
+ U8 Command[10];
+ U16 Reserved4;
+ SGE_IO_UNION SGL;
+} MSG_MAILBOX_REQUEST, MPI_POINTER PTR_MSG_MAILBOX_REQUEST,
+ MailboxRequest_t, MPI_POINTER pMailboxRequest_t;
+
+
+/* Mailbox reply structure */
+typedef struct _MSG_MAILBOX_REPLY
+{
+ U16 Reserved1; /* 00h */
+ U8 MsgLength; /* 02h */
+ U8 Function; /* 03h */
+ U16 Reserved2; /* 04h */
+ U8 Reserved3; /* 06h */
+ U8 MsgFlags; /* 07h */
+ U32 MsgContext; /* 08h */
+ U16 MailboxStatus; /* 0Ch */
+ U16 IOCStatus; /* 0Eh */
+ U32 IOCLogInfo; /* 10h */
+ U32 Reserved4; /* 14h */
+} MSG_MAILBOX_REPLY, MPI_POINTER PTR_MSG_MAILBOX_REPLY,
+ MailboxReply_t, MPI_POINTER pMailboxReply_t;
+
#endif
/*
- * Copyright (c) 2000-2001 LSI Logic Corporation.
+ * Copyright (c) 2000-2002 LSI Logic Corporation.
*
*
* Name: MPI_TARG.H
* Title: MPI Target mode messages and structures
* Creation Date: June 22, 2000
*
- * MPI Version: 01.02.04
+ * MPI_TARG.H Version: 01.02.06
*
* Version History
* ---------------
* of MPI.
* 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY.
* 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.
+ * 03-14-02 01.02.05 Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper
+ * byte ordering.
+ * 05-31-02 01.02.06 Modified TARGET_MODE_REPLY_ALIAS_MASK to only include
+ * one bit.
+ * Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.
* --------------------------------------------------------------------------
*/
U8 FcpCntl[4]; /* 08h */
U8 FcpCdb[16]; /* 0Ch */
U32 FcpDl; /* 1Ch */
+ U8 AliasIndex; /* 20h */
+ U8 Reserved1; /* 21h */
+ U16 Reserved2; /* 22h */
} MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04)
#define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80)
+/*
+ * NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this
+ * structure properly orders the bytes.
+ */
typedef struct _MPI_TARGET_FCP_RSP_BUFFER
{
U8 Reserved0[8]; /* 00h */
- U8 FcpStatus; /* 08h */
- U8 FcpFlags; /* 09h */
- U8 Reserved1[2]; /* 0Ah */
+ U8 Reserved1[2]; /* 08h */
+ U8 FcpFlags; /* 0Ah */
+ U8 FcpStatus; /* 0Bh */
U32 FcpResid; /* 0Ch */
U32 FcpSenseLength; /* 10h */
U32 FcpResponseLength; /* 14h */
} MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,
MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer;
+/*
+ * NOTE: The SPI status IU is big-endian. When used on a little-endian system,
+ * this structure properly orders the bytes.
+ */
typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
{
U8 Reserved0; /* 00h */
#define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0)
#define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000)
#define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14)
-#define TARGET_MODE_REPLY_ALIAS_MASK (0x0C000000)
+#define TARGET_MODE_REPLY_ALIAS_MASK (0x04000000)
#define TARGET_MODE_REPLY_ALIAS_SHIFT (26)
#define TARGET_MODE_REPLY_PORT_MASK (0x10000000)
#define TARGET_MODE_REPLY_PORT_SHIFT (28)
/*
- * Copyright (c) 2000-2001 LSI Logic Corporation.
+ * Copyright (c) 2000-2002 LSI Logic Corporation.
*
*
* Name: MPI_TYPE.H
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
- * $Id: mptbase.c,v 1.119 2002/06/20 13:28:15 pdelaney Exp $
+ * $Id: mptbase.c,v 1.121 2002/07/23 18:56:59 pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
pa = 0; /* No reply flush! */
}
+#ifdef MPT_DEBUG_IRQ
if ((int)ioc->chip_type > (int)FC929) {
- /* Verify mf, mf are reasonable.
+ /* Verify mf, mr are reasonable.
*/
if ((mf) && ((mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))
|| (mf < ioc->req_frames)) ) {
freeme = 0;
}
}
+#endif
/* Check for (valid) IO callback! */
if (cb_idx) {
if (reason == MPT_HOSTEVENT_IOC_BRINGUP){
if (ioc->upload_fw) {
- dprintk((MYIOC_s_INFO_FMT
+ ddlprintk((MYIOC_s_INFO_FMT
"firmware upload required!\n", ioc->name));
r = mpt_do_upload(ioc, sleepFlag);
(void) KickStart(this, 1, NO_SLEEP);
}
+ if (this->cached_fw != NULL) {
+ ddlprintk((KERN_INFO MYNAM ": Pushing FW onto adapter\n"));
+
+ if ((state = mpt_downloadboot(this, NO_SLEEP)) < 0) {
+ printk(KERN_WARNING MYNAM
+ ": firmware downloadboot failure (%d)!\n", state);
+ }
+ }
+
+
/* Disable adapter interrupts! */
CHIPREG_WRITE32(&this->chip->IntMask, 0xFFFFFFFF);
this->active = 0;
}
/* Is it already READY? */
- if (!statefault && (ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_READY)
- return 0;
+ if (!statefault && (ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_READY) {
+ if ((int)ioc->chip_type <= (int)FC929)
+ return 0;
+ else {
+ /* Workaround from broken 1030 FW.
+ * Force a diagnostic reset if fails.
+ */
+ if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag)) == 0)
+ return 0;
+ else
+ statefault = 4;
+ }
+ }
/*
* Check to see if IOC is in FAULT state.
else
ioc->upload_fw = 1;
}
+ ddlprintk((MYIOC_s_INFO_FMT "flags %d, upload_fw %d \n",
+ ioc->name, ioc_init.Flags, ioc->upload_fw));
if ((int)ioc->chip_type <= (int)FC929) {
ioc_init.MaxDevices = MPT_MAX_FC_DEVICES;
}
ioc->alloc_total += alloc_sz;
- dprintk((KERN_INFO MYNAM ": FW Image @ %p, sz=%d bytes\n",
+ ddlprintk((KERN_INFO MYNAM ": FW Image @ %p, sz=%d bytes\n",
(void *)(ulong)ioc->cached_fw, ioc->facts.FWImageSize));
prequest = (FWUpload_t *)&request;
cmdStatus = 0;
}
}
- dprintk((MYIOC_s_INFO_FMT ": do_upload status %d \n",
+ ddlprintk((MYIOC_s_INFO_FMT ": do_upload status %d \n",
ioc->name, cmdStatus));
/* Check to see if we have a copy of this image in
*/
if (cmdStatus || freeMem) {
- dprintk((MYIOC_s_INFO_FMT ": do_upload freeing %s image \n",
+ ddlprintk((MYIOC_s_INFO_FMT ": do_upload freeing %s image \n",
ioc->name, cmdStatus ? "incomplete" : "duplicate"));
mpt_free_fw_memory(ioc, NULL);
ioc->cached_fw = NULL;
int max_idx, fw_idx, ext_idx;
int left_u32s;
- dprintk((MYIOC_s_INFO_FMT "DbGb0: downloadboot entered.\n",
+ ddlprintk((MYIOC_s_INFO_FMT "DbGb0: downloadboot entered.\n",
ioc->name));
#ifdef MPT_DEBUG
diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
if (ioc->alt_ioc)
diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
- dprintk((MYIOC_s_INFO_FMT "DbGb1: diag0=%08x, diag1=%08x\n",
+ ddlprintk((MYIOC_s_INFO_FMT "DbGb1: diag0=%08x, diag1=%08x\n",
ioc->name, diag0val, diag1val));
#endif
- dprintk((MYIOC_s_INFO_FMT "fw size 0x%x, ioc FW Ptr %p\n",
+ ddlprintk((MYIOC_s_INFO_FMT "fw size 0x%x, ioc FW Ptr %p\n",
ioc->name, ioc->facts.FWImageSize, ioc->cached_fw));
if (ioc->alt_ioc)
- dprintk((MYIOC_s_INFO_FMT "alt ioc FW Ptr %p\n",
+ ddlprintk((MYIOC_s_INFO_FMT "alt ioc FW Ptr %p\n",
ioc->name, ioc->alt_ioc->cached_fw));
/* Get dma_addr and data transfer size.
return -1;
/* Get the DMA from ioc or ioc->alt_ioc */
- if (ioc->cached_fw == NULL)
+ if (ioc->cached_fw != NULL)
pCached = (fw_image_t **)ioc->cached_fw;
- else if (ioc->alt_ioc && ioc->alt_ioc->cached_fw)
+ else if (ioc->alt_ioc && (ioc->alt_ioc->cached_fw != NULL))
pCached = (fw_image_t **)ioc->alt_ioc->cached_fw;
- dprintk((MYIOC_s_INFO_FMT "DbGb2: FW Image @ %p\n",
- ioc->name, FwHdr));
+ ddlprintk((MYIOC_s_INFO_FMT "DbGb2: FW Image @ %p\n",
+ ioc->name, pCached));
if (!pCached)
return -2;
#ifdef MPT_DEBUG
if (ioc->alt_ioc)
diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
- dprintk((MYIOC_s_INFO_FMT "DbGb3: diag0=%08x, diag1=%08x\n",
+ ddlprintk((MYIOC_s_INFO_FMT "DbGb3: diag0=%08x, diag1=%08x\n",
ioc->name, diag0val, diag1val));
#endif
- dprintk((MYIOC_s_INFO_FMT "Wrote magic DiagWriteEn sequence (%x)\n",
+ ddlprintk((MYIOC_s_INFO_FMT "Wrote magic DiagWriteEn sequence (%x)\n",
ioc->name, diag0val));
}
#ifdef MPT_DEBUG
if (ioc->alt_ioc)
diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
- dprintk((MYIOC_s_INFO_FMT "DbGb3: diag0=%08x, diag1=%08x\n",
+
+ ddlprintk((MYIOC_s_INFO_FMT "DbGb3: diag0=%08x, diag1=%08x\n",
ioc->name, diag0val, diag1val));
#endif
- /* Write the LoadStartAddress to the DiagRw Address Register
- * using Programmed IO
- */
- CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, FwHdr->LoadStartAddress);
- dprintk((MYIOC_s_INFO_FMT "LoadStart addr written 0x%x \n",
- ioc->name, FwHdr->LoadStartAddress));
-#if 1
-
/* max_idx = 1 + maximum valid buffer index
*/
max_idx = 0;
count = (FwHdr->ImageSize + 3)/4;
nextImage = FwHdr->NextImageHeaderOffset;
- dprintk((MYIOC_s_INFO_FMT "Write FW Image: 0x%x u32's @ %p\n",
+ /* Write the LoadStartAddress to the DiagRw Address Register
+ * using Programmed IO
+ */
+ CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, FwHdr->LoadStartAddress);
+ ddlprintk((MYIOC_s_INFO_FMT "LoadStart addr written 0x%x \n",
+ ioc->name, FwHdr->LoadStartAddress));
+
+ ddlprintk((MYIOC_s_INFO_FMT "Write FW Image: 0x%x u32's @ %p\n",
ioc->name, count, ptru32));
left_u32s = pCached[fw_idx]->size/4;
while (count--) {
count = (count +3)/4;
}
- dprintk((MYIOC_s_INFO_FMT "Write Ext Image: 0x%x u32's @ %p\n",
+ ddlprintk((MYIOC_s_INFO_FMT "Write Ext Image: 0x%x u32's @ %p\n",
ioc->name, count, ptru32));
CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, load_addr);
}
}
-#else
- while (nextImage) {
-
- /* Set the pointer to the extended image
- */
- ExtHdr = (MpiExtImageHeader_t *) ((char *) FwHdr + nextImage);
-
- CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, ExtHdr->LoadStartAddress);
-
- count = (ExtHdr->ImageSize + 3 )/4;
-
- ptru32 = (u32 *) ExtHdr;
- dprintk((MYIOC_s_INFO_FMT "Write Ext Image: 0x%x u32's @ %p\n",
- ioc->name, count, ptru32));
- while (count-- ) {
- CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, *ptru32);
- ptru32++;
- }
- nextImage = ExtHdr->NextImageHeaderOffset;
- }
-#endif
-
-
/* Write the IopResetVectorRegAddr */
- dprintk((MYIOC_s_INFO_FMT "Write IopResetVector Addr! \n", ioc->name));
+ ddlprintk((MYIOC_s_INFO_FMT "Write IopResetVector Addr! \n", ioc->name));
CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, FwHdr->IopResetRegAddr);
/* Write the IopResetVectorValue */
- dprintk((MYIOC_s_INFO_FMT "Write IopResetVector Value! \n", ioc->name));
+ ddlprintk((MYIOC_s_INFO_FMT "Write IopResetVector Value! \n", ioc->name));
CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, FwHdr->IopResetVectorValue);
/* Clear the internal flash bad bit - autoincrementing register,
/* Write magic sequence to WriteSequence register
* Loop until in diagnostic mode
*/
+ CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF);
CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE);
CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE);
CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE);
ioc->name, diag0val, diag1val));
#endif
/* Write the PreventIocBoot bit */
+#if 1
+ if ((ioc->cached_fw) || (ioc->alt_ioc && ioc->alt_ioc->cached_fw)) {
+#else
if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) {
+#endif
diag0val |= MPI_DIAG_PREVENT_IOC_BOOT;
CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val);
}
/* FIXME? Examine results here? */
}
+#if 1
+ if ((ioc->cached_fw) || (ioc->alt_ioc && ioc->alt_ioc->cached_fw)) {
+#else
if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) {
+#endif
/* If the DownloadBoot operation fails, the
* IOC will be left unusable. This is a fatal error
* case. _diag_reset will return < 0
printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n",
rc, ioc->name);
}
+ ioc->reload_fw = 0;
+ if (ioc->alt_ioc)
+ ioc->alt_ioc->reload_fw = 0;
spin_lock_irqsave(&ioc->diagLock, flags);
ioc->diagPending = 0;
static void
mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info)
{
- /* FIXME! */
- printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x)\n", ioc->name, log_info);
+ u32 info = log_info & 0x00FF0000;
+ char *desc = "unknown";
+
+ switch (info) {
+ case 0x00010000:
+ desc = "bug! MID not found";
+ if (ioc->reload_fw == 0)
+ ioc->reload_fw++;
+ break;
+
+ case 0x00020000:
+ desc = "Parity Error";
+ break;
+
+ case 0x00030000:
+ desc = "ASYNC Outbound Overrun";
+ break;
+
+ case 0x00040000:
+ desc = "SYNC Offset Error";
+ break;
+
+ case 0x00050000:
+ desc = "BM Change";
+ break;
+
+ case 0x00060000:
+ desc = "Msg In Overflow";
+ break;
+
+ case 0x00070000:
+ desc = "DMA Error";
+ break;
+
+ case 0x00080000:
+ desc = "Outbound DMA Overrun";
+ break;
+ }
+
+ printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): F/W: %s\n", ioc->name, log_info, desc);
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
- * $Id: mptbase.h,v 1.123 2002/06/20 13:28:16 pdelaney Exp $
+ * $Id: mptbase.h,v 1.133 2002/09/05 22:30:09 pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
#define COPYRIGHT "Copyright (c) 1999-2002 " MODULEAUTHOR
#endif
-#define MPT_LINUX_VERSION_COMMON "2.01.06"
-#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.01.06"
+#define MPT_LINUX_VERSION_COMMON "2.02.01.01"
+#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.02.01.01"
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \
u8 maxWidth; /* 0 if narrow, 1 if wide*/
u8 negoFlags; /* bit field, 0 if WDTR/SDTR/QAS allowed */
u8 raidVolume; /* set, if RAID Volume */
+#ifdef ABORT_FIX
+ u8 numAborts;
+#else
u8 rsvd;
+#endif
u16 rsvd1raid;
int npaths;
u16 fc_phys_lun;
#define MPT_TARGET_FLAGS_VALID_INQUIRY 0x02
#define MPT_TARGET_FLAGS_VALID_SENSE 0x04
#define MPT_TARGET_FLAGS_Q_YES 0x08
+#define MPT_TARGET_FLAGS_VALID_56 0x10
#define MPT_TARGET_NO_NEGO_WIDE 0x01
#define MPT_TARGET_NO_NEGO_SYNC 0x02
#define MPT_SCSICFG_NEGOTIATE 0x01 /* Negotiate on next IO */
#define MPT_SCSICFG_NEED_DV 0x02 /* Schedule DV */
#define MPT_SCSICFG_DV_PENDING 0x04 /* DV on this physical id pending */
-#define MPT_SCSICFG_DV_DONE 0x08 /* DV on this physical id complete */
+#define MPT_SCSICFG_DV_NOT_DONE 0x08 /* DV has not been performed */
#define MPT_SCSICFG_BLK_NEGO 0x10 /* WriteSDP1 with WDTR and SDTR disabled */
/* Args passed to writeSDP1: */
LANPage1_t lan_cnfg_page1;
u8 FirstWhoInit;
u8 upload_fw; /* If set, do a fw upload */
- u8 pad1[6];
+ u8 reload_fw; /* Force a FW Reload on next reset */
+ u8 pad1[5];
} MPT_ADAPTER;
#define dsgprintk(x)
#endif
+#if defined(MPT_DEBUG_DL) || defined(MPT_DEBUG)
+#define ddlprintk(x) printk x
+#else
+#define ddlprintk(x)
+#endif
+
+
#ifdef MPT_DEBUG_DV
#define ddvprintk(x) printk x
#else
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
- * $Id: mptctl.c,v 1.55 2002/06/20 13:28:16 pdelaney Exp $
+ * $Id: mptctl.c,v 1.59 2002/09/05 22:30:10 pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
iocnumX = khdr.iocnum & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
(iocp == NULL)) {
- printk(KERN_ERR "%s::mptctl_ioctl() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnumX);
+ dtmprintk((KERN_ERR "%s::mptctl_ioctl() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnumX));
return -ENODEV;
}
}
if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) {
- printk(KERN_ERR "%s@%d::mptctl_do_reset - ioc%d not found!\n",
- __FILE__, __LINE__, krinfo.hdr.iocnum);
- return -ENXIO; /* (-6) No such device or address */
+ dtmprintk((KERN_ERR "%s@%d::mptctl_do_reset - ioc%d not found!\n",
+ __FILE__, __LINE__, krinfo.hdr.iocnum));
+ return -ENODEV; /* (-6) No such device or address */
}
if (mpt_HardResetHandler(iocp, NO_SLEEP) != 0) {
dctlprintk((KERN_INFO "DbG: kfwdl.ioc = %04xh\n", ioc));
if ((ioc = mpt_verify_adapter(ioc, &iocp)) < 0) {
- printk("%s@%d::_ioctl_fwdl - ioc%d not found!\n",
- __FILE__, __LINE__, ioc);
- return -ENXIO; /* (-6) No such device or address */
+ dtmprintk(("%s@%d::_ioctl_fwdl - ioc%d not found!\n",
+ __FILE__, __LINE__, ioc));
+ return -ENODEV; /* (-6) No such device or address */
}
/* Valid device. Get a message frame and construct the FW download message.
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_readtest() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_readtest() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_eventquery() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_eventquery() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_eventenable() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_eventenable() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_eventreport() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_eventreport() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_replace_fw() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_replace_fw() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_mpt_command() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_mpt_command() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (!ioc->ioctl) {
if (pTarget &&(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES))
qtag = MPI_SCSIIO_CONTROL_SIMPLEQ;
- else {
- rc = -EPERM;
- goto done_free_mem;
- }
/* Have the IOCTL driver set the direction based
* on the dataOutSize (ordering issue with Sparc).
this_sge++; /* go to next structure */
this_alloc = bufOut.len;
pci_free_consistent(ioc->pcidev,
- this_alloc, (void *) &bufOut, dma_addr);
+ this_alloc, (void *) bufOut.kptr, dma_addr);
}
if (bufIn.kptr != NULL ) {
this_alloc = bufIn.len;
pci_free_consistent(ioc->pcidev,
- this_alloc, (void *) &bufIn, dma_addr);
+ this_alloc, (void *) bufIn.kptr, dma_addr);
}
this_alloc = sgSize * sizeof(MptSge_t);
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
(iocp == NULL)) {
- printk(KERN_ERR "%s::mptctl_compaq_ioctl() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnumX);
+ dtmprintk((KERN_ERR "%s::mptctl_compaq_ioctl() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnumX));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_pciinfo() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_pciinfo() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_cpq_getdriver() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_cpq_getdriver() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_cpq_ctlr_status() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_cpq_ctlr_status() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_cpq_target_address() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_cpq_target_address() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
iocnumX = karg.lc & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR "%s::mptctl_cpq_passthru() @%d - ioc%d not found!\n",
- __FILE__, __LINE__, iocnum);
+ dtmprintk((KERN_ERR "%s::mptctl_cpq_passthru() @%d - ioc%d not found!\n",
+ __FILE__, __LINE__, iocnum));
return -ENODEV;
}
static struct file_operations mptctl_fops = {
owner_THIS_MODULE
- llseek: no_llseek,
- read: mptctl_read,
- write: mptctl_write,
- ioctl: mptctl_ioctl,
- open: mptctl_open,
- release: mptctl_release,
+ .llseek = no_llseek,
+ .read = mptctl_read,
+ .write = mptctl_write,
+ .ioctl = mptctl_ioctl,
+ .open = mptctl_open,
+ .release = mptctl_release,
};
static struct miscdevice mptctl_miscdev = {
iocnumX = kfw32.iocnum & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
(iocp == NULL)) {
- printk(KERN_ERR MYNAM "::sparc32_mptfwxfer_ioctl @%d - ioc%d not found!\n",
- __LINE__, iocnumX);
+ dtmprintk((KERN_ERR MYNAM "::sparc32_mptfwxfer_ioctl @%d - ioc%d not found!\n",
+ __LINE__, iocnumX));
return -ENODEV;
}
iocnumX = karg32.hdr.iocnum & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
(iocp == NULL)) {
- printk(KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n",
- __LINE__, iocnumX);
+ dtmprintk((KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n",
+ __LINE__, iocnumX));
return -ENODEV;
}
iocnumX = karg32.lc & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) {
- printk(KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n",
- __LINE__, iocnumX);
+ dtmprintk((KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n",
+ __LINE__, iocnumX));
return -ENODEV;
}
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
- * $Id: mptscsih.c,v 1.95 2002/06/20 13:28:17 pdelaney Exp $
+ * $Id: mptscsih.c,v 1.101 2002/09/05 22:30:11 pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
#define MPT_SCANDV_SENSE (0x00000002)
#define MPT_SCANDV_SOME_ERROR (0x00000004)
#define MPT_SCANDV_SELECTION_TIMEOUT (0x00000008)
+#define MPT_SCANDV_ISSUE_SENSE (0x00000010)
#define MPT_SCANDV_MAX_RETRIES (10)
static VirtDevice *mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen);
void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56);
static void clear_sense_flag(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq);
-static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq, char *data);
+static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq);
static void mptscsih_setDevicePage1Flags (u8 width, u8 factor, u8 offset, int *requestedPtr, int *configurationPtr, u8 flags);
static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id);
static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags);
static void mptscsih_domainValidation(void *hd);
static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id);
static void mptscsih_qas_check(MPT_SCSI_HOST *hd);
-static void mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int target);
+static int mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int target);
static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage);
static void mptscsih_fillbuf(char *buffer, int size, int index, int width);
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,28)
static struct proc_dir_entry proc_mpt_scsihost =
{
- low_ino: PROC_SCSI_MPT,
- namelen: 8,
- name: "mptscsih",
- mode: S_IFDIR | S_IRUGO | S_IXUGO,
- nlink: 2,
+ .low_ino = PROC_SCSI_MPT,
+ .namelen = 8,
+ .name = "mptscsih",
+ .mode = S_IFDIR | S_IRUGO | S_IXUGO,
+ .nlink = 2,
};
#endif
return 1;
}
- dmfprintk((MYIOC_s_INFO_FMT "ScsiDone (mf=%p,mr=%p,sc=%p)\n",
- ioc->name, mf, mr, sc));
+ dmfprintk((MYIOC_s_INFO_FMT "ScsiDone (mf=%p,mr=%p,sc=%p,idx=%d)\n",
+ ioc->name, mf, mr, sc, req_idx));
atomic_dec(&queue_depth);
}
}
clear_sense_flag(hd, pScsiReq);
-
- if (hd->is_spi)
- mptscsih_set_dvflags(hd, pScsiReq, sc->buffer);
} else {
u32 xfer_cnt;
u16 status;
sc->buffer,
xfer_cnt);
}
-
- if (hd->is_spi)
- mptscsih_set_dvflags(hd, pScsiReq, sc->buffer);
break;
case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */
sc->buffer,
xfer_cnt);
}
-
- if (hd->is_spi)
- mptscsih_set_dvflags(hd, pScsiReq, sc->buffer);
break;
case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */
dmfprintk(( "flush: ScsiDone (mf=%p,sc=%p)\n",
mf, SCpnt));
- /* Set status
+ /* Set status, free OS resources (SG DMA buffers)
* Do OS callback
- * Free chain buffers
- * Free message frame
+ * Free driver resources (chain, msg buffers)
*/
+ if (SCpnt->use_sg) {
+ pci_unmap_sg(hd->ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer,
+ SCpnt->use_sg, scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+ } else if (SCpnt->request_bufflen) {
+ scPrivate *my_priv;
+
+ my_priv = (scPrivate *) &SCpnt->SCp;
+ pci_unmap_single(hd->ioc->pcidev, (dma_addr_t)(ulong)my_priv->p1,
+ SCpnt->request_bufflen,
+ scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+ }
SCpnt->result = DID_RESET << 16;
SCpnt->host_scribble = NULL;
MPT_HOST_LOCK(flags);
mpt_free_msg_frame(ScsiDoneCtx, hd->ioc->id, mf);
}
}
+
return;
}
+#ifdef DROP_TEST
+/* mptscsih_flush_drop_test - Free resources and do callback if
+ * DROP_TEST enabled.
+ *
+ * @hd: Pointer to a SCSI HOST structure
+ *
+ * Returns: None.
+ *
+ * Must be called while new I/Os are being queued.
+ */
+static void
+mptscsih_flush_drop_test (MPT_SCSI_HOST *hd)
+{
+ Scsi_Cmnd *sc;
+ unsigned long flags;
+ u16 req_idx;
+
+ /* Free resources for the drop test MF
+ * and chain buffers.
+ */
+ if (dropMfPtr) {
+ req_idx = le16_to_cpu(dropMfPtr->u.frame.hwhdr.msgctxu.fld.req_idx);
+ sc = hd->ScsiLookup[req_idx];
+ if (sc == NULL) {
+ printk(MYIOC_s_ERR_FMT "Drop Test: NULL ScsiCmd ptr!\n",
+ ioc->name);
+ } else {
+ /* unmap OS resources, set status, do callback
+ * free driver resources
+ */
+ if (sc->use_sg) {
+ pci_unmap_sg(ioc->pcidev, (struct scatterlist *) sc->request_buffer,
+ sc->use_sg, scsi_to_pci_dma_dir(sc->sc_data_direction));
+ } else if (sc->request_bufflen) {
+ scPrivate *my_priv;
+
+ my_priv = (scPrivate *) &sc->SCp;
+ pci_unmap_single(ioc->pcidev, (dma_addr_t)(ulong)my_priv->p1,
+ sc->request_bufflen,
+ scsi_to_pci_dma_dir(sc->sc_data_direction));
+ }
+
+ sc->host_scribble = NULL;
+ sc->result = DID_RESET << 16;
+ hd->ScsiLookup[req_idx] = NULL;
+ atomic_dec(&queue_depth);
+ MPT_HOST_LOCK(flags);
+ sc->scsi_done(sc); /* Issue callback */
+ MPT_HOST_UNLOCK(flags);
+ }
+
+ mptscsih_freeChainBuffers(hd, req_idx);
+ mpt_free_msg_frame(ScsiDoneCtx, ioc->id, dropMfPtr);
+ printk(MYIOC_s_INFO_FMT "Free'd Dropped cmd (%p)\n",
+ hd->ioc->name, sc);
+ printk(MYIOC_s_INFO_FMT "mf (%p) reqidx (%4x)\n",
+ hd->ioc->name, dropMfPtr, req_idx);
+ printk(MYIOC_s_INFO_FMT "Num Tot (%d) Good (%d) Bad (%d) \n",
+ hd->ioc->name, dropTestNum,
+ dropTestOK, dropTestBad);
+ }
+ dropMfPtr = NULL;
+
+ return;
+}
+#endif
+
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* mptscsih_initChainBuffers - Allocate memory for and initialize
#endif
sh = scsi_register(tpnt, sizeof(MPT_SCSI_HOST));
if (sh != NULL) {
- save_flags(flags);
- cli();
+ mptscsih_save_flags(flags);
sh->io_port = 0;
sh->n_io_port = 0;
sh->irq = 0;
*/
scsi_set_pci_device(sh, this->pcidev);
- restore_flags(flags);
+ mptscsih_restore_flags(flags);
hd = (MPT_SCSI_HOST *) sh->hostdata;
hd->ioc = this;
hd->ioc->spi_data.forceDv = 0;
for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
hd->ioc->spi_data.dvStatus[ii] = MPT_SCSICFG_NEGOTIATE;
-
+
+ if (hd->negoNvram == 0) {
+ for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
+ hd->ioc->spi_data.dvStatus[ii] |= MPT_SCSICFG_DV_NOT_DONE;
+ }
ddvprintk((MYIOC_s_INFO_FMT
"dv %x width %x factor %x \n",
if (hd != NULL) {
int sz1, sz2, sz3, sztarget=0;
+ int szr2chain = 0;
+ int szc2chain = 0;
int szchain = 0;
int szQ = 0;
int scale;
}
if (hd->ReqToChain != NULL) {
- szchain += scale * hd->ioc->req_depth * sizeof(int);
+ szr2chain = scale * hd->ioc->req_depth * sizeof(int);
kfree(hd->ReqToChain);
hd->ReqToChain = NULL;
}
if (hd->ChainToChain != NULL) {
- szchain += scale * hd->ioc->req_depth * sizeof(int);
+ szc2chain = scale * hd->ioc->req_depth * sizeof(int);
kfree(hd->ChainToChain);
hd->ChainToChain = NULL;
}
if (hd->ChainBuffer != NULL) {
sz2 = scale * hd->ioc->req_depth * hd->ioc->req_sz;
- szchain += sz2;
+ szchain = szr2chain + szc2chain + sz2;
pci_free_consistent(hd->ioc->pcidev, sz2,
hd->ChainBuffer, hd->ChainBufferDMA);
mod_timer(&SCpnt->eh_timeout, jiffies + 40 * HZ);
issueCmd = 0;
}
+
+ /* Set the DV flags.
+ */
+ if (dvStatus & MPT_SCSICFG_DV_NOT_DONE)
+ mptscsih_set_dvflags(hd, pScsiReq);
#endif
}
}
if (issueCmd) {
mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf);
- dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p)\n",
- hd->ioc->name, SCpnt));
+ dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n",
+ hd->ioc->name, SCpnt, mf, my_idx));
} else {
- ddvtprintk((MYIOC_s_INFO_FMT "Pending SCSI cmd (%p)\n",
- hd->ioc->name, SCpnt));
+ ddvtprintk((MYIOC_s_INFO_FMT "Pending cmd=%p idx %d\n",
+ hd->ioc->name, SCpnt, my_idx));
/* Place this command on the pendingQ if possible */
spin_lock_irqsave(&hd->freedoneQlock, flags);
if (!Q_IS_EMPTY(&hd->freeQ)) {
}
#endif
- if (rc) {
+ if (rc || ioc->reload_fw || (ioc->alt_ioc && ioc->alt_ioc->reload_fw)) {
dtmprintk((MYIOC_s_INFO_FMT "Falling through to HardReset! \n",
hd->ioc->name));
rc = mpt_HardResetHandler(hd->ioc, sleepFlag);
}
#ifdef DROP_TEST
- {
- Scsi_Cmnd *sc;
- unsigned long flags;
- u16 req_idx;
-
- /* Free resources for the drop test MF and chain buffers.
- */
- if (dropMfPtr) {
- req_idx = le16_to_cpu(dropMfPtr->u.frame.hwhdr.msgctxu.fld.req_idx);
- sc = hd->ScsiLookup[req_idx];
- if (sc == NULL) {
- printk(MYIOC_s_ERR_FMT
- "Drop Test: NULL ScsiCmd ptr!\n",
- ioc->name);
- } else {
- sc->host_scribble = NULL;
- if (tmType == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS)
- sc->result = DID_RESET << 16;
- else
- sc->result = DID_ABORT << 16;
-
- hd->ScsiLookup[req_idx] = NULL;
- atomic_dec(&queue_depth);
- MPT_HOST_LOCK(flags);
- sc->scsi_done(sc); /* Issue callback */
- MPT_HOST_UNLOCK(flags);
-
- mptscsih_freeChainBuffers(hd, req_idx);
- mpt_free_msg_frame(ScsiDoneCtx, ioc->id, dropMfPtr);
-
- printk(MYIOC_s_INFO_FMT
- "Free'd Dropped cmd (%p)\n",
- hd->ioc->name, sc);
- printk(MYIOC_s_INFO_FMT
- "mf (%p) reqidx (%4x)\n",
- hd->ioc->name, dropMfPtr,
- req_idx);
- printk(MYIOC_s_INFO_FMT
- "Num Tot (%d) Good (%d) Bad (%d) \n",
- hd->ioc->name, dropTestNum,
- dropTestOK, dropTestBad);
- }
- dropMfPtr = NULL;
- }
- }
+ mptscsih_flush_drop_test(hd);
#endif
#ifndef MPT_SCSI_USE_NEW_EH
/*
* This is anyones guess quite frankly.
*/
-
int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28)
mptscsih_bios_param(Disk * disk, struct block_device *dev, int *ip)
+#else
+mptscsih_bios_param(Disk * disk, kdev_t dev, int *ip)
+#endif
{
int size;
* 0 = _DIR_NONE changed to SCSI_DATA_NONE (3)
* -1 = _DATA_IN changed to SCSI_DATA_READ (2)
* If the direction is unknown, fall through to original code.
+ *
+ * Mid-layer bug fix(): sg interface generates the wrong data
+ * direction in some cases. Set the direction the hard way for
+ * the most common commands.
*/
static int
mptscsih_io_direction(Scsi_Cmnd *cmd)
{
+ switch (cmd->cmnd[0]) {
+ case WRITE_6:
+ case WRITE_10:
+ return SCSI_DATA_WRITE;
+ break;
+ case READ_6:
+ case READ_10:
+ return SCSI_DATA_READ;
+ break;
+ }
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
if (cmd->sc_data_direction != SCSI_DATA_UNKNOWN)
return cmd->sc_data_direction;
sz = SCSI_STD_SENSE_BYTES;
memcpy(target->sense, sense_data, sz);
target->tflags |= MPT_TARGET_FLAGS_VALID_SENSE;
+
+#ifdef ABORT_FIX
+ if (sz >= SCSI_STD_SENSE_BYTES) {
+ if ((sense_data[02] == ABORTED_COMMAND) &&
+ (sense_data[12] == 0x47) && (sense_data[13] == 0x00)){
+ target->numAborts++;
+ if ((target->raidVolume == 0) && (target->numAborts > 5)) {
+ target->numAborts = 0;
+ target->minSyncFactor++;
+ hd->ioc->spi_data.dvStatus[index] |= MPT_SCSICFG_NEGOTIATE;
+ }
+ }
+ }
+#endif
}
/* Log SMART data (asc = 0x5D, non-IM case only) if required.
MPT_FRAME_HDR *mf = NULL;
MPT_FRAME_HDR *cmdMfPtr = NULL;
- ddvtprintk((MYIOC_s_INFO_FMT ": search_pendingQ called...", hd->ioc->name));
+ ddvtprintk((MYIOC_s_INFO_FMT ": search_pendingQ ...", hd->ioc->name));
cmdMfPtr = MPT_INDEX_2_MFPTR(hd->ioc, scpnt_idx);
spin_lock_irqsave(&hd->freedoneQlock, flags);
if (!Q_IS_EMPTY(&hd->pendingQ)) {
/* Flush the pendingQ.
*/
- ddvtprintk((MYIOC_s_INFO_FMT ": post_pendingQ_commands called\n", hd->ioc->name));
+ ddvtprintk((MYIOC_s_INFO_FMT ": post_pendingQ_commands\n", hd->ioc->name));
while (1) {
spin_lock_irqsave(&hd->freedoneQlock, flags);
if (Q_IS_EMPTY(&hd->pendingQ)) {
}
mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf);
- ddvtprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (mf=%p)\n",
- hd->ioc->name, mf));
+
+#if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY)
+ {
+ u16 req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
+ Scsi_Cmnd *sc = hd->ScsiLookup[req_idx];
+ printk(MYIOC_s_INFO_FMT "Issued SCSI cmd (sc=%p) idx=%d (mf=%p)\n",
+ hd->ioc->name, sc, req_idx, mf);
+ }
+#endif
}
return;
/* 2a. Drop Test Command.
*/
#ifdef DROP_TEST
- {
- Scsi_Cmnd *sc;
- unsigned long flags;
- u16 req_idx;
-
- /* Free resources for the drop test MF
- * and chain buffers.
- */
- if (dropMfPtr) {
- req_idx = le16_to_cpu(dropMfPtr->u.frame.hwhdr.msgctxu.fld.req_idx);
- sc = hd->ScsiLookup[req_idx];
- if (sc == NULL) {
- printk(MYIOC_s_ERR_FMT
- "Drop Test: NULL ScsiCmd ptr!\n",
- ioc->name);
- } else {
- sc->host_scribble = NULL;
- sc->result = DID_RESET << 16;
- hd->ScsiLookup[req_idx] = NULL;
- atomic_dec(&queue_depth);
- MPT_HOST_LOCK(flags);
- sc->scsi_done(sc); /* Issue callback */
- MPT_HOST_UNLOCK(flags);
- }
-
- mptscsih_freeChainBuffers(hd, req_idx);
- mpt_free_msg_frame(ScsiDoneCtx, ioc->id, dropMfPtr);
- printk(MYIOC_s_INFO_FMT
- "Free'd: mf (%p) reqidx (%4x)\n",
- hd->ioc->name, dropMfPtr,
- req_idx);
- }
- dropMfPtr = NULL;
- }
+ mptscsih_flush_drop_test(hd);
#endif
/* 2b. Reply to OS all known outstanding I/O commands.
while (numPDisk) {
if (physDiskNum == pPDisk->PhysDiskNum) {
- pSpi->dvStatus[pPDisk->PhysDiskID] = MPT_SCSICFG_NEED_DV;
+ pSpi->dvStatus[pPDisk->PhysDiskID] = (MPT_SCSICFG_NEED_DV | MPT_SCSICFG_DV_NOT_DONE);
pSpi->forceDv = MPT_SCSICFG_NEED_DV;
ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID));
break;
return 0;
}
+ /* Prevent the system from continually writing to the log
+ * if a medium is not found: 02 3A 00
+ * Changer issues: TUR, Read Capacity, Table of Contents continually
+ */
+ if (sk==SK_NOT_READY && asc==0x3A) {
+ if (ioop->cdbPtr == NULL) {
+ return 0;
+ } else if ((ioop->cdbPtr[0] == CMD_TestUnitReady) ||
+ (ioop->cdbPtr[0] == CMD_ReadCapacity) ||
+ (ioop->cdbPtr[0] == 0x43)) {
+ return 0;
+ }
+ }
+ if (sk==SK_UNIT_ATTENTION) {
+ if (ioop->cdbPtr == NULL)
+ return 0;
+ else if (ioop->cdbPtr[0] == CMD_TestUnitReady)
+ return 0;
+ }
+
/*
* Protect ourselves...
*/
}
if (vdev && data) {
- if (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) {
+ if ((!(vdev->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) ||
+ ((dlen > 56) && (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56)))) {
/* Copy the inquiry data - if we haven't yet.
*/
/* Update the target capabilities
*/
- if (dlen > 56)
+ if (dlen > 56) {
mptscsih_setTargetNegoParms(hd, vdev, data[56]);
- else
+ vdev->tflags |= MPT_TARGET_FLAGS_VALID_56;
+ } else
mptscsih_setTargetNegoParms(hd, vdev, 0);
+
+ /* If LUN 0, tape and have not done DV, set the DV flag.
+ */
+ if ((lun == 0) && ((data[0] & 0x1F) == 0x01)) {
+ ScsiCfgData *pSpi = &hd->ioc->spi_data;
+ if (pSpi->dvStatus[target_id] & MPT_SCSICFG_DV_NOT_DONE)
+ pSpi->dvStatus[target_id] |= MPT_SCSICFG_NEED_DV;
+ }
}
/* Is LUN supported? If so, upper 3 bits will be 0
/* Set flags based on Inquiry data
*/
if (target->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) {
- version = target->inq_data[2] & 0x03;
+ version = target->inq_data[2] & 0x07;
if (version < 2) {
width = 0;
factor = MPT_ULTRA2;
return;
}
-/*
- * If DV disabled (negoNvram set to USE_NVARM) or if not LUN 0, return.
+/* If DV disabled (negoNvram set to USE_NVARM) or if not LUN 0, return.
* Else set the NEED_DV flag after Read Capacity Issued (disks)
- * or Mode Sense (cdroms). Tapes, key off of Inquiry command.
+ * or Mode Sense (cdroms).
+ *
+ * Tapes, initTarget will set this flag on completion of Inquiry command.
+ * Called only if DV_NOT_DONE flag is set
*/
-static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq, char *data)
+static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq)
{
- u8 cmd = pReq->CDB[0];
+ u8 cmd;
- if (pReq->LUN[1] != 0)
+ if ((pReq->LUN[1] != 0) || (hd->negoNvram != 0))
return;
- if (hd->negoNvram != 0)
- return;
+ cmd = pReq->CDB[0];
- if ((cmd == READ_CAPACITY) || (cmd == MODE_SENSE) ||
- ((cmd == INQUIRY) && ((data[0] & 0x1F) == 0x01))) {
- u8 dvStatus = hd->ioc->spi_data.dvStatus[pReq->TargetID];
- if (!(dvStatus & MPT_SCSICFG_DV_DONE)) {
- ScsiCfgData *pSpi = &hd->ioc->spi_data;
- if ((pSpi->isRaid & (1 << pReq->TargetID)) && pSpi->pIocPg3) {
- /* Set NEED_DV for all hidden disks
- */
- Ioc3PhysDisk_t *pPDisk = pSpi->pIocPg3->PhysDisk;
- int numPDisk = pSpi->pIocPg3->NumPhysDisks;
-
- while (numPDisk) {
- pSpi->dvStatus[pPDisk->PhysDiskID] |= MPT_SCSICFG_NEED_DV;
- ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID));
- pPDisk++;
- numPDisk--;
- }
+ if ((cmd == READ_CAPACITY) || (cmd == MODE_SENSE)) {
+ ScsiCfgData *pSpi = &hd->ioc->spi_data;
+ if ((pSpi->isRaid & (1 << pReq->TargetID)) && pSpi->pIocPg3) {
+ /* Set NEED_DV for all hidden disks
+ */
+ Ioc3PhysDisk_t *pPDisk = pSpi->pIocPg3->PhysDisk;
+ int numPDisk = pSpi->pIocPg3->NumPhysDisks;
+
+ while (numPDisk) {
+ pSpi->dvStatus[pPDisk->PhysDiskID] |= MPT_SCSICFG_NEED_DV;
+ ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID));
+ pPDisk++;
+ numPDisk--;
}
- pSpi->dvStatus[pReq->TargetID] |= MPT_SCSICFG_NEED_DV;
- ddvtprintk(("NEED_DV set for visible disk id %d\n",
- pReq->TargetID));
- };
+ }
+ pSpi->dvStatus[pReq->TargetID] |= MPT_SCSICFG_NEED_DV;
+ ddvtprintk(("NEED_DV set for visible disk id %d\n", pReq->TargetID));
}
}
u8 offset;
u8 bus = 0;
u8 negoFlags;
+ u8 maxwidth, maxoffset, maxfactor;
if (ioc->spi_data.sdp1length == 0)
return 0;
}
for (; id <= maxid; id++) {
+
if (id == ioc->pfacts[portnum].PortSCSIID)
continue;
- if (flags & MPT_SCSICFG_USE_NVRAM) {
- /* Use NVRAM, adapter maximums and target settings.
- * Data over-riden by target structure information, if present
- */
- width = ioc->spi_data.maxBusWidth;
- offset = ioc->spi_data.maxSyncOffset;
- factor = ioc->spi_data.minSyncFactor;
- if (ioc->spi_data.nvram && (ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) {
- nvram = ioc->spi_data.nvram[id];
-
- if (width)
- width = nvram & MPT_NVRAM_WIDE_DISABLE ? 0 : 1;
-
- if (offset > 0) {
- factor = (nvram & MPT_NVRAM_SYNC_MASK) >> 8;
- if (factor == 0) {
- /* Key for async */
- factor = MPT_ASYNC;
- offset = 0;
- } else if (factor < ioc->spi_data.minSyncFactor) {
- factor = ioc->spi_data.minSyncFactor;
- }
- } else
- factor = MPT_ASYNC;
- }
+ /* Use NVRAM to get adapter and target maximums
+ * Data over-riden by target structure information, if present
+ */
+ maxwidth = ioc->spi_data.maxBusWidth;
+ maxoffset = ioc->spi_data.maxSyncOffset;
+ maxfactor = ioc->spi_data.minSyncFactor;
+ if (ioc->spi_data.nvram && (ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) {
+ nvram = ioc->spi_data.nvram[id];
+
+ if (maxwidth)
+ maxwidth = nvram & MPT_NVRAM_WIDE_DISABLE ? 0 : 1;
+
+ if (maxoffset > 0) {
+ maxfactor = (nvram & MPT_NVRAM_SYNC_MASK) >> 8;
+ if (maxfactor == 0) {
+ /* Key for async */
+ maxfactor = MPT_ASYNC;
+ maxoffset = 0;
+ } else if (maxfactor < ioc->spi_data.minSyncFactor) {
+ maxfactor = ioc->spi_data.minSyncFactor;
+ }
+ } else
+ maxfactor = MPT_ASYNC;
+ }
- /* Set the negotiation flags.
- */
- negoFlags = ioc->spi_data.noQas;
- if (!width)
- negoFlags |= MPT_TARGET_NO_NEGO_WIDE;
-
- if (!offset)
- negoFlags |= MPT_TARGET_NO_NEGO_SYNC;
+ /* Set the negotiation flags.
+ */
+ negoFlags = ioc->spi_data.noQas;
+ if (!maxwidth)
+ negoFlags |= MPT_TARGET_NO_NEGO_WIDE;
+
+ if (!maxoffset)
+ negoFlags |= MPT_TARGET_NO_NEGO_SYNC;
+
+ if (flags & MPT_SCSICFG_USE_NVRAM) {
+ width = maxwidth;
+ factor = maxfactor;
+ offset = maxoffset;
} else {
width = 0;
factor = MPT_ASYNC;
offset = 0;
- negoFlags = MPT_TARGET_NO_NEGO_SYNC;
+ //negoFlags = 0;
+ //negoFlags = MPT_TARGET_NO_NEGO_SYNC;
}
/* If id is not a raid volume, get the updated
if (flags & MPT_SCSICFG_BLK_NEGO)
negoFlags = MPT_TARGET_NO_NEGO_WIDE | MPT_TARGET_NO_NEGO_SYNC;
- /* REMOVE - can this be removed without problems?????
- else if (negoFlags == (MPT_TARGET_NO_NEGO_WIDE | MPT_TARGET_NO_NEGO_SYNC))
- continue;
- */
-
mptscsih_setDevicePage1Flags(width, factor, offset,
&requested, &configuration, negoFlags);
-
/* Get a MF for this command.
*/
if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc->id)) == NULL) {
return -EAGAIN;
}
+ ddvprintk((MYIOC_s_INFO_FMT "WriteSDP1 (mf=%p, id=%d, req=0x%x, cfg=0x%x)\n",
+ hd->ioc->name, mf, id, requested, configuration));
+
+
/* Set the request and the data pointers.
* Request takes: 36 bytes (32 bit SGE)
* SCSI Device Page 1 requires 16 bytes
*
* Remark: Sets a completion code and (possibly) saves sense data
* in the IOC member localReply structure.
- * Used ONLY for bus scan, DV and other internal commands.
+ * Used ONLY for DV and other internal commands.
*/
static int
mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
pReq = (SCSIIORequest_t *) mf;
if (mf != hd->cmdPtr) {
- printk(MYIOC_s_WARN_FMT "ScanDvComplete (mf=%p, cmdPtr=%p)\n",
- hd->ioc->name, (void *)mf, (void *) hd->cmdPtr);
+ printk(MYIOC_s_WARN_FMT "ScanDvComplete (mf=%p, cmdPtr=%p, idx=%d)\n",
+ hd->ioc->name, (void *)mf, (void *) hd->cmdPtr, req_idx);
}
hd->cmdPtr = NULL;
- ddvprintk((MYIOC_s_INFO_FMT "ScanDvComplete (mf=%p,mr=%p)\n",
- hd->ioc->name, mf, mr));
+ ddvprintk((MYIOC_s_INFO_FMT "ScanDvComplete (mf=%p,mr=%p,idx=%d)\n",
+ hd->ioc->name, mf, mr, req_idx));
atomic_dec(&queue_depth);
hd->pLocal = &hd->localReply;
+ hd->pLocal->scsiStatus = 0;
/* If target struct exists, clear sense valid flag.
*/
status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK;
- ddvprintk((KERN_NOTICE " IOCStatus=%04xh, SCSIState=%02xh, SCSIStatus=%02xh, IOCLogInfo=%08xh\n",
+ ddvtprintk((KERN_NOTICE " IOCStatus=%04xh, SCSIState=%02xh, SCSIStatus=%02xh, IOCLogInfo=%08xh\n",
status, pReply->SCSIState, pReply->SCSIStatus,
le32_to_cpu(pReply->IOCLogInfo)));
ddvprintk((KERN_NOTICE " Check Condition, sense ptr %p\n",
sense_data));
- } else if (pReply->SCSIState & (MPI_SCSI_STATE_AUTOSENSE_FAILED |
- MPI_SCSI_STATE_NO_SCSI_STATUS)) {
+ } else if (pReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_FAILED) {
+ if (pReq->CDB[0] == CMD_Inquiry)
+ completionCode = MPT_SCANDV_ISSUE_SENSE;
+ else
+ completionCode = MPT_SCANDV_DID_RESET;
+ }
+ else if (pReply->SCSIState & MPI_SCSI_STATE_NO_SCSI_STATUS)
completionCode = MPT_SCANDV_DID_RESET;
- } else if (pReply->SCSIState & MPI_SCSI_STATE_TERMINATED) {
+ else if (pReply->SCSIState & MPI_SCSI_STATE_TERMINATED)
completionCode = MPT_SCANDV_DID_RESET;
- } else {
+ else {
/* If no error, this will be equivalent
* to MPT_SCANDV_GOOD
*/
- completionCode = (int) pReply->SCSIStatus;
+ completionCode = MPT_SCANDV_GOOD;
+ hd->pLocal->scsiStatus = pReply->SCSIStatus;
}
break;
} /* switch(status) */
- ddvprintk((KERN_NOTICE " completionCode set to %08xh\n",
+ ddvtprintk((KERN_NOTICE " completionCode set to %08xh\n",
completionCode));
} /* end of address reply case */
cmdTimeout = 15;
break;
+ case CMD_RequestSense:
+ cmdLen = 6;
+ CDB[0] = cmd;
+ CDB[4] = io->size;
+ dir = MPI_SCSIIO_CONTROL_READ;
+ cmdTimeout = 10;
+ break;
+
case CMD_ReadBuffer:
cmdLen = 10;
dir = MPI_SCSIIO_CONTROL_READ;
/* If target Ptr NULL or if this target is NOT a disk, skip.
*/
// if (pTarget && ((pTarget->inq_data[0] & 0x1F) == 0)) {
- if (pTarget) {
+ if ((pTarget) && (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)){
for (lun=0; lun <= MPT_LAST_LUN; lun++) {
/* If LUN present, issue the command
*/
unsigned long flags;
int id, maxid, dvStatus, did;
int ii, isPhysDisk;
- u8 oldQas;
spin_lock_irqsave(&dvtaskQ_lock, flags);
dvtaskQ_active = 1;
maxid = MIN (ioc->sh->max_id, MPT_MAX_SCSI_DEVICES);
for (id = 0; id < maxid; id++) {
- oldQas = hd->ioc->spi_data.noQas;
spin_lock_irqsave(&dvtaskQ_lock, flags);
if (dvtaskQ_release) {
dvtaskQ_active = 0;
dvStatus = hd->ioc->spi_data.dvStatus[id];
if (dvStatus & MPT_SCSICFG_NEED_DV) {
-
+ did++;
hd->ioc->spi_data.dvStatus[id] |= MPT_SCSICFG_DV_PENDING;
hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_NEED_DV;
}
}
- mptscsih_doDv(hd, 0, id);
- did++;
- hd->ioc->spi_data.dvStatus[id] |= MPT_SCSICFG_DV_DONE;
- hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_DV_PENDING;
+ if (mptscsih_doDv(hd, 0, id) == 1) {
+ /* Untagged device was busy, try again
+ */
+ hd->ioc->spi_data.dvStatus[id] |= MPT_SCSICFG_NEED_DV;
+ hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_DV_PENDING;
+ } else {
+ /* DV is complete. Clear flags.
+ */
+ hd->ioc->spi_data.dvStatus[id] &= ~(MPT_SCSICFG_DV_NOT_DONE | MPT_SCSICFG_DV_PENDING);
+ }
if (isPhysDisk) {
for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
*/
post_pendingQ_commands(hd);
- if ((!oldQas) && (hd->ioc->spi_data.noQas))
+ if (hd->ioc->spi_data.noQas)
mptscsih_qas_check(hd);
}
}
{
VirtDevice *pTarget = NULL;
int ii;
- int change = 0;
if (hd->Targets == NULL)
return;
for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
- change = 0;
+ if ((hd->ioc->spi_data.dvStatus[ii] & MPT_SCSICFG_DV_NOT_DONE) != 0)
+ continue;
+
pTarget = hd->Targets[ii];
if ((pTarget != NULL) && (!pTarget->raidVolume)) {
if ((pTarget->negoFlags & hd->ioc->spi_data.noQas) == 0) {
- change = 1;
pTarget->negoFlags |= hd->ioc->spi_data.noQas;
+ mptscsih_writeSDP1(hd, 0, ii, 0);
}
} else {
if (mptscsih_is_phys_disk(hd->ioc, ii) == 1)
- change = 1;
+ mptscsih_writeSDP1(hd, 0, ii, MPT_SCSICFG_USE_NVRAM);
}
-
- if ((change) && (hd->ioc->spi_data.dvStatus[ii] & MPT_SCSICFG_DV_DONE))
- mptscsih_writeSDP1(hd, 0, ii, 0);
}
return;
}
*
* Return: None.
*/
-static void
+static int
mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
{
MPT_ADAPTER *ioc = hd->ioc;
int notDone;
int patt;
int repeat;
+ int retcode = 0;
char firstPass = 1;
char doFallback = 0;
char readPage0;
char inq0 = 0;
if (ioc->spi_data.sdp1length == 0)
- return;
+ return 0;
if (ioc->spi_data.sdp0length == 0)
- return;
+ return 0;
if (id == ioc->pfacts[portnum].PortSCSIID)
- return;
+ return 0;
lun = 0;
bus = 0;
dv.cmd = MPT_GET_NVRAM_VALS;
mptscsih_dv_parms(hd, &dv, NULL);
if ((!dv.max.width) && (!dv.max.offset))
- return;
+ return 0;
/* Prep SCSI IO structure
*/
iocmd.physDiskNum = -1;
iocmd.rsvd = iocmd.rsvd2 = 0;
- /* Use tagged commands if possible.
- */
pTarget = hd->Targets[id];
- if (pTarget && (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES))
- iocmd.flags |= MPT_ICFLAG_TAGGED_CMD;
-
if (pTarget && (pTarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) {
/* Another GEM workaround. Check peripheral device type,
* if PROCESSOR, quit DV.
*/
if (((pTarget->inq_data[0] & 0x1F) == 0x03) || ((pTarget->inq_data[0] & 0x1F) > 0x08)) {
pTarget->negoFlags |= (MPT_TARGET_NO_NEGO_WIDE | MPT_TARGET_NO_NEGO_SYNC);
- return;
+ return 0;
+ }
+ }
+
+ /* Use tagged commands if possible.
+ */
+ if (pTarget) {
+ if (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)
+ iocmd.flags |= MPT_ICFLAG_TAGGED_CMD;
+ else {
+ if (hd->ioc->facts.FWVersion.Word < 0x01000600)
+ return 0;
+
+ if ((hd->ioc->facts.FWVersion.Word >= 0x01010000) &&
+ (hd->ioc->facts.FWVersion.Word < 0x01010B00))
+ return 0;
}
}
pDvBuf = pci_alloc_consistent(ioc->pcidev, dv_alloc, &dvbuf_dma);
if (pDvBuf == NULL)
- return;
+ return 0;
sz = 0;
pbuf1 = (u8 *)pDvBuf;
hd->pLocal = NULL;
readPage0 = 0;
sz = SCSI_STD_INQUIRY_BYTES;
+ rc = MPT_SCANDV_GOOD;
while (1) {
ddvprintk((MYIOC_s_NOTE_FMT "DV: Start Basic test.\n", ioc->name));
+ retcode = 0;
dv.cmd = MPT_SET_MIN;
mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data);
if (mpt_config(hd->ioc, &cfg) != 0)
goto target_done;
+ /* Wide - narrow - wide workaround case
+ */
+ if ((rc == MPT_SCANDV_ISSUE_SENSE) && dv.max.width) {
+ /* Send an untagged command to reset disk Qs corrupted
+ * when a parity error occurs on a Request Sense.
+ */
+ if ((hd->ioc->facts.FWVersion.Word >= 0x01000600) ||
+ ((hd->ioc->facts.FWVersion.Word >= 0x01010000) &&
+ (hd->ioc->facts.FWVersion.Word < 0x01010B00)) ) {
+
+ iocmd.cmd = CMD_RequestSense;
+ iocmd.data_dma = buf1_dma;
+ iocmd.data = pbuf1;
+ iocmd.size = 0x12;
+ if (mptscsih_do_cmd(hd, &iocmd) < 0)
+ goto target_done;
+ else {
+ if (hd->pLocal == NULL)
+ goto target_done;
+ rc = hd->pLocal->completion;
+ if ((rc == MPT_SCANDV_GOOD) || (rc == MPT_SCANDV_SENSE)) {
+ dv.max.width = 0;
+ } else
+ goto target_done;
+ }
+ } else
+ goto target_done;
+ }
+
iocmd.cmd = CMD_Inquiry;
iocmd.data_dma = buf1_dma;
iocmd.data = pbuf1;
iocmd.size = sz;
if (mptscsih_do_cmd(hd, &iocmd) < 0)
goto target_done;
+ else {
+ if (hd->pLocal == NULL)
+ goto target_done;
+ rc = hd->pLocal->completion;
+ if (rc == MPT_SCANDV_GOOD) {
+ if (hd->pLocal->scsiStatus == STS_BUSY) {
+ retcode = 1;
+ goto target_done;
+ }
+ } else if (rc == MPT_SCANDV_SENSE) {
+ ;
+ } else {
+ /* If first command doesn't complete
+ * with a good status or with a check condition,
+ * exit.
+ */
+ goto target_done;
+ }
+ }
/* Another GEM workaround. Check peripheral device type,
* if PROCESSOR, quit DV.
cfg.physAddr = cfg0_dma_addr;
cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
cfg.dir = 0;
+
if (mpt_config(hd->ioc, &cfg) != 0)
goto target_done;
}
- } else if ((rc == MPT_SCANDV_DID_RESET) || (rc == MPT_SCANDV_SENSE))
+ } else if (rc == MPT_SCANDV_ISSUE_SENSE)
+ doFallback = 1; /* set fallback flag */
+ else if ((rc == MPT_SCANDV_DID_RESET) || (rc == MPT_SCANDV_SENSE))
doFallback = 1; /* set fallback flag */
else
goto target_done;
/* Set if cfg1_dma_addr contents is valid
*/
- if (cfg.hdr != NULL) {
-
+ if ((cfg.hdr != NULL) && (retcode == 0)){
/* If disk, not U320, disable QAS
*/
if ((inq0 == 0) && (dv.now.factor > MPT_ULTRA320))
ddvtprintk((MYIOC_s_INFO_FMT "DV Done. IOs outstanding = %d\n",
ioc->name, atomic_read(&queue_depth)));
- return;
+ return retcode;
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
extern int x_scsi_old_abort(Scsi_Cmnd *);
extern int x_scsi_old_reset(Scsi_Cmnd *, unsigned int);
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28)
extern int x_scsi_bios_param(Disk *, struct block_device *, int *);
+#else
+extern int x_scsi_bios_param(Disk *, kdev_t, int *);
+#endif
extern void x_scsi_select_queue_depths(struct Scsi_Host *, Scsi_Device *);
extern void x_scsi_taskmgmt_bh(void *);