[PATCH] Android: Fix bgscan-start / bgscan-stop call
Dmitry Shmidt
dimitrysh
Tue Nov 29 10:26:27 PST 2011
On Tue, Nov 29, 2011 at 3:03 AM, Jouni Malinen <j at w1.fi> wrote:
> 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.
The point here to return proper status in the return buffer. ("Ok" in
this case or "Fail").
Thanks,
Dmitry
>
> --
> Jouni Malinen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
More information about the Hostap
mailing list