Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silabs] Adds support for WPA3 transition mode for 917/916 NCP #27334

Merged
merged 11 commits into from
Jun 21, 2023
6 changes: 3 additions & 3 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare_args() {
sl_wfx_config_scan = true

# Argument to force enable WPA3 security on rs91x
rs91x_wpa3_only = false
rs91x_wpa3_transition = false

# use commissionable data for SiWx917
siwx917_commissionable_data = false
Expand Down Expand Up @@ -219,8 +219,8 @@ config("silabs-wifi-config") {
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ]
}

if (rs91x_wpa3_only) {
defines += [ "WIFI_ENABLE_SECURITY_WPA3=1" ]
if (rs91x_wpa3_transition) {
defines += [ "WIFI_ENABLE_SECURITY_WPA3_TRANSITION=1" ]
}
}

Expand Down
18 changes: 12 additions & 6 deletions examples/platform/silabs/SiWx917/SiWx917/rsi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ static void wfx_rsi_save_ap_info()
/*
* Scan is done - failed
*/
#if WIFI_ENABLE_SECURITY_WPA3
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
wfx_rsi.sec.security = WFX_SEC_WPA3;
#else /* !WIFI_ENABLE_SECURITY_WPA3 */
#else /* !WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
wfx_rsi.sec.security = WFX_SEC_WPA2;
#endif /* WIFI_ENABLE_SECURITY_WPA3 */
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
SILABS_LOG("%s: warn: failed with status: %02x", __func__, status);
return;
}
Expand All @@ -386,9 +386,13 @@ static void wfx_rsi_save_ap_info()
case SME_WEP:
wfx_rsi.sec.security = WFX_SEC_WEP;
break;
case SME_WPA3:
case SME_WPA3_TRANSITION:
wfx_rsi.sec.security = WFX_SEC_WPA3;
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
case SME_WPA3:
wfx_rsi.sec.security = RSI_WPA3;
#else
wfx_rsi.sec.security = WFX_SEC_WPA2;
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
break;
default:
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
Expand Down Expand Up @@ -425,9 +429,11 @@ static void wfx_rsi_do_join(void)
case WFX_SEC_WPA2:
connect_security_mode = RSI_WPA_WPA2_MIXED;
break;
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
case WFX_SEC_WPA3:
connect_security_mode = RSI_WPA3;
connect_security_mode = RSI_WPA3_TRANSITION;
break;
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANS */
case WFX_SEC_NONE:
connect_security_mode = RSI_OPEN;
break;
Expand Down
7 changes: 3 additions & 4 deletions examples/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ declare_args() {
sl_wfx_config_scan = true

# Argument to force enable WPA3 security on rs91x
rs91x_wpa3_only = false
rs91x_wpa3_transition = false

#default WiFi SSID
chip_default_wifi_ssid = ""
Expand Down Expand Up @@ -254,10 +254,9 @@ config("silabs-wifi-config") {
if (chip_enable_wifi_ipv4) {
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ]
}

if (rs91x_wpa3_only) {
if (rs91x_wpa3_transition) {
# TODO: Change this macro once WF200 support is provided
defines += [ "WIFI_ENABLE_SECURITY_WPA3=1" ]
defines += [ "WIFI_ENABLE_SECURITY_WPA3_TRANSITION=1" ]
}
}

Expand Down
25 changes: 14 additions & 11 deletions examples/platform/silabs/efr32/rs911x/rsi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,20 +420,17 @@ static void wfx_rsi_save_ap_info() // translation
/*
* Scan is done - failed
*/
#if WIFI_ENABLE_SECURITY_WPA3
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
wfx_rsi.sec.security = WFX_SEC_WPA3;
#else /* !WIFI_ENABLE_SECURITY_WPA3 */
#else /* !WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
wfx_rsi.sec.security = WFX_SEC_WPA2;
#endif /* WIFI_ENABLE_SECURITY_WPA3 */
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
SILABS_LOG("%s: warn: failed with status: %02x", __func__, status);
return;
}
else
{
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
wfx_rsi.ap_chan = rsp.scan_info->rf_channel;
memcpy(&wfx_rsi.ap_mac.octet[0], &rsp.scan_info->bssid[0], BSSID_MAX_STR_LEN);
}
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
wfx_rsi.ap_chan = rsp.scan_info->rf_channel;
memcpy(&wfx_rsi.ap_mac.octet[0], &rsp.scan_info->bssid[0], BSSID_MAX_STR_LEN);

switch (rsp.scan_info->security_mode)
{
Expand All @@ -451,9 +448,13 @@ static void wfx_rsi_save_ap_info() // translation
case SME_WEP:
wfx_rsi.sec.security = WFX_SEC_WEP;
break;
case SME_WPA3:
case SME_WPA3_TRANSITION:
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
case SME_WPA3:
wfx_rsi.sec.security = WFX_SEC_WPA3;
#else
wfx_rsi.sec.security = WFX_SEC_WPA2;
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
break;
default:
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
Expand Down Expand Up @@ -492,9 +493,11 @@ static void wfx_rsi_do_join(void)
case WFX_SEC_WPA2:
connect_security_mode = RSI_WPA_WPA2_MIXED;
break;
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
case WFX_SEC_WPA3:
connect_security_mode = RSI_WPA3;
connect_security_mode = RSI_WPA3_TRANSITION;
poyamini marked this conversation as resolved.
Show resolved Hide resolved
break;
#endif // WIFI_ENABLE_SECURITY_WPA3_TRANSITION
case WFX_SEC_NONE:
connect_security_mode = RSI_OPEN;
break;
Expand Down
18 changes: 9 additions & 9 deletions examples/platform/silabs/efr32/rs911x/rsi_wlan_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
#define RSI_TCP_IP_FEATURE_BIT_MAP (TCP_IP_FEAT_BYPASS /*| TCP_IP_FEAT_EXTENSION_VALID*/)

//! To set Extended custom feature select bit map
#if WIFI_ENABLE_SECURITY_WPA3
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
#ifdef CHIP_9117
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \
(EXT_FEAT_448K_M4SS_256K | EXT_FEAT_IEEE_80211W | EXT_FEAT_LOW_POWER_MODE | EXT_FEAT_XTAL_CLK_ENABLE)
#else
(EXT_FEAT_448K_M4SS_256K | EXT_FEAT_LOW_POWER_MODE | EXT_FEAT_XTAL_CLK_ENABLE | EXT_FEAT_IEEE_80211W)
#else /* !CHIP_9117 */
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (EXT_FEAT_384K_MODE | EXT_FEAT_IEEE_80211W)
#endif /* CHIP_9117 */
#else
#else /* !WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
#ifdef CHIP_9117
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (EXT_FEAT_448K_M4SS_256K | EXT_FEAT_LOW_POWER_MODE | EXT_FEAT_XTAL_CLK_ENABLE)
#else
#else /* !CHIP_9117 */
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP EXT_FEAT_384K_MODE
#endif /* CHIP_9117 */
#endif /* WIFI_ENABLE_SECURITY_WPA3 */
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */

//! To set Extended TCPIP feature select bit map
#define RSI_EXT_TCPIP_FEATURE_BITMAP (/*EXT_FEAT_HTTP_OTAF_SUPPORT |*/ EXT_TCP_IP_SSL_16K_RECORD)
Expand Down Expand Up @@ -242,11 +242,11 @@
#define RSI_POWER_LEVEL RSI_POWER_LEVEL_HIGH

//! RSI_JOIN_FEAT_STA_BG_ONLY_MODE_ENABLE or RSI_JOIN_FEAT_LISTEN_INTERVAL_VALID
#if WIFI_ENABLE_SECURITY_WPA3
#define RSI_JOIN_FEAT_BIT_MAP RSI_JOIN_FEAT_MFP_CAPABLE_REQUIRED
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
#define RSI_JOIN_FEAT_BIT_MAP RSI_JOIN_FEAT_MFP_CAPABLE_ONLY
#else
#define RSI_JOIN_FEAT_BIT_MAP 0
#endif
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANS */

#define RSI_LISTEN_INTERVAL 0

Expand Down
4 changes: 2 additions & 2 deletions scripts/examples/gn_silabs_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ if [ "$#" == "0" ]; then
Use to build the example with pigweed RPC
ota_periodic_query_timeout_sec
Periodic query timeout variable for OTA in seconds
rs91x_wpa3_only
Support for WPA3 only mode on RS91x
rs91x_wpa3_transition
Support for WPA3 transition mode on RS91x
sl_matter_version
Use provided software version at build time
sl_matter_version_str
Expand Down
2 changes: 1 addition & 1 deletion src/platform/silabs/efr32/wifi/wfx_host_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ typedef enum
WFX_SEC_WEP = 2,
WFX_SEC_WPA = 3,
WFX_SEC_WPA2 = 4,
WFX_SEC_WPA3 = 5
WFX_SEC_WPA3 = 5,
} wfx_sec_t;

typedef struct
Expand Down