diff options
-rw-r--r-- | net/batman-adv/bat_algo.h | 7 | ||||
-rw-r--r-- | net/batman-adv/bat_v.c | 19 | ||||
-rw-r--r-- | net/batman-adv/bat_v_elp.c | 1 | ||||
-rw-r--r-- | net/batman-adv/hard-interface.c | 3 |
4 files changed, 23 insertions, 7 deletions
diff --git a/net/batman-adv/bat_algo.h b/net/batman-adv/bat_algo.h index 03dafd33d23b..36542962de7d 100644 --- a/net/batman-adv/bat_algo.h +++ b/net/batman-adv/bat_algo.h | |||
@@ -18,13 +18,14 @@ | |||
18 | #ifndef _NET_BATMAN_ADV_BAT_ALGO_H_ | 18 | #ifndef _NET_BATMAN_ADV_BAT_ALGO_H_ |
19 | #define _NET_BATMAN_ADV_BAT_ALGO_H_ | 19 | #define _NET_BATMAN_ADV_BAT_ALGO_H_ |
20 | 20 | ||
21 | struct batadv_priv; | 21 | #include "main.h" |
22 | 22 | ||
23 | int batadv_iv_init(void); | 23 | int batadv_iv_init(void); |
24 | 24 | ||
25 | #ifdef CONFIG_BATMAN_ADV_BATMAN_V | 25 | #ifdef CONFIG_BATMAN_ADV_BATMAN_V |
26 | 26 | ||
27 | int batadv_v_init(void); | 27 | int batadv_v_init(void); |
28 | void batadv_v_hardif_init(struct batadv_hard_iface *hardif); | ||
28 | int batadv_v_mesh_init(struct batadv_priv *bat_priv); | 29 | int batadv_v_mesh_init(struct batadv_priv *bat_priv); |
29 | void batadv_v_mesh_free(struct batadv_priv *bat_priv); | 30 | void batadv_v_mesh_free(struct batadv_priv *bat_priv); |
30 | 31 | ||
@@ -35,6 +36,10 @@ static inline int batadv_v_init(void) | |||
35 | return 0; | 36 | return 0; |
36 | } | 37 | } |
37 | 38 | ||
39 | static inline void batadv_v_hardif_init(struct batadv_hard_iface *hardif) | ||
40 | { | ||
41 | } | ||
42 | |||
38 | static inline int batadv_v_mesh_init(struct batadv_priv *bat_priv) | 43 | static inline int batadv_v_mesh_init(struct batadv_priv *bat_priv) |
39 | { | 44 | { |
40 | return 0; | 45 | return 0; |
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) | |||
70 | if (ret < 0) | 70 | if (ret < 0) |
71 | batadv_v_elp_iface_disable(hard_iface); | 71 | batadv_v_elp_iface_disable(hard_iface); |
72 | 72 | ||
73 | /* enable link throughput auto-detection by setting the throughput | ||
74 | * override to zero | ||
75 | */ | ||
76 | atomic_set(&hard_iface->bat_v.throughput_override, 0); | ||
77 | |||
78 | return ret; | 73 | return ret; |
79 | } | 74 | } |
80 | 75 | ||
@@ -339,6 +334,20 @@ static struct batadv_algo_ops batadv_batman_v __read_mostly = { | |||
339 | }; | 334 | }; |
340 | 335 | ||
341 | /** | 336 | /** |
337 | * batadv_v_hardif_init - initialize the algorithm specific fields in the | ||
338 | * hard-interface object | ||
339 | * @hard_iface: the hard-interface to initialize | ||
340 | */ | ||
341 | void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface) | ||
342 | { | ||
343 | /* enable link throughput auto-detection by setting the throughput | ||
344 | * override to zero | ||
345 | */ | ||
346 | atomic_set(&hard_iface->bat_v.throughput_override, 0); | ||
347 | atomic_set(&hard_iface->bat_v.elp_interval, 500); | ||
348 | } | ||
349 | |||
350 | /** | ||
342 | * batadv_v_mesh_init - initialize the B.A.T.M.A.N. V private resources for a | 351 | * batadv_v_mesh_init - initialize the B.A.T.M.A.N. V private resources for a |
343 | * mesh | 352 | * mesh |
344 | * @bat_priv: the object representing the mesh interface to initialise | 353 | * @bat_priv: the object representing the mesh interface to initialise |
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c index 8909d1eb9622..cf0262becd08 100644 --- a/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c | |||
@@ -344,7 +344,6 @@ int batadv_v_elp_iface_enable(struct batadv_hard_iface *hard_iface) | |||
344 | /* randomize initial seqno to avoid collision */ | 344 | /* randomize initial seqno to avoid collision */ |
345 | get_random_bytes(&random_seqno, sizeof(random_seqno)); | 345 | get_random_bytes(&random_seqno, sizeof(random_seqno)); |
346 | atomic_set(&hard_iface->bat_v.elp_seqno, random_seqno); | 346 | atomic_set(&hard_iface->bat_v.elp_seqno, random_seqno); |
347 | atomic_set(&hard_iface->bat_v.elp_interval, 500); | ||
348 | 347 | ||
349 | /* assume full-duplex by default */ | 348 | /* assume full-duplex by default */ |
350 | hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX; | 349 | hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX; |
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index db2009d84a25..3696929e5692 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
38 | #include <linux/workqueue.h> | 38 | #include <linux/workqueue.h> |
39 | 39 | ||
40 | #include "bat_algo.h" | ||
40 | #include "bridge_loop_avoidance.h" | 41 | #include "bridge_loop_avoidance.h" |
41 | #include "debugfs.h" | 42 | #include "debugfs.h" |
42 | #include "distributed-arp-table.h" | 43 | #include "distributed-arp-table.h" |
@@ -683,6 +684,8 @@ batadv_hardif_add_interface(struct net_device *net_dev) | |||
683 | if (batadv_is_wifi_netdev(net_dev)) | 684 | if (batadv_is_wifi_netdev(net_dev)) |
684 | hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS; | 685 | hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS; |
685 | 686 | ||
687 | batadv_v_hardif_init(hard_iface); | ||
688 | |||
686 | /* extra reference for return */ | 689 | /* extra reference for return */ |
687 | kref_init(&hard_iface->refcount); | 690 | kref_init(&hard_iface->refcount); |
688 | kref_get(&hard_iface->refcount); | 691 | kref_get(&hard_iface->refcount); |