/[pearpc]/src/io/ide/scsicmds.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /src/io/ide/scsicmds.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Wed Sep 5 17:11:21 2007 UTC (16 years, 7 months ago) by dpavlin
File MIME type: text/plain
File size: 10835 byte(s)
import upstream CVS
1 //
2 //
3 // This file was copied from bochs IA-32 emulator
4 // Original comment:
5 //
6 // > This file was copied from ... ?
7 //
8 // A few commands were added
9
10 //***************************************************************************
11 // %%% TARGET STATUS VALUES %%%
12 //***************************************************************************
13 #define SCSI_STATUS_GOOD 0x00 // Status Good
14 #define SCSI_STATUS_CHKCOND 0x02 // Check Condition
15 #define SCSI_STATUS_CONDMET 0x04 // Condition Met
16 #define SCSI_STATUS_BUSY 0x08 // Busy
17 #define SCSI_STATUS_INTERM 0x10 // Intermediate
18 #define SCSI_STATUS_INTCDMET 0x14 // Intermediate-condition met
19 #define SCSI_STATUS_RESCONF 0x18 // Reservation conflict
20 #define SCSI_STATUS_COMTERM 0x22 // Command Terminated
21 #define SCSI_STATUS_QFULL 0x28 // Queue full
22
23 //***************************************************************************
24 // %%% SCSI MISCELLANEOUS EQUATES %%%
25 //***************************************************************************
26 #define MAXLUN 7 // Maximum Logical Unit Id
27 #define MAXTARG 7 // Maximum Target Id
28 #define MAX_SCSI_LUNS 64 // Maximum Number of SCSI LUNs
29 #define MAX_NUM_HA 8 // Maximum Number of SCSI HA's
30
31
32 //***************************************************************************
33 // %%% SCSI COMMAND DIRECTIONS %%%
34 //***************************************************************************
35 #define SCSI_CMD_DIR_IN 1
36 #define SCSI_CMD_DIR_OUT 2
37
38 //***************************************************************************
39 // %%% CDROM COMMAND PARAMETERS %%%
40 //***************************************************************************
41 #define SCSI_TRAYLOCK_LOCKED 0x01 // Lock the tray
42 #define SCSI_TRAYLOCK_UNLOCKED 0x00 // Unlock the tray
43 #define SCSI_EJECTTRAY_LOAD 0x03 // Close the drive's tray
44 #define SCSI_EJECTTRAY_UNLOAD 0x02 // Open the drive's tray
45
46 //***************************************************************************
47 // %%% SCSI MISCELLANEOUS EQUATES %%%
48 //***************************************************************************
49
50
51 //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
52 //
53 // %%% SCSI COMMAND OPCODES %%%
54 //
55 ///\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
56
57 //***************************************************************************
58 // %%% Commands for all Device Types %%%
59 //***************************************************************************
60 #define SCSI_CHANGE_DEF 0x40 // Change Definition (Optional)
61 #define SCSI_COMPARE 0x39 // Compare (O)
62 #define SCSI_COPY 0x18 // Copy (O)
63 #define SCSI_COP_VERIFY 0x3A // Copy and Verify (O)
64 #define SCSI_INQUIRY 0x12 // Inquiry (MANDATORY)
65 #define SCSI_LOG_SELECT 0x4C // Log Select (O)
66 #define SCSI_LOG_SENSE 0x4D // Log Sense (O)
67 #define SCSI_MODE_SEL6 0x15 // Mode Select 6-byte (Device Specific)
68 #define SCSI_MODE_SEL10 0x55 // Mode Select 10-byte (Device Specific)
69 #define SCSI_MODE_SEN6 0x1A // Mode Sense 6-byte (Device Specific)
70 #define SCSI_MODE_SEN10 0x5A // Mode Sense 10-byte (Device Specific)
71 #define SCSI_READ_BUFF 0x3C // Read Buffer (O)
72 #define SCSI_REQ_SENSE 0x03 // Request Sense (MANDATORY)
73 #define SCSI_SEND_DIAG 0x1D // Send Diagnostic (O)
74 #define SCSI_TST_U_RDY 0x00 // Test Unit Ready (MANDATORY)
75 #define SCSI_WRITE_BUFF 0x3B // Write Buffer (O)
76
77 //***************************************************************************
78 // %%% Commands Unique to Direct Access Devices %%%
79 //***************************************************************************
80 #define SCSI_COMPARE 0x39 // Compare (O)
81 #define SCSI_FORMAT 0x04 // Format Unit (MANDATORY)
82 #define SCSI_LCK_UN_CAC 0x36 // Lock Unlock Cache (O)
83 #define SCSI_PREFETCH 0x34 // Prefetch (O)
84 #define SCSI_MED_REMOVL 0x1E // Prevent/Allow medium Removal (O)
85 #define SCSI_READ6 0x08 // Read 6-byte (MANDATORY)
86 #define SCSI_READ10 0x28 // Read 10-byte (MANDATORY)
87 #define SCSI_RD_CAPAC 0x25 // Read Capacity (MANDATORY)
88 #define SCSI_RD_DEFECT 0x37 // Read Defect Data (O)
89 #define SCSI_READ_LONG 0x3E // Read Long (O)
90 #define SCSI_REASS_BLK 0x07 // Reassign Blocks (O)
91 #define SCSI_RCV_DIAG 0x1C // Receive Diagnostic Results (O)
92 #define SCSI_RELEASE 0x17 // Release Unit (MANDATORY)
93 #define SCSI_REZERO 0x01 // Rezero Unit (O)
94 #define SCSI_SRCH_DAT_E 0x31 // Search Data Equal (O)
95 #define SCSI_SRCH_DAT_H 0x30 // Search Data High (O)
96 #define SCSI_SRCH_DAT_L 0x32 // Search Data Low (O)
97 #define SCSI_SEEK6 0x0B // Seek 6-Byte (O)
98 #define SCSI_SEEK10 0x2B // Seek 10-Byte (O)
99 #define SCSI_SEND_DIAG 0x1D // Send Diagnostics (MANDATORY)
100 #define SCSI_SET_LIMIT 0x33 // Set Limits (O)
101 #define SCSI_START_STP 0x1B // Start/Stop Unit (O)
102 #define SCSI_SYNC_CACHE 0x35 // Synchronize Cache (O)
103 #define SCSI_VERIFY 0x2F // Verify (O)
104 #define SCSI_WRITE6 0x0A // Write 6-Byte (MANDATORY)
105 #define SCSI_WRITE10 0x2A // Write 10-Byte (MANDATORY)
106 #define SCSI_WRT_VERIFY 0x2E // Write and Verify (O)
107 #define SCSI_WRITE_LONG 0x3F // Write Long (O)
108 #define SCSI_WRITE_SAME 0x41 // Write Same (O)
109
110 //***************************************************************************
111 // %%% Commands Unique to Sequential Access Devices %%%
112 //***************************************************************************
113 #define SCSI_ERASE 0x19 // Erase (MANDATORY)
114 #define SCSI_LOAD_UN 0x1B // Load/Unload (O)
115 #define SCSI_LOCATE 0x2B // Locate (O)
116 #define SCSI_RD_BLK_LIM 0x05 // Read Block Limits (MANDATORY)
117 #define SCSI_READ_POS 0x34 // Read Position (O)
118 #define SCSI_READ_REV 0x0F // Read Reverse (O)
119 #define SCSI_REC_BF_DAT 0x14 // Recover Buffer Data (O)
120 #define SCSI_RESERVE 0x16 // Reserve Unit (MANDATORY)
121 #define SCSI_REWIND 0x01 // Rewind (MANDATORY)
122 #define SCSI_SPACE 0x11 // Space (MANDATORY)
123 #define SCSI_VERIFY_T 0x13 // Verify (Tape) (O)
124 #define SCSI_WRT_FILE 0x10 // Write Filemarks (MANDATORY)
125
126 //***************************************************************************
127 // %%% Commands Unique to Printer Devices %%%
128 //***************************************************************************
129 #define SCSI_PRINT 0x0A // Print (MANDATORY)
130 #define SCSI_SLEW_PNT 0x0B // Slew and Print (O)
131 #define SCSI_STOP_PNT 0x1B // Stop Print (O)
132 #define SCSI_SYNC_BUFF 0x10 // Synchronize Buffer (O)
133
134 //***************************************************************************
135 // %%% Commands Unique to Processor Devices %%%
136 //***************************************************************************
137 #define SCSI_RECEIVE 0x08 // Receive (O)
138 #define SCSI_SEND 0x0A // Send (O)
139
140 //***************************************************************************
141 // %%% Commands Unique to Write-Once Devices %%%
142 //***************************************************************************
143 #define SCSI_MEDIUM_SCN 0x38 // Medium Scan (O)
144 #define SCSI_SRCHDATE10 0x31 // Search Data Equal 10-Byte (O)
145 #define SCSI_SRCHDATE12 0xB1 // Search Data Equal 12-Byte (O)
146 #define SCSI_SRCHDATH10 0x30 // Search Data High 10-Byte (O)
147 #define SCSI_SRCHDATH12 0xB0 // Search Data High 12-Byte (O)
148 #define SCSI_SRCHDATL10 0x32 // Search Data Low 10-Byte (O)
149 #define SCSI_SRCHDATL12 0xB2 // Search Data Low 12-Byte (O)
150 #define SCSI_SET_LIM_10 0x33 // Set Limits 10-Byte (O)
151 #define SCSI_SET_LIM_12 0xB3 // Set Limits 10-Byte (O)
152 #define SCSI_VERIFY10 0x2F // Verify 10-Byte (O)
153 #define SCSI_VERIFY12 0xAF // Verify 12-Byte (O)
154 #define SCSI_WRITE12 0xAA // Write 12-Byte (O)
155 #define SCSI_WRT_VER10 0x2E // Write and Verify 10-Byte (O)
156 #define SCSI_WRT_VER12 0xAE // Write and Verify 12-Byte (O)
157
158 //***************************************************************************
159 // %%% Commands Unique to CD-ROM Devices %%%
160 //***************************************************************************
161 #define SCSI_PLAYAUD_10 0x45 // Play Audio 10-Byte (O)
162 #define SCSI_PLAYAUD_12 0xA5 // Play Audio 12-Byte 12-Byte (O)
163 #define SCSI_PLAYAUDMSF 0x47 // Play Audio MSF (O)
164 #define SCSI_PLAYA_TKIN 0x48 // Play Audio Track/Index (O)
165 #define SCSI_PLYTKREL10 0x49 // Play Track Relative 10-Byte (O)
166 #define SCSI_PLYTKREL12 0xA9 // Play Track Relative 12-Byte (O)
167 #define SCSI_READCDCAP 0x25 // Read CD-ROM Capacity (MANDATORY)
168 #define SCSI_READHEADER 0x44 // Read Header (O)
169 #define SCSI_SUBCHANNEL 0x42 // Read Subchannel (O)
170 #define SCSI_READ_TOC 0x43 // Read TOC (O)
171 #define SCSI_TRAYLOCK 0x1E // Lock the drive's tray
172 #define SCSI_UNITREADY 0x00 // Medium state of the drive
173 #define SCSI_EJECTTRAY 0x1B // Ejects the drive's tray
174
175 //***************************************************************************
176 // %%% Commands Unique to Scanner Devices %%%
177 //***************************************************************************
178 #define SCSI_GETDBSTAT 0x34 // Get Data Buffer Status (O)
179 #define SCSI_GETWINDOW 0x25 // Get Window (O)
180 #define SCSI_OBJECTPOS 0x31 // Object Postion (O)
181 #define SCSI_SCAN 0x1B // Scan (O)
182 #define SCSI_SETWINDOW 0x24 // Set Window (MANDATORY)
183
184 //***************************************************************************
185 // %%% Commands Unique to Optical Memory Devices %%%
186 //***************************************************************************
187 #define SCSI_UpdateBlk 0x3D // Update Block (O)
188
189 //***************************************************************************
190 // %%% Commands Unique to Medium Changer Devices %%%
191 //***************************************************************************
192 #define SCSI_EXCHMEDIUM 0xA6 // Exchange Medium (O)
193 #define SCSI_INITELSTAT 0x07 // Initialize Element Status (O)
194 #define SCSI_POSTOELEM 0x2B // Position to Element (O)
195 #define SCSI_REQ_VE_ADD 0xB5 // Request Volume Element Address (O)
196 #define SCSI_SENDVOLTAG 0xB6 // Send Volume Tag (O)
197
198 //***************************************************************************
199 // %%% Commands Unique to Communication Devices %%%
200 //***************************************************************************
201 #define SCSI_GET_MSG_6 0x08 // Get Message 6-byte (MANDATORY)
202 #define SCSI_GET_MSG_10 0x28 // Get Message 10-byte (O)
203 #define SCSI_GET_MSG_12 0xA8 // Get Message 12-byte (O)
204 #define SCSI_SND_MSG_6 0x0A // Send Message 6-byte (MANDATORY)
205 #define SCSI_SND_MSG_10 0x2A // Send Message 10-byte (O)
206 #define SCSI_SND_MSG_12 0xAA // Send Message 12-byte (O)
207
208 //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
209 //
210 // %%% END OF SCSI COMMAND OPCODES %%%
211 //
212 ///\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

  ViewVC Help
Powered by ViewVC 1.1.26