summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj P Kizhakkethil <suraj.kizhakkethil@oss.qualcomm.com>2026-02-13 13:01:26 +0300
committerJohannes Berg <johannes.berg@intel.com>2026-03-02 11:13:39 +0300
commitf3f52e6f20ac875ebbef6bd3a235a06d9c4d3fa0 (patch)
treeb86bb4f046cb5d055bd7c30787a5fe4dd0ebbdbb
parent73e7df69edb6f1271ea0fa876794761e6c73e76a (diff)
downloadlinux-f3f52e6f20ac875ebbef6bd3a235a06d9c4d3fa0.tar.xz
wifi: mac80211: Set link ID for NULL packets sent to probe stations
Currently, for AP MLD, the link ID is not provided when a NULL packet is triggered to probe a station. For non-MLO stations connected to an AP MLD, use the station's default link to send the NULL packets and set addr2 and addr3 to the link address. For MLO stations, set the link ID to unspecified to let the driver select the appropriate link. Co-developed-by: Sriram R <quic_srirrama@quicinc.com> Signed-off-by: Sriram R <quic_srirrama@quicinc.com> Co-developed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Signed-off-by: Suraj P Kizhakkethil <suraj.kizhakkethil@oss.qualcomm.com> Link: https://patch.msgid.link/20260213100126.1414398-3-suraj.kizhakkethil@oss.qualcomm.com [init link_id in each branch instead of default to zero] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/cfg.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 3cdb3e5addd9..df5153772592 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -4614,7 +4614,9 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_tx_info *info;
struct sta_info *sta;
struct ieee80211_chanctx_conf *chanctx_conf;
+ struct ieee80211_bss_conf *conf;
enum nl80211_band band;
+ u8 link_id;
int ret;
/* the lock is needed to assign the cookie later */
@@ -4630,6 +4632,23 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
qos = sta->sta.wme;
if (ieee80211_vif_is_mld(&sdata->vif)) {
+ if (sta->sta.mlo) {
+ link_id = IEEE80211_LINK_UNSPECIFIED;
+ } else {
+ /*
+ * For non-MLO clients connected to an AP MLD, band
+ * information is not used; instead, sta->deflink is
+ * used to send packets.
+ */
+ link_id = sta->deflink.link_id;
+
+ conf = rcu_dereference(sdata->vif.link_conf[link_id]);
+
+ if (unlikely(!conf)) {
+ ret = -ENOLINK;
+ goto unlock;
+ }
+ }
/* MLD transmissions must not rely on the band */
band = 0;
} else {
@@ -4639,6 +4658,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
goto unlock;
}
band = chanctx_conf->def.chan->band;
+ link_id = 0;
}
if (qos) {
@@ -4666,8 +4686,13 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
nullfunc->frame_control = fc;
nullfunc->duration_id = 0;
memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN);
- memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN);
- memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN);
+ if (ieee80211_vif_is_mld(&sdata->vif) && !sta->sta.mlo) {
+ memcpy(nullfunc->addr2, conf->addr, ETH_ALEN);
+ memcpy(nullfunc->addr3, conf->addr, ETH_ALEN);
+ } else {
+ memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN);
+ memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN);
+ }
nullfunc->seq_ctrl = 0;
info = IEEE80211_SKB_CB(skb);
@@ -4676,6 +4701,8 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
IEEE80211_TX_INTFL_NL80211_FRAME_TX;
info->band = band;
+ info->control.flags |= u32_encode_bits(link_id,
+ IEEE80211_TX_CTRL_MLO_LINK);
skb_set_queue_mapping(skb, IEEE80211_AC_VO);
skb->priority = 7;
if (qos)