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 6b6c0ef..a92de56 100644 (file)
@@ -448,6 +448,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
         * Request (including information element id and length). Use
index 87c9661..9b9e66c 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 46195b1..555210b 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;