Revision e7b9bc3e hw/dec_pci.c

b/hw/dec_pci.c
50 50
    return irq_num;
51 51
}
52 52

  
53
static int dec_21154_initfn(PCIDevice *dev)
54
{
55
    int rc;
56

  
57
    rc = pci_bridge_initfn(dev);
58
    if (rc < 0) {
59
        return rc;
60
    }
61

  
62
    pci_config_set_vendor_id(dev->config, PCI_VENDOR_ID_DEC);
63
    pci_config_set_device_id(dev->config, PCI_DEVICE_ID_DEC_21154);
64
    return 0;
65
}
66

  
67 53
static PCIDeviceInfo dec_21154_pci_bridge_info = {
68 54
    .qdev.name = "dec-21154-p2p-bridge",
69 55
    .qdev.desc = "DEC 21154 PCI-PCI bridge",
70 56
    .qdev.size = sizeof(PCIBridge),
71 57
    .qdev.vmsd = &vmstate_pci_device,
72 58
    .qdev.reset = pci_bridge_reset,
73
    .init = dec_21154_initfn,
59
    .init = pci_bridge_initfn,
74 60
    .exit = pci_bridge_exitfn,
61
    .vendor_id = PCI_VENDOR_ID_DEC,
62
    .device_id = PCI_DEVICE_ID_DEC_21154,
75 63
    .config_write = pci_bridge_write_config,
76 64
    .is_bridge = 1,
77 65
};
......
108 96
static int dec_21154_pci_host_init(PCIDevice *d)
109 97
{
110 98
    /* PCI2PCI bridge same values as PearPC - check this */
111
    pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_DEC);
112
    pci_config_set_device_id(d->config, PCI_DEVICE_ID_DEC_21154);
113
    pci_set_byte(d->config + PCI_REVISION_ID, 0x02);
114
    pci_config_set_class(d->config, PCI_CLASS_BRIDGE_PCI);
115 99
    return 0;
116 100
}
117 101

  
......
119 103
    .qdev.name = "dec-21154",
120 104
    .qdev.size = sizeof(PCIDevice),
121 105
    .init      = dec_21154_pci_host_init,
106
    .vendor_id = PCI_VENDOR_ID_DEC,
107
    .device_id = PCI_DEVICE_ID_DEC_21154,
108
    .revision = 0x02,
109
    .class_id = PCI_CLASS_BRIDGE_PCI,
122 110
    .is_bridge  = 1,
123 111
};
124 112

  

Also available in: Unified diff