[RFC 0/4] Initial sched_scan support in wpa_supplicant

Luciano Coelho coelho
Wed Sep 21 04:07:19 PDT 2011


This is my initial implementation of scheduled scan support in the
wpa_supplicant.  It is still very rough and there are probably lots of
corner cases and other things that may break.  That's why I'm sending
this RFC, so we can discuss this implementation before I spend too
much time on it.

I have not properly tested it, only tried out a few different

This still doesn't include the SSID filtering that I have recently
implemented in the kernel, so if you have more than the maximum
supported SSIDs to search for, it becomes pretty useless, since you'll
end up getting all the results all the time.  I'll add support for
filtering after we agree on the basics.

Known issues:

* I'm not checking whether the lower driver supports sched_scan or
  not.  This is not a problem, but can be optimized by checking
  whether the NL80211_ATTR_SUPPORTED_COMMANDS flag.

* I have implemented a rather simple algorithm that is used when we
  need to scan for more than the maximum SSIDs supported by the
  driver.  In this case, we need to eventually stop the sched_scan and
  start a new one with the remaining SSIDs.  In this implementation, I
  always start with a timeout of max_sched_scan_ssids * 2 seconds and
  an interval of 2 seconds.  After the timeout, I double the scan
  interval and halve the timeout.  This backing off algorithm is used
  because the SSIDs are supposedly sorted in order of importance, so
  we spend less time and with longer intervals when scanning lower
  priority SSIDs.  I need to figure out a better way to handle this.
  Suggestions are welcome!

* When we use a broadcast SSID (eg. when the network is using
  scan_ssid=0 or when we have more than 4 SSIDs to scan), we don't
  filter the results.  Every AP found will be reported to
  wpa_supplicant, so it will behave almost as a normal scan.  As I
  said, filtering has already been implemented in the kernel and I'll
  implement it here too in the near future.

* We don't support extra IEs (eg. used by WPS) nor P2P yet.  Adding
  support for it should be fairly simple, though.  This is obviously
  wrong and will be eventually fixed.

* We only perform sched_scans when the wpa_supplicant is starting and
  when a connection fails or we disconnect.  We don't perform
  scheduled scans yet when the SSID list is changed, an SSID is
  enabled or on other scan scenarios.  This should be fairly simple to
  add, but I want to maturize the current use-case first.

Please let me know what you think about this so I can be reassured
that I'm going in the right direction. ;)


Luciano Coelho (4):
  wpa_s: add scheduled scan driver operations
  nl80211: add scheduled scan support
  wpa_s: use sched_scan in driver init
  wpa_s: Increase number of SSIDs per scan

 src/drivers/driver.h              |   38 +++++++-
 src/drivers/driver_nl80211.c      |  142 ++++++++++++++++++++++++++++
 wpa_supplicant/driver_i.h         |   17 ++++
 wpa_supplicant/events.c           |   19 ++++-
 wpa_supplicant/scan.c             |  185 ++++++++++++++++++++++++++++++++++++-
 wpa_supplicant/scan.h             |    2 +
 wpa_supplicant/sme.c              |    1 +
 wpa_supplicant/wpa_supplicant.c   |    8 ++-
 wpa_supplicant/wpa_supplicant_i.h |    8 ++
 9 files changed, 413 insertions(+), 7 deletions(-)

More information about the Hostap mailing list