summaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-21 11:36:33 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-21 11:36:33 -0600
commit926f204fe26a9798ef119dd3170c81b2d43175b3 (patch)
tree5b13afa47fe9b6cf8e1129d4a088b3e363c27357 /nuttx/arch
parenta4aaf127457d1092916b2c4f87272c3471345ae3 (diff)
downloadpx4-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
Diffstat (limited to 'nuttx/arch')
-rw-r--r--nuttx/arch/arm/src/c5471/c5471_ethernet.c25
-rw-r--r--nuttx/arch/arm/src/kinetis/kinetis_enet.c25
-rw-r--r--nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c23
-rw-r--r--nuttx/arch/arm/src/sam34/sam_emac.c23
-rw-r--r--nuttx/arch/arm/src/sama5/sam_emaca.c23
-rw-r--r--nuttx/arch/arm/src/sama5/sam_emacb.c23
-rw-r--r--nuttx/arch/arm/src/sama5/sam_gmac.c23
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_eth.c23
-rw-r--r--nuttx/arch/arm/src/tiva/lm3s_ethernet.c26
-rw-r--r--nuttx/arch/arm/src/tiva/tm4c_ethernet.c23
-rw-r--r--nuttx/arch/hc/src/m9s12/m9s12_ethernet.c25
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c23
-rw-r--r--nuttx/arch/sim/src/up_netdriver.c25
-rw-r--r--nuttx/arch/z80/src/ez80/ez80_emac.c23
14 files changed, 318 insertions, 15 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);
}