Merge pull request #12895 from wosym/lwip_stm32

pkg/lwip: add STM32 support
This commit is contained in:
benpicco 2019-12-06 19:10:12 +01:00 committed by GitHub
commit 43290f66e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,10 @@
#include "esp-wifi/esp_wifi_netdev.h"
#endif
#ifdef MODULE_STM32_ETH
#include "stm32_eth.h"
#endif
#include "lwip.h"
#define ENABLE_DEBUG (0)
@ -67,6 +71,10 @@
#define LWIP_NETIF_NUMOF (1)
#endif
#ifdef MODULE_STM32_ETH
#define LWIP_NETIF_NUMOF (1)
#endif
#ifdef LWIP_NETIF_NUMOF
static struct netif netif[LWIP_NETIF_NUMOF];
#endif
@ -92,6 +100,11 @@ extern esp_wifi_netdev_t _esp_wifi_dev;
extern void esp_wifi_setup (esp_wifi_netdev_t* dev);
#endif
#ifdef MODULE_STM32_ETH
static netdev_t stm32_eth;
extern void stm32_eth_netdev_setup(netdev_t *netdev);
#endif
void lwip_bootstrap(void)
{
/* TODO: do for every eligible netdev */
@ -139,6 +152,13 @@ void lwip_bootstrap(void)
DEBUG("Could not add esp_wifi device\n");
return;
}
#elif defined(MODULE_STM32_ETH)
stm32_eth_netdev_setup(&stm32_eth);
if (netif_add(&netif[0], &stm32_eth, lwip_netdev_init,
tcpip_input) == NULL) {
DEBUG("Could not add stm32_eth device\n");
return;
}
#endif
if (netif[0].state != NULL) {
/* state is set to a netdev_t in the netif_add() functions above */