[PATCH 1/1] STA: Handle legacy scan interruption of schedscan
Jithu Jance
jithujance
Thu Nov 7 20:56:24 PST 2013
Hi Jouni,
I saw few issues with scheduled scan inter-op with legacy scan . Could you
see whether the changes to address below issues are fine.
a) While starting from PNO start context the scheduled
scan was not setting the flag wpa_s->scanning. This was resulting
in the subsequent SCAN command to proceed further and send command to
nl80211/cfg80211.
The expected behaviour of cancelling sched scan is not happening here.
b) While schedscan is in progress and a legacy scan comes
> on the cli/socket the sched scan is cancelled and normal scan
> is allowed to continue. However, sometimes schedscan cancelled
event comes a bit delayed and we will send out the scan command before
the
wpa_s->scanning is cleared. Instead, the incoming scan req is
rescheduled now if the wpa_s->scanning shows that it is still in
progress.
On Thu, Oct 17, 2013 at 11:56 AM, Jithu Jance <jithu at broadcom.com> wrote:
>
>
> Signed-hostap: Jithu Jance <jithu at broadcom.com>
> ---
> wpa_supplicant/ctrl_iface.c | 5 +++--
> wpa_supplicant/scan.c | 14 ++++++++++++--
> wpa_supplicant/scan.h | 4 ++++
> 3 files changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> index 0f893f7..e993973 100644
> --- a/wpa_supplicant/ctrl_iface.c
> +++ b/wpa_supplicant/ctrl_iface.c
> @@ -111,7 +111,8 @@ static int pno_start(struct wpa_supplicant *wpa_s)
> interval = wpa_s->conf->sched_scan_interval ?
> wpa_s->conf->sched_scan_interval : 10;
>
> - ret = wpa_drv_sched_scan(wpa_s, ¶ms, interval * 1000);
> + ret = wpa_supplicant_start_sched_scan(wpa_s, ¶ms,
> + interval);
> os_free(params.filter_ssids);
> if (ret == 0)
> wpa_s->pno = 1;
> @@ -125,7 +126,7 @@ static int pno_stop(struct wpa_supplicant *wpa_s)
>
> if (wpa_s->pno) {
> wpa_s->pno = 0;
> - ret = wpa_drv_stop_sched_scan(wpa_s);
> + ret = wpa_supplicant_stop_sched_scan(wpa_s);
> }
>
> if (wpa_s->wpa_state == WPA_SCANNING)
> diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
> index be826db..0074cf3 100644
> --- a/wpa_supplicant/scan.c
> +++ b/wpa_supplicant/scan.c
> @@ -260,7 +260,7 @@ wpa_supplicant_sched_scan_timeout(void *eloop_ctx,
> void *timeout_ctx)
> }
>
>
> -static int
> +int
> wpa_supplicant_start_sched_scan(struct wpa_supplicant *wpa_s,
> struct wpa_driver_scan_params *params,
> int interval)
> @@ -278,7 +278,8 @@ wpa_supplicant_start_sched_scan(struct wpa_supplicant
> *wpa_s,
> }
>
>
> -static int wpa_supplicant_stop_sched_scan(struct wpa_supplicant *wpa_s)
> +int
> +wpa_supplicant_stop_sched_scan(struct wpa_supplicant *wpa_s)
> {
> int ret;
>
> @@ -566,6 +567,15 @@ static void wpa_supplicant_scan(void *eloop_ctx, void
> *timeout_ctx)
> return;
> }
>
> + if (wpa_s->scanning) {
> + /* If we are already in scanning state, we shall
> reschedule the
> + * the incomming scan request
> + */
> + wpa_dbg(wpa_s, MSG_DEBUG, "Already scanning - Reschedule
> the "
> + "incoming scan req");
> + wpa_supplicant_req_scan(wpa_s, 1, 0);
> + return;
> + }
> if (!wpa_supplicant_enabled_networks(wpa_s) &&
> wpa_s->scan_req == NORMAL_SCAN_REQ) {
> wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks - do not
> scan");
> diff --git a/wpa_supplicant/scan.h b/wpa_supplicant/scan.h
> index 66581a9..f6910ae 100644
> --- a/wpa_supplicant/scan.h
> +++ b/wpa_supplicant/scan.h
> @@ -39,5 +39,9 @@ void wpa_supplicant_update_scan_int(struct
> wpa_supplicant *wpa_s, int sec);
> void scan_only_handler(struct wpa_supplicant *wpa_s,
> struct wpa_scan_results *scan_res);
> int wpas_scan_scheduled(struct wpa_supplicant *wpa_s);
> +int wpa_supplicant_start_sched_scan(struct wpa_supplicant *wpa_s,
> + struct wpa_driver_scan_params *params, int interval);
> +int
> +wpa_supplicant_stop_sched_scan(struct wpa_supplicant *wpa_s);
>
> #endif /* SCAN_H */
> --
> 1.7.9.5
>
>
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20131108/8e8b348b/attachment.htm>
More information about the Hostap
mailing list