All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregory.greenman@intel.com
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Miri Korenblit <miriam.rachel.korenblit@intel.com>,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 14/18] wifi: mac80211: make mgd_protect_tdls_discover MLO-aware
Date: Thu, 28 Sep 2023 17:35:35 +0300	[thread overview]
Message-ID: <20230928172905.ef12ce3eb835.If864f406cfd9e24f36a2b88fd13a37328633fcf9@changeid> (raw)
In-Reply-To: <20230928143539.1037500-1-gregory.greenman@intel.com>

From: Miri Korenblit <miriam.rachel.korenblit@intel.com>

Since userspace can choose now what link to establish the
TDLS on, we should know on what channel to do session protection.
Add a link id parameter to this callback.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  | 3 ++-
 drivers/net/wireless/intel/iwlwifi/mvm/tdls.c | 5 +++--
 include/net/mac80211.h                        | 3 ++-
 net/mac80211/driver-ops.h                     | 8 ++++++--
 net/mac80211/tdls.c                           | 2 +-
 5 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 66d9de0f1511..74cb2f863472 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -2345,7 +2345,8 @@ void iwl_mvm_teardown_tdls_peers(struct iwl_mvm *mvm);
 void iwl_mvm_recalc_tdls_state(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			       bool sta_added);
 void iwl_mvm_mac_mgd_protect_tdls_discover(struct ieee80211_hw *hw,
-					   struct ieee80211_vif *vif);
+					   struct ieee80211_vif *vif,
+					   unsigned int link_id);
 int iwl_mvm_tdls_channel_switch(struct ieee80211_hw *hw,
 				struct ieee80211_vif *vif,
 				struct ieee80211_sta *sta, u8 oper_class,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tdls.c b/drivers/net/wireless/intel/iwlwifi/mvm/tdls.c
index dae6f2a1aad9..fac992af3ddb 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tdls.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tdls.c
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2014 Intel Mobile Communications GmbH
  * Copyright (C) 2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2020, 2022 Intel Corporation
+ * Copyright (C) 2018-2020, 2022-2023 Intel Corporation
  */
 #include <linux/etherdevice.h>
 #include "mvm.h"
@@ -144,7 +144,8 @@ void iwl_mvm_recalc_tdls_state(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 }
 
 void iwl_mvm_mac_mgd_protect_tdls_discover(struct ieee80211_hw *hw,
-					   struct ieee80211_vif *vif)
+					   struct ieee80211_vif *vif,
+					   unsigned int link_id)
 {
 	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 	u32 duration = 2 * vif->bss_conf.dtim_period * vif->bss_conf.beacon_int;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index db3e3bd62a61..c839a04ad9db 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4525,7 +4525,8 @@ struct ieee80211_ops {
 				   struct ieee80211_prep_tx_info *info);
 
 	void	(*mgd_protect_tdls_discover)(struct ieee80211_hw *hw,
-					     struct ieee80211_vif *vif);
+					     struct ieee80211_vif *vif,
+					     unsigned int link_id);
 
 	int (*add_chanctx)(struct ieee80211_hw *hw,
 			   struct ieee80211_chanctx_conf *ctx);
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 3c8eb6afd6fd..568633b38c47 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -956,7 +956,8 @@ static inline void drv_mgd_complete_tx(struct ieee80211_local *local,
 
 static inline void
 drv_mgd_protect_tdls_discover(struct ieee80211_local *local,
-			      struct ieee80211_sub_if_data *sdata)
+			      struct ieee80211_sub_if_data *sdata,
+			      int link_id)
 {
 	might_sleep();
 	lockdep_assert_wiphy(local->hw.wiphy);
@@ -965,9 +966,12 @@ drv_mgd_protect_tdls_discover(struct ieee80211_local *local,
 		return;
 	WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION);
 
+	link_id = link_id > 0 ? link_id : 0;
+
 	trace_drv_mgd_protect_tdls_discover(local, sdata);
 	if (local->ops->mgd_protect_tdls_discover)
-		local->ops->mgd_protect_tdls_discover(&local->hw, &sdata->vif);
+		local->ops->mgd_protect_tdls_discover(&local->hw, &sdata->vif,
+						      link_id);
 	trace_drv_return_void(local);
 }
 
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index f3fd66d30b84..05a7dff69fe9 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -1318,7 +1318,7 @@ int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
 		 * response frame. It is transmitted directly and not buffered
 		 * by the AP.
 		 */
-		drv_mgd_protect_tdls_discover(sdata->local, sdata);
+		drv_mgd_protect_tdls_discover(sdata->local, sdata, link_id);
 		fallthrough;
 	case WLAN_TDLS_SETUP_CONFIRM:
 	case WLAN_PUB_ACTION_TDLS_DISCOVER_RES:
-- 
2.38.1


  parent reply	other threads:[~2023-09-28 14:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 14:35 [PATCH 00/18] cfg80211/mac80211 patches from our internal tree 2023-09-28 gregory.greenman
2023-09-28 14:35 ` [PATCH 01/18] wifi: mac80211: cleanup auth_data only if association continues gregory.greenman
2023-09-28 14:35 ` [PATCH 02/18] wifi: mac80211: drop robust action frames before assoc gregory.greenman
2023-09-28 14:35 ` [PATCH 03/18] wifi: mac80211: don't recreate driver link debugfs in reconfig gregory.greenman
2023-09-28 14:35 ` [PATCH 04/18] wifi: mac80211: add a driver callback to add vif debugfs gregory.greenman
2023-09-28 14:35 ` [PATCH 05/18] wifi: mac80211: handle debugfs when switching to/from MLO gregory.greenman
2023-09-28 14:35 ` [PATCH 06/18] wifi: mac80211: Rename and update IEEE80211_VIF_DISABLE_SMPS_OVERRIDE gregory.greenman
2023-09-28 14:35 ` [PATCH 07/18] wifi: cfg80211: Include operating class 137 in 6GHz band gregory.greenman
2023-09-28 14:35 ` [PATCH 08/18] wifi: mac80211: mesh: fix some kdoc warnings gregory.greenman
2023-09-28 23:54   ` Jeff Johnson
2023-09-29  6:48     ` Johannes Berg
2023-09-29  8:09       ` Berg, Benjamin
2023-09-28 14:35 ` [PATCH 09/18] wifi: cfg80211: Handle specific BSSID in 6GHz scanning gregory.greenman
2023-09-28 14:35 ` [PATCH 10/18] wifi: mac80211: Fix setting vif links gregory.greenman
2023-09-28 14:35 ` [PATCH 11/18] wifi: cfg80211: Fix typo in documentation gregory.greenman
2023-09-28 14:35 ` [PATCH 12/18] wifi: mac80211: Check if we had first beacon with relevant links gregory.greenman
2023-09-28 23:57   ` Jeff Johnson
2023-09-28 14:35 ` [PATCH 13/18] wifi: mac80211: add link id to mgd_prepare_tx() gregory.greenman
2023-09-28 14:35 ` gregory.greenman [this message]
2023-09-28 14:35 ` [PATCH 15/18] wifi: mac80211: fix a expired vs. cancel race in roc gregory.greenman
2023-09-28 14:35 ` [PATCH 16/18] wifi: cfg80211: wext: convert return value to kernel-doc gregory.greenman
2023-09-29  0:00   ` Jeff Johnson
2023-09-28 14:35 ` [PATCH 17/18] wifi: mac80211: purge TX queues in flush_queues flow gregory.greenman
2023-09-28 14:35 ` [PATCH 18/18] wifi: mac80211: flush STA queues on unauthorization gregory.greenman

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=20230928172905.ef12ce3eb835.If864f406cfd9e24f36a2b88fd13a37328633fcf9@changeid \
    --to=gregory.greenman@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=miriam.rachel.korenblit@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.