From 0b5ecc6811bd576ecc9813bbe069f2293cb1c6aa Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Sat, 16 Jan 2016 16:40:14 +0800 Subject: 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 Signed-off-by: Marek Lindner --- net/batman-adv/bat_v.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'net/batman-adv/bat_v.c') 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 #include #include @@ -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; } -- cgit v1.2.3