blob: 235a0dcafe4da3521a3bbb73a47cace7f1e152bd [file] [log] [blame]
From 82e6fba06a1489a007ef20f9db17cc066f6f53d2 Mon Sep 17 00:00:00 2001
From: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Date: Thu, 25 Aug 2022 11:51:11 +0200
Subject: [PATCH 02/28] iw: add cac background command
Add command that request background CAC radar scan.
Tested on mt7915.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Link: https://lore.kernel.org/r/20220825095111.1026649-1-janusz.dziedzic@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
phy.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
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,
--
2.39.2