summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-16 10:42:19 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-16 10:42:19 -0600
commit6772ffe7c885c81c9af0c364372f52fbba1370b0 (patch)
tree20e3bc0ca76e4bdd65d6f1781d3aeabc3474cc82 /nuttx
parent370e5cf601805a846cf564752e45469b23169292 (diff)
downloadnuttx-6772ffe7c885c81c9af0c364372f52fbba1370b0.tar.gz
nuttx-6772ffe7c885c81c9af0c364372f52fbba1370b0.tar.bz2
nuttx-6772ffe7c885c81c9af0c364372f52fbba1370b0.zip
Rename NET_LL_MTU to NET_DEV_MTU; rename d_llmtu to d_mtu
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/include/nuttx/net/netconfig.h50
-rw-r--r--nuttx/include/nuttx/net/netdev.h4
-rw-r--r--nuttx/net/devif/devif_input.c2
-rw-r--r--nuttx/net/devif/devif_iobsend.c2
-rw-r--r--nuttx/net/devif/devif_pktsend.c2
-rw-r--r--nuttx/net/devif/devif_send.c2
-rw-r--r--nuttx/net/netdev/netdev_ioctl.c2
-rw-r--r--nuttx/net/netdev/netdev_register.c6
-rw-r--r--nuttx/net/utils/net_chksum.c2
9 files changed, 38 insertions, 34 deletions
diff --git a/nuttx/include/nuttx/net/netconfig.h b/nuttx/include/nuttx/net/netconfig.h
index 91c9f4960..556930cc7 100644
--- a/nuttx/include/nuttx/net/netconfig.h
+++ b/nuttx/include/nuttx/net/netconfig.h
@@ -85,10 +85,14 @@
* supported concurrently. In this case, the size of link layer header
* varies and is obtained from the network device structure.
*
- * Support is also provided to select different MTU sizes for each different
- * link layer protocol. A better solution would be to support device-by-
- * device MTU sizes. This minimum support is require to support the
- * optimal SLIP MTU of 296 bytes and the standard Ethernet MTU of 1500
+ * There are other device-specific features that at tied to the link layer:
+ *
+ * - Maximum Transfer Unit (MTU)
+ * - TCP Receive Window size
+ *
+ * A better solution would be to support device-by-device MTU and receive
+ * window sizes. This minimum support is require to support the optimal
+ * SLIP MTU of 296 bytes and the standard Ethernet MTU of 1500
* bytes.
*/
@@ -111,14 +115,14 @@
*/
# define NET_LL_HDRLEN(d) ((d)->d_llhdrlen)
-# define NET_LL_MTU(d) ((d)->d_llmtu)
+# 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
+# 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
+# define _MIN_ETH_MTU UINT16_MAX
+# define _MAX_ETH_MTU 0
# endif
# ifdef CONFIG_NET_SLIP
@@ -129,8 +133,8 @@
# define _MAX_SLIP_MTU _MAX_ETH_MTU
# endif
-# define MIN_NET_LL_MTU _MIN_SLIP_MTU
-# define MAX_NET_LL_MTU _MAX_SLIP_MTU
+# define MIN_NET_DEV_MTU _MIN_SLIP_MTU
+# define MAX_NET_DEV_MTU _MAX_SLIP_MTU
#elif defined(CONFIG_NET_SLIP)
/* There is no link layer header with SLIP */
@@ -138,18 +142,18 @@
# ifdef CONFIG_NET_IPv6
# error SLIP is not available for IPv6
# endif
-# define NET_LL_HDRLEN(d) 0
-# define NET_LL_MTU(d) CONFIG_NET_SLIP_MTU
-# define MIN_NET_LL_MTU CONFIG_NET_SLIP_MTU
-# define MAX_NET_LL_MTU CONFIG_NET_SLIP_MTU
+# 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
#else /* if defined(CONFIG_NET_ETHERNET) */
/* Assume standard Ethernet link layer header */
-# define NET_LL_HDRLEN(d) 14
-# define NET_LL_MTU(d) CONFIG_NET_ETH_MTU
-# define MIN_NET_LL_MTU CONFIG_NET_ETH_MTU
-# define MAX_NET_LL_MTU CONFIG_NET_ETH_MTU
+# 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
#endif /* MULTILINK or SLIP or ETHERNET */
@@ -206,10 +210,10 @@
#endif
/* The UDP maximum packet size. This is should not be to set to more
- * than NET_LL_MTU(d) - NET_LL_HDRLEN(dev) - IPUDP_HDRLEN.
+ * than NET_DEV_MTU(d) - NET_LL_HDRLEN(dev) - IPUDP_HDRLEN.
*/
-#define UDP_MSS(d) (NET_LL_MTU(d) - NET_LL_HDRLEN(d) - IPUDP_HDRLEN)
+#define UDP_MSS(d) (NET_DEV_MTU(d) - NET_LL_HDRLEN(d) - IPUDP_HDRLEN)
#ifdef CONFIG_NET_ETHERNET
# define MIN_UDP_MSS (CONFIG_NET_ETH_MTU - ETH_HDRLEN - IPUDP_HDRLEN)
@@ -283,7 +287,7 @@
#define TCP_MAXSYNRTX 5
/* The TCP maximum segment size. This is should not be set to more
- * than NET_LL_MTU(dev) - NET_LL_HDRLEN(dev) - IPTCP_HDRLEN.
+ * than NET_DEV_MTU(dev) - NET_LL_HDRLEN(dev) - IPTCP_HDRLEN.
*
* In the case where there are multiple network devices with different
* link layer protocols (CONFIG_NET_MULTILINK), each network device
@@ -291,7 +295,7 @@
* the minimum MSS for that case.
*/
-#define TCP_MSS(d) (NET_LL_MTU(d) - NET_LL_HDRLEN(d) - IPTCP_HDRLEN)
+#define TCP_MSS(d) (NET_DEV_MTU(d) - NET_LL_HDRLEN(d) - IPTCP_HDRLEN)
#ifdef CONFIG_NET_ETHERNET
# define MIN_TCP_MSS (CONFIG_NET_ETH_MTU - ETH_HDRLEN - IPTCP_HDRLEN)
diff --git a/nuttx/include/nuttx/net/netdev.h b/nuttx/include/nuttx/net/netdev.h
index d5135738d..70d965be0 100644
--- a/nuttx/include/nuttx/net/netdev.h
+++ b/nuttx/include/nuttx/net/netdev.h
@@ -101,7 +101,7 @@ struct net_driver_s
uint8_t d_lltype; /* See enum net_datalink_e */
uint8_t d_llhdrlen; /* Link layer header size */
- uint16_t d_llmtu; /* Maximum packet size */
+ uint16_t d_mtu; /* Maximum packet size */
#endif
#ifdef CONFIG_NET_ETHERNET
@@ -131,7 +131,7 @@ struct net_driver_s
#ifdef CONFIG_NET_MULTIBUFFER
uint8_t *d_buf;
#else
- uint8_t d_buf[MAX_NET_LL_MTU + CONFIG_NET_GUARDSIZE];
+ uint8_t d_buf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
#endif
/* d_appdata points to the location where application data can be read from
diff --git a/nuttx/net/devif/devif_input.c b/nuttx/net/devif/devif_input.c
index c60140562..bba58be93 100644
--- a/nuttx/net/devif/devif_input.c
+++ b/nuttx/net/devif/devif_input.c
@@ -113,7 +113,7 @@
/* IP fragment re-assembly */
#define IP_MF 0x20
-#define TCP_REASS_BUFSIZE (NET_LL_MTU(dev) - NET_LL_HDRLEN(dev))
+#define TCP_REASS_BUFSIZE (NET_DEV_MTU(dev) - NET_LL_HDRLEN(dev))
#define TCP_REASS_LASTFRAG 0x01
/****************************************************************************
diff --git a/nuttx/net/devif/devif_iobsend.c b/nuttx/net/devif/devif_iobsend.c
index 6d00ebcf4..27e1adcbc 100644
--- a/nuttx/net/devif/devif_iobsend.c
+++ b/nuttx/net/devif/devif_iobsend.c
@@ -99,7 +99,7 @@
void devif_iob_send(FAR struct net_driver_s *dev, FAR struct iob_s *iob,
unsigned int len, unsigned int offset)
{
- DEBUGASSERT(dev && len > 0 && len < NET_LL_MTU(dev));
+ DEBUGASSERT(dev && len > 0 && len < NET_DEV_MTU(dev));
/* Copy the data from the I/O buffer chain to the device buffer */
diff --git a/nuttx/net/devif/devif_pktsend.c b/nuttx/net/devif/devif_pktsend.c
index ef8e33523..1dc1a41a6 100644
--- a/nuttx/net/devif/devif_pktsend.c
+++ b/nuttx/net/devif/devif_pktsend.c
@@ -99,7 +99,7 @@
void devif_pkt_send(FAR struct net_driver_s *dev, FAR const void *buf,
unsigned int len)
{
- DEBUGASSERT(dev && len > 0 && len < NET_LL_MTU(dev));
+ DEBUGASSERT(dev && len > 0 && len < NET_DEV_MTU(dev));
/* Copy the data into the device packet buffer */
diff --git a/nuttx/net/devif/devif_send.c b/nuttx/net/devif/devif_send.c
index 60eaadd1e..1738c28e5 100644
--- a/nuttx/net/devif/devif_send.c
+++ b/nuttx/net/devif/devif_send.c
@@ -94,7 +94,7 @@
void devif_send(struct net_driver_s *dev, const void *buf, int len)
{
- DEBUGASSERT(dev && len > 0 && len < NET_LL_MTU(dev));
+ DEBUGASSERT(dev && len > 0 && len < NET_DEV_MTU(dev));
memcpy(dev->d_snddata, buf, len);
dev->d_sndlen = len;
diff --git a/nuttx/net/netdev/netdev_ioctl.c b/nuttx/net/netdev/netdev_ioctl.c
index a70358478..22a0c1f1c 100644
--- a/nuttx/net/netdev/netdev_ioctl.c
+++ b/nuttx/net/netdev/netdev_ioctl.c
@@ -319,7 +319,7 @@ static int netdev_ifrioctl(FAR struct socket *psock, int cmd,
dev = netdev_ifrdev(req);
if (dev)
{
- req->ifr_mtu = NET_LL_MTU(dev);
+ req->ifr_mtu = NET_DEV_MTU(dev);
ret = OK;
}
}
diff --git a/nuttx/net/netdev/netdev_register.c b/nuttx/net/netdev/netdev_register.c
index ea336cab6..26bf8ecf7 100644
--- a/nuttx/net/netdev/netdev_register.c
+++ b/nuttx/net/netdev/netdev_register.c
@@ -134,7 +134,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
#ifdef CONFIG_NET_ETHERNET
case NET_LL_ETHERNET: /* Ethernet */
dev->d_llhdrlen = ETH_HDRLEN;
- dev->d_llmtu = CONFIG_NET_ETH_MTU;
+ dev->d_mtu = CONFIG_NET_ETH_MTU;
devfmt = NETDEV_ETH_FORMAT;
break;
#endif
@@ -142,7 +142,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
#ifdef CONFIG_NET_SLIP
case NET_LL_SLIP: /* Serial Line Internet Protocol (SLIP) */
dev->d_llhdrlen = 0;
- dev->d_llmtu = CONFIG_NET_SLIP_MTU;
+ dev->d_mtu = CONFIG_NET_SLIP_MTU;
devfmt = NETDEV_SLIP_FORMAT;
break;
#endif
@@ -150,7 +150,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
#if 0 /* REVISIT: Not yet supported */
case NET_LL_PPP: /* Point-to-Point Protocol (PPP) */
dev->d_llhdrlen = 0;
- dev->d_llmtu = CONFIG_NET_PPP_MTU;
+ dev->d_mtu = CONFIG_NET_PPP_MTU;
devfmt = NETDEV_PPP_FORMAT;
break;
#endif
diff --git a/nuttx/net/utils/net_chksum.c b/nuttx/net/utils/net_chksum.c
index c32c7ade5..14ecc43a5 100644
--- a/nuttx/net/utils/net_chksum.c
+++ b/nuttx/net/utils/net_chksum.c
@@ -128,7 +128,7 @@ static uint16_t upper_layer_chksum(FAR struct net_driver_s *dev, uint8_t proto)
/* Verify some minimal assumptions */
- if (upper_layer_len > NET_LL_MTU(dev))
+ if (upper_layer_len > NET_DEV_MTU(dev))
{
return 0;
}