pci_mmcfg_config_num++;
pci_mmcfg_config[i].address = addr;
- pci_mmcfg_config[i].pci_segment = segment;
- pci_mmcfg_config[i].start_bus_number = start;
- pci_mmcfg_config[i].end_bus_number = end;
+ pci_mmcfg_config[i].segment = segment;
+ pci_mmcfg_config[i].start_bus = start;
+ pci_mmcfg_config[i].end_bus = end;
return &pci_mmcfg_config[i];
}
const typeof(pci_mmcfg_config[0]) *m2 = x2;
int start1, start2;
- start1 = m1->start_bus_number;
- start2 = m2->start_bus_number;
+ start1 = m1->start_bus;
+ start2 = m2->start_bus;
return start1 - start2;
}
if (pci_mmcfg_config_num > 0) {
i = pci_mmcfg_config_num - 1;
cfg = &pci_mmcfg_config[i];
- if (cfg->end_bus_number < cfg->start_bus_number)
- cfg->end_bus_number = 255;
+ if (cfg->end_bus < cfg->start_bus)
+ cfg->end_bus = 255;
}
/* don't overlap please */
cfg = &pci_mmcfg_config[i];
cfgx = &pci_mmcfg_config[i+1];
- if (cfg->end_bus_number < cfg->start_bus_number)
- cfg->end_bus_number = 255;
+ if (cfg->end_bus < cfg->start_bus)
+ cfg->end_bus = 255;
- if (cfg->end_bus_number >= cfgx->start_bus_number)
- cfg->end_bus_number = cfgx->start_bus_number - 1;
+ if (cfg->end_bus >= cfgx->start_bus)
+ cfg->end_bus = cfgx->start_bus - 1;
}
}
names = (void *)&res[pci_mmcfg_config_num];
for (i = 0; i < pci_mmcfg_config_num; i++, res++) {
struct pci_mmcfg_region *cfg = &pci_mmcfg_config[i];
- num_buses = cfg->end_bus_number - cfg->start_bus_number + 1;
+ num_buses = cfg->end_bus - cfg->start_bus + 1;
res->name = names;
snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN,
- "PCI MMCONFIG %u [%02x-%02x]", cfg->pci_segment,
- cfg->start_bus_number, cfg->end_bus_number);
+ "PCI MMCONFIG %u [%02x-%02x]", cfg->segment,
+ cfg->start_bus, cfg->end_bus);
res->start = cfg->address +
- PCI_MMCFG_BUS_OFFSET(cfg->start_bus_number);
+ PCI_MMCFG_BUS_OFFSET(cfg->start_bus);
res->end = res->start + PCI_MMCFG_BUS_OFFSET(num_buses) - 1;
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
insert_resource(&iomem_resource, res);
valid = 1;
if (old_size != size) {
- /* update end_bus_number */
- cfg->end_bus_number = cfg->start_bus_number + ((size>>20) - 1);
+ /* update end_bus */
+ cfg->end_bus = cfg->start_bus + ((size>>20) - 1);
printk(KERN_NOTICE "PCI: updated MCFG configuration %d: base %lx "
"segment %hu buses %u - %u\n",
- i, (unsigned long)cfg->address, cfg->pci_segment,
- (unsigned int)cfg->start_bus_number,
- (unsigned int)cfg->end_bus_number);
+ i, (unsigned long)cfg->address, cfg->segment,
+ (unsigned int)cfg->start_bus,
+ (unsigned int)cfg->end_bus);
}
}
cfg = &pci_mmcfg_config[i];
addr = cfg->address +
- PCI_MMCFG_BUS_OFFSET(cfg->start_bus_number);
- num_buses = cfg->end_bus_number - cfg->start_bus_number + 1;
+ PCI_MMCFG_BUS_OFFSET(cfg->start_bus);
+ num_buses = cfg->end_bus - cfg->start_bus + 1;
size = PCI_MMCFG_BUS_OFFSET(num_buses);
printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx "
"segment %hu buses %u - %u\n",
- i, (unsigned long)cfg->address, cfg->pci_segment,
- (unsigned int)cfg->start_bus_number,
- (unsigned int)cfg->end_bus_number);
+ i, (unsigned long)cfg->address, cfg->segment,
+ (unsigned int)cfg->start_bus,
+ (unsigned int)cfg->end_bus);
if (!early && !acpi_disabled)
valid = is_mmconf_reserved(is_acpi_reserved, addr, size, i, cfg, 0);
for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
cfg = pci_mmcfg_virt[cfg_num].cfg;
- if (cfg->pci_segment == seg &&
- (cfg->start_bus_number <= bus) &&
- (cfg->end_bus_number >= bus))
+ if (cfg->segment == seg &&
+ (cfg->start_bus <= bus) &&
+ (cfg->end_bus >= bus))
return pci_mmcfg_virt[cfg_num].virt;
}
u64 start, size;
int num_buses;
- start = cfg->address + PCI_MMCFG_BUS_OFFSET(cfg->start_bus_number);
- num_buses = cfg->end_bus_number - cfg->start_bus_number + 1;
+ start = cfg->address + PCI_MMCFG_BUS_OFFSET(cfg->start_bus);
+ num_buses = cfg->end_bus - cfg->start_bus + 1;
size = PCI_MMCFG_BUS_OFFSET(num_buses);
addr = ioremap_nocache(start, size);
if (addr) {
printk(KERN_INFO "PCI: Using MMCONFIG at %Lx - %Lx\n",
start, start + size - 1);
- addr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus_number);
+ addr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus);
}
return addr;
}
if (!pci_mmcfg_virt[i].virt) {
printk(KERN_ERR "PCI: Cannot map mmconfig aperture for "
"segment %d\n",
- pci_mmcfg_config[i].pci_segment);
+ pci_mmcfg_config[i].segment);
pci_mmcfg_arch_free();
return 0;
}
for (i = 0; i < pci_mmcfg_config_num; ++i) {
if (pci_mmcfg_virt[i].virt) {
- iounmap(pci_mmcfg_virt[i].virt + PCI_MMCFG_BUS_OFFSET(pci_mmcfg_virt[i].cfg->start_bus_number));
+ iounmap(pci_mmcfg_virt[i].virt + PCI_MMCFG_BUS_OFFSET(pci_mmcfg_virt[i].cfg->start_bus));
pci_mmcfg_virt[i].virt = NULL;
pci_mmcfg_virt[i].cfg = NULL;
}