]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add driver_ops for stopping AP beaconing
authorSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Thu, 9 May 2013 17:06:33 +0000 (20:06 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 9 May 2013 17:06:33 +0000 (20:06 +0300)
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>

src/drivers/driver.h
src/drivers/driver_nl80211.c

index 167268c080d90599dc70da37ca4d9577b0346dcc..59102a466c1c79446742364446109b0e4711b2aa 100644 (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);
 };
 
 
index e5fb23ff0ee1b404e2b1779c2a9a25b45bdb2d68..d66d2e36a579bc1bd7523a497b2385a7817be3b9 100644 (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,