All Ethernet drivers (again): Missed one place where arp_out() is called and neighber_out() needs to be called

This commit is contained in:
Gregory Nutt 2015-01-21 11:36:33 -06:00
parent 5e23a855ec
commit 32d2a4c548
21 changed files with 485 additions and 22 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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