diff mbox series

iw: add cac background command

Message ID 20220825095111.1026649-1-janusz.dziedzic@gmail.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series iw: add cac background command | expand

Commit Message

Janusz Dziedzic Aug. 25, 2022, 9:51 a.m. UTC
Add command that request background CAC radar scan.
Tested on mt7915.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
---
 phy.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff mbox series

Patch

diff --git a/phy.c b/phy.c
index 2d489ef..0a57ecb 100644
--- a/phy.c
+++ b/phy.c
@@ -301,6 +301,15 @@  static int handle_cac_trigger(struct nl80211_state *state,
 	return put_chandef(msg, &chandef);
 }
 
+static int handle_cac_background(struct nl80211_state *state,
+				 struct nl_msg *msg,
+				 int argc, char **argv,
+				 enum id_input id)
+{
+	nla_put_flag(msg, NL80211_ATTR_RADAR_BACKGROUND);
+	return handle_cac_trigger(state, msg, argc, argv, id);
+}
+
 static int no_seq_check(struct nl_msg *msg, void *arg)
 {
 	return NL_OK;
@@ -381,6 +390,14 @@  COMMAND(cac, trigger,
 	"Start or trigger a channel availability check (CAC) looking to look for\n"
 	"radars on the given channel.");
 
+COMMAND(cac, background,
+	"channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
+	"freq <frequency> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
+	"freq <frequency> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
+	NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_background,
+	"Start background channel availability check (CAC) looking to look for\n"
+	"radars on the given channel.");
+
 static int handle_fragmentation(struct nl80211_state *state,
 				struct nl_msg *msg,
 				int argc, char **argv,