diff --git a/ChangeLog b/ChangeLog index b0e42092ed..878c036e54 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11523,6 +11523,4 @@ data buffers (2016-02-22). * fs/fat: Add an option to force all transfers to be performed indirectly using the FAT file system's internal sector buffers (2016-02-22). - * net/: Add basic support for IEEE 802.15-4 sockets. Compiles but still - missing a few things (2016-02-25). diff --git a/net/netdev/netdev_register.c b/net/netdev/netdev_register.c index 29a20c747d..af523f5ad1 100644 --- a/net/netdev/netdev_register.c +++ b/net/netdev/netdev_register.c @@ -216,8 +216,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype) #ifdef CONFIG_NET_IEEE802154 case NET_LL_IEEE802154: /* IEEE802.15-4 */ -# warning Missing IEEE 802.15-4 logic: Header length - //dev->d_llhdrlen = ???; + dev->d_llhdrlen = 0; /* REVISIT */ dev->d_mtu = CONFIG_NET_IEEE802154_MTU; #ifdef CONFIG_NET_TCP dev->d_recvwndo = CONFIG_NET_IEEE802154_TCP_RECVWNDO; diff --git a/net/socket/net_close.c b/net/socket/net_close.c index c4d8cfff85..8d657583bd 100644 --- a/net/socket/net_close.c +++ b/net/socket/net_close.c @@ -301,12 +301,12 @@ static inline void netclose_txnotify(FAR struct socket *psock, #ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv4 - else /* if (psock->s_domain == PF_INET6 || psock->s_domain == PF_IEEE802154) */ + else /* if (psock->s_domain == PF_INET6) */ #endif /* CONFIG_NET_IPv4 */ { /* Notify the device driver that send data is available */ - DEBUGASSERT(psock->s_domain == PF_INET6 || psock->s_domain == PF_IEEE802154); + DEBUGASSERT(psock->s_domain == PF_INET6); #ifdef CONFIG_NETDEV_MULTINIC netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr); #else diff --git a/net/socket/net_sendfile.c b/net/socket/net_sendfile.c index e286cb2af7..a8b7b9f162 100644 --- a/net/socket/net_sendfile.c +++ b/net/socket/net_sendfile.c @@ -175,8 +175,7 @@ static uint16_t ack_interrupt(FAR struct net_driver_s *dev, FAR void *pvconn, if (IFF_IS_IPv6(dev->d_flags)) #endif { - DEBUGASSERT(pstate->snd_sock == PF_INET6 || - pstate->snd_sock == PF_IEEE802154); + DEBUGASSERT(pstate->snd_sock == PF_INET6); tcp = TCPIPv6BUF; } #endif /* CONFIG_NET_IPv6 */ @@ -515,14 +514,12 @@ static inline void sendfile_txnotify(FAR struct socket *psock, #ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv4 - else /* if (psock->s_domain == PF_INET6 || psock->s_domain == PF_IEEE802154) */ + else /* if (psock->s_domain == PF_INET6) */ #endif /* CONFIG_NET_IPv4 */ { /* Notify the device driver that send data is available */ - DEBUGASSERT(psock->s_domain == PF_INET6 || - psock->s_domain == PF_IEEE802154); - + DEBUGASSERT(psock->s_domain == PF_INET6); #ifdef CONFIG_NETDEV_MULTINIC netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr); #else diff --git a/net/socket/recvfrom.c b/net/socket/recvfrom.c index a02a1e3acc..a6921315fd 100644 --- a/net/socket/recvfrom.c +++ b/net/socket/recvfrom.c @@ -1024,7 +1024,7 @@ static inline void recvfrom_udpsender(struct net_driver_s *dev, struct recvfrom_ * class of addresses, the IPv4-mapped IPv6 addresses. */ - if (conn->domain == PF_INET6 || conn->domain == PF_IEEE802154) + if (conn->domain == PF_INET6) { FAR struct sockaddr_in6 *infrom6 = (FAR struct sockaddr_in6 *)infrom; FAR socklen_t *fromlen = pstate->rf_fromlen; @@ -1350,12 +1350,12 @@ static inline void recvfrom_udp_rxnotify(FAR struct socket *psock, #ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv4 - else /* if (psock->s_domain == PF_INET6 || psock->s_domain == PF_INET6) */ + else /* if (psock->s_domain == PF_INET6) */ #endif /* CONFIG_NET_IPv4 */ { /* Notify the device driver of the receive ready */ - DEBUGASSERT(psock->s_domain == PF_INET6 || psock->s_domain == PF_INET6); + DEBUGASSERT(psock->s_domain == PF_INET6); #ifdef CONFIG_NETDEV_MULTINIC netdev_ipv6_rxnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr); #else @@ -1892,9 +1892,6 @@ ssize_t psock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, #ifdef CONFIG_NET_IPv6 case PF_INET6: -#ifdef CONFIG_NET_IEEE802145 - case PF_IEEE802154: -#endif { minlen = sizeof(struct sockaddr_in6); } diff --git a/net/socket/socket.c b/net/socket/socket.c index cfe84fdc7e..93fd41a278 100644 --- a/net/socket/socket.c +++ b/net/socket/socket.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/socket/socket.c * - * Copyright (C) 2007-2009, 2012, 2014-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -250,7 +250,7 @@ int psock_socket(int domain, int type, int protocol, FAR struct socket *psock) int ret; int err; - /* Only PF_INET, PF_INET6, PF_PACKET, PF_IEEE802154 domains supported */ + /* Only PF_INET, PF_INET6 or PF_PACKET domains supported */ switch (domain) { @@ -265,9 +265,6 @@ int psock_socket(int domain, int type, int protocol, FAR struct socket *psock) #ifdef CONFIG_NET_IPv6 case PF_INET6: -#ifdef CONFIG_NET_IEEE802154 - case PF_IEEE802154: -#endif #ifdef CONFIG_NET_LOCAL ipdomain = true; #endif diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h index 27692fcce4..2f3284d709 100644 --- a/net/tcp/tcp.h +++ b/net/tcp/tcp.h @@ -149,7 +149,7 @@ struct tcp_conn_s uint8_t sndseq[4]; /* The sequence number that was last sent by us */ uint8_t crefs; /* Reference counts on this instance */ #if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) - uint8_t domain; /* IP domain: PF_INET, PF_INET6, or PF_IEEE802154 */ + uint8_t domain; /* IP domain: PF_INET or PF_INET6 */ #endif uint8_t sa; /* Retransmission time-out calculation state * variable */ diff --git a/net/tcp/tcp_accept.c b/net/tcp/tcp_accept.c index 6bb1bd3d8a..102f8c2213 100644 --- a/net/tcp/tcp_accept.c +++ b/net/tcp/tcp_accept.c @@ -139,9 +139,7 @@ static inline void accept_tcpsender(FAR struct socket *psock, { FAR struct sockaddr_in6 *inaddr = (FAR struct sockaddr_in6 *)addr; - DEBUGASSERT(psock->s_domain == PF_INET6 || - psock->s_domain == PF_IEEE802154); - + DEBUGASSERT(psock->s_domain == PF_INET6); inaddr->sin6_family = AF_INET6; inaddr->sin6_port = conn->rport; net_ipv6addr_copy(inaddr->sin6_addr.s6_addr, conn->u.ipv6.raddr); diff --git a/net/tcp/tcp_conn.c b/net/tcp/tcp_conn.c index ab579a042f..6cc9950fc0 100644 --- a/net/tcp/tcp_conn.c +++ b/net/tcp/tcp_conn.c @@ -977,8 +977,6 @@ FAR struct tcp_conn_s *tcp_alloc_accept(FAR struct net_driver_s *dev, domain = ipv6 ? PF_INET6 : PF_INET; #elif defined(CONFIG_NET_IPv4) domain = PF_INET; -#elif defined(CONFIG_NET_IEEE802154) - domain = PF_IEEE80254; #else /* defined(CONFIG_NET_IPv6) */ domain = PF_INET6; #endif diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index bf14e81434..077a1dbe2e 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -241,13 +241,11 @@ static inline void send_ipselect(FAR struct net_driver_s *dev, tcp_ipv4_select(dev); } - else /* if (psock->s_domain == PF_INET6 || psock->s_domain == PF_IEEE802154) */ + else /* if (psock->s_domain == PF_INET6) */ { /* Select the IPv6 domain */ - DEBUGASSERT(psock->s_domain == PF_INET6 || - psock->s_domain == PF_IEEE802154); - + DEBUGASSERT(psock->s_domain == PF_INET6); tcp_ipv4_select(dev); } } @@ -859,14 +857,12 @@ static inline void send_txnotify(FAR struct socket *psock, #ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv4 - else /* if (psock->s_domain == PF_INET6 || psock->s_domain == PF_IEEE802154) */ + else /* if (psock->s_domain == PF_INET6) */ #endif /* CONFIG_NET_IPv4 */ { /* Notify the device driver that send data is available */ - DEBUGASSERT(psock->s_domain == PF_INET6 || - psock->s_domain == PF_IEEE802154); - + DEBUGASSERT(psock->s_domain == PF_INET6); #ifdef CONFIG_NETDEV_MULTINIC netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr); #else diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index 3d77aea3c6..7c0faac458 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -190,13 +190,11 @@ static inline void tcpsend_ipselect(FAR struct net_driver_s *dev, tcp_ipv4_select(dev); } - else /* if (psock->s_domain == PF_INET6 || psock->s_domain == PF_IEEE802154) */ + else /* if (psock->s_domain == PF_INET6) */ { /* Select the IPv6 domain */ - DEBUGASSERT(psock->s_domain == PF_INET6 || - psock->s_domain == PF_IEEE802154); - + DEBUGASSERT(psock->s_domain == PF_INET6); tcp_ipv4_select(dev); } } @@ -639,14 +637,12 @@ static inline void send_txnotify(FAR struct socket *psock, #ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv4 - else /* if (psock->s_domain == PF_INET6 || psock->s_domain == PF_IEEE802154) */ + else /* if (psock->s_domain == PF_INET6) */ #endif /* CONFIG_NET_IPv4 */ { /* Notify the device driver that send data is available */ - DEBUGASSERT(psock->s_domain == PF_INET6 || - psock->s_domain == PF_IEEE802154); - + DEBUGASSERT(psock->s_domain == PF_INET6); #ifdef CONFIG_NETDEV_MULTINIC netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr); #else diff --git a/net/udp/udp.h b/net/udp/udp.h index 621cf927ac..91447d2596 100644 --- a/net/udp/udp.h +++ b/net/udp/udp.h @@ -85,7 +85,7 @@ struct udp_conn_s union ip_binding_u u; /* IP address binding */ uint16_t lport; /* Bound local port number (network byte order) */ uint16_t rport; /* Remote port number (network byte order) */ - uint8_t domain; /* IP domain: PF_INET, PF_INET6, or PF_IEEE802145 */ + uint8_t domain; /* IP domain: PF_INET or PF_INET6 */ uint8_t ttl; /* Default time-to-live */ uint8_t crefs; /* Reference counts on this instance */ diff --git a/net/udp/udp_callback.c b/net/udp/udp_callback.c index 778581298b..86b733f81a 100644 --- a/net/udp/udp_callback.c +++ b/net/udp/udp_callback.c @@ -130,7 +130,7 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev, FAR struct udp_con * class of addresses, the IPv4-mapped IPv6 addresses. */ - if (conn->domain == PF_INET6 || conn->domain == PF_IEEE802154) + if (conn->domain == PF_INET6) { FAR struct udp_hdr_s *udp = UDPIPv6BUF; FAR struct ipv6_hdr_s *ipv6 = IPv6BUF; diff --git a/net/udp/udp_psock_sendto.c b/net/udp/udp_psock_sendto.c index 60cc465496..71fbe55af1 100644 --- a/net/udp/udp_psock_sendto.c +++ b/net/udp/udp_psock_sendto.c @@ -188,13 +188,11 @@ static inline void sendto_ipselect(FAR struct net_driver_s *dev, udp_ipv4_select(dev); } - else /* if (psock->s_domain == PF_INET6 || psock->s_domain == PF_IEEE802154) */ + else /* if (psock->s_domain == PF_INET6) */ { /* Select the IPv6 domain */ - DEBUGASSERT(psock->s_domain == PF_INET6 || - psock->s_domain == PF_IEEE802154); - + DEBUGASSERT(psock->s_domain == PF_INET6); udp_ipv4_select(dev); } } diff --git a/net/udp/udp_send.c b/net/udp/udp_send.c index 713e043738..b764fade42 100644 --- a/net/udp/udp_send.c +++ b/net/udp/udp_send.c @@ -109,7 +109,7 @@ void udp_send(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn) #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 if (conn->domain == PF_INET || - ((conn->domain == PF_INET6 || conn->domain == PF_IEEE802154) && + (conn->domain == PF_INET6 && ip6_is_ipv4addr((FAR struct in6_addr *)conn->u.ipv6.raddr))) #endif { @@ -135,7 +135,7 @@ void udp_send(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn) net_ipv4addr_hdrcopy(ipv4->srcipaddr, &dev->d_ipaddr); #ifdef CONFIG_NET_IPv6 - if ((conn->domain == PF_INET6 || conn->domain == PF_IEEE802154) && + if (conn->domain == PF_INET6 && ip6_is_ipv4addr((FAR struct in6_addr *)conn->u.ipv6.raddr)) { in_addr_t raddr = ip6_get_ipv4addr((FAR struct in6_addr *)conn->u.ipv6.raddr); @@ -229,7 +229,7 @@ void udp_send(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn) #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 if (conn->domain == PF_INET || - ((conn->domain == PF_INET6 || conn->domain == PF_IEEE802154) && + (conn->domain == PF_INET6 && ip6_is_ipv4addr((FAR struct in6_addr *)conn->u.ipv6.raddr))) #endif {