blob: 235a0dcafe4da3521a3bbb73a47cace7f1e152bd [file] [log] [blame]
developer56addb32024-03-21 17:32:43 +08001From 82e6fba06a1489a007ef20f9db17cc066f6f53d2 Mon Sep 17 00:00:00 2001
2From: Janusz Dziedzic <janusz.dziedzic@gmail.com>
3Date: Thu, 25 Aug 2022 11:51:11 +0200
4Subject: [PATCH 02/28] iw: add cac background command
5
6Add command that request background CAC radar scan.
7Tested on mt7915.
8
9Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
10Link: https://lore.kernel.org/r/20220825095111.1026649-1-janusz.dziedzic@gmail.com
11Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12---
13 phy.c | 17 +++++++++++++++++
14 1 file changed, 17 insertions(+)
15
16diff --git a/phy.c b/phy.c
17index 2d489ef..0a57ecb 100644
18--- a/phy.c
19+++ b/phy.c
20@@ -301,6 +301,15 @@ static int handle_cac_trigger(struct nl80211_state *state,
21 return put_chandef(msg, &chandef);
22 }
23
24+static int handle_cac_background(struct nl80211_state *state,
25+ struct nl_msg *msg,
26+ int argc, char **argv,
27+ enum id_input id)
28+{
29+ nla_put_flag(msg, NL80211_ATTR_RADAR_BACKGROUND);
30+ return handle_cac_trigger(state, msg, argc, argv, id);
31+}
32+
33 static int no_seq_check(struct nl_msg *msg, void *arg)
34 {
35 return NL_OK;
36@@ -381,6 +390,14 @@ COMMAND(cac, trigger,
37 "Start or trigger a channel availability check (CAC) looking to look for\n"
38 "radars on the given channel.");
39
40+COMMAND(cac, background,
41+ "channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
42+ "freq <frequency> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
43+ "freq <frequency> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
44+ NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_background,
45+ "Start background channel availability check (CAC) looking to look for\n"
46+ "radars on the given channel.");
47+
48 static int handle_fragmentation(struct nl80211_state *state,
49 struct nl_msg *msg,
50 int argc, char **argv,
51--
522.39.2
53