1
0
Fork 0
forked from nuttx/nuttx-update

net/devif/ip: build l2 header on the IP layer

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2022-11-27 02:13:21 +08:00 committed by Xiang Xiao
parent 81325a8a3d
commit 6fa60627eb
49 changed files with 77 additions and 1473 deletions

View file

@ -1290,11 +1290,8 @@ static void c5471_receive(struct c5471_driver_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(dev);
ipv4_input(dev);
/* If the above function invocation resulted in data that should be
@ -1306,21 +1303,6 @@ static void c5471_receive(struct c5471_driver_s *priv)
if (dev->d_len > 0 &&
(EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(dev->d_flags))
#endif
{
arp_out(dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(dev);
}
#endif
/* And send the packet */
c5471_transmit(priv);
@ -1346,21 +1328,6 @@ static void c5471_receive(struct c5471_driver_s *priv)
if (dev->d_len > 0 &&
(EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(dev->d_flags))
{
arp_out(dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(dev);
}
#endif
/* And send the packet */
c5471_transmit(priv);

View file

@ -1685,11 +1685,8 @@ static void gd32_receive(struct gd32_enet_mac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1698,10 +1695,6 @@ static void gd32_receive(struct gd32_enet_mac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
arp_out(&priv->dev);
/* And send the packet */
gd32_transmit(priv);

View file

@ -765,11 +765,8 @@ static inline void imx_dispatch(struct imx_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -778,21 +775,6 @@ static inline void imx_dispatch(struct imx_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
imx_transmit(priv);
@ -818,21 +800,6 @@ static inline void imx_dispatch(struct imx_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
imx_transmit(priv);

View file

@ -807,11 +807,8 @@ static inline void imxrt_dispatch(struct imxrt_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -820,21 +817,6 @@ static inline void imxrt_dispatch(struct imxrt_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
imxrt_transmit(priv);
@ -860,21 +842,6 @@ static inline void imxrt_dispatch(struct imxrt_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
imxrt_transmit(priv);

View file

@ -602,11 +602,8 @@ static void kinetis_receive(struct kinetis_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -615,21 +612,6 @@ static void kinetis_receive(struct kinetis_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
kinetis_transmit(priv);
@ -653,21 +635,6 @@ static void kinetis_receive(struct kinetis_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
kinetis_transmit(priv);

View file

@ -916,11 +916,8 @@ static void lpc17_40_rxdone_work(void *arg)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->lp_dev);
/* Handle ARP on input then give the IPv4 packet to the
* network layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->lp_dev);
ipv4_input(&priv->lp_dev);
/* If the above function invocation resulted in data that
@ -930,21 +927,6 @@ static void lpc17_40_rxdone_work(void *arg)
if (priv->lp_dev.d_len > 0)
{
/* Update Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->lp_dev.d_flags))
#endif
{
arp_out(&priv->lp_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->lp_dev);
}
#endif
/* And send the packet */
lpc17_40_response(priv);
@ -969,21 +951,6 @@ static void lpc17_40_rxdone_work(void *arg)
if (priv->lp_dev.d_len > 0)
{
/* Update Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->lp_dev.d_flags))
{
arp_out(&priv->lp_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->lp_dev);
}
#endif
/* And send the packet */
lpc17_40_response(priv);

View file

@ -1596,11 +1596,8 @@ static void lpc43_receive(struct lpc43_ethmac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1609,21 +1606,6 @@ static void lpc43_receive(struct lpc43_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
lpc43_transmit(priv);
@ -1646,21 +1628,6 @@ static void lpc43_receive(struct lpc43_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
lpc43_transmit(priv);

View file

@ -847,28 +847,6 @@ static void lpc54_eth_reply(struct lpc54_ethdriver_s *priv)
#warning Missing Logic
#endif
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6
/* Check for an outgoing IPv4 packet */
if (IFF_IS_IPv4(priv->eth_dev.d_flags))
#endif
{
arp_out(&priv->eth_dev);
}
#endif
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv4
/* Otherwise, it must be an outgoing IPv6 packet */
else
#endif
{
neighbor_out(&priv->eth_dev);
}
#endif
/* And send the packet */
chan = lpc54_eth_getring(priv);
@ -917,11 +895,8 @@ static void lpc54_eth_rxdispatch(struct lpc54_ethdriver_s *priv)
ninfo("IPv4 packet\n");
NETDEV_RXIPV4(dev);
/* Handle ARP on input,
* then dispatch IPv4 packet to the network layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(dev);
ipv4_input(dev);
/* Check for a reply to the IPv4 packet */

View file

@ -84,20 +84,6 @@ static void amebaz_reply(struct amebaz_dev_s *priv)
{
if (priv->dev.d_len > 0)
{
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
amebaz_transmit(priv);
}
}
@ -143,7 +129,6 @@ void amebaz_netdev_notify_receive(struct amebaz_dev_s *priv,
if (hdr->type == HTONS(ETHTYPE_IP))
{
NETDEV_RXIPV4(&priv->dev);
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
amebaz_reply(priv);
}

View file

@ -650,11 +650,8 @@ static inline void s32k1xx_dispatch(struct s32k1xx_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -663,21 +660,6 @@ static inline void s32k1xx_dispatch(struct s32k1xx_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
s32k1xx_transmit(priv);
@ -703,21 +685,6 @@ static inline void s32k1xx_dispatch(struct s32k1xx_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
s32k1xx_transmit(priv);

View file

@ -1343,11 +1343,8 @@ static void s32k3xx_receive(struct s32k3xx_driver_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should
@ -1357,21 +1354,6 @@ static void s32k3xx_receive(struct s32k3xx_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
s32k3xx_transmit(priv);
@ -1395,21 +1377,6 @@ static void s32k3xx_receive(struct s32k3xx_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
s32k3xx_transmit(priv);

View file

@ -1181,11 +1181,8 @@ static void sam_receive(struct sam_emac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1194,21 +1191,6 @@ static void sam_receive(struct sam_emac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);
@ -1231,21 +1213,6 @@ static void sam_receive(struct sam_emac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);

View file

@ -1244,11 +1244,8 @@ static void sam_receive(struct sam_emac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1257,21 +1254,6 @@ static void sam_receive(struct sam_emac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);
@ -1294,21 +1276,6 @@ static void sam_receive(struct sam_emac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);

View file

@ -1555,11 +1555,8 @@ static void sam_receive(struct sam_emac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1568,21 +1565,6 @@ static void sam_receive(struct sam_emac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);
@ -1605,21 +1587,6 @@ static void sam_receive(struct sam_emac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);

View file

@ -1188,11 +1188,8 @@ static void sam_receive(struct sam_gmac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1202,21 +1199,6 @@ static void sam_receive(struct sam_gmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);
@ -1240,21 +1222,6 @@ static void sam_receive(struct sam_gmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);

View file

@ -1173,11 +1173,8 @@ static void sam_receive(struct sam_gmac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1186,21 +1183,6 @@ static void sam_receive(struct sam_gmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);
@ -1223,21 +1205,6 @@ static void sam_receive(struct sam_gmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv);

View file

@ -1877,11 +1877,8 @@ static void sam_receive(struct sam_emac_s *priv, int qid)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1890,21 +1887,6 @@ static void sam_receive(struct sam_emac_s *priv, int qid)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv, qid);
@ -1928,21 +1910,6 @@ static void sam_receive(struct sam_emac_s *priv, int qid)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
sam_transmit(priv, qid);

View file

@ -1725,11 +1725,8 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1738,21 +1735,6 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
stm32_transmit(priv);
@ -1775,21 +1757,6 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
stm32_transmit(priv);

View file

@ -1806,11 +1806,8 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1819,21 +1816,6 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
stm32_transmit(priv);
@ -1856,21 +1838,6 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
stm32_transmit(priv);

View file

@ -1913,11 +1913,8 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should
@ -1927,21 +1924,6 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
stm32_transmit(priv);
@ -1965,21 +1947,6 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
stm32_transmit(priv);

View file

@ -762,11 +762,8 @@ static void tiva_receive(struct tiva_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(dev);
ipv4_input(dev);
/* If the above function invocation resulted in data that should be
@ -775,21 +772,6 @@ static void tiva_receive(struct tiva_driver_s *priv)
if (dev->d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(dev->d_flags))
#endif
{
arp_out(dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(dev);
}
#endif
/* And send the packet */
tiva_transmit(priv);
@ -805,7 +787,6 @@ static void tiva_receive(struct tiva_driver_s *priv)
/* Give the IPv6 packet to the network layer */
arp_ipin(dev);
ipv6_input(dev);
/* If the above function invocation resulted in data that should be
@ -813,22 +794,7 @@ static void tiva_receive(struct tiva_driver_s *priv)
*/
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(dev->d_flags))
{
arp_out(dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(dev);
}
#endif
{
/* And send the packet */
tiva_transmit(priv);

View file

@ -1699,11 +1699,8 @@ static void tiva_receive(struct tiva_ethmac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1712,21 +1709,6 @@ static void tiva_receive(struct tiva_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
tiva_transmit(priv);
@ -1749,21 +1731,6 @@ static void tiva_receive(struct tiva_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
tiva_transmit(priv);

View file

@ -254,11 +254,8 @@ static void emac_receive(FAR struct emac_driver_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->d_dev);
ipv4_input(&priv->d_dev);
/* If the above function invocation resulted in data that should be
@ -267,21 +264,6 @@ static void emac_receive(FAR struct emac_driver_s *priv)
if (priv->d_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->d_dev.d_flags))
#endif
{
arp_out(&priv->d_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->d_dev);
}
#endif
/* And send the packet */
emac_transmit(priv);
@ -304,21 +286,6 @@ static void emac_receive(FAR struct emac_driver_s *priv)
if (priv->d_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->d_dev.d_flags))
{
arp_out(&priv->d_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->d_dev);
}
#endif
/* And send the packet */
emac_transmit(priv);

View file

@ -1383,11 +1383,8 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->pd_dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->pd_dev);
ipv4_input(&priv->pd_dev);
/* If the above function invocation resulted in data that
@ -1397,24 +1394,9 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
if (priv->pd_dev.d_len > 0)
{
/* Update Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->pd_dev.d_flags))
#endif
{
arp_out(&priv->pd_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->pd_dev);
}
#endif
/* And send the packet */
pic32mx_response(priv);
pic32mx_response(priv);
}
}
else
@ -1436,21 +1418,6 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
if (priv->pd_dev.d_len > 0)
{
/* Update Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->pd_dev.d_flags))
{
arp_out(&priv->pd_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->pd_dev);
}
#endif
/* And send the packet */
pic32mx_response(priv);

View file

@ -1494,11 +1494,8 @@ static void pic32mz_rxdone(struct pic32mz_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->pd_dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->pd_dev);
ipv4_input(&priv->pd_dev);
/* If the above function invocation resulted in data that
@ -1508,23 +1505,6 @@ static void pic32mz_rxdone(struct pic32mz_driver_s *priv)
if (priv->pd_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC
* address
*/
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->pd_dev.d_flags))
#endif
{
arp_out(&priv->pd_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->pd_dev);
}
#endif
/* And send the packet */
pic32mz_response(priv);
@ -1549,23 +1529,6 @@ static void pic32mz_rxdone(struct pic32mz_driver_s *priv)
if (priv->pd_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC
* address
*/
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->pd_dev.d_flags))
{
arp_out(&priv->pd_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->pd_dev);
}
#endif
/* And send the packet */
pic32mz_response(priv);

View file

@ -370,11 +370,8 @@ static void misoc_net_receive(struct misoc_net_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->misoc_net_dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->misoc_net_dev);
ipv4_input(&priv->misoc_net_dev);
/* If the above function invocation resulted in data that should be
@ -383,21 +380,6 @@ static void misoc_net_receive(struct misoc_net_driver_s *priv)
if (priv->misoc_net_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->misoc_net_dev.d_flags))
#endif
{
arp_out(&priv->misoc_net_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&kel->misoc_net_dev);
}
#endif
/* And send the packet */
misoc_net_transmit(priv);
@ -421,21 +403,6 @@ static void misoc_net_receive(struct misoc_net_driver_s *priv)
if (priv->misoc_net_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->misoc_net_dev.d_flags))
{
arp_out(&priv->misoc_net_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->misoc_net_dev);
}
#endif
/* And send the packet */
misoc_net_transmit(priv);

View file

@ -1516,17 +1516,14 @@ static void rx65n_receive(FAR struct rx65n_ethmac_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
/* Increment statistics */
#if defined(CONFIG_NETDEV_STATISTICS)
(priv->dev.d_statistics.rx_ipv4)++;
(priv->dev.d_statistics.rx_ipv4)++;
#endif
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data
@ -1537,21 +1534,6 @@ static void rx65n_receive(FAR struct rx65n_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
rx65n_transmit(priv);
@ -1575,21 +1557,6 @@ static void rx65n_receive(FAR struct rx65n_ethmac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
rx65n_transmit(priv);

View file

@ -419,30 +419,6 @@ static void bl602_net_reply(struct bl602_net_driver_s *priv)
if (priv->net_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6
/* Check for an outgoing IPv4 packet */
if (IFF_IS_IPv4(priv->net_dev.d_flags))
#endif
{
arp_out(&priv->net_dev);
}
#endif
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv4
/* Otherwise, it must be an outgoing IPv6 packet */
else
#endif
{
neighbor_out(&priv->net_dev);
}
#endif
/* alloc tx buffer and copy to it */
tx_p = bl602_netdev_alloc_txbuf();
@ -519,11 +495,8 @@ static void bl602_net_receive(struct bl602_net_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->net_dev);
/* Handle ARP on input, then dispatch IPv4 packet to the network
* layer.
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->net_dev);
ipv4_input(&priv->net_dev);
/* Check for a reply to the IPv4 packet */

View file

@ -720,11 +720,8 @@ static void wlan_rxpoll(void *arg)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data
@ -734,21 +731,6 @@ static void wlan_rxpoll(void *arg)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
wlan_cache_txpkt_tail(priv);
@ -772,21 +754,6 @@ static void wlan_rxpoll(void *arg)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
wlan_cache_txpkt_tail(priv);

View file

@ -568,11 +568,8 @@ static void litex_receive(struct litex_emac_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -581,21 +578,6 @@ static void litex_receive(struct litex_emac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
litex_transmit(priv);
@ -619,21 +601,6 @@ static void litex_receive(struct litex_emac_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
litex_transmit(priv);

View file

@ -835,11 +835,8 @@ static void mpfs_receive(struct mpfs_ethmac_s *priv, unsigned int queue)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -849,21 +846,6 @@ static void mpfs_receive(struct mpfs_ethmac_s *priv, unsigned int queue)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
mpfs_transmit(priv, queue);
@ -888,19 +870,6 @@ static void mpfs_receive(struct mpfs_ethmac_s *priv, unsigned int queue)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
{
neighbor_out(&priv->dev);
}
/* And send the packet */
mpfs_transmit(priv, queue);

View file

@ -107,28 +107,6 @@ static void netdriver_reply(struct net_driver_s *dev)
if (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(dev->d_flags))
#endif
{
arp_out(dev);
}
#endif /* CONFIG_NET_IPv4 */
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv4
else
#endif
{
neighbor_out(dev);
}
#endif /* CONFIG_NET_IPv6 */
/* Send the packet */
NETDEV_TXPACKETS(dev);
@ -189,11 +167,8 @@ static void netdriver_recv_work(void *arg)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(dev);
/* Handle ARP on input then give the IPv4 packet to
* the network layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(dev);
ipv4_input(dev);
/* Check for a reply to the IPv4 packet */

View file

@ -1370,11 +1370,8 @@ static void emac_rx_interrupt_work(void *arg)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1383,21 +1380,6 @@ static void emac_rx_interrupt_work(void *arg)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
emac_transmit(priv);
@ -1420,21 +1402,6 @@ static void emac_rx_interrupt_work(void *arg)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
emac_transmit(priv);

View file

@ -717,11 +717,8 @@ static void wlan_rxpoll(void *arg)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data
@ -731,21 +728,6 @@ static void wlan_rxpoll(void *arg)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
wlan_cache_txpkt_tail(priv);
@ -769,21 +751,6 @@ static void wlan_rxpoll(void *arg)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
wlan_cache_txpkt_tail(priv);

View file

@ -1365,12 +1365,9 @@ static int ez80emac_receive(FAR struct ez80emac_driver_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
EMAC_STAT(priv, rx_ip);
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1380,21 +1377,6 @@ static int ez80emac_receive(FAR struct ez80emac_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
ez80emac_transmit(priv);
@ -1419,21 +1401,6 @@ static int ez80emac_receive(FAR struct ez80emac_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
ez80emac_transmit(priv);

View file

@ -901,11 +901,8 @@ static void dm9x_receive(FAR struct dm9x_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dm_dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dm_dev);
ipv4_input(&priv->dm_dev);
/* If the above function invocation resulted in data that
@ -915,21 +912,6 @@ static void dm9x_receive(FAR struct dm9x_driver_s *priv)
if (priv->dm_dev.d_len > 0)
{
/* Update Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dm_dev.d_flags))
#endif
{
arp_out(&priv->dm_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dm_dev);
}
#endif
/* And send the packet */
dm9x_transmit(priv);
@ -954,24 +936,9 @@ static void dm9x_receive(FAR struct dm9x_driver_s *priv)
if (priv->dm_dev.d_len > 0)
{
/* Update Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dm_dev.d_flags))
{
arp_out(&priv->dm_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dm_dev);
}
#endif
/* And send the packet */
dm9x_transmit(priv);
dm9x_transmit(priv);
}
}
else

View file

@ -1345,11 +1345,8 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* If the above function invocation resulted in data that should be
@ -1358,21 +1355,6 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
enc_transmit(priv);
@ -1396,21 +1378,6 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
enc_transmit(priv);

View file

@ -1432,11 +1432,8 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
/* Free the packet */
@ -1450,21 +1447,6 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
enc_txenqueue(priv);
@ -1493,21 +1475,6 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
enc_txenqueue(priv);

View file

@ -651,11 +651,8 @@ static void ftmac100_receive(FAR struct ftmac100_driver_s *priv)
{
ninfo("IPv4 frame\n");
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->ft_dev);
ipv4_input(&priv->ft_dev);
/* If the above function invocation resulted in data that should be
@ -665,21 +662,6 @@ static void ftmac100_receive(FAR struct ftmac100_driver_s *priv)
if (priv->ft_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->ft_dev.d_flags))
#endif
{
arp_out(&priv->ft_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->ft_dev);
}
#endif
/* And send the packet */
ftmac100_transmit(priv);
@ -703,21 +685,6 @@ static void ftmac100_receive(FAR struct ftmac100_driver_s *priv)
if (priv->ft_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->ft_dev.d_flags))
{
arp_out(&priv->ft_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->ft_dev);
}
#endif
/* And send the packet */
ftmac100_transmit(priv);

View file

@ -534,22 +534,6 @@ static void lan91c111_reply(FAR struct net_driver_s *dev)
if (dev->d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(dev->d_flags))
{
arp_out(dev);
}
#endif
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv6(dev->d_flags))
{
neighbor_out(dev);
}
#endif
/* And send the packet */
lan91c111_transmit(dev);
@ -645,11 +629,8 @@ static void lan91c111_receive(FAR struct net_driver_s *dev)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(dev);
/* Handle ARP on input, then dispatch IPv4 packet to the network
* layer.
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(dev);
ipv4_input(dev);
/* Check for a reply to the IPv4 packet */

View file

@ -300,22 +300,6 @@ static void net_rpmsg_drv_reply(FAR struct net_driver_s *dev)
if (dev->d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(dev->d_flags))
{
arp_out(dev);
}
#endif
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv6(dev->d_flags))
{
neighbor_out(dev);
}
#endif
/* And send the packet */
net_rpmsg_drv_transmit(dev, false);
@ -520,11 +504,8 @@ static int net_rpmsg_drv_transfer_handler(FAR struct rpmsg_endpoint *ept,
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(dev);
/* Handle ARP on input, then dispatch IPv4 packet to the network
* layer.
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(dev);
ipv4_input(dev);
/* Check for a reply to the IPv4 packet */

View file

@ -293,30 +293,6 @@ static void skel_reply(struct skel_driver_s *priv)
if (priv->sk_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6
/* Check for an outgoing IPv4 packet */
if (IFF_IS_IPv4(priv->sk_dev.d_flags))
#endif
{
arp_out(&priv->sk_dev);
}
#endif
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv4
/* Otherwise, it must be an outgoing IPv6 packet */
else
#endif
{
neighbor_out(&priv->sk_dev);
}
#endif
/* And send the packet */
skel_transmit(priv);
@ -368,11 +344,8 @@ static void skel_receive(FAR struct skel_driver_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->sk_dev);
/* Handle ARP on input, then dispatch IPv4 packet to the network
* layer.
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->sk_dev);
ipv4_input(&priv->sk_dev);
/* Check for a reply to the IPv4 packet */

View file

@ -474,9 +474,8 @@ static void tun_net_receive_tap(FAR struct tun_device_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
/* Give the IPv4 packet to the network layer. */
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->dev);
ipv4_input(&priv->dev);
}
else
@ -523,21 +522,6 @@ static void tun_net_receive_tap(FAR struct tun_device_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
priv->write_d_len = priv->dev.d_len;

View file

@ -1224,22 +1224,6 @@ static void w5500_reply(FAR struct w5500_driver_s *self)
if (self->w_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(self->w_dev.d_flags))
{
arp_out(&self->w_dev);
}
#endif
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv6(self->w_dev.d_flags))
{
neighbor_out(&self->w_dev);
}
#endif
/* And send the packet */
w5500_transmit(self);
@ -1389,11 +1373,8 @@ static void w5500_receive(FAR struct w5500_driver_s *self)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&self->w_dev);
/* Handle ARP on input, then dispatch IPv4 packet to the network
* layer.
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&self->w_dev);
ipv4_input(&self->w_dev);
/* Check for a reply to the IPv4 packet */

View file

@ -378,30 +378,6 @@ static void cdcecm_reply(struct cdcecm_driver_s *priv)
if (priv->dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6
/* Check for an outgoing IPv4 packet */
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
}
#endif
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv4
/* Otherwise, it must be an outgoing IPv6 packet */
else
#endif
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
cdcecm_transmit(priv);
@ -454,11 +430,8 @@ static void cdcecm_receive(FAR struct cdcecm_driver_s *self)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&self->dev);
/* Handle ARP on input, then dispatch IPv4 packet to the network
* layer.
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&self->dev);
ipv4_input(&self->dev);
/* Check for a reply to the IPv4 packet */

View file

@ -868,30 +868,12 @@ static void rndis_rxdispatch(FAR void *arg)
{
NETDEV_RXIPV4(&priv->netdev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->netdev);
ipv4_input(&priv->netdev);
if (priv->netdev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->netdev.d_flags))
#endif
{
arp_out(&priv->netdev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->netdev);
}
#endif
/* And send the packet */
rndis_transmit(priv);
@ -906,26 +888,10 @@ static void rndis_rxdispatch(FAR void *arg)
/* Give the IPv6 packet to the network layer */
arp_ipin(&priv->netdev);
ipv6_input(&priv->netdev);
if (priv->netdev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->netdev.d_flags))
{
arp_out(&priv->netdev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->netdev);
}
#endif
/* And send the packet */
rndis_transmit(priv);

View file

@ -286,11 +286,8 @@ static void bcmf_receive(FAR struct bcmf_dev_s *priv)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->bc_dev);
/* Handle ARP on input then give the IPv4 packet to the network
* layer
*/
/* Receive an IPv4 packet from the network device */
arp_ipin(&priv->bc_dev);
ipv4_input(&priv->bc_dev);
/* If the above function invocation resulted in data that should be
@ -299,21 +296,6 @@ static void bcmf_receive(FAR struct bcmf_dev_s *priv)
if (priv->bc_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv4(priv->bc_dev.d_flags))
#endif
{
arp_out(&priv->bc_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&kel->bc_dev);
}
#endif
/* And send the packet */
bcmf_transmit(priv, frame);
@ -343,21 +325,6 @@ static void bcmf_receive(FAR struct bcmf_dev_s *priv)
if (priv->bc_dev.d_len > 0)
{
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->bc_dev.d_flags))
{
arp_out(&priv->bc_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->bc_dev);
}
#endif
/* And send the packet */
bcmf_transmit(priv, frame);

View file

@ -92,6 +92,7 @@
#include <nuttx/net/netconfig.h>
#include <nuttx/net/netdev.h>
#include <nuttx/net/netstats.h>
#include <nuttx/net/arp.h>
#include <nuttx/net/ip.h>
#include "inet/inet.h"
@ -137,6 +138,11 @@ int ipv4_input(FAR struct net_driver_s *dev)
in_addr_t destipaddr;
uint16_t llhdrlen;
uint16_t totlen;
int ret = OK;
/* Handle ARP on input then give the IPv4 packet to the network layer */
arp_ipin(dev);
/* This is where the input processing starts. */
@ -236,7 +242,8 @@ int ipv4_input(FAR struct net_driver_s *dev)
ipv4_forward_broadcast(dev, ipv4);
#endif
return udp_ipv4_input(dev);
ret = udp_ipv4_input(dev);
goto done;
}
else
#endif
@ -256,7 +263,8 @@ int ipv4_input(FAR struct net_driver_s *dev)
ipv4_forward_broadcast(dev, ipv4);
#endif
return udp_ipv4_input(dev);
ret = udp_ipv4_input(dev);
goto done;
}
else
#endif
@ -296,7 +304,7 @@ int ipv4_input(FAR struct net_driver_s *dev)
* it was received on.
*/
return OK;
goto done;
}
else
#endif
@ -394,9 +402,15 @@ int ipv4_input(FAR struct net_driver_s *dev)
goto drop;
}
done:
if (dev->d_len > 0)
{
arp_out(dev);
}
/* Return and let the caller do any pending transmission. */
return OK;
return ret;
/* Drop the packet. NOTE that OK is returned meaning that the
* packet has been processed (although processed unsuccessfully).

View file

@ -372,7 +372,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
* it was received on.
*/
return OK;
goto done;
}
else
#endif
@ -505,6 +505,14 @@ int ipv6_input(FAR struct net_driver_s *dev)
goto drop;
}
#ifdef CONFIG_NET_IPFORWARD
done:
#endif
if (dev->d_len > 0)
{
neighbor_out(dev);
}
/* Return and let the caller do any pending transmission. */
return OK;