wifi: mac80211: make mgd_protect_tdls_discover MLO-aware
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Thu, 28 Sep 2023 14:35:35 +0000 (17:35 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 23 Oct 2023 09:45:17 +0000 (11:45 +0200)
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>
Link: https://lore.kernel.org/r/20230928172905.ef12ce3eb835.If864f406cfd9e24f36a2b88fd13a37328633fcf9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/tdls.c
include/net/mac80211.h
net/mac80211/driver-ops.h
net/mac80211/tdls.c

index 66d9de0f15117fe61bf3cf1e7a2123242c3ff431..74cb2f863472c72066edcd5f97a939ae1573ce51 100644 (file)
@@ -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,
index dae6f2a1aad9807eb7a01f0a2b24e5afead003be..fac992af3ddb81422227843d830647cb92e29741 100644 (file)
@@ -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;
index 7dae9aac089ca3d976e6215a7f07abfe02327821..0ce5b0831884886362adc4995ecaf96d8c876433 100644 (file)
@@ -4522,7 +4522,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);
index e07e65da15ee7fcff1995f62100d2a1ba51223ea..d92de4cd960b0723d33f8a6fe4182f8322e65e69 100644 (file)
@@ -955,7 +955,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);
@@ -964,9 +965,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);
 }
 
index f3fd66d30b847d1c720ff1ca0a53e8ae4b7acd0b..05a7dff69fe94f77a8db27c9b88b99d39b414af3 100644 (file)
@@ -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: