From fdddebbffdc2672a9faff94351af0f3ed253103d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 27 Feb 2016 07:26:20 -0600 Subject: [PATCH] net/: Finish IEEE802154->6LOWPAN renaming; remove PF_IEEE804154; Move 6LoWPAN menu to inside Internet Protocol Menu --- include/nuttx/net/net.h | 2 +- .../nuttx/wireless/ieee802154/ieee802154.h | 6 ++-- include/sys/socket.h | 3 +- net/6lowpan/6lowpan.h | 10 +++---- net/6lowpan/Kconfig | 28 ++++++++----------- net/6lowpan/Make.defs | 4 +-- net/Kconfig | 5 ++-- net/netdev/netdev_register.c | 24 ++++++++-------- 8 files changed, 38 insertions(+), 44 deletions(-) diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h index 45c84811ee..a11c8bcd2e 100644 --- a/include/nuttx/net/net.h +++ b/include/nuttx/net/net.h @@ -79,7 +79,7 @@ enum net_lltype_e NET_LL_LOOPBACK, /* Local loopback */ NET_LL_SLIP, /* Serial Line Internet Protocol (SLIP) */ NET_LL_TUN, /* TUN Virtual Network Device */ - NET_LL_IEEE802154 /* IEEE 802.15.4 */ + NET_LL_6LOWPAN /* IEEE 802.15.4 6LoWPAN*/ }; /* This defines a bitmap big enough for one bit for each socket option */ diff --git a/include/nuttx/wireless/ieee802154/ieee802154.h b/include/nuttx/wireless/ieee802154/ieee802154.h index 250a81bf00..0211940414 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154.h +++ b/include/nuttx/wireless/ieee802154/ieee802154.h @@ -36,8 +36,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NUTTX_NET_IEEE802154_H -#define __INCLUDE_NUTTX_NET_IEEE802154_H +#ifndef __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_H +#define __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_H /**************************************************************************** * Included Files @@ -59,4 +59,4 @@ * Public Function Prototypes ****************************************************************************/ -#endif /* __INCLUDE_NUTTX_NET_IEEE802154_H */ +#endif /* __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_H */ diff --git a/include/sys/socket.h b/include/sys/socket.h index 7276fe2700..0f9f10f4d1 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/sys/socket.h * - * Copyright (C) 2007, 2009, 2011, 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -64,7 +64,6 @@ #define PF_ATMPVC 8 /* Access to raw ATM PVCs */ #define PF_APPLETALK 9 /* Appletalk */ #define PF_PACKET 10 /* Low level packet interface */ -#define PF_IEEE802154 11 /* IEEE 802.15.4 sockets */ /* Address families */ diff --git a/net/6lowpan/6lowpan.h b/net/6lowpan/6lowpan.h index cb5a54eb34..657b04c75b 100644 --- a/net/6lowpan/6lowpan.h +++ b/net/6lowpan/6lowpan.h @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NET_IEEE802_15_4_IEEE802154_H -#define __NET_IEEE802_15_4_IEEE802154_H +#ifndef __NET_6LOWPAN_6LOWPAN_H +#define __NET_6LOWPAN_6LOWPAN_H /**************************************************************************** * Included Files @@ -42,7 +42,7 @@ #include -#ifdef CONFIG_NET_IEEE802154 +#ifdef CONFIG_NET_6LOWPAN /**************************************************************************** * Public Types @@ -52,5 +52,5 @@ * Public Function Prototypes ****************************************************************************/ -#endif /* CONFIG_NET_IEEE802154 */ -#endif /* __NET_IEEE802_15_4_IEEE802154_H */ +#endif /* CONFIG_NET_6LOWPAN */ +#endif /* __NET_6LOWPAN_6LOWPAN_H */ diff --git a/net/6lowpan/Kconfig b/net/6lowpan/Kconfig index a96521a49b..e72e42268b 100644 --- a/net/6lowpan/Kconfig +++ b/net/6lowpan/Kconfig @@ -3,36 +3,31 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -menu "IEEE 802.15.4 Configuration" - -config NET_IEEE802154 - bool "IEEE 802.15.4 support" +menuconfig NET_6LOWPAN + bool "IEEE 802.15.4 6LoWPAN support" default n depends on EXPERIMENTAL && NET_IPv6 ---help--- - Enable IEEE 802.15.4 protocol socket support + Enable support for IEEE 802.15.4 Low power Wireless Personal Area + Networking (6LoWPAN). -if NET_IEEE802154 +if NET_6LOWPAN -config NET_IEEE802154_MTU - int "IEEE 802.15.4 packet buffer size (MTU)" +config NET_6LOWPAN_MTU + int "6LoWPAN packet buffer size (MTU)" default 1294 range 590 1518 ---help--- Packet buffer size. This size includes the TCP/UDP payload plus the - size of TCP/UDP header, the IP header, and the IEEE 802.15.4 header. + size of TCP/UDP header, the IP header, and data link layer headers. This value is normally referred to as the MTU (Maximum Transmission Unit); the payload is the MSS (Maximum Segment Size). - IPv4 hosts are required to be able to handle an MSS of at least - 536 octets, resulting in a minimum buffer size of 536+20+20+xx = - xx. REVISIT! - IPv6 hosts are required to be able to handle an MSS of 1220 octets, resulting in a minimum buffer size of of 1220+20+40+xx = xx. REVISIT! -config IEEE802154_TCP_RECVWNDO - int "IEEE 802.15.4 TCP receive window size" +config NET_6LOWPAN_TCP_RECVWNDO + int "6LoWPAN TCP receive window size" default 1220 depends on NET_TCP ---help--- @@ -41,5 +36,4 @@ config IEEE802154_TCP_RECVWNDO incoming data, or high (32768 bytes) if the application processes data quickly. REVISIT! -endif # NET_IEEE802154 -endmenu # IEEE 802.15.4 Configuration +endif # NET_6LOWPAN diff --git a/net/6lowpan/Make.defs b/net/6lowpan/Make.defs index e04fd7a17c..e52060673a 100644 --- a/net/6lowpan/Make.defs +++ b/net/6lowpan/Make.defs @@ -35,7 +35,7 @@ # IEEE 802.15.4 support -ifeq ($(CONFIG_NET_IEEE802154),y) +ifeq ($(CONFIG_NET_6LOWPAN),y) # Include IEEE 802.15.4 file in the build @@ -46,4 +46,4 @@ ifeq ($(CONFIG_NET_IEEE802154),y) DEPPATH += --dep-path 6lowpan VPATH += :6lowpan -endif # CONFIG_NET_IEEE802154 +endif # CONFIG_NET_6LOWPAN diff --git a/net/Kconfig b/net/Kconfig index ca36d66e16..a69a42e3d1 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -255,13 +255,15 @@ config NET_IPv4 ---help--- Build in support for IPv4. -config NET_IPv6 +menuconfig NET_IPv6 bool "IPv6" default n ---help--- Build in support for IPv6. source "net/neighbor/Kconfig" +source "net/6lowpan/Kconfig" + endmenu # Internet Protocol Selection source "net/socket/Kconfig" @@ -269,7 +271,6 @@ source "net/pkt/Kconfig" source "net/local/Kconfig" source "net/tcp/Kconfig" source "net/udp/Kconfig" -source "net/6lowpan/Kconfig" source "net/icmp/Kconfig" source "net/icmpv6/Kconfig" source "net/igmp/Kconfig" diff --git a/net/netdev/netdev_register.c b/net/netdev/netdev_register.c index e1228de7b1..11982d9eeb 100644 --- a/net/netdev/netdev_register.c +++ b/net/netdev/netdev_register.c @@ -61,18 +61,18 @@ * Pre-processor Definitions ****************************************************************************/ -#define NETDEV_ETH_FORMAT "eth%d" -#define NETDEV_LO_FORMAT "lo" -#define NETDEV_IEEE802154_FORMAT "wpan%d" -#define NETDEV_SLIP_FORMAT "sl%d" -#define NETDEV_TUN_FORMAT "tun%d" +#define NETDEV_ETH_FORMAT "eth%d" +#define NETDEV_LO_FORMAT "lo" +#define NETDEV_WPAN_FORMAT "wpan%d" +#define NETDEV_SLIP_FORMAT "sl%d" +#define NETDEV_TUN_FORMAT "tun%d" #if defined(CONFIG_NET_SLIP) # define NETDEV_DEFAULT_FORMAT NETDEV_SLIP_FORMAT #elif defined(CONFIG_NET_ETHERNET) # define NETDEV_DEFAULT_FORMAT NETDEV_ETH_FORMAT -#elif defined(CONFIG_NET_IEEE802154) -# define NETDEV_DEFAULT_FORMAT NETDEV_IEEE802154_FORMAT +#elif defined(CONFIG_NET_6LOWPAN) +# define NETDEV_DEFAULT_FORMAT NETDEV_WPAN_FORMAT #else /* if defined(CONFIG_NET_LOOPBACK) */ # define NETDEV_DEFAULT_FORMAT NETDEV_LO_FORMAT #endif @@ -214,14 +214,14 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype) break; #endif -#ifdef CONFIG_NET_IEEE802154 - case NET_LL_IEEE802154: /* IEEE 802.15.4 */ +#ifdef CONFIG_NET_6LOWPAN + case NET_LL_6LOWPAN: /* IEEE 802.15.4 */ dev->d_llhdrlen = 0; /* REVISIT */ - dev->d_mtu = CONFIG_NET_IEEE802154_MTU; + dev->d_mtu = CONFIG_NET_6LOWPAN_MTU; #ifdef CONFIG_NET_TCP - dev->d_recvwndo = CONFIG_NET_IEEE802154_TCP_RECVWNDO; + dev->d_recvwndo = CONFIG_NET_6LOWPAN_TCP_RECVWNDO; #endif - devfmt = NETDEV_IEEE802154_FORMAT; + devfmt = NETDEV_WPAN_FORMAT; break; #endif