linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 03/12] iwlwifi: mvm: correct sta-state logic for TDLS
Date: Sun, 17 Oct 2021 12:40:10 +0300	[thread overview]
Message-ID: <iwlwifi.20211017123741.954001ec079f.I9deb8bc7520ad569a453f72c8d99adc9c99c9be3@changeid> (raw)
In-Reply-To: <20211017094019.442271-1-luca@coelho.fi>

From: Johannes Berg <johannes.berg@intel.com>

For TDLS stations, much of the sta-state logic shouldn't apply,
since they don't affect the link to the AP. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 37 ++++++++++---------
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 5374faa15684..56da2759777c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -3194,32 +3194,35 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 		if (iwl_mvm_phy_ctx_count(mvm) > 1)
 			iwl_mvm_teardown_tdls_peers(mvm);
 
-		if (sta->tdls)
+		if (sta->tdls) {
 			iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr,
 						   NL80211_TDLS_ENABLE_LINK);
+		} else {
+			/* enable beacon filtering */
+			WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0));
 
-		/* enable beacon filtering */
-		WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0));
-
-		/*
-		 * Now that the station is authorized, i.e., keys were already
-		 * installed, need to indicate to the FW that
-		 * multicast data frames can be forwarded to the driver
-		 */
-		iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
+			/*
+			 * Now that the station is authorized, i.e., keys were already
+			 * installed, need to indicate to the FW that
+			 * multicast data frames can be forwarded to the driver
+			 */
+			iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
+		}
 
 		iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band,
 				     true);
 	} else if (old_state == IEEE80211_STA_AUTHORIZED &&
 		   new_state == IEEE80211_STA_ASSOC) {
-		/* Multicast data frames are no longer allowed */
-		iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
+		if (!sta->tdls) {
+			/* Multicast data frames are no longer allowed */
+			iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
 
-		/* disable beacon filtering */
-		ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);
-		WARN_ON(ret &&
-			!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
-				  &mvm->status));
+			/* disable beacon filtering */
+			ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);
+			WARN_ON(ret &&
+				!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
+					  &mvm->status));
+		}
 		ret = 0;
 	} else if (old_state == IEEE80211_STA_ASSOC &&
 		   new_state == IEEE80211_STA_AUTH) {
-- 
2.33.0


  parent reply	other threads:[~2021-10-17  9:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-17  9:40 [PATCH 00/12] iwlwifi: updates intended for v5.16 2021-10-17 part 2 Luca Coelho
2021-10-17  9:40 ` [PATCH 01/12] iwlwifi: fix fw/img.c license statement Luca Coelho
2021-10-17  9:40 ` [PATCH 02/12] iwlwifi: api: fix struct iwl_wowlan_status_v7 kernel-doc Luca Coelho
2021-10-17  9:40 ` Luca Coelho [this message]
2021-10-17  9:40 ` [PATCH 04/12] iwlwifi: fw dump: add infrastructure for dump scrubbing Luca Coelho
2021-10-17  9:40 ` [PATCH 05/12] iwlwifi: parse debug exclude data from firmware file Luca Coelho
2021-10-17  9:40 ` [PATCH 06/12] iwlwifi: mvm: scrub key material in firmware dumps Luca Coelho
2021-10-17  9:40 ` [PATCH 07/12] iwlwifi: mvm: update definitions due to new rate & flags Luca Coelho
2021-10-17  9:40 ` [PATCH 08/12] iwlwifi: mvm: add definitions for " Luca Coelho
2021-10-17  9:40 ` [PATCH 09/12] iwlwifi: mvm: convert old rate & flags to the new format Luca Coelho
2021-10-17  9:40 ` [PATCH 10/12] iwlwifi: mvm: Support version 3 of tlc_update_notif Luca Coelho
2021-10-17  9:40 ` [PATCH 11/12] iwlwifi: mvm: Support new version of ranging response notification Luca Coelho
2021-10-17  9:40 ` [PATCH 12/12] iwlwifi: yoyo: fw debug config from context info and preset Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iwlwifi.20211017123741.954001ec079f.I9deb8bc7520ad569a453f72c8d99adc9c99c9be3@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).