5 * This header file contains public constants and structures used by
6 * the scsi code for linux.
10 $Header: /usr/src/linux/include/linux/RCS/scsi.h,v 1.3 1993/09/24 12:20:33 drew Exp $
12 For documentation on the OPCODES, MESSAGES, and SENSE values,
13 please consult the SCSI standard.
21 #define TEST_UNIT_READY 0x00
22 #define REZERO_UNIT 0x01
23 #define REQUEST_SENSE 0x03
24 #define FORMAT_UNIT 0x04
25 #define READ_BLOCK_LIMITS 0x05
26 #define REASSIGN_BLOCKS 0x07
30 #define READ_REVERSE 0x0f
31 #define WRITE_FILEMARKS 0x10
34 #define RECOVER_BUFFERED_DATA 0x14
35 #define MODE_SELECT 0x15
40 #define MODE_SENSE 0x1a
41 #define START_STOP 0x1b
42 #define RECEIVE_DIAGNOSTIC 0x1c
43 #define SEND_DIAGNOSTIC 0x1d
44 #define ALLOW_MEDIUM_REMOVAL 0x1e
46 #define SET_WINDOW 0x24
47 #define READ_CAPACITY 0x25
51 #define WRITE_VERIFY 0x2e
53 #define SEARCH_HIGH 0x30
54 #define SEARCH_EQUAL 0x31
55 #define SEARCH_LOW 0x32
56 #define SET_LIMITS 0x33
57 #define PRE_FETCH 0x34
58 #define READ_POSITION 0x34
59 #define SYNCHRONIZE_CACHE 0x35
60 #define LOCK_UNLOCK_CACHE 0x36
61 #define READ_DEFECT_DATA 0x37
62 #define MEDIUM_SCAN 0x38
64 #define COPY_VERIFY 0x3a
65 #define WRITE_BUFFER 0x3b
66 #define READ_BUFFER 0x3c
67 #define UPDATE_BLOCK 0x3d
68 #define READ_LONG 0x3e
69 #define WRITE_LONG 0x3f
70 #define CHANGE_DEFINITION 0x40
71 #define WRITE_SAME 0x41
73 #define LOG_SELECT 0x4c
74 #define LOG_SENSE 0x4d
75 #define MODE_SELECT_10 0x55
76 #define MODE_SENSE_10 0x5a
77 #define MOVE_MEDIUM 0xa5
80 #define WRITE_VERIFY_12 0xae
81 #define SEARCH_HIGH_12 0xb0
82 #define SEARCH_EQUAL_12 0xb1
83 #define SEARCH_LOW_12 0xb2
84 #define READ_ELEMENT_STATUS 0xb8
85 #define SEND_VOLUME_TAG 0xb6
86 #define WRITE_LONG_2 0xea
93 #define CHECK_CONDITION 0x01
94 #define CONDITION_GOOD 0x02
96 #define INTERMEDIATE_GOOD 0x08
97 #define INTERMEDIATE_C_GOOD 0x0a
98 #define RESERVATION_CONFLICT 0x0c
99 #define COMMAND_TERMINATED 0x11
100 #define QUEUE_FULL 0x14
102 #define STATUS_MASK 0x3e
108 #define NO_SENSE 0x00
109 #define RECOVERED_ERROR 0x01
110 #define NOT_READY 0x02
111 #define MEDIUM_ERROR 0x03
112 #define HARDWARE_ERROR 0x04
113 #define ILLEGAL_REQUEST 0x05
114 #define UNIT_ATTENTION 0x06
115 #define DATA_PROTECT 0x07
116 #define BLANK_CHECK 0x08
117 #define COPY_ABORTED 0x0a
118 #define ABORTED_COMMAND 0x0b
119 #define VOLUME_OVERFLOW 0x0d
120 #define MISCOMPARE 0x0e
127 #define TYPE_DISK 0x00
128 #define TYPE_TAPE 0x01
129 #define TYPE_PROCESSOR 0x03 /* HP scanners use this */
130 #define TYPE_WORM 0x04 /* Treated as ROM by our system */
131 #define TYPE_ROM 0x05
132 #define TYPE_SCANNER 0x06
133 #define TYPE_MOD 0x07 /* Magneto-optical disk -
134 * - treated as TYPE_DISK */
135 #define TYPE_MEDIUM_CHANGER 0x08
136 #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
137 #define TYPE_NO_LUN 0x7f
140 * standard mode-select header prepended to all mode-select commands
142 * moved here from cdrom.h -- kraxel
145 struct ccs_modesel_head
147 u_char _r1
; /* reserved */
148 u_char medium
; /* device-specific medium type */
149 u_char _r2
; /* reserved */
150 u_char block_desc_length
; /* block descriptor length */
151 u_char density
; /* device-specific density code */
152 u_char number_blocks_hi
; /* number of blocks in this block desc */
153 u_char number_blocks_med
;
154 u_char number_blocks_lo
;
156 u_char block_length_hi
; /* block length for blocks in this desc */
157 u_char block_length_med
;
158 u_char block_length_lo
;
165 #define COMMAND_COMPLETE 0x00
166 #define EXTENDED_MESSAGE 0x01
167 #define EXTENDED_MODIFY_DATA_POINTER 0x00
168 #define EXTENDED_SDTR 0x01
169 #define EXTENDED_EXTENDED_IDENTIFY 0x02 /* SCSI-I only */
170 #define EXTENDED_WDTR 0x03
171 #define SAVE_POINTERS 0x02
172 #define RESTORE_POINTERS 0x03
173 #define DISCONNECT 0x04
174 #define INITIATOR_ERROR 0x05
176 #define MESSAGE_REJECT 0x07
178 #define MSG_PARITY_ERROR 0x09
179 #define LINKED_CMD_COMPLETE 0x0a
180 #define LINKED_FLG_CMD_COMPLETE 0x0b
181 #define BUS_DEVICE_RESET 0x0c
183 #define INITIATE_RECOVERY 0x0f /* SCSI-II only */
184 #define RELEASE_RECOVERY 0x10 /* SCSI-II only */
186 #define SIMPLE_QUEUE_TAG 0x20
187 #define HEAD_OF_QUEUE_TAG 0x21
188 #define ORDERED_QUEUE_TAG 0x22
191 * Here are some scsi specific ioctl commands which are sometimes useful.
193 /* These are a few other constants only used by scsi devices */
195 #define SCSI_IOCTL_GET_IDLUN 0x5382
197 /* Used to turn on and off tagged queuing for scsi devices */
199 #define SCSI_IOCTL_TAGGED_ENABLE 0x5383
200 #define SCSI_IOCTL_TAGGED_DISABLE 0x5384
202 /* Used to obtain the host number of a device. */
203 #define SCSI_IOCTL_PROBE_HOST 0x5385
205 /* Used to get the bus number for a device */
206 #define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
209 * Overrides for Emacs so that we follow Linus's tabbing style.
210 * Emacs will notice this stuff at the end of the file and automatically
211 * adjust the settings for this buffer only. This must remain at the end
213 * ---------------------------------------------------------------------------
216 * c-brace-imaginary-offset: 0
218 * c-argdecl-indent: 4
220 * c-continued-statement-offset: 4
221 * c-continued-brace-offset: 0
222 * indent-tabs-mode: nil