Merge pull request #12895 from wosym/lwip_stm32
pkg/lwip: add STM32 support
This commit is contained in:
commit
43290f66e6
@ -42,6 +42,10 @@
|
|||||||
#include "esp-wifi/esp_wifi_netdev.h"
|
#include "esp-wifi/esp_wifi_netdev.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODULE_STM32_ETH
|
||||||
|
#include "stm32_eth.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "lwip.h"
|
#include "lwip.h"
|
||||||
|
|
||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
@ -67,6 +71,10 @@
|
|||||||
#define LWIP_NETIF_NUMOF (1)
|
#define LWIP_NETIF_NUMOF (1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODULE_STM32_ETH
|
||||||
|
#define LWIP_NETIF_NUMOF (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef LWIP_NETIF_NUMOF
|
#ifdef LWIP_NETIF_NUMOF
|
||||||
static struct netif netif[LWIP_NETIF_NUMOF];
|
static struct netif netif[LWIP_NETIF_NUMOF];
|
||||||
#endif
|
#endif
|
||||||
@ -92,6 +100,11 @@ extern esp_wifi_netdev_t _esp_wifi_dev;
|
|||||||
extern void esp_wifi_setup (esp_wifi_netdev_t* dev);
|
extern void esp_wifi_setup (esp_wifi_netdev_t* dev);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODULE_STM32_ETH
|
||||||
|
static netdev_t stm32_eth;
|
||||||
|
extern void stm32_eth_netdev_setup(netdev_t *netdev);
|
||||||
|
#endif
|
||||||
|
|
||||||
void lwip_bootstrap(void)
|
void lwip_bootstrap(void)
|
||||||
{
|
{
|
||||||
/* TODO: do for every eligible netdev */
|
/* TODO: do for every eligible netdev */
|
||||||
@ -139,6 +152,13 @@ void lwip_bootstrap(void)
|
|||||||
DEBUG("Could not add esp_wifi device\n");
|
DEBUG("Could not add esp_wifi device\n");
|
||||||
return;
|
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
|
#endif
|
||||||
if (netif[0].state != NULL) {
|
if (netif[0].state != NULL) {
|
||||||
/* state is set to a netdev_t in the netif_add() functions above */
|
/* state is set to a netdev_t in the netif_add() functions above */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user