mpi_init.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:15k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  Copyright (c) 2000-2001 LSI Logic Corporation.
  3.  *
  4.  *
  5.  *           Name:  MPI_INIT.H
  6.  *          Title:  MPI initiator mode messages and structures
  7.  *  Creation Date:  June 8, 2000
  8.  *
  9.  *    MPI Version:  01.02.04
  10.  *
  11.  *  Version History
  12.  *  ---------------
  13.  *
  14.  *  Date      Version   Description
  15.  *  --------  --------  ------------------------------------------------------
  16.  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
  17.  *  05-24-00  00.10.02  Added SenseBufferLength to _MSG_SCSI_IO_REPLY.
  18.  *  06-06-00  01.00.01  Update version number for 1.0 release.
  19.  *  06-08-00  01.00.02  Added MPI_SCSI_RSP_INFO_ definitions.
  20.  *  11-02-00  01.01.01  Original release for post 1.0 work.
  21.  *  12-04-00  01.01.02  Added MPI_SCSIIO_CONTROL_NO_DISCONNECT.
  22.  *  02-20-01  01.01.03  Started using MPI_POINTER.
  23.  *  03-27-01  01.01.04  Added structure offset comments.
  24.  *  04-10-01  01.01.05  Added new MsgFlag for MSG_SCSI_TASK_MGMT.
  25.  *  08-08-01  01.02.01  Original release for v1.2 work.
  26.  *  08-29-01  01.02.02  Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET.
  27.  *                      Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for
  28.  *                      MSG_SCSI_IO_REPLY.
  29.  *  09-28-01  01.02.03  Added structures and defines for SCSI Enclosure
  30.  *                      Processor messages.
  31.  *  10-04-01  01.02.04  Added defines for SEP request Action field.
  32.  *  --------------------------------------------------------------------------
  33.  */
  34. #ifndef MPI_INIT_H
  35. #define MPI_INIT_H
  36. /*****************************************************************************
  37. *
  38. *               S C S I    I n i t i a t o r    M e s s a g e s
  39. *
  40. *****************************************************************************/
  41. /****************************************************************************/
  42. /*  SCSI IO messages and assocaited structures                              */
  43. /****************************************************************************/
  44. typedef struct _MSG_SCSI_IO_REQUEST
  45. {
  46.     U8                      TargetID;           /* 00h */
  47.     U8                      Bus;                /* 01h */
  48.     U8                      ChainOffset;        /* 02h */
  49.     U8                      Function;           /* 03h */
  50.     U8                      CDBLength;          /* 04h */
  51.     U8                      SenseBufferLength;  /* 05h */
  52.     U8                      Reserved;           /* 06h */
  53.     U8                      MsgFlags;           /* 07h */
  54.     U32                     MsgContext;         /* 08h */
  55.     U8                      LUN[8];             /* 0Ch */
  56.     U32                     Control;            /* 14h */
  57.     U8                      CDB[16];            /* 18h */
  58.     U32                     DataLength;         /* 28h */
  59.     U32                     SenseBufferLowAddr; /* 2Ch */
  60.     SGE_IO_UNION            SGL;                /* 30h */
  61. } MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST,
  62.   SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
  63. /* SCSIO MsgFlags bits */
  64. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH          (0x01)
  65. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32       (0x00)
  66. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64       (0x01)
  67. #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION       (0x02)
  68. #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST       (0x00)
  69. #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC        (0x02)
  70. /* SCSIIO LUN fields */
  71. #define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING   (0x0000FFFF)
  72. #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING  (0xFFFF0000)
  73. #define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING   (0x0000FFFF)
  74. #define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING  (0xFFFF0000)
  75. #define MPI_SCSIIO_LUN_LEVEL_1_WORD             (0xFF00)
  76. #define MPI_SCSIIO_LUN_LEVEL_1_DWORD            (0x0000FF00)
  77. /* SCSIO Control bits */
  78. #define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK   (0x03000000)
  79. #define MPI_SCSIIO_CONTROL_NODATATRANSFER       (0x00000000)
  80. #define MPI_SCSIIO_CONTROL_WRITE                (0x01000000)
  81. #define MPI_SCSIIO_CONTROL_READ                 (0x02000000)
  82. #define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK       (0x3C000000)
  83. #define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT      (26)
  84. #define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK   (0x00000700)
  85. #define MPI_SCSIIO_CONTROL_SIMPLEQ              (0x00000000)
  86. #define MPI_SCSIIO_CONTROL_HEADOFQ              (0x00000100)
  87. #define MPI_SCSIIO_CONTROL_ORDEREDQ             (0x00000200)
  88. #define MPI_SCSIIO_CONTROL_ACAQ                 (0x00000400)
  89. #define MPI_SCSIIO_CONTROL_UNTAGGED             (0x00000500)
  90. #define MPI_SCSIIO_CONTROL_NO_DISCONNECT        (0x00000700)
  91. #define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK      (0x00FF0000)
  92. #define MPI_SCSIIO_CONTROL_OBSOLETE             (0x00800000)
  93. #define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV        (0x00400000)
  94. #define MPI_SCSIIO_CONTROL_TARGET_RESET         (0x00200000)
  95. #define MPI_SCSIIO_CONTROL_LUN_RESET_RSV        (0x00100000)
  96. #define MPI_SCSIIO_CONTROL_RESERVED             (0x00080000)
  97. #define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV     (0x00040000)
  98. #define MPI_SCSIIO_CONTROL_ABORT_TASK_SET       (0x00020000)
  99. #define MPI_SCSIIO_CONTROL_RESERVED2            (0x00010000)
  100. /* SCSIIO reply structure */
  101. typedef struct _MSG_SCSI_IO_REPLY
  102. {
  103.     U8                      TargetID;           /* 00h */
  104.     U8                      Bus;                /* 01h */
  105.     U8                      MsgLength;          /* 02h */
  106.     U8                      Function;           /* 03h */
  107.     U8                      CDBLength;          /* 04h */
  108.     U8                      SenseBufferLength;  /* 05h */
  109.     U8                      Reserved;           /* 06h */
  110.     U8                      MsgFlags;           /* 07h */
  111.     U32                     MsgContext;         /* 08h */
  112.     U8                      SCSIStatus;         /* 0Ch */
  113.     U8                      SCSIState;          /* 0Dh */
  114.     U16                     IOCStatus;          /* 0Eh */
  115.     U32                     IOCLogInfo;         /* 10h */
  116.     U32                     TransferCount;      /* 14h */
  117.     U32                     SenseCount;         /* 18h */
  118.     U32                     ResponseInfo;       /* 1Ch */
  119. } MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
  120.   SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
  121. /* SCSIIO Reply SCSIStatus values (SAM-2 status codes) */
  122. #define MPI_SCSI_STATUS_SUCCESS                 (0x00)
  123. #define MPI_SCSI_STATUS_CHECK_CONDITION         (0x02)
  124. #define MPI_SCSI_STATUS_CONDITION_MET           (0x04)
  125. #define MPI_SCSI_STATUS_BUSY                    (0x08)
  126. #define MPI_SCSI_STATUS_INTERMEDIATE            (0x10)
  127. #define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET    (0x14)
  128. #define MPI_SCSI_STATUS_RESERVATION_CONFLICT    (0x18)
  129. #define MPI_SCSI_STATUS_COMMAND_TERMINATED      (0x22)
  130. #define MPI_SCSI_STATUS_TASK_SET_FULL           (0x28)
  131. #define MPI_SCSI_STATUS_ACA_ACTIVE              (0x30)
  132. /* SCSIIO Reply SCSIState values */
  133. #define MPI_SCSI_STATE_AUTOSENSE_VALID          (0x01)
  134. #define MPI_SCSI_STATE_AUTOSENSE_FAILED         (0x02)
  135. #define MPI_SCSI_STATE_NO_SCSI_STATUS           (0x04)
  136. #define MPI_SCSI_STATE_TERMINATED               (0x08)
  137. #define MPI_SCSI_STATE_RESPONSE_INFO_VALID      (0x10)
  138. #define MPI_SCSI_STATE_QUEUE_TAG_REJECTED       (0x20)
  139. /* SCSIIO Reply ResponseInfo values */
  140. /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
  141. #define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE     (0x00000000)
  142. #define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR   (0x01000000)
  143. #define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID   (0x02000000)
  144. #define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR     (0x03000000)
  145. #define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED (0x04000000)
  146. #define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED      (0x05000000)
  147. #define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE   (0x06000000)
  148. /****************************************************************************/
  149. /*  SCSI Task Management messages                                           */
  150. /****************************************************************************/
  151. typedef struct _MSG_SCSI_TASK_MGMT
  152. {
  153.     U8                      TargetID;           /* 00h */
  154.     U8                      Bus;                /* 01h */
  155.     U8                      ChainOffset;        /* 02h */
  156.     U8                      Function;           /* 03h */
  157.     U8                      Reserved;           /* 04h */
  158.     U8                      TaskType;           /* 05h */
  159.     U8                      Reserved1;          /* 06h */
  160.     U8                      MsgFlags;           /* 07h */
  161.     U32                     MsgContext;         /* 08h */
  162.     U8                      LUN[8];             /* 0Ch */
  163.     U32                     Reserved2[7];       /* 14h */
  164.     U32                     TaskMsgContext;     /* 30h */
  165. } MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT,
  166.   SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t;
  167. /* TaskType values */
  168. #define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK            (0x01)
  169. #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET         (0x02)
  170. #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET          (0x03)
  171. #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS             (0x04)
  172. #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET    (0x05)
  173. /* MsgFlags bits */
  174. #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION   (0x00)
  175. #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION      (0x02)
  176. #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
  177. /* SCSI Task Management Reply */
  178. typedef struct _MSG_SCSI_TASK_MGMT_REPLY
  179. {
  180.     U8                      TargetID;           /* 00h */
  181.     U8                      Bus;                /* 01h */
  182.     U8                      MsgLength;          /* 02h */
  183.     U8                      Function;           /* 03h */
  184.     U8                      Reserved;           /* 04h */
  185.     U8                      TaskType;           /* 05h */
  186.     U8                      Reserved1;          /* 06h */
  187.     U8                      MsgFlags;           /* 07h */
  188.     U32                     MsgContext;         /* 08h */
  189.     U8                      Reserved2[2];       /* 0Ch */
  190.     U16                     IOCStatus;          /* 0Eh */
  191.     U32                     IOCLogInfo;         /* 10h */
  192.     U32                     TerminationCount;   /* 14h */
  193. } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
  194.   SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
  195. /****************************************************************************/
  196. /*  SCSI Enclosure Processor messages                                       */
  197. /****************************************************************************/
  198. typedef struct _MSG_SEP_REQUEST
  199. {
  200.     U8                      TargetID;           /* 00h */
  201.     U8                      Bus;                /* 01h */
  202.     U8                      ChainOffset;        /* 02h */
  203.     U8                      Function;           /* 03h */
  204.     U8                      Action;             /* 04h */
  205.     U8                      Reserved1;          /* 05h */
  206.     U8                      Reserved2;          /* 06h */
  207.     U8                      MsgFlags;           /* 07h */
  208.     U32                     MsgContext;         /* 08h */
  209.     U32                     SlotStatus;         /* 0Ch */
  210. } MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST,
  211.   SEPRequest_t, MPI_POINTER pSEPRequest_t;
  212. /* Action defines */
  213. #define MPI_SEP_REQ_ACTION_WRITE_STATUS                 (0x00)
  214. #define MPI_SEP_REQ_ACTION_READ_STATUS                  (0x01)
  215. /* SlotStatus bits for MSG_SEP_REQUEST */
  216. #define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR                 (0x00000001)
  217. #define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY               (0x00000002)
  218. #define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING           (0x00000004)
  219. #define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY          (0x00000008)
  220. #define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY        (0x00000010)
  221. #define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK             (0x00000020)
  222. #define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT          (0x00000040)
  223. #define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED             (0x00000080)
  224. #define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE                (0x00000100)
  225. #define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED          (0x00000200)
  226. #define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST         (0x00020000)
  227. #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE           (0x00040000)
  228. #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT           (0x00080000)
  229. #define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE              (0x00400000)
  230. #define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS          (0x04000000)
  231. #define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS          (0x08000000)
  232. #define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF                  (0x10000000)
  233. #define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET               (0x80000000)
  234. typedef struct _MSG_SEP_REPLY
  235. {
  236.     U8                      TargetID;           /* 00h */
  237.     U8                      Bus;                /* 01h */
  238.     U8                      MsgLength;          /* 02h */
  239.     U8                      Function;           /* 03h */
  240.     U8                      Action;             /* 04h */
  241.     U8                      Reserved1;          /* 05h */
  242.     U8                      Reserved2;          /* 06h */
  243.     U8                      MsgFlags;           /* 07h */
  244.     U32                     MsgContext;         /* 08h */
  245.     U16                     Reserved3;          /* 0Ch */
  246.     U16                     IOCStatus;          /* 0Eh */
  247.     U32                     IOCLogInfo;         /* 10h */
  248.     U32                     SlotStatus;         /* 14h */
  249. } MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
  250.   SEPReply_t, MPI_POINTER pSEPReply_t;
  251. /* SlotStatus bits for MSG_SEP_REPLY */
  252. #define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR               (0x00000001)
  253. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY             (0x00000002)
  254. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING         (0x00000004)
  255. #define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY        (0x00000008)
  256. #define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY      (0x00000010)
  257. #define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK           (0x00000020)
  258. #define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT        (0x00000040)
  259. #define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED           (0x00000080)
  260. #define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE              (0x00000100)
  261. #define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED        (0x00000200)
  262. #define MPI_SEP_REPLY_SLOTSTATUS_REPORT                 (0x00010000)
  263. #define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST       (0x00020000)
  264. #define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY           (0x00040000)
  265. #define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY           (0x00080000)
  266. #define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE          (0x00400000)
  267. #define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED       (0x01000000)
  268. #define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED       (0x02000000)
  269. #define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS        (0x04000000)
  270. #define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS        (0x08000000)
  271. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF                (0x10000000)
  272. #define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED           (0x40000000)
  273. #define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED                (0x80000000)
  274. #endif