[PATCH] Android: Fix max number of sched scan ssids based on driver capability

Dmitry Shmidt dimitrysh at google.com
Mon Mar 28 11:09:37 PDT 2016


Change-Id: I822c20c284096c72eca3810eb9ce8e439fbe40f9
Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
 wpa_supplicant/scan.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 3463dd9..cfa4416 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) {
-- 
2.8.0.rc3.226.g39d4020
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Android-Fix-max-number-of-sched-scan-ssids-based-on-.patch
Type: application/octet-stream
Size: 1676 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20160328/6c888432/attachment.obj>


More information about the Hostap mailing list