diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-01-21 11:36:33 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-01-21 11:36:33 -0600 |
commit | 926f204fe26a9798ef119dd3170c81b2d43175b3 (patch) | |
tree | 5b13afa47fe9b6cf8e1129d4a088b3e363c27357 | |
parent | a4aaf127457d1092916b2c4f87272c3471345ae3 (diff) | |
download | px4-nuttx-926f204fe26a9798ef119dd3170c81b2d43175b3.tar.gz px4-nuttx-926f204fe26a9798ef119dd3170c81b2d43175b3.tar.bz2 px4-nuttx-926f204fe26a9798ef119dd3170c81b2d43175b3.zip |
All Ethernet drivers (again): Missed one place where arp_out() is called and neighber_out() needs to be called
-rw-r--r-- | nuttx/arch/arm/src/c5471/c5471_ethernet.c | 25 | ||||
-rw-r--r-- | nuttx/arch/arm/src/kinetis/kinetis_enet.c | 25 | ||||
-rw-r--r-- | nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c | 23 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sam34/sam_emac.c | 23 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_emaca.c | 23 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_emacb.c | 23 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_gmac.c | 23 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_eth.c | 23 | ||||
-rw-r--r-- | nuttx/arch/arm/src/tiva/lm3s_ethernet.c | 26 | ||||
-rw-r--r-- | nuttx/arch/arm/src/tiva/tm4c_ethernet.c | 23 | ||||
-rw-r--r-- | nuttx/arch/hc/src/m9s12/m9s12_ethernet.c | 25 | ||||
-rw-r--r-- | nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c | 23 | ||||
-rw-r--r-- | nuttx/arch/sim/src/up_netdriver.c | 25 | ||||
-rw-r--r-- | nuttx/arch/z80/src/ez80/ez80_emac.c | 23 | ||||
-rw-r--r-- | nuttx/drivers/net/cs89x0.c | 25 | ||||
-rw-r--r-- | nuttx/drivers/net/dm90x0.c | 25 | ||||
-rw-r--r-- | nuttx/drivers/net/e1000.c | 25 | ||||
-rw-r--r-- | nuttx/drivers/net/enc28j60.c | 25 | ||||
-rw-r--r-- | nuttx/drivers/net/encx24j600.c | 24 | ||||
-rw-r--r-- | nuttx/drivers/net/skeleton.c | 25 | ||||
-rw-r--r-- | nuttx/drivers/net/vnet.c | 25 |
21 files changed, 485 insertions, 22 deletions
diff --git a/nuttx/arch/arm/src/c5471/c5471_ethernet.c b/nuttx/arch/arm/src/c5471/c5471_ethernet.c index 35a4ae29a..9c34efeb3 100644 --- a/nuttx/arch/arm/src/c5471/c5471_ethernet.c +++ b/nuttx/arch/arm/src/c5471/c5471_ethernet.c @@ -988,7 +988,30 @@ static int c5471_txpoll(struct net_driver_s *dev) if (c5471->c_dev.d_len > 0) { - arp_out(&c5471->c_dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(c5471->c_dev.d_flags)) +#endif + { + arp_out(&c5471->c_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&c5471->c_dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + c5471_transmit(c5471); /* Check if the ESM has let go of the RX descriptor giving us access diff --git a/nuttx/arch/arm/src/kinetis/kinetis_enet.c b/nuttx/arch/arm/src/kinetis/kinetis_enet.c index e28f8b630..8cf87932d 100644 --- a/nuttx/arch/arm/src/kinetis/kinetis_enet.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_enet.c @@ -448,7 +448,30 @@ static int kinetis_txpoll(struct net_driver_s *dev) if (priv->dev.d_len > 0) { - arp_out(&priv->dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + kinetis_transmit(priv); /* Check if there is room in the device to hold another packet. If not, diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c index d0e085d4f..fdda0fe4c 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -697,11 +697,32 @@ static int lpc17_txpoll(struct net_driver_s *dev) if (priv->lp_dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->lp_dev.d_flags)) +#endif + { + arp_out(&priv->lp_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->lp_dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send this packet. In this context, we know that there is space for * at least one more packet in the descriptor list. */ - arp_out(&priv->lp_dev); lpc17_transmit(priv); /* Check if there is room in the device to hold another packet. If not, diff --git a/nuttx/arch/arm/src/sam34/sam_emac.c b/nuttx/arch/arm/src/sam34/sam_emac.c index 2f2932436..6a23f0b9d 100644 --- a/nuttx/arch/arm/src/sam34/sam_emac.c +++ b/nuttx/arch/arm/src/sam34/sam_emac.c @@ -830,9 +830,30 @@ static int sam_txpoll(struct net_driver_s *dev) if (priv->dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send the packet */ - arp_out(&priv->dev); sam_transmit(priv); /* Check if the there are any free TX descriptors. We cannot perform diff --git a/nuttx/arch/arm/src/sama5/sam_emaca.c b/nuttx/arch/arm/src/sama5/sam_emaca.c index d9b8037ff..250772d8b 100644 --- a/nuttx/arch/arm/src/sama5/sam_emaca.c +++ b/nuttx/arch/arm/src/sama5/sam_emaca.c @@ -840,9 +840,30 @@ static int sam_txpoll(struct net_driver_s *dev) if (priv->dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send the packet */ - arp_out(&priv->dev); sam_transmit(priv); /* Check if the there are any free TX descriptors. We cannot perform diff --git a/nuttx/arch/arm/src/sama5/sam_emacb.c b/nuttx/arch/arm/src/sama5/sam_emacb.c index 35ba12c90..b1c2fb2e9 100644 --- a/nuttx/arch/arm/src/sama5/sam_emacb.c +++ b/nuttx/arch/arm/src/sama5/sam_emacb.c @@ -1167,9 +1167,30 @@ static int sam_txpoll(struct net_driver_s *dev) if (priv->dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send the packet */ - arp_out(&priv->dev); sam_transmit(priv); /* Check if the there are any free TX descriptors. We cannot perform diff --git a/nuttx/arch/arm/src/sama5/sam_gmac.c b/nuttx/arch/arm/src/sama5/sam_gmac.c index 4a86bf4c1..1baa4283c 100644 --- a/nuttx/arch/arm/src/sama5/sam_gmac.c +++ b/nuttx/arch/arm/src/sama5/sam_gmac.c @@ -772,9 +772,30 @@ static int sam_txpoll(struct net_driver_s *dev) if (priv->dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send the packet */ - arp_out(&priv->dev); sam_transmit(priv); /* Check if the there are any free TX descriptors. We cannot perform diff --git a/nuttx/arch/arm/src/stm32/stm32_eth.c b/nuttx/arch/arm/src/stm32/stm32_eth.c index 16d00614a..4dc1c8105 100644 --- a/nuttx/arch/arm/src/stm32/stm32_eth.c +++ b/nuttx/arch/arm/src/stm32/stm32_eth.c @@ -1175,9 +1175,30 @@ static int stm32_txpoll(struct net_driver_s *dev) if (priv->dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send the packet */ - arp_out(&priv->dev); stm32_transmit(priv); DEBUGASSERT(dev->d_len == 0 && dev->d_buf == NULL); diff --git a/nuttx/arch/arm/src/tiva/lm3s_ethernet.c b/nuttx/arch/arm/src/tiva/lm3s_ethernet.c index 89fad3101..87334ab92 100644 --- a/nuttx/arch/arm/src/tiva/lm3s_ethernet.c +++ b/nuttx/arch/arm/src/tiva/lm3s_ethernet.c @@ -620,12 +620,34 @@ static int tiva_txpoll(struct net_driver_s *dev) nllvdbg("Poll result: d_len=%d\n", priv->ld_dev.d_len); if (priv->ld_dev.d_len > 0) { + DEBUGASSERT((tiva_ethin(priv, TIVA_MAC_TR_OFFSET) & MAC_TR_NEWTX) == 0) + + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->ld_dev.d_flags)) +#endif + { + arp_out(&priv->ld_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->ld_dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send the packet. tiva_transmit() will return zero if the * packet was successfully handled. */ - DEBUGASSERT((tiva_ethin(priv, TIVA_MAC_TR_OFFSET) & MAC_TR_NEWTX) == 0) - arp_out(&priv->ld_dev); ret = tiva_transmit(priv); } diff --git a/nuttx/arch/arm/src/tiva/tm4c_ethernet.c b/nuttx/arch/arm/src/tiva/tm4c_ethernet.c index 5910b0953..93d6df9cb 100644 --- a/nuttx/arch/arm/src/tiva/tm4c_ethernet.c +++ b/nuttx/arch/arm/src/tiva/tm4c_ethernet.c @@ -1251,9 +1251,30 @@ static int tiva_txpoll(struct net_driver_s *dev) if (priv->dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send the packet */ - arp_out(&priv->dev); tiva_transmit(priv); DEBUGASSERT(dev->d_len == 0 && dev->d_buf == NULL); diff --git a/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c b/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c index 782e8f151..94270dcdd 100644 --- a/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c @@ -216,7 +216,30 @@ static int emac_txpoll(struct net_driver_s *dev) if (priv->d_dev.d_len > 0) { - arp_out(&priv->d_dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->d_dev.d_flags)) +#endif + { + arp_out(&priv->d_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->d_dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + emac_transmit(priv); /* Check if there is room in the device to hold another packet. If not, diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c b/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c index d78a7c225..0743a7676 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -1152,11 +1152,32 @@ static int pic32mx_txpoll(struct net_driver_s *dev) if (priv->pd_dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->pd_dev.d_flags)) +#endif + { + arp_out(&priv->pd_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->pd_dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send this packet. In this context, we know that there is space for * at least one more packet in the descriptor list. */ - arp_out(&priv->pd_dev); pic32mx_transmit(priv); /* Check if the next TX descriptor is available. If not, return a diff --git a/nuttx/arch/sim/src/up_netdriver.c b/nuttx/arch/sim/src/up_netdriver.c index 036d51e2b..383bf46c1 100644 --- a/nuttx/arch/sim/src/up_netdriver.c +++ b/nuttx/arch/sim/src/up_netdriver.c @@ -126,7 +126,30 @@ static int sim_txpoll(struct net_driver_s *dev) if (g_sim_dev.d_len > 0) { - arp_out(&g_sim_dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(&g_sim_dev)) +#endif + { + arp_out(&g_sim_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&g_sim_dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + netdev_send(g_sim_dev.d_buf, g_sim_dev.d_len); } diff --git a/nuttx/arch/z80/src/ez80/ez80_emac.c b/nuttx/arch/z80/src/ez80/ez80_emac.c index 7ea5b47ac..f654fc2d5 100644 --- a/nuttx/arch/z80/src/ez80/ez80_emac.c +++ b/nuttx/arch/z80/src/ez80/ez80_emac.c @@ -1085,11 +1085,32 @@ static int ez80emac_txpoll(struct net_driver_s *dev) nvdbg("Poll result: d_len=%d\n", priv->dev.d_len); if (priv->dev.d_len > 0) { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + /* Send the packet. ez80emac_transmit() will return zero if the * packet was successfully handled. */ - arp_out(&priv->dev); ret = ez80emac_transmit(priv); } diff --git a/nuttx/drivers/net/cs89x0.c b/nuttx/drivers/net/cs89x0.c index 47d92f782..bb0a43304 100644 --- a/nuttx/drivers/net/cs89x0.c +++ b/nuttx/drivers/net/cs89x0.c @@ -341,7 +341,30 @@ static int cs89x0_txpoll(struct net_driver_s *dev) if (cs89x0->cs_dev.d_len > 0) { - arp_out(&cs89x0->cs_dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(cs89x0->cs_dev.d_flags)) +#endif + { + arp_out(&cs89x0->cs_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&cs89x0->cs_dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + cs89x0_transmit(cs89x0); /* Check if there is room in the CS89x0 to hold another packet. If not, diff --git a/nuttx/drivers/net/dm90x0.c b/nuttx/drivers/net/dm90x0.c index c7f7d8b69..32129f50f 100644 --- a/nuttx/drivers/net/dm90x0.c +++ b/nuttx/drivers/net/dm90x0.c @@ -853,7 +853,30 @@ static int dm9x_txpoll(struct net_driver_s *dev) if (dm9x->dm_dev.d_len > 0) { - arp_out(&dm9x->dm_dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(dm9x->dm_dev.d_flags)) +#endif + { + arp_out(&dm9x->dm_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&dm9x->dm_dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + dm9x_transmit(dm9x); /* Check if there is room in the DM90x0 to hold another packet. In 100M mode, diff --git a/nuttx/drivers/net/e1000.c b/nuttx/drivers/net/e1000.c index 9fc546ec9..b122b75d9 100644 --- a/nuttx/drivers/net/e1000.c +++ b/nuttx/drivers/net/e1000.c @@ -492,7 +492,30 @@ static int e1000_txpoll(struct net_driver_s *dev) if (e1000->netdev.d_len > 0) { - arp_out(&e1000->netdev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(e1000->netdev.d_flags)) +#endif + { + arp_out(&e1000->netdev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&e1000->netdev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + e1000_transmit(e1000); /* Check if there is room in the device to hold another packet. If not, diff --git a/nuttx/drivers/net/enc28j60.c b/nuttx/drivers/net/enc28j60.c index 18ec1e449..78fcaf283 100644 --- a/nuttx/drivers/net/enc28j60.c +++ b/nuttx/drivers/net/enc28j60.c @@ -1204,7 +1204,30 @@ static int enc_txpoll(struct net_driver_s *dev) nllvdbg("Poll result: d_len=%d\n", priv->dev.d_len); if (priv->dev.d_len > 0) { - arp_out(&priv->dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + enc_transmit(priv); /* Stop the poll now because we can queue only one packet */ diff --git a/nuttx/drivers/net/encx24j600.c b/nuttx/drivers/net/encx24j600.c index 5ed7c2dea..ca47a0173 100644 --- a/nuttx/drivers/net/encx24j600.c +++ b/nuttx/drivers/net/encx24j600.c @@ -1220,7 +1220,29 @@ static int enc_txpoll(struct net_driver_s *dev) if (priv->dev.d_len > 0) { - arp_out(&priv->dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->dev.d_flags)) +#endif + { + arp_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ ret = enc_txenqueue(priv); } diff --git a/nuttx/drivers/net/skeleton.c b/nuttx/drivers/net/skeleton.c index a94234730..8eeff3ec9 100644 --- a/nuttx/drivers/net/skeleton.c +++ b/nuttx/drivers/net/skeleton.c @@ -248,7 +248,30 @@ static int skel_txpoll(struct net_driver_s *dev) if (skel->sk_dev.d_len > 0) { - arp_out(&skel->sk_dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(skel->sk_dev.d_flags)) +#endif + { + arp_out(&skel->sk_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&skel->sk_dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + skel_transmit(skel); /* Check if there is room in the device to hold another packet. If not, diff --git a/nuttx/drivers/net/vnet.c b/nuttx/drivers/net/vnet.c index 3def6e8d1..6a61b7964 100644 --- a/nuttx/drivers/net/vnet.c +++ b/nuttx/drivers/net/vnet.c @@ -243,7 +243,30 @@ static int vnet_txpoll(struct net_driver_s *dev) if (vnet->sk_dev.d_len > 0) { - arp_out(&vnet->sk_dev); + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(vnet->sk_dev.d_flags)) +#endif + { + arp_out(&vnet->sk_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&vnet->sk_dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + vnet_transmit(vnet); /* Check if there is room in the device to hold another packet. If not, |