esp_netif: remove dependency of L2 TAP Interface from netif_lwip

esp_eth: extended infrastructure to optionally provide more advanced access to MAC/PHY layers
This commit is contained in:
Ondrej Kosta
2021-12-01 09:53:25 +01:00
parent faed2a44aa
commit 4051b80b4d
20 changed files with 537 additions and 562 deletions

View File

@@ -10,6 +10,9 @@
#include "esp_event.h"
#include "esp_log.h"
#include "esp_check.h"
#if CONFIG_ESP_NETIF_L2_TAP
#include "esp_vfs_l2tap.h"
#endif
const static char *TAG = "esp_eth.netif.netif_glue";
@@ -27,6 +30,13 @@ struct esp_eth_netif_glue_t {
static esp_err_t eth_input_to_netif(esp_eth_handle_t eth_handle, uint8_t *buffer, uint32_t length, void *priv)
{
#if CONFIG_ESP_NETIF_L2_TAP
esp_err_t ret = ESP_OK;
ret = esp_vfs_l2tap_eth_filter(eth_handle, buffer, (size_t *)&length);
if (length == 0) {
return ret;
}
#endif
return esp_netif_receive((esp_netif_t *)priv, buffer, length, NULL);
}