diff options
Diffstat (limited to 'arch/x86/pci/common.c')
-rw-r--r-- | arch/x86/pci/common.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 52deabc72a6f..b7c67a187b6b 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
@@ -26,16 +26,37 @@ int pcibios_last_bus = -1; | |||
26 | unsigned long pirq_table_addr; | 26 | unsigned long pirq_table_addr; |
27 | struct pci_bus *pci_root_bus; | 27 | struct pci_bus *pci_root_bus; |
28 | struct pci_raw_ops *raw_pci_ops; | 28 | struct pci_raw_ops *raw_pci_ops; |
29 | struct pci_raw_ops *raw_pci_ext_ops; | ||
30 | |||
31 | int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, | ||
32 | int reg, int len, u32 *val) | ||
33 | { | ||
34 | if (reg < 256 && raw_pci_ops) | ||
35 | return raw_pci_ops->read(domain, bus, devfn, reg, len, val); | ||
36 | if (raw_pci_ext_ops) | ||
37 | return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, val); | ||
38 | return -EINVAL; | ||
39 | } | ||
40 | |||
41 | int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, | ||
42 | int reg, int len, u32 val) | ||
43 | { | ||
44 | if (reg < 256 && raw_pci_ops) | ||
45 | return raw_pci_ops->write(domain, bus, devfn, reg, len, val); | ||
46 | if (raw_pci_ext_ops) | ||
47 | return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, val); | ||
48 | return -EINVAL; | ||
49 | } | ||
29 | 50 | ||
30 | static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) | 51 | static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) |
31 | { | 52 | { |
32 | return raw_pci_ops->read(pci_domain_nr(bus), bus->number, | 53 | return raw_pci_read(pci_domain_nr(bus), bus->number, |
33 | devfn, where, size, value); | 54 | devfn, where, size, value); |
34 | } | 55 | } |
35 | 56 | ||
36 | static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) | 57 | static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) |
37 | { | 58 | { |
38 | return raw_pci_ops->write(pci_domain_nr(bus), bus->number, | 59 | return raw_pci_write(pci_domain_nr(bus), bus->number, |
39 | devfn, where, size, value); | 60 | devfn, where, size, value); |
40 | } | 61 | } |
41 | 62 | ||