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.

661 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. #define UDMA_MODE6_CYCLE_TIME 15
  154. typedef union _IDE_PATH_ID {
  155. struct {
  156. ULONG Lun:8;
  157. ULONG TargetId:8;
  158. ULONG Path:8;
  159. ULONG Reserved:8;
  160. } b;
  161. ULONG l;
  162. } IDE_PATH_ID, *PIDE_PATH_ID;
  163. typedef struct _IDE_REGISTERS_1 {
  164. PUCHAR RegistersBaseAddress;
  165. PUSHORT Data;
  166. PUCHAR Error;
  167. PUCHAR BlockCount;
  168. PUCHAR BlockNumber;
  169. PUCHAR CylinderLow;
  170. PUCHAR CylinderHigh;
  171. PUCHAR DriveSelect;
  172. PUCHAR Command;
  173. } IDE_REGISTERS_1, *PIDE_REGISTERS_1;
  174. typedef struct _IDE_REGISTERS_2 {
  175. PUCHAR RegistersBaseAddress;
  176. PUCHAR DeviceControl;
  177. PUCHAR DriveAddress;
  178. } IDE_REGISTERS_2, *PIDE_REGISTERS_2;
  179. //
  180. // device extension header
  181. //
  182. #define EXTENSION_COMMON_HEADER PDEVICE_OBJECT AttacheeDeviceObject; \
  183. PDEVICE_OBJECT AttacheePdo; \
  184. PDRIVER_OBJECT DriverObject; \
  185. PDEVICE_OBJECT DeviceObject; \
  186. ULONG PagingPathCount; /* keep track of page path */ \
  187. ULONG HiberPathCount; /* keep track of hiber path */ \
  188. ULONG CrashDumpPathCount; /* keep track of crashdump path */ \
  189. SYSTEM_POWER_STATE SystemPowerState; \
  190. DEVICE_POWER_STATE DevicePowerState; \
  191. WMILIB_CONTEXT WmiLibInfo; \
  192. PIRP PendingSystemPowerIrp; /* DEBUG */ \
  193. PIRP PendingDevicePowerIrp; /* DEBUG */ \
  194. PDRIVER_DISPATCH DefaultDispatch; \
  195. PDRIVER_DISPATCH *PnPDispatchTable; \
  196. PDRIVER_DISPATCH *PowerDispatchTable; \
  197. PDRIVER_DISPATCH *WmiDispatchTable
  198. typedef struct _DEVICE_EXTENSION_HEADER {
  199. EXTENSION_COMMON_HEADER;
  200. } DEVICE_EXTENSION_HEADER, * PDEVICE_EXTENSION_HEADER;
  201. typedef struct _PCIIDE_BUSMASTER_INTERFACE {
  202. ULONG Size;
  203. ULONG SupportedTransferMode[MAX_IDE_DEVICE * MAX_IDE_LINE];
  204. ULONG MaxTransferByteSize;
  205. PVOID Context;
  206. NTSTATUS
  207. (* BmSetup) (
  208. IN PVOID Context,
  209. IN PVOID DataVirtualAddress,
  210. IN ULONG TransferByteCount,
  211. IN PMDL Mdl,
  212. IN BOOLEAN DataIn,
  213. IN VOID (*BmCallback) (PVOID Context),
  214. IN PVOID CallbackContext
  215. );
  216. NTSTATUS
  217. (* BmArm) (
  218. IN PVOID Context
  219. );
  220. BMSTATUS
  221. (* BmDisarm) (
  222. IN PVOID Context
  223. );
  224. BMSTATUS
  225. (* BmFlush) (
  226. IN PVOID Context
  227. );
  228. BMSTATUS
  229. (* BmStatus) (
  230. IN PVOID Context
  231. );
  232. NTSTATUS
  233. (* BmTimingSetup) (
  234. IN PVOID Context
  235. );
  236. BOOLEAN IgnoreActiveBitForAtaDevice;
  237. BOOLEAN AlwaysClearBusMasterInterrupt;
  238. ULONG ContextSize;
  239. NTSTATUS
  240. (* BmSetupOnePage) (
  241. IN PVOID Context,
  242. IN PVOID DataVirtualPageAddress,
  243. IN ULONG TransferByteCount,
  244. IN PMDL Mdl,
  245. IN BOOLEAN DataIn,
  246. IN PVOID RegionDescriptorTablePage
  247. );
  248. NTSTATUS
  249. (* BmCrashDumpInitialize) (
  250. IN PVOID Context
  251. );
  252. NTSTATUS
  253. (* BmFlushAdapterBuffers) (
  254. IN PVOID Context,
  255. IN PVOID DataVirtualPageAddress,
  256. IN ULONG TransferByteCount,
  257. IN PMDL Mdl,
  258. IN BOOLEAN DataIn
  259. );
  260. } PCIIDE_BUSMASTER_INTERFACE, * PPCIIDE_BUSMASTER_INTERFACE;
  261. typedef struct _PCIIDE_SYNC_ACCESS_INTERFACE {
  262. VOID
  263. (*AllocateAccessToken) (
  264. PVOID Token,
  265. PDRIVER_CONTROL Callback,
  266. PVOID CallbackContext
  267. );
  268. VOID
  269. (*FreeAccessToken) (
  270. PVOID Token
  271. );
  272. PVOID Token;
  273. } PCIIDE_SYNC_ACCESS_INTERFACE, *PPCIIDE_SYNC_ACCESS_INTERFACE;
  274. typedef enum PCIIDE_XFER_MODE_SUPPORT_LEVEL {
  275. PciIdeBasicXferModeSupport,
  276. PciIdeFullXferModeSupport
  277. } PCIIDE_XFER_MODE_SUPPORT_LEVEL;
  278. typedef struct _PCIIDE_INTERRUPT_INTERFACE {
  279. NTSTATUS
  280. (*PciIdeInterruptControl) (
  281. PVOID Context,
  282. ULONG Disable
  283. );
  284. PVOID Context;
  285. } PCIIDE_INTERRUPT_INTERFACE, *PPCIIDE_INTERRUPT_INTERFACE;
  286. typedef struct _PCIIDE_XFER_MODE_INTERFACE {
  287. PCIIDE_XFER_MODE_SUPPORT_LEVEL SupportLevel;
  288. PVOID VendorSpecificDeviceExtension;
  289. NTSTATUS
  290. (*TransferModeSelect) (
  291. PVOID Context,
  292. PPCIIDE_TRANSFER_MODE_SELECT XferMode
  293. );
  294. ULONG
  295. (*UseDma) (
  296. PVOID deviceExtension,
  297. PVOID Cdbcmd,
  298. UCHAR targetId
  299. );
  300. PVOID Context;
  301. PULONG TransferModeTimingTable;
  302. ULONG TransferModeTableLength;
  303. NTSTATUS
  304. (*UdmaModesSupported) (
  305. IDENTIFY_DATA IdentifyData,
  306. PULONG BestXferMode,
  307. PULONG CurrentMode
  308. );
  309. } PCIIDE_XFER_MODE_INTERFACE, *PPCIIDE_XFER_MODE_INTERFACE;
  310. #define PCIIDE_PROGIF_MASTER_IDE (1 << 7)
  311. typedef IDE_CHANNEL_STATE
  312. (*PCIIDE_CHANNEL_ENABLED) (
  313. IN PVOID DeviceExtension,
  314. IN ULONG Channel
  315. );
  316. typedef BOOLEAN
  317. (*PCIIDE_SYNC_ACCESS_REQUIRED) (
  318. IN PVOID DeviceExtension
  319. );
  320. typedef NTSTATUS
  321. (*PCIIDE_TRANSFER_MODE_SELECT_FUNC) (
  322. IN PVOID DeviceExtension,
  323. IN OUT PPCIIDE_TRANSFER_MODE_SELECT TransferModeSelect
  324. );
  325. typedef VOID
  326. (*PCIIDE_REQUEST_PROPER_RESOURCES) (
  327. IN PDEVICE_OBJECT PhysicalDeviceObject
  328. );
  329. typedef
  330. NTSTATUS (*PCONTROLLER_PROPERTIES) (
  331. IN PVOID DeviceExtension,
  332. IN PIDE_CONTROLLER_PROPERTIES ControllerProperties
  333. );
  334. NTSTATUS
  335. PciIdeXInitialize(
  336. IN PDRIVER_OBJECT DriverObject,
  337. IN PUNICODE_STRING RegistryPath,
  338. IN PCONTROLLER_PROPERTIES PciIdeGetControllerProperties,
  339. IN ULONG ExtensionSize
  340. );
  341. NTSTATUS
  342. PciIdeXGetBusData(
  343. IN PVOID DeviceExtension,
  344. IN PVOID Buffer,
  345. IN ULONG ConfigDataOffset,
  346. IN ULONG BufferLength
  347. );
  348. NTSTATUS
  349. PciIdeXSetBusData(
  350. IN PVOID DeviceExtension,
  351. IN PVOID Buffer,
  352. IN PVOID DataMask,
  353. IN ULONG ConfigDataOffset,
  354. IN ULONG BufferLength
  355. );
  356. NTSTATUS
  357. PciIdeXSaveDeviceParameter (
  358. IN PVOID DeviceExtension,
  359. IN PWSTR ParameterName,
  360. IN ULONG ParameterValue
  361. );
  362. #if DBG
  363. #define IdePortWaitOnBusyEx(a,b,c) IdePortpWaitOnBusyEx (a,b,c,__FILE__,__LINE__)
  364. #else
  365. #define IdePortWaitOnBusyEx(a,b,c) IdePortpWaitOnBusyEx (a,b,c)
  366. #endif
  367. #ifdef DPC_FOR_EMPTY_CHANNEL
  368. #define IdePortWaitOnBusyExK(CmdRegBase, status, BadStatus) {\
  369. int ki; \
  370. for (ki=0; ki<20; ki++) {\
  371. GetStatus(CmdRegBase, status);\
  372. if (status == BadStatus) {\
  373. break;\
  374. } else if (status & IDE_STATUS_BUSY) {\
  375. KeStallExecutionProcessor(5);\
  376. continue;\
  377. } else {\
  378. break;\
  379. }\
  380. }\
  381. }
  382. #endif
  383. NTSTATUS
  384. IdePortpWaitOnBusyEx (
  385. IN PIDE_REGISTERS_1 CmdRegBase,
  386. IN OUT PUCHAR Status,
  387. IN UCHAR BadStatus
  388. #if DBG
  389. ,
  390. IN PCSTR FileName,
  391. IN ULONG LineNumber
  392. #endif
  393. );
  394. VOID
  395. IdeCreateIdeDirectory(
  396. VOID
  397. );
  398. #define DEVICE_OJBECT_BASE_NAME L"\\Device\\Ide"
  399. #define MEMORY_SPACE 0
  400. #define IO_SPACE 1
  401. #define CLRMASK(x, mask) ((x) &= ~(mask));
  402. #define SETMASK(x, mask) ((x) |= (mask));
  403. #define IS_PDO(doExtension) (doExtension->AttacheeDeviceObject == NULL)
  404. #define IS_FDO(doExtension) (doExtension->AttacheeDeviceObject != NULL)
  405. /* 681190ea-e4ea-11d0-ab82-00a0c906962f */
  406. DEFINE_GUID(GUID_PCIIDE_BUSMASTER_INTERFACE, 0x681190ea, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  407. /* 681190eb-e4ea-11d0-ab82-00a0c906962f */
  408. DEFINE_GUID(GUID_PCIIDE_SYNC_ACCESS_INTERFACE, 0x681190eb, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  409. /* 681190ec-e4ea-11d0-ab82-00a0c906962f */
  410. DEFINE_GUID(GUID_PCIIDE_XFER_MODE_INTERFACE, 0x681190ec, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  411. /* 681190ed-e4ea-11d0-ab82-00a0c906962f */
  412. DEFINE_GUID(GUID_PCIIDE_REQUEST_PROPER_RESOURCES, 0x681190ed, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  413. /* 681190ee-e4ea-11d0-ab82-00a0c906962f */
  414. DEFINE_GUID(GUID_PCIIDE_INTERRUPT_INTERFACE, 0x681190ee, 0xe4ea, 0x11d0, 0xab, 0x82, 0x00, 0xa0, 0xc9, 0x06, 0x96, 0x2f);
  415. /* {14A001C6-F837-4157-BFC9-496F52C18998} */
  416. DEFINE_GUID(INTERFACENAME4, 0x14a001c6, 0xf837, 0x4157, 0xbf, 0xc9, 0x49, 0x6f, 0x52, 0xc1, 0x89, 0x98);
  417. #define max(a,b) (((a) > (b)) ? (a) : (b))
  418. #define min(a,b) (((a) < (b)) ? (a) : (b))
  419. #if !DBG
  420. #define DECLARE_EXTRA_DEBUG_PARAMETER(t, x)
  421. #else
  422. #define DECLARE_EXTRA_DEBUG_PARAMETER(t, x) ,t x
  423. #endif //DBG
  424. //
  425. // ATAPI Exports
  426. //
  427. BOOLEAN
  428. IdePortChannelEmpty (
  429. IN PIDE_REGISTERS_1 CmdRegBase,
  430. IN PIDE_REGISTERS_2 CtrlRegBase,
  431. IN ULONG MaxIdeDevice
  432. );
  433. #ifdef DPC_FOR_EMPTY_CHANNEL
  434. ULONG
  435. IdePortChannelEmptyQuick (
  436. IN PIDE_REGISTERS_1 CmdRegBase,
  437. IN PIDE_REGISTERS_2 CtrlRegBase,
  438. IN ULONG MaxIdeDevice,
  439. PULONG CurrentIdeDevice,
  440. PULONG MoreWait,
  441. PULONG NoRetry
  442. );
  443. #endif
  444. typedef struct _IDE_RESOURCE {
  445. ULONG CommandBaseAddressSpace;
  446. ULONG ControlBaseAddressSpace;
  447. PUCHAR TranslatedCommandBaseAddress;
  448. PUCHAR TranslatedControlBaseAddress;
  449. KINTERRUPT_MODE InterruptMode;
  450. ULONG InterruptLevel;
  451. //
  452. // Primary and Secondary at disk address (0x1f0 and 0x170) claimed.
  453. //
  454. BOOLEAN AtdiskPrimaryClaimed;
  455. BOOLEAN AtdiskSecondaryClaimed;
  456. } IDE_RESOURCE, *PIDE_RESOURCE;
  457. NTSTATUS
  458. DigestResourceList (
  459. IN OUT PIDE_RESOURCE IdeResource,
  460. IN PCM_RESOURCE_LIST ResourceList,
  461. OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR *IrqPartialDescriptors
  462. );
  463. VOID
  464. AtapiBuildIoAddress (
  465. IN PUCHAR CmdBaseAddress,
  466. IN PUCHAR CtrlBaseAddress,
  467. OUT PIDE_REGISTERS_1 BaseIoAddress1,
  468. OUT PIDE_REGISTERS_2 BaseIoAddress2,
  469. OUT PULONG BaseIoAddress1Length,
  470. OUT PULONG BaseIoAddress2Length,
  471. OUT PULONG MaxIdeDevice,
  472. OUT PULONG MaxIdeTargetId
  473. );
  474. NTSTATUS
  475. IdeGetDeviceCapabilities(
  476. IN PDEVICE_OBJECT DeviceObject,
  477. IN PDEVICE_CAPABILITIES DeviceCapabilities
  478. );
  479. #if DBG
  480. static PUCHAR IdeDebugPnpIrpName[NUM_PNP_MINOR_FUNCTION] = {
  481. "IRP_MN_START_DEVICE",
  482. "IRP_MN_QUERY_REMOVE_DEVICE",
  483. "IRP_MN_REMOVE_DEVICE",
  484. "IRP_MN_CANCEL_REMOVE_DEVICE",
  485. "IRP_MN_STOP_DEVICE",
  486. "IRP_MN_QUERY_STOP_DEVICE",
  487. "IRP_MN_CANCEL_STOP_DEVICE",
  488. "IRP_MN_QUERY_DEVICE_RELATIONS",
  489. "IRP_MN_QUERY_INTERFACE",
  490. "IRP_MN_QUERY_CAPABILITIES",
  491. "IRP_MN_QUERY_RESOURCES",
  492. "IRP_MN_QUERY_RESOURCE_REQUIREMENTS",
  493. "IRP_MN_QUERY_DEVICE_TEXT",
  494. "IRP_MN_FILTER_RESOURCE_REQUIREMENTS",
  495. "an undefined PnP IRP",
  496. "IRP_MN_READ_CONFIG",
  497. "IRP_MN_WRITE_CONFIG",
  498. "IRP_MN_EJECT",
  499. "IRP_MN_SET_LOCK",
  500. "IRP_MN_QUERY_ID",
  501. "IRP_MN_QUERY_PNP_DEVICE_STATE",
  502. "IRP_MN_QUERY_BUS_INFORMATION",
  503. "IRP_MN_DEVICE_USAGE_NOTIFICATION",
  504. "IRP_MN_SURPRISE_REMOVAL",
  505. "IRP_MN_QUERY_LEGACY_BUS_INFORMATION"
  506. };
  507. static PUCHAR IdeDebugPowerIrpName[NUM_POWER_MINOR_FUNCTION] = {
  508. "IRP_MN_WAIT_WAKE",
  509. "IRP_MN_POWER_SEQUENCE",
  510. "IRP_MN_SET_POWER",
  511. "IRP_MN_QUERY_POWER"
  512. };
  513. static PUCHAR IdeDebugWmiIrpName[NUM_WMI_MINOR_FUNCTION] = {
  514. "IRP_MN_QUERY_ALL_DATA",
  515. "IRP_MN_QUERY_SINGLE_INSTANCE",
  516. "IRP_MN_CHANGE_SINGLE_INSTANCE",
  517. "IRP_MN_CHANGE_SINGLE_ITEM",
  518. "IRP_MN_ENABLE_EVENTS",
  519. "IRP_MN_DISABLE_EVENTS",
  520. "IRP_MN_ENABLE_COLLECTION",
  521. "IRP_MN_DISABLE_COLLECTION",
  522. "IRP_MN_REGINFO",
  523. "IRP_MN_EXECUTE_METHOD"
  524. };
  525. #endif
  526. #endif // ___idep_h___