Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


scsi.h
001: /* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
002:    This file is part of the GNU C Library.
003: 
004:    The GNU C Library is free software; you can redistribute it and/or
005:    modify it under the terms of the GNU Lesser General Public
006:    License as published by the Free Software Foundation; either
007:    version 2.1 of the License, or (at your option) any later version.
008: 
009:    The GNU C Library is distributed in the hope that it will be useful,
010:    but WITHOUT ANY WARRANTY; without even the implied warranty of
011:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:    Lesser General Public License for more details.
013: 
014:    You should have received a copy of the GNU Lesser General Public
015:    License along with the GNU C Library; if not, write to the Free
016:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
017:    02111-1307 USA.  */
018: 
019: /*
020:  * This header file contains public constants and structures used by
021:  * the scsi code for linux.
022:  */
023: 
024: #ifndef _SCSI_SCSI_H
025: #define _SCSI_SCSI_H    1
026: 
027: #include <features.h>
028: 
029: /*
030:  *      SCSI opcodes
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:  *  Status codes
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:  *  SENSE KEYS
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:  *  DEVICE TYPES
141:  */
142: 
143: #define TYPE_DISK           0x00
144: #define TYPE_TAPE           0x01
145: #define TYPE_PROCESSOR      0x03    /* HP scanners use this */
146: #define TYPE_WORM           0x04    /* Treated as ROM by our system */
147: #define TYPE_ROM            0x05
148: #define TYPE_SCANNER        0x06
149: #define TYPE_MOD            0x07    /* Magneto-optical disk -
150:                                      * - treated as TYPE_DISK */
151: #define TYPE_MEDIUM_CHANGER 0x08
152: #define TYPE_ENCLOSURE      0x0d    /* Enclosure Services Device */
153: #define TYPE_NO_LUN         0x7f
154: 
155: /*
156:  * standard mode-select header prepended to all mode-select commands
157:  *
158:  * moved here from cdrom.h -- kraxel
159:  */
160: 
161: struct ccs_modesel_head
162:   {
163:     unsigned char _r1;                  /* reserved.  */
164:     unsigned char medium;               /* device-specific medium type.  */
165:     unsigned char _r2;                  /* reserved.  */
166:     unsigned char block_desc_length;    /* block descriptor length.  */
167:     unsigned char density;              /* device-specific density code.  */
168:     unsigned char number_blocks_hi;     /* number of blocks in this block
169:                                            desc.  */
170:     unsigned char number_blocks_med;
171:     unsigned char number_blocks_lo;
172:     unsigned char _r3;
173:     unsigned char block_length_hi;      /* block length for blocks in this
174:                                            desc.  */
175:     unsigned char block_length_med;
176:     unsigned char block_length_lo;
177:   };
178: 
179: /*
180:  *  MESSAGE CODES
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    /* SCSI-I only */
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            /* SCSI-II only */
202: #define RELEASE_RECOVERY    0x10            /* SCSI-II only */
203: 
204: #define SIMPLE_QUEUE_TAG    0x20
205: #define HEAD_OF_QUEUE_TAG   0x21
206: #define ORDERED_QUEUE_TAG   0x22
207: 
208: /*
209:  * Here are some scsi specific ioctl commands which are sometimes useful.
210:  */
211: /* These are a few other constants only used by scsi devices.  */
212: 
213: #define SCSI_IOCTL_GET_IDLUN 0x5382
214: 
215: /* Used to turn on and off tagged queuing for scsi devices.  */
216: 
217: #define SCSI_IOCTL_TAGGED_ENABLE 0x5383
218: #define SCSI_IOCTL_TAGGED_DISABLE 0x5384
219: 
220: /* Used to obtain the host number of a device.  */
221: #define SCSI_IOCTL_PROBE_HOST 0x5385
222: 
223: /* Used to get the bus number for a device.  */
224: #define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
225: 
226: #endif /* scsi/scsi.h */
227: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/