mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
lwip: Adapted lwip port layer to use 2.1.2-esp in 4.0
This commit is contained in:
Submodule components/lwip/lwip updated: f2bd195eed...c483f30ba2
@@ -61,7 +61,7 @@
|
|||||||
* @param buf memory alloc in L2 layer
|
* @param buf memory alloc in L2 layer
|
||||||
* @note this function is also the callback when invoke pbuf_free
|
* @note this function is also the callback when invoke pbuf_free
|
||||||
*/
|
*/
|
||||||
static void ethernet_free_rx_buf_l2(void *buf)
|
static void ethernet_free_rx_buf_l2(struct netif *netif, void *buf)
|
||||||
{
|
{
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ void ethernetif_input(struct netif *netif, void *buffer, uint16_t len)
|
|||||||
|
|
||||||
if (buffer == NULL || !netif_is_up(netif)) {
|
if (buffer == NULL || !netif_is_up(netif)) {
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
ethernet_free_rx_buf_l2(buffer);
|
ethernet_free_rx_buf_l2(netif, buffer);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ void ethernetif_input(struct netif *netif, void *buffer, uint16_t len)
|
|||||||
/* acquire new pbuf, type: PBUF_REF */
|
/* acquire new pbuf, type: PBUF_REF */
|
||||||
p = pbuf_alloc(PBUF_RAW, len, PBUF_REF);
|
p = pbuf_alloc(PBUF_RAW, len, PBUF_REF);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
ethernet_free_rx_buf_l2(buffer);
|
ethernet_free_rx_buf_l2(netif, buffer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p->payload = buffer;
|
p->payload = buffer;
|
||||||
|
@@ -52,6 +52,18 @@
|
|||||||
|
|
||||||
#include "tcpip_adapter.h"
|
#include "tcpip_adapter.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Free resources allocated in L2 layer
|
||||||
|
*
|
||||||
|
* This function translates the free_tx_buf to the prototype used on 2.1.2-esp branch
|
||||||
|
*
|
||||||
|
* @param buf memory alloc in L2 layer
|
||||||
|
* @note this function is also the callback when invoke pbuf_free
|
||||||
|
*/
|
||||||
|
static void wlanif_free_rx_buf_l2(struct netif *netif, void *buf)
|
||||||
|
{
|
||||||
|
esp_wifi_internal_free_rx_buffer(buf);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In this function, the hardware should be initialized.
|
* In this function, the hardware should be initialized.
|
||||||
@@ -82,7 +94,7 @@ low_level_init(struct netif *netif)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !ESP_L2_TO_L3_COPY
|
#if !ESP_L2_TO_L3_COPY
|
||||||
netif->l2_buffer_free_notify = esp_wifi_internal_free_rx_buffer;
|
netif->l2_buffer_free_notify = wlanif_free_rx_buf_l2;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user