From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Mike Nawrocki Date: Tue, 31 Oct 2017 11:54:34 -0400 Message-ID: <20171031155435.4618-2-michael.nawrocki@gtri.gatech.edu> In-Reply-To: <20171031155435.4618-1-michael.nawrocki@gtri.gatech.edu> References: <20171031155435.4618-1-michael.nawrocki@gtri.gatech.edu> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 1/2] Fix eepro100 simple transmission mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jasowang@redhat.com, mst@redhat.com, marcel@redhat.com, Mike Nawrocki 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 <= sizeof(buf)); while (size < tcb_bytes) { - uint32_t tx_buffer_address = ldl_le_pci_dma(&s->dev, tbd_address); - uint16_t tx_buffer_size = lduw_le_pci_dma(&s->dev, tbd_address + 4); -#if 0 - uint16_t tx_buffer_el = lduw_le_pci_dma(&s->dev, tbd_address + 6); -#endif - if (tx_buffer_size == 0) { - /* Prevent an endless loop. */ - logout("loop in %s:%u\n", __FILE__, __LINE__); - break; - } - tbd_address += 8; TRACE(RXTX, logout ("TBD (simplified mode): buffer address 0x%08x, size 0x%04x\n", - tx_buffer_address, tx_buffer_size)); - tx_buffer_size = MIN(tx_buffer_size, sizeof(buf) - size); - pci_dma_read(&s->dev, tx_buffer_address, &buf[size], tx_buffer_size); - size += tx_buffer_size; + tbd_address, tcb_bytes)); + pci_dma_read(&s->dev, tbd_address, &buf[size], tcb_bytes); + size += tcb_bytes; } if (tbd_array == 0xffffffff) { /* Simplified mode. Was already handled by code above. */ -- 2.14.2