aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/main.c')
-rw-r--r--net/batman-adv/main.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 0a7cee0076f4..b0f9068ade57 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -58,9 +58,8 @@ static int __init batman_init(void)
58 58
59 register_netdevice_notifier(&hard_if_notifier); 59 register_netdevice_notifier(&hard_if_notifier);
60 60
61 pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) " 61 pr_info("B.A.T.M.A.N. advanced %s (compatibility version %i) "
62 "loaded\n", SOURCE_VERSION, REVISION_VERSION_STR, 62 "loaded\n", SOURCE_VERSION, COMPAT_VERSION);
63 COMPAT_VERSION);
64 63
65 return 0; 64 return 0;
66} 65}
@@ -84,8 +83,10 @@ int mesh_init(struct net_device *soft_iface)
84 83
85 spin_lock_init(&bat_priv->forw_bat_list_lock); 84 spin_lock_init(&bat_priv->forw_bat_list_lock);
86 spin_lock_init(&bat_priv->forw_bcast_list_lock); 85 spin_lock_init(&bat_priv->forw_bcast_list_lock);
87 spin_lock_init(&bat_priv->tt_lhash_lock); 86 spin_lock_init(&bat_priv->tt_changes_list_lock);
88 spin_lock_init(&bat_priv->tt_ghash_lock); 87 spin_lock_init(&bat_priv->tt_req_list_lock);
88 spin_lock_init(&bat_priv->tt_roam_list_lock);
89 spin_lock_init(&bat_priv->tt_buff_lock);
89 spin_lock_init(&bat_priv->gw_list_lock); 90 spin_lock_init(&bat_priv->gw_list_lock);
90 spin_lock_init(&bat_priv->vis_hash_lock); 91 spin_lock_init(&bat_priv->vis_hash_lock);
91 spin_lock_init(&bat_priv->vis_list_lock); 92 spin_lock_init(&bat_priv->vis_list_lock);
@@ -96,14 +97,14 @@ int mesh_init(struct net_device *soft_iface)
96 INIT_HLIST_HEAD(&bat_priv->forw_bcast_list); 97 INIT_HLIST_HEAD(&bat_priv->forw_bcast_list);
97 INIT_HLIST_HEAD(&bat_priv->gw_list); 98 INIT_HLIST_HEAD(&bat_priv->gw_list);
98 INIT_HLIST_HEAD(&bat_priv->softif_neigh_vids); 99 INIT_HLIST_HEAD(&bat_priv->softif_neigh_vids);
100 INIT_LIST_HEAD(&bat_priv->tt_changes_list);
101 INIT_LIST_HEAD(&bat_priv->tt_req_list);
102 INIT_LIST_HEAD(&bat_priv->tt_roam_list);
99 103
100 if (originator_init(bat_priv) < 1) 104 if (originator_init(bat_priv) < 1)
101 goto err; 105 goto err;
102 106
103 if (tt_local_init(bat_priv) < 1) 107 if (tt_init(bat_priv) < 1)
104 goto err;
105
106 if (tt_global_init(bat_priv) < 1)
107 goto err; 108 goto err;
108 109
109 tt_local_add(soft_iface, soft_iface->dev_addr); 110 tt_local_add(soft_iface, soft_iface->dev_addr);
@@ -111,6 +112,7 @@ int mesh_init(struct net_device *soft_iface)
111 if (vis_init(bat_priv) < 1) 112 if (vis_init(bat_priv) < 1)
112 goto err; 113 goto err;
113 114
115 atomic_set(&bat_priv->gw_reselect, 0);
114 atomic_set(&bat_priv->mesh_state, MESH_ACTIVE); 116 atomic_set(&bat_priv->mesh_state, MESH_ACTIVE);
115 goto end; 117 goto end;
116 118
@@ -137,8 +139,7 @@ void mesh_free(struct net_device *soft_iface)
137 gw_node_purge(bat_priv); 139 gw_node_purge(bat_priv);
138 originator_free(bat_priv); 140 originator_free(bat_priv);
139 141
140 tt_local_free(bat_priv); 142 tt_free(bat_priv);
141 tt_global_free(bat_priv);
142 143
143 softif_neigh_purge(bat_priv); 144 softif_neigh_purge(bat_priv);
144 145
@@ -155,9 +156,9 @@ void dec_module_count(void)
155 module_put(THIS_MODULE); 156 module_put(THIS_MODULE);
156} 157}
157 158
158int is_my_mac(uint8_t *addr) 159int is_my_mac(const uint8_t *addr)
159{ 160{
160 struct hard_iface *hard_iface; 161 const struct hard_iface *hard_iface;
161 162
162 rcu_read_lock(); 163 rcu_read_lock();
163 list_for_each_entry_rcu(hard_iface, &hardif_list, list) { 164 list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
@@ -182,8 +183,4 @@ MODULE_LICENSE("GPL");
182MODULE_AUTHOR(DRIVER_AUTHOR); 183MODULE_AUTHOR(DRIVER_AUTHOR);
183MODULE_DESCRIPTION(DRIVER_DESC); 184MODULE_DESCRIPTION(DRIVER_DESC);
184MODULE_SUPPORTED_DEVICE(DRIVER_DEVICE); 185MODULE_SUPPORTED_DEVICE(DRIVER_DEVICE);
185#ifdef REVISION_VERSION
186MODULE_VERSION(SOURCE_VERSION "-" REVISION_VERSION);
187#else
188MODULE_VERSION(SOURCE_VERSION); 186MODULE_VERSION(SOURCE_VERSION);
189#endif