]> git.baikalelectronics.ru Git - kernel.git/commitdiff
wifi: cfg80211: report link ID in NL80211_CMD_FRAME
authorJohannes Berg <johannes.berg@intel.com>
Mon, 18 Jul 2022 08:40:44 +0000 (10:40 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 22 Jul 2022 12:28:30 +0000 (14:28 +0200)
If given by the underlying driver, report the link ID for
MLO in NL80211_CMD_FRAME.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
net/wireless/nl80211.c

index 2f5c271bcde1785868fb9b3a2d584cb89be7c752..8545ed098d905198a5743ff2effcdfa4f9f7353f 100644 (file)
@@ -7797,6 +7797,9 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
  *
  * @freq: Frequency on which the frame was received in kHz
  * @sig_dbm: signal strength in dBm, or 0 if unknown
+ * @have_link_id: indicates the frame was received on a link of
+ *     an MLD, i.e. the @link_id field is valid
+ * @link_id: the ID of the link the frame was received on
  * @buf: Management frame (header + body)
  * @len: length of the frame data
  * @flags: flags, as defined in enum nl80211_rxmgmt_flags
@@ -7806,6 +7809,8 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
 struct cfg80211_rx_info {
        int freq;
        int sig_dbm;
+       bool have_link_id;
+       u8 link_id;
        const u8 *buf;
        size_t len;
        u32 flags;
index e5ed0950ef0b2bba03704eda24f5831cdd0e3b0c..60b8406b8d7ef6639bbd86a53ed02c3297c48677 100644 (file)
@@ -18377,6 +18377,8 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
                                        netdev->ifindex)) ||
            nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev),
                              NL80211_ATTR_PAD) ||
+           (info->have_link_id &&
+            nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, info->link_id)) ||
            nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, KHZ_TO_MHZ(info->freq)) ||
            nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ_OFFSET, info->freq % 1000) ||
            (info->sig_dbm &&