@@ -150,6 +150,8 @@ do { printf("lan9118: " fmt , ## __VA_ARGS__); } while (0)
#define GPT_TIMER_EN 0x20000000
+#define PKT_SIZE 2048
+
enum tx_state {
TX_IDLE,
TX_B,
@@ -166,7 +168,7 @@ typedef struct {
int32_t pad;
int32_t fifo_used;
int32_t len;
- uint8_t data[2048];
+ uint8_t data[PKT_SIZE];
} LAN9118Packet;
static const VMStateDescription vmstate_lan9118_packet = {
@@ -182,7 +184,7 @@ static const VMStateDescription vmstate_lan9118_packet = {
VMSTATE_INT32(pad, LAN9118Packet),
VMSTATE_INT32(fifo_used, LAN9118Packet),
VMSTATE_INT32(len, LAN9118Packet),
- VMSTATE_UINT8_ARRAY(data, LAN9118Packet, 2048),
+ VMSTATE_UINT8_ARRAY(data, LAN9118Packet, PKT_SIZE),
VMSTATE_END_OF_LIST()
}
};
@@ -544,7 +546,7 @@ static ssize_t lan9118_receive(NetClientState *nc, const uint8_t *buf,
return -1;
}
- if (size >= 2048 || size < 14) {
+ if (size >= PKT_SIZE || size < 14) {
return -1;
}
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/net/lan9118.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)