diff --git a/Makefile.dep b/Makefile.dep index afd530ae2a..966e8f8cba 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -274,6 +274,9 @@ ifneq (,$(filter gnrc_sixlowpan,$(USEMODULE))) DEFAULT_MODULE += auto_init_gnrc_sixlowpan USEMODULE += gnrc_nettype_sixlowpan USEMODULE += sixlowpan + ifneq (,$(filter gnrc_netif,$(USEMODULE))) + USEMODULE += gnrc_netif_6lo + endif endif ifneq (,$(filter gnrc_sixlowpan_ctx,$(USEMODULE))) diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 1a8ea706ff..773de0f675 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -33,6 +33,7 @@ PSEUDOMODULES += gnrc_netapi_callbacks PSEUDOMODULES += gnrc_netapi_mbox PSEUDOMODULES += gnrc_netif_events PSEUDOMODULES += gnrc_pktbuf_cmd +PSEUDOMODULES += gnrc_netif_6lo PSEUDOMODULES += gnrc_netif_cmd_% PSEUDOMODULES += gnrc_netif_dedup PSEUDOMODULES += gnrc_nettype_% diff --git a/pkg/nimble/netif/nimble_netif.c b/pkg/nimble/netif/nimble_netif.c index bf35a6b62d..e40cdc7d44 100644 --- a/pkg/nimble/netif/nimble_netif.c +++ b/pkg/nimble/netif/nimble_netif.c @@ -94,11 +94,11 @@ static void _netif_init(gnrc_netif_t *netif) /* save the threads context pointer, so we can set its flags */ _netif_thread = (thread_t *)thread_get(thread_getpid()); -#ifdef MODULE_GNRC_SIXLOWPAN +#if IS_USED(MODULE_GNRC_NETIF_6LO) /* we disable fragmentation for this device, as the L2CAP layer takes care * of this */ _nimble_netif->sixlo.max_frag_size = 0; -#endif +#endif /* IS_USED(MODULE_GNRC_NETIF_6LO) */ } static int _send_pkt(nimble_netif_conn_t *conn, gnrc_pktsnip_t *pkt) diff --git a/sys/include/net/gnrc/netif.h b/sys/include/net/gnrc/netif.h index d080f7ea58..d4968d8108 100644 --- a/sys/include/net/gnrc/netif.h +++ b/sys/include/net/gnrc/netif.h @@ -38,7 +38,7 @@ #if IS_USED(MODULE_GNRC_NETIF_LORAWAN) #include "net/gnrc/netif/lorawan.h" #endif -#ifdef MODULE_GNRC_SIXLOWPAN +#if IS_USED(MODULE_GNRC_NETIF_6LO) #include "net/gnrc/netif/6lo.h" #endif #if defined(MODULE_GNRC_NETIF_DEDUP) && (GNRC_NETIF_L2ADDR_MAXLEN > 0) @@ -129,7 +129,7 @@ typedef struct { gnrc_netif_dedup_t last_pkt; #endif #endif -#if defined(MODULE_GNRC_SIXLOWPAN) || DOXYGEN +#if IS_USED(MODULE_GNRC_NETIF_6LO) || defined(DOXYGEN) gnrc_netif_6lo_t sixlo; /**< 6Lo component */ #endif uint8_t cur_hl; /**< Current hop-limit for out-going packets */ diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index eac2b7462e..b424a5704f 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -1296,14 +1296,14 @@ static void _test_options(gnrc_netif_t *netif) assert((IEEE802154_SHORT_ADDRESS_LEN == netif->l2addr_len) || (IEEE802154_LONG_ADDRESS_LEN == netif->l2addr_len)); #ifdef MODULE_GNRC_IPV6 -#ifdef MODULE_GNRC_SIXLOWPAN +#if IS_USED(MODULE_GNRC_NETIF_6LO) assert(netif->ipv6.mtu == IPV6_MIN_MTU); assert(netif->sixlo.max_frag_size > 0); assert(-ENOTSUP != netif->dev->driver->get(netif->dev, NETOPT_PROTO, &tmp, sizeof(tmp))); -#else /* MODULE_GNRC_SIXLOWPAN */ +#else /* IS_USED(MODULE_GNRC_NETIF_6LO) */ assert(netif->ipv6.mtu < UINT16_MAX); -#endif /* MODULE_GNRC_SIXLOWPAN */ +#endif /* IS_USED(MODULE_GNRC_NETIF_6LO) */ #endif /* MODULE_GNRC_IPV6 */ #ifdef MODULE_GNRC_SIXLOWPAN_ND assert((netif->device_type != NETDEV_TYPE_IEEE802154) || diff --git a/sys/net/gnrc/netif/gnrc_netif_device_type.c b/sys/net/gnrc/netif/gnrc_netif_device_type.c index 5e095f1e71..233e89a44a 100644 --- a/sys/net/gnrc/netif/gnrc_netif_device_type.c +++ b/sys/net/gnrc/netif/gnrc_netif_device_type.c @@ -144,12 +144,12 @@ void gnrc_netif_ipv6_init_mtu(gnrc_netif_t *netif) res = dev->driver->get(dev, NETOPT_MAX_PDU_SIZE, &tmp, sizeof(tmp)); assert(res == sizeof(tmp)); -#ifdef MODULE_GNRC_SIXLOWPAN +#if IS_USED(MODULE_GNRC_NETIF_6LO) netif->ipv6.mtu = MAX(IPV6_MIN_MTU, tmp); netif->sixlo.max_frag_size = tmp; -#else +#else /* IS_USED(MODULE_GNRC_NETIF_6LO) */ netif->ipv6.mtu = tmp; -#endif +#endif /* IS_USED(MODULE_GNRC_NETIF_6LO) */ break; #endif /* defined(MODULE_NETDEV_IEEE802154) || defined(MODULE_NRFMIN) || \ * defined(MODULE_XBEE) || defined(MODULE_ESP_NOW) */