From 078c47d79ca06dc558f5a275936bfe88c4c5503c Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Sun, 13 Jan 2019 16:51:20 +0100 Subject: [PATCH] cpu/esp32: fixes frame size handling in esp_wifi The size of received and transmitted frames was stored in an uint8_t, which did not allow to process frames larger than 255 octets. However, WiFi has an MTU of 1500 octets. --- cpu/esp32/esp-wifi/esp_wifi_netdev.c | 2 +- cpu/esp32/esp-wifi/esp_wifi_netdev.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu/esp32/esp-wifi/esp_wifi_netdev.c b/cpu/esp32/esp-wifi/esp_wifi_netdev.c index 218e0d0a72..f3b461f82e 100644 --- a/cpu/esp32/esp-wifi/esp_wifi_netdev.c +++ b/cpu/esp32/esp-wifi/esp_wifi_netdev.c @@ -298,7 +298,7 @@ static int _esp_wifi_recv(netdev_t *netdev, void *buf, size_t len, void *info) mutex_lock(&dev->dev_lock); - uint8_t size = dev->rx_len; + uint16_t size = dev->rx_len; if (!buf && !len) { /* return the size without dropping received data */ diff --git a/cpu/esp32/esp-wifi/esp_wifi_netdev.h b/cpu/esp32/esp-wifi/esp_wifi_netdev.h index d478423a16..a0900c54dd 100644 --- a/cpu/esp32/esp-wifi/esp_wifi_netdev.h +++ b/cpu/esp32/esp-wifi/esp_wifi_netdev.h @@ -37,10 +37,10 @@ typedef struct { netdev_t netdev; /**< netdev parent struct */ - uint8_t rx_len; /**< number of bytes received */ + uint16_t rx_len; /**< number of bytes received */ uint8_t rx_buf[ETHERNET_DATA_LEN]; /**< receive buffer */ - uint8_t tx_len; /**< number of bytes in transmit buffer */ + uint16_t tx_len; /**< number of bytes in transmit buffer */ uint8_t tx_buf[ETHERNET_DATA_LEN]; /**< transmit buffer */ uint32_t event; /**< received event */