From 36780249955396f8c9a76192f360ac3a8e9d1e01 Mon Sep 17 00:00:00 2001 From: Ivan Kokshaysky Date: Sat, 7 Sep 2002 18:23:34 -0700 Subject: [PATCH] pci bus resources, transparent bridges Added PCI_BUS_NUM_RESOURCES as Ben suggested. Default value is 4 and can be overridden by arch (probably in asm/system.h). pci_read_bridge_bases() and pci_assign_bus_resource() changed accordingly. "for (i = 0 ; i < 4; i++)" in pci_add_new_bus() not changed, as it's used _only_ for pci-pci and cardbus bridges. --- include/linux/pci.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/pci.h b/include/linux/pci.h index 3c76341f02bf..b82ec8e41174 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -386,6 +386,9 @@ struct pci_dev { int ro; /* ISAPnP: read only */ unsigned short regs; /* ISAPnP: supported registers */ + /* These fields are used by common fixups */ + unsigned short transparent:1; /* Transparent PCI bridge */ + int (*prepare)(struct pci_dev *dev); /* ISAPnP hooks */ int (*activate)(struct pci_dev *dev); int (*deactivate)(struct pci_dev *dev); @@ -406,6 +409,10 @@ struct pci_dev { #define PCI_ROM_RESOURCE 6 #define PCI_BRIDGE_RESOURCES 7 #define PCI_NUM_RESOURCES 11 + +#ifndef PCI_BUS_NUM_RESOURCES +#define PCI_BUS_NUM_RESOURCES 4 +#endif #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ @@ -415,7 +422,8 @@ struct pci_bus { struct list_head children; /* list of child buses */ struct list_head devices; /* list of devices on this bus */ struct pci_dev *self; /* bridge device as seen by parent */ - struct resource *resource[4]; /* address space routed to this bus */ + struct resource *resource[PCI_BUS_NUM_RESOURCES]; + /* address space routed to this bus */ struct pci_ops *ops; /* configuration access functions */ void *sysdata; /* hook for sys-specific extension */ -- cgit v1.2.3