From 2c04f54d28ca89ca1e87c755810656592b329dbd Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 24 Apr 2020 13:21:21 +0200 Subject: [PATCH] gnrc/rpl: Move GNRC_RPL_DEFAULT_NETIF to 'CONFIG_' namespace --- sys/include/net/gnrc/rpl.h | 12 ++++++------ sys/net/gnrc/routing/rpl/gnrc_rpl_auto_init.c | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/include/net/gnrc/rpl.h b/sys/include/net/gnrc/rpl.h index f3978e8752..56fbc19294 100644 --- a/sys/include/net/gnrc/rpl.h +++ b/sys/include/net/gnrc/rpl.h @@ -37,9 +37,9 @@ * * If the application defines several interfaces (@ref gnrc_netif_highlander() * returns false), then RPL will be initialized on the interface - * `GNRC_RPL_DEFAULT_NETIF`. - * Your application is responsible for setting `GNRC_RPL_DEFAULT_NETIF` to a - * valid interface PID, e.g. via `CFLAGS`. + * `CONFIG_GNRC_RPL_DEFAULT_NETIF`. + * Your application is responsible for setting `CONFIG_GNRC_RPL_DEFAULT_NETIF` + * to a valid interface PID, e.g. via `CFLAGS` or menuconfig. * * Initializing RPL on multiple interfaces automatically is currently not supported. * Call `gnrc_rpl_init()` manually from your application for the desired interfaces in this case. @@ -72,7 +72,7 @@ * - Set interface for auto-initialization if more than one * interface exists (@ref gnrc_netif_highlander() returns false) * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.mk} - * CFLAGS += -DGNRC_RPL_DEFAULT_NETIF=6 + * CFLAGS += -DCONFIG_GNRC_RPL_DEFAULT_NETIF=6 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * - By default, all incoming control messages get checked for validation. @@ -503,8 +503,8 @@ extern netstats_rpl_t gnrc_rpl_netstats; /** * @brief Default network interface for GNRC RPL */ -#ifndef GNRC_RPL_DEFAULT_NETIF -#define GNRC_RPL_DEFAULT_NETIF (KERNEL_PID_UNDEF) +#ifndef CONFIG_GNRC_RPL_DEFAULT_NETIF +#define CONFIG_GNRC_RPL_DEFAULT_NETIF (KERNEL_PID_UNDEF) #endif /** diff --git a/sys/net/gnrc/routing/rpl/gnrc_rpl_auto_init.c b/sys/net/gnrc/routing/rpl/gnrc_rpl_auto_init.c index a1bfd2ac2c..e88ef84061 100644 --- a/sys/net/gnrc/routing/rpl/gnrc_rpl_auto_init.c +++ b/sys/net/gnrc/routing/rpl/gnrc_rpl_auto_init.c @@ -41,24 +41,24 @@ void auto_init_gnrc_rpl(void) gnrc_rpl_init(netif->pid); return; } - else if (GNRC_RPL_DEFAULT_NETIF != KERNEL_PID_UNDEF) { - if (gnrc_netif_get_by_pid(GNRC_RPL_DEFAULT_NETIF) != NULL) { + else if (CONFIG_GNRC_RPL_DEFAULT_NETIF != KERNEL_PID_UNDEF) { + if (gnrc_netif_get_by_pid(CONFIG_GNRC_RPL_DEFAULT_NETIF) != NULL) { DEBUG("auto_init_gnrc_rpl: initializing RPL on interface %" PRIkernel_pid "\n", - (kernel_pid_t) GNRC_RPL_DEFAULT_NETIF); - gnrc_rpl_init(GNRC_RPL_DEFAULT_NETIF); + (kernel_pid_t) CONFIG_GNRC_RPL_DEFAULT_NETIF); + gnrc_rpl_init(CONFIG_GNRC_RPL_DEFAULT_NETIF); return; } /* XXX this is just a work-around ideally this would happen with - * an `up` event of the GNRC_RPL_DEFAULT_NETIF */ + * an `up` event of the CONFIG_GNRC_RPL_DEFAULT_NETIF */ DEBUG("auto_init_gnrc_rpl: could not initialize RPL on interface %" PRIkernel_pid" - " - "interface does not exist\n", (kernel_pid_t) GNRC_RPL_DEFAULT_NETIF); + "interface does not exist\n", (kernel_pid_t) CONFIG_GNRC_RPL_DEFAULT_NETIF); return; } else { /* XXX this is just a work-around ideally this should be defined in some * run-time interface configuration */ DEBUG("auto_init_gnrc_rpl: please specify an interface " - "by setting GNRC_RPL_DEFAULT_NETIF\n"); + "by setting CONFIG_GNRC_RPL_DEFAULT_NETIF\n"); } } #else