brcmfmac: use mfp if required from user-space
The struct cfg80211_connect_params indicate whether the connection should use management frame protection (mfp). If required set the MFP_CAPABLE flag in the firmware command. This is supported from user-space by wpa_supplicant since v2.1. Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
1851cb4a0f
commit
87b7e9e2f6
|
@ -1354,13 +1354,14 @@ static s32 brcmf_set_auth_type(struct net_device *ndev,
|
||||||
}
|
}
|
||||||
|
|
||||||
static s32
|
static s32
|
||||||
brcmf_set_set_cipher(struct net_device *ndev,
|
brcmf_set_wsec_mode(struct net_device *ndev,
|
||||||
struct cfg80211_connect_params *sme)
|
struct cfg80211_connect_params *sme, bool mfp)
|
||||||
{
|
{
|
||||||
struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
|
struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
|
||||||
struct brcmf_cfg80211_security *sec;
|
struct brcmf_cfg80211_security *sec;
|
||||||
s32 pval = 0;
|
s32 pval = 0;
|
||||||
s32 gval = 0;
|
s32 gval = 0;
|
||||||
|
s32 wsec;
|
||||||
s32 err = 0;
|
s32 err = 0;
|
||||||
|
|
||||||
if (sme->crypto.n_ciphers_pairwise) {
|
if (sme->crypto.n_ciphers_pairwise) {
|
||||||
|
@ -1412,7 +1413,12 @@ brcmf_set_set_cipher(struct net_device *ndev,
|
||||||
if (brcmf_find_wpsie(sme->ie, sme->ie_len) && !pval && !gval &&
|
if (brcmf_find_wpsie(sme->ie, sme->ie_len) && !pval && !gval &&
|
||||||
sme->privacy)
|
sme->privacy)
|
||||||
pval = AES_ENABLED;
|
pval = AES_ENABLED;
|
||||||
err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", pval | gval);
|
|
||||||
|
if (mfp)
|
||||||
|
wsec = pval | gval | MFP_CAPABLE;
|
||||||
|
else
|
||||||
|
wsec = pval | gval;
|
||||||
|
err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", wsec);
|
||||||
if (err) {
|
if (err) {
|
||||||
brcmf_err("error (%d)\n", err);
|
brcmf_err("error (%d)\n", err);
|
||||||
return err;
|
return err;
|
||||||
|
@ -1582,7 +1588,6 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
u32 ie_len;
|
u32 ie_len;
|
||||||
struct brcmf_ext_join_params_le *ext_join_params;
|
struct brcmf_ext_join_params_le *ext_join_params;
|
||||||
u16 chanspec;
|
u16 chanspec;
|
||||||
|
|
||||||
s32 err = 0;
|
s32 err = 0;
|
||||||
|
|
||||||
brcmf_dbg(TRACE, "Enter\n");
|
brcmf_dbg(TRACE, "Enter\n");
|
||||||
|
@ -1651,7 +1656,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = brcmf_set_set_cipher(ndev, sme);
|
err = brcmf_set_wsec_mode(ndev, sme, sme->mfp == NL80211_MFP_REQUIRED);
|
||||||
if (err) {
|
if (err) {
|
||||||
brcmf_err("wl_set_set_cipher failed (%d)\n", err);
|
brcmf_err("wl_set_set_cipher failed (%d)\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
@ -217,6 +217,9 @@ static inline bool ac_bitmap_tst(u8 bitmap, int prec)
|
||||||
#define WSEC_SWFLAG 0x0008
|
#define WSEC_SWFLAG 0x0008
|
||||||
/* to go into transition mode without setting wep */
|
/* to go into transition mode without setting wep */
|
||||||
#define SES_OW_ENABLED 0x0040
|
#define SES_OW_ENABLED 0x0040
|
||||||
|
/* MFP */
|
||||||
|
#define MFP_CAPABLE 0x0200
|
||||||
|
#define MFP_REQUIRED 0x0400
|
||||||
|
|
||||||
/* WPA authentication mode bitvec */
|
/* WPA authentication mode bitvec */
|
||||||
#define WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */
|
#define WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */
|
||||||
|
|
Loading…
Reference in New Issue