Merge remote-tracking branch 'origin/master' into llhdrlen

This commit is contained in:
Gregory Nutt 2014-11-15 10:04:49 -06:00
commit a831ab21bc
11 changed files with 16 additions and 20 deletions

View File

@ -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;

View File

@ -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 */

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 < 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++;

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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 */

View File

@ -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

View File

@ -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 */