Rename CONFIG_NET_BUFSIZE to CONFIG_NET_ETH_MTU in all drivers/net (except slip.c)

This commit is contained in:
Gregory Nutt 2014-11-16 08:53:20 -06:00
parent 71a4f29518
commit b9cd425bc2
6 changed files with 24 additions and 24 deletions

View File

@ -963,7 +963,7 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x)
/* Also check if the packet is a valid size for the uIP configuration */
else if (rx.desc.rx_len < ETH_HDRLEN || rx.desc.rx_len > (CONFIG_NET_BUFSIZE + 2))
else if (rx.desc.rx_len < ETH_HDRLEN || rx.desc.rx_len > (CONFIG_NET_ETH_MTU + 2))
{
#if defined(CONFIG_DM9X_STATS)
dm9x->dm_nrxlengtherrors++;

View File

@ -550,7 +550,7 @@ static void e1000_receive(struct e1000_dev *e1000)
cnt = e1000->rx_ring.desc[head].packet_length;
if (cnt > CONFIG_NET_BUFSIZE || cnt < 14)
if (cnt > CONFIG_NET_ETH_MTU || cnt < 14)
{
cprintf("NIC READ: invalid package size\n");
goto next;

View File

@ -104,10 +104,10 @@
# define CONFIG_ENC28J60_NINTERFACES 1
#endif
/* CONFIG_NET_BUFSIZE must always be defined */
/* CONFIG_NET_ETH_MTU must always be defined */
#if !defined(CONFIG_NET_BUFSIZE) && (CONFIG_NET_BUFSIZE <= MAX_FRAMELEN)
# error "CONFIG_NET_BUFSIZE is not valid for the ENC28J60"
#if !defined(CONFIG_NET_ETH_MTU) && (CONFIG_NET_ETH_MTU <= MAX_FRAMELEN)
# error "CONFIG_NET_ETH_MTU is not valid for the ENC28J60"
#endif
/* We need to have the work queue to handle SPI interrupts */
@ -155,7 +155,7 @@
/* Packet memory layout */
#define ALIGNED_BUFSIZE ((CONFIG_NET_BUFSIZE + 255) & ~255)
#define ALIGNED_BUFSIZE ((CONFIG_NET_ETH_MTU + 255) & ~255)
/* Work around Errata #5 (spurious reset of ERXWRPT to 0) by placing the RX
* FIFO at the beginning of packet memory.
@ -1487,7 +1487,7 @@ static void enc_pktif(FAR struct enc_driver_s *priv)
/* Check for a usable packet length (4 added for the CRC) */
else if (pktlen > (CONFIG_NET_BUFSIZE + 4) || pktlen <= (ETH_HDRLEN + 4))
else if (pktlen > (CONFIG_NET_ETH_MTU + 4) || pktlen <= (ETH_HDRLEN + 4))
{
nlldbg("Bad packet size dropped (%d)\n", pktlen);
#ifdef CONFIG_ENC28J60_STATS
@ -2504,8 +2504,8 @@ static int enc_reset(FAR struct enc_driver_s *priv)
/* Set the maximum packet size which the controller will accept */
enc_wrbreg(priv, ENC_MAMXFLL, CONFIG_NET_BUFSIZE & 0xff);
enc_wrbreg(priv, ENC_MAMXFLH, CONFIG_NET_BUFSIZE >> 8);
enc_wrbreg(priv, ENC_MAMXFLL, CONFIG_NET_ETH_MTU & 0xff);
enc_wrbreg(priv, ENC_MAMXFLH, CONFIG_NET_ETH_MTU >> 8);
/* Configure LEDs (No, just use the defaults for now) */
/* enc_wrphy(priv, ENC_PHLCON, ??); */

View File

@ -109,10 +109,10 @@
# define CONFIG_ENCX24J600_NINTERFACES 1
#endif
/* CONFIG_NET_BUFSIZE must always be defined */
/* CONFIG_NET_ETH_MTU must always be defined */
#if !defined(CONFIG_NET_BUFSIZE) && (CONFIG_NET_BUFSIZE <= MAX_FRAMELEN)
# error "CONFIG_NET_BUFSIZE is not valid for the ENCX24J600"
#if !defined(CONFIG_NET_ETH_MTU) && (CONFIG_NET_ETH_MTU <= MAX_FRAMELEN)
# error "CONFIG_NET_ETH_MTU is not valid for the ENCX24J600"
#endif
/* We need to have the work queue to handle SPI interrupts */
@ -168,7 +168,7 @@
/* Packet memory layout */
#define PKTMEM_ALIGNED_BUFSIZE ((CONFIG_NET_BUFSIZE + 1) & ~1)
#define PKTMEM_ALIGNED_BUFSIZE ((CONFIG_NET_ETH_MTU + 1) & ~1)
#define PKTMEM_RX_START (PKTMEM_START + PKTMEM_SIZE / 2) /* Followed by RX buffer */
#define PKTMEM_RX_SIZE (PKTMEM_SIZE - PKTMEM_RX_START)
#define PKTMEM_RX_END (PKTMEM_START + PKTMEM_SIZE) /* RX buffer goes to the end of SRAM */
@ -1656,7 +1656,7 @@ static void enc_pktif(FAR struct enc_driver_s *priv)
/* Check for a usable packet length (4 added for the CRC) */
else if (pktlen > (CONFIG_NET_BUFSIZE + 4) || pktlen <= (ETH_HDRLEN + 4))
else if (pktlen > (CONFIG_NET_ETH_MTU + 4) || pktlen <= (ETH_HDRLEN + 4))
{
nlldbg("Bad packet size dropped (%d)\n", pktlen);
@ -2746,7 +2746,7 @@ static int enc_reset(FAR struct enc_driver_s *priv)
/* Set the maximum packet size which the controller will accept */
enc_wrreg(priv, ENC_MAMXFL, CONFIG_NET_BUFSIZE + 4);
enc_wrreg(priv, ENC_MAMXFL, CONFIG_NET_ETH_MTU + 4);
ret = enc_waitreg(priv, ENC_ESTAT, ESTAT_PHYLNK, ESTAT_PHYLNK);

View File

@ -92,7 +92,7 @@
/* The Linux slip module hard-codes its MTU size to 296 (40 bytes for the
* IP+TPC headers plus 256 bytes of data). So you might as well set
* CONFIG_NET_BUFSIZE to 296 as well.
* CONFIG_NET_SLIP_MTU to 296 as well.
*
* There may be an issue with this setting, however. I see that Linux uses
* a MTU of 296 and window of 256, but actually only sends 168 bytes of data:
@ -101,10 +101,10 @@
* uIP to 128 bytes (possibly by modifying the tcp_mss() macro).
*/
#if CONFIG_NET_BUFSIZE < 296
# error "CONFIG_NET_BUFSIZE >= 296 is required"
#elif CONFIG_NET_BUFSIZE > 296
# warning "CONFIG_NET_BUFSIZE == 296 is optimal"
#if CONFIG_NET_SLIP_MTU < 296
# error "CONFIG_NET_SLIP_MTU >= 296 is required"
#elif CONFIG_NET_SLIP_MTU > 296
# warning "CONFIG_NET_SLIP_MTU == 296 is optimal"
#endif
/* CONFIG_SLIP_NINTERFACES determines the number of physical interfaces
@ -173,8 +173,8 @@ struct slip_driver_s
/* This holds the information visible to uIP/NuttX */
struct net_driver_s dev; /* Interface understood by uIP */
uint8_t rxbuf[CONFIG_NET_BUFSIZE + 2];
uint8_t txbuf[CONFIG_NET_BUFSIZE + 2];
uint8_t rxbuf[CONFIG_NET_SLIP_MTU + 2];
uint8_t txbuf[CONFIG_NET_SLIP_MTU + 2];
};
/****************************************************************************
@ -612,7 +612,7 @@ static inline void slip_receive(FAR struct slip_driver_s *priv)
*/
default:
if (priv->rxlen < CONFIG_NET_BUFSIZE+2)
if (priv->rxlen < CONFIG_NET_SLIP_MTU+2)
{
priv->rxbuf[priv->rxlen++] = ch;
}

View File

@ -286,7 +286,7 @@ void rtos_vnet_recv(struct rgmp_vnet *rgmp_vnet, char *data, int len)
/* Check if the packet is a valid size for the uIP buffer configuration */
if (len > CONFIG_NET_BUFSIZE || len < 14)
if (len > CONFIG_NET_ETH_MTU || len < 14)
{
#ifdef CONFIG_DEBUG
cprintf("VNET: receive invalid packet of size %d\n", len);