diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 167268c08..59102a466 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -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); }; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index e5fb23ff0..d66d2e36a 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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,