diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-26 15:37:35 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-26 15:37:35 +0000 |
commit | 89853e7fc9ba61805a81b467933696d9d4c6bc13 (patch) | |
tree | 00f99dbd1adbf0f2c7ac75befc848a454c77aefa /hw/lsi53c895a.c | |
parent | 62eb84a62f071e2d62d1064a46ec2d3be7427465 (diff) | |
download | qemu-89853e7fc9ba61805a81b467933696d9d4c6bc13.tar.gz qemu-89853e7fc9ba61805a81b467933696d9d4c6bc13.tar.bz2 qemu-89853e7fc9ba61805a81b467933696d9d4c6bc13.zip |
Define PCI vendor and device IDs in pci.h (Stuart Brady)
This patch defines PCI vendor and device IDs in pci.h (matching those
from Linux's pci_ids.h), and uses those definitions where appropriate.
Change from v1:
Introduces pci_config_set_vendor_id() / pci_config_set_device_id()
accessors as suggested by Anthony Liguori.
Signed-off-by: Stuart Brady <stuart.brady@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6442 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/lsi53c895a.c')
-rw-r--r-- | hw/lsi53c895a.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 9f50dcbd18..021fe88cc5 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -1963,6 +1963,7 @@ void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id) void *lsi_scsi_init(PCIBus *bus, int devfn) { LSIState *s; + uint8_t *pci_conf; s = (LSIState *)pci_register_device(bus, "LSI53C895A SCSI HBA", sizeof(*s), devfn, NULL, NULL); @@ -1971,21 +1972,21 @@ void *lsi_scsi_init(PCIBus *bus, int devfn) return NULL; } + pci_conf = s->pci_dev.config; + /* PCI Vendor ID (word) */ - s->pci_dev.config[0x00] = 0x00; - s->pci_dev.config[0x01] = 0x10; + pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_LSI_LOGIC); /* PCI device ID (word) */ - s->pci_dev.config[0x02] = 0x12; - s->pci_dev.config[0x03] = 0x00; + pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_LSI_53C895A); /* PCI base class code */ - s->pci_dev.config[0x0b] = 0x01; + pci_conf[0x0b] = 0x01; /* PCI subsystem ID */ - s->pci_dev.config[0x2e] = 0x00; - s->pci_dev.config[0x2f] = 0x10; + pci_conf[0x2e] = 0x00; + pci_conf[0x2f] = 0x10; /* PCI latency timer = 255 */ - s->pci_dev.config[0x0d] = 0xff; + pci_conf[0x0d] = 0xff; /* Interrupt pin 1 */ - s->pci_dev.config[0x3d] = 0x01; + pci_conf[0x3d] = 0x01; s->mmio_io_addr = cpu_register_io_memory(0, lsi_mmio_readfn, lsi_mmio_writefn, s); |