6 #define SS_PENDING 0x00
8 #define SS_ABORTED 0x02
10 #define SS_OLD_MANAGE 0xe1
11 #define SS_ILLEGAL_MODE 0xe2
12 #define SS_NO_ASPI 0xe3
13 #define SS_FAILED_INIT 0xe4
14 #define SS_INVALID_HA 0x81
15 #define SS_INVALID_SRB 0xe0
16 #define SS_ASPI_IS_BUSY 0xe5
17 #define SS_BUFFER_TO_BIG 0xe6
19 #define SC_HA_INQUIRY 0x00
20 #define SC_GET_DEV_TYPE 0x01
21 #define SC_EXEC_SCSI_CMD 0x02
22 #define SC_ABORT_SRB 0x03
23 #define SC_RESET_DEV 0x04
25 /* Host adapter status codes */
26 #define HASTAT_OK 0x00
27 #define HASTAT_SEL_TO 0x11
28 #define HASTAT_DO_DU 0x12
29 #define HASTAT_BUS_FREE 0x13
30 #define HASTAT_PHASE_ERR 0x14
32 /* Target status codes */
33 #define STATUS_GOOD 0x00
34 #define STATUS_CHKCOND 0x02
35 #define STATUS_BUSY 0x08
36 #define STATUS_RESCONF 0x18
39 typedef union SRB16
* LPSRB16
;
41 struct SRB_HaInquiry16
{
46 WORD SRB_55AASignature
;
47 WORD SRB_ExtBufferSize
;
50 BYTE HA_ManagerId
[16];
51 BYTE HA_Identifier
[16];
56 typedef struct SRB_HaInquiry16 SRB_HaInquiry16
;
58 struct SRB_ExecSCSICmd16
{
59 BYTE SRB_Cmd
; /* ASPI command code (W) */
60 BYTE SRB_Status
; /* ASPI command status byte (R) */
61 BYTE SRB_HaId
; /* ASPI host adapter number (W) */
62 BYTE SRB_Flags
; /* ASPI request flags (W) */
63 DWORD SRB_Hdr_Rsvd
; /* Reserved, MUST = 0 (-) */
64 BYTE SRB_Target
; /* Target's SCSI ID (W) */
65 BYTE SRB_Lun
; /* Target's LUN number (W) */
66 DWORD SRB_BufLen
; /* Data Allocation LengthPG (W/R)*/
67 BYTE SRB_SenseLen
; /* Sense Allocation Length (W) */
68 SEGPTR SRB_BufPointer
; /* Data Buffer Pointer (W) */
69 DWORD SRB_Rsvd1
; /* Reserved, MUST = 0 (-/W)*/
70 BYTE SRB_CDBLen
; /* CDB Length = 6 (W) */
71 BYTE SRB_HaStat
; /* Host Adapter Status (R) */
72 BYTE SRB_TargStat
; /* Target Status (R) */
73 FARPROC16 SRB_PostProc
; /* Post routine (W) */
74 BYTE SRB_Rsvd2
[34]; /* Reserved, MUST = 0 */
75 BYTE CDBByte
[0]; /* SCSI CBD - variable length (W) */
76 /* variable example for 6 byte cbd
77 * BYTE CDBByte[6]; * SCSI CDB (W) *
78 * BYTE SenseArea6[SENSE_LEN]; * Request Sense buffer (R) *
82 typedef struct SRB_ExecSCSICmd16 SRB_ExecSCSICmd16
;
84 struct SRB_ExecSCSICmd32
{
85 BYTE SRB_Cmd
; /* ASPI command code = SC_EXEC_SCSI_CMD */
86 BYTE SRB_Status
; /* ASPI command status byte */
87 BYTE SRB_HaId
; /* ASPI host adapter number */
88 BYTE SRB_Flags
; /* ASPI request flags */
89 DWORD SRB_Hdr_Rsvd
; /* Reserved */
90 BYTE SRB_Target
; /* Target's SCSI ID */
91 BYTE SRB_Lun
; /* Target's LUN number */
92 WORD SRB_Rsvd1
; /* Reserved for Alignment */
93 DWORD SRB_BufLen
; /* Data Allocation Length */
94 BYTE
*SRB_BufPointer
; /* Data Buffer Point */
95 BYTE SRB_SenseLen
; /* Sense Allocation Length */
96 BYTE SRB_CDBLen
; /* CDB Length */
97 BYTE SRB_HaStat
; /* Host Adapter Status */
98 BYTE SRB_TargStat
; /* Target Status */
99 void (*SRB_PostProc
)(); /* Post routine */
100 void *SRB_Rsvd2
; /* Reserved */
101 BYTE SRB_Rsvd3
[16]; /* Reserved for expansion */
102 BYTE CDBByte
[16]; /* SCSI CDB */
103 BYTE SenseArea
[0]; /* Request sense buffer - var length */
106 typedef struct SRB_ExecSCSICmd32 SRB_ExecSCSICmd32
;
109 BYTE SRB_Cmd
; /* ASPI command code = SC_ABORT_SRB */
110 BYTE SRB_Status
; /* ASPI command status byte */
111 BYTE SRB_HaId
; /* ASPI host adapter number */
112 BYTE SRB_Flags
; /* ASPI request flags */
113 DWORD SRB_Hdr_Rsvd
; /* Reserved, MUST = 0 */
114 LPSRB16 SRB_ToAbort
; /* Pointer to SRB to abort */
117 typedef struct SRB_Abort16 SRB_Abort16
;
119 struct SRB_BusDeviceReset16
{
120 BYTE SRB_Cmd
; /* ASPI command code = SC_RESET_DEV */
121 BYTE SRB_Status
; /* ASPI command status byte */
122 BYTE SRB_HaId
; /* ASPI host adapter number */
123 BYTE SRB_Flags
; /* ASPI request flags */
124 DWORD SRB_Hdr_Rsvd
; /* Reserved, MUST = 0 */
125 BYTE SRB_Target
; /* Target's SCSI ID */
126 BYTE SRB_Lun
; /* Target's LUN number */
127 BYTE SRB_ResetRsvd1
[14]; /* Reserved, MUST = 0 */
128 BYTE SRB_HaStat
; /* Host Adapter Status */
129 BYTE SRB_TargStat
; /* Target Status */
130 SEGPTR SRB_PostProc
; /* Post routine */
131 BYTE SRB_ResetRsvd2
[34]; /* Reserved, MUST = 0 */
134 typedef struct SRB_BusDeviceReset16 SRB_BusDeviceReset16
;
136 struct SRB_GDEVBlock16
{
137 BYTE SRB_Cmd
; /* ASPI command code = SC_GET_DEV_TYPE */
138 BYTE SRB_Status
; /* ASPI command status byte */
139 BYTE SRB_HaId
; /* ASPI host adapter number */
140 BYTE SRB_Flags
; /* ASPI request flags */
141 DWORD SRB_Hdr_Rsvd
; /* Reserved, MUST = 0 */
142 BYTE SRB_Target
; /* Target's SCSI ID */
143 BYTE SRB_Lun
; /* Target's LUN number */
144 BYTE SRB_DeviceType
; /* Target's peripheral device type */
147 typedef struct SRB_GDEVBlock16 SRB_GDEVBlock16
;
151 struct SRB_Common16
{
156 typedef struct SRB_Common16 SRB_Common16
;
161 SRB_HaInquiry16 inquiry
;
162 SRB_ExecSCSICmd16 cmd
;
164 SRB_BusDeviceReset16 reset
;
165 SRB_GDEVBlock16 devtype
;
168 typedef union SRB16 SRB16
;