diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-04-10 08:21:58 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-04-10 08:21:58 -0500 |
commit | 4e1957acc854b2f3f3068c75cef2a429f9b97011 (patch) | |
tree | cab3ca24ed0fc963cb693c0d440a9495a2cc47eb /hw/pci.c | |
parent | 6da25bd5e8355230b9562417e386728c31783002 (diff) | |
parent | ff71f2e8cacefae99179993204172bc65e4303df (diff) | |
download | qemu-4e1957acc854b2f3f3068c75cef2a429f9b97011.zip qemu-4e1957acc854b2f3f3068c75cef2a429f9b97011.tar.gz qemu-4e1957acc854b2f3f3068c75cef2a429f9b97011.tar.bz2 |
Merge commit 'ff71f2e8cacefae99179993204172bc65e4303df' into staging
* commit 'ff71f2e8cacefae99179993204172bc65e4303df': (21 commits)
rtl8139: do the network/host communication only in normal operating mode
rtl8139: correctly check the opmode
net: move compute_mcast_idx() to net.h
rtl8139: support byte read to TxStatus registers
rtl8139: remove unused marco
rtl8139: limit transmission buffer size in c+ mode
pci_regs: Add PCI_EXP_TYPE_PCIE_BRIDGE
virtio-net: add DATA_VALID flag
pci_bridge: upper 32 bit are long registers
pci: fix bridge IO/BASE
pcie: drop functionality moved to core
pci: set memory type for memory behind the bridge
pci: add standard bridge device
slotid: add slot id capability
shpc: standard hot plug controller
pci_bridge: user-friendly default bus name
pci: make another unused extern function static
pci: don't export an internal function
pci_regs: Fix value of PCI_EXP_TYPE_RC_EC.
pci: Do not check if a bus exist in pci_parse_devaddr.
...
Diffstat (limited to 'hw/pci.c')
-rw-r--r-- | hw/pci.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -63,6 +63,7 @@ struct BusInfo pci_bus_info = { } }; +static PCIBus *pci_find_bus_nr(PCIBus *bus, int bus_num); static void pci_update_mappings(PCIDevice *d); static void pci_set_irq(void *opaque, int irq_num, int level); static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom); @@ -478,7 +479,7 @@ static void pci_set_default_subsystem_id(PCIDevice *pci_dev) * Parse [[<domain>:]<bus>:]<slot>, return -1 on error if funcp == NULL * [[<domain>:]<bus>:]<slot>.<func>, return -1 on error */ -int pci_parse_devaddr(const char *addr, int *domp, int *busp, +static int pci_parse_devaddr(const char *addr, int *domp, int *busp, unsigned int *slotp, unsigned int *funcp) { const char *p; @@ -529,10 +530,6 @@ int pci_parse_devaddr(const char *addr, int *domp, int *busp, if (*e) return -1; - /* Note: QEMU doesn't implement domains other than 0 */ - if (!pci_find_bus(pci_find_root_bus(dom), bus)) - return -1; - *domp = dom; *busp = bus; *slotp = slot; @@ -562,7 +559,7 @@ PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr) if (!devaddr) { *devfnp = -1; - return pci_find_bus(pci_find_root_bus(0), 0); + return pci_find_bus_nr(pci_find_root_bus(0), 0); } if (pci_parse_devaddr(devaddr, &dom, &bus, &slot, NULL) < 0) { @@ -570,7 +567,7 @@ PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr) } *devfnp = PCI_DEVFN(slot, 0); - return pci_find_bus(pci_find_root_bus(dom), bus); + return pci_find_bus_nr(pci_find_root_bus(dom), bus); } static void pci_init_cmask(PCIDevice *dev) @@ -636,8 +633,8 @@ static void pci_init_mask_bridge(PCIDevice *d) memset(d->wmask + PCI_PREF_BASE_UPPER32, 0xff, 8); /* Supported memory and i/o types */ - d->config[PCI_IO_BASE] |= PCI_IO_RANGE_TYPE_32; - d->config[PCI_IO_LIMIT] |= PCI_IO_RANGE_TYPE_32; + d->config[PCI_IO_BASE] |= PCI_IO_RANGE_TYPE_16; + d->config[PCI_IO_LIMIT] |= PCI_IO_RANGE_TYPE_16; pci_word_test_and_set_mask(d->config + PCI_PREF_MEMORY_BASE, PCI_PREF_RANGE_TYPE_64); pci_word_test_and_set_mask(d->config + PCI_PREF_MEMORY_LIMIT, @@ -666,8 +663,11 @@ static void pci_init_mask_bridge(PCIDevice *d) pci_set_word(d->w1cmask + PCI_BRIDGE_CONTROL, PCI_BRIDGE_CTL_DISCARD_STATUS); d->cmask[PCI_IO_BASE] |= PCI_IO_RANGE_TYPE_MASK; + d->cmask[PCI_IO_LIMIT] |= PCI_IO_RANGE_TYPE_MASK; pci_word_test_and_set_mask(d->cmask + PCI_PREF_MEMORY_BASE, PCI_PREF_RANGE_TYPE_MASK); + pci_word_test_and_set_mask(d->cmask + PCI_PREF_MEMORY_LIMIT, + PCI_PREF_RANGE_TYPE_MASK); } static int pci_init_multifunction(PCIBus *bus, PCIDevice *dev) @@ -1143,7 +1143,7 @@ static void pci_for_each_device_under_bus(PCIBus *bus, void pci_for_each_device(PCIBus *bus, int bus_num, void (*fn)(PCIBus *b, PCIDevice *d)) { - bus = pci_find_bus(bus, bus_num); + bus = pci_find_bus_nr(bus, bus_num); if (bus) { pci_for_each_device_under_bus(bus, fn); @@ -1230,7 +1230,7 @@ static PciBridgeInfo *qmp_query_pci_bridge(PCIDevice *dev, PCIBus *bus, info->bus.prefetchable_range->limit = pci_bridge_get_limit(dev, PCI_BASE_ADDRESS_MEM_PREFETCH); if (dev->config[PCI_SECONDARY_BUS] != 0) { - PCIBus *child_bus = pci_find_bus(bus, dev->config[PCI_SECONDARY_BUS]); + PCIBus *child_bus = pci_find_bus_nr(bus, dev->config[PCI_SECONDARY_BUS]); if (child_bus) { info->has_devices = true; info->devices = qmp_query_pci_devices(child_bus, dev->config[PCI_SECONDARY_BUS]); @@ -1309,7 +1309,7 @@ static PciInfo *qmp_query_pci_bus(PCIBus *bus, int bus_num) { PciInfo *info = NULL; - bus = pci_find_bus(bus, bus_num); + bus = pci_find_bus_nr(bus, bus_num); if (bus) { info = g_malloc0(sizeof(*info)); info->bus = bus_num; @@ -1419,7 +1419,7 @@ static bool pci_secondary_bus_in_range(PCIDevice *dev, int bus_num) bus_num <= dev->config[PCI_SUBORDINATE_BUS]; } -PCIBus *pci_find_bus(PCIBus *bus, int bus_num) +static PCIBus *pci_find_bus_nr(PCIBus *bus, int bus_num) { PCIBus *sec; @@ -1455,7 +1455,7 @@ PCIBus *pci_find_bus(PCIBus *bus, int bus_num) PCIDevice *pci_find_device(PCIBus *bus, int bus_num, uint8_t devfn) { - bus = pci_find_bus(bus, bus_num); + bus = pci_find_bus_nr(bus, bus_num); if (!bus) return NULL; |