diff --git a/Makefile.dep b/Makefile.dep index 0b9c59c29c711b094ae3ec70fa42a415365c4159..654daa430d3f06e873119c0eff3fde4e3cf319db 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -123,7 +123,7 @@ ifneq (,$(filter trickle,$(USEMODULE))) USEMODULE += xtimer endif -ifneq (,$(filter ieee802154,$(USEMODULE))) +ifneq (,$(filter ieee802154 nrfmin,$(USEMODULE))) ifneq (,$(filter gnrc_ipv6, $(USEMODULE))) USEMODULE += gnrc_sixlowpan endif diff --git a/cpu/nrf5x_common/radio/nrfmin/nrfmin.c b/cpu/nrf5x_common/radio/nrfmin/nrfmin.c index 8a8cfc0e827a3d41fd8c65bd32c34dd020238297..1d1d127869c6202e97fb10cbc993b998311a37d6 100644 --- a/cpu/nrf5x_common/radio/nrfmin/nrfmin.c +++ b/cpu/nrf5x_common/radio/nrfmin/nrfmin.c @@ -31,6 +31,10 @@ #include "nrfmin.h" #include "net/netdev.h" +#ifdef MODULE_GNRC_SIXLOWPAN +#include "net/gnrc/nettype.h" +#endif + #define ENABLE_DEBUG (0) #include "debug.h" @@ -495,9 +499,12 @@ static int nrfmin_get(netdev_t *dev, netopt_t opt, void *val, size_t max_len) assert(max_len >= sizeof(uint16_t)); *((uint16_t*)val) = CONF_PSEUDO_NID; return sizeof(uint16_t); +#ifdef MODULE_GNRC_SIXLOWPAN case NETOPT_PROTO: - *((uint16_t *)val) = 809; /* TODO */ - return 2; + assert(max_len >= sizeof(uint16_t)); + *((uint16_t *)val) = GNRC_NETTYPE_SIXLOWPAN; + return sizeof(uint16_t); +#endif case NETOPT_DEVICE_TYPE: assert(max_len >= sizeof(uint16_t)); *((uint16_t *)val) = NETDEV_TYPE_NRFMIN; diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index 8eba2047450a88041b53c79963ae3283642522c3..a3c80f88fc1769f8eddcdd61fda75f0f74692ef6 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -1157,8 +1157,9 @@ static void _init_from_device(gnrc_netif_t *netif) assert(res == sizeof(tmp)); netif->device_type = (uint8_t)tmp; switch (netif->device_type) { -#ifdef MODULE_NETDEV_IEEE802154 +#if defined(MODULE_NETDEV_IEEE802154) || defined(MODULE_NRFMIN) case NETDEV_TYPE_IEEE802154: + case NETDEV_TYPE_NRFMIN: #ifdef MODULE_GNRC_SIXLOWPAN_IPHC netif->flags |= GNRC_NETIF_FLAGS_6LO_HC; #endif diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-6ln.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-6ln.c index 7c2c339455186d6d526358b54e86ea84cbdb4f51..3bf50ccbad24fe65f3e5b6bf2a390b05f39a2ec1 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-6ln.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-6ln.c @@ -58,6 +58,12 @@ static inline uint8_t _reverse_iid(const ipv6_addr_t *dst, l2addr[0] ^= 0x02; return sizeof(dst->u64[1]); #endif /* MODULE_NETDEV_IEEE802154 */ +#ifdef MODULE_NRFMIN + case NETDEV_TYPE_NRFMIN: + l2addr[0] = dst->u8[14]; + l2addr[1] = dst->u8[15]; + return sizeof(uint16_t); +#endif /* MODULE_NETDEV_IEEE802154 */ #ifdef MODULE_CC110X case NETDEV_TYPE_CC110X: l2addr[0] = dst->u8[15];