Remove CONFIG_NET_MULTILINK. This increases code size by a little, but greatly reduces the complexity of the network code.

This commit is contained in:
Gregory Nutt
2017-08-08 15:26:09 -06:00
parent bd7c84b23e
commit aeb59383cf
33 changed files with 171 additions and 554 deletions
-6
View File
@@ -1189,12 +1189,8 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
int intf; int intf;
FAR struct ifreq *ifr = (FAR struct ifreq *)arg; FAR struct ifreq *ifr = (FAR struct ifreq *)arg;
#ifdef CONFIG_NET_MULTILINK
if (!ifr || ((ifr->ifr_flags & IFF_MASK) != IFF_TUN && if (!ifr || ((ifr->ifr_flags & IFF_MASK) != IFF_TUN &&
(ifr->ifr_flags & IFF_MASK) != IFF_TAP)) (ifr->ifr_flags & IFF_MASK) != IFF_TAP))
#else
if (!ifr || (ifr->ifr_flags & IFF_MASK) != IFF_TUN)
#endif
{ {
return -EINVAL; return -EINVAL;
} }
@@ -1226,7 +1222,6 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
priv = filep->f_priv; priv = filep->f_priv;
strncpy(ifr->ifr_name, priv->dev.d_ifname, IFNAMSIZ); strncpy(ifr->ifr_name, priv->dev.d_ifname, IFNAMSIZ);
#ifdef CONFIG_NET_MULTILINK
if ((ifr->ifr_flags & IFF_MASK) == IFF_TAP) if ((ifr->ifr_flags & IFF_MASK) == IFF_TAP)
{ {
/* TAP device -> handling raw Ethernet packets /* TAP device -> handling raw Ethernet packets
@@ -1243,7 +1238,6 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
priv->dev.d_llhdrlen = 0; priv->dev.d_llhdrlen = 0;
} }
#endif
tundev_unlock(tun); tundev_unlock(tun);
@@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* include/nuttx/wireless/spirit/include/spirit_Linearfifo.h * include/nuttx/wireless/spirit/include/spirit_linearfifo.h
* Configuration and management of SPIRIT Fifo. * Configuration and management of SPIRIT Fifo.
* *
* Copyright(c) 2015 STMicroelectronics * Copyright(c) 2015 STMicroelectronics
@@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* drivers/wireless/spirit/lib/spirit_Linearfifo.c * drivers/wireless/spirit/lib/spirit_linearfifo.c
* Configuration and management of SPIRIT Fifo. * Configuration and management of SPIRIT Fifo.
* *
* Copyright(c) 2015 STMicroelectronics * Copyright(c) 2015 STMicroelectronics
@@ -40,7 +40,7 @@
#include <assert.h> #include <assert.h>
#include "spirit_Linearfifo.h" #include "spirit_linearfifo.h"
#include "spirit_spi.h" #include "spirit_spi.h"
/****************************************************************************** /******************************************************************************
+3 -3
View File
@@ -1808,9 +1808,9 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data,
/* But don't let the buffer size exceed the MSS of the socket type. /* But don't let the buffer size exceed the MSS of the socket type.
* *
* In the case where there are multiple network devices with different * In the case where there are multiple network devices with different
* link layer protocols (CONFIG_NET_MULTILINK), each network device * link layer protocols, each network device may support a different
* may support a different UDP MSS value. Here we arbitrarily select * UDP MSS value. Here we arbitrarily select the minimum MSS for
* the minimum MSS for that case. * that case.
*/ */
if (buflen > MIN_IPv4_UDP_MSS) if (buflen > MIN_IPv4_UDP_MSS)
+52 -203
View File
@@ -89,10 +89,6 @@
* can be found. For Ethernet, this should be set to 14. For SLIP, this * can be found. For Ethernet, this should be set to 14. For SLIP, this
* should be set to 0. * should be set to 0.
* *
* If CONFIG_NET_MULTILINK is defined, then multiple link protocols are
* supported concurrently. In this case, the size of link layer header
* varies and is obtained from the network device structure.
*
* There are other device-specific features that at tied to the link layer: * There are other device-specific features that at tied to the link layer:
* *
* - Maximum Transfer Unit (MTU) * - Maximum Transfer Unit (MTU)
@@ -138,132 +134,61 @@
# endif # endif
#endif #endif
#if defined(CONFIG_NET_MULTILINK) /* We are supporting multiple network devices using different link layer
/* We are supporting multiple network devices using different link layer
* protocols. Get the size of the link layer header from the device * protocols. Get the size of the link layer header from the device
* structure. * structure.
*/ */
# define NET_LL_HDRLEN(d) ((d)->d_llhdrlen) #define NET_LL_HDRLEN(d) ((d)->d_llhdrlen)
# define NET_DEV_MTU(d) ((d)->d_mtu) #define NET_DEV_MTU(d) ((d)->d_mtu)
# ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
# define _MIN_ETH_MTU CONFIG_NET_ETH_MTU # define _MIN_ETH_MTU CONFIG_NET_ETH_MTU
# define _MAX_ETH_MTU CONFIG_NET_ETH_MTU # define _MAX_ETH_MTU CONFIG_NET_ETH_MTU
# else #else
# define _MIN_ETH_MTU UINT16_MAX # define _MIN_ETH_MTU UINT16_MAX
# define _MAX_ETH_MTU 0 # define _MAX_ETH_MTU 0
# endif #endif
# ifdef CONFIG_NET_LOOPBACK #ifdef CONFIG_NET_LOOPBACK
# define _MIN_LO_MTU MIN(_MIN_ETH_MTU,1518) # define _MIN_LO_MTU MIN(_MIN_ETH_MTU,1518)
# define _MAX_LO_MTU MAX(_MAX_ETH_MTU,574) # define _MAX_LO_MTU MAX(_MAX_ETH_MTU,574)
# else #else
# define _MIN_LO_MTU _MIN_ETH_MTU # define _MIN_LO_MTU _MIN_ETH_MTU
# define _MAX_LO_MTU _MAX_ETH_MTU # define _MAX_LO_MTU _MAX_ETH_MTU
# endif #endif
# ifdef CONFIG_NET_SLIP #ifdef CONFIG_NET_SLIP
# define _MIN_SLIP_MTU MIN(_MIN_LO_MTU,CONFIG_NET_SLIP_MTU) # define _MIN_SLIP_MTU MIN(_MIN_LO_MTU,CONFIG_NET_SLIP_MTU)
# define _MAX_SLIP_MTU MAX(_MAX_LO_MTU,CONFIG_NET_SLIP_MTU) # define _MAX_SLIP_MTU MAX(_MAX_LO_MTU,CONFIG_NET_SLIP_MTU)
# else #else
# define _MIN_SLIP_MTU _MIN_LO_MTU # define _MIN_SLIP_MTU _MIN_LO_MTU
# define _MAX_SLIP_MTU _MAX_LO_MTU # define _MAX_SLIP_MTU _MAX_LO_MTU
# endif #endif
# ifdef CONFIG_NET_TUN #ifdef CONFIG_NET_TUN
# define _MIN_TUN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_TUN_MTU) # define _MIN_TUN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_TUN_MTU)
# define _MAX_TUN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_TUN_MTU) # define _MAX_TUN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_TUN_MTU)
# else #else
# define _MIN_TUN_MTU _MIN_SLIP_MTU # define _MIN_TUN_MTU _MIN_SLIP_MTU
# define _MAX_TUN_MTU _MAX_SLIP_MTU # define _MAX_TUN_MTU _MAX_SLIP_MTU
# endif #endif
# ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
# define _MIN_6LOWPAN_MTU MIN(_MIN_TUN_MTU,CONFIG_NET_6LOWPAN_MTU) # define _MIN_6LOWPAN_MTU MIN(_MIN_TUN_MTU,CONFIG_NET_6LOWPAN_MTU)
# define _MAX_6LOWPAN_MTU MAX(_MAX_TUN_MTU,CONFIG_NET_6LOWPAN_MTU) # define _MAX_6LOWPAN_MTU MAX(_MAX_TUN_MTU,CONFIG_NET_6LOWPAN_MTU)
# else #else
# define _MIN_6LOWPAN_MTU _MIN_TUN_MTU # define _MIN_6LOWPAN_MTU _MIN_TUN_MTU
# define _MAX_6LOWPAN_MTU _MAX_TUN_MTU # define _MAX_6LOWPAN_MTU _MAX_TUN_MTU
# endif #endif
# define MIN_NET_DEV_MTU _MIN_6LOWPAN_MTU #define MIN_NET_DEV_MTU _MIN_6LOWPAN_MTU
# define MAX_NET_DEV_MTU _MAX_6LOWPAN_MTU #define MAX_NET_DEV_MTU _MAX_6LOWPAN_MTU
/* For the loopback device, we will use the largest MTU */ /* For the loopback device, we will use the largest MTU */
# define NET_LO_MTU MAX_NET_DEV_MTU # define NET_LO_MTU MAX_NET_DEV_MTU
#elif defined(CONFIG_NET_SLIP)
/* There is no link layer header with SLIP */
# ifndef CONFIG_NET_IPv4
# error SLIP requires IPv4 support
# endif
# define NET_LL_HDRLEN(d) 0
# define NET_DEV_MTU(d) CONFIG_NET_SLIP_MTU
# define MIN_NET_DEV_MTU CONFIG_NET_SLIP_MTU
# define MAX_NET_DEV_MTU CONFIG_NET_SLIP_MTU
#elif defined(CONFIG_NET_TUN)
/* There is no link layer header with TUN */
# define NET_LL_HDRLEN(d) 0
# define NET_DEV_MTU(d) CONFIG_NET_TUN_MTU
# define MIN_NET_DEV_MTU CONFIG_NET_TUN_MTU
# define MAX_NET_DEV_MTU CONFIG_NET_TUN_MTU
#elif defined(CONFIG_NET_ETHERNET)
/* Assume standard Ethernet link layer header */
# define NET_LL_HDRLEN(d) 14
# define NET_DEV_MTU(d) CONFIG_NET_ETH_MTU
# define MIN_NET_DEV_MTU CONFIG_NET_ETH_MTU
# define MAX_NET_DEV_MTU CONFIG_NET_ETH_MTU
#elif defined(CONFIG_NET_LOOPBACK)
/* Force the loopback MTU to some reasonable size. We could do something smarter, but
* The case where the local loopback device is the only device is very unusal.
*/
# define NET_LO_MTU 1518
/* Assume standard Ethernet link layer header */
# define NET_LL_HDRLEN(d) 0
# define NET_DEV_MTU(d) NET_LO_MTU
# define MIN_NET_DEV_MTU NET_LO_MTU
# define MAX_NET_DEV_MTU NET_LO_MTU
#elif defined(CONFIG_NET_6LOWPAN)
/* There is no link layer header with 6LoWPAN */
# ifndef CONFIG_NET_IPv6
# error 6LoWPAN requires IP6v support
# endif
# define NET_LL_HDRLEN(d) 0
# define NET_DEV_MTU(d) CONFIG_NET_6LOWPAN_MTU
# define MIN_NET_DEV_MTU CONFIG_NET_6LOWPAN_MTU
# define MAX_NET_DEV_MTU CONFIG_NET_6LOWPAN_MTU
/* For the IEEE802.15.4 MAC device, we will use the packet MTU
* (which is probably much larger than the IEEE802.15.4 fram size)
*/
# define NET_LO_MTU MAX_NET_DEV_MTU
#else
/* Perhaps only Unix domain sockets or the loopback device */
# define NET_LL_HDRLEN(d) 0
# define NET_DEV_MTU(d) 0
# define MIN_NET_DEV_MTU 0
# define MAX_NET_DEV_MTU 0
#endif /* MULTILINK, SLIP, TUN, LOOPBACK, 6LoWOPAN, or ETHERNET */
/* Layer 3/4 Configuration Options ******************************************/ /* Layer 3/4 Configuration Options ******************************************/
/* IP configuration options */ /* IP configuration options */
@@ -324,102 +249,80 @@
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
# define ETH_UDP_MSS(h) (CONFIG_NET_ETH_MTU - ETH_HDRLEN - UDP_HDRLEN - (h)) # define ETH_UDP_MSS(h) (CONFIG_NET_ETH_MTU - ETH_HDRLEN - UDP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_UDP_MSS(h) ETH_UDP_MSS(h)
# define __MAX_UDP_MSS(h) ETH_UDP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
# define IEEE802154_UDP_MSS(h) (CONFIG_NET_6LOWPAN_MTU - UDP_HDRLEN - (h)) # define IEEE802154_UDP_MSS(h) (CONFIG_NET_6LOWPAN_MTU - UDP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_UDP_MSS(h) IEEE802154_UDP_MSS(h)
# define __MAX_UDP_MSS(h) IEEE802154_UDP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_LOOPBACK #ifdef CONFIG_NET_LOOPBACK
# define LO_UDP_MSS(h) (NET_LO_MTU - UDP_HDRLEN - (h)) # define LO_UDP_MSS(h) (NET_LO_MTU - UDP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_UDP_MSS(h) LO_UDP_MSS(h)
# define __MAX_UDP_MSS(h) LO_UDP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_SLIP #ifdef CONFIG_NET_SLIP
# define SLIP_UDP_MSS(h) (CONFIG_NET_SLIP_MTU - UDP_HDRLEN - (h)) # define SLIP_UDP_MSS(h) (CONFIG_NET_SLIP_MTU - UDP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_UDP_MSS(h) SLIP_UDP_MSS(h)
# define __MAX_UDP_MSS(h) SLIP_UDP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_TUN #ifdef CONFIG_NET_TUN
# define TUN_UDP_MSS(h) (CONFIG_NET_TUN_MTU - UDP_HDRLEN - (h)) # define TUN_UDP_MSS(h) (CONFIG_NET_TUN_MTU - UDP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_UDP_MSS(h) TUN_UDP_MSS(h)
# define __MAX_UDP_MSS(h) TUN_UDP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_MULTILINK #ifdef CONFIG_NET_ETHERNET
# ifdef CONFIG_NET_ETHERNET
# define __MIN_UDP_MSS(h) ETH_UDP_MSS(h) # define __MIN_UDP_MSS(h) ETH_UDP_MSS(h)
# define __MAX_UDP_MSS(h) ETH_UDP_MSS(h) # define __MAX_UDP_MSS(h) ETH_UDP_MSS(h)
# define __ETH_MIN_UDP_MSS(h) ETH_UDP_MSS(h) # define __ETH_MIN_UDP_MSS(h) ETH_UDP_MSS(h)
# define __ETH_MAX_UDP_MSS(h) ETH_UDP_MSS(h) # define __ETH_MAX_UDP_MSS(h) ETH_UDP_MSS(h)
# else #else
# define __ETH_MIN_UDP_MSS(h) INT_MAX # define __ETH_MIN_UDP_MSS(h) INT_MAX
# define __ETH_MAX_UDP_MSS(h) 0 # define __ETH_MAX_UDP_MSS(h) 0
# endif #endif
# ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
# undef __MIN_UDP_MSS # undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS # undef __MIN_UDP_MSS
# define __MIN_UDP_MSS(h) MIN(IEEE802154_UDP_MSS(h),__ETH_MIN_UDP_MSS(h)) # define __MIN_UDP_MSS(h) MIN(IEEE802154_UDP_MSS(h),__ETH_MIN_UDP_MSS(h))
# define __MAX_UDP_MSS(h) MAX(IEEE802154_UDP_MSS(h),__ETH_MAX_UDP_MSS(h)) # define __MAX_UDP_MSS(h) MAX(IEEE802154_UDP_MSS(h),__ETH_MAX_UDP_MSS(h))
# define __6LOWPAN_MIN_UDP_MSS(h) MIN(IEEE802154_UDP_MSS(h),__ETH_MIN_UDP_MSS(h)) # define __6LOWPAN_MIN_UDP_MSS(h) MIN(IEEE802154_UDP_MSS(h),__ETH_MIN_UDP_MSS(h))
# define __6LOWPAN_MAX_UDP_MSS(h) MAX(IEEE802154_UDP_MSS(h),__ETH_MAX_UDP_MSS(h)) # define __6LOWPAN_MAX_UDP_MSS(h) MAX(IEEE802154_UDP_MSS(h),__ETH_MAX_UDP_MSS(h))
# else #else
# define __6LOWPAN_MIN_UDP_MSS(h) __ETH_MIN_UDP_MSS(h) # define __6LOWPAN_MIN_UDP_MSS(h) __ETH_MIN_UDP_MSS(h)
# define __6LOWPAN_MAX_UDP_MSS(h) __ETH_MAX_UDP_MSS(h) # define __6LOWPAN_MAX_UDP_MSS(h) __ETH_MAX_UDP_MSS(h)
# endif #endif
# ifdef CONFIG_NET_LOOPBACK #ifdef CONFIG_NET_LOOPBACK
# undef __MIN_UDP_MSS # undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS # undef __MIN_UDP_MSS
# define __MIN_UDP_MSS(h) MIN(LO_UDP_MSS(h),__6LOWPAN_MIN_UDP_MSS(h)) # define __MIN_UDP_MSS(h) MIN(LO_UDP_MSS(h),__6LOWPAN_MIN_UDP_MSS(h))
# define __MAX_UDP_MSS(h) MAX(LO_UDP_MSS(h),__6LOWPAN_MAX_UDP_MSS(h)) # define __MAX_UDP_MSS(h) MAX(LO_UDP_MSS(h),__6LOWPAN_MAX_UDP_MSS(h))
# define __LOOP_MIN_UDP_MSS(h) MIN(LO_UDP_MSS(h),__6LOWPAN_MIN_UDP_MSS(h)) # define __LOOP_MIN_UDP_MSS(h) MIN(LO_UDP_MSS(h),__6LOWPAN_MIN_UDP_MSS(h))
# define __LOOP_MAX_UDP_MSS(h) MAX(LO_UDP_MSS(h),__6LOWPAN_MAX_UDP_MSS(h)) # define __LOOP_MAX_UDP_MSS(h) MAX(LO_UDP_MSS(h),__6LOWPAN_MAX_UDP_MSS(h))
# else #else
# define __LOOP_MIN_UDP_MSS(h) __6LOWPAN_MIN_UDP_MSS(h) # define __LOOP_MIN_UDP_MSS(h) __6LOWPAN_MIN_UDP_MSS(h)
# define __LOOP_MAX_UDP_MSS(h) __6LOWPAN_MAX_UDP_MSS(h) # define __LOOP_MAX_UDP_MSS(h) __6LOWPAN_MAX_UDP_MSS(h)
# endif #endif
# ifdef CONFIG_NET_SLIP #ifdef CONFIG_NET_SLIP
# undef __MIN_UDP_MSS # undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS # undef __MIN_UDP_MSS
# define __MIN_UDP_MSS(h) MIN(SLIP_UDP_MSS(h),__LOOP_MIN_UDP_MSS(h)) # define __MIN_UDP_MSS(h) MIN(SLIP_UDP_MSS(h),__LOOP_MIN_UDP_MSS(h))
# define __MAX_UDP_MSS(h) MAX(SLIP_UDP_MSS(h),__LOOP_MAX_UDP_MSS(h)) # define __MAX_UDP_MSS(h) MAX(SLIP_UDP_MSS(h),__LOOP_MAX_UDP_MSS(h))
# define __SLIP_MIN_UDP_MSS(h) MIN(SLIP_UDP_MSS(h),__LOOP_MIN_UDP_MSS(h)) # define __SLIP_MIN_UDP_MSS(h) MIN(SLIP_UDP_MSS(h),__LOOP_MIN_UDP_MSS(h))
# define __SLIP_MAX_UDP_MSS(h) MAX(SLIP_UDP_MSS(h),__LOOP_MAX_UDP_MSS(h)) # define __SLIP_MAX_UDP_MSS(h) MAX(SLIP_UDP_MSS(h),__LOOP_MAX_UDP_MSS(h))
# else #else
# define __SLIP_MIN_UDP_MSS(h) __LOOP_MIN_UDP_MSS(h) # define __SLIP_MIN_UDP_MSS(h) __LOOP_MIN_UDP_MSS(h)
# define __SLIP_MAX_UDP_MSS(h) __LOOP_MAX_UDP_MSS(h) # define __SLIP_MAX_UDP_MSS(h) __LOOP_MAX_UDP_MSS(h)
# endif #endif
# ifdef CONFIG_NET_TUN #ifdef CONFIG_NET_TUN
# undef __MIN_UDP_MSS # undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS # undef __MIN_UDP_MSS
# define __MIN_UDP_MSS(h) MIN(TUN_UDP_MSS(h),__SLIP_MIN_UDP_MSS(h)) # define __MIN_UDP_MSS(h) MIN(TUN_UDP_MSS(h),__SLIP_MIN_UDP_MSS(h))
# define __MAX_UDP_MSS(h) MAX(TUN_UDP_MSS(h),__SLIP_MAX_UDP_MSS(h)) # define __MAX_UDP_MSS(h) MAX(TUN_UDP_MSS(h),__SLIP_MAX_UDP_MSS(h))
# define __TUN_MIN_UDP_MSS(h) MIN(TUN_UDP_MSS(h),__SLIP_MIN_UDP_MSS(h)) # define __TUN_MIN_UDP_MSS(h) MIN(TUN_UDP_MSS(h),__SLIP_MIN_UDP_MSS(h))
# define __TUN_MAX_UDP_MSS(h) MAX(TUN_UDP_MSS(h),__SLIP_MAX_UDP_MSS(h)) # define __TUN_MAX_UDP_MSS(h) MAX(TUN_UDP_MSS(h),__SLIP_MAX_UDP_MSS(h))
# else #else
# define __TUN_MIN_UDP_MSS(h) __SLIP_MIN_UDP_MSS(h) # define __TUN_MIN_UDP_MSS(h) __SLIP_MIN_UDP_MSS(h)
# define __TUN_MAX_UDP_MSS(h) __SLIP_MAX_UDP_MSS(h) # define __TUN_MAX_UDP_MSS(h) __SLIP_MAX_UDP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv4
@@ -507,9 +410,8 @@
* than NET_DEV_MTU(dev) - NET_LL_HDRLEN(dev) - IPvN_HDRLEN - TCP_HDRLEN. * than NET_DEV_MTU(dev) - NET_LL_HDRLEN(dev) - IPvN_HDRLEN - TCP_HDRLEN.
* *
* In the case where there are multiple network devices with different * In the case where there are multiple network devices with different
* link layer protocols (CONFIG_NET_MULTILINK), each network device * link layer protocols, each network device may support a different UDP
* may support a different UDP MSS value. Here we arbitrarily select * MSS value. Here we arbitrarily select the minimum MSS for that case.
* the minimum MSS for that case.
* *
* REVISIT: TCP_HDRLEN is not really a constant! * REVISIT: TCP_HDRLEN is not really a constant!
*/ */
@@ -520,103 +422,80 @@
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
# define ETH_TCP_MSS(h) (CONFIG_NET_ETH_MTU - ETH_HDRLEN - TCP_HDRLEN - (h)) # define ETH_TCP_MSS(h) (CONFIG_NET_ETH_MTU - ETH_HDRLEN - TCP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_TCP_MSS(h) ETH_TCP_MSS(h)
# define __MAX_TCP_MSS(h) ETH_TCP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
# define IEEE802154_TCP_MSS(h) (CONFIG_NET_6LOWPAN_MTU - TCP_HDRLEN - (h)) # define IEEE802154_TCP_MSS(h) (CONFIG_NET_6LOWPAN_MTU - TCP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_TCP_MSS(h) IEEE802154_TCP_MSS(h)
# define __MAX_TCP_MSS(h) IEEE802154_TCP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_LOOPBACK #ifdef CONFIG_NET_LOOPBACK
# define LO_TCP_MSS(h) (NET_LO_MTU - TCP_HDRLEN - (h)) # define LO_TCP_MSS(h) (NET_LO_MTU - TCP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_TCP_MSS(h) LO_TCP_MSS(h)
# define __MAX_TCP_MSS(h) LO_TCP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_SLIP #ifdef CONFIG_NET_SLIP
# define SLIP_TCP_MSS(h) (CONFIG_NET_SLIP_MTU - TCP_HDRLEN - (h)) # define SLIP_TCP_MSS(h) (CONFIG_NET_SLIP_MTU - TCP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_TCP_MSS(h) SLIP_TCP_MSS(h)
# define __MAX_TCP_MSS(h) SLIP_TCP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_TUN #ifdef CONFIG_NET_TUN
# define TUN_TCP_MSS(h) (CONFIG_NET_TUN_MTU - TCP_HDRLEN - (h)) # define TUN_TCP_MSS(h) (CONFIG_NET_TUN_MTU - TCP_HDRLEN - (h))
# ifndef CONFIG_NET_MULTILINK
# define __MIN_TCP_MSS(h) TUN_TCP_MSS(h)
# define __MAX_TCP_MSS(h) TUN_TCP_MSS(h)
# endif
#endif #endif
#ifdef CONFIG_NET_MULTILINK #ifdef CONFIG_NET_ETHERNET
# ifdef CONFIG_NET_ETHERNET
# define __MIN_TCP_MSS(h) ETH_TCP_MSS(h) # define __MIN_TCP_MSS(h) ETH_TCP_MSS(h)
# define __MAX_TCP_MSS(h) ETH_TCP_MSS(h) # define __MAX_TCP_MSS(h) ETH_TCP_MSS(h)
# define __ETH_MIN_TCP_MSS(h) ETH_TCP_MSS(h) # define __ETH_MIN_TCP_MSS(h) ETH_TCP_MSS(h)
# define __ETH_MAX_TCP_MSS(h) ETH_TCP_MSS(h) # define __ETH_MAX_TCP_MSS(h) ETH_TCP_MSS(h)
# else #else
# define __ETH_MIN_TCP_MSS(h) INT_MAX # define __ETH_MIN_TCP_MSS(h) INT_MAX
# define __ETH_MAX_TCP_MSS(h) 0 # define __ETH_MAX_TCP_MSS(h) 0
# endif #endif
# ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
# undef __MIN_TCP_MSS # undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS # undef __MAX_TCP_MSS
# define __MIN_TCP_MSS(h) MIN(IEEE802154_TCP_MSS(h),__ETH_MIN_TCP_MSS(h)) # define __MIN_TCP_MSS(h) MIN(IEEE802154_TCP_MSS(h),__ETH_MIN_TCP_MSS(h))
# define __MAX_TCP_MSS(h) MAX(IEEE802154_TCP_MSS(h),__ETH_MAX_TCP_MSS(h)) # define __MAX_TCP_MSS(h) MAX(IEEE802154_TCP_MSS(h),__ETH_MAX_TCP_MSS(h))
# define __6LOWPAN_MIN_TCP_MSS(h) MIN(IEEE802154_TCP_MSS(h),__ETH_MIN_TCP_MSS(h)) # define __6LOWPAN_MIN_TCP_MSS(h) MIN(IEEE802154_TCP_MSS(h),__ETH_MIN_TCP_MSS(h))
# define __6LOWPAN_MAX_TCP_MSS(h) MAX(IEEE802154_TCP_MSS(h),__ETH_MAX_TCP_MSS(h)) # define __6LOWPAN_MAX_TCP_MSS(h) MAX(IEEE802154_TCP_MSS(h),__ETH_MAX_TCP_MSS(h))
# else #else
# define __6LOWPAN_MIN_TCP_MSS(h) __ETH_MIN_TCP_MSS(h) # define __6LOWPAN_MIN_TCP_MSS(h) __ETH_MIN_TCP_MSS(h)
# define __6LOWPAN_MAX_TCP_MSS(h) __ETH_MAX_TCP_MSS(h) # define __6LOWPAN_MAX_TCP_MSS(h) __ETH_MAX_TCP_MSS(h)
# endif #endif
# ifdef CONFIG_NET_LOOPBACK #ifdef CONFIG_NET_LOOPBACK
# undef __MIN_TCP_MSS # undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS # undef __MAX_TCP_MSS
# define __MIN_TCP_MSS(h) MIN(LO_TCP_MSS(h),__6LOWPAN_MIN_TCP_MSS(h)) # define __MIN_TCP_MSS(h) MIN(LO_TCP_MSS(h),__6LOWPAN_MIN_TCP_MSS(h))
# define __MAX_TCP_MSS(h) MAX(LO_TCP_MSS(h),__6LOWPAN_MAX_TCP_MSS(h)) # define __MAX_TCP_MSS(h) MAX(LO_TCP_MSS(h),__6LOWPAN_MAX_TCP_MSS(h))
# define __LOOP_MIN_TCP_MSS(h) MIN(LO_TCP_MSS(h),__6LOWPAN_MIN_TCP_MSS(h)) # define __LOOP_MIN_TCP_MSS(h) MIN(LO_TCP_MSS(h),__6LOWPAN_MIN_TCP_MSS(h))
# define __LOOP_MAX_TCP_MSS(h) MAX(LO_TCP_MSS(h),__6LOWPAN_MAX_TCP_MSS(h)) # define __LOOP_MAX_TCP_MSS(h) MAX(LO_TCP_MSS(h),__6LOWPAN_MAX_TCP_MSS(h))
# else #else
# define __LOOP_MIN_TCP_MSS(h) __6LOWPAN_MIN_TCP_MSS(h) # define __LOOP_MIN_TCP_MSS(h) __6LOWPAN_MIN_TCP_MSS(h)
# define __LOOP_MAX_TCP_MSS(h) __6LOWPAN_MAX_TCP_MSS(h) # define __LOOP_MAX_TCP_MSS(h) __6LOWPAN_MAX_TCP_MSS(h)
# endif #endif
# ifdef CONFIG_NET_SLIP #ifdef CONFIG_NET_SLIP
# undef __MIN_TCP_MSS # undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS # undef __MAX_TCP_MSS
# define __MIN_TCP_MSS(h) MIN(SLIP_TCP_MSS(h),__LOOP_MIN_TCP_MSS(h)) # define __MIN_TCP_MSS(h) MIN(SLIP_TCP_MSS(h),__LOOP_MIN_TCP_MSS(h))
# define __MAX_TCP_MSS(h) MAX(SLIP_TCP_MSS(h),__LOOP_MAX_TCP_MSS(h)) # define __MAX_TCP_MSS(h) MAX(SLIP_TCP_MSS(h),__LOOP_MAX_TCP_MSS(h))
# define __SLIP_MIN_TCP_MSS(h) MIN(SLIP_TCP_MSS(h),__LOOP_MIN_TCP_MSS(h)) # define __SLIP_MIN_TCP_MSS(h) MIN(SLIP_TCP_MSS(h),__LOOP_MIN_TCP_MSS(h))
# define __SLIP_MAX_TCP_MSS(h) MAX(SLIP_TCP_MSS(h),__LOOP_MAX_TCP_MSS(h)) # define __SLIP_MAX_TCP_MSS(h) MAX(SLIP_TCP_MSS(h),__LOOP_MAX_TCP_MSS(h))
# else #else
# define __SLIP_MIN_TCP_MSS(h) __LOOP_MIN_TCP_MSS(h) # define __SLIP_MIN_TCP_MSS(h) __LOOP_MIN_TCP_MSS(h)
# define __SLIP_MAX_TCP_MSS(h) __LOOP_MAX_TCP_MSS(h) # define __SLIP_MAX_TCP_MSS(h) __LOOP_MAX_TCP_MSS(h)
# endif #endif
# ifdef CONFIG_NET_TUN #ifdef CONFIG_NET_TUN
# undef __MIN_TCP_MSS # undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS # undef __MAX_TCP_MSS
# define __MIN_TCP_MSS(h) MIN(TUN_TCP_MSS(h),__SLIP_MIN_TCP_MSS(h)) # define __MIN_TCP_MSS(h) MIN(TUN_TCP_MSS(h),__SLIP_MIN_TCP_MSS(h))
# define __MAX_TCP_MSS(h) MAX(TUN_TCP_MSS(h),__SLIP_MAX_TCP_MSS(h)) # define __MAX_TCP_MSS(h) MAX(TUN_TCP_MSS(h),__SLIP_MAX_TCP_MSS(h))
# define __TUN_MIN_TCP_MSS(h) MIN(TUN_TCP_MSS(h),__SLIP_MIN_TCP_MSS(h)) # define __TUN_MIN_TCP_MSS(h) MIN(TUN_TCP_MSS(h),__SLIP_MIN_TCP_MSS(h))
# define __TUN_MAX_TCP_MSS(h) MAX(TUN_TCP_MSS(h),__SLIP_MAX_TCP_MSS(h)) # define __TUN_MAX_TCP_MSS(h) MAX(TUN_TCP_MSS(h),__SLIP_MAX_TCP_MSS(h))
# else #else
# define __TUN_MIN_TCP_MSS(h) __SLIP_MIN_TCP_MSS(h) # define __TUN_MIN_TCP_MSS(h) __SLIP_MIN_TCP_MSS(h)
# define __TUN_MAX_TCP_MSS(h) __SLIP_MAX_TCP_MSS(h) # define __TUN_MAX_TCP_MSS(h) __SLIP_MAX_TCP_MSS(h)
# endif
#endif #endif
/* If IPv4 is supported, it will have the larger MSS. /* If IPv4 is supported, it will have the larger MSS.
@@ -653,8 +532,6 @@
* Should be set low (i.e., to the size of the d_buf buffer) is the * Should be set low (i.e., to the size of the d_buf buffer) is the
* application is slow to process incoming data, or high (32768 bytes) * application is slow to process incoming data, or high (32768 bytes)
* if the application processes data quickly. * if the application processes data quickly.
*
* See the note above regarding the TCP MSS and CONFIG_NET_MULTILINK.
*/ */
#define NET_LO_TCP_RECVWNDO LO_TCP_MSS(0) #define NET_LO_TCP_RECVWNDO LO_TCP_MSS(0)
@@ -677,40 +554,12 @@
# endif # endif
#endif #endif
#if defined(CONFIG_NET_MULTILINK) /* We are supporting multiple network devices using different link layer
/* We are supporting multiple network devices using different link layer
* protocols. Get the size of the receive window from the device * protocols. Get the size of the receive window from the device
* structure. * structure.
*/ */
# define NET_DEV_RCVWNDO(d) ((d)->d_recvwndo) #define NET_DEV_RCVWNDO(d) ((d)->d_recvwndo)
#elif defined(CONFIG_NET_ETHERNET)
/* Only Ethernet.. use the configured Ethernet receive window size */
# define NET_DEV_RCVWNDO(d) CONFIG_NET_ETH_TCP_RECVWNDO
#elif defined(CONFIG_NET_6LOWPAN)
/* Only 6LoWPAN.. use the configured 6LoWPAN receive window size */
# define NET_DEV_RCVWNDO(d) CONFIG_NET_6LOWPAN_TCP_RECVWNDO
#elif defined(CONFIG_NET_SLIP)
/* Only SLIP.. use the configured SLIP receive window size */
# define NET_DEV_RCVWNDO(d) CONFIG_NET_SLIP_TCP_RECVWNDO
#elif defined(CONFIG_NET_TUN)
/* Only SLIP.. use the configured SLIP receive window size */
# define NET_DEV_RCVWNDO(d) CONFIG_NET_TUN_TCP_RECVWNDO
#else /* if defined(CONFIG_NET_LOOPBACK) */
/* Only loal loopback.. use the fixed loopback receive window size */
# define NET_DEV_RCVWNDO(d) NET_LO_TCP_RECVWNDO
#endif /* MULTILINK, ETHERNET, 6LoWPAN, SLIP, TUN, or LOOPBACK */
/* How long a connection should stay in the TIME_WAIT state. /* How long a connection should stay in the TIME_WAIT state.
* *
-14
View File
@@ -227,7 +227,6 @@ struct net_driver_s
uint8_t d_flags; uint8_t d_flags;
#ifdef CONFIG_NET_MULTILINK
/* Multi network devices using multiple data links protocols are selected */ /* Multi network devices using multiple data links protocols are selected */
uint8_t d_lltype; /* See enum net_lltype_e */ uint8_t d_lltype; /* See enum net_lltype_e */
@@ -236,7 +235,6 @@ struct net_driver_s
#ifdef CONFIG_NET_TCP #ifdef CONFIG_NET_TCP
uint16_t d_recvwndo; /* TCP receive window size */ uint16_t d_recvwndo; /* TCP receive window size */
#endif #endif
#endif
#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_NET_6LOWPAN) #if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_NET_6LOWPAN)
/* Link layer address */ /* Link layer address */
@@ -674,13 +672,7 @@ uint16_t ipv6_chksum(FAR struct net_driver_s *dev);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv4
#if defined(CONFIG_NET_MULTILINK)
# define netdev_ipv4_hdrlen(dev) (dev->d_llhdrlen) # define netdev_ipv4_hdrlen(dev) (dev->d_llhdrlen)
#elif defined(CONFIG_NET_ETHERNET)
# define netdev_ipv4_hdrlen(dev) ETH_HDRLEN
#else /* if defined(CONFIG_NET_SLIP) */
# define netdev_ipv4_hdrlen(dev) 0
#endif
#endif /* CONFIG_NET_IPv4 */ #endif /* CONFIG_NET_IPv4 */
/**************************************************************************** /****************************************************************************
@@ -695,13 +687,7 @@ uint16_t ipv6_chksum(FAR struct net_driver_s *dev);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv6
#if defined(CONFIG_NET_MULTILINK)
# define netdev_ipv6_hdrlen(dev) dev->d_llhdrlen # define netdev_ipv6_hdrlen(dev) dev->d_llhdrlen
#elif defined(CONFIG_NET_ETHERNET)
# define netdev_ipv6_hdrlen(dev) ETH_HDRLEN
#else /* if defined(CONFIG_NET_SLIP) */
# define netdev_ipv6_hdrlen(dev) 0
#endif
#endif /* CONFIG_NET_IPv6 */ #endif /* CONFIG_NET_IPv6 */
#endif /* __INCLUDE_NUTTX_NET_NETDEV_H */ #endif /* __INCLUDE_NUTTX_NET_NETDEV_H */
-10
View File
@@ -110,10 +110,6 @@ endmenu # Driver buffer configuration
menu "Data link support" menu "Data link support"
config NET_MULTILINK
bool
default n
config NET_USER_DEVFMT config NET_USER_DEVFMT
bool "User provided devfmt" bool "User provided devfmt"
default n default n
@@ -124,7 +120,6 @@ config NET_USER_DEVFMT
config NET_ETHERNET config NET_ETHERNET
bool "Ethernet support" bool "Ethernet support"
default y default y
select NET_MULTILINK if NET_6LOWPAN || NET_LOOPBACK || NET_SLIP || NET_TUN
---help--- ---help---
If NET_SLIP is not selected, then Ethernet will be used (there is If NET_SLIP is not selected, then Ethernet will be used (there is
no need to define anything special in the configuration file to use no need to define anything special in the configuration file to use
@@ -133,8 +128,6 @@ config NET_ETHERNET
config NET_6LOWPAN config NET_6LOWPAN
bool "6LoWPAN support" bool "6LoWPAN support"
default n default n
select NET_MULTILINK if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN
select NET_MULTILINK if WIRELESS_IEEE802 && WIRELESS_PKTRADIO
select NETDEV_IOCTL select NETDEV_IOCTL
select NET_HAVE_STAR select NET_HAVE_STAR
depends on NET_IPv6 depends on NET_IPv6
@@ -145,14 +138,12 @@ config NET_6LOWPAN
config NET_LOOPBACK config NET_LOOPBACK
bool "Local loopback" bool "Local loopback"
default n default n
select NET_MULTILINK if NET_ETHERNET || NET_6LOWPAN || NET_SLIP || NET_TUN
---help--- ---help---
Add support for the local network loopback device, lo. Add support for the local network loopback device, lo.
config NET_SLIP config NET_SLIP
bool "SLIP support" bool "SLIP support"
default n default n
select NET_MULTILINK if NET_ETHERNET || NET_6LOWPAN || NET_LOOPBACK || NET_TUN
---help--- ---help---
Enables building of the SLIP driver. SLIP requires Enables building of the SLIP driver. SLIP requires
at least one IP protocol selected. at least one IP protocol selected.
@@ -198,7 +189,6 @@ endif # NET_SLIP
config NET_TUN config NET_TUN
bool "TUN Virtual Network Device support" bool "TUN Virtual Network Device support"
default n default n
select NET_MULTILINK if NET_ETHERNET || NET_6LOWPAN || NET_LOOPBACK || NET_SLIP
select ARCH_HAVE_NETDEV_STATISTICS select ARCH_HAVE_NETDEV_STATISTICS
if NET_TUN if NET_TUN
-2
View File
@@ -231,7 +231,6 @@ int arp_send(in_addr_t ipaddr)
goto errout; goto errout;
} }
#ifdef CONFIG_NET_MULTILINK
/* ARP support is only built if the Ethernet data link is supported. /* ARP support is only built if the Ethernet data link is supported.
* Continue and send the ARP request only if this device uses the * Continue and send the ARP request only if this device uses the
* Ethernet data link protocol. * Ethernet data link protocol.
@@ -241,7 +240,6 @@ int arp_send(in_addr_t ipaddr)
{ {
return OK; return OK;
} }
#endif
/* Check if the destination address is on the local network. */ /* Check if the destination address is on the local network. */
-4
View File
@@ -124,12 +124,8 @@ static void devif_packet_conversion(FAR struct net_driver_s *dev,
{ {
if (dev->d_len > 0) if (dev->d_len > 0)
{ {
#ifdef CONFIG_NET_MULTILINK
/* Handle the case where multiple link layer protocols are supported */
if (dev->d_lltype == NET_LL_IEEE802154 || if (dev->d_lltype == NET_LL_IEEE802154 ||
dev->d_lltype == NET_LL_PKTRADIO) dev->d_lltype == NET_LL_PKTRADIO)
#endif
{ {
FAR struct ipv6_hdr_s *ipv6 = (FAR struct ipv6_hdr_s *)dev->d_buf; FAR struct ipv6_hdr_s *ipv6 = (FAR struct ipv6_hdr_s *)dev->d_buf;
-12
View File
@@ -410,13 +410,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
* logic will be called to create the IEEE80215.4 frames. * logic will be called to create the IEEE80215.4 frames.
*/ */
#ifdef CONFIG_NET_MULTILINK
/* Handle the case where multiple link layer protocols are supported */
if (dev->d_len > 0 && dev->d_lltype == CONFIG_NET_6LOWPAN) if (dev->d_len > 0 && dev->d_lltype == CONFIG_NET_6LOWPAN)
#else
if (dev->d_len > 0)
#endif
{ {
/* Let 6LoWPAN handle the TCP output */ /* Let 6LoWPAN handle the TCP output */
@@ -460,13 +454,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
* logic will be called to create the IEEE80215.4 frames. * logic will be called to create the IEEE80215.4 frames.
*/ */
#ifdef CONFIG_NET_MULTILINK
/* Handle the case where multiple link layer protocols are supported */
if (dev->d_len > 0 && dev->d_lltype == CONFIG_NET_6LOWPAN) if (dev->d_len > 0 && dev->d_lltype == CONFIG_NET_6LOWPAN)
#else
if (dev->d_len > 0)
#endif
{ {
/* Let 6LoWPAN handle the ICMPv6 output */ /* Let 6LoWPAN handle the ICMPv6 output */
-2
View File
@@ -93,10 +93,8 @@ struct icmpv6_notify_s
struct icmpv6_rnotify_s struct icmpv6_rnotify_s
{ {
#ifdef CONFIG_NET_MULTILINK
FAR struct icmpv6_notify_s *rn_flink; /* Supports singly linked list */ FAR struct icmpv6_notify_s *rn_flink; /* Supports singly linked list */
char rn_ifname[IFNAMSIZ]; /* Device name */ char rn_ifname[IFNAMSIZ]; /* Device name */
#endif
sem_t rn_sem; /* Will wake up the waiter */ sem_t rn_sem; /* Will wake up the waiter */
int rn_result; /* The result of the wait */ int rn_result; /* The result of the wait */
}; };
-2
View File
@@ -164,9 +164,7 @@ void icmpv6_advertise(FAR struct net_driver_s *dev,
* and use our MAC as the new source address * and use our MAC as the new source address
*/ */
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET) if (dev->d_lltype == NET_LL_ETHERNET)
#endif
{ {
FAR struct eth_hdr_s *eth = ETHBUF; FAR struct eth_hdr_s *eth = ETHBUF;
-2
View File
@@ -356,7 +356,6 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev)
DEBUGASSERT(dev); DEBUGASSERT(dev);
ninfo("Auto-configuring %s\n", dev->d_ifname); ninfo("Auto-configuring %s\n", dev->d_ifname);
#ifdef CONFIG_NET_MULTILINK
/* Only Ethernet devices are supported for now */ /* Only Ethernet devices are supported for now */
if (dev->d_lltype != NET_LL_ETHERNET) if (dev->d_lltype != NET_LL_ETHERNET)
@@ -364,7 +363,6 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev)
nerr("ERROR: Only Ethernet is supported\n"); nerr("ERROR: Only Ethernet is supported\n");
return -ENOSYS; return -ENOSYS;
} }
#endif
/* The interface should be in the down state */ /* The interface should be in the down state */
+1 -21
View File
@@ -74,27 +74,7 @@
#define ICMPv6RADVERTISE \ #define ICMPv6RADVERTISE \
((struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) ((struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN])
#if defined(CONFIG_NET_MULTILINK) #define DEV_LLTYPE(d) ((d)->d_lltype)
# define DEV_LLTYPE(d) ((d)->d_lltype)
#elif defined(CONFIG_NET_ETHERNET)
# define DEV_LLTYPE(d) NET_LL_ETHERNET
#elif defined(CONFIG_NET_6LOWPAN)
# if defined(CONFIG_WIRELESS_IEEE802154)
# define DEV_LLTYPE(d) NET_LL_IEEE802154
# elif defined(CONFIG_WIRELESS_PKTRADIO)
# define DEV_LLTYPE(d) NET_LL_PKTRADIO
# endif
#elif defined(CONFIG_NET_SLIP)
# define DEV_LLTYPE(d) NET_LL_SLIP
#elif defined(CONFIG_NET_TUN)
# define DEV_LLTYPE(d) NET_LL_TUN
#else /* if defined(CONFIG_NET_LOOPBACK) */
# define DEV_LLTYPE(d) NET_LL_LOOPBACK
#endif
/****************************************************************************
* Public Data
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
+1 -3
View File
@@ -229,19 +229,17 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr)
goto errout; goto errout;
} }
#ifdef CONFIG_NET_MULTILINK
* Continue and send the Neighbor Solicitation request only if this * Continue and send the Neighbor Solicitation request only if this
* device uses the Ethernet data link protocol. * device uses the Ethernet data link protocol.
* *
* REVISIT: Other link layer protocols may require Neighbor Discovery * REVISIT: Other link layer protocols may require Neighbor Discovery
* as well (but not SLIP which is the only other option at the moment). * as well.
*/ */
if (dev->d_lltype != NET_LL_ETHERNET) if (dev->d_lltype != NET_LL_ETHERNET)
{ {
return OK; return OK;
} }
#endif
/* Check if the destination address is on the local network. */ /* Check if the destination address is on the local network. */
-2
View File
@@ -211,9 +211,7 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev)
* and use our MAC as the new source address * and use our MAC as the new source address
*/ */
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET) if (dev->d_lltype == NET_LL_ETHERNET)
#endif
{ {
FAR struct eth_hdr_s *eth = ETHBUF; FAR struct eth_hdr_s *eth = ETHBUF;
-2
View File
@@ -155,9 +155,7 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev)
dev->d_len = IPv6_HDRLEN + l3size; dev->d_len = IPv6_HDRLEN + l3size;
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET) if (dev->d_lltype == NET_LL_ETHERNET)
#endif
{ {
/* Set the destination IPv6 all-routers multicast Ethernet /* Set the destination IPv6 all-routers multicast Ethernet
* address * address
-2
View File
@@ -168,9 +168,7 @@ void icmpv6_solicit(FAR struct net_driver_s *dev,
dev->d_len = IPv6_HDRLEN + l3size; dev->d_len = IPv6_HDRLEN + l3size;
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET) if (dev->d_lltype == NET_LL_ETHERNET)
#endif
{ {
FAR struct eth_hdr_s *eth; FAR struct eth_hdr_s *eth;
-3
View File
@@ -277,7 +277,6 @@ static uint16_t psock_connect_interrupt(FAR struct net_driver_s *dev,
psock_teardown_callbacks(pstate, pstate->tc_result); psock_teardown_callbacks(pstate, pstate->tc_result);
#ifdef CONFIG_NET_MULTILINK
/* When we set up the connection structure, we did not know the size /* When we set up the connection structure, we did not know the size
* of the initial MSS. Now that the connection is associated with a * of the initial MSS. Now that the connection is associated with a
* network device, we now know the size of link layer header and can * network device, we now know the size of link layer header and can
@@ -312,8 +311,6 @@ static uint16_t psock_connect_interrupt(FAR struct net_driver_s *dev,
pstate->tc_conn->dev == dev); pstate->tc_conn->dev == dev);
pstate->tc_conn->dev = dev; pstate->tc_conn->dev = dev;
#endif /* CONFIG_NET_MULTILINK */
/* Wake up the waiting thread */ /* Wake up the waiting thread */
sem_post(&pstate->tc_sem); sem_post(&pstate->tc_sem);
-2
View File
@@ -147,12 +147,10 @@ static inline bool ipfwd_addrchk(FAR struct forward_s *fwd)
/* REVISIT: Could the MAC address not also be in a routing table? */ /* REVISIT: Could the MAC address not also be in a routing table? */
#ifdef CONFIG_NET_MULTILINK
if (fwd->f_dev->d_lltype != NET_LL_ETHERNET) if (fwd->f_dev->d_lltype != NET_LL_ETHERNET)
{ {
return true; return true;
} }
#endif
#ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv6
+2 -8
View File
@@ -74,12 +74,8 @@ static int ipfwd_packet_proto(FAR struct net_driver_s *dev)
if (dev->d_len > (IPv6_HDRLEN + llhdrlen)) if (dev->d_len > (IPv6_HDRLEN + llhdrlen))
{ {
#ifdef CONFIG_NET_MULTILINK
/* Handle the case where multiple link layer protocols are supported */
if (dev->d_lltype == NET_LL_IEEE802154 || if (dev->d_lltype == NET_LL_IEEE802154 ||
dev->d_lltype == NET_LL_PKTRADIO) dev->d_lltype == NET_LL_PKTRADIO)
#endif
{ {
/* There should be an IPv6 packet at the beginning of the buffer */ /* There should be an IPv6 packet at the beginning of the buffer */
@@ -112,13 +108,11 @@ static void ipfwd_packet_conversion(FAR struct net_driver_s *dev, int proto)
{ {
if (dev->d_len > 0) if (dev->d_len > 0)
{ {
#ifdef CONFIG_NET_MULTILINK
/* Handle the case where multiple link layer protocols are supported */
if (dev->d_lltype == NET_LL_IEEE802154 || if (dev->d_lltype == NET_LL_IEEE802154 ||
dev->d_lltype == NET_LL_PKTRADIO) dev->d_lltype == NET_LL_PKTRADIO)
#endif
{ {
FAR struct ipv6_hdr_s *ipv6 = (FAR struct ipv6_hdr_s *)dev->d_buf;
#ifdef CONFIG_NET_TCP #ifdef CONFIG_NET_TCP
if (proto == IP_PROTO_TCP) if (proto == IP_PROTO_TCP)
{ {
-4
View File
@@ -205,16 +205,12 @@ static int ipv6_packet_conversion(FAR struct net_driver_s *dev,
if (dev->d_len > 0) if (dev->d_len > 0)
{ {
#ifdef CONFIG_NET_MULTILINK
/* Handle the case where multiple link layer protocols are supported */
if (fwddev->d_lltype != NET_LL_IEEE802154 && if (fwddev->d_lltype != NET_LL_IEEE802154 &&
fwddev->d_lltype != NET_LL_PKTRADIO) fwddev->d_lltype != NET_LL_PKTRADIO)
{ {
nwarn("WARNING: Unsupported link layer... Not forwarded\n"); nwarn("WARNING: Unsupported link layer... Not forwarded\n");
} }
else else
#endif
#ifdef CONFIG_NET_TCP #ifdef CONFIG_NET_TCP
if (ipv6->proto == IP_PROTO_TCP) if (ipv6->proto == IP_PROTO_TCP)
{ {
-2
View File
@@ -74,9 +74,7 @@
struct neighbor_addr_s struct neighbor_addr_s
{ {
#ifdef CONFIG_NET_MULTILINK
uint8_t na_lltype; uint8_t na_lltype;
#endif
uint8_t na_llsize; uint8_t na_llsize;
union union
-6
View File
@@ -96,12 +96,8 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype,
break; break;
} }
#ifdef CONFIG_NET_MULTILINK
if (g_neighbors[i].ne_addr.na_lltype == lltype && if (g_neighbors[i].ne_addr.na_lltype == lltype &&
net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr)) net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr))
#else
if (net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr))
#endif
{ {
oldest_ndx = i; oldest_ndx = i;
break; break;
@@ -121,9 +117,7 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype,
g_neighbors[oldest_ndx].ne_time = 0; g_neighbors[oldest_ndx].ne_time = 0;
net_ipv6addr_copy(g_neighbors[oldest_ndx].ne_ipaddr, ipaddr); net_ipv6addr_copy(g_neighbors[oldest_ndx].ne_ipaddr, ipaddr);
#ifdef CONFIG_NET_MULTILINK
g_neighbors[oldest_ndx].ne_addr.na_lltype = lltype; g_neighbors[oldest_ndx].ne_addr.na_lltype = lltype;
#endif
g_neighbors[oldest_ndx].ne_addr.na_llsize = netdev_type_lladdrsize(lltype); g_neighbors[oldest_ndx].ne_addr.na_llsize = netdev_type_lladdrsize(lltype);
memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr, memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr,
+1 -30
View File
@@ -47,31 +47,6 @@
#include <nuttx/net/ip.h> #include <nuttx/net/ip.h>
/****************************************************************************
* Public Data
****************************************************************************/
/* If there is only one supported link layer, then the size of the link
* layer address is a constant.
*
* NOTE: Literal constants are used here to avoid bringing in all of the
* header files where they are correctly defined.
*/
#ifndef CONFIG_NET_MULTILINK
# if defined(CONFIG_NET_ETHERNET)
# define NETDEV_LLADDRSIZE 6 /* IFHWADDRLEN */
# elif defined(CONFIG_NET_6LOWPAN)
# ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR
# define NETDEV_LLADDRSIZE 10 /* NET_6LOWPAN_EADDRSIZE */
# else
# define NETDEV_LLADDRSIZE 2 /* NET_6LOWPAN_SADDRSIZE */
# endif
# else
# define NETDEV_LLADDRSIZE 0 /* No link layer address */
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/
@@ -458,11 +433,7 @@ int netdev_type_lladdrsize(uint8_t lltype);
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NET_MULTILINK #define netdev_dev_lladdrsize(dev) netdev_type_lladdrsize((dev)->d_lltype)
# define netdev_dev_lladdrsize(dev) netdev_type_lladdrsize((dev)->d_lltype)
#else
# define netdev_dev_lladdrsize(dev) NETDEV_LLADDRSIZE
#endif
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
-24
View File
@@ -380,11 +380,7 @@ static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
/* Find the device with this name */ /* Find the device with this name */
dev = netdev_findbyname(ifname); dev = netdev_findbyname(ifname);
#ifdef CONFIG_NET_MULTILINK
if (dev != NULL && dev->d_lltype == NET_LL_IEEE802154) if (dev != NULL && dev->d_lltype == NET_LL_IEEE802154)
#else
if (dev != NULL)
#endif
{ {
/* Perform the device IOCTL */ /* Perform the device IOCTL */
@@ -447,11 +443,7 @@ static int netdev_pktradio_ioctl(FAR struct socket *psock, int cmd,
/* Find the device with this name */ /* Find the device with this name */
dev = netdev_findbyname(ifname); dev = netdev_findbyname(ifname);
#ifdef CONFIG_NET_MULTILINK
if (dev != NULL && dev->d_lltype == NET_LL_PKTRADIO) if (dev != NULL && dev->d_lltype == NET_LL_PKTRADIO)
#else
if (dev != NULL)
#endif
{ {
/* Perform the device IOCTL */ /* Perform the device IOCTL */
@@ -825,11 +817,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
if (dev) if (dev)
{ {
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET) if (dev->d_lltype == NET_LL_ETHERNET)
#else
if (true)
#endif
{ {
req->ifr_hwaddr.sa_family = AF_INETX; req->ifr_hwaddr.sa_family = AF_INETX;
memcpy(req->ifr_hwaddr.sa_data, memcpy(req->ifr_hwaddr.sa_data,
@@ -840,12 +828,8 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
#endif #endif
#ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_IEEE802154 || if (dev->d_lltype == NET_LL_IEEE802154 ||
dev->d_lltype == NET_LL_PKTRADIO) dev->d_lltype == NET_LL_PKTRADIO)
#else
if (true)
#endif
{ {
req->ifr_hwaddr.sa_family = AF_INETX; req->ifr_hwaddr.sa_family = AF_INETX;
memcpy(req->ifr_hwaddr.sa_data, memcpy(req->ifr_hwaddr.sa_data,
@@ -868,11 +852,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
if (dev) if (dev)
{ {
#ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_ETHERNET
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET) if (dev->d_lltype == NET_LL_ETHERNET)
#else
if (true)
#endif
{ {
memcpy(dev->d_mac.ether.ether_addr_octet, memcpy(dev->d_mac.ether.ether_addr_octet,
req->ifr_hwaddr.sa_data, IFHWADDRLEN); req->ifr_hwaddr.sa_data, IFHWADDRLEN);
@@ -882,12 +862,8 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
#endif #endif
#ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_IEEE802154 || if (dev->d_lltype == NET_LL_IEEE802154 ||
dev->d_lltype == NET_LL_PKTRADIO) dev->d_lltype == NET_LL_PKTRADIO)
#else
if (true)
#endif
{ {
FAR struct sixlowpan_driver_s *radio; FAR struct sixlowpan_driver_s *radio;
struct sixlowpan_properties_s properties; struct sixlowpan_properties_s properties;
+4 -33
View File
@@ -82,16 +82,6 @@
# define NETDEV_DEFAULT_FORMAT NETDEV_LO_FORMAT # define NETDEV_DEFAULT_FORMAT NETDEV_LO_FORMAT
#endif #endif
/****************************************************************************
* Private Data
****************************************************************************/
/* Then next available device number */
#ifndef CONFIG_NET_MULTILINK
static int g_next_devnum = 0;
#endif
/**************************************************************************** /****************************************************************************
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/
@@ -119,7 +109,6 @@ struct net_driver_s *g_netdevices = NULL;
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NET_MULTILINK
static int find_devnum(FAR const char *devfmt) static int find_devnum(FAR const char *devfmt)
{ {
FAR struct net_driver_s *curr; FAR struct net_driver_s *curr;
@@ -151,7 +140,6 @@ static int find_devnum(FAR const char *devfmt)
return result; return result;
} }
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@@ -187,11 +175,8 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
if (dev != NULL) if (dev != NULL)
{ {
#ifdef CONFIG_NET_MULTILINK /* Set the protocol used by the device and the size of the link
/* We are supporting multiple network devices and using different link * header used by this protocol.
* level protocols. Set the protocol usd by the device and the size
* level protocols. Set the protocol used by the device and the size
* of the link header used by this protocol.
*/ */
switch (lltype) switch (lltype)
@@ -273,12 +258,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
dev->d_lltype = (uint8_t)lltype; dev->d_lltype = (uint8_t)lltype;
#else
/* Use the default device name */
devfmt = NETDEV_DEFAULT_FORMAT;
#endif
/* There are no clients of the device yet */ /* There are no clients of the device yet */
dev->d_conncb = NULL; dev->d_conncb = NULL;
@@ -290,8 +269,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
net_lock(); net_lock();
#ifdef CONFIG_NET_MULTILINK #ifdef CONFIG_NET_LOOPBACK
# ifdef CONFIG_NET_LOOPBACK
/* The local loopback device is a special case: There can be only one /* The local loopback device is a special case: There can be only one
* local loopback device so it is unnumbered. * local loopback device so it is unnumbered.
*/ */
@@ -301,17 +279,10 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
devnum = 0; devnum = 0;
} }
else else
# endif #endif
{ {
devnum = find_devnum(devfmt); devnum = find_devnum(devfmt);
} }
#else
/* There is only a single link type. Finding the next network device
* number is simple.
*/
devnum = g_next_devnum++;
#endif
#ifdef CONFIG_NET_USER_DEVFMT #ifdef CONFIG_NET_USER_DEVFMT
if (*dev->d_ifname) if (*dev->d_ifname)
+2 -35
View File
@@ -196,9 +196,8 @@ static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile)
status = "DOWN"; status = "DOWN";
} }
#if defined(CONFIG_NET_MULTILINK) /* Select the output appropriate for the link type associated with
/* If there are multiple link types being supported, then selected the * this device.
* output appropriate for the link type associated with this device.
*/ */
switch (dev->d_lltype) switch (dev->d_lltype)
@@ -256,38 +255,6 @@ static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile)
len += snprintf(&netfile->line[len], NET_LINELEN - len, len += snprintf(&netfile->line[len], NET_LINELEN - len,
" at %s\n", status); " at %s\n", status);
#elif defined(CONFIG_NET_ETHERNET)
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:Ethernet HWaddr %s at %s\n",
dev->d_ifname, ether_ntoa(&dev->d_mac.ether), status);
#elif defined(CONFIG_NET_6LOWPAN)
len += netprocfs_6lowpan_linklayer(netfile, len);
len += snprintf(&netfile->line[len], NET_LINELEN - len,
" at %s\n", status);
#elif defined(CONFIG_NET_LOOPBACK)
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:Local Loopback at %s\n",
dev->d_ifname, status);
#elif defined(CONFIG_NET_SLIP)
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:SLIP at %s\n",
dev->d_ifname, status);
#elif defined(CONFIG_NET_PPP)
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:P-t-P at %s\n",
dev->d_ifname, status);
#elif defined(CONFIG_NET_TUN)
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:TUN at %s\n",
dev->d_ifname, status);
#endif
return len; return len;
} }
-2
View File
@@ -161,7 +161,6 @@ static uint16_t send_interrupt(FAR struct net_driver_s *dev,
ninfo("flags: %04x: %d\n", flags); ninfo("flags: %04x: %d\n", flags);
#ifdef CONFIG_NET_MULTILINK
/* Verify that this is a compatible network driver. */ /* Verify that this is a compatible network driver. */
if (dev->d_lltype != NET_LL_IEEE802154 && if (dev->d_lltype != NET_LL_IEEE802154 &&
@@ -170,7 +169,6 @@ static uint16_t send_interrupt(FAR struct net_driver_s *dev,
ninfo("Not a compatible network device\n"); ninfo("Not a compatible network device\n");
return flags; return flags;
} }
#endif
/* REVISIT: Verify that this is the correct IEEE802.15.4 network driver to /* REVISIT: Verify that this is the correct IEEE802.15.4 network driver to
* route the outgoing frame(s). Chances are that there is only one * route the outgoing frame(s). Chances are that there is only one
-4
View File
@@ -350,7 +350,6 @@ static uint16_t tcp_send_interrupt(FAR struct net_driver_s *dev,
struct ipv6tcp_hdr_s ipv6tcp; struct ipv6tcp_hdr_s ipv6tcp;
int ret; int ret;
#ifdef CONFIG_NET_MULTILINK
/* Verify that this is an IEEE802.15.4 network driver. */ /* Verify that this is an IEEE802.15.4 network driver. */
if (dev->d_lltype != NET_LL_IEEE802154 && if (dev->d_lltype != NET_LL_IEEE802154 &&
@@ -359,7 +358,6 @@ static uint16_t tcp_send_interrupt(FAR struct net_driver_s *dev,
ninfo("Not a compatible network device\n"); ninfo("Not a compatible network device\n");
return flags; return flags;
} }
#endif
/* The TCP socket is connected and, hence, should be bound to a device. /* The TCP socket is connected and, hence, should be bound to a device.
* Make sure that the polling device is the one that we are bound to. * Make sure that the polling device is the one that we are bound to.
@@ -803,7 +801,6 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
return (ssize_t)-ENETUNREACH; return (ssize_t)-ENETUNREACH;
} }
#ifdef CONFIG_NET_MULTILINK
/* Some network devices support different link layer protocols. /* Some network devices support different link layer protocols.
* Check if this device has the hooks to support 6LoWPAN. * Check if this device has the hooks to support 6LoWPAN.
*/ */
@@ -814,7 +811,6 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
nwarn("WARNING: Not a compatible network device\n"); nwarn("WARNING: Not a compatible network device\n");
return (ssize_t)-ENONET; return (ssize_t)-ENONET;
} }
#endif
#ifdef CONFIG_NET_ICMPv6_NEIGHBOR #ifdef CONFIG_NET_ICMPv6_NEIGHBOR
/* Make sure that the IP address mapping is in the Neighbor Table */ /* Make sure that the IP address mapping is in the Neighbor Table */
-2
View File
@@ -213,7 +213,6 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
return (ssize_t)-ENETUNREACH; return (ssize_t)-ENETUNREACH;
} }
#ifdef CONFIG_NET_MULTILINK
/* Some network devices support different link layer protocols. /* Some network devices support different link layer protocols.
* Check if this device has the hooks to support 6LoWPAN. * Check if this device has the hooks to support 6LoWPAN.
*/ */
@@ -224,7 +223,6 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
nwarn("WARNING: Not a compatible network device\n"); nwarn("WARNING: Not a compatible network device\n");
return (ssize_t)-ENONET; return (ssize_t)-ENONET;
} }
#endif
#ifdef CONFIG_NET_ICMPv6_NEIGHBOR #ifdef CONFIG_NET_ICMPv6_NEIGHBOR
/* Make sure that the IP address mapping is in the Neighbor Table */ /* Make sure that the IP address mapping is in the Neighbor Table */
-2
View File
@@ -284,12 +284,10 @@ static inline bool psock_send_addrchck(FAR struct tcp_conn_s *conn)
{ {
/* REVISIT: Could the MAC address not also be in a routing table? */ /* REVISIT: Could the MAC address not also be in a routing table? */
#ifdef CONFIG_NET_MULTILINK
if (conn->dev->d_lltype != NET_LL_ETHERNET) if (conn->dev->d_lltype != NET_LL_ETHERNET)
{ {
return true; return true;
} }
#endif
#ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv6
-2
View File
@@ -235,12 +235,10 @@ static inline bool psock_send_addrchck(FAR struct tcp_conn_s *conn)
{ {
/* REVISIT: Could the MAC address not also be in a routing table? */ /* REVISIT: Could the MAC address not also be in a routing table? */
#ifdef CONFIG_NET_MULTILINK
if (conn->dev->d_lltype != NET_LL_ETHERNET) if (conn->dev->d_lltype != NET_LL_ETHERNET)
{ {
return true; return true;
} }
#endif
#ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv6