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.

660 lines
18 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: idep.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #if !defined (___idep_h___)
  11. #define ___idep_h___
  12. #include "ide.h"
  13. #include "wmilib.h"
  14. // go to ntddscsi.h
  15. #define SRB_FUNCTION_ATA_POWER_PASS_THROUGH 0xC7
  16. #define SRB_FUNCTION_ATA_PASS_THROUGH 0xC8
  17. #define ATA_PTFLAGS_BUS_RESET (1 << 0)
  18. #define ATA_PTFLAGS_OK_TO_FAIL (1 << 1)
  19. #define ATA_PTFLAGS_EMPTY_CHANNEL_TEST (1 << 2)
  20. #define ATA_PTFLAGS_INLINE_HARD_RESET (1 << 3)
  21. #define ATA_PTFLAGS_ENUM_PROBING (1 << 4)
  22. #define ATA_PTFLAGS_NO_OP (1 << 5)
  23. #define ATA_PTFLAGS_STATUS_DRDY_REQUIRED (1 << 6)
  24. #define ATA_PTFLAGS_URGENT (1 << 7)
  25. #define MAX_TRANSFER_SIZE_PER_SRB (0x100 * 0x200) // 128k ATA limits
  26. typedef struct _ATA_PASS_THROUGH {
  27. IDEREGS IdeReg;
  28. ULONG DataBufferSize; // byte size of DataBuffer[]
  29. UCHAR DataBuffer[1];
  30. }ATA_PASS_THROUGH, *PATA_PASS_THROUGH;
  31. #define NUM_PNP_MINOR_FUNCTION (0x19)
  32. #define NUM_POWER_MINOR_FUNCTION (0x04)
  33. #define NUM_WMI_MINOR_FUNCTION (0xc)
  34. #define SAMPLE_CYLINDER_LOW_VALUE 0x55
  35. #define SAMPLE_CYLINDER_HIGH_VALUE 0xaa
  36. //
  37. // Scsiops to suuport dvd operation
  38. // Should go to scsi.h?
  39. //
  40. #if 0
  41. #define SCSIOP_DVD_READ 0xA8
  42. #endif
  43. //
  44. // IDE drive control definitions
  45. //
  46. #define IDE_DC_DISABLE_INTERRUPTS 0x02
  47. #define IDE_DC_RESET_CONTROLLER 0x04
  48. #define IDE_DC_REENABLE_CONTROLLER 0x00
  49. //
  50. // IDE status definitions
  51. //
  52. #define IDE_STATUS_ERROR 0x01
  53. #define IDE_STATUS_INDEX 0x02
  54. #define IDE_STATUS_CORRECTED_ERROR 0x04
  55. #define IDE_STATUS_DRQ 0x08
  56. #define IDE_STATUS_DSC 0x10
  57. #define IDE_STATUS_DRDY 0x40
  58. #define IDE_STATUS_IDLE 0x50
  59. #define IDE_STATUS_BUSY 0x80
  60. #define GetStatus(BaseIoAddress, Status) \
  61. Status = READ_PORT_UCHAR((BaseIoAddress)->Command);
  62. //
  63. // NEC 98: ide control port.
  64. //
  65. #define CURRENT_INTERRUPT_SENCE (PUCHAR)0x430
  66. #define SELECT_IDE_PORT (PUCHAR)0x432
  67. //
  68. // NEC 98: dip-switch 2 system port.
  69. //
  70. #define SYSTEM_PORT_A (PUCHAR)0x31
  71. //
  72. // NEC 98: check enhanced ide support.
  73. //
  74. #define EnhancedIdeSupport() \
  75. (READ_PORT_UCHAR(CURRENT_INTERRUPT_SENCE)&0x40)?TRUE:FALSE
  76. //
  77. // Checking legacy ide on NEC 98.
  78. //
  79. #ifdef IsNEC_98
  80. #undef IsNEC_98
  81. #endif
  82. #define IsNEC_98 0
  83. #define Is98LegacyIde(BaseIoAddress) \
  84. (BOOLEAN)(IsNEC_98 && \
  85. ((BaseIoAddress)->RegistersBaseAddress == \
  86. (PUCHAR)IDE_NEC98_COMMAND_PORT_ADDRESS))
  87. //
  88. // Select IDE line(Primary or Secondary).
  89. // lineNumber:
  90. // 0 - Primary
  91. // 1 - Secondary
  92. //
  93. #define SelectIdeLine(BaseIoAddress,lineNumber) \
  94. { \
  95. if (Is98LegacyIde(BaseIoAddress)) { \
  96. WRITE_PORT_UCHAR (SELECT_IDE_PORT, (UCHAR)((lineNumber) & 0x1)); \
  97. } \
  98. }
  99. #define SelectIdeDevice(BaseIoAddress, deviceNumber, additional) {\
  100. SelectIdeLine(BaseIoAddress, (deviceNumber) >>1);\
  101. WRITE_PORT_UCHAR ((BaseIoAddress)->DriveSelect, (UCHAR)((((deviceNumber) & 0x1) << 4) | 0xA0 | additional));\
  102. }
  103. #define GetSelectedIdeDevice(BaseIoAddress, cmd) {\
  104. cmd=READ_PORT_UCHAR((BaseIoAddress)->DriveSelect);\
  105. }
  106. #define ReSelectIdeDevice(BaseIoAddress, cmd) {\
  107. WRITE_PORT_UCHAR ((BaseIoAddress)->DriveSelect, (UCHAR)cmd);\
  108. }
  109. //
  110. // ISSUE: 08/30/2000 How can I reserve this ioctl value?
  111. //
  112. //#define IOCTL_IDE_BIND_BUSMASTER_PARENT CTL_CODE(FILE_DEVICE_CONTROLLER, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
  113. //#define IOCTL_IDE_UNBIND_BUSMASTER_PARENT CTL_CODE(FILE_DEVICE_CONTROLLER, 0x0502, METHOD_BUFFERED, FILE_ANY_ACCESS)
  114. //#define IOCTL_IDE_GET_SYNC_ACCESS CTL_CODE(FILE_DEVICE_CONTROLLER, 0x0503, METHOD_BUFFERED, FILE_ANY_ACCESS)
  115. //#define IOCTL_IDE_TRANSFER_MODE_SELECT CTL_CODE(FILE_DEVICE_CONTROLLER, 0x0504, METHOD_BUFFERED, FILE_ANY_ACCESS)
  116. #define IOCTL_IDE_GET_RESOURCES_ALLOCATED CTL_CODE(FILE_DEVICE_CONTROLLER, 0x0505, METHOD_BUFFERED, FILE_ANY_ACCESS)
  117. #define MAX_IDE_DEVICE 2
  118. #define MAX_IDE_LINE 2
  119. #define MAX_IDE_CHANNEL 2
  120. #define MAX_IDE_BUS 1
  121. #define MAX_IDE_PATH MAX_IDE_BUS
  122. #define MAX_IDE_TARGETID MAX_IDE_DEVICE
  123. #define MAX_IDE_LUN 8
  124. #define IDE_STANDARD_PRIMARY_ADDRESS (0x1f0)
  125. #define IDE_STANDARD_SECONDARY_ADDRESS (0x170)
  126. #define IDE_NEC98_COMMAND_PORT_ADDRESS (0x640)
  127. typedef ULONG BMSTATUS;
  128. #define BMSTATUS_NO_ERROR (0)
  129. #define BMSTATUS_NOT_REACH_END_OF_TRANSFER (1 << 0)
  130. #define BMSTATUS_ERROR_TRANSFER (1 << 1)
  131. #define BMSTATUS_INTERRUPT (1 << 2)
  132. #define BMSTATUS_SUCCESS(x) ((x & ~BMSTATUS_INTERRUPT) == 0)
  133. //
  134. // IDE Cycle Timing
  135. //
  136. #define PIO_MODE0_CYCLE_TIME 600
  137. #define PIO_MODE1_CYCLE_TIME 383
  138. #define PIO_MODE2_CYCLE_TIME 240
  139. #define PIO_MODE3_CYCLE_TIME 180
  140. #define PIO_MODE4_CYCLE_TIME 120
  141. #define SWDMA_MODE0_CYCLE_TIME 960
  142. #define SWDMA_MODE1_CYCLE_TIME 480
  143. #define SWDMA_MODE2_CYCLE_TIME 240
  144. #define MWDMA_MODE0_CYCLE_TIME 480
  145. #define MWDMA_MODE1_CYCLE_TIME 150
  146. #define MWDMA_MODE2_CYCLE_TIME 120
  147. #define UDMA_MODE0_CYCLE_TIME 120
  148. #define UDMA_MODE1_CYCLE_TIME 80
  149. #define UDMA_MODE2_CYCLE_TIME 60
  150. #define UDMA_MODE3_CYCLE_TIME 45
  151. #define UDMA_MODE4_CYCLE_TIME 30
  152. #define UDMA_MODE5_CYCLE_TIME 20
  153. typedef union _IDE_PATH_ID {
  154. struct {
  155. ULONG Lun:8;
  156. ULONG TargetId:8;
  157. ULONG Path:8;
  158. ULONG Reserved:8;
  159. } b;
  160. ULONG l;
  161. } IDE_PATH_ID, *PIDE_PATH_ID;
  162. typedef struct _IDE_REGISTERS_1 {
  163. PUCHAR RegistersBaseAddress;
  164. PUSHORT Data;
  165. PUCHAR Error;
  166. PUCHAR BlockCount;
  167. PUCHAR BlockNumber;
  168. PUCHAR CylinderLow;
  169. PUCHAR CylinderHigh;
  170. PUCHAR DriveSelect;
  171. PUCHAR Command;
  172. } IDE_REGISTERS_1, *PIDE_REGISTERS_1;
  173. typedef struct _IDE_REGISTERS_2 {
  174. PUCHAR RegistersBaseAddress;
  175. PUCHAR DeviceControl;
  176. PUCHAR DriveAddress;
  177. } IDE_REGISTERS_2, *PIDE_REGISTERS_2;
  178. //
  179. // device extension header
  180. //
  181. #define EXTENSION_COMMON_HEADER PDEVICE_OBJECT AttacheeDeviceObject; \
  182. PDEVICE_OBJECT AttacheePdo; \
  183. PDRIVER_OBJECT DriverObject; \
  184. PDEVICE_OBJECT DeviceObject; \
  185. ULONG PagingPathCount; /* keep track of page path */ \
  186. ULONG HiberPathCount; /* keep track of hiber path */ \
  187. ULONG CrashDumpPathCount; /* keep track of crashdump path */ \
  188. SYSTEM_POWER_STATE SystemPowerState; \
  189. DEVICE_POWER_STATE DevicePowerState; \
  190. WMILIB_CONTEXT WmiLibInfo; \
  191. PIRP PendingSystemPowerIrp; /* DEBUG */ \
  192. PIRP PendingDevicePowerIrp; /* DEBUG */ \
  193. PDRIVER_DISPATCH DefaultDispatch; \
  194. PDRIVER_DISPATCH *PnPDispatchTable; \
  195. PDRIVER_DISPATCH *PowerDispatchTable; \
  196. PDRIVER_DISPATCH *WmiDispatchTable
  197. typedef struct _DEVICE_EXTENSION_HEADER {
  198. EXTENSION_COMMON_HEADER;
  199. } DEVICE_EXTENSION_HEADER, * PDEVICE_EXTENSION_HEADER;
  200. typedef struct _PCIIDE_BUSMASTER_INTERFACE {
  201. ULONG Size;
  202. ULONG SupportedTransferMode[MAX_IDE_DEVICE * MAX_IDE_LINE];
  203. ULONG MaxTransferByteSize;
  204. PVOID Context;
  205. NTSTATUS
  206. (* BmSetup) (
  207. IN PVOID Context,
  208. IN PVOID DataVirtualAddress,
  209. IN ULONG TransferByteCount,
  210. IN PMDL Mdl,
  211. IN BOOLEAN DataIn,
  212. IN VOID (*BmCallback) (PVOID Context),
  213. IN PVOID CallbackContext
  214. );
  215. NTSTATUS
  216. (* BmArm) (
  217. IN PVOID Context
  218. );
  219. BMSTATUS
  220. (* BmDisarm) (
  221. IN PVOID Context
  222. );
  223. BMSTATUS
  224. (* BmFlush) (
  225. IN PVOID Context
  226. );
  227. BMSTATUS
  228. (* BmStatus) (
  229. IN PVOID Context
  230. );
  231. NTSTATUS
  232. (* BmTimingSetup) (
  233. IN PVOID Context
  234. );
  235. BOOLEAN IgnoreActiveBitForAtaDevice;
  236. BOOLEAN AlwaysClearBusMasterInterrupt;
  237. ULONG ContextSize;
  238. NTSTATUS
  239. (* BmSetupOnePage) (
  240. IN PVOID Context,
  241. IN PVOID DataVirtualPageAddress,
  242. IN ULONG TransferByteCount,
  243. IN PMDL Mdl,
  244. IN BOOLEAN DataIn,
  245. IN PVOID RegionDescriptorTablePage
  246. );
  247. NTSTATUS
  248. (* BmCrashDumpInitialize) (
  249. IN PVOID Context
  250. );
  251. NTSTATUS
  252. (* BmFlushAdapterBuffers) (
  253. IN PVOID Context,
  254. IN PVOID DataVirtualPageAddress,
  255. IN ULONG TransferByteCount,
  256. IN PMDL Mdl,
  257. IN BOOLEAN DataIn
  258. );
  259. } PCIIDE_BUSMASTER_INTERFACE, * PPCIIDE_BUSMASTER_INTERFACE;
  260. typedef struct _PCIIDE_SYNC_ACCESS_INTERFACE {
  261. VOID
  262. (*AllocateAccessToken) (
  263. PVOID Token,
  264. PDRIVER_CONTROL Callback,
  265. PVOID CallbackContext
  266. );
  267. VOID
  268. (*FreeAccessToken) (
  269. PVOID Token
  270. );
  271. PVOID Token;
  272. } PCIIDE_SYNC_ACCESS_INTERFACE, *PPCIIDE_SYNC_ACCESS_INTERFACE;
  273. typedef enum PCIIDE_XFER_MODE_SUPPORT_LEVEL {
  274. PciIdeBasicXferModeSupport,
  275. PciIdeFullXferModeSupport
  276. } PCIIDE_XFER_MODE_SUPPORT_LEVEL;
  277. typedef struct _PCIIDE_INTERRUPT_INTERFACE {
  278. NTSTATUS
  279. (*PciIdeInterruptControl) (
  280. PVOID Context,
  281. ULONG Disable
  282. );
  283. PVOID Context;
  284. } PCIIDE_INTERRUPT_INTERFACE, *PPCIIDE_INTERRUPT_INTERFACE;
  285. typedef struct _PCIIDE_XFER_MODE_INTERFACE {
  286. PCIIDE_XFER_MODE_SUPPORT_LEVEL SupportLevel;
  287. PVOID VendorSpecificDeviceExtension;
  288. NTSTATUS
  289. (*TransferModeSelect) (
  290. PVOID Context,
  291. PPCIIDE_TRANSFER_MODE_SELECT XferMode
  292. );
  293. ULONG
  294. (*UseDma) (
  295. PVOID deviceExtension,
  296. PVOID Cdbcmd,
  297. UCHAR targetId
  298. );
  299. PVOID Context;
  300. PULONG TransferModeTimingTable;
  301. ULONG TransferModeTableLength;
  302. NTSTATUS
  303. (*UdmaModesSupported) (
  304. IDENTIFY_DATA IdentifyData,
  305. PULONG BestXferMode,
  306. PULONG CurrentMode
  307. );
  308. } PCIIDE_XFER_MODE_INTERFACE, *PPCIIDE_XFER_MODE_INTERFACE;
  309. #define PCIIDE_PROGIF_MASTER_IDE (1 << 7)
  310. typedef IDE_CHANNEL_STATE
  311. (*PCIIDE_CHANNEL_ENABLED) (
  312. IN PVOID DeviceExtension,
  313. IN ULONG Channel
  314. );
  315. typedef BOOLEAN
  316. (*PCIIDE_SYNC_ACCESS_REQUIRED) (
  317. IN PVOID DeviceExtension
  318. );
  319. typedef NTSTATUS
  320. (*PCIIDE_TRANSFER_MODE_SELECT_FUNC) (
  321. IN PVOID DeviceExtension,
  322. IN OUT PPCIIDE_TRANSFER_MODE_SELECT TransferModeSelect
  323. );
  324. typedef VOID
  325. (*PCIIDE_REQUEST_PROPER_RESOURCES) (
  326. IN PDEVICE_OBJECT PhysicalDeviceObject
  327. );
  328. typedef
  329. NTSTATUS (*PCONTROLLER_PROPERTIES) (
  330. IN PVOID DeviceExtension,
  331. IN PIDE_CONTROLLER_PROPERTIES ControllerProperties
  332. );
  333. NTSTATUS
  334. PciIdeXInitialize(
  335. IN PDRIVER_OBJECT DriverObject,
  336. IN PUNICODE_STRING RegistryPath,
  337. IN PCONTROLLER_PROPERTIES PciIdeGetControllerProperties,
  338. IN ULONG ExtensionSize
  339. );
  340. NTSTATUS
  341. PciIdeXGetBusData(
  342. IN PVOID DeviceExtension,
  343. IN PVOID Buffer,
  344. IN ULONG ConfigDataOffset,
  345. IN ULONG BufferLength
  346. );
  347. NTSTATUS
  348. PciIdeXSetBusData(
  349. IN PVOID DeviceExtension,
  350. IN PVOID Buffer,
  351. IN PVOID DataMask,
  352. IN ULONG ConfigDataOffset,
  353. IN ULONG BufferLength
  354. );
  355. NTSTATUS
  356. PciIdeXSaveDeviceParameter (
  357. IN PVOID DeviceExtension,
  358. IN PWSTR ParameterName,
  359. IN ULONG ParameterValue
  360. );
  361. #if DBG
  362. #define IdePortWaitOnBusyEx(a,b,c) IdePortpWaitOnBusyEx (a,b,c,__FILE__,__LINE__)
  363. #else
  364. #define IdePortWaitOnBusyEx(a,b,c) IdePortpWaitOnBusyEx (a,b,c)
  365. #endif
  366. #ifdef DPC_FOR_EMPTY_CHANNEL
  367. #define IdePortWaitOnBusyExK(CmdRegBase, status, BadStatus) {\
  368. int ki; \
  369. for (ki=0; ki<20; ki++) {\
  370. GetStatus(CmdRegBase, status);\
  371. if (status == BadStatus) {\
  372. break;\
  373. } else if (status & IDE_STATUS_BUSY) {\
  374. KeStallExecutionProcessor(5);\
  375. continue;\
  376. } else {\
  377. break;\
  378. }\
  379. }\
  380. }
  381. #endif
  382. NTSTATUS
  383. IdePortpWaitOnBusyEx (
  384. IN PIDE_REGISTERS_1 CmdRegBase,
  385. IN OUT PUCHAR Status,
  386. IN UCHAR BadStatus
  387. #if DBG
  388. ,
  389. IN PCSTR FileName,
  390. IN ULONG LineNumber
  391. #endif
  392. );
  393. VOID
  394. IdeCreateIdeDirectory(
  395. VOID
  396. );
  397. #define DEVICE_OJBECT_BASE_NAME L"\\Device\\Ide"
  398. #define MEMORY_SPACE 0
  399. #define IO_SPACE 1
  400. #define CLRMASK(x, mask) ((x) &= ~(mask));
  401. #define SETMASK(x, mask) ((x) |= (mask));
  402. #define IS_PDO(doExtension) (doExtension->AttacheeDeviceObject == NULL)
  403. #define IS_FDO(doExtension) (doExtension->AttacheeDeviceObject != NULL)
  404. /* 681190ea-e4ea-11d0-ab82-00a0c906962f */
  405. DEFINE_GUID(GUID_PCIIDE_BUSMASTER_INTERFACE, 0x681190ea, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  406. /* 681190eb-e4ea-11d0-ab82-00a0c906962f */
  407. DEFINE_GUID(GUID_PCIIDE_SYNC_ACCESS_INTERFACE, 0x681190eb, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  408. /* 681190ec-e4ea-11d0-ab82-00a0c906962f */
  409. DEFINE_GUID(GUID_PCIIDE_XFER_MODE_INTERFACE, 0x681190ec, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  410. /* 681190ed-e4ea-11d0-ab82-00a0c906962f */
  411. DEFINE_GUID(GUID_PCIIDE_REQUEST_PROPER_RESOURCES, 0x681190ed, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  412. /* 681190ee-e4ea-11d0-ab82-00a0c906962f */
  413. DEFINE_GUID(GUID_PCIIDE_INTERRUPT_INTERFACE, 0x681190ee, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  414. /* {14A001C6-F837-4157-BFC9-496F52C18998} */
  415. DEFINE_GUID(INTERFACENAME4, 0x14a001c6, 0xf837, 0x4157, 0xbf, 0xc9, 0x49, 0x6f, 0x52, 0xc1, 0x89, 0x98);
  416. #define max(a,b) (((a) > (b)) ? (a) : (b))
  417. #define min(a,b) (((a) < (b)) ? (a) : (b))
  418. #if !DBG
  419. #define DECLARE_EXTRA_DEBUG_PARAMETER(t, x)
  420. #else
  421. #define DECLARE_EXTRA_DEBUG_PARAMETER(t, x) ,t x
  422. #endif //DBG
  423. //
  424. // ATAPI Exports
  425. //
  426. BOOLEAN
  427. IdePortChannelEmpty (
  428. IN PIDE_REGISTERS_1 CmdRegBase,
  429. IN PIDE_REGISTERS_2 CtrlRegBase,
  430. IN ULONG MaxIdeDevice
  431. );
  432. #ifdef DPC_FOR_EMPTY_CHANNEL
  433. ULONG
  434. IdePortChannelEmptyQuick (
  435. IN PIDE_REGISTERS_1 CmdRegBase,
  436. IN PIDE_REGISTERS_2 CtrlRegBase,
  437. IN ULONG MaxIdeDevice,
  438. PULONG CurrentIdeDevice,
  439. PULONG MoreWait,
  440. PULONG NoRetry
  441. );
  442. #endif
  443. typedef struct _IDE_RESOURCE {
  444. ULONG CommandBaseAddressSpace;
  445. ULONG ControlBaseAddressSpace;
  446. PUCHAR TranslatedCommandBaseAddress;
  447. PUCHAR TranslatedControlBaseAddress;
  448. KINTERRUPT_MODE InterruptMode;
  449. ULONG InterruptLevel;
  450. //
  451. // Primary and Secondary at disk address (0x1f0 and 0x170) claimed.
  452. //
  453. BOOLEAN AtdiskPrimaryClaimed;
  454. BOOLEAN AtdiskSecondaryClaimed;
  455. } IDE_RESOURCE, *PIDE_RESOURCE;
  456. NTSTATUS
  457. DigestResourceList (
  458. IN OUT PIDE_RESOURCE IdeResource,
  459. IN PCM_RESOURCE_LIST ResourceList,
  460. OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR *IrqPartialDescriptors
  461. );
  462. VOID
  463. AtapiBuildIoAddress (
  464. IN PUCHAR CmdBaseAddress,
  465. IN PUCHAR CtrlBaseAddress,
  466. OUT PIDE_REGISTERS_1 BaseIoAddress1,
  467. OUT PIDE_REGISTERS_2 BaseIoAddress2,
  468. OUT PULONG BaseIoAddress1Length,
  469. OUT PULONG BaseIoAddress2Length,
  470. OUT PULONG MaxIdeDevice,
  471. OUT PULONG MaxIdeTargetId
  472. );
  473. NTSTATUS
  474. IdeGetDeviceCapabilities(
  475. IN PDEVICE_OBJECT DeviceObject,
  476. IN PDEVICE_CAPABILITIES DeviceCapabilities
  477. );
  478. #if DBG
  479. static PUCHAR IdeDebugPnpIrpName[NUM_PNP_MINOR_FUNCTION] = {
  480. "IRP_MN_START_DEVICE",
  481. "IRP_MN_QUERY_REMOVE_DEVICE",
  482. "IRP_MN_REMOVE_DEVICE",
  483. "IRP_MN_CANCEL_REMOVE_DEVICE",
  484. "IRP_MN_STOP_DEVICE",
  485. "IRP_MN_QUERY_STOP_DEVICE",
  486. "IRP_MN_CANCEL_STOP_DEVICE",
  487. "IRP_MN_QUERY_DEVICE_RELATIONS",
  488. "IRP_MN_QUERY_INTERFACE",
  489. "IRP_MN_QUERY_CAPABILITIES",
  490. "IRP_MN_QUERY_RESOURCES",
  491. "IRP_MN_QUERY_RESOURCE_REQUIREMENTS",
  492. "IRP_MN_QUERY_DEVICE_TEXT",
  493. "IRP_MN_FILTER_RESOURCE_REQUIREMENTS",
  494. "an undefined PnP IRP",
  495. "IRP_MN_READ_CONFIG",
  496. "IRP_MN_WRITE_CONFIG",
  497. "IRP_MN_EJECT",
  498. "IRP_MN_SET_LOCK",
  499. "IRP_MN_QUERY_ID",
  500. "IRP_MN_QUERY_PNP_DEVICE_STATE",
  501. "IRP_MN_QUERY_BUS_INFORMATION",
  502. "IRP_MN_DEVICE_USAGE_NOTIFICATION",
  503. "IRP_MN_SURPRISE_REMOVAL",
  504. "IRP_MN_QUERY_LEGACY_BUS_INFORMATION"
  505. };
  506. static PUCHAR IdeDebugPowerIrpName[NUM_POWER_MINOR_FUNCTION] = {
  507. "IRP_MN_WAIT_WAKE",
  508. "IRP_MN_POWER_SEQUENCE",
  509. "IRP_MN_SET_POWER",
  510. "IRP_MN_QUERY_POWER"
  511. };
  512. static PUCHAR IdeDebugWmiIrpName[NUM_WMI_MINOR_FUNCTION] = {
  513. "IRP_MN_QUERY_ALL_DATA",
  514. "IRP_MN_QUERY_SINGLE_INSTANCE",
  515. "IRP_MN_CHANGE_SINGLE_INSTANCE",
  516. "IRP_MN_CHANGE_SINGLE_ITEM",
  517. "IRP_MN_ENABLE_EVENTS",
  518. "IRP_MN_DISABLE_EVENTS",
  519. "IRP_MN_ENABLE_COLLECTION",
  520. "IRP_MN_DISABLE_COLLECTION",
  521. "IRP_MN_REGINFO",
  522. "IRP_MN_EXECUTE_METHOD"
  523. };
  524. #endif
  525. #endif // ___idep_h___