Skip to content

Commit b352baf

Browse files
paulburtonbjorn-helgaas
authored andcommitted
PCI: Move enum pci_interrupt_pin to linux/pci.h
We currently have a definition of enum pci_interrupt_pin in a header specific to PCI endpoints - linux/pci-epf.h. In order to allow for use of this enum from PCI host code in a future commit, move its definition to linux/pci.h & include that from linux/pci-epf.h. Additionally we add a PCI_NUM_INTX macro which indicates the number of PCI INTx interrupts, and will be used alongside enum pci_interrupt_pin in further patches. Signed-off-by: Paul Burton <[email protected]> [bhelgaas: move enum pci_interrupt_pin outside #ifdef CONFIG_PCI] Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 16f73eb commit b352baf

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

include/linux/pci-epf.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,10 @@
1414

1515
#include <linux/device.h>
1616
#include <linux/mod_devicetable.h>
17+
#include <linux/pci.h>
1718

1819
struct pci_epf;
1920

20-
enum pci_interrupt_pin {
21-
PCI_INTERRUPT_UNKNOWN,
22-
PCI_INTERRUPT_INTA,
23-
PCI_INTERRUPT_INTB,
24-
PCI_INTERRUPT_INTC,
25-
PCI_INTERRUPT_INTD,
26-
};
27-
2821
enum pci_barno {
2922
BAR_0,
3023
BAR_1,

include/linux/pci.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,28 @@ enum {
102102
DEVICE_COUNT_RESOURCE = PCI_NUM_RESOURCES,
103103
};
104104

105+
/**
106+
* enum pci_interrupt_pin - PCI INTx interrupt values
107+
* @PCI_INTERRUPT_UNKNOWN: Unknown or unassigned interrupt
108+
* @PCI_INTERRUPT_INTA: PCI INTA pin
109+
* @PCI_INTERRUPT_INTB: PCI INTB pin
110+
* @PCI_INTERRUPT_INTC: PCI INTC pin
111+
* @PCI_INTERRUPT_INTD: PCI INTD pin
112+
*
113+
* Corresponds to values for legacy PCI INTx interrupts, as can be found in the
114+
* PCI_INTERRUPT_PIN register.
115+
*/
116+
enum pci_interrupt_pin {
117+
PCI_INTERRUPT_UNKNOWN,
118+
PCI_INTERRUPT_INTA,
119+
PCI_INTERRUPT_INTB,
120+
PCI_INTERRUPT_INTC,
121+
PCI_INTERRUPT_INTD,
122+
};
123+
124+
/* The number of legacy PCI INTx interrupts */
125+
#define PCI_NUM_INTX 4
126+
105127
/*
106128
* pci_power_t values must match the bits in the Capabilities PME_Support
107129
* and Control/Status PowerState fields in the Power Management capability.

0 commit comments

Comments
 (0)