From d568a6dba197d94149aa3a89c0c24a806d7b3950 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Sat, 3 Sep 2022 14:11:06 +0200 Subject: [PATCH] Revert "esp32/eth: Don't overwrite queued event with RX packet" This reverts commit 95196fb7e40b12c7824e9827aadcc2ace35016a5. Not needed since the initial event is now processed properly. --- cpu/esp32/esp-eth/esp_eth_netdev.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/cpu/esp32/esp-eth/esp_eth_netdev.c b/cpu/esp32/esp-eth/esp_eth_netdev.c index 86920fa0fa..f874652f50 100644 --- a/cpu/esp32/esp-eth/esp_eth_netdev.c +++ b/cpu/esp32/esp-eth/esp_eth_netdev.c @@ -100,19 +100,14 @@ static esp_err_t IRAM_ATTR _eth_input_callback(esp_eth_handle_t hdl, mutex_lock(&_esp_eth_dev.dev_lock); - /* Don't overwrite other events, drop packet instead. - * Keep the latest received packet if previous has not been read. */ - if (_esp_eth_dev.event == SYSTEM_EVENT_MAX || - _esp_eth_dev.event == SYSTEM_EVENT_ETH_RX_DONE) { - memcpy(_esp_eth_dev.rx_buf, buffer, len); - /* buffer is allocated by the `emac_esp32_rx_task` upon receipt of a - * MAC frame and is forwarded to the consumer who responsible for - * freeing the buffer. */ - free(buffer); - _esp_eth_dev.rx_len = len; - _esp_eth_dev.event = SYSTEM_EVENT_ETH_RX_DONE; - netdev_trigger_event_isr(&_esp_eth_dev.netdev); - } + memcpy(_esp_eth_dev.rx_buf, buffer, len); + /* buffer is allocated by the `emac_esp32_rx_task` upon receipt of a + * MAC frame and is forwarded to the consumer who responsible for + * freeing the buffer. */ + free(buffer); + _esp_eth_dev.rx_len = len; + _esp_eth_dev.event = SYSTEM_EVENT_ETH_RX_DONE; + netdev_trigger_event_isr(&_esp_eth_dev.netdev); mutex_unlock(&_esp_eth_dev.dev_lock);