7
{ ---------------------------------------------------------------------
9
---------------------------------------------------------------------}
11
STATUS_GOOD = $00; // Status Good
12
STATUS_CHKCOND = $02; // Check Condition
13
STATUS_CONDMET = $04; // Condition Met
14
STATUS_BUSY = $08; // Busy
15
STATUS_INTERM = $10; // Intermediate
16
STATUS_INTCDMET = $14; // Intermediate-condition met
17
STATUS_RESCONF = $18; // Reservation conflict
18
STATUS_COMTERM = $22; // Command Terminated
19
STATUS_QFULL = $28; // Queue full
21
{ ---------------------------------------------------------------------
22
SCSI MISCELLANEOUS EQUATES
23
---------------------------------------------------------------------}
25
MAXLUN = 7; // Maximum Logical Unit Id
26
MAXTARG = 7; // Maximum Target Id
27
MAX_SCSI_LUNS = 64; // Maximum Number of SCSI LUNs
28
MAX_NUM_HA = 8; // Maximum Number of SCSI HA's
30
{ ---------------------------------------------------------------------
32
---------------------------------------------------------------------}
34
{ ---------------------------------------------------------------------
35
Commands for all Device Types
36
---------------------------------------------------------------------}
38
SCSI_CHANGE_DEF = $40; // Change Definition (Optional)
39
SCSI_COMPARE = $39; // Compare (O)
40
SCSI_COPY = $18; // Copy (O)
41
SCSI_COP_VERIFY = $3A; // Copy and Verify (O)
42
SCSI_INQUIRY = $12; // Inquiry (MANDATORY)
43
SCSI_LOG_SELECT = $4C; // Log Select (O)
44
SCSI_LOG_SENSE = $4D; // Log Sense (O)
45
SCSI_MODE_SEL6 = $15; // Mode Select 6-byte (Device Specific)
46
SCSI_MODE_SEL10 = $55; // Mode Select 10-byte (Device Specific)
47
SCSI_MODE_SEN6 = $1A; // Mode Sense 6-byte (Device Specific)
48
SCSI_MODE_SEN10 = $5A; // Mode Sense 10-byte (Device Specific)
49
SCSI_READ_BUFF = $3C; // Read Buffer (O)
50
SCSI_REQ_SENSE = $03; // Request Sense (MANDATORY)
51
SCSI_SEND_DIAG = $1D; // Send Diagnostic (O)
52
SCSI_TST_U_RDY = $00; // Test Unit Ready (MANDATORY)
53
SCSI_WRITE_BUFF = $3B; // Write Buffer (O)
55
{ ---------------------------------------------------------------------
56
Commands Unique to Direct Access Devices
57
---------------------------------------------------------------------}
59
SCSI_FORMAT = $04; // Format Unit (MANDATORY)
60
SCSI_LCK_UN_CAC = $36; // Lock Unlock Cache (O)
61
SCSI_PREFETCH = $34; // Prefetch (O)
62
SCSI_MED_REMOVL = $1E; // Prevent/Allow medium Removal (O)
63
SCSI_READ6 = $08; // Read 6-byte (MANDATORY)
64
SCSI_READ10 = $28; // Read 10-byte (MANDATORY)
65
SCSI_RD_CAPAC = $25; // Read Capacity (MANDATORY)
66
SCSI_RD_DEFECT = $37; // Read Defect Data (O)
67
SCSI_READ_LONG = $3E; // Read Long (O)
68
SCSI_REASS_BLK = $07; // Reassign Blocks (O)
69
SCSI_RCV_DIAG = $1C; // Receive Diagnostic Results (O)
70
SCSI_RELEASE = $17; // Release Unit (MANDATORY)
71
SCSI_REZERO = $01; // Rezero Unit (O)
72
SCSI_SRCH_DAT_E = $31; // Search Data Equal (O)
73
SCSI_SRCH_DAT_H = $30; // Search Data High (O)
74
SCSI_SRCH_DAT_L = $32; // Search Data Low (O)
75
SCSI_SEEK6 = $0B; // Seek 6-Byte (O)
76
SCSI_SEEK10 = $2B; // Seek 10-Byte (O)
77
SCSI_SET_LIMIT = $33; // Set Limits (O)
78
SCSI_START_STP = $1B; // Start/Stop Unit (O)
79
SCSI_SYNC_CACHE = $35; // Synchronize Cache (O)
80
SCSI_VERIFY = $2F; // Verify (O)
81
SCSI_WRITE6 = $0A; // Write 6-Byte (MANDATORY)
82
SCSI_WRITE10 = $2A; // Write 10-Byte (MANDATORY)
83
SCSI_WRT_VERIFY = $2E; // Write and Verify (O)
84
SCSI_WRITE_LONG = $3F; // Write Long (O)
85
SCSI_WRITE_SAME = $41; // Write Same (O)
87
{ ---------------------------------------------------------------------
88
Commands Unique to Sequential Access Devices
89
---------------------------------------------------------------------}
91
SCSI_ERASE = $19; // Erase (MANDATORY)
92
SCSI_LOAD_UN = $1B; // Load/Unload (O)
93
SCSI_LOCATE = $2B; // Locate (O)
94
SCSI_RD_BLK_LIM = $05; // Read Block Limits (MANDATORY)
95
SCSI_READ_POS = $34; // Read Position (O)
96
SCSI_READ_REV = $0F; // Read Reverse (O)
97
SCSI_REC_BF_DAT = $14; // Recover Buffer Data (O)
98
SCSI_RESERVE = $16; // Reserve Unit (MANDATORY)
99
SCSI_REWIND = $01; // Rewind (MANDATORY)
100
SCSI_SPACE = $11; // Space (MANDATORY)
101
SCSI_VERIFY_T = $13; // Verify (Tape) (O)
102
SCSI_WRT_FILE = $10; // Write Filemarks (MANDATORY)
104
{ ---------------------------------------------------------------------
105
Commands Unique to Printer Devices
106
---------------------------------------------------------------------}
108
SCSI_PRINT = $0A; // Print (MANDATORY)
109
SCSI_SLEW_PNT = $0B; // Slew and Print (O)
110
SCSI_STOP_PNT = $1B; // Stop Print (O)
111
SCSI_SYNC_BUFF = $10; // Synchronize Buffer (O)
113
{ ---------------------------------------------------------------------
114
Commands Unique to Processor Devices
115
---------------------------------------------------------------------}
117
SCSI_RECEIVE = $08; // Receive (O)
118
SCSI_SEND = $0A; // Send (O)
120
{ ---------------------------------------------------------------------
121
Commands Unique to Write-Once Devices
122
---------------------------------------------------------------------}
124
SCSI_MEDIUM_SCN = $38; // Medium Scan (O)
125
SCSI_SRCHDATE10 = $31; // Search Data Equal 10-Byte (O)
126
SCSI_SRCHDATE12 = $B1; // Search Data Equal 12-Byte (O)
127
SCSI_SRCHDATH10 = $30; // Search Data High 10-Byte (O)
128
SCSI_SRCHDATH12 = $B0; // Search Data High 12-Byte (O)
129
SCSI_SRCHDATL10 = $32; // Search Data Low 10-Byte (O)
130
SCSI_SRCHDATL12 = $B2; // Search Data Low 12-Byte (O)
131
SCSI_SET_LIM_10 = $33; // Set Limits 10-Byte (O)
132
SCSI_SET_LIM_12 = $B3; // Set Limits 10-Byte (O)
133
SCSI_VERIFY10 = $2F; // Verify 10-Byte (O)
134
SCSI_VERIFY12 = $AF; // Verify 12-Byte (O)
135
SCSI_WRITE12 = $AA; // Write 12-Byte (O)
136
SCSI_WRT_VER10 = $2E; // Write and Verify 10-Byte (O)
137
SCSI_WRT_VER12 = $AE; // Write and Verify 12-Byte (O)
139
{ ---------------------------------------------------------------------
140
Commands Unique to CD-ROM Devices
141
---------------------------------------------------------------------}
143
SCSI_PLAYAUD_10 = $45; // Play Audio 10-Byte (O)
144
SCSI_PLAYAUD_12 = $A5; // Play Audio 12-Byte 12-Byte (O)
145
SCSI_PLAYAUDMSF = $47; // Play Audio MSF (O)
146
SCSI_PLAYA_TKIN = $48; // Play Audio Track/Index (O)
147
SCSI_PLYTKREL10 = $49; // Play Track Relative 10-Byte (O)
148
SCSI_PLYTKREL12 = $A9; // Play Track Relative 12-Byte (O)
149
SCSI_READCDCAP = $25; // Read CD-ROM Capacity (MANDATORY)
150
SCSI_READHEADER = $44; // Read Header (O)
151
SCSI_SUBCHANNEL = $42; // Read Subchannel (O)
152
SCSI_READ_TOC = $43; // Read TOC (O)
154
SCSI_PAUSERESUME = $4B;
156
{ ---------------------------------------------------------------------
157
Commands Unique to Scanner Devices
158
---------------------------------------------------------------------}
160
SCSI_GETDBSTAT = $34; // Get Data Buffer Status (O)
161
SCSI_GETWINDOW = $25; // Get Window (O)
162
SCSI_OBJECTPOS = $31; // Object Postion (O)
163
SCSI_SCAN = $1B; // Scan (O)
164
SCSI_SETWINDOW = $24; // Set Window (MANDATORY)
166
{ ---------------------------------------------------------------------
167
Commands Unique to Optical Memory Devices
168
---------------------------------------------------------------------}
170
SCSI_UpdateBlk = $3D; // Update Block (O)
172
{ ---------------------------------------------------------------------
173
Commands Unique to Optical Medium Changer Devices
174
---------------------------------------------------------------------}
176
SCSI_EXCHMEDIUM = $A6; // Exchange Medium (O)
177
SCSI_INITELSTAT = $07; // Initialize Element Status (O)
178
SCSI_POSTOELEM = $2B; // Position to Element (O)
179
SCSI_REQ_VE_ADD = $B5; // Request Volume Element Address (O)
180
SCSI_SENDVOLTAG = $B6; // Send Volume Tag (O)
182
{ ---------------------------------------------------------------------
183
Commands Unique to Optical Communication Devices
184
---------------------------------------------------------------------}
186
SCSI_GET_MSG_6 = $08; // Get Message 6-Byte (MANDATORY)
187
SCSI_GET_MSG_10 = $28; // Get Message 10-Byte (O)
188
SCSI_GET_MSG_12 = $A8; // Get Message 12-Byte (O)
189
SCSI_SND_MSG_6 = $0A; // Send Message 6-Byte (MANDATORY)
190
SCSI_SND_MSG_10 = $2A; // Send Message 10-Byte (O)
191
SCSI_SND_MSG_12 = $AA; // Send Message 12-Byte (O)
193
{ ---------------------------------------------------------------------
194
Request Sense Data Format
195
---------------------------------------------------------------------}
199
SENSE_DATA_FMT = record
200
ErrorCode, // Error Code (70H or 71H)
201
SegmentNum, // Number of current segment descriptor
202
SenseKey, // Sense Key(See bit definitions too)
203
InfoByte0, // Information MSB
204
InfoByte1, // Information MID
205
InfoByte2, // Information MID
206
InfoByte3, // Information LSB
207
AddSenLen, // Additional Sense Length
208
ComSpecInf0, // Command Specific Information MSB
209
ComSpecInf1, // Command Specific Information MID
210
ComSpecInf2, // Command Specific Information MID
211
ComSpecInf3, // Command Specific Information LSB
212
AddSenseCode, // Additional Sense Code
213
AddSenQual, // Additional Sense Code Qualifier
214
FieldRepUCode, // Field Replaceable Unit Code
215
SenKeySpec15, // Sense Key Specific 15th byte
216
SenKeySpec16, // Sense Key Specific 16th byte
217
SenKeySpec17, // Sense Key Specific 17th byte
218
AddSenseBytes : BYTE; // Additional Sense Bytes
221
TSENSE_DATA_FMT = SENSE_DATA_FMT;
222
PSENSE_DATA_FMT = ^SENSE_DATA_FMT;
224
{ ---------------------------------------------------------------------
225
REQUEST SENSE ERROR CODE
226
---------------------------------------------------------------------}
230
SERROR_CURRENT = $70; // Current Errors
231
SERROR_DEFERED = $71; // Deferred Errors
233
{ ---------------------------------------------------------------------
234
REQUEST SENSE BIT DEFINITIONS
235
---------------------------------------------------------------------}
237
SENSE_VALID = $80; // Byte 0 Bit 7
238
SENSE_FILEMRK = $80; // Byte 2 Bit 7
239
SENSE_EOM = $40; // Byte 2 Bit 6
240
SENSE_ILI = $20; // Byte 2 Bit 5
242
{ ---------------------------------------------------------------------
243
REQUEST SENSE SENSE KEY DEFINITIONS
244
---------------------------------------------------------------------}
246
KEY_NOSENSE = $00; // No Sense
247
KEY_RECERROR = $01; // Recovered Error
248
KEY_NOTREADY = $02; // Not Ready
249
KEY_MEDIUMERR = $03; // Medium Error
250
KEY_HARDERROR = $04; // Hardware Error
251
KEY_ILLGLREQ = $05; // Illegal Request
252
KEY_UNITATT = $06; // Unit Attention
253
KEY_DATAPROT = $07; // Data Protect
254
KEY_BLANKCHK = $08; // Blank Check
255
KEY_VENDSPEC = $09; // Vendor Specific
256
KEY_COPYABORT = $0A; // Copy Abort
257
KEY_EQUAL = $0C; // Equal (Search)
258
KEY_VOLOVRFLW = $0D; // Volume Overflow
259
KEY_MISCOMP = $0E; // Miscompare (Search)
260
KEY_RESERVED = $0F; // Reserved
262
{ ---------------------------------------------------------------------
263
PERIPHERAL DEVICE TYPE DEFINITIONS
264
---------------------------------------------------------------------}
266
DTYPE_DASD = $00; // Disk Device
267
DTYPE_SEQD = $01; // Tape Device
268
DTYPE_PRNT = $02; // Printer
269
DTYPE_PROC = $03; // Processor
270
DTYPE_WORM = $04; // Write-once read-multiple
271
DTYPE_CROM = $05; // CD-ROM device
272
DTYPE_CDROM = DTYPE_CROM;
273
DTYPE_SCAN = $06; // Scanner device
274
DTYPE_OPTI = $07; // Optical memory device
275
DTYPE_JUKE = $08; // Medium Changer device
276
DTYPE_COMM = $09; // Communications device
277
DTYPE_RESL = $0A; // Reserved (low)
278
DTYPE_RESH = $1E; // Reserved (high)
279
DTYPE_UNKNOWN = $1F; // Unknown or no device type
281
{ ---------------------------------------------------------------------
282
ANSI APPROVED VERSION DEFINITIONS
283
---------------------------------------------------------------------}
285
ANSI_MAYBE = $0; // Device may or may not be ANSI approved stand
286
ANSI_SCSI1 = $1; // Device complies to ANSI X3.131-1986 (SCSI-1)
287
ANSI_SCSI2 = $2; // Device complies to SCSI-2
288
ANSI_RESLO = $3; // Reserved (low)
289
ANSI_RESHI = $7; // Reserved (high)