summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_v.c
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2016-01-16 09:40:14 +0100
committerAntonio Quartulli <a@unstable.cc>2016-02-29 09:05:32 +0100
commit0b5ecc6811bd576ecc9813bbe069f2293cb1c6aa (patch)
treea75d24c012f6c6ca6ae5fa8904a4eee4e7ed0f98 /net/batman-adv/bat_v.c
parentbatman-adv: OGMv2 - implement originators logic (diff)
downloadlinux-0b5ecc6811bd576ecc9813bbe069f2293cb1c6aa.tar.xz
linux-0b5ecc6811bd576ecc9813bbe069f2293cb1c6aa.zip
batman-adv: add throughput override attribute to hard_ifaces
This attribute is exported to user space to disable the link throughput auto-detection by setting a fixed value. The throughput override value is used when batman-adv is computing the link throughput towards a neighbour. If the value is set to 0 then batman-adv will try to detect the throughput by itself. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/bat_v.c')
-rw-r--r--net/batman-adv/bat_v.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index b90a4dfe8ba6..d9cb5c4922c1 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -18,6 +18,7 @@
#include "bat_algo.h"
#include "main.h"
+#include <linux/atomic.h>
#include <linux/cache.h>
#include <linux/init.h>
@@ -37,6 +38,11 @@ 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;
}