aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/pci_32.c')
-rw-r--r--arch/powerpc/kernel/pci_32.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 1e807fe7ad2c..8cf15d961c38 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -469,75 +469,4 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
469 return result; 469 return result;
470} 470}
471 471
472/*
473 * Null PCI config access functions, for the case when we can't
474 * find a hose.
475 */
476#define NULL_PCI_OP(rw, size, type) \
477static int \
478null_##rw##_config_##size(struct pci_dev *dev, int offset, type val) \
479{ \
480 return PCIBIOS_DEVICE_NOT_FOUND; \
481}
482
483static int
484null_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
485 int len, u32 *val)
486{
487 return PCIBIOS_DEVICE_NOT_FOUND;
488}
489
490static int
491null_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
492 int len, u32 val)
493{
494 return PCIBIOS_DEVICE_NOT_FOUND;
495}
496
497static struct pci_ops null_pci_ops =
498{
499 .read = null_read_config,
500 .write = null_write_config,
501};
502 472
503/*
504 * These functions are used early on before PCI scanning is done
505 * and all of the pci_dev and pci_bus structures have been created.
506 */
507static struct pci_bus *
508fake_pci_bus(struct pci_controller *hose, int busnr)
509{
510 static struct pci_bus bus;
511
512 if (hose == 0) {
513 hose = pci_bus_to_hose(busnr);
514 if (hose == 0)
515 printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
516 }
517 bus.number = busnr;
518 bus.sysdata = hose;
519 bus.ops = hose? hose->ops: &null_pci_ops;
520 return &bus;
521}
522
523#define EARLY_PCI_OP(rw, size, type) \
524int early_##rw##_config_##size(struct pci_controller *hose, int bus, \
525 int devfn, int offset, type value) \
526{ \
527 return pci_bus_##rw##_config_##size(fake_pci_bus(hose, bus), \
528 devfn, offset, value); \
529}
530
531EARLY_PCI_OP(read, byte, u8 *)
532EARLY_PCI_OP(read, word, u16 *)
533EARLY_PCI_OP(read, dword, u32 *)
534EARLY_PCI_OP(write, byte, u8)
535EARLY_PCI_OP(write, word, u16)
536EARLY_PCI_OP(write, dword, u32)
537
538extern int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
539int early_find_capability(struct pci_controller *hose, int bus, int devfn,
540 int cap)
541{
542 return pci_bus_find_capability(fake_pci_bus(hose, bus), devfn, cap);
543}