qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] fix the return value of rtl8139_can_receive()


From: Wen Congyang
Subject: [Qemu-devel] [PATCH] fix the return value of rtl8139_can_receive()
Date: Thu, 16 Jun 2011 16:23:56 +0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4

If rtl8139_can_receive() returns 1, it means that the nic can receive packet,
otherwise, it means the nic can not receive packet.

If !s->clock_enabled or !rtl8139_receiver_enabled(s), it means that the nic
can not receive packet. So the return value should be 0, not 1.

Signed-off-by: Wen Congyang <address@hidden>

---
 hw/rtl8139.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index 2f8db58..9084678 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -810,9 +810,9 @@ static int rtl8139_can_receive(VLANClientState *nc)
 
     /* Receive (drop) packets if card is disabled.  */
     if (!s->clock_enabled)
-      return 1;
+      return 0;
     if (!rtl8139_receiver_enabled(s))
-      return 1;
+      return 0;
 
     if (rtl8139_cp_receiver_enabled(s)) {
         /* ??? Flow control not implemented in c+ mode.
-- 
1.7.1



reply via email to

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