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 <kurt.lee@cypress.com>
Signed-off-by: Double Lo <double.lo@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
This commit is contained in:
Kurt Lee
2020-08-20 03:07:02 -05:00
committed by Dom Cobley
parent a7b3708f60
commit 7d239fbf9d
2 changed files with 42 additions and 31 deletions

View File

@@ -2475,15 +2475,20 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
goto done; goto done;
} }
if (sme->crypto.psk && if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_FWSUP)) {
profile->use_fwsup != BRCMF_PROFILE_FWSUP_SAE) { if (sme->crypto.psk) {
if (WARN_ON(profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE)) { if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_SAE) {
if (WARN_ON(profile->use_fwsup !=
BRCMF_PROFILE_FWSUP_NONE)) {
err = -EINVAL; err = -EINVAL;
goto done; goto done;
} }
brcmf_dbg(INFO, "using PSK offload\n"); brcmf_dbg(INFO, "using PSK offload\n");
profile->use_fwsup = BRCMF_PROFILE_FWSUP_PSK; profile->use_fwsup = BRCMF_PROFILE_FWSUP_PSK;
} }
} else {
profile->use_fwsup = BRCMF_PROFILE_FWSUP_NONE;
}
if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE) { if (profile->use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
/* enable firmware supplicant for this interface */ /* enable firmware supplicant for this interface */
@@ -2492,6 +2497,8 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
bphy_err(drvr, "failed to enable fw supplicant\n"); bphy_err(drvr, "failed to enable fw supplicant\n");
goto done; goto done;
} }
} else {
err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 0);
} }
if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_PSK) if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_PSK)
@@ -2499,8 +2506,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
BRCMF_WSEC_MAX_PSK_LEN); BRCMF_WSEC_MAX_PSK_LEN);
else if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_SAE) { else if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_SAE) {
/* clean up user-space RSNE */ /* clean up user-space RSNE */
err = brcmf_fil_iovar_data_set(ifp, "wpaie", NULL, 0); if (brcmf_fil_iovar_data_set(ifp, "wpaie", NULL, 0)) {
if (err) {
bphy_err(drvr, "failed to clean up user-space RSNE\n"); bphy_err(drvr, "failed to clean up user-space RSNE\n");
goto done; goto done;
} }
@@ -2512,7 +2518,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
} }
if (err) if (err)
goto done; goto done;
}
/* Join with specific BSSID and cached SSID /* Join with specific BSSID and cached SSID
* If SSID is zero join based on BSSID only * If SSID is zero join based on BSSID only
*/ */

View File

@@ -1281,6 +1281,10 @@ static s32 brcmf_p2p_abort_action_frame(struct brcmf_cfg80211_info *cfg)
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
if (!vif)
vif = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val, err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val,
sizeof(s32)); sizeof(s32));
if (err) if (err)
@@ -1826,6 +1830,7 @@ bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
/* validate channel and p2p ies */ /* validate channel and p2p ies */
if (config_af_params.search_channel && if (config_af_params.search_channel &&
IS_P2P_SOCIAL_CHANNEL(le32_to_cpu(af_params->channel)) && IS_P2P_SOCIAL_CHANNEL(le32_to_cpu(af_params->channel)) &&
p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif &&
p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif->saved_ie.probe_req_ie_len) { p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif->saved_ie.probe_req_ie_len) {
afx_hdl = &p2p->afx_hdl; afx_hdl = &p2p->afx_hdl;
afx_hdl->peer_listen_chan = le32_to_cpu(af_params->channel); afx_hdl->peer_listen_chan = le32_to_cpu(af_params->channel);