]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: add cac background command
authorJanusz Dziedzic <janusz.dziedzic@gmail.com>
Thu, 25 Aug 2022 09:51:11 +0000 (11:51 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 1 Dec 2022 13:12:47 +0000 (14:12 +0100)
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

diff --git a/phy.c b/phy.c
index 2d489efd769037dd105deff32289e49ee6145c51..0a57ecbff45667afed216658c8a69ead6db60445 100644 (file)
--- 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,