Skip to content

Commit e829b17

Browse files
benilevIntellucacoelho
authored andcommitted
iwlwifi: mvm: Correctly set IGTK for AP
Currently when an IGTK is set for an AP, it is set as a regular key. Since the cipher is set to CMAC, the STA_KEY_FLG_EXT flag is added to the host command, which causes assert 0x253D on NICs that do not support this. Fixes: 85aeb58 ("iwlwifi: mvm: Enable security on new TX API") Signed-off-by: Beni Lev <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
1 parent 334167d commit e829b17

File tree

1 file changed

+12
-9
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+12
-9
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/sta.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,17 +3233,9 @@ int iwl_mvm_set_sta_key(struct iwl_mvm *mvm,
32333233
}
32343234
sta_id = mvm_sta->sta_id;
32353235

3236-
if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
3237-
keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
3238-
keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) {
3239-
ret = iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id,
3240-
false);
3241-
goto end;
3242-
}
3243-
32443236
/*
32453237
* It is possible that the 'sta' parameter is NULL, and thus
3246-
* there is a need to retrieve the sta from the local station
3238+
* there is a need to retrieve the sta from the local station
32473239
* table.
32483240
*/
32493241
if (!sta) {
@@ -3258,6 +3250,17 @@ int iwl_mvm_set_sta_key(struct iwl_mvm *mvm,
32583250

32593251
if (WARN_ON_ONCE(iwl_mvm_sta_from_mac80211(sta)->vif != vif))
32603252
return -EINVAL;
3253+
} else {
3254+
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3255+
3256+
sta_id = mvmvif->mcast_sta.sta_id;
3257+
}
3258+
3259+
if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
3260+
keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
3261+
keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) {
3262+
ret = iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, false);
3263+
goto end;
32613264
}
32623265

32633266
/* If the key_offset is not pre-assigned, we need to find a

0 commit comments

Comments
 (0)