Browse Source

mesh: Make beacon interval configurable

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Masashi Honma 10 years ago
parent
commit
9c58c5f72c
3 changed files with 12 additions and 0 deletions
  1. 1 0
      src/drivers/driver.h
  2. 7 0
      src/drivers/driver_nl80211.c
  3. 4 0
      wpa_supplicant/mesh.c

+ 1 - 0
src/drivers/driver.h

@@ -952,6 +952,7 @@ struct wpa_driver_mesh_join_params {
 	const u8 *ies;
 	int ie_len;
 	int freq;
+	int beacon_int;
 	enum ht_mode ht_mode;
 	struct wpa_driver_mesh_bss_params conf;
 #define WPA_DRIVER_MESH_FLAG_USER_MPM	0x00000001

+ 7 - 0
src/drivers/driver_nl80211.c

@@ -7761,6 +7761,13 @@ wpa_driver_nl80211_join_mesh(void *priv,
 			goto fail;
 	}
 
+	if (params->beacon_int > 0) {
+		wpa_printf(MSG_DEBUG, "  * beacon_int=%d", params->beacon_int);
+		if (nla_put_u32(msg, NL80211_ATTR_BEACON_INTERVAL,
+				params->beacon_int))
+			goto fail;
+	}
+
 	wpa_printf(MSG_DEBUG, "  * flags=%08X", params->flags);
 
 	container = nla_nest_start(msg, NL80211_ATTR_MESH_SETUP);

+ 4 - 0
wpa_supplicant/mesh.c

@@ -319,6 +319,10 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
 	params.meshid = ssid->ssid;
 	params.meshid_len = ssid->ssid_len;
 	params.freq = ssid->frequency;
+	if (ssid->beacon_int > 0)
+		params.beacon_int = ssid->beacon_int;
+	else if (wpa_s->conf->beacon_int > 0)
+		params.beacon_int = wpa_s->conf->beacon_int;
 #ifdef CONFIG_IEEE80211N
 	params.ht_mode = ssid->mesh_ht_mode;
 #endif /* CONFIG_IEEE80211N */