344-0020-brcmfmac-add-802.11w-management-frame-protection-sup.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. From: Hante Meuleman <hante.meuleman@broadcom.com>
  2. Date: Wed, 17 Feb 2016 11:27:10 +0100
  3. Subject: [PATCH] brcmfmac: add 802.11w management frame protection support
  4. Add full support for both AP and STA for management frame protection.
  5. Reviewed-by: Arend Van Spriel <arend.van@broadcom.com>
  6. Reviewed-by: Franky (Zhenhui) Lin <franky.lin@broadcom.com>
  7. Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
  8. Signed-off-by: Hante Meuleman <hante.meuleman@broadcom.com>
  9. Signed-off-by: Arend van Spriel <arend@broadcom.com>
  10. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  11. ---
  12. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  13. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  14. @@ -72,8 +72,13 @@
  15. #define RSN_AKM_NONE 0 /* None (IBSS) */
  16. #define RSN_AKM_UNSPECIFIED 1 /* Over 802.1x */
  17. #define RSN_AKM_PSK 2 /* Pre-shared Key */
  18. +#define RSN_AKM_SHA256_1X 5 /* SHA256, 802.1X */
  19. +#define RSN_AKM_SHA256_PSK 6 /* SHA256, Pre-shared Key */
  20. #define RSN_CAP_LEN 2 /* Length of RSN capabilities */
  21. -#define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C
  22. +#define RSN_CAP_PTK_REPLAY_CNTR_MASK (BIT(2) | BIT(3))
  23. +#define RSN_CAP_MFPR_MASK BIT(6)
  24. +#define RSN_CAP_MFPC_MASK BIT(7)
  25. +#define RSN_PMKID_COUNT_LEN 2
  26. #define VNDR_IE_CMD_LEN 4 /* length of the set command
  27. * string :"add", "del" (+ NUL)
  28. @@ -211,12 +216,19 @@ static const struct ieee80211_regdomain
  29. REG_RULE(5470-10, 5850+10, 80, 6, 20, 0), }
  30. };
  31. -static const u32 __wl_cipher_suites[] = {
  32. +/* Note: brcmf_cipher_suites is an array of int defining which cipher suites
  33. + * are supported. A pointer to this array and the number of entries is passed
  34. + * on to upper layers. AES_CMAC defines whether or not the driver supports MFP.
  35. + * So the cipher suite AES_CMAC has to be the last one in the array, and when
  36. + * device does not support MFP then the number of suites will be decreased by 1
  37. + */
  38. +static const u32 brcmf_cipher_suites[] = {
  39. WLAN_CIPHER_SUITE_WEP40,
  40. WLAN_CIPHER_SUITE_WEP104,
  41. WLAN_CIPHER_SUITE_TKIP,
  42. WLAN_CIPHER_SUITE_CCMP,
  43. - WLAN_CIPHER_SUITE_AES_CMAC,
  44. + /* Keep as last entry: */
  45. + WLAN_CIPHER_SUITE_AES_CMAC
  46. };
  47. /* Vendor specific ie. id = 221, oui and type defines exact ie */
  48. @@ -1533,7 +1545,7 @@ static s32 brcmf_set_auth_type(struct ne
  49. static s32
  50. brcmf_set_wsec_mode(struct net_device *ndev,
  51. - struct cfg80211_connect_params *sme, bool mfp)
  52. + struct cfg80211_connect_params *sme)
  53. {
  54. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  55. struct brcmf_cfg80211_security *sec;
  56. @@ -1592,10 +1604,7 @@ brcmf_set_wsec_mode(struct net_device *n
  57. sme->privacy)
  58. pval = AES_ENABLED;
  59. - if (mfp)
  60. - wsec = pval | gval | MFP_CAPABLE;
  61. - else
  62. - wsec = pval | gval;
  63. + wsec = pval | gval;
  64. err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", wsec);
  65. if (err) {
  66. brcmf_err("error (%d)\n", err);
  67. @@ -1612,56 +1621,100 @@ brcmf_set_wsec_mode(struct net_device *n
  68. static s32
  69. brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
  70. {
  71. - struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  72. - struct brcmf_cfg80211_security *sec;
  73. - s32 val = 0;
  74. - s32 err = 0;
  75. + struct brcmf_if *ifp = netdev_priv(ndev);
  76. + s32 val;
  77. + s32 err;
  78. + const struct brcmf_tlv *rsn_ie;
  79. + const u8 *ie;
  80. + u32 ie_len;
  81. + u32 offset;
  82. + u16 rsn_cap;
  83. + u32 mfp;
  84. + u16 count;
  85. - if (sme->crypto.n_akm_suites) {
  86. - err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev),
  87. - "wpa_auth", &val);
  88. - if (err) {
  89. - brcmf_err("could not get wpa_auth (%d)\n", err);
  90. - return err;
  91. + if (!sme->crypto.n_akm_suites)
  92. + return 0;
  93. +
  94. + err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val);
  95. + if (err) {
  96. + brcmf_err("could not get wpa_auth (%d)\n", err);
  97. + return err;
  98. + }
  99. + if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
  100. + switch (sme->crypto.akm_suites[0]) {
  101. + case WLAN_AKM_SUITE_8021X:
  102. + val = WPA_AUTH_UNSPECIFIED;
  103. + break;
  104. + case WLAN_AKM_SUITE_PSK:
  105. + val = WPA_AUTH_PSK;
  106. + break;
  107. + default:
  108. + brcmf_err("invalid cipher group (%d)\n",
  109. + sme->crypto.cipher_group);
  110. + return -EINVAL;
  111. }
  112. - if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
  113. - switch (sme->crypto.akm_suites[0]) {
  114. - case WLAN_AKM_SUITE_8021X:
  115. - val = WPA_AUTH_UNSPECIFIED;
  116. - break;
  117. - case WLAN_AKM_SUITE_PSK:
  118. - val = WPA_AUTH_PSK;
  119. - break;
  120. - default:
  121. - brcmf_err("invalid cipher group (%d)\n",
  122. - sme->crypto.cipher_group);
  123. - return -EINVAL;
  124. - }
  125. - } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) {
  126. - switch (sme->crypto.akm_suites[0]) {
  127. - case WLAN_AKM_SUITE_8021X:
  128. - val = WPA2_AUTH_UNSPECIFIED;
  129. - break;
  130. - case WLAN_AKM_SUITE_PSK:
  131. - val = WPA2_AUTH_PSK;
  132. - break;
  133. - default:
  134. - brcmf_err("invalid cipher group (%d)\n",
  135. - sme->crypto.cipher_group);
  136. - return -EINVAL;
  137. - }
  138. + } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) {
  139. + switch (sme->crypto.akm_suites[0]) {
  140. + case WLAN_AKM_SUITE_8021X:
  141. + val = WPA2_AUTH_UNSPECIFIED;
  142. + break;
  143. + case WLAN_AKM_SUITE_8021X_SHA256:
  144. + val = WPA2_AUTH_1X_SHA256;
  145. + break;
  146. + case WLAN_AKM_SUITE_PSK_SHA256:
  147. + val = WPA2_AUTH_PSK_SHA256;
  148. + break;
  149. + case WLAN_AKM_SUITE_PSK:
  150. + val = WPA2_AUTH_PSK;
  151. + break;
  152. + default:
  153. + brcmf_err("invalid cipher group (%d)\n",
  154. + sme->crypto.cipher_group);
  155. + return -EINVAL;
  156. }
  157. + }
  158. - brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
  159. - err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev),
  160. - "wpa_auth", val);
  161. - if (err) {
  162. - brcmf_err("could not set wpa_auth (%d)\n", err);
  163. - return err;
  164. - }
  165. + if (!brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP))
  166. + goto skip_mfp_config;
  167. + /* The MFP mode (1 or 2) needs to be determined, parse IEs. The
  168. + * IE will not be verified, just a quick search for MFP config
  169. + */
  170. + rsn_ie = brcmf_parse_tlvs((const u8 *)sme->ie, sme->ie_len,
  171. + WLAN_EID_RSN);
  172. + if (!rsn_ie)
  173. + goto skip_mfp_config;
  174. + ie = (const u8 *)rsn_ie;
  175. + ie_len = rsn_ie->len + TLV_HDR_LEN;
  176. + /* Skip unicast suite */
  177. + offset = TLV_HDR_LEN + WPA_IE_VERSION_LEN + WPA_IE_MIN_OUI_LEN;
  178. + if (offset + WPA_IE_SUITE_COUNT_LEN >= ie_len)
  179. + goto skip_mfp_config;
  180. + /* Skip multicast suite */
  181. + count = ie[offset] + (ie[offset + 1] << 8);
  182. + offset += WPA_IE_SUITE_COUNT_LEN + (count * WPA_IE_MIN_OUI_LEN);
  183. + if (offset + WPA_IE_SUITE_COUNT_LEN >= ie_len)
  184. + goto skip_mfp_config;
  185. + /* Skip auth key management suite(s) */
  186. + count = ie[offset] + (ie[offset + 1] << 8);
  187. + offset += WPA_IE_SUITE_COUNT_LEN + (count * WPA_IE_MIN_OUI_LEN);
  188. + if (offset + WPA_IE_SUITE_COUNT_LEN > ie_len)
  189. + goto skip_mfp_config;
  190. + /* Ready to read capabilities */
  191. + mfp = BRCMF_MFP_NONE;
  192. + rsn_cap = ie[offset] + (ie[offset + 1] << 8);
  193. + if (rsn_cap & RSN_CAP_MFPR_MASK)
  194. + mfp = BRCMF_MFP_REQUIRED;
  195. + else if (rsn_cap & RSN_CAP_MFPC_MASK)
  196. + mfp = BRCMF_MFP_CAPABLE;
  197. + brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "mfp", mfp);
  198. +
  199. +skip_mfp_config:
  200. + brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
  201. + err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
  202. + if (err) {
  203. + brcmf_err("could not set wpa_auth (%d)\n", err);
  204. + return err;
  205. }
  206. - sec = &profile->sec;
  207. - sec->wpa_auth = sme->crypto.akm_suites[0];
  208. return err;
  209. }
  210. @@ -1827,7 +1880,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  211. goto done;
  212. }
  213. - err = brcmf_set_wsec_mode(ndev, sme, sme->mfp == NL80211_MFP_REQUIRED);
  214. + err = brcmf_set_wsec_mode(ndev, sme);
  215. if (err) {
  216. brcmf_err("wl_set_set_cipher failed (%d)\n", err);
  217. goto done;
  218. @@ -2077,10 +2130,12 @@ brcmf_cfg80211_del_key(struct wiphy *wip
  219. u8 key_idx, bool pairwise, const u8 *mac_addr)
  220. {
  221. struct brcmf_if *ifp = netdev_priv(ndev);
  222. - struct brcmf_wsec_key key;
  223. - s32 err = 0;
  224. + struct brcmf_wsec_key *key;
  225. + s32 err;
  226. brcmf_dbg(TRACE, "Enter\n");
  227. + brcmf_dbg(CONN, "key index (%d)\n", key_idx);
  228. +
  229. if (!check_vif_up(ifp->vif))
  230. return -EIO;
  231. @@ -2089,16 +2144,19 @@ brcmf_cfg80211_del_key(struct wiphy *wip
  232. return -EINVAL;
  233. }
  234. - memset(&key, 0, sizeof(key));
  235. + key = &ifp->vif->profile.key[key_idx];
  236. - key.index = (u32)key_idx;
  237. - key.flags = BRCMF_PRIMARY_KEY;
  238. - key.algo = CRYPTO_ALGO_OFF;
  239. + if (key->algo == CRYPTO_ALGO_OFF) {
  240. + brcmf_dbg(CONN, "Ignore clearing of (never configured) key\n");
  241. + return -EINVAL;
  242. + }
  243. - brcmf_dbg(CONN, "key index (%d)\n", key_idx);
  244. + memset(key, 0, sizeof(*key));
  245. + key->index = (u32)key_idx;
  246. + key->flags = BRCMF_PRIMARY_KEY;
  247. - /* Set the new key/index */
  248. - err = send_key_to_dongle(ifp, &key);
  249. + /* Clear the key/index */
  250. + err = send_key_to_dongle(ifp, key);
  251. brcmf_dbg(TRACE, "Exit\n");
  252. return err;
  253. @@ -2106,8 +2164,8 @@ brcmf_cfg80211_del_key(struct wiphy *wip
  254. static s32
  255. brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
  256. - u8 key_idx, bool pairwise, const u8 *mac_addr,
  257. - struct key_params *params)
  258. + u8 key_idx, bool pairwise, const u8 *mac_addr,
  259. + struct key_params *params)
  260. {
  261. struct brcmf_if *ifp = netdev_priv(ndev);
  262. struct brcmf_wsec_key *key;
  263. @@ -2214,9 +2272,10 @@ done:
  264. }
  265. static s32
  266. -brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
  267. - u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
  268. - void (*callback) (void *cookie, struct key_params * params))
  269. +brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, u8 key_idx,
  270. + bool pairwise, const u8 *mac_addr, void *cookie,
  271. + void (*callback)(void *cookie,
  272. + struct key_params *params))
  273. {
  274. struct key_params params;
  275. struct brcmf_if *ifp = netdev_priv(ndev);
  276. @@ -2268,8 +2327,15 @@ done:
  277. static s32
  278. brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
  279. - struct net_device *ndev, u8 key_idx)
  280. + struct net_device *ndev, u8 key_idx)
  281. {
  282. + struct brcmf_if *ifp = netdev_priv(ndev);
  283. +
  284. + brcmf_dbg(TRACE, "Enter key_idx %d\n", key_idx);
  285. +
  286. + if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP))
  287. + return 0;
  288. +
  289. brcmf_dbg(INFO, "Not supported\n");
  290. return -EOPNOTSUPP;
  291. @@ -3769,7 +3835,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  292. u32 auth = 0; /* d11 open authentication */
  293. u16 count;
  294. s32 err = 0;
  295. - s32 len = 0;
  296. + s32 len;
  297. u32 i;
  298. u32 wsec;
  299. u32 pval = 0;
  300. @@ -3779,6 +3845,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  301. u8 *data;
  302. u16 rsn_cap;
  303. u32 wme_bss_disable;
  304. + u32 mfp;
  305. brcmf_dbg(TRACE, "Enter\n");
  306. if (wpa_ie == NULL)
  307. @@ -3893,19 +3960,53 @@ brcmf_configure_wpaie(struct brcmf_if *i
  308. is_rsn_ie ? (wpa_auth |= WPA2_AUTH_PSK) :
  309. (wpa_auth |= WPA_AUTH_PSK);
  310. break;
  311. + case RSN_AKM_SHA256_PSK:
  312. + brcmf_dbg(TRACE, "RSN_AKM_MFP_PSK\n");
  313. + wpa_auth |= WPA2_AUTH_PSK_SHA256;
  314. + break;
  315. + case RSN_AKM_SHA256_1X:
  316. + brcmf_dbg(TRACE, "RSN_AKM_MFP_1X\n");
  317. + wpa_auth |= WPA2_AUTH_1X_SHA256;
  318. + break;
  319. default:
  320. brcmf_err("Ivalid key mgmt info\n");
  321. }
  322. offset++;
  323. }
  324. + mfp = BRCMF_MFP_NONE;
  325. if (is_rsn_ie) {
  326. wme_bss_disable = 1;
  327. if ((offset + RSN_CAP_LEN) <= len) {
  328. rsn_cap = data[offset] + (data[offset + 1] << 8);
  329. if (rsn_cap & RSN_CAP_PTK_REPLAY_CNTR_MASK)
  330. wme_bss_disable = 0;
  331. + if (rsn_cap & RSN_CAP_MFPR_MASK) {
  332. + brcmf_dbg(TRACE, "MFP Required\n");
  333. + mfp = BRCMF_MFP_REQUIRED;
  334. + /* Firmware only supports mfp required in
  335. + * combination with WPA2_AUTH_PSK_SHA256 or
  336. + * WPA2_AUTH_1X_SHA256.
  337. + */
  338. + if (!(wpa_auth & (WPA2_AUTH_PSK_SHA256 |
  339. + WPA2_AUTH_1X_SHA256))) {
  340. + err = -EINVAL;
  341. + goto exit;
  342. + }
  343. + /* Firmware has requirement that WPA2_AUTH_PSK/
  344. + * WPA2_AUTH_UNSPECIFIED be set, if SHA256 OUI
  345. + * is to be included in the rsn ie.
  346. + */
  347. + if (wpa_auth & WPA2_AUTH_PSK_SHA256)
  348. + wpa_auth |= WPA2_AUTH_PSK;
  349. + else if (wpa_auth & WPA2_AUTH_1X_SHA256)
  350. + wpa_auth |= WPA2_AUTH_UNSPECIFIED;
  351. + } else if (rsn_cap & RSN_CAP_MFPC_MASK) {
  352. + brcmf_dbg(TRACE, "MFP Capable\n");
  353. + mfp = BRCMF_MFP_CAPABLE;
  354. + }
  355. }
  356. + offset += RSN_CAP_LEN;
  357. /* set wme_bss_disable to sync RSN Capabilities */
  358. err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
  359. wme_bss_disable);
  360. @@ -3913,6 +4014,21 @@ brcmf_configure_wpaie(struct brcmf_if *i
  361. brcmf_err("wme_bss_disable error %d\n", err);
  362. goto exit;
  363. }
  364. +
  365. + /* Skip PMKID cnt as it is know to be 0 for AP. */
  366. + offset += RSN_PMKID_COUNT_LEN;
  367. +
  368. + /* See if there is BIP wpa suite left for MFP */
  369. + if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP) &&
  370. + ((offset + WPA_IE_MIN_OUI_LEN) <= len)) {
  371. + err = brcmf_fil_bsscfg_data_set(ifp, "bip",
  372. + &data[offset],
  373. + WPA_IE_MIN_OUI_LEN);
  374. + if (err < 0) {
  375. + brcmf_err("bip error %d\n", err);
  376. + goto exit;
  377. + }
  378. + }
  379. }
  380. /* FOR WPS , set SES_OW_ENABLED */
  381. wsec = (pval | gval | SES_OW_ENABLED);
  382. @@ -3929,6 +4045,16 @@ brcmf_configure_wpaie(struct brcmf_if *i
  383. brcmf_err("wsec error %d\n", err);
  384. goto exit;
  385. }
  386. + /* Configure MFP, this needs to go after wsec otherwise the wsec command
  387. + * will overwrite the values set by MFP
  388. + */
  389. + if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) {
  390. + err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp);
  391. + if (err < 0) {
  392. + brcmf_err("mfp error %d\n", err);
  393. + goto exit;
  394. + }
  395. + }
  396. /* set upper-layer auth */
  397. err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth);
  398. if (err < 0) {
  399. @@ -6149,8 +6275,10 @@ static int brcmf_setup_wiphy(struct wiph
  400. wiphy->n_addresses = i;
  401. wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
  402. - wiphy->cipher_suites = __wl_cipher_suites;
  403. - wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
  404. + wiphy->cipher_suites = brcmf_cipher_suites;
  405. + wiphy->n_cipher_suites = ARRAY_SIZE(brcmf_cipher_suites);
  406. + if (!brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP))
  407. + wiphy->n_cipher_suites--;
  408. wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT |
  409. WIPHY_FLAG_OFFCHAN_TX |
  410. WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
  411. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
  412. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
  413. @@ -72,7 +72,7 @@
  414. #define BRCMF_VNDR_IE_P2PAF_SHIFT 12
  415. -#define BRCMF_MAX_DEFAULT_KEYS 4
  416. +#define BRCMF_MAX_DEFAULT_KEYS 6
  417. /* beacon loss timeout defaults */
  418. #define BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON 2
  419. @@ -107,7 +107,6 @@ struct brcmf_cfg80211_security {
  420. u32 auth_type;
  421. u32 cipher_pairwise;
  422. u32 cipher_group;
  423. - u32 wpa_auth;
  424. };
  425. /**
  426. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
  427. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
  428. @@ -161,6 +161,7 @@ void brcmf_feat_attach(struct brcmf_pub
  429. ifp->drvr->feat_flags &= ~BIT(BRCMF_FEAT_MBSS);
  430. brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_RSDB, "rsdb_mode");
  431. brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_TDLS, "tdls_enable");
  432. + brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MFP, "mfp");
  433. pfn_mac.version = BRCMF_PFN_MACADDR_CFG_VER;
  434. err = brcmf_fil_iovar_data_get(ifp, "pfn_macaddr", &pfn_mac,
  435. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
  436. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
  437. @@ -30,6 +30,7 @@
  438. * WOWL_ND: WOWL net detect (PNO)
  439. * WOWL_GTK: (WOWL) GTK rekeying offload
  440. * WOWL_ARP_ND: ARP and Neighbor Discovery offload support during WOWL.
  441. + * MFP: 802.11w Management Frame Protection.
  442. */
  443. #define BRCMF_FEAT_LIST \
  444. BRCMF_FEAT_DEF(MBSS) \
  445. @@ -42,7 +43,8 @@
  446. BRCMF_FEAT_DEF(SCAN_RANDOM_MAC) \
  447. BRCMF_FEAT_DEF(WOWL_ND) \
  448. BRCMF_FEAT_DEF(WOWL_GTK) \
  449. - BRCMF_FEAT_DEF(WOWL_ARP_ND)
  450. + BRCMF_FEAT_DEF(WOWL_ARP_ND) \
  451. + BRCMF_FEAT_DEF(MFP)
  452. /*
  453. * Quirks:
  454. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
  455. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
  456. @@ -142,6 +142,10 @@
  457. #define BRCMF_RSN_KEK_LENGTH 16
  458. #define BRCMF_RSN_REPLAY_LEN 8
  459. +#define BRCMF_MFP_NONE 0
  460. +#define BRCMF_MFP_CAPABLE 1
  461. +#define BRCMF_MFP_REQUIRED 2
  462. +
  463. /* join preference types for join_pref iovar */
  464. enum brcmf_join_pref_types {
  465. BRCMF_JOIN_PREF_RSSI = 1,
  466. --- a/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h
  467. +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h
  468. @@ -236,6 +236,8 @@ static inline bool ac_bitmap_tst(u8 bitm
  469. #define WPA2_AUTH_RESERVED3 0x0200
  470. #define WPA2_AUTH_RESERVED4 0x0400
  471. #define WPA2_AUTH_RESERVED5 0x0800
  472. +#define WPA2_AUTH_1X_SHA256 0x1000 /* 1X with SHA256 key derivation */
  473. +#define WPA2_AUTH_PSK_SHA256 0x8000 /* PSK with SHA256 key derivation */
  474. #define DOT11_DEFAULT_RTS_LEN 2347
  475. #define DOT11_DEFAULT_FRAG_LEN 2346