mesh: Add mesh mode config option
authorThomas Pedersen <thomas@noack.us>
Mon, 1 Sep 2014 04:23:26 +0000 (00:23 -0400)
committerJouni Malinen <j@w1.fi>
Sat, 25 Oct 2014 14:45:35 +0000 (17:45 +0300)
Modify network mode to support mode number 5 when CONFIG_MESH is
enabled.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Thomas Pedersen <thomas@noack.us>
src/drivers/driver.h
wpa_supplicant/config.c
wpa_supplicant/config_ssid.h
wpa_supplicant/events.c

index f534b08..081db0d 100644 (file)
@@ -170,6 +170,7 @@ struct hostapd_hw_modes {
 #define IEEE80211_MODE_INFRA   0
 #define IEEE80211_MODE_IBSS    1
 #define IEEE80211_MODE_AP      2
+#define IEEE80211_MODE_MESH    5
 
 #define IEEE80211_CAP_ESS      0x0001
 #define IEEE80211_CAP_IBSS     0x0002
index 99c5187..f6ec4a1 100644 (file)
@@ -1730,7 +1730,11 @@ static const struct parse_data ssid_fields[] = {
        { INTe(fragment_size) },
        { INTe(ocsp) },
 #endif /* IEEE8021X_EAPOL */
+#ifdef CONFIG_MESH
+       { INT_RANGE(mode, 0, 5) },
+#else /* CONFIG_MESH */
        { INT_RANGE(mode, 0, 4) },
+#endif /* CONFIG_MESH */
        { INT_RANGE(proactive_key_caching, 0, 1) },
        { INT_RANGE(disabled, 0, 2) },
        { STR(id_str) },
index f50b2d4..82fa2c5 100644 (file)
@@ -317,6 +317,8 @@ struct wpa_ssid {
         * 4 = P2P Group Formation (used internally; not in configuration
         * files)
         *
+        * 5 = Mesh
+        *
         * Note: IBSS can only be used with key_mgmt NONE (plaintext and static
         * WEP) and WPA-PSK (with proto=RSN). In addition, key_mgmt=WPA-NONE
         * (fixed group key TKIP/CCMP) is available for backwards compatibility,
@@ -331,6 +333,7 @@ struct wpa_ssid {
                WPAS_MODE_AP = 2,
                WPAS_MODE_P2P_GO = 3,
                WPAS_MODE_P2P_GROUP_FORMATION = 4,
+               WPAS_MODE_MESH = 5,
        } mode;
 
        /**
index fff4eb4..6761c1a 100644 (file)
@@ -1102,7 +1102,8 @@ wpa_supplicant_pick_new_network(struct wpa_supplicant *wpa_s)
                        if (wpas_network_disabled(wpa_s, ssid))
                                continue;
                        if (ssid->mode == IEEE80211_MODE_IBSS ||
-                           ssid->mode == IEEE80211_MODE_AP)
+                           ssid->mode == IEEE80211_MODE_AP ||
+                           ssid->mode == IEEE80211_MODE_MESH)
                                return ssid;
                }
        }