drivers: wifi: Introduce SiWx91x WiFi driver

This driver allow to use Zephyr native IP stack or the IP stack provided
by HAL / WiseConnect.

The WiseConnect implementation may take advantage of the specific
features provided by the 917 (power consumption, speed,
validation...).

Some notable features are not available with this interface:
  - It seems Zephyr does not provide API to offload multicast membership
    management. User should be to directly call WiseConnect APIs
  - Support for ICMP frames is difficult. Note that WiseConnect
    automatically answer to ping request. It is just not possible to
    send ping requests and receive ping responses.
  - Zephyr and WiseConnect both support TLS offloading. However this
    patch does not implement it.
  - Reentrancy in the WiseConnect side is uncertain.

This implementation has been tested with samples/net/wifi/ (which relies
on subsys/net/lib/shell).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
This commit is contained in:
Jérôme Pouiller 2025-02-03 14:48:09 +01:00 committed by Benjamin Cabé
commit 1544354862
11 changed files with 988 additions and 2 deletions

View file

@ -30,14 +30,45 @@ static int siwg917_nwp_init(void)
.ext_tcp_ip_feature_bit_map = SL_SI91X_CONFIG_FEAT_EXTENSION_VALID,
.config_feature_bit_map = SL_SI91X_ENABLE_ENHANCED_MAX_PSP,
.custom_feature_bit_map = SL_SI91X_CUSTOM_FEAT_EXTENSION_VALID,
/* Even if neither WiFi or BLE is used we have to specify a Coex mode */
.coex_mode = SL_SI91X_BLE_MODE,
.ext_custom_feature_bit_map =
MEMORY_CONFIG |
SL_SI91X_EXT_FEAT_XTAL_CLK |
SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0,
}
};
sl_si91x_boot_configuration_t *cfg = &network_config.boot_config;
if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X) && IS_ENABLED(CONFIG_BT_SILABS_SIWX91X)) {
cfg->coex_mode = SL_SI91X_WLAN_BLE_MODE;
} else if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X)) {
cfg->coex_mode = SL_SI91X_WLAN_ONLY_MODE;
} else if (IS_ENABLED(CONFIG_BT_SILABS_SIWX91X)) {
cfg->coex_mode = SL_SI91X_BLE_MODE;
} else {
/*
* Even if neither WiFi or BLE is used we have to specify a Coex mode
*/
cfg->coex_mode = SL_SI91X_BLE_MODE;
}
#ifdef CONFIG_WIFI_SILABS_SIWX91X
cfg->feature_bit_map |= SL_SI91X_FEAT_SECURITY_OPEN | SL_SI91X_FEAT_WPS_DISABLE,
cfg->ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_IEEE_80211W;
if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_NET_STACK_OFFLOAD)) {
cfg->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_WINDOW_SCALING;
cfg->ext_tcp_ip_feature_bit_map |= SL_SI91X_EXT_TCP_IP_TOTAL_SELECTS(10);
cfg->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_ICMP;
if (IS_ENABLED(CONFIG_NET_IPV6)) {
cfg->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_DHCPV6_CLIENT;
cfg->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_IPV6;
}
if (IS_ENABLED(CONFIG_NET_IPV4)) {
cfg->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_DHCPV4_CLIENT;
}
} else {
cfg->tcp_ip_feature_bit_map |= SL_SI91X_TCP_IP_FEAT_BYPASS;
}
#endif
#ifdef CONFIG_BT_SILABS_SIWX91X
cfg->ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_BT_CUSTOM_FEAT_ENABLE;