From bad12effe8ad24e91af1f6c769d0ff322e2c7cf8 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Sun, 6 Mar 2022 20:34:11 +0100 Subject: [PATCH] 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 Signed-off-by: Lorenzo Bianconi --- 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 4b86d8fc6..111e7e408 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -782,6 +782,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 5b01e2b3e..403972985 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4912,6 +4912,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 || @@ -4989,6 +4991,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; }