qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] eepro100: Frame Reception


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH] eepro100: Frame Reception
Date: Thu, 22 Sep 2016 10:02:28 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0



On 2016年08月24日 00:46, Mateus Krepsky Ludwich wrote:
Changed E100 device so it updates EOF, F, and Actual Count fields of Receive
Frame Descriptor (RFD).

Actual Count fields were updated before this patch I think?

Assuming RFD.actual_count equals to size.

Signed-off-by: Mateus Krepsky Ludwich <address@hidden>
---
  hw/net/eepro100.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index bab4dbf..c0f3816 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -1739,6 +1739,7 @@ static ssize_t nic_receive(NetClientState *nc,
const uint8_t * buf, size_t size)
                   &rx, sizeof(eepro100_rx_t));
      uint16_t rfd_command = le16_to_cpu(rx.command);
      uint16_t rfd_size = le16_to_cpu(rx.size);
+    uint16_t rfd_count = size | 0xc000 ; /* Setting EOF and F bits */

      if (size > rfd_size) {
          logout("Receive buffer (%" PRId16 " bytes) too small for data "
@@ -1756,6 +1757,8 @@ static ssize_t nic_receive(NetClientState *nc,
const uint8_t * buf, size_t size)
                  offsetof(eepro100_rx_t, status), rfd_status);
      stw_le_pci_dma(&s->dev, s->ru_base + s->ru_offset +
                  offsetof(eepro100_rx_t, count), size);

Then this line can be removed, or what's maybe even better, you can just reuse rfd_size.

+    stw_le_pci_dma(&s->dev, s->ru_base + s->ru_offset +
+                offsetof(eepro100_rx_t, count), rfd_count);
      /* Early receive interrupt not supported. */
  #if 0
      eepro100_er_interrupt(s);

We need a better title, e.g "Fixing EOF and F filed when updating RFD"

Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]