aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/pci.c20
-rw-r--r--include/linux/pci.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 9d2aa6366fd0..c824dc8d617c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1422,6 +1422,26 @@ pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge)
1422} 1422}
1423 1423
1424/** 1424/**
1425 * pci_common_swizzle - swizzle INTx all the way to root bridge
1426 * @dev: the PCI device
1427 * @pinp: pointer to the INTx pin value (1=INTA, 2=INTB, 3=INTD, 4=INTD)
1428 *
1429 * Perform INTx swizzling for a device. This traverses through all PCI-to-PCI
1430 * bridges all the way up to a PCI root bus.
1431 */
1432u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp)
1433{
1434 u8 pin = *pinp;
1435
1436 while (dev->bus->self) {
1437 pin = pci_swizzle_interrupt_pin(dev, pin);
1438 dev = dev->bus->self;
1439 }
1440 *pinp = pin;
1441 return PCI_SLOT(dev->devfn);
1442}
1443
1444/**
1425 * pci_release_region - Release a PCI bar 1445 * pci_release_region - Release a PCI bar
1426 * @pdev: PCI device whose resources were previously reserved by pci_request_region 1446 * @pdev: PCI device whose resources were previously reserved by pci_request_region
1427 * @bar: BAR to release 1447 * @bar: BAR to release
diff --git a/include/linux/pci.h b/include/linux/pci.h
index da1c22bab40e..170f9ae2d8a0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -545,6 +545,7 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev,
545 struct resource *res); 545 struct resource *res);
546u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin); 546u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin);
547int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); 547int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
548u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp);
548extern struct pci_dev *pci_dev_get(struct pci_dev *dev); 549extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
549extern void pci_dev_put(struct pci_dev *dev); 550extern void pci_dev_put(struct pci_dev *dev);
550extern void pci_remove_bus(struct pci_bus *b); 551extern void pci_remove_bus(struct pci_bus *b);