]> granicus.if.org Git - esp-idf/commitdiff
make build pass when disable per soc tcp window
authorLiu Zhi Fu <liuzhifu@espressif.com>
Mon, 31 Oct 2016 11:38:47 +0000 (19:38 +0800)
committerLiu Zhi Fu <liuzhifu@espressif.com>
Mon, 31 Oct 2016 11:38:47 +0000 (19:38 +0800)
components/lwip/core/init.c
components/lwip/include/lwip/port/lwipopts.h

index 774e9a2beb9c3b98b2f95cbfca250d3decb3b494..8b2e92669a90162a11c4205bdf703407fa7fb252 100755 (executable)
 //#endif
 #else /* LWIP_WND_SCALE */
 
-#if (ESP_PER_SOC_TCP_WND == 0)
+#if ! ESP_PER_SOC_TCP_WND
 #if (LWIP_TCP && (TCP_WND > 0xffff))
   #error "If you want to use TCP, TCP_WND must fit in an u16_t, so, you have to reduce it in your lwipopts.h (or enable window scaling)"
 #endif
 
 #endif /* LWIP_WND_SCALE */
 
-#if (ESP_PER_SOC_TCP_WND == 0)
-#if (LWIP_TCP && (TCP_SND_QUEUELEN > 0xffff))
+#if ! ESP_PER_SOC_TCP_WND
+#if (LWIP_TCP && (TCP_SND_QUEUELEN(0) > 0xffff))
   #error "If you want to use TCP, TCP_SND_QUEUELEN must fit in an u16_t, so, you have to reduce it in your lwipopts.h"
 #endif
-#if (LWIP_TCP && (TCP_SND_QUEUELEN < 2))
+#if (LWIP_TCP && (TCP_SND_QUEUELEN(0) < 2))
   #error "TCP_SND_QUEUELEN must be at least 2 for no-copy TCP writes to work"
 #endif
 
 
 /* TCP sanity checks */
 #if !LWIP_DISABLE_TCP_SANITY_CHECKS
+#if ! ESP_PER_SOC_TCP_WND
 #if LWIP_TCP
-#if !MEMP_MEM_MALLOC && (MEMP_NUM_TCP_SEG < TCP_SND_QUEUELEN)
+#if !MEMP_MEM_MALLOC && (MEMP_NUM_TCP_SEG < TCP_SND_QUEUELEN(0))
   #error "lwip_sanity_check: WARNING: MEMP_NUM_TCP_SEG should be at least as big as TCP_SND_QUEUELEN. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
 #endif
 
-#if (ESP_PER_SOC_TCP_WND == 0)
-#if TCP_SND_BUF < (2 * TCP_MSS)
+#if TCP_SND_BUF(0) < (2 * TCP_MSS)
   #error "lwip_sanity_check: WARNING: TCP_SND_BUF must be at least as much as (2 * TCP_MSS) for things to work smoothly. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
 #endif
-#if TCP_SND_QUEUELEN < (2 * (TCP_SND_BUF / TCP_MSS))
-  #error "lwip_sanity_check: WARNING: TCP_SND_QUEUELEN must be at least as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
+#if TCP_SND_QUEUELEN(0) < (2 * (TCP_SND_BUF(0) / TCP_MSS))
+  #error "lwip_sanity_check: WARNING: TCP_SND_QUEUELEN must be at least as much as (2 * TCP_SND_BUF(0)/TCP_MSS) for things to work. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
 #endif
-#if TCP_SNDLOWAT >= TCP_SND_BUF
+#if TCP_SNDLOWAT >= TCP_SND_BUF(0)
   #error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must be less than TCP_SND_BUF. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
 #endif
 #if TCP_SNDLOWAT >= (0xFFFF - (4 * TCP_MSS))
   #error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must at least be 4*MSS below u16_t overflow!"
 #endif
-#if TCP_SNDQUEUELOWAT >= TCP_SND_QUEUELEN
+#if TCP_SNDQUEUELOWAT >= TCP_SND_QUEUELEN(0)
   #error "lwip_sanity_check: WARNING: TCP_SNDQUEUELOWAT must be less than TCP_SND_QUEUELEN. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
 #endif
 #endif
index b8811813d1dd38666854695afbdaca2410213ef3..2e11bdd5ce7de5fb569a6a424d7cd317d7f84d11 100755 (executable)
@@ -512,7 +512,7 @@ extern unsigned long os_random(void);
 /* Enable all Espressif-only options */
 
 #define ESP_LWIP                        1
-#define ESP_PER_SOC_TCP_WND             1
+#define ESP_PER_SOC_TCP_WND             0
 #define ESP_THREAD_SAFE                 1
 #define ESP_THREAD_SAFE_DEBUG           LWIP_DBG_OFF
 #define ESP_DHCP                        1
@@ -524,9 +524,10 @@ extern unsigned long os_random(void);
 #define ESP_LIGHT_SLEEP                 1
 
 
-#if ESP_PER_SOC_TCP_WND
 #define TCP_WND_DEFAULT                      (4*TCP_MSS)
 #define TCP_SND_BUF_DEFAULT                  (2*TCP_MSS)
+
+#if ESP_PER_SOC_TCP_WND
 #define TCP_WND(pcb)                         (pcb->per_soc_tcp_wnd)
 #define TCP_SND_BUF(pcb)                     (pcb->per_soc_tcp_snd_buf)
 #else