[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL V2 04/23] dp8393x: Have dp8393x_receive() return the packet size
From: |
Jason Wang |
Subject: |
[PULL V2 04/23] dp8393x: Have dp8393x_receive() return the packet size |
Date: |
Tue, 3 Mar 2020 18:10:23 +0800 |
From: Finn Thain <address@hidden>
This function re-uses its 'size' argument as a scratch variable.
Instead, declare a local 'size' variable for that purpose so that the
function result doesn't get messed up.
Signed-off-by: Finn Thain <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
hw/net/dp8393x.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index 1844482..ed57f5f 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -759,20 +759,21 @@ static int dp8393x_receive_filter(dp8393xState *s, const
uint8_t * buf,
}
static ssize_t dp8393x_receive(NetClientState *nc, const uint8_t * buf,
- size_t size)
+ size_t pkt_size)
{
dp8393xState *s = qemu_get_nic_opaque(nc);
int packet_type;
uint32_t available, address;
- int width, rx_len = size;
+ int width, rx_len = pkt_size;
uint32_t checksum;
+ int size;
width = (s->regs[SONIC_DCR] & SONIC_DCR_DW) ? 2 : 1;
s->regs[SONIC_RCR] &= ~(SONIC_RCR_PRX | SONIC_RCR_LBK | SONIC_RCR_FAER |
SONIC_RCR_CRCR | SONIC_RCR_LPKT | SONIC_RCR_BC | SONIC_RCR_MC);
- packet_type = dp8393x_receive_filter(s, buf, size);
+ packet_type = dp8393x_receive_filter(s, buf, pkt_size);
if (packet_type < 0) {
DPRINTF("packet not for netcard\n");
return -1;
@@ -868,7 +869,7 @@ static ssize_t dp8393x_receive(NetClientState *nc, const
uint8_t * buf,
/* Done */
dp8393x_update_irq(s);
- return size;
+ return pkt_size;
}
static void dp8393x_reset(DeviceState *dev)
--
2.5.0
- [PULL V2 01/23] dp8393x: Mask EOL bit from descriptor addresses, (continued)
- [PULL V2 01/23] dp8393x: Mask EOL bit from descriptor addresses, Jason Wang, 2020/03/03
- [PULL V2 03/23] dp8393x: Clean up endianness hacks, Jason Wang, 2020/03/03
- [PULL V2 10/23] dp8393x: Pad frames to word or long word boundary, Jason Wang, 2020/03/03
- [PULL V2 02/23] dp8393x: Always use 32-bit accesses, Jason Wang, 2020/03/03
- [PULL V2 11/23] dp8393x: Clear descriptor in_use field to release packet, Jason Wang, 2020/03/03
- [PULL V2 13/23] dp8393x: Don't reset Silicon Revision register, Jason Wang, 2020/03/03
- [PULL V2 17/23] NetRxPkt: fix hash calculation of IPV6 TCP, Jason Wang, 2020/03/03
- [PULL V2 12/23] dp8393x: Always update RRA pointers and sequence numbers, Jason Wang, 2020/03/03
- [PULL V2 04/23] dp8393x: Have dp8393x_receive() return the packet size,
Jason Wang <=
- [PULL V2 05/23] dp8393x: Update LLFA and CRDA registers from rx descriptor, Jason Wang, 2020/03/03
- [PULL V2 14/23] dp8393x: Don't stop reception upon RBE interrupt assertion, Jason Wang, 2020/03/03
- [PULL V2 16/23] NetRxPkt: Introduce support for additional hash types, Jason Wang, 2020/03/03
- [PULL V2 21/23] net/filter.c: Add Options to insert filters anywhere in the filter list, Jason Wang, 2020/03/03
- [PULL V2 06/23] dp8393x: Clear RRRA command register bit only when appropriate, Jason Wang, 2020/03/03
- [PULL V2 07/23] dp8393x: Implement packet size limit and RBAE interrupt, Jason Wang, 2020/03/03
- [PULL V2 15/23] e1000e: Avoid hw_error if legacy mode used, Jason Wang, 2020/03/03
- [PULL V2 20/23] tests/test-replication.c: Add test for for secondary node continuing replication, Jason Wang, 2020/03/03
- [PULL V2 19/23] block/replication.c: Ignore requests after failover, Jason Wang, 2020/03/03
- [PULL V2 22/23] colo: Update Documentation for continuous replication, Jason Wang, 2020/03/03