Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a90178fa authored by Johannes Berg's avatar Johannes Berg Committed by Reinette Chatre
Browse files

iwlagn: simplify WEP key check



Simplify the WEP group key check by checking the
sta pointer instead of the sta_id we calculate
with it; also clean up the comment formatting.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
parent 43a61261
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2901,12 +2901,13 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
	mutex_lock(&priv->mutex);
	iwl_scan_cancel_timeout(priv, 100);

	/* If we are getting WEP group key and we didn't receive any key mapping
	/*
	 * If we are getting WEP group key and we didn't receive any key mapping
	 * so far, we are in legacy wep mode (group key only), otherwise we are
	 * in 1X mode.
	 * In legacy wep mode, we use another host command to the uCode */
	if (key->alg == ALG_WEP && sta_id == priv->hw_params.bcast_sta_id &&
		priv->iw_mode != NL80211_IFTYPE_AP) {
	 * In legacy wep mode, we use another host command to the uCode.
	 */
	if (key->alg == ALG_WEP && !sta && vif->type != NL80211_IFTYPE_AP) {
		if (cmd == SET_KEY)
			is_default_wep_key = !priv->key_mapping_key;
		else