aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2016-03-28 17:58:53 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-02 14:35:28 (GMT)
commitf89c32e63f71e66d7b55e284016762b603ae02db (patch)
tree3ccfcbd7d99491a05fe72c29e1f60ad561233a7a
parentf1a5a34d8e5554d4286842f91797d811a713a5fc (diff)
downloadhostap-f89c32e63f71e66d7b55e284016762b603ae02db.zip
hostap-f89c32e63f71e66d7b55e284016762b603ae02db.tar.gz
hostap-f89c32e63f71e66d7b55e284016762b603ae02db.tar.bz2
Android: Fix max number of sched scan SSIDs based on driver capability
This adds use of the driver capability (instead of hardcoded WPAS_MAX_SCAN_SSIDS) in wpas_start_pno() similarly to what was already done in wpa_supplicant_req_sched_scan(). Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--wpa_supplicant/scan.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 768fa8e..7a52826 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -2334,10 +2334,18 @@ int wpas_start_pno(struct wpa_supplicant *wpa_s)
struct wpa_ssid *ssid;
struct wpa_driver_scan_params params;
struct sched_scan_plan scan_plan;
+ unsigned int max_sched_scan_ssids;
if (!wpa_s->sched_scan_supported)
return -1;
+ if (wpa_s->max_sched_scan_ssids > WPAS_MAX_SCAN_SSIDS)
+ max_sched_scan_ssids = WPAS_MAX_SCAN_SSIDS;
+ else
+ max_sched_scan_ssids = wpa_s->max_sched_scan_ssids;
+ if (max_sched_scan_ssids < 1)
+ return -1;
+
if (wpa_s->pno || wpa_s->pno_sched_pending)
return 0;
@@ -2381,10 +2389,10 @@ int wpas_start_pno(struct wpa_supplicant *wpa_s)
num_ssid++;
}
- if (num_ssid > WPAS_MAX_SCAN_SSIDS) {
+ if (num_ssid > max_sched_scan_ssids) {
wpa_printf(MSG_DEBUG, "PNO: Use only the first %u SSIDs from "
- "%u", WPAS_MAX_SCAN_SSIDS, (unsigned int) num_ssid);
- num_ssid = WPAS_MAX_SCAN_SSIDS;
+ "%u", max_sched_scan_ssids, (unsigned int) num_ssid);
+ num_ssid = max_sched_scan_ssids;
}
if (num_match_ssid > wpa_s->max_match_sets) {