diff --git a/sys/net/gnrc/netif/init_devs/auto_init_at86rf215.c b/sys/net/gnrc/netif/init_devs/auto_init_at86rf215.c index 277507941ffd6..8dcf88859266a 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_at86rf215.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_at86rf215.c @@ -29,6 +29,7 @@ #include "net/gnrc/gomach/gomach.h" #endif #include "net/gnrc.h" +#include "include/init_devs.h" #include "at86rf215.h" #include "at86rf215_params.h" @@ -37,7 +38,7 @@ * @brief Define stack parameters for the MAC layer thread * @{ */ -#define AT86RF215_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT) +#define AT86RF215_MAC_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT) #ifndef AT86RF215_MAC_PRIO #define AT86RF215_MAC_PRIO (GNRC_NETIF_PRIO) #endif diff --git a/sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c b/sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c index a108a5683830e..73985392149ce 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_at86rf2xx.c @@ -27,6 +27,7 @@ #include "net/gnrc/gomach/gomach.h" #endif #include "net/gnrc.h" +#include "include/init_devs.h" #include "at86rf2xx.h" #include "at86rf2xx_params.h" @@ -35,7 +36,7 @@ * @brief Define stack parameters for the MAC layer thread * @{ */ -#define AT86RF2XX_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT) +#define AT86RF2XX_MAC_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT) #ifndef AT86RF2XX_MAC_PRIO #define AT86RF2XX_MAC_PRIO (GNRC_NETIF_PRIO) #endif diff --git a/sys/net/gnrc/netif/init_devs/auto_init_cc2420.c b/sys/net/gnrc/netif/init_devs/auto_init_cc2420.c index 829e13e97ea14..49b94e008afef 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_cc2420.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_cc2420.c @@ -23,6 +23,7 @@ #include "board.h" #include "net/gnrc/netif/ieee802154.h" #include "net/gnrc.h" +#include "include/init_devs.h" #include "cc2420.h" #include "cc2420_params.h" @@ -31,7 +32,7 @@ * @brief MAC layer stack parameters * @{ */ -#define CC2420_MAC_STACKSIZE (THREAD_STACKSIZE_MAIN) +#define CC2420_MAC_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT) #ifndef CC2420_MAC_PRIO #define CC2420_MAC_PRIO (GNRC_NETIF_PRIO) #endif diff --git a/sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c b/sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c index 302cda7e242e9..eec5a5d539107 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_cc2538_rf.c @@ -19,6 +19,7 @@ #include "log.h" #include "net/gnrc/netif/ieee802154.h" +#include "include/init_devs.h" #include "cc2538_rf.h" @@ -26,7 +27,7 @@ * @brief Define stack parameters for the MAC layer thread * @{ */ -#define CC2538_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT) +#define CC2538_MAC_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT) #ifndef CC2538_MAC_PRIO #define CC2538_MAC_PRIO (GNRC_NETIF_PRIO) #endif diff --git a/sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c b/sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c index cd3818e08603b..8ec90ef180b21 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_kw2xrf.c @@ -24,6 +24,7 @@ #include "board.h" #include "net/gnrc/netif/ieee802154.h" #include "net/gnrc.h" +#include "include/init_devs.h" #include "kw2xrf.h" #include "kw2xrf_params.h" @@ -32,7 +33,7 @@ * @brief Define stack parameters for the MAC layer thread * @{ */ -#define KW2XRF_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT) +#define KW2XRF_MAC_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT) #ifndef KW2XRF_MAC_PRIO #define KW2XRF_MAC_PRIO (GNRC_NETIF_PRIO) #endif diff --git a/sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c b/sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c index b9062a6c0bd83..b3966f352ceb1 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_kw41zrf.c @@ -22,6 +22,7 @@ #include "board.h" #include "net/gnrc.h" #include "net/gnrc/netif/ieee802154.h" +#include "include/init_devs.h" #ifdef MODULE_GNRC_LWMAC #include "net/gnrc/lwmac/lwmac.h" @@ -37,7 +38,7 @@ * @{ */ #ifndef KW41ZRF_NETIF_STACKSIZE -#define KW41ZRF_NETIF_STACKSIZE (THREAD_STACKSIZE_DEFAULT) +#define KW41ZRF_NETIF_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT) #endif #ifndef KW41ZRF_NETIF_PRIO #define KW41ZRF_NETIF_PRIO (GNRC_NETIF_PRIO) diff --git a/sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c b/sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c index f9f943b0d4fc1..00d9ea921a238 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_mrf24j40.c @@ -21,6 +21,7 @@ #include "board.h" #include "net/gnrc/netif/ieee802154.h" #include "net/gnrc.h" +#include "include/init_devs.h" #include "mrf24j40.h" #include "mrf24j40_params.h" @@ -29,7 +30,7 @@ * @brief Define stack parameters for the MAC layer thread * @{ */ -#define MRF24J40_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT) +#define MRF24J40_MAC_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT) #ifndef MRF24J40_MAC_PRIO #define MRF24J40_MAC_PRIO (GNRC_NETIF_PRIO) #endif diff --git a/sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c b/sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c index 8d49a977b25fc..1657f825e6a3a 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_nrf802154.c @@ -21,13 +21,14 @@ #include "board.h" #include "nrf802154.h" #include "net/gnrc/netif/ieee802154.h" +#include "include/init_devs.h" /** * @brief Define stack parameters for the MAC layer thread * @{ */ #ifndef NRF802154_MAC_STACKSIZE -#define NRF802154_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT) +#define NRF802154_MAC_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT) #endif #ifndef NRF802154_MAC_PRIO #define NRF802154_MAC_PRIO (GNRC_NETIF_PRIO) diff --git a/sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c b/sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c index 3218643d8bfb6..b509bb0bdbcaf 100644 --- a/sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c +++ b/sys/net/gnrc/netif/init_devs/auto_init_socket_zep.c @@ -21,6 +21,7 @@ #include "socket_zep.h" #include "socket_zep_params.h" #include "net/gnrc/netif/ieee802154.h" +#include "include/init_devs.h" #define ENABLE_DEBUG 0 #include "debug.h" @@ -28,7 +29,7 @@ /** * @brief Define stack parameters for the MAC layer thread */ -#define SOCKET_ZEP_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE) +#define SOCKET_ZEP_MAC_STACKSIZE (IEEE802154_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE) #ifndef SOCKET_ZEP_MAC_PRIO #define SOCKET_ZEP_MAC_PRIO (GNRC_NETIF_PRIO) #endif diff --git a/sys/net/gnrc/netif/init_devs/include/init_devs.h b/sys/net/gnrc/netif/init_devs/include/init_devs.h new file mode 100644 index 0000000000000..41cd2eb3dc756 --- /dev/null +++ b/sys/net/gnrc/netif/init_devs/include/init_devs.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2020 Otto-von-Guericke-Universität Magdeburg + * + * 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 + * @{ + * + * @file + * @brief common netif device initialization definitions + * + * @author Fabian Hüßler + */ + +#ifndef INIT_DEVS_H +#define INIT_DEVS_H + +#include "thread.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief extra stack size if ieee802154 security is enabled + * + * You may increase this value if you experience a stack overflow + * with IEEE 802.15.4 security enabled. + */ +#define IEEE802154_SECURITY_EXTRA_STACKSIZE (128) + +#ifndef IEEE802154_STACKSIZE_DEFAULT +#ifdef MODULE_IEEE802154_SECURITY +#define IEEE802154_STACKSIZE_DEFAULT (THREAD_STACKSIZE_DEFAULT + \ + IEEE802154_SECURITY_EXTRA_STACKSIZE) +#else +/** + * @brief stack size of an ieee802154 device + */ +#define IEEE802154_STACKSIZE_DEFAULT (THREAD_STACKSIZE_DEFAULT) +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* INIT_DEVS_H */ +/** @} */