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

View file

@ -1189,12 +1189,8 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
int intf;
FAR struct ifreq *ifr = (FAR struct ifreq *)arg;
#ifdef CONFIG_NET_MULTILINK
if (!ifr || ((ifr->ifr_flags & IFF_MASK) != IFF_TUN &&
(ifr->ifr_flags & IFF_MASK) != IFF_TAP))
#else
if (!ifr || (ifr->ifr_flags & IFF_MASK) != IFF_TUN)
#endif
{
return -EINVAL;
}
@ -1226,7 +1222,6 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
priv = filep->f_priv;
strncpy(ifr->ifr_name, priv->dev.d_ifname, IFNAMSIZ);
#ifdef CONFIG_NET_MULTILINK
if ((ifr->ifr_flags & IFF_MASK) == IFF_TAP)
{
/* 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;
}
#endif
tundev_unlock(tun);

View file

@ -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.
*
* Copyright(c) 2015 STMicroelectronics

View file

@ -1,5 +1,5 @@
/******************************************************************************
* drivers/wireless/spirit/lib/spirit_Linearfifo.c
* drivers/wireless/spirit/lib/spirit_linearfifo.c
* Configuration and management of SPIRIT Fifo.
*
* Copyright(c) 2015 STMicroelectronics
@ -40,7 +40,7 @@
#include <assert.h>
#include "spirit_Linearfifo.h"
#include "spirit_linearfifo.h"
#include "spirit_spi.h"
/******************************************************************************

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.
*
* In the case where there are multiple network devices with different
* link layer protocols (CONFIG_NET_MULTILINK), each network device
* may support a different UDP MSS value. Here we arbitrarily select
* the minimum MSS for that case.
* link layer protocols, each network device may support a different
* UDP MSS value. Here we arbitrarily select the minimum MSS for
* that case.
*/
if (buflen > MIN_IPv4_UDP_MSS)

View file

@ -89,10 +89,6 @@
* can be found. For Ethernet, this should be set to 14. For SLIP, this
* 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:
*
* - Maximum Transfer Unit (MTU)
@ -138,132 +134,61 @@
# endif
#endif
#if defined(CONFIG_NET_MULTILINK)
/* We are supporting multiple network devices using different link layer
* protocols. Get the size of the link layer header from the device
* structure.
*/
/* We are supporting multiple network devices using different link layer
* protocols. Get the size of the link layer header from the device
* structure.
*/
# define NET_LL_HDRLEN(d) ((d)->d_llhdrlen)
# define NET_DEV_MTU(d) ((d)->d_mtu)
#define NET_LL_HDRLEN(d) ((d)->d_llhdrlen)
#define NET_DEV_MTU(d) ((d)->d_mtu)
# ifdef CONFIG_NET_ETHERNET
# define _MIN_ETH_MTU CONFIG_NET_ETH_MTU
# define _MAX_ETH_MTU CONFIG_NET_ETH_MTU
# else
# define _MIN_ETH_MTU UINT16_MAX
# define _MAX_ETH_MTU 0
# endif
#ifdef CONFIG_NET_ETHERNET
# define _MIN_ETH_MTU CONFIG_NET_ETH_MTU
# define _MAX_ETH_MTU CONFIG_NET_ETH_MTU
#else
# define _MIN_ETH_MTU UINT16_MAX
# define _MAX_ETH_MTU 0
#endif
# ifdef CONFIG_NET_LOOPBACK
# define _MIN_LO_MTU MIN(_MIN_ETH_MTU,1518)
# define _MAX_LO_MTU MAX(_MAX_ETH_MTU,574)
# else
# define _MIN_LO_MTU _MIN_ETH_MTU
# define _MAX_LO_MTU _MAX_ETH_MTU
# endif
#ifdef CONFIG_NET_LOOPBACK
# define _MIN_LO_MTU MIN(_MIN_ETH_MTU,1518)
# define _MAX_LO_MTU MAX(_MAX_ETH_MTU,574)
#else
# define _MIN_LO_MTU _MIN_ETH_MTU
# define _MAX_LO_MTU _MAX_ETH_MTU
#endif
# ifdef CONFIG_NET_SLIP
# define _MIN_SLIP_MTU MIN(_MIN_LO_MTU,CONFIG_NET_SLIP_MTU)
# define _MAX_SLIP_MTU MAX(_MAX_LO_MTU,CONFIG_NET_SLIP_MTU)
# else
# define _MIN_SLIP_MTU _MIN_LO_MTU
# define _MAX_SLIP_MTU _MAX_LO_MTU
# endif
#ifdef CONFIG_NET_SLIP
# define _MIN_SLIP_MTU MIN(_MIN_LO_MTU,CONFIG_NET_SLIP_MTU)
# define _MAX_SLIP_MTU MAX(_MAX_LO_MTU,CONFIG_NET_SLIP_MTU)
#else
# define _MIN_SLIP_MTU _MIN_LO_MTU
# define _MAX_SLIP_MTU _MAX_LO_MTU
#endif
# ifdef CONFIG_NET_TUN
# define _MIN_TUN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_TUN_MTU)
# define _MAX_TUN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_TUN_MTU)
# else
# define _MIN_TUN_MTU _MIN_SLIP_MTU
# define _MAX_TUN_MTU _MAX_SLIP_MTU
# endif
#ifdef CONFIG_NET_TUN
# define _MIN_TUN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_TUN_MTU)
# define _MAX_TUN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_TUN_MTU)
#else
# define _MIN_TUN_MTU _MIN_SLIP_MTU
# define _MAX_TUN_MTU _MAX_SLIP_MTU
#endif
# ifdef CONFIG_NET_6LOWPAN
# define _MIN_6LOWPAN_MTU MIN(_MIN_TUN_MTU,CONFIG_NET_6LOWPAN_MTU)
# define _MAX_6LOWPAN_MTU MAX(_MAX_TUN_MTU,CONFIG_NET_6LOWPAN_MTU)
# else
# define _MIN_6LOWPAN_MTU _MIN_TUN_MTU
# define _MAX_6LOWPAN_MTU _MAX_TUN_MTU
# endif
#ifdef CONFIG_NET_6LOWPAN
# define _MIN_6LOWPAN_MTU MIN(_MIN_TUN_MTU,CONFIG_NET_6LOWPAN_MTU)
# define _MAX_6LOWPAN_MTU MAX(_MAX_TUN_MTU,CONFIG_NET_6LOWPAN_MTU)
#else
# define _MIN_6LOWPAN_MTU _MIN_TUN_MTU
# define _MAX_6LOWPAN_MTU _MAX_TUN_MTU
#endif
# define MIN_NET_DEV_MTU _MIN_6LOWPAN_MTU
# define MAX_NET_DEV_MTU _MAX_6LOWPAN_MTU
#define MIN_NET_DEV_MTU _MIN_6LOWPAN_MTU
#define MAX_NET_DEV_MTU _MAX_6LOWPAN_MTU
/* For the loopback device, we will use the largest 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 ******************************************/
/* IP configuration options */
@ -324,102 +249,80 @@
#ifdef CONFIG_NET_ETHERNET
# 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
#ifdef CONFIG_NET_6LOWPAN
# 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
#ifdef CONFIG_NET_LOOPBACK
# 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
#ifdef CONFIG_NET_SLIP
# 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
#ifdef CONFIG_NET_TUN
# 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
#ifdef CONFIG_NET_MULTILINK
# ifdef CONFIG_NET_ETHERNET
# define __MIN_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_MAX_UDP_MSS(h) ETH_UDP_MSS(h)
# else
# define __ETH_MIN_UDP_MSS(h) INT_MAX
# define __ETH_MAX_UDP_MSS(h) 0
# endif
#ifdef CONFIG_NET_ETHERNET
# define __MIN_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_MAX_UDP_MSS(h) ETH_UDP_MSS(h)
#else
# define __ETH_MIN_UDP_MSS(h) INT_MAX
# define __ETH_MAX_UDP_MSS(h) 0
#endif
# ifdef CONFIG_NET_6LOWPAN
# undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS
# 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 __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))
# else
# define __6LOWPAN_MIN_UDP_MSS(h) __ETH_MIN_UDP_MSS(h)
# define __6LOWPAN_MAX_UDP_MSS(h) __ETH_MAX_UDP_MSS(h)
# endif
#ifdef CONFIG_NET_6LOWPAN
# undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS
# 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 __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))
#else
# define __6LOWPAN_MIN_UDP_MSS(h) __ETH_MIN_UDP_MSS(h)
# define __6LOWPAN_MAX_UDP_MSS(h) __ETH_MAX_UDP_MSS(h)
#endif
# ifdef CONFIG_NET_LOOPBACK
# undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS
# 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 __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))
# else
# define __LOOP_MIN_UDP_MSS(h) __6LOWPAN_MIN_UDP_MSS(h)
# define __LOOP_MAX_UDP_MSS(h) __6LOWPAN_MAX_UDP_MSS(h)
# endif
#ifdef CONFIG_NET_LOOPBACK
# undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS
# 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 __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))
#else
# define __LOOP_MIN_UDP_MSS(h) __6LOWPAN_MIN_UDP_MSS(h)
# define __LOOP_MAX_UDP_MSS(h) __6LOWPAN_MAX_UDP_MSS(h)
#endif
# ifdef CONFIG_NET_SLIP
# undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS
# 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 __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))
# else
# define __SLIP_MIN_UDP_MSS(h) __LOOP_MIN_UDP_MSS(h)
# define __SLIP_MAX_UDP_MSS(h) __LOOP_MAX_UDP_MSS(h)
# endif
#ifdef CONFIG_NET_SLIP
# undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS
# 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 __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))
#else
# define __SLIP_MIN_UDP_MSS(h) __LOOP_MIN_UDP_MSS(h)
# define __SLIP_MAX_UDP_MSS(h) __LOOP_MAX_UDP_MSS(h)
#endif
# ifdef CONFIG_NET_TUN
# undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS
# 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 __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))
# else
# define __TUN_MIN_UDP_MSS(h) __SLIP_MIN_UDP_MSS(h)
# define __TUN_MAX_UDP_MSS(h) __SLIP_MAX_UDP_MSS(h)
# endif
#ifdef CONFIG_NET_TUN
# undef __MIN_UDP_MSS
# undef __MIN_UDP_MSS
# 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 __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))
#else
# define __TUN_MIN_UDP_MSS(h) __SLIP_MIN_UDP_MSS(h)
# define __TUN_MAX_UDP_MSS(h) __SLIP_MAX_UDP_MSS(h)
#endif
#ifdef CONFIG_NET_IPv4
@ -507,9 +410,8 @@
* than NET_DEV_MTU(dev) - NET_LL_HDRLEN(dev) - IPvN_HDRLEN - TCP_HDRLEN.
*
* In the case where there are multiple network devices with different
* link layer protocols (CONFIG_NET_MULTILINK), each network device
* may support a different UDP MSS value. Here we arbitrarily select
* the minimum MSS for that case.
* link layer protocols, each network device may support a different UDP
* MSS value. Here we arbitrarily select the minimum MSS for that case.
*
* REVISIT: TCP_HDRLEN is not really a constant!
*/
@ -520,103 +422,80 @@
#ifdef CONFIG_NET_ETHERNET
# 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
#ifdef CONFIG_NET_6LOWPAN
# 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
#ifdef CONFIG_NET_LOOPBACK
# 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
#ifdef CONFIG_NET_SLIP
# 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
#ifdef CONFIG_NET_TUN
# 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
#ifdef CONFIG_NET_MULTILINK
#ifdef CONFIG_NET_ETHERNET
# define __MIN_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_MAX_TCP_MSS(h) ETH_TCP_MSS(h)
#else
# define __ETH_MIN_TCP_MSS(h) INT_MAX
# define __ETH_MAX_TCP_MSS(h) 0
#endif
# ifdef CONFIG_NET_ETHERNET
# define __MIN_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_MAX_TCP_MSS(h) ETH_TCP_MSS(h)
# else
# define __ETH_MIN_TCP_MSS(h) INT_MAX
# define __ETH_MAX_TCP_MSS(h) 0
# endif
#ifdef CONFIG_NET_6LOWPAN
# undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS
# 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 __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))
#else
# define __6LOWPAN_MIN_TCP_MSS(h) __ETH_MIN_TCP_MSS(h)
# define __6LOWPAN_MAX_TCP_MSS(h) __ETH_MAX_TCP_MSS(h)
#endif
# ifdef CONFIG_NET_6LOWPAN
# undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS
# 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 __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))
# else
# define __6LOWPAN_MIN_TCP_MSS(h) __ETH_MIN_TCP_MSS(h)
# define __6LOWPAN_MAX_TCP_MSS(h) __ETH_MAX_TCP_MSS(h)
# endif
#ifdef CONFIG_NET_LOOPBACK
# undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS
# 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 __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))
#else
# define __LOOP_MIN_TCP_MSS(h) __6LOWPAN_MIN_TCP_MSS(h)
# define __LOOP_MAX_TCP_MSS(h) __6LOWPAN_MAX_TCP_MSS(h)
#endif
# ifdef CONFIG_NET_LOOPBACK
# undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS
# 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 __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))
# else
# define __LOOP_MIN_TCP_MSS(h) __6LOWPAN_MIN_TCP_MSS(h)
# define __LOOP_MAX_TCP_MSS(h) __6LOWPAN_MAX_TCP_MSS(h)
# endif
#ifdef CONFIG_NET_SLIP
# undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS
# 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 __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))
#else
# define __SLIP_MIN_TCP_MSS(h) __LOOP_MIN_TCP_MSS(h)
# define __SLIP_MAX_TCP_MSS(h) __LOOP_MAX_TCP_MSS(h)
#endif
# ifdef CONFIG_NET_SLIP
# undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS
# 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 __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))
# else
# define __SLIP_MIN_TCP_MSS(h) __LOOP_MIN_TCP_MSS(h)
# define __SLIP_MAX_TCP_MSS(h) __LOOP_MAX_TCP_MSS(h)
# endif
# ifdef CONFIG_NET_TUN
# undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS
# 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 __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))
# else
# define __TUN_MIN_TCP_MSS(h) __SLIP_MIN_TCP_MSS(h)
# define __TUN_MAX_TCP_MSS(h) __SLIP_MAX_TCP_MSS(h)
# endif
#ifdef CONFIG_NET_TUN
# undef __MIN_TCP_MSS
# undef __MAX_TCP_MSS
# 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 __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))
#else
# define __TUN_MIN_TCP_MSS(h) __SLIP_MIN_TCP_MSS(h)
# define __TUN_MAX_TCP_MSS(h) __SLIP_MAX_TCP_MSS(h)
#endif
/* 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
* application is slow to process incoming data, or high (32768 bytes)
* 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)
@ -677,40 +554,12 @@
# endif
#endif
#if defined(CONFIG_NET_MULTILINK)
/* We are supporting multiple network devices using different link layer
* protocols. Get the size of the receive window from the device
* structure.
*/
/* We are supporting multiple network devices using different link layer
* protocols. Get the size of the receive window from the device
* structure.
*/
# 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 */
#define NET_DEV_RCVWNDO(d) ((d)->d_recvwndo)
/* How long a connection should stay in the TIME_WAIT state.
*

View file

@ -227,7 +227,6 @@ struct net_driver_s
uint8_t d_flags;
#ifdef CONFIG_NET_MULTILINK
/* Multi network devices using multiple data links protocols are selected */
uint8_t d_lltype; /* See enum net_lltype_e */
@ -236,7 +235,6 @@ struct net_driver_s
#ifdef CONFIG_NET_TCP
uint16_t d_recvwndo; /* TCP receive window size */
#endif
#endif
#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_NET_6LOWPAN)
/* Link layer address */
@ -674,13 +672,7 @@ uint16_t ipv6_chksum(FAR struct net_driver_s *dev);
****************************************************************************/
#ifdef CONFIG_NET_IPv4
#if defined(CONFIG_NET_MULTILINK)
# 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 */
/****************************************************************************
@ -695,13 +687,7 @@ uint16_t ipv6_chksum(FAR struct net_driver_s *dev);
****************************************************************************/
#ifdef CONFIG_NET_IPv6
#if defined(CONFIG_NET_MULTILINK)
# 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 /* __INCLUDE_NUTTX_NET_NETDEV_H */

View file

@ -110,10 +110,6 @@ endmenu # Driver buffer configuration
menu "Data link support"
config NET_MULTILINK
bool
default n
config NET_USER_DEVFMT
bool "User provided devfmt"
default n
@ -124,7 +120,6 @@ config NET_USER_DEVFMT
config NET_ETHERNET
bool "Ethernet support"
default y
select NET_MULTILINK if NET_6LOWPAN || NET_LOOPBACK || NET_SLIP || NET_TUN
---help---
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
@ -133,8 +128,6 @@ config NET_ETHERNET
config NET_6LOWPAN
bool "6LoWPAN support"
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 NET_HAVE_STAR
depends on NET_IPv6
@ -145,14 +138,12 @@ config NET_6LOWPAN
config NET_LOOPBACK
bool "Local loopback"
default n
select NET_MULTILINK if NET_ETHERNET || NET_6LOWPAN || NET_SLIP || NET_TUN
---help---
Add support for the local network loopback device, lo.
config NET_SLIP
bool "SLIP support"
default n
select NET_MULTILINK if NET_ETHERNET || NET_6LOWPAN || NET_LOOPBACK || NET_TUN
---help---
Enables building of the SLIP driver. SLIP requires
at least one IP protocol selected.
@ -198,7 +189,6 @@ endif # NET_SLIP
config NET_TUN
bool "TUN Virtual Network Device support"
default n
select NET_MULTILINK if NET_ETHERNET || NET_6LOWPAN || NET_LOOPBACK || NET_SLIP
select ARCH_HAVE_NETDEV_STATISTICS
if NET_TUN

View file

@ -231,7 +231,6 @@ int arp_send(in_addr_t ipaddr)
goto errout;
}
#ifdef CONFIG_NET_MULTILINK
/* ARP support is only built if the Ethernet data link is supported.
* Continue and send the ARP request only if this device uses the
* Ethernet data link protocol.
@ -241,7 +240,6 @@ int arp_send(in_addr_t ipaddr)
{
return OK;
}
#endif
/* Check if the destination address is on the local network. */

View file

@ -124,12 +124,8 @@ static void devif_packet_conversion(FAR struct net_driver_s *dev,
{
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 ||
dev->d_lltype == NET_LL_PKTRADIO)
#endif
{
FAR struct ipv6_hdr_s *ipv6 = (FAR struct ipv6_hdr_s *)dev->d_buf;

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.
*/
#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)
#else
if (dev->d_len > 0)
#endif
{
/* 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.
*/
#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)
#else
if (dev->d_len > 0)
#endif
{
/* Let 6LoWPAN handle the ICMPv6 output */

View file

@ -93,10 +93,8 @@ struct icmpv6_notify_s
struct icmpv6_rnotify_s
{
#ifdef CONFIG_NET_MULTILINK
FAR struct icmpv6_notify_s *rn_flink; /* Supports singly linked list */
char rn_ifname[IFNAMSIZ]; /* Device name */
#endif
sem_t rn_sem; /* Will wake up the waiter */
int rn_result; /* The result of the wait */
};

View file

@ -164,9 +164,7 @@ void icmpv6_advertise(FAR struct net_driver_s *dev,
* and use our MAC as the new source address
*/
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET)
#endif
{
FAR struct eth_hdr_s *eth = ETHBUF;

View file

@ -356,7 +356,6 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev)
DEBUGASSERT(dev);
ninfo("Auto-configuring %s\n", dev->d_ifname);
#ifdef CONFIG_NET_MULTILINK
/* Only Ethernet devices are supported for now */
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");
return -ENOSYS;
}
#endif
/* The interface should be in the down state */

View file

@ -74,27 +74,7 @@
#define ICMPv6RADVERTISE \
((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)
#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
****************************************************************************/
#define DEV_LLTYPE(d) ((d)->d_lltype)
/****************************************************************************
* Public Functions

View file

@ -229,19 +229,17 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr)
goto errout;
}
#ifdef CONFIG_NET_MULTILINK
* Continue and send the Neighbor Solicitation request only if this
* device uses the Ethernet data link protocol.
*
* 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)
{
return OK;
}
#endif
/* Check if the destination address is on the local network. */

View file

@ -211,9 +211,7 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev)
* and use our MAC as the new source address
*/
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET)
#endif
{
FAR struct eth_hdr_s *eth = ETHBUF;

View file

@ -155,9 +155,7 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev)
dev->d_len = IPv6_HDRLEN + l3size;
#ifdef CONFIG_NET_ETHERNET
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET)
#endif
{
/* Set the destination IPv6 all-routers multicast Ethernet
* address

View file

@ -168,9 +168,7 @@ void icmpv6_solicit(FAR struct net_driver_s *dev,
dev->d_len = IPv6_HDRLEN + l3size;
#ifdef CONFIG_NET_ETHERNET
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET)
#endif
{
FAR struct eth_hdr_s *eth;

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);
#ifdef CONFIG_NET_MULTILINK
/* 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
* 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;
#endif /* CONFIG_NET_MULTILINK */
/* Wake up the waiting thread */
sem_post(&pstate->tc_sem);

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? */
#ifdef CONFIG_NET_MULTILINK
if (fwd->f_dev->d_lltype != NET_LL_ETHERNET)
{
return true;
}
#endif
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6

View file

@ -74,12 +74,8 @@ static int ipfwd_packet_proto(FAR struct net_driver_s *dev)
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 ||
dev->d_lltype == NET_LL_PKTRADIO)
#endif
{
/* 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)
{
#ifdef CONFIG_NET_MULTILINK
/* Handle the case where multiple link layer protocols are supported */
if (dev->d_lltype == NET_LL_IEEE802154 ||
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
if (proto == IP_PROTO_TCP)
{

View file

@ -205,16 +205,12 @@ static int ipv6_packet_conversion(FAR struct net_driver_s *dev,
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 &&
fwddev->d_lltype != NET_LL_PKTRADIO)
{
nwarn("WARNING: Unsupported link layer... Not forwarded\n");
}
else
#endif
#ifdef CONFIG_NET_TCP
if (ipv6->proto == IP_PROTO_TCP)
{

View file

@ -74,9 +74,7 @@
struct neighbor_addr_s
{
#ifdef CONFIG_NET_MULTILINK
uint8_t na_lltype;
#endif
uint8_t na_llsize;
union

View file

@ -96,12 +96,8 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype,
break;
}
#ifdef CONFIG_NET_MULTILINK
if (g_neighbors[i].ne_addr.na_lltype == lltype &&
net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr))
#else
if (net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr))
#endif
{
oldest_ndx = i;
break;
@ -121,9 +117,7 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype,
g_neighbors[oldest_ndx].ne_time = 0;
net_ipv6addr_copy(g_neighbors[oldest_ndx].ne_ipaddr, ipaddr);
#ifdef CONFIG_NET_MULTILINK
g_neighbors[oldest_ndx].ne_addr.na_lltype = lltype;
#endif
g_neighbors[oldest_ndx].ne_addr.na_llsize = netdev_type_lladdrsize(lltype);
memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr,

View file

@ -47,31 +47,6 @@
#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
****************************************************************************/
@ -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)
#else
# define netdev_dev_lladdrsize(dev) NETDEV_LLADDRSIZE
#endif
#define netdev_dev_lladdrsize(dev) netdev_type_lladdrsize((dev)->d_lltype)
#undef EXTERN
#ifdef __cplusplus

View file

@ -380,11 +380,7 @@ static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
/* Find the device with this name */
dev = netdev_findbyname(ifname);
#ifdef CONFIG_NET_MULTILINK
if (dev != NULL && dev->d_lltype == NET_LL_IEEE802154)
#else
if (dev != NULL)
#endif
{
/* 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 */
dev = netdev_findbyname(ifname);
#ifdef CONFIG_NET_MULTILINK
if (dev != NULL && dev->d_lltype == NET_LL_PKTRADIO)
#else
if (dev != NULL)
#endif
{
/* Perform the device IOCTL */
@ -825,11 +817,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
if (dev)
{
#ifdef CONFIG_NET_ETHERNET
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET)
#else
if (true)
#endif
{
req->ifr_hwaddr.sa_family = AF_INETX;
memcpy(req->ifr_hwaddr.sa_data,
@ -840,12 +828,8 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
#endif
#ifdef CONFIG_NET_6LOWPAN
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_IEEE802154 ||
dev->d_lltype == NET_LL_PKTRADIO)
#else
if (true)
#endif
{
req->ifr_hwaddr.sa_family = AF_INETX;
memcpy(req->ifr_hwaddr.sa_data,
@ -868,11 +852,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
if (dev)
{
#ifdef CONFIG_NET_ETHERNET
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_ETHERNET)
#else
if (true)
#endif
{
memcpy(dev->d_mac.ether.ether_addr_octet,
req->ifr_hwaddr.sa_data, IFHWADDRLEN);
@ -882,12 +862,8 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
#endif
#ifdef CONFIG_NET_6LOWPAN
#ifdef CONFIG_NET_MULTILINK
if (dev->d_lltype == NET_LL_IEEE802154 ||
dev->d_lltype == NET_LL_PKTRADIO)
#else
if (true)
#endif
{
FAR struct sixlowpan_driver_s *radio;
struct sixlowpan_properties_s properties;

View file

@ -82,16 +82,6 @@
# define NETDEV_DEFAULT_FORMAT NETDEV_LO_FORMAT
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/* Then next available device number */
#ifndef CONFIG_NET_MULTILINK
static int g_next_devnum = 0;
#endif
/****************************************************************************
* 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)
{
FAR struct net_driver_s *curr;
@ -151,7 +140,6 @@ static int find_devnum(FAR const char *devfmt)
return result;
}
#endif
/****************************************************************************
* Public Functions
@ -187,11 +175,8 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
if (dev != NULL)
{
#ifdef CONFIG_NET_MULTILINK
/* We are supporting multiple network devices and using different link
* 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.
/* Set the protocol used by the device and the size of the link
* header used by this protocol.
*/
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;
#else
/* Use the default device name */
devfmt = NETDEV_DEFAULT_FORMAT;
#endif
/* There are no clients of the device yet */
dev->d_conncb = NULL;
@ -290,8 +269,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
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
* 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;
}
else
# endif
#endif
{
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
if (*dev->d_ifname)

View file

@ -196,9 +196,8 @@ static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile)
status = "DOWN";
}
#if defined(CONFIG_NET_MULTILINK)
/* If there are multiple link types being supported, then selected the
* output appropriate for the link type associated with this device.
/* Select the output appropriate for the link type associated with
* this device.
*/
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,
" 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;
}

View file

@ -161,7 +161,6 @@ static uint16_t send_interrupt(FAR struct net_driver_s *dev,
ninfo("flags: %04x: %d\n", flags);
#ifdef CONFIG_NET_MULTILINK
/* Verify that this is a compatible network driver. */
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");
return flags;
}
#endif
/* 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

View file

@ -350,7 +350,6 @@ static uint16_t tcp_send_interrupt(FAR struct net_driver_s *dev,
struct ipv6tcp_hdr_s ipv6tcp;
int ret;
#ifdef CONFIG_NET_MULTILINK
/* Verify that this is an IEEE802.15.4 network driver. */
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");
return flags;
}
#endif
/* 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.
@ -803,7 +801,6 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
return (ssize_t)-ENETUNREACH;
}
#ifdef CONFIG_NET_MULTILINK
/* Some network devices support different link layer protocols.
* 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");
return (ssize_t)-ENONET;
}
#endif
#ifdef CONFIG_NET_ICMPv6_NEIGHBOR
/* Make sure that the IP address mapping is in the Neighbor Table */

View file

@ -213,7 +213,6 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
return (ssize_t)-ENETUNREACH;
}
#ifdef CONFIG_NET_MULTILINK
/* Some network devices support different link layer protocols.
* 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");
return (ssize_t)-ENONET;
}
#endif
#ifdef CONFIG_NET_ICMPv6_NEIGHBOR
/* Make sure that the IP address mapping is in the Neighbor Table */

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? */
#ifdef CONFIG_NET_MULTILINK
if (conn->dev->d_lltype != NET_LL_ETHERNET)
{
return true;
}
#endif
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6

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? */
#ifdef CONFIG_NET_MULTILINK
if (conn->dev->d_lltype != NET_LL_ETHERNET)
{
return true;
}
#endif
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6