From d488fdc1e3ee5333e69b313be566a77a48d0f3c4 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Thu, 18 May 2017 17:11:39 +0200 Subject: [PATCH] sys/drivers: guard l2filter.h, netstats.h includes --- drivers/encx24j600/encx24j600.c | 8 ++++---- drivers/include/net/netdev.h | 9 +++++++-- sys/include/net/gnrc/ipv6/netif.h | 7 ++++++- sys/shell/commands/sc_netif.c | 9 +++++++-- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/encx24j600/encx24j600.c b/drivers/encx24j600/encx24j600.c index 378d8c3d44..104c8f6aa3 100644 --- a/drivers/encx24j600/encx24j600.c +++ b/drivers/encx24j600/encx24j600.c @@ -22,10 +22,6 @@ #include #include -#ifdef MODULE_NETSTATS_L2 -#include -#endif - #include "mutex.h" #include "encx24j600.h" #include "encx24j600_internal.h" @@ -36,7 +32,11 @@ #include "net/netdev/eth.h" #include "net/eui64.h" #include "net/ethernet.h" + +#ifdef MODULE_NETSTATS_L2 +#include #include "net/netstats.h" +#endif #define ENABLE_DEBUG (0) #include "debug.h" diff --git a/drivers/include/net/netdev.h b/drivers/include/net/netdev.h index b512df9ee8..57ac3178d0 100644 --- a/drivers/include/net/netdev.h +++ b/drivers/include/net/netdev.h @@ -53,10 +53,15 @@ extern "C" { #include #include -#include "net/netstats.h" -#include "net/l2filter.h" #include "net/netopt.h" +#ifdef MODULE_NETSTATS_L2 +#include "net/netstats.h" +#endif +#ifdef MODULE_L2FILTER +#include "net/l2filter.h" +#endif + enum { NETDEV_TYPE_UNKNOWN, NETDEV_TYPE_RAW, diff --git a/sys/include/net/gnrc/ipv6/netif.h b/sys/include/net/gnrc/ipv6/netif.h index 7e513dfa3d..15357c4cbf 100644 --- a/sys/include/net/gnrc/ipv6/netif.h +++ b/sys/include/net/gnrc/ipv6/netif.h @@ -30,9 +30,12 @@ #include "mutex.h" #include "net/ipv6.h" #include "net/ipv6/addr.h" -#include "net/netstats.h" #include "xtimer.h" +#ifdef MODULE_NETSTATS_IPV6 +#include "net/netstats.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -605,7 +608,9 @@ void gnrc_ipv6_netif_init_by_dev(void); * @return A @ref netstats_t pointer to the statistics. * @return NULL if no statistics are available. */ +#if defined(MODULE_NETSTATS_IPV6) || DOXYGEN netstats_t *gnrc_ipv6_netif_get_stats(kernel_pid_t pid); +#endif #ifdef __cplusplus } diff --git a/sys/shell/commands/sc_netif.c b/sys/shell/commands/sc_netif.c index 64fc8657b9..8c4f572869 100644 --- a/sys/shell/commands/sc_netif.c +++ b/sys/shell/commands/sc_netif.c @@ -26,8 +26,6 @@ #include #include "thread.h" -#include "net/netstats.h" -#include "net/l2filter.h" #include "net/ipv6/addr.h" #include "net/gnrc/ipv6/netif.h" #include "net/gnrc/netif.h" @@ -38,6 +36,13 @@ #include "net/gnrc/netif/hdr.h" #include "net/gnrc/sixlowpan/netif.h" +#ifdef MODULE_NETSTATS +#include "net/netstats.h" +#endif +#ifdef MODULE_L2FILTER +#include "net/l2filter.h" +#endif + /** * @brief The maximal expected link layer address length in byte */