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.

164 lines
4.4 KiB

  1. #ifndef _HPSSTRUCT_H
  2. #define _HPSSTRUCT_H
  3. #define HPS_WMI_LEVEL (0x10|DPFLTR_MASK)
  4. extern UNICODE_STRING HpsRegistryPath;
  5. extern LIST_ENTRY HpsDeviceExtensions;
  6. typedef struct _HPS_EVENT_WORKITEM {
  7. PIO_WORKITEM WorkItem;
  8. PHPS_CONTROLLER_EVENT Event;
  9. } HPS_EVENT_WORKITEM, *PHPS_EVENT_WORKITEM;
  10. typedef struct _HPS_INTERFACE_WRAPPER {
  11. PVOID PciContext;
  12. PINTERFACE_REFERENCE PciInterfaceReference;
  13. PINTERFACE_DEREFERENCE PciInterfaceDereference;
  14. PGET_SET_DEVICE_DATA PciSetBusData;
  15. PGET_SET_DEVICE_DATA PciGetBusData;
  16. } HPS_INTERFACE_WRAPPER, *PHPS_INTERFACE_WRAPPER;
  17. //
  18. // Device Object defines and structures
  19. //
  20. typedef enum _HPS_DEVICE_TAG {
  21. HpsUpperDeviceTag = 'UspH',
  22. HpsLowerDeviceTag = 'LspH'
  23. } HPS_DEVICE_TAG;
  24. typedef struct _HPS_DEVICE_EXTENSION {
  25. //
  26. // These three variables are the same as HPS_COMMON_EXTENSION,
  27. // so rearranging them requires rearranging the
  28. // HPS_COMMON_EXTENSION declaration as well
  29. //
  30. HPS_DEVICE_TAG ExtensionTag;
  31. PDEVICE_OBJECT LowerDO;
  32. PDEVICE_OBJECT Self;
  33. //
  34. // List entry to link all hps device extensions together.
  35. //
  36. LIST_ENTRY ListEntry;
  37. PDEVICE_OBJECT PhysicalDO;
  38. PUNICODE_STRING SymbolicName;
  39. PVOID WmiEventContext;
  40. ULONG WmiEventContextSize;
  41. KDPC EventDpc;
  42. HPS_CONTROLLER_EVENT CurrentEvent;
  43. PSOFTPCI_DEVICE *SoftDevices;
  44. BOOLEAN EventsEnabled;
  45. UCHAR ConfigOffset;
  46. PKSERVICE_ROUTINE IntServiceRoutine;
  47. PVOID IntServiceContext;
  48. KSPIN_LOCK IntSpinLock;
  49. BOOLEAN UseConfig;
  50. HPS_INTERFACE_WRAPPER InterfaceWrapper;
  51. PUCHAR HBRBOffset;
  52. ULONG HBRBLength;
  53. ULONG HBRBRegisterSetOffset;
  54. PVOID HBRB;
  55. HPS_HWINIT_DESCRIPTOR HwInitData;
  56. SHPC_CONFIG_SPACE ConfigSpace;
  57. SHPC_REGISTER_SET RegisterSet;
  58. KSPIN_LOCK RegisterLock;
  59. LONG MemoryInterfaceCount;
  60. } HPS_DEVICE_EXTENSION, *PHPS_DEVICE_EXTENSION;
  61. typedef struct _HPS_COMMON_EXTENSION {
  62. HPS_DEVICE_TAG ExtensionTag;
  63. PDEVICE_OBJECT LowerDO;
  64. PDEVICE_OBJECT Self;
  65. } HPS_COMMON_EXTENSION, *PHPS_COMMON_EXTENSION;
  66. //
  67. // Interface structures and defines
  68. //
  69. typedef struct _HPS_PING_INTERFACE {
  70. USHORT Size;
  71. USHORT Version;
  72. PVOID Context;
  73. PINTERFACE_REFERENCE InterfaceReference;
  74. PINTERFACE_DEREFERENCE InterfaceDereference;
  75. PDEVICE_OBJECT SenderDevice;
  76. } HPS_PING_INTERFACE, *PHPS_PING_INTERFACE;
  77. DEFINE_GUID(GUID_HPS_PING_INTERFACE,0x0c76ca29, 0x4f2a, 0x4870,
  78. 0xa4, 0xdd, 0xc1, 0xa7, 0x56, 0x1a, 0xf7, 0xc7);
  79. #define HPS_EQUAL_GUID(x,y) \
  80. (RtlEqualMemory((PVOID)(x), (PVOID)(y), sizeof(GUID)))
  81. //
  82. // Register Writing Variables
  83. //
  84. extern UCHAR ConfigWriteMask[];
  85. extern ULONG RegisterReadOnlyMask[];
  86. extern ULONG RegisterWriteClearMask[];
  87. typedef
  88. VOID
  89. (*PHPS_WRITE_REGISTER)(
  90. PHPS_DEVICE_EXTENSION DeviceExtension,
  91. ULONG RegisterNum,
  92. PULONG Source,
  93. ULONG BitMask
  94. );
  95. extern PHPS_WRITE_REGISTER RegisterWriteCommands[];
  96. #define IS_SUBSET(_inner,_ilength,_outer,_olength) \
  97. ((_outer <= _inner) && ((_outer+_olength) >= (_inner+_ilength)))
  98. //
  99. // Returns a ULONG that is a bit mask of the bits in the ULONG written
  100. // where all bits from _offset for _length were written.
  101. //
  102. #define HPS_ULONG_WRITE_MASK(_offset,_length) \
  103. (((1 << (_length*8)) - 1) << (_offset * 8))
  104. #define FOR_ALL_IN_LIST(Type, Head, Current) \
  105. for((Current) = CONTAINING_RECORD((Head)->Flink, Type, ListEntry); \
  106. (Head) != &(Current)->ListEntry; \
  107. (Current) = CONTAINING_RECORD((Current)->ListEntry.Flink, \
  108. Type, \
  109. ListEntry) \
  110. )
  111. //
  112. // Pool Tags
  113. //
  114. typedef enum _HPS_POOL_TAG {
  115. HpsInterfacePool = 'IspH',
  116. HpsTempPool = 'TspH',
  117. HpsStringPool = 'SspH'
  118. } HPS_POOL_TAG;
  119. #endif