@@ -327,6 +327,11 @@ void pci_scan_bars(struct pci_dev *dev)
}
}
+uint8_t pci_intx_line(struct pci_dev *dev)
+{
+ return pci_config_readb(dev->bdf, PCI_INTERRUPT_LINE);
+}
+
void pci_enable_defaults(struct pci_dev *dev)
{
pci_scan_bars(dev);
@@ -64,6 +64,7 @@ extern bool pci_bar_is_memory(struct pci_dev *dev, int bar_num);
extern bool pci_bar_is_valid(struct pci_dev *dev, int bar_num);
extern void pci_bar_print(struct pci_dev *dev, int bar_num);
extern void pci_dev_print_id(pcidevaddr_t dev);
+extern uint8_t pci_intx_line(struct pci_dev *dev);
extern int pci_testdev(void);
To fetch INTx irq line number. Signed-off-by: Peter Xu <peterx@redhat.com> --- lib/pci.c | 5 +++++ lib/pci.h | 1 + 2 files changed, 6 insertions(+)