diff --git a/arch/arm/src/tiva/tiva_ethernet.c b/arch/arm/src/tiva/tiva_ethernet.c index 1fb19f8828..bd297e5a56 100644 --- a/arch/arm/src/tiva/tiva_ethernet.c +++ b/arch/arm/src/tiva/tiva_ethernet.c @@ -515,7 +515,7 @@ static int tiva_transmit(struct tiva_driver_s *priv) pktlen = priv->ld_dev.d_len; nllvdbg("Sending packet, pktlen: %d\n", pktlen); - DEBUGASSERT(pktlen > NET_LL_HDRLEN); + DEBUGASSERT(pktlen > ETH_HDRLEN); dbuf = priv->ld_dev.d_buf; regval = (uint32_t)(pktlen - 14); @@ -677,7 +677,7 @@ static void tiva_receive(struct tiva_driver_s *priv) * and 4 byte FCS that are not copied into the uIP packet. */ - if (pktlen > (CONFIG_NET_BUFSIZE + 6) || pktlen <= (NET_LL_HDRLEN + 6)) + if (pktlen > (CONFIG_NET_BUFSIZE + 6) || pktlen <= (ETH_HDRLEN + 6)) { int wordlen; diff --git a/arch/sim/src/up_netdriver.c b/arch/sim/src/up_netdriver.c index 90ff0bb3e6..f63233a912 100644 --- a/arch/sim/src/up_netdriver.c +++ b/arch/sim/src/up_netdriver.c @@ -155,7 +155,7 @@ void netdriver_loop(void) * MAC address */ - if (g_sim_dev.d_len > NET_LL_HDRLEN && up_comparemac(BUF->ether_dhost, &g_sim_dev.d_mac) == 0) + if (g_sim_dev.d_len > ETH_HDRLEN && up_comparemac(BUF->ether_dhost, &g_sim_dev.d_mac) == 0) { /* We only accept IP packets of the configured type and ARP packets */ diff --git a/drivers/net/dm90x0.c b/drivers/net/dm90x0.c index 13aaa38ec9..38c1773c22 100644 --- a/drivers/net/dm90x0.c +++ b/drivers/net/dm90x0.c @@ -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 < NET_LL_HDRLEN || rx.desc.rx_len > (CONFIG_NET_BUFSIZE + 2)) + else if (rx.desc.rx_len < ETH_HDRLEN || rx.desc.rx_len > (CONFIG_NET_BUFSIZE + 2)) { #if defined(CONFIG_DM9X_STATS) dm9x->dm_nrxlengtherrors++; diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 5c045f1de8..9b1463d76e 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -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 <= (NET_LL_HDRLEN + 4)) + else if (pktlen > (CONFIG_NET_BUFSIZE + 4) || pktlen <= (ETH_HDRLEN + 4)) { nlldbg("Bad packet size dropped (%d)\n", pktlen); #ifdef CONFIG_ENC28J60_STATS diff --git a/drivers/net/encx24j600.c b/drivers/net/encx24j600.c index d4eb7095e1..fb0f2eb305 100644 --- a/drivers/net/encx24j600.c +++ b/drivers/net/encx24j600.c @@ -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 <= (NET_LL_HDRLEN + 4)) + else if (pktlen > (CONFIG_NET_BUFSIZE + 4) || pktlen <= (ETH_HDRLEN + 4)) { nlldbg("Bad packet size dropped (%d)\n", pktlen); diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 2585ac34cb..fc028174a0 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -74,10 +74,6 @@ /* Configuration ************************************************************/ -#if NET_LL_HDRLEN > 0 -# error "NET_LL_HDRLEN must be set to zero" -#endif - #ifndef CONFIG_NET_NOINTS # warning "CONFIG_NET_NOINTS must be set" #endif diff --git a/include/nuttx/net/arp.h b/include/nuttx/net/arp.h index b7bddeedb3..e42d367d3f 100644 --- a/include/nuttx/net/arp.h +++ b/include/nuttx/net/arp.h @@ -67,7 +67,7 @@ /* Size of the Ethernet header */ -#define ETH_HDRLEN 14 /* Minimum size: 2*6 + 2 */ +#define ETH_HDRLEN 14 /* Minimum size: 2*6 + 2 */ /**************************************************************************** * Public Types diff --git a/net/arp/arp_arpin.c b/net/arp/arp_arpin.c index 80cf623c9f..eed1539a6b 100644 --- a/net/arp/arp_arpin.c +++ b/net/arp/arp_arpin.c @@ -60,7 +60,7 @@ ****************************************************************************/ #define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[NET_LL_HDRLEN]) +#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN]) /**************************************************************************** * Private Types @@ -106,7 +106,7 @@ void arp_arpin(FAR struct net_driver_s *dev) FAR struct arp_hdr_s *parp = ARPBUF; in_addr_t ipaddr; - if (dev->d_len < (sizeof(struct arp_hdr_s) + NET_LL_HDRLEN)) + if (dev->d_len < (sizeof(struct arp_hdr_s) + ETH_HDRLEN)) { nlldbg("Too small\n"); dev->d_len = 0; @@ -146,7 +146,7 @@ void arp_arpin(FAR struct net_driver_s *dev) arp_dump(parp); peth->type = HTONS(ETHTYPE_ARP); - dev->d_len = sizeof(struct arp_hdr_s) + NET_LL_HDRLEN; + dev->d_len = sizeof(struct arp_hdr_s) + ETH_HDRLEN; } break; diff --git a/net/arp/arp_format.c b/net/arp/arp_format.c index 96546cc3b4..50a3054e1b 100644 --- a/net/arp/arp_format.c +++ b/net/arp/arp_format.c @@ -60,7 +60,7 @@ ****************************************************************************/ #define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[NET_LL_HDRLEN]) +#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN]) /**************************************************************************** * Private Types @@ -115,7 +115,7 @@ void arp_format(FAR struct net_driver_s *dev, in_addr_t ipaddr) arp->ah_protolen = 4; eth->type = HTONS(ETHTYPE_ARP); - dev->d_len = sizeof(struct arp_hdr_s) + NET_LL_HDRLEN; + dev->d_len = sizeof(struct arp_hdr_s) + ETH_HDRLEN; } #endif /* CONFIG_NET_ARP */ diff --git a/net/arp/arp_ipin.c b/net/arp/arp_ipin.c index 1c39405d6c..ddd7102a13 100644 --- a/net/arp/arp_ipin.c +++ b/net/arp/arp_ipin.c @@ -57,7 +57,7 @@ ****************************************************************************/ #define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN]) +#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN]) /**************************************************************************** * Private Types diff --git a/net/arp/arp_out.c b/net/arp/arp_out.c index d365dfdc20..7e77bfc4ae 100644 --- a/net/arp/arp_out.c +++ b/net/arp/arp_out.c @@ -58,8 +58,8 @@ ****************************************************************************/ #define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[NET_LL_HDRLEN]) -#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN]) +#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN]) +#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN]) /**************************************************************************** * Private Types @@ -247,7 +247,7 @@ void arp_out(FAR struct net_driver_s *dev) memcpy(peth->src, dev->d_mac.ether_addr_octet, ETHER_ADDR_LEN); peth->type = HTONS(ETHTYPE_IP); - dev->d_len += NET_LL_HDRLEN; + dev->d_len += ETH_HDRLEN; } #endif /* CONFIG_NET_ARP */