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

Commit 0507e159 authored by Javier Cardona's avatar Javier Cardona Committed by John W. Linville
Browse files

{nl,cfg,mac}80211: let userspace set RANN interval



Allow userspace to set Root Announcement Interval for our mesh
interface. Also, RANN interval is now in proper units of TUs.

Signed-off-by: default avatarJavier Cardona <javier@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 699403db
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1861,6 +1861,9 @@ enum nl80211_mntr_flags {
 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
 * source mesh point for path selection elements.
 *
 * @NL80211_MESHCONF_HWMP_RANN_INTERVAL:  The interval of time (in TUs) between
 * root announcements are transmitted.
 *
 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
 *
 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
@@ -1882,6 +1885,7 @@ enum nl80211_meshconf_params {
	NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
	NL80211_MESHCONF_HWMP_ROOTMODE,
	NL80211_MESHCONF_ELEMENT_TTL,
	NL80211_MESHCONF_HWMP_RANN_INTERVAL,

	/* keep last */
	__NL80211_MESHCONF_ATTR_AFTER_LAST,
+1 −0
Original line number Diff line number Diff line
@@ -755,6 +755,7 @@ struct mesh_config {
	u16 dot11MeshHWMPpreqMinInterval;
	u16 dot11MeshHWMPnetDiameterTraversalTime;
	u8  dot11MeshHWMPRootMode;
	u16 dot11MeshHWMPRannInterval;
};

/**
+4 −0
Original line number Diff line number Diff line
@@ -1137,6 +1137,10 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
		conf->dot11MeshHWMPRootMode = nconf->dot11MeshHWMPRootMode;
		ieee80211_mesh_root_setup(ifmsh);
	}
	if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_RANN_INTERVAL, mask)) {
		conf->dot11MeshHWMPRannInterval =
			nconf->dot11MeshHWMPRannInterval;
	}
	return 0;
}

+3 −0
Original line number Diff line number Diff line
@@ -372,6 +372,8 @@ IEEE80211_IF_FILE(min_discovery_timeout,
		u.mesh.mshcfg.min_discovery_timeout, DEC);
IEEE80211_IF_FILE(dot11MeshHWMPRootMode,
		u.mesh.mshcfg.dot11MeshHWMPRootMode, DEC);
IEEE80211_IF_FILE(dot11MeshHWMPRannInterval,
		u.mesh.mshcfg.dot11MeshHWMPRannInterval, DEC);
#endif


@@ -486,6 +488,7 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata)
	MESHPARAMS_ADD(path_refresh_time);
	MESHPARAMS_ADD(min_discovery_timeout);
	MESHPARAMS_ADD(dot11MeshHWMPRootMode);
	MESHPARAMS_ADD(dot11MeshHWMPRannInterval);
#undef MESHPARAMS_ADD
}
#endif
+2 −1
Original line number Diff line number Diff line
@@ -537,7 +537,8 @@ static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata)

	mesh_path_tx_root_frame(sdata);
	mod_timer(&ifmsh->mesh_path_root_timer,
		  round_jiffies(jiffies + IEEE80211_MESH_RANN_INTERVAL));
		  round_jiffies(jiffies +
			  usecs_to_jiffies(ifmsh->mshcfg.dot11MeshHWMPRannInterval * 1024)));
}

#ifdef CONFIG_PM
Loading