2 * drivers/pci/setup-irq.c
4 * Extruded from code written by
5 * Dave Rusling (david.rusling@reo.mts.dec.com)
6 * David Mosberger (davidm@cs.arizona.edu)
7 * David Miller (davem@redhat.com)
9 * Support routines for initializing a PCI subsystem.
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/pci.h>
16 #include <linux/errno.h>
17 #include <linux/ioport.h>
18 #include <linux/cache.h>
22 pdev_fixup_irq(struct pci_dev
*dev
,
23 u8 (*swizzle
)(struct pci_dev
*, u8
*),
24 int (*map_irq
)(struct pci_dev
*, u8
, u8
))
29 /* If this device is not on the primary bus, we need to figure out
30 which interrupt pin it will come in on. We know which slot it
31 will come in on 'cos that slot is where the bridge is. Each
32 time the interrupt line passes through a PCI-PCI bridge we must
33 apply the swizzle function. */
35 pci_read_config_byte(dev
, PCI_INTERRUPT_PIN
, &pin
);
36 /* Cope with illegal. */
41 /* Follow the chain of bridges, swizzling as we go. */
42 slot
= (*swizzle
)(dev
, &pin
);
44 irq
= (*map_irq
)(dev
, slot
, pin
);
50 pr_debug("PCI: fixup irq: (%s) got %d\n",
51 dev
->dev
.kobj
.name
, dev
->irq
);
53 /* Always tell the device, so the driver knows what is
54 the real IRQ to use; the device does not use it. */
55 pcibios_update_irq(dev
, irq
);
59 pci_fixup_irqs(u8 (*swizzle
)(struct pci_dev
*, u8
*),
60 int (*map_irq
)(struct pci_dev
*, u8
, u8
))
62 struct pci_dev
*dev
= NULL
;
63 while ((dev
= pci_get_device(PCI_ANY_ID
, PCI_ANY_ID
, dev
)) != NULL
) {
64 pdev_fixup_irq(dev
, swizzle
, map_irq
);
This page took 0.032822 seconds and 6 git commands to generate.