Remove use of NET_LL_HDRLEN from Ethernet drivers. Use ETH_HDRLEN instead
This commit is contained in:
parent
2b758537ea
commit
25a9005ce7
@ -515,7 +515,7 @@ static int tiva_transmit(struct tiva_driver_s *priv)
|
|||||||
|
|
||||||
pktlen = priv->ld_dev.d_len;
|
pktlen = priv->ld_dev.d_len;
|
||||||
nllvdbg("Sending packet, pktlen: %d\n", pktlen);
|
nllvdbg("Sending packet, pktlen: %d\n", pktlen);
|
||||||
DEBUGASSERT(pktlen > NET_LL_HDRLEN);
|
DEBUGASSERT(pktlen > ETH_HDRLEN);
|
||||||
|
|
||||||
dbuf = priv->ld_dev.d_buf;
|
dbuf = priv->ld_dev.d_buf;
|
||||||
regval = (uint32_t)(pktlen - 14);
|
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.
|
* 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;
|
int wordlen;
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ void netdriver_loop(void)
|
|||||||
* MAC address
|
* 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 */
|
/* We only accept IP packets of the configured type and ARP packets */
|
||||||
|
|
||||||
|
@ -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 */
|
/* 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)
|
#if defined(CONFIG_DM9X_STATS)
|
||||||
dm9x->dm_nrxlengtherrors++;
|
dm9x->dm_nrxlengtherrors++;
|
||||||
|
@ -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) */
|
/* 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);
|
nlldbg("Bad packet size dropped (%d)\n", pktlen);
|
||||||
#ifdef CONFIG_ENC28J60_STATS
|
#ifdef CONFIG_ENC28J60_STATS
|
||||||
|
@ -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) */
|
/* 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);
|
nlldbg("Bad packet size dropped (%d)\n", pktlen);
|
||||||
|
|
||||||
|
@ -74,10 +74,6 @@
|
|||||||
|
|
||||||
/* Configuration ************************************************************/
|
/* Configuration ************************************************************/
|
||||||
|
|
||||||
#if NET_LL_HDRLEN > 0
|
|
||||||
# error "NET_LL_HDRLEN must be set to zero"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CONFIG_NET_NOINTS
|
#ifndef CONFIG_NET_NOINTS
|
||||||
# warning "CONFIG_NET_NOINTS must be set"
|
# warning "CONFIG_NET_NOINTS must be set"
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user