Networking: Condition certain ARP logic on CONFIG_NET_ARP in all Ethernet drivers
This commit is contained in:
parent
d3174cdac4
commit
6bc54c3541
@ -5,7 +5,7 @@
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Based one a C5471 Linux driver and released under this BSD license with
|
||||
* special permisson from the copyright holder of the Linux driver:
|
||||
* special permission from the copyright holder of the Linux driver:
|
||||
* Todd Fischer, Cadenux, LLC. Other references: "TMS320VC547x CPU and
|
||||
* Peripherals Reference Guide," TI document spru038.pdf.
|
||||
*
|
||||
@ -1254,6 +1254,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
||||
c5471_transmit(c5471);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_NET_ARP
|
||||
else if (BUF->type == HTONS(ETHTYPE_ARP))
|
||||
{
|
||||
arp_arpin(dev);
|
||||
@ -1270,6 +1271,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
||||
c5471_transmit(c5471);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_C5471_NET_STATS
|
||||
else
|
||||
|
@ -535,6 +535,7 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv)
|
||||
kinetis_transmit(priv);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_NET_ARP
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
arp_arpin(&priv->dev);
|
||||
@ -549,6 +550,7 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv)
|
||||
kinetis_transmit(priv);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -892,7 +892,9 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv)
|
||||
lpc17_response(priv);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
EMAC_STAT(priv, rx_arp);
|
||||
arp_arpin(&priv->lp_dev);
|
||||
@ -908,6 +910,7 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Unrecognized... drop it. */
|
||||
|
||||
|
@ -1163,7 +1163,9 @@ static void sam_receive(struct sam_emac_s *priv)
|
||||
sam_transmit(priv);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
nllvdbg("ARP frame\n");
|
||||
|
||||
@ -1181,6 +1183,7 @@ static void sam_receive(struct sam_emac_s *priv)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nlldbg("DROPPED: Unknown type: %04x\n", BUF->type);
|
||||
}
|
||||
|
@ -1203,7 +1203,9 @@ static void sam_receive(struct sam_emac_s *priv)
|
||||
sam_transmit(priv);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
nllvdbg("ARP frame\n");
|
||||
|
||||
@ -1221,6 +1223,7 @@ static void sam_receive(struct sam_emac_s *priv)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nlldbg("DROPPED: Unknown type: %04x\n", BUF->type);
|
||||
}
|
||||
|
@ -1529,7 +1529,9 @@ static void sam_receive(struct sam_emac_s *priv)
|
||||
sam_transmit(priv);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
nllvdbg("ARP frame\n");
|
||||
|
||||
@ -1547,6 +1549,7 @@ static void sam_receive(struct sam_emac_s *priv)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nlldbg("DROPPED: Unknown type: %04x\n", BUF->type);
|
||||
}
|
||||
|
@ -1133,7 +1133,9 @@ static void sam_receive(struct sam_gmac_s *priv)
|
||||
sam_transmit(priv);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
nllvdbg("ARP frame\n");
|
||||
|
||||
@ -1151,6 +1153,7 @@ static void sam_receive(struct sam_gmac_s *priv)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nlldbg("DROPPED: Unknown type: %04x\n", BUF->type);
|
||||
}
|
||||
|
@ -1639,7 +1639,9 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv)
|
||||
stm32_transmit(priv);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
nllvdbg("ARP frame\n");
|
||||
|
||||
@ -1657,6 +1659,7 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nlldbg("DROPPED: Unknown type: %04x\n", BUF->type);
|
||||
}
|
||||
|
@ -785,7 +785,9 @@ static void tiva_receive(struct tiva_driver_s *priv)
|
||||
tiva_transmit(priv);
|
||||
}
|
||||
}
|
||||
else if (ETHBUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (ETHBUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
nllvdbg("ARP packet received (%02x)\n", ETHBUF->type);
|
||||
EMAC_STAT(priv, rx_arp);
|
||||
@ -801,13 +803,12 @@ static void tiva_receive(struct tiva_driver_s *priv)
|
||||
tiva_transmit(priv);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_DEBUG
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nlldbg("Unsupported packet type dropped (%02x)\n", htons(ETHBUF->type));
|
||||
EMAC_STAT(priv, rx_dropped);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1706,7 +1706,9 @@ static void tiva_receive(FAR struct tiva_ethmac_s *priv)
|
||||
tiva_transmit(priv);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
nvdbg("ARP frame\n");
|
||||
|
||||
@ -1724,6 +1726,7 @@ static void tiva_receive(FAR struct tiva_ethmac_s *priv)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nlldbg("DROPPED: Unknown type: %04x\n", BUF->type);
|
||||
}
|
||||
|
@ -277,6 +277,7 @@ static void emac_receive(FAR struct emac_driver_s *priv)
|
||||
emac_transmit(priv);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_NET_ARP
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
arp_arpin(&priv->d_dev);
|
||||
@ -290,6 +291,7 @@ static void emac_receive(FAR struct emac_driver_s *priv)
|
||||
emac_transmit(priv);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
while (true); /* While there are more packets to be processed */
|
||||
}
|
||||
|
@ -1449,7 +1449,9 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
|
||||
pic32mx_response(priv);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (BUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
/* Handle the incoming ARP packet */
|
||||
|
||||
@ -1467,6 +1469,7 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Unrecognized... drop it. */
|
||||
|
||||
|
@ -179,6 +179,7 @@ void netdriver_loop(void)
|
||||
netdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_NET_ARP
|
||||
else if (BUF->ether_type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
arp_arpin(&g_sim_dev);
|
||||
@ -193,6 +194,7 @@ void netdriver_loop(void)
|
||||
netdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ SYMBOL(up_setjmp):
|
||||
push %rsi
|
||||
|
||||
/* Save registers */
|
||||
/* Storage order: %rbx, %rsp, %rbp, %r12, %r13, %r14, %r15, %rip */
|
||||
/* Storage order: %rbx, %rsp, %rbp, %r12, %r13, %r14, %r15, %rip */
|
||||
|
||||
movq %rbp, JB_RBP(%rdi) /* Save 3: rbp */
|
||||
movq %r12, JB_R12(%rdi) /* Save 4: r12 */
|
||||
|
@ -1287,7 +1287,9 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
|
||||
ez80emac_transmit(priv);
|
||||
}
|
||||
}
|
||||
else if (ETHBUF->type == htons(ETHTYPE_ARP))
|
||||
else
|
||||
#ifdef CONFIG_NET_ARP
|
||||
if (ETHBUF->type == htons(ETHTYPE_ARP))
|
||||
{
|
||||
nvdbg("ARP packet received (%02x)\n", ETHBUF->type);
|
||||
EMAC_STAT(priv, rx_arp);
|
||||
@ -1303,13 +1305,13 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
|
||||
ez80emac_transmit(priv);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_DEBUG
|
||||
else
|
||||
#endif
|
||||
{
|
||||
ndbg("Unsupported packet type dropped (%02x)\n", ETHBUF->type);
|
||||
EMAC_STAT(priv, rx_dropped);
|
||||
}
|
||||
#endif
|
||||
|
||||
npackets++;
|
||||
}
|
||||
return npackets;
|
||||
|
Loading…
Reference in New Issue
Block a user