[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/14] pci bridge: add helper function for ssvid cap
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 03/14] pci bridge: add helper function for ssvid capability. |
Date: |
Mon, 6 Sep 2010 16:46:17 +0900 |
helper function to add ssvid capability.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/pci_bridge.c | 19 +++++++++++++++++++
hw/pci_bridge.h | 3 +++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/hw/pci_bridge.c b/hw/pci_bridge.c
index 198c3c7..638e3b3 100644
--- a/hw/pci_bridge.c
+++ b/hw/pci_bridge.c
@@ -32,6 +32,25 @@
#include "pci_bridge.h"
#include "pci_internals.h"
+/* PCI bridge subsystem vendor ID helper functions */
+#define PCI_SSVID_SIZEOF 8
+#define PCI_SSVID_SVID 4
+#define PCI_SSVID_SSID 6
+
+int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset,
+ uint16_t svid, uint16_t ssid)
+{
+ int pos;
+ pos = pci_add_capability(dev, PCI_CAP_ID_SSVID, offset, PCI_SSVID_SIZEOF);
+ if (pos < 0) {
+ return pos;
+ }
+
+ pci_set_word(dev->config + pos + PCI_SSVID_SVID, svid);
+ pci_set_word(dev->config + pos + PCI_SSVID_SSID, ssid);
+ return pos;
+}
+
/* 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 63ada19..f6fade0 100644
--- a/hw/pci_bridge.h
+++ b/hw/pci_bridge.h
@@ -28,6 +28,9 @@
#include "pci.h"
+int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset,
+ uint16_t svid, uint16_t ssid);
+
PCIDevice *pci_bridge_get_device(PCIBus *bus);
PCIBus *pci_bridge_get_sec_bus(PCIBridge *br);
--
1.7.1.1
[Qemu-devel] [PATCH 10/14] pcie root port: implement pcie root port., Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 04/14] pci: call hotplug callback even when not hotplug case for later use., Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 06/14] pci_ids.h: add vendor id of Texus Intesruments., Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 14/14] pcie/aer: glue aer error injection into qemu monitor., Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 03/14] pci bridge: add helper function for ssvid capability.,
Isaku Yamahata <=
[Qemu-devel] [PATCH 05/14] pci: make pci_parse_devfn() aware of func., Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 07/14] msi: implemented msi., Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 13/14] pcie/hotplug: glue pushing attention button command. pcie_abp, Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 02/14] pci: consolidate pci_add_capability_at_offset() into pci_add_capability()., Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 11/14] pcie upstream port: pci express switch upstream port., Isaku Yamahata, 2010/09/06
[Qemu-devel] [PATCH 12/14] pcie downstream port: pci express switch downstream port., Isaku Yamahata, 2010/09/06