From e6811d5bd30e6e2eafdd6bbbf5652001421769d5 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Tue, 6 May 2025 23:10:56 +0200 Subject: [PATCH 01/17] drivers: wifi: siwx91x: SNTP NetStack Application protocol To support the SiWx917 SNTP Network Stack Application protocol offloading, we need to integrate the Silicon Labs APIs, so adding the corresponding source files and include files in the kconfig and CMakelist Co-authored-by: Swami Das Nampalli Signed-off-by: Swami Das Nampalli Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 9 +++++++++ modules/hal_silabs/wiseconnect/CMakeLists.txt | 12 ++++++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ west.yml | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index b7bf8a6d9faae..7fe028ab97145 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -71,6 +71,15 @@ config WIFI_SILABS_SIWX91X_LIMIT_PACKET_BUF_PER_STA would be buffered when the STA is in Power Save (PS) mode. This helps manage buffer usage and ensures efficient packet handling. +config WIFI_SILABS_SIWX91X_SNTP_CLIENT + bool "Offloaded implementation of SNTP client" + help + Enable this option to allow to use the SNTP (Simple Network Time + protocol) implementation provided by the Network Co-Processor present + on SiWx91x series. This implementation usually require less resources + than the Zephyr one. See also sl_sntp.h in Silabs HAL for more + information about the API. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/modules/hal_silabs/wiseconnect/CMakeLists.txt b/modules/hal_silabs/wiseconnect/CMakeLists.txt index 6ecadd1729ab7..9f97af0af9632 100644 --- a/modules/hal_silabs/wiseconnect/CMakeLists.txt +++ b/modules/hal_silabs/wiseconnect/CMakeLists.txt @@ -110,6 +110,18 @@ if(CONFIG_WIFI_SILABS_SIWX91X) ) endif() # CONFIG_WIFI_SILABS_SIWX91X +if(CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD) + zephyr_compile_definitions_ifdef(CONFIG_WIFI_SILABS_SIWX91X_SNTP_CLIENT + SLI_SI91X_INTERNAL_SNTP_CLIENT + ) + zephyr_include_directories_ifdef(CONFIG_WIFI_SILABS_SIWX91X_SNTP_CLIENT + ${WISECONNECT_DIR}/components/service/sntp/inc + ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/inc/sntp + ) + zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_SNTP_CLIENT + ${WISECONNECT_DIR}/components/service/sntp/si91x/sl_sntp.c + ) +endif() # CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD if(CONFIG_BT_SILABS_SIWX91X) zephyr_compile_definitions( SLI_SI91X_ENABLE_BLE diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 8395925ebe90b..44f3f633b63e1 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -127,6 +127,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ } boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_ICMP; + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SNTP_CLIENT)) { + boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_SNTP_CLIENT; + } boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_WINDOW_SCALING; boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_TOTAL_SELECTS(10); diff --git a/west.yml b/west.yml index 702bc9b784e32..10b64ea9c628f 100644 --- a/west.yml +++ b/west.yml @@ -235,7 +235,7 @@ manifest: groups: - hal - name: hal_silabs - revision: a0095a7ac356a04e12188bb563e6207594f8e6b2 + revision: pull/100/head path: modules/hal/silabs groups: - hal From fc347cf6ef63c13128115a61947a421099fd7e79 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Mon, 12 May 2025 11:15:22 +0530 Subject: [PATCH 02/17] drivers: wifi: siwx91x: HTTP NetStack Application To support the SiWx917 HTTP Network Stack Application protocol offloading, we need to integrate the Silicon Labs APIs, so adding the corresponding source files and include files in the kconfig and CMakelist Co-authored-by: Swami Das Nampalli Signed-off-by: Swami Das Nampalli Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 9 +++++++++ modules/hal_silabs/wiseconnect/CMakeLists.txt | 12 ++++++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 3 files changed, 24 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 7fe028ab97145..1c715ab7e21f5 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -80,6 +80,15 @@ config WIFI_SILABS_SIWX91X_SNTP_CLIENT than the Zephyr one. See also sl_sntp.h in Silabs HAL for more information about the API. +config WIFI_SILABS_SIWX91X_HTTP_CLIENT + bool "Offloaded implementation of HTTP client" + help + Enable this option to allow to use the HTTP (hypertext transfer + protocol) implementation provided by the Network Co-Processor present + on SiWx91x series. This implementation usually require less resources + than the Zephyr one. See also sl_http_client.h in Silabs HAL for more + information about the API. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/modules/hal_silabs/wiseconnect/CMakeLists.txt b/modules/hal_silabs/wiseconnect/CMakeLists.txt index 9f97af0af9632..e11aaebf7bf99 100644 --- a/modules/hal_silabs/wiseconnect/CMakeLists.txt +++ b/modules/hal_silabs/wiseconnect/CMakeLists.txt @@ -40,6 +40,7 @@ zephyr_include_directories( zephyr_library_sources( ${SISDK_DIR}/platform/common/src/sl_core_cortexm.c + ${SISDK_DIR}/platform/common/src/sl_slist.c ${WISECONNECT_DIR}/components/device/silabs/si91x/mcu/core/chip/src/rsi_deepsleep_soc.c ${WISECONNECT_DIR}/components/device/silabs/si91x/mcu/core/chip/src/system_si91x.c ${WISECONNECT_DIR}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/clock_update.c @@ -121,6 +122,17 @@ if(CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD) zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_SNTP_CLIENT ${WISECONNECT_DIR}/components/service/sntp/si91x/sl_sntp.c ) + zephyr_compile_definitions_ifdef(CONFIG_WIFI_SILABS_SIWX91X_HTTP_CLIENT + SLI_SI91X_INTERNAL_HTTP_CLIENT + ) + zephyr_include_directories_ifdef(CONFIG_WIFI_SILABS_SIWX91X_HTTP_CLIENT + ${WISECONNECT_DIR}/components/service/http_client/inc + ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/inc/http_client/inc + ) + zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_HTTP_CLIENT + ${WISECONNECT_DIR}/components/service/http_client/si91x_socket/sl_http_client.c + ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/src/sl_si91x_http_client_callback_framework.c + ) endif() # CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD if(CONFIG_BT_SILABS_SIWX91X) zephyr_compile_definitions( diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 44f3f633b63e1..6791b9506a399 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -130,6 +130,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SNTP_CLIENT)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_SNTP_CLIENT; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_HTTP_CLIENT)) { + boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_HTTP_CLIENT; + } boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_WINDOW_SCALING; boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_TOTAL_SELECTS(10); From 8986e3e76fe1ceff7f5c60919a0ed49496d010cb Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Fri, 16 May 2025 12:31:34 +0530 Subject: [PATCH 03/17] drivers: wifi: siwx91x: MQTT NetStack Application To support the SiWx917 MQTT Network Stack Application protocol offloading, we need to integrate the Silicon Labs APIs, so adding the corresponding source files and include files in the kconfig and CMakelist Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 9 +++++++++ modules/hal_silabs/wiseconnect/CMakeLists.txt | 10 ++++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 3 files changed, 22 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 1c715ab7e21f5..9c2a17ab16089 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -89,6 +89,15 @@ config WIFI_SILABS_SIWX91X_HTTP_CLIENT than the Zephyr one. See also sl_http_client.h in Silabs HAL for more information about the API. +config WIFI_SILABS_SIWX91X_MQTT_CLIENT + bool "Offloaded implementation of MQTT client" + help + Enable this option to allow to use the MQTT(Message Queuing Telemetry + Transport) implementation provided by the Network Co-Processor present + on SiWx91x series. This implementation usually require less resources + than the Zephyr one. See also sl_mqtt_client.h in Silabs HAL for more + information about the API. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/modules/hal_silabs/wiseconnect/CMakeLists.txt b/modules/hal_silabs/wiseconnect/CMakeLists.txt index e11aaebf7bf99..0725461804491 100644 --- a/modules/hal_silabs/wiseconnect/CMakeLists.txt +++ b/modules/hal_silabs/wiseconnect/CMakeLists.txt @@ -133,6 +133,16 @@ if(CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD) ${WISECONNECT_DIR}/components/service/http_client/si91x_socket/sl_http_client.c ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/src/sl_si91x_http_client_callback_framework.c ) + zephyr_compile_definitions_ifdef(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT + SLI_SI91X_EMBEDDED_MQTT_CLIENT + ) + zephyr_include_directories_ifdef(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT + ${WISECONNECT_DIR}/components/service/mqtt/inc + ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/inc/mqtt/inc + ) + zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT + ${WISECONNECT_DIR}/components/service/mqtt/si91x/sl_mqtt_client.c + ) endif() # CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD if(CONFIG_BT_SILABS_SIWX91X) zephyr_compile_definitions( diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 6791b9506a399..e9ecfad59e5bf 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -133,6 +133,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_HTTP_CLIENT)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_HTTP_CLIENT; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT)) { + boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_EMB_MQTT_ENABLE; + } boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_WINDOW_SCALING; boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_TOTAL_SELECTS(10); From 66c1e17d2bb3312a5eeaf7318575dc8ecc889bc7 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Tue, 20 May 2025 10:59:06 +0530 Subject: [PATCH 04/17] drivers: wifi: siwx91x: ICMP NetStack Application To support the SiWx917 ICMP Network Stack Application protocol offloading, we need to integrate the Silicon Labs APIs, so adding the corresponding source files and include files in the kconfig and CMakelist Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 9 +++++++++ modules/hal_silabs/wiseconnect/CMakeLists.txt | 6 ++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 9c2a17ab16089..86323de09b337 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -98,6 +98,15 @@ config WIFI_SILABS_SIWX91X_MQTT_CLIENT than the Zephyr one. See also sl_mqtt_client.h in Silabs HAL for more information about the API. +config WIFI_SILABS_SIWX91X_PING + bool "Offloaded implementation of ICMP client" + help + Enable this option to allow to use the MQTT(Internet Control Message + Protocol) implementation provided by the Network Co-Processor present + on SiWx91x series. This implementation usually require less resources + than the Zephyr one. See also sl_net_ping.h in Silabs HAL for more + information about the API. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/modules/hal_silabs/wiseconnect/CMakeLists.txt b/modules/hal_silabs/wiseconnect/CMakeLists.txt index 0725461804491..67011bd17497b 100644 --- a/modules/hal_silabs/wiseconnect/CMakeLists.txt +++ b/modules/hal_silabs/wiseconnect/CMakeLists.txt @@ -143,6 +143,12 @@ if(CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD) zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT ${WISECONNECT_DIR}/components/service/mqtt/si91x/sl_mqtt_client.c ) + zephyr_include_directories_ifdef(CONFIG_WIFI_SILABS_SIWX91X_PING + ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/icmp + ) + zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_PING + ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/icmp/sl_net_ping.c + ) endif() # CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD if(CONFIG_BT_SILABS_SIWX91X) zephyr_compile_definitions( diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index e9ecfad59e5bf..e51e60e5ed267 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -133,6 +133,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_HTTP_CLIENT)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_HTTP_CLIENT; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_PING)) { + boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_ICMP; + } if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT)) { boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_EMB_MQTT_ENABLE; } From 0cb9c8ab578efaaa1102f8979fe411d9e8d5cb2d Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Thu, 22 May 2025 10:15:10 +0530 Subject: [PATCH 05/17] drivers: wifi: siwx91x: Websockets NetStack Application To support the SiWx917 Websockets Network Stack Application protocol offloading, we need to integrate the Silicon Labs APIs, so adding the corresponding source files and include files in the kconfig and CMakelist Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 9 +++++++++ modules/hal_silabs/wiseconnect/CMakeLists.txt | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 86323de09b337..23bb08fd6406f 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -107,6 +107,15 @@ config WIFI_SILABS_SIWX91X_PING than the Zephyr one. See also sl_net_ping.h in Silabs HAL for more information about the API. +config WIFI_SILABS_SIWX91X_WEBSOCKET_CLIENT + bool "Offloaded implementation of Websocket client" + help + Enable this option to allow to use the Websocket client implementation + provided by the Network Co-Processor present on SiWx91x series. This + implementation usually require less resources than the Zephyr one. + See also sl_websocket_client.h in Silabs HAL for more information + about the API. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/modules/hal_silabs/wiseconnect/CMakeLists.txt b/modules/hal_silabs/wiseconnect/CMakeLists.txt index 67011bd17497b..2d16f4c4f1e95 100644 --- a/modules/hal_silabs/wiseconnect/CMakeLists.txt +++ b/modules/hal_silabs/wiseconnect/CMakeLists.txt @@ -149,6 +149,12 @@ if(CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD) zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_PING ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/icmp/sl_net_ping.c ) + zephyr_include_directories_ifdef(CONFIG_WIFI_SILABS_SIWX91X_WEBSOCKET_CLIENT + ${WISECONNECT_DIR}/components/service/sl_websocket_client/inc + ) + zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_WEBSOCKET_CLIENT + ${WISECONNECT_DIR}/components/service/sl_websocket_client/src/sl_websocket_client.c + ) endif() # CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD if(CONFIG_BT_SILABS_SIWX91X) zephyr_compile_definitions( From faa61c3d6517e017d796e97b43e1ddcdd5916a59 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Thu, 22 May 2025 11:34:00 +0530 Subject: [PATCH 06/17] drivers: wifi: siwx91x: MDNS NetStack Application To support the SiWx917 MDNS Network Stack Application protocol offloading, we need to integrate the Silicon Labs APIs, so adding the corresponding source files and include files in the kconfig and CMakelist Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 9 +++++++++ modules/hal_silabs/wiseconnect/CMakeLists.txt | 6 ++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 23bb08fd6406f..a88f56adbe659 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -116,6 +116,15 @@ config WIFI_SILABS_SIWX91X_WEBSOCKET_CLIENT See also sl_websocket_client.h in Silabs HAL for more information about the API. +config WIFI_SILABS_SIWX91X_MDNS_RESPONDER + bool "Offloaded implementation of MDNS responder" + help + Enable this option to allow to use the MDNS(Multicast Domain Name + System) implementation provided by the Network Co-Processor present + on SiWx91x series. This implementation usually require less resources + than the Zephyr one. See also sl_mdns.h in Silabs HAL for more + information about the API. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/modules/hal_silabs/wiseconnect/CMakeLists.txt b/modules/hal_silabs/wiseconnect/CMakeLists.txt index 2d16f4c4f1e95..7312dbb135e8f 100644 --- a/modules/hal_silabs/wiseconnect/CMakeLists.txt +++ b/modules/hal_silabs/wiseconnect/CMakeLists.txt @@ -155,6 +155,12 @@ if(CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD) zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_WEBSOCKET_CLIENT ${WISECONNECT_DIR}/components/service/sl_websocket_client/src/sl_websocket_client.c ) + zephyr_include_directories_ifdef(CONFIG_WIFI_SILABS_SIWX91X_MDNS_RESPONDER + ${WISECONNECT_DIR}/components/service/mdns/inc + ) + zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_MDNS_RESPONDER + ${WISECONNECT_DIR}/components/service/mdns/si91x/sl_mdns.c + ) endif() # CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD if(CONFIG_BT_SILABS_SIWX91X) zephyr_compile_definitions( diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index e51e60e5ed267..51ac73840e3ed 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -136,6 +136,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_PING)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_ICMP; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MDNS_RESPONDER)) { + boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_MDNSD; + } if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT)) { boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_EMB_MQTT_ENABLE; } From c6629e3cab1dd00ab221783e65d79f6fb3ff76b5 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Fri, 23 May 2025 14:44:03 +0530 Subject: [PATCH 07/17] drivers: wifi: siwx91x: DNS NetStack Application To support the SiWx917 DNS Network Stack Application protocol offloading, we need to integrate the Silicon Labs APIs, so adding the corresponding source files and include files in the kconfig and CMakelist Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 9 +++++++++ modules/hal_silabs/wiseconnect/CMakeLists.txt | 3 +++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 3 files changed, 15 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index a88f56adbe659..4d27b8aead117 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -125,6 +125,15 @@ config WIFI_SILABS_SIWX91X_MDNS_RESPONDER than the Zephyr one. See also sl_mdns.h in Silabs HAL for more information about the API. +config WIFI_SILABS_SIWX91X_DNS_CLIENT + bool "Offloaded implementation of DNS client" + help + Enable this option to allow to use the DNS(Domain Name System) + implementation provided by the Network Co-Processor present on + SiWx91x series. This implementation usually require less + resources than the Zephyr one. See also sl_net_dns.h in Silabs + HAL for more information about the API. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/modules/hal_silabs/wiseconnect/CMakeLists.txt b/modules/hal_silabs/wiseconnect/CMakeLists.txt index 7312dbb135e8f..f07b69857ef74 100644 --- a/modules/hal_silabs/wiseconnect/CMakeLists.txt +++ b/modules/hal_silabs/wiseconnect/CMakeLists.txt @@ -161,6 +161,9 @@ if(CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD) zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_MDNS_RESPONDER ${WISECONNECT_DIR}/components/service/mdns/si91x/sl_mdns.c ) + zephyr_library_sources_ifdef(CONFIG_WIFI_SILABS_SIWX91X_DNS_CLIENT + ${WISECONNECT_DIR}/components/device/silabs/si91x/wireless/sl_net/src/sl_net_si91x.c + ) endif() # CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD if(CONFIG_BT_SILABS_SIWX91X) zephyr_compile_definitions( diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 51ac73840e3ed..c5898a0f24876 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -139,6 +139,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MDNS_RESPONDER)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_MDNSD; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_DNS_CLIENT)) { + boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_DNS_CLIENT; + } if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT)) { boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_EMB_MQTT_ENABLE; } From 43951027defbd8290b2dc69045956ac1a6c1921c Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Mon, 26 May 2025 11:26:22 +0530 Subject: [PATCH 08/17] drivers: wifi: siwx91x: Adding TLS bitmap To support the SiWx917 TLS Sockets , Need to enable the TLS bitmap in the intilization Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 8 ++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 4d27b8aead117..08af3e8c9a90f 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -134,6 +134,14 @@ config WIFI_SILABS_SIWX91X_DNS_CLIENT resources than the Zephyr one. See also sl_net_dns.h in Silabs HAL for more information about the API. +config WIFI_SILABS_SIWX91X_ENABLE_TLS + bool "Offloaded implementation of TLS" + help + Enable this option to allow to use the TLS(Transport layer Security) + implementation over the network provided by the Network Co-Processor + present on SiWx91x series. This implementation usually require less + resources than the Zephyr one. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index c5898a0f24876..277b43d549546 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -142,6 +142,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_DNS_CLIENT)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_DNS_CLIENT; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_ENABLE_TLS)) { + boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_SSL; + } if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT)) { boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_EMB_MQTT_ENABLE; } From 20e57f62ee5ccd235b45cf357438dac080fe5d87 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Mon, 26 May 2025 11:41:38 +0530 Subject: [PATCH 09/17] drivers: wifi: siwx91x: Adding Single TLS bitmap To support the SiWx917 Single TLS Sockets, Need to enable the Single TLS bitmap in the intilization Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 8 ++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 08af3e8c9a90f..873da72ebe8d3 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -142,6 +142,14 @@ config WIFI_SILABS_SIWX91X_ENABLE_TLS present on SiWx91x series. This implementation usually require less resources than the Zephyr one. +config WIFI_SILABS_SIWX91X_ENABLE_SINGLE_TLS_SOCKET + bool "Offloaded implementation of single TLS socket" + depends on WIFI_SILABS_SIWX91X_ENABLE_TLS + help + Enable this option to allow to use the single TLS socket + implementation over the network provided by the Network + Co-Processor present on SiWx91x series. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 277b43d549546..c0760f8d71743 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -145,6 +145,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_ENABLE_TLS)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_SSL; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_ENABLE_SINGLE_TLS_SOCKET)) { + boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_SINGLE_SSL_SOCKET; + } if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT)) { boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_EMB_MQTT_ENABLE; } From 7dd74f850e727c39139b183936bfb5a1b5f8f3a6 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Mon, 26 May 2025 12:31:26 +0530 Subject: [PATCH 10/17] drivers: wifi: siwx91x: Adding Three SSL bitmap To support the SiWx917 Three SSL Sockets, Need to enable the Three SSL bitmap in the intilization Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 7 +++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 873da72ebe8d3..3b65054a763e9 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -150,6 +150,13 @@ config WIFI_SILABS_SIWX91X_ENABLE_SINGLE_TLS_SOCKET implementation over the network provided by the Network Co-Processor present on SiWx91x series. +config WIFI_SILABS_SIWX91X_ENABLE_THREE_SSL_SOCKETS + bool "Offloaded implementation of 3 SSL/TLS sockets" + help + Enable this option to support up to three SSL socket implementations + over the network, utilizing the Network Co-Processor available in + the SiWx91x series. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index c0760f8d71743..25a1a987b4060 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -151,6 +151,10 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT)) { boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_EMB_MQTT_ENABLE; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_ENABLE_THREE_SSL_SOCKETS)) { + boot_config->ext_tcp_ip_feature_bit_map |= + SL_SI91X_EXT_TCP_IP_FEAT_SSL_THREE_SOCKETS; + } boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_WINDOW_SCALING; boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_TOTAL_SELECTS(10); From 175cdc8a8ca9c513b26cb90a1f65a6fc5aaae03d Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Mon, 26 May 2025 12:36:19 +0530 Subject: [PATCH 11/17] drivers: wifi: siwx91x: Adding SSL bitmap To support the SiWx917 SSL high streaming throughput, Need to enable the high streaming bitmap in the intilization Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 7 +++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 3b65054a763e9..149001404615c 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -157,6 +157,13 @@ config WIFI_SILABS_SIWX91X_ENABLE_THREE_SSL_SOCKETS over the network, utilizing the Network Co-Processor available in the SiWx91x series. +config WIFI_SILABS_SIWX91X_SSL_HIGH_STREAMING + bool "Offloaded implementation for SSL/TLS high speed" + help + Enable this option to achieve high-throughput SSL/TLS streaming, + This implementation is provided by the Network Co-Processor present + on SiWx91x series. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 25a1a987b4060..d697bc4035fdd 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -127,6 +127,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ } boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_ICMP; + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SSL_HIGH_STREAMING)) { + boot_config->feature_bit_map |= SL_SI91X_FEAT_SSL_HIGH_STREAMING_BIT; + } if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SNTP_CLIENT)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_SNTP_CLIENT; } From 69fed9c483a5c85337fe80fc7c547ec38c106c8e Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Tue, 27 May 2025 10:10:27 +0530 Subject: [PATCH 12/17] drivers: wifi: siwx91x: Muliple TLS version To support the SiWx917 Multiple TLS version, Need to enable the SSL version bitmap in the intilization Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 8 ++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 149001404615c..e54e089e2fbac 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -164,6 +164,14 @@ config WIFI_SILABS_SIWX91X_SSL_HIGH_STREAMING This implementation is provided by the Network Co-Processor present on SiWx91x series. +config WIFI_SILABS_SIWX91X_SSL_VERSIONS_SUPPORT + bool "Offloaded implementation of SSL/TLS multiple versions support" + help + Enable this option to allow the device to support multiple versions + of SSL/TLS over TCP, providing flexibility in handling different + SSL/TLS versions.This implementation is provided by the Network + Co-Processor present on SiWx91x series. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index d697bc4035fdd..888aa57d669dd 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -158,6 +158,10 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_FEAT_SSL_THREE_SOCKETS; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SSL_VERSIONS_SUPPORT)) { + boot_config->ext_custom_feature_bit_map |= + SL_SI91X_EXT_FEAT_SSL_VERSIONS_SUPPORT; + } boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_WINDOW_SCALING; boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_TOTAL_SELECTS(10); From a4e0856f4fbfc5ad36fc8d87e21ee9012c1c354e Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Tue, 27 May 2025 10:15:17 +0530 Subject: [PATCH 13/17] drivers: wifi: siwx91x: SSL 16k record Added support for 16K SSL record sizes, which improves performance for SSL connections that use larger record sizes Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 8 ++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index e54e089e2fbac..6ba801db48f7d 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -172,6 +172,14 @@ config WIFI_SILABS_SIWX91X_SSL_VERSIONS_SUPPORT SSL/TLS versions.This implementation is provided by the Network Co-Processor present on SiWx91x series. +config WIFI_SILABS_SIWX91X_ENABLE_SSL_16K_RECORD + bool "Offloaded implementation to support SSL 16K record" + help + Enable this option to support for 16K SSL record sizes, which improves + performance for SSL connections that use larger record sizes. This + implementation is provided by the Network Co-Processor present on + SiWx91x series. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 888aa57d669dd..abb132733ef3c 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -158,6 +158,9 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_FEAT_SSL_THREE_SOCKETS; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_ENABLE_SSL_16K_RECORD)) { + boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_SSL_16K_RECORD; + } if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SSL_VERSIONS_SUPPORT)) { boot_config->ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_SSL_VERSIONS_SUPPORT; From 3278e414901d1f13a823f047965e79aed7e8e63a Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Tue, 27 May 2025 10:19:15 +0530 Subject: [PATCH 14/17] drivers: wifi: siwx91x: Adding SSL cloud memory Added support to allocate additional memory for SSL/TLS connections, typically required for connections to cloud servers Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 8 ++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 6ba801db48f7d..95ea8d046cd36 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -180,6 +180,14 @@ config WIFI_SILABS_SIWX91X_ENABLE_SSL_16K_RECORD implementation is provided by the Network Co-Processor present on SiWx91x series. +config WIFI_SILABS_SIWX91X_SSL_MEMORY_CLOUD + bool "Offloaded implementation for the SSL/TLS cloud connections" + help + Enable this option to allocate additional memory for SSL/TLS + connections, typically required for connections to cloud servers, + to avoid handshake failure.This implementation is provided by the + Network Co-Processor present on SiWx91x series. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index abb132733ef3c..a73bcb8d83b43 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -161,6 +161,10 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_ENABLE_SSL_16K_RECORD)) { boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_SSL_16K_RECORD; } + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SSL_MEMORY_CLOUD)) { + boot_config->ext_tcp_ip_feature_bit_map |= + SL_SI91X_EXT_TCP_IP_FEAT_SSL_MEMORY_CLOUD; + } if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SSL_VERSIONS_SUPPORT)) { boot_config->ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_SSL_VERSIONS_SUPPORT; From c8f938a2ab63b61807485e786238a973e88641d7 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Tue, 27 May 2025 10:24:15 +0530 Subject: [PATCH 15/17] drivers: wifi: siwx91x: Adding select bitmap Added support to Configure number of selects in SiWx917 Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 17 +++++++++++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 95ea8d046cd36..a979c83dd9d9c 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -188,6 +188,23 @@ config WIFI_SILABS_SIWX91X_SSL_MEMORY_CLOUD to avoid handshake failure.This implementation is provided by the Network Co-Processor present on SiWx91x series. +config WIFI_SILABS_SIWX91X_SOCKET_SELECT + bool "Offloaded implementation for socket select" + help + Enable this option for the configuration of socket select + implementation over the network provided by the Network + Co-Processor present on SiWx91x series. + +config WIFI_SILABS_SIWX91X_SOCKET_SELECT_COUNT + int "Offloaded implementation of select" + default 10 + range 1 10 + depends on WIFI_SILABS_SIWX91X_SOCKET_SELECT + help + Configure this option for the number of select operations the + device can handle, with a maximum value of 10. This implementation + is provided by the Network Co-Processor present on SiWx91x series. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index a73bcb8d83b43..08dd98ccad2cc 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -165,6 +165,10 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_FEAT_SSL_MEMORY_CLOUD; } +#ifdef CONFIG_WIFI_SILABS_SIWX91X_SOCKET_SELECT + boot_config->ext_tcp_ip_feature_bit_map |= + SL_SI91X_EXT_TCP_IP_TOTAL_SELECTS(CONFIG_WIFI_SILABS_SIWX91X_SOCKET_SELECT_COUNT); +#endif if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_SSL_VERSIONS_SUPPORT)) { boot_config->ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_SSL_VERSIONS_SUPPORT; From 1ea219f9eecc0e2cf68acca02bd581b7c6e4c203 Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Tue, 27 May 2025 10:31:37 +0530 Subject: [PATCH 16/17] drivers: wifi: siwx91x: Configure sockets Added support to Configure number of sockets in SiWx917 Signed-off-by: Rahul Gurram --- drivers/wifi/siwx91x/Kconfig.siwx91x | 17 +++++++++++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index a979c83dd9d9c..0f22558f9e923 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -205,6 +205,23 @@ config WIFI_SILABS_SIWX91X_SOCKET_SELECT_COUNT device can handle, with a maximum value of 10. This implementation is provided by the Network Co-Processor present on SiWx91x series. +config WIFI_SILABS_SIWX91X_SOCKETS + bool "Offloaded implementation to configure sockets" + help + Enable this option to configure the number of sockets in SiWx91x. + over the network .This implementation is provided by the Network + Co-Processor present on SiWx91x series. + +config WIFI_SILABS_SIWX91X_TOTAL_SOCKETS + int "Offloaded implementation for maximum number of sockets" + default 10 + range 1 10 + depends on WIFI_SILABS_SIWX91X_SOCKETS + help + Configure this option for total number of sockets to use. A maximum + of 10 sockets are allowed to use. This implementation is provided + by the Network Co-Processor present on SiWx91x series. + config WIFI_SILABS_SIWX91X_ENABLE_ROAMING bool "WiFi roaming support" default y diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 08dd98ccad2cc..08911be2f40d0 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -151,6 +151,10 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_ if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_ENABLE_SINGLE_TLS_SOCKET)) { boot_config->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_SINGLE_SSL_SOCKET; } +#ifdef CONFIG_WIFI_SILABS_SIWX91X_SOCKETS + boot_config->tcp_ip_feature_bit_map |= + SL_SI91X_TCP_IP_TOTAL_SOCKETS(CONFIG_WIFI_SILABS_SIWX91X_TOTAL_SOCKETS); +#endif if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_MQTT_CLIENT)) { boot_config->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_EMB_MQTT_ENABLE; } From c498dcd62ad219e9d37bec519f80bb2f3164e62d Mon Sep 17 00:00:00 2001 From: Rahul Gurram Date: Fri, 30 May 2025 14:49:17 +0530 Subject: [PATCH 17/17] samples: boards : Wi-Fi SiWx91x sample app This application demonstrates support for SiWx91x ICMP and DNS protocols Co-authored-by: Swami Das Nampalli Signed-off-by: Swami Das Nampalli Signed-off-by: Rahul Gurram --- .../siwx91x/siwx91x_sample_app/CMakeLists.txt | 8 + .../siwx91x/siwx91x_sample_app/README.rst | 40 +++ .../siwx91x/siwx91x_sample_app/prj.conf | 10 + .../siwx91x/siwx91x_sample_app/sample.yaml | 11 + .../siwx91x_sample_app/src/app_config.h | 45 ++++ .../siwx91x/siwx91x_sample_app/src/main.c | 238 ++++++++++++++++++ 6 files changed, 352 insertions(+) create mode 100644 samples/boards/siwx91x/siwx91x_sample_app/CMakeLists.txt create mode 100644 samples/boards/siwx91x/siwx91x_sample_app/README.rst create mode 100644 samples/boards/siwx91x/siwx91x_sample_app/prj.conf create mode 100644 samples/boards/siwx91x/siwx91x_sample_app/sample.yaml create mode 100644 samples/boards/siwx91x/siwx91x_sample_app/src/app_config.h create mode 100644 samples/boards/siwx91x/siwx91x_sample_app/src/main.c diff --git a/samples/boards/siwx91x/siwx91x_sample_app/CMakeLists.txt b/samples/boards/siwx91x/siwx91x_sample_app/CMakeLists.txt new file mode 100644 index 0000000000000..bb2798189c909 --- /dev/null +++ b/samples/boards/siwx91x/siwx91x_sample_app/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(siwx91x_sample_app) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/boards/siwx91x/siwx91x_sample_app/README.rst b/samples/boards/siwx91x/siwx91x_sample_app/README.rst new file mode 100644 index 0000000000000..f7d1ee3fa17e3 --- /dev/null +++ b/samples/boards/siwx91x/siwx91x_sample_app/README.rst @@ -0,0 +1,40 @@ +.. zephyr:code-sample:: siwx91x_sample_app + :name: siwx91x sample app + +Overview +******** + +A sample application that demonstrates the DNS client and ICMP functionality. +This program will get the IP address of the given hostname and the ICMP will +initiate a PING request to the address obtained from the DNS client. + +Requirements +************ + +* Windows PC (Remote PC). +* SiWx91x Wi-Fi Evaluation Kit(SoC). + +Configuration Parameters +************************ +The below confgurations are available in app_config.h file + +#define SSID "SiWx91x_AP" // Wi-Fi Network Name +#define PSK "12345678" // Wi-Fi Password +#define SECURITY_TYPE WIFI_SECURITY_TYPE_PSK // Wi-Fi Security Type: WIFI_SECURITY_TYPE_NONE/WIFI_SECURITY_TYPE_WPA_PSK/WIFI_SECURITY_TYPE_PSK +#define CHANNEL_NO WIFI_CHANNEL_ANY // Wi-Fi channel +#define HOSTNAME "www.zephyrproject.org" //Hostname to ping + +Building and Running +******************** + +* This sample can be found under :zephyr_file:`zephyr/samples/boards/siwx91x/siwx91x_sample_app` in the Zephyr tree. + +* Build:- west build -b siwx917_rb4338a samples/boards/siwx91x/siwx91x_sample_app/ -p + +* Flash:- west flash + +Test the Application +******************** +* Open any serial console to view logs. +* After program gets executed, SiWx91x EVK will be connected to an Access Point with configured **SSID** and **PSK** +* The device will start sending ping requests to the given hostname and the response can be seen in network_event_handler(). diff --git a/samples/boards/siwx91x/siwx91x_sample_app/prj.conf b/samples/boards/siwx91x/siwx91x_sample_app/prj.conf new file mode 100644 index 0000000000000..21ca9fae68d24 --- /dev/null +++ b/samples/boards/siwx91x/siwx91x_sample_app/prj.conf @@ -0,0 +1,10 @@ +CONFIG_WIFI=y +CONFIG_NETWORKING=y +CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD=y +CONFIG_NET_IPV4=y +CONFIG_NET_DHCPV4=y +CONFIG_NET_IPV6=n +CONFIG_NET_DHCPV6=n +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_WIFI_SILABS_SIWX91X_PING=y +CONFIG_WIFI_SILABS_SIWX91X_DNS_CLIENT=y diff --git a/samples/boards/siwx91x/siwx91x_sample_app/sample.yaml b/samples/boards/siwx91x/siwx91x_sample_app/sample.yaml new file mode 100644 index 0000000000000..11f7414eea9c1 --- /dev/null +++ b/samples/boards/siwx91x/siwx91x_sample_app/sample.yaml @@ -0,0 +1,11 @@ +sample: + name: siwx91x sample app + description: Demonstrates ICMP functionality +tests: + sample.boards.siwx91x.siwx91x_sample_app: + harness: Wi-Fi + platform_allow: + - siwx917_rb4338a + tags: Wi-Fi + integration_platforms: + - siwx917_rb4338a diff --git a/samples/boards/siwx91x/siwx91x_sample_app/src/app_config.h b/samples/boards/siwx91x/siwx91x_sample_app/src/app_config.h new file mode 100644 index 0000000000000..ac7c1610d6c9a --- /dev/null +++ b/samples/boards/siwx91x/siwx91x_sample_app/src/app_config.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025 Silicon Laboratories Inc. + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + +/* Wi-Fi Network Name */ +#define SSID "SiWx91x_AP" +/* Wi-Fi Password */ +#define PSK "12345678" +/* Wi-Fi Security Type: + * WIFI_SECURITY_TYPE_NONE/WIFI_SECURITY_TYPE_WPA_PSK/WIFI_SECURITY_TYPE_PSK + */ +#define SECURITY_TYPE WIFI_SECURITY_TYPE_PSK +/* Wi-Fi channel */ +#define CHANNEL_NO WIFI_CHANNEL_ANY +#define STACK_SIZE 4096 +#define STATUS_OK 0 +#define STATUS_FAIL -1 +#define CMD_WAIT_TIME 180000 + +/* Hostname to ping */ +#define HOSTNAME "www.zephyrproject.org" +#define DNS_TIMEOUT (20 * MSEC_PER_SEC) +#define PING_PACKET_SIZE 64 +#define PING_PACKETS 30 + +static struct { + const struct shell *sh; + uint32_t scan_result; + + union { + struct { + uint8_t connecting: 1; + uint8_t disconnecting: 1; + uint8_t _unused: 6; + }; + uint8_t all; + }; +} context; + +#define WIFI_SHELL_MGMT_EVENTS (NET_EVENT_WIFI_CONNECT_RESULT) + +#endif /* _CONFIG_H_ */ diff --git a/samples/boards/siwx91x/siwx91x_sample_app/src/main.c b/samples/boards/siwx91x/siwx91x_sample_app/src/main.c new file mode 100644 index 0000000000000..6b02b9f72d38b --- /dev/null +++ b/samples/boards/siwx91x/siwx91x_sample_app/src/main.c @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2012-2014 Wind River Systems, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +#include "sl_net_ip_types.h" +#include "sl_si91x_types.h" +#include "sl_net_si91x.h" +#include "sl_net_dns.h" +#ifdef CONFIG_WIFI_SILABS_SIWX91X_PING +#include "sl_net_ping.h" +#endif +#include "sl_net.h" +#include "app_config.h" + +volatile uint8_t state = 0; +static K_SEM_DEFINE(wlan_sem, 0, 1); +K_THREAD_STACK_DEFINE(wifi_stack, STACK_SIZE); + +typedef enum siwx91x_app_state_e { + SIWX91X_WIFI_CONNECT_STATE = 0, + SIWX91X_IP_CONFIG_STATE, + SIWX91X_PING_HOSTNAME_STATE +} siwx91x_app_state_t; + +void application_start(void); +static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, + struct net_if *iface); +static void handle_wifi_connect_result(struct net_mgmt_event_callback *cb); +static sl_status_t network_event_handler(sl_net_event_t event, sl_status_t status, void *data, + uint32_t data_length); + +static void dhcp_callback_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, + struct net_if *iface) +{ + uint8_t ipv4_addr[NET_IPV4_ADDR_LEN] = {0}; + uint8_t subnet[NET_IPV4_ADDR_LEN] = {0}; + uint8_t gateway[NET_IPV4_ADDR_LEN] = {0}; + int i = 0; + + if (mgmt_event != NET_EVENT_IPV4_ADDR_ADD) { + return; + } + + for (i = 0; i < ARRAY_SIZE(iface->config.ip.ipv4->unicast); i++) { + + if (iface->config.ip.ipv4->unicast[i].ipv4.addr_type != NET_ADDR_DHCP) { + continue; + } + + printf("Address[%d]: %s", net_if_get_by_iface(iface), + net_addr_ntop(AF_INET, + &iface->config.ip.ipv4->unicast[i].ipv4.address.in_addr, + ipv4_addr, sizeof(ipv4_addr))); + printf(" Subnet[%d]: %s", net_if_get_by_iface(iface), + net_addr_ntop(AF_INET, &iface->config.ip.ipv4->unicast[i].netmask, subnet, + sizeof(subnet))); + printf(" Router[%d]: %s", net_if_get_by_iface(iface), + net_addr_ntop(AF_INET, &iface->config.ip.ipv4->gw, gateway, + sizeof(gateway))); + + k_sem_give(&wlan_sem); + } +} + +void application_start(void) +{ + int32_t status = -1; + uint8_t ping_count = 0; + struct net_if *iface; + + printf("\r\nApplication started\r\n"); + state = SIWX91X_WIFI_CONNECT_STATE; + + while (1) { + switch (state) { + case SIWX91X_WIFI_CONNECT_STATE: { + struct wifi_connect_req_params cnx_params; + + iface = net_if_get_first_wifi(); + memset(&cnx_params, 0, sizeof(struct wifi_connect_req_params)); + context.connecting = true; + cnx_params.channel = CHANNEL_NO; + cnx_params.band = 0; + cnx_params.security = SECURITY_TYPE; + cnx_params.psk_length = strlen(PSK); + cnx_params.psk = PSK; + cnx_params.ssid_length = strlen(SSID); + cnx_params.ssid = SSID; + + status = net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, &cnx_params, + sizeof(struct wifi_connect_req_params)); + if (status != STATUS_OK) { + printf("Connection request failed with error: %d\n", status); + context.connecting = false; + state = SIWX91X_WIFI_CONNECT_STATE; + break; + } + printf("Connection requested\n"); + + if (k_sem_take(&wlan_sem, K_MSEC(CMD_WAIT_TIME)) != STATUS_OK) { + printf("\r\nWi-Fi connect failed\r\n"); + state = SIWX91X_WIFI_CONNECT_STATE; + } + } break; + case SIWX91X_IP_CONFIG_STATE: { + if (k_sem_take(&wlan_sem, K_MSEC(CMD_WAIT_TIME)) != STATUS_OK) { + printf("\r\nIP config failed\r\n"); + state = SIWX91X_IP_CONFIG_STATE; + break; + } + state = SIWX91X_PING_HOSTNAME_STATE; + } break; + case SIWX91X_PING_HOSTNAME_STATE: { + sl_ip_address_t dns_ip = { 0 }; + + sli_net_register_event_handler(network_event_handler); + dns_ip.type = SL_IPV4; + status = sl_net_dns_resolve_hostname(HOSTNAME, DNS_TIMEOUT, + SL_NET_DNS_TYPE_IPV4, &dns_ip); + if (status != STATUS_OK) { + printf("\r\nDNS Query failed:0x%x\r\n", status); + break; + } + printf("\r\nDNS Query successful\r\n"); + printf("\r\nIP address = %d.%d.%d.%d\r\n", dns_ip.ip.v4.bytes[0], + dns_ip.ip.v4.bytes[1], dns_ip.ip.v4.bytes[2], dns_ip.ip.v4.bytes[3]); + while (ping_count < PING_PACKETS) { + status = sl_si91x_send_ping(dns_ip, PING_PACKET_SIZE); + if (status != SL_STATUS_IN_PROGRESS) { + printf("\r\nPing request failed with status 0x%X\r\n", + status); + return; + } + ping_count++; + k_sleep(K_MSEC(1000)); + } + return; + } break; + } + } +} + +static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, + struct net_if *iface) +{ + switch (mgmt_event) { + case NET_EVENT_WIFI_CONNECT_RESULT: + handle_wifi_connect_result(cb); + break; + case NET_EVENT_WIFI_DISCONNECT_RESULT: + break; + default: + break; + } +} + +static void handle_wifi_connect_result(struct net_mgmt_event_callback *cb) +{ + const struct wifi_status *status = (const struct wifi_status *)cb->info; + int st = status->status; + + if (st) { + if (st < 0) { + /* Errno values are negative, try to map to + * wifi status values. + */ + if (st == -ETIMEDOUT) { + st = WIFI_STATUS_CONN_TIMEOUT; + } + } + + printf("Connection request failed (%s/%d)\n", wifi_conn_status_txt(st), st); + state = SIWX91X_WIFI_CONNECT_STATE; + } else { + printf("Connected to Wi-Fi\n"); + state = SIWX91X_IP_CONFIG_STATE; + } + + context.connecting = false; + k_sem_give(&wlan_sem); +} + +static sl_status_t network_event_handler(sl_net_event_t event, sl_status_t status, void *data, + uint32_t data_length) +{ + UNUSED_PARAMETER(data_length); + switch (event) { + case SL_NET_PING_RESPONSE_EVENT: { + sl_si91x_ping_response_t *response = (sl_si91x_ping_response_t *)data; + + if (status != SL_STATUS_OK) { + printf("\r\nPing request failed!\r\n"); + return status; + } + printf("\n%u bytes received from %u.%u.%u.%u\n", response->ping_size, + response->ping_address.ipv4_address[0], + response->ping_address.ipv4_address[1], + response->ping_address.ipv4_address[2], + response->ping_address.ipv4_address[3]); + break; + } + default: + break; + } + + return SL_STATUS_OK; +} + +int main(void) +{ + struct net_mgmt_event_callback wifi_mgmt_cb; + struct net_mgmt_event_callback mgmt_cb; + struct k_thread wifi_task_handle; + + printf("siwx91x sample application for ICMP\r\n"); + net_mgmt_init_event_callback(&wifi_mgmt_cb, wifi_mgmt_event_handler, + (WIFI_SHELL_MGMT_EVENTS)); + net_mgmt_add_event_callback(&wifi_mgmt_cb); + net_mgmt_init_event_callback(&mgmt_cb, dhcp_callback_handler, NET_EVENT_IPV4_ADDR_ADD); + + net_mgmt_add_event_callback(&mgmt_cb); + + k_tid_t application_tid = k_thread_create(&wifi_task_handle, wifi_stack, STACK_SIZE, + (k_thread_entry_t)application_start, NULL, NULL, + NULL, K_PRIO_PREEMPT(10), 0, K_NO_WAIT); + + k_thread_start(application_tid); + k_thread_join(application_tid, K_FOREVER); + printf("\r\nApplication exit\r\n"); + return 0; +}