scsi.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020:
021:
022:
023:
024: #ifndef _SCSI_SCSI_H
025: #define _SCSI_SCSI_H 1
026:
027: #include <features.h>
028:
029:
030:
031:
032:
033: #define TEST_UNIT_READY 0x00
034: #define REZERO_UNIT 0x01
035: #define REQUEST_SENSE 0x03
036: #define FORMAT_UNIT 0x04
037: #define READ_BLOCK_LIMITS 0x05
038: #define REASSIGN_BLOCKS 0x07
039: #define READ_6 0x08
040: #define WRITE_6 0x0a
041: #define SEEK_6 0x0b
042: #define READ_REVERSE 0x0f
043: #define WRITE_FILEMARKS 0x10
044: #define SPACE 0x11
045: #define INQUIRY 0x12
046: #define RECOVER_BUFFERED_DATA 0x14
047: #define MODE_SELECT 0x15
048: #define RESERVE 0x16
049: #define RELEASE 0x17
050: #define COPY 0x18
051: #define ERASE 0x19
052: #define MODE_SENSE 0x1a
053: #define START_STOP 0x1b
054: #define RECEIVE_DIAGNOSTIC 0x1c
055: #define SEND_DIAGNOSTIC 0x1d
056: #define ALLOW_MEDIUM_REMOVAL 0x1e
057:
058: #define SET_WINDOW 0x24
059: #define READ_CAPACITY 0x25
060: #define READ_10 0x28
061: #define WRITE_10 0x2a
062: #define SEEK_10 0x2b
063: #define WRITE_VERIFY 0x2e
064: #define VERIFY 0x2f
065: #define SEARCH_HIGH 0x30
066: #define SEARCH_EQUAL 0x31
067: #define SEARCH_LOW 0x32
068: #define SET_LIMITS 0x33
069: #define PRE_FETCH 0x34
070: #define READ_POSITION 0x34
071: #define SYNCHRONIZE_CACHE 0x35
072: #define LOCK_UNLOCK_CACHE 0x36
073: #define READ_DEFECT_DATA 0x37
074: #define MEDIUM_SCAN 0x38
075: #define COMPARE 0x39
076: #define COPY_VERIFY 0x3a
077: #define WRITE_BUFFER 0x3b
078: #define READ_BUFFER 0x3c
079: #define UPDATE_BLOCK 0x3d
080: #define READ_LONG 0x3e
081: #define WRITE_LONG 0x3f
082: #define CHANGE_DEFINITION 0x40
083: #define WRITE_SAME 0x41
084: #define READ_TOC 0x43
085: #define LOG_SELECT 0x4c
086: #define LOG_SENSE 0x4d
087: #define MODE_SELECT_10 0x55
088: #define RESERVE_10 0x56
089: #define RELEASE_10 0x57
090: #define MODE_SENSE_10 0x5a
091: #define PERSISTENT_RESERVE_IN 0x5e
092: #define PERSISTENT_RESERVE_OUT 0x5f
093: #define MOVE_MEDIUM 0xa5
094: #define READ_12 0xa8
095: #define WRITE_12 0xaa
096: #define WRITE_VERIFY_12 0xae
097: #define SEARCH_HIGH_12 0xb0
098: #define SEARCH_EQUAL_12 0xb1
099: #define SEARCH_LOW_12 0xb2
100: #define READ_ELEMENT_STATUS 0xb8
101: #define SEND_VOLUME_TAG 0xb6
102: #define WRITE_LONG_2 0xea
103:
104:
105:
106:
107:
108: #define GOOD 0x00
109: #define CHECK_CONDITION 0x01
110: #define CONDITION_GOOD 0x02
111: #define BUSY 0x04
112: #define INTERMEDIATE_GOOD 0x08
113: #define INTERMEDIATE_C_GOOD 0x0a
114: #define RESERVATION_CONFLICT 0x0c
115: #define COMMAND_TERMINATED 0x11
116: #define QUEUE_FULL 0x14
117:
118: #define STATUS_MASK 0x3e
119:
120:
121:
122:
123:
124: #define NO_SENSE 0x00
125: #define RECOVERED_ERROR 0x01
126: #define NOT_READY 0x02
127: #define MEDIUM_ERROR 0x03
128: #define HARDWARE_ERROR 0x04
129: #define ILLEGAL_REQUEST 0x05
130: #define UNIT_ATTENTION 0x06
131: #define DATA_PROTECT 0x07
132: #define BLANK_CHECK 0x08
133: #define COPY_ABORTED 0x0a
134: #define ABORTED_COMMAND 0x0b
135: #define VOLUME_OVERFLOW 0x0d
136: #define MISCOMPARE 0x0e
137:
138:
139:
140:
141:
142:
143: #define TYPE_DISK 0x00
144: #define TYPE_TAPE 0x01
145: #define TYPE_PROCESSOR 0x03
146: #define TYPE_WORM 0x04
147: #define TYPE_ROM 0x05
148: #define TYPE_SCANNER 0x06
149: #define TYPE_MOD 0x07
150:
151: #define TYPE_MEDIUM_CHANGER 0x08
152: #define TYPE_ENCLOSURE 0x0d
153: #define TYPE_NO_LUN 0x7f
154:
155:
156:
157:
158:
159:
160:
161: struct ccs_modesel_head
162: {
163: unsigned char _r1;
164: unsigned char medium;
165: unsigned char _r2;
166: unsigned char block_desc_length;
167: unsigned char density;
168: unsigned char number_blocks_hi;
169:
170: unsigned char number_blocks_med;
171: unsigned char number_blocks_lo;
172: unsigned char _r3;
173: unsigned char block_length_hi;
174:
175: unsigned char block_length_med;
176: unsigned char block_length_lo;
177: };
178:
179:
180:
181:
182:
183: #define COMMAND_COMPLETE 0x00
184: #define EXTENDED_MESSAGE 0x01
185: #define EXTENDED_MODIFY_DATA_POINTER 0x00
186: #define EXTENDED_SDTR 0x01
187: #define EXTENDED_EXTENDED_IDENTIFY 0x02
188: #define EXTENDED_WDTR 0x03
189: #define SAVE_POINTERS 0x02
190: #define RESTORE_POINTERS 0x03
191: #define DISCONNECT 0x04
192: #define INITIATOR_ERROR 0x05
193: #define ABORT 0x06
194: #define MESSAGE_REJECT 0x07
195: #define NOP 0x08
196: #define MSG_PARITY_ERROR 0x09
197: #define LINKED_CMD_COMPLETE 0x0a
198: #define LINKED_FLG_CMD_COMPLETE 0x0b
199: #define BUS_DEVICE_RESET 0x0c
200:
201: #define INITIATE_RECOVERY 0x0f
202: #define RELEASE_RECOVERY 0x10
203:
204: #define SIMPLE_QUEUE_TAG 0x20
205: #define HEAD_OF_QUEUE_TAG 0x21
206: #define ORDERED_QUEUE_TAG 0x22
207:
208:
209:
210:
211:
212:
213: #define SCSI_IOCTL_GET_IDLUN 0x5382
214:
215:
216:
217: #define SCSI_IOCTL_TAGGED_ENABLE 0x5383
218: #define SCSI_IOCTL_TAGGED_DISABLE 0x5384
219:
220:
221: #define SCSI_IOCTL_PROBE_HOST 0x5385
222:
223:
224: #define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
225:
226: #endif
227:
© Andrew Scott 2006 -
2025,
All Rights Reserved