sys/net: add sam0 eth auto init
This commit is contained in:
parent
3937aff923
commit
5b7961b747
41
sys/net/gnrc/netif/init_devs/auto_init_sam0_eth.c
Normal file
41
sys/net/gnrc/netif/init_devs/auto_init_sam0_eth.c
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Mesotic SAS
|
||||||
|
*
|
||||||
|
* 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_gnrc_netif
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @brief Auto initialize sam0 ethernet driver
|
||||||
|
*
|
||||||
|
* @author Dylan Laduranty <dylan.laduranty@mesotic.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef MODULE_SAM0_ETH
|
||||||
|
|
||||||
|
#include "net/gnrc/netif/ethernet.h"
|
||||||
|
#include "sam0_eth_netdev.h"
|
||||||
|
|
||||||
|
static netdev_t sam0eth;
|
||||||
|
static char stack[THREAD_STACKSIZE_DEFAULT];
|
||||||
|
static gnrc_netif_t _netif;
|
||||||
|
|
||||||
|
extern void sam0_eth_setup(netdev_t *netdev);
|
||||||
|
|
||||||
|
void auto_init_sam0_eth(void)
|
||||||
|
{
|
||||||
|
/* setup netdev device */
|
||||||
|
sam0_eth_setup(&sam0eth);
|
||||||
|
/* initialize netdev <-> gnrc adapter state */
|
||||||
|
gnrc_netif_ethernet_create(&_netif, stack, THREAD_STACKSIZE_DEFAULT,
|
||||||
|
GNRC_NETIF_PRIO, "sam0_eth", &sam0eth);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
typedef int dont_be_pedantic;
|
||||||
|
#endif /* MODULE_SAM0_ETH */
|
||||||
|
/** @} */
|
||||||
@ -99,6 +99,11 @@ void gnrc_netif_init_devs(void)
|
|||||||
auto_init_dose();
|
auto_init_dose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_USED(MODULE_SAM0_ETH)) {
|
||||||
|
extern void auto_init_sam0_eth(void);
|
||||||
|
auto_init_sam0_eth();
|
||||||
|
}
|
||||||
|
|
||||||
if (IS_USED(MODULE_SLIPDEV)) {
|
if (IS_USED(MODULE_SLIPDEV)) {
|
||||||
extern void auto_init_slipdev(void);
|
extern void auto_init_slipdev(void);
|
||||||
auto_init_slipdev();
|
auto_init_slipdev();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user