Revision 5256d8bf

b/hw/pci-hotplug.c
127 127
        if (pci_read_devaddr(mon, pci_addr, &dom, &pci_bus, &slot)) {
128 128
            goto err;
129 129
        }
130
        dev = pci_find_device(pci_find_root_bus(dom), pci_bus, slot, 0);
130
        dev = pci_find_device(pci_find_root_bus(dom), pci_bus,
131
                              PCI_DEVFN(slot, 0));
131 132
        if (!dev) {
132 133
            monitor_printf(mon, "no pci device with address %s\n", pci_addr);
133 134
            goto err;
......
277 278
        return -1;
278 279
    }
279 280

  
280
    d = pci_find_device(pci_find_root_bus(dom), bus, slot, 0);
281
    d = pci_find_device(pci_find_root_bus(dom), bus, PCI_DEVFN(slot, 0));
281 282
    if (!d) {
282 283
        monitor_printf(mon, "slot %d empty\n", slot);
283 284
        return -1;
b/hw/pci.c
1603 1603
    return NULL;
1604 1604
}
1605 1605

  
1606
PCIDevice *pci_find_device(PCIBus *bus, int bus_num, int slot, int function)
1606
PCIDevice *pci_find_device(PCIBus *bus, int bus_num, uint8_t devfn)
1607 1607
{
1608 1608
    bus = pci_find_bus(bus, bus_num);
1609 1609

  
1610 1610
    if (!bus)
1611 1611
        return NULL;
1612 1612

  
1613
    return bus->devices[PCI_DEVFN(slot, function)];
1613
    return bus->devices[devfn];
1614 1614
}
1615 1615

  
1616 1616
static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
b/hw/pci.h
252 252
PCIBus *pci_find_root_bus(int domain);
253 253
int pci_find_domain(const PCIBus *bus);
254 254
PCIBus *pci_find_bus(PCIBus *bus, int bus_num);
255
PCIDevice *pci_find_device(PCIBus *bus, int bus_num, int slot, int function);
255
PCIDevice *pci_find_device(PCIBus *bus, int bus_num, uint8_t devfn);
256 256
int pci_qdev_find_device(const char *id, PCIDevice **pdev);
257 257
PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr);
258 258

  
b/hw/pci_host.c
44 44
    uint8_t bus_num = addr >> 16;
45 45
    uint8_t devfn = addr >> 8;
46 46

  
47
    return pci_find_device(bus, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn));
47
    return pci_find_device(bus, bus_num, devfn);
48 48
}
49 49

  
50 50
void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len)
b/hw/pcie_host.c
49 49
                                                     uint32_t mmcfg_addr)
50 50
{
51 51
    return pci_find_device(s, PCIE_MMCFG_BUS(mmcfg_addr),
52
                           PCI_SLOT(PCIE_MMCFG_DEVFN(mmcfg_addr)),
53
                           PCI_FUNC(PCIE_MMCFG_DEVFN(mmcfg_addr)));
52
                           PCIE_MMCFG_DEVFN(mmcfg_addr));
54 53
}
55 54

  
56 55
static void pcie_mmcfg_data_write(PCIBus *s,

Also available in: Unified diff