aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorVictor Goldenshtein <victorg@ti.com>2012-07-26 16:08:41 +0300
committerArik Nemtsov <arik@wizery.com>2012-08-02 13:03:06 +0300
commita523a2884fe83c111c8f3855bf36620c7d79b016 (patch)
tree9641309e666210ef462f7bc6ded4cd5f20903003 /src/drivers
parentdf76167aca7c42ff7be962a0fe9fb7c178825fdb (diff)
downloadexternal_wpa_supplicant_8_ti-a523a2884fe83c111c8f3855bf36620c7d79b016.zip
external_wpa_supplicant_8_ti-a523a2884fe83c111c8f3855bf36620c7d79b016.tar.gz
external_wpa_supplicant_8_ti-a523a2884fe83c111c8f3855bf36620c7d79b016.tar.bz2
wpa_s: don't reschedule the sched scan on each scan complete event
wpa_supplicant doesn't distinguish between NL80211_CMD_SCHED_SCAN_RESULTS and NL80211_CMD_NEW_SCAN_RESULTS, this causing unnecessary rescheduling of the sched scan on each scan complete event. Reschedule the sched scan (stop + start) only if the scan results are from the sched scan. Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/driver.h2
-rw-r--r--src/drivers/driver_nl80211.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 096891a..accc1e6 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -3405,6 +3405,7 @@ union wpa_event_data {
/**
* struct scan_info - Optional data for EVENT_SCAN_RESULTS events
* @aborted: Whether the scan was aborted
+ * @is_sched_scan_res: Whether the scan results are from the sched scan
* @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
* @num_freqs: Number of entries in freqs array
* @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
@@ -3413,6 +3414,7 @@ union wpa_event_data {
*/
struct scan_info {
int aborted;
+ int is_sched_scan_res;
const int *freqs;
size_t num_freqs;
struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 9990944..2806d0f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1589,7 +1589,7 @@ static void mlme_event_remain_on_channel(struct wpa_driver_nl80211_data *drv,
static void send_scan_event(struct wpa_driver_nl80211_data *drv, int aborted,
- struct nlattr *tb[])
+ int is_sched_scan_res, struct nlattr *tb[])
{
union wpa_event_data event;
struct nlattr *nl;
@@ -1633,6 +1633,7 @@ static void send_scan_event(struct wpa_driver_nl80211_data *drv, int aborted,
info->freqs = freqs;
info->num_freqs = num_freqs;
}
+ info->is_sched_scan_res = is_sched_scan_res;
wpa_supplicant_event(drv->ctx, EVENT_SCAN_RESULTS, &event);
}
@@ -2131,12 +2132,12 @@ static void do_process_drv_event(struct wpa_driver_nl80211_data *drv,
drv->scan_complete_events = 1;
eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv,
drv->ctx);
- send_scan_event(drv, 0, tb);
+ send_scan_event(drv, 0, 0, tb);
break;
case NL80211_CMD_SCHED_SCAN_RESULTS:
wpa_printf(MSG_DEBUG,
"nl80211: New sched scan results available");
- send_scan_event(drv, 0, tb);
+ send_scan_event(drv, 0, 1, tb);
break;
case NL80211_CMD_SCAN_ABORTED:
wpa_printf(MSG_DEBUG, "nl80211: Scan aborted");
@@ -2146,7 +2147,7 @@ static void do_process_drv_event(struct wpa_driver_nl80211_data *drv,
*/
eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv,
drv->ctx);
- send_scan_event(drv, 1, tb);
+ send_scan_event(drv, 1, 0, tb);
break;
case NL80211_CMD_AUTHENTICATE:
case NL80211_CMD_ASSOCIATE: