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.

97 lines
2.4 KiB

  1. #ifndef _SPCIH_
  2. #define _SPCIH_
  3. #define IS_BRIDGE(x) ((PCI_CONFIGURATION_TYPE(&x->Config.Current)) == PCI_BRIDGE_TYPE)
  4. #define IS_ROOTBUS(x) \
  5. ((x->Config.PlaceHolder == TRUE) && \
  6. (x->Config.Current.VendorID == 0xAAAA) && \
  7. (x->Config.Current.DeviceID == 0xBBBB))
  8. typedef struct _SOFTPCI_DEVICE *PSOFTPCI_DEVICE;
  9. typedef union _SOFTPCI_SLOT{
  10. struct{
  11. UCHAR Function;
  12. UCHAR Device;
  13. };
  14. USHORT AsUSHORT;
  15. } SOFTPCI_SLOT, *PSOFTPCI_SLOT;
  16. typedef enum _SOFTPCI_READWRITE_CONFIG{
  17. Unsupported = 0,
  18. SoftPciReadConfig,
  19. SoftPciWriteConfig
  20. } SOFTPCI_READWRITE_CONFIG;
  21. typedef struct _SOFTPCI_RW_CONTEXT{
  22. SOFTPCI_READWRITE_CONFIG WriteConfig;
  23. ULONG Bus;
  24. SOFTPCI_SLOT Slot;
  25. ULONG Offset;
  26. PVOID Data;
  27. } SOFTPCI_RW_CONTEXT, *PSOFTPCI_RW_CONTEXT;
  28. typedef enum
  29. {
  30. TYPE_UNKNOWN = -1,
  31. TYPE_DEVICE,
  32. TYPE_PCI_BRIDGE,
  33. TYPE_HOTPLUG_BRIDGE,
  34. TYPE_CARDBUS_DEVICE,
  35. TYPE_CARDBUS_BRIDGE,
  36. TYPE_UNSUPPORTED
  37. } SOFTPCI_DEV_TYPE;
  38. typedef struct _SOFTPCI_CONFIG{
  39. BOOLEAN PlaceHolder; // True if this device is a bridge place holder
  40. // to keep our view of PCI matching with
  41. // the actual hardware.
  42. PCI_COMMON_CONFIG Current; // Current configspace
  43. PCI_COMMON_CONFIG Mask; // Configspace Mask
  44. PCI_COMMON_CONFIG Default; // Default configspace
  45. } SOFTPCI_CONFIG, *PSOFTPCI_CONFIG;
  46. typedef struct _SOFTPCI_DEVICE{
  47. PSOFTPCI_DEVICE Parent;
  48. PSOFTPCI_DEVICE Sibling;
  49. PSOFTPCI_DEVICE Child;
  50. SOFTPCI_DEV_TYPE DevType;
  51. UCHAR Bus;
  52. SOFTPCI_SLOT Slot;
  53. SOFTPCI_CONFIG Config; // Config space buffers
  54. } SOFTPCI_DEVICE;
  55. typedef struct _SOFTPCI_SCRIPT_DEVICE{
  56. SINGLE_LIST_ENTRY ListEntry;
  57. BOOLEAN SlotSpecified;
  58. SOFTPCI_DEVICE SoftPciDevice;
  59. ULONG ParentPathLength;
  60. WCHAR ParentPath[1]; //variable length path
  61. } SOFTPCI_SCRIPT_DEVICE, *PSOFTPCI_SCRIPT_DEVICE;
  62. //
  63. // Cardbus has extra configuration information beyond the common
  64. // header. (stolen from the PCI driver)
  65. //
  66. typedef struct _PCI_TYPE2_HEADER_EXTRAS {
  67. USHORT SubVendorID;
  68. USHORT SubSystemID;
  69. ULONG LegacyModeBaseAddress;
  70. } PCI_TYPE2_HEADER_EXTRAS, *PPCI_TYPE2_HEADER_EXTRAS;
  71. #endif