From patchwork Tue Sep 1 20:16:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 32764 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 48AEAB7B76 for ; Wed, 2 Sep 2009 06:17:22 +1000 (EST) Received: from localhost ([127.0.0.1]:41663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiZn1-0007J1-Ol for incoming@patchwork.ozlabs.org; Tue, 01 Sep 2009 16:17:15 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiZm8-00078I-Hr for qemu-devel@nongnu.org; Tue, 01 Sep 2009 16:16:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiZm3-00076z-V9 for qemu-devel@nongnu.org; Tue, 01 Sep 2009 16:16:20 -0400 Received: from [199.232.76.173] (port=53678 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiZm3-00076r-PA for qemu-devel@nongnu.org; Tue, 01 Sep 2009 16:16:15 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:63864) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MiZm3-0007GP-8d for qemu-devel@nongnu.org; Tue, 01 Sep 2009 16:16:15 -0400 Received: from flocke.weilnetz.de (p54ADF6F6.dip.t-dialin.net [84.173.246.246]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MKv1o-1MiZm00X3E-000Hoe; Tue, 01 Sep 2009 22:16:12 +0200 Received: from stefan by flocke.weilnetz.de with local (Exim 4.69) (envelope-from ) id 1MiZly-0005rs-VL; Tue, 01 Sep 2009 22:16:10 +0200 From: Stefan Weil To: qemu-devel@nongnu.org Date: Tue, 1 Sep 2009 22:16:10 +0200 Message-Id: <1251836170-22534-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.5.6.5 X-Provags-ID: V01U2FsdGVkX1/c5lvRhRHiWlHugr+3Uz9zlN9ABr2iu/YZjiU e1BocRu0t5jx1DCF0bls+Ed8LsmjS/Bla69okArRbY72+6zlfn vDCxLIepQNu4lj6ARzb5+tKlGK/qkVG4ensl4IlkbUJ57G8Skj 6IQ== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] eepro100: Clean code which sets the PCI device id X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org * Use function pci_config_set_device_id * Use new macro PCI_DEVICE_ID_INTEL_82557 Signed-off-by: Stefan Weil --- 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