Leaked source code of windows server 2003
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.

239 lines
5.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: chanpdo.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #if !defined (___chanpdo_h___)
  11. #define ___chanpdo_h___
  12. typedef enum BMSTATE {
  13. BmIdle,
  14. BmSet,
  15. BmArmed,
  16. BmDisarmed,
  17. } BMSTATE;
  18. #define PDOS_STARTED (1 << 0)
  19. #define PDOS_DEADMEAT (1 << 1)
  20. #define PDOS_STOPPED (1 << 2)
  21. #define PDOS_REMOVED (1 << 3)
  22. #define PDOS_SURPRISE_REMOVED (1 << 4)
  23. #define PDOS_DISABLED_BY_USER (1 << 5)
  24. typedef struct _PHYSICAL_REGION_DESCRIPTOR * PPHYSICAL_REGION_DESCRIPTOR;
  25. typedef struct _CHANNEL_PDO_EXTENSION {
  26. EXTENSION_COMMON_HEADER;
  27. PCTRLFDO_EXTENSION ParentDeviceExtension;
  28. ULONG ChannelNumber;
  29. KSPIN_LOCK SpinLock;
  30. ULONG PdoState;
  31. DMADETECTIONLEVEL DmaDetectionLevel;
  32. ULONG RefCount;
  33. ULONG PnPDeviceState;
  34. //
  35. // Busmaster Properties
  36. //
  37. PIDE_BUS_MASTER_REGISTERS BmRegister;
  38. PDMA_ADAPTER DmaAdapterObject;
  39. ULONG MaximumPhysicalPages;
  40. PPHYSICAL_REGION_DESCRIPTOR RegionDescriptorTable;
  41. PHYSICAL_ADDRESS PhysicalRegionDescriptorTable;
  42. PVOID DataVirtualAddress;
  43. PSCATTER_GATHER_LIST HalScatterGatherList;
  44. ULONG TransferLength;
  45. PVOID MapRegisterBase;
  46. PMDL Mdl;
  47. BOOLEAN DataIn;
  48. VOID (* BmCallback) (PVOID Context);
  49. PVOID BmCallbackContext;
  50. BMSTATE BmState;
  51. UCHAR BootBmStatus;
  52. BOOLEAN EmptyChannel;
  53. BOOLEAN NeedToCallIoInvalidateDeviceRelations;
  54. } CHANPDO_EXTENSION, *PCHANPDO_EXTENSION;
  55. PCHANPDO_EXTENSION
  56. ChannelGetPdoExtension(
  57. PDEVICE_OBJECT DeviceObject
  58. );
  59. ULONG
  60. ChannelUpdatePdoState(
  61. PCHANPDO_EXTENSION PdoExtension,
  62. ULONG SetFlags,
  63. ULONG ClearFlags
  64. );
  65. NTSTATUS
  66. ChannelStartDevice (
  67. IN PDEVICE_OBJECT DeviceObject,
  68. IN OUT PIRP Irp
  69. );
  70. NTSTATUS
  71. ChannelQueryStopRemoveDevice (
  72. IN PDEVICE_OBJECT DeviceObject,
  73. IN OUT PIRP Irp
  74. );
  75. NTSTATUS
  76. ChannelRemoveDevice (
  77. IN PDEVICE_OBJECT DeviceObject,
  78. IN OUT PIRP Irp
  79. );
  80. NTSTATUS
  81. ChannelStopDevice (
  82. IN PDEVICE_OBJECT DeviceObject,
  83. IN OUT PIRP Irp
  84. );
  85. NTSTATUS
  86. ChannelStopChannel (
  87. PCHANPDO_EXTENSION pdoExtension
  88. );
  89. NTSTATUS
  90. ChannelQueryId (
  91. IN PDEVICE_OBJECT DeviceObject,
  92. IN OUT PIRP Irp
  93. );
  94. PWSTR
  95. ChannelBuildDeviceId(
  96. IN PCHANPDO_EXTENSION pdoExtension
  97. );
  98. PWSTR
  99. ChannelBuildInstanceId(
  100. IN PCHANPDO_EXTENSION pdoExtension
  101. );
  102. PWSTR
  103. ChannelBuildCompatibleId(
  104. IN PCHANPDO_EXTENSION pdoExtension
  105. );
  106. PWSTR
  107. ChannelBuildHardwareId(
  108. IN PCHANPDO_EXTENSION pdoExtension
  109. );
  110. NTSTATUS
  111. ChannelQueryCapabitilies (
  112. IN PDEVICE_OBJECT DeviceObject,
  113. IN OUT PIRP Irp
  114. );
  115. NTSTATUS
  116. ChannelQueryResources(
  117. IN PDEVICE_OBJECT DeviceObject,
  118. IN PIRP Irp
  119. );
  120. NTSTATUS
  121. ChannelQueryResourceRequirements(
  122. IN PDEVICE_OBJECT DeviceObject,
  123. IN PIRP Irp
  124. );
  125. NTSTATUS
  126. ChannelQueryResourceRequirementsCompletionRoutine (
  127. IN PDEVICE_OBJECT DeviceObject,
  128. IN PIRP Irp,
  129. IN PVOID Context
  130. );
  131. NTSTATUS
  132. ChannelInternalDeviceIoControl(
  133. IN PDEVICE_OBJECT DeviceObject,
  134. IN PIRP Irp
  135. );
  136. NTSTATUS
  137. ChannelQueryText (
  138. IN PDEVICE_OBJECT DeviceObject,
  139. IN OUT PIRP Irp
  140. );
  141. NTSTATUS
  142. PciIdeChannelQueryInterface (
  143. IN PDEVICE_OBJECT DeviceObject,
  144. IN OUT PIRP Irp
  145. );
  146. NTSTATUS
  147. PciIdeChannelTransferModeInterface (
  148. IN PCHANPDO_EXTENSION PdoExtension,
  149. PPCIIDE_XFER_MODE_INTERFACE XferMode
  150. );
  151. NTSTATUS
  152. PciIdeChannelTransferModeSelect (
  153. IN PCHANPDO_EXTENSION PdoExtension,
  154. PPCIIDE_TRANSFER_MODE_SELECT XferMode
  155. );
  156. NTSTATUS
  157. ChannelQueryDeviceRelations (
  158. IN PDEVICE_OBJECT DeviceObject,
  159. IN OUT PIRP Irp
  160. );
  161. NTSTATUS
  162. ChannelUsageNotification (
  163. IN PDEVICE_OBJECT DeviceObject,
  164. IN OUT PIRP Irp
  165. );
  166. NTSTATUS
  167. ChannelQueryPnPDeviceState (
  168. IN PDEVICE_OBJECT DeviceObject,
  169. IN OUT PIRP Irp
  170. );
  171. VOID
  172. PciIdeChannelRequestProperResources(
  173. IN PDEVICE_OBJECT DeviceObject
  174. );
  175. NTSTATUS
  176. ChannelFilterResourceRequirements (
  177. IN PDEVICE_OBJECT DeviceObject,
  178. IN OUT PIRP Irp
  179. );
  180. #ifdef ENABLE_NATIVE_MODE
  181. NTSTATUS
  182. PciIdeInterruptControl (
  183. IN PVOID Context,
  184. IN ULONG DisConnect
  185. );
  186. NTSTATUS
  187. PciIdeChannelInterruptInterface (
  188. IN PCHANPDO_EXTENSION PdoExtension,
  189. PPCIIDE_INTERRUPT_INTERFACE InterruptInterface
  190. );
  191. #endif
  192. #endif // ___chanpdo_h___