]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Configure beacon interval for IBSS command
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 6 Mar 2014 21:09:20 +0000 (23:09 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 6 Mar 2014 21:09:20 +0000 (23:09 +0200)
wpa_supplicant already allowed beacon interval to be configured for AP
mode operations, but this was not passed to the driver for IBSS even
though the same parameter can used for that case. Add this for the
nl80211 driver interface to allow beacon interval to be controlled for
IBSS as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver.h
src/drivers/driver_nl80211.c
wpa_supplicant/wpa_supplicant.c

index 6b6c0efe43f3682c152ad55f875a3e35566b7db1..a92de5604ceb3cf37e854777daa2ccd342660179 100644 (file)
@@ -447,6 +447,11 @@ struct wpa_driver_associate_params {
         */
        int bg_scan_period;
 
+       /**
+        * beacon_int - Beacon interval for IBSS or 0 to use driver default
+        */
+       int beacon_int;
+
        /**
         * wpa_ie - WPA information element for (Re)Association Request
         * WPA information element to be included in (Re)Association
index 87c9661de640195ecfa5477c7ded029347444885..9b9e66cfe6b7359fd4d05fbe5a4bd5fd95e0eebd 100644 (file)
@@ -8377,6 +8377,12 @@ retry:
        wpa_printf(MSG_DEBUG, "  * freq=%d", params->freq);
        NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
 
+       if (params->beacon_int > 0) {
+               wpa_printf(MSG_DEBUG, "  * beacon_int=%d", params->beacon_int);
+               NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL,
+                           params->beacon_int);
+       }
+
        ret = nl80211_set_conn_keys(params, msg);
        if (ret)
                goto nla_put_failure;
index 46195b158546c81e620238d44454633e193a9c35..555210bc6f2e9ca8f86d731578740232ad105684 100644 (file)
@@ -1714,6 +1714,14 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
        if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 &&
            params.freq == 0)
                params.freq = ssid->frequency; /* Initial channel for IBSS */
+
+       if (ssid->mode == WPAS_MODE_IBSS) {
+               if (ssid->beacon_int)
+                       params.beacon_int = ssid->beacon_int;
+               else
+                       params.beacon_int = wpa_s->conf->beacon_int;
+       }
+
        params.wpa_ie = wpa_ie;
        params.wpa_ie_len = wpa_ie_len;
        params.pairwise_suite = cipher_pairwise;