diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2009-10-30 21:21:13 +0900 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-11-09 08:43:09 -0600 |
commit | e822a52a81f16e09b59cfd8126786bff6bde98bd (patch) | |
tree | d22caf5f16ac54efb8e9d08e9544221822c03c91 /hw/pci.h | |
parent | e94ff650263d99006fcfa857a72e5e1dd9638720 (diff) |
pci: make pci configuration transaction more accurate.
This patch sorts out/enhances pci code to track pci bus topology
more accurately.
- Track host bus bridge with pci domain number. Although the
current qemu implementation supports only pci domian 0 yet.
- Track pci bridge parent-child relationship.
When looking down from pci host bus for pci sub bus, be aware of
secondary bus/subordinate bus.
Thus pci configuration transaction is more accurately emulated.
This patch adds new member to PCIBus to track pci bus topology.
Since qdev already tracks down bus relationship, those new member
wouldn't be necessary.
However it would be addressed later because not all the pci device
isn't converted to qdev yet.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.h')
-rw-r--r-- | hw/pci.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -118,6 +118,7 @@ typedef struct PCIIORegion { #define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ #define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ #define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ +#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ #define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ #define PCI_SUBSYSTEM_VENDOR_ID 0x2c /* 16 bits */ #define PCI_SUBSYSTEM_ID 0x2e /* 16 bits */ @@ -267,9 +268,10 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, const char *default_model, void pci_data_write(void *opaque, uint32_t addr, uint32_t val, int len); uint32_t pci_data_read(void *opaque, uint32_t addr, int len); int pci_bus_num(PCIBus *s); -void pci_for_each_device(int bus_num, void (*fn)(PCIDevice *d)); -PCIBus *pci_find_bus(int bus_num); -PCIDevice *pci_find_device(int bus_num, int slot, int function); +void pci_for_each_device(PCIBus *bus, int bus_num, void (*fn)(PCIBus *bus, PCIDevice *d)); +PCIBus *pci_find_host_bus(int domain); +PCIBus *pci_find_bus(PCIBus *bus, int bus_num); +PCIDevice *pci_find_device(PCIBus *bus, int bus_num, int slot, int function); PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr); int pci_read_devaddr(Monitor *mon, const char *addr, int *domp, int *busp, |