Commit e829b17c authored by Beni Lev's avatar Beni Lev Committed by Luca Coelho
Browse files

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: 85aeb58c ("iwlwifi: mvm: Enable security on new TX API")
Signed-off-by: default avatarBeni Lev <beni.lev@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 334167de
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -3233,14 +3233,6 @@ int iwl_mvm_set_sta_key(struct iwl_mvm *mvm,
		}
		sta_id = mvm_sta->sta_id;

		if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
		    keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
		    keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) {
			ret = iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id,
						    false);
			goto end;
		}

		/*
		 * It is possible that the 'sta' parameter is NULL, and thus
		 * there is a need to retrieve the sta from the local station
@@ -3258,6 +3250,17 @@ int iwl_mvm_set_sta_key(struct iwl_mvm *mvm,

		if (WARN_ON_ONCE(iwl_mvm_sta_from_mac80211(sta)->vif != vif))
			return -EINVAL;
	} else {
		struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);

		sta_id = mvmvif->mcast_sta.sta_id;
	}

	if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
	    keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
	    keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) {
		ret = iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, false);
		goto end;
	}

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