summaryrefslogtreecommitdiff
path: root/net/batman-adv/bat_v.c
diff options
context:
space:
mode:
authorMarek Lindner <mareklindner@neomailbox.ch>2016-05-10 17:31:59 +0300
committerSimon Wunderlich <sw@simonwunderlich.de>2016-06-30 11:29:43 +0300
commit7db682d1c39b2198a9c9d0bee5812d9c4329123d (patch)
tree14f9eef1514bf90cdfdc6f95c92ec5c7fd4afd8c /net/batman-adv/bat_v.c
parent3a24a63e74af1bffc7aeb5d83adcd63b37e38425 (diff)
downloadlinux-7db682d1c39b2198a9c9d0bee5812d9c4329123d.tar.xz
batman-adv: init ELP tweaking options only once
The ELP interval and throughput override interface settings are initialized with default settings on every time an interface is added to a mesh. This patch prevents this behavior by moving the configuration init to the interface detection routine which runs only once per interface. Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> [a@unstable.cc: move initialization to batadv_v_hardif_init] Signed-off-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/bat_v.c')
-rw-r--r--net/batman-adv/bat_v.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index c16cd44a3b4c..c2fea812fb48 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -70,11 +70,6 @@ static int batadv_v_iface_enable(struct batadv_hard_iface *hard_iface)
if (ret < 0)
batadv_v_elp_iface_disable(hard_iface);
- /* enable link throughput auto-detection by setting the throughput
- * override to zero
- */
- atomic_set(&hard_iface->bat_v.throughput_override, 0);
-
return ret;
}
@@ -339,6 +334,20 @@ static struct batadv_algo_ops batadv_batman_v __read_mostly = {
};
/**
+ * batadv_v_hardif_init - initialize the algorithm specific fields in the
+ * hard-interface object
+ * @hard_iface: the hard-interface to initialize
+ */
+void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface)
+{
+ /* enable link throughput auto-detection by setting the throughput
+ * override to zero
+ */
+ atomic_set(&hard_iface->bat_v.throughput_override, 0);
+ atomic_set(&hard_iface->bat_v.elp_interval, 500);
+}
+
+/**
* batadv_v_mesh_init - initialize the B.A.T.M.A.N. V private resources for a
* mesh
* @bat_priv: the object representing the mesh interface to initialise