]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: scan: add flag for scanning colocated ap
authorTova Mussai <tova.mussai@intel.com>
Thu, 10 Oct 2019 06:54:41 +0000 (09:54 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 6 Nov 2020 08:52:24 +0000 (09:52 +0100)
1. For full scan set the flag to scan for collocated ap by default.
2. In any other case, user need to add it to the command line (optional).

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
scan.c

diff --git a/scan.c b/scan.c
index 02fa6e2c1831a34e6e681c78f1d2e85e56bb001f..8c23483ecede77da0a97b3ee0a82693f54b85412 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -425,6 +425,9 @@ static int handle_scan(struct nl80211_state *state,
                        } else if (strcmp(argv[i], "ap-force") == 0) {
                                flags |= NL80211_SCAN_FLAG_AP;
                                break;
+                       } else if (strcmp(argv[i], "coloc") == 0) {
+                               flags |= NL80211_SCAN_FLAG_COLOCATED_6GHZ;
+                               break;
                        } else if (strcmp(argv[i], "duration-mandatory") == 0) {
                                duration_mandatory = true;
                                break;
@@ -512,6 +515,8 @@ static int handle_scan(struct nl80211_state *state,
 
        if (have_freqs)
                nla_put_nested(msg, NL80211_ATTR_SCAN_FREQUENCIES, freqs);
+       else
+               flags |=  NL80211_SCAN_FLAG_COLOCATED_6GHZ;
        if (flags)
                NLA_PUT_U32(msg, NL80211_ATTR_SCAN_FLAGS, flags);
        if (duration)
@@ -2604,7 +2609,7 @@ COMMAND(scan, dump, "[-u]",
        NL80211_CMD_GET_SCAN, NLM_F_DUMP, CIB_NETDEV, handle_scan_dump,
        "Dump the current scan results. If -u is specified, print unknown\n"
        "data in scan results.");
-COMMAND(scan, trigger, "[freq <freq>*] [duration <dur>] [ies <hex as 00:11:..>] [meshid <meshid>] [lowpri,flush,ap-force,duration-mandatory] [randomise[=<addr>/<mask>]] [ssid <ssid>*|passive]",
+COMMAND(scan, trigger, "[freq <freq>*] [duration <dur>] [ies <hex as 00:11:..>] [meshid <meshid>] [lowpri,flush,ap-force,duration-mandatory,coloc] [randomise[=<addr>/<mask>]] [ssid <ssid>*|passive]",
        NL80211_CMD_TRIGGER_SCAN, 0, CIB_NETDEV, handle_scan,
         "Trigger a scan on the given frequencies with probing for the given\n"
         "SSIDs (or wildcard if not given) unless passive scanning is requested.\n"