From patchwork Thu Dec 10 18:09:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 40850 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 ozlabs.org (Postfix) with ESMTPS id AB843B7B64 for ; Fri, 11 Dec 2009 05:15:00 +1100 (EST) Received: from localhost ([127.0.0.1]:53848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NInXU-0005go-VP for incoming@patchwork.ozlabs.org; Thu, 10 Dec 2009 13:14:56 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NInVF-0003Oz-Ab for qemu-devel@nongnu.org; Thu, 10 Dec 2009 13:12:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NInVA-0003J2-G1 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 13:12:36 -0500 Received: from [199.232.76.173] (port=58652 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NInVA-0003Ir-86 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 13:12:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9208) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NInVA-0003Yx-Nc for qemu-devel@nongnu.org; Thu, 10 Dec 2009 13:12:33 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBAICUpE030655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Dec 2009 13:12:30 -0500 Received: from redhat.com (vpn-6-118.tlv.redhat.com [10.35.6.118]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id nBAICSWo008571; Thu, 10 Dec 2009 13:12:29 -0500 Date: Thu, 10 Dec 2009 20:09:46 +0200 From: "Michael S. Tsirkin" To: Anthony Liguori , qemu-devel@nongnu.org Message-ID: <20091210180946.GB25707@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH 01/17] e1000: switch to symbolic names for pci registers 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 No functional changes. I verified that the generated object binary does not change. Signed-off-by: Michael S. Tsirkin --- hw/e1000.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index ad7a267..300b11d 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1089,12 +1089,15 @@ static int pci_e1000_init(PCIDevice *pci_dev) pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL); pci_config_set_device_id(pci_conf, E1000_DEVID); - *(uint16_t *)(pci_conf+0x06) = cpu_to_le16(0x0010); - pci_conf[0x08] = 0x03; + /* TODO: we have no capabilities, so why is this bit set? */ + pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST); + pci_conf[PCI_REVISION_ID] = 0x03; pci_config_set_class(pci_conf, PCI_CLASS_NETWORK_ETHERNET); - pci_conf[0x0c] = 0x10; + /* TODO: RST# value should be 0, PCI spec 6.2.4 */ + pci_conf[PCI_CACHE_LINE_SIZE] = 0x10; - pci_conf[0x3d] = 1; // interrupt pin 0 + /* TODO: RST# value should be 0 if programmable, PCI spec 6.2.4 */ + pci_conf[PCI_INTERRUPT_PIN] = 1; // interrupt pin 0 d->mmio_index = cpu_register_io_memory(e1000_mmio_read, e1000_mmio_write, d);