Revision f4c817e0 hw/pci_bridge.c

b/hw/pci_bridge.c
32 32
#include "pci_bridge.h"
33 33
#include "pci_internals.h"
34 34

  
35
/* PCI bridge subsystem vendor ID helper functions */
36
#define PCI_SSVID_SIZEOF        8
37
#define PCI_SSVID_SVID          4
38
#define PCI_SSVID_SSID          6
39

  
40
int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset,
41
                          uint16_t svid, uint16_t ssid)
42
{
43
    int pos;
44
    pos = pci_add_capability(dev, PCI_CAP_ID_SSVID, offset, PCI_SSVID_SIZEOF);
45
    if (pos < 0) {
46
        return pos;
47
    }
48

  
49
    pci_set_word(dev->config + pos + PCI_SSVID_SVID, svid);
50
    pci_set_word(dev->config + pos + PCI_SSVID_SSID, ssid);
51
    return pos;
52
}
53

  
35 54
/* Accessor function to get parent bridge device from pci bus. */
36 55
PCIDevice *pci_bridge_get_device(PCIBus *bus)
37 56
{

Also available in: Unified diff