diff options
author | Johannes Berg <johannes.berg@intel.com> | 2022-06-13 16:51:27 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-06-20 12:57:08 +0200 |
commit | ce08cd344a0027076b2f46b9e8988d08f6641252 (patch) | |
tree | 6ed38cceac907d2d1fe490df9001ea06546f60b7 /net/wireless | |
parent | wifi: mac80211_hwsim: send a beacon per link (diff) | |
download | linux-ce08cd344a0027076b2f46b9e8988d08f6641252.tar.xz linux-ce08cd344a0027076b2f46b9e8988d08f6641252.zip |
wifi: nl80211: expose link information for interfaces
When getting/dumping an interface, expose information about
valid links.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 0a69a5a6b74d..64934dd923ce 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3800,6 +3800,28 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag goto nla_put_failure; } + if (wdev->valid_links) { + unsigned int link_id; + struct nlattr *links = nla_nest_start(msg, + NL80211_ATTR_MLO_LINKS); + + if (!links) + goto nla_put_failure; + + for_each_valid_link(wdev, link_id) { + struct nlattr *link = nla_nest_start(msg, link_id + 1); + + if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) + goto nla_put_failure; + if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, + wdev->links[link_id].addr)) + goto nla_put_failure; + nla_nest_end(msg, link); + } + + nla_nest_end(msg, links); + } + genlmsg_end(msg, hdr); return 0; |