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
+23
View File
@@ -987,8 +987,31 @@ static int c5471_txpoll(struct net_driver_s *dev)
*/ */
if (c5471->c_dev.d_len > 0) if (c5471->c_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(c5471->c_dev.d_flags))
#endif
{ {
arp_out(&c5471->c_dev); 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); c5471_transmit(c5471);
/* Check if the ESM has let go of the RX descriptor giving us access /* Check if the ESM has let go of the RX descriptor giving us access
+23
View File
@@ -447,8 +447,31 @@ static int kinetis_txpoll(struct net_driver_s *dev)
*/ */
if (priv->dev.d_len > 0) 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); 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); kinetis_transmit(priv);
/* Check if there is room in the device to hold another packet. If not, /* Check if there is room in the device to hold another packet. If not,
+22 -1
View File
@@ -697,11 +697,32 @@ static int lpc17_txpoll(struct net_driver_s *dev)
if (priv->lp_dev.d_len > 0) 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 /* Send this packet. In this context, we know that there is space for
* at least one more packet in the descriptor list. * at least one more packet in the descriptor list.
*/ */
arp_out(&priv->lp_dev);
lpc17_transmit(priv); lpc17_transmit(priv);
/* Check if there is room in the device to hold another packet. If not, /* Check if there is room in the device to hold another packet. If not,
+22 -1
View File
@@ -830,9 +830,30 @@ static int sam_txpoll(struct net_driver_s *dev)
if (priv->dev.d_len > 0) 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 */ /* Send the packet */
arp_out(&priv->dev);
sam_transmit(priv); sam_transmit(priv);
/* Check if the there are any free TX descriptors. We cannot perform /* Check if the there are any free TX descriptors. We cannot perform
+22 -1
View File
@@ -840,9 +840,30 @@ static int sam_txpoll(struct net_driver_s *dev)
if (priv->dev.d_len > 0) 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 */ /* Send the packet */
arp_out(&priv->dev);
sam_transmit(priv); sam_transmit(priv);
/* Check if the there are any free TX descriptors. We cannot perform /* Check if the there are any free TX descriptors. We cannot perform
+22 -1
View File
@@ -1167,9 +1167,30 @@ static int sam_txpoll(struct net_driver_s *dev)
if (priv->dev.d_len > 0) 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 */ /* Send the packet */
arp_out(&priv->dev);
sam_transmit(priv); sam_transmit(priv);
/* Check if the there are any free TX descriptors. We cannot perform /* Check if the there are any free TX descriptors. We cannot perform
+22 -1
View File
@@ -772,9 +772,30 @@ static int sam_txpoll(struct net_driver_s *dev)
if (priv->dev.d_len > 0) 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 */ /* Send the packet */
arp_out(&priv->dev);
sam_transmit(priv); sam_transmit(priv);
/* Check if the there are any free TX descriptors. We cannot perform /* Check if the there are any free TX descriptors. We cannot perform
+22 -1
View File
@@ -1175,9 +1175,30 @@ static int stm32_txpoll(struct net_driver_s *dev)
if (priv->dev.d_len > 0) 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 */ /* Send the packet */
arp_out(&priv->dev);
stm32_transmit(priv); stm32_transmit(priv);
DEBUGASSERT(dev->d_len == 0 && dev->d_buf == NULL); DEBUGASSERT(dev->d_len == 0 && dev->d_buf == NULL);
+24 -2
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); nllvdbg("Poll result: d_len=%d\n", priv->ld_dev.d_len);
if (priv->ld_dev.d_len > 0) 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 /* Send the packet. tiva_transmit() will return zero if the
* packet was successfully handled. * 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); ret = tiva_transmit(priv);
} }
+22 -1
View File
@@ -1251,9 +1251,30 @@ static int tiva_txpoll(struct net_driver_s *dev)
if (priv->dev.d_len > 0) 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 */ /* Send the packet */
arp_out(&priv->dev);
tiva_transmit(priv); tiva_transmit(priv);
DEBUGASSERT(dev->d_len == 0 && dev->d_buf == NULL); DEBUGASSERT(dev->d_len == 0 && dev->d_buf == NULL);
+23
View File
@@ -215,8 +215,31 @@ static int emac_txpoll(struct net_driver_s *dev)
*/ */
if (priv->d_dev.d_len > 0) if (priv->d_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->d_dev.d_flags))
#endif
{ {
arp_out(&priv->d_dev); 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); emac_transmit(priv);
/* Check if there is room in the device to hold another packet. If not, /* Check if there is room in the device to hold another packet. If not,
+22 -1
View File
@@ -1152,11 +1152,32 @@ static int pic32mx_txpoll(struct net_driver_s *dev)
if (priv->pd_dev.d_len > 0) 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 /* Send this packet. In this context, we know that there is space for
* at least one more packet in the descriptor list. * at least one more packet in the descriptor list.
*/ */
arp_out(&priv->pd_dev);
pic32mx_transmit(priv); pic32mx_transmit(priv);
/* Check if the next TX descriptor is available. If not, return a /* Check if the next TX descriptor is available. If not, return a
+23
View File
@@ -125,8 +125,31 @@ static int sim_txpoll(struct net_driver_s *dev)
*/ */
if (g_sim_dev.d_len > 0) if (g_sim_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(&g_sim_dev))
#endif
{ {
arp_out(&g_sim_dev); 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); netdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
} }
+22 -1
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); nvdbg("Poll result: d_len=%d\n", priv->dev.d_len);
if (priv->dev.d_len > 0) 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 /* Send the packet. ez80emac_transmit() will return zero if the
* packet was successfully handled. * packet was successfully handled.
*/ */
arp_out(&priv->dev);
ret = ez80emac_transmit(priv); ret = ez80emac_transmit(priv);
} }
+23
View File
@@ -340,8 +340,31 @@ static int cs89x0_txpoll(struct net_driver_s *dev)
*/ */
if (cs89x0->cs_dev.d_len > 0) if (cs89x0->cs_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(cs89x0->cs_dev.d_flags))
#endif
{ {
arp_out(&cs89x0->cs_dev); 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); cs89x0_transmit(cs89x0);
/* Check if there is room in the CS89x0 to hold another packet. If not, /* Check if there is room in the CS89x0 to hold another packet. If not,
+23
View File
@@ -852,8 +852,31 @@ static int dm9x_txpoll(struct net_driver_s *dev)
*/ */
if (dm9x->dm_dev.d_len > 0) if (dm9x->dm_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(dm9x->dm_dev.d_flags))
#endif
{ {
arp_out(&dm9x->dm_dev); 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); dm9x_transmit(dm9x);
/* Check if there is room in the DM90x0 to hold another packet. In 100M mode, /* Check if there is room in the DM90x0 to hold another packet. In 100M mode,
+23
View File
@@ -491,8 +491,31 @@ static int e1000_txpoll(struct net_driver_s *dev)
*/ */
if (e1000->netdev.d_len > 0) if (e1000->netdev.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(e1000->netdev.d_flags))
#endif
{ {
arp_out(&e1000->netdev); 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); e1000_transmit(e1000);
/* Check if there is room in the device to hold another packet. If not, /* Check if there is room in the device to hold another packet. If not,
+23
View File
@@ -1203,8 +1203,31 @@ static int enc_txpoll(struct net_driver_s *dev)
nllvdbg("Poll result: d_len=%d\n", priv->dev.d_len); nllvdbg("Poll result: d_len=%d\n", priv->dev.d_len);
if (priv->dev.d_len > 0) 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); 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); enc_transmit(priv);
/* Stop the poll now because we can queue only one packet */ /* Stop the poll now because we can queue only one packet */
+22
View File
@@ -1219,8 +1219,30 @@ static int enc_txpoll(struct net_driver_s *dev)
nllvdbg("Poll result: d_len=%d\n", priv->dev.d_len); nllvdbg("Poll result: d_len=%d\n", priv->dev.d_len);
if (priv->dev.d_len > 0) 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); 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); ret = enc_txenqueue(priv);
} }
+23
View File
@@ -247,8 +247,31 @@ static int skel_txpoll(struct net_driver_s *dev)
*/ */
if (skel->sk_dev.d_len > 0) if (skel->sk_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(skel->sk_dev.d_flags))
#endif
{ {
arp_out(&skel->sk_dev); 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); skel_transmit(skel);
/* Check if there is room in the device to hold another packet. If not, /* Check if there is room in the device to hold another packet. If not,
+23
View File
@@ -242,8 +242,31 @@ static int vnet_txpoll(struct net_driver_s *dev)
*/ */
if (vnet->sk_dev.d_len > 0) if (vnet->sk_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(vnet->sk_dev.d_flags))
#endif
{ {
arp_out(&vnet->sk_dev); 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); vnet_transmit(vnet);
/* Check if there is room in the device to hold another packet. If not, /* Check if there is room in the device to hold another packet. If not,