aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2012-01-18 16:19:24 +0200
committerArik Nemtsov <arik@wizery.com>2012-08-02 13:01:42 +0300
commitec0e5394ebb986f71b640f488659ddba89f940b0 (patch)
treef967dcb8a7aa42b43f3523abe38b9c563e7d9d7e /src/drivers
parent61270d8694738559c7887ee7002c07e41ba65149 (diff)
downloadexternal_wpa_supplicant_8_ti-ec0e5394ebb986f71b640f488659ddba89f940b0.zip
external_wpa_supplicant_8_ti-ec0e5394ebb986f71b640f488659ddba89f940b0.tar.gz
external_wpa_supplicant_8_ti-ec0e5394ebb986f71b640f488659ddba89f940b0.tar.bz2
sched scan: add support for short and long intervals
Configure sched scan to use short and long intervals if the driver supports it
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/driver.h63
-rw-r--r--src/drivers/driver_nl80211.c25
2 files changed, 54 insertions, 34 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index cd90913..a5c5f92 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1485,6 +1485,40 @@ struct wpa_driver_ops {
int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
/**
+ * sched_scan - Request the driver to initiate scheduled scan
+ * @priv: private driver interface data
+ * @params: Scan parameters
+ * @long_interval: interval between cycles after short intervals end
+ * @short_interval: interval between initial short scan cycles
+ * @num_short_intervals: number of interval short scan intervals
+ *
+ * Returns: 0 on success, -1 on failure
+ *
+ * This operation should be used for scheduled scan offload to
+ * the hardware. Every time scan results are available, the
+ * driver should report scan results event for wpa_supplicant
+ * which will eventually request the results with
+ * wpa_driver_get_scan_results2(). This operation is optional
+ * and if not provided or if it returns -1, we fall back to
+ * normal host-scheduled scans.
+ */
+ int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params,
+ u32 long_interval, u32 short_interval,
+ u8 num_short_intervals);
+
+ /**
+ * stop_sched_scan - Request the driver to stop a scheduled scan
+ * @priv: private driver interface data
+ *
+ * Returns: 0 on success, -1 on failure
+ *
+ * This should cause the scheduled scan to be stopped and
+ * results should stop being sent. Must be supported if
+ * sched_scan is supported.
+ */
+ int (*stop_sched_scan)(void *priv);
+
+ /**
* authenticate - Request driver to authenticate
* @priv: private driver interface data
* @params: authentication parameters
@@ -2503,35 +2537,6 @@ struct wpa_driver_ops {
int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
/**
- * sched_scan - Request the driver to initiate scheduled scan
- * @priv: Private driver interface data
- * @params: Scan parameters
- * @interval: Interval between scan cycles in milliseconds
- * Returns: 0 on success, -1 on failure
- *
- * This operation should be used for scheduled scan offload to
- * the hardware. Every time scan results are available, the
- * driver should report scan results event for wpa_supplicant
- * which will eventually request the results with
- * wpa_driver_get_scan_results2(). This operation is optional
- * and if not provided or if it returns -1, we fall back to
- * normal host-scheduled scans.
- */
- int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params,
- u32 interval);
-
- /**
- * stop_sched_scan - Request the driver to stop a scheduled scan
- * @priv: Private driver interface data
- * Returns: 0 on success, -1 on failure
- *
- * This should cause the scheduled scan to be stopped and
- * results should stop being sent. Must be supported if
- * sched_scan is supported.
- */
- int (*stop_sched_scan)(void *priv);
-
- /**
* poll_client - Probe (null data or such) the given station
* @priv: Private driver interface data
* @own_addr: MAC address of sending interface
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index ab8b635..2192a6e 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3607,12 +3607,16 @@ nla_put_failure:
* wpa_driver_nl80211_sched_scan - Initiate a scheduled scan
* @priv: Pointer to private driver data from wpa_driver_nl80211_init()
* @params: Scan parameters
- * @interval: Interval between scan cycles in milliseconds
+ * @long_interval: interval between scan cycles after end of short cycles
+ * @short_interval: interval between initial short scan cycles
+ * @num_short_intervals: number of interval short scan intervals
* Returns: 0 on success, -1 on failure or if not supported
*/
static int wpa_driver_nl80211_sched_scan(void *priv,
struct wpa_driver_scan_params *params,
- u32 interval)
+ u32 long_interval,
+ u32 short_interval,
+ u8 num_short_intervals)
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -3645,7 +3649,17 @@ static int wpa_driver_nl80211_sched_scan(void *priv,
NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
- NLA_PUT_U32(msg, NL80211_ATTR_SCHED_SCAN_INTERVAL, interval);
+ NLA_PUT_U32(msg, NL80211_ATTR_SCHED_SCAN_INTERVAL, long_interval);
+
+ if (drv->capa.sched_scan_intervals_supported) {
+ NLA_PUT_U32(msg,
+ NL80211_ATTR_SCHED_SCAN_SHORT_INTERVAL,
+ short_interval);
+
+ NLA_PUT_U8(msg,
+ NL80211_ATTR_SCHED_SCAN_NUM_SHORT_INTERVALS,
+ num_short_intervals);
+ }
if ((drv->num_filter_ssids &&
(int) drv->num_filter_ssids <= drv->capa.max_match_sets) ||
@@ -3723,8 +3737,9 @@ static int wpa_driver_nl80211_sched_scan(void *priv,
goto nla_put_failure;
}
- wpa_printf(MSG_DEBUG, "nl80211: Sched scan requested (ret=%d) - "
- "scan interval %d msec", ret, interval);
+ wpa_printf(MSG_DEBUG, "nl80211: Sched scan requested (ret=%d) "
+ "intervals: short=%d ms long=%d ms num_short_intervals=%d"
+ , ret, short_interval, long_interval, num_short_intervals);
nla_put_failure:
nlmsg_free(ssids);