[PATCH] Android: Fix bgscan-start / bgscan-stop call
Jouni Malinen
j
Tue Nov 29 03:03:33 PST 2011
On Mon, Nov 28, 2011 at 05:07:26PM -0800, Dmitry Shmidt wrote:
> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> i = 0;
> + ssid = wpa_s->conf->ssid;
> while (ssid) {
Thanks! Applied this part.
> @@ -3377,10 +3378,12 @@ static int wpa_supplicant_driver_cmd(struct wpa_supplicant *wpa_s, char *cmd,
>
> #ifdef ANDROID
> if (os_strcasecmp(cmd, "BGSCAN-START") == 0)
> - return pno_start(wpa_s);
> + ret = pno_start(wpa_s);
> +
> + else if (os_strcasecmp(cmd, "BGSCAN-STOP") == 0)
> + ret = pno_stop(wpa_s);
>
> - if (os_strcasecmp(cmd, "BGSCAN-STOP") == 0)
> - return pno_stop(wpa_s);
> + else
> #endif /* ANDROID */
>
> ret = wpa_drv_driver_cmd(wpa_s, cmd, buf, buflen);
This does not look correct. The reason for the special handlers for
BGSCAN-START/STOP here are for the explicit purpose of avoiding that
wpa_drv_driver_cmd() call and as such, those returns are there for
purpose. pno_start/stop end up calling
wpa_drv_sched_scan/wpa_drv_stop_sched_scan and the driver wrappers can
use those to implement whatever is needed for this. In the android
branch, driver_wext.c converts this to what driver_cmd() does in
wpa_supplicant_8.git (and the private wpa_supplicant_8_lib) and
driver_nl80211.c uses nl80211 sched_scan commands if the driver supports
them and if not, does what wpa_supplicant_8.git tree is doing with the
private ioctl.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list