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.

138 lines
3.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: acpiutil.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #if !defined (___acpiutil_h___)
  11. #define ___acpiutil_h___
  12. //
  13. // ACPI Control Method Stuff
  14. //
  15. #define ACPI_METHOD_GET_TASK_FILE ((ULONG) 'FTG_') // _GTF
  16. #define ACPI_METHOD_GET_TIMING ((ULONG) 'MTG_') // _GTM
  17. #define ACPI_METHOD_SET_TIMING ((ULONG) 'MTS_') // _STM
  18. #define ACPI_XFER_MODE_NOT_SUPPORT (0xffffffff)
  19. #pragma pack(1)
  20. typedef struct _ACPI_GTF_IDE_REGISTERS {
  21. UCHAR FeaturesReg;
  22. UCHAR SectorCountReg;
  23. UCHAR SectorNumberReg;
  24. UCHAR CylLowReg;
  25. UCHAR CylHighReg;
  26. UCHAR DriveHeadReg;
  27. UCHAR CommandReg;
  28. } ACPI_GTF_IDE_REGISTERS, *PACPI_GTF_IDE_REGISTERS;
  29. #pragma pack()
  30. typedef struct _ACPI_IDE_TIMING {
  31. struct _TIMING {
  32. ULONG Pio;
  33. ULONG Dma;
  34. } Speed[MAX_IDE_DEVICE];
  35. union {
  36. struct {
  37. ULONG UltraDma0:1;
  38. ULONG IoChannelReady0:1;
  39. ULONG UltraDma1:1;
  40. ULONG IoChannelReady1:1;
  41. ULONG IndependentTiming:1;
  42. ULONG Reserved:27;
  43. } b;
  44. ULONG AsULong;
  45. } Flags;
  46. } ACPI_IDE_TIMING, *PACPI_IDE_TIMING;
  47. NTSTATUS
  48. DeviceQueryFirmwareBootSettings (
  49. IN PPDO_EXTENSION PdoExtension,
  50. IN OUT PDEVICE_SETTINGS *IdeBiosSettings
  51. );
  52. NTSTATUS
  53. DeviceQueryACPISettings (
  54. IN PDEVICE_EXTENSION_HEADER DoExtension,
  55. IN ULONG ControlMethodName,
  56. OUT PACPI_EVAL_OUTPUT_BUFFER *QueryResult
  57. );
  58. NTSTATUS
  59. DeviceQueryACPISettingsCompletionRoutine (
  60. IN PDEVICE_OBJECT DeviceObject,
  61. IN PIRP Irp,
  62. IN PVOID Context
  63. );
  64. NTSTATUS
  65. DeviceQueryChannelTimingSettings (
  66. IN PFDO_EXTENSION FdoExtension,
  67. IN OUT PACPI_IDE_TIMING TimimgSettings
  68. );
  69. typedef struct _SYNC_SET_ACPI_TIMING_CONTEXT {
  70. KEVENT Event;
  71. NTSTATUS IrpStatus;
  72. } SYNC_SET_ACPI_TIMING_CONTEXT, *PSYNC_SET_ACPI_TIMING_CONTEXT;
  73. NTSTATUS
  74. ChannelSyncSetACPITimingSettings (
  75. IN PFDO_EXTENSION FdoExtension,
  76. IN PACPI_IDE_TIMING TimimgSettings,
  77. IN PIDENTIFY_DATA AtaIdentifyData[MAX_IDE_DEVICE]
  78. );
  79. NTSTATUS
  80. ChannelSyncSetACPITimingSettingsCompletionRoutine (
  81. IN PDEVICE_OBJECT DeviceObject,
  82. IN NTSTATUS Status,
  83. IN PVOID Context
  84. );
  85. typedef
  86. NTSTATUS
  87. (*PSET_ACPI_TIMING_COMPLETION_ROUTINE) (
  88. IN PDEVICE_OBJECT DeviceObject,
  89. IN NTSTATUS Status,
  90. IN PVOID Context
  91. );
  92. typedef struct _ASYNC_SET_ACPI_TIMING_CONTEXT {
  93. PFDO_EXTENSION FdoExtension;
  94. PSET_ACPI_TIMING_COMPLETION_ROUTINE CallerCompletionRoutine;
  95. PVOID CallerContext;
  96. } ASYNC_SET_ACPI_TIMING_CONTEXT, *PASYNC_SET_ACPI_TIMING_CONTEXT;
  97. NTSTATUS
  98. ChannelSetACPITimingSettings (
  99. IN PFDO_EXTENSION FdoExtension,
  100. IN PACPI_IDE_TIMING TimimgSettings,
  101. IN PIDENTIFY_DATA AtaIdentifyData[MAX_IDE_DEVICE],
  102. IN PSET_ACPI_TIMING_COMPLETION_ROUTINE CallerCompletionRoutine,
  103. IN PVOID CallerContext
  104. );
  105. NTSTATUS
  106. ChannelSetACPITimingSettingsCompletionRoutine (
  107. IN PDEVICE_OBJECT DeviceObject,
  108. IN PIRP Irp,
  109. IN PVOID Context
  110. );
  111. #endif // ___acpiutil_h___