Reduce Channel Scanning Time in wpa_supplicant

Jouni Malinen j
Fri Feb 24 13:28:50 PST 2012

On Thu, Feb 23, 2012 at 12:48:25AM -0500, Nithyananthan Poosamani wrote:
> I am working with wpa_supplicant 0.6.x provided along with the Android
> source git. I am working on supplicant for NexusOne phone.
> In driver_wext.c file and in the method "wpa_driver_wext_set_cscan_params",
> there is the code to do passive channel scanning.
> So by default of 250 ms dwell time, if my understanding is right, Android
> takes close to 3.5 sec to do one full-channel scan and return the results.

This is an Android specific private extension to WEXT and depends on
what exactly the specific driver you are using happens to support..
There does seem to be a WEXT_CSCAN_CHANNEL_SECTION that could
potentially be used for some scan parameter configuration. However, I
have not verified what exactly can be done with that.

> My question is, how can I do scanning for only one specified channel ? So
> basically I would do scanning for 250 ms only and then return results.

If you are able to use Android ICS, a driver that supports
nl80211/cfg80211, and more recent wpa_supplicant (e.g., the one that is
included in ICS or even better, the one from hostap.git android branch),
you should be able to do this with NL80211_ATTR_SCAN_FREQUENCIES in
NL80211_CMD_TRIGGER_SCAN, i.e., the standard nl80211 way of specifying
which channels are to be scanned. wpa_supplicant uses that internally
whenever it is possible to optimize operations by running a single
channel scan instead of full scan.

> Also the previous scan results are cached somewhere, so whenever the phone
> screen is turned on, we check the cached results first to speed-up
> association else do new scanning.
> How are the cache results changed, how periodically ?

That would be another Android specific question.. There are actually
multiple caches for scan results (firmware, driver, cfg80211,
wpa_supplicant, potentially Wi-Fi framework).. I'm not sure which one of
these is used in the particular case you describe here.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list