* [Qemu-devel] [PATCH] eepro100: Clean code which sets the PCI device id
@ 2009-09-01 20:16 Stefan Weil
0 siblings, 0 replies; only message in thread
From: Stefan Weil @ 2009-09-01 20:16 UTC (permalink / raw)
To: qemu-devel
* Use function pci_config_set_device_id
* Use new macro PCI_DEVICE_ID_INTEL_82557
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
hw/eepro100.c | 15 +++++++--------
hw/pci.h | 1 +
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/eepro100.c b/hw/eepro100.c
index c374931..535a270 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -398,8 +398,7 @@ static void pci_reset(EEPRO100State * s)
/* PCI Vendor ID */
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
- /* PCI Device ID */
- pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82551IT);
+ /* PCI Device ID depends on device and is set below. */
/* PCI Command */
PCI_CONFIG_16(PCI_COMMAND, 0x0000);
/* PCI Status */
@@ -447,29 +446,29 @@ static void pci_reset(EEPRO100State * s)
switch (device) {
case i82551:
- //~ PCI_CONFIG_16(PCI_DEVICE_ID, 0x1209);
+ pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82551IT);
PCI_CONFIG_8(PCI_REVISION_ID, 0x0f);
break;
case i82557B:
- PCI_CONFIG_16(PCI_DEVICE_ID, 0x1229);
+ pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82557);
PCI_CONFIG_8(PCI_REVISION_ID, 0x02);
break;
case i82557C:
- PCI_CONFIG_16(PCI_DEVICE_ID, 0x1229);
+ pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82557);
PCI_CONFIG_8(PCI_REVISION_ID, 0x03);
break;
case i82558B:
- PCI_CONFIG_16(PCI_DEVICE_ID, 0x1229);
+ pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82557);
PCI_CONFIG_16(PCI_STATUS, 0x2810);
PCI_CONFIG_8(PCI_REVISION_ID, 0x05);
break;
case i82559C:
- PCI_CONFIG_16(PCI_DEVICE_ID, 0x1229);
+ pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82557);
PCI_CONFIG_16(PCI_STATUS, 0x2810);
//~ PCI_CONFIG_8(PCI_REVISION_ID, 0x08);
break;
case i82559ER:
- //~ PCI_CONFIG_16(PCI_DEVICE_ID, 0x1209);
+ pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82551IT);
PCI_CONFIG_16(PCI_STATUS, 0x2810);
PCI_CONFIG_8(PCI_REVISION_ID, 0x09);
break;
diff --git a/hw/pci.h b/hw/pci.h
index fd1d35c..80fc78a 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -59,6 +59,7 @@ extern target_phys_addr_t pci_mem_base;
/* Intel (0x8086) */
#define PCI_DEVICE_ID_INTEL_82551IT 0x1209
+#define PCI_DEVICE_ID_INTEL_82557 0x1229
/* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */
#define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4
--
1.5.6.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-01 20:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-01 20:16 [Qemu-devel] [PATCH] eepro100: Clean code which sets the PCI device id Stefan Weil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).