2022-08-25 10:04:42

by Janusz Dziedzic

[permalink] [raw]
Subject: [PATCH] iw: add cac background command

Add command that request background CAC radar scan.
Tested on mt7915.

Signed-off-by: Janusz Dziedzic <[email protected]>
---
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.25.1