Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
4.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: pciidex.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #if !defined (___pciide_h___)
  11. #define ___pciide_h___
  12. #define _NTSRV_
  13. //#define _NTDDK_
  14. #include "stdarg.h"
  15. #include "stdio.h"
  16. #include "ntosp.h"
  17. //#include "pci.h"
  18. #include "wdmguid.h"
  19. #include "zwapi.h"
  20. //#include "ntddk.h"
  21. //#include "ntimage.h"
  22. //#include "ntexapi.h"
  23. //#include "ntrtl.h"
  24. #include "scsi.h"
  25. #include <initguid.h>
  26. #include <ntddscsi.h>
  27. #include <ntdddisk.h>
  28. #include <string.h>
  29. #include "wdmguid.h"
  30. #include "pciintrf.h"
  31. #ifdef POOL_TAGGING
  32. #ifdef ExAllocatePool
  33. #undef ExAllocatePool
  34. #endif
  35. #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,'XedI')
  36. #endif
  37. #define FULL_RESOURCE_LIST_SIZE(n) (sizeof (CM_FULL_RESOURCE_DESCRIPTOR) + (sizeof (CM_PARTIAL_RESOURCE_DESCRIPTOR) * (n - 1)))
  38. #if DBG
  39. #ifdef DebugPrint
  40. #undef DebugPrint
  41. #endif // DebugPrint
  42. #define DebugPrint(x) PciIdeDebugPrint x
  43. VOID
  44. PciIdeDebugPrint(
  45. ULONG DebugPrintLevel,
  46. PCCHAR DebugMessage,
  47. ...
  48. );
  49. #else
  50. #define DebugPrint(x)
  51. #endif // DBG
  52. //#define MAX_IDE_CHANNEL 2
  53. //#define MAX_IDE_DEVICE 2
  54. #define DRIVER_OBJECT_EXTENSION_ID DriverEntry
  55. #include "idep.h"
  56. #include "ctlrfdo.h"
  57. #include "chanpdo.h"
  58. #include "bm.h"
  59. #include "sync.h"
  60. #include "power.h"
  61. #include "msg.h"
  62. extern PDRIVER_DISPATCH FdoPnpDispatchTable[NUM_PNP_MINOR_FUNCTION];
  63. extern PDRIVER_DISPATCH PdoPnpDispatchTable[NUM_PNP_MINOR_FUNCTION];
  64. extern PDRIVER_DISPATCH FdoPowerDispatchTable[NUM_POWER_MINOR_FUNCTION];
  65. extern PDRIVER_DISPATCH PdoPowerDispatchTable[NUM_POWER_MINOR_FUNCTION];
  66. extern PDRIVER_DISPATCH FdoWmiDispatchTable[NUM_WMI_MINOR_FUNCTION];
  67. extern PDRIVER_DISPATCH PdoWmiDispatchTable[NUM_WMI_MINOR_FUNCTION];
  68. //
  69. // Controller Op Mode
  70. //
  71. #define PCIIDE_CHAN1_DUAL_MODE_CAPABLE (1 << 3)
  72. #define PCIIDE_CHAN1_IS_NATIVE_MODE (1 << 2)
  73. #define PCIIDE_CHAN0_DUAL_MODE_CAPABLE (1 << 1)
  74. #define PCIIDE_CHAN0_IS_NATIVE_MODE (1 << 0)
  75. NTSTATUS
  76. DriverEntry(
  77. IN PDRIVER_OBJECT DriverObject,
  78. IN PUNICODE_STRING RegistryPath
  79. );
  80. NTSTATUS
  81. PciIdeXInitialize(
  82. IN PDRIVER_OBJECT DriverObject,
  83. IN PUNICODE_STRING RegistryPath,
  84. IN PCONTROLLER_PROPERTIES PciIdeGetControllerProperties,
  85. IN ULONG ExtensionSize
  86. );
  87. NTSTATUS
  88. PciIdeXAlwaysStatusSuccessIrp (
  89. IN PDEVICE_OBJECT DeviceObject,
  90. IN OUT PIRP Irp
  91. );
  92. NTSTATUS
  93. DispatchPower(
  94. IN PDEVICE_OBJECT DeviceObject,
  95. IN OUT PIRP Irp
  96. );
  97. NTSTATUS
  98. DispatchPnp(
  99. IN PDEVICE_OBJECT DeviceObject,
  100. IN OUT PIRP Irp
  101. );
  102. NTSTATUS
  103. DispatchWmi(
  104. IN PDEVICE_OBJECT DeviceObject,
  105. IN OUT PIRP Irp
  106. );
  107. NTSTATUS
  108. PassDownToNextDriver (
  109. IN PDEVICE_OBJECT DeviceObject,
  110. IN OUT PIRP Irp
  111. );
  112. NTSTATUS
  113. StatusSuccessAndPassDownToNextDriver (
  114. IN PDEVICE_OBJECT DeviceObject,
  115. IN OUT PIRP Irp
  116. );
  117. NTSTATUS
  118. CompleteIrp (
  119. IN PDEVICE_OBJECT DeviceObject,
  120. IN OUT PIRP Irp
  121. );
  122. NTSTATUS
  123. NoSupportIrp (
  124. IN PDEVICE_OBJECT DeviceObject,
  125. IN OUT PIRP Irp
  126. );
  127. VOID
  128. AtapiHexToString (
  129. IN ULONG Value,
  130. IN OUT PCHAR *Buffer
  131. );
  132. NTSTATUS
  133. PciIdeXGetBusData(
  134. IN PVOID FdoExtension,
  135. IN PVOID Buffer,
  136. IN ULONG ConfigDataOffset,
  137. IN ULONG BufferLength
  138. );
  139. NTSTATUS
  140. PciIdeXSetBusData(
  141. IN PVOID FdoExtension,
  142. IN PVOID Buffer,
  143. IN PVOID DataMask,
  144. IN ULONG ConfigDataOffset,
  145. IN ULONG BufferLength
  146. );
  147. NTSTATUS
  148. PciIdeBusData(
  149. IN PCTRLFDO_EXTENSION FdoExtension,
  150. IN OUT PVOID Buffer,
  151. IN ULONG ConfigDataOffset,
  152. IN ULONG BufferLength,
  153. IN BOOLEAN ReadConfigData
  154. );
  155. NTSTATUS
  156. PciIdeBusDataCompletionRoutine(
  157. PDEVICE_OBJECT DeviceObject,
  158. PIRP Irp,
  159. PVOID Context
  160. );
  161. NTSTATUS
  162. PciIdeInternalDeviceIoControl (
  163. IN PDEVICE_OBJECT DeviceObject,
  164. IN OUT PIRP Irp
  165. );
  166. NTSTATUS
  167. PciIdeXRegQueryRoutine (
  168. IN PWSTR ValueName,
  169. IN ULONG ValueType,
  170. IN PVOID ValueData,
  171. IN ULONG ValueLength,
  172. IN PVOID Context,
  173. IN PVOID EntryContext
  174. );
  175. NTSTATUS
  176. PciIdeXGetDeviceParameterEx (
  177. IN PDEVICE_OBJECT DeviceObject,
  178. IN PWSTR ParameterName,
  179. IN OUT PVOID *ParameterValue
  180. );
  181. NTSTATUS
  182. PciIdeXGetDeviceParameter (
  183. IN PDEVICE_OBJECT DeviceObject,
  184. IN PWSTR ParameterName,
  185. IN OUT PULONG ParameterValue
  186. );
  187. VOID
  188. PciIdeUnload(
  189. IN PDRIVER_OBJECT DriverObject
  190. );
  191. NTSTATUS
  192. PciIdeXSyncSendIrp (
  193. IN PDEVICE_OBJECT TargetDeviceObject,
  194. IN PIO_STACK_LOCATION IrpSp,
  195. IN OUT OPTIONAL PIO_STATUS_BLOCK IoStatus
  196. );
  197. NTSTATUS
  198. PciIdeXSyncSendIrpCompletionRoutine (
  199. IN PDEVICE_OBJECT DeviceObject,
  200. IN PIRP Irp,
  201. IN PVOID Context
  202. );
  203. #endif // ___pciide_h___