2012-10-26 14:42:30

by Antonio Quartulli

[permalink] [raw]
Subject: [PATCH 1/2] iw: show AP scan capability

If the wireless driver supports the AP scan capability (this can be
seen by checking NL80211_FEATURE_AP_SCAN) iw has to show it.

Signed-off-by: Antonio Quartulli <[email protected]>
---
info.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/info.c b/info.c
index 799f6d3..5dab1e8 100644
--- a/info.c
+++ b/info.c
@@ -448,6 +448,8 @@ broken_combination:
printf("\tDevice supports low priority scan.\n");
if (features & NL80211_FEATURE_SCAN_FLUSH)
printf("\tDevice supports scan flush.\n");
+ if (features & NL80211_FEATURE_AP_SCAN)
+ printf("\tDevice supports AP scan.\n");
}

return NL_SKIP;
--
1.7.12.4



2012-10-26 14:47:45

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] iw: show AP scan capability

Applied both, thanks.

johannes


2012-10-26 14:42:30

by Antonio Quartulli

[permalink] [raw]
Subject: [PATCH 2/2] iw: add support for the forced AP scan

This patch introduces the "ap-force" argument to the scan command.
This argument instructs mac80211 to trigger the scan even if the
interface is configured as AP and has already started beaconing (the
driver may not support such operation)

Signed-off-by: Antonio Quartulli <[email protected]>
---
scan.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scan.c b/scan.c
index 91984e5..73fb3fe 100644
--- a/scan.c
+++ b/scan.c
@@ -103,6 +103,10 @@ static int handle_scan(struct nl80211_state *state,
parse = NONE;
flags |= NL80211_SCAN_FLAG_FLUSH;
break;
+ } else if (strcmp(argv[i], "ap-force") == 0) {
+ parse = NONE;
+ flags |= NL80211_SCAN_FLAG_AP;
+ break;
} else if (strcmp(argv[i], "ssid") == 0) {
parse = SSID;
have_ssids = true;
@@ -1355,7 +1359,7 @@ static int handle_scan_combined(struct nl80211_state *state,
dump_argv[0] = argv[0];
return handle_cmd(state, id, dump_argc, dump_argv);
}
-TOPLEVEL(scan, "[-u] [freq <freq>*] [ies <hex as 00:11:..>] [lowpri,flush] [ssid <ssid>*|passive]", 0, 0,
+TOPLEVEL(scan, "[-u] [freq <freq>*] [ies <hex as 00:11:..>] [lowpri,flush,ap-force] [ssid <ssid>*|passive]", 0, 0,
CIB_NETDEV, handle_scan_combined,
"Scan on the given frequencies and probe for the given SSIDs\n"
"(or wildcard if not given) unless passive scanning is requested.\n"
@@ -1365,7 +1369,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>*] [ies <hex as 00:11:..>] [lowpri,flush] [ssid <ssid>*|passive]",
+COMMAND(scan, trigger, "[freq <freq>*] [ies <hex as 00:11:..>] [lowpri,flush,ap-force] [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.");
--
1.7.12.4