Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: mac80211: make mgd_protect_tdls_discover MLO-aware

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>

authored by

Miri Korenblit and committed by
Johannes Berg
271d14b3 ec06bdb2

+14 -7
+2 -1
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
··· 2345 2345 void iwl_mvm_recalc_tdls_state(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 2346 2346 bool sta_added); 2347 2347 void iwl_mvm_mac_mgd_protect_tdls_discover(struct ieee80211_hw *hw, 2348 - struct ieee80211_vif *vif); 2348 + struct ieee80211_vif *vif, 2349 + unsigned int link_id); 2349 2350 int iwl_mvm_tdls_channel_switch(struct ieee80211_hw *hw, 2350 2351 struct ieee80211_vif *vif, 2351 2352 struct ieee80211_sta *sta, u8 oper_class,
+3 -2
drivers/net/wireless/intel/iwlwifi/mvm/tdls.c
··· 2 2 /* 3 3 * Copyright (C) 2014 Intel Mobile Communications GmbH 4 4 * Copyright (C) 2017 Intel Deutschland GmbH 5 - * Copyright (C) 2018-2020, 2022 Intel Corporation 5 + * Copyright (C) 2018-2020, 2022-2023 Intel Corporation 6 6 */ 7 7 #include <linux/etherdevice.h> 8 8 #include "mvm.h" ··· 144 144 } 145 145 146 146 void iwl_mvm_mac_mgd_protect_tdls_discover(struct ieee80211_hw *hw, 147 - struct ieee80211_vif *vif) 147 + struct ieee80211_vif *vif, 148 + unsigned int link_id) 148 149 { 149 150 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 150 151 u32 duration = 2 * vif->bss_conf.dtim_period * vif->bss_conf.beacon_int;
+2 -1
include/net/mac80211.h
··· 4522 4522 struct ieee80211_prep_tx_info *info); 4523 4523 4524 4524 void (*mgd_protect_tdls_discover)(struct ieee80211_hw *hw, 4525 - struct ieee80211_vif *vif); 4525 + struct ieee80211_vif *vif, 4526 + unsigned int link_id); 4526 4527 4527 4528 int (*add_chanctx)(struct ieee80211_hw *hw, 4528 4529 struct ieee80211_chanctx_conf *ctx);
+6 -2
net/mac80211/driver-ops.h
··· 955 955 956 956 static inline void 957 957 drv_mgd_protect_tdls_discover(struct ieee80211_local *local, 958 - struct ieee80211_sub_if_data *sdata) 958 + struct ieee80211_sub_if_data *sdata, 959 + int link_id) 959 960 { 960 961 might_sleep(); 961 962 lockdep_assert_wiphy(local->hw.wiphy); ··· 965 964 return; 966 965 WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION); 967 966 967 + link_id = link_id > 0 ? link_id : 0; 968 + 968 969 trace_drv_mgd_protect_tdls_discover(local, sdata); 969 970 if (local->ops->mgd_protect_tdls_discover) 970 - local->ops->mgd_protect_tdls_discover(&local->hw, &sdata->vif); 971 + local->ops->mgd_protect_tdls_discover(&local->hw, &sdata->vif, 972 + link_id); 971 973 trace_drv_return_void(local); 972 974 } 973 975
+1 -1
net/mac80211/tdls.c
··· 1318 1318 * response frame. It is transmitted directly and not buffered 1319 1319 * by the AP. 1320 1320 */ 1321 - drv_mgd_protect_tdls_discover(sdata->local, sdata); 1321 + drv_mgd_protect_tdls_discover(sdata->local, sdata, link_id); 1322 1322 fallthrough; 1323 1323 case WLAN_TDLS_SETUP_CONFIRM: 1324 1324 case WLAN_PUB_ACTION_TDLS_DISCOVER_RES: