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.

156 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. pciirqmp.h
  5. Abstract:
  6. This module contains support routines for the Pci Irq Routing.
  7. Author:
  8. Santosh Jodh (santoshj) 09-June-1998
  9. Environment:
  10. Kernel mode
  11. --*/
  12. #ifndef _PCIIRQMP_
  13. #define _PCIIRQMP_
  14. //
  15. // Standard Pci Irq miniport return values (source compatible with W9x).
  16. //
  17. typedef NTSTATUS PCIMPRET;
  18. #define PCIMP_SUCCESS STATUS_SUCCESS
  19. #define PCIMP_FAILURE STATUS_UNSUCCESSFUL
  20. #define PCIMP_INVALID_LINK STATUS_TOO_MANY_LINKS
  21. #define PCIMP_INVALID_IRQ STATUS_INVALID_PARAMETER
  22. #define PCIIRQMP_STATUS_NOT_INITIALIZED STATUS_UNSUCCESSFUL
  23. #define PCIIRQMP_STATUS_ALREADY_INITIALIZED STATUS_UNSUCCESSFUL
  24. #define PCIIRQMP_STATUS_NO_INSTANCE STATUS_UNSUCCESSFUL
  25. #define PCIIRQMP_STATUS_INVALID_INSTANCE STATUS_UNSUCCESSFUL
  26. #define PCIIRQMP_STATUS_INVALID_PARAMETER STATUS_UNSUCCESSFUL
  27. //
  28. // Define bits to describe source of routing table.
  29. //
  30. #define PCIMP_VALIDATE_SOURCE_BITS 1
  31. #define PCIMP_VALIDATE_SOURCE_PCIBIOS 1
  32. //
  33. // Chipset specific flags for individual workarounds.
  34. //
  35. // Bit 0: PCI devices cannot share interrupts.
  36. //
  37. #define PCIIR_FLAG_EXCLUSIVE 0x00000001
  38. //
  39. // Maximum number of interrupt pins possible on a single
  40. // Pci device (CS offset 3D).
  41. //
  42. #define NUM_IRQ_PINS 4
  43. //
  44. // Structure definitions for Pci Irq Routing.
  45. //
  46. #pragma pack(push, 1)
  47. //
  48. // Structure of information for one link.
  49. //
  50. typedef struct _PIN_INFO {
  51. UCHAR Link;
  52. USHORT InterruptMap;
  53. } PIN_INFO, *PPIN_INFO;
  54. //
  55. // Structure of information for one slot entry.
  56. //
  57. typedef struct _SLOT_INFO {
  58. UCHAR BusNumber;
  59. UCHAR DeviceNumber;
  60. PIN_INFO PinInfo[NUM_IRQ_PINS];
  61. UCHAR SlotNumber;
  62. UCHAR Reserved[1];
  63. } SLOT_INFO, *PSLOT_INFO;
  64. #pragma pack(pop)
  65. //
  66. // Structure of the $PIR table according to MS specification.
  67. //
  68. typedef struct _PCI_IRQ_ROUTING_TABLE {
  69. ULONG Signature;
  70. USHORT Version;
  71. USHORT TableSize;
  72. UCHAR RouterBus;
  73. UCHAR RouterDevFunc;
  74. USHORT ExclusiveIRQs;
  75. ULONG CompatibleRouter;
  76. ULONG MiniportData;
  77. UCHAR Reserved0[11];
  78. UCHAR Checksum;
  79. } PCI_IRQ_ROUTING_TABLE, *PPCI_IRQ_ROUTING_TABLE;
  80. //
  81. // Functions exported by Pci Irq Routing miniport library.
  82. //
  83. NTSTATUS
  84. PciirqmpInit (
  85. IN ULONG Instance,
  86. IN ULONG RouterBus,
  87. IN ULONG RouterDevFunc
  88. );
  89. NTSTATUS
  90. PciirqmpExit (
  91. VOID
  92. );
  93. NTSTATUS
  94. PciirqmpValidateTable (
  95. IN PPCI_IRQ_ROUTING_TABLE PciIrqRoutingTable,
  96. IN ULONG Flags
  97. );
  98. NTSTATUS
  99. PciirqmpGetIrq (
  100. OUT PUCHAR Irq,
  101. IN UCHAR Link
  102. );
  103. NTSTATUS
  104. PciirqmpSetIrq (
  105. IN UCHAR Irq,
  106. IN UCHAR Link
  107. );
  108. NTSTATUS
  109. PciirqmpGetTrigger (
  110. OUT PULONG Trigger
  111. );
  112. NTSTATUS
  113. PciirqmpSetTrigger (
  114. IN ULONG Trigger
  115. );
  116. #endif // _PCIIRQMP_