diff options
author | Daniel Kim <dekim@broadcom.com> | 2014-03-25 16:45:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-27 14:20:06 -0400 |
commit | 87b7e9e2f6fe7e6b401443b3dd4b64815bcaa15c (patch) | |
tree | 19c23a2fa665cf3bf0ff64178edd94a63a267587 | |
parent | 1851cb4a0f08ba0600103203c4b52e53c744f59c (diff) |
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>
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/include/brcmu_wifi.h | 3 |
2 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index e0e649aab8db..afb3d15e38ff 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -1354,13 +1354,14 @@ static s32 brcmf_set_auth_type(struct net_device *ndev, | |||
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | static s32 | 1356 | static s32 |
1357 | brcmf_set_set_cipher(struct net_device *ndev, | 1357 | brcmf_set_wsec_mode(struct net_device *ndev, |
1358 | struct cfg80211_connect_params *sme) | 1358 | struct cfg80211_connect_params *sme, bool mfp) |
1359 | { | 1359 | { |
1360 | struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); | 1360 | struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); |
1361 | struct brcmf_cfg80211_security *sec; | 1361 | struct brcmf_cfg80211_security *sec; |
1362 | s32 pval = 0; | 1362 | s32 pval = 0; |
1363 | s32 gval = 0; | 1363 | s32 gval = 0; |
1364 | s32 wsec; | ||
1364 | s32 err = 0; | 1365 | s32 err = 0; |
1365 | 1366 | ||
1366 | if (sme->crypto.n_ciphers_pairwise) { | 1367 | if (sme->crypto.n_ciphers_pairwise) { |
@@ -1412,7 +1413,12 @@ brcmf_set_set_cipher(struct net_device *ndev, | |||
1412 | if (brcmf_find_wpsie(sme->ie, sme->ie_len) && !pval && !gval && | 1413 | if (brcmf_find_wpsie(sme->ie, sme->ie_len) && !pval && !gval && |
1413 | sme->privacy) | 1414 | sme->privacy) |
1414 | pval = AES_ENABLED; | 1415 | pval = AES_ENABLED; |
1415 | err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", pval | gval); | 1416 | |
1417 | if (mfp) | ||
1418 | wsec = pval | gval | MFP_CAPABLE; | ||
1419 | else | ||
1420 | wsec = pval | gval; | ||
1421 | err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", wsec); | ||
1416 | if (err) { | 1422 | if (err) { |
1417 | brcmf_err("error (%d)\n", err); | 1423 | brcmf_err("error (%d)\n", err); |
1418 | return err; | 1424 | return err; |
@@ -1582,7 +1588,6 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, | |||
1582 | u32 ie_len; | 1588 | u32 ie_len; |
1583 | struct brcmf_ext_join_params_le *ext_join_params; | 1589 | struct brcmf_ext_join_params_le *ext_join_params; |
1584 | u16 chanspec; | 1590 | u16 chanspec; |
1585 | |||
1586 | s32 err = 0; | 1591 | s32 err = 0; |
1587 | 1592 | ||
1588 | brcmf_dbg(TRACE, "Enter\n"); | 1593 | brcmf_dbg(TRACE, "Enter\n"); |
@@ -1651,7 +1656,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, | |||
1651 | goto done; | 1656 | goto done; |
1652 | } | 1657 | } |
1653 | 1658 | ||
1654 | err = brcmf_set_set_cipher(ndev, sme); | 1659 | err = brcmf_set_wsec_mode(ndev, sme, sme->mfp == NL80211_MFP_REQUIRED); |
1655 | if (err) { | 1660 | if (err) { |
1656 | brcmf_err("wl_set_set_cipher failed (%d)\n", err); | 1661 | brcmf_err("wl_set_set_cipher failed (%d)\n", err); |
1657 | goto done; | 1662 | goto done; |
diff --git a/drivers/net/wireless/brcm80211/include/brcmu_wifi.h b/drivers/net/wireless/brcm80211/include/brcmu_wifi.h index 7ca2aa1035b2..74419d4bd123 100644 --- a/drivers/net/wireless/brcm80211/include/brcmu_wifi.h +++ b/drivers/net/wireless/brcm80211/include/brcmu_wifi.h | |||
@@ -217,6 +217,9 @@ static inline bool ac_bitmap_tst(u8 bitmap, int prec) | |||
217 | #define WSEC_SWFLAG 0x0008 | 217 | #define WSEC_SWFLAG 0x0008 |
218 | /* to go into transition mode without setting wep */ | 218 | /* to go into transition mode without setting wep */ |
219 | #define SES_OW_ENABLED 0x0040 | 219 | #define SES_OW_ENABLED 0x0040 |
220 | /* MFP */ | ||
221 | #define MFP_CAPABLE 0x0200 | ||
222 | #define MFP_REQUIRED 0x0400 | ||
220 | 223 | ||
221 | /* WPA authentication mode bitvec */ | 224 | /* WPA authentication mode bitvec */ |
222 | #define WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */ | 225 | #define WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */ |