Patchwork [06/26] pci_bridge: add helper function to convert PCIBridge into PCIDevice

login
register
mail settings
Submitter Isaku Yamahata
Date March 16, 2011, 9:29 a.m.
Message ID <eca6efeb48feaea9942cd91ee77fb111658fd99a.1300266238.git.yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/87189/
State New
Headers show

Comments

Isaku Yamahata - March 16, 2011, 9:29 a.m.
pci_bridge_to_pci() which converts PCIBridge into PCIDevice which will
be used later by pci_p2pbr.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/pci_bridge.c |    6 ++++++
 hw/pci_bridge.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/pci_bridge.c b/hw/pci_bridge.c
index 464d897..00b6b76 100644
--- a/hw/pci_bridge.c
+++ b/hw/pci_bridge.c
@@ -52,6 +52,12 @@  int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset,
     return pos;
 }
 
+/* Accessor function to get PCI device from pci bridge. */
+PCIDevice *pci_bridge_to_pci(PCIBridge *br)
+{
+    return &br->dev;
+}
+
 /* Accessor function to get parent bridge device from pci bus. */
 PCIDevice *pci_bridge_get_device(PCIBus *bus)
 {
diff --git a/hw/pci_bridge.h b/hw/pci_bridge.h
index 84411a6..c306992 100644
--- a/hw/pci_bridge.h
+++ b/hw/pci_bridge.h
@@ -31,6 +31,7 @@ 
 int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset,
                           uint16_t svid, uint16_t ssid);
 
+PCIDevice *pci_bridge_to_pci(PCIBridge *br);
 PCIDevice *pci_bridge_get_device(PCIBus *bus);
 PCIBus *pci_bridge_get_sec_bus(PCIBridge *br);