nl80211: Add driver_ops for stopping AP beaconing

This can be used to stop AP mode beaconing temporarily, e.g., in
response to a radar detected event.

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
This commit is contained in:
Simon Wunderlich 2013-05-09 20:06:33 +03:00 committed by Jouni Malinen
parent f90e9c1c8b
commit 695c70381f
2 changed files with 24 additions and 0 deletions

View file

@ -2663,6 +2663,17 @@ struct wpa_driver_ops {
* Returns: 0 on success, -1 on failure
*/
int (*start_dfs_cac)(void *priv, int freq);
/**
* stop_ap - Removes beacon from AP
* @priv: Private driver interface data
* Returns: 0 on success, -1 on failure (or if not supported)
*
* This optional function can be used to disable AP mode related
* configuration. Unlike deinit_ap, it does not change to station
* mode.
*/
int (*stop_ap)(void *priv);
};

View file

@ -8986,6 +8986,18 @@ static int wpa_driver_nl80211_deinit_ap(void *priv)
}
static int wpa_driver_nl80211_stop_ap(void *priv)
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
if (!is_ap_interface(drv->nlmode))
return -1;
wpa_driver_nl80211_del_beacon(drv);
bss->beacon_set = 0;
return 0;
}
static int wpa_driver_nl80211_deinit_p2p_cli(void *priv)
{
struct i802_bss *bss = priv;
@ -9913,6 +9925,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.poll_client = nl80211_poll_client,
.set_p2p_powersave = nl80211_set_p2p_powersave,
.start_dfs_cac = nl80211_start_radar_detection,
.stop_ap = wpa_driver_nl80211_stop_ap,
#ifdef CONFIG_TDLS
.send_tdls_mgmt = nl80211_send_tdls_mgmt,
.tdls_oper = nl80211_tdls_oper,