Skip to contentSkip to conversation

wifi: mac80211: report assoc_link_id in station info for non-MLD STAs on MLD AP

PATCH New Felix Fietkau 1 participant 1 message May 28 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mac80211: report assoc_link_id in station info for non-MLD STAs on MLD AP

When a non-MLD station associates with an MLD AP, it does so on a specific link. However, sta_set_sinfo() never sets mlo_params_valid, so nl80211 never emits NL80211_ATTR_MLO_LINK_ID in get_station / dump_station responses. Userspace has no way to determine which link a non-MLD STA is associated on.

Set mlo_params_valid to 1 and assoc_link_id to sta->deflink.link_id, when valid_links is set.
Also set the mld_addr copy only for MLD STAs, so that non-MLD STAs get a zeroed mld_addr as documented.

---
 net/mac80211/sta_info.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/mac80211/sta_info.c +4 -1
index 6cace7fdc571..60d0d0a43418 100644
@@ -3307,7 +3307,10 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
 		u32 est_thr = 0;
 		int link_id;
 
-		ether_addr_copy(sinfo->mld_addr, sta->addr);
+		sinfo->mlo_params_valid = true;
+		sinfo->assoc_link_id = sta->deflink.link_id;
+		if (sta->sta.mlo)
+			ether_addr_copy(sinfo->mld_addr, sta->addr);
 
 		/* assign valid links first for iteration */
 		sinfo->valid_links = sta->sta.valid_links;
Signature · 1 line
2.51.0