blob: ace1b11fb72a9190c3e275f145d42a38196c0395 [file] [log] [blame]
From 9ac9d78cb92dd3ffce4dd514f80d5a166d722ce0 Mon Sep 17 00:00:00 2001
From: dzou <dzou@company.com>
Date: Sun, 5 Jun 2022 23:19:45 +0800
Subject: [PATCH 904/911] nl80211: Radar background flag setting
Allow background radar detection flag to be set when specifying a
channel. This is a preliminary change to introduce radar/CAC background
detection support.
Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
src/drivers/driver.h | 5 +++++
src/drivers/driver_nl80211.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 68964c9d5..90adbf0f4 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -783,6 +783,11 @@ struct hostapd_freq_params {
* for IEEE 802.11ay EDMG configuration.
*/
struct ieee80211_edmg_config edmg;
+
+ /**
+ * radar_background - Whether radar/CAC background is requested
+ */
+ bool radar_background;
};
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index bf4fda770..6cf127ca7 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4901,6 +4901,8 @@ static int nl80211_put_freq_params(struct nl_msg *msg,
wpa_printf(MSG_DEBUG, " * he_enabled=%d", freq->he_enabled);
wpa_printf(MSG_DEBUG, " * vht_enabled=%d", freq->vht_enabled);
wpa_printf(MSG_DEBUG, " * ht_enabled=%d", freq->ht_enabled);
+ wpa_printf(MSG_DEBUG, " * radar_background=%d",
+ freq->radar_background);
hw_mode = ieee80211_freq_to_chan(freq->freq, &channel);
is_24ghz = hw_mode == HOSTAPD_MODE_IEEE80211G ||
@@ -4978,6 +4980,9 @@ static int nl80211_put_freq_params(struct nl_msg *msg,
NL80211_CHAN_NO_HT))
return -ENOBUFS;
}
+ if (freq->radar_background)
+ nla_put_flag(msg, NL80211_ATTR_RADAR_BACKGROUND);
+
return 0;
}
--
2.29.2