Add scheduled scan driver operations

In new Linux kernel versions (>=3.0), nl80211 adds scheduled scan
capability. In order to use this feature to its full extent, we need
to support it in the wpa_supplicant core, so that it can also be used
by other drivers.

This commit adds initial scheduled scan support operations and events.

Signed-off-by: Luciano Coelho <coelho@ti.com>
This commit is contained in:
Luciano Coelho 2011-09-27 22:21:29 +03:00 committed by Jouni Malinen
parent 5f738a21a6
commit cbdf3507e9
8 changed files with 271 additions and 2 deletions

View file

@ -694,6 +694,8 @@ struct wpa_driver_capa {
unsigned int flags;
int max_scan_ssids;
int max_sched_scan_ssids;
int sched_scan_supported;
/**
* max_remain_on_chan - Maximum remain-on-channel duration in msec
@ -2455,6 +2457,35 @@ struct wpa_driver_ops {
* the station gets added by FT-over-DS.
*/
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);
};
@ -2867,7 +2898,12 @@ enum wpa_event_type {
* completed Group Key Handshake while the host (including
* wpa_supplicant was sleeping).
*/
EVENT_DRIVER_GTK_REKEY
EVENT_DRIVER_GTK_REKEY,
/**
* EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
*/
EVENT_SCHED_SCAN_STOPPED
};

View file

@ -3331,5 +3331,7 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
NULL /* sta_assoc */,
NULL /* sta_auth */,
NULL /* add_tspec */,
NULL /* add_sta_node */
NULL /* add_sta_node */,
NULL /* sched_scan */,
NULL /* stop_sched_scan */
};