Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/lwip: Move nrf802154 to netif auto init
- Loading branch information
Showing
3 changed files
with
48 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) 2021 Inria | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @ingroup sys_auto_init_lwip_netif | ||
* @{ | ||
* | ||
* @file | ||
* @brief Auto initialization for NRF802154 network interfaces | ||
* | ||
* @author Alexandre Abadie <alexandre.abadie@inria.fr> | ||
* @author Erik Ekman <eekman@google.com> | ||
*/ | ||
|
||
#include "nrf802154.h" | ||
#include "net/netdev/ieee802154_submac.h" | ||
|
||
#include "lwip_init_devs.h" | ||
|
||
#define ENABLE_DEBUG 0 | ||
#include "debug.h" | ||
|
||
static struct netif netif; | ||
static netdev_ieee802154_submac_t nrf802154_netdev; | ||
|
||
void auto_init_nrf802154(void) | ||
{ | ||
netdev_register(&nrf802154_netdev.dev.netdev, NETDEV_NRF802154, 0); | ||
netdev_ieee802154_submac_init(&nrf802154_netdev); | ||
|
||
nrf802154_hal_setup(&nrf802154_netdev.submac.dev); | ||
nrf802154_init(); | ||
if (lwip_add_6lowpan(&netif, &nrf802154_netdev.dev.netdev) == NULL) { | ||
DEBUG("Could not add nrf802154 device\n"); | ||
return; | ||
} | ||
} | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters