mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-25 01:37:22 +00:00
esp_netif/lwip: Fix deps cycles to "lwip -> esp_netif -> phy-drivers"
Fix dependency tree so that lwip doesn't depend on any specific network interface component. Network interface drivers shall depend on esp_netif. esp_netif shall depend on lwip (but not on any specific interface driver) -- it optionally depends on vfs and esp_eth (need ethernet header for L2/bridge mode)
This commit is contained in:
79
components/esp_netif/include/lwip/esp_netif_net_stack.h
Normal file
79
components/esp_netif/include/lwip/esp_netif_net_stack.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esp_netif.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "esp_netif_ppp.h"
|
||||
#include "esp_netif_slip.h"
|
||||
|
||||
#if defined(CONFIG_ESP_NETIF_TCPIP_LWIP)
|
||||
|
||||
struct esp_netif_netstack_lwip_vanilla_config {
|
||||
err_t (*init_fn)(struct netif*);
|
||||
void (*input_fn)(void *netif, void *buffer, size_t len, void *eb);
|
||||
};
|
||||
|
||||
struct esp_netif_netstack_lwip_ppp_config {
|
||||
void (*input_fn)(void *netif, void *buffer, size_t len, void *eb);
|
||||
esp_netif_ppp_config_t ppp_events;
|
||||
};
|
||||
|
||||
struct esp_netif_netstack_lwip_slip_config {
|
||||
err_t (*init_fn)(struct netif*);
|
||||
void (*input_fn)(void *netif, void *buffer, size_t len, void *eb);
|
||||
esp_netif_slip_config_t slip_config;
|
||||
};
|
||||
|
||||
// LWIP netif specific network stack configuration
|
||||
struct esp_netif_netstack_config {
|
||||
union {
|
||||
struct esp_netif_netstack_lwip_vanilla_config lwip;
|
||||
struct esp_netif_netstack_lwip_ppp_config lwip_ppp;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief LWIP's network stack init function for Ethernet
|
||||
* @param netif LWIP's network interface handle
|
||||
* @return ERR_OK on success
|
||||
*/
|
||||
err_t ethernetif_init(struct netif *netif);
|
||||
|
||||
/**
|
||||
* @brief LWIP's network stack input packet function for Ethernet
|
||||
* @param h LWIP's network interface handle
|
||||
* @param buffer Input buffer pointer
|
||||
* @param len Input buffer size
|
||||
* @param l2_buff External buffer pointer (to be passed to custom input-buffer free)
|
||||
*/
|
||||
void ethernetif_input(void *h, void *buffer, size_t len, void *l2_buff);
|
||||
|
||||
/**
|
||||
* @brief LWIP's network stack init function for WiFi (AP)
|
||||
* @param netif LWIP's network interface handle
|
||||
* @return ERR_OK on success
|
||||
*/
|
||||
err_t wlanif_init_ap(struct netif *netif);
|
||||
|
||||
/**
|
||||
* @brief LWIP's network stack init function for WiFi (Station)
|
||||
* @param netif LWIP's network interface handle
|
||||
* @return ERR_OK on success
|
||||
*/
|
||||
err_t wlanif_init_sta(struct netif *netif);
|
||||
|
||||
/**
|
||||
* @brief LWIP's network stack input packet function for WiFi (both STA/AP)
|
||||
* @param h LWIP's network interface handle
|
||||
* @param buffer Input buffer pointer
|
||||
* @param len Input buffer size
|
||||
* @param l2_buff External buffer pointer (to be passed to custom input-buffer free)
|
||||
*/
|
||||
void wlanif_input(void *h, void *buffer, size_t len, void* l2_buff);
|
||||
|
||||
#endif // CONFIG_ESP_NETIF_TCPIP_LWIP
|
Reference in New Issue
Block a user