提交 f7d57e42 编写于 作者: L Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (57 commits)
  [SCSI] fix error handling in scsi_io_completion
  [SCSI] qla1280: fix section mismatch warnings
  [SCSI] mptsas: eliminate ghost devices
  [SCSI] qla2xxx: make some more functions static
  [SCSI] small whitespace cleanup for qlogic driver
  [SCSI] mptbase: mpt_interrupt should return IRQ_NONE
  [SCSI] mptsas: make two functions static
  [SCSI] sg.c: Fix bad error handling in
  [SCSI] 53c700: fix breakage caused by the autosense update
  [SCSI] iscsi: add async notification of session events
  [SCSI] iscsi: pass target nr to session creation
  [SCSI] iscsi: break up session creation into two stages
  [SCSI] iscsi: rm channel usage from iscsi
  [SCSI] iscsi: fix session refcouting
  [SCSI] iscsi: convert iscsi_tcp to new set/get param fns
  [SCSI] iscsi: convert iser to new set/get param fns
  [SCSI] iscsi: fixup set/get param functions
  [SCSI] iscsi: add target discvery event to transport class
  [SCSI] st: remove unused st_buffer.in_use
  [SCSI] atp870u: reduce huge stack usage
  ...
1 Release Date : Sun May 14 22:49:52 PDT 2006 - Sumant Patro <Sumant.Patro@lsil.com>
2 Current Version : 00.00.03.01
3 Older Version : 00.00.02.04
i. Added support for ZCR controller.
New device id 0x413 added.
ii. Bug fix : Disable controller interrupt before firing INIT cmd to FW.
Interrupt is enabled after required initialization is over.
This is done to ensure that driver is ready to handle interrupts when
it is generated by the controller.
-Sumant Patro <Sumant.Patro@lsil.com>
1 Release Date : Wed Feb 03 14:31:44 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com> 1 Release Date : Wed Feb 03 14:31:44 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com>
2 Current Version : 00.00.02.04 2 Current Version : 00.00.02.04
3 Older Version : 00.00.02.04 3 Older Version : 00.00.02.04
......
...@@ -437,159 +437,50 @@ iscsi_iser_session_create(struct iscsi_transport *iscsit, ...@@ -437,159 +437,50 @@ iscsi_iser_session_create(struct iscsi_transport *iscsit,
} }
static int static int
iscsi_iser_conn_set_param(struct iscsi_cls_conn *cls_conn, iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn,
enum iscsi_param param, uint32_t value) enum iscsi_param param, char *buf, int buflen)
{ {
struct iscsi_conn *conn = cls_conn->dd_data; int value;
struct iscsi_session *session = conn->session;
spin_lock_bh(&session->lock);
if (conn->c_stage != ISCSI_CONN_INITIAL_STAGE &&
conn->stop_stage != STOP_CONN_RECOVER) {
printk(KERN_ERR "iscsi_iser: can not change parameter [%d]\n",
param);
spin_unlock_bh(&session->lock);
return 0;
}
spin_unlock_bh(&session->lock);
switch (param) { switch (param) {
case ISCSI_PARAM_MAX_RECV_DLENGTH: case ISCSI_PARAM_MAX_RECV_DLENGTH:
/* TBD */ /* TBD */
break; break;
case ISCSI_PARAM_MAX_XMIT_DLENGTH:
conn->max_xmit_dlength = value;
break;
case ISCSI_PARAM_HDRDGST_EN: case ISCSI_PARAM_HDRDGST_EN:
sscanf(buf, "%d", &value);
if (value) { if (value) {
printk(KERN_ERR "DataDigest wasn't negotiated to None"); printk(KERN_ERR "DataDigest wasn't negotiated to None");
return -EPROTO; return -EPROTO;
} }
break; break;
case ISCSI_PARAM_DATADGST_EN: case ISCSI_PARAM_DATADGST_EN:
sscanf(buf, "%d", &value);
if (value) { if (value) {
printk(KERN_ERR "DataDigest wasn't negotiated to None"); printk(KERN_ERR "DataDigest wasn't negotiated to None");
return -EPROTO; return -EPROTO;
} }
break; break;
case ISCSI_PARAM_INITIAL_R2T_EN:
session->initial_r2t_en = value;
break;
case ISCSI_PARAM_IMM_DATA_EN:
session->imm_data_en = value;
break;
case ISCSI_PARAM_FIRST_BURST:
session->first_burst = value;
break;
case ISCSI_PARAM_MAX_BURST:
session->max_burst = value;
break;
case ISCSI_PARAM_PDU_INORDER_EN:
session->pdu_inorder_en = value;
break;
case ISCSI_PARAM_DATASEQ_INORDER_EN:
session->dataseq_inorder_en = value;
break;
case ISCSI_PARAM_ERL:
session->erl = value;
break;
case ISCSI_PARAM_IFMARKER_EN: case ISCSI_PARAM_IFMARKER_EN:
sscanf(buf, "%d", &value);
if (value) { if (value) {
printk(KERN_ERR "IFMarker wasn't negotiated to No"); printk(KERN_ERR "IFMarker wasn't negotiated to No");
return -EPROTO; return -EPROTO;
} }
break; break;
case ISCSI_PARAM_OFMARKER_EN: case ISCSI_PARAM_OFMARKER_EN:
sscanf(buf, "%d", &value);
if (value) { if (value) {
printk(KERN_ERR "OFMarker wasn't negotiated to No"); printk(KERN_ERR "OFMarker wasn't negotiated to No");
return -EPROTO; return -EPROTO;
} }
break; break;
default: default:
break; return iscsi_set_param(cls_conn, param, buf, buflen);
}
return 0;
}
static int
iscsi_iser_session_get_param(struct iscsi_cls_session *cls_session,
enum iscsi_param param, uint32_t *value)
{
struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
switch (param) {
case ISCSI_PARAM_INITIAL_R2T_EN:
*value = session->initial_r2t_en;
break;
case ISCSI_PARAM_MAX_R2T:
*value = session->max_r2t;
break;
case ISCSI_PARAM_IMM_DATA_EN:
*value = session->imm_data_en;
break;
case ISCSI_PARAM_FIRST_BURST:
*value = session->first_burst;
break;
case ISCSI_PARAM_MAX_BURST:
*value = session->max_burst;
break;
case ISCSI_PARAM_PDU_INORDER_EN:
*value = session->pdu_inorder_en;
break;
case ISCSI_PARAM_DATASEQ_INORDER_EN:
*value = session->dataseq_inorder_en;
break;
case ISCSI_PARAM_ERL:
*value = session->erl;
break;
case ISCSI_PARAM_IFMARKER_EN:
*value = 0;
break;
case ISCSI_PARAM_OFMARKER_EN:
*value = 0;
break;
default:
return ISCSI_ERR_PARAM_NOT_FOUND;
}
return 0;
}
static int
iscsi_iser_conn_get_param(struct iscsi_cls_conn *cls_conn,
enum iscsi_param param, uint32_t *value)
{
struct iscsi_conn *conn = cls_conn->dd_data;
switch(param) {
case ISCSI_PARAM_MAX_RECV_DLENGTH:
*value = conn->max_recv_dlength;
break;
case ISCSI_PARAM_MAX_XMIT_DLENGTH:
*value = conn->max_xmit_dlength;
break;
case ISCSI_PARAM_HDRDGST_EN:
*value = 0;
break;
case ISCSI_PARAM_DATADGST_EN:
*value = 0;
break;
/*case ISCSI_PARAM_TARGET_RECV_DLENGTH:
*value = conn->target_recv_dlength;
break;
case ISCSI_PARAM_INITIATOR_RECV_DLENGTH:
*value = conn->initiator_recv_dlength;
break;*/
default:
return ISCSI_ERR_PARAM_NOT_FOUND;
} }
return 0; return 0;
} }
static void static void
iscsi_iser_conn_get_stats(struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats) iscsi_iser_conn_get_stats(struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats)
{ {
...@@ -701,7 +592,12 @@ static struct iscsi_transport iscsi_iser_transport = { ...@@ -701,7 +592,12 @@ static struct iscsi_transport iscsi_iser_transport = {
ISCSI_FIRST_BURST | ISCSI_FIRST_BURST |
ISCSI_MAX_BURST | ISCSI_MAX_BURST |
ISCSI_PDU_INORDER_EN | ISCSI_PDU_INORDER_EN |
ISCSI_DATASEQ_INORDER_EN, ISCSI_DATASEQ_INORDER_EN |
ISCSI_EXP_STATSN |
ISCSI_PERSISTENT_PORT |
ISCSI_PERSISTENT_ADDRESS |
ISCSI_TARGET_NAME |
ISCSI_TPGT,
.host_template = &iscsi_iser_sht, .host_template = &iscsi_iser_sht,
.conndata_size = sizeof(struct iscsi_conn), .conndata_size = sizeof(struct iscsi_conn),
.max_lun = ISCSI_ISER_MAX_LUN, .max_lun = ISCSI_ISER_MAX_LUN,
...@@ -713,9 +609,9 @@ static struct iscsi_transport iscsi_iser_transport = { ...@@ -713,9 +609,9 @@ static struct iscsi_transport iscsi_iser_transport = {
.create_conn = iscsi_iser_conn_create, .create_conn = iscsi_iser_conn_create,
.bind_conn = iscsi_iser_conn_bind, .bind_conn = iscsi_iser_conn_bind,
.destroy_conn = iscsi_iser_conn_destroy, .destroy_conn = iscsi_iser_conn_destroy,
.set_param = iscsi_iser_conn_set_param, .set_param = iscsi_iser_set_param,
.get_conn_param = iscsi_iser_conn_get_param, .get_conn_param = iscsi_conn_get_param,
.get_session_param = iscsi_iser_session_get_param, .get_session_param = iscsi_session_get_param,
.start_conn = iscsi_iser_conn_start, .start_conn = iscsi_iser_conn_start,
.stop_conn = iscsi_conn_stop, .stop_conn = iscsi_conn_stop,
/* these are called as part of conn recovery */ /* these are called as part of conn recovery */
......
...@@ -33,6 +33,11 @@ ...@@ -33,6 +33,11 @@
# For mptfc: # For mptfc:
#CFLAGS_mptfc.o += -DMPT_DEBUG_FC #CFLAGS_mptfc.o += -DMPT_DEBUG_FC
# For mptsas:
#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS
#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS_WIDE
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
obj-$(CONFIG_FUSION_SPI) += mptbase.o mptscsih.o mptspi.o obj-$(CONFIG_FUSION_SPI) += mptbase.o mptscsih.o mptspi.o
......
/*
* Copyright (c) 2000-2001 LSI Logic Corporation. All rights reserved.
*
* NAME: fc_log.h
* SUMMARY: MPI IocLogInfo definitions for the SYMFC9xx chips
* DESCRIPTION: Contains the enumerated list of values that may be returned
* in the IOCLogInfo field of a MPI Default Reply Message.
*
* CREATION DATE: 6/02/2000
* ID: $Id: fc_log.h,v 4.6 2001/07/26 14:41:33 sschremm Exp $
*/
/*
* MpiIocLogInfo_t enum
*
* These 32 bit values are used in the IOCLogInfo field of the MPI reply
* messages.
* The value is 0xabcccccc where
* a = The type of log info as per the MPI spec. Since these codes are
* all for Fibre Channel this value will always be 2.
* b = Specifies a subclass of the firmware where
* 0 = FCP Initiator
* 1 = FCP Target
* 2 = LAN
* 3 = MPI Message Layer
* 4 = FC Link
* 5 = Context Manager
* 6 = Invalid Field Offset
* 7 = State Change Info
* all others are reserved for future use
* c = A specific value within the subclass.
*
* NOTE: Any new values should be added to the end of each subclass so that the
* codes remain consistent across firmware releases.
*/
typedef enum _MpiIocLogInfoFc
{
MPI_IOCLOGINFO_FC_INIT_BASE = 0x20000000,
MPI_IOCLOGINFO_FC_INIT_ERROR_OUT_OF_ORDER_FRAME = 0x20000001, /* received an out of order frame - unsupported */
MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_START_OF_FRAME = 0x20000002, /* Bad Rx Frame, bad start of frame primative */
MPI_IOCLOGINFO_FC_INIT_ERROR_BAD_END_OF_FRAME = 0x20000003, /* Bad Rx Frame, bad end of frame primative */
MPI_IOCLOGINFO_FC_INIT_ERROR_OVER_RUN = 0x20000004, /* Bad Rx Frame, overrun */
MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OTHER = 0x20000005, /* Other errors caught by IOC which require retries */
MPI_IOCLOGINFO_FC_INIT_ERROR_SUBPROC_DEAD = 0x20000006, /* Main processor could not initialize sub-processor */
MPI_IOCLOGINFO_FC_INIT_ERROR_RX_OVERRUN = 0x20000007, /* Scatter Gather overrun */
MPI_IOCLOGINFO_FC_INIT_ERROR_RX_BAD_STATUS = 0x20000008, /* Receiver detected context mismatch via invalid header */
MPI_IOCLOGINFO_FC_INIT_ERROR_RX_UNEXPECTED_FRAME= 0x20000009, /* CtxMgr detected unsupported frame type */
MPI_IOCLOGINFO_FC_INIT_ERROR_LINK_FAILURE = 0x2000000A, /* Link failure occurred */
MPI_IOCLOGINFO_FC_INIT_ERROR_TX_TIMEOUT = 0x2000000B, /* Transmitter timeout error */
MPI_IOCLOGINFO_FC_TARGET_BASE = 0x21000000,
MPI_IOCLOGINFO_FC_TARGET_NO_PDISC = 0x21000001, /* not sent because we are waiting for a PDISC from the initiator */
MPI_IOCLOGINFO_FC_TARGET_NO_LOGIN = 0x21000002, /* not sent because we are not logged in to the remote node */
MPI_IOCLOGINFO_FC_TARGET_DOAR_KILLED_BY_LIP = 0x21000003, /* Data Out, Auto Response, not sent due to a LIP */
MPI_IOCLOGINFO_FC_TARGET_DIAR_KILLED_BY_LIP = 0x21000004, /* Data In, Auto Response, not sent due to a LIP */
MPI_IOCLOGINFO_FC_TARGET_DIAR_MISSING_DATA = 0x21000005, /* Data In, Auto Response, missing data frames */
MPI_IOCLOGINFO_FC_TARGET_DONR_KILLED_BY_LIP = 0x21000006, /* Data Out, No Response, not sent due to a LIP */
MPI_IOCLOGINFO_FC_TARGET_WRSP_KILLED_BY_LIP = 0x21000007, /* Auto-response after a write not sent due to a LIP */
MPI_IOCLOGINFO_FC_TARGET_DINR_KILLED_BY_LIP = 0x21000008, /* Data In, No Response, not completed due to a LIP */
MPI_IOCLOGINFO_FC_TARGET_DINR_MISSING_DATA = 0x21000009, /* Data In, No Response, missing data frames */
MPI_IOCLOGINFO_FC_TARGET_MRSP_KILLED_BY_LIP = 0x2100000a, /* Manual Response not sent due to a LIP */
MPI_IOCLOGINFO_FC_TARGET_NO_CLASS_3 = 0x2100000b, /* not sent because remote node does not support Class 3 */
MPI_IOCLOGINFO_FC_TARGET_LOGIN_NOT_VALID = 0x2100000c, /* not sent because login to remote node not validated */
MPI_IOCLOGINFO_FC_TARGET_FROM_OUTBOUND = 0x2100000e, /* cleared from the outbound queue after a logout */
MPI_IOCLOGINFO_FC_TARGET_WAITING_FOR_DATA_IN = 0x2100000f, /* cleared waiting for data after a logout */
MPI_IOCLOGINFO_FC_LAN_BASE = 0x22000000,
MPI_IOCLOGINFO_FC_LAN_TRANS_SGL_MISSING = 0x22000001, /* Transaction Context Sgl Missing */
MPI_IOCLOGINFO_FC_LAN_TRANS_WRONG_PLACE = 0x22000002, /* Transaction Context found before an EOB */
MPI_IOCLOGINFO_FC_LAN_TRANS_RES_BITS_SET = 0x22000003, /* Transaction Context value has reserved bits set */
MPI_IOCLOGINFO_FC_LAN_WRONG_SGL_FLAG = 0x22000004, /* Invalid SGL Flags */
MPI_IOCLOGINFO_FC_MSG_BASE = 0x23000000,
MPI_IOCLOGINFO_FC_LINK_BASE = 0x24000000,
MPI_IOCLOGINFO_FC_LINK_LOOP_INIT_TIMEOUT = 0x24000001, /* Loop initialization timed out */
MPI_IOCLOGINFO_FC_LINK_ALREADY_INITIALIZED = 0x24000002, /* Another system controller already initialized the loop */
MPI_IOCLOGINFO_FC_LINK_LINK_NOT_ESTABLISHED = 0x24000003, /* Not synchronized to signal or still negotiating (possible cable problem) */
MPI_IOCLOGINFO_FC_LINK_CRC_ERROR = 0x24000004, /* CRC check detected error on received frame */
MPI_IOCLOGINFO_FC_CTX_BASE = 0x25000000,
MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET = 0x26000000, /* The lower 24 bits give the byte offset of the field in the request message that is invalid */
MPI_IOCLOGINFO_FC_INVALID_FIELD_MAX_OFFSET = 0x26ffffff,
MPI_IOCLOGINFO_FC_STATE_CHANGE = 0x27000000 /* The lower 24 bits give additional information concerning state change */
} MpiIocLogInfoFc_t;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* 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.h Version: 01.05.10 * mpi.h Version: 01.05.11
* *
* Version History * Version History
* --------------- * ---------------
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
* Added EEDP IOCStatus codes. * Added EEDP IOCStatus codes.
* 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT. * 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT.
* 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target.
* 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -106,7 +107,7 @@ ...@@ -106,7 +107,7 @@
/* 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 */ /* versioning for this MPI header set */
#define MPI_HEADER_VERSION_UNIT (0x0C) #define MPI_HEADER_VERSION_UNIT (0x0D)
#define MPI_HEADER_VERSION_DEV (0x00) #define MPI_HEADER_VERSION_DEV (0x00)
#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
#define MPI_HEADER_VERSION_UNIT_SHIFT (8) #define MPI_HEADER_VERSION_UNIT_SHIFT (8)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* 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_cnfg.h Version: 01.05.11 * mpi_cnfg.h Version: 01.05.12
* *
* Version History * Version History
* --------------- * ---------------
...@@ -266,6 +266,16 @@ ...@@ -266,6 +266,16 @@
* Added postpone SATA Init bit to SAS IO Unit Page 1 * Added postpone SATA Init bit to SAS IO Unit Page 1
* ControlFlags. * ControlFlags.
* Changed LogEntry format for Log Page 0. * Changed LogEntry format for Log Page 0.
* 03-27-06 01.05.12 Added two new Flags defines for Manufacturing Page 4.
* Added Manufacturing Page 7.
* Added MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING.
* Added IOC Page 6.
* Added PrevBootDeviceForm field to CONFIG_PAGE_BIOS_2.
* Added MaxLBAHigh field to RAID Volume Page 0.
* Added Nvdata version fields to SAS IO Unit Page 0.
* Added AdditionalControlFlags, MaxTargetPortConnectTime,
* ReportDeviceMissingDelay, and IODeviceMissingDelay
* fields to SAS IO Unit Page 1.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -631,9 +641,11 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4 ...@@ -631,9 +641,11 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
} CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, } CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4,
ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t;
#define MPI_MANUFACTURING4_PAGEVERSION (0x03) #define MPI_MANUFACTURING4_PAGEVERSION (0x04)
/* defines for the Flags field */ /* defines for the Flags field */
#define MPI_MANPAGE4_FORCE_BAD_BLOCK_TABLE (0x80)
#define MPI_MANPAGE4_FORCE_OFFLINE_FAILOVER (0x40)
#define MPI_MANPAGE4_IME_DISABLE (0x20) #define MPI_MANPAGE4_IME_DISABLE (0x20)
#define MPI_MANPAGE4_IM_DISABLE (0x10) #define MPI_MANPAGE4_IM_DISABLE (0x10)
#define MPI_MANPAGE4_IS_DISABLE (0x08) #define MPI_MANPAGE4_IS_DISABLE (0x08)
...@@ -668,6 +680,66 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_6 ...@@ -668,6 +680,66 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_6
#define MPI_MANUFACTURING6_PAGEVERSION (0x00) #define MPI_MANUFACTURING6_PAGEVERSION (0x00)
typedef struct _MPI_MANPAGE7_CONNECTOR_INFO
{
U32 Pinout; /* 00h */
U8 Connector[16]; /* 04h */
U8 Location; /* 14h */
U8 Reserved1; /* 15h */
U16 Slot; /* 16h */
U32 Reserved2; /* 18h */
} MPI_MANPAGE7_CONNECTOR_INFO, MPI_POINTER PTR_MPI_MANPAGE7_CONNECTOR_INFO,
MpiManPage7ConnectorInfo_t, MPI_POINTER pMpiManPage7ConnectorInfo_t;
/* defines for the Pinout field */
#define MPI_MANPAGE7_PINOUT_SFF_8484_L4 (0x00080000)
#define MPI_MANPAGE7_PINOUT_SFF_8484_L3 (0x00040000)
#define MPI_MANPAGE7_PINOUT_SFF_8484_L2 (0x00020000)
#define MPI_MANPAGE7_PINOUT_SFF_8484_L1 (0x00010000)
#define MPI_MANPAGE7_PINOUT_SFF_8470_L4 (0x00000800)
#define MPI_MANPAGE7_PINOUT_SFF_8470_L3 (0x00000400)
#define MPI_MANPAGE7_PINOUT_SFF_8470_L2 (0x00000200)
#define MPI_MANPAGE7_PINOUT_SFF_8470_L1 (0x00000100)
#define MPI_MANPAGE7_PINOUT_SFF_8482 (0x00000002)
#define MPI_MANPAGE7_PINOUT_CONNECTION_UNKNOWN (0x00000001)
/* defines for the Location field */
#define MPI_MANPAGE7_LOCATION_UNKNOWN (0x01)
#define MPI_MANPAGE7_LOCATION_INTERNAL (0x02)
#define MPI_MANPAGE7_LOCATION_EXTERNAL (0x04)
#define MPI_MANPAGE7_LOCATION_SWITCHABLE (0x08)
#define MPI_MANPAGE7_LOCATION_AUTO (0x10)
#define MPI_MANPAGE7_LOCATION_NOT_PRESENT (0x20)
#define MPI_MANPAGE7_LOCATION_NOT_CONNECTED (0x80)
/*
* Host code (drivers, BIOS, utilities, etc.) should leave this define set to
* one and check NumPhys at runtime.
*/
#ifndef MPI_MANPAGE7_CONNECTOR_INFO_MAX
#define MPI_MANPAGE7_CONNECTOR_INFO_MAX (1)
#endif
typedef struct _CONFIG_PAGE_MANUFACTURING_7
{
CONFIG_PAGE_HEADER Header; /* 00h */
U32 Reserved1; /* 04h */
U32 Reserved2; /* 08h */
U32 Flags; /* 0Ch */
U8 EnclosureName[16]; /* 10h */
U8 NumPhys; /* 20h */
U8 Reserved3; /* 21h */
U16 Reserved4; /* 22h */
MPI_MANPAGE7_CONNECTOR_INFO ConnectorInfo[MPI_MANPAGE7_CONNECTOR_INFO_MAX]; /* 24h */
} CONFIG_PAGE_MANUFACTURING_7, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_7,
ManufacturingPage7_t, MPI_POINTER pManufacturingPage7_t;
#define MPI_MANUFACTURING7_PAGEVERSION (0x00)
/* defines for the Flags field */
#define MPI_MANPAGE7_FLAG_USE_SLOT_INFO (0x00000001)
/**************************************************************************** /****************************************************************************
* IO Unit Config Pages * IO Unit Config Pages
****************************************************************************/ ****************************************************************************/
...@@ -867,7 +939,7 @@ typedef struct _CONFIG_PAGE_IOC_2 ...@@ -867,7 +939,7 @@ typedef struct _CONFIG_PAGE_IOC_2
} CONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2, } CONFIG_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 (0x03) #define MPI_IOCPAGE2_PAGEVERSION (0x04)
/* IOC Page 2 Capabilities flags */ /* IOC Page 2 Capabilities flags */
...@@ -878,6 +950,7 @@ typedef struct _CONFIG_PAGE_IOC_2 ...@@ -878,6 +950,7 @@ typedef struct _CONFIG_PAGE_IOC_2
#define MPI_IOCPAGE2_CAP_FLAGS_RAID_6_SUPPORT (0x00000010) #define MPI_IOCPAGE2_CAP_FLAGS_RAID_6_SUPPORT (0x00000010)
#define MPI_IOCPAGE2_CAP_FLAGS_RAID_10_SUPPORT (0x00000020) #define MPI_IOCPAGE2_CAP_FLAGS_RAID_10_SUPPORT (0x00000020)
#define MPI_IOCPAGE2_CAP_FLAGS_RAID_50_SUPPORT (0x00000040) #define MPI_IOCPAGE2_CAP_FLAGS_RAID_50_SUPPORT (0x00000040)
#define MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING (0x10000000)
#define MPI_IOCPAGE2_CAP_FLAGS_SES_SUPPORT (0x20000000) #define MPI_IOCPAGE2_CAP_FLAGS_SES_SUPPORT (0x20000000)
#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)
...@@ -975,6 +1048,44 @@ typedef struct _CONFIG_PAGE_IOC_5 ...@@ -975,6 +1048,44 @@ typedef struct _CONFIG_PAGE_IOC_5
#define MPI_IOCPAGE5_PAGEVERSION (0x00) #define MPI_IOCPAGE5_PAGEVERSION (0x00)
typedef struct _CONFIG_PAGE_IOC_6
{
CONFIG_PAGE_HEADER Header; /* 00h */
U32 CapabilitiesFlags; /* 04h */
U8 MaxDrivesIS; /* 08h */
U8 MaxDrivesIM; /* 09h */
U8 MaxDrivesIME; /* 0Ah */
U8 Reserved1; /* 0Bh */
U8 MinDrivesIS; /* 0Ch */
U8 MinDrivesIM; /* 0Dh */
U8 MinDrivesIME; /* 0Eh */
U8 Reserved2; /* 0Fh */
U8 MaxGlobalHotSpares; /* 10h */
U8 Reserved3; /* 11h */
U16 Reserved4; /* 12h */
U32 Reserved5; /* 14h */
U32 SupportedStripeSizeMapIS; /* 18h */
U32 SupportedStripeSizeMapIME; /* 1Ch */
U32 Reserved6; /* 20h */
U8 MetadataSize; /* 24h */
U8 Reserved7; /* 25h */
U16 Reserved8; /* 26h */
U16 MaxBadBlockTableEntries; /* 28h */
U16 Reserved9; /* 2Ah */
U16 IRNvsramUsage; /* 2Ch */
U16 Reserved10; /* 2Eh */
U32 IRNvsramVersion; /* 30h */
U32 Reserved11; /* 34h */
U32 Reserved12; /* 38h */
} CONFIG_PAGE_IOC_6, MPI_POINTER PTR_CONFIG_PAGE_IOC_6,
IOCPage6_t, MPI_POINTER pIOCPage6_t;
#define MPI_IOCPAGE6_PAGEVERSION (0x00)
/* IOC Page 6 Capabilities Flags */
#define MPI_IOCPAGE6_CAP_FLAGS_GLOBAL_HOT_SPARE (0x00000001)
/**************************************************************************** /****************************************************************************
* BIOS Config Pages * BIOS Config Pages
...@@ -1218,13 +1329,13 @@ typedef struct _CONFIG_PAGE_BIOS_2 ...@@ -1218,13 +1329,13 @@ typedef struct _CONFIG_PAGE_BIOS_2
U32 Reserved5; /* 14h */ U32 Reserved5; /* 14h */
U32 Reserved6; /* 18h */ U32 Reserved6; /* 18h */
U8 BootDeviceForm; /* 1Ch */ U8 BootDeviceForm; /* 1Ch */
U8 Reserved7; /* 1Dh */ U8 PrevBootDeviceForm; /* 1Ch */
U16 Reserved8; /* 1Eh */ U16 Reserved8; /* 1Eh */
MPI_BIOSPAGE2_BOOT_DEVICE BootDevice; /* 20h */ MPI_BIOSPAGE2_BOOT_DEVICE BootDevice; /* 20h */
} CONFIG_PAGE_BIOS_2, MPI_POINTER PTR_CONFIG_PAGE_BIOS_2, } CONFIG_PAGE_BIOS_2, MPI_POINTER PTR_CONFIG_PAGE_BIOS_2,
BIOSPage2_t, MPI_POINTER pBIOSPage2_t; BIOSPage2_t, MPI_POINTER pBIOSPage2_t;
#define MPI_BIOSPAGE2_PAGEVERSION (0x01) #define MPI_BIOSPAGE2_PAGEVERSION (0x02)
#define MPI_BIOSPAGE2_FORM_MASK (0x0F) #define MPI_BIOSPAGE2_FORM_MASK (0x0F)
#define MPI_BIOSPAGE2_FORM_ADAPTER_ORDER (0x00) #define MPI_BIOSPAGE2_FORM_ADAPTER_ORDER (0x00)
...@@ -2080,7 +2191,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0 ...@@ -2080,7 +2191,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
RAID_VOL0_STATUS VolumeStatus; /* 08h */ RAID_VOL0_STATUS VolumeStatus; /* 08h */
RAID_VOL0_SETTINGS VolumeSettings; /* 0Ch */ RAID_VOL0_SETTINGS VolumeSettings; /* 0Ch */
U32 MaxLBA; /* 10h */ U32 MaxLBA; /* 10h */
U32 Reserved1; /* 14h */ U32 MaxLBAHigh; /* 14h */
U32 StripeSize; /* 18h */ U32 StripeSize; /* 18h */
U32 Reserved2; /* 1Ch */ U32 Reserved2; /* 1Ch */
U32 Reserved3; /* 20h */ U32 Reserved3; /* 20h */
...@@ -2092,7 +2203,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0 ...@@ -2092,7 +2203,7 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
} CONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0, } CONFIG_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 (0x05) #define MPI_RAIDVOLPAGE0_PAGEVERSION (0x06)
/* values for RAID Volume Page 0 InactiveStatus field */ /* values for RAID Volume Page 0 InactiveStatus field */
#define MPI_RAIDVOLPAGE0_UNKNOWN_INACTIVE (0x00) #define MPI_RAIDVOLPAGE0_UNKNOWN_INACTIVE (0x00)
...@@ -2324,7 +2435,8 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA ...@@ -2324,7 +2435,8 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA
typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
{ {
CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
U32 Reserved1; /* 08h */ U16 NvdataVersionDefault; /* 08h */
U16 NvdataVersionPersistent; /* 0Ah */
U8 NumPhys; /* 0Ch */ U8 NumPhys; /* 0Ch */
U8 Reserved2; /* 0Dh */ U8 Reserved2; /* 0Dh */
U16 Reserved3; /* 0Eh */ U16 Reserved3; /* 0Eh */
...@@ -2332,7 +2444,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 ...@@ -2332,7 +2444,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
} CONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0, } CONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0,
SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t; SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t;
#define MPI_SASIOUNITPAGE0_PAGEVERSION (0x03) #define MPI_SASIOUNITPAGE0_PAGEVERSION (0x04)
/* values for SAS IO Unit Page 0 PortFlags */ /* values for SAS IO Unit Page 0 PortFlags */
#define MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS (0x08) #define MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS (0x08)
...@@ -2373,12 +2485,13 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 ...@@ -2373,12 +2485,13 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA
{ {
U8 Port; /* 00h */ U8 Port; /* 00h */
U8 PortFlags; /* 01h */ U8 PortFlags; /* 01h */
U8 PhyFlags; /* 02h */ U8 PhyFlags; /* 02h */
U8 MaxMinLinkRate; /* 03h */ U8 MaxMinLinkRate; /* 03h */
U32 ControllerPhyDeviceInfo;/* 04h */ U32 ControllerPhyDeviceInfo; /* 04h */
U32 Reserved1; /* 08h */ U16 MaxTargetPortConnectTime; /* 08h */
U16 Reserved1; /* 0Ah */
} MPI_SAS_IO_UNIT1_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT1_PHY_DATA, } MPI_SAS_IO_UNIT1_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT1_PHY_DATA,
SasIOUnit1PhyData, MPI_POINTER pSasIOUnit1PhyData; SasIOUnit1PhyData, MPI_POINTER pSasIOUnit1PhyData;
...@@ -2395,15 +2508,17 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1 ...@@ -2395,15 +2508,17 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1
CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
U16 ControlFlags; /* 08h */ U16 ControlFlags; /* 08h */
U16 MaxNumSATATargets; /* 0Ah */ U16 MaxNumSATATargets; /* 0Ah */
U32 Reserved1; /* 0Ch */ U16 AdditionalControlFlags; /* 0Ch */
U16 Reserved1; /* 0Eh */
U8 NumPhys; /* 10h */ U8 NumPhys; /* 10h */
U8 SATAMaxQDepth; /* 11h */ U8 SATAMaxQDepth; /* 11h */
U16 Reserved2; /* 12h */ U8 ReportDeviceMissingDelay; /* 12h */
U8 IODeviceMissingDelay; /* 13h */
MPI_SAS_IO_UNIT1_PHY_DATA PhyData[MPI_SAS_IOUNIT1_PHY_MAX]; /* 14h */ MPI_SAS_IO_UNIT1_PHY_DATA PhyData[MPI_SAS_IOUNIT1_PHY_MAX]; /* 14h */
} CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1, } CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1,
SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t; SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t;
#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x05) #define MPI_SASIOUNITPAGE1_PAGEVERSION (0x06)
/* values for SAS IO Unit Page 1 ControlFlags */ /* values for SAS IO Unit Page 1 ControlFlags */
#define MPI_SAS_IOUNIT1_CONTROL_DEVICE_SELF_TEST (0x8000) #define MPI_SAS_IOUNIT1_CONTROL_DEVICE_SELF_TEST (0x8000)
...@@ -2428,6 +2543,13 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1 ...@@ -2428,6 +2543,13 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1
#define MPI_SAS_IOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY (0x0002) #define MPI_SAS_IOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY (0x0002)
#define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001) #define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001)
/* values for SAS IO Unit Page 1 AdditionalControlFlags */
#define MPI_SAS_IOUNIT1_ACONTROL_ALLOW_TABLE_TO_TABLE (0x0001)
/* defines for SAS IO Unit Page 1 ReportDeviceMissingDelay */
#define MPI_SAS_IOUNIT1_REPORT_MISSING_TIMEOUT_MASK (0x7F)
#define MPI_SAS_IOUNIT1_REPORT_MISSING_UNIT_16 (0x80)
/* values for SAS IO Unit Page 1 PortFlags */ /* values for SAS IO Unit Page 1 PortFlags */
#define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00) #define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00)
#define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04) #define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04)
......
...@@ -6,25 +6,25 @@ ...@@ -6,25 +6,25 @@
Copyright (c) 2000-2005 LSI Logic Corporation. Copyright (c) 2000-2005 LSI Logic Corporation.
--------------------------------------- ---------------------------------------
Header Set Release Version: 01.05.12 Header Set Release Version: 01.05.13
Header Set Release Date: 08-30-05 Header Set Release Date: 03-27-06
--------------------------------------- ---------------------------------------
Filename Current version Prior version Filename Current version Prior version
---------- --------------- ------------- ---------- --------------- -------------
mpi.h 01.05.10 01.05.09 mpi.h 01.05.11 01.05.10
mpi_ioc.h 01.05.10 01.05.09 mpi_ioc.h 01.05.11 01.05.10
mpi_cnfg.h 01.05.11 01.05.10 mpi_cnfg.h 01.05.12 01.05.11
mpi_init.h 01.05.06 01.05.06 mpi_init.h 01.05.07 01.05.06
mpi_targ.h 01.05.05 01.05.05 mpi_targ.h 01.05.06 01.05.05
mpi_fc.h 01.05.01 01.05.01 mpi_fc.h 01.05.01 01.05.01
mpi_lan.h 01.05.01 01.05.01 mpi_lan.h 01.05.01 01.05.01
mpi_raid.h 01.05.02 01.05.02 mpi_raid.h 01.05.02 01.05.02
mpi_tool.h 01.05.03 01.05.03 mpi_tool.h 01.05.03 01.05.03
mpi_inb.h 01.05.01 01.05.01 mpi_inb.h 01.05.01 01.05.01
mpi_sas.h 01.05.02 01.05.01 mpi_sas.h 01.05.03 01.05.02
mpi_type.h 01.05.02 01.05.01 mpi_type.h 01.05.02 01.05.02
mpi_history.txt 01.05.12 01.05.11 mpi_history.txt 01.05.13 01.05.12
* Date Version Description * Date Version Description
...@@ -93,6 +93,7 @@ mpi.h ...@@ -93,6 +93,7 @@ mpi.h
* Added EEDP IOCStatus codes. * Added EEDP IOCStatus codes.
* 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT. * 08-03-05 01.05.09 Bumped MPI_HEADER_VERSION_UNIT.
* 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target.
* 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_ioc.h mpi_ioc.h
...@@ -170,6 +171,17 @@ mpi_ioc.h ...@@ -170,6 +171,17 @@ mpi_ioc.h
* Added new ReasonCode value for SAS Device Status Change * Added new ReasonCode value for SAS Device Status Change
* event. * event.
* Added new family code for FC949E. * Added new family code for FC949E.
* 03-27-06 01.05.11 Added MPI_IOCFACTS_CAPABILITY_TLR.
* Added additional Reason Codes and more event data fields
* to EVENT_DATA_SAS_DEVICE_STATUS_CHANGE.
* Added EVENT_DATA_SAS_BROADCAST_PRIMITIVE structure and
* new event.
* Added MPI_EVENT_SAS_SMP_ERROR and event data structure.
* Added MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE and event
* data structure.
* Added MPI_EVENT_SAS_INIT_TABLE_OVERFLOW and event
* data structure.
* Added MPI_EXT_IMAGE_TYPE_INITIALIZATION.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_cnfg.h mpi_cnfg.h
...@@ -425,6 +437,16 @@ mpi_cnfg.h ...@@ -425,6 +437,16 @@ mpi_cnfg.h
* Added postpone SATA Init bit to SAS IO Unit Page 1 * Added postpone SATA Init bit to SAS IO Unit Page 1
* ControlFlags. * ControlFlags.
* Changed LogEntry format for Log Page 0. * Changed LogEntry format for Log Page 0.
* 03-27-06 01.05.12 Added two new Flags defines for Manufacturing Page 4.
* Added Manufacturing Page 7.
* Added MPI_IOCPAGE2_CAP_FLAGS_RAID_64_BIT_ADDRESSING.
* Added IOC Page 6.
* Added PrevBootDeviceForm field to CONFIG_PAGE_BIOS_2.
* Added MaxLBAHigh field to RAID Volume Page 0.
* Added Nvdata version fields to SAS IO Unit Page 0.
* Added AdditionalControlFlags, MaxTargetPortConnectTime,
* ReportDeviceMissingDelay, and IODeviceMissingDelay
* fields to SAS IO Unit Page 1.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_init.h mpi_init.h
...@@ -467,6 +489,7 @@ mpi_init.h ...@@ -467,6 +489,7 @@ mpi_init.h
* Added four new defines for SEP SlotStatus. * Added four new defines for SEP SlotStatus.
* 08-03-05 01.05.06 Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them * 08-03-05 01.05.06 Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them
* unique in the first 32 characters. * unique in the first 32 characters.
* 03-27-06 01.05.07 Added Task Management type of Clear ACA.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_targ.h mpi_targ.h
...@@ -511,6 +534,7 @@ mpi_targ.h ...@@ -511,6 +534,7 @@ mpi_targ.h
* 02-22-05 01.05.03 Changed a comment. * 02-22-05 01.05.03 Changed a comment.
* 03-11-05 01.05.04 Removed TargetAssistExtended Request. * 03-11-05 01.05.04 Removed TargetAssistExtended Request.
* 06-24-05 01.05.05 Added TargetAssistExtended structures and defines. * 06-24-05 01.05.05 Added TargetAssistExtended structures and defines.
* 03-27-06 01.05.06 Added a comment.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_fc.h mpi_fc.h
...@@ -610,6 +634,10 @@ mpi_sas.h ...@@ -610,6 +634,10 @@ mpi_sas.h
* 08-30-05 01.05.02 Added DeviceInfo bit for SEP. * 08-30-05 01.05.02 Added DeviceInfo bit for SEP.
* Added PrimFlags and Primitive field to SAS IO Unit * Added PrimFlags and Primitive field to SAS IO Unit
* Control request, and added a new operation code. * Control request, and added a new operation code.
* 03-27-06 01.05.03 Added Force Full Discovery, Transmit Port Select Signal,
* and Remove Device operations to SAS IO Unit Control.
* Added DevHandle field to SAS IO Unit Control request and
* reply.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_type.h mpi_type.h
...@@ -625,20 +653,20 @@ mpi_type.h ...@@ -625,20 +653,20 @@ mpi_type.h
mpi_history.txt Parts list history mpi_history.txt Parts list history
Filename 01.05.12 01.05.11 01.05.10 01.05.09 Filename 01.05.13 01.05.12 01.05.11 01.05.10 01.05.09
---------- -------- -------- -------- -------- ---------- -------- -------- -------- -------- --------
mpi.h 01.05.10 01.05.09 01.05.08 01.05.07 mpi.h 01.05.11 01.05.10 01.05.09 01.05.08 01.05.07
mpi_ioc.h 01.05.10 01.05.09 01.05.09 01.05.08 mpi_ioc.h 01.05.11 01.05.10 01.05.09 01.05.09 01.05.08
mpi_cnfg.h 01.05.11 01.05.10 01.05.09 01.05.08 mpi_cnfg.h 01.05.12 01.05.11 01.05.10 01.05.09 01.05.08
mpi_init.h 01.05.06 01.05.06 01.05.05 01.05.04 mpi_init.h 01.05.07 01.05.06 01.05.06 01.05.05 01.05.04
mpi_targ.h 01.05.05 01.05.05 01.05.05 01.05.04 mpi_targ.h 01.05.06 01.05.05 01.05.05 01.05.05 01.05.04
mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
mpi_raid.h 01.05.02 01.05.02 01.05.02 01.05.02 mpi_raid.h 01.05.02 01.05.02 01.05.02 01.05.02 01.05.02
mpi_tool.h 01.05.03 01.05.03 01.05.03 01.05.03 mpi_tool.h 01.05.03 01.05.03 01.05.03 01.05.03 01.05.03
mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
mpi_sas.h 01.05.02 01.05.01 01.05.01 01.05.01 mpi_sas.h 01.05.03 01.05.02 01.05.01 01.05.01 01.05.01
mpi_type.h 01.05.02 01.05.01 01.05.01 01.05.01 mpi_type.h 01.05.02 01.05.02 01.05.01 01.05.01 01.05.01
Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03
---------- -------- -------- -------- -------- -------- -------- ---------- -------- -------- -------- -------- -------- --------
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* 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_init.h Version: 01.05.06 * mpi_init.h Version: 01.05.07
* *
* Version History * Version History
* --------------- * ---------------
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
* Added four new defines for SEP SlotStatus. * Added four new defines for SEP SlotStatus.
* 08-03-05 01.05.06 Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them * 08-03-05 01.05.06 Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them
* unique in the first 32 characters. * unique in the first 32 characters.
* 03-27-06 01.05.07 Added Task Management type of Clear ACA.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -427,6 +428,7 @@ typedef struct _MSG_SCSI_TASK_MGMT ...@@ -427,6 +428,7 @@ typedef struct _MSG_SCSI_TASK_MGMT
#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05)
#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) #define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06)
#define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) #define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07)
#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_ACA (0x08)
/* MsgFlags bits */ /* MsgFlags bits */
#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00) #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* 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_ioc.h Version: 01.05.10 * mpi_ioc.h Version: 01.05.11
* *
* Version History * Version History
* --------------- * ---------------
...@@ -87,6 +87,17 @@ ...@@ -87,6 +87,17 @@
* Added new ReasonCode value for SAS Device Status Change * Added new ReasonCode value for SAS Device Status Change
* event. * event.
* Added new family code for FC949E. * Added new family code for FC949E.
* 03-27-06 01.05.11 Added MPI_IOCFACTS_CAPABILITY_TLR.
* Added additional Reason Codes and more event data fields
* to EVENT_DATA_SAS_DEVICE_STATUS_CHANGE.
* Added EVENT_DATA_SAS_BROADCAST_PRIMITIVE structure and
* new event.
* Added MPI_EVENT_SAS_SMP_ERROR and event data structure.
* Added MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE and event
* data structure.
* Added MPI_EVENT_SAS_INIT_TABLE_OVERFLOW and event
* data structure.
* Added MPI_EXT_IMAGE_TYPE_INITIALIZATION.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -272,6 +283,7 @@ typedef struct _MSG_IOC_FACTS_REPLY ...@@ -272,6 +283,7 @@ typedef struct _MSG_IOC_FACTS_REPLY
#define MPI_IOCFACTS_CAPABILITY_MULTICAST (0x00000100) #define MPI_IOCFACTS_CAPABILITY_MULTICAST (0x00000100)
#define MPI_IOCFACTS_CAPABILITY_SCSIIO32 (0x00000200) #define MPI_IOCFACTS_CAPABILITY_SCSIIO32 (0x00000200)
#define MPI_IOCFACTS_CAPABILITY_NO_SCSIIO16 (0x00000400) #define MPI_IOCFACTS_CAPABILITY_NO_SCSIIO16 (0x00000400)
#define MPI_IOCFACTS_CAPABILITY_TLR (0x00000800)
/***************************************************************************** /*****************************************************************************
...@@ -448,30 +460,34 @@ typedef struct _MSG_EVENT_ACK_REPLY ...@@ -448,30 +460,34 @@ typedef struct _MSG_EVENT_ACK_REPLY
/* Event */ /* Event */
#define MPI_EVENT_NONE (0x00000000) #define MPI_EVENT_NONE (0x00000000)
#define MPI_EVENT_LOG_DATA (0x00000001) #define MPI_EVENT_LOG_DATA (0x00000001)
#define MPI_EVENT_STATE_CHANGE (0x00000002) #define MPI_EVENT_STATE_CHANGE (0x00000002)
#define MPI_EVENT_UNIT_ATTENTION (0x00000003) #define MPI_EVENT_UNIT_ATTENTION (0x00000003)
#define MPI_EVENT_IOC_BUS_RESET (0x00000004) #define MPI_EVENT_IOC_BUS_RESET (0x00000004)
#define MPI_EVENT_EXT_BUS_RESET (0x00000005) #define MPI_EVENT_EXT_BUS_RESET (0x00000005)
#define MPI_EVENT_RESCAN (0x00000006) #define MPI_EVENT_RESCAN (0x00000006)
#define MPI_EVENT_LINK_STATUS_CHANGE (0x00000007) #define MPI_EVENT_LINK_STATUS_CHANGE (0x00000007)
#define MPI_EVENT_LOOP_STATE_CHANGE (0x00000008) #define MPI_EVENT_LOOP_STATE_CHANGE (0x00000008)
#define MPI_EVENT_LOGOUT (0x00000009) #define MPI_EVENT_LOGOUT (0x00000009)
#define MPI_EVENT_EVENT_CHANGE (0x0000000A) #define MPI_EVENT_EVENT_CHANGE (0x0000000A)
#define MPI_EVENT_INTEGRATED_RAID (0x0000000B) #define MPI_EVENT_INTEGRATED_RAID (0x0000000B)
#define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE (0x0000000C) #define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE (0x0000000C)
#define MPI_EVENT_ON_BUS_TIMER_EXPIRED (0x0000000D) #define MPI_EVENT_ON_BUS_TIMER_EXPIRED (0x0000000D)
#define MPI_EVENT_QUEUE_FULL (0x0000000E) #define MPI_EVENT_QUEUE_FULL (0x0000000E)
#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F) #define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F)
#define MPI_EVENT_SAS_SES (0x00000010) #define MPI_EVENT_SAS_SES (0x00000010)
#define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) #define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011)
#define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012) #define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012)
#define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013) #define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013)
#define MPI_EVENT_IR_RESYNC_UPDATE (0x00000014) #define MPI_EVENT_IR_RESYNC_UPDATE (0x00000014)
#define MPI_EVENT_IR2 (0x00000015) #define MPI_EVENT_IR2 (0x00000015)
#define MPI_EVENT_SAS_DISCOVERY (0x00000016) #define MPI_EVENT_SAS_DISCOVERY (0x00000016)
#define MPI_EVENT_LOG_ENTRY_ADDED (0x00000021) #define MPI_EVENT_SAS_BROADCAST_PRIMITIVE (0x00000017)
#define MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE (0x00000018)
#define MPI_EVENT_SAS_INIT_TABLE_OVERFLOW (0x00000019)
#define MPI_EVENT_SAS_SMP_ERROR (0x0000001A)
#define MPI_EVENT_LOG_ENTRY_ADDED (0x00000021)
/* AckRequired field values */ /* AckRequired field values */
...@@ -558,18 +574,25 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE ...@@ -558,18 +574,25 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
U8 PhyNum; /* 0Eh */ U8 PhyNum; /* 0Eh */
U8 Reserved1; /* 0Fh */ U8 Reserved1; /* 0Fh */
U64 SASAddress; /* 10h */ U64 SASAddress; /* 10h */
U8 LUN[8]; /* 18h */
U16 TaskTag; /* 20h */
U16 Reserved2; /* 22h */
} EVENT_DATA_SAS_DEVICE_STATUS_CHANGE, } EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE, MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
MpiEventDataSasDeviceStatusChange_t, MpiEventDataSasDeviceStatusChange_t,
MPI_POINTER pMpiEventDataSasDeviceStatusChange_t; MPI_POINTER pMpiEventDataSasDeviceStatusChange_t;
/* MPI SAS Device Status Change Event data ReasonCode values */ /* MPI SAS Device Status Change Event data ReasonCode values */
#define MPI_EVENT_SAS_DEV_STAT_RC_ADDED (0x03) #define MPI_EVENT_SAS_DEV_STAT_RC_ADDED (0x03)
#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING (0x04) #define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING (0x04)
#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) #define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05)
#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) #define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06)
#define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) #define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07)
#define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08) #define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08)
#define MPI_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL (0x09)
#define MPI_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL (0x0A)
#define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B)
#define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C)
/* SCSI Event data for Queue Full event */ /* SCSI Event data for Queue Full event */
...@@ -742,6 +765,27 @@ typedef struct _EVENT_DATA_SAS_SES ...@@ -742,6 +765,27 @@ typedef struct _EVENT_DATA_SAS_SES
} EVENT_DATA_SAS_SES, MPI_POINTER PTR_EVENT_DATA_SAS_SES, } EVENT_DATA_SAS_SES, MPI_POINTER PTR_EVENT_DATA_SAS_SES,
MpiEventDataSasSes_t, MPI_POINTER pMpiEventDataSasSes_t; MpiEventDataSasSes_t, MPI_POINTER pMpiEventDataSasSes_t;
/* SAS Broadcast Primitive Event data */
typedef struct _EVENT_DATA_SAS_BROADCAST_PRIMITIVE
{
U8 PhyNum; /* 00h */
U8 Port; /* 01h */
U8 PortWidth; /* 02h */
U8 Primitive; /* 04h */
} EVENT_DATA_SAS_BROADCAST_PRIMITIVE,
MPI_POINTER PTR_EVENT_DATA_SAS_BROADCAST_PRIMITIVE,
MpiEventDataSasBroadcastPrimitive_t,
MPI_POINTER pMpiEventDataSasBroadcastPrimitive_t;
#define MPI_EVENT_PRIMITIVE_CHANGE (0x01)
#define MPI_EVENT_PRIMITIVE_EXPANDER (0x03)
#define MPI_EVENT_PRIMITIVE_RESERVED2 (0x04)
#define MPI_EVENT_PRIMITIVE_RESERVED3 (0x05)
#define MPI_EVENT_PRIMITIVE_RESERVED4 (0x06)
#define MPI_EVENT_PRIMITIVE_CHANGE0_RESERVED (0x07)
#define MPI_EVENT_PRIMITIVE_CHANGE1_RESERVED (0x08)
/* SAS Phy Link Status Event data */ /* SAS Phy Link Status Event data */
typedef struct _EVENT_DATA_SAS_PHY_LINK_STATUS typedef struct _EVENT_DATA_SAS_PHY_LINK_STATUS
...@@ -804,6 +848,53 @@ typedef struct _EVENT_DATA_DISCOVERY_ERROR ...@@ -804,6 +848,53 @@ typedef struct _EVENT_DATA_DISCOVERY_ERROR
#define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_PATHS (0x00000800) #define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_PATHS (0x00000800)
#define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000) #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000)
/* SAS SMP Error Event data */
typedef struct _EVENT_DATA_SAS_SMP_ERROR
{
U8 Status; /* 00h */
U8 Port; /* 01h */
U8 SMPFunctionResult; /* 02h */
U8 Reserved1; /* 03h */
U64 SASAddress; /* 04h */
} EVENT_DATA_SAS_SMP_ERROR, MPI_POINTER PTR_EVENT_DATA_SAS_SMP_ERROR,
MpiEventDataSasSmpError_t, MPI_POINTER pMpiEventDataSasSmpError_t;
/* defines for the Status field of the SAS SMP Error event */
#define MPI_EVENT_SAS_SMP_FUNCTION_RESULT_VALID (0x00)
#define MPI_EVENT_SAS_SMP_CRC_ERROR (0x01)
#define MPI_EVENT_SAS_SMP_TIMEOUT (0x02)
#define MPI_EVENT_SAS_SMP_NO_DESTINATION (0x03)
#define MPI_EVENT_SAS_SMP_BAD_DESTINATION (0x04)
/* SAS Initiator Device Status Change Event data */
typedef struct _EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE
{
U8 ReasonCode; /* 00h */
U8 Port; /* 01h */
U16 DevHandle; /* 02h */
U64 SASAddress; /* 04h */
} EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE,
MPI_POINTER PTR_EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE,
MpiEventDataSasInitDevStatusChange_t,
MPI_POINTER pMpiEventDataSasInitDevStatusChange_t;
/* defines for the ReasonCode field of the SAS Initiator Device Status Change event */
#define MPI_EVENT_SAS_INIT_RC_ADDED (0x01)
/* SAS Initiator Device Table Overflow Event data */
typedef struct _EVENT_DATA_SAS_INIT_TABLE_OVERFLOW
{
U8 MaxInit; /* 00h */
U8 CurrentInit; /* 01h */
U16 Reserved1; /* 02h */
} EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
MpiEventDataSasInitTableOverflow_t,
MPI_POINTER pMpiEventDataSasInitTableOverflow_t;
/***************************************************************************** /*****************************************************************************
* *
...@@ -1013,5 +1104,6 @@ typedef struct _MPI_EXT_IMAGE_HEADER ...@@ -1013,5 +1104,6 @@ typedef struct _MPI_EXT_IMAGE_HEADER
#define MPI_EXT_IMAGE_TYPE_FW (0x01) #define MPI_EXT_IMAGE_TYPE_FW (0x01)
#define MPI_EXT_IMAGE_TYPE_NVDATA (0x03) #define MPI_EXT_IMAGE_TYPE_NVDATA (0x03)
#define MPI_EXT_IMAGE_TYPE_BOOTLOADER (0x04) #define MPI_EXT_IMAGE_TYPE_BOOTLOADER (0x04)
#define MPI_EXT_IMAGE_TYPE_INITIALIZATION (0x05)
#endif #endif
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#ifndef IOPI_IOCLOGINFO_H_INCLUDED #ifndef IOPI_IOCLOGINFO_H_INCLUDED
#define IOPI_IOCLOGINFO_H_INCLUDED #define IOPI_IOCLOGINFO_H_INCLUDED
#define SAS_LOGINFO_NEXUS_LOSS 0x31170000
#define SAS_LOGINFO_MASK 0xFFFF0000
/****************************************************************************/ /****************************************************************************/
/* IOC LOGINFO defines, 0x00000000 - 0x0FFFFFFF */ /* IOC LOGINFO defines, 0x00000000 - 0x0FFFFFFF */
...@@ -51,6 +53,9 @@ ...@@ -51,6 +53,9 @@
#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DNM (0x00030500) /* Device Not Mapped */ #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DNM (0x00030500) /* Device Not Mapped */
#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PERSIST (0x00030600) /* Persistent Page not found */ #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_PERSIST (0x00030600) /* Persistent Page not found */
#define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DEFAULT (0x00030700) /* Default Page not found */ #define IOP_LOGINFO_CODE_CONFIG_INVALID_PAGE_DEFAULT (0x00030700) /* Default Page not found */
#define IOP_LOGINFO_CODE_DIAG_MSG_ERROR (0x00040000) /* Error handling diag msg - or'd with diag status */
#define IOP_LOGINFO_CODE_TASK_TERMINATED (0x00050000) #define IOP_LOGINFO_CODE_TASK_TERMINATED (0x00050000)
#define IOP_LOGINFO_CODE_ENCL_MGMT_READ_ACTION_ERR0R (0x00060001) /* Read Action not supported for SEP msg */ #define IOP_LOGINFO_CODE_ENCL_MGMT_READ_ACTION_ERR0R (0x00060001) /* Read Action not supported for SEP msg */
...@@ -103,6 +108,7 @@ ...@@ -103,6 +108,7 @@
#define PL_LOGINFO_CODE_IO_EXECUTED (0x00140000) #define PL_LOGINFO_CODE_IO_EXECUTED (0x00140000)
#define PL_LOGINFO_CODE_PERS_RESV_OUT_NOT_AFFIL_OWNER (0x00150000) #define PL_LOGINFO_CODE_PERS_RESV_OUT_NOT_AFFIL_OWNER (0x00150000)
#define PL_LOGINFO_CODE_OPEN_TXDMA_ABORT (0x00160000) #define PL_LOGINFO_CODE_OPEN_TXDMA_ABORT (0x00160000)
#define PL_LOGINFO_CODE_IO_DEVICE_MISSING_DELAY_RETRY (0x00170000)
#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE (0x00000100) #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE (0x00000100)
#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_NO_DEST_TIMEOUT (0x00000101) #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_NO_DEST_TIMEOUT (0x00000101)
#define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ORR_TIMEOUT (0x0000011A) /* Open Reject (Retry) Timeout */ #define PL_LOGINFO_SUB_CODE_OPEN_FAILURE_ORR_TIMEOUT (0x0000011A) /* Open Reject (Retry) Timeout */
...@@ -165,11 +171,81 @@ ...@@ -165,11 +171,81 @@
/****************************************************************************/ /****************************************************************************/
/* IR LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = IR */ /* IR LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = IR */
/****************************************************************************/ /****************************************************************************/
#define IR_LOGINFO_CODE_UNUSED1 (0x00010000) #define IR_LOGINFO_RAID_ACTION_ERROR (0x00010000)
#define IR_LOGINFO_CODE_UNUSED2 (0x00020000) #define IR_LOGINFO_CODE_UNUSED2 (0x00020000)
/* Amount of information passed down for Create Volume is too large */
#define IR_LOGINFO_VOLUME_CREATE_INVALID_LENGTH (0x00010001)
/* Creation of duplicate volume attempted (Bus/Target ID checked) */
#define IR_LOGINFO_VOLUME_CREATE_DUPLICATE (0x00010002)
/* Creation failed due to maximum number of supported volumes exceeded */
#define IR_LOGINFO_VOLUME_CREATE_NO_SLOTS (0x00010003)
/* Creation failed due to DMA error in trying to read from host */
#define IR_LOGINFO_VOLUME_CREATE_DMA_ERROR (0x00010004)
/* Creation failed due to invalid volume type passed down */
#define IR_LOGINFO_VOLUME_CREATE_INVALID_VOLUME_TYPE (0x00010005)
/* Creation failed due to error reading MFG Page 4 */
#define IR_LOGINFO_VOLUME_MFG_PAGE4_ERROR (0x00010006)
/* Creation failed when trying to create internal structures */
#define IR_LOGINFO_VOLUME_INTERNAL_CONFIG_STRUCTURE_ERROR (0x00010007)
/* Activation failed due to trying to activate an already active volume */
#define IR_LOGINFO_VOLUME_ACTIVATING_AN_ACTIVE_VOLUME (0x00010010)
/* Activation failed due to trying to active unsupported volume type */
#define IR_LOGINFO_VOLUME_ACTIVATING_INVALID_VOLUME_TYPE (0x00010011)
/* Activation failed due to trying to active too many volumes */
#define IR_LOGINFO_VOLUME_ACTIVATING_TOO_MANY_VOLUMES (0x00010012)
/* Activation failed due to Volume ID in use already */
#define IR_LOGINFO_VOLUME_ACTIVATING_VOLUME_ID_IN_USE (0x00010013)
/* Activation failed call to activateVolume returned failure */
#define IR_LOGINFO_VOLUME_ACTIVATE_VOLUME_FAILED (0x00010014)
/* Activation failed trying to import the volume */
#define IR_LOGINFO_VOLUME_ACTIVATING_IMPORT_VOLUME_FAILED (0x00010015)
/* Phys Disk failed, too many phys disks */
#define IR_LOGINFO_PHYSDISK_CREATE_TOO_MANY_DISKS (0x00010020)
/* Amount of information passed down for Create Pnysdisk is too large */
#define IR_LOGINFO_PHYSDISK_CREATE_INVALID_LENGTH (0x00010021)
/* Creation failed due to DMA error in trying to read from host */
#define IR_LOGINFO_PHYSDISK_CREATE_DMA_ERROR (0x00010022)
/* Creation failed due to invalid Bus TargetID passed down */
#define IR_LOGINFO_PHYSDISK_CREATE_BUS_TID_INVALID (0x00010023)
/* Creation failed due to error in creating RAID Phys Disk Config Page */
#define IR_LOGINFO_PHYSDISK_CREATE_CONFIG_PAGE_ERROR (0x00010024)
/* Compatibility Error : IR Disabled */
#define IR_LOGINFO_COMPAT_ERROR_RAID_DISABLED (0x00010030)
/* Compatibility Error : Inquiry Comand failed */
#define IR_LOGINFO_COMPAT_ERROR_INQUIRY_FAILED (0x00010031)
/* Compatibility Error : Device not direct access device */
#define IR_LOGINFO_COMPAT_ERROR_NOT_DIRECT_ACCESS (0x00010032)
/* Compatibility Error : Removable device found */
#define IR_LOGINFO_COMPAT_ERROR_REMOVABLE_FOUND (0x00010033)
/* Compatibility Error : Device SCSI Version not 2 or higher */
#define IR_LOGINFO_COMPAT_ERROR_NEED_SCSI_2_OR_HIGHER (0x00010034)
/* Compatibility Error : SATA device, 48 BIT LBA not supported */
#define IR_LOGINFO_COMPAT_ERROR_SATA_48BIT_LBA_NOT_SUPPORTED (0x00010035)
/* Compatibility Error : Device does not have 512 byte block sizes */
#define IR_LOGINFO_COMPAT_ERROR_DEVICE_NOT_512_BYTE_BLOCK (0x00010036)
/* Compatibility Error : Volume Type check failed */
#define IR_LOGINFO_COMPAT_ERROR_VOLUME_TYPE_CHECK_FAILED (0x00010037)
/* Compatibility Error : Volume Type is unsupported by FW */
#define IR_LOGINFO_COMPAT_ERROR_UNSUPPORTED_VOLUME_TYPE (0x00010038)
/* Compatibility Error : Disk drive too small for use in volume */
#define IR_LOGINFO_COMPAT_ERROR_DISK_TOO_SMALL (0x00010039)
/* Compatibility Error : Phys disk for Create Volume not found */
#define IR_LOGINFO_COMPAT_ERROR_PHYS_DISK_NOT_FOUND (0x0001003A)
/* Compatibility Error : membership count error, too many or too few disks for volume type */
#define IR_LOGINFO_COMPAT_ERROR_MEMBERSHIP_COUNT (0x0001003B)
/* Compatibility Error : Disk stripe sizes must be 64KB */
#define IR_LOGINFO_COMPAT_ERROR_NON_64K_STRIPE_SIZE (0x0001003C)
/* Compatibility Error : IME size limited to < 2TB */
#define IR_LOGINFO_COMPAT_ERROR_IME_VOL_NOT_CURRENTLY_SUPPORTED (0x0001003D)
/****************************************************************************/ /****************************************************************************/
/* Defines for convienence */ /* Defines for convenience */
/****************************************************************************/ /****************************************************************************/
#define IOC_LOGINFO_PREFIX_IOP ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_IOP) #define IOC_LOGINFO_PREFIX_IOP ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_IOP)
#define IOC_LOGINFO_PREFIX_PL ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_PL) #define IOC_LOGINFO_PREFIX_PL ((MPI_IOCLOGINFO_TYPE_SAS << MPI_IOCLOGINFO_TYPE_SHIFT) | IOC_LOGINFO_ORIGINATOR_PL)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Title: MPI Serial Attached SCSI structures and definitions * Title: MPI Serial Attached SCSI structures and definitions
* Creation Date: August 19, 2004 * Creation Date: August 19, 2004
* *
* mpi_sas.h Version: 01.05.02 * mpi_sas.h Version: 01.05.03
* *
* Version History * Version History
* --------------- * ---------------
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
* 08-30-05 01.05.02 Added DeviceInfo bit for SEP. * 08-30-05 01.05.02 Added DeviceInfo bit for SEP.
* Added PrimFlags and Primitive field to SAS IO Unit * Added PrimFlags and Primitive field to SAS IO Unit
* Control request, and added a new operation code. * Control request, and added a new operation code.
* 03-27-06 01.05.03 Added Force Full Discovery, Transmit Port Select Signal,
* and Remove Device operations to SAS IO Unit Control.
* Added DevHandle field to SAS IO Unit Control request and
* reply.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -209,7 +213,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST ...@@ -209,7 +213,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
U8 Reserved1; /* 01h */ U8 Reserved1; /* 01h */
U8 ChainOffset; /* 02h */ U8 ChainOffset; /* 02h */
U8 Function; /* 03h */ U8 Function; /* 03h */
U16 Reserved2; /* 04h */ U16 DevHandle; /* 04h */
U8 Reserved3; /* 06h */ U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */ U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */ U32 MsgContext; /* 08h */
...@@ -231,6 +235,9 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST ...@@ -231,6 +235,9 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
#define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) #define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
#define MPI_SAS_OP_MAP_CURRENT (0x09) #define MPI_SAS_OP_MAP_CURRENT (0x09)
#define MPI_SAS_OP_SEND_PRIMITIVE (0x0A) #define MPI_SAS_OP_SEND_PRIMITIVE (0x0A)
#define MPI_SAS_OP_FORCE_FULL_DISCOVERY (0x0B)
#define MPI_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C)
#define MPI_SAS_OP_TRANSMIT_REMOVE_DEVICE (0x0D)
/* values for the PrimFlags field */ /* values for the PrimFlags field */
#define MPI_SAS_PRIMFLAGS_SINGLE (0x08) #define MPI_SAS_PRIMFLAGS_SINGLE (0x08)
...@@ -245,7 +252,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY ...@@ -245,7 +252,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY
U8 Reserved1; /* 01h */ U8 Reserved1; /* 01h */
U8 MsgLength; /* 02h */ U8 MsgLength; /* 02h */
U8 Function; /* 03h */ U8 Function; /* 03h */
U16 Reserved2; /* 04h */ U16 DevHandle; /* 04h */
U8 Reserved3; /* 06h */ U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */ U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */ U32 MsgContext; /* 08h */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* 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_targ.h Version: 01.05.05 * mpi_targ.h Version: 01.05.06
* *
* Version History * Version History
* --------------- * ---------------
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
* 02-22-05 01.05.03 Changed a comment. * 02-22-05 01.05.03 Changed a comment.
* 03-11-05 01.05.04 Removed TargetAssistExtended Request. * 03-11-05 01.05.04 Removed TargetAssistExtended Request.
* 06-24-05 01.05.05 Added TargetAssistExtended structures and defines. * 06-24-05 01.05.05 Added TargetAssistExtended structures and defines.
* 03-27-06 01.05.06 Added a comment.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -351,7 +352,7 @@ typedef struct _MSG_TARGET_ASSIST_REQUEST ...@@ -351,7 +352,7 @@ typedef struct _MSG_TARGET_ASSIST_REQUEST
#define TARGET_ASSIST_FLAGS_CONFIRMED (0x08) #define TARGET_ASSIST_FLAGS_CONFIRMED (0x08)
#define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80) #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80)
/* Standard Target Mode Reply message */
typedef struct _MSG_TARGET_ERROR_REPLY typedef struct _MSG_TARGET_ERROR_REPLY
{ {
U16 Reserved; /* 00h */ U16 Reserved; /* 00h */
......
...@@ -368,20 +368,21 @@ static irqreturn_t ...@@ -368,20 +368,21 @@ static irqreturn_t
mpt_interrupt(int irq, void *bus_id, struct pt_regs *r) mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
{ {
MPT_ADAPTER *ioc = bus_id; MPT_ADAPTER *ioc = bus_id;
u32 pa; u32 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
if (pa == 0xFFFFFFFF)
return IRQ_NONE;
/* /*
* Drain the reply FIFO! * Drain the reply FIFO!
*/ */
while (1) { do {
pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo); if (pa & MPI_ADDRESS_REPLY_A_BIT)
if (pa == 0xFFFFFFFF)
return IRQ_HANDLED;
else if (pa & MPI_ADDRESS_REPLY_A_BIT)
mpt_reply(ioc, pa); mpt_reply(ioc, pa);
else else
mpt_turbo_reply(ioc, pa); mpt_turbo_reply(ioc, pa);
} pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
} while (pa != 0xFFFFFFFF);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1219,31 +1220,25 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1219,31 +1220,25 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
port = psize = 0; port = psize = 0;
for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) {
if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) { if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
if (psize)
continue;
/* Get I/O space! */ /* Get I/O space! */
port = pci_resource_start(pdev, ii); port = pci_resource_start(pdev, ii);
psize = pci_resource_len(pdev,ii); psize = pci_resource_len(pdev,ii);
} else { } else {
if (msize)
continue;
/* Get memmap */ /* Get memmap */
mem_phys = pci_resource_start(pdev, ii); mem_phys = pci_resource_start(pdev, ii);
msize = pci_resource_len(pdev,ii); msize = pci_resource_len(pdev,ii);
break;
} }
} }
ioc->mem_size = msize; ioc->mem_size = msize;
if (ii == DEVICE_COUNT_RESOURCE) {
printk(KERN_ERR MYNAM ": ERROR - MPT adapter has no memory regions defined!\n");
kfree(ioc);
return -EINVAL;
}
dinitprintk((KERN_INFO MYNAM ": MPT adapter @ %lx, msize=%dd bytes\n", mem_phys, msize));
dinitprintk((KERN_INFO MYNAM ": (port i/o @ %lx, psize=%dd bytes)\n", port, psize));
mem = NULL; mem = NULL;
/* Get logical ptr for PciMem0 space */ /* Get logical ptr for PciMem0 space */
/*mem = ioremap(mem_phys, msize);*/ /*mem = ioremap(mem_phys, msize);*/
mem = ioremap(mem_phys, 0x100); mem = ioremap(mem_phys, msize);
if (mem == NULL) { if (mem == NULL) {
printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n"); printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n");
kfree(ioc); kfree(ioc);
...@@ -1343,11 +1338,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1343,11 +1338,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
ioc->bus_type = SAS; ioc->bus_type = SAS;
ioc->errata_flag_1064 = 1; ioc->errata_flag_1064 = 1;
} }
else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066) {
ioc->prod_name = "LSISAS1066";
ioc->bus_type = SAS;
ioc->errata_flag_1064 = 1;
}
else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) { else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) {
ioc->prod_name = "LSISAS1068"; ioc->prod_name = "LSISAS1068";
ioc->bus_type = SAS; ioc->bus_type = SAS;
...@@ -1357,14 +1347,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1357,14 +1347,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
ioc->prod_name = "LSISAS1064E"; ioc->prod_name = "LSISAS1064E";
ioc->bus_type = SAS; ioc->bus_type = SAS;
} }
else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066E) {
ioc->prod_name = "LSISAS1066E";
ioc->bus_type = SAS;
}
else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) { else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) {
ioc->prod_name = "LSISAS1068E"; ioc->prod_name = "LSISAS1068E";
ioc->bus_type = SAS; ioc->bus_type = SAS;
} }
else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
ioc->prod_name = "LSISAS1078";
ioc->bus_type = SAS;
}
if (ioc->errata_flag_1064) if (ioc->errata_flag_1064)
pci_disable_io_access(pdev); pci_disable_io_access(pdev);
...@@ -3184,6 +3174,37 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3184,6 +3174,37 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
u32 diag1val = 0; u32 diag1val = 0;
#endif #endif
if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
drsprintk((MYIOC_s_WARN_FMT "%s: Doorbell=%p; 1078 reset "
"address=%p\n", ioc->name, __FUNCTION__,
&ioc->chip->Doorbell, &ioc->chip->Reset_1078));
CHIPREG_WRITE32(&ioc->chip->Reset_1078, 0x07);
if (sleepFlag == CAN_SLEEP)
msleep(1);
else
mdelay(1);
for (count = 0; count < 60; count ++) {
doorbell = CHIPREG_READ32(&ioc->chip->Doorbell);
doorbell &= MPI_IOC_STATE_MASK;
drsprintk((MYIOC_s_INFO_FMT
"looking for READY STATE: doorbell=%x"
" count=%d\n",
ioc->name, doorbell, count));
if (doorbell == MPI_IOC_STATE_READY) {
return 0;
}
/* wait 1 sec */
if (sleepFlag == CAN_SLEEP)
msleep(1000);
else
mdelay(1000);
}
return -1;
}
/* Clear any existing interrupts */ /* Clear any existing interrupts */
CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
......
...@@ -75,8 +75,8 @@ ...@@ -75,8 +75,8 @@
#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR
#endif #endif
#define MPT_LINUX_VERSION_COMMON "3.03.10" #define MPT_LINUX_VERSION_COMMON "3.04.00"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.10" #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.00"
#define WHAT_MAGIC_STRING "@" "(" "#" ")" #define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \ #define show_mptmod_ver(s,ver) \
...@@ -307,7 +307,8 @@ typedef struct _SYSIF_REGS ...@@ -307,7 +307,8 @@ typedef struct _SYSIF_REGS
u32 HostIndex; /* 50 Host Index register */ u32 HostIndex; /* 50 Host Index register */
u32 Reserved4[15]; /* 54-8F */ u32 Reserved4[15]; /* 54-8F */
u32 Fubar; /* 90 For Fubar usage */ u32 Fubar; /* 90 For Fubar usage */
u32 Reserved5[27]; /* 94-FF */ u32 Reserved5[1050];/* 94-10F8 */
u32 Reset_1078; /* 10FC Reset 1078 */
} SYSIF_REGS; } SYSIF_REGS;
/* /*
...@@ -341,6 +342,7 @@ typedef struct _VirtTarget { ...@@ -341,6 +342,7 @@ typedef struct _VirtTarget {
u8 negoFlags; /* bit field, see above */ u8 negoFlags; /* bit field, see above */
u8 raidVolume; /* set, if RAID Volume */ u8 raidVolume; /* set, if RAID Volume */
u8 type; /* byte 0 of Inquiry data */ u8 type; /* byte 0 of Inquiry data */
u8 deleted; /* target in process of being removed */
u32 num_luns; u32 num_luns;
u32 luns[8]; /* Max LUNs is 256 */ u32 luns[8]; /* Max LUNs is 256 */
} VirtTarget; } VirtTarget;
...@@ -629,10 +631,11 @@ typedef struct _MPT_ADAPTER ...@@ -629,10 +631,11 @@ typedef struct _MPT_ADAPTER
struct mutex sas_discovery_mutex; struct mutex sas_discovery_mutex;
u8 sas_discovery_runtime; u8 sas_discovery_runtime;
u8 sas_discovery_ignore_events; u8 sas_discovery_ignore_events;
u16 handle;
int sas_index; /* index refrencing */ int sas_index; /* index refrencing */
MPT_SAS_MGMT sas_mgmt; MPT_SAS_MGMT sas_mgmt;
int num_ports; int num_ports;
struct work_struct mptscsih_persistTask; struct work_struct sas_persist_task;
struct work_struct fc_setup_reset_work; struct work_struct fc_setup_reset_work;
struct list_head fc_rports; struct list_head fc_rports;
...@@ -641,6 +644,7 @@ typedef struct _MPT_ADAPTER ...@@ -641,6 +644,7 @@ typedef struct _MPT_ADAPTER
struct work_struct fc_rescan_work; struct work_struct fc_rescan_work;
char fc_rescan_work_q_name[KOBJ_NAME_LEN]; char fc_rescan_work_q_name[KOBJ_NAME_LEN];
struct workqueue_struct *fc_rescan_work_q; struct workqueue_struct *fc_rescan_work_q;
u8 port_serial_number;
} MPT_ADAPTER; } MPT_ADAPTER;
/* /*
...@@ -892,6 +896,13 @@ typedef struct _mpt_sge { ...@@ -892,6 +896,13 @@ typedef struct _mpt_sge {
#define DBG_DUMP_REQUEST_FRAME_HDR(mfp) #define DBG_DUMP_REQUEST_FRAME_HDR(mfp)
#endif #endif
// debug sas wide ports
#ifdef MPT_DEBUG_SAS_WIDE
#define dsaswideprintk(x) printk x
#else
#define dsaswideprintk(x)
#endif
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -132,21 +132,21 @@ static struct scsi_host_template mptfc_driver_template = { ...@@ -132,21 +132,21 @@ static struct scsi_host_template mptfc_driver_template = {
*/ */
static struct pci_device_id mptfc_pci_table[] = { static struct pci_device_id mptfc_pci_table[] = {
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC909,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC929,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC919X,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC929X,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC939X, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC939X,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949X, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC949X,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949ES, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC949E,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{0} /* Terminating entry */ {0} /* Terminating entry */
}; };
......
此差异已折叠。
...@@ -775,9 +775,9 @@ static struct spi_function_template mptspi_transport_functions = { ...@@ -775,9 +775,9 @@ static struct spi_function_template mptspi_transport_functions = {
*/ */
static struct pci_device_id mptspi_pci_table[] = { static struct pci_device_id mptspi_pci_table[] = {
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1030,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035, { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1035,
PCI_ANY_ID, PCI_ANY_ID }, PCI_ANY_ID, PCI_ANY_ID },
{0} /* Terminating entry */ {0} /* Terminating entry */
}; };
......
...@@ -173,6 +173,7 @@ STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); ...@@ -173,6 +173,7 @@ STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt);
STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
STATIC void NCR_700_chip_setup(struct Scsi_Host *host); STATIC void NCR_700_chip_setup(struct Scsi_Host *host);
STATIC void NCR_700_chip_reset(struct Scsi_Host *host); STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
STATIC int NCR_700_slave_alloc(struct scsi_device *SDpnt);
STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt); STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt);
STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt); STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt);
static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth); static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth);
...@@ -182,10 +183,6 @@ STATIC struct device_attribute *NCR_700_dev_attrs[]; ...@@ -182,10 +183,6 @@ STATIC struct device_attribute *NCR_700_dev_attrs[];
STATIC struct scsi_transport_template *NCR_700_transport_template = NULL; STATIC struct scsi_transport_template *NCR_700_transport_template = NULL;
struct NCR_700_sense {
unsigned char cmnd[MAX_COMMAND_SIZE];
};
static char *NCR_700_phase[] = { static char *NCR_700_phase[] = {
"", "",
"after selection", "after selection",
...@@ -333,6 +330,7 @@ NCR_700_detect(struct scsi_host_template *tpnt, ...@@ -333,6 +330,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
tpnt->use_clustering = ENABLE_CLUSTERING; tpnt->use_clustering = ENABLE_CLUSTERING;
tpnt->slave_configure = NCR_700_slave_configure; tpnt->slave_configure = NCR_700_slave_configure;
tpnt->slave_destroy = NCR_700_slave_destroy; tpnt->slave_destroy = NCR_700_slave_destroy;
tpnt->slave_alloc = NCR_700_slave_alloc;
tpnt->change_queue_depth = NCR_700_change_queue_depth; tpnt->change_queue_depth = NCR_700_change_queue_depth;
tpnt->change_queue_type = NCR_700_change_queue_type; tpnt->change_queue_type = NCR_700_change_queue_type;
...@@ -611,9 +609,10 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata, ...@@ -611,9 +609,10 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata,
struct NCR_700_command_slot *slot = struct NCR_700_command_slot *slot =
(struct NCR_700_command_slot *)SCp->host_scribble; (struct NCR_700_command_slot *)SCp->host_scribble;
NCR_700_unmap(hostdata, SCp, slot); dma_unmap_single(hostdata->dev, slot->pCmd,
sizeof(SCp->cmnd), DMA_TO_DEVICE);
if (slot->flags == NCR_700_FLAG_AUTOSENSE) { if (slot->flags == NCR_700_FLAG_AUTOSENSE) {
struct NCR_700_sense *sense = SCp->device->hostdata; char *cmnd = NCR_700_get_sense_cmnd(SCp->device);
#ifdef NCR_700_DEBUG #ifdef NCR_700_DEBUG
printk(" ORIGINAL CMD %p RETURNED %d, new return is %d sense is\n", printk(" ORIGINAL CMD %p RETURNED %d, new return is %d sense is\n",
SCp, SCp->cmnd[7], result); SCp, SCp->cmnd[7], result);
...@@ -624,10 +623,9 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata, ...@@ -624,10 +623,9 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata,
/* restore the old result if the request sense was /* restore the old result if the request sense was
* successful */ * successful */
if(result == 0) if(result == 0)
result = sense->cmnd[7]; result = cmnd[7];
} else } else
dma_unmap_single(hostdata->dev, slot->pCmd, NCR_700_unmap(hostdata, SCp, slot);
sizeof(SCp->cmnd), DMA_TO_DEVICE);
free_slot(slot, hostdata); free_slot(slot, hostdata);
#ifdef NCR_700_DEBUG #ifdef NCR_700_DEBUG
...@@ -969,14 +967,15 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, ...@@ -969,14 +967,15 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
status_byte(hostdata->status[0]) == COMMAND_TERMINATED) { status_byte(hostdata->status[0]) == COMMAND_TERMINATED) {
struct NCR_700_command_slot *slot = struct NCR_700_command_slot *slot =
(struct NCR_700_command_slot *)SCp->host_scribble; (struct NCR_700_command_slot *)SCp->host_scribble;
if(SCp->cmnd[0] == REQUEST_SENSE) { if(slot->flags == NCR_700_FLAG_AUTOSENSE) {
/* OOPS: bad device, returning another /* OOPS: bad device, returning another
* contingent allegiance condition */ * contingent allegiance condition */
scmd_printk(KERN_ERR, SCp, scmd_printk(KERN_ERR, SCp,
"broken device is looping in contingent allegiance: ignoring\n"); "broken device is looping in contingent allegiance: ignoring\n");
NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]);
} else { } else {
struct NCR_700_sense *sense = SCp->device->hostdata; char *cmnd =
NCR_700_get_sense_cmnd(SCp->device);
#ifdef NCR_DEBUG #ifdef NCR_DEBUG
scsi_print_command(SCp); scsi_print_command(SCp);
printk(" cmd %p has status %d, requesting sense\n", printk(" cmd %p has status %d, requesting sense\n",
...@@ -994,21 +993,21 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, ...@@ -994,21 +993,21 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
sizeof(SCp->cmnd), sizeof(SCp->cmnd),
DMA_TO_DEVICE); DMA_TO_DEVICE);
sense->cmnd[0] = REQUEST_SENSE; cmnd[0] = REQUEST_SENSE;
sense->cmnd[1] = (SCp->device->lun & 0x7) << 5; cmnd[1] = (SCp->device->lun & 0x7) << 5;
sense->cmnd[2] = 0; cmnd[2] = 0;
sense->cmnd[3] = 0; cmnd[3] = 0;
sense->cmnd[4] = sizeof(SCp->sense_buffer); cmnd[4] = sizeof(SCp->sense_buffer);
sense->cmnd[5] = 0; cmnd[5] = 0;
/* Here's a quiet hack: the /* Here's a quiet hack: the
* REQUEST_SENSE command is six bytes, * REQUEST_SENSE command is six bytes,
* so store a flag indicating that * so store a flag indicating that
* this was an internal sense request * this was an internal sense request
* and the original status at the end * and the original status at the end
* of the command */ * of the command */
sense->cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC; cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC;
sense->cmnd[7] = hostdata->status[0]; cmnd[7] = hostdata->status[0];
slot->pCmd = dma_map_single(hostdata->dev, sense->cmnd, sizeof(sense->cmnd), DMA_TO_DEVICE); slot->pCmd = dma_map_single(hostdata->dev, cmnd, MAX_COMMAND_SIZE, DMA_TO_DEVICE);
slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, sizeof(SCp->sense_buffer), DMA_FROM_DEVICE); slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, sizeof(SCp->sense_buffer), DMA_FROM_DEVICE);
slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer)); slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer));
slot->SG[0].pAddr = bS_to_host(slot->dma_handle); slot->SG[0].pAddr = bS_to_host(slot->dma_handle);
...@@ -1530,7 +1529,7 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1530,7 +1529,7 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
/* clear all the negotiated parameters */ /* clear all the negotiated parameters */
__shost_for_each_device(SDp, host) __shost_for_each_device(SDp, host)
SDp->hostdata = NULL; NCR_700_clear_flag(SDp, ~0);
/* clear all the slots and their pending commands */ /* clear all the slots and their pending commands */
for(i = 0; i < NCR_700_COMMAND_SLOTS_PER_HOST; i++) { for(i = 0; i < NCR_700_COMMAND_SLOTS_PER_HOST; i++) {
...@@ -2035,7 +2034,17 @@ NCR_700_set_offset(struct scsi_target *STp, int offset) ...@@ -2035,7 +2034,17 @@ NCR_700_set_offset(struct scsi_target *STp, int offset)
spi_flags(STp) |= NCR_700_DEV_PRINT_SYNC_NEGOTIATION; spi_flags(STp) |= NCR_700_DEV_PRINT_SYNC_NEGOTIATION;
} }
STATIC int
NCR_700_slave_alloc(struct scsi_device *SDp)
{
SDp->hostdata = kzalloc(sizeof(struct NCR_700_Device_Parameters),
GFP_KERNEL);
if (!SDp->hostdata)
return -ENOMEM;
return 0;
}
STATIC int STATIC int
NCR_700_slave_configure(struct scsi_device *SDp) NCR_700_slave_configure(struct scsi_device *SDp)
...@@ -2043,11 +2052,6 @@ NCR_700_slave_configure(struct scsi_device *SDp) ...@@ -2043,11 +2052,6 @@ NCR_700_slave_configure(struct scsi_device *SDp)
struct NCR_700_Host_Parameters *hostdata = struct NCR_700_Host_Parameters *hostdata =
(struct NCR_700_Host_Parameters *)SDp->host->hostdata[0]; (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
SDp->hostdata = kmalloc(GFP_KERNEL, sizeof(struct NCR_700_sense));
if (!SDp->hostdata)
return -ENOMEM;
/* to do here: allocate memory; build a queue_full list */ /* to do here: allocate memory; build a queue_full list */
if(SDp->tagged_supported) { if(SDp->tagged_supported) {
scsi_set_tag_type(SDp, MSG_ORDERED_TAG); scsi_set_tag_type(SDp, MSG_ORDERED_TAG);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <scsi/scsi_device.h> #include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
/* Turn on for general debugging---too verbose for normal use */ /* Turn on for general debugging---too verbose for normal use */
#undef NCR_700_DEBUG #undef NCR_700_DEBUG
...@@ -76,11 +76,16 @@ struct NCR_700_SG_List { ...@@ -76,11 +76,16 @@ struct NCR_700_SG_List {
#define SCRIPT_RETURN 0x90080000 #define SCRIPT_RETURN 0x90080000
}; };
/* We use device->hostdata to store negotiated parameters. This is struct NCR_700_Device_Parameters {
* supposed to be a pointer to a device private area, but we cannot /* space for creating a request sense command. Really, except
* really use it as such since it will never be freed, so just use the * for the annoying SCSI-2 requirement for LUN information in
* 32 bits to cram the information. The SYNC negotiation sequence looks * cmnd[1], this could be in static storage */
* like: unsigned char cmnd[MAX_COMMAND_SIZE];
__u8 depth;
};
/* The SYNC negotiation sequence looks like:
* *
* If DEV_NEGOTIATED_SYNC not set, tack and SDTR message on to the * If DEV_NEGOTIATED_SYNC not set, tack and SDTR message on to the
* initial identify for the device and set DEV_BEGIN_SYNC_NEGOTATION * initial identify for the device and set DEV_BEGIN_SYNC_NEGOTATION
...@@ -98,19 +103,26 @@ struct NCR_700_SG_List { ...@@ -98,19 +103,26 @@ struct NCR_700_SG_List {
#define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION (1<<17) #define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION (1<<17)
#define NCR_700_DEV_PRINT_SYNC_NEGOTIATION (1<<19) #define NCR_700_DEV_PRINT_SYNC_NEGOTIATION (1<<19)
static inline char *NCR_700_get_sense_cmnd(struct scsi_device *SDp)
{
struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
return hostdata->cmnd;
}
static inline void static inline void
NCR_700_set_depth(struct scsi_device *SDp, __u8 depth) NCR_700_set_depth(struct scsi_device *SDp, __u8 depth)
{ {
long l = (long)SDp->hostdata; struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
l &= 0xffff00ff; hostdata->depth = depth;
l |= 0xff00 & (depth << 8);
SDp->hostdata = (void *)l;
} }
static inline __u8 static inline __u8
NCR_700_get_depth(struct scsi_device *SDp) NCR_700_get_depth(struct scsi_device *SDp)
{ {
return ((((unsigned long)SDp->hostdata) & 0xff00)>>8); struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
return hostdata->depth;
} }
static inline int static inline int
NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag) NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag)
......
...@@ -92,31 +92,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co ...@@ -92,31 +92,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys); init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys);
init->AdapterFibsSize = cpu_to_le32(fibsize); init->AdapterFibsSize = cpu_to_le32(fibsize);
init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib)); init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib));
/* init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
* number of 4k pages of host physical memory. The aacraid fw needs
* this number to be less than 4gb worth of pages. num_physpages is in
* system page units. New firmware doesn't have any issues with the
* mapping system, but older Firmware did, and had *troubles* dealing
* with the math overloading past 32 bits, thus we must limit this
* field.
*
* This assumes the memory is mapped zero->n, which isnt
* always true on real computers. It also has some slight problems
* with the GART on x86-64. I've btw never tried DMA from PCI space
* on this platform but don't be surprised if its problematic.
* [AK: something is very very wrong when a driver tests this symbol.
* Someone should figure out what the comment writer really meant here and fix
* the code. Or just remove that bad code. ]
*/
#ifndef CONFIG_IOMMU
if ((num_physpages << (PAGE_SHIFT - 12)) <= AAC_MAX_HOSTPHYSMEMPAGES) {
init->HostPhysMemPages =
cpu_to_le32(num_physpages << (PAGE_SHIFT-12));
} else
#endif
{
init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
}
init->InitFlags = 0; init->InitFlags = 0;
if (dev->new_comm_interface) { if (dev->new_comm_interface) {
......
...@@ -1487,6 +1487,7 @@ typedef enum { ...@@ -1487,6 +1487,7 @@ typedef enum {
} ahd_queue_alg; } ahd_queue_alg;
void ahd_set_tags(struct ahd_softc *ahd, void ahd_set_tags(struct ahd_softc *ahd,
struct scsi_cmnd *cmd,
struct ahd_devinfo *devinfo, struct ahd_devinfo *devinfo,
ahd_queue_alg alg); ahd_queue_alg alg);
......
...@@ -1090,7 +1090,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) ...@@ -1090,7 +1090,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
/* Notify XPT */ /* Notify XPT */
ahd_send_async(ahd, devinfo.channel, devinfo.target, ahd_send_async(ahd, devinfo.channel, devinfo.target,
CAM_LUN_WILDCARD, AC_SENT_BDR, NULL); CAM_LUN_WILDCARD, AC_SENT_BDR);
/* /*
* Allow the sequencer to continue with * Allow the sequencer to continue with
...@@ -3062,7 +3062,7 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, ...@@ -3062,7 +3062,7 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
tinfo->curr.ppr_options = ppr_options; tinfo->curr.ppr_options = ppr_options;
ahd_send_async(ahd, devinfo->channel, devinfo->target, ahd_send_async(ahd, devinfo->channel, devinfo->target,
CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL); CAM_LUN_WILDCARD, AC_TRANSFER_NEG);
if (bootverbose) { if (bootverbose) {
if (offset != 0) { if (offset != 0) {
int options; int options;
...@@ -3184,7 +3184,7 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, ...@@ -3184,7 +3184,7 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
tinfo->curr.width = width; tinfo->curr.width = width;
ahd_send_async(ahd, devinfo->channel, devinfo->target, ahd_send_async(ahd, devinfo->channel, devinfo->target,
CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL); CAM_LUN_WILDCARD, AC_TRANSFER_NEG);
if (bootverbose) { if (bootverbose) {
printf("%s: target %d using %dbit transfers\n", printf("%s: target %d using %dbit transfers\n",
ahd_name(ahd), devinfo->target, ahd_name(ahd), devinfo->target,
...@@ -3211,12 +3211,14 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, ...@@ -3211,12 +3211,14 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
* Update the current state of tagged queuing for a given target. * Update the current state of tagged queuing for a given target.
*/ */
void void
ahd_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, ahd_set_tags(struct ahd_softc *ahd, struct scsi_cmnd *cmd,
ahd_queue_alg alg) struct ahd_devinfo *devinfo, ahd_queue_alg alg)
{ {
ahd_platform_set_tags(ahd, devinfo, alg); struct scsi_device *sdev = cmd->device;
ahd_platform_set_tags(ahd, sdev, devinfo, alg);
ahd_send_async(ahd, devinfo->channel, devinfo->target, ahd_send_async(ahd, devinfo->channel, devinfo->target,
devinfo->lun, AC_TRANSFER_NEG, &alg); devinfo->lun, AC_TRANSFER_NEG);
} }
static void static void
...@@ -4746,7 +4748,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) ...@@ -4746,7 +4748,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
printf("(%s:%c:%d:%d): refuses tagged commands. " printf("(%s:%c:%d:%d): refuses tagged commands. "
"Performing non-tagged I/O\n", ahd_name(ahd), "Performing non-tagged I/O\n", ahd_name(ahd),
devinfo->channel, devinfo->target, devinfo->lun); devinfo->channel, devinfo->target, devinfo->lun);
ahd_set_tags(ahd, devinfo, AHD_QUEUE_NONE); ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_NONE);
mask = ~0x23; mask = ~0x23;
} else { } else {
printf("(%s:%c:%d:%d): refuses %s tagged commands. " printf("(%s:%c:%d:%d): refuses %s tagged commands. "
...@@ -4754,7 +4756,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) ...@@ -4754,7 +4756,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd_name(ahd), devinfo->channel, devinfo->target, ahd_name(ahd), devinfo->channel, devinfo->target,
devinfo->lun, tag_type == MSG_ORDERED_TASK devinfo->lun, tag_type == MSG_ORDERED_TASK
? "ordered" : "head of queue"); ? "ordered" : "head of queue");
ahd_set_tags(ahd, devinfo, AHD_QUEUE_BASIC); ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_BASIC);
mask = ~0x03; mask = ~0x03;
} }
...@@ -5098,7 +5100,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, ...@@ -5098,7 +5100,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
if (status != CAM_SEL_TIMEOUT) if (status != CAM_SEL_TIMEOUT)
ahd_send_async(ahd, devinfo->channel, devinfo->target, ahd_send_async(ahd, devinfo->channel, devinfo->target,
CAM_LUN_WILDCARD, AC_SENT_BDR, NULL); CAM_LUN_WILDCARD, AC_SENT_BDR);
if (message != NULL && bootverbose) if (message != NULL && bootverbose)
printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd), printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd),
...@@ -7952,7 +7954,7 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset) ...@@ -7952,7 +7954,7 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
#endif #endif
/* Notify the XPT that a bus reset occurred */ /* Notify the XPT that a bus reset occurred */
ahd_send_async(ahd, devinfo.channel, CAM_TARGET_WILDCARD, ahd_send_async(ahd, devinfo.channel, CAM_TARGET_WILDCARD,
CAM_LUN_WILDCARD, AC_BUS_RESET, NULL); CAM_LUN_WILDCARD, AC_BUS_RESET);
/* /*
* Revert to async/narrow transfers until we renegotiate. * Revert to async/narrow transfers until we renegotiate.
......
...@@ -484,7 +484,6 @@ ahd_linux_target_alloc(struct scsi_target *starget) ...@@ -484,7 +484,6 @@ ahd_linux_target_alloc(struct scsi_target *starget)
struct seeprom_config *sc = ahd->seep_config; struct seeprom_config *sc = ahd->seep_config;
unsigned long flags; unsigned long flags;
struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget); struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget);
struct ahd_linux_target *targ = scsi_transport_target_data(starget);
struct ahd_devinfo devinfo; struct ahd_devinfo devinfo;
struct ahd_initiator_tinfo *tinfo; struct ahd_initiator_tinfo *tinfo;
struct ahd_tmode_tstate *tstate; struct ahd_tmode_tstate *tstate;
...@@ -495,7 +494,6 @@ ahd_linux_target_alloc(struct scsi_target *starget) ...@@ -495,7 +494,6 @@ ahd_linux_target_alloc(struct scsi_target *starget)
BUG_ON(*ahd_targp != NULL); BUG_ON(*ahd_targp != NULL);
*ahd_targp = starget; *ahd_targp = starget;
memset(targ, 0, sizeof(*targ));
if (sc) { if (sc) {
int flags = sc->device_flags[starget->id]; int flags = sc->device_flags[starget->id];
...@@ -551,15 +549,11 @@ ahd_linux_slave_alloc(struct scsi_device *sdev) ...@@ -551,15 +549,11 @@ ahd_linux_slave_alloc(struct scsi_device *sdev)
{ {
struct ahd_softc *ahd = struct ahd_softc *ahd =
*((struct ahd_softc **)sdev->host->hostdata); *((struct ahd_softc **)sdev->host->hostdata);
struct scsi_target *starget = sdev->sdev_target;
struct ahd_linux_target *targ = scsi_transport_target_data(starget);
struct ahd_linux_device *dev; struct ahd_linux_device *dev;
if (bootverbose) if (bootverbose)
printf("%s: Slave Alloc %d\n", ahd_name(ahd), sdev->id); printf("%s: Slave Alloc %d\n", ahd_name(ahd), sdev->id);
BUG_ON(targ->sdev[sdev->lun] != NULL);
dev = scsi_transport_device_data(sdev); dev = scsi_transport_device_data(sdev);
memset(dev, 0, sizeof(*dev)); memset(dev, 0, sizeof(*dev));
...@@ -576,8 +570,6 @@ ahd_linux_slave_alloc(struct scsi_device *sdev) ...@@ -576,8 +570,6 @@ ahd_linux_slave_alloc(struct scsi_device *sdev)
*/ */
dev->maxtags = 0; dev->maxtags = 0;
targ->sdev[sdev->lun] = sdev;
return (0); return (0);
} }
...@@ -599,23 +591,6 @@ ahd_linux_slave_configure(struct scsi_device *sdev) ...@@ -599,23 +591,6 @@ ahd_linux_slave_configure(struct scsi_device *sdev)
return 0; return 0;
} }
static void
ahd_linux_slave_destroy(struct scsi_device *sdev)
{
struct ahd_softc *ahd;
struct ahd_linux_device *dev = scsi_transport_device_data(sdev);
struct ahd_linux_target *targ = scsi_transport_target_data(sdev->sdev_target);
ahd = *((struct ahd_softc **)sdev->host->hostdata);
if (bootverbose)
printf("%s: Slave Destroy %d\n", ahd_name(ahd), sdev->id);
BUG_ON(dev->active);
targ->sdev[sdev->lun] = NULL;
}
#if defined(__i386__) #if defined(__i386__)
/* /*
* Return the disk geometry for the given SCSI device. * Return the disk geometry for the given SCSI device.
...@@ -822,7 +797,6 @@ struct scsi_host_template aic79xx_driver_template = { ...@@ -822,7 +797,6 @@ struct scsi_host_template aic79xx_driver_template = {
.use_clustering = ENABLE_CLUSTERING, .use_clustering = ENABLE_CLUSTERING,
.slave_alloc = ahd_linux_slave_alloc, .slave_alloc = ahd_linux_slave_alloc,
.slave_configure = ahd_linux_slave_configure, .slave_configure = ahd_linux_slave_configure,
.slave_destroy = ahd_linux_slave_destroy,
.target_alloc = ahd_linux_target_alloc, .target_alloc = ahd_linux_target_alloc,
.target_destroy = ahd_linux_target_destroy, .target_destroy = ahd_linux_target_destroy,
}; };
...@@ -1249,20 +1223,13 @@ void ...@@ -1249,20 +1223,13 @@ void
ahd_platform_free(struct ahd_softc *ahd) ahd_platform_free(struct ahd_softc *ahd)
{ {
struct scsi_target *starget; struct scsi_target *starget;
int i, j; int i;
if (ahd->platform_data != NULL) { if (ahd->platform_data != NULL) {
/* destroy all of the device and target objects */ /* destroy all of the device and target objects */
for (i = 0; i < AHD_NUM_TARGETS; i++) { for (i = 0; i < AHD_NUM_TARGETS; i++) {
starget = ahd->platform_data->starget[i]; starget = ahd->platform_data->starget[i];
if (starget != NULL) { if (starget != NULL) {
for (j = 0; j < AHD_NUM_LUNS; j++) {
struct ahd_linux_target *targ =
scsi_transport_target_data(starget);
if (targ->sdev[j] == NULL)
continue;
targ->sdev[j] = NULL;
}
ahd->platform_data->starget[i] = NULL; ahd->platform_data->starget[i] = NULL;
} }
} }
...@@ -1318,20 +1285,13 @@ ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb) ...@@ -1318,20 +1285,13 @@ ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
} }
void void
ahd_platform_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev,
ahd_queue_alg alg) struct ahd_devinfo *devinfo, ahd_queue_alg alg)
{ {
struct scsi_target *starget;
struct ahd_linux_target *targ;
struct ahd_linux_device *dev; struct ahd_linux_device *dev;
struct scsi_device *sdev;
int was_queuing; int was_queuing;
int now_queuing; int now_queuing;
starget = ahd->platform_data->starget[devinfo->target];
targ = scsi_transport_target_data(starget);
BUG_ON(targ == NULL);
sdev = targ->sdev[devinfo->lun];
if (sdev == NULL) if (sdev == NULL)
return; return;
...@@ -1467,11 +1427,15 @@ ahd_linux_device_queue_depth(struct scsi_device *sdev) ...@@ -1467,11 +1427,15 @@ ahd_linux_device_queue_depth(struct scsi_device *sdev)
tags = ahd_linux_user_tagdepth(ahd, &devinfo); tags = ahd_linux_user_tagdepth(ahd, &devinfo);
if (tags != 0 && sdev->tagged_supported != 0) { if (tags != 0 && sdev->tagged_supported != 0) {
ahd_set_tags(ahd, &devinfo, AHD_QUEUE_TAGGED); ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_TAGGED);
ahd_send_async(ahd, devinfo.channel, devinfo.target,
devinfo.lun, AC_TRANSFER_NEG);
ahd_print_devinfo(ahd, &devinfo); ahd_print_devinfo(ahd, &devinfo);
printf("Tagged Queuing enabled. Depth %d\n", tags); printf("Tagged Queuing enabled. Depth %d\n", tags);
} else { } else {
ahd_set_tags(ahd, &devinfo, AHD_QUEUE_NONE); ahd_platform_set_tags(ahd, sdev, &devinfo, AHD_QUEUE_NONE);
ahd_send_async(ahd, devinfo.channel, devinfo.target,
devinfo.lun, AC_TRANSFER_NEG);
} }
} }
...@@ -1629,7 +1593,7 @@ ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs) ...@@ -1629,7 +1593,7 @@ ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs)
void void
ahd_send_async(struct ahd_softc *ahd, char channel, ahd_send_async(struct ahd_softc *ahd, char channel,
u_int target, u_int lun, ac_code code, void *arg) u_int target, u_int lun, ac_code code)
{ {
switch (code) { switch (code) {
case AC_TRANSFER_NEG: case AC_TRANSFER_NEG:
...@@ -1956,7 +1920,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, ...@@ -1956,7 +1920,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
} }
ahd_set_transaction_status(scb, CAM_REQUEUE_REQ); ahd_set_transaction_status(scb, CAM_REQUEUE_REQ);
ahd_set_scsi_status(scb, SCSI_STATUS_OK); ahd_set_scsi_status(scb, SCSI_STATUS_OK);
ahd_platform_set_tags(ahd, &devinfo, ahd_platform_set_tags(ahd, sdev, &devinfo,
(dev->flags & AHD_DEV_Q_BASIC) (dev->flags & AHD_DEV_Q_BASIC)
? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED); ? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED);
break; break;
...@@ -1966,7 +1930,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, ...@@ -1966,7 +1930,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
* as if the target returned BUSY SCSI status. * as if the target returned BUSY SCSI status.
*/ */
dev->openings = 1; dev->openings = 1;
ahd_platform_set_tags(ahd, &devinfo, ahd_platform_set_tags(ahd, sdev, &devinfo,
(dev->flags & AHD_DEV_Q_BASIC) (dev->flags & AHD_DEV_Q_BASIC)
? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED); ? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED);
ahd_set_scsi_status(scb, SCSI_STATUS_BUSY); ahd_set_scsi_status(scb, SCSI_STATUS_BUSY);
...@@ -2778,8 +2742,6 @@ ahd_linux_init(void) ...@@ -2778,8 +2742,6 @@ ahd_linux_init(void)
if (!ahd_linux_transport_template) if (!ahd_linux_transport_template)
return -ENODEV; return -ENODEV;
scsi_transport_reserve_target(ahd_linux_transport_template,
sizeof(struct ahd_linux_target));
scsi_transport_reserve_device(ahd_linux_transport_template, scsi_transport_reserve_device(ahd_linux_transport_template,
sizeof(struct ahd_linux_device)); sizeof(struct ahd_linux_device));
......
...@@ -262,7 +262,6 @@ typedef enum { ...@@ -262,7 +262,6 @@ typedef enum {
AHD_DEV_PERIODIC_OTAG = 0x40, /* Send OTAG to prevent starvation */ AHD_DEV_PERIODIC_OTAG = 0x40, /* Send OTAG to prevent starvation */
} ahd_linux_dev_flags; } ahd_linux_dev_flags;
struct ahd_linux_target;
struct ahd_linux_device { struct ahd_linux_device {
TAILQ_ENTRY(ahd_linux_device) links; TAILQ_ENTRY(ahd_linux_device) links;
...@@ -342,12 +341,6 @@ struct ahd_linux_device { ...@@ -342,12 +341,6 @@ struct ahd_linux_device {
#define AHD_OTAG_THRESH 500 #define AHD_OTAG_THRESH 500
}; };
struct ahd_linux_target {
struct scsi_device *sdev[AHD_NUM_LUNS];
struct ahd_transinfo last_tinfo;
struct ahd_softc *ahd;
};
/********************* Definitions Required by the Core ***********************/ /********************* Definitions Required by the Core ***********************/
/* /*
* Number of SG segments we require. So long as the S/G segments for * Number of SG segments we require. So long as the S/G segments for
...@@ -864,7 +857,7 @@ ahd_freeze_scb(struct scb *scb) ...@@ -864,7 +857,7 @@ ahd_freeze_scb(struct scb *scb)
} }
} }
void ahd_platform_set_tags(struct ahd_softc *ahd, void ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev,
struct ahd_devinfo *devinfo, ahd_queue_alg); struct ahd_devinfo *devinfo, ahd_queue_alg);
int ahd_platform_abort_scbs(struct ahd_softc *ahd, int target, int ahd_platform_abort_scbs(struct ahd_softc *ahd, int target,
char channel, int lun, u_int tag, char channel, int lun, u_int tag,
...@@ -873,7 +866,7 @@ irqreturn_t ...@@ -873,7 +866,7 @@ irqreturn_t
ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs); ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs);
void ahd_done(struct ahd_softc*, struct scb*); void ahd_done(struct ahd_softc*, struct scb*);
void ahd_send_async(struct ahd_softc *, char channel, void ahd_send_async(struct ahd_softc *, char channel,
u_int target, u_int lun, ac_code, void *); u_int target, u_int lun, ac_code);
void ahd_print_path(struct ahd_softc *, struct scb *); void ahd_print_path(struct ahd_softc *, struct scb *);
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
......
...@@ -47,7 +47,7 @@ static int copy_info(struct info_str *info, char *fmt, ...); ...@@ -47,7 +47,7 @@ static int copy_info(struct info_str *info, char *fmt, ...);
static void ahd_dump_target_state(struct ahd_softc *ahd, static void ahd_dump_target_state(struct ahd_softc *ahd,
struct info_str *info, struct info_str *info,
u_int our_id, char channel, u_int our_id, char channel,
u_int target_id, u_int target_offset); u_int target_id);
static void ahd_dump_device_state(struct info_str *info, static void ahd_dump_device_state(struct info_str *info,
struct scsi_device *sdev); struct scsi_device *sdev);
static int ahd_proc_write_seeprom(struct ahd_softc *ahd, static int ahd_proc_write_seeprom(struct ahd_softc *ahd,
...@@ -204,10 +204,8 @@ ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo) ...@@ -204,10 +204,8 @@ ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo)
static void static void
ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info,
u_int our_id, char channel, u_int target_id, u_int our_id, char channel, u_int target_id)
u_int target_offset)
{ {
struct ahd_linux_target *targ;
struct scsi_target *starget; struct scsi_target *starget;
struct ahd_initiator_tinfo *tinfo; struct ahd_initiator_tinfo *tinfo;
struct ahd_tmode_tstate *tstate; struct ahd_tmode_tstate *tstate;
...@@ -218,10 +216,9 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, ...@@ -218,10 +216,9 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info,
copy_info(info, "Target %d Negotiation Settings\n", target_id); copy_info(info, "Target %d Negotiation Settings\n", target_id);
copy_info(info, "\tUser: "); copy_info(info, "\tUser: ");
ahd_format_transinfo(info, &tinfo->user); ahd_format_transinfo(info, &tinfo->user);
starget = ahd->platform_data->starget[target_offset]; starget = ahd->platform_data->starget[target_id];
if (starget == NULL) if (starget == NULL)
return; return;
targ = scsi_transport_target_data(starget);
copy_info(info, "\tGoal: "); copy_info(info, "\tGoal: ");
ahd_format_transinfo(info, &tinfo->goal); ahd_format_transinfo(info, &tinfo->goal);
...@@ -231,7 +228,7 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, ...@@ -231,7 +228,7 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info,
for (lun = 0; lun < AHD_NUM_LUNS; lun++) { for (lun = 0; lun < AHD_NUM_LUNS; lun++) {
struct scsi_device *dev; struct scsi_device *dev;
dev = targ->sdev[lun]; dev = scsi_device_lookup_by_target(starget, lun);
if (dev == NULL) if (dev == NULL)
continue; continue;
...@@ -355,7 +352,7 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, ...@@ -355,7 +352,7 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
copy_info(&info, "Allocated SCBs: %d, SG List Length: %d\n\n", copy_info(&info, "Allocated SCBs: %d, SG List Length: %d\n\n",
ahd->scb_data.numscbs, AHD_NSEG); ahd->scb_data.numscbs, AHD_NSEG);
max_targ = 15; max_targ = 16;
if (ahd->seep_config == NULL) if (ahd->seep_config == NULL)
copy_info(&info, "No Serial EEPROM\n"); copy_info(&info, "No Serial EEPROM\n");
...@@ -373,12 +370,12 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, ...@@ -373,12 +370,12 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
copy_info(&info, "\n"); copy_info(&info, "\n");
if ((ahd->features & AHD_WIDE) == 0) if ((ahd->features & AHD_WIDE) == 0)
max_targ = 7; max_targ = 8;
for (i = 0; i <= max_targ; i++) { for (i = 0; i < max_targ; i++) {
ahd_dump_target_state(ahd, &info, ahd->our_id, 'A', ahd_dump_target_state(ahd, &info, ahd->our_id, 'A',
/*target_id*/i, /*target_offset*/i); /*target_id*/i);
} }
retval = info.pos > info.offset ? info.pos - info.offset : 0; retval = info.pos > info.offset ? info.pos - info.offset : 0;
done: done:
......
...@@ -2625,29 +2625,32 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2625,29 +2625,32 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
unsigned int base_io, tmport, error,n; unsigned int base_io, tmport, error,n;
unsigned char host_id; unsigned char host_id;
struct Scsi_Host *shpnt = NULL; struct Scsi_Host *shpnt = NULL;
struct atp_unit atp_dev, *p; struct atp_unit *atpdev, *p;
unsigned char setupdata[2][16]; unsigned char setupdata[2][16];
int count = 0; int count = 0;
atpdev = kzalloc(sizeof(*atpdev), GFP_KERNEL);
if (!atpdev)
return -ENOMEM;
if (pci_enable_device(pdev)) if (pci_enable_device(pdev))
return -EIO; goto err_eio;
if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
printk(KERN_INFO "atp870u: use 32bit DMA mask.\n"); printk(KERN_INFO "atp870u: use 32bit DMA mask.\n");
} else { } else {
printk(KERN_ERR "atp870u: DMA mask required but not available.\n"); printk(KERN_ERR "atp870u: DMA mask required but not available.\n");
return -EIO; goto err_eio;
} }
memset(&atp_dev, 0, sizeof atp_dev);
/* /*
* It's probably easier to weed out some revisions like * It's probably easier to weed out some revisions like
* this than via the PCI device table * this than via the PCI device table
*/ */
if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610) { if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610) {
error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atp_dev.chip_ver); error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atpdev->chip_ver);
if (atp_dev.chip_ver < 2) if (atpdev->chip_ver < 2)
return -EIO; goto err_eio;
} }
switch (ent->device) { switch (ent->device) {
...@@ -2656,15 +2659,15 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2656,15 +2659,15 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
case ATP880_DEVID1: case ATP880_DEVID1:
case ATP880_DEVID2: case ATP880_DEVID2:
case ATP885_DEVID: case ATP885_DEVID:
atp_dev.chip_ver = 0x04; atpdev->chip_ver = 0x04;
default: default:
break; break;
} }
base_io = pci_resource_start(pdev, 0); base_io = pci_resource_start(pdev, 0);
base_io &= 0xfffffff8; base_io &= 0xfffffff8;
if ((ent->device == ATP880_DEVID1)||(ent->device == ATP880_DEVID2)) { if ((ent->device == ATP880_DEVID1)||(ent->device == ATP880_DEVID2)) {
error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atp_dev.chip_ver); error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atpdev->chip_ver);
pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x80);//JCC082803 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x80);//JCC082803
host_id = inb(base_io + 0x39); host_id = inb(base_io + 0x39);
...@@ -2672,17 +2675,17 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2672,17 +2675,17 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
printk(KERN_INFO " ACARD AEC-67160 PCI Ultra3 LVD Host Adapter: %d" printk(KERN_INFO " ACARD AEC-67160 PCI Ultra3 LVD Host Adapter: %d"
" IO:%x, IRQ:%d.\n", count, base_io, pdev->irq); " IO:%x, IRQ:%d.\n", count, base_io, pdev->irq);
atp_dev.ioport[0] = base_io + 0x40; atpdev->ioport[0] = base_io + 0x40;
atp_dev.pciport[0] = base_io + 0x28; atpdev->pciport[0] = base_io + 0x28;
atp_dev.dev_id = ent->device; atpdev->dev_id = ent->device;
atp_dev.host_id[0] = host_id; atpdev->host_id[0] = host_id;
tmport = base_io + 0x22; tmport = base_io + 0x22;
atp_dev.scam_on = inb(tmport); atpdev->scam_on = inb(tmport);
tmport += 0x13; tmport += 0x13;
atp_dev.global_map[0] = inb(tmport); atpdev->global_map[0] = inb(tmport);
tmport += 0x07; tmport += 0x07;
atp_dev.ultra_map[0] = inw(tmport); atpdev->ultra_map[0] = inw(tmport);
n = 0x3f09; n = 0x3f09;
next_fblk_880: next_fblk_880:
...@@ -2695,57 +2698,57 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2695,57 +2698,57 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (inb(base_io + 0x30) == 0xff) if (inb(base_io + 0x30) == 0xff)
goto flash_ok_880; goto flash_ok_880;
atp_dev.sp[0][m++] = inb(base_io + 0x30); atpdev->sp[0][m++] = inb(base_io + 0x30);
atp_dev.sp[0][m++] = inb(base_io + 0x31); atpdev->sp[0][m++] = inb(base_io + 0x31);
atp_dev.sp[0][m++] = inb(base_io + 0x32); atpdev->sp[0][m++] = inb(base_io + 0x32);
atp_dev.sp[0][m++] = inb(base_io + 0x33); atpdev->sp[0][m++] = inb(base_io + 0x33);
outw(n, base_io + 0x34); outw(n, base_io + 0x34);
n += 0x0002; n += 0x0002;
atp_dev.sp[0][m++] = inb(base_io + 0x30); atpdev->sp[0][m++] = inb(base_io + 0x30);
atp_dev.sp[0][m++] = inb(base_io + 0x31); atpdev->sp[0][m++] = inb(base_io + 0x31);
atp_dev.sp[0][m++] = inb(base_io + 0x32); atpdev->sp[0][m++] = inb(base_io + 0x32);
atp_dev.sp[0][m++] = inb(base_io + 0x33); atpdev->sp[0][m++] = inb(base_io + 0x33);
outw(n, base_io + 0x34); outw(n, base_io + 0x34);
n += 0x0002; n += 0x0002;
atp_dev.sp[0][m++] = inb(base_io + 0x30); atpdev->sp[0][m++] = inb(base_io + 0x30);
atp_dev.sp[0][m++] = inb(base_io + 0x31); atpdev->sp[0][m++] = inb(base_io + 0x31);
atp_dev.sp[0][m++] = inb(base_io + 0x32); atpdev->sp[0][m++] = inb(base_io + 0x32);
atp_dev.sp[0][m++] = inb(base_io + 0x33); atpdev->sp[0][m++] = inb(base_io + 0x33);
outw(n, base_io + 0x34); outw(n, base_io + 0x34);
n += 0x0002; n += 0x0002;
atp_dev.sp[0][m++] = inb(base_io + 0x30); atpdev->sp[0][m++] = inb(base_io + 0x30);
atp_dev.sp[0][m++] = inb(base_io + 0x31); atpdev->sp[0][m++] = inb(base_io + 0x31);
atp_dev.sp[0][m++] = inb(base_io + 0x32); atpdev->sp[0][m++] = inb(base_io + 0x32);
atp_dev.sp[0][m++] = inb(base_io + 0x33); atpdev->sp[0][m++] = inb(base_io + 0x33);
n += 0x0018; n += 0x0018;
goto next_fblk_880; goto next_fblk_880;
flash_ok_880: flash_ok_880:
outw(0, base_io + 0x34); outw(0, base_io + 0x34);
atp_dev.ultra_map[0] = 0; atpdev->ultra_map[0] = 0;
atp_dev.async[0] = 0; atpdev->async[0] = 0;
for (k = 0; k < 16; k++) { for (k = 0; k < 16; k++) {
n = 1; n = 1;
n = n << k; n = n << k;
if (atp_dev.sp[0][k] > 1) { if (atpdev->sp[0][k] > 1) {
atp_dev.ultra_map[0] |= n; atpdev->ultra_map[0] |= n;
} else { } else {
if (atp_dev.sp[0][k] == 0) if (atpdev->sp[0][k] == 0)
atp_dev.async[0] |= n; atpdev->async[0] |= n;
} }
} }
atp_dev.async[0] = ~(atp_dev.async[0]); atpdev->async[0] = ~(atpdev->async[0]);
outb(atp_dev.global_map[0], base_io + 0x35); outb(atpdev->global_map[0], base_io + 0x35);
shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit)); shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit));
if (!shpnt) if (!shpnt)
return -ENOMEM; goto err_nomem;
p = (struct atp_unit *)&shpnt->hostdata; p = (struct atp_unit *)&shpnt->hostdata;
atp_dev.host = shpnt; atpdev->host = shpnt;
atp_dev.pdev = pdev; atpdev->pdev = pdev;
pci_set_drvdata(pdev, p); pci_set_drvdata(pdev, p);
memcpy(p, &atp_dev, sizeof atp_dev); memcpy(p, atpdev, sizeof(*atpdev));
if (atp870u_init_tables(shpnt) < 0) { if (atp870u_init_tables(shpnt) < 0) {
printk(KERN_ERR "Unable to allocate tables for Acard controller\n"); printk(KERN_ERR "Unable to allocate tables for Acard controller\n");
goto unregister; goto unregister;
...@@ -2798,24 +2801,24 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2798,24 +2801,24 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
printk(KERN_INFO " ACARD AEC-67162 PCI Ultra3 LVD Host Adapter: IO:%x, IRQ:%d.\n" printk(KERN_INFO " ACARD AEC-67162 PCI Ultra3 LVD Host Adapter: IO:%x, IRQ:%d.\n"
, base_io, pdev->irq); , base_io, pdev->irq);
atp_dev.pdev = pdev; atpdev->pdev = pdev;
atp_dev.dev_id = ent->device; atpdev->dev_id = ent->device;
atp_dev.baseport = base_io; atpdev->baseport = base_io;
atp_dev.ioport[0] = base_io + 0x80; atpdev->ioport[0] = base_io + 0x80;
atp_dev.ioport[1] = base_io + 0xc0; atpdev->ioport[1] = base_io + 0xc0;
atp_dev.pciport[0] = base_io + 0x40; atpdev->pciport[0] = base_io + 0x40;
atp_dev.pciport[1] = base_io + 0x50; atpdev->pciport[1] = base_io + 0x50;
shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit)); shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit));
if (!shpnt) if (!shpnt)
return -ENOMEM; goto err_nomem;
p = (struct atp_unit *)&shpnt->hostdata; p = (struct atp_unit *)&shpnt->hostdata;
atp_dev.host = shpnt; atpdev->host = shpnt;
atp_dev.pdev = pdev; atpdev->pdev = pdev;
pci_set_drvdata(pdev, p); pci_set_drvdata(pdev, p);
memcpy(p, &atp_dev, sizeof(struct atp_unit)); memcpy(p, atpdev, sizeof(struct atp_unit));
if (atp870u_init_tables(shpnt) < 0) if (atp870u_init_tables(shpnt) < 0)
goto unregister; goto unregister;
...@@ -2974,33 +2977,33 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2974,33 +2977,33 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
printk(KERN_INFO " ACARD AEC-671X PCI Ultra/W SCSI-2/3 Host Adapter: %d " printk(KERN_INFO " ACARD AEC-671X PCI Ultra/W SCSI-2/3 Host Adapter: %d "
"IO:%x, IRQ:%d.\n", count, base_io, pdev->irq); "IO:%x, IRQ:%d.\n", count, base_io, pdev->irq);
atp_dev.ioport[0] = base_io; atpdev->ioport[0] = base_io;
atp_dev.pciport[0] = base_io + 0x20; atpdev->pciport[0] = base_io + 0x20;
atp_dev.dev_id = ent->device; atpdev->dev_id = ent->device;
host_id &= 0x07; host_id &= 0x07;
atp_dev.host_id[0] = host_id; atpdev->host_id[0] = host_id;
tmport = base_io + 0x22; tmport = base_io + 0x22;
atp_dev.scam_on = inb(tmport); atpdev->scam_on = inb(tmport);
tmport += 0x0b; tmport += 0x0b;
atp_dev.global_map[0] = inb(tmport++); atpdev->global_map[0] = inb(tmport++);
atp_dev.ultra_map[0] = inw(tmport); atpdev->ultra_map[0] = inw(tmport);
if (atp_dev.ultra_map[0] == 0) { if (atpdev->ultra_map[0] == 0) {
atp_dev.scam_on = 0x00; atpdev->scam_on = 0x00;
atp_dev.global_map[0] = 0x20; atpdev->global_map[0] = 0x20;
atp_dev.ultra_map[0] = 0xffff; atpdev->ultra_map[0] = 0xffff;
} }
shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit)); shpnt = scsi_host_alloc(&atp870u_template, sizeof(struct atp_unit));
if (!shpnt) if (!shpnt)
return -ENOMEM; goto err_nomem;
p = (struct atp_unit *)&shpnt->hostdata; p = (struct atp_unit *)&shpnt->hostdata;
atp_dev.host = shpnt; atpdev->host = shpnt;
atp_dev.pdev = pdev; atpdev->pdev = pdev;
pci_set_drvdata(pdev, p); pci_set_drvdata(pdev, p);
memcpy(p, &atp_dev, sizeof atp_dev); memcpy(p, atpdev, sizeof(*atpdev));
if (atp870u_init_tables(shpnt) < 0) if (atp870u_init_tables(shpnt) < 0)
goto unregister; goto unregister;
...@@ -3010,7 +3013,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3010,7 +3013,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
spin_lock_irqsave(shpnt->host_lock, flags); spin_lock_irqsave(shpnt->host_lock, flags);
if (atp_dev.chip_ver > 0x07) { /* check if atp876 chip then enable terminator */ if (atpdev->chip_ver > 0x07) { /* check if atp876 chip then enable terminator */
tmport = base_io + 0x3e; tmport = base_io + 0x3e;
outb(0x00, tmport); outb(0x00, tmport);
} }
...@@ -3044,7 +3047,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3044,7 +3047,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
outb((inb(tmport) & 0xef), tmport); outb((inb(tmport) & 0xef), tmport);
tmport++; tmport++;
outb((inb(tmport) | 0x20), tmport); outb((inb(tmport) | 0x20), tmport);
if (atp_dev.chip_ver == 4) if (atpdev->chip_ver == 4)
shpnt->max_id = 16; shpnt->max_id = 16;
else else
shpnt->max_id = 8; shpnt->max_id = 8;
...@@ -3093,6 +3096,12 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3093,6 +3096,12 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
printk("atp870u_prob:unregister\n"); printk("atp870u_prob:unregister\n");
scsi_host_put(shpnt); scsi_host_put(shpnt);
return -1; return -1;
err_eio:
kfree(atpdev);
return -EIO;
err_nomem:
kfree(atpdev);
return -ENOMEM;
} }
/* The abort command does not leave the device in a clean state where /* The abort command does not leave the device in a clean state where
......
...@@ -535,6 +535,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, ...@@ -535,6 +535,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
struct ibmvscsi_host_data *hostdata) struct ibmvscsi_host_data *hostdata)
{ {
u64 *crq_as_u64 = (u64 *) &evt_struct->crq; u64 *crq_as_u64 = (u64 *) &evt_struct->crq;
int request_status;
int rc; int rc;
/* If we have exhausted our request limit, just fail this request. /* If we have exhausted our request limit, just fail this request.
...@@ -542,9 +543,18 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, ...@@ -542,9 +543,18 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
* (such as task management requests) that the mid layer may think we * (such as task management requests) that the mid layer may think we
* can handle more requests (can_queue) when we actually can't * can handle more requests (can_queue) when we actually can't
*/ */
if ((evt_struct->crq.format == VIOSRP_SRP_FORMAT) && if (evt_struct->crq.format == VIOSRP_SRP_FORMAT) {
(atomic_dec_if_positive(&hostdata->request_limit) < 0)) request_status =
goto send_error; atomic_dec_if_positive(&hostdata->request_limit);
/* If request limit was -1 when we started, it is now even
* less than that
*/
if (request_status < -1)
goto send_error;
/* Otherwise, if we have run out of requests */
else if (request_status < 0)
goto send_busy;
}
/* Copy the IU into the transfer area */ /* Copy the IU into the transfer area */
*evt_struct->xfer_iu = evt_struct->iu; *evt_struct->xfer_iu = evt_struct->iu;
...@@ -567,11 +577,23 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, ...@@ -567,11 +577,23 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
return 0; return 0;
send_error: send_busy:
unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev); unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
free_event_struct(&hostdata->pool, evt_struct); free_event_struct(&hostdata->pool, evt_struct);
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
send_error:
unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
if (evt_struct->cmnd != NULL) {
evt_struct->cmnd->result = DID_ERROR << 16;
evt_struct->cmnd_done(evt_struct->cmnd);
} else if (evt_struct->done)
evt_struct->done(evt_struct);
free_event_struct(&hostdata->pool, evt_struct);
return 0;
} }
/** /**
...@@ -1184,27 +1206,37 @@ void ibmvscsi_handle_crq(struct viosrp_crq *crq, ...@@ -1184,27 +1206,37 @@ void ibmvscsi_handle_crq(struct viosrp_crq *crq,
return; return;
case 0xFF: /* Hypervisor telling us the connection is closed */ case 0xFF: /* Hypervisor telling us the connection is closed */
scsi_block_requests(hostdata->host); scsi_block_requests(hostdata->host);
atomic_set(&hostdata->request_limit, 0);
if (crq->format == 0x06) { if (crq->format == 0x06) {
/* We need to re-setup the interpartition connection */ /* We need to re-setup the interpartition connection */
printk(KERN_INFO printk(KERN_INFO
"ibmvscsi: Re-enabling adapter!\n"); "ibmvscsi: Re-enabling adapter!\n");
atomic_set(&hostdata->request_limit, -1);
purge_requests(hostdata, DID_REQUEUE); purge_requests(hostdata, DID_REQUEUE);
if (ibmvscsi_reenable_crq_queue(&hostdata->queue, if ((ibmvscsi_reenable_crq_queue(&hostdata->queue,
hostdata) == 0) hostdata) == 0) ||
if (ibmvscsi_send_crq(hostdata, (ibmvscsi_send_crq(hostdata,
0xC001000000000000LL, 0)) 0xC001000000000000LL, 0))) {
atomic_set(&hostdata->request_limit,
-1);
printk(KERN_ERR printk(KERN_ERR
"ibmvscsi: transmit error after" "ibmvscsi: error after"
" enable\n"); " enable\n");
}
} else { } else {
printk(KERN_INFO printk(KERN_INFO
"ibmvscsi: Virtual adapter failed rc %d!\n", "ibmvscsi: Virtual adapter failed rc %d!\n",
crq->format); crq->format);
atomic_set(&hostdata->request_limit, -1);
purge_requests(hostdata, DID_ERROR); purge_requests(hostdata, DID_ERROR);
ibmvscsi_reset_crq_queue(&hostdata->queue, hostdata); if ((ibmvscsi_reset_crq_queue(&hostdata->queue,
hostdata)) ||
(ibmvscsi_send_crq(hostdata,
0xC001000000000000LL, 0))) {
atomic_set(&hostdata->request_limit,
-1);
printk(KERN_ERR
"ibmvscsi: error after reset\n");
}
} }
scsi_unblock_requests(hostdata->host); scsi_unblock_requests(hostdata->host);
return; return;
...@@ -1467,6 +1499,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) ...@@ -1467,6 +1499,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
struct Scsi_Host *host; struct Scsi_Host *host;
struct device *dev = &vdev->dev; struct device *dev = &vdev->dev;
unsigned long wait_switch = 0; unsigned long wait_switch = 0;
int rc;
vdev->dev.driver_data = NULL; vdev->dev.driver_data = NULL;
...@@ -1484,8 +1517,8 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) ...@@ -1484,8 +1517,8 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
atomic_set(&hostdata->request_limit, -1); atomic_set(&hostdata->request_limit, -1);
hostdata->host->max_sectors = 32 * 8; /* default max I/O 32 pages */ hostdata->host->max_sectors = 32 * 8; /* default max I/O 32 pages */
if (ibmvscsi_init_crq_queue(&hostdata->queue, hostdata, rc = ibmvscsi_init_crq_queue(&hostdata->queue, hostdata, max_requests);
max_requests) != 0) { if (rc != 0 && rc != H_RESOURCE) {
printk(KERN_ERR "ibmvscsi: couldn't initialize crq\n"); printk(KERN_ERR "ibmvscsi: couldn't initialize crq\n");
goto init_crq_failed; goto init_crq_failed;
} }
...@@ -1505,7 +1538,8 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) ...@@ -1505,7 +1538,8 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
* to fail if the other end is not acive. In that case we don't * to fail if the other end is not acive. In that case we don't
* want to scan * want to scan
*/ */
if (ibmvscsi_send_crq(hostdata, 0xC001000000000000LL, 0) == 0) { if (ibmvscsi_send_crq(hostdata, 0xC001000000000000LL, 0) == 0
|| rc == H_RESOURCE) {
/* /*
* Wait around max init_timeout secs for the adapter to finish * Wait around max init_timeout secs for the adapter to finish
* initializing. When we are done initializing, we will have a * initializing. When we are done initializing, we will have a
......
...@@ -208,6 +208,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, ...@@ -208,6 +208,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
int max_requests) int max_requests)
{ {
int rc; int rc;
int retrc;
struct vio_dev *vdev = to_vio_dev(hostdata->dev); struct vio_dev *vdev = to_vio_dev(hostdata->dev);
queue->msgs = (struct viosrp_crq *)get_zeroed_page(GFP_KERNEL); queue->msgs = (struct viosrp_crq *)get_zeroed_page(GFP_KERNEL);
...@@ -226,7 +227,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, ...@@ -226,7 +227,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
gather_partition_info(); gather_partition_info();
set_adapter_info(hostdata); set_adapter_info(hostdata);
rc = plpar_hcall_norets(H_REG_CRQ, retrc = rc = plpar_hcall_norets(H_REG_CRQ,
vdev->unit_address, vdev->unit_address,
queue->msg_token, PAGE_SIZE); queue->msg_token, PAGE_SIZE);
if (rc == H_RESOURCE) if (rc == H_RESOURCE)
...@@ -263,7 +264,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, ...@@ -263,7 +264,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
tasklet_init(&hostdata->srp_task, (void *)ibmvscsi_task, tasklet_init(&hostdata->srp_task, (void *)ibmvscsi_task,
(unsigned long)hostdata); (unsigned long)hostdata);
return 0; return retrc;
req_irq_failed: req_irq_failed:
do { do {
......
...@@ -2130,19 +2130,21 @@ iscsi_r2tpool_free(struct iscsi_session *session) ...@@ -2130,19 +2130,21 @@ iscsi_r2tpool_free(struct iscsi_session *session)
static int static int
iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
uint32_t value) char *buf, int buflen)
{ {
struct iscsi_conn *conn = cls_conn->dd_data; struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_session *session = conn->session; struct iscsi_session *session = conn->session;
struct iscsi_tcp_conn *tcp_conn = conn->dd_data; struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
int value;
switch(param) { switch(param) {
case ISCSI_PARAM_MAX_RECV_DLENGTH: { case ISCSI_PARAM_MAX_RECV_DLENGTH: {
char *saveptr = tcp_conn->data; char *saveptr = tcp_conn->data;
gfp_t flags = GFP_KERNEL; gfp_t flags = GFP_KERNEL;
sscanf(buf, "%d", &value);
if (tcp_conn->data_size >= value) { if (tcp_conn->data_size >= value) {
conn->max_recv_dlength = value; iscsi_set_param(cls_conn, param, buf, buflen);
break; break;
} }
...@@ -2165,15 +2167,12 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, ...@@ -2165,15 +2167,12 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
else else
free_pages((unsigned long)saveptr, free_pages((unsigned long)saveptr,
get_order(tcp_conn->data_size)); get_order(tcp_conn->data_size));
conn->max_recv_dlength = value; iscsi_set_param(cls_conn, param, buf, buflen);
tcp_conn->data_size = value; tcp_conn->data_size = value;
}
break;
case ISCSI_PARAM_MAX_XMIT_DLENGTH:
conn->max_xmit_dlength = value;
break; break;
}
case ISCSI_PARAM_HDRDGST_EN: case ISCSI_PARAM_HDRDGST_EN:
conn->hdrdgst_en = value; iscsi_set_param(cls_conn, param, buf, buflen);
tcp_conn->hdr_size = sizeof(struct iscsi_hdr); tcp_conn->hdr_size = sizeof(struct iscsi_hdr);
if (conn->hdrdgst_en) { if (conn->hdrdgst_en) {
tcp_conn->hdr_size += sizeof(__u32); tcp_conn->hdr_size += sizeof(__u32);
...@@ -2197,7 +2196,7 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, ...@@ -2197,7 +2196,7 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
} }
break; break;
case ISCSI_PARAM_DATADGST_EN: case ISCSI_PARAM_DATADGST_EN:
conn->datadgst_en = value; iscsi_set_param(cls_conn, param, buf, buflen);
if (conn->datadgst_en) { if (conn->datadgst_en) {
if (!tcp_conn->data_tx_tfm) if (!tcp_conn->data_tx_tfm)
tcp_conn->data_tx_tfm = tcp_conn->data_tx_tfm =
...@@ -2220,121 +2219,36 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, ...@@ -2220,121 +2219,36 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
tcp_conn->sendpage = conn->datadgst_en ? tcp_conn->sendpage = conn->datadgst_en ?
sock_no_sendpage : tcp_conn->sock->ops->sendpage; sock_no_sendpage : tcp_conn->sock->ops->sendpage;
break; break;
case ISCSI_PARAM_INITIAL_R2T_EN:
session->initial_r2t_en = value;
break;
case ISCSI_PARAM_MAX_R2T: case ISCSI_PARAM_MAX_R2T:
sscanf(buf, "%d", &value);
if (session->max_r2t == roundup_pow_of_two(value)) if (session->max_r2t == roundup_pow_of_two(value))
break; break;
iscsi_r2tpool_free(session); iscsi_r2tpool_free(session);
session->max_r2t = value; iscsi_set_param(cls_conn, param, buf, buflen);
if (session->max_r2t & (session->max_r2t - 1)) if (session->max_r2t & (session->max_r2t - 1))
session->max_r2t = roundup_pow_of_two(session->max_r2t); session->max_r2t = roundup_pow_of_two(session->max_r2t);
if (iscsi_r2tpool_alloc(session)) if (iscsi_r2tpool_alloc(session))
return -ENOMEM; return -ENOMEM;
break; break;
case ISCSI_PARAM_IMM_DATA_EN:
session->imm_data_en = value;
break;
case ISCSI_PARAM_FIRST_BURST:
session->first_burst = value;
break;
case ISCSI_PARAM_MAX_BURST:
session->max_burst = value;
break;
case ISCSI_PARAM_PDU_INORDER_EN:
session->pdu_inorder_en = value;
break;
case ISCSI_PARAM_DATASEQ_INORDER_EN:
session->dataseq_inorder_en = value;
break;
case ISCSI_PARAM_ERL:
session->erl = value;
break;
case ISCSI_PARAM_IFMARKER_EN:
BUG_ON(value);
session->ifmarker_en = value;
break;
case ISCSI_PARAM_OFMARKER_EN:
BUG_ON(value);
session->ofmarker_en = value;
break;
case ISCSI_PARAM_EXP_STATSN:
conn->exp_statsn = value;
break;
default:
break;
}
return 0;
}
static int
iscsi_session_get_param(struct iscsi_cls_session *cls_session,
enum iscsi_param param, uint32_t *value)
{
struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
switch(param) {
case ISCSI_PARAM_INITIAL_R2T_EN:
*value = session->initial_r2t_en;
break;
case ISCSI_PARAM_MAX_R2T:
*value = session->max_r2t;
break;
case ISCSI_PARAM_IMM_DATA_EN:
*value = session->imm_data_en;
break;
case ISCSI_PARAM_FIRST_BURST:
*value = session->first_burst;
break;
case ISCSI_PARAM_MAX_BURST:
*value = session->max_burst;
break;
case ISCSI_PARAM_PDU_INORDER_EN:
*value = session->pdu_inorder_en;
break;
case ISCSI_PARAM_DATASEQ_INORDER_EN:
*value = session->dataseq_inorder_en;
break;
case ISCSI_PARAM_ERL:
*value = session->erl;
break;
case ISCSI_PARAM_IFMARKER_EN:
*value = session->ifmarker_en;
break;
case ISCSI_PARAM_OFMARKER_EN:
*value = session->ofmarker_en;
break;
default: default:
return -EINVAL; return iscsi_set_param(cls_conn, param, buf, buflen);
} }
return 0; return 0;
} }
static int static int
iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, iscsi_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn,
enum iscsi_param param, uint32_t *value) enum iscsi_param param, char *buf)
{ {
struct iscsi_conn *conn = cls_conn->dd_data; struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_tcp_conn *tcp_conn = conn->dd_data; struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
struct inet_sock *inet; struct inet_sock *inet;
struct ipv6_pinfo *np;
struct sock *sk;
int len;
switch(param) { switch(param) {
case ISCSI_PARAM_MAX_RECV_DLENGTH:
*value = conn->max_recv_dlength;
break;
case ISCSI_PARAM_MAX_XMIT_DLENGTH:
*value = conn->max_xmit_dlength;
break;
case ISCSI_PARAM_HDRDGST_EN:
*value = conn->hdrdgst_en;
break;
case ISCSI_PARAM_DATADGST_EN:
*value = conn->datadgst_en;
break;
case ISCSI_PARAM_CONN_PORT: case ISCSI_PARAM_CONN_PORT:
mutex_lock(&conn->xmitmutex); mutex_lock(&conn->xmitmutex);
if (!tcp_conn->sock) { if (!tcp_conn->sock) {
...@@ -2343,30 +2257,9 @@ iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, ...@@ -2343,30 +2257,9 @@ iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
} }
inet = inet_sk(tcp_conn->sock->sk); inet = inet_sk(tcp_conn->sock->sk);
*value = be16_to_cpu(inet->dport); len = sprintf(buf, "%hu\n", be16_to_cpu(inet->dport));
mutex_unlock(&conn->xmitmutex); mutex_unlock(&conn->xmitmutex);
case ISCSI_PARAM_EXP_STATSN:
*value = conn->exp_statsn;
break; break;
default:
return -EINVAL;
}
return 0;
}
static int
iscsi_conn_get_str_param(struct iscsi_cls_conn *cls_conn,
enum iscsi_param param, char *buf)
{
struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
struct sock *sk;
struct inet_sock *inet;
struct ipv6_pinfo *np;
int len = 0;
switch (param) {
case ISCSI_PARAM_CONN_ADDRESS: case ISCSI_PARAM_CONN_ADDRESS:
mutex_lock(&conn->xmitmutex); mutex_lock(&conn->xmitmutex);
if (!tcp_conn->sock) { if (!tcp_conn->sock) {
...@@ -2388,7 +2281,7 @@ iscsi_conn_get_str_param(struct iscsi_cls_conn *cls_conn, ...@@ -2388,7 +2281,7 @@ iscsi_conn_get_str_param(struct iscsi_cls_conn *cls_conn,
mutex_unlock(&conn->xmitmutex); mutex_unlock(&conn->xmitmutex);
break; break;
default: default:
return -EINVAL; return iscsi_conn_get_param(cls_conn, param, buf);
} }
return len; return len;
...@@ -2501,7 +2394,11 @@ static struct iscsi_transport iscsi_tcp_transport = { ...@@ -2501,7 +2394,11 @@ static struct iscsi_transport iscsi_tcp_transport = {
ISCSI_ERL | ISCSI_ERL |
ISCSI_CONN_PORT | ISCSI_CONN_PORT |
ISCSI_CONN_ADDRESS | ISCSI_CONN_ADDRESS |
ISCSI_EXP_STATSN, ISCSI_EXP_STATSN |
ISCSI_PERSISTENT_PORT |
ISCSI_PERSISTENT_ADDRESS |
ISCSI_TARGET_NAME |
ISCSI_TPGT,
.host_template = &iscsi_sht, .host_template = &iscsi_sht,
.conndata_size = sizeof(struct iscsi_conn), .conndata_size = sizeof(struct iscsi_conn),
.max_conn = 1, .max_conn = 1,
...@@ -2514,8 +2411,7 @@ static struct iscsi_transport iscsi_tcp_transport = { ...@@ -2514,8 +2411,7 @@ static struct iscsi_transport iscsi_tcp_transport = {
.bind_conn = iscsi_tcp_conn_bind, .bind_conn = iscsi_tcp_conn_bind,
.destroy_conn = iscsi_tcp_conn_destroy, .destroy_conn = iscsi_tcp_conn_destroy,
.set_param = iscsi_conn_set_param, .set_param = iscsi_conn_set_param,
.get_conn_param = iscsi_conn_get_param, .get_conn_param = iscsi_tcp_conn_get_param,
.get_conn_str_param = iscsi_conn_get_str_param,
.get_session_param = iscsi_session_get_param, .get_session_param = iscsi_session_get_param,
.start_conn = iscsi_conn_start, .start_conn = iscsi_conn_start,
.stop_conn = iscsi_conn_stop, .stop_conn = iscsi_conn_stop,
......
...@@ -1287,13 +1287,18 @@ iscsi_session_setup(struct iscsi_transport *iscsit, ...@@ -1287,13 +1287,18 @@ iscsi_session_setup(struct iscsi_transport *iscsit,
if (scsi_add_host(shost, NULL)) if (scsi_add_host(shost, NULL))
goto add_host_fail; goto add_host_fail;
if (!try_module_get(iscsit->owner))
goto cls_session_fail;
cls_session = iscsi_create_session(shost, iscsit, 0); cls_session = iscsi_create_session(shost, iscsit, 0);
if (!cls_session) if (!cls_session)
goto cls_session_fail; goto module_put;
*(unsigned long*)shost->hostdata = (unsigned long)cls_session; *(unsigned long*)shost->hostdata = (unsigned long)cls_session;
return cls_session; return cls_session;
module_put:
module_put(iscsit->owner);
cls_session_fail: cls_session_fail:
scsi_remove_host(shost); scsi_remove_host(shost);
add_host_fail: add_host_fail:
...@@ -1325,6 +1330,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) ...@@ -1325,6 +1330,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
iscsi_destroy_session(cls_session); iscsi_destroy_session(cls_session);
scsi_host_put(shost); scsi_host_put(shost);
module_put(cls_session->transport->owner);
} }
EXPORT_SYMBOL_GPL(iscsi_session_teardown); EXPORT_SYMBOL_GPL(iscsi_session_teardown);
...@@ -1697,6 +1703,185 @@ int iscsi_conn_bind(struct iscsi_cls_session *cls_session, ...@@ -1697,6 +1703,185 @@ int iscsi_conn_bind(struct iscsi_cls_session *cls_session,
} }
EXPORT_SYMBOL_GPL(iscsi_conn_bind); EXPORT_SYMBOL_GPL(iscsi_conn_bind);
int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
enum iscsi_param param, char *buf, int buflen)
{
struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_session *session = conn->session;
uint32_t value;
switch(param) {
case ISCSI_PARAM_MAX_RECV_DLENGTH:
sscanf(buf, "%d", &conn->max_recv_dlength);
break;
case ISCSI_PARAM_MAX_XMIT_DLENGTH:
sscanf(buf, "%d", &conn->max_xmit_dlength);
break;
case ISCSI_PARAM_HDRDGST_EN:
sscanf(buf, "%d", &conn->hdrdgst_en);
break;
case ISCSI_PARAM_DATADGST_EN:
sscanf(buf, "%d", &conn->datadgst_en);
break;
case ISCSI_PARAM_INITIAL_R2T_EN:
sscanf(buf, "%d", &session->initial_r2t_en);
break;
case ISCSI_PARAM_MAX_R2T:
sscanf(buf, "%d", &session->max_r2t);
break;
case ISCSI_PARAM_IMM_DATA_EN:
sscanf(buf, "%d", &session->imm_data_en);
break;
case ISCSI_PARAM_FIRST_BURST:
sscanf(buf, "%d", &session->first_burst);
break;
case ISCSI_PARAM_MAX_BURST:
sscanf(buf, "%d", &session->max_burst);
break;
case ISCSI_PARAM_PDU_INORDER_EN:
sscanf(buf, "%d", &session->pdu_inorder_en);
break;
case ISCSI_PARAM_DATASEQ_INORDER_EN:
sscanf(buf, "%d", &session->dataseq_inorder_en);
break;
case ISCSI_PARAM_ERL:
sscanf(buf, "%d", &session->erl);
break;
case ISCSI_PARAM_IFMARKER_EN:
sscanf(buf, "%d", &value);
BUG_ON(value);
break;
case ISCSI_PARAM_OFMARKER_EN:
sscanf(buf, "%d", &value);
BUG_ON(value);
break;
case ISCSI_PARAM_EXP_STATSN:
sscanf(buf, "%u", &conn->exp_statsn);
break;
case ISCSI_PARAM_TARGET_NAME:
/* this should not change between logins */
if (session->targetname)
break;
session->targetname = kstrdup(buf, GFP_KERNEL);
if (!session->targetname)
return -ENOMEM;
break;
case ISCSI_PARAM_TPGT:
sscanf(buf, "%d", &session->tpgt);
break;
case ISCSI_PARAM_PERSISTENT_PORT:
sscanf(buf, "%d", &conn->persistent_port);
break;
case ISCSI_PARAM_PERSISTENT_ADDRESS:
/*
* this is the address returned in discovery so it should
* not change between logins.
*/
if (conn->persistent_address)
break;
conn->persistent_address = kstrdup(buf, GFP_KERNEL);
if (!conn->persistent_address)
return -ENOMEM;
break;
default:
return -ENOSYS;
}
return 0;
}
EXPORT_SYMBOL_GPL(iscsi_set_param);
int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
enum iscsi_param param, char *buf)
{
struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
int len;
switch(param) {
case ISCSI_PARAM_INITIAL_R2T_EN:
len = sprintf(buf, "%d\n", session->initial_r2t_en);
break;
case ISCSI_PARAM_MAX_R2T:
len = sprintf(buf, "%hu\n", session->max_r2t);
break;
case ISCSI_PARAM_IMM_DATA_EN:
len = sprintf(buf, "%d\n", session->imm_data_en);
break;
case ISCSI_PARAM_FIRST_BURST:
len = sprintf(buf, "%u\n", session->first_burst);
break;
case ISCSI_PARAM_MAX_BURST:
len = sprintf(buf, "%u\n", session->max_burst);
break;
case ISCSI_PARAM_PDU_INORDER_EN:
len = sprintf(buf, "%d\n", session->pdu_inorder_en);
break;
case ISCSI_PARAM_DATASEQ_INORDER_EN:
len = sprintf(buf, "%d\n", session->dataseq_inorder_en);
break;
case ISCSI_PARAM_ERL:
len = sprintf(buf, "%d\n", session->erl);
break;
case ISCSI_PARAM_TARGET_NAME:
len = sprintf(buf, "%s\n", session->targetname);
break;
case ISCSI_PARAM_TPGT:
len = sprintf(buf, "%d\n", session->tpgt);
break;
default:
return -ENOSYS;
}
return len;
}
EXPORT_SYMBOL_GPL(iscsi_session_get_param);
int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
enum iscsi_param param, char *buf)
{
struct iscsi_conn *conn = cls_conn->dd_data;
int len;
switch(param) {
case ISCSI_PARAM_MAX_RECV_DLENGTH:
len = sprintf(buf, "%u\n", conn->max_recv_dlength);
break;
case ISCSI_PARAM_MAX_XMIT_DLENGTH:
len = sprintf(buf, "%u\n", conn->max_xmit_dlength);
break;
case ISCSI_PARAM_HDRDGST_EN:
len = sprintf(buf, "%d\n", conn->hdrdgst_en);
break;
case ISCSI_PARAM_DATADGST_EN:
len = sprintf(buf, "%d\n", conn->datadgst_en);
break;
case ISCSI_PARAM_IFMARKER_EN:
len = sprintf(buf, "%d\n", conn->ifmarker_en);
break;
case ISCSI_PARAM_OFMARKER_EN:
len = sprintf(buf, "%d\n", conn->ofmarker_en);
break;
case ISCSI_PARAM_EXP_STATSN:
len = sprintf(buf, "%u\n", conn->exp_statsn);
break;
case ISCSI_PARAM_PERSISTENT_PORT:
len = sprintf(buf, "%d\n", conn->persistent_port);
break;
case ISCSI_PARAM_PERSISTENT_ADDRESS:
len = sprintf(buf, "%s\n", conn->persistent_address);
break;
default:
return -ENOSYS;
}
return len;
}
EXPORT_SYMBOL_GPL(iscsi_conn_get_param);
MODULE_AUTHOR("Mike Christie"); MODULE_AUTHOR("Mike Christie");
MODULE_DESCRIPTION("iSCSI library functions"); MODULE_DESCRIPTION("iSCSI library functions");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -174,7 +174,6 @@ struct lpfc_hba { ...@@ -174,7 +174,6 @@ struct lpfc_hba {
dma_addr_t slim2p_mapping; dma_addr_t slim2p_mapping;
uint16_t pci_cfg_value; uint16_t pci_cfg_value;
struct semaphore hba_can_block;
int32_t hba_state; int32_t hba_state;
#define LPFC_STATE_UNKNOWN 0 /* HBA state is unknown */ #define LPFC_STATE_UNKNOWN 0 /* HBA state is unknown */
......
...@@ -821,7 +821,7 @@ lpfc_issue_els_plogi(struct lpfc_hba * phba, uint32_t did, uint8_t retry) ...@@ -821,7 +821,7 @@ lpfc_issue_els_plogi(struct lpfc_hba * phba, uint32_t did, uint8_t retry)
pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */ pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
cmdsize = (sizeof (uint32_t) + sizeof (struct serv_parm)); cmdsize = (sizeof (uint32_t) + sizeof (struct serv_parm));
elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, 0, did, elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, NULL, did,
ELS_CMD_PLOGI); ELS_CMD_PLOGI);
if (!elsiocb) if (!elsiocb)
return 1; return 1;
...@@ -2791,8 +2791,8 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb) ...@@ -2791,8 +2791,8 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
ndlp = (struct lpfc_nodelist *) pmb->context2; ndlp = (struct lpfc_nodelist *) pmb->context2;
xri = (uint16_t) ((unsigned long)(pmb->context1)); xri = (uint16_t) ((unsigned long)(pmb->context1));
pmb->context1 = 0; pmb->context1 = NULL;
pmb->context2 = 0; pmb->context2 = NULL;
if (mb->mbxStatus) { if (mb->mbxStatus) {
mempool_free( pmb, phba->mbox_mem_pool); mempool_free( pmb, phba->mbox_mem_pool);
......
...@@ -939,12 +939,12 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) ...@@ -939,12 +939,12 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp)
"10-port ", "PCIe"}; "10-port ", "PCIe"};
break; break;
default: default:
m = (typeof(m)){ 0 }; m = (typeof(m)){ NULL };
break; break;
} }
break; break;
default: default:
m = (typeof(m)){ 0 }; m = (typeof(m)){ NULL };
break; break;
} }
...@@ -1451,7 +1451,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) ...@@ -1451,7 +1451,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
goto out_put_host; goto out_put_host;
host->unique_id = phba->brd_no; host->unique_id = phba->brd_no;
init_MUTEX(&phba->hba_can_block);
INIT_LIST_HEAD(&phba->ctrspbuflist); INIT_LIST_HEAD(&phba->ctrspbuflist);
INIT_LIST_HEAD(&phba->rnidrspbuflist); INIT_LIST_HEAD(&phba->rnidrspbuflist);
INIT_LIST_HEAD(&phba->freebufList); INIT_LIST_HEAD(&phba->freebufList);
......
...@@ -41,20 +41,6 @@ ...@@ -41,20 +41,6 @@
#define LPFC_ABORT_WAIT 2 #define LPFC_ABORT_WAIT 2
static inline void
lpfc_block_requests(struct lpfc_hba * phba)
{
down(&phba->hba_can_block);
scsi_block_requests(phba->host);
}
static inline void
lpfc_unblock_requests(struct lpfc_hba * phba)
{
scsi_unblock_requests(phba->host);
up(&phba->hba_can_block);
}
/* /*
* This routine allocates a scsi buffer, which contains all the necessary * This routine allocates a scsi buffer, which contains all the necessary
* information needed to initiate a SCSI I/O. The non-DMAable buffer region * information needed to initiate a SCSI I/O. The non-DMAable buffer region
...@@ -859,7 +845,6 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) ...@@ -859,7 +845,6 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
unsigned int loop_count = 0; unsigned int loop_count = 0;
int ret = SUCCESS; int ret = SUCCESS;
lpfc_block_requests(phba);
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble; lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble;
...@@ -945,7 +930,6 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) ...@@ -945,7 +930,6 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
cmnd->device->lun, cmnd->serial_number); cmnd->device->lun, cmnd->serial_number);
spin_unlock_irq(shost->host_lock); spin_unlock_irq(shost->host_lock);
lpfc_unblock_requests(phba);
return ret; return ret;
} }
...@@ -963,7 +947,6 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) ...@@ -963,7 +947,6 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
int ret = FAILED; int ret = FAILED;
int cnt, loopcnt; int cnt, loopcnt;
lpfc_block_requests(phba);
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
/* /*
* If target is not in a MAPPED state, delay the reset until * If target is not in a MAPPED state, delay the reset until
...@@ -1065,7 +1048,6 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) ...@@ -1065,7 +1048,6 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
out: out:
spin_unlock_irq(shost->host_lock); spin_unlock_irq(shost->host_lock);
lpfc_unblock_requests(phba);
return ret; return ret;
} }
...@@ -1080,7 +1062,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) ...@@ -1080,7 +1062,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
int cnt, loopcnt; int cnt, loopcnt;
struct lpfc_scsi_buf * lpfc_cmd; struct lpfc_scsi_buf * lpfc_cmd;
lpfc_block_requests(phba);
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
lpfc_cmd = lpfc_get_scsi_buf(phba); lpfc_cmd = lpfc_get_scsi_buf(phba);
...@@ -1163,7 +1144,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) ...@@ -1163,7 +1144,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
phba->brd_no, ret); phba->brd_no, ret);
out: out:
spin_unlock_irq(shost->host_lock); spin_unlock_irq(shost->host_lock);
lpfc_unblock_requests(phba);
return ret; return ret;
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
* *
* FILE : megaraid_sas.c * FILE : megaraid_sas.c
* Version : v00.00.02.04 * Version : v00.00.03.01
* *
* Authors: * Authors:
* Sreenivas Bagalkote <Sreenivas.Bagalkote@lsil.com> * Sreenivas Bagalkote <Sreenivas.Bagalkote@lsil.com>
...@@ -55,19 +55,25 @@ static struct pci_device_id megasas_pci_table[] = { ...@@ -55,19 +55,25 @@ static struct pci_device_id megasas_pci_table[] = {
{ {
PCI_VENDOR_ID_LSI_LOGIC, PCI_VENDOR_ID_LSI_LOGIC,
PCI_DEVICE_ID_LSI_SAS1064R, // xscale IOP PCI_DEVICE_ID_LSI_SAS1064R, /* xscale IOP */
PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, PCI_ANY_ID,
}, },
{ {
PCI_VENDOR_ID_LSI_LOGIC, PCI_VENDOR_ID_LSI_LOGIC,
PCI_DEVICE_ID_LSI_SAS1078R, // ppc IOP PCI_DEVICE_ID_LSI_SAS1078R, /* ppc IOP */
PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, PCI_ANY_ID,
}, },
{
PCI_VENDOR_ID_LSI_LOGIC,
PCI_DEVICE_ID_LSI_VERDE_ZCR, /* xscale IOP, vega */
PCI_ANY_ID,
PCI_ANY_ID,
},
{ {
PCI_VENDOR_ID_DELL, PCI_VENDOR_ID_DELL,
PCI_DEVICE_ID_DELL_PERC5, // xscale IOP PCI_DEVICE_ID_DELL_PERC5, /* xscale IOP */
PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, PCI_ANY_ID,
}, },
...@@ -289,9 +295,14 @@ static struct megasas_instance_template megasas_instance_template_ppc = { ...@@ -289,9 +295,14 @@ static struct megasas_instance_template megasas_instance_template_ppc = {
* @regs: MFI register set * @regs: MFI register set
*/ */
static inline void static inline void
megasas_disable_intr(struct megasas_register_set __iomem * regs) megasas_disable_intr(struct megasas_instance *instance)
{ {
u32 mask = 0x1f; u32 mask = 0x1f;
struct megasas_register_set __iomem *regs = instance->reg_set;
if(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078R)
mask = 0xffffffff;
writel(mask, &regs->outbound_intr_mask); writel(mask, &regs->outbound_intr_mask);
/* Dummy readl to force pci flush */ /* Dummy readl to force pci flush */
...@@ -1260,7 +1271,7 @@ megasas_transition_to_ready(struct megasas_instance* instance) ...@@ -1260,7 +1271,7 @@ megasas_transition_to_ready(struct megasas_instance* instance)
/* /*
* Bring it to READY state; assuming max wait 2 secs * Bring it to READY state; assuming max wait 2 secs
*/ */
megasas_disable_intr(instance->reg_set); megasas_disable_intr(instance);
writel(MFI_INIT_READY, &instance->reg_set->inbound_doorbell); writel(MFI_INIT_READY, &instance->reg_set->inbound_doorbell);
max_wait = 10; max_wait = 10;
...@@ -1756,6 +1767,11 @@ static int megasas_init_mfi(struct megasas_instance *instance) ...@@ -1756,6 +1767,11 @@ static int megasas_init_mfi(struct megasas_instance *instance)
init_frame->data_xfer_len = sizeof(struct megasas_init_queue_info); init_frame->data_xfer_len = sizeof(struct megasas_init_queue_info);
/*
* disable the intr before firing the init frame to FW
*/
megasas_disable_intr(instance);
/* /*
* Issue the init frame in polled mode * Issue the init frame in polled mode
*/ */
...@@ -2234,7 +2250,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2234,7 +2250,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
megasas_mgmt_info.max_index--; megasas_mgmt_info.max_index--;
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
megasas_disable_intr(instance->reg_set); megasas_disable_intr(instance);
free_irq(instance->pdev->irq, instance); free_irq(instance->pdev->irq, instance);
megasas_release_mfi(instance); megasas_release_mfi(instance);
...@@ -2364,7 +2380,7 @@ static void megasas_detach_one(struct pci_dev *pdev) ...@@ -2364,7 +2380,7 @@ static void megasas_detach_one(struct pci_dev *pdev)
pci_set_drvdata(instance->pdev, NULL); pci_set_drvdata(instance->pdev, NULL);
megasas_disable_intr(instance->reg_set); megasas_disable_intr(instance);
free_irq(instance->pdev->irq, instance); free_irq(instance->pdev->irq, instance);
......
...@@ -18,9 +18,16 @@ ...@@ -18,9 +18,16 @@
/** /**
* MegaRAID SAS Driver meta data * MegaRAID SAS Driver meta data
*/ */
#define MEGASAS_VERSION "00.00.02.04" #define MEGASAS_VERSION "00.00.03.01"
#define MEGASAS_RELDATE "Feb 03, 2006" #define MEGASAS_RELDATE "May 14, 2006"
#define MEGASAS_EXT_VERSION "Fri Feb 03 14:31:44 PST 2006" #define MEGASAS_EXT_VERSION "Sun May 14 22:49:52 PDT 2006"
/*
* Device IDs
*/
#define PCI_DEVICE_ID_LSI_SAS1078R 0x0060
#define PCI_DEVICE_ID_LSI_VERDE_ZCR 0x0413
/* /*
* ===================================== * =====================================
* MegaRAID SAS MFI firmware definitions * MegaRAID SAS MFI firmware definitions
...@@ -554,7 +561,11 @@ struct megasas_ctrl_info { ...@@ -554,7 +561,11 @@ struct megasas_ctrl_info {
#define MFI_POLL_TIMEOUT_SECS 10 #define MFI_POLL_TIMEOUT_SECS 10
#define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 #define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000
#define PCI_DEVICE_ID_LSI_SAS1078R 0x00000060
/*
* register set for both 1068 and 1078 controllers
* structure extended for 1078 registers
*/
struct megasas_register_set { struct megasas_register_set {
u32 reserved_0[4]; /*0000h*/ u32 reserved_0[4]; /*0000h*/
...@@ -1150,10 +1161,10 @@ struct compat_megasas_iocpacket { ...@@ -1150,10 +1161,10 @@ struct compat_megasas_iocpacket {
struct compat_iovec sgl[MAX_IOCTL_SGE]; struct compat_iovec sgl[MAX_IOCTL_SGE];
} __attribute__ ((packed)); } __attribute__ ((packed));
#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket)
#endif #endif
#define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket) #define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket)
#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket)
#define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen) #define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen)
struct megasas_mgmt_info { struct megasas_mgmt_info {
......
...@@ -2866,8 +2866,7 @@ static int nsp32_detect(struct scsi_host_template *sht) ...@@ -2866,8 +2866,7 @@ static int nsp32_detect(struct scsi_host_template *sht)
*/ */
nsp32_do_bus_reset(data); nsp32_do_bus_reset(data);
ret = request_irq(host->irq, do_nsp32_isr, ret = request_irq(host->irq, do_nsp32_isr, IRQF_SHARED, "nsp32", data);
IRQF_SHARED | IRQF_SAMPLE_RANDOM, "nsp32", data);
if (ret < 0) { if (ret < 0) {
nsp32_msg(KERN_ERR, "Unable to allocate IRQ for NinjaSCSI32 " nsp32_msg(KERN_ERR, "Unable to allocate IRQ for NinjaSCSI32 "
"SCSI PCI controller. Interrupt: %d", host->irq); "SCSI PCI controller. Interrupt: %d", host->irq);
...@@ -2886,12 +2885,19 @@ static int nsp32_detect(struct scsi_host_template *sht) ...@@ -2886,12 +2885,19 @@ static int nsp32_detect(struct scsi_host_template *sht)
} }
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73))
scsi_add_host (host, &PCIDEV->dev); ret = scsi_add_host(host, &PCIDEV->dev);
if (ret) {
nsp32_msg(KERN_ERR, "failed to add scsi host");
goto free_region;
}
scsi_scan_host(host); scsi_scan_host(host);
#endif #endif
pci_set_drvdata(PCIDEV, host); pci_set_drvdata(PCIDEV, host);
return DETECT_OK; return DETECT_OK;
free_region:
release_region(host->io_port, host->n_io_port);
free_irq: free_irq:
free_irq(host->irq, data); free_irq(host->irq, data);
......
...@@ -1623,7 +1623,7 @@ static int nsp_cs_probe(struct pcmcia_device *link) ...@@ -1623,7 +1623,7 @@ static int nsp_cs_probe(struct pcmcia_device *link)
/* Interrupt handler */ /* Interrupt handler */
link->irq.Handler = &nspintr; link->irq.Handler = &nspintr;
link->irq.Instance = info; link->irq.Instance = info;
link->irq.Attributes |= (IRQF_SHARED | IRQF_SAMPLE_RANDOM); link->irq.Attributes |= IRQF_SHARED;
/* General socket configuration */ /* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
......
...@@ -4209,7 +4209,7 @@ qla1280_setup(char *s) ...@@ -4209,7 +4209,7 @@ qla1280_setup(char *s)
} }
static int static int __init
qla1280_get_token(char *str) qla1280_get_token(char *str)
{ {
char *sep; char *sep;
......
...@@ -16,15 +16,16 @@ qla2x00_sysfs_read_fw_dump(struct kobject *kobj, char *buf, loff_t off, ...@@ -16,15 +16,16 @@ qla2x00_sysfs_read_fw_dump(struct kobject *kobj, char *buf, loff_t off,
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
char *rbuf = (char *)ha->fw_dump;
if (ha->fw_dump_reading == 0) if (ha->fw_dump_reading == 0)
return 0; return 0;
if (off > ha->fw_dump_buffer_len) if (off > ha->fw_dump_len)
return 0; return 0;
if (off + count > ha->fw_dump_buffer_len) if (off + count > ha->fw_dump_len)
count = ha->fw_dump_buffer_len - off; count = ha->fw_dump_len - off;
memcpy(buf, &ha->fw_dump_buffer[off], count); memcpy(buf, &rbuf[off], count);
return (count); return (count);
} }
...@@ -36,7 +37,6 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off, ...@@ -36,7 +37,6 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off,
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
int reading; int reading;
uint32_t dump_size;
if (off != 0) if (off != 0)
return (0); return (0);
...@@ -44,46 +44,27 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off, ...@@ -44,46 +44,27 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off,
reading = simple_strtol(buf, NULL, 10); reading = simple_strtol(buf, NULL, 10);
switch (reading) { switch (reading) {
case 0: case 0:
if (ha->fw_dump_reading == 1) { if (!ha->fw_dump_reading)
qla_printk(KERN_INFO, ha, break;
"Firmware dump cleared on (%ld).\n", ha->host_no);
vfree(ha->fw_dump_buffer); qla_printk(KERN_INFO, ha,
ha->fw_dump_buffer = NULL; "Firmware dump cleared on (%ld).\n", ha->host_no);
ha->fw_dump_reading = 0;
ha->fw_dumped = 0; ha->fw_dump_reading = 0;
} ha->fw_dumped = 0;
break; break;
case 1: case 1:
if (ha->fw_dumped && !ha->fw_dump_reading) { if (ha->fw_dumped && !ha->fw_dump_reading) {
ha->fw_dump_reading = 1; ha->fw_dump_reading = 1;
if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
dump_size = FW_DUMP_SIZE_24XX;
else {
dump_size = FW_DUMP_SIZE_1M;
if (ha->fw_memory_size < 0x20000)
dump_size = FW_DUMP_SIZE_128K;
else if (ha->fw_memory_size < 0x80000)
dump_size = FW_DUMP_SIZE_512K;
}
ha->fw_dump_buffer = (char *)vmalloc(dump_size);
if (ha->fw_dump_buffer == NULL) {
qla_printk(KERN_WARNING, ha,
"Unable to allocate memory for firmware "
"dump buffer (%d).\n", dump_size);
ha->fw_dump_reading = 0;
return (count);
}
qla_printk(KERN_INFO, ha, qla_printk(KERN_INFO, ha,
"Firmware dump ready for read on (%ld).\n", "Raw firmware dump ready for read on (%ld).\n",
ha->host_no); ha->host_no);
memset(ha->fw_dump_buffer, 0, dump_size);
ha->isp_ops.ascii_fw_dump(ha);
ha->fw_dump_buffer_len = strlen(ha->fw_dump_buffer);
} }
break; break;
case 2:
qla2x00_alloc_fw_dump(ha);
break;
} }
return (count); return (count);
} }
...@@ -313,9 +294,6 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off, ...@@ -313,9 +294,6 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off,
if (!capable(CAP_SYS_ADMIN) || off != 0) if (!capable(CAP_SYS_ADMIN) || off != 0)
return 0; return 0;
if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
return -ENOTSUPP;
/* Read NVRAM. */ /* Read NVRAM. */
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size); ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size);
...@@ -335,9 +313,6 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, char *buf, loff_t off, ...@@ -335,9 +313,6 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, char *buf, loff_t off,
if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size) if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size)
return 0; return 0;
if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
return -ENOTSUPP;
/* Write NVRAM. */ /* Write NVRAM. */
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count);
...@@ -357,6 +332,53 @@ static struct bin_attribute sysfs_vpd_attr = { ...@@ -357,6 +332,53 @@ static struct bin_attribute sysfs_vpd_attr = {
.write = qla2x00_sysfs_write_vpd, .write = qla2x00_sysfs_write_vpd,
}; };
static ssize_t
qla2x00_sysfs_read_sfp(struct kobject *kobj, char *buf, loff_t off,
size_t count)
{
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
struct device, kobj)));
uint16_t iter, addr, offset;
int rval;
if (!capable(CAP_SYS_ADMIN) || off != 0 || count != SFP_DEV_SIZE * 2)
return 0;
addr = 0xa0;
for (iter = 0, offset = 0; iter < (SFP_DEV_SIZE * 2) / SFP_BLOCK_SIZE;
iter++, offset += SFP_BLOCK_SIZE) {
if (iter == 4) {
/* Skip to next device address. */
addr = 0xa2;
offset = 0;
}
rval = qla2x00_read_sfp(ha, ha->sfp_data_dma, addr, offset,
SFP_BLOCK_SIZE);
if (rval != QLA_SUCCESS) {
qla_printk(KERN_WARNING, ha,
"Unable to read SFP data (%x/%x/%x).\n", rval,
addr, offset);
count = 0;
break;
}
memcpy(buf, ha->sfp_data, SFP_BLOCK_SIZE);
buf += SFP_BLOCK_SIZE;
}
return count;
}
static struct bin_attribute sysfs_sfp_attr = {
.attr = {
.name = "sfp",
.mode = S_IRUSR | S_IWUSR,
.owner = THIS_MODULE,
},
.size = SFP_DEV_SIZE * 2,
.read = qla2x00_sysfs_read_sfp,
};
void void
qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha) qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
{ {
...@@ -367,7 +389,12 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha) ...@@ -367,7 +389,12 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr); sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
sysfs_create_bin_file(&host->shost_gendev.kobj, sysfs_create_bin_file(&host->shost_gendev.kobj,
&sysfs_optrom_ctl_attr); &sysfs_optrom_ctl_attr);
sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr); if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
sysfs_create_bin_file(&host->shost_gendev.kobj,
&sysfs_vpd_attr);
sysfs_create_bin_file(&host->shost_gendev.kobj,
&sysfs_sfp_attr);
}
} }
void void
...@@ -380,7 +407,12 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha) ...@@ -380,7 +407,12 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha)
sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr); sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
sysfs_remove_bin_file(&host->shost_gendev.kobj, sysfs_remove_bin_file(&host->shost_gendev.kobj,
&sysfs_optrom_ctl_attr); &sysfs_optrom_ctl_attr);
sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr); if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
sysfs_remove_bin_file(&host->shost_gendev.kobj,
&sysfs_vpd_attr);
sysfs_remove_bin_file(&host->shost_gendev.kobj,
&sysfs_sfp_attr);
}
if (ha->beacon_blink_led == 1) if (ha->beacon_blink_led == 1)
ha->isp_ops.beacon_off(ha); ha->isp_ops.beacon_off(ha);
......
此差异已折叠。
...@@ -37,134 +37,86 @@ ...@@ -37,134 +37,86 @@
/* /*
* Macros use for debugging the driver. * Macros use for debugging the driver.
*/ */
#undef ENTER_TRACE
#if defined(ENTER_TRACE)
#define ENTER(x) do { printk("qla2100 : Entering %s()\n", x); } while (0)
#define LEAVE(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0)
#define ENTER_INTR(x) do { printk("qla2100 : Entering %s()\n", x); } while (0)
#define LEAVE_INTR(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0)
#else
#define ENTER(x) do {} while (0)
#define LEAVE(x) do {} while (0)
#define ENTER_INTR(x) do {} while (0)
#define LEAVE_INTR(x) do {} while (0)
#endif
#if DEBUG_QLA2100 #define DEBUG(x) do { if (extended_error_logging) { x; } } while (0)
#define DEBUG(x) do {x;} while (0);
#else
#define DEBUG(x) do {} while (0);
#endif
#if defined(QL_DEBUG_LEVEL_1) #if defined(QL_DEBUG_LEVEL_1)
#define DEBUG1(x) do {x;} while (0); #define DEBUG1(x) do {x;} while (0)
#else #else
#define DEBUG1(x) do {} while (0); #define DEBUG1(x) do {} while (0)
#endif #endif
#if defined(QL_DEBUG_LEVEL_2) #define DEBUG2(x) do { if (extended_error_logging) { x; } } while (0)
#define DEBUG2(x) do {x;} while (0); #define DEBUG2_3(x) do { if (extended_error_logging) { x; } } while (0)
#define DEBUG2_3(x) do {x;} while (0); #define DEBUG2_3_11(x) do { if (extended_error_logging) { x; } } while (0)
#define DEBUG2_3_11(x) do {x;} while (0); #define DEBUG2_9_10(x) do { if (extended_error_logging) { x; } } while (0)
#define DEBUG2_9_10(x) do {x;} while (0); #define DEBUG2_11(x) do { if (extended_error_logging) { x; } } while (0)
#define DEBUG2_11(x) do {x;} while (0); #define DEBUG2_13(x) do { if (extended_error_logging) { x; } } while (0)
#define DEBUG2_13(x) do {x;} while (0);
#else
#define DEBUG2(x) do {} while (0);
#endif
#if defined(QL_DEBUG_LEVEL_3) #if defined(QL_DEBUG_LEVEL_3)
#define DEBUG3(x) do {x;} while (0); #define DEBUG3(x) do {x;} while (0)
#define DEBUG2_3(x) do {x;} while (0); #define DEBUG3_11(x) do {x;} while (0)
#define DEBUG2_3_11(x) do {x;} while (0);
#define DEBUG3_11(x) do {x;} while (0);
#else #else
#define DEBUG3(x) do {} while (0); #define DEBUG3(x) do {} while (0)
#if !defined(QL_DEBUG_LEVEL_2)
#define DEBUG2_3(x) do {} while (0);
#endif
#endif #endif
#if defined(QL_DEBUG_LEVEL_4) #if defined(QL_DEBUG_LEVEL_4)
#define DEBUG4(x) do {x;} while (0); #define DEBUG4(x) do {x;} while (0)
#else #else
#define DEBUG4(x) do {} while (0); #define DEBUG4(x) do {} while (0)
#endif #endif
#if defined(QL_DEBUG_LEVEL_5) #if defined(QL_DEBUG_LEVEL_5)
#define DEBUG5(x) do {x;} while (0); #define DEBUG5(x) do {x;} while (0)
#else #else
#define DEBUG5(x) do {} while (0); #define DEBUG5(x) do {} while (0)
#endif #endif
#if defined(QL_DEBUG_LEVEL_7) #if defined(QL_DEBUG_LEVEL_7)
#define DEBUG7(x) do {x;} while (0); #define DEBUG7(x) do {x;} while (0)
#else #else
#define DEBUG7(x) do {} while (0); #define DEBUG7(x) do {} while (0)
#endif #endif
#if defined(QL_DEBUG_LEVEL_9) #if defined(QL_DEBUG_LEVEL_9)
#define DEBUG9(x) do {x;} while (0); #define DEBUG9(x) do {x;} while (0)
#define DEBUG9_10(x) do {x;} while (0); #define DEBUG9_10(x) do {x;} while (0)
#define DEBUG2_9_10(x) do {x;} while (0);
#else #else
#define DEBUG9(x) do {} while (0); #define DEBUG9(x) do {} while (0)
#endif #endif
#if defined(QL_DEBUG_LEVEL_10) #if defined(QL_DEBUG_LEVEL_10)
#define DEBUG10(x) do {x;} while (0); #define DEBUG10(x) do {x;} while (0)
#define DEBUG2_9_10(x) do {x;} while (0); #define DEBUG9_10(x) do {x;} while (0)
#define DEBUG9_10(x) do {x;} while (0);
#else #else
#define DEBUG10(x) do {} while (0); #define DEBUG10(x) do {} while (0)
#if !defined(DEBUG2_9_10)
#define DEBUG2_9_10(x) do {} while (0);
#endif
#if !defined(DEBUG9_10) #if !defined(DEBUG9_10)
#define DEBUG9_10(x) do {} while (0); #define DEBUG9_10(x) do {} while (0)
#endif #endif
#endif #endif
#if defined(QL_DEBUG_LEVEL_11) #if defined(QL_DEBUG_LEVEL_11)
#define DEBUG11(x) do{x;} while(0); #define DEBUG11(x) do{x;} while(0)
#if !defined(DEBUG2_11)
#define DEBUG2_11(x) do{x;} while(0);
#endif
#if !defined(DEBUG2_3_11)
#define DEBUG2_3_11(x) do{x;} while(0);
#endif
#if !defined(DEBUG3_11) #if !defined(DEBUG3_11)
#define DEBUG3_11(x) do{x;} while(0); #define DEBUG3_11(x) do{x;} while(0)
#endif #endif
#else #else
#define DEBUG11(x) do{} while(0); #define DEBUG11(x) do{} while(0)
#if !defined(QL_DEBUG_LEVEL_2)
#define DEBUG2_11(x) do{} while(0);
#if !defined(QL_DEBUG_LEVEL_3)
#define DEBUG2_3_11(x) do{} while(0);
#endif
#endif
#if !defined(QL_DEBUG_LEVEL_3) #if !defined(QL_DEBUG_LEVEL_3)
#define DEBUG3_11(x) do{} while(0); #define DEBUG3_11(x) do{} while(0)
#endif #endif
#endif #endif
#if defined(QL_DEBUG_LEVEL_12) #if defined(QL_DEBUG_LEVEL_12)
#define DEBUG12(x) do {x;} while (0); #define DEBUG12(x) do {x;} while (0)
#else #else
#define DEBUG12(x) do {} while (0); #define DEBUG12(x) do {} while (0)
#endif #endif
#if defined(QL_DEBUG_LEVEL_13) #if defined(QL_DEBUG_LEVEL_13)
#define DEBUG13(x) do {x;} while (0) #define DEBUG13(x) do {x;} while (0)
#if !defined(DEBUG2_13)
#define DEBUG2_13(x) do {x;} while(0)
#endif
#else #else
#define DEBUG13(x) do {} while (0) #define DEBUG13(x) do {} while (0)
#if !defined(QL_DEBUG_LEVEL_2)
#define DEBUG2_13(x) do {} while(0)
#endif
#endif #endif
#if defined(QL_DEBUG_LEVEL_14) #if defined(QL_DEBUG_LEVEL_14)
...@@ -176,9 +128,6 @@ ...@@ -176,9 +128,6 @@
/* /*
* Firmware Dump structure definition * Firmware Dump structure definition
*/ */
#define FW_DUMP_SIZE_128K 0xBC000
#define FW_DUMP_SIZE_512K 0x2FC000
#define FW_DUMP_SIZE_1M 0x5FC000
struct qla2300_fw_dump { struct qla2300_fw_dump {
uint16_t hccr; uint16_t hccr;
...@@ -224,8 +173,6 @@ struct qla2100_fw_dump { ...@@ -224,8 +173,6 @@ struct qla2100_fw_dump {
uint16_t risc_ram[0xf000]; uint16_t risc_ram[0xf000];
}; };
#define FW_DUMP_SIZE_24XX 0x2B0000
struct qla24xx_fw_dump { struct qla24xx_fw_dump {
uint32_t host_status; uint32_t host_status;
uint32_t host_reg[32]; uint32_t host_reg[32];
...@@ -257,3 +204,39 @@ struct qla24xx_fw_dump { ...@@ -257,3 +204,39 @@ struct qla24xx_fw_dump {
uint32_t code_ram[0x2000]; uint32_t code_ram[0x2000];
uint32_t ext_mem[1]; uint32_t ext_mem[1];
}; };
#define EFT_NUM_BUFFERS 4
#define EFT_BYTES_PER_BUFFER 0x4000
#define EFT_SIZE ((EFT_BYTES_PER_BUFFER) * (EFT_NUM_BUFFERS))
struct qla2xxx_fw_dump {
uint8_t signature[4];
uint32_t version;
uint32_t fw_major_version;
uint32_t fw_minor_version;
uint32_t fw_subminor_version;
uint32_t fw_attributes;
uint32_t vendor;
uint32_t device;
uint32_t subsystem_vendor;
uint32_t subsystem_device;
uint32_t fixed_size;
uint32_t mem_size;
uint32_t req_q_size;
uint32_t rsp_q_size;
uint32_t eft_size;
uint32_t eft_addr_l;
uint32_t eft_addr_h;
uint32_t header_size;
union {
struct qla2100_fw_dump isp21;
struct qla2300_fw_dump isp23;
struct qla24xx_fw_dump isp24;
} isp;
};
此差异已折叠。
此差异已折叠。
...@@ -141,7 +141,7 @@ struct nvram_24xx { ...@@ -141,7 +141,7 @@ struct nvram_24xx {
* BIT 2 = Enable Memory Map BIOS * BIT 2 = Enable Memory Map BIOS
* BIT 3 = Enable Selectable Boot * BIT 3 = Enable Selectable Boot
* BIT 4 = Disable RISC code load * BIT 4 = Disable RISC code load
* BIT 5 = * BIT 5 = Disable Serdes
* BIT 6 = * BIT 6 =
* BIT 7 = * BIT 7 =
* *
...@@ -278,7 +278,7 @@ struct init_cb_24xx { ...@@ -278,7 +278,7 @@ struct init_cb_24xx {
uint16_t response_q_length; uint16_t response_q_length;
uint16_t request_q_length; uint16_t request_q_length;
uint16_t link_down_timeout; /* Milliseconds. */ uint16_t link_down_on_nos; /* Milliseconds. */
uint16_t prio_request_q_length; uint16_t prio_request_q_length;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册