6 * This file is part of the w32api package.
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.
27 #pragma GCC system_header
37 #if defined(_STORPORT_)
38 #define STORPORTAPI DECLSPEC_EXPORT
40 #define STORPORTAPI DECLSPEC_IMPORT
44 typedef PHYSICAL_ADDRESS STOR_PHYSICAL_ADDRESS
;
46 typedef struct _STOR_SCATTER_GATHER_ELEMENT
{
47 STOR_PHYSICAL_ADDRESS PhysicalAddress
;
50 } STOR_SCATTER_GATHER_ELEMENT
, *PSTOR_SCATTER_GATHER_ELEMENT
;
52 typedef struct _STOR_SCATTER_GATHER_LIST
{
53 ULONG NumberOfElements
;
55 STOR_SCATTER_GATHER_ELEMENT List
[0];
56 } STOR_SCATTER_GATHER_LIST
, *PSTOR_SCATTER_GATHER_LIST
;
58 typedef struct _SCSI_WMI_REQUEST_BLOCK
{
70 ULONG DataTransferLength
;
75 PVOID OriginalRequest
;
79 } SCSI_WMI_REQUEST_BLOCK
, *PSCSI_WMI_REQUEST_BLOCK
;
86 /*IN*/ PVOID Argument1
,
87 /*IN*/ PVOID Argument2
,
88 /*IN*/ PHW_INITIALIZATION_DATA HwInitializationData
,
94 StorPortFreeDeviceBase(
95 /*IN*/ PVOID HwDeviceExtension
,
96 /*IN*/ PVOID MappedAddress
);
102 /*IN*/ PVOID DeviceExtension
,
103 /*IN*/ ULONG BusDataType
,
104 /*IN*/ ULONG SystemIoBusNumber
,
105 /*IN*/ ULONG SlotNumber
,
107 /*IN*/ ULONG Length
);
112 StorPortSetBusDataByOffset(
113 /*IN*/ PVOID DeviceExtension
,
114 /*IN*/ ULONG BusDataType
,
115 /*IN*/ ULONG SystemIoBusNumber
,
116 /*IN*/ ULONG SlotNumber
,
119 /*IN*/ ULONG Length
);
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
);
135 StorPortGetLogicalUnit(
136 /*IN*/ PVOID HwDeviceExtension
,
138 /*IN*/ UCHAR TargetId
,
145 /*IN*/ PVOID DeviceExtension
,
147 /*IN*/ UCHAR TargetId
,
149 /*IN*/ LONG QueueTag
);
152 STOR_PHYSICAL_ADDRESS
154 StorPortGetPhysicalAddress(
155 /*IN*/ PVOID HwDeviceExtension
,
156 /*IN*/ PSCSI_REQUEST_BLOCK Srb
,
157 /*IN*/ PVOID VirtualAddress
,
158 /*OUT*/ ULONG
*Length
);
163 StorPortGetVirtualAddress(
164 /*IN*/ PVOID HwDeviceExtension
,
165 /*IN*/ STOR_PHYSICAL_ADDRESS PhysicalAddress
);
170 StorPortGetUncachedExtension(
171 /*IN*/ PVOID HwDeviceExtension
,
172 /*IN*/ PPORT_CONFIGURATION_INFORMATION ConfigInfo
,
173 /*IN*/ ULONG NumberOfBytes
);
178 StorPortNotification(
179 /*IN*/ SCSI_NOTIFICATION_TYPE NotificationType
,
180 /*IN*/ PVOID HwDeviceExtension
,
187 /*IN*/ PVOID HwDeviceExtension
,
188 /*IN*/ PSCSI_REQUEST_BLOCK Srb
/*OPTIONAL*/,
190 /*IN*/ UCHAR TargetId
,
192 /*IN*/ ULONG ErrorCode
,
193 /*IN*/ ULONG UniqueId
);
198 StorPortCompleteRequest(
199 /*IN*/ PVOID HwDeviceExtension
,
201 /*IN*/ UCHAR TargetId
,
203 /*IN*/ UCHAR SrbStatus
);
209 /*IN*/ PVOID WriteBuffer
,
210 /*IN*/ PVOID ReadBuffer
,
211 /*IN*/ ULONG Length
);
216 StorPortStallExecution(
220 STOR_PHYSICAL_ADDRESS
222 StorPortConvertUlong64ToPhysicalAddress(
223 /*IN*/ ULONG64 UlongAddress
);
228 StorPortConvertPhysicalAddressToUlong64(
229 /*IN*/ STOR_PHYSICAL_ADDRESS Address
);
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
);
246 /*IN*/ ULONG DebugPrintLevel
,
247 /*IN*/ PCCHAR DebugMessage
,
253 StorPortReadPortUchar(
259 StorPortReadPortUlong(
265 StorPortReadPortUshort(
266 /*IN*/ PUSHORT Port
);
271 StorPortReadRegisterUchar(
272 /*IN*/ PUCHAR Register
);
277 StorPortReadRegisterUlong(
278 /*IN*/ PULONG Register
);
283 StorPortReadRegisterUshort(
284 /*IN*/ PUSHORT Register
);
289 StorPortWritePortUchar(
296 StorPortWritePortUlong(
303 StorPortWritePortUshort(
305 /*IN*/ USHORT Value
);
310 StorPortWriteRegisterUchar(
317 StorPortWriteRegisterUlong(
324 StorPortWriteRegisterUshort(
326 /*IN*/ USHORT Value
);
332 /*IN*/ PVOID HwDeviceExtension
,
334 /*IN*/ UCHAR TargetId
,
336 /*IN*/ ULONG TimeOut
);
341 StorPortResumeDevice(
342 /*IN*/ PVOID HwDeviceExtension
,
344 /*IN*/ UCHAR TargetId
,
351 /*IN*/ PVOID HwDeviceExtension
,
352 /*IN*/ ULONG TimeOut
);
358 /*IN*/ PVOID HwDeviceExtension
);
364 /*IN*/ PVOID HwDeviceExtension
,
366 /*IN*/ UCHAR TargetId
,
368 /*IN*/ ULONG RequestsToComplete
);
374 /*IN*/ PVOID HwDeviceExtension
,
376 /*IN*/ UCHAR TargetId
,
383 /*IN*/ PVOID HwDeviceExtension
,
384 /*IN*/ ULONG RequestsToComplete
);
390 /*IN*/ PVOID HwDeviceExtension
);
393 PSTOR_SCATTER_GATHER_LIST
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
);
407 StorPortSynchronizeAccess(
408 /*IN*/ PVOID HwDeviceExtension
,
409 /*IN*/ PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine
,
410 /*IN*/ PVOID Context
);
413 #define DebugPrint(x) StorPortDebugPrint x
415 #define DebugPrint(x)
422 #endif /* __STORPORT_H */