]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
IBSS: Add fixed_freq network parameter
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Thu, 19 Feb 2015 06:15:45 +0000 (07:15 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 21 Feb 2015 14:07:53 +0000 (16:07 +0200)
Add fixed_freq=<0/1> network block parameter and pass it to the driver
when starting or joining an IBSS. If this flag is set, IBSS should not
try to look for other IBSS networks to merge with on different channels.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
src/drivers/driver.h
src/drivers/driver_nl80211.c
wpa_supplicant/config.c
wpa_supplicant/config_file.c
wpa_supplicant/config_ssid.h
wpa_supplicant/wpa_supplicant.c

index b1d896c02ddc561af5c0070c484dbd87feaf6374..9daae88d736c8e423008c18e087326b8a580f616 100644 (file)
@@ -766,6 +766,14 @@ struct wpa_driver_associate_params {
         */
        int fixed_bssid;
 
+       /**
+        * fixed_freq - Fix control channel in IBSS mode
+        * 0 = don't fix control channel (default)
+        * 1 = fix control channel; this prevents IBSS merging with another
+        *      channel
+        */
+       int fixed_freq;
+
        /**
         * disable_ht - Disable HT (IEEE 802.11n) for this connection
         */
index 82990481288d11ddff548b008842cf0386aa4b94..ee6d069472acdb5bd81926170453149b867a4ff2 100644 (file)
@@ -4378,6 +4378,12 @@ retry:
                        goto fail;
        }
 
+       if (params->fixed_freq) {
+               wpa_printf(MSG_DEBUG, "  * fixed_freq");
+               if (nla_put_flag(msg, NL80211_ATTR_FREQ_FIXED))
+                       goto fail;
+       }
+
        if (params->key_mgmt_suite == WPA_KEY_MGMT_IEEE8021X ||
            params->key_mgmt_suite == WPA_KEY_MGMT_PSK ||
            params->key_mgmt_suite == WPA_KEY_MGMT_IEEE8021X_SHA256 ||
index 6c67f9f2ed7879e459f6acc962a970ed67c85f1c..30d9342f2334a506bc5535d0180398674229c47d 100644 (file)
@@ -1896,6 +1896,7 @@ static const struct parse_data ssid_fields[] = {
        { INT_RANGE(peerkey, 0, 1) },
        { INT_RANGE(mixed_cell, 0, 1) },
        { INT_RANGE(frequency, 0, 65000) },
+       { INT_RANGE(fixed_freq, 0, 1) },
 #ifdef CONFIG_MESH
        { FUNC(mesh_basic_rates) },
        { INT(dot11MeshMaxRetries) },
index ecc57372ad67d34794ed839c6b91c4bc33ec925d..c749e21fcac3439f9e8842e0966629ceb24ecfbe 100644 (file)
@@ -736,6 +736,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
 #endif /* IEEE8021X_EAPOL */
        INT(mode);
        INT(frequency);
+       INT(fixed_freq);
        write_int(f, "proactive_key_caching", ssid->proactive_key_caching, -1);
        INT(disabled);
        INT(peerkey);
index f744895a3a6c389ba20035c6e52ec3a8f7df5d90..7c826cfd983f817682648a7f4a875087c18e6124 100644 (file)
@@ -419,6 +419,11 @@ struct wpa_ssid {
         */
        int frequency;
 
+       /**
+        * fixed_freq - Use fixed frequency for IBSS
+        */
+       int fixed_freq;
+
        /**
         * mesh_basic_rates - BSS Basic rate set for mesh network
         *
index 5f67e55df54bc60082d7546cb9882e4e9ac0b72f..2a0bf399510df35d8df51d82be499dc4f3b5054d 100644 (file)
@@ -2122,6 +2122,7 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
                ibss_mesh_setup_freq(wpa_s, ssid, &params.freq);
 
        if (ssid->mode == WPAS_MODE_IBSS) {
+               params.fixed_freq = ssid->fixed_freq;
                if (ssid->beacon_int)
                        params.beacon_int = ssid->beacon_int;
                else