[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/6] sunhme: fix return values from sunhme_receive()
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-devel] [PULL 5/6] sunhme: fix return values from sunhme_receive() during receive packet processing |
Date: |
Tue, 2 Jul 2019 23:16:05 +0100 |
The current return values in sunhme_receive() when processing incoming packets
are inverted from what they should be. Make sure that we return 0 to indicate
the packet was discarded (and polling is to be disabled) and -1 to indicate
that the packet was discarded but polling for incoming data is to be continued.
Signed-off-by: Mark Cave-Ayland <address@hidden>
---
hw/net/sunhme.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
index 14e7effb88..cd076d642b 100644
--- a/hw/net/sunhme.c
+++ b/hw/net/sunhme.c
@@ -728,7 +728,7 @@ static ssize_t sunhme_receive(NetClientState *nc, const
uint8_t *buf,
/* Do nothing if MAC RX disabled */
if (!(s->macregs[HME_MACI_RXCFG >> 2] & HME_MAC_RXCFG_ENABLE)) {
- return -1;
+ return 0;
}
trace_sunhme_rx_filter_destmac(buf[0], buf[1], buf[2],
@@ -757,14 +757,14 @@ static ssize_t sunhme_receive(NetClientState *nc, const
uint8_t *buf,
/* Didn't match hash filter */
trace_sunhme_rx_filter_hash_nomatch();
trace_sunhme_rx_filter_reject();
- return 0;
+ return -1;
} else {
trace_sunhme_rx_filter_hash_match();
}
} else {
/* Not for us */
trace_sunhme_rx_filter_reject();
- return 0;
+ return -1;
}
} else {
trace_sunhme_rx_filter_promisc_match();
--
2.11.0
- [Qemu-devel] [PULL 0/6] qemu-sparc queue 20190702, Mark Cave-Ayland, 2019/07/02
- [Qemu-devel] [PULL 5/6] sunhme: fix return values from sunhme_receive() during receive packet processing,
Mark Cave-Ayland <=
- [Qemu-devel] [PULL 1/6] sun4m: set default display type to TCX, Mark Cave-Ayland, 2019/07/02
- [Qemu-devel] [PULL 4/6] sunhme: flush any queued packets when HME_MAC_RXCFG_ENABLE bit is raised, Mark Cave-Ayland, 2019/07/02
- [Qemu-devel] [PULL 2/6] sunhme: add trace event for logging PCI IRQ, Mark Cave-Ayland, 2019/07/02
- [Qemu-devel] [PULL 3/6] sunhme: fix incorrect constant in sunhme_can_receive(), Mark Cave-Ayland, 2019/07/02
- [Qemu-devel] [PULL 6/6] sunhme: ensure that RX descriptor ring overflow is indicated to client driver, Mark Cave-Ayland, 2019/07/02
- Re: [Qemu-devel] [PULL 0/6] qemu-sparc queue 20190702, no-reply, 2019/07/02
- Re: [Qemu-devel] [PULL 0/6] qemu-sparc queue 20190702, Peter Maydell, 2019/07/04