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.

130 lines
2.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: bm.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #if !defined (___bm_h___)
  11. #define ___bm_h___
  12. //
  13. // Busmaster Status Register Bit Definition
  14. #define BUSMASTER_DMA_SIMPLEX_BIT ((UCHAR) (1 << 7))
  15. #define BUSMASTER_DEVICE1_DMA_OK ((UCHAR) (1 << 6))
  16. #define BUSMASTER_DEVICE0_DMA_OK ((UCHAR) (1 << 5))
  17. #define BUSMASTER_INTERRUPT ((UCHAR) (1 << 2))
  18. #define BUSMASTER_ERROR ((UCHAR) (1 << 1))
  19. #define BUSMASTER_ACTIVE ((UCHAR) (1 << 0))
  20. #define BUSMASTER_ZERO_BITS ((UCHAR) ((1 << 3) | (1 << 4)))
  21. #pragma pack (1)
  22. //
  23. // Bus Master Controller Register
  24. //
  25. typedef struct _IDE_BUS_MASTER_REGISTERS {
  26. UCHAR Command;
  27. UCHAR Reserved1;
  28. UCHAR Status;
  29. UCHAR Reserved2;
  30. ULONG DescriptionTable;
  31. } IDE_BUS_MASTER_REGISTERS, *PIDE_BUS_MASTER_REGISTERS;
  32. //
  33. // Bus Master Physical Region Descriptor
  34. //
  35. typedef struct _PHYSICAL_REGION_DESCRIPTOR {
  36. ULONG PhysicalAddress;
  37. ULONG ByteCount:16;
  38. ULONG Reserved:15;
  39. ULONG EndOfTable:1;
  40. } PHYSICAL_REGION_DESCRIPTOR, * PPHYSICAL_REGION_DESCRIPTOR;
  41. #pragma pack ()
  42. NTSTATUS
  43. BusMasterInitialize (
  44. PCHANPDO_EXTENSION pdoExtension
  45. );
  46. NTSTATUS
  47. BusMasterUninitialize (
  48. PCHANPDO_EXTENSION PdoExtension
  49. );
  50. NTSTATUS
  51. BmSetup (
  52. IN PVOID PdoExtension,
  53. IN PVOID DataVirtualAddress,
  54. IN ULONG TransferByteCount,
  55. IN PMDL Mdl,
  56. IN BOOLEAN DataIn,
  57. IN VOID (* BmCallback) (PVOID Context),
  58. IN PVOID Context
  59. );
  60. VOID
  61. BmReceiveScatterGatherList(
  62. IN PDEVICE_OBJECT DeviceObject,
  63. IN PIRP Irp,
  64. IN PSCATTER_GATHER_LIST ScatterGather,
  65. IN PVOID Context
  66. );
  67. VOID
  68. BmRebuildScatterGatherList(
  69. IN PCHANPDO_EXTENSION pdoExtension,
  70. IN PSCATTER_GATHER_LIST ScatterGather
  71. );
  72. VOID
  73. BmPrepareController (
  74. PCHANPDO_EXTENSION PdoExtension
  75. );
  76. NTSTATUS
  77. BmArm (
  78. IN PVOID PdoExtension
  79. );
  80. BMSTATUS
  81. BmDisarm (
  82. IN PVOID PdoExtension
  83. );
  84. BMSTATUS
  85. BmFlush (
  86. IN PVOID PdoExtension
  87. );
  88. BMSTATUS
  89. BmStatus (
  90. IN PVOID PdoExtension
  91. );
  92. NTSTATUS
  93. BmTimingSetup (
  94. IN PVOID PdoExtension
  95. );
  96. NTSTATUS
  97. BmFlushAdapterBuffers (
  98. IN PVOID PdoExtension,
  99. IN PVOID DataVirtualPageAddress,
  100. IN ULONG TransferByteCount,
  101. IN PMDL Mdl,
  102. IN BOOLEAN DataIn
  103. );
  104. NTSTATUS
  105. BmQueryInterface (
  106. IN PCHANPDO_EXTENSION PdoExtension,
  107. IN OUT PPCIIDE_BUSMASTER_INTERFACE BusMasterInterface
  108. );
  109. #endif // ___bm_h___