diff --git a/include/nuttx/fs/ioctl.h b/include/nuttx/fs/ioctl.h index 2d18dc217e8..cfcc4507d60 100644 --- a/include/nuttx/fs/ioctl.h +++ b/include/nuttx/fs/ioctl.h @@ -425,8 +425,8 @@ /* 802.15.4 MAC driver ioctl definitions ************************************/ /* (see nuttx/include/wireless/ieee802154/ieee802154_mac.h */ -#define _MAC802154IOCVALID(c) (_IOC_TYPE(c)==_MAC802154BASE) -#define _MAC802154IOC(nr) _IOC(_MAC802154BASE,nr) +#define _MAC802154IOCVALID(c) (_IOC_TYPE(c)==_MAC802154BASE) +#define _MAC802154IOC(nr) _IOC(_MAC802154BASE,nr) /* boardctl() command definitions *******************************************/ diff --git a/net/sixlowpan/sixlowpan_internal.h b/net/sixlowpan/sixlowpan_internal.h index c48b89929ff..cf71100db15 100644 --- a/net/sixlowpan/sixlowpan_internal.h +++ b/net/sixlowpan/sixlowpan_internal.h @@ -134,7 +134,9 @@ * Public Types ****************************************************************************/ -/* IPv^ TCP/UDP Definitions *************************************************/ +/* IPv6 TCP/UDP/ICMPv6 Definitions ******************************************/ + +#ifdef CONFIG_NET_TCP /* IPv6 + TCP header. Cast compatible based on IPv6 protocol field. */ struct ipv6tcp_hdr_s @@ -142,7 +144,9 @@ struct ipv6tcp_hdr_s struct ipv6_hdr_s ipv6; struct tcp_hdr_s tcp; }; +#endif +#ifdef CONFIG_NET_UDP /* IPv6 + UDP header */ struct ipv6udp_hdr_s @@ -150,7 +154,9 @@ struct ipv6udp_hdr_s struct ipv6_hdr_s ipv6; struct udp_hdr_s udp; }; +#endif +#ifdef CONFIG_NET_ICMPv6 /* IPv6 + ICMPv6 header */ struct ipv6icmp_hdr_s @@ -158,6 +164,7 @@ struct ipv6icmp_hdr_s struct ipv6_hdr_s ipv6; struct icmpv6_iphdr_s icmp; }; +#endif /* In order to provide a customizable IEEE 802.15.4 MAC header, a structure * of meta data is passed to the MAC network driver, struct diff --git a/net/sixlowpan/sixlowpan_utils.c b/net/sixlowpan/sixlowpan_utils.c index d392f0ef477..a1d7892a3e3 100644 --- a/net/sixlowpan/sixlowpan_utils.c +++ b/net/sixlowpan/sixlowpan_utils.c @@ -57,6 +57,7 @@ #include #include +#include #include "sixlowpan/sixlowpan_internal.h" @@ -193,7 +194,7 @@ int sixlowpan_src_panid(FAR struct ieee802154_driver_s *ieee, return ret; } - *panid = arg.u.getreq.attr_value->panid; + *panid = arg.u.getreq.attr_value.mac.panid; return OK; } diff --git a/wireless/ieee802154/mac802154_loopback.c b/wireless/ieee802154/mac802154_loopback.c index 44cb4f0762b..f30953a3869 100644 --- a/wireless/ieee802154/mac802154_loopback.c +++ b/wireless/ieee802154/mac802154_loopback.c @@ -577,10 +577,9 @@ static int lo_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac) static int lo_ioctl(FAR struct net_driver_s *dev, int cmd, unsigned long arg) { - FAR struct lo_driver_s *priv = (FAR struct lo_driver_s *)dev->d_private; - int ret = -ENOTTY; - #if 0 + FAR struct lo_driver_s *priv = (FAR struct lo_driver_s *)dev->d_private; + /* Check for IOCTLs aimed at the IEEE802.15.4 MAC layer */ if (_MAC802154IOCVALID(cmd)) @@ -588,12 +587,13 @@ static int lo_ioctl(FAR struct net_driver_s *dev, int cmd, FAR struct ieee802154_netmac_s *netmac = (FAR struct ieee802154_netmac_s *)arg; } - - /* No, check for IOCTLs aimed at the IEEE802.15.4 radio layer */ - else #endif - return ret; + { + /* Not a valid IEEE 802.15.4 MAC IOCTL command */ + + return -ENOTTY; + } } #endif