Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9bdbf04d authored by Marco Porsch's avatar Marco Porsch Committed by Johannes Berg
Browse files

{cfg,nl,mac}80211: set beacon interval and DTIM period on mesh join



Move the default mesh beacon interval and DTIM period to cfg80211
and make them accessible to nl80211. This enables setting both
values when joining an MBSS.

Previously the DTIM parameter was not set by mac80211 so the
driver's default value was used.

Signed-off-by: default avatarMarco Porsch <marco@cozybit.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent eac70c13
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1036,6 +1036,8 @@ struct mesh_config {
 * @ie_len: length of vendor information elements
 * @is_authenticated: this mesh requires authentication
 * @is_secure: this mesh uses security
 * @dtim_period: DTIM period to use
 * @beacon_interval: beacon interval to use
 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
 *
 * These parameters are fixed when the mesh is created.
@@ -1051,6 +1053,8 @@ struct mesh_setup {
	u8 ie_len;
	bool is_authenticated;
	bool is_secure;
	u8 dtim_period;
	u16 beacon_interval;
	int mcast_rate[IEEE80211_NUM_BANDS];
};

+3 −0
Original line number Diff line number Diff line
@@ -1666,6 +1666,9 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
	memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate,
						sizeof(setup->mcast_rate));

	sdata->vif.bss_conf.beacon_int = setup->beacon_interval;
	sdata->vif.bss_conf.dtim_period = setup->dtim_period;

	return 0;
}

+0 −1
Original line number Diff line number Diff line
@@ -625,7 +625,6 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
	ieee80211_queue_work(&local->hw, &sdata->work);
	sdata->vif.bss_conf.ht_operation_mode =
				ifmsh->mshcfg.ht_opmode;
	sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL;
	sdata->vif.bss_conf.enable_beacon = true;
	sdata->vif.bss_conf.basic_rates =
		ieee80211_mandatory_rates(local, band);
+0 −2
Original line number Diff line number Diff line
@@ -191,8 +191,6 @@ struct mesh_rmc {
#define IEEE80211_MESH_PEER_INACTIVITY_LIMIT (1800 * HZ)
#define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ)

#define MESH_DEFAULT_BEACON_INTERVAL		1000 	/* in 1024 us units */

#define MESH_PATH_EXPIRE (600 * HZ)

/* Default maximum number of plinks per interface */
+5 −0
Original line number Diff line number Diff line
@@ -44,6 +44,9 @@

#define MESH_SYNC_NEIGHBOR_OFFSET_MAX 50

#define MESH_DEFAULT_BEACON_INTERVAL	1000	/* in 1024 us units (=TUs) */
#define MESH_DEFAULT_DTIM_PERIOD	2

const struct mesh_config default_mesh_config = {
	.dot11MeshRetryTimeout = MESH_RET_T,
	.dot11MeshConfirmTimeout = MESH_CONF_T,
@@ -79,6 +82,8 @@ const struct mesh_setup default_mesh_setup = {
	.ie = NULL,
	.ie_len = 0,
	.is_secure = false,
	.beacon_interval = MESH_DEFAULT_BEACON_INTERVAL,
	.dtim_period = MESH_DEFAULT_DTIM_PERIOD,
};

int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
Loading