From 1177163af42ecf1019db3c7e6ddc5ae61a16e37b Mon Sep 17 00:00:00 2001 From: Thirsrin <108743108+Thirsrin@users.noreply.github.com> Date: Tue, 4 Apr 2023 04:20:09 +0530 Subject: [PATCH] Adds DNS related changes for DIC (#25897) --- examples/platform/silabs/SiWx917/FreeRTOSConfig.h | 2 +- examples/platform/silabs/efr32/FreeRTOSConfig.h | 2 +- src/lwip/silabs/lwipopts-rs911x.h | 7 +++++++ src/lwip/silabs/lwipopts-wf200.h | 8 ++++++-- third_party/silabs/efr32_sdk.gni | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/examples/platform/silabs/SiWx917/FreeRTOSConfig.h b/examples/platform/silabs/SiWx917/FreeRTOSConfig.h index 31ed4e04533108..cfbc571454a209 100644 --- a/examples/platform/silabs/SiWx917/FreeRTOSConfig.h +++ b/examples/platform/silabs/SiWx917/FreeRTOSConfig.h @@ -190,7 +190,7 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #ifndef configTOTAL_HEAP_SIZE #ifdef DIC_ENABLE -#define configTOTAL_HEAP_SIZE ((size_t)(44 * 1024)) +#define configTOTAL_HEAP_SIZE ((size_t)(50 * 1024)) #else #define configTOTAL_HEAP_SIZE ((size_t)(34 * 1024)) #endif // DIC_ENABLE diff --git a/examples/platform/silabs/efr32/FreeRTOSConfig.h b/examples/platform/silabs/efr32/FreeRTOSConfig.h index e9ebd8a94dd39a..4cad6b1e9803dc 100644 --- a/examples/platform/silabs/efr32/FreeRTOSConfig.h +++ b/examples/platform/silabs/efr32/FreeRTOSConfig.h @@ -209,7 +209,7 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #ifndef configTOTAL_HEAP_SIZE #ifdef SL_WIFI #ifdef DIC_ENABLE -#define configTOTAL_HEAP_SIZE ((size_t)(50 * 1024)) +#define configTOTAL_HEAP_SIZE ((size_t)(56 * 1024)) #else #define configTOTAL_HEAP_SIZE ((size_t)(34 * 1024)) #endif // DIC diff --git a/src/lwip/silabs/lwipopts-rs911x.h b/src/lwip/silabs/lwipopts-rs911x.h index 19396b5e05a520..f67cf862fb7cb0 100644 --- a/src/lwip/silabs/lwipopts-rs911x.h +++ b/src/lwip/silabs/lwipopts-rs911x.h @@ -65,6 +65,13 @@ #define LWIP_SOCKET 0 +#ifdef DIC_ENABLE +#define LWIP_DNS 1 +#define DNS_RAND_TXID() ((u32_t) rand()) +#else +#define LWIP_DNS 0 +#endif /* DIC_ENABLE */ + #define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 #define LWIP_RAW 1 diff --git a/src/lwip/silabs/lwipopts-wf200.h b/src/lwip/silabs/lwipopts-wf200.h index 13231c647061e9..67a38eadef0265 100644 --- a/src/lwip/silabs/lwipopts-wf200.h +++ b/src/lwip/silabs/lwipopts-wf200.h @@ -66,7 +66,13 @@ #define LWIP_SOCKET 0 #ifdef DIC_ENABLE +#define LWIP_DNS 1 +#define DNS_RAND_TXID() ((u32_t) rand()) #define MEM_SIZE 5632 +#define MEMP_NUM_UDP_PCB (6) +#else +#define LWIP_DNS 0 +#define MEMP_NUM_UDP_PCB (5) #endif // DIC_ENABLE #define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 @@ -74,8 +80,6 @@ #define LWIP_RAW 1 #define MEMP_NUM_RAW_PCB (4) -#define MEMP_NUM_UDP_PCB (5) - #define LWIP_HAVE_LOOPIF (0) // TODO: not sure why this is disabled diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 8803d087df4558..ddedbb2be5ed3a 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -240,6 +240,7 @@ template("efr32_sdk") { if (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) { if (enable_dic) { + assert(chip_enable_wifi_ipv4, "enable chip_enable_wifi_ipv4") defines += [ "DIC_ENABLE=1" ] } if (chip_enable_wifi_ipv4) { @@ -288,7 +289,6 @@ template("efr32_sdk") { "LWIP_ICMP=1", "LWIP_IGMP=1", "LWIP_DHCP=1", - "LWIP_DNS=0", ] } else { defines += [ "LWIP_IPV4=0" ]