From 476e6bb68d29953dd1a6db9af4118cabec4642b1 Mon Sep 17 00:00:00 2001 From: Thomas Pedersen Date: Mon, 1 Sep 2014 00:23:26 -0400 Subject: [PATCH] mesh: Add mesh mode config option Modify network mode to support mode number 5 when CONFIG_MESH is enabled. Signed-off-by: Javier Lopez Signed-off-by: Jason Mobarak Signed-off-by: Thomas Pedersen --- src/drivers/driver.h | 1 + wpa_supplicant/config.c | 4 ++++ wpa_supplicant/config_ssid.h | 3 +++ wpa_supplicant/events.c | 3 ++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index f534b0801..081db0d0d 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -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 diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 99c518756..f6ec4a1e2 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -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) }, diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h index f50b2d41d..82fa2c5cb 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -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; /** diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index fff4eb4e7..6761c1a8b 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -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; } }