source: Daodan/MinGW/include/ddk/storport.h@ 1063

Last change on this file since 1063 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 7.6 KB
RevLine 
[1046]1/*
2 * storport.h
3 *
4 * StorPort interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
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.
20 *
21 */
22
23#ifndef __STORPORT_H
24#define __STORPORT_H
25
26#if __GNUC__ >=3
27#pragma GCC system_header
28#endif
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "ntddk.h"
35#include "srb.h"
36
37#if defined(_STORPORT_)
38 #define STORPORTAPI DECLSPEC_EXPORT
39#else
40 #define STORPORTAPI DECLSPEC_IMPORT
41#endif
42
43
44typedef PHYSICAL_ADDRESS STOR_PHYSICAL_ADDRESS;
45
46typedef 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;
51
52typedef 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;
57
58typedef 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;
80
81
82STORPORTAPI
83ULONG
84DDKAPI
85StorPortInitialize(
86 /*IN*/ PVOID Argument1,
87 /*IN*/ PVOID Argument2,
88 /*IN*/ PHW_INITIALIZATION_DATA HwInitializationData,
89 /*IN*/ PVOID Unused);
90
91STORPORTAPI
92VOID
93DDKAPI
94StorPortFreeDeviceBase(
95 /*IN*/ PVOID HwDeviceExtension,
96 /*IN*/ PVOID MappedAddress);
97
98STORPORTAPI
99ULONG
100DDKAPI
101StorPortGetBusData(
102 /*IN*/ PVOID DeviceExtension,
103 /*IN*/ ULONG BusDataType,
104 /*IN*/ ULONG SystemIoBusNumber,
105 /*IN*/ ULONG SlotNumber,
106 /*IN*/ PVOID Buffer,
107 /*IN*/ ULONG Length);
108
109STORPORTAPI
110ULONG
111DDKAPI
112StorPortSetBusDataByOffset(
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);
120
121STORPORTAPI
122PVOID
123DDKAPI
124StorPortGetDeviceBase(
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);
131
132STORPORTAPI
133PVOID
134DDKAPI
135StorPortGetLogicalUnit(
136 /*IN*/ PVOID HwDeviceExtension,
137 /*IN*/ UCHAR PathId,
138 /*IN*/ UCHAR TargetId,
139 /*IN*/ UCHAR Lun);
140
141STORPORTAPI
142PSCSI_REQUEST_BLOCK
143DDKAPI
144StorPortGetSrb(
145 /*IN*/ PVOID DeviceExtension,
146 /*IN*/ UCHAR PathId,
147 /*IN*/ UCHAR TargetId,
148 /*IN*/ UCHAR Lun,
149 /*IN*/ LONG QueueTag);
150
151STORPORTAPI
152STOR_PHYSICAL_ADDRESS
153DDKAPI
154StorPortGetPhysicalAddress(
155 /*IN*/ PVOID HwDeviceExtension,
156 /*IN*/ PSCSI_REQUEST_BLOCK Srb,
157 /*IN*/ PVOID VirtualAddress,
158 /*OUT*/ ULONG *Length);
159
160STORPORTAPI
161PVOID
162DDKAPI
163StorPortGetVirtualAddress(
164 /*IN*/ PVOID HwDeviceExtension,
165 /*IN*/ STOR_PHYSICAL_ADDRESS PhysicalAddress);
166
167STORPORTAPI
168PVOID
169DDKAPI
170StorPortGetUncachedExtension(
171 /*IN*/ PVOID HwDeviceExtension,
172 /*IN*/ PPORT_CONFIGURATION_INFORMATION ConfigInfo,
173 /*IN*/ ULONG NumberOfBytes);
174
175STORPORTAPI
176VOID
177DDKCDECLAPI
178StorPortNotification(
179 /*IN*/ SCSI_NOTIFICATION_TYPE NotificationType,
180 /*IN*/ PVOID HwDeviceExtension,
181 /*IN*/ ...);
182
183STORPORTAPI
184VOID
185DDKAPI
186StorPortLogError(
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);
194
195STORPORTAPI
196VOID
197DDKAPI
198StorPortCompleteRequest(
199 /*IN*/ PVOID HwDeviceExtension,
200 /*IN*/ UCHAR PathId,
201 /*IN*/ UCHAR TargetId,
202 /*IN*/ UCHAR Lun,
203 /*IN*/ UCHAR SrbStatus);
204
205STORPORTAPI
206VOID
207DDKAPI
208StorPortMoveMemory(
209 /*IN*/ PVOID WriteBuffer,
210 /*IN*/ PVOID ReadBuffer,
211 /*IN*/ ULONG Length);
212
213STORPORTAPI
214VOID
215DDKAPI
216StorPortStallExecution(
217 /*IN*/ ULONG Delay);
218
219STORPORTAPI
220STOR_PHYSICAL_ADDRESS
221DDKAPI
222StorPortConvertUlong64ToPhysicalAddress(
223 /*IN*/ ULONG64 UlongAddress);
224
225STORPORTAPI
226ULONG64
227DDKAPI
228StorPortConvertPhysicalAddressToUlong64(
229 /*IN*/ STOR_PHYSICAL_ADDRESS Address);
230
231STORPORTAPI
232BOOLEAN
233DDKAPI
234StorPortValidateRange(
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);
241
242STORPORTAPI
243VOID
244DDKCDECLAPI
245StorPortDebugPrint(
246 /*IN*/ ULONG DebugPrintLevel,
247 /*IN*/ PCCHAR DebugMessage,
248 /*IN*/ ...);
249
250STORPORTAPI
251UCHAR
252DDKAPI
253StorPortReadPortUchar(
254 /*IN*/ PUCHAR Port);
255
256STORPORTAPI
257ULONG
258DDKAPI
259StorPortReadPortUlong(
260 /*IN*/ PULONG Port);
261
262STORPORTAPI
263USHORT
264DDKAPI
265StorPortReadPortUshort(
266 /*IN*/ PUSHORT Port);
267
268STORPORTAPI
269UCHAR
270DDKAPI
271StorPortReadRegisterUchar(
272 /*IN*/ PUCHAR Register);
273
274STORPORTAPI
275ULONG
276DDKAPI
277StorPortReadRegisterUlong(
278 /*IN*/ PULONG Register);
279
280STORPORTAPI
281USHORT
282DDKAPI
283StorPortReadRegisterUshort(
284 /*IN*/ PUSHORT Register);
285
286STORPORTAPI
287VOID
288DDKAPI
289StorPortWritePortUchar(
290 /*IN*/ PUCHAR Port,
291 /*IN*/ UCHAR Value);
292
293STORPORTAPI
294VOID
295DDKAPI
296StorPortWritePortUlong(
297 /*IN*/ PULONG Port,
298 /*IN*/ ULONG Value);
299
300STORPORTAPI
301VOID
302DDKAPI
303StorPortWritePortUshort(
304 /*IN*/ PUSHORT Port,
305 /*IN*/ USHORT Value);
306
307STORPORTAPI
308VOID
309DDKAPI
310StorPortWriteRegisterUchar(
311 /*IN*/ PUCHAR Port,
312 /*IN*/ UCHAR Value);
313
314STORPORTAPI
315VOID
316DDKAPI
317StorPortWriteRegisterUlong(
318 /*IN*/ PULONG Port,
319 /*IN*/ ULONG Value);
320
321STORPORTAPI
322VOID
323DDKAPI
324StorPortWriteRegisterUshort(
325 /*IN*/ PUSHORT Port,
326 /*IN*/ USHORT Value);
327
328STORPORTAPI
329BOOLEAN
330DDKAPI
331StorPortPauseDevice(
332 /*IN*/ PVOID HwDeviceExtension,
333 /*IN*/ UCHAR PathId,
334 /*IN*/ UCHAR TargetId,
335 /*IN*/ UCHAR Lun,
336 /*IN*/ ULONG TimeOut);
337
338STORPORTAPI
339BOOLEAN
340DDKAPI
341StorPortResumeDevice(
342 /*IN*/ PVOID HwDeviceExtension,
343 /*IN*/ UCHAR PathId,
344 /*IN*/ UCHAR TargetId,
345 /*IN*/ UCHAR Lun);
346
347STORPORTAPI
348BOOLEAN
349DDKAPI
350StorPortPause(
351 /*IN*/ PVOID HwDeviceExtension,
352 /*IN*/ ULONG TimeOut);
353
354STORPORTAPI
355BOOLEAN
356DDKAPI
357StorPortResume(
358 /*IN*/ PVOID HwDeviceExtension);
359
360STORPORTAPI
361BOOLEAN
362DDKAPI
363StorPortDeviceBusy(
364 /*IN*/ PVOID HwDeviceExtension,
365 /*IN*/ UCHAR PathId,
366 /*IN*/ UCHAR TargetId,
367 /*IN*/ UCHAR Lun,
368 /*IN*/ ULONG RequestsToComplete);
369
370STORPORTAPI
371BOOLEAN
372DDKAPI
373StorPortDeviceReady(
374 /*IN*/ PVOID HwDeviceExtension,
375 /*IN*/ UCHAR PathId,
376 /*IN*/ UCHAR TargetId,
377 /*IN*/ UCHAR Lun);
378
379STORPORTAPI
380BOOLEAN
381DDKAPI
382StorPortBusy(
383 /*IN*/ PVOID HwDeviceExtension,
384 /*IN*/ ULONG RequestsToComplete);
385
386STORPORTAPI
387BOOLEAN
388DDKAPI
389StorPortReady(
390 /*IN*/ PVOID HwDeviceExtension);
391
392STORPORTAPI
393PSTOR_SCATTER_GATHER_LIST
394DDKAPI
395StorPortGetScatterGatherList(
396 /*IN*/ PVOID DeviceExtension,
397 /*IN*/ PSCSI_REQUEST_BLOCK Srb);
398
399typedef BOOLEAN DDKAPI
400(*PSTOR_SYNCHRONIZED_ACCESS)(
401 /*IN*/ PVOID HwDeviceExtension,
402 /*IN*/ PVOID Context);
403
404STORPORTAPI
405VOID
406DDKAPI
407StorPortSynchronizeAccess(
408 /*IN*/ PVOID HwDeviceExtension,
409 /*IN*/ PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine,
410 /*IN*/ PVOID Context);
411
412#ifdef DBG
413#define DebugPrint(x) StorPortDebugPrint x
414#else
415#define DebugPrint(x)
416#endif
417
418#ifdef __cplusplus
419}
420#endif
421
422#endif /* __STORPORT_H */
Note: See TracBrowser for help on using the repository browser.