Merge branch 'ieee802154'

This commit is contained in:
Gregory Nutt 2017-06-16 16:48:08 -06:00
commit 99bf0b522b
7 changed files with 259 additions and 15 deletions

View File

@ -418,7 +418,7 @@ Configurations
to support any future debugging needs that you may have.
If you don't plan on using the debug features, then by all means
disable this feature and save 16KiB of RAM!
disable this feature and save 8KiB of RAM!
NOTE: There is an issue with capturing data in the RAMLOG: If
the system crashes, all of the crash dump information will go into
@ -426,6 +426,16 @@ Configurations
the system has crashed because (a) it will be unresponsive and (b)
the LD2 will be blinking at about 2Hz.
4. IPv6 networking is enabled with TCP/IP, UDP, 6loWPAN, and NSH
Telnet support.
5. Configuration instructions: Basic PAN configuration is the same as
for the ieee802154-mac configuration with the exception that after
the PAN has been configured with the i8sak utility, you must
explicity bring the network up:
nsh> ifup wpan0
nsh:
Configures the NuttShell (nsh) located at examples/nsh. This

View File

@ -800,6 +800,27 @@ CONFIG_SPI_EXCHANGE=y
# CONFIG_MODEM is not set
# CONFIG_MTD is not set
# CONFIG_EEPROM is not set
CONFIG_NETDEVICES=y
#
# General Ethernet MAC Driver Options
#
# CONFIG_NETDEV_LOOPBACK is not set
CONFIG_NETDEV_TELNET=y
CONFIG_TELNET_RXBUFFER_SIZE=256
CONFIG_TELNET_TXBUFFER_SIZE=256
# CONFIG_NETDEV_MULTINIC is not set
# CONFIG_ARCH_HAVE_NETDEV_STATISTICS is not set
CONFIG_NETDEV_LATEINIT=y
#
# External Ethernet MAC Device Support
#
# CONFIG_NET_DM90x0 is not set
# CONFIG_ENC28J60 is not set
# CONFIG_ENCX24J600 is not set
# CONFIG_NET_SLIP is not set
# CONFIG_NET_FTMAC100 is not set
# CONFIG_PIPES is not set
# CONFIG_PM is not set
# CONFIG_POWER is not set
@ -912,9 +933,129 @@ CONFIG_RAMLOG_SYSLOG=y
#
# Networking Support
#
# CONFIG_ARCH_HAVE_NET is not set
CONFIG_ARCH_HAVE_NET=y
# CONFIG_ARCH_HAVE_PHY is not set
# CONFIG_NET is not set
CONFIG_NET=y
# CONFIG_NET_PROMISCUOUS is not set
#
# Driver buffer configuration
#
CONFIG_NET_GUARDSIZE=2
#
# Data link support
#
# CONFIG_NET_MULTILINK is not set
# CONFIG_NET_ETHERNET is not set
CONFIG_NET_6LOWPAN=y
# CONFIG_NET_LOOPBACK is not set
# CONFIG_NET_TUN is not set
# CONFIG_NET_USRSOCK is not set
#
# Network Device Operations
#
CONFIG_NETDEV_IOCTL=y
# CONFIG_NETDEV_PHY_IOCTL is not set
CONFIG_NETDEV_WIRELESS_IOCTL=y
#
# Internet Protocol Selection
#
# CONFIG_NET_IPv4 is not set
CONFIG_NET_IPv6=y
CONFIG_NET_IPv6_NCONF_ENTRIES=8
#
# 6LoWPAN Configuration
#
CONFIG_NET_6LOWPAN_FRAG=y
CONFIG_NET_6LOWPAN_FRAMELEN=127
# CONFIG_NET_6LOWPAN_COMPRESSION_IPv6 is not set
# CONFIG_NET_6LOWPAN_COMPRESSION_HC1 is not set
CONFIG_NET_6LOWPAN_COMPRESSION_HC06=y
CONFIG_NET_6LOWPAN_COMPRESSION_THRESHOLD=63
CONFIG_NET_6LOWPAN_MAXADDRCONTEXT=1
CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREFIX_0_0=0xaa
CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREFIX_0_1=0xaa
# CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREINIT_1 is not set
# CONFIG_NET_6LOWPAN_EXTENDEDADDR is not set
CONFIG_NET_6LOWPAN_MAXAGE=20
CONFIG_NET_6LOWPAN_MAX_MACTRANSMITS=4
CONFIG_NET_6LOWPAN_MTU=1294
CONFIG_NET_6LOWPAN_TCP_RECVWNDO=1220
#
# Socket Support
#
CONFIG_NSOCKET_DESCRIPTORS=8
CONFIG_NET_NACTIVESOCKETS=16
CONFIG_NET_SOCKOPTS=y
# CONFIG_NET_SOLINGER is not set
#
# Raw Socket Support
#
# CONFIG_NET_PKT is not set
#
# Unix Domain Socket Support
#
# CONFIG_NET_LOCAL is not set
#
# TCP/IP Networking
#
CONFIG_NET_TCP=y
# CONFIG_NET_TCP_NO_STACK is not set
# CONFIG_NET_TCPURGDATA is not set
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=20
CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_WRITE_BUFFERS=y
CONFIG_NET_TCP_NWRBCHAINS=8
CONFIG_NET_TCP_RECVDELAY=0
CONFIG_NET_TCPBACKLOG=y
# CONFIG_NET_SENDFILE is not set
#
# UDP Networking
#
CONFIG_NET_UDP=y
# CONFIG_NET_UDP_NO_STACK is not set
CONFIG_NET_UDP_CHECKSUMS=y
CONFIG_NET_UDP_CONNS=8
CONFIG_NET_BROADCAST=y
# CONFIG_NET_RXAVAIL is not set
CONFIG_NET_UDP_READAHEAD=y
#
# ICMPv6 Networking Support
#
# CONFIG_NET_ICMPv6 is not set
#
# IGMPv2 Client Support
#
# CONFIG_NET_IGMP is not set
#
# ARP Configuration
#
#
# User-space networking stack API
#
# CONFIG_NET_ARCH_INCR32 is not set
# CONFIG_NET_ARCH_CHKSUM is not set
CONFIG_NET_STATISTICS=y
#
# Routing Table Configuration
#
# CONFIG_NET_ROUTE is not set
CONFIG_NET_HOSTNAME="MRF24J40"
#
# Crypto API
@ -959,6 +1100,7 @@ CONFIG_FS_PROCFS=y
# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set
# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set
# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set
# CONFIG_FS_PROCFS_EXCLUDE_NET is not set
# CONFIG_FS_UNIONFS is not set
#
@ -978,10 +1120,10 @@ CONFIG_MM_REGIONS=1
# Common I/O Buffer Support
#
CONFIG_MM_IOB=y
CONFIG_IOB_NBUFFERS=8
CONFIG_IOB_BUFSIZE=196
CONFIG_IOB_NCHAINS=0
CONFIG_IOB_THROTTLE=0
CONFIG_IOB_NBUFFERS=32
CONFIG_IOB_BUFSIZE=128
CONFIG_IOB_NCHAINS=16
CONFIG_IOB_THROTTLE=8
#
# Audio Support
@ -999,6 +1141,8 @@ CONFIG_MAC802154_HPWORK=y
CONFIG_IEEE802154_NTXDESC=3
CONFIG_IEEE802154_IND_PREALLOC=20
CONFIG_IEEE802154_IND_IRQRESERVE=10
# CONFIG_IEEE802154_NETDEV is not set
# CONFIG_IEEE802154_LOOPBACK is not set
#
# Binary Loader
@ -1101,13 +1245,13 @@ CONFIG_ARCH_HAVE_TLS=y
# Network-Related Options
#
# CONFIG_LIBC_IPv4_ADDRCONV is not set
# CONFIG_LIBC_IPv6_ADDRCONV is not set
# CONFIG_LIBC_NETDB is not set
CONFIG_LIBC_NETDB=y
#
# NETDB Support
#
# CONFIG_NETDB_HOSTFILE is not set
# CONFIG_NETDB_DNSCLIENT is not set
# CONFIG_LIBC_IOCTL_VARIADIC is not set
CONFIG_LIB_SENDFILE_BUFSIZE=512
@ -1158,6 +1302,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024
# CONFIG_EXAMPLES_CONFIGDATA is not set
# CONFIG_EXAMPLES_CXXTEST is not set
# CONFIG_EXAMPLES_DHCPD is not set
# CONFIG_EXAMPLES_DISCOVER is not set
# CONFIG_EXAMPLES_ELF is not set
# CONFIG_EXAMPLES_FSTEST is not set
# CONFIG_EXAMPLES_FTPC is not set
@ -1172,6 +1317,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024
# CONFIG_EXAMPLES_MM is not set
# CONFIG_EXAMPLES_MODBUS is not set
# CONFIG_EXAMPLES_MOUNT is not set
# CONFIG_EXAMPLES_NETTEST is not set
# CONFIG_EXAMPLES_NRF24L01TERM is not set
CONFIG_EXAMPLES_NSH=y
CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
@ -1202,6 +1348,8 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
# CONFIG_EXAMPLES_TELNETD is not set
# CONFIG_EXAMPLES_TIFF is not set
# CONFIG_EXAMPLES_TOUCHSCREEN is not set
# CONFIG_EXAMPLES_UDP is not set
# CONFIG_EXAMPLES_UDPBLASTER is not set
# CONFIG_EXAMPLES_USBSERIAL is not set
# CONFIG_EXAMPLES_WATCHDOG is not set
# CONFIG_EXAMPLES_WEBSERVER is not set
@ -1242,10 +1390,19 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
# Network Utilities
#
# CONFIG_NETUTILS_CODECS is not set
# CONFIG_NETUTILS_DISCOVER is not set
# CONFIG_NETUTILS_ESP8266 is not set
# CONFIG_NETUTILS_FTPC is not set
# CONFIG_NETUTILS_JSON is not set
CONFIG_NETUTILS_NETLIB=y
# CONFIG_NETUTILS_NTPCLIENT is not set
# CONFIG_NETUTILS_PPPD is not set
# CONFIG_NETUTILS_SMTP is not set
CONFIG_NETUTILS_TELNETD=y
# CONFIG_NETUTILS_TFTPC is not set
# CONFIG_NETUTILS_WEBCLIENT is not set
# CONFIG_NETUTILS_WEBSERVER is not set
# CONFIG_NETUTILS_XMLRPC is not set
#
# NSH Library
@ -1343,10 +1500,72 @@ CONFIG_NSH_FILEIOSIZE=512
#
CONFIG_NSH_CONSOLE=y
# CONFIG_NSH_USBCONSOLE is not set
# CONFIG_NSH_ALTCONDEV is not set
CONFIG_NSH_ARCHINIT=y
#
# Networking Configuration
#
CONFIG_NSH_NETINIT=y
CONFIG_NSH_NETLOCAL=y
#
# IP Address Configuration
#
#
# Target IPv6 address
#
CONFIG_NSH_IPv6ADDR_1=0xfc00
CONFIG_NSH_IPv6ADDR_2=0x0000
CONFIG_NSH_IPv6ADDR_3=0x0000
CONFIG_NSH_IPv6ADDR_4=0x0000
CONFIG_NSH_IPv6ADDR_5=0x0000
CONFIG_NSH_IPv6ADDR_6=0x00ff
CONFIG_NSH_IPv6ADDR_7=0xfe00
CONFIG_NSH_IPv6ADDR_8=0xa9cd
#
# Router IPv6 address
#
CONFIG_NSH_DRIPv6ADDR_1=0xfc00
CONFIG_NSH_DRIPv6ADDR_2=0x0000
CONFIG_NSH_DRIPv6ADDR_3=0x0000
CONFIG_NSH_DRIPv6ADDR_4=0x0000
CONFIG_NSH_DRIPv6ADDR_5=0x0000
CONFIG_NSH_DRIPv6ADDR_6=0x00ff
CONFIG_NSH_DRIPv6ADDR_7=0xfe00
CONFIG_NSH_DRIPv6ADDR_8=0x1034
#
# IPv6 Network mask
#
CONFIG_NSH_IPv6NETMASK_1=0xffff
CONFIG_NSH_IPv6NETMASK_2=0xffff
CONFIG_NSH_IPv6NETMASK_3=0xffff
CONFIG_NSH_IPv6NETMASK_4=0xffff
CONFIG_NSH_IPv6NETMASK_5=0xffff
CONFIG_NSH_IPv6NETMASK_6=0xffff
CONFIG_NSH_IPv6NETMASK_7=0xffff
CONFIG_NSH_IPv6NETMASK_8=0x0000
CONFIG_NSH_NOMAC=y
CONFIG_NSH_SWMAC=y
CONFIG_NSH_MACADDR=0xabcd
CONFIG_NSH_PANID=0xface
CONFIG_NSH_MAX_ROUNDTRIP=20
#
# Telnet Configuration
#
CONFIG_NSH_TELNET=y
CONFIG_NSH_TELNETD_PORT=23
CONFIG_NSH_TELNETD_DAEMONPRIO=100
CONFIG_NSH_TELNETD_DAEMONSTACKSIZE=2048
CONFIG_NSH_TELNETD_CLIENTPRIO=100
CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=2048
CONFIG_NSH_IOBUFFER_SIZE=512
# CONFIG_NSH_LOGIN is not set
# CONFIG_NSH_CONSOLE_LOGIN is not set
# CONFIG_NSH_TELNET_LOGIN is not set
#
# NxWidgets/NxWM
@ -1368,6 +1587,8 @@ CONFIG_HAVE_CXXINITIALIZE=y
# CONFIG_SYSTEM_HEX2BIN is not set
# CONFIG_SYSTEM_HEXED is not set
# CONFIG_SYSTEM_INSTALL is not set
# CONFIG_SYSTEM_NETDB is not set
# CONFIG_SYSTEM_NTPC is not set
# CONFIG_SYSTEM_RAMTEST is not set
CONFIG_READLINE_HAVE_EXTMATCH=y
CONFIG_SYSTEM_READLINE=y
@ -1393,3 +1614,4 @@ CONFIG_IEEE802154_LIBUTILS=y
CONFIG_IEEE802154_I8SAK=y
CONFIG_IEEE802154_I8SAK_PRIORITY=100
CONFIG_IEEE802154_I8SAK_STACKSIZE=2048
# CONFIG_WIRELESS_IWPAN is not set

View File

@ -255,7 +255,7 @@ static int stm32_mrf24j40_devsetup(FAR struct stm32_priv_s *priv)
return -ENODEV;
}
#if defined(CONFIG_IEEE802154_NETDEV)
#ifdef CONFIG_IEEE802154_NETDEV
/* Use the IEEE802.15.4 MAC interface instance to create a 6loWPAN
* network interface by wrapping the MAC intrface instance in a
* network device driver via mac802154dev_register().
@ -268,7 +268,9 @@ static int stm32_mrf24j40_devsetup(FAR struct stm32_priv_s *priv)
0, ret);
return ret;
}
#elif defined(CONFIG_IEEE802154_MAC_DEV)
#endif
#ifdef CONFIG_IEEE802154_MAC_DEV
/* If want to call these APIs from userspace, you have to wrap the MAC
* interface in a character device viamac802154dev_register().
*/

View File

@ -137,7 +137,7 @@ config NET_6LOWPAN
select NETDEV_MULTINIC if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN
select NET_MULTILINK if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN
select NETDEV_IOCTL
depends on EXPERIMENTAL && NET_IPv6
depends on NET_IPv6
---help---
Enable support for IEEE 802.15.4 Low power Wireless Personal Area
Networking (6LoWPAN).

View File

@ -141,6 +141,12 @@ config NET_6LOWPAN_EXTENDEDADDR
device's link layer address. If this option is selected, then an
8-byte extended address will be used.
All devices operating on a network have unique, 8-byte addresses,
referred to as extended addresses. A device will use either the
extended address for direct communication within the PAN or the
short 2-byte address that was allocated by the PAN coordinator when
the device associated.
config NET_6LOWPAN_MAXAGE
int "Packet reassembly timeout"
default 20

View File

@ -263,7 +263,9 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
/* Copy the source and destination addresses */
#ifdef CONFIG_NETDEV_MULTINIC
net_ipv6addr_hdrcopy(ipv6tcp.ipv6.srcipaddr, conn->u.ipv6.laddr);
#endif
net_ipv6addr_hdrcopy(ipv6tcp.ipv6.destipaddr, conn->u.ipv6.raddr);
ninfo("IPv6 length: %d\n",

View File

@ -78,7 +78,7 @@
****************************************************************************/
#ifdef CONFIG_NET_UDP_CHECKSUMS
static uint16_t sixlowpan_udp_chksum(FAR struct ipv6udp_hdr_s *ipv6udp,
static uint16_t sixlowpan_udp_chksum(FAR const struct ipv6udp_hdr_s *ipv6udp,
FAR const uint8_t *buf, uint16_t buflen)
{
uint16_t upperlen;
@ -258,7 +258,9 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
/* Copy the source and destination addresses */
net_ipv6addr_hdrcopy(ipv6udp.ipv6.destipaddr, to6->sin6_addr.in6_u.u6_addr16);
#ifdef CONFIG_NETDEV_MULTINIC
net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, conn->u.ipv6.laddr);
#endif
ninfo("IPv6 length: %d\n",
((int)ipv6udp.ipv6.len[0] << 8) + ipv6udp.ipv6.len[1]);
@ -275,7 +277,7 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
ipv6udp.udp.udpchksum = 0;
#ifdef CONFIG_NET_UDP_CHECKSUMS
ipv6udp.udp.udpchksum = ~sixlowpan_udp_chksum(ipv6udp, buf, buflen);
ipv6udp.udp.udpchksum = ~sixlowpan_udp_chksum(&ipv6udp, buf, buflen);
if (ipv6udp.udp.udpchksum == 0)
{
ipv6udp.udp.udpchksum = 0xffff;