From fa81f3712dfdba49f0d3ac55f26b438a82738e40 Mon Sep 17 00:00:00 2001 From: EunBong Song Date: Tue, 21 Mar 2017 11:24:29 +0900 Subject: [PATCH] net: add config menus for LwIP thread options This patch adds for config menu for LwIP thread options. Change-Id: Iae7734f6977bd6defede874e00e6a6aeaf122ab5 Signed-off-by: EunBong Song --- .../configs/sidk_s5jt200/sidk_tash_wlan/defconfig | 11 ++++++ os/include/net/lwip/lwipopts.h | 42 ++++++++++++++++------ os/net/lwip/Kconfig | 32 +++++++++++++++++ 3 files changed, 75 insertions(+), 10 deletions(-) diff --git a/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig b/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig index a43dba0..d6e509d 100755 --- a/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig +++ b/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig @@ -687,6 +687,17 @@ CONFIG_NET_LWIP_IP_REASS_MAX_PBUFS=20 CONFIG_NET_LWIP_IP_FRAG=y CONFIG_NET_LWIP_IP_DEFAULT_TTL=255 # CONFIG_NET_LWIP_VLAN is not set + +# +# Thread options +# +CONFIG_NET_LWIP_TCPIP_THREAD_NAME="LWIP_TCP/IP" +CONFIG_NET_LWIP_TCPIP_THREAD_STACKSIZE=4096 +CONFIG_NET_LWIP_TCPIP_THREAD_PRIO=110 +CONFIG_NET_LWIP_TCPIP_MBOX_SIZE=64 +CONFIG_NET_LWIP_DEFAULT_THREAD_NAME="lwIP" +CONFIG_NET_LWIP_DEFAULT_THREAD_STACKSIZE=1024 +CONFIG_NET_LWIP_DEFAULT_THREAD_PRIO=100 CONFIG_NET_LWIP_LOOPBACK_INTERFACE=y CONFIG_NET_SECURITY_TLS=y # CONFIG_TLS_WITH_SSS is not set diff --git a/os/include/net/lwip/lwipopts.h b/os/include/net/lwip/lwipopts.h index 1be44e3..1139f61 100644 --- a/os/include/net/lwip/lwipopts.h +++ b/os/include/net/lwip/lwipopts.h @@ -477,21 +477,43 @@ #define LWIP_DEBUG_TIMERNAMES 0 -/* - --------------------------------- - ---------- OS options ---------- - --------------------------------- -*/ +/* Thread options */ + +#ifdef CONFIG_NET_LWIP_TCPIP_THREAD_NAME +#define TCPIP_THREAD_NAME CONFIG_NET_LWIP_TCPIP_THREAD_NAME +#endif + +#ifdef CONFIG_NET_LWIP_TCPIP_THREAD_STACKSIZE +#define TCPIP_THREAD_STACKSIZE CONFIG_NET_LWIP_TCPIP_THREAD_STACKSIZE +#endif + +#ifdef CONFIG_NET_LWIP_TCPIP_THREAD_PRIO +#define TCPIP_THREAD_PRIO CONFIG_NET_LWIP_TCPIP_THREAD_PRIO +#endif + +#ifdef CONFIG_NET_LWIP_TCPIP_MBOX_SIZE +#define TCPIP_MBOX_SIZE CONFIG_NET_LWIP_TCPIP_MBOX_SIZE +#endif + +#ifdef CONFIG_NET_LWIP_DEFAULT_THREAD_NAME +#define DEFAULT_THREAD_NAME CONFIG_NET_LWIP_DEFAULT_THREAD_NAME +#endif + +#ifdef CONFIG_NET_LWIP_DEFAULT_THREAD_STACKSIZE +#define DEFAULT_THREAD_STACKSIZE CONFIG_NET_LWIP_DEFAULT_THREAD_STACKSIZE +#endif + +#ifdef CONFIG_NET_LWIP_DEFAULT_THREAD_PRIO +#define DEFAULT_THREAD_PRIO CONFIG_NET_LWIP_DEFAULT_THREAD_PRIO +#endif -#define TCPIP_THREAD_NAME "LWIP_TCP/IP" -#define TCPIP_THREAD_STACKSIZE (1024*4) -#define TCPIP_MBOX_SIZE 64 #define DEFAULT_RAW_RECVMBOX_SIZE 64 #define DEFAULT_UDP_RECVMBOX_SIZE 64 #define DEFAULT_TCP_RECVMBOX_SIZE 54 #define DEFAULT_ACCEPTMBOX_SIZE 64 -#define DEFAULT_THREAD_STACKSIZE (1024*4) -#define TCPIP_THREAD_PRIO 110 +/* Thread options */ + + #define LWIP_STATS 1 #define LWIP_COMPAT_MUTEX 1 diff --git a/os/net/lwip/Kconfig b/os/net/lwip/Kconfig index 93d799f..18b5398 100644 --- a/os/net/lwip/Kconfig +++ b/os/net/lwip/Kconfig @@ -388,6 +388,38 @@ config NET_LWIP_VLAN_CHECK_ID default 1 depends on NET_LWIP_VLAN_CHECK +menu "Thread options" + +config NET_LWIP_TCPIP_THREAD_NAME + string "The name assigned to the main tcpip thread" + default "tcpip_thread" + +config NET_LWIP_TCPIP_THREAD_STACKSIZE + int "The stack size used by the main tcpip thread" + default 1024 + +config NET_LWIP_TCPIP_THREAD_PRIO + int "The priority assigned to the main tcpip thread" + default 100 + +config NET_LWIP_TCPIP_MBOX_SIZE + int "The mailbox size for the tcpip thread messages" + default 0 + +config NET_LWIP_DEFAULT_THREAD_NAME + string "The name assigned to any other lwIP thread" + default "lwIP" + +config NET_LWIP_DEFAULT_THREAD_STACKSIZE + int "The stack size used by any other lwIP thread" + default 1024 + +config NET_LWIP_DEFAULT_THREAD_PRIO + int "The priority assigned to any other lwIP thread" + default 100 + +endmenu #Thread options + config NET_LWIP_LOOPBACK_INTERFACE bool "Support loopback interface" default n -- 2.7.4