diff --git a/arch/arm/src/lpc17xx/lpc17_allocateheap.c b/arch/arm/src/lpc17xx/lpc17_allocateheap.c index 46d5d9e7a38fc25abd85c22ec705b86212712cb3..5bf4827999ab48a7a4f95dce827dc93727d70a43 100755 --- a/arch/arm/src/lpc17xx/lpc17_allocateheap.c +++ b/arch/arm/src/lpc17xx/lpc17_allocateheap.c @@ -57,6 +57,7 @@ ****************************************************************************/ /* Configuration ************************************************************/ +/* The configured RAM start address must be the beginning of CPU SRAM */ #if CONFIG_DRAM_START != LPC17_SRAM_BASE # warning "CONFIG_DRAM_START is not at LPC17_SRAM_BASE" @@ -66,6 +67,8 @@ # define CONFIG_DRAM_END (LPC17_SRAM_BASE+LPC17_CPUSRAM_SIZE) #endif +/* The configured RAM size must be less then or equal to the CPU SRAM size */ + #if CONFIG_DRAM_SIZE > LPC17_CPUSRAM_SIZE # warning "CONFIG_DRAM_SIZE is larger than the size of CPU SRAM" # undef CONFIG_DRAM_SIZE @@ -76,13 +79,25 @@ # warning "CONFIG_DRAM_END is before end of CPU SRAM... not all of CPU SRAM used" #endif +/* Sanity checking */ + #ifdef LPC17_HAVE_BANK0 -# if CONFIG_MM_REGIONS < 2 -# warning "CONFIG_MM_REGIONS < 2: AHB SRAM Bank(s) not included in HEAP" +# if defined(LPC17_BANK0_HEAPSIZE) || defined(LPC17_HAVE_BANK1) +# if CONFIG_MM_REGIONS < 2 +# warning "CONFIG_MM_REGIONS < 2: AHB SRAM Bank(s) not included in HEAP" +# endif +# if CONFIG_MM_REGIONS > 2 +# warning "CONFIG_MM_REGIONS > 2: Additional regions handled by application?" +# endif +# else +# if CONFIG_MM_REGIONS > 1 +# warning "CONFIG_MM_REGIONS > 1: This MCU has no available AHB SRAM Bank0/1" +# endif # endif #else # if CONFIG_MM_REGIONS > 1 # warning "CONFIG_MM_REGIONS > 1: This MCU has no AHB SRAM Bank0/1" +# warning " Other memory regions handled by application?" # endif #endif @@ -131,22 +146,44 @@ void up_addregion(void) /* Banks 0 and 1 are each 16Kb. If both are present, they occupy a * contiguous 32Kb memory region. * - * If Ethernet is enabled, it will take all of bank 0 for packet + * If Ethernet is enabled, it will take some or all of bank 0 for packet * buffering and descriptor tables. */ #ifdef LPC17_HAVE_BANK0 -# if defined(CONFIG_NET) && defined(CONFIG_LPC17_ETHERNET) && defined(LPC17_NETHCONTROLLERS) -# ifdef LPC17_HAVE_BANK1 - mm_addregion((FAR void*)LPC17_SRAM_BANK1, LPC17_BANK1_SIZE); -# endif + + /* We have BANK0 (and, hence, possibly Bank1). Is Bank0 all used for + * Ethernet packet buffering? Or is there any part of Bank0 available for + * the heap. + */ + +# ifdef LPC17_BANK0_HEAPSIZE + + /* Some or all of Bank0 is available for the heap. Is Bank1 present? */ + +# ifdef LPC17_HAVE_BANK1 + + /* Yes... the heap space available is the unused memory at the end of + * Bank0 plus all of Bank1. + */ + + mm_addregion((FAR void*)LPC17_BANK0_HEAPBASE, LPC17_BANK0_HEAPSIZE+LPC17_BANK1_SIZE); # else -# ifdef LPC17_HAVE_BANK1 - mm_addregion((FAR void*)LPC17_SRAM_BANK0, LPC17_BANK0_SIZE+LPC17_BANK1_SIZE); -# else - mm_addregion((FAR void*)LPC17_SRAM_BANK0, LPC17_BANK0_SIZE); -# endif + + /* No... only the unused memory at the end of Bank0 is available for the + * heap/ + */ + + mm_addregion((FAR void*)LPC17_BANK0_HEAPBASE, LPC17_BANK0_HEAPSIZE); +# endif +# else + + /* Nothing is available in Bank0. Is Bank1 available? */ + +# ifdef LPC17_HAVE_BANK1 + mm_addregion((FAR void*)LPC17_SRAM_BANK1, LPC17_BANK1_SIZE); # endif +# endif #endif } #endif diff --git a/arch/arm/src/lpc17xx/lpc17_emacram.h b/arch/arm/src/lpc17xx/lpc17_emacram.h index 75137084e0b2c1e76b97fb557b2512dc8f27c3ec..3759ccb9ee9f264a52fbfa22d489587660f78fa6 100755 --- a/arch/arm/src/lpc17xx/lpc17_emacram.h +++ b/arch/arm/src/lpc17xx/lpc17_emacram.h @@ -41,20 +41,36 @@ ************************************************************************************/ #include <nuttx/config.h> -#if defined(CONFIG_NET) && defined(CONFIG_LPC17_ETHERNET) - #include "chip.h" #include "lpc17_memorymap.h" -/* Does this chip have and ethernet controller? */ - -#if LPC17_NETHCONTROLLERS > 0 - /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ +/* Default, no-EMAC Case ************************************************************/ +/* Assume that all of AHB SRAM will be available for heap. If this is not true, then + * LPC17_BANK0_HEAPSIZE will be undefined and redefined below. + */ + +#undef LPC17_BANK0_HEAPBASE +#undef LPC17_BANK0_HEAPSIZE +#ifdef LPC17_HAVE_BANK0 +# define LPC17_BANK0_HEAPBASE LPC17_SRAM_BANK0 +# define LPC17_BANK0_HEAPSIZE LPC17_BANK0_SIZE +#endif -/* Configuration ********************************************************************/ +/* Is networking enabled? Is the LPC17xx Ethernet device enabled? Does this chip have + * and Ethernet controlloer? Yes... then we will replace the above default definitions. + */ + +#if defined(CONFIG_NET) && defined(CONFIG_LPC17_ETHERNET) && LPC17_NETHCONTROLLERS > 0 + +/* EMAC RAM Configuration ***********************************************************/ +/* Is AHB SRAM available? */ + +#ifndef LPC17_HAVE_BANK0 +# error "AHB SRAM Bank0 is not available for EMAC RAM" +#endif /* Number of Tx descriptors */ @@ -68,12 +84,43 @@ # define CONFIG_NET_NRXDESC 18 #endif -/* All of AHB SRAM, Bank 0 is set aside for EMAC Tx and Rx descriptors. */ +/* Size of the region at the beginning of AHB SRAM 0 set set aside for the EMAC. + * This size must fit within AHB SRAM Bank 0 and also be a multiple of 32-bit + * words. + */ + +#ifndef CONFIG_NET_EMACRAM_SIZE +# define CONFIG_NET_EMACRAM_SIZE LPC17_BANK0_SIZE +#endif + +#if CONFIG_NET_EMACRAM_SIZE > LPC17_BANK0_SIZE +# error "EMAC RAM size cannot exceed the size of AHB SRAM Bank 0" +#endif + +#if (CONFIG_NET_EMACRAM_SIZE & 3) != 0 +# error "EMAC RAM size must be in multiples of 32-bit words" +#endif + +/* Determine is there is any meaning space left at the end of AHB Bank 0 that + * could be added to the heap. + */ + +#undef LPC17_BANK0_HEAPBASE +#undef LPC17_BANK0_HEAPSIZE +#if CONFIG_NET_EMACRAM_SIZE < (LPC17_BANK0_SIZE-128) +# define LPC17_BANK0_HEAPBASE (LPC17_SRAM_BANK0 + CONFIG_NET_EMACRAM_SIZE) +# define LPC17_BANK0_HEAPSIZE (LPC17_BANK0_SIZE - CONFIG_NET_EMACRAM_SIZE) +#endif + +/* Memory at the beginning of AHB SRAM, Bank 0 is set aside for EMAC Tx and Rx + * descriptors. The position is not controllable, only the size of the region + * is controllable. + */ #define LPC17_EMACRAM_BASE LPC17_SRAM_BANK0 -#define LPC17_EMACRAM_SIZE LPC17_BANK0_SIZE +#define LPC17_EMACRAM_SIZE CONFIG_NET_EMACRAM_SIZE -/* Descriptors Memory Layout ********************************************************/ +/* Descriptor Memory Layout *********************************************************/ /* EMAC DMA RAM and descriptor definitions. The configured number of descriptors * will determine the organization and the size of the descriptor and status tables. * There is a complex interaction between the maximum packet size (CONFIG_NET_BUFSIZE) @@ -90,7 +137,7 @@ * * An example with all of the details: * - * NTXDESC=18 NRXDESC=18 CONFIG_NET_BUFSIZE=420: + * NTXDESC=18 NRXDESC=18 CONFIG_NET_EMACRAM_SIZE=16Kb CONFIG_NET_BUFSIZE=420: * LPC17_TXDESCTAB_SIZE = 18*8 = 144 * LPC17_TXSTATTAB_SIZE = 18*4 = 72 * LPC17_TXTAB_SIZE = 216 @@ -191,6 +238,5 @@ * Public Functions ************************************************************************************/ -#endif /* LPC17_NETHCONTROLLERS > 0 */ -#endif /* CONFIG_NET && CONFIG_LPC17_ETHERNET */ +#endif /* CONFIG_NET && CONFIG_LPC17_ETHERNET && LPC17_NETHCONTROLLERS > 0*/ #endif /* __ARCH_ARM_SRC_LPC17XX_LPC17_EMACRAM_H */ diff --git a/configs/mbed/README.txt b/configs/mbed/README.txt index 01becd3df1552a8661ec4fcce9cb38bfc08b0938..6098fc88b248c58508cadb1864d54b1f8200b046 100755 --- a/configs/mbed/README.txt +++ b/configs/mbed/README.txt @@ -291,6 +291,7 @@ mbed Configuration Options CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex + CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/mbed/nsh/defconfig b/configs/mbed/nsh/defconfig index d8f55906288b834a6dba37260d0622b57202b243..1cddaa924d75ea640ad3df1e5725118f0249af8f 100755 --- a/configs/mbed/nsh/defconfig +++ b/configs/mbed/nsh/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/nucleus2g/README.txt b/configs/nucleus2g/README.txt index 229c69a9bd1d667550eb8f7d5ab0790eca6ba326..654fd90894c777a8d9a94d39afbe525bee927f0a 100755 --- a/configs/nucleus2g/README.txt +++ b/configs/nucleus2g/README.txt @@ -403,6 +403,7 @@ Nucleus 2G Configuration Options CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex + CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/nucleus2g/nsh/defconfig b/configs/nucleus2g/nsh/defconfig index 0ae8f76a981959c2d1f9bdcacd0d71f1772cb6d6..447df77ba32346f79980e34644b8e368ea6501ae 100755 --- a/configs/nucleus2g/nsh/defconfig +++ b/configs/nucleus2g/nsh/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/nucleus2g/ostest/defconfig b/configs/nucleus2g/ostest/defconfig index f55fc07f08d0afe1ce17ff5cd98dd6e6acff4d17..4f532128916070da4c9473eb39dc3e1a35da62f1 100755 --- a/configs/nucleus2g/ostest/defconfig +++ b/configs/nucleus2g/ostest/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/nucleus2g/usbserial/defconfig b/configs/nucleus2g/usbserial/defconfig index 1b3d0fdfbec7976173636d0da2de3b1dbc4af9ae..aaed805b1584cf84210eded41ca003d8d7722579 100755 --- a/configs/nucleus2g/usbserial/defconfig +++ b/configs/nucleus2g/usbserial/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/nucleus2g/usbstorage/defconfig b/configs/nucleus2g/usbstorage/defconfig index 8b21405a2097ece3a7aba31579b0693d65a939bb..fc0aa5f96be9be9e86ec229eb28f4755b43d4bb9 100755 --- a/configs/nucleus2g/usbstorage/defconfig +++ b/configs/nucleus2g/usbstorage/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/olimex-lpc1766stk/README.txt b/configs/olimex-lpc1766stk/README.txt index 7aebf16ee65210356d9d4e39ffed2de576cbf2a6..65264b770beb67eb0e2518b225cae8d29c15072b 100755 --- a/configs/olimex-lpc1766stk/README.txt +++ b/configs/olimex-lpc1766stk/README.txt @@ -609,6 +609,7 @@ Olimex LPC1766-STK Configuration Options CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex + CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/olimex-lpc1766stk/nettest/defconfig b/configs/olimex-lpc1766stk/nettest/defconfig index 2d36172c116cb1c08911fbbac451354f183900ef..be6fb996037ea8519dc3a6a59fab1eb12316eaa5 100755 --- a/configs/olimex-lpc1766stk/nettest/defconfig +++ b/configs/olimex-lpc1766stk/nettest/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/olimex-lpc1766stk/nsh/defconfig b/configs/olimex-lpc1766stk/nsh/defconfig index 783070df68e94c8e1acbf734328b25245d308881..d8dcf573aecbc1a08f1b5b1eac7021c34679399d 100755 --- a/configs/olimex-lpc1766stk/nsh/defconfig +++ b/configs/olimex-lpc1766stk/nsh/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/olimex-lpc1766stk/ostest/defconfig b/configs/olimex-lpc1766stk/ostest/defconfig index d0dc7385d321b0f6d6f3213c6623333c4a0daaa6..3b9eb5384c90e79daa916261691811fa13331ef7 100755 --- a/configs/olimex-lpc1766stk/ostest/defconfig +++ b/configs/olimex-lpc1766stk/ostest/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/olimex-lpc1766stk/thttpd/defconfig b/configs/olimex-lpc1766stk/thttpd/defconfig index 4b2b5345edd261a44d6cf502ef39bb6348cf27f8..f8eebba352672129e7fd325f0e42f4f080063b4f 100755 --- a/configs/olimex-lpc1766stk/thttpd/defconfig +++ b/configs/olimex-lpc1766stk/thttpd/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/olimex-lpc1766stk/usbserial/defconfig b/configs/olimex-lpc1766stk/usbserial/defconfig index acef97a79bbb2a2a168a6a7ea91562cdc27be72e..29b78e72b60d210e0c7c0a1f6264ae455a369fe2 100755 --- a/configs/olimex-lpc1766stk/usbserial/defconfig +++ b/configs/olimex-lpc1766stk/usbserial/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/configs/olimex-lpc1766stk/usbstorage/defconfig b/configs/olimex-lpc1766stk/usbstorage/defconfig index 033d42c5652f3d6a2e070152909a6fdc666253d5..99619b98ab510f296a2d08c129a98b8ab0aaaa6b 100755 --- a/configs/olimex-lpc1766stk/usbstorage/defconfig +++ b/configs/olimex-lpc1766stk/usbstorage/defconfig @@ -188,6 +188,7 @@ CONFIG_UART3_2STOP=0 # CONFIG_PHY_AUTONEG - Enable auto-negotion # CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed. # CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex +# CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb # CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18 # CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18 # CONFIG_NET_PRIORITY - Ethernet interrupt priority. The is default is diff --git a/net/send.c b/net/send.c index 14b9cea9925e6d0b2f4ef8812bda952f5ebf285e..b3f1373765bd068d794d89d3b03dc65a1def52e4 100644 --- a/net/send.c +++ b/net/send.c @@ -268,13 +268,17 @@ static uint16_t send_interrupt(struct uip_driver_s *dev, void *pvconn, * then the send won't actually make it out... it will be replaced with * an ARP request. * - * NOTE: If we are actually harvesting IP addresses on incomming IP - * packets, then this check should be necessary; the MAC mapping should - * already be in the ARP table. + * NOTE 1: This could an expensive check if there are a lot of entries + * in the ARP table. Hence, we only check on the first packet -- when + * snd_sent is zero. + * + * NOTE 2: If we are actually harvesting IP addresses on incomming IP + * packets, then this check should not be necessary; the MAC mapping + * should already be in the ARP table. */ #ifndef CONFIG_NET_ARP_IPIN - if (uip_arp_find(conn->ripaddr) != NULL) + if (pstate->snd_sent != 0 || uip_arp_find(conn->ripaddr) != NULL) #endif { /* Update the amount of data sent (but not necessarily ACKed) */