[PATCH] Use priority list instead of global for PNO

Dmitry Shmidt dimitrysh
Tue Feb 10 10:32:23 PST 2015


Change-Id: Ib9309b2cd461ac681bbc6e2efcec18b597e34f26
Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
 wpa_supplicant/scan.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index debceb9..7c3d4db 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1944,7 +1944,7 @@ void wpa_scan_free_params(struct
wpa_driver_scan_params *params)

 int wpas_start_pno(struct wpa_supplicant *wpa_s)
 {
-       int ret, interval;
+       int ret, interval, prio;
        size_t i, num_ssid, num_match_ssid;
        struct wpa_ssid *ssid;
        struct wpa_driver_scan_params params;
@@ -2009,9 +2009,11 @@ int wpas_start_pno(struct wpa_supplicant *wpa_s)
                                        sizeof(struct wpa_driver_scan_filter));
        if (params.filter_ssids == NULL)
                return -1;
+
        i = 0;
-       ssid = wpa_s->conf->ssid;
-       while (ssid) {
+       prio = 0;
+       ssid = wpa_s->conf->pssid[prio];
+       while (ssid && (prio < wpa_s->conf->num_prio)) {
                if (!wpas_network_disabled(wpa_s, ssid)) {
                        if (ssid->scan_ssid && params.num_ssids < num_ssid) {
                                params.ssids[params.num_ssids].ssid =
@@ -2028,7 +2030,10 @@ int wpas_start_pno(struct wpa_supplicant *wpa_s)
                        if (i == num_match_ssid)
                                break;
                }
-               ssid = ssid->next;
+               if (ssid->pnext)
+                       ssid = ssid->pnext;
+               else
+                       ssid = wpa_s->conf->pssid[++prio];
        }

        if (wpa_s->conf->filter_rssi)
--
2.2.0.rc0.207.ga3a616c



More information about the Hostap mailing list