Skip to content

Commit f9f2398

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 27e8ae1 commit f9f2398

File tree

2 files changed

+42
-30
lines changed

2 files changed

+42
-30
lines changed

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

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,43 +2467,50 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
24672467
goto done;
24682468
}
24692469

2470-
if (sme->crypto.psk &&
2471-
profile->use_fwsup != BRCMF_PROFILE_FWSUP_SAE) {
2472-
if (WARN_ON(profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE)) {
2473-
err = -EINVAL;
2474-
goto done;
2470+
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_FWSUP)) {
2471+
if (sme->crypto.psk) {
2472+
if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_SAE) {
2473+
if (WARN_ON(profile->use_fwsup !=
2474+
BRCMF_PROFILE_FWSUP_NONE)) {
2475+
err = -EINVAL;
2476+
goto done;
2477+
}
2478+
brcmf_dbg(INFO, "using PSK offload\n");
2479+
profile->use_fwsup = BRCMF_PROFILE_FWSUP_PSK;
2480+
}
2481+
} else {
2482+
profile->use_fwsup = BRCMF_PROFILE_FWSUP_NONE;
24752483
}
2476-
brcmf_dbg(INFO, "using PSK offload\n");
2477-
profile->use_fwsup = BRCMF_PROFILE_FWSUP_PSK;
2478-
}
24792484

2480-
if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
2481-
/* enable firmware supplicant for this interface */
2482-
err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
2483-
if (err < 0) {
2484-
bphy_err(drvr, "failed to enable fw supplicant\n");
2485-
goto done;
2485+
if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
2486+
/* enable firmware supplicant for this interface */
2487+
err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
2488+
if (err < 0) {
2489+
bphy_err(drvr, "failed to enable fw supplicant\n");
2490+
goto done;
2491+
}
2492+
} else {
2493+
err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 0);
24862494
}
2487-
}
24882495

2489-
if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_PSK)
2490-
err = brcmf_set_pmk(ifp, sme->crypto.psk,
2491-
BRCMF_WSEC_MAX_PSK_LEN);
2492-
else if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_SAE) {
2493-
/* clean up user-space RSNE */
2494-
err = brcmf_fil_iovar_data_set(ifp, "wpaie", NULL, 0);
2495-
if (err) {
2496-
bphy_err(drvr, "failed to clean up user-space RSNE\n");
2497-
goto done;
2498-
}
2499-
err = brcmf_fwvid_set_sae_password(ifp, &sme->crypto);
2500-
if (!err && sme->crypto.psk)
2496+
if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_PSK) {
25012497
err = brcmf_set_pmk(ifp, sme->crypto.psk,
25022498
BRCMF_WSEC_MAX_PSK_LEN);
2499+
} else if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_SAE) {
2500+
/* clean up user-space RSNE */
2501+
err = brcmf_fil_iovar_data_set(ifp, "wpaie", NULL, 0);
2502+
if (err) {
2503+
bphy_err(drvr, "failed to clean up user-space RSNE\n");
2504+
goto done;
2505+
}
2506+
err = brcmf_fwvid_set_sae_password(ifp, &sme->crypto);
2507+
if (!err && sme->crypto.psk)
2508+
err = brcmf_set_pmk(ifp, sme->crypto.psk,
2509+
BRCMF_WSEC_MAX_PSK_LEN);
2510+
}
2511+
if (err)
2512+
goto done;
25032513
}
2504-
if (err)
2505-
goto done;
2506-
25072514
/* Join with specific BSSID and cached SSID
25082515
* If SSID is zero join based on BSSID only
25092516
*/

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)