]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: mld: advertise support for TTLM changes
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 12 Jun 2025 11:48:52 +0000 (14:48 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 25 Jun 2025 07:57:33 +0000 (10:57 +0300)
The iwlmld driver is able to handle TTLM changes as long as all TIDs
have the same TID to Link Mapping. Add the corresponding code so that
mac80211 will accept and trigger the TTLM change.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250612144708.3b0a4fd2c12b.I1fab7840f1cc222bd1e8cb58ac1a4177474fcd56@changeid
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c

index 1eb4dfb83778dd60e2c730ad366f227af40d231b..a8b2e2046d76822b5eba76b4e901fb71914e2482 100644 (file)
@@ -2622,6 +2622,23 @@ static int iwl_mld_start_pmsr(struct ieee80211_hw *hw,
        return iwl_mld_ftm_start(mld, vif, request);
 }
 
+static enum ieee80211_neg_ttlm_res
+iwl_mld_can_neg_ttlm(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+                    struct ieee80211_neg_ttlm *neg_ttlm)
+{
+       u16 map;
+
+       /* Verify all TIDs are mapped to the same links set */
+       map = neg_ttlm->downlink[0];
+       for (int i = 0; i < IEEE80211_TTLM_NUM_TIDS; i++) {
+               if (neg_ttlm->downlink[i] != neg_ttlm->uplink[i] ||
+                   neg_ttlm->uplink[i] != map)
+                       return NEG_TTLM_RES_REJECT;
+       }
+
+       return NEG_TTLM_RES_ACCEPT;
+}
+
 const struct ieee80211_ops iwl_mld_hw_ops = {
        .tx = iwl_mld_mac80211_tx,
        .start = iwl_mld_mac80211_start,
@@ -2691,4 +2708,5 @@ const struct ieee80211_ops iwl_mld_hw_ops = {
        .prep_add_interface = iwl_mld_prep_add_interface,
        .set_hw_timestamp = iwl_mld_set_hw_timestamp,
        .start_pmsr = iwl_mld_start_pmsr,
+       .can_neg_ttlm = iwl_mld_can_neg_ttlm,
 };