Skip to content

Commit 3689418

Browse files
poyaminirestyled-commits
authored andcommitted
[Silabs] Adds support for WPA3 transition mode for 917/916 NCP (#27334)
* WPA3 transition support * WPA3 transition mode support * wpa3 transition name changes * Restyled by clang-format * adding the wpa3 transition support for 917 ncp * Restyled by whitespace * Restyled by clang-format * wpa3 transition name changes * wpa3 transition personal * removing wpa3 transition personal * changing comments --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 1f5e5de commit 3689418

File tree

7 files changed

+44
-36
lines changed

7 files changed

+44
-36
lines changed

examples/platform/silabs/SiWx917/BUILD.gn

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ declare_args() {
3333
sl_wfx_config_scan = true
3434

3535
# Argument to force enable WPA3 security on rs91x
36-
rs91x_wpa3_only = false
36+
rs91x_wpa3_transition = false
3737

3838
# use commissionable data for SiWx917
3939
siwx917_commissionable_data = false
@@ -219,8 +219,8 @@ config("silabs-wifi-config") {
219219
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ]
220220
}
221221

222-
if (rs91x_wpa3_only) {
223-
defines += [ "WIFI_ENABLE_SECURITY_WPA3=1" ]
222+
if (rs91x_wpa3_transition) {
223+
defines += [ "WIFI_ENABLE_SECURITY_WPA3_TRANSITION=1" ]
224224
}
225225
}
226226

examples/platform/silabs/SiWx917/SiWx917/rsi_if.c

+12-6
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,11 @@ static void wfx_rsi_save_ap_info()
355355
/*
356356
* Scan is done - failed
357357
*/
358-
#if WIFI_ENABLE_SECURITY_WPA3
358+
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
359359
wfx_rsi.sec.security = WFX_SEC_WPA3;
360-
#else /* !WIFI_ENABLE_SECURITY_WPA3 */
360+
#else /* !WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
361361
wfx_rsi.sec.security = WFX_SEC_WPA2;
362-
#endif /* WIFI_ENABLE_SECURITY_WPA3 */
362+
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
363363
SILABS_LOG("%s: warn: failed with status: %02x", __func__, status);
364364
return;
365365
}
@@ -386,9 +386,13 @@ static void wfx_rsi_save_ap_info()
386386
case SME_WEP:
387387
wfx_rsi.sec.security = WFX_SEC_WEP;
388388
break;
389-
case SME_WPA3:
390389
case SME_WPA3_TRANSITION:
391-
wfx_rsi.sec.security = WFX_SEC_WPA3;
390+
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
391+
case SME_WPA3:
392+
wfx_rsi.sec.security = RSI_WPA3;
393+
#else
394+
wfx_rsi.sec.security = WFX_SEC_WPA2;
395+
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
392396
break;
393397
default:
394398
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
@@ -425,9 +429,11 @@ static void wfx_rsi_do_join(void)
425429
case WFX_SEC_WPA2:
426430
connect_security_mode = RSI_WPA_WPA2_MIXED;
427431
break;
432+
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
428433
case WFX_SEC_WPA3:
429-
connect_security_mode = RSI_WPA3;
434+
connect_security_mode = RSI_WPA3_TRANSITION;
430435
break;
436+
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANS */
431437
case WFX_SEC_NONE:
432438
connect_security_mode = RSI_OPEN;
433439
break;

examples/platform/silabs/efr32/BUILD.gn

+3-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ declare_args() {
3131
sl_wfx_config_scan = true
3232

3333
# Argument to force enable WPA3 security on rs91x
34-
rs91x_wpa3_only = false
34+
rs91x_wpa3_transition = false
3535

3636
#default WiFi SSID
3737
chip_default_wifi_ssid = ""
@@ -254,10 +254,9 @@ config("silabs-wifi-config") {
254254
if (chip_enable_wifi_ipv4) {
255255
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ]
256256
}
257-
258-
if (rs91x_wpa3_only) {
257+
if (rs91x_wpa3_transition) {
259258
# TODO: Change this macro once WF200 support is provided
260-
defines += [ "WIFI_ENABLE_SECURITY_WPA3=1" ]
259+
defines += [ "WIFI_ENABLE_SECURITY_WPA3_TRANSITION=1" ]
261260
}
262261
}
263262

examples/platform/silabs/efr32/rs911x/rsi_if.c

+14-11
Original file line numberDiff line numberDiff line change
@@ -420,20 +420,17 @@ static void wfx_rsi_save_ap_info() // translation
420420
/*
421421
* Scan is done - failed
422422
*/
423-
#if WIFI_ENABLE_SECURITY_WPA3
423+
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
424424
wfx_rsi.sec.security = WFX_SEC_WPA3;
425-
#else /* !WIFI_ENABLE_SECURITY_WPA3 */
425+
#else /* !WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
426426
wfx_rsi.sec.security = WFX_SEC_WPA2;
427-
#endif /* WIFI_ENABLE_SECURITY_WPA3 */
427+
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
428428
SILABS_LOG("%s: warn: failed with status: %02x", __func__, status);
429429
return;
430430
}
431-
else
432-
{
433-
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
434-
wfx_rsi.ap_chan = rsp.scan_info->rf_channel;
435-
memcpy(&wfx_rsi.ap_mac.octet[0], &rsp.scan_info->bssid[0], BSSID_MAX_STR_LEN);
436-
}
431+
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
432+
wfx_rsi.ap_chan = rsp.scan_info->rf_channel;
433+
memcpy(&wfx_rsi.ap_mac.octet[0], &rsp.scan_info->bssid[0], BSSID_MAX_STR_LEN);
437434

438435
switch (rsp.scan_info->security_mode)
439436
{
@@ -451,9 +448,13 @@ static void wfx_rsi_save_ap_info() // translation
451448
case SME_WEP:
452449
wfx_rsi.sec.security = WFX_SEC_WEP;
453450
break;
454-
case SME_WPA3:
455451
case SME_WPA3_TRANSITION:
452+
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
453+
case SME_WPA3:
456454
wfx_rsi.sec.security = WFX_SEC_WPA3;
455+
#else
456+
wfx_rsi.sec.security = WFX_SEC_WPA2;
457+
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
457458
break;
458459
default:
459460
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
@@ -492,9 +493,11 @@ static void wfx_rsi_do_join(void)
492493
case WFX_SEC_WPA2:
493494
connect_security_mode = RSI_WPA_WPA2_MIXED;
494495
break;
496+
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
495497
case WFX_SEC_WPA3:
496-
connect_security_mode = RSI_WPA3;
498+
connect_security_mode = RSI_WPA3_TRANSITION;
497499
break;
500+
#endif // WIFI_ENABLE_SECURITY_WPA3_TRANSITION
498501
case WFX_SEC_NONE:
499502
connect_security_mode = RSI_OPEN;
500503
break;

examples/platform/silabs/efr32/rs911x/rsi_wlan_config.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@
4141
#define RSI_TCP_IP_FEATURE_BIT_MAP (TCP_IP_FEAT_BYPASS /*| TCP_IP_FEAT_EXTENSION_VALID*/)
4242

4343
//! To set Extended custom feature select bit map
44-
#if WIFI_ENABLE_SECURITY_WPA3
44+
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
4545
#ifdef CHIP_9117
4646
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \
47-
(EXT_FEAT_448K_M4SS_256K | EXT_FEAT_IEEE_80211W | EXT_FEAT_LOW_POWER_MODE | EXT_FEAT_XTAL_CLK_ENABLE)
48-
#else
47+
(EXT_FEAT_448K_M4SS_256K | EXT_FEAT_LOW_POWER_MODE | EXT_FEAT_XTAL_CLK_ENABLE | EXT_FEAT_IEEE_80211W)
48+
#else /* !CHIP_9117 */
4949
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (EXT_FEAT_384K_MODE | EXT_FEAT_IEEE_80211W)
5050
#endif /* CHIP_9117 */
51-
#else
51+
#else /* !WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
5252
#ifdef CHIP_9117
5353
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (EXT_FEAT_448K_M4SS_256K | EXT_FEAT_LOW_POWER_MODE | EXT_FEAT_XTAL_CLK_ENABLE)
54-
#else
54+
#else /* !CHIP_9117 */
5555
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP EXT_FEAT_384K_MODE
5656
#endif /* CHIP_9117 */
57-
#endif /* WIFI_ENABLE_SECURITY_WPA3 */
57+
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */
5858

5959
//! To set Extended TCPIP feature select bit map
6060
#define RSI_EXT_TCPIP_FEATURE_BITMAP (/*EXT_FEAT_HTTP_OTAF_SUPPORT |*/ EXT_TCP_IP_SSL_16K_RECORD)
@@ -242,11 +242,11 @@
242242
#define RSI_POWER_LEVEL RSI_POWER_LEVEL_HIGH
243243

244244
//! RSI_JOIN_FEAT_STA_BG_ONLY_MODE_ENABLE or RSI_JOIN_FEAT_LISTEN_INTERVAL_VALID
245-
#if WIFI_ENABLE_SECURITY_WPA3
246-
#define RSI_JOIN_FEAT_BIT_MAP RSI_JOIN_FEAT_MFP_CAPABLE_REQUIRED
245+
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
246+
#define RSI_JOIN_FEAT_BIT_MAP RSI_JOIN_FEAT_MFP_CAPABLE_ONLY
247247
#else
248248
#define RSI_JOIN_FEAT_BIT_MAP 0
249-
#endif
249+
#endif /* WIFI_ENABLE_SECURITY_WPA3_TRANS */
250250

251251
#define RSI_LISTEN_INTERVAL 0
252252

scripts/examples/gn_silabs_example.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ if [ "$#" == "0" ]; then
9696
Use to build the example with pigweed RPC
9797
ota_periodic_query_timeout_sec
9898
Periodic query timeout variable for OTA in seconds
99-
rs91x_wpa3_only
100-
Support for WPA3 only mode on RS91x
99+
rs91x_wpa3_transition
100+
Support for WPA3 transition mode on RS91x
101101
sl_matter_version
102102
Use provided software version at build time
103103
sl_matter_version_str

src/platform/silabs/efr32/wifi/wfx_host_events.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ typedef enum
239239
WFX_SEC_WEP = 2,
240240
WFX_SEC_WPA = 3,
241241
WFX_SEC_WPA2 = 4,
242-
WFX_SEC_WPA3 = 5
242+
WFX_SEC_WPA3 = 5,
243243
} wfx_sec_t;
244244

245245
typedef struct

0 commit comments

Comments
 (0)