All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH][RESEND] pcnet: Do not receive external frames in loopback mode
@ 2010-10-19 15:03 Jan Kiszka
  2010-11-17 10:18 ` [Qemu-devel] " Jan Kiszka
  2010-11-21 15:18 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Kiszka @ 2010-10-19 15:03 UTC (permalink / raw)
  To: qemu-devel

While not explicitly stated in the spec, it was observed on real systems
that enabling loopback testing on the pcnet controller disables
reception of external frames. And some legacy software relies on it, so
provide this behavior.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/pcnet.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/pcnet.c b/hw/pcnet.c
index b52935a..f970bda 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -1048,9 +1048,10 @@ ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_)
     int crc_err = 0;
     int size = size_;
 
-    if (CSR_DRX(s) || CSR_STOP(s) || CSR_SPND(s) || !size)
+    if (CSR_DRX(s) || CSR_STOP(s) || CSR_SPND(s) || !size ||
+        (CSR_LOOP(s) && !s->looptest)) {
         return -1;
-
+    }
 #ifdef PCNET_DEBUG
     printf("pcnet_receive size=%d\n", size);
 #endif
-- 
1.7.1

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

end of thread, other threads:[~2010-11-21 15:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 15:03 [Qemu-devel] [PATCH][RESEND] pcnet: Do not receive external frames in loopback mode Jan Kiszka
2010-11-17 10:18 ` [Qemu-devel] " Jan Kiszka
2010-11-21 15:18 ` [Qemu-devel] " Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.