home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 186 / DPCS0803.ISO / Café / Dev-C++ / devcpp4980.exe / $INSTDIR / include / ddk / storport.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-05-15  |  7.2 KB  |  427 lines

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