2021-12-01 03:53:25 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2019-06-28 10:47:34 -04:00
|
|
|
|
|
|
|
#include "esp_netif.h"
|
|
|
|
#include "esp_netif_lwip_internal.h"
|
2019-11-21 07:23:58 -05:00
|
|
|
#include "esp_netif_lwip_ppp.h"
|
2019-06-28 10:47:34 -04:00
|
|
|
|
2022-06-02 10:25:20 -04:00
|
|
|
#if defined(CONFIG_ESP_NETIF_TCPIP_LWIP)
|
2020-09-11 18:37:28 -04:00
|
|
|
|
2019-06-28 10:47:34 -04:00
|
|
|
#include "netif/wlanif.h"
|
|
|
|
#include "netif/ethernetif.h"
|
2022-05-06 10:09:24 -04:00
|
|
|
#include "netif/bridgeif.h"
|
2021-05-18 23:52:51 -04:00
|
|
|
#if CONFIG_OPENTHREAD_ENABLED
|
|
|
|
#include "netif/openthreadif.h"
|
|
|
|
#endif
|
2019-06-28 10:47:34 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// Purpose of this object is to define default network stack configuration
|
|
|
|
// of basic types of interfaces using lwip network stack
|
|
|
|
//
|
|
|
|
|
|
|
|
static const struct esp_netif_netstack_config s_eth_netif_config = {
|
2019-11-21 07:23:58 -05:00
|
|
|
.lwip = {
|
|
|
|
.init_fn = ethernetif_init,
|
|
|
|
.input_fn = ethernetif_input
|
|
|
|
}
|
2019-06-28 10:47:34 -04:00
|
|
|
};
|
2022-05-06 10:09:24 -04:00
|
|
|
static const struct esp_netif_netstack_config s_br_netif_config = {
|
|
|
|
.lwip = {
|
|
|
|
.init_fn = bridgeif_init,
|
|
|
|
.input_fn = NULL
|
|
|
|
}
|
|
|
|
};
|
2019-06-28 10:47:34 -04:00
|
|
|
static const struct esp_netif_netstack_config s_wifi_netif_config_ap = {
|
2019-11-21 07:23:58 -05:00
|
|
|
.lwip = {
|
|
|
|
.init_fn = wlanif_init_ap,
|
|
|
|
.input_fn = wlanif_input
|
|
|
|
}
|
|
|
|
|
2019-06-28 10:47:34 -04:00
|
|
|
};
|
|
|
|
static const struct esp_netif_netstack_config s_wifi_netif_config_sta = {
|
2019-11-21 07:23:58 -05:00
|
|
|
.lwip = {
|
|
|
|
.init_fn = wlanif_init_sta,
|
|
|
|
.input_fn = wlanif_input
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct esp_netif_netstack_config s_netif_config_ppp = {
|
|
|
|
.lwip_ppp = {
|
|
|
|
.input_fn = esp_netif_lwip_ppp_input,
|
|
|
|
.ppp_events = {
|
|
|
|
.ppp_error_event_enabled = true,
|
|
|
|
.ppp_phase_event_enabled = false
|
|
|
|
}
|
|
|
|
}
|
2019-06-28 10:47:34 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_eth = &s_eth_netif_config;
|
2022-05-06 10:09:24 -04:00
|
|
|
const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_br = &s_br_netif_config;
|
2019-06-28 10:47:34 -04:00
|
|
|
const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_sta = &s_wifi_netif_config_sta;
|
2019-11-21 07:23:58 -05:00
|
|
|
const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_ap = &s_wifi_netif_config_ap;
|
2020-05-21 01:55:56 -04:00
|
|
|
const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_ppp = &s_netif_config_ppp;
|
2020-09-11 18:37:28 -04:00
|
|
|
|
2021-05-18 23:52:51 -04:00
|
|
|
#if CONFIG_OPENTHREAD_ENABLED
|
|
|
|
static const struct esp_netif_netstack_config s_netif_config_openthread = {
|
|
|
|
.lwip = {
|
|
|
|
.init_fn = openthread_netif_init,
|
|
|
|
.input_fn = openthread_netif_input,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_openthread = &s_netif_config_openthread;
|
|
|
|
#endif // CONFIG_OPENTHREAD_ENABLED
|
|
|
|
|
2020-09-11 18:37:28 -04:00
|
|
|
#endif /*CONFIG_ESP_NETIF_TCPIP_LWIP*/
|