Commit 05862384 authored by Pam Delaney's avatar Pam Delaney Committed by Linus Torvalds

[PATCH] Fusion-MPT driver update

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/)
parent 25f0da24
# #
# Makefile for the LSI Logic Fusion MPT (Message Passing Technology) drivers. # 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 # 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 # to someone else, use the MPT_CFLAGS env variable (thanks Steve). -nromer
...@@ -20,6 +27,7 @@ EXTRA_CFLAGS += -I. ${MPT_CFLAGS} ...@@ -20,6 +27,7 @@ EXTRA_CFLAGS += -I. ${MPT_CFLAGS}
#EXTRA_CFLAGS += -DDEBUG #EXTRA_CFLAGS += -DDEBUG
#EXTRA_CFLAGS += -DMPT_DEBUG #EXTRA_CFLAGS += -DMPT_DEBUG
#EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME #EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME
#EXTRA_CFLAGS += -DMPT_DEBUG_SG
# #
# driver/module specifics... # driver/module specifics...
# #
...@@ -27,11 +35,13 @@ EXTRA_CFLAGS += -I. ${MPT_CFLAGS} ...@@ -27,11 +35,13 @@ EXTRA_CFLAGS += -I. ${MPT_CFLAGS}
#CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE #CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE
#CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ #CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ
# #
# For {mptscsih, mptctl}: # For mptscsih:
#CFLAGS_mptscsih.o += -DMPT_SCSI_USE_NEW_EH
#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCANDV #CFLAGS_mptscsih.o += -DMPT_DEBUG_SCANDV
#CFLAGS_mptscsih.o += -DMPT_DEBUG_SG #CFLAGS_mptscsih.o += -DMPT_DEBUG_RESET
#CFLAGS_mptctl.o += -DMPT_DEBUG_SG #CFLAGS_mptscsih.o += -DMPT_DEBUG_NEH
#
# For mptctl:
#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL
# #
# For mptlan: # For mptlan:
#CFLAGS_mptlan.o += -DMPT_LAN_IO_DEBUG #CFLAGS_mptlan.o += -DMPT_LAN_IO_DEBUG
...@@ -43,11 +53,27 @@ EXTRA_CFLAGS += -I. ${MPT_CFLAGS} ...@@ -43,11 +53,27 @@ EXTRA_CFLAGS += -I. ${MPT_CFLAGS}
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} 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) += mptbase.o mptscsih.o
obj-$(CONFIG_FUSION_ISENSE) += isense.o obj-$(CONFIG_FUSION_ISENSE) += isense.o
obj-$(CONFIG_FUSION_CTL) += mptctl.o obj-$(CONFIG_FUSION_CTL) += mptctl.o
obj-$(CONFIG_FUSION_LAN) += mptlan.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 include $(TOPDIR)/Rules.make
# EXP...
## Fusion MPT extra's...
##mptscsih.o: $(mptscsih-objs)
## $(LD) -r -o $@ $(mptscsih-objs)
...@@ -252,6 +252,27 @@ static __inline__ int __get_order(unsigned long size) ...@@ -252,6 +252,27 @@ static __inline__ int __get_order(unsigned long size)
#define MPT_SCSI_USE_NEW_EH #define MPT_SCSI_USE_NEW_EH
#endif #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 */ #endif /* _LINUX_COMPAT_H */
/* /*
* Copyright (c) 2000-2001 LSI Logic Corporation. * Copyright (c) 2000-2002 LSI Logic Corporation.
* *
* *
* Name: MPI.H * Name: MPI.H
* Title: MPI Message independent structures and definitions * Title: MPI Message independent structures and definitions
* Creation Date: July 27, 2000 * Creation Date: July 27, 2000
* *
* MPI Version: 01.02.03 * MPI.H Version: 01.02.06
* *
* Version History * Version History
* --------------- * ---------------
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
* Added define MPI_FUNCTION_TOOLBOX. * Added define MPI_FUNCTION_TOOLBOX.
* 09-28-01 01.02.02 New function code MPI_SCSI_ENCLOSURE_PROCESSOR. * 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. * 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.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -59,10 +62,27 @@ ...@@ -59,10 +62,27 @@
#define MPI_VERSION_MAJOR (0x01) #define MPI_VERSION_MAJOR (0x01)
#define MPI_VERSION_MINOR (0x02) #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 */ /* 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 * I O C S t a t e D e f i n i t i o n s
...@@ -228,6 +248,8 @@ ...@@ -228,6 +248,8 @@
#define MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18) #define MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18)
#define MPI_FUNCTION_MAILBOX (0x19)
#define MPI_FUNCTION_LAN_SEND (0x20) #define MPI_FUNCTION_LAN_SEND (0x20)
#define MPI_FUNCTION_LAN_RECEIVE (0x21) #define MPI_FUNCTION_LAN_RECEIVE (0x21)
#define MPI_FUNCTION_LAN_RESET (0x22) #define MPI_FUNCTION_LAN_RESET (0x22)
......
/* /*
* Copyright (c) 2000-2001 LSI Logic Corporation. * Copyright (c) 2000-2002 LSI Logic Corporation.
* *
* *
* Name: MPI_CNFG.H * Name: MPI_CNFG.H
* Title: MPI Config message, structures, and Pages * Title: MPI Config message, structures, and Pages
* Creation Date: July 27, 2000 * Creation Date: July 27, 2000
* *
* MPI Version: 01.02.05 * MPI_CNFG.H Version: 01.02.08
* *
* Version History * Version History
* --------------- * ---------------
...@@ -108,6 +108,25 @@ ...@@ -108,6 +108,25 @@
* Added generic defines for hot spare pools and RAID * Added generic defines for hot spare pools and RAID
* volume types. * volume types.
* 11-01-01 01.02.05 Added define for MPI_IOUNITPAGE1_DISABLE_IR. * 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.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -266,6 +285,7 @@ typedef struct _MSG_CONFIG_REPLY ...@@ -266,6 +285,7 @@ typedef struct _MSG_CONFIG_REPLY
#define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622) #define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622)
#define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628) #define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628)
#define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) #define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626)
#define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) #define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030)
#define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) #define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031)
#define MPI_MANUFACTPAGE_DEVID_1030_53C1035 (0x0032) #define MPI_MANUFACTPAGE_DEVID_1030_53C1035 (0x0032)
...@@ -273,6 +293,12 @@ typedef struct _MSG_CONFIG_REPLY ...@@ -273,6 +293,12 @@ typedef struct _MSG_CONFIG_REPLY
#define MPI_MANUFACTPAGE_DEVID_53C1035 (0x0040) #define MPI_MANUFACTPAGE_DEVID_53C1035 (0x0040)
#define MPI_MANUFACTPAGE_DEVID_53C1035ZC (0x0041) #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 typedef struct _CONFIG_PAGE_MANUFACTURING_0
{ {
fCONFIG_PAGE_HEADER Header; /* 00h */ fCONFIG_PAGE_HEADER Header; /* 00h */
...@@ -481,14 +507,17 @@ typedef struct _CONFIG_PAGE_IOC_1 ...@@ -481,14 +507,17 @@ typedef struct _CONFIG_PAGE_IOC_1
U32 Flags; /* 04h */ U32 Flags; /* 04h */
U32 CoalescingTimeout; /* 08h */ U32 CoalescingTimeout; /* 08h */
U8 CoalescingDepth; /* 0Ch */ 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, } fCONFIG_PAGE_IOC_1, MPI_POINTER PTR_CONFIG_PAGE_IOC_1,
IOCPage1_t, MPI_POINTER pIOCPage1_t; 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_REPLY_COALESCING (0x00000001)
#define MPI_IOCPAGE1_PCISLOTNUM_UNKNOWN (0xFF)
typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL
{ {
...@@ -497,11 +526,21 @@ typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL ...@@ -497,11 +526,21 @@ typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL
U8 VolumeIOC; /* 02h */ U8 VolumeIOC; /* 02h */
U8 VolumePageNumber; /* 03h */ U8 VolumePageNumber; /* 03h */
U8 VolumeType; /* 04h */ U8 VolumeType; /* 04h */
U8 Reserved2; /* 05h */ U8 Flags; /* 05h */
U16 Reserved3; /* 06h */ U16 Reserved3; /* 06h */
} fCONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL, } fCONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL,
ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t; 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 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
* one and check Header.PageLength at runtime. * one and check Header.PageLength at runtime.
...@@ -522,7 +561,7 @@ typedef struct _CONFIG_PAGE_IOC_2 ...@@ -522,7 +561,7 @@ typedef struct _CONFIG_PAGE_IOC_2
} fCONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2, } fCONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2,
IOCPage2_t, MPI_POINTER pIOCPage2_t; IOCPage2_t, MPI_POINTER pIOCPage2_t;
#define MPI_IOCPAGE2_PAGEVERSION (0x01) #define MPI_IOCPAGE2_PAGEVERSION (0x02)
/* IOC Page 2 Capabilities flags */ /* IOC Page 2 Capabilities flags */
...@@ -533,12 +572,6 @@ typedef struct _CONFIG_PAGE_IOC_2 ...@@ -533,12 +572,6 @@ typedef struct _CONFIG_PAGE_IOC_2
#define MPI_IOCPAGE2_CAP_FLAGS_SAFTE_SUPPORT (0x40000000) #define MPI_IOCPAGE2_CAP_FLAGS_SAFTE_SUPPORT (0x40000000)
#define MPI_IOCPAGE2_CAP_FLAGS_CROSS_CHANNEL_SUPPORT (0x80000000) #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 typedef struct _IOC_3_PHYS_DISK
{ {
...@@ -599,6 +632,41 @@ typedef struct _CONFIG_PAGE_IOC_4 ...@@ -599,6 +632,41 @@ typedef struct _CONFIG_PAGE_IOC_4
#define MPI_IOCPAGE4_PAGEVERSION (0x00) #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 * SCSI Port Config Pages
****************************************************************************/ ****************************************************************************/
...@@ -698,11 +766,16 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_0 ...@@ -698,11 +766,16 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_0
} fCONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0, } fCONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0,
SCSIDevicePage0_t, MPI_POINTER pSCSIDevicePage0_t; 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_IU (0x00000001)
#define MPI_SCSIDEVPAGE0_NP_DT (0x00000002) #define MPI_SCSIDEVPAGE0_NP_DT (0x00000002)
#define MPI_SCSIDEVPAGE0_NP_QAS (0x00000004) #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_PERIOD_MASK (0x0000FF00)
#define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000) #define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000)
#define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000) #define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000)
...@@ -723,21 +796,24 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_1 ...@@ -723,21 +796,24 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_1
} fCONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1, } fCONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1,
SCSIDevicePage1_t, MPI_POINTER pSCSIDevicePage1_t; 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_IU (0x00000001)
#define MPI_SCSIDEVPAGE1_RP_DT (0x00000002) #define MPI_SCSIDEVPAGE1_RP_DT (0x00000002)
#define MPI_SCSIDEVPAGE1_RP_QAS (0x00000004) #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_MIN_SYNC_PERIOD_MASK (0x0000FF00)
#define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000) #define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000)
#define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000) #define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000)
#define MPI_SCSIDEVPAGE1_RP_AIP (0x80000000) #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_WDTR_DISALLOWED (0x00000002)
#define MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED (0x00000004) #define MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED (0x00000004)
#define MPI_SCSIDEVPAGE1_CONF_EXTENDED_PARAMS_ENABLE (0x00000008)
typedef struct _CONFIG_PAGE_SCSI_DEVICE_2 typedef struct _CONFIG_PAGE_SCSI_DEVICE_2
...@@ -749,7 +825,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_2 ...@@ -749,7 +825,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_2
} fCONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2, } fCONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2,
SCSIDevicePage2_t, MPI_POINTER pSCSIDevicePage2_t; 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_ISI_ENABLE (0x00000010)
#define MPI_SCSIDEVPAGE2_DV_SECONDARY_DRIVER_ENABLE (0x00000020) #define MPI_SCSIDEVPAGE2_DV_SECONDARY_DRIVER_ENABLE (0x00000020)
...@@ -781,6 +857,22 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_2 ...@@ -781,6 +857,22 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_2
#define MPI_SCSIDEVPAGE2_DPS_BIT_15_PL_SELECT_MASK (0xC0000000) #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 * FC Port Config Pages
****************************************************************************/ ****************************************************************************/
...@@ -804,10 +896,14 @@ typedef struct _CONFIG_PAGE_FC_PORT_0 ...@@ -804,10 +896,14 @@ typedef struct _CONFIG_PAGE_FC_PORT_0
U64 FabricWWPN; /* 38h */ U64 FabricWWPN; /* 38h */
U32 DiscoveredPortsCount; /* 40h */ U32 DiscoveredPortsCount; /* 40h */
U32 MaxInitiators; /* 44h */ 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, } fCONFIG_PAGE_FC_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_0,
FCPortPage0_t, MPI_POINTER pFCPortPage0_t; 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_MASK (0x0000000F)
#define MPI_FCPORTPAGE0_FLAGS_PROT_FCP_INIT (MPI_PORTFACTS_PROTOCOL_INITIATOR) #define MPI_FCPORTPAGE0_FLAGS_PROT_FCP_INIT (MPI_PORTFACTS_PROTOCOL_INITIATOR)
...@@ -874,11 +970,14 @@ typedef struct _CONFIG_PAGE_FC_PORT_1 ...@@ -874,11 +970,14 @@ typedef struct _CONFIG_PAGE_FC_PORT_1
U8 HardALPA; /* 18h */ U8 HardALPA; /* 18h */
U8 LinkConfig; /* 19h */ U8 LinkConfig; /* 19h */
U8 TopologyConfig; /* 1Ah */ 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, } fCONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1,
FCPortPage1_t, MPI_POINTER pFCPortPage1_t; 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_EXT_FCP_STATUS_EN (0x08000000)
#define MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY (0x04000000) #define MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY (0x04000000)
...@@ -906,6 +1005,8 @@ typedef struct _CONFIG_PAGE_FC_PORT_1 ...@@ -906,6 +1005,8 @@ typedef struct _CONFIG_PAGE_FC_PORT_1
#define MPI_FCPORTPAGE1_TOPOLOGY_NPORT (0x02) #define MPI_FCPORTPAGE1_TOPOLOGY_NPORT (0x02)
#define MPI_FCPORTPAGE1_TOPOLOGY_AUTO (0x0F) #define MPI_FCPORTPAGE1_TOPOLOGY_AUTO (0x0F)
#define MPI_FCPORTPAGE1_ALT_CONN_UNKNOWN (0x00)
typedef struct _CONFIG_PAGE_FC_PORT_2 typedef struct _CONFIG_PAGE_FC_PORT_2
{ {
...@@ -998,26 +1099,19 @@ typedef struct _CONFIG_PAGE_FC_PORT_5_ALIAS_INFO ...@@ -998,26 +1099,19 @@ typedef struct _CONFIG_PAGE_FC_PORT_5_ALIAS_INFO
MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO,
FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t; 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 typedef struct _CONFIG_PAGE_FC_PORT_5
{ {
fCONFIG_PAGE_HEADER Header; /* 00h */ fCONFIG_PAGE_HEADER Header; /* 00h */
fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo[MPI_FC_PORT_PAGE_5_ALIAS_MAX];/* 04h */ fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo; /* 04h */
} fCONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5, } fCONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5,
FCPortPage5_t, MPI_POINTER pFCPortPage5_t; FCPortPage5_t, MPI_POINTER pFCPortPage5_t;
#define MPI_FCPORTPAGE5_PAGEVERSION (0x00) #define MPI_FCPORTPAGE5_PAGEVERSION (0x01)
#define MPI_FCPORTPAGE5_FLAGS_ALIAS_ALPA_VALID (0x01)
#define MPI_FCPORTPAGE5_FLAGS_ALIAS_WWN_VALID (0x02)
#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 typedef struct _CONFIG_PAGE_FC_PORT_6
{ {
...@@ -1086,6 +1180,132 @@ typedef struct _CONFIG_PAGE_FC_PORT_9 ...@@ -1086,6 +1180,132 @@ typedef struct _CONFIG_PAGE_FC_PORT_9
#define MPI_FCPORTPAGE9_PAGEVERSION (0x00) #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 * FC Device Config Pages
****************************************************************************/ ****************************************************************************/
...@@ -1155,6 +1375,7 @@ typedef struct _RAID_VOL0_STATUS ...@@ -1155,6 +1375,7 @@ typedef struct _RAID_VOL0_STATUS
#define MPI_RAIDVOL0_STATUS_FLAG_ENABLED (0x01) #define MPI_RAIDVOL0_STATUS_FLAG_ENABLED (0x01)
#define MPI_RAIDVOL0_STATUS_FLAG_QUIESCED (0x02) #define MPI_RAIDVOL0_STATUS_FLAG_QUIESCED (0x02)
#define MPI_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS (0x04) #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_OPTIMAL (0x00)
#define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01) #define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01)
...@@ -1216,7 +1437,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0 ...@@ -1216,7 +1437,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
} fCONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0, } fCONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0,
RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t; 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 * Name: MPI_FC.H
* Title: MPI Fibre Channel messages and structures * Title: MPI Fibre Channel messages and structures
* Creation Date: June 12, 2000 * Creation Date: June 12, 2000
* *
* MPI Version: 01.02.02 * MPI_FC.H Version: 01.02.03
* *
* Version History * Version History
* --------------- * ---------------
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
* 08-08-01 01.02.01 Original release for v1.2 work. * 08-08-01 01.02.01 Original release for v1.2 work.
* 09-28-01 01.02.02 Change name of reserved field in * 09-28-01 01.02.02 Change name of reserved field in
* MSG_LINK_SERVICE_RSP_REPLY. * MSG_LINK_SERVICE_RSP_REPLY.
* 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -193,7 +194,7 @@ typedef struct _MSG_LINK_SERVICE_RSP_REPLY ...@@ -193,7 +194,7 @@ typedef struct _MSG_LINK_SERVICE_RSP_REPLY
typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST
{ {
U8 SendFlags; /* 00h */ U8 SendFlags; /* 00h */
U8 Reserved; /* 01h */ U8 AliasIndex; /* 01h */
U8 ChainOffset; /* 02h */ U8 ChainOffset; /* 02h */
U8 Function; /* 03h */ U8 Function; /* 03h */
U32 MsgFlags_Did; /* 04h */ U32 MsgFlags_Did; /* 04h */
...@@ -212,7 +213,8 @@ typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST ...@@ -212,7 +213,8 @@ typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST
/* Extended Link Service Send Reply */ /* Extended Link Service Send Reply */
typedef struct _MSG_EXLINK_SERVICE_SEND_REPLY typedef struct _MSG_EXLINK_SERVICE_SEND_REPLY
{ {
U16 Reserved; /* 00h */ U8 Reserved; /* 00h */
U8 AliasIndex; /* 01h */
U8 MsgLength; /* 02h */ U8 MsgLength; /* 02h */
U8 Function; /* 03h */ U8 Function; /* 03h */
U16 Reserved1; /* 04h */ U16 Reserved1; /* 04h */
...@@ -275,7 +277,7 @@ typedef struct _MSG_FC_ABORT_REPLY ...@@ -275,7 +277,7 @@ typedef struct _MSG_FC_ABORT_REPLY
typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST
{ {
U8 SendFlags; /* 00h */ U8 SendFlags; /* 00h */
U8 Reserved; /* 01h */ U8 AliasIndex; /* 01h */
U8 ChainOffset; /* 02h */ U8 ChainOffset; /* 02h */
U8 Function; /* 03h */ U8 Function; /* 03h */
U32 MsgFlags_Did; /* 04h */ U32 MsgFlags_Did; /* 04h */
...@@ -297,7 +299,8 @@ typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST ...@@ -297,7 +299,8 @@ typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST
/* FC Common Transport Send Reply */ /* FC Common Transport Send Reply */
typedef struct _MSG_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 MsgLength; /* 02h */
U8 Function; /* 03h */ U8 Function; /* 03h */
U16 Reserved1; /* 04h */ U16 Reserved1; /* 04h */
......
/* /*
* Copyright (c) 2000-2001 LSI Logic Corporation. * Copyright (c) 2000-2002 LSI Logic Corporation.
* *
* *
* Name: MPI_INIT.H * Name: MPI_INIT.H
* Title: MPI initiator mode messages and structures * Title: MPI initiator mode messages and structures
* Creation Date: June 8, 2000 * Creation Date: June 8, 2000
* *
* MPI Version: 01.02.04 * MPI_INIT.H Version: 01.02.05
* *
* Version History * Version History
* --------------- * ---------------
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
* 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure * 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure
* Processor messages. * Processor messages.
* 10-04-01 01.02.04 Added defines for SEP request Action field. * 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.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -67,16 +69,17 @@ typedef struct _MSG_SCSI_IO_REQUEST ...@@ -67,16 +69,17 @@ typedef struct _MSG_SCSI_IO_REQUEST
SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t; 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 (0x01)
#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00) #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00)
#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01) #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01)
#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02) #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02)
#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00) #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00)
#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02) #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_FIRST_LEVEL_ADDRESSING (0x0000FFFF)
#define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000) #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000)
...@@ -85,7 +88,7 @@ typedef struct _MSG_SCSI_IO_REQUEST ...@@ -85,7 +88,7 @@ typedef struct _MSG_SCSI_IO_REQUEST
#define MPI_SCSIIO_LUN_LEVEL_1_WORD (0xFF00) #define MPI_SCSIIO_LUN_LEVEL_1_WORD (0xFF00)
#define MPI_SCSIIO_LUN_LEVEL_1_DWORD (0x0000FF00) #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_DATADIRECTION_MASK (0x03000000)
#define MPI_SCSIIO_CONTROL_NODATATRANSFER (0x00000000) #define MPI_SCSIIO_CONTROL_NODATATRANSFER (0x00000000)
...@@ -114,7 +117,7 @@ typedef struct _MSG_SCSI_IO_REQUEST ...@@ -114,7 +117,7 @@ typedef struct _MSG_SCSI_IO_REQUEST
#define MPI_SCSIIO_CONTROL_RESERVED2 (0x00010000) #define MPI_SCSIIO_CONTROL_RESERVED2 (0x00010000)
/* SCSIIO reply structure */ /* SCSI IO reply structure */
typedef struct _MSG_SCSI_IO_REPLY typedef struct _MSG_SCSI_IO_REPLY
{ {
U8 TargetID; /* 00h */ U8 TargetID; /* 00h */
...@@ -137,7 +140,7 @@ typedef struct _MSG_SCSI_IO_REPLY ...@@ -137,7 +140,7 @@ typedef struct _MSG_SCSI_IO_REPLY
SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t; 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_SUCCESS (0x00)
#define MPI_SCSI_STATUS_CHECK_CONDITION (0x02) #define MPI_SCSI_STATUS_CHECK_CONDITION (0x02)
...@@ -151,7 +154,7 @@ typedef struct _MSG_SCSI_IO_REPLY ...@@ -151,7 +154,7 @@ typedef struct _MSG_SCSI_IO_REPLY
#define MPI_SCSI_STATUS_ACA_ACTIVE (0x30) #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_VALID (0x01)
#define MPI_SCSI_STATE_AUTOSENSE_FAILED (0x02) #define MPI_SCSI_STATE_AUTOSENSE_FAILED (0x02)
...@@ -160,7 +163,7 @@ typedef struct _MSG_SCSI_IO_REPLY ...@@ -160,7 +163,7 @@ typedef struct _MSG_SCSI_IO_REPLY
#define MPI_SCSI_STATE_RESPONSE_INFO_VALID (0x10) #define MPI_SCSI_STATE_RESPONSE_INFO_VALID (0x10)
#define MPI_SCSI_STATE_QUEUE_TAG_REJECTED (0x20) #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) */ /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
#define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE (0x00000000) #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 * Name: MPI_IOC.H
* Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages
* Creation Date: August 11, 2000 * Creation Date: August 11, 2000
* *
* MPI Version: 01.02.04 * MPI_IOC.H Version: 01.02.06
* *
* Version History * Version History
* --------------- * ---------------
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
* MPI_FW_UPLOAD_ITYPE_NVDATA. * MPI_FW_UPLOAD_ITYPE_NVDATA.
* 09-28-01 01.02.03 Modified Event Data for Integrated RAID. * 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. * 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.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -151,7 +155,7 @@ typedef struct _MSG_IOC_FACTS_REPLY ...@@ -151,7 +155,7 @@ typedef struct _MSG_IOC_FACTS_REPLY
U16 MsgVersion; /* 00h */ U16 MsgVersion; /* 00h */
U8 MsgLength; /* 02h */ U8 MsgLength; /* 02h */
U8 Function; /* 03h */ U8 Function; /* 03h */
U16 Reserved; /* 04h */ U16 HeaderVersion; /* 04h */
U8 IOCNumber; /* 06h */ U8 IOCNumber; /* 06h */
U8 MsgFlags; /* 07h */ U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */ U32 MsgContext; /* 08h */
...@@ -183,7 +187,11 @@ typedef struct _MSG_IOC_FACTS_REPLY ...@@ -183,7 +187,11 @@ typedef struct _MSG_IOC_FACTS_REPLY
#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00) #define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00)
#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF) #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_CONFIG_CHECKSUM_FAIL (0x0001)
#define MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID (0x0002)
#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01) #define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01)
...@@ -464,12 +472,15 @@ typedef struct _EVENT_DATA_LOOP_STATE ...@@ -464,12 +472,15 @@ typedef struct _EVENT_DATA_LOOP_STATE
typedef struct _EVENT_DATA_LOGOUT typedef struct _EVENT_DATA_LOGOUT
{ {
U32 NPortID; /* 00h */ U32 NPortID; /* 00h */
U8 Reserved; /* 04h */ U8 AliasIndex; /* 04h */
U8 Port; /* 05h */ U8 Port; /* 05h */
U16 Reserved1; /* 06h */ U16 Reserved1; /* 06h */
} EVENT_DATA_LOGOUT, MPI_POINTER PTR_EVENT_DATA_LOGOUT, } EVENT_DATA_LOGOUT, MPI_POINTER PTR_EVENT_DATA_LOGOUT,
EventDataLogout_t, MPI_POINTER pEventDataLogout_t; EventDataLogout_t, MPI_POINTER pEventDataLogout_t;
#define MPI_EVENT_LOGOUT_ALL_ALIASES (0xFF)
/* MPI Integrated RAID Event data */ /* MPI Integrated RAID Event data */
typedef struct _EVENT_DATA_RAID typedef struct _EVENT_DATA_RAID
......
/* /*
* Copyright (c) 2000-2001 LSI Logic Corporation. * Copyright (c) 2000-2002 LSI Logic Corporation.
* *
* *
* Name: MPI_LAN.H * Name: MPI_LAN.H
* Title: MPI LAN messages and structures * Title: MPI LAN messages and structures
* Creation Date: June 30, 2000 * Creation Date: June 30, 2000
* *
* MPI Version: 01.02.01 * MPI_LAN.H Version: 01.02.01
* *
* Version History * Version History
* --------------- * ---------------
......
/* /*
* Copyright (c) 2001 LSI Logic Corporation. * Copyright (c) 2001-2002 LSI Logic Corporation.
* *
* *
* Name: MPI_RAID.H * Name: MPI_RAID.H
* Title: MPI RAID message and structures * Title: MPI RAID message and structures
* Creation Date: February 27, 2001 * Creation Date: February 27, 2001
* *
* MPI Version: 01.02.04 * MPI_RAID.H Version: 01.02.07
* *
* Version History * Version History
* --------------- * ---------------
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
* 10-04-01 01.02.03 Added ActionData defines for * 10-04-01 01.02.03 Added ActionData defines for
* MPI_RAID_ACTION_DELETE_VOLUME action. * MPI_RAID_ACTION_DELETE_VOLUME action.
* 11-01-01 01.02.04 Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC. * 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.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -74,14 +79,20 @@ typedef struct _MSG_RAID_ACTION ...@@ -74,14 +79,20 @@ typedef struct _MSG_RAID_ACTION
#define MPI_RAID_ACTION_DELETE_PHYSDISK (0x0E) #define MPI_RAID_ACTION_DELETE_PHYSDISK (0x0E)
#define MPI_RAID_ACTION_FAIL_PHYSDISK (0x0F) #define MPI_RAID_ACTION_FAIL_PHYSDISK (0x0F)
#define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10) #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 */ /* 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_DO_NOT_SYNC (0x00000001)
#define MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT (0x00000002)
/* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */ /* 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_KEEP_PHYS_DISKS (0x00000000)
#define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS (0x00000001) #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 */ /* RAID Action reply message */
...@@ -172,6 +183,42 @@ typedef struct _MSG_SCSI_IO_RAID_PT_REPLY ...@@ -172,6 +183,42 @@ typedef struct _MSG_SCSI_IO_RAID_PT_REPLY
SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t; 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 #endif
......
/* /*
* Copyright (c) 2000-2001 LSI Logic Corporation. * Copyright (c) 2000-2002 LSI Logic Corporation.
* *
* *
* Name: MPI_TARG.H * Name: MPI_TARG.H
* Title: MPI Target mode messages and structures * Title: MPI Target mode messages and structures
* Creation Date: June 22, 2000 * Creation Date: June 22, 2000
* *
* MPI Version: 01.02.04 * MPI_TARG.H Version: 01.02.06
* *
* Version History * Version History
* --------------- * ---------------
...@@ -34,6 +34,11 @@ ...@@ -34,6 +34,11 @@
* of MPI. * of MPI.
* 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY. * 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. * 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.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -161,6 +166,9 @@ typedef struct _MPI_TARGET_FCP_CMD_BUFFER ...@@ -161,6 +166,9 @@ typedef struct _MPI_TARGET_FCP_CMD_BUFFER
U8 FcpCntl[4]; /* 08h */ U8 FcpCntl[4]; /* 08h */
U8 FcpCdb[16]; /* 0Ch */ U8 FcpCdb[16]; /* 0Ch */
U32 FcpDl; /* 1Ch */ 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, } MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer; MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
...@@ -255,12 +263,16 @@ typedef struct _MSG_TARGET_STATUS_SEND_REQUEST ...@@ -255,12 +263,16 @@ typedef struct _MSG_TARGET_STATUS_SEND_REQUEST
#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04) #define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04)
#define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80) #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 typedef struct _MPI_TARGET_FCP_RSP_BUFFER
{ {
U8 Reserved0[8]; /* 00h */ U8 Reserved0[8]; /* 00h */
U8 FcpStatus; /* 08h */ U8 Reserved1[2]; /* 08h */
U8 FcpFlags; /* 09h */ U8 FcpFlags; /* 0Ah */
U8 Reserved1[2]; /* 0Ah */ U8 FcpStatus; /* 0Bh */
U32 FcpResid; /* 0Ch */ U32 FcpResid; /* 0Ch */
U32 FcpSenseLength; /* 10h */ U32 FcpSenseLength; /* 10h */
U32 FcpResponseLength; /* 14h */ U32 FcpResponseLength; /* 14h */
...@@ -269,6 +281,10 @@ typedef struct _MPI_TARGET_FCP_RSP_BUFFER ...@@ -269,6 +281,10 @@ typedef struct _MPI_TARGET_FCP_RSP_BUFFER
} MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER, } MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,
MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer; 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 typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
{ {
U8 Reserved0; /* 00h */ U8 Reserved0; /* 00h */
...@@ -332,7 +348,7 @@ typedef struct _MSG_TARGET_MODE_ABORT_REPLY ...@@ -332,7 +348,7 @@ typedef struct _MSG_TARGET_MODE_ABORT_REPLY
#define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0) #define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0)
#define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000) #define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000)
#define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14) #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_ALIAS_SHIFT (26)
#define TARGET_MODE_REPLY_PORT_MASK (0x10000000) #define TARGET_MODE_REPLY_PORT_MASK (0x10000000)
#define TARGET_MODE_REPLY_PORT_SHIFT (28) #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 * Name: MPI_TYPE.H
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
* (mailto:sjralston1@netscape.net) * (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com) * (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 $
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/* /*
...@@ -437,8 +437,9 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r) ...@@ -437,8 +437,9 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
pa = 0; /* No reply flush! */ pa = 0; /* No reply flush! */
} }
#ifdef MPT_DEBUG_IRQ
if ((int)ioc->chip_type > (int)FC929) { 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)) if ((mf) && ((mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))
|| (mf < ioc->req_frames)) ) { || (mf < ioc->req_frames)) ) {
...@@ -464,6 +465,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r) ...@@ -464,6 +465,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
freeme = 0; freeme = 0;
} }
} }
#endif
/* Check for (valid) IO callback! */ /* Check for (valid) IO callback! */
if (cb_idx) { if (cb_idx) {
...@@ -1602,7 +1604,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) ...@@ -1602,7 +1604,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
if (reason == MPT_HOSTEVENT_IOC_BRINGUP){ if (reason == MPT_HOSTEVENT_IOC_BRINGUP){
if (ioc->upload_fw) { if (ioc->upload_fw) {
dprintk((MYIOC_s_INFO_FMT ddlprintk((MYIOC_s_INFO_FMT
"firmware upload required!\n", ioc->name)); "firmware upload required!\n", ioc->name));
r = mpt_do_upload(ioc, sleepFlag); r = mpt_do_upload(ioc, sleepFlag);
...@@ -1788,6 +1790,16 @@ mpt_adapter_disable(MPT_ADAPTER *this, int freeup) ...@@ -1788,6 +1790,16 @@ mpt_adapter_disable(MPT_ADAPTER *this, int freeup)
(void) KickStart(this, 1, NO_SLEEP); (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! */ /* Disable adapter interrupts! */
CHIPREG_WRITE32(&this->chip->IntMask, 0xFFFFFFFF); CHIPREG_WRITE32(&this->chip->IntMask, 0xFFFFFFFF);
this->active = 0; this->active = 0;
...@@ -1994,8 +2006,19 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) ...@@ -1994,8 +2006,19 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
} }
/* Is it already READY? */ /* Is it already READY? */
if (!statefault && (ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_READY) if (!statefault && (ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_READY) {
return 0; 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. * Check to see if IOC is in FAULT state.
...@@ -2376,6 +2399,8 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2376,6 +2399,8 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
else else
ioc->upload_fw = 1; 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) { if ((int)ioc->chip_type <= (int)FC929) {
ioc_init.MaxDevices = MPT_MAX_FC_DEVICES; ioc_init.MaxDevices = MPT_MAX_FC_DEVICES;
...@@ -2688,7 +2713,7 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2688,7 +2713,7 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
} }
ioc->alloc_total += alloc_sz; 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)); (void *)(ulong)ioc->cached_fw, ioc->facts.FWImageSize));
prequest = (FWUpload_t *)&request; prequest = (FWUpload_t *)&request;
...@@ -2748,7 +2773,7 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2748,7 +2773,7 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
cmdStatus = 0; 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)); ioc->name, cmdStatus));
/* Check to see if we have a copy of this image in /* Check to see if we have a copy of this image in
...@@ -2766,7 +2791,7 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2766,7 +2791,7 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
*/ */
if (cmdStatus || freeMem) { 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")); ioc->name, cmdStatus ? "incomplete" : "duplicate"));
mpt_free_fw_memory(ioc, NULL); mpt_free_fw_memory(ioc, NULL);
ioc->cached_fw = NULL; ioc->cached_fw = NULL;
...@@ -2809,20 +2834,20 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2809,20 +2834,20 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
int max_idx, fw_idx, ext_idx; int max_idx, fw_idx, ext_idx;
int left_u32s; int left_u32s;
dprintk((MYIOC_s_INFO_FMT "DbGb0: downloadboot entered.\n", ddlprintk((MYIOC_s_INFO_FMT "DbGb0: downloadboot entered.\n",
ioc->name)); ioc->name));
#ifdef MPT_DEBUG #ifdef MPT_DEBUG
diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
if (ioc->alt_ioc) if (ioc->alt_ioc)
diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); 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)); ioc->name, diag0val, diag1val));
#endif #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)); ioc->name, ioc->facts.FWImageSize, ioc->cached_fw));
if (ioc->alt_ioc) 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)); ioc->name, ioc->alt_ioc->cached_fw));
/* Get dma_addr and data transfer size. /* Get dma_addr and data transfer size.
...@@ -2831,13 +2856,13 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2831,13 +2856,13 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
return -1; return -1;
/* Get the DMA from ioc or ioc->alt_ioc */ /* 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; 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; pCached = (fw_image_t **)ioc->alt_ioc->cached_fw;
dprintk((MYIOC_s_INFO_FMT "DbGb2: FW Image @ %p\n", ddlprintk((MYIOC_s_INFO_FMT "DbGb2: FW Image @ %p\n",
ioc->name, FwHdr)); ioc->name, pCached));
if (!pCached) if (!pCached)
return -2; return -2;
...@@ -2872,10 +2897,10 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2872,10 +2897,10 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
#ifdef MPT_DEBUG #ifdef MPT_DEBUG
if (ioc->alt_ioc) if (ioc->alt_ioc)
diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); 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)); ioc->name, diag0val, diag1val));
#endif #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)); ioc->name, diag0val));
} }
...@@ -2886,18 +2911,11 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2886,18 +2911,11 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
#ifdef MPT_DEBUG #ifdef MPT_DEBUG
if (ioc->alt_ioc) if (ioc->alt_ioc)
diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic); 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)); ioc->name, diag0val, diag1val));
#endif #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 = 1 + maximum valid buffer index
*/ */
max_idx = 0; max_idx = 0;
...@@ -2910,7 +2928,14 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2910,7 +2928,14 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
count = (FwHdr->ImageSize + 3)/4; count = (FwHdr->ImageSize + 3)/4;
nextImage = FwHdr->NextImageHeaderOffset; 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)); ioc->name, count, ptru32));
left_u32s = pCached[fw_idx]->size/4; left_u32s = pCached[fw_idx]->size/4;
while (count--) { while (count--) {
...@@ -2997,7 +3022,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2997,7 +3022,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
count = (count +3)/4; 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)); ioc->name, count, ptru32));
CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, load_addr); CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, load_addr);
...@@ -3019,35 +3044,12 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -3019,35 +3044,12 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
} }
} }
#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 */ /* 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); CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, FwHdr->IopResetRegAddr);
/* Write the IopResetVectorValue */ /* 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); CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, FwHdr->IopResetVectorValue);
/* Clear the internal flash bad bit - autoincrementing register, /* Clear the internal flash bad bit - autoincrementing register,
...@@ -3182,6 +3184,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3182,6 +3184,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* Write magic sequence to WriteSequence register /* Write magic sequence to WriteSequence register
* Loop until in diagnostic mode * 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_1ST_KEY_VALUE);
CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE); CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE);
CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE); CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_3RD_KEY_VALUE);
...@@ -3217,7 +3220,11 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3217,7 +3220,11 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
ioc->name, diag0val, diag1val)); ioc->name, diag0val, diag1val));
#endif #endif
/* Write the PreventIocBoot bit */ /* 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) { if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) {
#endif
diag0val |= MPI_DIAG_PREVENT_IOC_BOOT; diag0val |= MPI_DIAG_PREVENT_IOC_BOOT;
CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val); CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val);
} }
...@@ -3263,7 +3270,11 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3263,7 +3270,11 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* FIXME? Examine results here? */ /* 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) { if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) {
#endif
/* If the DownloadBoot operation fails, the /* If the DownloadBoot operation fails, the
* IOC will be left unusable. This is a fatal error * IOC will be left unusable. This is a fatal error
* case. _diag_reset will return < 0 * case. _diag_reset will return < 0
...@@ -5274,6 +5285,9 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -5274,6 +5285,9 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n", printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n",
rc, ioc->name); rc, ioc->name);
} }
ioc->reload_fw = 0;
if (ioc->alt_ioc)
ioc->alt_ioc->reload_fw = 0;
spin_lock_irqsave(&ioc->diagLock, flags); spin_lock_irqsave(&ioc->diagLock, flags);
ioc->diagPending = 0; ioc->diagPending = 0;
...@@ -5612,8 +5626,46 @@ mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info) ...@@ -5612,8 +5626,46 @@ mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info)
static void static void
mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info) mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info)
{ {
/* FIXME! */ u32 info = log_info & 0x00FF0000;
printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x)\n", ioc->name, log_info); 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);
} }
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* (mailto:sjralston1@netscape.net) * (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com) * (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 $
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/* /*
...@@ -80,8 +80,8 @@ ...@@ -80,8 +80,8 @@
#define COPYRIGHT "Copyright (c) 1999-2002 " MODULEAUTHOR #define COPYRIGHT "Copyright (c) 1999-2002 " MODULEAUTHOR
#endif #endif
#define MPT_LINUX_VERSION_COMMON "2.01.06" #define MPT_LINUX_VERSION_COMMON "2.02.01.01"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.01.06" #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.02.01.01"
#define WHAT_MAGIC_STRING "@" "(" "#" ")" #define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \ #define show_mptmod_ver(s,ver) \
...@@ -379,7 +379,11 @@ typedef struct _VirtDevice { ...@@ -379,7 +379,11 @@ typedef struct _VirtDevice {
u8 maxWidth; /* 0 if narrow, 1 if wide*/ u8 maxWidth; /* 0 if narrow, 1 if wide*/
u8 negoFlags; /* bit field, 0 if WDTR/SDTR/QAS allowed */ u8 negoFlags; /* bit field, 0 if WDTR/SDTR/QAS allowed */
u8 raidVolume; /* set, if RAID Volume */ u8 raidVolume; /* set, if RAID Volume */
#ifdef ABORT_FIX
u8 numAborts;
#else
u8 rsvd; u8 rsvd;
#endif
u16 rsvd1raid; u16 rsvd1raid;
int npaths; int npaths;
u16 fc_phys_lun; u16 fc_phys_lun;
...@@ -422,6 +426,7 @@ typedef struct _VirtDevice { ...@@ -422,6 +426,7 @@ typedef struct _VirtDevice {
#define MPT_TARGET_FLAGS_VALID_INQUIRY 0x02 #define MPT_TARGET_FLAGS_VALID_INQUIRY 0x02
#define MPT_TARGET_FLAGS_VALID_SENSE 0x04 #define MPT_TARGET_FLAGS_VALID_SENSE 0x04
#define MPT_TARGET_FLAGS_Q_YES 0x08 #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_WIDE 0x01
#define MPT_TARGET_NO_NEGO_SYNC 0x02 #define MPT_TARGET_NO_NEGO_SYNC 0x02
...@@ -511,7 +516,7 @@ typedef struct _mpt_ioctl_events { ...@@ -511,7 +516,7 @@ typedef struct _mpt_ioctl_events {
#define MPT_SCSICFG_NEGOTIATE 0x01 /* Negotiate on next IO */ #define MPT_SCSICFG_NEGOTIATE 0x01 /* Negotiate on next IO */
#define MPT_SCSICFG_NEED_DV 0x02 /* Schedule DV */ #define MPT_SCSICFG_NEED_DV 0x02 /* Schedule DV */
#define MPT_SCSICFG_DV_PENDING 0x04 /* DV on this physical id pending */ #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 */ #define MPT_SCSICFG_BLK_NEGO 0x10 /* WriteSDP1 with WDTR and SDTR disabled */
/* Args passed to writeSDP1: */ /* Args passed to writeSDP1: */
...@@ -622,7 +627,8 @@ typedef struct _MPT_ADAPTER ...@@ -622,7 +627,8 @@ typedef struct _MPT_ADAPTER
LANPage1_t lan_cnfg_page1; LANPage1_t lan_cnfg_page1;
u8 FirstWhoInit; u8 FirstWhoInit;
u8 upload_fw; /* If set, do a fw upload */ 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; } MPT_ADAPTER;
...@@ -707,6 +713,13 @@ typedef struct _mpt_sge { ...@@ -707,6 +713,13 @@ typedef struct _mpt_sge {
#define dsgprintk(x) #define dsgprintk(x)
#endif #endif
#if defined(MPT_DEBUG_DL) || defined(MPT_DEBUG)
#define ddlprintk(x) printk x
#else
#define ddlprintk(x)
#endif
#ifdef MPT_DEBUG_DV #ifdef MPT_DEBUG_DV
#define ddvprintk(x) printk x #define ddvprintk(x) printk x
#else #else
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* (mailto:sjralston1@netscape.net) * (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com) * (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 $
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/* /*
...@@ -637,8 +637,8 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned ...@@ -637,8 +637,8 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
iocnumX = khdr.iocnum & 0xFF; iocnumX = khdr.iocnum & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
(iocp == NULL)) { (iocp == NULL)) {
printk(KERN_ERR "%s::mptctl_ioctl() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_ioctl() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnumX); __FILE__, __LINE__, iocnumX));
return -ENODEV; return -ENODEV;
} }
...@@ -708,9 +708,9 @@ static int mptctl_do_reset(unsigned long arg) ...@@ -708,9 +708,9 @@ static int mptctl_do_reset(unsigned long arg)
} }
if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) { if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) {
printk(KERN_ERR "%s@%d::mptctl_do_reset - ioc%d not found!\n", dtmprintk((KERN_ERR "%s@%d::mptctl_do_reset - ioc%d not found!\n",
__FILE__, __LINE__, krinfo.hdr.iocnum); __FILE__, __LINE__, krinfo.hdr.iocnum));
return -ENXIO; /* (-6) No such device or address */ return -ENODEV; /* (-6) No such device or address */
} }
if (mpt_HardResetHandler(iocp, NO_SLEEP) != 0) { if (mpt_HardResetHandler(iocp, NO_SLEEP) != 0) {
...@@ -816,9 +816,9 @@ mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen) ...@@ -816,9 +816,9 @@ mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen)
dctlprintk((KERN_INFO "DbG: kfwdl.ioc = %04xh\n", ioc)); dctlprintk((KERN_INFO "DbG: kfwdl.ioc = %04xh\n", ioc));
if ((ioc = mpt_verify_adapter(ioc, &iocp)) < 0) { if ((ioc = mpt_verify_adapter(ioc, &iocp)) < 0) {
printk("%s@%d::_ioctl_fwdl - ioc%d not found!\n", dtmprintk(("%s@%d::_ioctl_fwdl - ioc%d not found!\n",
__FILE__, __LINE__, ioc); __FILE__, __LINE__, ioc));
return -ENXIO; /* (-6) No such device or address */ return -ENODEV; /* (-6) No such device or address */
} }
/* Valid device. Get a message frame and construct the FW download message. /* Valid device. Get a message frame and construct the FW download message.
...@@ -1252,8 +1252,8 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) ...@@ -1252,8 +1252,8 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -1379,8 +1379,8 @@ mptctl_gettargetinfo (unsigned long arg) ...@@ -1379,8 +1379,8 @@ mptctl_gettargetinfo (unsigned long arg)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -1510,8 +1510,8 @@ mptctl_readtest (unsigned long arg) ...@@ -1510,8 +1510,8 @@ mptctl_readtest (unsigned long arg)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_readtest() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_readtest() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -1568,8 +1568,8 @@ mptctl_eventquery (unsigned long arg) ...@@ -1568,8 +1568,8 @@ mptctl_eventquery (unsigned long arg)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_eventquery() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_eventquery() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -1606,8 +1606,8 @@ mptctl_eventenable (unsigned long arg) ...@@ -1606,8 +1606,8 @@ mptctl_eventenable (unsigned long arg)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_eventenable() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_eventenable() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -1654,8 +1654,8 @@ mptctl_eventreport (unsigned long arg) ...@@ -1654,8 +1654,8 @@ mptctl_eventreport (unsigned long arg)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_eventreport() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_eventreport() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -1708,8 +1708,8 @@ mptctl_replace_fw (unsigned long arg) ...@@ -1708,8 +1708,8 @@ mptctl_replace_fw (unsigned long arg)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_replace_fw() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -1794,8 +1794,8 @@ mptctl_mpt_command (unsigned long arg) ...@@ -1794,8 +1794,8 @@ mptctl_mpt_command (unsigned long arg)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_mpt_command() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -1842,8 +1842,8 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local) ...@@ -1842,8 +1842,8 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
if (!ioc->ioctl) { if (!ioc->ioctl) {
...@@ -1948,10 +1948,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local) ...@@ -1948,10 +1948,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
if (pTarget &&(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) if (pTarget &&(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES))
qtag = MPI_SCSIIO_CONTROL_SIMPLEQ; qtag = MPI_SCSIIO_CONTROL_SIMPLEQ;
else {
rc = -EPERM;
goto done_free_mem;
}
/* Have the IOCTL driver set the direction based /* Have the IOCTL driver set the direction based
* on the dataOutSize (ordering issue with Sparc). * on the dataOutSize (ordering issue with Sparc).
...@@ -2334,7 +2330,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local) ...@@ -2334,7 +2330,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
this_sge++; /* go to next structure */ this_sge++; /* go to next structure */
this_alloc = bufOut.len; this_alloc = bufOut.len;
pci_free_consistent(ioc->pcidev, pci_free_consistent(ioc->pcidev,
this_alloc, (void *) &bufOut, dma_addr); this_alloc, (void *) bufOut.kptr, dma_addr);
} }
if (bufIn.kptr != NULL ) { if (bufIn.kptr != NULL ) {
...@@ -2342,7 +2338,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local) ...@@ -2342,7 +2338,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
this_alloc = bufIn.len; this_alloc = bufIn.len;
pci_free_consistent(ioc->pcidev, pci_free_consistent(ioc->pcidev,
this_alloc, (void *) &bufIn, dma_addr); this_alloc, (void *) bufIn.kptr, dma_addr);
} }
this_alloc = sgSize * sizeof(MptSge_t); this_alloc = sgSize * sizeof(MptSge_t);
...@@ -2393,8 +2389,8 @@ mptctl_compaq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2393,8 +2389,8 @@ mptctl_compaq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
(iocp == NULL)) { (iocp == NULL)) {
printk(KERN_ERR "%s::mptctl_compaq_ioctl() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_compaq_ioctl() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnumX); __FILE__, __LINE__, iocnumX));
return -ENODEV; return -ENODEV;
} }
...@@ -2466,8 +2462,8 @@ mptctl_cpq_getpciinfo(unsigned long arg) ...@@ -2466,8 +2462,8 @@ mptctl_cpq_getpciinfo(unsigned long arg)
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_pciinfo() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_pciinfo() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -2567,8 +2563,8 @@ mptctl_cpq_getdriver(unsigned long arg) ...@@ -2567,8 +2563,8 @@ mptctl_cpq_getdriver(unsigned long arg)
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_cpq_getdriver() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_cpq_getdriver() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -2631,8 +2627,8 @@ mptctl_cpq_ctlr_status(unsigned long arg) ...@@ -2631,8 +2627,8 @@ mptctl_cpq_ctlr_status(unsigned long arg)
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_cpq_ctlr_status() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_cpq_ctlr_status() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -2687,8 +2683,8 @@ mptctl_cpq_target_address(unsigned long arg) ...@@ -2687,8 +2683,8 @@ mptctl_cpq_target_address(unsigned long arg)
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_cpq_target_address() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_cpq_target_address() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -2790,8 +2786,8 @@ mptctl_cpq_passthru(unsigned long arg) ...@@ -2790,8 +2786,8 @@ mptctl_cpq_passthru(unsigned long arg)
iocnumX = karg.lc & 0xFF; iocnumX = karg.lc & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR "%s::mptctl_cpq_passthru() @%d - ioc%d not found!\n", dtmprintk((KERN_ERR "%s::mptctl_cpq_passthru() @%d - ioc%d not found!\n",
__FILE__, __LINE__, iocnum); __FILE__, __LINE__, iocnum));
return -ENODEV; return -ENODEV;
} }
...@@ -2920,12 +2916,12 @@ mptctl_compaq_scsiio(VENDOR_IOCTL_REQ *pVenReq, cpqfc_passthru_t *pPass) ...@@ -2920,12 +2916,12 @@ mptctl_compaq_scsiio(VENDOR_IOCTL_REQ *pVenReq, cpqfc_passthru_t *pPass)
static struct file_operations mptctl_fops = { static struct file_operations mptctl_fops = {
owner_THIS_MODULE owner_THIS_MODULE
llseek: no_llseek, .llseek = no_llseek,
read: mptctl_read, .read = mptctl_read,
write: mptctl_write, .write = mptctl_write,
ioctl: mptctl_ioctl, .ioctl = mptctl_ioctl,
open: mptctl_open, .open = mptctl_open,
release: mptctl_release, .release = mptctl_release,
}; };
static struct miscdevice mptctl_miscdev = { static struct miscdevice mptctl_miscdev = {
...@@ -2975,8 +2971,8 @@ sparc32_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd, ...@@ -2975,8 +2971,8 @@ sparc32_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd,
iocnumX = kfw32.iocnum & 0xFF; iocnumX = kfw32.iocnum & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
(iocp == NULL)) { (iocp == NULL)) {
printk(KERN_ERR MYNAM "::sparc32_mptfwxfer_ioctl @%d - ioc%d not found!\n", dtmprintk((KERN_ERR MYNAM "::sparc32_mptfwxfer_ioctl @%d - ioc%d not found!\n",
__LINE__, iocnumX); __LINE__, iocnumX));
return -ENODEV; return -ENODEV;
} }
...@@ -3015,8 +3011,8 @@ sparc32_mpt_command(unsigned int fd, unsigned int cmd, ...@@ -3015,8 +3011,8 @@ sparc32_mpt_command(unsigned int fd, unsigned int cmd,
iocnumX = karg32.hdr.iocnum & 0xFF; iocnumX = karg32.hdr.iocnum & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
(iocp == NULL)) { (iocp == NULL)) {
printk(KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n", dtmprintk((KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n",
__LINE__, iocnumX); __LINE__, iocnumX));
return -ENODEV; return -ENODEV;
} }
...@@ -3072,8 +3068,8 @@ sparc32_mptctl_cpq_passthru(unsigned int fd, unsigned int cmd, ...@@ -3072,8 +3068,8 @@ sparc32_mptctl_cpq_passthru(unsigned int fd, unsigned int cmd,
iocnumX = karg32.lc & 0xFF; iocnumX = karg32.lc & 0xFF;
if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) || if (((iocnum = mpt_verify_adapter(iocnumX, &ioc)) < 0) ||
(ioc == NULL)) { (ioc == NULL)) {
printk(KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n", dtmprintk((KERN_ERR MYNAM "::sparc32_mpt_command @%d - ioc%d not found!\n",
__LINE__, iocnumX); __LINE__, iocnumX));
return -ENODEV; return -ENODEV;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* (mailto:sjralston1@netscape.net) * (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com) * (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 $
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/* /*
...@@ -110,6 +110,7 @@ typedef struct _BIG_SENSE_BUF { ...@@ -110,6 +110,7 @@ typedef struct _BIG_SENSE_BUF {
#define MPT_SCANDV_SENSE (0x00000002) #define MPT_SCANDV_SENSE (0x00000002)
#define MPT_SCANDV_SOME_ERROR (0x00000004) #define MPT_SCANDV_SOME_ERROR (0x00000004)
#define MPT_SCANDV_SELECTION_TIMEOUT (0x00000008) #define MPT_SCANDV_SELECTION_TIMEOUT (0x00000008)
#define MPT_SCANDV_ISSUE_SENSE (0x00000010)
#define MPT_SCANDV_MAX_RETRIES (10) #define MPT_SCANDV_MAX_RETRIES (10)
...@@ -183,7 +184,7 @@ static int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pE ...@@ -183,7 +184,7 @@ static int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pE
static VirtDevice *mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen); 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); 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 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_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 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 int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags);
...@@ -198,7 +199,7 @@ static int mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io); ...@@ -198,7 +199,7 @@ static int mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io);
static void mptscsih_domainValidation(void *hd); static void mptscsih_domainValidation(void *hd);
static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id); static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id);
static void mptscsih_qas_check(MPT_SCSI_HOST *hd); 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_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage);
static void mptscsih_fillbuf(char *buffer, int size, int index, int width); static void mptscsih_fillbuf(char *buffer, int size, int index, int width);
#endif #endif
...@@ -226,11 +227,11 @@ static int ScsiScanDvCtx = -1; /* Used only for bus scan and dv */ ...@@ -226,11 +227,11 @@ static int ScsiScanDvCtx = -1; /* Used only for bus scan and dv */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,28) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,28)
static struct proc_dir_entry proc_mpt_scsihost = static struct proc_dir_entry proc_mpt_scsihost =
{ {
low_ino: PROC_SCSI_MPT, .low_ino = PROC_SCSI_MPT,
namelen: 8, .namelen = 8,
name: "mptscsih", .name = "mptscsih",
mode: S_IFDIR | S_IRUGO | S_IXUGO, .mode = S_IFDIR | S_IRUGO | S_IXUGO,
nlink: 2, .nlink = 2,
}; };
#endif #endif
...@@ -323,8 +324,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -323,8 +324,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
return 1; return 1;
} }
dmfprintk((MYIOC_s_INFO_FMT "ScsiDone (mf=%p,mr=%p,sc=%p)\n", dmfprintk((MYIOC_s_INFO_FMT "ScsiDone (mf=%p,mr=%p,sc=%p,idx=%d)\n",
ioc->name, mf, mr, sc)); ioc->name, mf, mr, sc, req_idx));
atomic_dec(&queue_depth); atomic_dec(&queue_depth);
...@@ -351,9 +352,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -351,9 +352,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
} }
} }
clear_sense_flag(hd, pScsiReq); clear_sense_flag(hd, pScsiReq);
if (hd->is_spi)
mptscsih_set_dvflags(hd, pScsiReq, sc->buffer);
} else { } else {
u32 xfer_cnt; u32 xfer_cnt;
u16 status; u16 status;
...@@ -484,9 +482,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -484,9 +482,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
sc->buffer, sc->buffer,
xfer_cnt); xfer_cnt);
} }
if (hd->is_spi)
mptscsih_set_dvflags(hd, pScsiReq, sc->buffer);
break; break;
case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */
...@@ -568,9 +563,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -568,9 +563,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
sc->buffer, sc->buffer,
xfer_cnt); xfer_cnt);
} }
if (hd->is_spi)
mptscsih_set_dvflags(hd, pScsiReq, sc->buffer);
break; break;
case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */
...@@ -919,11 +911,21 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd) ...@@ -919,11 +911,21 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
dmfprintk(( "flush: ScsiDone (mf=%p,sc=%p)\n", dmfprintk(( "flush: ScsiDone (mf=%p,sc=%p)\n",
mf, SCpnt)); mf, SCpnt));
/* Set status /* Set status, free OS resources (SG DMA buffers)
* Do OS callback * Do OS callback
* Free chain buffers * Free driver resources (chain, msg buffers)
* Free message frame
*/ */
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->result = DID_RESET << 16;
SCpnt->host_scribble = NULL; SCpnt->host_scribble = NULL;
MPT_HOST_LOCK(flags); MPT_HOST_LOCK(flags);
...@@ -937,9 +939,77 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd) ...@@ -937,9 +939,77 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
mpt_free_msg_frame(ScsiDoneCtx, hd->ioc->id, mf); mpt_free_msg_frame(ScsiDoneCtx, hd->ioc->id, mf);
} }
} }
return; 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 * mptscsih_initChainBuffers - Allocate memory for and initialize
...@@ -1156,8 +1226,7 @@ mptscsih_detect(Scsi_Host_Template *tpnt) ...@@ -1156,8 +1226,7 @@ mptscsih_detect(Scsi_Host_Template *tpnt)
#endif #endif
sh = scsi_register(tpnt, sizeof(MPT_SCSI_HOST)); sh = scsi_register(tpnt, sizeof(MPT_SCSI_HOST));
if (sh != NULL) { if (sh != NULL) {
save_flags(flags); mptscsih_save_flags(flags);
cli();
sh->io_port = 0; sh->io_port = 0;
sh->n_io_port = 0; sh->n_io_port = 0;
sh->irq = 0; sh->irq = 0;
...@@ -1221,7 +1290,7 @@ mptscsih_detect(Scsi_Host_Template *tpnt) ...@@ -1221,7 +1290,7 @@ mptscsih_detect(Scsi_Host_Template *tpnt)
*/ */
scsi_set_pci_device(sh, this->pcidev); scsi_set_pci_device(sh, this->pcidev);
restore_flags(flags); mptscsih_restore_flags(flags);
hd = (MPT_SCSI_HOST *) sh->hostdata; hd = (MPT_SCSI_HOST *) sh->hostdata;
hd->ioc = this; hd->ioc = this;
...@@ -1358,7 +1427,11 @@ mptscsih_detect(Scsi_Host_Template *tpnt) ...@@ -1358,7 +1427,11 @@ mptscsih_detect(Scsi_Host_Template *tpnt)
hd->ioc->spi_data.forceDv = 0; hd->ioc->spi_data.forceDv = 0;
for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
hd->ioc->spi_data.dvStatus[ii] = MPT_SCSICFG_NEGOTIATE; 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 ddvprintk((MYIOC_s_INFO_FMT
"dv %x width %x factor %x \n", "dv %x width %x factor %x \n",
...@@ -1456,6 +1529,8 @@ mptscsih_release(struct Scsi_Host *host) ...@@ -1456,6 +1529,8 @@ mptscsih_release(struct Scsi_Host *host)
if (hd != NULL) { if (hd != NULL) {
int sz1, sz2, sz3, sztarget=0; int sz1, sz2, sz3, sztarget=0;
int szr2chain = 0;
int szc2chain = 0;
int szchain = 0; int szchain = 0;
int szQ = 0; int szQ = 0;
int scale; int scale;
...@@ -1480,20 +1555,20 @@ mptscsih_release(struct Scsi_Host *host) ...@@ -1480,20 +1555,20 @@ mptscsih_release(struct Scsi_Host *host)
} }
if (hd->ReqToChain != NULL) { if (hd->ReqToChain != NULL) {
szchain += scale * hd->ioc->req_depth * sizeof(int); szr2chain = scale * hd->ioc->req_depth * sizeof(int);
kfree(hd->ReqToChain); kfree(hd->ReqToChain);
hd->ReqToChain = NULL; hd->ReqToChain = NULL;
} }
if (hd->ChainToChain != NULL) { if (hd->ChainToChain != NULL) {
szchain += scale * hd->ioc->req_depth * sizeof(int); szc2chain = scale * hd->ioc->req_depth * sizeof(int);
kfree(hd->ChainToChain); kfree(hd->ChainToChain);
hd->ChainToChain = NULL; hd->ChainToChain = NULL;
} }
if (hd->ChainBuffer != NULL) { if (hd->ChainBuffer != NULL) {
sz2 = scale * hd->ioc->req_depth * hd->ioc->req_sz; sz2 = scale * hd->ioc->req_depth * hd->ioc->req_sz;
szchain += sz2; szchain = szr2chain + szc2chain + sz2;
pci_free_consistent(hd->ioc->pcidev, sz2, pci_free_consistent(hd->ioc->pcidev, sz2,
hd->ChainBuffer, hd->ChainBufferDMA); hd->ChainBuffer, hd->ChainBufferDMA);
...@@ -1962,17 +2037,22 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) ...@@ -1962,17 +2037,22 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
mod_timer(&SCpnt->eh_timeout, jiffies + 40 * HZ); mod_timer(&SCpnt->eh_timeout, jiffies + 40 * HZ);
issueCmd = 0; issueCmd = 0;
} }
/* Set the DV flags.
*/
if (dvStatus & MPT_SCSICFG_DV_NOT_DONE)
mptscsih_set_dvflags(hd, pScsiReq);
#endif #endif
} }
} }
if (issueCmd) { if (issueCmd) {
mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf);
dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p)\n", dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n",
hd->ioc->name, SCpnt)); hd->ioc->name, SCpnt, mf, my_idx));
} else { } else {
ddvtprintk((MYIOC_s_INFO_FMT "Pending SCSI cmd (%p)\n", ddvtprintk((MYIOC_s_INFO_FMT "Pending cmd=%p idx %d\n",
hd->ioc->name, SCpnt)); hd->ioc->name, SCpnt, my_idx));
/* Place this command on the pendingQ if possible */ /* Place this command on the pendingQ if possible */
spin_lock_irqsave(&hd->freedoneQlock, flags); spin_lock_irqsave(&hd->freedoneQlock, flags);
if (!Q_IS_EMPTY(&hd->freeQ)) { if (!Q_IS_EMPTY(&hd->freeQ)) {
...@@ -2453,7 +2533,7 @@ mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort, ...@@ -2453,7 +2533,7 @@ mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int ctx2abort,
} }
#endif #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", dtmprintk((MYIOC_s_INFO_FMT "Falling through to HardReset! \n",
hd->ioc->name)); hd->ioc->name));
rc = mpt_HardResetHandler(hd->ioc, sleepFlag); rc = mpt_HardResetHandler(hd->ioc, sleepFlag);
...@@ -3507,51 +3587,7 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m ...@@ -3507,51 +3587,7 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m
} }
#ifdef DROP_TEST #ifdef DROP_TEST
{ mptscsih_flush_drop_test(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 {
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;
}
}
#endif #endif
#ifndef MPT_SCSI_USE_NEW_EH #ifndef MPT_SCSI_USE_NEW_EH
...@@ -3574,9 +3610,12 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m ...@@ -3574,9 +3610,12 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m
/* /*
* This is anyones guess quite frankly. * This is anyones guess quite frankly.
*/ */
int int
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28)
mptscsih_bios_param(Disk * disk, struct block_device *dev, int *ip) 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; int size;
...@@ -3648,10 +3687,25 @@ mptscsih_select_queue_depths(struct Scsi_Host *sh, Scsi_Device *sdList) ...@@ -3648,10 +3687,25 @@ mptscsih_select_queue_depths(struct Scsi_Host *sh, Scsi_Device *sdList)
* 0 = _DIR_NONE changed to SCSI_DATA_NONE (3) * 0 = _DIR_NONE changed to SCSI_DATA_NONE (3)
* -1 = _DATA_IN changed to SCSI_DATA_READ (2) * -1 = _DATA_IN changed to SCSI_DATA_READ (2)
* If the direction is unknown, fall through to original code. * 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 static int
mptscsih_io_direction(Scsi_Cmnd *cmd) 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 LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
if (cmd->sc_data_direction != SCSI_DATA_UNKNOWN) if (cmd->sc_data_direction != SCSI_DATA_UNKNOWN)
return cmd->sc_data_direction; return cmd->sc_data_direction;
...@@ -3756,6 +3810,20 @@ copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply ...@@ -3756,6 +3810,20 @@ copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply
sz = SCSI_STD_SENSE_BYTES; sz = SCSI_STD_SENSE_BYTES;
memcpy(target->sense, sense_data, sz); memcpy(target->sense, sense_data, sz);
target->tflags |= MPT_TARGET_FLAGS_VALID_SENSE; 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. /* Log SMART data (asc = 0x5D, non-IM case only) if required.
...@@ -3849,7 +3917,7 @@ mptscsih_search_pendingQ(MPT_SCSI_HOST *hd, int scpnt_idx) ...@@ -3849,7 +3917,7 @@ mptscsih_search_pendingQ(MPT_SCSI_HOST *hd, int scpnt_idx)
MPT_FRAME_HDR *mf = NULL; MPT_FRAME_HDR *mf = NULL;
MPT_FRAME_HDR *cmdMfPtr = 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); cmdMfPtr = MPT_INDEX_2_MFPTR(hd->ioc, scpnt_idx);
spin_lock_irqsave(&hd->freedoneQlock, flags); spin_lock_irqsave(&hd->freedoneQlock, flags);
if (!Q_IS_EMPTY(&hd->pendingQ)) { if (!Q_IS_EMPTY(&hd->pendingQ)) {
...@@ -3889,7 +3957,7 @@ post_pendingQ_commands(MPT_SCSI_HOST *hd) ...@@ -3889,7 +3957,7 @@ post_pendingQ_commands(MPT_SCSI_HOST *hd)
/* Flush the 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) { while (1) {
spin_lock_irqsave(&hd->freedoneQlock, flags); spin_lock_irqsave(&hd->freedoneQlock, flags);
if (Q_IS_EMPTY(&hd->pendingQ)) { if (Q_IS_EMPTY(&hd->pendingQ)) {
...@@ -3917,8 +3985,15 @@ post_pendingQ_commands(MPT_SCSI_HOST *hd) ...@@ -3917,8 +3985,15 @@ post_pendingQ_commands(MPT_SCSI_HOST *hd)
} }
mptscsih_put_msgframe(ScsiDoneCtx, hd->ioc->id, mf); 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; return;
...@@ -3963,40 +4038,7 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) ...@@ -3963,40 +4038,7 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
/* 2a. Drop Test Command. /* 2a. Drop Test Command.
*/ */
#ifdef DROP_TEST #ifdef DROP_TEST
{ mptscsih_flush_drop_test(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 {
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;
}
#endif #endif
/* 2b. Reply to OS all known outstanding I/O commands. /* 2b. Reply to OS all known outstanding I/O commands.
...@@ -4161,7 +4203,7 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) ...@@ -4161,7 +4203,7 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
while (numPDisk) { while (numPDisk) {
if (physDiskNum == pPDisk->PhysDiskNum) { 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; pSpi->forceDv = MPT_SCSICFG_NEED_DV;
ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID)); ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID));
break; break;
...@@ -4596,6 +4638,26 @@ int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop) ...@@ -4596,6 +4638,26 @@ int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop)
return 0; 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... * Protect ourselves...
*/ */
...@@ -4715,7 +4777,8 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char * ...@@ -4715,7 +4777,8 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *
} }
if (vdev && data) { 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. /* Copy the inquiry data - if we haven't yet.
*/ */
...@@ -4726,10 +4789,19 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char * ...@@ -4726,10 +4789,19 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *
/* Update the target capabilities /* Update the target capabilities
*/ */
if (dlen > 56) if (dlen > 56) {
mptscsih_setTargetNegoParms(hd, vdev, data[56]); mptscsih_setTargetNegoParms(hd, vdev, data[56]);
else vdev->tflags |= MPT_TARGET_FLAGS_VALID_56;
} else
mptscsih_setTargetNegoParms(hd, vdev, 0); 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 /* Is LUN supported? If so, upper 3 bits will be 0
...@@ -4765,7 +4837,7 @@ void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byt ...@@ -4765,7 +4837,7 @@ void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byt
/* Set flags based on Inquiry data /* Set flags based on Inquiry data
*/ */
if (target->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) { if (target->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) {
version = target->inq_data[2] & 0x03; version = target->inq_data[2] & 0x07;
if (version < 2) { if (version < 2) {
width = 0; width = 0;
factor = MPT_ULTRA2; factor = MPT_ULTRA2;
...@@ -4899,43 +4971,39 @@ static void clear_sense_flag(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq) ...@@ -4899,43 +4971,39 @@ static void clear_sense_flag(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq)
return; 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) * 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; return;
if (hd->negoNvram != 0) cmd = pReq->CDB[0];
return;
if ((cmd == READ_CAPACITY) || (cmd == MODE_SENSE) || if ((cmd == READ_CAPACITY) || (cmd == MODE_SENSE)) {
((cmd == INQUIRY) && ((data[0] & 0x1F) == 0x01))) { ScsiCfgData *pSpi = &hd->ioc->spi_data;
u8 dvStatus = hd->ioc->spi_data.dvStatus[pReq->TargetID]; if ((pSpi->isRaid & (1 << pReq->TargetID)) && pSpi->pIocPg3) {
if (!(dvStatus & MPT_SCSICFG_DV_DONE)) { /* Set NEED_DV for all hidden disks
ScsiCfgData *pSpi = &hd->ioc->spi_data; */
if ((pSpi->isRaid & (1 << pReq->TargetID)) && pSpi->pIocPg3) { Ioc3PhysDisk_t *pPDisk = pSpi->pIocPg3->PhysDisk;
/* Set NEED_DV for all hidden disks int numPDisk = pSpi->pIocPg3->NumPhysDisks;
*/
Ioc3PhysDisk_t *pPDisk = pSpi->pIocPg3->PhysDisk; while (numPDisk) {
int numPDisk = pSpi->pIocPg3->NumPhysDisks; pSpi->dvStatus[pPDisk->PhysDiskID] |= MPT_SCSICFG_NEED_DV;
ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID));
while (numPDisk) { pPDisk++;
pSpi->dvStatus[pPDisk->PhysDiskID] |= MPT_SCSICFG_NEED_DV; numPDisk--;
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", pSpi->dvStatus[pReq->TargetID] |= MPT_SCSICFG_NEED_DV;
pReq->TargetID)); ddvtprintk(("NEED_DV set for visible disk id %d\n", pReq->TargetID));
};
} }
} }
...@@ -5036,6 +5104,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags) ...@@ -5036,6 +5104,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
u8 offset; u8 offset;
u8 bus = 0; u8 bus = 0;
u8 negoFlags; u8 negoFlags;
u8 maxwidth, maxoffset, maxfactor;
if (ioc->spi_data.sdp1length == 0) if (ioc->spi_data.sdp1length == 0)
return 0; return 0;
...@@ -5049,48 +5118,54 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags) ...@@ -5049,48 +5118,54 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
} }
for (; id <= maxid; id++) { for (; id <= maxid; id++) {
if (id == ioc->pfacts[portnum].PortSCSIID) if (id == ioc->pfacts[portnum].PortSCSIID)
continue; continue;
if (flags & MPT_SCSICFG_USE_NVRAM) { /* Use NVRAM to get adapter and target maximums
/* Use NVRAM, adapter maximums and target settings. * Data over-riden by target structure information, if present
* Data over-riden by target structure information, if present */
*/ maxwidth = ioc->spi_data.maxBusWidth;
width = ioc->spi_data.maxBusWidth; maxoffset = ioc->spi_data.maxSyncOffset;
offset = ioc->spi_data.maxSyncOffset; maxfactor = ioc->spi_data.minSyncFactor;
factor = ioc->spi_data.minSyncFactor; if (ioc->spi_data.nvram && (ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) {
if (ioc->spi_data.nvram && (ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) { nvram = ioc->spi_data.nvram[id];
nvram = ioc->spi_data.nvram[id];
if (maxwidth)
if (width) maxwidth = nvram & MPT_NVRAM_WIDE_DISABLE ? 0 : 1;
width = nvram & MPT_NVRAM_WIDE_DISABLE ? 0 : 1;
if (maxoffset > 0) {
if (offset > 0) { maxfactor = (nvram & MPT_NVRAM_SYNC_MASK) >> 8;
factor = (nvram & MPT_NVRAM_SYNC_MASK) >> 8; if (maxfactor == 0) {
if (factor == 0) { /* Key for async */
/* Key for async */ maxfactor = MPT_ASYNC;
factor = MPT_ASYNC; maxoffset = 0;
offset = 0; } else if (maxfactor < ioc->spi_data.minSyncFactor) {
} else if (factor < ioc->spi_data.minSyncFactor) { maxfactor = ioc->spi_data.minSyncFactor;
factor = ioc->spi_data.minSyncFactor; }
} } else
} else maxfactor = MPT_ASYNC;
factor = MPT_ASYNC; }
}
/* Set the negotiation flags. /* Set the negotiation flags.
*/ */
negoFlags = ioc->spi_data.noQas; negoFlags = ioc->spi_data.noQas;
if (!width) if (!maxwidth)
negoFlags |= MPT_TARGET_NO_NEGO_WIDE; negoFlags |= MPT_TARGET_NO_NEGO_WIDE;
if (!offset) if (!maxoffset)
negoFlags |= MPT_TARGET_NO_NEGO_SYNC; negoFlags |= MPT_TARGET_NO_NEGO_SYNC;
if (flags & MPT_SCSICFG_USE_NVRAM) {
width = maxwidth;
factor = maxfactor;
offset = maxoffset;
} else { } else {
width = 0; width = 0;
factor = MPT_ASYNC; factor = MPT_ASYNC;
offset = 0; 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 id is not a raid volume, get the updated
...@@ -5107,15 +5182,9 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags) ...@@ -5107,15 +5182,9 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
if (flags & MPT_SCSICFG_BLK_NEGO) if (flags & MPT_SCSICFG_BLK_NEGO)
negoFlags = MPT_TARGET_NO_NEGO_WIDE | MPT_TARGET_NO_NEGO_SYNC; 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, mptscsih_setDevicePage1Flags(width, factor, offset,
&requested, &configuration, negoFlags); &requested, &configuration, negoFlags);
/* Get a MF for this command. /* Get a MF for this command.
*/ */
if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc->id)) == NULL) { if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc->id)) == NULL) {
...@@ -5124,6 +5193,10 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags) ...@@ -5124,6 +5193,10 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
return -EAGAIN; 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. /* Set the request and the data pointers.
* Request takes: 36 bytes (32 bit SGE) * Request takes: 36 bytes (32 bit SGE)
* SCSI Device Page 1 requires 16 bytes * SCSI Device Page 1 requires 16 bytes
...@@ -5255,7 +5328,7 @@ static void mptscsih_taskmgmt_timeout(unsigned long data) ...@@ -5255,7 +5328,7 @@ static void mptscsih_taskmgmt_timeout(unsigned long data)
* *
* Remark: Sets a completion code and (possibly) saves sense data * Remark: Sets a completion code and (possibly) saves sense data
* in the IOC member localReply structure. * 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 static int
mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
...@@ -5280,17 +5353,18 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -5280,17 +5353,18 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
pReq = (SCSIIORequest_t *) mf; pReq = (SCSIIORequest_t *) mf;
if (mf != hd->cmdPtr) { if (mf != hd->cmdPtr) {
printk(MYIOC_s_WARN_FMT "ScanDvComplete (mf=%p, cmdPtr=%p)\n", printk(MYIOC_s_WARN_FMT "ScanDvComplete (mf=%p, cmdPtr=%p, idx=%d)\n",
hd->ioc->name, (void *)mf, (void *) hd->cmdPtr); hd->ioc->name, (void *)mf, (void *) hd->cmdPtr, req_idx);
} }
hd->cmdPtr = NULL; hd->cmdPtr = NULL;
ddvprintk((MYIOC_s_INFO_FMT "ScanDvComplete (mf=%p,mr=%p)\n", ddvprintk((MYIOC_s_INFO_FMT "ScanDvComplete (mf=%p,mr=%p,idx=%d)\n",
hd->ioc->name, mf, mr)); hd->ioc->name, mf, mr, req_idx));
atomic_dec(&queue_depth); atomic_dec(&queue_depth);
hd->pLocal = &hd->localReply; hd->pLocal = &hd->localReply;
hd->pLocal->scsiStatus = 0;
/* If target struct exists, clear sense valid flag. /* If target struct exists, clear sense valid flag.
*/ */
...@@ -5306,7 +5380,7 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -5306,7 +5380,7 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK; 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, status, pReply->SCSIState, pReply->SCSIStatus,
le32_to_cpu(pReply->IOCLogInfo))); le32_to_cpu(pReply->IOCLogInfo)));
...@@ -5370,16 +5444,22 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -5370,16 +5444,22 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
ddvprintk((KERN_NOTICE " Check Condition, sense ptr %p\n", ddvprintk((KERN_NOTICE " Check Condition, sense ptr %p\n",
sense_data)); sense_data));
} else if (pReply->SCSIState & (MPI_SCSI_STATE_AUTOSENSE_FAILED | } else if (pReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_FAILED) {
MPI_SCSI_STATE_NO_SCSI_STATUS)) { 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; 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; completionCode = MPT_SCANDV_DID_RESET;
} else { else {
/* If no error, this will be equivalent /* If no error, this will be equivalent
* to MPT_SCANDV_GOOD * to MPT_SCANDV_GOOD
*/ */
completionCode = (int) pReply->SCSIStatus; completionCode = MPT_SCANDV_GOOD;
hd->pLocal->scsiStatus = pReply->SCSIStatus;
} }
break; break;
...@@ -5396,7 +5476,7 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -5396,7 +5476,7 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
} /* switch(status) */ } /* switch(status) */
ddvprintk((KERN_NOTICE " completionCode set to %08xh\n", ddvtprintk((KERN_NOTICE " completionCode set to %08xh\n",
completionCode)); completionCode));
} /* end of address reply case */ } /* end of address reply case */
...@@ -5619,6 +5699,14 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io) ...@@ -5619,6 +5699,14 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
cmdTimeout = 15; cmdTimeout = 15;
break; break;
case CMD_RequestSense:
cmdLen = 6;
CDB[0] = cmd;
CDB[4] = io->size;
dir = MPI_SCSIIO_CONTROL_READ;
cmdTimeout = 10;
break;
case CMD_ReadBuffer: case CMD_ReadBuffer:
cmdLen = 10; cmdLen = 10;
dir = MPI_SCSIIO_CONTROL_READ; dir = MPI_SCSIIO_CONTROL_READ;
...@@ -5904,7 +5992,7 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum) ...@@ -5904,7 +5992,7 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum)
/* If target Ptr NULL or if this target is NOT a disk, skip. /* If target Ptr NULL or if this target is NOT a disk, skip.
*/ */
// if (pTarget && ((pTarget->inq_data[0] & 0x1F) == 0)) { // 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++) { for (lun=0; lun <= MPT_LAST_LUN; lun++) {
/* If LUN present, issue the command /* If LUN present, issue the command
*/ */
...@@ -5954,7 +6042,6 @@ mptscsih_domainValidation(void *arg) ...@@ -5954,7 +6042,6 @@ mptscsih_domainValidation(void *arg)
unsigned long flags; unsigned long flags;
int id, maxid, dvStatus, did; int id, maxid, dvStatus, did;
int ii, isPhysDisk; int ii, isPhysDisk;
u8 oldQas;
spin_lock_irqsave(&dvtaskQ_lock, flags); spin_lock_irqsave(&dvtaskQ_lock, flags);
dvtaskQ_active = 1; dvtaskQ_active = 1;
...@@ -6000,7 +6087,6 @@ mptscsih_domainValidation(void *arg) ...@@ -6000,7 +6087,6 @@ mptscsih_domainValidation(void *arg)
maxid = MIN (ioc->sh->max_id, MPT_MAX_SCSI_DEVICES); maxid = MIN (ioc->sh->max_id, MPT_MAX_SCSI_DEVICES);
for (id = 0; id < maxid; id++) { for (id = 0; id < maxid; id++) {
oldQas = hd->ioc->spi_data.noQas;
spin_lock_irqsave(&dvtaskQ_lock, flags); spin_lock_irqsave(&dvtaskQ_lock, flags);
if (dvtaskQ_release) { if (dvtaskQ_release) {
dvtaskQ_active = 0; dvtaskQ_active = 0;
...@@ -6011,7 +6097,7 @@ mptscsih_domainValidation(void *arg) ...@@ -6011,7 +6097,7 @@ mptscsih_domainValidation(void *arg)
dvStatus = hd->ioc->spi_data.dvStatus[id]; dvStatus = hd->ioc->spi_data.dvStatus[id];
if (dvStatus & MPT_SCSICFG_NEED_DV) { 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_DV_PENDING;
hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_NEED_DV; hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_NEED_DV;
...@@ -6031,10 +6117,16 @@ mptscsih_domainValidation(void *arg) ...@@ -6031,10 +6117,16 @@ mptscsih_domainValidation(void *arg)
} }
} }
mptscsih_doDv(hd, 0, id); if (mptscsih_doDv(hd, 0, id) == 1) {
did++; /* Untagged device was busy, try again
hd->ioc->spi_data.dvStatus[id] |= MPT_SCSICFG_DV_DONE; */
hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_DV_PENDING; 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) { if (isPhysDisk) {
for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
...@@ -6049,7 +6141,7 @@ mptscsih_domainValidation(void *arg) ...@@ -6049,7 +6141,7 @@ mptscsih_domainValidation(void *arg)
*/ */
post_pendingQ_commands(hd); post_pendingQ_commands(hd);
if ((!oldQas) && (hd->ioc->spi_data.noQas)) if (hd->ioc->spi_data.noQas)
mptscsih_qas_check(hd); mptscsih_qas_check(hd);
} }
} }
...@@ -6088,27 +6180,25 @@ static void mptscsih_qas_check(MPT_SCSI_HOST *hd) ...@@ -6088,27 +6180,25 @@ static void mptscsih_qas_check(MPT_SCSI_HOST *hd)
{ {
VirtDevice *pTarget = NULL; VirtDevice *pTarget = NULL;
int ii; int ii;
int change = 0;
if (hd->Targets == NULL) if (hd->Targets == NULL)
return; return;
for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { 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]; pTarget = hd->Targets[ii];
if ((pTarget != NULL) && (!pTarget->raidVolume)) { if ((pTarget != NULL) && (!pTarget->raidVolume)) {
if ((pTarget->negoFlags & hd->ioc->spi_data.noQas) == 0) { if ((pTarget->negoFlags & hd->ioc->spi_data.noQas) == 0) {
change = 1;
pTarget->negoFlags |= hd->ioc->spi_data.noQas; pTarget->negoFlags |= hd->ioc->spi_data.noQas;
mptscsih_writeSDP1(hd, 0, ii, 0);
} }
} else { } else {
if (mptscsih_is_phys_disk(hd->ioc, ii) == 1) 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;
} }
...@@ -6135,7 +6225,7 @@ static void mptscsih_qas_check(MPT_SCSI_HOST *hd) ...@@ -6135,7 +6225,7 @@ static void mptscsih_qas_check(MPT_SCSI_HOST *hd)
* *
* Return: None. * Return: None.
*/ */
static void static int
mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
{ {
MPT_ADAPTER *ioc = hd->ioc; MPT_ADAPTER *ioc = hd->ioc;
...@@ -6163,6 +6253,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6163,6 +6253,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
int notDone; int notDone;
int patt; int patt;
int repeat; int repeat;
int retcode = 0;
char firstPass = 1; char firstPass = 1;
char doFallback = 0; char doFallback = 0;
char readPage0; char readPage0;
...@@ -6170,13 +6261,13 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6170,13 +6261,13 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
char inq0 = 0; char inq0 = 0;
if (ioc->spi_data.sdp1length == 0) if (ioc->spi_data.sdp1length == 0)
return; return 0;
if (ioc->spi_data.sdp0length == 0) if (ioc->spi_data.sdp0length == 0)
return; return 0;
if (id == ioc->pfacts[portnum].PortSCSIID) if (id == ioc->pfacts[portnum].PortSCSIID)
return; return 0;
lun = 0; lun = 0;
bus = 0; bus = 0;
...@@ -6196,7 +6287,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6196,7 +6287,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
dv.cmd = MPT_GET_NVRAM_VALS; dv.cmd = MPT_GET_NVRAM_VALS;
mptscsih_dv_parms(hd, &dv, NULL); mptscsih_dv_parms(hd, &dv, NULL);
if ((!dv.max.width) && (!dv.max.offset)) if ((!dv.max.width) && (!dv.max.offset))
return; return 0;
/* Prep SCSI IO structure /* Prep SCSI IO structure
*/ */
...@@ -6207,19 +6298,29 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6207,19 +6298,29 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
iocmd.physDiskNum = -1; iocmd.physDiskNum = -1;
iocmd.rsvd = iocmd.rsvd2 = 0; iocmd.rsvd = iocmd.rsvd2 = 0;
/* Use tagged commands if possible.
*/
pTarget = hd->Targets[id]; 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)) { if (pTarget && (pTarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) {
/* Another GEM workaround. Check peripheral device type, /* Another GEM workaround. Check peripheral device type,
* if PROCESSOR, quit DV. * if PROCESSOR, quit DV.
*/ */
if (((pTarget->inq_data[0] & 0x1F) == 0x03) || ((pTarget->inq_data[0] & 0x1F) > 0x08)) { 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); 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;
} }
} }
...@@ -6249,7 +6350,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6249,7 +6350,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
pDvBuf = pci_alloc_consistent(ioc->pcidev, dv_alloc, &dvbuf_dma); pDvBuf = pci_alloc_consistent(ioc->pcidev, dv_alloc, &dvbuf_dma);
if (pDvBuf == NULL) if (pDvBuf == NULL)
return; return 0;
sz = 0; sz = 0;
pbuf1 = (u8 *)pDvBuf; pbuf1 = (u8 *)pDvBuf;
...@@ -6331,8 +6432,10 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6331,8 +6432,10 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
hd->pLocal = NULL; hd->pLocal = NULL;
readPage0 = 0; readPage0 = 0;
sz = SCSI_STD_INQUIRY_BYTES; sz = SCSI_STD_INQUIRY_BYTES;
rc = MPT_SCANDV_GOOD;
while (1) { while (1) {
ddvprintk((MYIOC_s_NOTE_FMT "DV: Start Basic test.\n", ioc->name)); ddvprintk((MYIOC_s_NOTE_FMT "DV: Start Basic test.\n", ioc->name));
retcode = 0;
dv.cmd = MPT_SET_MIN; dv.cmd = MPT_SET_MIN;
mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data); mptscsih_dv_parms(hd, &dv, (void *)pcfg1Data);
...@@ -6343,12 +6446,60 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6343,12 +6446,60 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
if (mpt_config(hd->ioc, &cfg) != 0) if (mpt_config(hd->ioc, &cfg) != 0)
goto target_done; 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.cmd = CMD_Inquiry;
iocmd.data_dma = buf1_dma; iocmd.data_dma = buf1_dma;
iocmd.data = pbuf1; iocmd.data = pbuf1;
iocmd.size = sz; iocmd.size = sz;
if (mptscsih_do_cmd(hd, &iocmd) < 0) if (mptscsih_do_cmd(hd, &iocmd) < 0)
goto target_done; 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, /* Another GEM workaround. Check peripheral device type,
* if PROCESSOR, quit DV. * if PROCESSOR, quit DV.
...@@ -6396,6 +6547,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6396,6 +6547,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
cfg.physAddr = cfg0_dma_addr; cfg.physAddr = cfg0_dma_addr;
cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
cfg.dir = 0; cfg.dir = 0;
if (mpt_config(hd->ioc, &cfg) != 0) if (mpt_config(hd->ioc, &cfg) != 0)
goto target_done; goto target_done;
...@@ -6431,7 +6583,9 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6431,7 +6583,9 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
} }
} 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 */ doFallback = 1; /* set fallback flag */
else else
goto target_done; goto target_done;
...@@ -6854,8 +7008,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6854,8 +7008,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
/* Set if cfg1_dma_addr contents is valid /* 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 disk, not U320, disable QAS
*/ */
if ((inq0 == 0) && (dv.now.factor > MPT_ULTRA320)) if ((inq0 == 0) && (dv.now.factor > MPT_ULTRA320))
...@@ -6889,7 +7042,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id) ...@@ -6889,7 +7042,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int portnum, int id)
ddvtprintk((MYIOC_s_INFO_FMT "DV Done. IOs outstanding = %d\n", ddvtprintk((MYIOC_s_INFO_FMT "DV Done. IOs outstanding = %d\n",
ioc->name, atomic_read(&queue_depth))); ioc->name, atomic_read(&queue_depth)));
return; return retcode;
} }
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -201,7 +201,11 @@ extern int x_scsi_host_reset(Scsi_Cmnd *); ...@@ -201,7 +201,11 @@ extern int x_scsi_host_reset(Scsi_Cmnd *);
extern int x_scsi_old_abort(Scsi_Cmnd *); extern int x_scsi_old_abort(Scsi_Cmnd *);
extern int x_scsi_old_reset(Scsi_Cmnd *, unsigned int); extern int x_scsi_old_reset(Scsi_Cmnd *, unsigned int);
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28)
extern int x_scsi_bios_param(Disk *, struct block_device *, int *); 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_select_queue_depths(struct Scsi_Host *, Scsi_Device *);
extern void x_scsi_taskmgmt_bh(void *); extern void x_scsi_taskmgmt_bh(void *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment