This source file includes following definitions.
- pci_assign_irq
1
2
3
4
5
6
7
8
9
10
11
12 #include <linux/kernel.h>
13 #include <linux/pci.h>
14 #include <linux/errno.h>
15 #include <linux/ioport.h>
16 #include <linux/cache.h>
17 #include "pci.h"
18
19 void pci_assign_irq(struct pci_dev *dev)
20 {
21 u8 pin;
22 u8 slot = -1;
23 int irq = 0;
24 struct pci_host_bridge *hbrg = pci_find_host_bridge(dev->bus);
25
26 if (!(hbrg->map_irq)) {
27 pci_dbg(dev, "runtime IRQ mapping not provided by arch\n");
28 return;
29 }
30
31
32
33
34
35
36
37 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
38
39 if (pin > 4)
40 pin = 1;
41
42 if (pin) {
43
44 if (hbrg->swizzle_irq)
45 slot = (*(hbrg->swizzle_irq))(dev, &pin);
46
47
48
49
50
51 irq = (*(hbrg->map_irq))(dev, slot, pin);
52 if (irq == -1)
53 irq = 0;
54 }
55 dev->irq = irq;
56
57 pci_dbg(dev, "assign IRQ: got %d\n", dev->irq);
58
59
60
61 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
62 }