Search Linux Wireless

[PATCH mac80211-next 4/4] cfg80211: introduce NL80211_EXT_FEATURE_RADAR_OFFCHAN feature flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Introduce NL80211_EXT_FEATURE_RADAR_OFFCHAN feature flag in order to
notify userland the underlay hw supports offchannel radar/CAC detection.

Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
---
 include/uapi/linux/nl80211.h | 4 ++++
 net/wireless/nl80211.c       | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 96e622777bb2..d856c95ea736 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -6055,6 +6055,9 @@ enum nl80211_feature_flags {
  *	frames. Userspace has to share FILS AAD details to the driver by using
  *	@NL80211_CMD_SET_FILS_AAD.
  *
+ * @NL80211_EXT_FEATURE_RADAR_OFFCHAN: Device supports offchannel radar/CAC
+ *	detection.
+ *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
  */
@@ -6121,6 +6124,7 @@ enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
 	NL80211_EXT_FEATURE_BSS_COLOR,
 	NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
+	NL80211_EXT_FEATURE_RADAR_OFFCHAN,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a296f180624e..9f19ff5b13c5 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -9304,6 +9304,10 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
 
 	if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_OFFCHAN])) {
 		/* offchannel radar detection */
+		if (!wiphy_ext_feature_isset(wiphy,
+					     NL80211_EXT_FEATURE_RADAR_OFFCHAN))
+			return -EOPNOTSUPP;
+
 		return rdev_set_radar_offchan(rdev, &chandef);
 	}
 
-- 
2.31.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux