[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 9/9] eepro100: Simplify receive data structure
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PATCH 9/9] eepro100: Simplify receive data structure |
Date: |
Thu, 31 Mar 2011 22:33:31 +0200 |
The packet data part of this structure was only used to calculate
the size of the preceding data. This can be simplified.
Signed-off-by: Stefan Weil <address@hidden>
---
hw/eepro100.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/eepro100.c b/hw/eepro100.c
index a740d2e..d4d315b 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -180,7 +180,7 @@ typedef struct {
uint32_t rx_buf_addr; /* void * */
uint16_t count;
uint16_t size;
- char packet[MAX_ETH_FRAME_SIZE + 4];
+ /* Ethernet frame data follows. */
} eepro100_rx_t;
typedef enum {
@@ -1859,7 +1859,7 @@ static ssize_t nic_receive(VLANClientState *nc, const
uint8_t * buf, size_t size
/* !!! */
eepro100_rx_t rx;
cpu_physical_memory_read(s->ru_base + s->ru_offset, (uint8_t *) & rx,
- offsetof(eepro100_rx_t, packet));
+ sizeof(eepro100_rx_t));
uint16_t rfd_command = le16_to_cpu(rx.command);
uint16_t rfd_size = le16_to_cpu(rx.size);
@@ -1893,7 +1893,7 @@ static ssize_t nic_receive(VLANClientState *nc, const
uint8_t * buf, size_t size
assert(!(s->configuration[17] & BIT(0)));
#endif
cpu_physical_memory_write(s->ru_base + s->ru_offset +
- offsetof(eepro100_rx_t, packet), buf, size);
+ sizeof(eepro100_rx_t), buf, size);
s->statistics.rx_good_frames++;
eepro100_fr_interrupt(s);
s->ru_offset = le32_to_cpu(rx.link);
--
1.7.2.5
- [Qemu-devel] eepro100: Improve emulation and portability, Stefan Weil, 2011/03/31
- [Qemu-devel] [PATCH 5/9] eepro100: Support byte/word read/write access to MDI control register, Stefan Weil, 2011/03/31
- [Qemu-devel] [PATCH 4/9] eepro100: Support byte/word writes to pointer register, Stefan Weil, 2011/03/31
- [Qemu-devel] [PATCH 8/9] eepro100: Pad received short frames, Stefan Weil, 2011/03/31
- [Qemu-devel] [PATCH 7/9] eepro100: Support 32 bit read access to flash register, Stefan Weil, 2011/03/31
- [Qemu-devel] [PATCH 2/9] eepro100: Fix endianness issues, Stefan Weil, 2011/03/31
- [Qemu-devel] [PATCH 9/9] eepro100: Simplify receive data structure,
Stefan Weil <=
- [Qemu-devel] [PATCH 6/9] eepro100: Support byte read access to general control register, Stefan Weil, 2011/03/31
- [Qemu-devel] [PATCH 3/9] eepro100: Support byte/word writes to port address, Stefan Weil, 2011/03/31
- [Qemu-devel] [PATCH 1/9] eepro100: Avoid duplicate debug messages, Stefan Weil, 2011/03/31