69 |
69 |
DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
|
70 |
70 |
DEFINE_PROP_STRING("romfile", PCIDevice, romfile),
|
71 |
71 |
DEFINE_PROP_UINT32("rombar", PCIDevice, rom_bar, 1),
|
|
72 |
DEFINE_PROP_BIT("multifunction", PCIDevice, cap_present,
|
|
73 |
QEMU_PCI_CAP_MULTIFUNCTION_BITNR, false),
|
72 |
74 |
DEFINE_PROP_END_OF_LIST()
|
73 |
75 |
}
|
74 |
76 |
};
|
... | ... | |
1659 |
1661 |
}
|
1660 |
1662 |
}
|
1661 |
1663 |
|
1662 |
|
PCIDevice *pci_create(PCIBus *bus, int devfn, const char *name)
|
|
1664 |
PCIDevice *pci_create_multifunction(PCIBus *bus, int devfn, bool multifunction,
|
|
1665 |
const char *name)
|
1663 |
1666 |
{
|
1664 |
1667 |
DeviceState *dev;
|
1665 |
1668 |
|
1666 |
1669 |
dev = qdev_create(&bus->qbus, name);
|
1667 |
1670 |
qdev_prop_set_uint32(dev, "addr", devfn);
|
|
1671 |
qdev_prop_set_bit(dev, "multifunction", multifunction);
|
1668 |
1672 |
return DO_UPCAST(PCIDevice, qdev, dev);
|
1669 |
1673 |
}
|
1670 |
1674 |
|
1671 |
|
PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name)
|
|
1675 |
PCIDevice *pci_create_simple_multifunction(PCIBus *bus, int devfn,
|
|
1676 |
bool multifunction,
|
|
1677 |
const char *name)
|
1672 |
1678 |
{
|
1673 |
|
PCIDevice *dev = pci_create(bus, devfn, name);
|
|
1679 |
PCIDevice *dev = pci_create_multifunction(bus, devfn, multifunction, name);
|
1674 |
1680 |
qdev_init_nofail(&dev->qdev);
|
1675 |
1681 |
return dev;
|
1676 |
1682 |
}
|
1677 |
1683 |
|
|
1684 |
PCIDevice *pci_create(PCIBus *bus, int devfn, const char *name)
|
|
1685 |
{
|
|
1686 |
return pci_create_multifunction(bus, devfn, false, name);
|
|
1687 |
}
|
|
1688 |
|
|
1689 |
PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name)
|
|
1690 |
{
|
|
1691 |
return pci_create_simple_multifunction(bus, devfn, false, name);
|
|
1692 |
}
|
|
1693 |
|
1678 |
1694 |
static int pci_find_space(PCIDevice *pdev, uint8_t size)
|
1679 |
1695 |
{
|
1680 |
1696 |
int config_size = pci_config_size(pdev);
|