From 33f03fc98c0fe5cd5ce2fc99bbd684fb2d8c790b Mon Sep 17 00:00:00 2001 From: Tiago Medicci Serrano Date: Fri, 4 Aug 2023 17:22:05 -0300 Subject: [PATCH] esp32s3/wlan: Always run `wlan_rxpoll` work queue Even if we were unable to get a free IOB, trigger the work queue to make sure that no old packet is waiting to be handled by the network upper layers. --- arch/xtensa/src/esp32s3/esp32s3_wlan.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/xtensa/src/esp32s3/esp32s3_wlan.c b/arch/xtensa/src/esp32s3/esp32s3_wlan.c index 9a27d1dda94..70f0b7f9dc8 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_wlan.c +++ b/arch/xtensa/src/esp32s3/esp32s3_wlan.c @@ -448,29 +448,23 @@ static int wlan_rx_done(struct wlan_priv_s *priv, void *buffer, goto out; } +out: + if (eb != NULL) { esp_wifi_free_eb(eb); } + if (ret != OK && iob != NULL) + { + iob_free_chain(iob); + } + if (work_available(&priv->rxwork)) { work_queue(WLAN_WORK, &priv->rxwork, wlan_rxpoll, priv, 0); } - return 0; - -out: - if (iob != NULL) - { - iob_free_chain(iob); - } - - if (eb != NULL) - { - esp_wifi_free_eb(eb); - } - wlan_txavail(&priv->dev); return ret;