]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: cfg80211: Report per-radio RTS threshold to userspace
authorRoopni Devanathan <quic_rdevanat@quicinc.com>
Sun, 15 Jun 2025 08:23:11 +0000 (13:53 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 24 Jun 2025 13:19:27 +0000 (15:19 +0200)
In case of multi-radio wiphys, with per-radio RTS threshold brought
into use, RTS threshold for each radio in a wiphy can be recorded in
wiphy parameter - wiphy_radio_cfg, as an array. Add a new attribute -
NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD in nested parameter -
NL80211_ATTR_WIPHY_RADIOS. When a request for getting RTS threshold
for a particular radio is received, parse the radio id and get the
required data. Add this data to the newly added nested attribute
NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD. Add support to report this
data to userspace.

Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
Link: https://patch.msgid.link/20250615082312.619639-4-quic_rdevanat@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index 2a71149c3065dda74350a5f8f37d018c781f52c8..39460334dafb3d5d778ae74ef0d8eb8a6b28b89f 100644 (file)
@@ -8106,6 +8106,7 @@ enum nl80211_ap_settings_flags {
  *     and contains attributes defined in &enum nl80211_if_combination_attrs.
  * @NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK: bitmask (u32) of antennas
  *     connected to this radio.
+ * @NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD: RTS threshold (u32) of this radio.
  *
  * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal
  * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute
@@ -8117,6 +8118,7 @@ enum nl80211_wiphy_radio_attrs {
        NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE,
        NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION,
        NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK,
+       NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD,
 
        /* keep last */
        __NL80211_WIPHY_RADIO_ATTR_LAST,
index b0176090182ca090abcd3caa8119323ce0b8fb9f..70bfe2bfdcc7137a250b92736e8235ac8b63da7b 100644 (file)
@@ -2447,6 +2447,7 @@ fail:
 static int nl80211_put_radio(struct wiphy *wiphy, struct sk_buff *msg, int idx)
 {
        const struct wiphy_radio *r = &wiphy->radio[idx];
+       const struct wiphy_radio_cfg *rcfg = &wiphy->radio_cfg[idx];
        struct nlattr *radio, *freq;
        int i;
 
@@ -2457,6 +2458,11 @@ static int nl80211_put_radio(struct wiphy *wiphy, struct sk_buff *msg, int idx)
        if (nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_INDEX, idx))
                goto nla_put_failure;
 
+       if (rcfg->rts_threshold &&
+           nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD,
+                       rcfg->rts_threshold))
+               goto nla_put_failure;
+
        if (r->antenna_mask &&
            nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK,
                        r->antenna_mask))