]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: fetch unsolicited probe response template by link ID
authorSriram R <quic_srirrama@quicinc.com>
Thu, 19 Feb 2026 19:42:42 +0000 (01:12 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 2 Mar 2026 08:29:15 +0000 (09:29 +0100)
Currently, the unsolicited probe response template is always fetched from
the default link of a virtual interface in both Multi-Link Operation (MLO)
and non-MLO cases. However, in the MLO case there is a need to fetch the
unsolicited probe response template from a specific link instead of the
default link.

Hence, add support for fetching the unsolicited probe response template
based on the link ID from the corresponding link data.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Co-developed-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com>
Signed-off-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com>
Link: https://patch.msgid.link/20260220-fils-prob-by-link-v1-2-a2746a853f75@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ath/ath11k/mac.c
drivers/net/wireless/ath/ath12k/mac.c
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
include/net/mac80211.h
net/mac80211/tx.c

index dda77f87461eb993fbc351f120e6ef46321ccaf8..ca08de6bbe85d0ba6de0e55a088fa2833dddc7f5 100644 (file)
@@ -3314,7 +3314,7 @@ static int ath11k_mac_fils_discovery(struct ath11k_vif *arvif,
                interval = info->unsol_bcast_probe_resp_interval;
 
                tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(ar->hw,
-                                                                arvif->vif);
+                                                                arvif->vif, 0);
                if (tmpl)
                        ret = ath11k_wmi_probe_resp_tmpl(ar, arvif->vdev_id,
                                                         tmpl);
index af57ac10d5172593fcd49715decd7aee236d35c3..275263f77f44baec29245be7f83faf71bf5d8707 100644 (file)
@@ -4320,7 +4320,8 @@ static int ath12k_mac_fils_discovery(struct ath12k_link_vif *arvif,
                unsol_bcast_probe_resp_enabled = 1;
                interval = info->unsol_bcast_probe_resp_interval;
 
-               tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif);
+               tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif,
+                                                                info->link_id);
                if (tmpl)
                        ret = ath12k_wmi_probe_resp_tmpl(ar, arvif->vdev_id,
                                                         tmpl);
index 83ce06857a1e079475122cc11a6042ff95e5f3f1..2d2f34aa465d160dcde220d320de36a45a0c62fb 100644 (file)
@@ -1981,7 +1981,7 @@ mt7915_mcu_add_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif,
        } else if (changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP &&
                   vif->bss_conf.unsol_bcast_probe_resp_interval) {
                interval = vif->bss_conf.unsol_bcast_probe_resp_interval;
-               skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif);
+               skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif, 0);
        }
 
        if (!skb) {
index 968afc2967a81a436891de5561f570eca07449a3..b4422a4754cdb44bd8556ebeef6158b2a22b1daa 100644 (file)
@@ -2868,7 +2868,8 @@ int mt7996_mcu_beacon_inband_discov(struct mt7996_dev *dev,
        } else if (changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP &&
                   link_conf->unsol_bcast_probe_resp_interval) {
                interval = link_conf->unsol_bcast_probe_resp_interval;
-               skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif);
+               skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif,
+                                                               link_conf->link_id);
        }
 
        if (!skb) {
index d36c14a86c8afeb8cb63b922cd53b808d279522a..89027e94ba5ceeea8be4d3bb440c18038e5f6ded 100644 (file)
@@ -7781,6 +7781,7 @@ struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw,
  *     probe response template.
  * @hw: pointer obtained from ieee80211_alloc_hw().
  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
+ * @link_id: valid link_id during MLO or 0 for non-MLO.
  *
  * The driver is responsible for freeing the returned skb.
  *
@@ -7788,7 +7789,8 @@ struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw,
  */
 struct sk_buff *
 ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
-                                         struct ieee80211_vif *vif);
+                                         struct ieee80211_vif *vif,
+                                         unsigned int link_id);
 
 /**
  * ieee80211_obss_color_collision_notify - notify userland about a BSS color
index 77ad85a49924076d59617cff8129379069d04206..28dcdd7f0e05b6c42260261ea7c1bcf24907de9c 100644 (file)
@@ -5872,21 +5872,28 @@ EXPORT_SYMBOL(ieee80211_get_fils_discovery_tmpl);
 
 struct sk_buff *
 ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
-                                         struct ieee80211_vif *vif)
+                                         struct ieee80211_vif *vif,
+                                         unsigned int link_id)
 {
        struct sk_buff *skb = NULL;
        struct unsol_bcast_probe_resp_data *tmpl = NULL;
        struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+       struct ieee80211_link_data *link;
 
        if (sdata->vif.type != NL80211_IFTYPE_AP)
                return NULL;
 
-       rcu_read_lock();
-       tmpl = rcu_dereference(sdata->deflink.u.ap.unsol_bcast_probe_resp);
-       if (!tmpl) {
-               rcu_read_unlock();
+       if (link_id >= IEEE80211_MLD_MAX_NUM_LINKS)
+               return NULL;
+
+       guard(rcu)();
+       link = rcu_dereference(sdata->link[link_id]);
+       if (!link)
+               return NULL;
+
+       tmpl = rcu_dereference(link->u.ap.unsol_bcast_probe_resp);
+       if (!tmpl)
                return NULL;
-       }
 
        skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom + tmpl->len);
        if (skb) {
@@ -5894,7 +5901,6 @@ ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
                skb_put_data(skb, tmpl->data, tmpl->len);
        }
 
-       rcu_read_unlock();
        return skb;
 }
 EXPORT_SYMBOL(ieee80211_get_unsol_bcast_probe_resp_tmpl);