if (!io7_port->enabled)
return addr;
- if (hose->first_busno == bus) {
+ if (hose->bus == pbus) {
/* Don't support idsel > 20 on primary bus. */
if (devfn >= PCI_DEVFN(21, 0))
return addr;
/* Type 1 configuration cycle for *ALL* busses. */
*type1 = 1;
- if (bus == hose->first_busno)
+ if (hose->bus == pbus)
bus = 0;
addr = (bus << 16) | (devfn << 8) | (where);
addr <<= 5; /* swizzle for SPARSE */
"pci_addr=0x%p, type1=0x%p)\n",
bus, device_fn, where, pci_addr, type1));
- if (hose->first_busno == bus)
+ if (hose->bus == pbus)
bus = 0;
*type1 = (bus != 0);
"pci_addr=0x%p, type1=0x%p)\n",
bus, device_fn, where, pci_addr, type1));
- if (hose->first_busno == bus)
+ if (hose->bus == pbus)
bus = 0;
*type1 = (bus != 0);
{
struct pci_controller *hose = dev->sysdata;
- if (dev->bus->number != hose->first_busno) {
+ if (dev->bus != hose->bus) {
u8 pin = *pinp;
do {
pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
struct pci_controller *hose;
struct pci_bus *bus;
int next_busno;
+ int need_domain_info = 0;
/* Scan all of the recorded PCI controllers. */
for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
- hose->first_busno = next_busno;
- hose->last_busno = 0xff;
bus = pci_scan_bus(next_busno, alpha_mv.pci_ops, hose);
hose->bus = bus;
- next_busno = hose->last_busno = bus->subordinate;
- next_busno += 1;
+ hose->need_domain_info = need_domain_info;
+ next_busno = bus->subordinate + 1;
+ /* Don't allow 8-bit bus number overflow inside the hose -
+ reserve some space for bridges. */
+ if (next_busno > 224) {
+ next_busno = 0;
+ need_domain_info = 1;
+ }
}
if (pci_probe_only)
struct pci_controller *hose = dev->sysdata;
int slot, pin = *pinp;
- if (hose->first_busno == dev->bus->number) {
+ if (hose->bus == dev->bus) {
slot = PCI_SLOT(dev->devfn);
}
/* Check for the built-in bridge on hose 1. */
/* Scan our single hose. */
bus = pci_scan_bus(0, alpha_mv.pci_ops, hose);
hose->bus = bus;
- hose->last_busno = bus->subordinate;
irongate = pci_find_slot(0, 0);
bus->self = irongate;
unsigned long config_space_base;
unsigned int index;
- unsigned int first_busno;
- unsigned int last_busno;
+ /* For compatibility with current (as of July 2003) pciutils
+ and XFree86. Eventually will be removed. */
+ unsigned int need_domain_info;
struct pci_iommu_arena *sg_pci;
struct pci_iommu_arena *sg_isa;
#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
-/* Bus number == domain number until we get above 256 busses */
static inline int pci_name_bus(char *name, struct pci_bus *bus)
{
- int domain = pci_domain_nr(bus);
+ struct pci_controller *hose = bus->sysdata;
- if (domain < 256) {
- sprintf(name, "%02x", domain);
+ if (likely(hose->need_domain_info == 0)) {
+ sprintf(name, "%02x", bus->number);
} else {
- sprintf(name, "%04x:%02x", domain, bus->number);
+ sprintf(name, "%04x:%02x", hose->index, bus->number);
}
return 0;
}