diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-09-27 08:27:35 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-09-27 08:27:35 -0600 |
commit | be67d1ffbebf6d799c76addd003895fc36aea7c5 (patch) | |
tree | bf2b105f00d6f62aec0c7eec61d68824360cce95 | |
parent | c83c95eb6b801da6539fa7ffbca95104ea42605d (diff) | |
download | nuttx-be67d1ffbebf6d799c76addd003895fc36aea7c5.tar.gz nuttx-be67d1ffbebf6d799c76addd003895fc36aea7c5.tar.bz2 nuttx-be67d1ffbebf6d799c76addd003895fc36aea7c5.zip |
Networking: Fix backward conditional in test to see if address is in ARP table. From Max Holtzberg
-rw-r--r-- | nuttx/ChangeLog | 5 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_gmac.c | 10 | ||||
-rw-r--r-- | nuttx/net/send.c | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index f685333ca..42e07a27f 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -5646,5 +5646,8 @@ if the packet is being sent out of our subnet (via a router). The fallback here is just to use "eth0" if the subnet lookup fails. This will, of course, will have to be revisited if/when - multiple NICs are supported (2013-9-27). + multiple NICs are supported. From Max Holtzberg (2013-9-27). + * net/send.c: Fix some backward conditional logic in check + to see if we should check if the ARP address in the table. From + Max Holzberg (2013-9-27). diff --git a/nuttx/arch/arm/src/sama5/sam_gmac.c b/nuttx/arch/arm/src/sama5/sam_gmac.c index b25d74b57..6971d7a85 100644 --- a/nuttx/arch/arm/src/sama5/sam_gmac.c +++ b/nuttx/arch/arm/src/sama5/sam_gmac.c @@ -1831,7 +1831,7 @@ static void sam_phydump(struct sam_gmac_s *priv) static void sam_enablemdio(struct sam_gmac_s *priv) { uint32_t regval; - uint32_t enables; + uint32_t ncr; /* Enable management port */ @@ -2489,14 +2489,11 @@ static void sam_mdcclock(struct sam_gmac_s *priv) { uint32_t ncfgr; uint32_t ncr; - uint32_t enables; /* Disable RX and TX momentarily */ - ncr = sam_getreg(priv, SAM_GMAC_NCR); - enables = ncr & (GMAC_NCR_RXEN | GMAC_NCR_TXEN); - ncr &= ~(GMAC_NCR_RXEN | GMAC_NCR_TXEN); - sam_putreg(priv, SAM_GMAC_NCR, ncr); + ncr = sam_getreg(priv, SAM_GMAC_NCR); + sam_putreg(priv, SAM_GMAC_NCR, ncr & ~(GMAC_NCR_RXEN | GMAC_NCR_TXEN)); /* Modify the NCFGR register based on the configured board MCK frequency */ @@ -2523,7 +2520,6 @@ static void sam_mdcclock(struct sam_gmac_s *priv) /* Restore RX and TX enable settings */ - ncr |= enables; sam_putreg(priv, SAM_GMAC_NCR, ncr); } diff --git a/nuttx/net/send.c b/nuttx/net/send.c index 9f7c71f13..2d66f26f0 100644 --- a/nuttx/net/send.c +++ b/nuttx/net/send.c @@ -379,7 +379,7 @@ static uint16_t send_interrupt(FAR struct uip_driver_s *dev, FAR void *pvconn, * should already be in the ARP table. */ -#if defined(CONFIG_NET_ETHERNET) && defined (CONFIG_NET_ARP_IPIN) +#if defined(CONFIG_NET_ETHERNET) && !defined(CONFIG_NET_ARP_IPIN) if (pstate->snd_sent != 0 || uip_arp_find(conn->ripaddr) != NULL) #endif { |