From nobody Sun May 5 10:30:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1509465447880914.6785033635592; Tue, 31 Oct 2017 08:57:27 -0700 (PDT) Received: from localhost ([::1]:46309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9Yui-0005Gl-PD for importer@patchew.org; Tue, 31 Oct 2017 11:57:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9Yt3-0004N6-8S for qemu-devel@nongnu.org; Tue, 31 Oct 2017 11:55:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9Ysy-0007nt-EA for qemu-devel@nongnu.org; Tue, 31 Oct 2017 11:55:33 -0400 Received: from relay2.gtri.gatech.edu ([130.207.199.168]:54912) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e9Ysy-0007mx-8a for qemu-devel@nongnu.org; Tue, 31 Oct 2017 11:55:28 -0400 Received: from jekyll.core.gtri.org (jekyll.core.gtri.org [10.41.1.48]) by relay2.gtri.gatech.edu with ESMTP id gvTSDOWyizSkJSgC (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Tue, 31 Oct 2017 11:55:26 -0400 (EDT) Received: from tybee.core.gtri.org (10.41.1.49) by jekyll.core.gtri.org (10.41.1.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 31 Oct 2017 11:55:26 -0400 Received: from tia-mxn-d01.ctisl.gtri.org (130.207.205.130) by tybee.core.gtri.org (10.41.1.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 31 Oct 2017 11:55:26 -0400 X-ASG-Debug-ID: 1509465326-0768e41b315625d0003-jgbH7p X-Barracuda-Envelope-From: Michael.Nawrocki@gtri.gatech.edu From: Mike Nawrocki To: Date: Tue, 31 Oct 2017 11:54:34 -0400 X-ASG-Orig-Subj: [PATCH 1/2] Fix eepro100 simple transmission mode Message-ID: <20171031155435.4618-2-michael.nawrocki@gtri.gatech.edu> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171031155435.4618-1-michael.nawrocki@gtri.gatech.edu> References: <20171031155435.4618-1-michael.nawrocki@gtri.gatech.edu> MIME-Version: 1.0 X-Originating-IP: [130.207.205.130] X-ClientProxiedBy: apatlisdmfe5.core.gtri.org (10.41.104.96) To tybee.core.gtri.org (10.41.1.49) X-Barracuda-Connect: jekyll.core.gtri.org[10.41.1.48] X-Barracuda-Start-Time: 1509465326 X-Barracuda-Encrypted: ECDHE-RSA-AES128-SHA256 X-Barracuda-URL: https://130.207.199.168:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at gtri.gatech.edu X-Barracuda-Scan-Msg-Size: 1788 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.44360 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 130.207.199.168 Subject: [Qemu-devel] [PATCH 1/2] Fix eepro100 simple transmission mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcel@redhat.com, jasowang@redhat.com, Mike Nawrocki , mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The simple transmission mode was treating the area immediately after the transmit command block (TCB) as if it were a transmit buffer descriptor, when in reality it is simply the packet data. This change simply copies the data following the TCB into the packet buffer. Signed-off-by: Mike Nawrocki --- hw/net/eepro100.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 80b8f47c4b..91dd058010 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -774,23 +774,11 @@ static void tx_command(EEPRO100State *s) } assert(tcb_bytes <=3D sizeof(buf)); while (size < tcb_bytes) { - uint32_t tx_buffer_address =3D ldl_le_pci_dma(&s->dev, tbd_address= ); - uint16_t tx_buffer_size =3D lduw_le_pci_dma(&s->dev, tbd_address += 4); -#if 0 - uint16_t tx_buffer_el =3D lduw_le_pci_dma(&s->dev, tbd_address + 6= ); -#endif - if (tx_buffer_size =3D=3D 0) { - /* Prevent an endless loop. */ - logout("loop in %s:%u\n", __FILE__, __LINE__); - break; - } - tbd_address +=3D 8; TRACE(RXTX, logout ("TBD (simplified mode): buffer address 0x%08x, size 0x%04x\n", - tx_buffer_address, tx_buffer_size)); - tx_buffer_size =3D MIN(tx_buffer_size, sizeof(buf) - size); - pci_dma_read(&s->dev, tx_buffer_address, &buf[size], tx_buffer_siz= e); - size +=3D tx_buffer_size; + tbd_address, tcb_bytes)); + pci_dma_read(&s->dev, tbd_address, &buf[size], tcb_bytes); + size +=3D tcb_bytes; } if (tbd_array =3D=3D 0xffffffff) { /* Simplified mode. Was already handled by code above. */ --=20 2.14.2 From nobody Sun May 5 10:30:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 150946544678317.007998653694585; Tue, 31 Oct 2017 08:57:26 -0700 (PDT) Received: from localhost ([::1]:46308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9Yuh-0005G7-Gw for importer@patchew.org; Tue, 31 Oct 2017 11:57:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9Yt3-0004N5-8E for qemu-devel@nongnu.org; Tue, 31 Oct 2017 11:55:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9Ysy-0007o3-EL for qemu-devel@nongnu.org; Tue, 31 Oct 2017 11:55:33 -0400 Received: from relay2.gtri.gatech.edu ([130.207.199.168]:54921) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e9Ysy-0007nI-8e for qemu-devel@nongnu.org; Tue, 31 Oct 2017 11:55:28 -0400 Received: from jekyll.core.gtri.org (jekyll.core.gtri.org [10.41.1.48]) by relay2.gtri.gatech.edu with ESMTP id HbchHhgedcDoIVp9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Tue, 31 Oct 2017 11:55:26 -0400 (EDT) Received: from tybee.core.gtri.org (10.41.1.49) by jekyll.core.gtri.org (10.41.1.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 31 Oct 2017 11:55:26 -0400 Received: from tia-mxn-d01.ctisl.gtri.org (130.207.205.130) by tybee.core.gtri.org (10.41.1.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 31 Oct 2017 11:55:26 -0400 X-ASG-Debug-ID: 1509465326-0768e41b315625d0004-jgbH7p X-Barracuda-Envelope-From: Michael.Nawrocki@gtri.gatech.edu From: Mike Nawrocki To: Date: Tue, 31 Oct 2017 11:54:35 -0400 X-ASG-Orig-Subj: [PATCH 2/2] Add i82559a eepro100 interface Message-ID: <20171031155435.4618-3-michael.nawrocki@gtri.gatech.edu> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171031155435.4618-1-michael.nawrocki@gtri.gatech.edu> References: <20171031155435.4618-1-michael.nawrocki@gtri.gatech.edu> MIME-Version: 1.0 X-Originating-IP: [130.207.205.130] X-ClientProxiedBy: apatlisdmfe5.core.gtri.org (10.41.104.96) To tybee.core.gtri.org (10.41.1.49) X-Barracuda-Connect: jekyll.core.gtri.org[10.41.1.48] X-Barracuda-Start-Time: 1509465326 X-Barracuda-Encrypted: ECDHE-RSA-AES128-SHA256 X-Barracuda-URL: https://130.207.199.168:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at gtri.gatech.edu X-Barracuda-Scan-Msg-Size: 2526 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.44360 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 130.207.199.168 Subject: [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcel@redhat.com, jasowang@redhat.com, Mike Nawrocki , mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Nawrocki --- hw/net/eepro100.c | 2 +- hw/pci/pci.c | 2 ++ include/hw/pci/pci.h | 1 + qemu-options.hx | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 91dd058010..2c7c5cdeb9 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -1973,7 +1973,7 @@ static E100PCIDeviceInfo e100_devices[] =3D { .name =3D "i82559a", .desc =3D "Intel i82559A Ethernet", .device =3D i82559A, - .device_id =3D PCI_DEVICE_ID_INTEL_82557, + .device_id =3D PCI_DEVICE_ID_INTEL_82559, .revision =3D 0x06, .stats_size =3D 80, .has_extended_tcb_support =3D true, diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 5ed3c8dca4..1126ad1eb3 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1826,6 +1826,7 @@ static const char * const pci_nic_models[] =3D { "ne2k_pci", "i82551", "i82557b", + "i82559a", "i82559er", "rtl8139", "e1000", @@ -1839,6 +1840,7 @@ static const char * const pci_nic_names[] =3D { "ne2k_pci", "i82551", "i82557b", + "i82559a", "i82559er", "rtl8139", "e1000", diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 8d02a0a383..f30e2cfb72 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -70,6 +70,7 @@ extern bool pci_available; /* Intel (0x8086) */ #define PCI_DEVICE_ID_INTEL_82551IT 0x1209 #define PCI_DEVICE_ID_INTEL_82557 0x1229 +#define PCI_DEVICE_ID_INTEL_82559 0x1030 #define PCI_DEVICE_ID_INTEL_82801IR 0x2922 =20 /* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */ diff --git a/qemu-options.hx b/qemu-options.hx index 3728e9b4dd..a39c7e44b3 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2047,7 +2047,7 @@ that the card should have; this option currently only= affects virtio cards; set @var{v} =3D 0 to disable MSI-X. If no @option{-net} option is specified, a= single NIC is created. QEMU can emulate several different models of network card. Valid values for @var{type} are -@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er}, +@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559a}, @code{i82559= er}, @code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139}, @code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}. Not all devices are supported on all targets. Use @code{-net nic,model=3D= help} --=20 2.14.2