Skip to content

Commit 7d239fb

Browse files
Kurt Leepopcornmix
Kurt Lee
authored andcommitted
brcmfmac: Fix interoperating DPP and other encryption network access
1. If firmware supports 4-way handshake offload but not supports DPP 4-way offload, when user first connects encryption network, driver will set "sup_wpa 1" to firmware, but it will further result in DPP connection failure since firmware won't send EAPOL frame to host. 2. Fix DPP AP mode handling action frames. 3. For some firmware without fwsup support, the join procedure will be skipped due to "sup_wpa" iovar returning not-support. Check the fwsup feature before do such iovar. Signed-off-by: Kurt Lee <[email protected]> Signed-off-by: Double Lo <[email protected]> Signed-off-by: Chi-hsien Lin <[email protected]>
1 parent a7b3708 commit 7d239fb

File tree

2 files changed

+42
-31
lines changed

2 files changed

+42
-31
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,44 +2475,50 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
24752475
goto done;
24762476
}
24772477

2478-
if (sme->crypto.psk &&
2479-
profile->use_fwsup != BRCMF_PROFILE_FWSUP_SAE) {
2480-
if (WARN_ON(profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE)) {
2481-
err = -EINVAL;
2482-
goto done;
2478+
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_FWSUP)) {
2479+
if (sme->crypto.psk) {
2480+
if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_SAE) {
2481+
if (WARN_ON(profile->use_fwsup !=
2482+
BRCMF_PROFILE_FWSUP_NONE)) {
2483+
err = -EINVAL;
2484+
goto done;
2485+
}
2486+
brcmf_dbg(INFO, "using PSK offload\n");
2487+
profile->use_fwsup = BRCMF_PROFILE_FWSUP_PSK;
2488+
}
2489+
} else {
2490+
profile->use_fwsup = BRCMF_PROFILE_FWSUP_NONE;
24832491
}
2484-
brcmf_dbg(INFO, "using PSK offload\n");
2485-
profile->use_fwsup = BRCMF_PROFILE_FWSUP_PSK;
2486-
}
24872492

2488-
if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
2489-
/* enable firmware supplicant for this interface */
2490-
err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
2491-
if (err < 0) {
2492-
bphy_err(drvr, "failed to enable fw supplicant\n");
2493-
goto done;
2493+
if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
2494+
/* enable firmware supplicant for this interface */
2495+
err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
2496+
if (err < 0) {
2497+
bphy_err(drvr, "failed to enable fw supplicant\n");
2498+
goto done;
2499+
}
2500+
} else {
2501+
err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 0);
24942502
}
2495-
}
24962503

2497-
if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_PSK)
2498-
err = brcmf_set_pmk(ifp, sme->crypto.psk,
2499-
BRCMF_WSEC_MAX_PSK_LEN);
2500-
else if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_SAE) {
2501-
/* clean up user-space RSNE */
2502-
err = brcmf_fil_iovar_data_set(ifp, "wpaie", NULL, 0);
2503-
if (err) {
2504-
bphy_err(drvr, "failed to clean up user-space RSNE\n");
2505-
goto done;
2506-
}
2507-
err = brcmf_set_sae_password(ifp, sme->crypto.sae_pwd,
2508-
sme->crypto.sae_pwd_len);
2509-
if (!err && sme->crypto.psk)
2504+
if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_PSK)
25102505
err = brcmf_set_pmk(ifp, sme->crypto.psk,
25112506
BRCMF_WSEC_MAX_PSK_LEN);
2507+
else if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_SAE) {
2508+
/* clean up user-space RSNE */
2509+
if (brcmf_fil_iovar_data_set(ifp, "wpaie", NULL, 0)) {
2510+
bphy_err(drvr, "failed to clean up user-space RSNE\n");
2511+
goto done;
2512+
}
2513+
err = brcmf_set_sae_password(ifp, sme->crypto.sae_pwd,
2514+
sme->crypto.sae_pwd_len);
2515+
if (!err && sme->crypto.psk)
2516+
err = brcmf_set_pmk(ifp, sme->crypto.psk,
2517+
BRCMF_WSEC_MAX_PSK_LEN);
2518+
}
2519+
if (err)
2520+
goto done;
25122521
}
2513-
if (err)
2514-
goto done;
2515-
25162522
/* Join with specific BSSID and cached SSID
25172523
* If SSID is zero join based on BSSID only
25182524
*/

drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,10 @@ static s32 brcmf_p2p_abort_action_frame(struct brcmf_cfg80211_info *cfg)
12811281
brcmf_dbg(TRACE, "Enter\n");
12821282

12831283
vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
1284+
1285+
if (!vif)
1286+
vif = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
1287+
12841288
err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val,
12851289
sizeof(s32));
12861290
if (err)
@@ -1826,6 +1830,7 @@ bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
18261830
/* validate channel and p2p ies */
18271831
if (config_af_params.search_channel &&
18281832
IS_P2P_SOCIAL_CHANNEL(le32_to_cpu(af_params->channel)) &&
1833+
p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif &&
18291834
p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif->saved_ie.probe_req_ie_len) {
18301835
afx_hdl = &p2p->afx_hdl;
18311836
afx_hdl->peer_listen_chan = le32_to_cpu(af_params->channel);

0 commit comments

Comments
 (0)