1c2c66affSColin Finck /*
2c2c66affSColin Finck * storport.h
3c2c66affSColin Finck *
4c2c66affSColin Finck * StorPort interface
5c2c66affSColin Finck *
6c2c66affSColin Finck * This file is part of the w32api package.
7c2c66affSColin Finck *
8c2c66affSColin Finck * Contributors:
9c2c66affSColin Finck * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10c2c66affSColin Finck *
11c2c66affSColin Finck * THIS SOFTWARE IS NOT COPYRIGHTED
12c2c66affSColin Finck *
13c2c66affSColin Finck * This source code is offered for use in the public domain. You may
14c2c66affSColin Finck * use, modify or distribute it freely.
15c2c66affSColin Finck *
16c2c66affSColin Finck * This code is distributed in the hope that it will be useful but
17c2c66affSColin Finck * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18c2c66affSColin Finck * DISCLAIMED. This includes but is not limited to warranties of
19c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20c2c66affSColin Finck *
21c2c66affSColin Finck */
22c2c66affSColin Finck
23*0fbd5edaSHermès Bélusca-Maïto #ifdef _NTSCSI_
24*0fbd5edaSHermès Bélusca-Maïto #error STORPORT.H must be included instead of SCSI.H
25*0fbd5edaSHermès Bélusca-Maïto #endif
26*0fbd5edaSHermès Bélusca-Maïto
27*0fbd5edaSHermès Bélusca-Maïto #ifdef _NTSRB_
28*0fbd5edaSHermès Bélusca-Maïto #error STORPORT.H must be included instead of SRB.H
29*0fbd5edaSHermès Bélusca-Maïto #endif
30*0fbd5edaSHermès Bélusca-Maïto
31c2c66affSColin Finck #ifndef _NTSTORPORT_
32c2c66affSColin Finck #define _NTSTORPORT_
33c2c66affSColin Finck
34c2c66affSColin Finck #ifdef __cplusplus
35c2c66affSColin Finck extern "C" {
36c2c66affSColin Finck #endif
37c2c66affSColin Finck
38*0fbd5edaSHermès Bélusca-Maïto //
39*0fbd5edaSHermès Bélusca-Maïto // Common definitions with SRB.H
40*0fbd5edaSHermès Bélusca-Maïto //
41*0fbd5edaSHermès Bélusca-Maïto
42*0fbd5edaSHermès Bélusca-Maïto /* NOTE: the current SCSI_MAXIMUM_TARGETS_PER_BUS is applicable
43*0fbd5edaSHermès Bélusca-Maïto * only on scsiport miniports. For storport miniports, the max
44*0fbd5edaSHermès Bélusca-Maïto * target supported is 255. */
45*0fbd5edaSHermès Bélusca-Maïto #if (NTDDI_VERSION >= NTDDI_WIN8)
46*0fbd5edaSHermès Bélusca-Maïto #define SCSI_MAXIMUM_BUSES_PER_ADAPTER 255
47*0fbd5edaSHermès Bélusca-Maïto #endif
48*0fbd5edaSHermès Bélusca-Maïto #define SCSI_MAXIMUM_TARGETS_PER_BUS 128
49*0fbd5edaSHermès Bélusca-Maïto #define SCSI_MAXIMUM_LUNS_PER_TARGET 255
50*0fbd5edaSHermès Bélusca-Maïto #define SCSI_MINIMUM_PHYSICAL_BREAKS 16
51*0fbd5edaSHermès Bélusca-Maïto #define SCSI_MAXIMUM_PHYSICAL_BREAKS 255
52*0fbd5edaSHermès Bélusca-Maïto
53*0fbd5edaSHermès Bélusca-Maïto /* These constants are for backward compatibility.
54*0fbd5edaSHermès Bélusca-Maïto * They used to be the maximum supported. */
55*0fbd5edaSHermès Bélusca-Maïto #define SCSI_MAXIMUM_BUSES 8
56*0fbd5edaSHermès Bélusca-Maïto #define SCSI_MAXIMUM_TARGETS 8
57*0fbd5edaSHermès Bélusca-Maïto #define SCSI_MAXIMUM_LOGICAL_UNITS 8
58*0fbd5edaSHermès Bélusca-Maïto
59*0fbd5edaSHermès Bélusca-Maïto /* PORT_CONFIGURATION_INFORMATION.Dma64BitAddresses constants */
60*0fbd5edaSHermès Bélusca-Maïto #define SCSI_DMA64_MINIPORT_SUPPORTED 0x01
61*0fbd5edaSHermès Bélusca-Maïto #define SCSI_DMA64_SYSTEM_SUPPORTED 0x80
62*0fbd5edaSHermès Bélusca-Maïto #if (NTDDI_VERSION > NTDDI_WS03SP1)
63*0fbd5edaSHermès Bélusca-Maïto #define SCSI_DMA64_MINIPORT_FULL64BIT_SUPPORTED 0x02
64*0fbd5edaSHermès Bélusca-Maïto #endif
65*0fbd5edaSHermès Bélusca-Maïto
66*0fbd5edaSHermès Bélusca-Maïto #define SP_UNINITIALIZED_VALUE ((ULONG) ~0)
67*0fbd5edaSHermès Bélusca-Maïto #define SP_UNTAGGED ((UCHAR) ~0)
68*0fbd5edaSHermès Bélusca-Maïto
69*0fbd5edaSHermès Bélusca-Maïto // End of common definitions with SRB.H
70*0fbd5edaSHermès Bélusca-Maïto
71*0fbd5edaSHermès Bélusca-Maïto
72c2c66affSColin Finck #if defined(_STORPORT_)
73c2c66affSColin Finck #define STORPORT_API
74c2c66affSColin Finck #else
75c2c66affSColin Finck #define STORPORT_API DECLSPEC_IMPORT
76c2c66affSColin Finck #endif
77c2c66affSColin Finck
78c2c66affSColin Finck #define DIRECT_ACCESS_DEVICE 0x00
79c2c66affSColin Finck #define SEQUENTIAL_ACCESS_DEVICE 0x01
80c2c66affSColin Finck #define PRINTER_DEVICE 0x02
81c2c66affSColin Finck #define PROCESSOR_DEVICE 0x03
82c2c66affSColin Finck #define WRITE_ONCE_READ_MULTIPLE_DEVICE 0x04
83c2c66affSColin Finck #define READ_ONLY_DIRECT_ACCESS_DEVICE 0x05
84c2c66affSColin Finck #define SCANNER_DEVICE 0x06
85c2c66affSColin Finck #define OPTICAL_DEVICE 0x07
86c2c66affSColin Finck #define MEDIUM_CHANGER 0x08
87c2c66affSColin Finck #define COMMUNICATION_DEVICE 0x09
88c2c66affSColin Finck #define ARRAY_CONTROLLER_DEVICE 0x0C
89c2c66affSColin Finck #define SCSI_ENCLOSURE_DEVICE 0x0D
90c2c66affSColin Finck #define REDUCED_BLOCK_DEVICE 0x0E
91c2c66affSColin Finck #define OPTICAL_CARD_READER_WRITER_DEVICE 0x0F
92c2c66affSColin Finck #define BRIDGE_CONTROLLER_DEVICE 0x10
93c2c66affSColin Finck #define OBJECT_BASED_STORAGE_DEVICE 0x11
94c2c66affSColin Finck #define LOGICAL_UNIT_NOT_PRESENT_DEVICE 0x7F
95c2c66affSColin Finck
96c2c66affSColin Finck #define DEVICE_CONNECTED 0x00
97c2c66affSColin Finck
98c2c66affSColin Finck #define CDB6GENERIC_LENGTH 6
99c2c66affSColin Finck #define CDB10GENERIC_LENGTH 10
100c2c66affSColin Finck #define CDB12GENERIC_LENGTH 12
101c2c66affSColin Finck
102c2c66affSColin Finck #define INQUIRYDATABUFFERSIZE 36
103f7c01906SEric Kohl #define SENSE_BUFFER_SIZE 18
104f7c01906SEric Kohl #define MAX_SENSE_BUFFER_SIZE 255
105f7c01906SEric Kohl
106f7c01906SEric Kohl #define FILE_DEVICE_SCSI 0x0000001b
107f7c01906SEric Kohl #define IOCTL_SCSI_EXECUTE_IN ((FILE_DEVICE_SCSI << 16) + 0x0011)
108f7c01906SEric Kohl #define IOCTL_SCSI_EXECUTE_OUT ((FILE_DEVICE_SCSI << 16) + 0x0012)
109f7c01906SEric Kohl #define IOCTL_SCSI_EXECUTE_NONE ((FILE_DEVICE_SCSI << 16) + 0x0013)
110c2c66affSColin Finck
111c2c66affSColin Finck #define MODE_PAGE_VENDOR_SPECIFIC 0x00
112c2c66affSColin Finck #define MODE_PAGE_ERROR_RECOVERY 0x01
113c2c66affSColin Finck #define MODE_PAGE_DISCONNECT 0x02
114c2c66affSColin Finck #define MODE_PAGE_FORMAT_DEVICE 0x03
115c2c66affSColin Finck #define MODE_PAGE_MRW 0x03
116c2c66affSColin Finck #define MODE_PAGE_RIGID_GEOMETRY 0x04
117c2c66affSColin Finck #define MODE_PAGE_FLEXIBILE 0x05
118c2c66affSColin Finck #define MODE_PAGE_WRITE_PARAMETERS 0x05
119c2c66affSColin Finck #define MODE_PAGE_VERIFY_ERROR 0x07
120c2c66affSColin Finck #define MODE_PAGE_CACHING 0x08
121c2c66affSColin Finck #define MODE_PAGE_PERIPHERAL 0x09
122c2c66affSColin Finck #define MODE_PAGE_CONTROL 0x0A
123c2c66affSColin Finck #define MODE_PAGE_MEDIUM_TYPES 0x0B
124c2c66affSColin Finck #define MODE_PAGE_NOTCH_PARTITION 0x0C
125c2c66affSColin Finck #define MODE_PAGE_CD_AUDIO_CONTROL 0x0E
126c2c66affSColin Finck #define MODE_PAGE_DATA_COMPRESS 0x0F
127c2c66affSColin Finck #define MODE_PAGE_DEVICE_CONFIG 0x10
128c2c66affSColin Finck #define MODE_PAGE_XOR_CONTROL 0x10
129c2c66affSColin Finck #define MODE_PAGE_MEDIUM_PARTITION 0x11
130c2c66affSColin Finck #define MODE_PAGE_ENCLOSURE_SERVICES_MANAGEMENT 0x14
131c2c66affSColin Finck #define MODE_PAGE_EXTENDED 0x15
132c2c66affSColin Finck #define MODE_PAGE_EXTENDED_DEVICE_SPECIFIC 0x16
133c2c66affSColin Finck #define MODE_PAGE_CDVD_FEATURE_SET 0x18
134c2c66affSColin Finck #define MODE_PAGE_PROTOCOL_SPECIFIC_LUN 0x18
135c2c66affSColin Finck #define MODE_PAGE_PROTOCOL_SPECIFIC_PORT 0x19
136c2c66affSColin Finck #define MODE_PAGE_POWER_CONDITION 0x1A
137c2c66affSColin Finck #define MODE_PAGE_LUN_MAPPING 0x1B
138c2c66affSColin Finck #define MODE_PAGE_FAULT_REPORTING 0x1C
139c2c66affSColin Finck #define MODE_PAGE_CDVD_INACTIVITY 0x1D
140c2c66affSColin Finck #define MODE_PAGE_ELEMENT_ADDRESS 0x1D
141c2c66affSColin Finck #define MODE_PAGE_TRANSPORT_GEOMETRY 0x1E
142c2c66affSColin Finck #define MODE_PAGE_DEVICE_CAPABILITIES 0x1F
143c2c66affSColin Finck #define MODE_PAGE_CAPABILITIES 0x2A
144c2c66affSColin Finck #define MODE_SENSE_RETURN_ALL 0x3F
145c2c66affSColin Finck
146c2c66affSColin Finck #define MODE_SENSE_CURRENT_VALUES 0x00
147c2c66affSColin Finck #define MODE_SENSE_CHANGEABLE_VALUES 0x40
148c2c66affSColin Finck #define MODE_SENSE_DEFAULT_VAULES 0x80
149c2c66affSColin Finck #define MODE_SENSE_SAVED_VALUES 0xc0
150c2c66affSColin Finck
151c2c66affSColin Finck #define SCSIOP_TEST_UNIT_READY 0x00
152c2c66affSColin Finck #define SCSIOP_REZERO_UNIT 0x01
153c2c66affSColin Finck #define SCSIOP_REWIND 0x01
154c2c66affSColin Finck #define SCSIOP_REQUEST_BLOCK_ADDR 0x02
155c2c66affSColin Finck #define SCSIOP_REQUEST_SENSE 0x03
156c2c66affSColin Finck #define SCSIOP_FORMAT_UNIT 0x04
157c2c66affSColin Finck #define SCSIOP_READ_BLOCK_LIMITS 0x05
158c2c66affSColin Finck #define SCSIOP_REASSIGN_BLOCKS 0x07
159c2c66affSColin Finck #define SCSIOP_INIT_ELEMENT_STATUS 0x07
160c2c66affSColin Finck #define SCSIOP_READ6 0x08
161c2c66affSColin Finck #define SCSIOP_RECEIVE 0x08
162c2c66affSColin Finck #define SCSIOP_WRITE6 0x0A
163c2c66affSColin Finck #define SCSIOP_PRINT 0x0A
164c2c66affSColin Finck #define SCSIOP_SEND 0x0A
165c2c66affSColin Finck #define SCSIOP_SEEK6 0x0B
166c2c66affSColin Finck #define SCSIOP_TRACK_SELECT 0x0B
167c2c66affSColin Finck #define SCSIOP_SLEW_PRINT 0x0B
168c2c66affSColin Finck #define SCSIOP_SET_CAPACITY 0x0B
169c2c66affSColin Finck #define SCSIOP_SEEK_BLOCK 0x0C
170c2c66affSColin Finck #define SCSIOP_PARTITION 0x0D
171c2c66affSColin Finck #define SCSIOP_READ_REVERSE 0x0F
172c2c66affSColin Finck #define SCSIOP_WRITE_FILEMARKS 0x10
173c2c66affSColin Finck #define SCSIOP_FLUSH_BUFFER 0x10
174c2c66affSColin Finck #define SCSIOP_SPACE 0x11
175c2c66affSColin Finck #define SCSIOP_INQUIRY 0x12
176c2c66affSColin Finck #define SCSIOP_VERIFY6 0x13
177c2c66affSColin Finck #define SCSIOP_RECOVER_BUF_DATA 0x14
178c2c66affSColin Finck #define SCSIOP_MODE_SELECT 0x15
179c2c66affSColin Finck #define SCSIOP_RESERVE_UNIT 0x16
180c2c66affSColin Finck #define SCSIOP_RELEASE_UNIT 0x17
181c2c66affSColin Finck #define SCSIOP_COPY 0x18
182c2c66affSColin Finck #define SCSIOP_ERASE 0x19
183c2c66affSColin Finck #define SCSIOP_MODE_SENSE 0x1A
184c2c66affSColin Finck #define SCSIOP_START_STOP_UNIT 0x1B
185c2c66affSColin Finck #define SCSIOP_STOP_PRINT 0x1B
186c2c66affSColin Finck #define SCSIOP_LOAD_UNLOAD 0x1B
187c2c66affSColin Finck #define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C
188c2c66affSColin Finck #define SCSIOP_SEND_DIAGNOSTIC 0x1D
189c2c66affSColin Finck #define SCSIOP_MEDIUM_REMOVAL 0x1E
190c2c66affSColin Finck #define SCSIOP_READ_FORMATTED_CAPACITY 0x23
191c2c66affSColin Finck #define SCSIOP_READ_CAPACITY 0x25
192c2c66affSColin Finck #define SCSIOP_READ 0x28
193c2c66affSColin Finck #define SCSIOP_WRITE 0x2A
194c2c66affSColin Finck #define SCSIOP_SEEK 0x2B
195c2c66affSColin Finck #define SCSIOP_LOCATE 0x2B
196c2c66affSColin Finck #define SCSIOP_POSITION_TO_ELEMENT 0x2B
197c2c66affSColin Finck #define SCSIOP_WRITE_VERIFY 0x2E
198c2c66affSColin Finck #define SCSIOP_VERIFY 0x2F
199c2c66affSColin Finck #define SCSIOP_SEARCH_DATA_HIGH 0x30
200c2c66affSColin Finck #define SCSIOP_SEARCH_DATA_EQUAL 0x31
201c2c66affSColin Finck #define SCSIOP_SEARCH_DATA_LOW 0x32
202c2c66affSColin Finck #define SCSIOP_SET_LIMITS 0x33
203c2c66affSColin Finck #define SCSIOP_READ_POSITION 0x34
204c2c66affSColin Finck #define SCSIOP_SYNCHRONIZE_CACHE 0x35
205c2c66affSColin Finck #define SCSIOP_COMPARE 0x39
206c2c66affSColin Finck #define SCSIOP_COPY_COMPARE 0x3A
207c2c66affSColin Finck #define SCSIOP_WRITE_DATA_BUFF 0x3B
208c2c66affSColin Finck #define SCSIOP_READ_DATA_BUFF 0x3C
209c2c66affSColin Finck #define SCSIOP_WRITE_LONG 0x3F
210c2c66affSColin Finck #define SCSIOP_CHANGE_DEFINITION 0x40
211c2c66affSColin Finck #define SCSIOP_WRITE_SAME 0x41
212c2c66affSColin Finck #define SCSIOP_READ_SUB_CHANNEL 0x42
213c2c66affSColin Finck #define SCSIOP_READ_TOC 0x43
214c2c66affSColin Finck #define SCSIOP_READ_HEADER 0x44
215c2c66affSColin Finck #define SCSIOP_REPORT_DENSITY_SUPPORT 0x44
216c2c66affSColin Finck #define SCSIOP_PLAY_AUDIO 0x45
217c2c66affSColin Finck #define SCSIOP_GET_CONFIGURATION 0x46
218c2c66affSColin Finck #define SCSIOP_PLAY_AUDIO_MSF 0x47
219c2c66affSColin Finck #define SCSIOP_PLAY_TRACK_INDEX 0x48
220c2c66affSColin Finck #define SCSIOP_PLAY_TRACK_RELATIVE 0x49
221c2c66affSColin Finck #define SCSIOP_GET_EVENT_STATUS 0x4A
222c2c66affSColin Finck #define SCSIOP_PAUSE_RESUME 0x4B
223c2c66affSColin Finck #define SCSIOP_LOG_SELECT 0x4C
224c2c66affSColin Finck #define SCSIOP_LOG_SENSE 0x4D
225c2c66affSColin Finck #define SCSIOP_STOP_PLAY_SCAN 0x4E
226c2c66affSColin Finck #define SCSIOP_XDWRITE 0x50
227c2c66affSColin Finck #define SCSIOP_XPWRITE 0x51
228c2c66affSColin Finck #define SCSIOP_READ_DISK_INFORMATION 0x51
229c2c66affSColin Finck #define SCSIOP_READ_DISC_INFORMATION 0x51
230c2c66affSColin Finck #define SCSIOP_READ_TRACK_INFORMATION 0x52
231c2c66affSColin Finck #define SCSIOP_XDWRITE_READ 0x53
232c2c66affSColin Finck #define SCSIOP_RESERVE_TRACK_RZONE 0x53
233c2c66affSColin Finck #define SCSIOP_SEND_OPC_INFORMATION 0x54
234c2c66affSColin Finck #define SCSIOP_MODE_SELECT10 0x55
235c2c66affSColin Finck #define SCSIOP_RESERVE_UNIT10 0x56
236c2c66affSColin Finck #define SCSIOP_RESERVE_ELEMENT 0x56
237c2c66affSColin Finck #define SCSIOP_RELEASE_UNIT10 0x57
238c2c66affSColin Finck #define SCSIOP_RELEASE_ELEMENT 0x57
239c2c66affSColin Finck #define SCSIOP_REPAIR_TRACK 0x58
240c2c66affSColin Finck #define SCSIOP_MODE_SENSE10 0x5A
241c2c66affSColin Finck #define SCSIOP_CLOSE_TRACK_SESSION 0x5B
242c2c66affSColin Finck #define SCSIOP_READ_BUFFER_CAPACITY 0x5C
243c2c66affSColin Finck #define SCSIOP_SEND_CUE_SHEET 0x5D
244c2c66affSColin Finck #define SCSIOP_PERSISTENT_RESERVE_IN 0x5E
245c2c66affSColin Finck #define SCSIOP_PERSISTENT_RESERVE_OUT 0x5F
246c2c66affSColin Finck #define SCSIOP_XDWRITE_EXTENDED16 0x80
247c2c66affSColin Finck #define SCSIOP_WRITE_FILEMARKS16 0x80
248c2c66affSColin Finck #define SCSIOP_REBUILD16 0x81
249c2c66affSColin Finck #define SCSIOP_READ_REVERSE16 0x81
250c2c66affSColin Finck #define SCSIOP_REGENERATE16 0x82
251c2c66affSColin Finck #define SCSIOP_EXTENDED_COPY 0x83
252c2c66affSColin Finck #define SCSIOP_RECEIVE_COPY_RESULTS 0x84
253c2c66affSColin Finck #define SCSIOP_ATA_PASSTHROUGH16 0x85
254c2c66affSColin Finck #define SCSIOP_ACCESS_CONTROL_IN 0x86
255c2c66affSColin Finck #define SCSIOP_ACCESS_CONTROL_OUT 0x87
256c2c66affSColin Finck #define SCSIOP_READ16 0x88
257c2c66affSColin Finck #define SCSIOP_WRITE16 0x8A
258c2c66affSColin Finck #define SCSIOP_READ_ATTRIBUTES 0x8C
259c2c66affSColin Finck #define SCSIOP_WRITE_ATTRIBUTES 0x8D
260c2c66affSColin Finck #define SCSIOP_WRITE_VERIFY16 0x8E
261c2c66affSColin Finck #define SCSIOP_VERIFY16 0x8F
262c2c66affSColin Finck #define SCSIOP_PREFETCH16 0x90
263c2c66affSColin Finck #define SCSIOP_SYNCHRONIZE_CACHE16 0x91
264c2c66affSColin Finck #define SCSIOP_SPACE16 0x91
265c2c66affSColin Finck #define SCSIOP_LOCK_UNLOCK_CACHE16 0x92
266c2c66affSColin Finck #define SCSIOP_LOCATE16 0x92
267c2c66affSColin Finck #define SCSIOP_WRITE_SAME16 0x93
268c2c66affSColin Finck #define SCSIOP_ERASE16 0x93
269c2c66affSColin Finck #define SCSIOP_READ_CAPACITY16 0x9E
270c2c66affSColin Finck #define SCSIOP_SERVICE_ACTION_IN16 0x9E
271c2c66affSColin Finck #define SCSIOP_SERVICE_ACTION_OUT16 0x9F
272c2c66affSColin Finck #define SCSIOP_REPORT_LUNS 0xA0
273c2c66affSColin Finck #define SCSIOP_BLANK 0xA1
274c2c66affSColin Finck #define SCSIOP_ATA_PASSTHROUGH12 0xA1
275c2c66affSColin Finck #define SCSIOP_SEND_EVENT 0xA2
276c2c66affSColin Finck #define SCSIOP_SEND_KEY 0xA3
277c2c66affSColin Finck #define SCSIOP_MAINTENANCE_IN 0xA3
278c2c66affSColin Finck #define SCSIOP_REPORT_KEY 0xA4
279c2c66affSColin Finck #define SCSIOP_MAINTENANCE_OUT 0xA4
280c2c66affSColin Finck #define SCSIOP_MOVE_MEDIUM 0xA5
281c2c66affSColin Finck #define SCSIOP_LOAD_UNLOAD_SLOT 0xA6
282c2c66affSColin Finck #define SCSIOP_EXCHANGE_MEDIUM 0xA6
283c2c66affSColin Finck #define SCSIOP_SET_READ_AHEAD 0xA7
284c2c66affSColin Finck #define SCSIOP_MOVE_MEDIUM_ATTACHED 0xA7
285c2c66affSColin Finck #define SCSIOP_READ12 0xA8
286c2c66affSColin Finck #define SCSIOP_GET_MESSAGE 0xA8
287c2c66affSColin Finck #define SCSIOP_SERVICE_ACTION_OUT12 0xA9
288c2c66affSColin Finck #define SCSIOP_WRITE12 0xAA
289c2c66affSColin Finck #define SCSIOP_SEND_MESSAGE 0xAB
290c2c66affSColin Finck #define SCSIOP_SERVICE_ACTION_IN12 0xAB
291c2c66affSColin Finck #define SCSIOP_GET_PERFORMANCE 0xAC
292c2c66affSColin Finck #define SCSIOP_READ_DVD_STRUCTURE 0xAD
293c2c66affSColin Finck #define SCSIOP_WRITE_VERIFY12 0xAE
294c2c66affSColin Finck #define SCSIOP_VERIFY12 0xAF
295c2c66affSColin Finck #define SCSIOP_SEARCH_DATA_HIGH12 0xB0
296c2c66affSColin Finck #define SCSIOP_SEARCH_DATA_EQUAL12 0xB1
297c2c66affSColin Finck #define SCSIOP_SEARCH_DATA_LOW12 0xB2
298c2c66affSColin Finck #define SCSIOP_SET_LIMITS12 0xB3
299c2c66affSColin Finck #define SCSIOP_READ_ELEMENT_STATUS_ATTACHED 0xB4
300c2c66affSColin Finck #define SCSIOP_REQUEST_VOL_ELEMENT 0xB5
301c2c66affSColin Finck #define SCSIOP_SEND_VOLUME_TAG 0xB6
302c2c66affSColin Finck #define SCSIOP_SET_STREAMING 0xB6
303c2c66affSColin Finck #define SCSIOP_READ_DEFECT_DATA 0xB7
304c2c66affSColin Finck #define SCSIOP_READ_ELEMENT_STATUS 0xB8
305c2c66affSColin Finck #define SCSIOP_READ_CD_MSF 0xB9
306c2c66affSColin Finck #define SCSIOP_SCAN_CD 0xBA
307c2c66affSColin Finck #define SCSIOP_REDUNDANCY_GROUP_IN 0xBA
308c2c66affSColin Finck #define SCSIOP_SET_CD_SPEED 0xBB
309c2c66affSColin Finck #define SCSIOP_REDUNDANCY_GROUP_OUT 0xBB
310c2c66affSColin Finck #define SCSIOP_PLAY_CD 0xBC
311c2c66affSColin Finck #define SCSIOP_SPARE_IN 0xBC
312c2c66affSColin Finck #define SCSIOP_MECHANISM_STATUS 0xBD
313c2c66affSColin Finck #define SCSIOP_SPARE_OUT 0xBD
314c2c66affSColin Finck #define SCSIOP_READ_CD 0xBE
315c2c66affSColin Finck #define SCSIOP_VOLUME_SET_IN 0xBE
316c2c66affSColin Finck #define SCSIOP_SEND_DVD_STRUCTURE 0xBF
317c2c66affSColin Finck #define SCSIOP_VOLUME_SET_OUT 0xBF
318c2c66affSColin Finck #define SCSIOP_INIT_ELEMENT_RANGE 0xE7
319c2c66affSColin Finck
320c2c66affSColin Finck #define SCSISTAT_GOOD 0x00
321c2c66affSColin Finck #define SCSISTAT_CHECK_CONDITION 0x02
322c2c66affSColin Finck #define SCSISTAT_CONDITION_MET 0x04
323c2c66affSColin Finck #define SCSISTAT_BUSY 0x08
324c2c66affSColin Finck #define SCSISTAT_INTERMEDIATE 0x10
325c2c66affSColin Finck #define SCSISTAT_INTERMEDIATE_COND_MET 0x14
326c2c66affSColin Finck #define SCSISTAT_RESERVATION_CONFLICT 0x18
327c2c66affSColin Finck #define SCSISTAT_COMMAND_TERMINATED 0x22
328c2c66affSColin Finck #define SCSISTAT_QUEUE_FULL 0x28
329c2c66affSColin Finck
330c2c66affSColin Finck #define SETBITON 1
331c2c66affSColin Finck #define SETBITOFF 0
332c2c66affSColin Finck
333c2c66affSColin Finck #define SP_RETURN_NOT_FOUND 0
334c2c66affSColin Finck #define SP_RETURN_FOUND 1
335c2c66affSColin Finck #define SP_RETURN_ERROR 2
336c2c66affSColin Finck #define SP_RETURN_BAD_CONFIG 3
337c2c66affSColin Finck
338*0fbd5edaSHermès Bélusca-Maïto /* SCSI_REQUEST_BLOCK.Function constants */
339c2c66affSColin Finck #define SRB_FUNCTION_EXECUTE_SCSI 0x00
340c2c66affSColin Finck #define SRB_FUNCTION_CLAIM_DEVICE 0x01
341c2c66affSColin Finck #define SRB_FUNCTION_IO_CONTROL 0x02
342c2c66affSColin Finck #define SRB_FUNCTION_RECEIVE_EVENT 0x03
343c2c66affSColin Finck #define SRB_FUNCTION_RELEASE_QUEUE 0x04
344c2c66affSColin Finck #define SRB_FUNCTION_ATTACH_DEVICE 0x05
345c2c66affSColin Finck #define SRB_FUNCTION_RELEASE_DEVICE 0x06
346c2c66affSColin Finck #define SRB_FUNCTION_SHUTDOWN 0x07
347c2c66affSColin Finck #define SRB_FUNCTION_FLUSH 0x08
348c2c66affSColin Finck #define SRB_FUNCTION_ABORT_COMMAND 0x10
349c2c66affSColin Finck #define SRB_FUNCTION_RELEASE_RECOVERY 0x11
350c2c66affSColin Finck #define SRB_FUNCTION_RESET_BUS 0x12
351c2c66affSColin Finck #define SRB_FUNCTION_RESET_DEVICE 0x13
352c2c66affSColin Finck #define SRB_FUNCTION_TERMINATE_IO 0x14
353c2c66affSColin Finck #define SRB_FUNCTION_FLUSH_QUEUE 0x15
354c2c66affSColin Finck #define SRB_FUNCTION_REMOVE_DEVICE 0x16
355c2c66affSColin Finck #define SRB_FUNCTION_WMI 0x17
356c2c66affSColin Finck #define SRB_FUNCTION_LOCK_QUEUE 0x18
357c2c66affSColin Finck #define SRB_FUNCTION_UNLOCK_QUEUE 0x19
358c2c66affSColin Finck #define SRB_FUNCTION_RESET_LOGICAL_UNIT 0x20
359c2c66affSColin Finck #define SRB_FUNCTION_SET_LINK_TIMEOUT 0x21
360c2c66affSColin Finck #define SRB_FUNCTION_LINK_TIMEOUT_OCCURRED 0x22
361c2c66affSColin Finck #define SRB_FUNCTION_LINK_TIMEOUT_COMPLETE 0x23
362c2c66affSColin Finck #define SRB_FUNCTION_POWER 0x24
363c2c66affSColin Finck #define SRB_FUNCTION_PNP 0x25
364c2c66affSColin Finck #define SRB_FUNCTION_DUMP_POINTERS 0x26
365c2c66affSColin Finck
366*0fbd5edaSHermès Bélusca-Maïto /* SCSI_REQUEST_BLOCK.SrbStatus constants */
367c2c66affSColin Finck #define SRB_STATUS_PENDING 0x00
368c2c66affSColin Finck #define SRB_STATUS_SUCCESS 0x01
369c2c66affSColin Finck #define SRB_STATUS_ABORTED 0x02
370c2c66affSColin Finck #define SRB_STATUS_ABORT_FAILED 0x03
371c2c66affSColin Finck #define SRB_STATUS_ERROR 0x04
372c2c66affSColin Finck #define SRB_STATUS_BUSY 0x05
373c2c66affSColin Finck #define SRB_STATUS_INVALID_REQUEST 0x06
374c2c66affSColin Finck #define SRB_STATUS_INVALID_PATH_ID 0x07
375c2c66affSColin Finck #define SRB_STATUS_NO_DEVICE 0x08
376c2c66affSColin Finck #define SRB_STATUS_TIMEOUT 0x09
377c2c66affSColin Finck #define SRB_STATUS_SELECTION_TIMEOUT 0x0A
378c2c66affSColin Finck #define SRB_STATUS_COMMAND_TIMEOUT 0x0B
379c2c66affSColin Finck #define SRB_STATUS_MESSAGE_REJECTED 0x0D
380c2c66affSColin Finck #define SRB_STATUS_BUS_RESET 0x0E
381c2c66affSColin Finck #define SRB_STATUS_PARITY_ERROR 0x0F
382c2c66affSColin Finck #define SRB_STATUS_REQUEST_SENSE_FAILED 0x10
383c2c66affSColin Finck #define SRB_STATUS_NO_HBA 0x11
384c2c66affSColin Finck #define SRB_STATUS_DATA_OVERRUN 0x12
385c2c66affSColin Finck #define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13
386c2c66affSColin Finck #define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14
387c2c66affSColin Finck #define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15
388c2c66affSColin Finck #define SRB_STATUS_REQUEST_FLUSHED 0x16
389c2c66affSColin Finck #define SRB_STATUS_INVALID_LUN 0x20
390c2c66affSColin Finck #define SRB_STATUS_INVALID_TARGET_ID 0x21
391c2c66affSColin Finck #define SRB_STATUS_BAD_FUNCTION 0x22
392c2c66affSColin Finck #define SRB_STATUS_ERROR_RECOVERY 0x23
393c2c66affSColin Finck #define SRB_STATUS_NOT_POWERED 0x24
394c2c66affSColin Finck #define SRB_STATUS_LINK_DOWN 0x25
395c2c66affSColin Finck #define SRB_STATUS_INTERNAL_ERROR 0x30
396c2c66affSColin Finck #define SRB_STATUS_QUEUE_FROZEN 0x40
397c2c66affSColin Finck #define SRB_STATUS_AUTOSENSE_VALID 0x80
398c2c66affSColin Finck #define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
399c2c66affSColin Finck
400*0fbd5edaSHermès Bélusca-Maïto /* SCSI_REQUEST_BLOCK.SrbFlags constants */
401c2c66affSColin Finck #define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002
402c2c66affSColin Finck #define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004
403c2c66affSColin Finck #define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
404c2c66affSColin Finck
405c2c66affSColin Finck #define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010
406c2c66affSColin Finck #define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
407c2c66affSColin Finck #define SRB_FLAGS_DATA_IN 0x00000040
408c2c66affSColin Finck #define SRB_FLAGS_DATA_OUT 0x00000080
409c2c66affSColin Finck #define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
410c2c66affSColin Finck #define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
411c2c66affSColin Finck
412c2c66affSColin Finck #define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100
413c2c66affSColin Finck #define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200
414c2c66affSColin Finck #define SRB_FLAGS_FREE_SENSE_BUFFER 0x00000400
415c2c66affSColin Finck
416c2c66affSColin Finck #define SRB_FLAGS_IS_ACTIVE 0x00010000
417c2c66affSColin Finck #define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000
418c2c66affSColin Finck #define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000
419c2c66affSColin Finck #define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000
420c2c66affSColin Finck
421c2c66affSColin Finck #define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000
422c2c66affSColin Finck #define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE 0x00200000
423c2c66affSColin Finck
424c2c66affSColin Finck #define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT 0x00400000
425c2c66affSColin Finck #define SRB_FLAGS_DONT_START_NEXT_PACKET 0x00800000
426c2c66affSColin Finck
427c2c66affSColin Finck #define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000
428c2c66affSColin Finck #define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000
429c2c66affSColin Finck
430c2c66affSColin Finck #define SRB_SIMPLE_TAG_REQUEST 0x20
431c2c66affSColin Finck #define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21
432c2c66affSColin Finck #define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22
433c2c66affSColin Finck
434c2c66affSColin Finck #define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01
435c2c66affSColin Finck #define SRB_POWER_FLAGS_ADAPTER_REQUEST 0x01
436c2c66affSColin Finck #define SRB_PNP_FLAGS_ADAPTER_REQUEST 0x01
437c2c66affSColin Finck
438c2c66affSColin Finck #define STOR_MAP_NO_BUFFERS (0)
439c2c66affSColin Finck #define STOR_MAP_ALL_BUFFERS (1)
440c2c66affSColin Finck #define STOR_MAP_NON_READ_WRITE_BUFFERS (2)
441c2c66affSColin Finck
442c2c66affSColin Finck #define VPD_SUPPORTED_PAGES 0x00
443c2c66affSColin Finck #define VPD_SERIAL_NUMBER 0x80
444c2c66affSColin Finck #define VPD_DEVICE_IDENTIFIERS 0x83
445c2c66affSColin Finck #define VPD_MEDIA_SERIAL_NUMBER 0x84
446c2c66affSColin Finck #define VPD_SOFTWARE_INTERFACE_IDENTIFIERS 0x84
447c2c66affSColin Finck #define VPD_NETWORK_MANAGEMENT_ADDRESSES 0x85
448c2c66affSColin Finck #define VPD_EXTENDED_INQUIRY_DATA 0x86
449c2c66affSColin Finck #define VPD_MODE_PAGE_POLICY 0x87
450c2c66affSColin Finck #define VPD_SCSI_PORTS 0x88
451c2c66affSColin Finck
452e75bdce6SPierre Schweitzer #define SCSI_SENSE_NO_SENSE 0x00
453e75bdce6SPierre Schweitzer #define SCSI_SENSE_RECOVERED_ERROR 0x01
454e75bdce6SPierre Schweitzer #define SCSI_SENSE_NOT_READY 0x02
455e75bdce6SPierre Schweitzer #define SCSI_SENSE_MEDIUM_ERROR 0x03
456e75bdce6SPierre Schweitzer #define SCSI_SENSE_HARDWARE_ERROR 0x04
457e75bdce6SPierre Schweitzer #define SCSI_SENSE_ILLEGAL_REQUEST 0x05
458e75bdce6SPierre Schweitzer #define SCSI_SENSE_UNIT_ATTENTION 0x06
459e75bdce6SPierre Schweitzer #define SCSI_SENSE_DATA_PROTECT 0x07
460e75bdce6SPierre Schweitzer #define SCSI_SENSE_BLANK_CHECK 0x08
461e75bdce6SPierre Schweitzer #define SCSI_SENSE_UNIQUE 0x09
462e75bdce6SPierre Schweitzer #define SCSI_SENSE_COPY_ABORTED 0x0A
463e75bdce6SPierre Schweitzer #define SCSI_SENSE_ABORTED_COMMAND 0x0B
464e75bdce6SPierre Schweitzer #define SCSI_SENSE_EQUAL 0x0C
465e75bdce6SPierre Schweitzer #define SCSI_SENSE_VOL_OVERFLOW 0x0D
466e75bdce6SPierre Schweitzer #define SCSI_SENSE_MISCOMPARE 0x0E
467e75bdce6SPierre Schweitzer #define SCSI_SENSE_RESERVED 0x0F
468e75bdce6SPierre Schweitzer
469c2c66affSColin Finck typedef enum _STOR_SYNCHRONIZATION_MODEL
470c2c66affSColin Finck {
471c2c66affSColin Finck StorSynchronizeHalfDuplex,
472c2c66affSColin Finck StorSynchronizeFullDuplex
473c2c66affSColin Finck } STOR_SYNCHRONIZATION_MODEL;
474c2c66affSColin Finck
475c2c66affSColin Finck typedef enum _STOR_DMA_WIDTH
476c2c66affSColin Finck {
477c2c66affSColin Finck DmaUnknown,
478c2c66affSColin Finck Dma32Bit,
479c2c66affSColin Finck Dma64BitScatterGather,
480c2c66affSColin Finck Dma64Bit
481c2c66affSColin Finck } STOR_DMA_WIDTH;
482c2c66affSColin Finck
483c2c66affSColin Finck typedef enum _STOR_SPINLOCK
484c2c66affSColin Finck {
485c2c66affSColin Finck DpcLock = 1,
486c2c66affSColin Finck StartIoLock,
487c2c66affSColin Finck InterruptLock
488c2c66affSColin Finck } STOR_SPINLOCK;
489c2c66affSColin Finck
490c2c66affSColin Finck typedef enum _SCSI_ADAPTER_CONTROL_TYPE
491c2c66affSColin Finck {
492c2c66affSColin Finck ScsiQuerySupportedControlTypes = 0,
493c2c66affSColin Finck ScsiStopAdapter,
494c2c66affSColin Finck ScsiRestartAdapter,
495c2c66affSColin Finck ScsiSetBootConfig,
496c2c66affSColin Finck ScsiSetRunningConfig,
497c2c66affSColin Finck ScsiAdapterControlMax,
498c2c66affSColin Finck MakeAdapterControlTypeSizeOfUlong = 0xffffffff
499c2c66affSColin Finck } SCSI_ADAPTER_CONTROL_TYPE, *PSCSI_ADAPTER_CONTROL_TYPE;
500c2c66affSColin Finck
501c2c66affSColin Finck typedef enum _SCSI_ADAPTER_CONTROL_STATUS
502c2c66affSColin Finck {
503c2c66affSColin Finck ScsiAdapterControlSuccess = 0,
504c2c66affSColin Finck ScsiAdapterControlUnsuccessful
505c2c66affSColin Finck } SCSI_ADAPTER_CONTROL_STATUS, *PSCSI_ADAPTER_CONTROL_STATUS;
506c2c66affSColin Finck
507c2c66affSColin Finck typedef enum _SCSI_NOTIFICATION_TYPE
508c2c66affSColin Finck {
509c2c66affSColin Finck RequestComplete,
510c2c66affSColin Finck NextRequest,
511c2c66affSColin Finck NextLuRequest,
512c2c66affSColin Finck ResetDetected,
513c2c66affSColin Finck _obsolete1,
514c2c66affSColin Finck _obsolete2,
515c2c66affSColin Finck RequestTimerCall,
516c2c66affSColin Finck BusChangeDetected,
517c2c66affSColin Finck WMIEvent,
518c2c66affSColin Finck WMIReregister,
519c2c66affSColin Finck LinkUp,
520c2c66affSColin Finck LinkDown,
521c2c66affSColin Finck QueryTickCount,
522c2c66affSColin Finck BufferOverrunDetected,
523c2c66affSColin Finck TraceNotification,
524c2c66affSColin Finck GetExtendedFunctionTable,
525c2c66affSColin Finck EnablePassiveInitialization = 0x1000,
526c2c66affSColin Finck InitializeDpc,
527c2c66affSColin Finck IssueDpc,
528c2c66affSColin Finck AcquireSpinLock,
529c2c66affSColin Finck ReleaseSpinLock
530c2c66affSColin Finck } SCSI_NOTIFICATION_TYPE, *PSCSI_NOTIFICATION_TYPE;
531c2c66affSColin Finck
532c2c66affSColin Finck typedef enum _STOR_DEVICE_POWER_STATE
533c2c66affSColin Finck {
534c2c66affSColin Finck StorPowerDeviceUnspecified = 0,
535c2c66affSColin Finck StorPowerDeviceD0,
536c2c66affSColin Finck StorPowerDeviceD1,
537c2c66affSColin Finck StorPowerDeviceD2,
538c2c66affSColin Finck StorPowerDeviceD3,
539c2c66affSColin Finck StorPowerDeviceMaximum
540c2c66affSColin Finck } STOR_DEVICE_POWER_STATE, *PSTOR_DEVICE_POWER_STATE;
541c2c66affSColin Finck
542c2c66affSColin Finck typedef enum _STOR_POWER_ACTION
543c2c66affSColin Finck {
544c2c66affSColin Finck StorPowerActionNone = 0,
545c2c66affSColin Finck StorPowerActionReserved,
546c2c66affSColin Finck StorPowerActionSleep,
547c2c66affSColin Finck StorPowerActionHibernate,
548c2c66affSColin Finck StorPowerActionShutdown,
549c2c66affSColin Finck StorPowerActionShutdownReset,
550c2c66affSColin Finck StorPowerActionShutdownOff,
551c2c66affSColin Finck StorPowerActionWarmEject
552c2c66affSColin Finck } STOR_POWER_ACTION, *PSTOR_POWER_ACTION;
553c2c66affSColin Finck
554c2c66affSColin Finck typedef enum _STOR_PNP_ACTION
555c2c66affSColin Finck {
556c2c66affSColin Finck StorStartDevice = 0x0,
557c2c66affSColin Finck StorRemoveDevice = 0x2,
558c2c66affSColin Finck StorStopDevice = 0x4,
559c2c66affSColin Finck StorQueryCapabilities = 0x9,
560c2c66affSColin Finck StorQueryResourceRequirements = 0xB,
561c2c66affSColin Finck StorFilterResourceRequirements = 0xD,
562c2c66affSColin Finck StorSurpriseRemoval = 0x17
563c2c66affSColin Finck } STOR_PNP_ACTION, *PSTOR_PNP_ACTION;
564c2c66affSColin Finck
565c2c66affSColin Finck typedef enum _VPD_CODE_SET
566c2c66affSColin Finck {
567c2c66affSColin Finck VpdCodeSetReserved = 0,
568c2c66affSColin Finck VpdCodeSetBinary = 1,
569c2c66affSColin Finck VpdCodeSetAscii = 2,
570c2c66affSColin Finck VpdCodeSetUTF8 = 3
571c2c66affSColin Finck } VPD_CODE_SET, *PVPD_CODE_SET;
572c2c66affSColin Finck
573c2c66affSColin Finck typedef enum _VPD_ASSOCIATION
574c2c66affSColin Finck {
575c2c66affSColin Finck VpdAssocDevice = 0,
576c2c66affSColin Finck VpdAssocPort = 1,
577c2c66affSColin Finck VpdAssocTarget = 2,
578c2c66affSColin Finck VpdAssocReserved1 = 3,
579c2c66affSColin Finck VpdAssocReserved2 = 4
580c2c66affSColin Finck } VPD_ASSOCIATION, *PVPD_ASSOCIATION;
581c2c66affSColin Finck
582c2c66affSColin Finck typedef enum _VPD_IDENTIFIER_TYPE
583c2c66affSColin Finck {
584c2c66affSColin Finck VpdIdentifierTypeVendorSpecific = 0,
585c2c66affSColin Finck VpdIdentifierTypeVendorId = 1,
586c2c66affSColin Finck VpdIdentifierTypeEUI64 = 2,
587c2c66affSColin Finck VpdIdentifierTypeFCPHName = 3,
588c2c66affSColin Finck VpdIdentifierTypePortRelative = 4,
589c2c66affSColin Finck VpdIdentifierTypeTargetPortGroup = 5,
590c2c66affSColin Finck VpdIdentifierTypeLogicalUnitGroup = 6,
591c2c66affSColin Finck VpdIdentifierTypeMD5LogicalUnitId = 7,
592c2c66affSColin Finck VpdIdentifierTypeSCSINameString = 8
593c2c66affSColin Finck } VPD_IDENTIFIER_TYPE, *PVPD_IDENTIFIER_TYPE;
594c2c66affSColin Finck
595ca22dc9bSEric Kohl typedef enum _STORPORT_FUNCTION_CODE
596ca22dc9bSEric Kohl {
597ca22dc9bSEric Kohl ExtFunctionAllocatePool,
598ca22dc9bSEric Kohl ExtFunctionFreePool,
599ca22dc9bSEric Kohl ExtFunctionAllocateMdl,
600ca22dc9bSEric Kohl ExtFunctionFreeMdl,
601ca22dc9bSEric Kohl ExtFunctionBuildMdlForNonPagedPool,
602ca22dc9bSEric Kohl ExtFunctionGetSystemAddress,
603ca22dc9bSEric Kohl ExtFunctionGetOriginalMdl,
604ca22dc9bSEric Kohl ExtFunctionCompleteServiceIrp,
605ca22dc9bSEric Kohl ExtFunctionGetDeviceObjects,
606ca22dc9bSEric Kohl ExtFunctionBuildScatterGatherList,
607ca22dc9bSEric Kohl ExtFunctionPutScatterGatherList,
608ca22dc9bSEric Kohl ExtFunctionAcquireMSISpinLock,
609ca22dc9bSEric Kohl ExtFunctionReleaseMSISpinLock,
610ca22dc9bSEric Kohl ExtFunctionGetMessageInterruptInformation,
611ca22dc9bSEric Kohl ExtFunctionInitializePerformanceOptimizations,
612ca22dc9bSEric Kohl ExtFunctionGetStartIoPerformanceParameters,
613ca22dc9bSEric Kohl ExtFunctionLogSystemEvent,
614ca22dc9bSEric Kohl #if (NTDDI_VERSION >= NTDDI_WIN7)
615ca22dc9bSEric Kohl ExtFunctionGetCurrentProcessorNumber,
616ca22dc9bSEric Kohl ExtFunctionGetActiveGroupCount,
617ca22dc9bSEric Kohl ExtFunctionGetGroupAffinity,
618ca22dc9bSEric Kohl ExtFunctionGetActiveNodeCount,
619ca22dc9bSEric Kohl ExtFunctionGetNodeAffinity,
620ca22dc9bSEric Kohl ExtFunctionGetHighestNodeNumber,
621ca22dc9bSEric Kohl ExtFunctionGetLogicalProcessorRelationship,
622ca22dc9bSEric Kohl ExtFunctionAllocateContiguousMemorySpecifyCacheNode,
623ca22dc9bSEric Kohl ExtFunctionFreeContiguousMemorySpecifyCache
624ca22dc9bSEric Kohl #endif
625ca22dc9bSEric Kohl } STORPORT_FUNCTION_CODE, *PSTORPORT_FUNCTION_CODE;
626ca22dc9bSEric Kohl
627ca22dc9bSEric Kohl typedef enum _STOR_EVENT_ASSOCIATION_ENUM
628ca22dc9bSEric Kohl {
629ca22dc9bSEric Kohl StorEventAdapterAssociation = 0,
630ca22dc9bSEric Kohl StorEventLunAssociation,
631ca22dc9bSEric Kohl StorEventTargetAssociation,
632ca22dc9bSEric Kohl StorEventInvalidAssociation
633ca22dc9bSEric Kohl } STOR_EVENT_ASSOCIATION_ENUM;
634ca22dc9bSEric Kohl
635f7c01906SEric Kohl typedef enum _GETSGSTATUS
636f7c01906SEric Kohl {
637f7c01906SEric Kohl SG_ALLOCATED = 0,
638f7c01906SEric Kohl SG_BUFFER_TOO_SMALL
639f7c01906SEric Kohl } GETSGSTATUS, *PGETSGSTATUS;
640f7c01906SEric Kohl
641c2c66affSColin Finck typedef struct _SCSI_REQUEST_BLOCK
642c2c66affSColin Finck {
643c2c66affSColin Finck USHORT Length;
644c2c66affSColin Finck UCHAR Function;
645c2c66affSColin Finck UCHAR SrbStatus;
646c2c66affSColin Finck UCHAR ScsiStatus;
647c2c66affSColin Finck UCHAR PathId;
648c2c66affSColin Finck UCHAR TargetId;
649c2c66affSColin Finck UCHAR Lun;
650c2c66affSColin Finck UCHAR QueueTag;
651c2c66affSColin Finck UCHAR QueueAction;
652c2c66affSColin Finck UCHAR CdbLength;
653c2c66affSColin Finck UCHAR SenseInfoBufferLength;
654c2c66affSColin Finck ULONG SrbFlags;
655c2c66affSColin Finck ULONG DataTransferLength;
656c2c66affSColin Finck ULONG TimeOutValue;
657c2c66affSColin Finck PVOID DataBuffer;
658c2c66affSColin Finck PVOID SenseInfoBuffer;
659c2c66affSColin Finck struct _SCSI_REQUEST_BLOCK *NextSrb;
660c2c66affSColin Finck PVOID OriginalRequest;
661c2c66affSColin Finck PVOID SrbExtension;
662c2c66affSColin Finck union
663c2c66affSColin Finck {
664c2c66affSColin Finck ULONG InternalStatus;
665c2c66affSColin Finck ULONG QueueSortKey;
666c2c66affSColin Finck ULONG LinkTimeoutValue;
667c2c66affSColin Finck };
668c2c66affSColin Finck #if defined(_WIN64)
669c2c66affSColin Finck ULONG Reserved;
670c2c66affSColin Finck #endif
671c2c66affSColin Finck UCHAR Cdb[16];
672c2c66affSColin Finck } SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK;
673c2c66affSColin Finck
674c2c66affSColin Finck typedef struct _SCSI_WMI_REQUEST_BLOCK
675c2c66affSColin Finck {
676c2c66affSColin Finck USHORT Length;
677c2c66affSColin Finck UCHAR Function;
678c2c66affSColin Finck UCHAR SrbStatus;
679c2c66affSColin Finck UCHAR WMISubFunction;
680c2c66affSColin Finck UCHAR PathId;
681c2c66affSColin Finck UCHAR TargetId;
682c2c66affSColin Finck UCHAR Lun;
683c2c66affSColin Finck UCHAR Reserved1;
684c2c66affSColin Finck UCHAR WMIFlags;
685c2c66affSColin Finck UCHAR Reserved2[2];
686c2c66affSColin Finck ULONG SrbFlags;
687c2c66affSColin Finck ULONG DataTransferLength;
688c2c66affSColin Finck ULONG TimeOutValue;
689c2c66affSColin Finck PVOID DataBuffer;
690c2c66affSColin Finck PVOID DataPath;
691c2c66affSColin Finck PVOID Reserved3;
692c2c66affSColin Finck PVOID OriginalRequest;
693c2c66affSColin Finck PVOID SrbExtension;
694c2c66affSColin Finck ULONG Reserved4;
695c2c66affSColin Finck #if (NTDDI_VERSION >= NTDDI_WS03SP1) && defined(_WIN64)
696c2c66affSColin Finck ULONG Reserved6;
697c2c66affSColin Finck #endif
698c2c66affSColin Finck UCHAR Reserved5[16];
699c2c66affSColin Finck } SCSI_WMI_REQUEST_BLOCK, *PSCSI_WMI_REQUEST_BLOCK;
700c2c66affSColin Finck
701c2c66affSColin Finck typedef struct _SCSI_POWER_REQUEST_BLOCK
702c2c66affSColin Finck {
703c2c66affSColin Finck USHORT Length;
704c2c66affSColin Finck UCHAR Function;
705c2c66affSColin Finck UCHAR SrbStatus;
706c2c66affSColin Finck UCHAR SrbPowerFlags;
707c2c66affSColin Finck UCHAR PathId;
708c2c66affSColin Finck UCHAR TargetId;
709c2c66affSColin Finck UCHAR Lun;
710c2c66affSColin Finck STOR_DEVICE_POWER_STATE DevicePowerState;
711c2c66affSColin Finck ULONG SrbFlags;
712c2c66affSColin Finck ULONG DataTransferLength;
713c2c66affSColin Finck ULONG TimeOutValue;
714c2c66affSColin Finck PVOID DataBuffer;
715c2c66affSColin Finck PVOID SenseInfoBuffer;
716c2c66affSColin Finck struct _SCSI_REQUEST_BLOCK *NextSrb;
717c2c66affSColin Finck PVOID OriginalRequest;
718c2c66affSColin Finck PVOID SrbExtension;
719c2c66affSColin Finck STOR_POWER_ACTION PowerAction;
720c2c66affSColin Finck #if defined(_WIN64)
721c2c66affSColin Finck ULONG Reserved;
722c2c66affSColin Finck #endif
723c2c66affSColin Finck UCHAR Reserved5[16];
724c2c66affSColin Finck } SCSI_POWER_REQUEST_BLOCK, *PSCSI_POWER_REQUEST_BLOCK;
725c2c66affSColin Finck
726c2c66affSColin Finck typedef struct _STOR_DEVICE_CAPABILITIES
727c2c66affSColin Finck {
728c2c66affSColin Finck USHORT Version;
729c2c66affSColin Finck ULONG DeviceD1:1;
730c2c66affSColin Finck ULONG DeviceD2:1;
731c2c66affSColin Finck ULONG LockSupported:1;
732c2c66affSColin Finck ULONG EjectSupported:1;
733c2c66affSColin Finck ULONG Removable:1;
734c2c66affSColin Finck ULONG DockDevice:1;
735c2c66affSColin Finck ULONG UniqueID:1;
736c2c66affSColin Finck ULONG SilentInstall:1;
737c2c66affSColin Finck ULONG SurpriseRemovalOK:1;
738c2c66affSColin Finck ULONG NoDisplayInUI:1;
739c2c66affSColin Finck } STOR_DEVICE_CAPABILITIES, *PSTOR_DEVICE_CAPABILITIES;
740c2c66affSColin Finck
741c2c66affSColin Finck typedef struct _SCSI_PNP_REQUEST_BLOCK
742c2c66affSColin Finck {
743c2c66affSColin Finck USHORT Length;
744c2c66affSColin Finck UCHAR Function;
745c2c66affSColin Finck UCHAR SrbStatus;
746c2c66affSColin Finck UCHAR PnPSubFunction;
747c2c66affSColin Finck UCHAR PathId;
748c2c66affSColin Finck UCHAR TargetId;
749c2c66affSColin Finck UCHAR Lun;
750c2c66affSColin Finck STOR_PNP_ACTION PnPAction;
751c2c66affSColin Finck ULONG SrbFlags;
752c2c66affSColin Finck ULONG DataTransferLength;
753c2c66affSColin Finck ULONG TimeOutValue;
754c2c66affSColin Finck PVOID DataBuffer;
755c2c66affSColin Finck PVOID SenseInfoBuffer;
756c2c66affSColin Finck struct _SCSI_REQUEST_BLOCK *NextSrb;
757c2c66affSColin Finck PVOID OriginalRequest;
758c2c66affSColin Finck PVOID SrbExtension;
759c2c66affSColin Finck ULONG SrbPnPFlags;
760c2c66affSColin Finck #if defined(_WIN64)
761c2c66affSColin Finck ULONG Reserved;
762c2c66affSColin Finck #endif
763c2c66affSColin Finck UCHAR Reserved4[16];
764c2c66affSColin Finck } SCSI_PNP_REQUEST_BLOCK, *PSCSI_PNP_REQUEST_BLOCK;
765c2c66affSColin Finck
766c2c66affSColin Finck #include <pshpack1.h>
767c2c66affSColin Finck typedef union _CDB
768c2c66affSColin Finck {
769c2c66affSColin Finck struct _CDB6GENERIC
770c2c66affSColin Finck {
771c2c66affSColin Finck UCHAR OperationCode;
772c2c66affSColin Finck UCHAR Immediate:1;
773c2c66affSColin Finck UCHAR CommandUniqueBits:4;
774c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
775c2c66affSColin Finck UCHAR CommandUniqueBytes[3];
776c2c66affSColin Finck UCHAR Link:1;
777c2c66affSColin Finck UCHAR Flag:1;
778c2c66affSColin Finck UCHAR Reserved:4;
779c2c66affSColin Finck UCHAR VendorUnique:2;
780c2c66affSColin Finck } CDB6GENERIC, *PCDB6GENERIC;
781c2c66affSColin Finck struct _CDB6READWRITE
782c2c66affSColin Finck {
783c2c66affSColin Finck UCHAR OperationCode;
784c2c66affSColin Finck UCHAR LogicalBlockMsb1:5;
785c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
786c2c66affSColin Finck UCHAR LogicalBlockMsb0;
787c2c66affSColin Finck UCHAR LogicalBlockLsb;
788c2c66affSColin Finck UCHAR TransferBlocks;
789c2c66affSColin Finck UCHAR Control;
790c2c66affSColin Finck } CDB6READWRITE, *PCDB6READWRITE;
791c2c66affSColin Finck struct _CDB6INQUIRY
792c2c66affSColin Finck {
793c2c66affSColin Finck UCHAR OperationCode;
794c2c66affSColin Finck UCHAR Reserved1:5;
795c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
796c2c66affSColin Finck UCHAR PageCode;
797c2c66affSColin Finck UCHAR IReserved;
798c2c66affSColin Finck UCHAR AllocationLength;
799c2c66affSColin Finck UCHAR Control;
800c2c66affSColin Finck } CDB6INQUIRY, *PCDB6INQUIRY;
801c2c66affSColin Finck struct _CDB6INQUIRY3
802c2c66affSColin Finck {
803c2c66affSColin Finck UCHAR OperationCode;
804c2c66affSColin Finck UCHAR EnableVitalProductData:1;
805c2c66affSColin Finck UCHAR CommandSupportData:1;
806c2c66affSColin Finck UCHAR Reserved1:6;
807c2c66affSColin Finck UCHAR PageCode;
808c2c66affSColin Finck UCHAR Reserved2;
809c2c66affSColin Finck UCHAR AllocationLength;
810c2c66affSColin Finck UCHAR Control;
811c2c66affSColin Finck } CDB6INQUIRY3, *PCDB6INQUIRY3;
812c2c66affSColin Finck struct _CDB6VERIFY
813c2c66affSColin Finck {
814c2c66affSColin Finck UCHAR OperationCode;
815c2c66affSColin Finck UCHAR Fixed:1;
816c2c66affSColin Finck UCHAR ByteCompare:1;
817c2c66affSColin Finck UCHAR Immediate:1;
818c2c66affSColin Finck UCHAR Reserved:2;
819c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
820c2c66affSColin Finck UCHAR VerificationLength[3];
821c2c66affSColin Finck UCHAR Control;
822c2c66affSColin Finck } CDB6VERIFY, *PCDB6VERIFY;
823c2c66affSColin Finck struct _CDB6FORMAT
824c2c66affSColin Finck {
825c2c66affSColin Finck UCHAR OperationCode;
826c2c66affSColin Finck UCHAR FormatControl:5;
827c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
828c2c66affSColin Finck UCHAR FReserved1;
829c2c66affSColin Finck UCHAR InterleaveMsb;
830c2c66affSColin Finck UCHAR InterleaveLsb;
831c2c66affSColin Finck UCHAR FReserved2;
832c2c66affSColin Finck } CDB6FORMAT, *PCDB6FORMAT;
833c2c66affSColin Finck struct _CDB10
834c2c66affSColin Finck {
835c2c66affSColin Finck UCHAR OperationCode;
836c2c66affSColin Finck UCHAR RelativeAddress:1;
837c2c66affSColin Finck UCHAR Reserved1:2;
838c2c66affSColin Finck UCHAR ForceUnitAccess:1;
839c2c66affSColin Finck UCHAR DisablePageOut:1;
840c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
841c2c66affSColin Finck UCHAR LogicalBlockByte0;
842c2c66affSColin Finck UCHAR LogicalBlockByte1;
843c2c66affSColin Finck UCHAR LogicalBlockByte2;
844c2c66affSColin Finck UCHAR LogicalBlockByte3;
845c2c66affSColin Finck UCHAR Reserved2;
846c2c66affSColin Finck UCHAR TransferBlocksMsb;
847c2c66affSColin Finck UCHAR TransferBlocksLsb;
848c2c66affSColin Finck UCHAR Control;
849c2c66affSColin Finck } CDB10, *PCDB10;
850c2c66affSColin Finck struct _CDB12
851c2c66affSColin Finck {
852c2c66affSColin Finck UCHAR OperationCode;
853c2c66affSColin Finck UCHAR RelativeAddress:1;
854c2c66affSColin Finck UCHAR Reserved1:2;
855c2c66affSColin Finck UCHAR ForceUnitAccess:1;
856c2c66affSColin Finck UCHAR DisablePageOut:1;
857c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
858c2c66affSColin Finck UCHAR LogicalBlock[4];
859c2c66affSColin Finck UCHAR TransferLength[4];
860c2c66affSColin Finck UCHAR Reserved2;
861c2c66affSColin Finck UCHAR Control;
862c2c66affSColin Finck } CDB12, *PCDB12;
863c2c66affSColin Finck struct _CDB16
864c2c66affSColin Finck {
865c2c66affSColin Finck UCHAR OperationCode;
866c2c66affSColin Finck UCHAR Reserved1:3;
867c2c66affSColin Finck UCHAR ForceUnitAccess:1;
868c2c66affSColin Finck UCHAR DisablePageOut:1;
869c2c66affSColin Finck UCHAR Protection:3;
870c2c66affSColin Finck UCHAR LogicalBlock[8];
871c2c66affSColin Finck UCHAR TransferLength[4];
872c2c66affSColin Finck UCHAR Reserved2;
873c2c66affSColin Finck UCHAR Control;
874c2c66affSColin Finck } CDB16, *PCDB16;
875c2c66affSColin Finck struct _PAUSE_RESUME
876c2c66affSColin Finck {
877c2c66affSColin Finck UCHAR OperationCode;
878c2c66affSColin Finck UCHAR Reserved1:5;
879c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
880c2c66affSColin Finck UCHAR Reserved2[6];
881c2c66affSColin Finck UCHAR Action;
882c2c66affSColin Finck UCHAR Control;
883c2c66affSColin Finck } PAUSE_RESUME, *PPAUSE_RESUME;
884c2c66affSColin Finck struct _READ_TOC
885c2c66affSColin Finck {
886c2c66affSColin Finck UCHAR OperationCode;
887c2c66affSColin Finck UCHAR Reserved0:1;
888c2c66affSColin Finck UCHAR Msf:1;
889c2c66affSColin Finck UCHAR Reserved1:3;
890c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
891c2c66affSColin Finck UCHAR Format2:4;
892c2c66affSColin Finck UCHAR Reserved2:4;
893c2c66affSColin Finck UCHAR Reserved3[3];
894c2c66affSColin Finck UCHAR StartingTrack;
895c2c66affSColin Finck UCHAR AllocationLength[2];
896c2c66affSColin Finck UCHAR Control:6;
897c2c66affSColin Finck UCHAR Format:2;
898c2c66affSColin Finck } READ_TOC, *PREAD_TOC;
899c2c66affSColin Finck struct _READ_DISK_INFORMATION
900c2c66affSColin Finck {
901c2c66affSColin Finck UCHAR OperationCode;
902c2c66affSColin Finck UCHAR Reserved1:5;
903c2c66affSColin Finck UCHAR Lun:3;
904c2c66affSColin Finck UCHAR Reserved2[5];
905c2c66affSColin Finck UCHAR AllocationLength[2];
906c2c66affSColin Finck UCHAR Control;
907c2c66affSColin Finck } READ_DISK_INFORMATION, *PREAD_DISK_INFORMATION;
908c2c66affSColin Finck struct _READ_TRACK_INFORMATION
909c2c66affSColin Finck {
910c2c66affSColin Finck UCHAR OperationCode;
911c2c66affSColin Finck UCHAR Track:1;
912c2c66affSColin Finck UCHAR Reserved1:3;
913c2c66affSColin Finck UCHAR Reserved2:1;
914c2c66affSColin Finck UCHAR Lun:3;
915c2c66affSColin Finck UCHAR BlockAddress[4];
916c2c66affSColin Finck UCHAR Reserved3;
917c2c66affSColin Finck UCHAR AllocationLength[2];
918c2c66affSColin Finck UCHAR Control;
919c2c66affSColin Finck } READ_TRACK_INFORMATION, *PREAD_TRACK_INFORMATION;
920c2c66affSColin Finck struct _RESERVE_TRACK_RZONE
921c2c66affSColin Finck {
922c2c66affSColin Finck UCHAR OperationCode;
923c2c66affSColin Finck UCHAR Reserved1[4];
924c2c66affSColin Finck UCHAR ReservationSize[4];
925c2c66affSColin Finck UCHAR Control;
926c2c66affSColin Finck } RESERVE_TRACK_RZONE, *PRESERVE_TRACK_RZONE;
927c2c66affSColin Finck struct _SEND_OPC_INFORMATION
928c2c66affSColin Finck {
929c2c66affSColin Finck UCHAR OperationCode;
930c2c66affSColin Finck UCHAR DoOpc:1;
931c2c66affSColin Finck UCHAR Reserved1:7;
932c2c66affSColin Finck UCHAR Exclude0:1;
933c2c66affSColin Finck UCHAR Exclude1:1;
934c2c66affSColin Finck UCHAR Reserved2:6;
935c2c66affSColin Finck UCHAR Reserved3[4];
936c2c66affSColin Finck UCHAR ParameterListLength[2];
937c2c66affSColin Finck UCHAR Reserved4;
938c2c66affSColin Finck } SEND_OPC_INFORMATION, *PSEND_OPC_INFORMATION;
939c2c66affSColin Finck struct _REPAIR_TRACK
940c2c66affSColin Finck {
941c2c66affSColin Finck UCHAR OperationCode;
942c2c66affSColin Finck UCHAR Immediate:1;
943c2c66affSColin Finck UCHAR Reserved1:7;
944c2c66affSColin Finck UCHAR Reserved2[2];
945c2c66affSColin Finck UCHAR TrackNumber[2];
946c2c66affSColin Finck UCHAR Reserved3[3];
947c2c66affSColin Finck UCHAR Control;
948c2c66affSColin Finck } REPAIR_TRACK, *PREPAIR_TRACK;
949c2c66affSColin Finck struct _CLOSE_TRACK
950c2c66affSColin Finck {
951c2c66affSColin Finck UCHAR OperationCode;
952c2c66affSColin Finck UCHAR Immediate:1;
953c2c66affSColin Finck UCHAR Reserved1:7;
954c2c66affSColin Finck UCHAR Track:1;
955c2c66affSColin Finck UCHAR Session:1;
956c2c66affSColin Finck UCHAR Reserved2:6;
957c2c66affSColin Finck UCHAR Reserved3;
958c2c66affSColin Finck UCHAR TrackNumber[2];
959c2c66affSColin Finck UCHAR Reserved4[3];
960c2c66affSColin Finck UCHAR Control;
961c2c66affSColin Finck } CLOSE_TRACK, *PCLOSE_TRACK;
962c2c66affSColin Finck struct _READ_BUFFER_CAPACITY
963c2c66affSColin Finck {
964c2c66affSColin Finck UCHAR OperationCode;
965c2c66affSColin Finck UCHAR BlockInfo:1;
966c2c66affSColin Finck UCHAR Reserved1:7;
967c2c66affSColin Finck UCHAR Reserved2[5];
968c2c66affSColin Finck UCHAR AllocationLength[2];
969c2c66affSColin Finck UCHAR Control;
970c2c66affSColin Finck } READ_BUFFER_CAPACITY, *PREAD_BUFFER_CAPACITY;
971c2c66affSColin Finck struct _SEND_CUE_SHEET
972c2c66affSColin Finck {
973c2c66affSColin Finck UCHAR OperationCode;
974c2c66affSColin Finck UCHAR Reserved[5];
975c2c66affSColin Finck UCHAR CueSheetSize[3];
976c2c66affSColin Finck UCHAR Control;
977c2c66affSColin Finck } SEND_CUE_SHEET, *PSEND_CUE_SHEET;
978c2c66affSColin Finck struct _READ_HEADER
979c2c66affSColin Finck {
980c2c66affSColin Finck UCHAR OperationCode;
981c2c66affSColin Finck UCHAR Reserved1:1;
982c2c66affSColin Finck UCHAR Msf:1;
983c2c66affSColin Finck UCHAR Reserved2:3;
984c2c66affSColin Finck UCHAR Lun:3;
985c2c66affSColin Finck UCHAR LogicalBlockAddress[4];
986c2c66affSColin Finck UCHAR Reserved3;
987c2c66affSColin Finck UCHAR AllocationLength[2];
988c2c66affSColin Finck UCHAR Control;
989c2c66affSColin Finck } READ_HEADER, *PREAD_HEADER;
990c2c66affSColin Finck struct _PLAY_AUDIO
991c2c66affSColin Finck {
992c2c66affSColin Finck UCHAR OperationCode;
993c2c66affSColin Finck UCHAR Reserved1:5;
994c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
995c2c66affSColin Finck UCHAR StartingBlockAddress[4];
996c2c66affSColin Finck UCHAR Reserved2;
997c2c66affSColin Finck UCHAR PlayLength[2];
998c2c66affSColin Finck UCHAR Control;
999c2c66affSColin Finck } PLAY_AUDIO, *PPLAY_AUDIO;
1000c2c66affSColin Finck struct _PLAY_AUDIO_MSF
1001c2c66affSColin Finck {
1002c2c66affSColin Finck UCHAR OperationCode;
1003c2c66affSColin Finck UCHAR Reserved1:5;
1004c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1005c2c66affSColin Finck UCHAR Reserved2;
1006c2c66affSColin Finck UCHAR StartingM;
1007c2c66affSColin Finck UCHAR StartingS;
1008c2c66affSColin Finck UCHAR StartingF;
1009c2c66affSColin Finck UCHAR EndingM;
1010c2c66affSColin Finck UCHAR EndingS;
1011c2c66affSColin Finck UCHAR EndingF;
1012c2c66affSColin Finck UCHAR Control;
1013c2c66affSColin Finck } PLAY_AUDIO_MSF, *PPLAY_AUDIO_MSF;
1014c2c66affSColin Finck struct _BLANK_MEDIA
1015c2c66affSColin Finck {
1016c2c66affSColin Finck UCHAR OperationCode;
1017c2c66affSColin Finck UCHAR BlankType:3;
1018c2c66affSColin Finck UCHAR Reserved1:1;
1019c2c66affSColin Finck UCHAR Immediate:1;
1020c2c66affSColin Finck UCHAR Reserved2:3;
1021c2c66affSColin Finck UCHAR AddressOrTrack[4];
1022c2c66affSColin Finck UCHAR Reserved3[5];
1023c2c66affSColin Finck UCHAR Control;
1024c2c66affSColin Finck } BLANK_MEDIA, *PBLANK_MEDIA;
1025c2c66affSColin Finck struct _PLAY_CD
1026c2c66affSColin Finck {
1027c2c66affSColin Finck UCHAR OperationCode;
1028c2c66affSColin Finck UCHAR Reserved1:1;
1029c2c66affSColin Finck UCHAR CMSF:1;
1030c2c66affSColin Finck UCHAR ExpectedSectorType:3;
1031c2c66affSColin Finck UCHAR Lun:3;
1032c2c66affSColin Finck _ANONYMOUS_UNION union
1033c2c66affSColin Finck {
1034c2c66affSColin Finck struct _LBA
1035c2c66affSColin Finck {
1036c2c66affSColin Finck UCHAR StartingBlockAddress[4];
1037c2c66affSColin Finck UCHAR PlayLength[4];
1038c2c66affSColin Finck } LBA;
1039c2c66affSColin Finck struct _MSF
1040c2c66affSColin Finck {
1041c2c66affSColin Finck UCHAR Reserved1;
1042c2c66affSColin Finck UCHAR StartingM;
1043c2c66affSColin Finck UCHAR StartingS;
1044c2c66affSColin Finck UCHAR StartingF;
1045c2c66affSColin Finck UCHAR EndingM;
1046c2c66affSColin Finck UCHAR EndingS;
1047c2c66affSColin Finck UCHAR EndingF;
1048c2c66affSColin Finck UCHAR Reserved2;
1049c2c66affSColin Finck } MSF;
1050c2c66affSColin Finck } DUMMYUNIONNAME;
1051c2c66affSColin Finck UCHAR Audio:1;
1052c2c66affSColin Finck UCHAR Composite:1;
1053c2c66affSColin Finck UCHAR Port1:1;
1054c2c66affSColin Finck UCHAR Port2:1;
1055c2c66affSColin Finck UCHAR Reserved2:3;
1056c2c66affSColin Finck UCHAR Speed:1;
1057c2c66affSColin Finck UCHAR Control;
1058c2c66affSColin Finck } PLAY_CD, *PPLAY_CD;
1059c2c66affSColin Finck struct _SCAN_CD
1060c2c66affSColin Finck {
1061c2c66affSColin Finck UCHAR OperationCode;
1062c2c66affSColin Finck UCHAR RelativeAddress:1;
1063c2c66affSColin Finck UCHAR Reserved1:3;
1064c2c66affSColin Finck UCHAR Direct:1;
1065c2c66affSColin Finck UCHAR Lun:3;
1066c2c66affSColin Finck UCHAR StartingAddress[4];
1067c2c66affSColin Finck UCHAR Reserved2[3];
1068c2c66affSColin Finck UCHAR Reserved3:6;
1069c2c66affSColin Finck UCHAR Type:2;
1070c2c66affSColin Finck UCHAR Reserved4;
1071c2c66affSColin Finck UCHAR Control;
1072c2c66affSColin Finck } SCAN_CD, *PSCAN_CD;
1073c2c66affSColin Finck struct _STOP_PLAY_SCAN
1074c2c66affSColin Finck {
1075c2c66affSColin Finck UCHAR OperationCode;
1076c2c66affSColin Finck UCHAR Reserved1:5;
1077c2c66affSColin Finck UCHAR Lun:3;
1078c2c66affSColin Finck UCHAR Reserved2[7];
1079c2c66affSColin Finck UCHAR Control;
1080c2c66affSColin Finck } STOP_PLAY_SCAN, *PSTOP_PLAY_SCAN;
1081c2c66affSColin Finck struct _SUBCHANNEL
1082c2c66affSColin Finck {
1083c2c66affSColin Finck UCHAR OperationCode;
1084c2c66affSColin Finck UCHAR Reserved0:1;
1085c2c66affSColin Finck UCHAR Msf:1;
1086c2c66affSColin Finck UCHAR Reserved1:3;
1087c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1088c2c66affSColin Finck UCHAR Reserved2:6;
1089c2c66affSColin Finck UCHAR SubQ:1;
1090c2c66affSColin Finck UCHAR Reserved3:1;
1091c2c66affSColin Finck UCHAR Format;
1092c2c66affSColin Finck UCHAR Reserved4[2];
1093c2c66affSColin Finck UCHAR TrackNumber;
1094c2c66affSColin Finck UCHAR AllocationLength[2];
1095c2c66affSColin Finck UCHAR Control;
1096c2c66affSColin Finck } SUBCHANNEL, *PSUBCHANNEL;
1097c2c66affSColin Finck struct _READ_CD
1098c2c66affSColin Finck {
1099c2c66affSColin Finck UCHAR OperationCode;
1100c2c66affSColin Finck UCHAR RelativeAddress:1;
1101c2c66affSColin Finck UCHAR Reserved0:1;
1102c2c66affSColin Finck UCHAR ExpectedSectorType:3;
1103c2c66affSColin Finck UCHAR Lun:3;
1104c2c66affSColin Finck UCHAR StartingLBA[4];
1105c2c66affSColin Finck UCHAR TransferBlocks[3];
1106c2c66affSColin Finck UCHAR Reserved2:1;
1107c2c66affSColin Finck UCHAR ErrorFlags:2;
1108c2c66affSColin Finck UCHAR IncludeEDC:1;
1109c2c66affSColin Finck UCHAR IncludeUserData:1;
1110c2c66affSColin Finck UCHAR HeaderCode:2;
1111c2c66affSColin Finck UCHAR IncludeSyncData:1;
1112c2c66affSColin Finck UCHAR SubChannelSelection:3;
1113c2c66affSColin Finck UCHAR Reserved3:5;
1114c2c66affSColin Finck UCHAR Control;
1115c2c66affSColin Finck } READ_CD, *PREAD_CD;
1116c2c66affSColin Finck struct _READ_CD_MSF
1117c2c66affSColin Finck {
1118c2c66affSColin Finck UCHAR OperationCode;
1119c2c66affSColin Finck UCHAR RelativeAddress:1;
1120c2c66affSColin Finck UCHAR Reserved1:1;
1121c2c66affSColin Finck UCHAR ExpectedSectorType:3;
1122c2c66affSColin Finck UCHAR Lun:3;
1123c2c66affSColin Finck UCHAR Reserved2;
1124c2c66affSColin Finck UCHAR StartingM;
1125c2c66affSColin Finck UCHAR StartingS;
1126c2c66affSColin Finck UCHAR StartingF;
1127c2c66affSColin Finck UCHAR EndingM;
1128c2c66affSColin Finck UCHAR EndingS;
1129c2c66affSColin Finck UCHAR EndingF;
1130c2c66affSColin Finck UCHAR Reserved3;
1131c2c66affSColin Finck UCHAR Reserved4:1;
1132c2c66affSColin Finck UCHAR ErrorFlags:2;
1133c2c66affSColin Finck UCHAR IncludeEDC:1;
1134c2c66affSColin Finck UCHAR IncludeUserData:1;
1135c2c66affSColin Finck UCHAR HeaderCode:2;
1136c2c66affSColin Finck UCHAR IncludeSyncData:1;
1137c2c66affSColin Finck UCHAR SubChannelSelection:3;
1138c2c66affSColin Finck UCHAR Reserved5:5;
1139c2c66affSColin Finck UCHAR Control;
1140c2c66affSColin Finck } READ_CD_MSF, *PREAD_CD_MSF;
1141c2c66affSColin Finck struct _PLXTR_READ_CDDA
1142c2c66affSColin Finck {
1143c2c66affSColin Finck UCHAR OperationCode;
1144c2c66affSColin Finck UCHAR Reserved0:5;
1145c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1146c2c66affSColin Finck UCHAR LogicalBlockByte0;
1147c2c66affSColin Finck UCHAR LogicalBlockByte1;
1148c2c66affSColin Finck UCHAR LogicalBlockByte2;
1149c2c66affSColin Finck UCHAR LogicalBlockByte3;
1150c2c66affSColin Finck UCHAR TransferBlockByte0;
1151c2c66affSColin Finck UCHAR TransferBlockByte1;
1152c2c66affSColin Finck UCHAR TransferBlockByte2;
1153c2c66affSColin Finck UCHAR TransferBlockByte3;
1154c2c66affSColin Finck UCHAR SubCode;
1155c2c66affSColin Finck UCHAR Control;
1156c2c66affSColin Finck } PLXTR_READ_CDDA, *PPLXTR_READ_CDDA;
1157c2c66affSColin Finck struct _NEC_READ_CDDA
1158c2c66affSColin Finck {
1159c2c66affSColin Finck UCHAR OperationCode;
1160c2c66affSColin Finck UCHAR Reserved0;
1161c2c66affSColin Finck UCHAR LogicalBlockByte0;
1162c2c66affSColin Finck UCHAR LogicalBlockByte1;
1163c2c66affSColin Finck UCHAR LogicalBlockByte2;
1164c2c66affSColin Finck UCHAR LogicalBlockByte3;
1165c2c66affSColin Finck UCHAR Reserved1;
1166c2c66affSColin Finck UCHAR TransferBlockByte0;
1167c2c66affSColin Finck UCHAR TransferBlockByte1;
1168c2c66affSColin Finck UCHAR Control;
1169c2c66affSColin Finck } NEC_READ_CDDA, *PNEC_READ_CDDA;
1170c2c66affSColin Finck struct _MODE_SENSE
1171c2c66affSColin Finck {
1172c2c66affSColin Finck UCHAR OperationCode;
1173c2c66affSColin Finck UCHAR Reserved1:3;
1174c2c66affSColin Finck UCHAR Dbd:1;
1175c2c66affSColin Finck UCHAR Reserved2:1;
1176c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1177c2c66affSColin Finck UCHAR PageCode:6;
1178c2c66affSColin Finck UCHAR Pc:2;
1179c2c66affSColin Finck UCHAR Reserved3;
1180c2c66affSColin Finck UCHAR AllocationLength;
1181c2c66affSColin Finck UCHAR Control;
1182c2c66affSColin Finck } MODE_SENSE, *PMODE_SENSE;
1183c2c66affSColin Finck struct _MODE_SENSE10
1184c2c66affSColin Finck {
1185c2c66affSColin Finck UCHAR OperationCode;
1186c2c66affSColin Finck UCHAR Reserved1:3;
1187c2c66affSColin Finck UCHAR Dbd:1;
1188c2c66affSColin Finck UCHAR Reserved2:1;
1189c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1190c2c66affSColin Finck UCHAR PageCode:6;
1191c2c66affSColin Finck UCHAR Pc:2;
1192c2c66affSColin Finck UCHAR Reserved3[4];
1193c2c66affSColin Finck UCHAR AllocationLength[2];
1194c2c66affSColin Finck UCHAR Control;
1195c2c66affSColin Finck } MODE_SENSE10, *PMODE_SENSE10;
1196c2c66affSColin Finck struct _MODE_SELECT
1197c2c66affSColin Finck {
1198c2c66affSColin Finck UCHAR OperationCode;
1199c2c66affSColin Finck UCHAR SPBit:1;
1200c2c66affSColin Finck UCHAR Reserved1:3;
1201c2c66affSColin Finck UCHAR PFBit:1;
1202c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1203c2c66affSColin Finck UCHAR Reserved2[2];
1204c2c66affSColin Finck UCHAR ParameterListLength;
1205c2c66affSColin Finck UCHAR Control;
1206c2c66affSColin Finck } MODE_SELECT, *PMODE_SELECT;
1207c2c66affSColin Finck struct _MODE_SELECT10
1208c2c66affSColin Finck {
1209c2c66affSColin Finck UCHAR OperationCode;
1210c2c66affSColin Finck UCHAR SPBit:1;
1211c2c66affSColin Finck UCHAR Reserved1:3;
1212c2c66affSColin Finck UCHAR PFBit:1;
1213c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1214c2c66affSColin Finck UCHAR Reserved2[5];
1215c2c66affSColin Finck UCHAR ParameterListLength[2];
1216c2c66affSColin Finck UCHAR Control;
1217c2c66affSColin Finck } MODE_SELECT10, *PMODE_SELECT10;
1218c2c66affSColin Finck struct _LOCATE
1219c2c66affSColin Finck {
1220c2c66affSColin Finck UCHAR OperationCode;
1221c2c66affSColin Finck UCHAR Immediate:1;
1222c2c66affSColin Finck UCHAR CPBit:1;
1223c2c66affSColin Finck UCHAR BTBit:1;
1224c2c66affSColin Finck UCHAR Reserved1:2;
1225c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1226c2c66affSColin Finck UCHAR Reserved3;
1227c2c66affSColin Finck UCHAR LogicalBlockAddress[4];
1228c2c66affSColin Finck UCHAR Reserved4;
1229c2c66affSColin Finck UCHAR Partition;
1230c2c66affSColin Finck UCHAR Control;
1231c2c66affSColin Finck } LOCATE, *PLOCATE;
1232c2c66affSColin Finck struct _LOGSENSE
1233c2c66affSColin Finck {
1234c2c66affSColin Finck UCHAR OperationCode;
1235c2c66affSColin Finck UCHAR SPBit:1;
1236c2c66affSColin Finck UCHAR PPCBit:1;
1237c2c66affSColin Finck UCHAR Reserved1:3;
1238c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1239c2c66affSColin Finck UCHAR PageCode:6;
1240c2c66affSColin Finck UCHAR PCBit:2;
1241c2c66affSColin Finck UCHAR Reserved2;
1242c2c66affSColin Finck UCHAR Reserved3;
1243c2c66affSColin Finck UCHAR ParameterPointer[2];
1244c2c66affSColin Finck UCHAR AllocationLength[2];
1245c2c66affSColin Finck UCHAR Control;
1246c2c66affSColin Finck } LOGSENSE, *PLOGSENSE;
1247c2c66affSColin Finck struct _LOGSELECT
1248c2c66affSColin Finck {
1249c2c66affSColin Finck UCHAR OperationCode;
1250c2c66affSColin Finck UCHAR SPBit:1;
1251c2c66affSColin Finck UCHAR PCRBit:1;
1252c2c66affSColin Finck UCHAR Reserved1:3;
1253c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1254c2c66affSColin Finck UCHAR Reserved:6;
1255c2c66affSColin Finck UCHAR PCBit:2;
1256c2c66affSColin Finck UCHAR Reserved2[4];
1257c2c66affSColin Finck UCHAR ParameterListLength[2];
1258c2c66affSColin Finck UCHAR Control;
1259c2c66affSColin Finck } LOGSELECT, *PLOGSELECT;
1260c2c66affSColin Finck struct _PRINT
1261c2c66affSColin Finck {
1262c2c66affSColin Finck UCHAR OperationCode;
1263c2c66affSColin Finck UCHAR Reserved:5;
1264c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1265c2c66affSColin Finck UCHAR TransferLength[3];
1266c2c66affSColin Finck UCHAR Control;
1267c2c66affSColin Finck } PRINT, *PPRINT;
1268c2c66affSColin Finck struct _SEEK
1269c2c66affSColin Finck {
1270c2c66affSColin Finck UCHAR OperationCode;
1271c2c66affSColin Finck UCHAR Reserved1:5;
1272c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1273c2c66affSColin Finck UCHAR LogicalBlockAddress[4];
1274c2c66affSColin Finck UCHAR Reserved2[3];
1275c2c66affSColin Finck UCHAR Control;
1276c2c66affSColin Finck } SEEK, *PSEEK;
1277c2c66affSColin Finck struct _ERASE
1278c2c66affSColin Finck {
1279c2c66affSColin Finck UCHAR OperationCode;
1280c2c66affSColin Finck UCHAR Long:1;
1281c2c66affSColin Finck UCHAR Immediate:1;
1282c2c66affSColin Finck UCHAR Reserved1:3;
1283c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1284c2c66affSColin Finck UCHAR Reserved2[3];
1285c2c66affSColin Finck UCHAR Control;
1286c2c66affSColin Finck } ERASE, *PERASE;
1287c2c66affSColin Finck struct _START_STOP
1288c2c66affSColin Finck {
1289c2c66affSColin Finck UCHAR OperationCode;
1290c2c66affSColin Finck UCHAR Immediate:1;
1291c2c66affSColin Finck UCHAR Reserved1:4;
1292c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1293c2c66affSColin Finck UCHAR Reserved2[2];
1294c2c66affSColin Finck UCHAR Start:1;
1295c2c66affSColin Finck UCHAR LoadEject:1;
1296c2c66affSColin Finck UCHAR Reserved3:6;
1297c2c66affSColin Finck UCHAR Control;
1298c2c66affSColin Finck } START_STOP, *PSTART_STOP;
1299c2c66affSColin Finck struct _MEDIA_REMOVAL
1300c2c66affSColin Finck {
1301c2c66affSColin Finck UCHAR OperationCode;
1302c2c66affSColin Finck UCHAR Reserved1:5;
1303c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1304c2c66affSColin Finck UCHAR Reserved2[2];
1305c2c66affSColin Finck UCHAR Prevent:1;
1306c2c66affSColin Finck UCHAR Persistant:1;
1307c2c66affSColin Finck UCHAR Reserved3:6;
1308c2c66affSColin Finck UCHAR Control;
1309c2c66affSColin Finck } MEDIA_REMOVAL, *PMEDIA_REMOVAL;
1310c2c66affSColin Finck struct _SEEK_BLOCK
1311c2c66affSColin Finck {
1312c2c66affSColin Finck UCHAR OperationCode;
1313c2c66affSColin Finck UCHAR Immediate:1;
1314c2c66affSColin Finck UCHAR Reserved1:7;
1315c2c66affSColin Finck UCHAR BlockAddress[3];
1316c2c66affSColin Finck UCHAR Link:1;
1317c2c66affSColin Finck UCHAR Flag:1;
1318c2c66affSColin Finck UCHAR Reserved2:4;
1319c2c66affSColin Finck UCHAR VendorUnique:2;
1320c2c66affSColin Finck } SEEK_BLOCK, *PSEEK_BLOCK;
1321c2c66affSColin Finck struct _REQUEST_BLOCK_ADDRESS
1322c2c66affSColin Finck {
1323c2c66affSColin Finck UCHAR OperationCode;
1324c2c66affSColin Finck UCHAR Reserved1[3];
1325c2c66affSColin Finck UCHAR AllocationLength;
1326c2c66affSColin Finck UCHAR Link:1;
1327c2c66affSColin Finck UCHAR Flag:1;
1328c2c66affSColin Finck UCHAR Reserved2:4;
1329c2c66affSColin Finck UCHAR VendorUnique:2;
1330c2c66affSColin Finck } REQUEST_BLOCK_ADDRESS, *PREQUEST_BLOCK_ADDRESS;
1331c2c66affSColin Finck struct _PARTITION
1332c2c66affSColin Finck {
1333c2c66affSColin Finck UCHAR OperationCode;
1334c2c66affSColin Finck UCHAR Immediate:1;
1335c2c66affSColin Finck UCHAR Sel:1;
1336c2c66affSColin Finck UCHAR PartitionSelect:6;
1337c2c66affSColin Finck UCHAR Reserved1[3];
1338c2c66affSColin Finck UCHAR Control;
1339c2c66affSColin Finck } PARTITION, *PPARTITION;
1340c2c66affSColin Finck struct _WRITE_TAPE_MARKS
1341c2c66affSColin Finck {
1342c2c66affSColin Finck UCHAR OperationCode;
1343c2c66affSColin Finck UCHAR Immediate:1;
1344c2c66affSColin Finck UCHAR WriteSetMarks:1;
1345c2c66affSColin Finck UCHAR Reserved:3;
1346c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1347c2c66affSColin Finck UCHAR TransferLength[3];
1348c2c66affSColin Finck UCHAR Control;
1349c2c66affSColin Finck } WRITE_TAPE_MARKS, *PWRITE_TAPE_MARKS;
1350c2c66affSColin Finck struct _SPACE_TAPE_MARKS
1351c2c66affSColin Finck {
1352c2c66affSColin Finck UCHAR OperationCode;
1353c2c66affSColin Finck UCHAR Code:3;
1354c2c66affSColin Finck UCHAR Reserved:2;
1355c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1356c2c66affSColin Finck UCHAR NumMarksMSB;
1357c2c66affSColin Finck UCHAR NumMarks;
1358c2c66affSColin Finck UCHAR NumMarksLSB;
1359c2c66affSColin Finck union
1360c2c66affSColin Finck {
1361c2c66affSColin Finck UCHAR value;
1362c2c66affSColin Finck struct
1363c2c66affSColin Finck {
1364c2c66affSColin Finck UCHAR Link:1;
1365c2c66affSColin Finck UCHAR Flag:1;
1366c2c66affSColin Finck UCHAR Reserved:4;
1367c2c66affSColin Finck UCHAR VendorUnique:2;
1368c2c66affSColin Finck } Fields;
1369c2c66affSColin Finck } Byte6;
1370c2c66affSColin Finck } SPACE_TAPE_MARKS, *PSPACE_TAPE_MARKS;
1371c2c66affSColin Finck struct _READ_POSITION
1372c2c66affSColin Finck {
1373c2c66affSColin Finck UCHAR Operation;
1374c2c66affSColin Finck UCHAR BlockType:1;
1375c2c66affSColin Finck UCHAR Reserved1:4;
1376c2c66affSColin Finck UCHAR Lun:3;
1377c2c66affSColin Finck UCHAR Reserved2[7];
1378c2c66affSColin Finck UCHAR Control;
1379c2c66affSColin Finck } READ_POSITION, *PREAD_POSITION;
1380c2c66affSColin Finck struct _CDB6READWRITETAPE
1381c2c66affSColin Finck {
1382c2c66affSColin Finck UCHAR OperationCode;
1383c2c66affSColin Finck UCHAR VendorSpecific:5;
1384c2c66affSColin Finck UCHAR Reserved:3;
1385c2c66affSColin Finck UCHAR TransferLenMSB;
1386c2c66affSColin Finck UCHAR TransferLen;
1387c2c66affSColin Finck UCHAR TransferLenLSB;
1388c2c66affSColin Finck UCHAR Link:1;
1389c2c66affSColin Finck UCHAR Flag:1;
1390c2c66affSColin Finck UCHAR Reserved1:4;
1391c2c66affSColin Finck UCHAR VendorUnique:2;
1392c2c66affSColin Finck } CDB6READWRITETAPE, *PCDB6READWRITETAPE;
1393c2c66affSColin Finck struct _INIT_ELEMENT_STATUS
1394c2c66affSColin Finck {
1395c2c66affSColin Finck UCHAR OperationCode;
1396c2c66affSColin Finck UCHAR Reserved1:5;
1397c2c66affSColin Finck UCHAR LogicalUnitNubmer:3;
1398c2c66affSColin Finck UCHAR Reserved2[3];
1399c2c66affSColin Finck UCHAR Reserved3:7;
1400c2c66affSColin Finck UCHAR NoBarCode:1;
1401c2c66affSColin Finck } INIT_ELEMENT_STATUS, *PINIT_ELEMENT_STATUS;
1402c2c66affSColin Finck struct _INITIALIZE_ELEMENT_RANGE
1403c2c66affSColin Finck {
1404c2c66affSColin Finck UCHAR OperationCode;
1405c2c66affSColin Finck UCHAR Range:1;
1406c2c66affSColin Finck UCHAR Reserved1:4;
1407c2c66affSColin Finck UCHAR LogicalUnitNubmer:3;
1408c2c66affSColin Finck UCHAR FirstElementAddress[2];
1409c2c66affSColin Finck UCHAR Reserved2[2];
1410c2c66affSColin Finck UCHAR NumberOfElements[2];
1411c2c66affSColin Finck UCHAR Reserved3;
1412c2c66affSColin Finck UCHAR Reserved4:7;
1413c2c66affSColin Finck UCHAR NoBarCode:1;
1414c2c66affSColin Finck } INITIALIZE_ELEMENT_RANGE, *PINITIALIZE_ELEMENT_RANGE;
1415c2c66affSColin Finck struct _POSITION_TO_ELEMENT
1416c2c66affSColin Finck {
1417c2c66affSColin Finck UCHAR OperationCode;
1418c2c66affSColin Finck UCHAR Reserved1:5;
1419c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1420c2c66affSColin Finck UCHAR TransportElementAddress[2];
1421c2c66affSColin Finck UCHAR DestinationElementAddress[2];
1422c2c66affSColin Finck UCHAR Reserved2[2];
1423c2c66affSColin Finck UCHAR Flip:1;
1424c2c66affSColin Finck UCHAR Reserved3:7;
1425c2c66affSColin Finck UCHAR Control;
1426c2c66affSColin Finck } POSITION_TO_ELEMENT, *PPOSITION_TO_ELEMENT;
1427c2c66affSColin Finck struct _MOVE_MEDIUM
1428c2c66affSColin Finck {
1429c2c66affSColin Finck UCHAR OperationCode;
1430c2c66affSColin Finck UCHAR Reserved1:5;
1431c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1432c2c66affSColin Finck UCHAR TransportElementAddress[2];
1433c2c66affSColin Finck UCHAR SourceElementAddress[2];
1434c2c66affSColin Finck UCHAR DestinationElementAddress[2];
1435c2c66affSColin Finck UCHAR Reserved2[2];
1436c2c66affSColin Finck UCHAR Flip:1;
1437c2c66affSColin Finck UCHAR Reserved3:7;
1438c2c66affSColin Finck UCHAR Control;
1439c2c66affSColin Finck } MOVE_MEDIUM, *PMOVE_MEDIUM;
1440c2c66affSColin Finck struct _EXCHANGE_MEDIUM
1441c2c66affSColin Finck {
1442c2c66affSColin Finck UCHAR OperationCode;
1443c2c66affSColin Finck UCHAR Reserved1:5;
1444c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1445c2c66affSColin Finck UCHAR TransportElementAddress[2];
1446c2c66affSColin Finck UCHAR SourceElementAddress[2];
1447c2c66affSColin Finck UCHAR Destination1ElementAddress[2];
1448c2c66affSColin Finck UCHAR Destination2ElementAddress[2];
1449c2c66affSColin Finck UCHAR Flip1:1;
1450c2c66affSColin Finck UCHAR Flip2:1;
1451c2c66affSColin Finck UCHAR Reserved3:6;
1452c2c66affSColin Finck UCHAR Control;
1453c2c66affSColin Finck } EXCHANGE_MEDIUM, *PEXCHANGE_MEDIUM;
1454c2c66affSColin Finck struct _READ_ELEMENT_STATUS
1455c2c66affSColin Finck {
1456c2c66affSColin Finck UCHAR OperationCode;
1457c2c66affSColin Finck UCHAR ElementType:4;
1458c2c66affSColin Finck UCHAR VolTag:1;
1459c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1460c2c66affSColin Finck UCHAR StartingElementAddress[2];
1461c2c66affSColin Finck UCHAR NumberOfElements[2];
1462c2c66affSColin Finck UCHAR Reserved1;
1463c2c66affSColin Finck UCHAR AllocationLength[3];
1464c2c66affSColin Finck UCHAR Reserved2;
1465c2c66affSColin Finck UCHAR Control;
1466c2c66affSColin Finck } READ_ELEMENT_STATUS, *PREAD_ELEMENT_STATUS;
1467c2c66affSColin Finck struct _SEND_VOLUME_TAG
1468c2c66affSColin Finck {
1469c2c66affSColin Finck UCHAR OperationCode;
1470c2c66affSColin Finck UCHAR ElementType:4;
1471c2c66affSColin Finck UCHAR Reserved1:1;
1472c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1473c2c66affSColin Finck UCHAR StartingElementAddress[2];
1474c2c66affSColin Finck UCHAR Reserved2;
1475c2c66affSColin Finck UCHAR ActionCode:5;
1476c2c66affSColin Finck UCHAR Reserved3:3;
1477c2c66affSColin Finck UCHAR Reserved4[2];
1478c2c66affSColin Finck UCHAR ParameterListLength[2];
1479c2c66affSColin Finck UCHAR Reserved5;
1480c2c66affSColin Finck UCHAR Control;
1481c2c66affSColin Finck } SEND_VOLUME_TAG, *PSEND_VOLUME_TAG;
1482c2c66affSColin Finck struct _REQUEST_VOLUME_ELEMENT_ADDRESS
1483c2c66affSColin Finck {
1484c2c66affSColin Finck UCHAR OperationCode;
1485c2c66affSColin Finck UCHAR ElementType:4;
1486c2c66affSColin Finck UCHAR VolTag:1;
1487c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1488c2c66affSColin Finck UCHAR StartingElementAddress[2];
1489c2c66affSColin Finck UCHAR NumberElements[2];
1490c2c66affSColin Finck UCHAR Reserved1;
1491c2c66affSColin Finck UCHAR AllocationLength[3];
1492c2c66affSColin Finck UCHAR Reserved2;
1493c2c66affSColin Finck UCHAR Control;
1494c2c66affSColin Finck } REQUEST_VOLUME_ELEMENT_ADDRESS, *PREQUEST_VOLUME_ELEMENT_ADDRESS;
1495c2c66affSColin Finck struct _LOAD_UNLOAD
1496c2c66affSColin Finck {
1497c2c66affSColin Finck UCHAR OperationCode;
1498c2c66affSColin Finck UCHAR Immediate:1;
1499c2c66affSColin Finck UCHAR Reserved1:4;
1500c2c66affSColin Finck UCHAR Lun:3;
1501c2c66affSColin Finck UCHAR Reserved2[2];
1502c2c66affSColin Finck UCHAR Start:1;
1503c2c66affSColin Finck UCHAR LoadEject:1;
1504c2c66affSColin Finck UCHAR Reserved3:6;
1505c2c66affSColin Finck UCHAR Reserved4[3];
1506c2c66affSColin Finck UCHAR Slot;
1507c2c66affSColin Finck UCHAR Reserved5[3];
1508c2c66affSColin Finck } LOAD_UNLOAD, *PLOAD_UNLOAD;
1509c2c66affSColin Finck struct _MECH_STATUS
1510c2c66affSColin Finck {
1511c2c66affSColin Finck UCHAR OperationCode;
1512c2c66affSColin Finck UCHAR Reserved:5;
1513c2c66affSColin Finck UCHAR Lun:3;
1514c2c66affSColin Finck UCHAR Reserved1[6];
1515c2c66affSColin Finck UCHAR AllocationLength[2];
1516c2c66affSColin Finck UCHAR Reserved2[1];
1517c2c66affSColin Finck UCHAR Control;
1518c2c66affSColin Finck } MECH_STATUS, *PMECH_STATUS;
1519c2c66affSColin Finck struct _SYNCHRONIZE_CACHE10
1520c2c66affSColin Finck {
1521c2c66affSColin Finck UCHAR OperationCode;
1522c2c66affSColin Finck UCHAR RelAddr:1;
1523c2c66affSColin Finck UCHAR Immediate:1;
1524c2c66affSColin Finck UCHAR Reserved:3;
1525c2c66affSColin Finck UCHAR Lun:3;
1526c2c66affSColin Finck UCHAR LogicalBlockAddress[4];
1527c2c66affSColin Finck UCHAR Reserved2;
1528c2c66affSColin Finck UCHAR BlockCount[2];
1529c2c66affSColin Finck UCHAR Control;
1530c2c66affSColin Finck } SYNCHRONIZE_CACHE10, *PSYNCHRONIZE_CACHE10;
1531c2c66affSColin Finck struct _GET_EVENT_STATUS_NOTIFICATION
1532c2c66affSColin Finck {
1533c2c66affSColin Finck UCHAR OperationCode;
1534c2c66affSColin Finck UCHAR Immediate:1;
1535c2c66affSColin Finck UCHAR Reserved:4;
1536c2c66affSColin Finck UCHAR Lun:3;
1537c2c66affSColin Finck UCHAR Reserved2[2];
1538c2c66affSColin Finck UCHAR NotificationClassRequest;
1539c2c66affSColin Finck UCHAR Reserved3[2];
1540c2c66affSColin Finck UCHAR EventListLength[2];
1541c2c66affSColin Finck UCHAR Control;
1542c2c66affSColin Finck } GET_EVENT_STATUS_NOTIFICATION, *PGET_EVENT_STATUS_NOTIFICATION;
1543c2c66affSColin Finck struct _GET_PERFORMANCE
1544c2c66affSColin Finck {
1545c2c66affSColin Finck UCHAR OperationCode;
1546c2c66affSColin Finck UCHAR Except:2;
1547c2c66affSColin Finck UCHAR Write:1;
1548c2c66affSColin Finck UCHAR Tolerance:2;
1549c2c66affSColin Finck UCHAR Reserved0:3;
1550c2c66affSColin Finck UCHAR StartingLBA[4];
1551c2c66affSColin Finck UCHAR Reserved1[2];
1552c2c66affSColin Finck UCHAR MaximumNumberOfDescriptors[2];
1553c2c66affSColin Finck UCHAR Type;
1554c2c66affSColin Finck UCHAR Control;
1555c2c66affSColin Finck } GET_PERFORMANCE;
1556c2c66affSColin Finck struct _READ_DVD_STRUCTURE
1557c2c66affSColin Finck {
1558c2c66affSColin Finck UCHAR OperationCode;
1559c2c66affSColin Finck UCHAR Reserved1:5;
1560c2c66affSColin Finck UCHAR Lun:3;
1561c2c66affSColin Finck UCHAR RMDBlockNumber[4];
1562c2c66affSColin Finck UCHAR LayerNumber;
1563c2c66affSColin Finck UCHAR Format;
1564c2c66affSColin Finck UCHAR AllocationLength[2];
1565c2c66affSColin Finck UCHAR Reserved3:6;
1566c2c66affSColin Finck UCHAR AGID:2;
1567c2c66affSColin Finck UCHAR Control;
1568c2c66affSColin Finck } READ_DVD_STRUCTURE, *PREAD_DVD_STRUCTURE;
1569c2c66affSColin Finck struct _SET_STREAMING
1570c2c66affSColin Finck {
1571c2c66affSColin Finck UCHAR OperationCode;
1572c2c66affSColin Finck UCHAR Reserved[8];
1573c2c66affSColin Finck UCHAR ParameterListLength[2];
1574c2c66affSColin Finck UCHAR Control;
1575c2c66affSColin Finck } SET_STREAMING;
1576c2c66affSColin Finck struct _SEND_DVD_STRUCTURE
1577c2c66affSColin Finck {
1578c2c66affSColin Finck UCHAR OperationCode;
1579c2c66affSColin Finck UCHAR Reserved1:5;
1580c2c66affSColin Finck UCHAR Lun:3;
1581c2c66affSColin Finck UCHAR Reserved2[5];
1582c2c66affSColin Finck UCHAR Format;
1583c2c66affSColin Finck UCHAR ParameterListLength[2];
1584c2c66affSColin Finck UCHAR Reserved3;
1585c2c66affSColin Finck UCHAR Control;
1586c2c66affSColin Finck } SEND_DVD_STRUCTURE, *PSEND_DVD_STRUCTURE;
1587c2c66affSColin Finck struct _SEND_KEY
1588c2c66affSColin Finck {
1589c2c66affSColin Finck UCHAR OperationCode;
1590c2c66affSColin Finck UCHAR Reserved1:5;
1591c2c66affSColin Finck UCHAR Lun:3;
1592c2c66affSColin Finck UCHAR Reserved2[6];
1593c2c66affSColin Finck UCHAR ParameterListLength[2];
1594c2c66affSColin Finck UCHAR KeyFormat:6;
1595c2c66affSColin Finck UCHAR AGID:2;
1596c2c66affSColin Finck UCHAR Control;
1597c2c66affSColin Finck } SEND_KEY, *PSEND_KEY;
1598c2c66affSColin Finck struct _REPORT_KEY
1599c2c66affSColin Finck {
1600c2c66affSColin Finck UCHAR OperationCode;
1601c2c66affSColin Finck UCHAR Reserved1:5;
1602c2c66affSColin Finck UCHAR Lun:3;
1603c2c66affSColin Finck UCHAR LogicalBlockAddress[4];
1604c2c66affSColin Finck UCHAR Reserved2[2];
1605c2c66affSColin Finck UCHAR AllocationLength[2];
1606c2c66affSColin Finck UCHAR KeyFormat:6;
1607c2c66affSColin Finck UCHAR AGID:2;
1608c2c66affSColin Finck UCHAR Control;
1609c2c66affSColin Finck } REPORT_KEY, *PREPORT_KEY;
1610c2c66affSColin Finck struct _SET_READ_AHEAD
1611c2c66affSColin Finck {
1612c2c66affSColin Finck UCHAR OperationCode;
1613c2c66affSColin Finck UCHAR Reserved1:5;
1614c2c66affSColin Finck UCHAR Lun:3;
1615c2c66affSColin Finck UCHAR TriggerLBA[4];
1616c2c66affSColin Finck UCHAR ReadAheadLBA[4];
1617c2c66affSColin Finck UCHAR Reserved2;
1618c2c66affSColin Finck UCHAR Control;
1619c2c66affSColin Finck } SET_READ_AHEAD, *PSET_READ_AHEAD;
1620c2c66affSColin Finck struct _READ_FORMATTED_CAPACITIES
1621c2c66affSColin Finck {
1622c2c66affSColin Finck UCHAR OperationCode;
1623c2c66affSColin Finck UCHAR Reserved1:5;
1624c2c66affSColin Finck UCHAR Lun:3;
1625c2c66affSColin Finck UCHAR Reserved2[5];
1626c2c66affSColin Finck UCHAR AllocationLength[2];
1627c2c66affSColin Finck UCHAR Control;
1628c2c66affSColin Finck } READ_FORMATTED_CAPACITIES, *PREAD_FORMATTED_CAPACITIES;
1629c2c66affSColin Finck struct _REPORT_LUNS
1630c2c66affSColin Finck {
1631c2c66affSColin Finck UCHAR OperationCode;
1632c2c66affSColin Finck UCHAR Reserved1[5];
1633c2c66affSColin Finck UCHAR AllocationLength[4];
1634c2c66affSColin Finck UCHAR Reserved2[1];
1635c2c66affSColin Finck UCHAR Control;
1636c2c66affSColin Finck } REPORT_LUNS, *PREPORT_LUNS;
1637c2c66affSColin Finck struct _PERSISTENT_RESERVE_IN
1638c2c66affSColin Finck {
1639c2c66affSColin Finck UCHAR OperationCode;
1640c2c66affSColin Finck UCHAR ServiceAction:5;
1641c2c66affSColin Finck UCHAR Reserved1:3;
1642c2c66affSColin Finck UCHAR Reserved2[5];
1643c2c66affSColin Finck UCHAR AllocationLength[2];
1644c2c66affSColin Finck UCHAR Control;
1645c2c66affSColin Finck } PERSISTENT_RESERVE_IN, *PPERSISTENT_RESERVE_IN;
1646c2c66affSColin Finck struct _PERSISTENT_RESERVE_OUT
1647c2c66affSColin Finck {
1648c2c66affSColin Finck UCHAR OperationCode;
1649c2c66affSColin Finck UCHAR ServiceAction:5;
1650c2c66affSColin Finck UCHAR Reserved1:3;
1651c2c66affSColin Finck UCHAR Type:4;
1652c2c66affSColin Finck UCHAR Scope:4;
1653c2c66affSColin Finck UCHAR Reserved2[4];
1654c2c66affSColin Finck UCHAR ParameterListLength[2];
1655c2c66affSColin Finck UCHAR Control;
1656c2c66affSColin Finck } PERSISTENT_RESERVE_OUT, *PPERSISTENT_RESERVE_OUT;
1657c2c66affSColin Finck struct _GET_CONFIGURATION
1658c2c66affSColin Finck {
1659c2c66affSColin Finck UCHAR OperationCode;
1660c2c66affSColin Finck UCHAR RequestType:1;
1661c2c66affSColin Finck UCHAR Reserved1:7;
1662c2c66affSColin Finck UCHAR StartingFeature[2];
1663c2c66affSColin Finck UCHAR Reserved2[3];
1664c2c66affSColin Finck UCHAR AllocationLength[2];
1665c2c66affSColin Finck UCHAR Control;
1666c2c66affSColin Finck } GET_CONFIGURATION, *PGET_CONFIGURATION;
1667c2c66affSColin Finck struct _SET_CD_SPEED
1668c2c66affSColin Finck {
1669c2c66affSColin Finck UCHAR OperationCode;
1670c2c66affSColin Finck _ANONYMOUS_UNION union
1671c2c66affSColin Finck {
1672c2c66affSColin Finck UCHAR Reserved1;
1673c2c66affSColin Finck _ANONYMOUS_STRUCT struct
1674c2c66affSColin Finck {
1675c2c66affSColin Finck UCHAR RotationControl:2;
1676c2c66affSColin Finck UCHAR Reserved3:6;
1677c2c66affSColin Finck } DUMMYSTRUCTNAME;
1678c2c66affSColin Finck } DUMMYUNIONNAME;
1679c2c66affSColin Finck UCHAR ReadSpeed[2];
1680c2c66affSColin Finck UCHAR WriteSpeed[2];
1681c2c66affSColin Finck UCHAR Reserved2[5];
1682c2c66affSColin Finck UCHAR Control;
1683c2c66affSColin Finck } SET_CD_SPEED, *PSET_CD_SPEED;
1684c2c66affSColin Finck struct _READ12
1685c2c66affSColin Finck {
1686c2c66affSColin Finck UCHAR OperationCode;
1687c2c66affSColin Finck UCHAR RelativeAddress:1;
1688c2c66affSColin Finck UCHAR Reserved1:2;
1689c2c66affSColin Finck UCHAR ForceUnitAccess:1;
1690c2c66affSColin Finck UCHAR DisablePageOut:1;
1691c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1692c2c66affSColin Finck UCHAR LogicalBlock[4];
1693c2c66affSColin Finck UCHAR TransferLength[4];
1694c2c66affSColin Finck UCHAR Reserved2:7;
1695c2c66affSColin Finck UCHAR Streaming:1;
1696c2c66affSColin Finck UCHAR Control;
1697c2c66affSColin Finck } READ12;
1698c2c66affSColin Finck struct _WRITE12
1699c2c66affSColin Finck {
1700c2c66affSColin Finck UCHAR OperationCode;
1701c2c66affSColin Finck UCHAR RelativeAddress:1;
1702c2c66affSColin Finck UCHAR Reserved1:1;
1703c2c66affSColin Finck UCHAR EBP:1;
1704c2c66affSColin Finck UCHAR ForceUnitAccess:1;
1705c2c66affSColin Finck UCHAR DisablePageOut:1;
1706c2c66affSColin Finck UCHAR LogicalUnitNumber:3;
1707c2c66affSColin Finck UCHAR LogicalBlock[4];
1708c2c66affSColin Finck UCHAR TransferLength[4];
1709c2c66affSColin Finck UCHAR Reserved2:7;
1710c2c66affSColin Finck UCHAR Streaming:1;
1711c2c66affSColin Finck UCHAR Control;
1712c2c66affSColin Finck } WRITE12;
1713c2c66affSColin Finck struct _READ16
1714c2c66affSColin Finck {
1715c2c66affSColin Finck UCHAR OperationCode;
1716c2c66affSColin Finck UCHAR Reserved1:3;
1717c2c66affSColin Finck UCHAR ForceUnitAccess:1;
1718c2c66affSColin Finck UCHAR DisablePageOut:1;
1719c2c66affSColin Finck UCHAR ReadProtect:3;
1720c2c66affSColin Finck UCHAR LogicalBlock[8];
1721c2c66affSColin Finck UCHAR TransferLength[4];
1722c2c66affSColin Finck UCHAR Reserved2:7;
1723c2c66affSColin Finck UCHAR Streaming:1;
1724c2c66affSColin Finck UCHAR Control;
1725c2c66affSColin Finck } READ16;
1726c2c66affSColin Finck struct _WRITE16
1727c2c66affSColin Finck {
1728c2c66affSColin Finck UCHAR OperationCode;
1729c2c66affSColin Finck UCHAR Reserved1:3;
1730c2c66affSColin Finck UCHAR ForceUnitAccess:1;
1731c2c66affSColin Finck UCHAR DisablePageOut:1;
1732c2c66affSColin Finck UCHAR WriteProtect:3;
1733c2c66affSColin Finck UCHAR LogicalBlock[8];
1734c2c66affSColin Finck UCHAR TransferLength[4];
1735c2c66affSColin Finck UCHAR Reserved2:7;
1736c2c66affSColin Finck UCHAR Streaming:1;
1737c2c66affSColin Finck UCHAR Control;
1738c2c66affSColin Finck } WRITE16;
1739c2c66affSColin Finck struct _VERIFY16
1740c2c66affSColin Finck {
1741c2c66affSColin Finck UCHAR OperationCode;
1742c2c66affSColin Finck UCHAR Reserved1:1;
1743c2c66affSColin Finck UCHAR ByteCheck:1;
1744c2c66affSColin Finck UCHAR BlockVerify:1;
1745c2c66affSColin Finck UCHAR Reserved2: 1;
1746c2c66affSColin Finck UCHAR DisablePageOut:1;
1747c2c66affSColin Finck UCHAR VerifyProtect:3;
1748c2c66affSColin Finck UCHAR LogicalBlock[8];
1749c2c66affSColin Finck UCHAR VerificationLength[4];
1750c2c66affSColin Finck UCHAR Reserved3:7;
1751c2c66affSColin Finck UCHAR Streaming:1;
1752c2c66affSColin Finck UCHAR Control;
1753c2c66affSColin Finck } VERIFY16;
1754c2c66affSColin Finck struct _SYNCHRONIZE_CACHE16
1755c2c66affSColin Finck {
1756c2c66affSColin Finck UCHAR OperationCode;
1757c2c66affSColin Finck UCHAR Reserved1:1;
1758c2c66affSColin Finck UCHAR Immediate:1;
1759c2c66affSColin Finck UCHAR Reserved2:6;
1760c2c66affSColin Finck UCHAR LogicalBlock[8];
1761c2c66affSColin Finck UCHAR BlockCount[4];
1762c2c66affSColin Finck UCHAR Reserved3;
1763c2c66affSColin Finck UCHAR Control;
1764c2c66affSColin Finck } SYNCHRONIZE_CACHE16;
1765c2c66affSColin Finck struct _READ_CAPACITY16
1766c2c66affSColin Finck {
1767c2c66affSColin Finck UCHAR OperationCode;
1768c2c66affSColin Finck UCHAR ServiceAction:5;
1769c2c66affSColin Finck UCHAR Reserved1:3;
1770c2c66affSColin Finck UCHAR LogicalBlock[8];
1771c2c66affSColin Finck UCHAR BlockCount[4];
1772c2c66affSColin Finck UCHAR PMI:1;
1773c2c66affSColin Finck UCHAR Reserved2:7;
1774c2c66affSColin Finck UCHAR Control;
1775c2c66affSColin Finck } READ_CAPACITY16;
1776c2c66affSColin Finck ULONG AsUlong[4];
1777c2c66affSColin Finck UCHAR AsByte[16];
1778c2c66affSColin Finck } CDB, *PCDB;
1779c2c66affSColin Finck
1780c2c66affSColin Finck typedef union _EIGHT_BYTE
1781c2c66affSColin Finck {
1782c2c66affSColin Finck struct
1783c2c66affSColin Finck {
1784c2c66affSColin Finck UCHAR Byte0;
1785c2c66affSColin Finck UCHAR Byte1;
1786c2c66affSColin Finck UCHAR Byte2;
1787c2c66affSColin Finck UCHAR Byte3;
1788c2c66affSColin Finck UCHAR Byte4;
1789c2c66affSColin Finck UCHAR Byte5;
1790c2c66affSColin Finck UCHAR Byte6;
1791c2c66affSColin Finck UCHAR Byte7;
1792c2c66affSColin Finck };
1793c2c66affSColin Finck ULONGLONG AsULongLong;
1794c2c66affSColin Finck } EIGHT_BYTE, *PEIGHT_BYTE;
1795c2c66affSColin Finck
1796c2c66affSColin Finck typedef union _FOUR_BYTE
1797c2c66affSColin Finck {
1798c2c66affSColin Finck struct
1799c2c66affSColin Finck {
1800c2c66affSColin Finck UCHAR Byte0;
1801c2c66affSColin Finck UCHAR Byte1;
1802c2c66affSColin Finck UCHAR Byte2;
1803c2c66affSColin Finck UCHAR Byte3;
1804c2c66affSColin Finck };
1805c2c66affSColin Finck ULONG AsULong;
1806c2c66affSColin Finck } FOUR_BYTE, *PFOUR_BYTE;
1807c2c66affSColin Finck
1808c2c66affSColin Finck typedef union _TWO_BYTE
1809c2c66affSColin Finck {
1810c2c66affSColin Finck struct
1811c2c66affSColin Finck {
1812c2c66affSColin Finck UCHAR Byte0;
1813c2c66affSColin Finck UCHAR Byte1;
1814c2c66affSColin Finck };
1815c2c66affSColin Finck USHORT AsUShort;
1816c2c66affSColin Finck } TWO_BYTE, *PTWO_BYTE;
1817c2c66affSColin Finck #include <poppack.h>
1818c2c66affSColin Finck
1819c2c66affSColin Finck #if (NTDDI_VERSION < NTDDI_WINXP)
1820c2c66affSColin Finck typedef struct _INQUIRYDATA
1821c2c66affSColin Finck {
1822c2c66affSColin Finck UCHAR DeviceType:5;
1823c2c66affSColin Finck UCHAR DeviceTypeQualifier:3;
1824c2c66affSColin Finck UCHAR DeviceTypeModifier:7;
1825c2c66affSColin Finck UCHAR RemovableMedia:1;
1826c2c66affSColin Finck UCHAR Versions;
1827c2c66affSColin Finck UCHAR ResponseDataFormat:4;
1828c2c66affSColin Finck UCHAR HiSupport:1;
1829c2c66affSColin Finck UCHAR NormACA:1;
1830c2c66affSColin Finck UCHAR ReservedBit:1;
1831c2c66affSColin Finck UCHAR AERC:1;
1832c2c66affSColin Finck UCHAR AdditionalLength;
1833c2c66affSColin Finck UCHAR Reserved[2];
1834c2c66affSColin Finck UCHAR SoftReset:1;
1835c2c66affSColin Finck UCHAR CommandQueue:1;
1836c2c66affSColin Finck UCHAR Reserved2:1;
1837c2c66affSColin Finck UCHAR LinkedCommands:1;
1838c2c66affSColin Finck UCHAR Synchronous:1;
1839c2c66affSColin Finck UCHAR Wide16Bit:1;
1840c2c66affSColin Finck UCHAR Wide32Bit:1;
1841c2c66affSColin Finck UCHAR RelativeAddressing:1;
1842c2c66affSColin Finck UCHAR VendorId[8];
1843c2c66affSColin Finck UCHAR ProductId[16];
1844c2c66affSColin Finck UCHAR ProductRevisionLevel[4];
1845c2c66affSColin Finck UCHAR VendorSpecific[20];
1846c2c66affSColin Finck UCHAR Reserved3[40];
1847c2c66affSColin Finck } INQUIRYDATA, *PINQUIRYDATA;
1848c2c66affSColin Finck #else
1849c2c66affSColin Finck #include <pshpack1.h>
1850c2c66affSColin Finck typedef struct _INQUIRYDATA
1851c2c66affSColin Finck {
1852c2c66affSColin Finck UCHAR DeviceType:5;
1853c2c66affSColin Finck UCHAR DeviceTypeQualifier:3;
1854c2c66affSColin Finck UCHAR DeviceTypeModifier:7;
1855c2c66affSColin Finck UCHAR RemovableMedia:1;
1856c2c66affSColin Finck union
1857c2c66affSColin Finck {
1858c2c66affSColin Finck UCHAR Versions;
1859c2c66affSColin Finck struct
1860c2c66affSColin Finck {
1861c2c66affSColin Finck UCHAR ANSIVersion:3;
1862c2c66affSColin Finck UCHAR ECMAVersion:3;
1863c2c66affSColin Finck UCHAR ISOVersion:2;
1864c2c66affSColin Finck };
1865c2c66affSColin Finck };
1866c2c66affSColin Finck UCHAR ResponseDataFormat:4;
1867c2c66affSColin Finck UCHAR HiSupport:1;
1868c2c66affSColin Finck UCHAR NormACA:1;
1869c2c66affSColin Finck UCHAR TerminateTask:1;
1870c2c66affSColin Finck UCHAR AERC:1;
1871c2c66affSColin Finck UCHAR AdditionalLength;
1872c2c66affSColin Finck UCHAR Reserved;
1873c2c66affSColin Finck UCHAR Addr16:1;
1874c2c66affSColin Finck UCHAR Addr32:1;
1875c2c66affSColin Finck UCHAR AckReqQ:1;
1876c2c66affSColin Finck UCHAR MediumChanger:1;
1877c2c66affSColin Finck UCHAR MultiPort:1;
1878c2c66affSColin Finck UCHAR ReservedBit2:1;
1879c2c66affSColin Finck UCHAR EnclosureServices:1;
1880c2c66affSColin Finck UCHAR ReservedBit3:1;
1881c2c66affSColin Finck UCHAR SoftReset:1;
1882c2c66affSColin Finck UCHAR CommandQueue:1;
1883c2c66affSColin Finck UCHAR TransferDisable:1;
1884c2c66affSColin Finck UCHAR LinkedCommands:1;
1885c2c66affSColin Finck UCHAR Synchronous:1;
1886c2c66affSColin Finck UCHAR Wide16Bit:1;
1887c2c66affSColin Finck UCHAR Wide32Bit:1;
1888c2c66affSColin Finck UCHAR RelativeAddressing:1;
1889c2c66affSColin Finck UCHAR VendorId[8];
1890c2c66affSColin Finck UCHAR ProductId[16];
1891c2c66affSColin Finck UCHAR ProductRevisionLevel[4];
1892c2c66affSColin Finck UCHAR VendorSpecific[20];
1893c2c66affSColin Finck UCHAR Reserved3[40];
1894c2c66affSColin Finck } INQUIRYDATA, *PINQUIRYDATA;
1895c2c66affSColin Finck #include <poppack.h>
1896c2c66affSColin Finck #endif
1897c2c66affSColin Finck
1898c2c66affSColin Finck typedef struct _VPD_MEDIA_SERIAL_NUMBER_PAGE
1899c2c66affSColin Finck {
1900c2c66affSColin Finck UCHAR DeviceType:5;
1901c2c66affSColin Finck UCHAR DeviceTypeQualifier:3;
1902c2c66affSColin Finck UCHAR PageCode;
1903c2c66affSColin Finck UCHAR Reserved;
1904c2c66affSColin Finck UCHAR PageLength;
1905c2c66affSColin Finck UCHAR SerialNumber[0];
1906c2c66affSColin Finck } VPD_MEDIA_SERIAL_NUMBER_PAGE, *PVPD_MEDIA_SERIAL_NUMBER_PAGE;
1907c2c66affSColin Finck
1908c2c66affSColin Finck typedef struct _VPD_SERIAL_NUMBER_PAGE
1909c2c66affSColin Finck {
1910c2c66affSColin Finck UCHAR DeviceType:5;
1911c2c66affSColin Finck UCHAR DeviceTypeQualifier:3;
1912c2c66affSColin Finck UCHAR PageCode;
1913c2c66affSColin Finck UCHAR Reserved;
1914c2c66affSColin Finck UCHAR PageLength;
1915c2c66affSColin Finck UCHAR SerialNumber[0];
1916c2c66affSColin Finck } VPD_SERIAL_NUMBER_PAGE, *PVPD_SERIAL_NUMBER_PAGE;
1917c2c66affSColin Finck
1918c2c66affSColin Finck typedef struct _VPD_IDENTIFICATION_DESCRIPTOR
1919c2c66affSColin Finck {
1920c2c66affSColin Finck UCHAR CodeSet:4;
1921c2c66affSColin Finck UCHAR Reserved:4;
1922c2c66affSColin Finck UCHAR IdentifierType:4;
1923c2c66affSColin Finck UCHAR Association:2;
1924c2c66affSColin Finck UCHAR Reserved2:2;
1925c2c66affSColin Finck UCHAR Reserved3;
1926c2c66affSColin Finck UCHAR IdentifierLength;
1927c2c66affSColin Finck UCHAR Identifier[0];
1928c2c66affSColin Finck } VPD_IDENTIFICATION_DESCRIPTOR, *PVPD_IDENTIFICATION_DESCRIPTOR;
1929c2c66affSColin Finck
1930c2c66affSColin Finck typedef struct _VPD_IDENTIFICATION_PAGE
1931c2c66affSColin Finck {
1932c2c66affSColin Finck UCHAR DeviceType:5;
1933c2c66affSColin Finck UCHAR DeviceTypeQualifier:3;
1934c2c66affSColin Finck UCHAR PageCode;
1935c2c66affSColin Finck UCHAR Reserved;
1936c2c66affSColin Finck UCHAR PageLength;
1937c2c66affSColin Finck UCHAR Descriptors[0];
1938c2c66affSColin Finck } VPD_IDENTIFICATION_PAGE, *PVPD_IDENTIFICATION_PAGE;
1939c2c66affSColin Finck
1940c2c66affSColin Finck typedef struct _VPD_SUPPORTED_PAGES_PAGE
1941c2c66affSColin Finck {
1942c2c66affSColin Finck UCHAR DeviceType:5;
1943c2c66affSColin Finck UCHAR DeviceTypeQualifier:3;
1944c2c66affSColin Finck UCHAR PageCode;
1945c2c66affSColin Finck UCHAR Reserved;
1946c2c66affSColin Finck UCHAR PageLength;
1947c2c66affSColin Finck UCHAR SupportedPageList[0];
1948c2c66affSColin Finck } VPD_SUPPORTED_PAGES_PAGE, *PVPD_SUPPORTED_PAGES_PAGE;
1949c2c66affSColin Finck
1950c2c66affSColin Finck #include <pshpack1.h>
1951c2c66affSColin Finck typedef struct _READ_CAPACITY_DATA
1952c2c66affSColin Finck {
1953c2c66affSColin Finck ULONG LogicalBlockAddress;
1954c2c66affSColin Finck ULONG BytesPerBlock;
1955c2c66affSColin Finck } READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA;
1956c2c66affSColin Finck
1957c2c66affSColin Finck typedef struct _READ_CAPACITY_DATA_EX
1958c2c66affSColin Finck {
1959c2c66affSColin Finck LARGE_INTEGER LogicalBlockAddress;
1960c2c66affSColin Finck ULONG BytesPerBlock;
1961c2c66affSColin Finck } READ_CAPACITY_DATA_EX, *PREAD_CAPACITY_DATA_EX;
1962c2c66affSColin Finck
1963c2c66affSColin Finck typedef struct _MODE_PARAMETER_HEADER
1964c2c66affSColin Finck {
1965c2c66affSColin Finck UCHAR ModeDataLength;
1966c2c66affSColin Finck UCHAR MediumType;
1967c2c66affSColin Finck UCHAR DeviceSpecificParameter;
1968c2c66affSColin Finck UCHAR BlockDescriptorLength;
1969c2c66affSColin Finck }MODE_PARAMETER_HEADER, *PMODE_PARAMETER_HEADER;
1970c2c66affSColin Finck
1971c2c66affSColin Finck typedef struct _MODE_PARAMETER_HEADER10
1972c2c66affSColin Finck {
1973c2c66affSColin Finck UCHAR ModeDataLength[2];
1974c2c66affSColin Finck UCHAR MediumType;
1975c2c66affSColin Finck UCHAR DeviceSpecificParameter;
1976c2c66affSColin Finck UCHAR Reserved[2];
1977c2c66affSColin Finck UCHAR BlockDescriptorLength[2];
1978c2c66affSColin Finck }MODE_PARAMETER_HEADER10, *PMODE_PARAMETER_HEADER10;
1979c2c66affSColin Finck
1980c2c66affSColin Finck typedef struct _MODE_PARAMETER_BLOCK
1981c2c66affSColin Finck {
1982c2c66affSColin Finck UCHAR DensityCode;
1983c2c66affSColin Finck UCHAR NumberOfBlocks[3];
1984c2c66affSColin Finck UCHAR Reserved;
1985c2c66affSColin Finck UCHAR BlockLength[3];
1986c2c66affSColin Finck }MODE_PARAMETER_BLOCK, *PMODE_PARAMETER_BLOCK;
1987c2c66affSColin Finck
1988c2c66affSColin Finck typedef struct _LUN_LIST
1989c2c66affSColin Finck {
1990c2c66affSColin Finck UCHAR LunListLength[4];
1991c2c66affSColin Finck UCHAR Reserved[4];
1992c2c66affSColin Finck #if !defined(__midl)
1993c2c66affSColin Finck UCHAR Lun[0][8];
1994c2c66affSColin Finck #endif
1995c2c66affSColin Finck } LUN_LIST, *PLUN_LIST;
1996e75bdce6SPierre Schweitzer
1997e75bdce6SPierre Schweitzer typedef struct _SENSE_DATA
1998e75bdce6SPierre Schweitzer {
1999e75bdce6SPierre Schweitzer UCHAR ErrorCode:7;
2000e75bdce6SPierre Schweitzer UCHAR Valid:1;
2001e75bdce6SPierre Schweitzer UCHAR SegmentNumber;
2002e75bdce6SPierre Schweitzer UCHAR SenseKey:4;
2003e75bdce6SPierre Schweitzer UCHAR Reserved:1;
2004e75bdce6SPierre Schweitzer UCHAR IncorrectLength:1;
2005e75bdce6SPierre Schweitzer UCHAR EndOfMedia:1;
2006e75bdce6SPierre Schweitzer UCHAR FileMark:1;
2007e75bdce6SPierre Schweitzer UCHAR Information[4];
2008e75bdce6SPierre Schweitzer UCHAR AdditionalSenseLength;
2009e75bdce6SPierre Schweitzer UCHAR CommandSpecificInformation[4];
2010e75bdce6SPierre Schweitzer UCHAR AdditionalSenseCode;
2011e75bdce6SPierre Schweitzer UCHAR AdditionalSenseCodeQualifier;
2012e75bdce6SPierre Schweitzer UCHAR FieldReplaceableUnitCode;
2013e75bdce6SPierre Schweitzer UCHAR SenseKeySpecific[3];
2014e75bdce6SPierre Schweitzer } SENSE_DATA, *PSENSE_DATA;
2015e75bdce6SPierre Schweitzer
2016c2c66affSColin Finck #include <poppack.h>
2017c2c66affSColin Finck
2018c2c66affSColin Finck typedef PHYSICAL_ADDRESS STOR_PHYSICAL_ADDRESS;
2019c2c66affSColin Finck
2020c2c66affSColin Finck typedef struct _ACCESS_RANGE
2021c2c66affSColin Finck {
2022c2c66affSColin Finck STOR_PHYSICAL_ADDRESS RangeStart;
2023c2c66affSColin Finck ULONG RangeLength;
2024c2c66affSColin Finck BOOLEAN RangeInMemory;
2025c2c66affSColin Finck } ACCESS_RANGE, *PACCESS_RANGE;
2026c2c66affSColin Finck
2027c2c66affSColin Finck typedef struct _MEMORY_REGION
2028c2c66affSColin Finck {
2029c2c66affSColin Finck PUCHAR VirtualBase;
2030c2c66affSColin Finck PHYSICAL_ADDRESS PhysicalBase;
2031c2c66affSColin Finck ULONG Length;
2032c2c66affSColin Finck } MEMORY_REGION, *PMEMORY_REGION;
2033c2c66affSColin Finck
2034c2c66affSColin Finck typedef struct _PORT_CONFIGURATION_INFORMATION
2035c2c66affSColin Finck {
2036c2c66affSColin Finck ULONG Length;
2037c2c66affSColin Finck ULONG SystemIoBusNumber;
2038c2c66affSColin Finck INTERFACE_TYPE AdapterInterfaceType;
2039c2c66affSColin Finck ULONG BusInterruptLevel;
2040c2c66affSColin Finck ULONG BusInterruptVector;
2041c2c66affSColin Finck KINTERRUPT_MODE InterruptMode;
2042c2c66affSColin Finck ULONG MaximumTransferLength;
2043c2c66affSColin Finck ULONG NumberOfPhysicalBreaks;
2044c2c66affSColin Finck ULONG DmaChannel;
2045c2c66affSColin Finck ULONG DmaPort;
2046c2c66affSColin Finck DMA_WIDTH DmaWidth;
2047c2c66affSColin Finck DMA_SPEED DmaSpeed;
2048c2c66affSColin Finck ULONG AlignmentMask;
2049c2c66affSColin Finck ULONG NumberOfAccessRanges;
2050c2c66affSColin Finck ACCESS_RANGE (*AccessRanges)[];
2051c2c66affSColin Finck PVOID Reserved;
2052c2c66affSColin Finck UCHAR NumberOfBuses;
2053c2c66affSColin Finck CCHAR InitiatorBusId[8];
2054c2c66affSColin Finck BOOLEAN ScatterGather;
2055c2c66affSColin Finck BOOLEAN Master;
2056c2c66affSColin Finck BOOLEAN CachesData;
2057c2c66affSColin Finck BOOLEAN AdapterScansDown;
2058c2c66affSColin Finck BOOLEAN AtdiskPrimaryClaimed;
2059c2c66affSColin Finck BOOLEAN AtdiskSecondaryClaimed;
2060c2c66affSColin Finck BOOLEAN Dma32BitAddresses;
2061c2c66affSColin Finck BOOLEAN DemandMode;
2062c2c66affSColin Finck UCHAR MapBuffers;
2063c2c66affSColin Finck BOOLEAN NeedPhysicalAddresses;
2064c2c66affSColin Finck BOOLEAN TaggedQueuing;
2065c2c66affSColin Finck BOOLEAN AutoRequestSense;
2066c2c66affSColin Finck BOOLEAN MultipleRequestPerLu;
2067c2c66affSColin Finck BOOLEAN ReceiveEvent;
2068c2c66affSColin Finck BOOLEAN RealModeInitialized;
2069c2c66affSColin Finck BOOLEAN BufferAccessScsiPortControlled;
2070c2c66affSColin Finck UCHAR MaximumNumberOfTargets;
2071c2c66affSColin Finck UCHAR ReservedUchars[2];
2072c2c66affSColin Finck ULONG SlotNumber;
2073c2c66affSColin Finck ULONG BusInterruptLevel2;
2074c2c66affSColin Finck ULONG BusInterruptVector2;
2075c2c66affSColin Finck KINTERRUPT_MODE InterruptMode2;
2076c2c66affSColin Finck ULONG DmaChannel2;
2077c2c66affSColin Finck ULONG DmaPort2;
2078c2c66affSColin Finck DMA_WIDTH DmaWidth2;
2079c2c66affSColin Finck DMA_SPEED DmaSpeed2;
2080c2c66affSColin Finck ULONG DeviceExtensionSize;
2081c2c66affSColin Finck ULONG SpecificLuExtensionSize;
2082c2c66affSColin Finck ULONG SrbExtensionSize;
2083c2c66affSColin Finck UCHAR Dma64BitAddresses;
2084c2c66affSColin Finck BOOLEAN ResetTargetSupported;
2085c2c66affSColin Finck UCHAR MaximumNumberOfLogicalUnits;
2086c2c66affSColin Finck BOOLEAN WmiDataProvider;
2087c2c66affSColin Finck STOR_SYNCHRONIZATION_MODEL SynchronizationModel;
2088c2c66affSColin Finck } PORT_CONFIGURATION_INFORMATION, *PPORT_CONFIGURATION_INFORMATION;
2089c2c66affSColin Finck
2090c2c66affSColin Finck typedef struct _STOR_SCATTER_GATHER_ELEMENT
2091c2c66affSColin Finck {
2092c2c66affSColin Finck STOR_PHYSICAL_ADDRESS PhysicalAddress;
2093c2c66affSColin Finck ULONG Length;
2094c2c66affSColin Finck ULONG_PTR Reserved;
2095c2c66affSColin Finck } STOR_SCATTER_GATHER_ELEMENT, *PSTOR_SCATTER_GATHER_ELEMENT;
2096c2c66affSColin Finck
2097c2c66affSColin Finck typedef struct _STOR_SCATTER_GATHER_LIST
2098c2c66affSColin Finck {
2099c2c66affSColin Finck ULONG NumberOfElements;
2100c2c66affSColin Finck ULONG_PTR Reserved;
2101c2c66affSColin Finck STOR_SCATTER_GATHER_ELEMENT List[];
2102c2c66affSColin Finck } STOR_SCATTER_GATHER_LIST, *PSTOR_SCATTER_GATHER_LIST;
2103c2c66affSColin Finck
2104c2c66affSColin Finck typedef struct _DPC_BUFFER
2105c2c66affSColin Finck {
2106c2c66affSColin Finck CSHORT Type;
2107c2c66affSColin Finck UCHAR Number;
2108c2c66affSColin Finck UCHAR Importance;
2109c2c66affSColin Finck struct
2110c2c66affSColin Finck {
2111c2c66affSColin Finck PVOID F;
2112c2c66affSColin Finck PVOID B;
2113c2c66affSColin Finck };
2114c2c66affSColin Finck PVOID DeferredRoutine;
2115c2c66affSColin Finck PVOID DeferredContext;
2116c2c66affSColin Finck PVOID SystemArgument1;
2117c2c66affSColin Finck PVOID SystemArgument2;
2118c2c66affSColin Finck PVOID DpcData;
2119c2c66affSColin Finck } DPC_BUFFER;
2120c2c66affSColin Finck
2121c2c66affSColin Finck typedef struct _STOR_DPC
2122c2c66affSColin Finck {
2123c2c66affSColin Finck DPC_BUFFER Dpc;
2124c2c66affSColin Finck ULONG_PTR Lock;
2125c2c66affSColin Finck } STOR_DPC, *PSTOR_DPC;
2126c2c66affSColin Finck
2127c2c66affSColin Finck typedef struct _STOR_LOCK_HANDLE
2128c2c66affSColin Finck {
2129c2c66affSColin Finck STOR_SPINLOCK Lock;
2130c2c66affSColin Finck struct
2131c2c66affSColin Finck {
2132c2c66affSColin Finck struct
2133c2c66affSColin Finck {
2134c2c66affSColin Finck PVOID Next;
2135c2c66affSColin Finck PVOID Lock;
2136c2c66affSColin Finck } LockQueue;
2137c2c66affSColin Finck KIRQL OldIrql;
2138c2c66affSColin Finck } Context;
2139c2c66affSColin Finck } STOR_LOCK_HANDLE, *PSTOR_LOCK_HANDLE;
2140c2c66affSColin Finck
2141ca22dc9bSEric Kohl typedef struct _STOR_LOG_EVENT_DETAILS
2142ca22dc9bSEric Kohl {
2143ca22dc9bSEric Kohl ULONG InterfaceRevision;
2144ca22dc9bSEric Kohl ULONG Size;
2145ca22dc9bSEric Kohl ULONG Flags;
2146ca22dc9bSEric Kohl STOR_EVENT_ASSOCIATION_ENUM EventAssociation;
2147ca22dc9bSEric Kohl ULONG PathId;
2148ca22dc9bSEric Kohl ULONG TargetId;
2149ca22dc9bSEric Kohl ULONG LunId;
2150ca22dc9bSEric Kohl BOOLEAN StorportSpecificErrorCode;
2151ca22dc9bSEric Kohl ULONG ErrorCode;
2152ca22dc9bSEric Kohl ULONG UniqueId;
2153ca22dc9bSEric Kohl ULONG DumpDataSize;
2154ca22dc9bSEric Kohl PVOID DumpData;
2155ca22dc9bSEric Kohl ULONG StringCount;
2156ca22dc9bSEric Kohl PWSTR *StringList;
2157ca22dc9bSEric Kohl } STOR_LOG_EVENT_DETAILS, *PSTOR_LOG_EVENT_DETAILS;
2158ca22dc9bSEric Kohl
2159ca22dc9bSEric Kohl typedef struct _PERF_CONFIGURATION_DATA
2160ca22dc9bSEric Kohl {
2161ca22dc9bSEric Kohl ULONG Version;
2162ca22dc9bSEric Kohl ULONG Size;
2163ca22dc9bSEric Kohl ULONG Flags;
2164ca22dc9bSEric Kohl ULONG ConcurrentChannels;
21652e305b25SHermès Bélusca-Maïto ULONG FirstRedirectionMessageNumber;
21662e305b25SHermès Bélusca-Maïto ULONG LastRedirectionMessageNumber;
2167ca22dc9bSEric Kohl ULONG DeviceNode;
2168ca22dc9bSEric Kohl ULONG Reserved;
2169ca22dc9bSEric Kohl PGROUP_AFFINITY MessageTargets;
2170ca22dc9bSEric Kohl } PERF_CONFIGURATION_DATA, *PPERF_CONFIGURATION_DATA;
2171ca22dc9bSEric Kohl
2172ca22dc9bSEric Kohl typedef struct _STARTIO_PERFORMANCE_PARAMETERS
2173ca22dc9bSEric Kohl {
2174ca22dc9bSEric Kohl ULONG Version;
2175ca22dc9bSEric Kohl ULONG Size;
2176ca22dc9bSEric Kohl ULONG MessageNumber;
2177ca22dc9bSEric Kohl ULONG ChannelNumber;
2178ca22dc9bSEric Kohl } STARTIO_PERFORMANCE_PARAMETERS, *PSTARTIO_PERFORMANCE_PARAMETERS;
2179ca22dc9bSEric Kohl
2180ca22dc9bSEric Kohl typedef struct _MESSAGE_INTERRUPT_INFORMATION
2181ca22dc9bSEric Kohl {
2182ca22dc9bSEric Kohl ULONG MessageId;
2183ca22dc9bSEric Kohl ULONG MessageData;
2184ca22dc9bSEric Kohl STOR_PHYSICAL_ADDRESS MessageAddress;
2185ca22dc9bSEric Kohl ULONG InterruptVector;
2186ca22dc9bSEric Kohl ULONG InterruptLevel;
2187ca22dc9bSEric Kohl KINTERRUPT_MODE InterruptMode;
2188ca22dc9bSEric Kohl } MESSAGE_INTERRUPT_INFORMATION, *PMESSAGE_INTERRUPT_INFORMATION;
2189ca22dc9bSEric Kohl
2190c2c66affSColin Finck typedef
2191c2c66affSColin Finck BOOLEAN
2192c2c66affSColin Finck (NTAPI *PHW_INITIALIZE)(
2193c2c66affSColin Finck _In_ PVOID DeviceExtension);
2194c2c66affSColin Finck
2195c2c66affSColin Finck typedef
2196c2c66affSColin Finck BOOLEAN
2197c2c66affSColin Finck (NTAPI *PHW_BUILDIO)(
2198c2c66affSColin Finck _In_ PVOID DeviceExtension,
2199c2c66affSColin Finck _In_ PSCSI_REQUEST_BLOCK Srb);
2200c2c66affSColin Finck
2201c2c66affSColin Finck typedef
2202c2c66affSColin Finck BOOLEAN
2203c2c66affSColin Finck (NTAPI *PHW_STARTIO)(
2204c2c66affSColin Finck _In_ PVOID DeviceExtension,
2205c2c66affSColin Finck _In_ PSCSI_REQUEST_BLOCK Srb);
2206c2c66affSColin Finck
2207c2c66affSColin Finck typedef
2208c2c66affSColin Finck BOOLEAN
2209c2c66affSColin Finck (NTAPI *PHW_INTERRUPT)(
2210c2c66affSColin Finck _In_ PVOID DeviceExtension);
2211c2c66affSColin Finck
2212c2c66affSColin Finck typedef
2213c2c66affSColin Finck VOID
2214c2c66affSColin Finck (NTAPI *PHW_TIMER)(
2215c2c66affSColin Finck _In_ PVOID DeviceExtension);
2216c2c66affSColin Finck
2217c2c66affSColin Finck typedef
2218c2c66affSColin Finck VOID
2219c2c66affSColin Finck (NTAPI *PHW_DMA_STARTED)(
2220c2c66affSColin Finck _In_ PVOID DeviceExtension);
2221c2c66affSColin Finck
2222c2c66affSColin Finck typedef
2223c2c66affSColin Finck ULONG
2224c2c66affSColin Finck (NTAPI *PHW_FIND_ADAPTER)(
2225c2c66affSColin Finck IN PVOID DeviceExtension,
2226c2c66affSColin Finck IN PVOID HwContext,
2227c2c66affSColin Finck IN PVOID BusInformation,
2228c2c66affSColin Finck IN PCHAR ArgumentString,
2229c2c66affSColin Finck IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo,
2230c2c66affSColin Finck OUT PBOOLEAN Again);
2231c2c66affSColin Finck
2232c2c66affSColin Finck typedef
2233c2c66affSColin Finck BOOLEAN
2234c2c66affSColin Finck (NTAPI *PHW_RESET_BUS)(
2235c2c66affSColin Finck IN PVOID DeviceExtension,
2236c2c66affSColin Finck IN ULONG PathId);
2237c2c66affSColin Finck
2238c2c66affSColin Finck typedef
2239c2c66affSColin Finck BOOLEAN
2240c2c66affSColin Finck (NTAPI *PHW_ADAPTER_STATE)(
2241c2c66affSColin Finck IN PVOID DeviceExtension,
2242c2c66affSColin Finck IN PVOID Context,
2243c2c66affSColin Finck IN BOOLEAN SaveState);
2244c2c66affSColin Finck
2245c2c66affSColin Finck typedef
2246c2c66affSColin Finck SCSI_ADAPTER_CONTROL_STATUS
2247c2c66affSColin Finck (NTAPI *PHW_ADAPTER_CONTROL)(
2248c2c66affSColin Finck IN PVOID DeviceExtension,
2249c2c66affSColin Finck IN SCSI_ADAPTER_CONTROL_TYPE ControlType,
2250c2c66affSColin Finck IN PVOID Parameters);
2251c2c66affSColin Finck
2252c2c66affSColin Finck typedef
2253c2c66affSColin Finck BOOLEAN
2254c2c66affSColin Finck (*PHW_PASSIVE_INITIALIZE_ROUTINE)(
2255c2c66affSColin Finck _In_ PVOID DeviceExtension);
2256c2c66affSColin Finck
2257c2c66affSColin Finck typedef
2258c2c66affSColin Finck VOID
2259c2c66affSColin Finck (*PHW_DPC_ROUTINE)(
2260c2c66affSColin Finck _In_ PSTOR_DPC Dpc,
2261c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2262c2c66affSColin Finck _In_ PVOID SystemArgument1,
2263c2c66affSColin Finck _In_ PVOID SystemArgument2);
2264c2c66affSColin Finck
2265c2c66affSColin Finck typedef
2266c2c66affSColin Finck BOOLEAN
2267c2c66affSColin Finck (NTAPI STOR_SYNCHRONIZED_ACCESS)(
2268c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2269c2c66affSColin Finck _In_ PVOID Context);
2270c2c66affSColin Finck
2271c2c66affSColin Finck typedef STOR_SYNCHRONIZED_ACCESS *PSTOR_SYNCHRONIZED_ACCESS;
2272c2c66affSColin Finck
2273ca22dc9bSEric Kohl typedef
2274ca22dc9bSEric Kohl VOID
2275ca22dc9bSEric Kohl (NTAPI *PpostScaterGatherExecute)(
2276ca22dc9bSEric Kohl _In_ PVOID *DeviceObject,
2277ca22dc9bSEric Kohl _In_ PVOID *Irp,
2278ca22dc9bSEric Kohl _In_ PSTOR_SCATTER_GATHER_LIST ScatterGather,
2279ca22dc9bSEric Kohl _In_ PVOID Context);
2280ca22dc9bSEric Kohl
2281f7c01906SEric Kohl typedef
2282f7c01906SEric Kohl BOOLEAN
2283f7c01906SEric Kohl (NTAPI *PStorPortGetMessageInterruptInformation)(
2284f7c01906SEric Kohl _In_ PVOID HwDeviceExtension,
2285f7c01906SEric Kohl _In_ ULONG MessageId,
2286f7c01906SEric Kohl _Out_ PMESSAGE_INTERRUPT_INFORMATION InterruptInfo);
2287f7c01906SEric Kohl
2288f7c01906SEric Kohl typedef
2289f7c01906SEric Kohl VOID
2290f7c01906SEric Kohl (NTAPI *PStorPortPutScatterGatherList)(
2291f7c01906SEric Kohl _In_ PVOID HwDeviceExtension,
2292f7c01906SEric Kohl _In_ PSTOR_SCATTER_GATHER_LIST ScatterGatherList,
2293f7c01906SEric Kohl _In_ BOOLEAN WriteToDevice);
2294f7c01906SEric Kohl
2295f7c01906SEric Kohl typedef
2296f7c01906SEric Kohl GETSGSTATUS
2297f7c01906SEric Kohl (NTAPI *PStorPortBuildScatterGatherList)(
2298f7c01906SEric Kohl _In_ PVOID HwDeviceExtension,
2299f7c01906SEric Kohl _In_ PVOID Mdl,
2300f7c01906SEric Kohl _In_ PVOID CurrentVa,
2301f7c01906SEric Kohl _In_ ULONG Length,
2302f7c01906SEric Kohl _In_ PpostScaterGatherExecute ExecutionRoutine,
2303f7c01906SEric Kohl _In_ PVOID Context,
2304f7c01906SEric Kohl _In_ BOOLEAN WriteToDevice,
2305f7c01906SEric Kohl _Inout_ PVOID ScatterGatherBuffer,
2306f7c01906SEric Kohl _In_ ULONG ScatterGatherBufferLength);
2307f7c01906SEric Kohl
2308f7c01906SEric Kohl typedef
2309f7c01906SEric Kohl VOID
2310f7c01906SEric Kohl (NTAPI *PStorPortFreePool)(
2311f7c01906SEric Kohl _In_ PVOID PMemory,
2312f7c01906SEric Kohl _In_ PVOID HwDeviceExtension,
2313f7c01906SEric Kohl _In_opt_ PVOID PMdl);
2314f7c01906SEric Kohl
2315f7c01906SEric Kohl typedef
2316f7c01906SEric Kohl PVOID
2317f7c01906SEric Kohl (NTAPI *PStorPortAllocatePool)(
2318f7c01906SEric Kohl _In_ ULONG NumberOfBytes,
2319f7c01906SEric Kohl _In_ ULONG Tag,
2320f7c01906SEric Kohl _In_ PVOID HwDeviceExtension,
2321f7c01906SEric Kohl _Out_ PVOID *PMdl);
2322f7c01906SEric Kohl
2323f7c01906SEric Kohl typedef
2324f7c01906SEric Kohl PVOID
2325f7c01906SEric Kohl (NTAPI *PStorPortGetSystemAddress)(
2326f7c01906SEric Kohl _In_ PSCSI_REQUEST_BLOCK Srb);
2327f7c01906SEric Kohl
2328f7c01906SEric Kohl typedef struct _STORPORT_EXTENDED_FUNCTIONS
2329f7c01906SEric Kohl {
2330f7c01906SEric Kohl ULONG Version;
2331f7c01906SEric Kohl PStorPortGetMessageInterruptInformation GetMessageInterruptInformation;
2332f7c01906SEric Kohl PStorPortPutScatterGatherList PutScatterGatherList;
2333f7c01906SEric Kohl PStorPortBuildScatterGatherList BuildScatterGatherList;
2334f7c01906SEric Kohl PStorPortFreePool FreePool;
2335f7c01906SEric Kohl PStorPortAllocatePool AllocatePool;
2336f7c01906SEric Kohl PStorPortGetSystemAddress GetSystemAddress;
2337f7c01906SEric Kohl } STORPORT_EXTENDED_FUNCTIONS, *PSTORPORT_EXTENDED_FUNCTIONS;
2338f7c01906SEric Kohl
2339c2c66affSColin Finck typedef struct _HW_INITIALIZATION_DATA
2340c2c66affSColin Finck {
2341c2c66affSColin Finck ULONG HwInitializationDataSize;
2342c2c66affSColin Finck INTERFACE_TYPE AdapterInterfaceType;
2343c2c66affSColin Finck PHW_INITIALIZE HwInitialize;
2344c2c66affSColin Finck PHW_STARTIO HwStartIo;
2345c2c66affSColin Finck PHW_INTERRUPT HwInterrupt;
2346c2c66affSColin Finck PHW_FIND_ADAPTER HwFindAdapter;
2347c2c66affSColin Finck PHW_RESET_BUS HwResetBus;
2348c2c66affSColin Finck PHW_DMA_STARTED HwDmaStarted;
2349c2c66affSColin Finck PHW_ADAPTER_STATE HwAdapterState;
2350c2c66affSColin Finck ULONG DeviceExtensionSize;
2351c2c66affSColin Finck ULONG SpecificLuExtensionSize;
2352c2c66affSColin Finck ULONG SrbExtensionSize;
2353c2c66affSColin Finck ULONG NumberOfAccessRanges;
2354c2c66affSColin Finck PVOID Reserved;
2355c2c66affSColin Finck UCHAR MapBuffers;
2356c2c66affSColin Finck BOOLEAN NeedPhysicalAddresses;
2357c2c66affSColin Finck BOOLEAN TaggedQueuing;
2358c2c66affSColin Finck BOOLEAN AutoRequestSense;
2359c2c66affSColin Finck BOOLEAN MultipleRequestPerLu;
2360c2c66affSColin Finck BOOLEAN ReceiveEvent;
2361c2c66affSColin Finck USHORT VendorIdLength;
2362c2c66affSColin Finck PVOID VendorId;
2363c2c66affSColin Finck USHORT ReservedUshort;
2364c2c66affSColin Finck USHORT DeviceIdLength;
2365c2c66affSColin Finck PVOID DeviceId;
2366c2c66affSColin Finck PHW_ADAPTER_CONTROL HwAdapterControl;
2367c2c66affSColin Finck PHW_BUILDIO HwBuildIo;
2368c2c66affSColin Finck } HW_INITIALIZATION_DATA, *PHW_INITIALIZATION_DATA;
2369c2c66affSColin Finck
2370c2c66affSColin Finck
2371c2c66affSColin Finck
2372c2c66affSColin Finck #define REVERSE_BYTES_QUAD(Destination, Source) { \
2373c2c66affSColin Finck PEIGHT_BYTE d = (PEIGHT_BYTE)(Destination); \
2374c2c66affSColin Finck PEIGHT_BYTE s = (PEIGHT_BYTE)(Source); \
2375c2c66affSColin Finck d->Byte7 = s->Byte0; \
2376c2c66affSColin Finck d->Byte6 = s->Byte1; \
2377c2c66affSColin Finck d->Byte5 = s->Byte2; \
2378c2c66affSColin Finck d->Byte4 = s->Byte3; \
2379c2c66affSColin Finck d->Byte3 = s->Byte4; \
2380c2c66affSColin Finck d->Byte2 = s->Byte5; \
2381c2c66affSColin Finck d->Byte1 = s->Byte6; \
2382c2c66affSColin Finck d->Byte0 = s->Byte7; \
2383c2c66affSColin Finck }
2384c2c66affSColin Finck
2385c2c66affSColin Finck #define REVERSE_BYTES(Destination, Source) { \
2386c2c66affSColin Finck PFOUR_BYTE d = (PFOUR_BYTE)(Destination); \
2387c2c66affSColin Finck PFOUR_BYTE s = (PFOUR_BYTE)(Source); \
2388c2c66affSColin Finck d->Byte3 = s->Byte0; \
2389c2c66affSColin Finck d->Byte2 = s->Byte1; \
2390c2c66affSColin Finck d->Byte1 = s->Byte2; \
2391c2c66affSColin Finck d->Byte0 = s->Byte3; \
2392c2c66affSColin Finck }
2393c2c66affSColin Finck
2394c2c66affSColin Finck #define REVERSE_BYTES_SHORT(Destination, Source) { \
2395c2c66affSColin Finck PTWO_BYTE d = (PTWO_BYTE)(Destination); \
2396c2c66affSColin Finck PTWO_BYTE s = (PTWO_BYTE)(Source); \
2397c2c66affSColin Finck d->Byte1 = s->Byte0; \
2398c2c66affSColin Finck d->Byte0 = s->Byte1; \
2399c2c66affSColin Finck }
2400c2c66affSColin Finck
2401c2c66affSColin Finck #define StorPortCopyMemory(Destination,Source,Length) memcpy((Destination),(Source),(Length))
2402c2c66affSColin Finck
2403c2c66affSColin Finck STORPORT_API
2404c2c66affSColin Finck PUCHAR
2405c2c66affSColin Finck NTAPI
2406c2c66affSColin Finck StorPortAllocateRegistryBuffer(
2407c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2408c2c66affSColin Finck _In_ PULONG Length);
2409c2c66affSColin Finck
2410c2c66affSColin Finck STORPORT_API
2411c2c66affSColin Finck BOOLEAN
2412c2c66affSColin Finck NTAPI
2413c2c66affSColin Finck StorPortBusy(
2414c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2415c2c66affSColin Finck _In_ ULONG RequestsToComplete);
2416c2c66affSColin Finck
2417c2c66affSColin Finck STORPORT_API
2418c2c66affSColin Finck VOID
2419c2c66affSColin Finck NTAPI
2420c2c66affSColin Finck StorPortCompleteRequest(
2421c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2422c2c66affSColin Finck _In_ UCHAR PathId,
2423c2c66affSColin Finck _In_ UCHAR TargetId,
2424c2c66affSColin Finck _In_ UCHAR Lun,
2425c2c66affSColin Finck _In_ UCHAR SrbStatus);
2426c2c66affSColin Finck
2427c2c66affSColin Finck STORPORT_API
2428c2c66affSColin Finck ULONG64
2429c2c66affSColin Finck NTAPI
2430c2c66affSColin Finck StorPortConvertPhysicalAddressToUlong64(
2431c2c66affSColin Finck _In_ STOR_PHYSICAL_ADDRESS Address);
2432c2c66affSColin Finck
2433c2c66affSColin Finck STORPORT_API
2434c2c66affSColin Finck STOR_PHYSICAL_ADDRESS
2435c2c66affSColin Finck NTAPI
2436c2c66affSColin Finck StorPortConvertUlong64ToPhysicalAddress(
2437c2c66affSColin Finck _In_ ULONG64 UlongAddress);
2438c2c66affSColin Finck
2439c2c66affSColin Finck STORPORT_API
2440c2c66affSColin Finck VOID
2441c2c66affSColin Finck __cdecl
2442c2c66affSColin Finck StorPortDebugPrint(
2443c2c66affSColin Finck _In_ ULONG DebugPrintLevel,
2444c2c66affSColin Finck _In_ PCCHAR DebugMessage,
2445c2c66affSColin Finck ...);
2446c2c66affSColin Finck
2447c2c66affSColin Finck STORPORT_API
2448c2c66affSColin Finck BOOLEAN
2449c2c66affSColin Finck NTAPI
2450c2c66affSColin Finck StorPortDeviceBusy(
2451c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2452c2c66affSColin Finck _In_ UCHAR PathId,
2453c2c66affSColin Finck _In_ UCHAR TargetId,
2454c2c66affSColin Finck _In_ UCHAR Lun,
2455c2c66affSColin Finck _In_ ULONG RequestsToComplete);
2456c2c66affSColin Finck
2457c2c66affSColin Finck STORPORT_API
2458c2c66affSColin Finck BOOLEAN
2459c2c66affSColin Finck NTAPI
2460c2c66affSColin Finck StorPortDeviceReady(
2461c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2462c2c66affSColin Finck _In_ UCHAR PathId,
2463c2c66affSColin Finck _In_ UCHAR TargetId,
2464c2c66affSColin Finck _In_ UCHAR Lun);
2465c2c66affSColin Finck
2466c2c66affSColin Finck STORPORT_API
2467c2c66affSColin Finck VOID
2468c2c66affSColin Finck NTAPI
2469c2c66affSColin Finck StorPortFreeDeviceBase(
2470c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2471c2c66affSColin Finck _In_ PVOID MappedAddress);
2472c2c66affSColin Finck
2473c2c66affSColin Finck STORPORT_API
2474c2c66affSColin Finck VOID
2475c2c66affSColin Finck NTAPI
2476c2c66affSColin Finck StorPortFreeRegistryBuffer(
2477c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2478c2c66affSColin Finck _In_ PUCHAR Buffer);
2479c2c66affSColin Finck
2480c2c66affSColin Finck STORPORT_API
2481c2c66affSColin Finck ULONG
2482c2c66affSColin Finck NTAPI
2483c2c66affSColin Finck StorPortGetBusData(
2484c2c66affSColin Finck _In_ PVOID DeviceExtension,
2485c2c66affSColin Finck _In_ ULONG BusDataType,
2486c2c66affSColin Finck _In_ ULONG SystemIoBusNumber,
2487c2c66affSColin Finck _In_ ULONG SlotNumber,
2488c2c66affSColin Finck _Out_ _When_(Length != 0, _Out_writes_bytes_(Length)) PVOID Buffer,
2489c2c66affSColin Finck _In_ ULONG Length);
2490c2c66affSColin Finck
2491c2c66affSColin Finck STORPORT_API
2492c2c66affSColin Finck PVOID
2493c2c66affSColin Finck NTAPI
2494c2c66affSColin Finck StorPortGetDeviceBase(
2495c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2496c2c66affSColin Finck _In_ INTERFACE_TYPE BusType,
2497c2c66affSColin Finck _In_ ULONG SystemIoBusNumber,
2498c2c66affSColin Finck _In_ STOR_PHYSICAL_ADDRESS IoAddress,
2499c2c66affSColin Finck _In_ ULONG NumberOfBytes,
2500c2c66affSColin Finck _In_ BOOLEAN InIoSpace);
2501c2c66affSColin Finck
2502c2c66affSColin Finck STORPORT_API
2503c2c66affSColin Finck PVOID
2504c2c66affSColin Finck NTAPI
2505c2c66affSColin Finck StorPortGetLogicalUnit(
2506c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2507c2c66affSColin Finck _In_ UCHAR PathId,
2508c2c66affSColin Finck _In_ UCHAR TargetId,
2509c2c66affSColin Finck _In_ UCHAR Lun);
2510c2c66affSColin Finck
2511c2c66affSColin Finck STORPORT_API
2512c2c66affSColin Finck STOR_PHYSICAL_ADDRESS
2513c2c66affSColin Finck NTAPI
2514c2c66affSColin Finck StorPortGetPhysicalAddress(
2515c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2516c2c66affSColin Finck _In_opt_ PSCSI_REQUEST_BLOCK Srb,
2517c2c66affSColin Finck _In_ PVOID VirtualAddress,
2518c2c66affSColin Finck _Out_ ULONG *Length);
2519c2c66affSColin Finck
2520c2c66affSColin Finck STORPORT_API
2521c2c66affSColin Finck PSTOR_SCATTER_GATHER_LIST
2522c2c66affSColin Finck NTAPI
2523c2c66affSColin Finck StorPortGetScatterGatherList(
2524c2c66affSColin Finck _In_ PVOID DeviceExtension,
2525c2c66affSColin Finck _In_ PSCSI_REQUEST_BLOCK Srb);
2526c2c66affSColin Finck
2527c2c66affSColin Finck STORPORT_API
2528c2c66affSColin Finck PSCSI_REQUEST_BLOCK
2529c2c66affSColin Finck NTAPI
2530c2c66affSColin Finck StorPortGetSrb(
2531c2c66affSColin Finck _In_ PVOID DeviceExtension,
2532c2c66affSColin Finck _In_ UCHAR PathId,
2533c2c66affSColin Finck _In_ UCHAR TargetId,
2534c2c66affSColin Finck _In_ UCHAR Lun,
2535c2c66affSColin Finck _In_ LONG QueueTag);
2536c2c66affSColin Finck
2537c2c66affSColin Finck STORPORT_API
2538c2c66affSColin Finck PVOID
2539c2c66affSColin Finck NTAPI
2540c2c66affSColin Finck StorPortGetUncachedExtension(
2541c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2542c2c66affSColin Finck _In_ PPORT_CONFIGURATION_INFORMATION ConfigInfo,
2543c2c66affSColin Finck _In_ ULONG NumberOfBytes);
2544c2c66affSColin Finck
2545c2c66affSColin Finck STORPORT_API
2546c2c66affSColin Finck PVOID
2547c2c66affSColin Finck NTAPI
2548c2c66affSColin Finck StorPortGetVirtualAddress(
2549c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2550c2c66affSColin Finck _In_ STOR_PHYSICAL_ADDRESS PhysicalAddress);
2551c2c66affSColin Finck
2552c2c66affSColin Finck STORPORT_API
2553c2c66affSColin Finck ULONG
2554c2c66affSColin Finck NTAPI
2555c2c66affSColin Finck StorPortInitialize(
2556c2c66affSColin Finck _In_ PVOID Argument1,
2557c2c66affSColin Finck _In_ PVOID Argument2,
2558c2c66affSColin Finck _In_ PHW_INITIALIZATION_DATA HwInitializationData,
2559c2c66affSColin Finck _In_opt_ PVOID Unused);
2560c2c66affSColin Finck
2561c2c66affSColin Finck STORPORT_API
2562c2c66affSColin Finck VOID
2563c2c66affSColin Finck NTAPI
2564c2c66affSColin Finck StorPortLogError(
2565c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2566c2c66affSColin Finck _In_opt_ PSCSI_REQUEST_BLOCK Srb,
2567c2c66affSColin Finck _In_ UCHAR PathId,
2568c2c66affSColin Finck _In_ UCHAR TargetId,
2569c2c66affSColin Finck _In_ UCHAR Lun,
2570c2c66affSColin Finck _In_ ULONG ErrorCode,
2571c2c66affSColin Finck _In_ ULONG UniqueId);
2572c2c66affSColin Finck
2573c2c66affSColin Finck STORPORT_API
2574c2c66affSColin Finck VOID
2575c2c66affSColin Finck NTAPI
2576c2c66affSColin Finck StorPortMoveMemory(
2577c2c66affSColin Finck _Out_writes_bytes_(Length) PVOID WriteBuffer,
2578c2c66affSColin Finck _In_reads_bytes_(Length) PVOID ReadBuffer,
2579c2c66affSColin Finck _In_ ULONG Length);
2580c2c66affSColin Finck
2581c2c66affSColin Finck STORPORT_API
2582c2c66affSColin Finck VOID
2583c2c66affSColin Finck __cdecl
2584c2c66affSColin Finck StorPortNotification(
2585c2c66affSColin Finck _In_ SCSI_NOTIFICATION_TYPE NotificationType,
2586c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2587c2c66affSColin Finck ...);
2588c2c66affSColin Finck
2589c2c66affSColin Finck STORPORT_API
2590c2c66affSColin Finck VOID
2591c2c66affSColin Finck NTAPI
2592c2c66affSColin Finck StorPortQuerySystemTime(
2593c2c66affSColin Finck _Out_ PLARGE_INTEGER CurrentTime);
2594c2c66affSColin Finck
2595c2c66affSColin Finck STORPORT_API
2596c2c66affSColin Finck BOOLEAN
2597c2c66affSColin Finck NTAPI
2598c2c66affSColin Finck StorPortPause(
2599c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2600c2c66affSColin Finck _In_ ULONG TimeOut);
2601c2c66affSColin Finck
2602c2c66affSColin Finck STORPORT_API
2603c2c66affSColin Finck BOOLEAN
2604c2c66affSColin Finck NTAPI
2605c2c66affSColin Finck StorPortPauseDevice(
2606c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2607c2c66affSColin Finck _In_ UCHAR PathId,
2608c2c66affSColin Finck _In_ UCHAR TargetId,
2609c2c66affSColin Finck _In_ UCHAR Lun,
2610c2c66affSColin Finck _In_ ULONG TimeOut);
2611c2c66affSColin Finck
2612c2c66affSColin Finck STORPORT_API
2613c2c66affSColin Finck VOID
2614c2c66affSColin Finck NTAPI
2615c2c66affSColin Finck StorPortReadPortBufferUchar(
2616c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2617c2c66affSColin Finck _In_ PUCHAR Port,
2618c2c66affSColin Finck _In_ PUCHAR Buffer,
2619c2c66affSColin Finck _In_ ULONG Count);
2620c2c66affSColin Finck
2621c2c66affSColin Finck STORPORT_API
2622c2c66affSColin Finck VOID
2623c2c66affSColin Finck NTAPI
2624c2c66affSColin Finck StorPortReadPortBufferUlong(
2625c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2626c2c66affSColin Finck _In_ PULONG Port,
2627c2c66affSColin Finck _In_ PULONG Buffer,
2628c2c66affSColin Finck _In_ ULONG Count);
2629c2c66affSColin Finck
2630c2c66affSColin Finck STORPORT_API
2631c2c66affSColin Finck VOID
2632c2c66affSColin Finck NTAPI
2633c2c66affSColin Finck StorPortReadPortBufferUshort(
2634c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2635c2c66affSColin Finck _In_ PUSHORT Port,
2636c2c66affSColin Finck _In_ PUSHORT Buffer,
2637c2c66affSColin Finck _In_ ULONG Count);
2638c2c66affSColin Finck
2639c2c66affSColin Finck STORPORT_API
2640c2c66affSColin Finck UCHAR
2641c2c66affSColin Finck NTAPI
2642c2c66affSColin Finck StorPortReadPortUchar(
2643c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2644c2c66affSColin Finck _In_ PUCHAR Port);
2645c2c66affSColin Finck
2646c2c66affSColin Finck STORPORT_API
2647c2c66affSColin Finck ULONG
2648c2c66affSColin Finck NTAPI
2649c2c66affSColin Finck StorPortReadPortUlong(
2650c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2651c2c66affSColin Finck _In_ PULONG Port);
2652c2c66affSColin Finck
2653c2c66affSColin Finck STORPORT_API
2654c2c66affSColin Finck USHORT
2655c2c66affSColin Finck NTAPI
2656c2c66affSColin Finck StorPortReadPortUshort(
2657c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2658c2c66affSColin Finck _In_ PUSHORT Port);
2659c2c66affSColin Finck
2660c2c66affSColin Finck STORPORT_API
2661c2c66affSColin Finck VOID
2662c2c66affSColin Finck NTAPI
2663c2c66affSColin Finck StorPortReadRegisterBufferUchar(
2664c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2665c2c66affSColin Finck _In_ PUCHAR Register,
2666c2c66affSColin Finck _In_ PUCHAR Buffer,
2667c2c66affSColin Finck _In_ ULONG Count);
2668c2c66affSColin Finck
2669c2c66affSColin Finck STORPORT_API
2670c2c66affSColin Finck VOID
2671c2c66affSColin Finck NTAPI
2672c2c66affSColin Finck StorPortReadRegisterBufferUlong(
2673c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2674c2c66affSColin Finck _In_ PULONG Register,
2675c2c66affSColin Finck _In_ PULONG Buffer,
2676c2c66affSColin Finck _In_ ULONG Count);
2677c2c66affSColin Finck
2678c2c66affSColin Finck STORPORT_API
2679c2c66affSColin Finck VOID
2680c2c66affSColin Finck NTAPI
2681c2c66affSColin Finck StorPortReadRegisterBufferUshort(
2682c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2683c2c66affSColin Finck _In_ PUSHORT Register,
2684c2c66affSColin Finck _In_ PUSHORT Buffer,
2685c2c66affSColin Finck _In_ ULONG Count);
2686c2c66affSColin Finck
2687c2c66affSColin Finck STORPORT_API
2688c2c66affSColin Finck UCHAR
2689c2c66affSColin Finck NTAPI
2690c2c66affSColin Finck StorPortReadRegisterUchar(
2691c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2692c2c66affSColin Finck _In_ PUCHAR Register);
2693c2c66affSColin Finck
2694c2c66affSColin Finck STORPORT_API
2695c2c66affSColin Finck ULONG
2696c2c66affSColin Finck NTAPI
2697c2c66affSColin Finck StorPortReadRegisterUlong(
2698c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2699c2c66affSColin Finck _In_ PULONG Register);
2700c2c66affSColin Finck
2701c2c66affSColin Finck STORPORT_API
2702c2c66affSColin Finck USHORT
2703c2c66affSColin Finck NTAPI
2704c2c66affSColin Finck StorPortReadRegisterUshort(
2705c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2706c2c66affSColin Finck _In_ PUSHORT Register);
2707c2c66affSColin Finck
2708c2c66affSColin Finck STORPORT_API
2709c2c66affSColin Finck BOOLEAN
2710c2c66affSColin Finck NTAPI
2711c2c66affSColin Finck StorPortReady(
2712c2c66affSColin Finck _In_ PVOID HwDeviceExtension);
2713c2c66affSColin Finck
2714c2c66affSColin Finck STORPORT_API
2715c2c66affSColin Finck BOOLEAN
2716c2c66affSColin Finck NTAPI
2717c2c66affSColin Finck StorPortRegistryRead(
2718c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2719c2c66affSColin Finck _In_ PUCHAR ValueName,
2720c2c66affSColin Finck _In_ ULONG Global,
2721c2c66affSColin Finck _In_ ULONG Type,
2722c2c66affSColin Finck _In_ PUCHAR Buffer,
2723c2c66affSColin Finck _In_ PULONG BufferLength);
2724c2c66affSColin Finck
2725c2c66affSColin Finck STORPORT_API
2726c2c66affSColin Finck BOOLEAN
2727c2c66affSColin Finck NTAPI
2728c2c66affSColin Finck StorPortRegistryWrite(
2729c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2730c2c66affSColin Finck _In_ PUCHAR ValueName,
2731c2c66affSColin Finck _In_ ULONG Global,
2732c2c66affSColin Finck _In_ ULONG Type,
2733c2c66affSColin Finck _In_ PUCHAR Buffer,
2734c2c66affSColin Finck _In_ ULONG BufferLength);
2735c2c66affSColin Finck
2736c2c66affSColin Finck STORPORT_API
2737c2c66affSColin Finck BOOLEAN
2738c2c66affSColin Finck NTAPI
2739c2c66affSColin Finck StorPortResume(
2740c2c66affSColin Finck _In_ PVOID HwDeviceExtension);
2741c2c66affSColin Finck
2742c2c66affSColin Finck STORPORT_API
2743c2c66affSColin Finck BOOLEAN
2744c2c66affSColin Finck NTAPI
2745c2c66affSColin Finck StorPortResumeDevice(
2746c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2747c2c66affSColin Finck _In_ UCHAR PathId,
2748c2c66affSColin Finck _In_ UCHAR TargetId,
2749c2c66affSColin Finck _In_ UCHAR Lun);
2750c2c66affSColin Finck
2751c2c66affSColin Finck STORPORT_API
2752c2c66affSColin Finck ULONG
2753c2c66affSColin Finck NTAPI
2754c2c66affSColin Finck StorPortSetBusDataByOffset(
2755c2c66affSColin Finck _In_ PVOID DeviceExtension,
2756c2c66affSColin Finck _In_ ULONG BusDataType,
2757c2c66affSColin Finck _In_ ULONG SystemIoBusNumber,
2758c2c66affSColin Finck _In_ ULONG SlotNumber,
2759c2c66affSColin Finck _In_reads_bytes_(Length) PVOID Buffer,
2760c2c66affSColin Finck _In_ ULONG Offset,
2761c2c66affSColin Finck _In_ ULONG Length);
2762c2c66affSColin Finck
2763c2c66affSColin Finck STORPORT_API
2764c2c66affSColin Finck BOOLEAN
2765c2c66affSColin Finck NTAPI
2766c2c66affSColin Finck StorPortSetDeviceQueueDepth(
2767c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2768c2c66affSColin Finck _In_ UCHAR PathId,
2769c2c66affSColin Finck _In_ UCHAR TargetId,
2770c2c66affSColin Finck _In_ UCHAR Lun,
2771c2c66affSColin Finck _In_ ULONG Depth);
2772c2c66affSColin Finck
2773c2c66affSColin Finck STORPORT_API
2774c2c66affSColin Finck VOID
2775c2c66affSColin Finck NTAPI
2776c2c66affSColin Finck StorPortStallExecution(
2777c2c66affSColin Finck _In_ ULONG Delay);
2778c2c66affSColin Finck
2779c2c66affSColin Finck STORPORT_API
2780c2c66affSColin Finck VOID
2781c2c66affSColin Finck NTAPI
2782c2c66affSColin Finck StorPortSynchronizeAccess(
2783c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2784c2c66affSColin Finck _In_ PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine,
2785c2c66affSColin Finck _In_opt_ PVOID Context);
2786c2c66affSColin Finck
2787c2c66affSColin Finck STORPORT_API
2788c2c66affSColin Finck BOOLEAN
2789c2c66affSColin Finck NTAPI
2790c2c66affSColin Finck StorPortValidateRange(
2791c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2792c2c66affSColin Finck _In_ INTERFACE_TYPE BusType,
2793c2c66affSColin Finck _In_ ULONG SystemIoBusNumber,
2794c2c66affSColin Finck _In_ STOR_PHYSICAL_ADDRESS IoAddress,
2795c2c66affSColin Finck _In_ ULONG NumberOfBytes,
2796c2c66affSColin Finck _In_ BOOLEAN InIoSpace);
2797c2c66affSColin Finck
2798c2c66affSColin Finck STORPORT_API
2799c2c66affSColin Finck VOID
2800c2c66affSColin Finck NTAPI
2801c2c66affSColin Finck StorPortWritePortBufferUchar(
2802c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2803c2c66affSColin Finck _In_ PUCHAR Port,
2804c2c66affSColin Finck _In_ PUCHAR Buffer,
2805c2c66affSColin Finck _In_ ULONG Count);
2806c2c66affSColin Finck
2807c2c66affSColin Finck STORPORT_API
2808c2c66affSColin Finck VOID
2809c2c66affSColin Finck NTAPI
2810c2c66affSColin Finck StorPortWritePortBufferUlong(
2811c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2812c2c66affSColin Finck _In_ PULONG Port,
2813c2c66affSColin Finck _In_ PULONG Buffer,
2814c2c66affSColin Finck _In_ ULONG Count);
2815c2c66affSColin Finck
2816c2c66affSColin Finck STORPORT_API
2817c2c66affSColin Finck VOID
2818c2c66affSColin Finck NTAPI
2819c2c66affSColin Finck StorPortWritePortBufferUshort(
2820c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2821c2c66affSColin Finck _In_ PUSHORT Port,
2822c2c66affSColin Finck _In_ PUSHORT Buffer,
2823c2c66affSColin Finck _In_ ULONG Count);
2824c2c66affSColin Finck
2825c2c66affSColin Finck STORPORT_API
2826c2c66affSColin Finck VOID
2827c2c66affSColin Finck NTAPI
2828c2c66affSColin Finck StorPortWritePortUchar(
2829c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2830c2c66affSColin Finck _In_ PUCHAR Port,
2831c2c66affSColin Finck _In_ UCHAR Value);
2832c2c66affSColin Finck
2833c2c66affSColin Finck STORPORT_API
2834c2c66affSColin Finck VOID
2835c2c66affSColin Finck NTAPI
2836c2c66affSColin Finck StorPortWritePortUlong(
2837c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2838c2c66affSColin Finck _In_ PULONG Port,
2839c2c66affSColin Finck _In_ ULONG Value);
2840c2c66affSColin Finck
2841c2c66affSColin Finck STORPORT_API
2842c2c66affSColin Finck VOID
2843c2c66affSColin Finck NTAPI
2844c2c66affSColin Finck StorPortWritePortUshort(
2845c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2846c2c66affSColin Finck _In_ PUSHORT Port,
2847c2c66affSColin Finck _In_ USHORT Value);
2848c2c66affSColin Finck
2849c2c66affSColin Finck STORPORT_API
2850c2c66affSColin Finck VOID
2851c2c66affSColin Finck NTAPI
2852c2c66affSColin Finck StorPortWriteRegisterBufferUchar(
2853c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2854c2c66affSColin Finck _In_ PUCHAR Register,
2855c2c66affSColin Finck _In_ PUCHAR Buffer,
2856c2c66affSColin Finck _In_ ULONG Count);
2857c2c66affSColin Finck
2858c2c66affSColin Finck STORPORT_API
2859c2c66affSColin Finck VOID
2860c2c66affSColin Finck NTAPI
2861c2c66affSColin Finck StorPortWriteRegisterBufferUlong(
2862c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2863c2c66affSColin Finck _In_ PULONG Register,
2864c2c66affSColin Finck _In_ PULONG Buffer,
2865c2c66affSColin Finck _In_ ULONG Count);
2866c2c66affSColin Finck
2867c2c66affSColin Finck STORPORT_API
2868c2c66affSColin Finck VOID
2869c2c66affSColin Finck NTAPI
2870c2c66affSColin Finck StorPortWriteRegisterBufferUshort(
2871c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2872c2c66affSColin Finck _In_ PUSHORT Register,
2873c2c66affSColin Finck _In_ PUSHORT Buffer,
2874c2c66affSColin Finck _In_ ULONG Count);
2875c2c66affSColin Finck
2876c2c66affSColin Finck STORPORT_API
2877c2c66affSColin Finck VOID
2878c2c66affSColin Finck NTAPI
2879c2c66affSColin Finck StorPortWriteRegisterUchar(
2880c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2881c2c66affSColin Finck _In_ PUCHAR Register,
2882c2c66affSColin Finck _In_ UCHAR Value);
2883c2c66affSColin Finck
2884c2c66affSColin Finck STORPORT_API
2885c2c66affSColin Finck VOID
2886c2c66affSColin Finck NTAPI
2887c2c66affSColin Finck StorPortWriteRegisterUlong(
2888c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2889c2c66affSColin Finck _In_ PULONG Register,
2890c2c66affSColin Finck _In_ ULONG Value);
2891c2c66affSColin Finck
2892c2c66affSColin Finck STORPORT_API
2893c2c66affSColin Finck VOID
2894c2c66affSColin Finck NTAPI
2895c2c66affSColin Finck StorPortWriteRegisterUshort(
2896c2c66affSColin Finck _In_ PVOID HwDeviceExtension,
2897c2c66affSColin Finck _In_ PUSHORT Register,
2898c2c66affSColin Finck _In_ USHORT Value);
2899c2c66affSColin Finck
2900c2c66affSColin Finck
2901c2c66affSColin Finck FORCEINLINE
2902c2c66affSColin Finck BOOLEAN
StorPortEnablePassiveInitialization(_In_ PVOID DeviceExtension,_In_ PHW_PASSIVE_INITIALIZE_ROUTINE HwPassiveInitializeRoutine)2903c2c66affSColin Finck StorPortEnablePassiveInitialization(
2904c2c66affSColin Finck _In_ PVOID DeviceExtension,
2905c2c66affSColin Finck _In_ PHW_PASSIVE_INITIALIZE_ROUTINE HwPassiveInitializeRoutine)
2906c2c66affSColin Finck {
2907c2c66affSColin Finck LONG Succ;
2908c2c66affSColin Finck Succ = FALSE;
2909c2c66affSColin Finck StorPortNotification(EnablePassiveInitialization,
2910c2c66affSColin Finck DeviceExtension,
2911c2c66affSColin Finck HwPassiveInitializeRoutine,
2912c2c66affSColin Finck &Succ);
2913c2c66affSColin Finck return (BOOLEAN)Succ;
2914c2c66affSColin Finck }
2915c2c66affSColin Finck
2916c2c66affSColin Finck FORCEINLINE
2917c2c66affSColin Finck VOID
StorPortInitializeDpc(_In_ PVOID DeviceExtension,_Out_ PSTOR_DPC Dpc,_In_ PHW_DPC_ROUTINE HwDpcRoutine)2918c2c66affSColin Finck StorPortInitializeDpc(
2919c2c66affSColin Finck _In_ PVOID DeviceExtension,
2920c2c66affSColin Finck _Out_ PSTOR_DPC Dpc,
2921c2c66affSColin Finck _In_ PHW_DPC_ROUTINE HwDpcRoutine)
2922c2c66affSColin Finck {
2923c2c66affSColin Finck StorPortNotification(InitializeDpc,
2924c2c66affSColin Finck DeviceExtension,
2925c2c66affSColin Finck Dpc,
2926c2c66affSColin Finck HwDpcRoutine);
2927c2c66affSColin Finck }
2928c2c66affSColin Finck
2929c2c66affSColin Finck FORCEINLINE
2930c2c66affSColin Finck BOOLEAN
StorPortIssueDpc(_In_ PVOID DeviceExtension,_In_ PSTOR_DPC Dpc,_In_ PVOID SystemArgument1,_In_ PVOID SystemArgument2)2931c2c66affSColin Finck StorPortIssueDpc(
2932c2c66affSColin Finck _In_ PVOID DeviceExtension,
2933c2c66affSColin Finck _In_ PSTOR_DPC Dpc,
2934c2c66affSColin Finck _In_ PVOID SystemArgument1,
2935c2c66affSColin Finck _In_ PVOID SystemArgument2)
2936c2c66affSColin Finck {
2937c2c66affSColin Finck LONG Succ;
2938c2c66affSColin Finck Succ = FALSE;
2939c2c66affSColin Finck StorPortNotification(IssueDpc,
2940c2c66affSColin Finck DeviceExtension,
2941c2c66affSColin Finck Dpc,
2942c2c66affSColin Finck SystemArgument1,
2943c2c66affSColin Finck SystemArgument2,
2944c2c66affSColin Finck &Succ);
2945c2c66affSColin Finck return (BOOLEAN)Succ;
2946c2c66affSColin Finck }
2947c2c66affSColin Finck
2948c2c66affSColin Finck FORCEINLINE
2949c2c66affSColin Finck VOID
StorPortAcquireSpinLock(_In_ PVOID DeviceExtension,_In_ STOR_SPINLOCK SpinLock,_In_ PVOID LockContext,_Inout_ PSTOR_LOCK_HANDLE LockHandle)2950c2c66affSColin Finck StorPortAcquireSpinLock(
2951c2c66affSColin Finck _In_ PVOID DeviceExtension,
2952c2c66affSColin Finck _In_ STOR_SPINLOCK SpinLock,
2953c2c66affSColin Finck _In_ PVOID LockContext,
2954c2c66affSColin Finck _Inout_ PSTOR_LOCK_HANDLE LockHandle)
2955c2c66affSColin Finck {
2956c2c66affSColin Finck StorPortNotification(AcquireSpinLock,
2957c2c66affSColin Finck DeviceExtension,
2958c2c66affSColin Finck SpinLock,
2959c2c66affSColin Finck LockContext,
2960c2c66affSColin Finck LockHandle);
2961c2c66affSColin Finck }
2962c2c66affSColin Finck
2963c2c66affSColin Finck FORCEINLINE
2964c2c66affSColin Finck VOID
StorPortReleaseSpinLock(_In_ PVOID DeviceExtension,_Inout_ PSTOR_LOCK_HANDLE LockHandle)2965c2c66affSColin Finck StorPortReleaseSpinLock(
2966c2c66affSColin Finck _In_ PVOID DeviceExtension,
2967c2c66affSColin Finck _Inout_ PSTOR_LOCK_HANDLE LockHandle)
2968c2c66affSColin Finck {
2969c2c66affSColin Finck StorPortNotification(ReleaseSpinLock,
2970c2c66affSColin Finck DeviceExtension,
2971c2c66affSColin Finck LockHandle);
2972c2c66affSColin Finck }
2973c2c66affSColin Finck
2974ca22dc9bSEric Kohl STORPORT_API
2975ca22dc9bSEric Kohl ULONG
2976ca22dc9bSEric Kohl StorPortExtendedFunction(
2977ca22dc9bSEric Kohl _In_ STORPORT_FUNCTION_CODE FunctionCode,
2978ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
2979ca22dc9bSEric Kohl ...);
2980ca22dc9bSEric Kohl
2981ca22dc9bSEric Kohl FORCEINLINE
2982ca22dc9bSEric Kohl ULONG
StorPortAllocatePool(_In_ PVOID HwDeviceExtension,_In_ ULONG NumberOfBytes,_In_ ULONG Tag,_Out_ PVOID * BufferPointer)2983ca22dc9bSEric Kohl StorPortAllocatePool(
2984ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
2985ca22dc9bSEric Kohl _In_ ULONG NumberOfBytes,
2986ca22dc9bSEric Kohl _In_ ULONG Tag,
2987ca22dc9bSEric Kohl _Out_ PVOID *BufferPointer
2988ca22dc9bSEric Kohl )
2989ca22dc9bSEric Kohl {
2990ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionAllocatePool,
2991ca22dc9bSEric Kohl HwDeviceExtension,
2992ca22dc9bSEric Kohl NumberOfBytes,
2993ca22dc9bSEric Kohl Tag,
2994ca22dc9bSEric Kohl BufferPointer);
2995ca22dc9bSEric Kohl }
2996ca22dc9bSEric Kohl
2997ca22dc9bSEric Kohl FORCEINLINE
2998ca22dc9bSEric Kohl ULONG
StorPortFreePool(_In_ PVOID HwDeviceExtension,_In_ PVOID BufferPointer)2999ca22dc9bSEric Kohl StorPortFreePool(
3000ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3001ca22dc9bSEric Kohl _In_ PVOID BufferPointer)
3002ca22dc9bSEric Kohl {
3003ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionFreePool,
3004ca22dc9bSEric Kohl HwDeviceExtension,
3005ca22dc9bSEric Kohl BufferPointer);
3006ca22dc9bSEric Kohl }
3007ca22dc9bSEric Kohl
3008ca22dc9bSEric Kohl FORCEINLINE
3009ca22dc9bSEric Kohl ULONG
StorPortAllocateMdl(_In_ PVOID HwDeviceExtension,_In_ PVOID BufferPointer,_In_ ULONG NumberOfBytes,_Out_ PVOID * Mdl)3010ca22dc9bSEric Kohl StorPortAllocateMdl(
3011ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3012ca22dc9bSEric Kohl _In_ PVOID BufferPointer,
3013ca22dc9bSEric Kohl _In_ ULONG NumberOfBytes,
3014ca22dc9bSEric Kohl _Out_ PVOID *Mdl)
3015ca22dc9bSEric Kohl {
3016ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionAllocateMdl,
3017ca22dc9bSEric Kohl HwDeviceExtension,
3018ca22dc9bSEric Kohl BufferPointer,
3019ca22dc9bSEric Kohl NumberOfBytes,
3020ca22dc9bSEric Kohl Mdl);
3021ca22dc9bSEric Kohl }
3022ca22dc9bSEric Kohl
3023ca22dc9bSEric Kohl FORCEINLINE
3024ca22dc9bSEric Kohl ULONG
StorPortFreeMdl(_In_ PVOID HwDeviceExtension,_In_ PVOID Mdl)3025ca22dc9bSEric Kohl StorPortFreeMdl(
3026ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3027ca22dc9bSEric Kohl _In_ PVOID Mdl)
3028ca22dc9bSEric Kohl {
3029ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionFreeMdl,
3030ca22dc9bSEric Kohl HwDeviceExtension,
3031ca22dc9bSEric Kohl Mdl);
3032ca22dc9bSEric Kohl }
3033ca22dc9bSEric Kohl
3034ca22dc9bSEric Kohl FORCEINLINE
3035ca22dc9bSEric Kohl ULONG
StorPortBuildMdlForNonPagedPool(_In_ PVOID HwDeviceExtension,_Inout_ PVOID Mdl)3036ca22dc9bSEric Kohl StorPortBuildMdlForNonPagedPool(
3037ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3038ca22dc9bSEric Kohl _Inout_ PVOID Mdl)
3039ca22dc9bSEric Kohl {
3040ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionBuildMdlForNonPagedPool,
3041ca22dc9bSEric Kohl HwDeviceExtension,
3042ca22dc9bSEric Kohl Mdl);
3043ca22dc9bSEric Kohl }
3044ca22dc9bSEric Kohl
3045ca22dc9bSEric Kohl FORCEINLINE
3046ca22dc9bSEric Kohl ULONG
StorPortGetSystemAddress(_In_ PVOID HwDeviceExtension,_In_ PSCSI_REQUEST_BLOCK Srb,_Out_ PVOID * SystemAddress)3047ca22dc9bSEric Kohl StorPortGetSystemAddress(
3048ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3049ca22dc9bSEric Kohl _In_ PSCSI_REQUEST_BLOCK Srb,
3050ca22dc9bSEric Kohl _Out_ PVOID *SystemAddress)
3051ca22dc9bSEric Kohl {
3052ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionGetSystemAddress,
3053ca22dc9bSEric Kohl HwDeviceExtension,
3054ca22dc9bSEric Kohl Srb,
3055ca22dc9bSEric Kohl SystemAddress);
3056ca22dc9bSEric Kohl }
3057ca22dc9bSEric Kohl
3058ca22dc9bSEric Kohl FORCEINLINE
3059ca22dc9bSEric Kohl ULONG
StorPortGetOriginalMdl(_In_ PVOID HwDeviceExtension,_In_ PSCSI_REQUEST_BLOCK Srb,_Out_ PVOID * Mdl)3060ca22dc9bSEric Kohl StorPortGetOriginalMdl(
3061ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3062ca22dc9bSEric Kohl _In_ PSCSI_REQUEST_BLOCK Srb,
3063ca22dc9bSEric Kohl _Out_ PVOID *Mdl)
3064ca22dc9bSEric Kohl {
3065ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionGetOriginalMdl,
3066ca22dc9bSEric Kohl HwDeviceExtension,
3067ca22dc9bSEric Kohl Srb,
3068ca22dc9bSEric Kohl Mdl);
3069ca22dc9bSEric Kohl }
3070ca22dc9bSEric Kohl
3071ca22dc9bSEric Kohl FORCEINLINE
3072ca22dc9bSEric Kohl ULONG
StorPortCompleteServiceIrp(_In_ PVOID HwDeviceExtension,_In_ PVOID Irp)3073ca22dc9bSEric Kohl StorPortCompleteServiceIrp(
3074ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3075ca22dc9bSEric Kohl _In_ PVOID Irp)
3076ca22dc9bSEric Kohl {
3077ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionCompleteServiceIrp,
3078ca22dc9bSEric Kohl HwDeviceExtension,
3079ca22dc9bSEric Kohl Irp);
3080ca22dc9bSEric Kohl }
3081ca22dc9bSEric Kohl
3082ca22dc9bSEric Kohl FORCEINLINE
3083ca22dc9bSEric Kohl ULONG
StorPortGetDeviceObjects(_In_ PVOID HwDeviceExtension,_Out_ PVOID * AdapterDeviceObject,_Out_ PVOID * PhysicalDeviceObject,_Out_ PVOID * LowerDeviceObject)3084ca22dc9bSEric Kohl StorPortGetDeviceObjects(
3085ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3086ca22dc9bSEric Kohl _Out_ PVOID *AdapterDeviceObject,
3087ca22dc9bSEric Kohl _Out_ PVOID *PhysicalDeviceObject,
3088ca22dc9bSEric Kohl _Out_ PVOID *LowerDeviceObject)
3089ca22dc9bSEric Kohl {
3090ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionGetDeviceObjects,
3091ca22dc9bSEric Kohl HwDeviceExtension,
3092ca22dc9bSEric Kohl AdapterDeviceObject,
3093ca22dc9bSEric Kohl PhysicalDeviceObject,
3094ca22dc9bSEric Kohl LowerDeviceObject);
3095ca22dc9bSEric Kohl }
3096ca22dc9bSEric Kohl
3097ca22dc9bSEric Kohl FORCEINLINE
3098ca22dc9bSEric Kohl ULONG
StorPortBuildScatterGatherList(_In_ PVOID HwDeviceExtension,_In_ PVOID Mdl,_In_ PVOID CurrentVa,_In_ ULONG Length,_In_ PpostScaterGatherExecute ExecutionRoutine,_In_ PVOID Context,_In_ BOOLEAN WriteToDevice,_Inout_ PVOID ScatterGatherBuffer,_In_ ULONG ScatterGatherBufferLength)3099ca22dc9bSEric Kohl StorPortBuildScatterGatherList(
3100ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3101ca22dc9bSEric Kohl _In_ PVOID Mdl,
3102ca22dc9bSEric Kohl _In_ PVOID CurrentVa,
3103ca22dc9bSEric Kohl _In_ ULONG Length,
3104ca22dc9bSEric Kohl _In_ PpostScaterGatherExecute ExecutionRoutine,
3105ca22dc9bSEric Kohl _In_ PVOID Context,
3106ca22dc9bSEric Kohl _In_ BOOLEAN WriteToDevice,
3107ca22dc9bSEric Kohl _Inout_ PVOID ScatterGatherBuffer,
3108ca22dc9bSEric Kohl _In_ ULONG ScatterGatherBufferLength)
3109ca22dc9bSEric Kohl {
3110ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionBuildScatterGatherList,
3111ca22dc9bSEric Kohl HwDeviceExtension,
3112ca22dc9bSEric Kohl Mdl,
3113ca22dc9bSEric Kohl CurrentVa,
3114ca22dc9bSEric Kohl Length,
3115ca22dc9bSEric Kohl ExecutionRoutine,
3116ca22dc9bSEric Kohl Context,
3117ca22dc9bSEric Kohl WriteToDevice,
3118ca22dc9bSEric Kohl ScatterGatherBuffer,
3119ca22dc9bSEric Kohl ScatterGatherBufferLength);
3120ca22dc9bSEric Kohl }
3121ca22dc9bSEric Kohl
3122ca22dc9bSEric Kohl FORCEINLINE
3123ca22dc9bSEric Kohl ULONG
StorPortPutScatterGatherList(_In_ PVOID HwDeviceExtension,_In_ PSTOR_SCATTER_GATHER_LIST ScatterGatherList,_In_ BOOLEAN WriteToDevice)3124ca22dc9bSEric Kohl StorPortPutScatterGatherList(
3125ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3126ca22dc9bSEric Kohl _In_ PSTOR_SCATTER_GATHER_LIST ScatterGatherList,
3127ca22dc9bSEric Kohl _In_ BOOLEAN WriteToDevice)
3128ca22dc9bSEric Kohl {
3129ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionPutScatterGatherList,
3130ca22dc9bSEric Kohl HwDeviceExtension,
3131ca22dc9bSEric Kohl ScatterGatherList,
3132ca22dc9bSEric Kohl WriteToDevice);
3133ca22dc9bSEric Kohl }
3134ca22dc9bSEric Kohl
3135ca22dc9bSEric Kohl FORCEINLINE
3136ca22dc9bSEric Kohl ULONG
StorPortAcquireMSISpinLock(_In_ PVOID HwDeviceExtension,_In_ ULONG MessageId,_In_ PULONG OldIrql)3137ca22dc9bSEric Kohl StorPortAcquireMSISpinLock(
3138ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3139ca22dc9bSEric Kohl _In_ ULONG MessageId,
3140ca22dc9bSEric Kohl _In_ PULONG OldIrql)
3141ca22dc9bSEric Kohl {
3142ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionAcquireMSISpinLock,
3143ca22dc9bSEric Kohl HwDeviceExtension,
3144ca22dc9bSEric Kohl MessageId,
3145ca22dc9bSEric Kohl OldIrql);
3146ca22dc9bSEric Kohl }
3147ca22dc9bSEric Kohl
3148ca22dc9bSEric Kohl FORCEINLINE
3149ca22dc9bSEric Kohl ULONG
StorPortReleaseMSISpinLock(_In_ PVOID HwDeviceExtension,_In_ ULONG MessageId,_In_ ULONG OldIrql)3150ca22dc9bSEric Kohl StorPortReleaseMSISpinLock(
3151ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3152ca22dc9bSEric Kohl _In_ ULONG MessageId,
3153ca22dc9bSEric Kohl _In_ ULONG OldIrql)
3154ca22dc9bSEric Kohl {
3155ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionReleaseMSISpinLock,
3156ca22dc9bSEric Kohl HwDeviceExtension,
3157ca22dc9bSEric Kohl MessageId,
3158ca22dc9bSEric Kohl OldIrql);
3159ca22dc9bSEric Kohl }
3160ca22dc9bSEric Kohl
3161ca22dc9bSEric Kohl FORCEINLINE
3162ca22dc9bSEric Kohl ULONG
StorPortGetMSIInfo(_In_ PVOID HwDeviceExtension,_In_ ULONG MessageId,_Out_ PMESSAGE_INTERRUPT_INFORMATION InterruptInfo)3163ca22dc9bSEric Kohl StorPortGetMSIInfo(
3164ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3165ca22dc9bSEric Kohl _In_ ULONG MessageId,
3166ca22dc9bSEric Kohl _Out_ PMESSAGE_INTERRUPT_INFORMATION InterruptInfo)
3167ca22dc9bSEric Kohl {
3168ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionGetMessageInterruptInformation,
3169ca22dc9bSEric Kohl HwDeviceExtension,
3170ca22dc9bSEric Kohl MessageId,
3171ca22dc9bSEric Kohl InterruptInfo);
3172ca22dc9bSEric Kohl }
3173ca22dc9bSEric Kohl
3174ca22dc9bSEric Kohl FORCEINLINE
3175ca22dc9bSEric Kohl ULONG
StorPortInitializePerfOpts(_In_ PVOID HwDeviceExtension,_In_ BOOLEAN Query,_Inout_ PPERF_CONFIGURATION_DATA PerfConfigData)3176ca22dc9bSEric Kohl StorPortInitializePerfOpts(
3177ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3178ca22dc9bSEric Kohl _In_ BOOLEAN Query,
3179ca22dc9bSEric Kohl _Inout_ PPERF_CONFIGURATION_DATA PerfConfigData)
3180ca22dc9bSEric Kohl {
3181ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionInitializePerformanceOptimizations,
3182ca22dc9bSEric Kohl HwDeviceExtension,
3183ca22dc9bSEric Kohl Query,
3184ca22dc9bSEric Kohl PerfConfigData);
3185ca22dc9bSEric Kohl }
3186ca22dc9bSEric Kohl
3187ca22dc9bSEric Kohl FORCEINLINE
3188ca22dc9bSEric Kohl ULONG
StorPortGetStartIoPerfParams(_In_ PVOID HwDeviceExtension,_In_ PSCSI_REQUEST_BLOCK Srb,_Inout_ PSTARTIO_PERFORMANCE_PARAMETERS StartIoPerfParams)3189ca22dc9bSEric Kohl StorPortGetStartIoPerfParams(
3190ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3191ca22dc9bSEric Kohl _In_ PSCSI_REQUEST_BLOCK Srb,
3192ca22dc9bSEric Kohl _Inout_ PSTARTIO_PERFORMANCE_PARAMETERS StartIoPerfParams)
3193ca22dc9bSEric Kohl {
3194ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionGetStartIoPerformanceParameters,
3195ca22dc9bSEric Kohl HwDeviceExtension,
3196ca22dc9bSEric Kohl Srb,
3197ca22dc9bSEric Kohl StartIoPerfParams);
3198ca22dc9bSEric Kohl }
3199ca22dc9bSEric Kohl
3200ca22dc9bSEric Kohl FORCEINLINE
3201ca22dc9bSEric Kohl ULONG
StorPortLogSystemEvent(_In_ PVOID HwDeviceExtension,_Inout_ PSTOR_LOG_EVENT_DETAILS LogDetails,_Inout_ PULONG MaximumSize)3202ca22dc9bSEric Kohl StorPortLogSystemEvent(
3203ca22dc9bSEric Kohl _In_ PVOID HwDeviceExtension,
3204ca22dc9bSEric Kohl _Inout_ PSTOR_LOG_EVENT_DETAILS LogDetails,
3205ca22dc9bSEric Kohl _Inout_ PULONG MaximumSize)
3206ca22dc9bSEric Kohl {
3207ca22dc9bSEric Kohl return StorPortExtendedFunction(ExtFunctionLogSystemEvent,
3208ca22dc9bSEric Kohl HwDeviceExtension,
3209ca22dc9bSEric Kohl LogDetails,
3210ca22dc9bSEric Kohl MaximumSize);
3211ca22dc9bSEric Kohl }
3212ca22dc9bSEric Kohl
3213c2c66affSColin Finck #if DBG
3214c2c66affSColin Finck #define DebugPrint(x) StorPortDebugPrint x
3215c2c66affSColin Finck #else
3216c2c66affSColin Finck #define DebugPrint(x)
3217c2c66affSColin Finck #endif
3218c2c66affSColin Finck
3219c2c66affSColin Finck #ifdef __cplusplus
3220c2c66affSColin Finck }
3221c2c66affSColin Finck #endif
3222c2c66affSColin Finck
3223c2c66affSColin Finck #endif /* _NTSTORPORT_ */
3224