source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/ddk/storport.h@ 1175

Last change on this file since 1175 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 7.0 KB
Line 
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#include "srb.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#if defined(_STORPORT_)
33#define STORPORTAPI
34#else
35#define STORPORTAPI DECLSPEC_IMPORT
36#endif
37
38
39typedef PHYSICAL_ADDRESS STOR_PHYSICAL_ADDRESS;
40
41typedef struct _STOR_SCATTER_GATHER_ELEMENT {
42 STOR_PHYSICAL_ADDRESS PhysicalAddress;
43 ULONG Length;
44 ULONG_PTR Reserved;
45} STOR_SCATTER_GATHER_ELEMENT, *PSTOR_SCATTER_GATHER_ELEMENT;
46
47typedef struct _STOR_SCATTER_GATHER_LIST {
48 ULONG NumberOfElements;
49 ULONG_PTR Reserved;
50 STOR_SCATTER_GATHER_ELEMENT List[0];
51} STOR_SCATTER_GATHER_LIST, *PSTOR_SCATTER_GATHER_LIST;
52
53typedef struct _SCSI_WMI_REQUEST_BLOCK {
54 USHORT Length;
55 UCHAR Function;
56 UCHAR SrbStatus;
57 UCHAR WMISubFunction;
58 UCHAR PathId;
59 UCHAR TargetId;
60 UCHAR Lun;
61 UCHAR Reserved1;
62 UCHAR WMIFlags;
63 UCHAR Reserved2[2];
64 ULONG SrbFlags;
65 ULONG DataTransferLength;
66 ULONG TimeOutValue;
67 PVOID DataBuffer;
68 PVOID DataPath;
69 PVOID Reserved3;
70 PVOID OriginalRequest;
71 PVOID SrbExtension;
72 ULONG Reserved4;
73 UCHAR Reserved5[16];
74} SCSI_WMI_REQUEST_BLOCK, *PSCSI_WMI_REQUEST_BLOCK;
75
76
77STORPORTAPI
78ULONG
79NTAPI
80StorPortInitialize(
81 IN PVOID Argument1,
82 IN PVOID Argument2,
83 IN PHW_INITIALIZATION_DATA HwInitializationData,
84 IN PVOID Unused);
85
86STORPORTAPI
87VOID
88NTAPI
89StorPortFreeDeviceBase(
90 IN PVOID HwDeviceExtension,
91 IN PVOID MappedAddress);
92
93STORPORTAPI
94ULONG
95NTAPI
96StorPortGetBusData(
97 IN PVOID DeviceExtension,
98 IN ULONG BusDataType,
99 IN ULONG SystemIoBusNumber,
100 IN ULONG SlotNumber,
101 IN PVOID Buffer,
102 IN ULONG Length);
103
104STORPORTAPI
105ULONG
106NTAPI
107StorPortSetBusDataByOffset(
108 IN PVOID DeviceExtension,
109 IN ULONG BusDataType,
110 IN ULONG SystemIoBusNumber,
111 IN ULONG SlotNumber,
112 IN PVOID Buffer,
113 IN ULONG Offset,
114 IN ULONG Length);
115
116STORPORTAPI
117PVOID
118NTAPI
119StorPortGetDeviceBase(
120 IN PVOID HwDeviceExtension,
121 IN INTERFACE_TYPE BusType,
122 IN ULONG SystemIoBusNumber,
123 IN SCSI_PHYSICAL_ADDRESS IoAddress,
124 IN ULONG NumberOfBytes,
125 IN BOOLEAN InIoSpace);
126
127STORPORTAPI
128PVOID
129NTAPI
130StorPortGetLogicalUnit(
131 IN PVOID HwDeviceExtension,
132 IN UCHAR PathId,
133 IN UCHAR TargetId,
134 IN UCHAR Lun);
135
136STORPORTAPI
137PSCSI_REQUEST_BLOCK
138NTAPI
139StorPortGetSrb(
140 IN PVOID DeviceExtension,
141 IN UCHAR PathId,
142 IN UCHAR TargetId,
143 IN UCHAR Lun,
144 IN LONG QueueTag);
145
146STORPORTAPI
147STOR_PHYSICAL_ADDRESS
148NTAPI
149StorPortGetPhysicalAddress(
150 IN PVOID HwDeviceExtension,
151 IN PSCSI_REQUEST_BLOCK Srb,
152 IN PVOID VirtualAddress,
153 OUT ULONG *Length);
154
155STORPORTAPI
156PVOID
157NTAPI
158StorPortGetVirtualAddress(
159 IN PVOID HwDeviceExtension,
160 IN STOR_PHYSICAL_ADDRESS PhysicalAddress);
161
162STORPORTAPI
163PVOID
164NTAPI
165StorPortGetUncachedExtension(
166 IN PVOID HwDeviceExtension,
167 IN PPORT_CONFIGURATION_INFORMATION ConfigInfo,
168 IN ULONG NumberOfBytes);
169
170STORPORTAPI
171VOID
172__cdecl
173StorPortNotification(
174 IN SCSI_NOTIFICATION_TYPE NotificationType,
175 IN PVOID HwDeviceExtension,
176 IN ...);
177
178STORPORTAPI
179VOID
180NTAPI
181StorPortLogError(
182 IN PVOID HwDeviceExtension,
183 IN PSCSI_REQUEST_BLOCK Srb OPTIONAL,
184 IN UCHAR PathId,
185 IN UCHAR TargetId,
186 IN UCHAR Lun,
187 IN ULONG ErrorCode,
188 IN ULONG UniqueId);
189
190STORPORTAPI
191VOID
192NTAPI
193StorPortCompleteRequest(
194 IN PVOID HwDeviceExtension,
195 IN UCHAR PathId,
196 IN UCHAR TargetId,
197 IN UCHAR Lun,
198 IN UCHAR SrbStatus);
199
200STORPORTAPI
201VOID
202NTAPI
203StorPortMoveMemory(
204 IN PVOID WriteBuffer,
205 IN PVOID ReadBuffer,
206 IN ULONG Length);
207
208STORPORTAPI
209VOID
210NTAPI
211StorPortStallExecution(
212 IN ULONG Delay);
213
214STORPORTAPI
215STOR_PHYSICAL_ADDRESS
216NTAPI
217StorPortConvertUlong64ToPhysicalAddress(
218 IN ULONG64 UlongAddress);
219
220STORPORTAPI
221ULONG64
222NTAPI
223StorPortConvertPhysicalAddressToUlong64(
224 IN STOR_PHYSICAL_ADDRESS Address);
225
226STORPORTAPI
227BOOLEAN
228NTAPI
229StorPortValidateRange(
230 IN PVOID HwDeviceExtension,
231 IN INTERFACE_TYPE BusType,
232 IN ULONG SystemIoBusNumber,
233 IN STOR_PHYSICAL_ADDRESS IoAddress,
234 IN ULONG NumberOfBytes,
235 IN BOOLEAN InIoSpace);
236
237STORPORTAPI
238VOID
239__cdecl
240StorPortDebugPrint(
241 IN ULONG DebugPrintLevel,
242 IN PCCHAR DebugMessage,
243 IN ...);
244
245STORPORTAPI
246UCHAR
247NTAPI
248StorPortReadPortUchar(
249 IN PUCHAR Port);
250
251STORPORTAPI
252ULONG
253NTAPI
254StorPortReadPortUlong(
255 IN PULONG Port);
256
257STORPORTAPI
258USHORT
259NTAPI
260StorPortReadPortUshort(
261 IN PUSHORT Port);
262
263STORPORTAPI
264UCHAR
265NTAPI
266StorPortReadRegisterUchar(
267 IN PUCHAR Register);
268
269STORPORTAPI
270ULONG
271NTAPI
272StorPortReadRegisterUlong(
273 IN PULONG Register);
274
275STORPORTAPI
276USHORT
277NTAPI
278StorPortReadRegisterUshort(
279 IN PUSHORT Register);
280
281STORPORTAPI
282VOID
283NTAPI
284StorPortWritePortUchar(
285 IN PUCHAR Port,
286 IN UCHAR Value);
287
288STORPORTAPI
289VOID
290NTAPI
291StorPortWritePortUlong(
292 IN PULONG Port,
293 IN ULONG Value);
294
295STORPORTAPI
296VOID
297NTAPI
298StorPortWritePortUshort(
299 IN PUSHORT Port,
300 IN USHORT Value);
301
302STORPORTAPI
303VOID
304NTAPI
305StorPortWriteRegisterUchar(
306 IN PUCHAR Port,
307 IN UCHAR Value);
308
309STORPORTAPI
310VOID
311NTAPI
312StorPortWriteRegisterUlong(
313 IN PULONG Port,
314 IN ULONG Value);
315
316STORPORTAPI
317VOID
318NTAPI
319StorPortWriteRegisterUshort(
320 IN PUSHORT Port,
321 IN USHORT Value);
322
323STORPORTAPI
324BOOLEAN
325NTAPI
326StorPortPauseDevice(
327 IN PVOID HwDeviceExtension,
328 IN UCHAR PathId,
329 IN UCHAR TargetId,
330 IN UCHAR Lun,
331 IN ULONG TimeOut);
332
333STORPORTAPI
334BOOLEAN
335NTAPI
336StorPortResumeDevice(
337 IN PVOID HwDeviceExtension,
338 IN UCHAR PathId,
339 IN UCHAR TargetId,
340 IN UCHAR Lun);
341
342STORPORTAPI
343BOOLEAN
344NTAPI
345StorPortPause(
346 IN PVOID HwDeviceExtension,
347 IN ULONG TimeOut);
348
349STORPORTAPI
350BOOLEAN
351NTAPI
352StorPortResume(
353 IN PVOID HwDeviceExtension);
354
355STORPORTAPI
356BOOLEAN
357NTAPI
358StorPortDeviceBusy(
359 IN PVOID HwDeviceExtension,
360 IN UCHAR PathId,
361 IN UCHAR TargetId,
362 IN UCHAR Lun,
363 IN ULONG RequestsToComplete);
364
365STORPORTAPI
366BOOLEAN
367NTAPI
368StorPortDeviceReady(
369 IN PVOID HwDeviceExtension,
370 IN UCHAR PathId,
371 IN UCHAR TargetId,
372 IN UCHAR Lun);
373
374STORPORTAPI
375BOOLEAN
376NTAPI
377StorPortBusy(
378 IN PVOID HwDeviceExtension,
379 IN ULONG RequestsToComplete);
380
381STORPORTAPI
382BOOLEAN
383NTAPI
384StorPortReady(
385 IN PVOID HwDeviceExtension);
386
387STORPORTAPI
388PSTOR_SCATTER_GATHER_LIST
389NTAPI
390StorPortGetScatterGatherList(
391 IN PVOID DeviceExtension,
392 IN PSCSI_REQUEST_BLOCK Srb);
393
394typedef BOOLEAN
395(NTAPI *PSTOR_SYNCHRONIZED_ACCESS)(
396 IN PVOID HwDeviceExtension,
397 IN PVOID Context);
398
399STORPORTAPI
400VOID
401NTAPI
402StorPortSynchronizeAccess(
403 IN PVOID HwDeviceExtension,
404 IN PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine,
405 IN PVOID Context);
406
407#if DBG
408#define DebugPrint(x) StorPortDebugPrint x
409#else
410#define DebugPrint(x)
411#endif
412
413#ifdef __cplusplus
414}
415#endif
416
417#endif /* __STORPORT_H */
Note: See TracBrowser for help on using the repository browser.