qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix the return value of rtl8139_can_receive()
@ 2011-06-16  8:23 Wen Congyang
  2011-06-16 10:39 ` Kevin Wolf
  0 siblings, 1 reply; 9+ messages in thread
From: Wen Congyang @ 2011-06-16  8:23 UTC (permalink / raw)
  To: Aurelien Jarno, qemu-devel

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 <wency@cn.fujitsu.com>

---
 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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-06-20 11:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-16  8:23 [Qemu-devel] [PATCH] fix the return value of rtl8139_can_receive() Wen Congyang
2011-06-16 10:39 ` Kevin Wolf
2011-06-16 12:46   ` Michael S. Tsirkin
2011-06-17  1:33     ` [Qemu-devel] [PATCH] do not send packet to nic if the packet will be dropped by nic Wen Congyang
2011-06-20  9:10       ` Kevin Wolf
2011-06-20  9:40         ` Wen Congyang
2011-06-20  9:52           ` Kevin Wolf
2011-06-20 11:13             ` Michael S. Tsirkin
2011-06-17  1:49   ` [Qemu-devel] [PATCH] fix the return value of rtl8139_can_receive() Wen Congyang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).