1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

pkg/lwip: provide socket_zep support

This brings 802.15.4 support for native to lwIP. I used this to find
[this bug][1] and thought it might also be useful upstream. Downside:
There is no automated test for it yet.

[1]: https://savannah.nongnu.org/bugs/?54749
This commit is contained in:
Martine Lenders 2018-10-05 10:39:38 +02:00
parent 6bfd3338b9
commit 0abd89e7e6

View File

@ -33,6 +33,11 @@
#include "mrf24j40_params.h"
#endif
#ifdef MODULE_SOCKET_ZEP
#include "socket_zep.h"
#include "socket_zep_params.h"
#endif
#include "lwip.h"
#define ENABLE_DEBUG (0)
@ -50,6 +55,10 @@
#define LWIP_NETIF_NUMOF (sizeof(mrf24j40_params) / sizeof(mrf24j40_params[0]))
#endif
#ifdef MODULE_SOCKET_ZEP /* is mutual exclusive with above ifdef */
#define LWIP_NETIF_NUMOF (sizeof(socket_zep_params) / sizeof(socket_zep_params[0]))
#endif
#ifdef LWIP_NETIF_NUMOF
static struct netif netif[LWIP_NETIF_NUMOF];
#endif
@ -66,6 +75,10 @@ static at86rf2xx_t at86rf2xx_devs[LWIP_NETIF_NUMOF];
static mrf24j40_t mrf24j40_devs[LWIP_NETIF_NUMOF];
#endif
#ifdef MODULE_SOCKET_ZEP
static socket_zep_t socket_zep_devs[LWIP_NETIF_NUMOF];
#endif
void lwip_bootstrap(void)
{
/* TODO: do for every eligable netdev */
@ -97,6 +110,15 @@ void lwip_bootstrap(void)
return;
}
}
#elif defined(MODULE_SOCKET_ZEP)
for (unsigned i = 0; i < LWIP_NETIF_NUMOF; i++) {
socket_zep_setup(&socket_zep_devs[i], &socket_zep_params[i]);
if (netif_add(&netif[i], &socket_zep_devs[i], lwip_netdev_init,
tcpip_6lowpan_input) == NULL) {
DEBUG("Could not add socket_zep device\n");
return;
}
}
#endif
if (netif[0].state != NULL) {
/* state is set to a netdev_t in the netif_add() functions above */