diff --git a/sys/include/net/gnrc/pktdump.h b/sys/include/net/gnrc/pktdump.h index e891a41bd8..4448dbee06 100644 --- a/sys/include/net/gnrc/pktdump.h +++ b/sys/include/net/gnrc/pktdump.h @@ -33,13 +33,25 @@ extern "C" { * @ingroup net_gnrc_conf * @{ */ +/** + * @brief Default message queue size for the PKTDUMP thread (as exponent of + * 2^n). + * + * As the queue size ALWAYS needs to be power of two, this option + * represents the exponent of 2^n, which will be used as the size of + * the queue. + */ +#ifndef CONFIG_GNRC_PKTDUMP_MSG_QUEUE_SIZE_EXP +#define CONFIG_GNRC_PKTDUMP_MSG_QUEUE_SIZE_EXP 3 +#endif +/** @} */ + /** * @brief Message queue size for the pktdump thread */ #ifndef GNRC_PKTDUMP_MSG_QUEUE_SIZE -#define GNRC_PKTDUMP_MSG_QUEUE_SIZE (8U) +#define GNRC_PKTDUMP_MSG_QUEUE_SIZE (1 << CONFIG_GNRC_PKTDUMP_MSG_QUEUE_SIZE_EXP) #endif -/** @} */ /** * @brief Priority of the pktdump thread diff --git a/sys/net/gnrc/Kconfig b/sys/net/gnrc/Kconfig index 776607ac57..34d4981597 100644 --- a/sys/net/gnrc/Kconfig +++ b/sys/net/gnrc/Kconfig @@ -12,6 +12,7 @@ rsource "link_layer/lorawan/Kconfig" rsource "netif/Kconfig" rsource "network_layer/ipv6/Kconfig" rsource "network_layer/sixlowpan/Kconfig" +rsource "pktdump/Kconfig" rsource "routing/rpl/Kconfig" rsource "transport_layer/tcp/Kconfig" diff --git a/sys/net/gnrc/pktdump/Kconfig b/sys/net/gnrc/pktdump/Kconfig new file mode 100644 index 0000000000..9086ea3354 --- /dev/null +++ b/sys/net/gnrc/pktdump/Kconfig @@ -0,0 +1,23 @@ +# Copyright (c) 2020 Freie Universitaet Berlin +# +# 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. +# +menuconfig KCONFIG_MODULE_GNRC_PKTDUMP + bool "Configure GNRC Packet Dump" + depends on MODULE_GNRC_PKTDUMP + help + Configure the GNRC_PKTDUMP using Kconfig. + +if KCONFIG_MODULE_GNRC_PKTDUMP + +config GNRC_PKTDUMP_MSG_QUEUE_SIZE_EXP + int "Exponent for the queue size (resulting in the queue size 2^n)" + default 3 + help + As the queue size ALWAYS needs to be power of two, this option + represents the exponent of 2^n, which will be used as the size of + the queue. + +endif # KCONFIG_MODULE_GNRC_PKTDUMP