]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: nl80211: expose can-monitor channel property
authorJohannes Berg <johannes.berg@intel.com>
Thu, 23 May 2024 10:09:42 +0000 (12:09 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 12 Jun 2024 11:04:24 +0000 (13:04 +0200)
It may be possible to monitor on disabled channels per the
can-monitor flag, but evidently I forgot to expose that out
to userspace. Fix that.

Fixes: a110a3b79177 ("wifi: cfg80211: optionally support monitor on disabled channels")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240523120945.9a2c19a51e53.I50fa1b1a18b70f63a5095131ac23dc2e71f3d426@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 8ff5f79d446ae1fa104059a72d42e55cc49fa679..fd6e33a1eb2a6a86d5ecf769e8bb48f32a948f14 100644 (file)
@@ -1204,6 +1204,9 @@ static int nl80211_msg_put_channel(struct sk_buff *msg, struct wiphy *wiphy,
                if ((chan->flags & IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT) &&
                    nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT))
                        goto nla_put_failure;
+               if ((chan->flags & IEEE80211_CHAN_CAN_MONITOR) &&
+                   nla_put_flag(msg, NL80211_FREQUENCY_ATTR_CAN_MONITOR))
+                       goto nla_put_failure;
        }
 
        if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,