Skip to content

Commit cc8f22c

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 d8ff739 commit cc8f22c

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
@@ -2463,43 +2463,50 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
24632463
goto done;
24642464
}
24652465

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

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

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

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)