summaryrefslogtreecommitdiff
path: root/net/batman-adv/bat_v.c
diff options
context:
space:
mode:
authorLinus Luessing <linus.luessing@web.de>2016-01-16 11:40:10 +0300
committerAntonio Quartulli <a@unstable.cc>2016-02-29 11:05:30 +0300
commit162bd64c24aba8efe68948e95e61628403106cd7 (patch)
treefba0b614a5be99bcc6c6bce9c041dac1dd9a7193 /net/batman-adv/bat_v.c
parentd6f94d91f766b4205e5b0aa4b11f96271c793f6d (diff)
downloadlinux-162bd64c24aba8efe68948e95e61628403106cd7.tar.xz
batman-adv: ELP - creating neighbor structures
Initially developed by Linus during a 6 months trainee study period in Ascom (Switzerland) AG. Signed-off-by: Linus Luessing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Diffstat (limited to 'net/batman-adv/bat_v.c')
-rw-r--r--net/batman-adv/bat_v.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 01327f627a08..0fea894855ff 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -22,6 +22,7 @@
#include <linux/init.h>
#include "bat_v_elp.h"
+#include "packet.h"
static int batadv_v_iface_enable(struct batadv_hard_iface *hard_iface)
{
@@ -42,6 +43,12 @@ static void batadv_v_primary_iface_set(struct batadv_hard_iface *hard_iface)
batadv_v_elp_primary_iface_set(hard_iface);
}
+static void
+batadv_v_hardif_neigh_init(struct batadv_hardif_neigh_node *hardif_neigh)
+{
+ ewma_throughput_init(&hardif_neigh->bat_v.throughput);
+}
+
static void batadv_v_ogm_schedule(struct batadv_hard_iface *hard_iface)
{
}
@@ -56,6 +63,7 @@ static struct batadv_algo_ops batadv_batman_v __read_mostly = {
.bat_iface_disable = batadv_v_iface_disable,
.bat_iface_update_mac = batadv_v_iface_update_mac,
.bat_primary_iface_set = batadv_v_primary_iface_set,
+ .bat_hardif_neigh_init = batadv_v_hardif_neigh_init,
.bat_ogm_emit = batadv_v_ogm_emit,
.bat_ogm_schedule = batadv_v_ogm_schedule,
};
@@ -70,5 +78,18 @@ static struct batadv_algo_ops batadv_batman_v __read_mostly = {
*/
int __init batadv_v_init(void)
{
- return batadv_algo_register(&batadv_batman_v);
+ int ret;
+
+ /* B.A.T.M.A.N. V echo location protocol packet */
+ ret = batadv_recv_handler_register(BATADV_ELP,
+ batadv_v_elp_packet_recv);
+ if (ret < 0)
+ return ret;
+
+ ret = batadv_algo_register(&batadv_batman_v);
+
+ if (ret < 0)
+ batadv_recv_handler_unregister(BATADV_ELP);
+
+ return ret;
}