Work around MinGW mangling of "host:/path"
[msysgit/historical-msysgit.git] / mingw / include / ddk / storport.h
bloba7df9a1f3d40fa284a7121d27abb2c9ebb7d4520
1 /*
2 * storport.h
4 * StorPort interface
6 * This file is part of the w32api package.
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 #ifndef __STORPORT_H
24 #define __STORPORT_H
26 #if __GNUC__ >=3
27 #pragma GCC system_header
28 #endif
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #include "ntddk.h"
35 #include "srb.h"
37 #if defined(_STORPORT_)
38 #define STORPORTAPI DECLSPEC_EXPORT
39 #else
40 #define STORPORTAPI DECLSPEC_IMPORT
41 #endif
44 typedef PHYSICAL_ADDRESS STOR_PHYSICAL_ADDRESS;
46 typedef struct _STOR_SCATTER_GATHER_ELEMENT {
47 STOR_PHYSICAL_ADDRESS PhysicalAddress;
48 ULONG Length;
49 ULONG_PTR Reserved;
50 } STOR_SCATTER_GATHER_ELEMENT, *PSTOR_SCATTER_GATHER_ELEMENT;
52 typedef struct _STOR_SCATTER_GATHER_LIST {
53 ULONG NumberOfElements;
54 ULONG_PTR Reserved;
55 STOR_SCATTER_GATHER_ELEMENT List[0];
56 } STOR_SCATTER_GATHER_LIST, *PSTOR_SCATTER_GATHER_LIST;
58 typedef struct _SCSI_WMI_REQUEST_BLOCK {
59 USHORT Length;
60 UCHAR Function;
61 UCHAR SrbStatus;
62 UCHAR WMISubFunction;
63 UCHAR PathId;
64 UCHAR TargetId;
65 UCHAR Lun;
66 UCHAR Reserved1;
67 UCHAR WMIFlags;
68 UCHAR Reserved2[2];
69 ULONG SrbFlags;
70 ULONG DataTransferLength;
71 ULONG TimeOutValue;
72 PVOID DataBuffer;
73 PVOID DataPath;
74 PVOID Reserved3;
75 PVOID OriginalRequest;
76 PVOID SrbExtension;
77 ULONG Reserved4;
78 UCHAR Reserved5[16];
79 } SCSI_WMI_REQUEST_BLOCK, *PSCSI_WMI_REQUEST_BLOCK;
82 STORPORTAPI
83 ULONG
84 DDKAPI
85 StorPortInitialize(
86 /*IN*/ PVOID Argument1,
87 /*IN*/ PVOID Argument2,
88 /*IN*/ PHW_INITIALIZATION_DATA HwInitializationData,
89 /*IN*/ PVOID Unused);
91 STORPORTAPI
92 VOID
93 DDKAPI
94 StorPortFreeDeviceBase(
95 /*IN*/ PVOID HwDeviceExtension,
96 /*IN*/ PVOID MappedAddress);
98 STORPORTAPI
99 ULONG
100 DDKAPI
101 StorPortGetBusData(
102 /*IN*/ PVOID DeviceExtension,
103 /*IN*/ ULONG BusDataType,
104 /*IN*/ ULONG SystemIoBusNumber,
105 /*IN*/ ULONG SlotNumber,
106 /*IN*/ PVOID Buffer,
107 /*IN*/ ULONG Length);
109 STORPORTAPI
110 ULONG
111 DDKAPI
112 StorPortSetBusDataByOffset(
113 /*IN*/ PVOID DeviceExtension,
114 /*IN*/ ULONG BusDataType,
115 /*IN*/ ULONG SystemIoBusNumber,
116 /*IN*/ ULONG SlotNumber,
117 /*IN*/ PVOID Buffer,
118 /*IN*/ ULONG Offset,
119 /*IN*/ ULONG Length);
121 STORPORTAPI
122 PVOID
123 DDKAPI
124 StorPortGetDeviceBase(
125 /*IN*/ PVOID HwDeviceExtension,
126 /*IN*/ INTERFACE_TYPE BusType,
127 /*IN*/ ULONG SystemIoBusNumber,
128 /*IN*/ SCSI_PHYSICAL_ADDRESS IoAddress,
129 /*IN*/ ULONG NumberOfBytes,
130 /*IN*/ BOOLEAN InIoSpace);
132 STORPORTAPI
133 PVOID
134 DDKAPI
135 StorPortGetLogicalUnit(
136 /*IN*/ PVOID HwDeviceExtension,
137 /*IN*/ UCHAR PathId,
138 /*IN*/ UCHAR TargetId,
139 /*IN*/ UCHAR Lun);
141 STORPORTAPI
142 PSCSI_REQUEST_BLOCK
143 DDKAPI
144 StorPortGetSrb(
145 /*IN*/ PVOID DeviceExtension,
146 /*IN*/ UCHAR PathId,
147 /*IN*/ UCHAR TargetId,
148 /*IN*/ UCHAR Lun,
149 /*IN*/ LONG QueueTag);
151 STORPORTAPI
152 STOR_PHYSICAL_ADDRESS
153 DDKAPI
154 StorPortGetPhysicalAddress(
155 /*IN*/ PVOID HwDeviceExtension,
156 /*IN*/ PSCSI_REQUEST_BLOCK Srb,
157 /*IN*/ PVOID VirtualAddress,
158 /*OUT*/ ULONG *Length);
160 STORPORTAPI
161 PVOID
162 DDKAPI
163 StorPortGetVirtualAddress(
164 /*IN*/ PVOID HwDeviceExtension,
165 /*IN*/ STOR_PHYSICAL_ADDRESS PhysicalAddress);
167 STORPORTAPI
168 PVOID
169 DDKAPI
170 StorPortGetUncachedExtension(
171 /*IN*/ PVOID HwDeviceExtension,
172 /*IN*/ PPORT_CONFIGURATION_INFORMATION ConfigInfo,
173 /*IN*/ ULONG NumberOfBytes);
175 STORPORTAPI
176 VOID
177 DDKCDECLAPI
178 StorPortNotification(
179 /*IN*/ SCSI_NOTIFICATION_TYPE NotificationType,
180 /*IN*/ PVOID HwDeviceExtension,
181 /*IN*/ ...);
183 STORPORTAPI
184 VOID
185 DDKAPI
186 StorPortLogError(
187 /*IN*/ PVOID HwDeviceExtension,
188 /*IN*/ PSCSI_REQUEST_BLOCK Srb /*OPTIONAL*/,
189 /*IN*/ UCHAR PathId,
190 /*IN*/ UCHAR TargetId,
191 /*IN*/ UCHAR Lun,
192 /*IN*/ ULONG ErrorCode,
193 /*IN*/ ULONG UniqueId);
195 STORPORTAPI
196 VOID
197 DDKAPI
198 StorPortCompleteRequest(
199 /*IN*/ PVOID HwDeviceExtension,
200 /*IN*/ UCHAR PathId,
201 /*IN*/ UCHAR TargetId,
202 /*IN*/ UCHAR Lun,
203 /*IN*/ UCHAR SrbStatus);
205 STORPORTAPI
206 VOID
207 DDKAPI
208 StorPortMoveMemory(
209 /*IN*/ PVOID WriteBuffer,
210 /*IN*/ PVOID ReadBuffer,
211 /*IN*/ ULONG Length);
213 STORPORTAPI
214 VOID
215 DDKAPI
216 StorPortStallExecution(
217 /*IN*/ ULONG Delay);
219 STORPORTAPI
220 STOR_PHYSICAL_ADDRESS
221 DDKAPI
222 StorPortConvertUlong64ToPhysicalAddress(
223 /*IN*/ ULONG64 UlongAddress);
225 STORPORTAPI
226 ULONG64
227 DDKAPI
228 StorPortConvertPhysicalAddressToUlong64(
229 /*IN*/ STOR_PHYSICAL_ADDRESS Address);
231 STORPORTAPI
232 BOOLEAN
233 DDKAPI
234 StorPortValidateRange(
235 /*IN*/ PVOID HwDeviceExtension,
236 /*IN*/ INTERFACE_TYPE BusType,
237 /*IN*/ ULONG SystemIoBusNumber,
238 /*IN*/ STOR_PHYSICAL_ADDRESS IoAddress,
239 /*IN*/ ULONG NumberOfBytes,
240 /*IN*/ BOOLEAN InIoSpace);
242 STORPORTAPI
243 VOID
244 DDKCDECLAPI
245 StorPortDebugPrint(
246 /*IN*/ ULONG DebugPrintLevel,
247 /*IN*/ PCCHAR DebugMessage,
248 /*IN*/ ...);
250 STORPORTAPI
251 UCHAR
252 DDKAPI
253 StorPortReadPortUchar(
254 /*IN*/ PUCHAR Port);
256 STORPORTAPI
257 ULONG
258 DDKAPI
259 StorPortReadPortUlong(
260 /*IN*/ PULONG Port);
262 STORPORTAPI
263 USHORT
264 DDKAPI
265 StorPortReadPortUshort(
266 /*IN*/ PUSHORT Port);
268 STORPORTAPI
269 UCHAR
270 DDKAPI
271 StorPortReadRegisterUchar(
272 /*IN*/ PUCHAR Register);
274 STORPORTAPI
275 ULONG
276 DDKAPI
277 StorPortReadRegisterUlong(
278 /*IN*/ PULONG Register);
280 STORPORTAPI
281 USHORT
282 DDKAPI
283 StorPortReadRegisterUshort(
284 /*IN*/ PUSHORT Register);
286 STORPORTAPI
287 VOID
288 DDKAPI
289 StorPortWritePortUchar(
290 /*IN*/ PUCHAR Port,
291 /*IN*/ UCHAR Value);
293 STORPORTAPI
294 VOID
295 DDKAPI
296 StorPortWritePortUlong(
297 /*IN*/ PULONG Port,
298 /*IN*/ ULONG Value);
300 STORPORTAPI
301 VOID
302 DDKAPI
303 StorPortWritePortUshort(
304 /*IN*/ PUSHORT Port,
305 /*IN*/ USHORT Value);
307 STORPORTAPI
308 VOID
309 DDKAPI
310 StorPortWriteRegisterUchar(
311 /*IN*/ PUCHAR Port,
312 /*IN*/ UCHAR Value);
314 STORPORTAPI
315 VOID
316 DDKAPI
317 StorPortWriteRegisterUlong(
318 /*IN*/ PULONG Port,
319 /*IN*/ ULONG Value);
321 STORPORTAPI
322 VOID
323 DDKAPI
324 StorPortWriteRegisterUshort(
325 /*IN*/ PUSHORT Port,
326 /*IN*/ USHORT Value);
328 STORPORTAPI
329 BOOLEAN
330 DDKAPI
331 StorPortPauseDevice(
332 /*IN*/ PVOID HwDeviceExtension,
333 /*IN*/ UCHAR PathId,
334 /*IN*/ UCHAR TargetId,
335 /*IN*/ UCHAR Lun,
336 /*IN*/ ULONG TimeOut);
338 STORPORTAPI
339 BOOLEAN
340 DDKAPI
341 StorPortResumeDevice(
342 /*IN*/ PVOID HwDeviceExtension,
343 /*IN*/ UCHAR PathId,
344 /*IN*/ UCHAR TargetId,
345 /*IN*/ UCHAR Lun);
347 STORPORTAPI
348 BOOLEAN
349 DDKAPI
350 StorPortPause(
351 /*IN*/ PVOID HwDeviceExtension,
352 /*IN*/ ULONG TimeOut);
354 STORPORTAPI
355 BOOLEAN
356 DDKAPI
357 StorPortResume(
358 /*IN*/ PVOID HwDeviceExtension);
360 STORPORTAPI
361 BOOLEAN
362 DDKAPI
363 StorPortDeviceBusy(
364 /*IN*/ PVOID HwDeviceExtension,
365 /*IN*/ UCHAR PathId,
366 /*IN*/ UCHAR TargetId,
367 /*IN*/ UCHAR Lun,
368 /*IN*/ ULONG RequestsToComplete);
370 STORPORTAPI
371 BOOLEAN
372 DDKAPI
373 StorPortDeviceReady(
374 /*IN*/ PVOID HwDeviceExtension,
375 /*IN*/ UCHAR PathId,
376 /*IN*/ UCHAR TargetId,
377 /*IN*/ UCHAR Lun);
379 STORPORTAPI
380 BOOLEAN
381 DDKAPI
382 StorPortBusy(
383 /*IN*/ PVOID HwDeviceExtension,
384 /*IN*/ ULONG RequestsToComplete);
386 STORPORTAPI
387 BOOLEAN
388 DDKAPI
389 StorPortReady(
390 /*IN*/ PVOID HwDeviceExtension);
392 STORPORTAPI
393 PSTOR_SCATTER_GATHER_LIST
394 DDKAPI
395 StorPortGetScatterGatherList(
396 /*IN*/ PVOID DeviceExtension,
397 /*IN*/ PSCSI_REQUEST_BLOCK Srb);
399 typedef BOOLEAN DDKAPI
400 (*PSTOR_SYNCHRONIZED_ACCESS)(
401 /*IN*/ PVOID HwDeviceExtension,
402 /*IN*/ PVOID Context);
404 STORPORTAPI
405 VOID
406 DDKAPI
407 StorPortSynchronizeAccess(
408 /*IN*/ PVOID HwDeviceExtension,
409 /*IN*/ PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine,
410 /*IN*/ PVOID Context);
412 #ifdef DBG
413 #define DebugPrint(x) StorPortDebugPrint x
414 #else
415 #define DebugPrint(x)
416 #endif
418 #ifdef __cplusplus
420 #endif
422 #endif /* __STORPORT_H */