nl80211: Add support for aborting an ongoing scan

This adds the driver interface commands for issuing a request to abort
an ongoing scan operation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Kanchanapally, Vidyullatha 2015-10-19 19:30:34 +05:30 committed by Jouni Malinen
parent 5ef0b84355
commit 4f30addb38
5 changed files with 35 additions and 0 deletions

View file

@ -3457,6 +3457,13 @@ struct wpa_driver_ops {
* on. Local device is assuming P2P Client role.
*/
int (*set_prob_oper_freq)(void *priv, unsigned int freq);
/**
* abort_scan - Request the driver to abort an ongoing scan
* @priv: Private driver interface data
* Returns 0 on success, -1 on failure
*/
int (*abort_scan)(void *priv);
};

View file

@ -8806,6 +8806,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.sched_scan = wpa_driver_nl80211_sched_scan,
.stop_sched_scan = wpa_driver_nl80211_stop_sched_scan,
.get_scan_results2 = wpa_driver_nl80211_get_scan_results,
.abort_scan = wpa_driver_nl80211_abort_scan,
.deauthenticate = driver_nl80211_deauthenticate,
.authenticate = driver_nl80211_authenticate,
.associate = wpa_driver_nl80211_associate,

View file

@ -281,6 +281,7 @@ int wpa_driver_nl80211_sched_scan(void *priv,
int wpa_driver_nl80211_stop_sched_scan(void *priv);
struct wpa_scan_results * wpa_driver_nl80211_get_scan_results(void *priv);
void nl80211_dump_scan(struct wpa_driver_nl80211_data *drv);
int wpa_driver_nl80211_abort_scan(void *priv);
const u8 * nl80211_get_ie(const u8 *ies, size_t ies_len, u8 ie);
int wpa_driver_nl80211_vendor_scan(struct i802_bss *bss,
struct wpa_driver_scan_params *params);

View file

@ -787,6 +787,25 @@ void nl80211_dump_scan(struct wpa_driver_nl80211_data *drv)
}
int wpa_driver_nl80211_abort_scan(void *priv)
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
int ret;
struct nl_msg *msg;
wpa_printf(MSG_DEBUG, "nl80211: Abort scan");
msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_ABORT_SCAN);
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
if (ret) {
wpa_printf(MSG_DEBUG, "nl80211: Abort scan failed: ret=%d (%s)",
ret, strerror(-ret));
}
return ret;
}
#ifdef CONFIG_DRIVER_NL80211_QCA
static int scan_cookie_handler(struct nl_msg *msg, void *arg)

View file

@ -912,4 +912,11 @@ static inline int wpa_drv_set_prob_oper_freq(struct wpa_supplicant *wpa_s,
return wpa_s->driver->set_prob_oper_freq(wpa_s->drv_priv, freq);
}
static inline int wpa_drv_abort_scan(struct wpa_supplicant *wpa_s)
{
if (!wpa_s->driver->abort_scan)
return -1;
return wpa_s->driver->abort_scan(wpa_s->drv_priv);
}
#endif /* DRIVER_I_H */