diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-16 09:22:38 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-16 09:22:38 -0600 |
commit | b6112c5ca3f1d5b8b929ae64e0b256d26374fc7c (patch) | |
tree | 3b3d1d454f1894a9dba926abbba6b8a44c467825 /nuttx/include/nuttx | |
parent | 656e3c5bebfa925d8eaa77519a3c2f4ea453c1ea (diff) | |
download | nuttx-b6112c5ca3f1d5b8b929ae64e0b256d26374fc7c.tar.gz nuttx-b6112c5ca3f1d5b8b929ae64e0b256d26374fc7c.tar.bz2 nuttx-b6112c5ca3f1d5b8b929ae64e0b256d26374fc7c.zip |
Completes conversion of CONFIG_NET_BUFIZE to CONFIG_NET_ETH/SLIP_MTU
Diffstat (limited to 'nuttx/include/nuttx')
-rw-r--r-- | nuttx/include/nuttx/net/netconfig.h | 33 | ||||
-rw-r--r-- | nuttx/include/nuttx/net/netdev.h | 2 |
2 files changed, 21 insertions, 14 deletions
diff --git a/nuttx/include/nuttx/net/netconfig.h b/nuttx/include/nuttx/net/netconfig.h index 5e987cf65..793dd0cb5 100644 --- a/nuttx/include/nuttx/net/netconfig.h +++ b/nuttx/include/nuttx/net/netconfig.h @@ -81,11 +81,29 @@ * 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 mutliple link protocols are + * 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. + * + * 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 + * bytes. */ +#ifdef CONFIG_NET_SLIP +# ifndef CONFIG_NET_SLIP_MTU +# define CONFIG_NET_SLIP_MTU 590 +# endif +#endif + +#ifdef CONFIG_NET_ETHERNET +# ifndef CONFIG_NET_ETH_MTU +# define CONFIG_NET_ETH_MTU 590 +# 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 @@ -188,7 +206,7 @@ #endif /* The UDP maximum packet size. This is should not be to set to more - * than CONFIG_NET_BUFSIZE - NET_LL_HDRLEN(dev) - IPUDP_HDRLEN. + * than NET_LL_MTU(d) - NET_LL_HDRLEN(dev) - IPUDP_HDRLEN. */ #define UDP_MSS(d) (CONFIG_NET_ETH_MTU - NET_LL_HDRLEN(d) - IPUDP_HDRLEN) @@ -332,17 +350,6 @@ /* General configuration options */ -/* The size of the uIP packet buffer. - * - * The uIP packet buffer should not be smaller than 60 bytes, and does - * not need to be larger than 1500 bytes. Lower size results in lower - * TCP throughput, larger size results in higher TCP throughput. - */ - -#ifndef CONFIG_NET_BUFSIZE -# define CONFIG_NET_BUFSIZE 400 -#endif - /* Delay after receive to catch a following packet. No delay should be * required if TCP/IP read-ahead buffering is enabled. */ diff --git a/nuttx/include/nuttx/net/netdev.h b/nuttx/include/nuttx/net/netdev.h index 8e6f1b6eb..d5135738d 100644 --- a/nuttx/include/nuttx/net/netdev.h +++ b/nuttx/include/nuttx/net/netdev.h @@ -131,7 +131,7 @@ struct net_driver_s #ifdef CONFIG_NET_MULTIBUFFER uint8_t *d_buf; #else - uint8_t d_buf[CONFIG_NET_BUFSIZE + CONFIG_NET_GUARDSIZE]; + uint8_t d_buf[MAX_NET_LL_MTU + CONFIG_NET_GUARDSIZE]; #endif /* d_appdata points to the location where application data can be read from |