diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-06-05 16:31:31 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-07-01 16:47:21 -0400 |
commit | 56303d34a332be8e2f4daf7891ebc12cb7900529 (patch) | |
tree | bc972916771e698bd8a88fd66917950ce0bd48c1 /net/batman-adv | |
parent | 96412690116afcc1b2705615b5a7c8dc6c5e905f (diff) |
batman-adv: Prefix types structs with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv')
31 files changed, 1029 insertions, 938 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c index bd618e4df865..db7b9bf895aa 100644 --- a/net/batman-adv/bat_debugfs.c +++ b/net/batman-adv/bat_debugfs.c | |||
@@ -40,7 +40,7 @@ static struct dentry *batadv_debugfs; | |||
40 | 40 | ||
41 | static int batadv_log_buff_len = BATADV_LOG_BUF_LEN; | 41 | static int batadv_log_buff_len = BATADV_LOG_BUF_LEN; |
42 | 42 | ||
43 | static void batadv_emit_log_char(struct debug_log *debug_log, char c) | 43 | static void batadv_emit_log_char(struct batadv_debug_log *debug_log, char c) |
44 | { | 44 | { |
45 | BATADV_LOG_BUFF(debug_log->log_end) = c; | 45 | BATADV_LOG_BUFF(debug_log->log_end) = c; |
46 | debug_log->log_end++; | 46 | debug_log->log_end++; |
@@ -50,7 +50,8 @@ static void batadv_emit_log_char(struct debug_log *debug_log, char c) | |||
50 | } | 50 | } |
51 | 51 | ||
52 | __printf(2, 3) | 52 | __printf(2, 3) |
53 | static int batadv_fdebug_log(struct debug_log *debug_log, const char *fmt, ...) | 53 | static int batadv_fdebug_log(struct batadv_debug_log *debug_log, |
54 | const char *fmt, ...) | ||
54 | { | 55 | { |
55 | va_list args; | 56 | va_list args; |
56 | static char debug_log_buf[256]; | 57 | static char debug_log_buf[256]; |
@@ -74,7 +75,7 @@ static int batadv_fdebug_log(struct debug_log *debug_log, const char *fmt, ...) | |||
74 | return 0; | 75 | return 0; |
75 | } | 76 | } |
76 | 77 | ||
77 | int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...) | 78 | int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...) |
78 | { | 79 | { |
79 | va_list args; | 80 | va_list args; |
80 | char tmp_log_buf[256]; | 81 | char tmp_log_buf[256]; |
@@ -105,8 +106,8 @@ static int batadv_log_release(struct inode *inode, struct file *file) | |||
105 | static ssize_t batadv_log_read(struct file *file, char __user *buf, | 106 | static ssize_t batadv_log_read(struct file *file, char __user *buf, |
106 | size_t count, loff_t *ppos) | 107 | size_t count, loff_t *ppos) |
107 | { | 108 | { |
108 | struct bat_priv *bat_priv = file->private_data; | 109 | struct batadv_priv *bat_priv = file->private_data; |
109 | struct debug_log *debug_log = bat_priv->debug_log; | 110 | struct batadv_debug_log *debug_log = bat_priv->debug_log; |
110 | int error, i = 0; | 111 | int error, i = 0; |
111 | char c; | 112 | char c; |
112 | 113 | ||
@@ -158,8 +159,8 @@ static ssize_t batadv_log_read(struct file *file, char __user *buf, | |||
158 | 159 | ||
159 | static unsigned int batadv_log_poll(struct file *file, poll_table *wait) | 160 | static unsigned int batadv_log_poll(struct file *file, poll_table *wait) |
160 | { | 161 | { |
161 | struct bat_priv *bat_priv = file->private_data; | 162 | struct batadv_priv *bat_priv = file->private_data; |
162 | struct debug_log *debug_log = bat_priv->debug_log; | 163 | struct batadv_debug_log *debug_log = bat_priv->debug_log; |
163 | 164 | ||
164 | poll_wait(file, &debug_log->queue_wait, wait); | 165 | poll_wait(file, &debug_log->queue_wait, wait); |
165 | 166 | ||
@@ -177,7 +178,7 @@ static const struct file_operations batadv_log_fops = { | |||
177 | .llseek = no_llseek, | 178 | .llseek = no_llseek, |
178 | }; | 179 | }; |
179 | 180 | ||
180 | static int batadv_debug_log_setup(struct bat_priv *bat_priv) | 181 | static int batadv_debug_log_setup(struct batadv_priv *bat_priv) |
181 | { | 182 | { |
182 | struct dentry *d; | 183 | struct dentry *d; |
183 | 184 | ||
@@ -203,19 +204,19 @@ err: | |||
203 | return -ENOMEM; | 204 | return -ENOMEM; |
204 | } | 205 | } |
205 | 206 | ||
206 | static void batadv_debug_log_cleanup(struct bat_priv *bat_priv) | 207 | static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv) |
207 | { | 208 | { |
208 | kfree(bat_priv->debug_log); | 209 | kfree(bat_priv->debug_log); |
209 | bat_priv->debug_log = NULL; | 210 | bat_priv->debug_log = NULL; |
210 | } | 211 | } |
211 | #else /* CONFIG_BATMAN_ADV_DEBUG */ | 212 | #else /* CONFIG_BATMAN_ADV_DEBUG */ |
212 | static int batadv_debug_log_setup(struct bat_priv *bat_priv) | 213 | static int batadv_debug_log_setup(struct batadv_priv *bat_priv) |
213 | { | 214 | { |
214 | bat_priv->debug_log = NULL; | 215 | bat_priv->debug_log = NULL; |
215 | return 0; | 216 | return 0; |
216 | } | 217 | } |
217 | 218 | ||
218 | static void batadv_debug_log_cleanup(struct bat_priv *bat_priv) | 219 | static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv) |
219 | { | 220 | { |
220 | return; | 221 | return; |
221 | } | 222 | } |
@@ -339,7 +340,7 @@ void batadv_debugfs_destroy(void) | |||
339 | 340 | ||
340 | int batadv_debugfs_add_meshif(struct net_device *dev) | 341 | int batadv_debugfs_add_meshif(struct net_device *dev) |
341 | { | 342 | { |
342 | struct bat_priv *bat_priv = netdev_priv(dev); | 343 | struct batadv_priv *bat_priv = netdev_priv(dev); |
343 | struct batadv_debuginfo **bat_debug; | 344 | struct batadv_debuginfo **bat_debug; |
344 | struct dentry *file; | 345 | struct dentry *file; |
345 | 346 | ||
@@ -382,7 +383,7 @@ out: | |||
382 | 383 | ||
383 | void batadv_debugfs_del_meshif(struct net_device *dev) | 384 | void batadv_debugfs_del_meshif(struct net_device *dev) |
384 | { | 385 | { |
385 | struct bat_priv *bat_priv = netdev_priv(dev); | 386 | struct batadv_priv *bat_priv = netdev_priv(dev); |
386 | 387 | ||
387 | batadv_debug_log_cleanup(bat_priv); | 388 | batadv_debug_log_cleanup(bat_priv); |
388 | 389 | ||
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index a2bafd9e4fb7..e877af8bdd1e 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c | |||
@@ -28,13 +28,13 @@ | |||
28 | #include "send.h" | 28 | #include "send.h" |
29 | #include "bat_algo.h" | 29 | #include "bat_algo.h" |
30 | 30 | ||
31 | static struct neigh_node *batadv_iv_ogm_neigh_new(struct hard_iface *hard_iface, | 31 | static struct batadv_neigh_node * |
32 | const uint8_t *neigh_addr, | 32 | batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface, |
33 | struct orig_node *orig_node, | 33 | const uint8_t *neigh_addr, |
34 | struct orig_node *orig_neigh, | 34 | struct batadv_orig_node *orig_node, |
35 | __be32 seqno) | 35 | struct batadv_orig_node *orig_neigh, __be32 seqno) |
36 | { | 36 | { |
37 | struct neigh_node *neigh_node; | 37 | struct batadv_neigh_node *neigh_node; |
38 | 38 | ||
39 | neigh_node = batadv_neigh_node_new(hard_iface, neigh_addr, | 39 | neigh_node = batadv_neigh_node_new(hard_iface, neigh_addr, |
40 | ntohl(seqno)); | 40 | ntohl(seqno)); |
@@ -54,7 +54,7 @@ out: | |||
54 | return neigh_node; | 54 | return neigh_node; |
55 | } | 55 | } |
56 | 56 | ||
57 | static int batadv_iv_ogm_iface_enable(struct hard_iface *hard_iface) | 57 | static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface) |
58 | { | 58 | { |
59 | struct batadv_ogm_packet *batadv_ogm_packet; | 59 | struct batadv_ogm_packet *batadv_ogm_packet; |
60 | uint32_t random_seqno; | 60 | uint32_t random_seqno; |
@@ -85,13 +85,13 @@ out: | |||
85 | return res; | 85 | return res; |
86 | } | 86 | } |
87 | 87 | ||
88 | static void batadv_iv_ogm_iface_disable(struct hard_iface *hard_iface) | 88 | static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface) |
89 | { | 89 | { |
90 | kfree(hard_iface->packet_buff); | 90 | kfree(hard_iface->packet_buff); |
91 | hard_iface->packet_buff = NULL; | 91 | hard_iface->packet_buff = NULL; |
92 | } | 92 | } |
93 | 93 | ||
94 | static void batadv_iv_ogm_iface_update_mac(struct hard_iface *hard_iface) | 94 | static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface) |
95 | { | 95 | { |
96 | struct batadv_ogm_packet *batadv_ogm_packet; | 96 | struct batadv_ogm_packet *batadv_ogm_packet; |
97 | 97 | ||
@@ -102,7 +102,8 @@ static void batadv_iv_ogm_iface_update_mac(struct hard_iface *hard_iface) | |||
102 | hard_iface->net_dev->dev_addr, ETH_ALEN); | 102 | hard_iface->net_dev->dev_addr, ETH_ALEN); |
103 | } | 103 | } |
104 | 104 | ||
105 | static void batadv_iv_ogm_primary_iface_set(struct hard_iface *hard_iface) | 105 | static void |
106 | batadv_iv_ogm_primary_iface_set(struct batadv_hard_iface *hard_iface) | ||
106 | { | 107 | { |
107 | struct batadv_ogm_packet *batadv_ogm_packet; | 108 | struct batadv_ogm_packet *batadv_ogm_packet; |
108 | 109 | ||
@@ -113,7 +114,7 @@ static void batadv_iv_ogm_primary_iface_set(struct hard_iface *hard_iface) | |||
113 | 114 | ||
114 | /* when do we schedule our own ogm to be sent */ | 115 | /* when do we schedule our own ogm to be sent */ |
115 | static unsigned long | 116 | static unsigned long |
116 | batadv_iv_ogm_emit_send_time(const struct bat_priv *bat_priv) | 117 | batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv) |
117 | { | 118 | { |
118 | unsigned int msecs; | 119 | unsigned int msecs; |
119 | 120 | ||
@@ -130,7 +131,8 @@ static unsigned long batadv_iv_ogm_fwd_send_time(void) | |||
130 | } | 131 | } |
131 | 132 | ||
132 | /* apply hop penalty for a normal link */ | 133 | /* apply hop penalty for a normal link */ |
133 | static uint8_t batadv_hop_penalty(uint8_t tq, const struct bat_priv *bat_priv) | 134 | static uint8_t batadv_hop_penalty(uint8_t tq, |
135 | const struct batadv_priv *bat_priv) | ||
134 | { | 136 | { |
135 | int hop_penalty = atomic_read(&bat_priv->hop_penalty); | 137 | int hop_penalty = atomic_read(&bat_priv->hop_penalty); |
136 | int new_tq; | 138 | int new_tq; |
@@ -155,10 +157,10 @@ static int batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len, | |||
155 | } | 157 | } |
156 | 158 | ||
157 | /* send a batman ogm to a given interface */ | 159 | /* send a batman ogm to a given interface */ |
158 | static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet, | 160 | static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet, |
159 | struct hard_iface *hard_iface) | 161 | struct batadv_hard_iface *hard_iface) |
160 | { | 162 | { |
161 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 163 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
162 | char *fwd_str; | 164 | char *fwd_str; |
163 | uint8_t packet_num; | 165 | uint8_t packet_num; |
164 | int16_t buff_pos; | 166 | int16_t buff_pos; |
@@ -217,12 +219,12 @@ static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet, | |||
217 | } | 219 | } |
218 | 220 | ||
219 | /* send a batman ogm packet */ | 221 | /* send a batman ogm packet */ |
220 | static void batadv_iv_ogm_emit(struct forw_packet *forw_packet) | 222 | static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet) |
221 | { | 223 | { |
222 | struct hard_iface *hard_iface; | 224 | struct batadv_hard_iface *hard_iface; |
223 | struct net_device *soft_iface; | 225 | struct net_device *soft_iface; |
224 | struct bat_priv *bat_priv; | 226 | struct batadv_priv *bat_priv; |
225 | struct hard_iface *primary_if = NULL; | 227 | struct batadv_hard_iface *primary_if = NULL; |
226 | struct batadv_ogm_packet *batadv_ogm_packet; | 228 | struct batadv_ogm_packet *batadv_ogm_packet; |
227 | unsigned char directlink; | 229 | unsigned char directlink; |
228 | 230 | ||
@@ -288,15 +290,15 @@ out: | |||
288 | /* return true if new_packet can be aggregated with forw_packet */ | 290 | /* return true if new_packet can be aggregated with forw_packet */ |
289 | static bool | 291 | static bool |
290 | batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet, | 292 | batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet, |
291 | struct bat_priv *bat_priv, | 293 | struct batadv_priv *bat_priv, |
292 | int packet_len, unsigned long send_time, | 294 | int packet_len, unsigned long send_time, |
293 | bool directlink, | 295 | bool directlink, |
294 | const struct hard_iface *if_incoming, | 296 | const struct batadv_hard_iface *if_incoming, |
295 | const struct forw_packet *forw_packet) | 297 | const struct batadv_forw_packet *forw_packet) |
296 | { | 298 | { |
297 | struct batadv_ogm_packet *batadv_ogm_packet; | 299 | struct batadv_ogm_packet *batadv_ogm_packet; |
298 | int aggregated_bytes = forw_packet->packet_len + packet_len; | 300 | int aggregated_bytes = forw_packet->packet_len + packet_len; |
299 | struct hard_iface *primary_if = NULL; | 301 | struct batadv_hard_iface *primary_if = NULL; |
300 | bool res = false; | 302 | bool res = false; |
301 | unsigned long aggregation_end_time; | 303 | unsigned long aggregation_end_time; |
302 | 304 | ||
@@ -371,11 +373,11 @@ out: | |||
371 | static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff, | 373 | static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff, |
372 | int packet_len, unsigned long send_time, | 374 | int packet_len, unsigned long send_time, |
373 | bool direct_link, | 375 | bool direct_link, |
374 | struct hard_iface *if_incoming, | 376 | struct batadv_hard_iface *if_incoming, |
375 | int own_packet) | 377 | int own_packet) |
376 | { | 378 | { |
377 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 379 | struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
378 | struct forw_packet *forw_packet_aggr; | 380 | struct batadv_forw_packet *forw_packet_aggr; |
379 | unsigned char *skb_buff; | 381 | unsigned char *skb_buff; |
380 | unsigned int skb_size; | 382 | unsigned int skb_size; |
381 | 383 | ||
@@ -447,7 +449,7 @@ out: | |||
447 | } | 449 | } |
448 | 450 | ||
449 | /* aggregate a new packet into the existing ogm packet */ | 451 | /* aggregate a new packet into the existing ogm packet */ |
450 | static void batadv_iv_ogm_aggregate(struct forw_packet *forw_packet_aggr, | 452 | static void batadv_iv_ogm_aggregate(struct batadv_forw_packet *forw_packet_aggr, |
451 | const unsigned char *packet_buff, | 453 | const unsigned char *packet_buff, |
452 | int packet_len, bool direct_link) | 454 | int packet_len, bool direct_link) |
453 | { | 455 | { |
@@ -464,16 +466,17 @@ static void batadv_iv_ogm_aggregate(struct forw_packet *forw_packet_aggr, | |||
464 | (1 << forw_packet_aggr->num_packets); | 466 | (1 << forw_packet_aggr->num_packets); |
465 | } | 467 | } |
466 | 468 | ||
467 | static void batadv_iv_ogm_queue_add(struct bat_priv *bat_priv, | 469 | static void batadv_iv_ogm_queue_add(struct batadv_priv *bat_priv, |
468 | unsigned char *packet_buff, | 470 | unsigned char *packet_buff, |
469 | int packet_len, | 471 | int packet_len, |
470 | struct hard_iface *if_incoming, | 472 | struct batadv_hard_iface *if_incoming, |
471 | int own_packet, unsigned long send_time) | 473 | int own_packet, unsigned long send_time) |
472 | { | 474 | { |
473 | /* _aggr -> pointer to the packet we want to aggregate with | 475 | /* _aggr -> pointer to the packet we want to aggregate with |
474 | * _pos -> pointer to the position in the queue | 476 | * _pos -> pointer to the position in the queue |
475 | */ | 477 | */ |
476 | struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL; | 478 | struct batadv_forw_packet *forw_packet_aggr = NULL; |
479 | struct batadv_forw_packet *forw_packet_pos = NULL; | ||
477 | struct hlist_node *tmp_node; | 480 | struct hlist_node *tmp_node; |
478 | struct batadv_ogm_packet *batadv_ogm_packet; | 481 | struct batadv_ogm_packet *batadv_ogm_packet; |
479 | bool direct_link; | 482 | bool direct_link; |
@@ -524,14 +527,14 @@ static void batadv_iv_ogm_queue_add(struct bat_priv *bat_priv, | |||
524 | } | 527 | } |
525 | } | 528 | } |
526 | 529 | ||
527 | static void batadv_iv_ogm_forward(struct orig_node *orig_node, | 530 | static void batadv_iv_ogm_forward(struct batadv_orig_node *orig_node, |
528 | const struct ethhdr *ethhdr, | 531 | const struct ethhdr *ethhdr, |
529 | struct batadv_ogm_packet *batadv_ogm_packet, | 532 | struct batadv_ogm_packet *batadv_ogm_packet, |
530 | bool is_single_hop_neigh, | 533 | bool is_single_hop_neigh, |
531 | bool is_from_best_next_hop, | 534 | bool is_from_best_next_hop, |
532 | struct hard_iface *if_incoming) | 535 | struct batadv_hard_iface *if_incoming) |
533 | { | 536 | { |
534 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 537 | struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
535 | uint8_t tt_num_changes; | 538 | uint8_t tt_num_changes; |
536 | 539 | ||
537 | if (batadv_ogm_packet->header.ttl <= 1) { | 540 | if (batadv_ogm_packet->header.ttl <= 1) { |
@@ -577,11 +580,11 @@ static void batadv_iv_ogm_forward(struct orig_node *orig_node, | |||
577 | if_incoming, 0, batadv_iv_ogm_fwd_send_time()); | 580 | if_incoming, 0, batadv_iv_ogm_fwd_send_time()); |
578 | } | 581 | } |
579 | 582 | ||
580 | static void batadv_iv_ogm_schedule(struct hard_iface *hard_iface) | 583 | static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface) |
581 | { | 584 | { |
582 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 585 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
583 | struct batadv_ogm_packet *batadv_ogm_packet; | 586 | struct batadv_ogm_packet *batadv_ogm_packet; |
584 | struct hard_iface *primary_if; | 587 | struct batadv_hard_iface *primary_if; |
585 | int vis_server, tt_num_changes = 0; | 588 | int vis_server, tt_num_changes = 0; |
586 | 589 | ||
587 | vis_server = atomic_read(&bat_priv->vis_mode); | 590 | vis_server = atomic_read(&bat_priv->vis_mode); |
@@ -627,17 +630,17 @@ static void batadv_iv_ogm_schedule(struct hard_iface *hard_iface) | |||
627 | } | 630 | } |
628 | 631 | ||
629 | static void | 632 | static void |
630 | batadv_iv_ogm_orig_update(struct bat_priv *bat_priv, | 633 | batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, |
631 | struct orig_node *orig_node, | 634 | struct batadv_orig_node *orig_node, |
632 | const struct ethhdr *ethhdr, | 635 | const struct ethhdr *ethhdr, |
633 | const struct batadv_ogm_packet *batadv_ogm_packet, | 636 | const struct batadv_ogm_packet *batadv_ogm_packet, |
634 | struct hard_iface *if_incoming, | 637 | struct batadv_hard_iface *if_incoming, |
635 | const unsigned char *tt_buff, | 638 | const unsigned char *tt_buff, |
636 | int is_duplicate) | 639 | int is_duplicate) |
637 | { | 640 | { |
638 | struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; | 641 | struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; |
639 | struct neigh_node *router = NULL; | 642 | struct batadv_neigh_node *router = NULL; |
640 | struct orig_node *orig_node_tmp; | 643 | struct batadv_orig_node *orig_node_tmp; |
641 | struct hlist_node *node; | 644 | struct hlist_node *node; |
642 | uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; | 645 | uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; |
643 | uint8_t *neigh_addr; | 646 | uint8_t *neigh_addr; |
@@ -670,7 +673,7 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv, | |||
670 | } | 673 | } |
671 | 674 | ||
672 | if (!neigh_node) { | 675 | if (!neigh_node) { |
673 | struct orig_node *orig_tmp; | 676 | struct batadv_orig_node *orig_tmp; |
674 | 677 | ||
675 | orig_tmp = batadv_get_orig_node(bat_priv, ethhdr->h_source); | 678 | orig_tmp = batadv_get_orig_node(bat_priv, ethhdr->h_source); |
676 | if (!orig_tmp) | 679 | if (!orig_tmp) |
@@ -775,13 +778,13 @@ out: | |||
775 | batadv_neigh_node_free_ref(router); | 778 | batadv_neigh_node_free_ref(router); |
776 | } | 779 | } |
777 | 780 | ||
778 | static int batadv_iv_ogm_calc_tq(struct orig_node *orig_node, | 781 | static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node, |
779 | struct orig_node *orig_neigh_node, | 782 | struct batadv_orig_node *orig_neigh_node, |
780 | struct batadv_ogm_packet *batadv_ogm_packet, | 783 | struct batadv_ogm_packet *batadv_ogm_packet, |
781 | struct hard_iface *if_incoming) | 784 | struct batadv_hard_iface *if_incoming) |
782 | { | 785 | { |
783 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 786 | struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
784 | struct neigh_node *neigh_node = NULL, *tmp_neigh_node; | 787 | struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node; |
785 | struct hlist_node *node; | 788 | struct hlist_node *node; |
786 | uint8_t total_count; | 789 | uint8_t total_count; |
787 | uint8_t orig_eq_count, neigh_rq_count, neigh_rq_inv, tq_own; | 790 | uint8_t orig_eq_count, neigh_rq_count, neigh_rq_inv, tq_own; |
@@ -895,11 +898,11 @@ out: | |||
895 | static int | 898 | static int |
896 | batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, | 899 | batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, |
897 | const struct batadv_ogm_packet *batadv_ogm_packet, | 900 | const struct batadv_ogm_packet *batadv_ogm_packet, |
898 | const struct hard_iface *if_incoming) | 901 | const struct batadv_hard_iface *if_incoming) |
899 | { | 902 | { |
900 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 903 | struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
901 | struct orig_node *orig_node; | 904 | struct batadv_orig_node *orig_node; |
902 | struct neigh_node *tmp_neigh_node; | 905 | struct batadv_neigh_node *tmp_neigh_node; |
903 | struct hlist_node *node; | 906 | struct hlist_node *node; |
904 | int is_duplicate = 0; | 907 | int is_duplicate = 0; |
905 | int32_t seq_diff; | 908 | int32_t seq_diff; |
@@ -965,13 +968,13 @@ out: | |||
965 | static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, | 968 | static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, |
966 | struct batadv_ogm_packet *batadv_ogm_packet, | 969 | struct batadv_ogm_packet *batadv_ogm_packet, |
967 | const unsigned char *tt_buff, | 970 | const unsigned char *tt_buff, |
968 | struct hard_iface *if_incoming) | 971 | struct batadv_hard_iface *if_incoming) |
969 | { | 972 | { |
970 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 973 | struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
971 | struct hard_iface *hard_iface; | 974 | struct batadv_hard_iface *hard_iface; |
972 | struct orig_node *orig_neigh_node, *orig_node; | 975 | struct batadv_orig_node *orig_neigh_node, *orig_node; |
973 | struct neigh_node *router = NULL, *router_router = NULL; | 976 | struct batadv_neigh_node *router = NULL, *router_router = NULL; |
974 | struct neigh_node *orig_neigh_router = NULL; | 977 | struct batadv_neigh_node *orig_neigh_router = NULL; |
975 | int has_directlink_flag; | 978 | int has_directlink_flag; |
976 | int is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0; | 979 | int is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0; |
977 | int is_broadcast = 0, is_bidirect; | 980 | int is_broadcast = 0, is_bidirect; |
@@ -1240,9 +1243,9 @@ out: | |||
1240 | } | 1243 | } |
1241 | 1244 | ||
1242 | static int batadv_iv_ogm_receive(struct sk_buff *skb, | 1245 | static int batadv_iv_ogm_receive(struct sk_buff *skb, |
1243 | struct hard_iface *if_incoming) | 1246 | struct batadv_hard_iface *if_incoming) |
1244 | { | 1247 | { |
1245 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 1248 | struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
1246 | struct batadv_ogm_packet *batadv_ogm_packet; | 1249 | struct batadv_ogm_packet *batadv_ogm_packet; |
1247 | struct ethhdr *ethhdr; | 1250 | struct ethhdr *ethhdr; |
1248 | int buff_pos = 0, packet_len; | 1251 | int buff_pos = 0, packet_len; |
@@ -1287,7 +1290,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb, | |||
1287 | return NET_RX_SUCCESS; | 1290 | return NET_RX_SUCCESS; |
1288 | } | 1291 | } |
1289 | 1292 | ||
1290 | static struct bat_algo_ops batadv_batman_iv __read_mostly = { | 1293 | static struct batadv_algo_ops batadv_batman_iv __read_mostly = { |
1291 | .name = "BATMAN_IV", | 1294 | .name = "BATMAN_IV", |
1292 | .bat_iface_enable = batadv_iv_ogm_iface_enable, | 1295 | .bat_iface_enable = batadv_iv_ogm_iface_enable, |
1293 | .bat_iface_disable = batadv_iv_ogm_iface_disable, | 1296 | .bat_iface_disable = batadv_iv_ogm_iface_disable, |
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c index eb17629a78bc..a0a9ea43157c 100644 --- a/net/batman-adv/bat_sysfs.c +++ b/net/batman-adv/bat_sysfs.c | |||
@@ -32,7 +32,7 @@ static struct net_device *batadv_kobj_to_netdev(struct kobject *obj) | |||
32 | return to_net_dev(dev); | 32 | return to_net_dev(dev); |
33 | } | 33 | } |
34 | 34 | ||
35 | static struct bat_priv *batadv_kobj_to_batpriv(struct kobject *obj) | 35 | static struct batadv_priv *batadv_kobj_to_batpriv(struct kobject *obj) |
36 | { | 36 | { |
37 | struct net_device *net_dev = batadv_kobj_to_netdev(obj); | 37 | struct net_device *net_dev = batadv_kobj_to_netdev(obj); |
38 | return netdev_priv(net_dev); | 38 | return netdev_priv(net_dev); |
@@ -67,7 +67,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ | |||
67 | size_t count) \ | 67 | size_t count) \ |
68 | { \ | 68 | { \ |
69 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ | 69 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ |
70 | struct bat_priv *bat_priv = netdev_priv(net_dev); \ | 70 | struct batadv_priv *bat_priv = netdev_priv(net_dev); \ |
71 | return __batadv_store_bool_attr(buff, count, _post_func, attr, \ | 71 | return __batadv_store_bool_attr(buff, count, _post_func, attr, \ |
72 | &bat_priv->_name, net_dev); \ | 72 | &bat_priv->_name, net_dev); \ |
73 | } | 73 | } |
@@ -76,7 +76,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ | |||
76 | ssize_t batadv_show_##_name(struct kobject *kobj, \ | 76 | ssize_t batadv_show_##_name(struct kobject *kobj, \ |
77 | struct attribute *attr, char *buff) \ | 77 | struct attribute *attr, char *buff) \ |
78 | { \ | 78 | { \ |
79 | struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ | 79 | struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ |
80 | return sprintf(buff, "%s\n", \ | 80 | return sprintf(buff, "%s\n", \ |
81 | atomic_read(&bat_priv->_name) == 0 ? \ | 81 | atomic_read(&bat_priv->_name) == 0 ? \ |
82 | "disabled" : "enabled"); \ | 82 | "disabled" : "enabled"); \ |
@@ -98,7 +98,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ | |||
98 | size_t count) \ | 98 | size_t count) \ |
99 | { \ | 99 | { \ |
100 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ | 100 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ |
101 | struct bat_priv *bat_priv = netdev_priv(net_dev); \ | 101 | struct batadv_priv *bat_priv = netdev_priv(net_dev); \ |
102 | return __batadv_store_uint_attr(buff, count, _min, _max, \ | 102 | return __batadv_store_uint_attr(buff, count, _min, _max, \ |
103 | _post_func, attr, \ | 103 | _post_func, attr, \ |
104 | &bat_priv->_name, net_dev); \ | 104 | &bat_priv->_name, net_dev); \ |
@@ -108,7 +108,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ | |||
108 | ssize_t batadv_show_##_name(struct kobject *kobj, \ | 108 | ssize_t batadv_show_##_name(struct kobject *kobj, \ |
109 | struct attribute *attr, char *buff) \ | 109 | struct attribute *attr, char *buff) \ |
110 | { \ | 110 | { \ |
111 | struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ | 111 | struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ |
112 | return sprintf(buff, "%i\n", atomic_read(&bat_priv->_name)); \ | 112 | return sprintf(buff, "%i\n", atomic_read(&bat_priv->_name)); \ |
113 | } \ | 113 | } \ |
114 | 114 | ||
@@ -128,7 +128,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ | |||
128 | size_t count) \ | 128 | size_t count) \ |
129 | { \ | 129 | { \ |
130 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ | 130 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ |
131 | struct hard_iface *hard_iface; \ | 131 | struct batadv_hard_iface *hard_iface; \ |
132 | ssize_t length; \ | 132 | ssize_t length; \ |
133 | \ | 133 | \ |
134 | hard_iface = batadv_hardif_get_by_netdev(net_dev); \ | 134 | hard_iface = batadv_hardif_get_by_netdev(net_dev); \ |
@@ -148,7 +148,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \ | |||
148 | struct attribute *attr, char *buff) \ | 148 | struct attribute *attr, char *buff) \ |
149 | { \ | 149 | { \ |
150 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ | 150 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ |
151 | struct hard_iface *hard_iface; \ | 151 | struct batadv_hard_iface *hard_iface; \ |
152 | ssize_t length; \ | 152 | ssize_t length; \ |
153 | \ | 153 | \ |
154 | hard_iface = batadv_hardif_get_by_netdev(net_dev); \ | 154 | hard_iface = batadv_hardif_get_by_netdev(net_dev); \ |
@@ -281,7 +281,7 @@ __batadv_store_uint_attr(const char *buff, size_t count, | |||
281 | static ssize_t batadv_show_vis_mode(struct kobject *kobj, | 281 | static ssize_t batadv_show_vis_mode(struct kobject *kobj, |
282 | struct attribute *attr, char *buff) | 282 | struct attribute *attr, char *buff) |
283 | { | 283 | { |
284 | struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); | 284 | struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); |
285 | int vis_mode = atomic_read(&bat_priv->vis_mode); | 285 | int vis_mode = atomic_read(&bat_priv->vis_mode); |
286 | const char *mode; | 286 | const char *mode; |
287 | 287 | ||
@@ -298,7 +298,7 @@ static ssize_t batadv_store_vis_mode(struct kobject *kobj, | |||
298 | size_t count) | 298 | size_t count) |
299 | { | 299 | { |
300 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); | 300 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); |
301 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 301 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
302 | unsigned long val; | 302 | unsigned long val; |
303 | int ret, vis_mode_tmp = -1; | 303 | int ret, vis_mode_tmp = -1; |
304 | const char *old_mode, *new_mode; | 304 | const char *old_mode, *new_mode; |
@@ -349,20 +349,20 @@ static ssize_t batadv_store_vis_mode(struct kobject *kobj, | |||
349 | static ssize_t batadv_show_bat_algo(struct kobject *kobj, | 349 | static ssize_t batadv_show_bat_algo(struct kobject *kobj, |
350 | struct attribute *attr, char *buff) | 350 | struct attribute *attr, char *buff) |
351 | { | 351 | { |
352 | struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); | 352 | struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); |
353 | return sprintf(buff, "%s\n", bat_priv->bat_algo_ops->name); | 353 | return sprintf(buff, "%s\n", bat_priv->bat_algo_ops->name); |
354 | } | 354 | } |
355 | 355 | ||
356 | static void batadv_post_gw_deselect(struct net_device *net_dev) | 356 | static void batadv_post_gw_deselect(struct net_device *net_dev) |
357 | { | 357 | { |
358 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 358 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
359 | batadv_gw_deselect(bat_priv); | 359 | batadv_gw_deselect(bat_priv); |
360 | } | 360 | } |
361 | 361 | ||
362 | static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr, | 362 | static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr, |
363 | char *buff) | 363 | char *buff) |
364 | { | 364 | { |
365 | struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); | 365 | struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); |
366 | int bytes_written; | 366 | int bytes_written; |
367 | 367 | ||
368 | switch (atomic_read(&bat_priv->gw_mode)) { | 368 | switch (atomic_read(&bat_priv->gw_mode)) { |
@@ -388,7 +388,7 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, | |||
388 | size_t count) | 388 | size_t count) |
389 | { | 389 | { |
390 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); | 390 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); |
391 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 391 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
392 | char *curr_gw_mode_str; | 392 | char *curr_gw_mode_str; |
393 | int gw_mode_tmp = -1; | 393 | int gw_mode_tmp = -1; |
394 | 394 | ||
@@ -440,7 +440,7 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, | |||
440 | static ssize_t batadv_show_gw_bwidth(struct kobject *kobj, | 440 | static ssize_t batadv_show_gw_bwidth(struct kobject *kobj, |
441 | struct attribute *attr, char *buff) | 441 | struct attribute *attr, char *buff) |
442 | { | 442 | { |
443 | struct bat_priv *bat_priv = batadv_kobj_to_batpriv(kobj); | 443 | struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); |
444 | int down, up; | 444 | int down, up; |
445 | int gw_bandwidth = atomic_read(&bat_priv->gw_bandwidth); | 445 | int gw_bandwidth = atomic_read(&bat_priv->gw_bandwidth); |
446 | 446 | ||
@@ -512,7 +512,7 @@ static struct batadv_attribute *batadv_mesh_attrs[] = { | |||
512 | int batadv_sysfs_add_meshif(struct net_device *dev) | 512 | int batadv_sysfs_add_meshif(struct net_device *dev) |
513 | { | 513 | { |
514 | struct kobject *batif_kobject = &dev->dev.kobj; | 514 | struct kobject *batif_kobject = &dev->dev.kobj; |
515 | struct bat_priv *bat_priv = netdev_priv(dev); | 515 | struct batadv_priv *bat_priv = netdev_priv(dev); |
516 | struct batadv_attribute **bat_attr; | 516 | struct batadv_attribute **bat_attr; |
517 | int err; | 517 | int err; |
518 | 518 | ||
@@ -549,7 +549,7 @@ out: | |||
549 | 549 | ||
550 | void batadv_sysfs_del_meshif(struct net_device *dev) | 550 | void batadv_sysfs_del_meshif(struct net_device *dev) |
551 | { | 551 | { |
552 | struct bat_priv *bat_priv = netdev_priv(dev); | 552 | struct batadv_priv *bat_priv = netdev_priv(dev); |
553 | struct batadv_attribute **bat_attr; | 553 | struct batadv_attribute **bat_attr; |
554 | 554 | ||
555 | for (bat_attr = batadv_mesh_attrs; *bat_attr; ++bat_attr) | 555 | for (bat_attr = batadv_mesh_attrs; *bat_attr; ++bat_attr) |
@@ -563,10 +563,11 @@ static ssize_t batadv_show_mesh_iface(struct kobject *kobj, | |||
563 | struct attribute *attr, char *buff) | 563 | struct attribute *attr, char *buff) |
564 | { | 564 | { |
565 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); | 565 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); |
566 | struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); | 566 | struct batadv_hard_iface *hard_iface; |
567 | ssize_t length; | 567 | ssize_t length; |
568 | const char *ifname; | 568 | const char *ifname; |
569 | 569 | ||
570 | hard_iface = batadv_hardif_get_by_netdev(net_dev); | ||
570 | if (!hard_iface) | 571 | if (!hard_iface) |
571 | return 0; | 572 | return 0; |
572 | 573 | ||
@@ -587,10 +588,11 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj, | |||
587 | size_t count) | 588 | size_t count) |
588 | { | 589 | { |
589 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); | 590 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); |
590 | struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); | 591 | struct batadv_hard_iface *hard_iface; |
591 | int status_tmp = -1; | 592 | int status_tmp = -1; |
592 | int ret = count; | 593 | int ret = count; |
593 | 594 | ||
595 | hard_iface = batadv_hardif_get_by_netdev(net_dev); | ||
594 | if (!hard_iface) | 596 | if (!hard_iface) |
595 | return count; | 597 | return count; |
596 | 598 | ||
@@ -643,9 +645,10 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj, | |||
643 | struct attribute *attr, char *buff) | 645 | struct attribute *attr, char *buff) |
644 | { | 646 | { |
645 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); | 647 | struct net_device *net_dev = batadv_kobj_to_netdev(kobj); |
646 | struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); | 648 | struct batadv_hard_iface *hard_iface; |
647 | ssize_t length; | 649 | ssize_t length; |
648 | 650 | ||
651 | hard_iface = batadv_hardif_get_by_netdev(net_dev); | ||
649 | if (!hard_iface) | 652 | if (!hard_iface) |
650 | return 0; | 653 | return 0; |
651 | 654 | ||
@@ -723,11 +726,11 @@ void batadv_sysfs_del_hardif(struct kobject **hardif_obj) | |||
723 | *hardif_obj = NULL; | 726 | *hardif_obj = NULL; |
724 | } | 727 | } |
725 | 728 | ||
726 | int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type, | 729 | int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, |
727 | enum batadv_uev_action action, const char *data) | 730 | enum batadv_uev_action action, const char *data) |
728 | { | 731 | { |
729 | int ret = -ENOMEM; | 732 | int ret = -ENOMEM; |
730 | struct hard_iface *primary_if = NULL; | 733 | struct batadv_hard_iface *primary_if = NULL; |
731 | struct kobject *bat_kobj; | 734 | struct kobject *bat_kobj; |
732 | char *uevent_env[4] = { NULL, NULL, NULL, NULL }; | 735 | char *uevent_env[4] = { NULL, NULL, NULL, NULL }; |
733 | 736 | ||
diff --git a/net/batman-adv/bat_sysfs.h b/net/batman-adv/bat_sysfs.h index 88f95f817c4d..3fd1412b0620 100644 --- a/net/batman-adv/bat_sysfs.h +++ b/net/batman-adv/bat_sysfs.h | |||
@@ -36,7 +36,7 @@ void batadv_sysfs_del_meshif(struct net_device *dev); | |||
36 | int batadv_sysfs_add_hardif(struct kobject **hardif_obj, | 36 | int batadv_sysfs_add_hardif(struct kobject **hardif_obj, |
37 | struct net_device *dev); | 37 | struct net_device *dev); |
38 | void batadv_sysfs_del_hardif(struct kobject **hardif_obj); | 38 | void batadv_sysfs_del_hardif(struct kobject **hardif_obj); |
39 | int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type, | 39 | int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, |
40 | enum batadv_uev_action action, const char *data); | 40 | enum batadv_uev_action action, const char *data); |
41 | 41 | ||
42 | #endif /* _NET_BATMAN_ADV_SYSFS_H_ */ | 42 | #endif /* _NET_BATMAN_ADV_SYSFS_H_ */ |
diff --git a/net/batman-adv/bitarray.c b/net/batman-adv/bitarray.c index 835d3b60a477..aea174cdbfbd 100644 --- a/net/batman-adv/bitarray.c +++ b/net/batman-adv/bitarray.c | |||
@@ -41,7 +41,7 @@ static void batadv_bitmap_shift_left(unsigned long *seq_bits, int32_t n) | |||
41 | int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, | 41 | int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, |
42 | int32_t seq_num_diff, int set_mark) | 42 | int32_t seq_num_diff, int set_mark) |
43 | { | 43 | { |
44 | struct bat_priv *bat_priv = priv; | 44 | struct batadv_priv *bat_priv = priv; |
45 | 45 | ||
46 | /* sequence number is slightly older. We already got a sequence number | 46 | /* sequence number is slightly older. We already got a sequence number |
47 | * higher than this one, so we just mark it. | 47 | * higher than this one, so we just mark it. |
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index fdda2c8d48fe..49e10d91c00b 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -34,8 +34,8 @@ | |||
34 | static const uint8_t batadv_announce_mac[4] = {0x43, 0x05, 0x43, 0x05}; | 34 | static const uint8_t batadv_announce_mac[4] = {0x43, 0x05, 0x43, 0x05}; |
35 | 35 | ||
36 | static void batadv_bla_periodic_work(struct work_struct *work); | 36 | static void batadv_bla_periodic_work(struct work_struct *work); |
37 | static void batadv_bla_send_announce(struct bat_priv *bat_priv, | 37 | static void batadv_bla_send_announce(struct batadv_priv *bat_priv, |
38 | struct backbone_gw *backbone_gw); | 38 | struct batadv_backbone_gw *backbone_gw); |
39 | 39 | ||
40 | /* return the index of the claim */ | 40 | /* return the index of the claim */ |
41 | static inline uint32_t batadv_choose_claim(const void *data, uint32_t size) | 41 | static inline uint32_t batadv_choose_claim(const void *data, uint32_t size) |
@@ -83,7 +83,7 @@ static inline uint32_t batadv_choose_backbone_gw(const void *data, | |||
83 | static int batadv_compare_backbone_gw(const struct hlist_node *node, | 83 | static int batadv_compare_backbone_gw(const struct hlist_node *node, |
84 | const void *data2) | 84 | const void *data2) |
85 | { | 85 | { |
86 | const void *data1 = container_of(node, struct backbone_gw, | 86 | const void *data1 = container_of(node, struct batadv_backbone_gw, |
87 | hash_entry); | 87 | hash_entry); |
88 | 88 | ||
89 | return (memcmp(data1, data2, ETH_ALEN + sizeof(short)) == 0 ? 1 : 0); | 89 | return (memcmp(data1, data2, ETH_ALEN + sizeof(short)) == 0 ? 1 : 0); |
@@ -93,14 +93,14 @@ static int batadv_compare_backbone_gw(const struct hlist_node *node, | |||
93 | static int batadv_compare_claim(const struct hlist_node *node, | 93 | static int batadv_compare_claim(const struct hlist_node *node, |
94 | const void *data2) | 94 | const void *data2) |
95 | { | 95 | { |
96 | const void *data1 = container_of(node, struct claim, | 96 | const void *data1 = container_of(node, struct batadv_claim, |
97 | hash_entry); | 97 | hash_entry); |
98 | 98 | ||
99 | return (memcmp(data1, data2, ETH_ALEN + sizeof(short)) == 0 ? 1 : 0); | 99 | return (memcmp(data1, data2, ETH_ALEN + sizeof(short)) == 0 ? 1 : 0); |
100 | } | 100 | } |
101 | 101 | ||
102 | /* free a backbone gw */ | 102 | /* free a backbone gw */ |
103 | static void batadv_backbone_gw_free_ref(struct backbone_gw *backbone_gw) | 103 | static void batadv_backbone_gw_free_ref(struct batadv_backbone_gw *backbone_gw) |
104 | { | 104 | { |
105 | if (atomic_dec_and_test(&backbone_gw->refcount)) | 105 | if (atomic_dec_and_test(&backbone_gw->refcount)) |
106 | kfree_rcu(backbone_gw, rcu); | 106 | kfree_rcu(backbone_gw, rcu); |
@@ -109,16 +109,16 @@ static void batadv_backbone_gw_free_ref(struct backbone_gw *backbone_gw) | |||
109 | /* finally deinitialize the claim */ | 109 | /* finally deinitialize the claim */ |
110 | static void batadv_claim_free_rcu(struct rcu_head *rcu) | 110 | static void batadv_claim_free_rcu(struct rcu_head *rcu) |
111 | { | 111 | { |
112 | struct claim *claim; | 112 | struct batadv_claim *claim; |
113 | 113 | ||
114 | claim = container_of(rcu, struct claim, rcu); | 114 | claim = container_of(rcu, struct batadv_claim, rcu); |
115 | 115 | ||
116 | batadv_backbone_gw_free_ref(claim->backbone_gw); | 116 | batadv_backbone_gw_free_ref(claim->backbone_gw); |
117 | kfree(claim); | 117 | kfree(claim); |
118 | } | 118 | } |
119 | 119 | ||
120 | /* free a claim, call claim_free_rcu if its the last reference */ | 120 | /* free a claim, call claim_free_rcu if its the last reference */ |
121 | static void batadv_claim_free_ref(struct claim *claim) | 121 | static void batadv_claim_free_ref(struct batadv_claim *claim) |
122 | { | 122 | { |
123 | if (atomic_dec_and_test(&claim->refcount)) | 123 | if (atomic_dec_and_test(&claim->refcount)) |
124 | call_rcu(&claim->rcu, batadv_claim_free_rcu); | 124 | call_rcu(&claim->rcu, batadv_claim_free_rcu); |
@@ -130,14 +130,14 @@ static void batadv_claim_free_ref(struct claim *claim) | |||
130 | * looks for a claim in the hash, and returns it if found | 130 | * looks for a claim in the hash, and returns it if found |
131 | * or NULL otherwise. | 131 | * or NULL otherwise. |
132 | */ | 132 | */ |
133 | static struct claim *batadv_claim_hash_find(struct bat_priv *bat_priv, | 133 | static struct batadv_claim *batadv_claim_hash_find(struct batadv_priv *bat_priv, |
134 | struct claim *data) | 134 | struct batadv_claim *data) |
135 | { | 135 | { |
136 | struct batadv_hashtable *hash = bat_priv->claim_hash; | 136 | struct batadv_hashtable *hash = bat_priv->claim_hash; |
137 | struct hlist_head *head; | 137 | struct hlist_head *head; |
138 | struct hlist_node *node; | 138 | struct hlist_node *node; |
139 | struct claim *claim; | 139 | struct batadv_claim *claim; |
140 | struct claim *claim_tmp = NULL; | 140 | struct batadv_claim *claim_tmp = NULL; |
141 | int index; | 141 | int index; |
142 | 142 | ||
143 | if (!hash) | 143 | if (!hash) |
@@ -169,14 +169,15 @@ static struct claim *batadv_claim_hash_find(struct bat_priv *bat_priv, | |||
169 | * looks for a claim in the hash, and returns it if found | 169 | * looks for a claim in the hash, and returns it if found |
170 | * or NULL otherwise. | 170 | * or NULL otherwise. |
171 | */ | 171 | */ |
172 | static struct backbone_gw *batadv_backbone_hash_find(struct bat_priv *bat_priv, | 172 | static struct batadv_backbone_gw * |
173 | uint8_t *addr, short vid) | 173 | batadv_backbone_hash_find(struct batadv_priv *bat_priv, |
174 | uint8_t *addr, short vid) | ||
174 | { | 175 | { |
175 | struct batadv_hashtable *hash = bat_priv->backbone_hash; | 176 | struct batadv_hashtable *hash = bat_priv->backbone_hash; |
176 | struct hlist_head *head; | 177 | struct hlist_head *head; |
177 | struct hlist_node *node; | 178 | struct hlist_node *node; |
178 | struct backbone_gw search_entry, *backbone_gw; | 179 | struct batadv_backbone_gw search_entry, *backbone_gw; |
179 | struct backbone_gw *backbone_gw_tmp = NULL; | 180 | struct batadv_backbone_gw *backbone_gw_tmp = NULL; |
180 | int index; | 181 | int index; |
181 | 182 | ||
182 | if (!hash) | 183 | if (!hash) |
@@ -206,12 +207,13 @@ static struct backbone_gw *batadv_backbone_hash_find(struct bat_priv *bat_priv, | |||
206 | } | 207 | } |
207 | 208 | ||
208 | /* delete all claims for a backbone */ | 209 | /* delete all claims for a backbone */ |
209 | static void batadv_bla_del_backbone_claims(struct backbone_gw *backbone_gw) | 210 | static void |
211 | batadv_bla_del_backbone_claims(struct batadv_backbone_gw *backbone_gw) | ||
210 | { | 212 | { |
211 | struct batadv_hashtable *hash; | 213 | struct batadv_hashtable *hash; |
212 | struct hlist_node *node, *node_tmp; | 214 | struct hlist_node *node, *node_tmp; |
213 | struct hlist_head *head; | 215 | struct hlist_head *head; |
214 | struct claim *claim; | 216 | struct batadv_claim *claim; |
215 | int i; | 217 | int i; |
216 | spinlock_t *list_lock; /* protects write access to the hash lists */ | 218 | spinlock_t *list_lock; /* protects write access to the hash lists */ |
217 | 219 | ||
@@ -247,12 +249,12 @@ static void batadv_bla_del_backbone_claims(struct backbone_gw *backbone_gw) | |||
247 | * | 249 | * |
248 | * sends a claim frame according to the provided info. | 250 | * sends a claim frame according to the provided info. |
249 | */ | 251 | */ |
250 | static void batadv_bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac, | 252 | static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac, |
251 | short vid, int claimtype) | 253 | short vid, int claimtype) |
252 | { | 254 | { |
253 | struct sk_buff *skb; | 255 | struct sk_buff *skb; |
254 | struct ethhdr *ethhdr; | 256 | struct ethhdr *ethhdr; |
255 | struct hard_iface *primary_if; | 257 | struct batadv_hard_iface *primary_if; |
256 | struct net_device *soft_iface; | 258 | struct net_device *soft_iface; |
257 | uint8_t *hw_src; | 259 | uint8_t *hw_src; |
258 | struct batadv_bla_claim_dst local_claim_dest; | 260 | struct batadv_bla_claim_dst local_claim_dest; |
@@ -353,11 +355,12 @@ out: | |||
353 | * searches for the backbone gw or creates a new one if it could not | 355 | * searches for the backbone gw or creates a new one if it could not |
354 | * be found. | 356 | * be found. |
355 | */ | 357 | */ |
356 | static struct backbone_gw *batadv_bla_get_backbone_gw(struct bat_priv *bat_priv, | 358 | static struct batadv_backbone_gw * |
357 | uint8_t *orig, short vid) | 359 | batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, uint8_t *orig, |
360 | short vid) | ||
358 | { | 361 | { |
359 | struct backbone_gw *entry; | 362 | struct batadv_backbone_gw *entry; |
360 | struct orig_node *orig_node; | 363 | struct batadv_orig_node *orig_node; |
361 | int hash_added; | 364 | int hash_added; |
362 | 365 | ||
363 | entry = batadv_backbone_hash_find(bat_priv, orig, vid); | 366 | entry = batadv_backbone_hash_find(bat_priv, orig, vid); |
@@ -407,11 +410,12 @@ static struct backbone_gw *batadv_bla_get_backbone_gw(struct bat_priv *bat_priv, | |||
407 | /* update or add the own backbone gw to make sure we announce | 410 | /* update or add the own backbone gw to make sure we announce |
408 | * where we receive other backbone gws | 411 | * where we receive other backbone gws |
409 | */ | 412 | */ |
410 | static void batadv_bla_update_own_backbone_gw(struct bat_priv *bat_priv, | 413 | static void |
411 | struct hard_iface *primary_if, | 414 | batadv_bla_update_own_backbone_gw(struct batadv_priv *bat_priv, |
412 | short vid) | 415 | struct batadv_hard_iface *primary_if, |
416 | short vid) | ||
413 | { | 417 | { |
414 | struct backbone_gw *backbone_gw; | 418 | struct batadv_backbone_gw *backbone_gw; |
415 | 419 | ||
416 | backbone_gw = batadv_bla_get_backbone_gw(bat_priv, | 420 | backbone_gw = batadv_bla_get_backbone_gw(bat_priv, |
417 | primary_if->net_dev->dev_addr, | 421 | primary_if->net_dev->dev_addr, |
@@ -429,14 +433,15 @@ static void batadv_bla_update_own_backbone_gw(struct bat_priv *bat_priv, | |||
429 | * Repeat all of our own claims, and finally send an ANNOUNCE frame | 433 | * Repeat all of our own claims, and finally send an ANNOUNCE frame |
430 | * to allow the requester another check if the CRC is correct now. | 434 | * to allow the requester another check if the CRC is correct now. |
431 | */ | 435 | */ |
432 | static void batadv_bla_answer_request(struct bat_priv *bat_priv, | 436 | static void batadv_bla_answer_request(struct batadv_priv *bat_priv, |
433 | struct hard_iface *primary_if, short vid) | 437 | struct batadv_hard_iface *primary_if, |
438 | short vid) | ||
434 | { | 439 | { |
435 | struct hlist_node *node; | 440 | struct hlist_node *node; |
436 | struct hlist_head *head; | 441 | struct hlist_head *head; |
437 | struct batadv_hashtable *hash; | 442 | struct batadv_hashtable *hash; |
438 | struct claim *claim; | 443 | struct batadv_claim *claim; |
439 | struct backbone_gw *backbone_gw; | 444 | struct batadv_backbone_gw *backbone_gw; |
440 | int i; | 445 | int i; |
441 | 446 | ||
442 | batadv_dbg(BATADV_DBG_BLA, bat_priv, | 447 | batadv_dbg(BATADV_DBG_BLA, bat_priv, |
@@ -475,7 +480,7 @@ static void batadv_bla_answer_request(struct bat_priv *bat_priv, | |||
475 | * After the request, it will repeat all of his own claims and finally | 480 | * After the request, it will repeat all of his own claims and finally |
476 | * send an announcement claim with which we can check again. | 481 | * send an announcement claim with which we can check again. |
477 | */ | 482 | */ |
478 | static void batadv_bla_send_request(struct backbone_gw *backbone_gw) | 483 | static void batadv_bla_send_request(struct batadv_backbone_gw *backbone_gw) |
479 | { | 484 | { |
480 | /* first, remove all old entries */ | 485 | /* first, remove all old entries */ |
481 | batadv_bla_del_backbone_claims(backbone_gw); | 486 | batadv_bla_del_backbone_claims(backbone_gw); |
@@ -500,8 +505,8 @@ static void batadv_bla_send_request(struct backbone_gw *backbone_gw) | |||
500 | * This function sends an announcement. It is called from multiple | 505 | * This function sends an announcement. It is called from multiple |
501 | * places. | 506 | * places. |
502 | */ | 507 | */ |
503 | static void batadv_bla_send_announce(struct bat_priv *bat_priv, | 508 | static void batadv_bla_send_announce(struct batadv_priv *bat_priv, |
504 | struct backbone_gw *backbone_gw) | 509 | struct batadv_backbone_gw *backbone_gw) |
505 | { | 510 | { |
506 | uint8_t mac[ETH_ALEN]; | 511 | uint8_t mac[ETH_ALEN]; |
507 | __be16 crc; | 512 | __be16 crc; |
@@ -522,12 +527,12 @@ static void batadv_bla_send_announce(struct bat_priv *bat_priv, | |||
522 | * | 527 | * |
523 | * Adds a claim in the claim hash. | 528 | * Adds a claim in the claim hash. |
524 | */ | 529 | */ |
525 | static void batadv_bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac, | 530 | static void batadv_bla_add_claim(struct batadv_priv *bat_priv, |
526 | const short vid, | 531 | const uint8_t *mac, const short vid, |
527 | struct backbone_gw *backbone_gw) | 532 | struct batadv_backbone_gw *backbone_gw) |
528 | { | 533 | { |
529 | struct claim *claim; | 534 | struct batadv_claim *claim; |
530 | struct claim search_claim; | 535 | struct batadv_claim search_claim; |
531 | int hash_added; | 536 | int hash_added; |
532 | 537 | ||
533 | memcpy(search_claim.addr, mac, ETH_ALEN); | 538 | memcpy(search_claim.addr, mac, ETH_ALEN); |
@@ -588,10 +593,10 @@ claim_free_ref: | |||
588 | /* Delete a claim from the claim hash which has the | 593 | /* Delete a claim from the claim hash which has the |
589 | * given mac address and vid. | 594 | * given mac address and vid. |
590 | */ | 595 | */ |
591 | static void batadv_bla_del_claim(struct bat_priv *bat_priv, const uint8_t *mac, | 596 | static void batadv_bla_del_claim(struct batadv_priv *bat_priv, |
592 | const short vid) | 597 | const uint8_t *mac, const short vid) |
593 | { | 598 | { |
594 | struct claim search_claim, *claim; | 599 | struct batadv_claim search_claim, *claim; |
595 | 600 | ||
596 | memcpy(search_claim.addr, mac, ETH_ALEN); | 601 | memcpy(search_claim.addr, mac, ETH_ALEN); |
597 | search_claim.vid = vid; | 602 | search_claim.vid = vid; |
@@ -613,11 +618,11 @@ static void batadv_bla_del_claim(struct bat_priv *bat_priv, const uint8_t *mac, | |||
613 | } | 618 | } |
614 | 619 | ||
615 | /* check for ANNOUNCE frame, return 1 if handled */ | 620 | /* check for ANNOUNCE frame, return 1 if handled */ |
616 | static int batadv_handle_announce(struct bat_priv *bat_priv, | 621 | static int batadv_handle_announce(struct batadv_priv *bat_priv, |
617 | uint8_t *an_addr, uint8_t *backbone_addr, | 622 | uint8_t *an_addr, uint8_t *backbone_addr, |
618 | short vid) | 623 | short vid) |
619 | { | 624 | { |
620 | struct backbone_gw *backbone_gw; | 625 | struct batadv_backbone_gw *backbone_gw; |
621 | uint16_t crc; | 626 | uint16_t crc; |
622 | 627 | ||
623 | if (memcmp(an_addr, batadv_announce_mac, 4) != 0) | 628 | if (memcmp(an_addr, batadv_announce_mac, 4) != 0) |
@@ -659,8 +664,8 @@ static int batadv_handle_announce(struct bat_priv *bat_priv, | |||
659 | } | 664 | } |
660 | 665 | ||
661 | /* check for REQUEST frame, return 1 if handled */ | 666 | /* check for REQUEST frame, return 1 if handled */ |
662 | static int batadv_handle_request(struct bat_priv *bat_priv, | 667 | static int batadv_handle_request(struct batadv_priv *bat_priv, |
663 | struct hard_iface *primary_if, | 668 | struct batadv_hard_iface *primary_if, |
664 | uint8_t *backbone_addr, | 669 | uint8_t *backbone_addr, |
665 | struct ethhdr *ethhdr, short vid) | 670 | struct ethhdr *ethhdr, short vid) |
666 | { | 671 | { |
@@ -683,12 +688,12 @@ static int batadv_handle_request(struct bat_priv *bat_priv, | |||
683 | } | 688 | } |
684 | 689 | ||
685 | /* check for UNCLAIM frame, return 1 if handled */ | 690 | /* check for UNCLAIM frame, return 1 if handled */ |
686 | static int batadv_handle_unclaim(struct bat_priv *bat_priv, | 691 | static int batadv_handle_unclaim(struct batadv_priv *bat_priv, |
687 | struct hard_iface *primary_if, | 692 | struct batadv_hard_iface *primary_if, |
688 | uint8_t *backbone_addr, | 693 | uint8_t *backbone_addr, |
689 | uint8_t *claim_addr, short vid) | 694 | uint8_t *claim_addr, short vid) |
690 | { | 695 | { |
691 | struct backbone_gw *backbone_gw; | 696 | struct batadv_backbone_gw *backbone_gw; |
692 | 697 | ||
693 | /* unclaim in any case if it is our own */ | 698 | /* unclaim in any case if it is our own */ |
694 | if (primary_if && batadv_compare_eth(backbone_addr, | 699 | if (primary_if && batadv_compare_eth(backbone_addr, |
@@ -712,12 +717,12 @@ static int batadv_handle_unclaim(struct bat_priv *bat_priv, | |||
712 | } | 717 | } |
713 | 718 | ||
714 | /* check for CLAIM frame, return 1 if handled */ | 719 | /* check for CLAIM frame, return 1 if handled */ |
715 | static int batadv_handle_claim(struct bat_priv *bat_priv, | 720 | static int batadv_handle_claim(struct batadv_priv *bat_priv, |
716 | struct hard_iface *primary_if, | 721 | struct batadv_hard_iface *primary_if, |
717 | uint8_t *backbone_addr, uint8_t *claim_addr, | 722 | uint8_t *backbone_addr, uint8_t *claim_addr, |
718 | short vid) | 723 | short vid) |
719 | { | 724 | { |
720 | struct backbone_gw *backbone_gw; | 725 | struct batadv_backbone_gw *backbone_gw; |
721 | 726 | ||
722 | /* register the gateway if not yet available, and add the claim. */ | 727 | /* register the gateway if not yet available, and add the claim. */ |
723 | 728 | ||
@@ -752,13 +757,13 @@ static int batadv_handle_claim(struct bat_priv *bat_priv, | |||
752 | * 1 - if is a claim packet from another group | 757 | * 1 - if is a claim packet from another group |
753 | * 0 - if it is not a claim packet | 758 | * 0 - if it is not a claim packet |
754 | */ | 759 | */ |
755 | static int batadv_check_claim_group(struct bat_priv *bat_priv, | 760 | static int batadv_check_claim_group(struct batadv_priv *bat_priv, |
756 | struct hard_iface *primary_if, | 761 | struct batadv_hard_iface *primary_if, |
757 | uint8_t *hw_src, uint8_t *hw_dst, | 762 | uint8_t *hw_src, uint8_t *hw_dst, |
758 | struct ethhdr *ethhdr) | 763 | struct ethhdr *ethhdr) |
759 | { | 764 | { |
760 | uint8_t *backbone_addr; | 765 | uint8_t *backbone_addr; |
761 | struct orig_node *orig_node; | 766 | struct batadv_orig_node *orig_node; |
762 | struct batadv_bla_claim_dst *bla_dst, *bla_dst_own; | 767 | struct batadv_bla_claim_dst *bla_dst, *bla_dst_own; |
763 | 768 | ||
764 | bla_dst = (struct batadv_bla_claim_dst *)hw_dst; | 769 | bla_dst = (struct batadv_bla_claim_dst *)hw_dst; |
@@ -824,8 +829,8 @@ static int batadv_check_claim_group(struct bat_priv *bat_priv, | |||
824 | * returns 1 if it was a claim frame, otherwise return 0 to | 829 | * returns 1 if it was a claim frame, otherwise return 0 to |
825 | * tell the callee that it can use the frame on its own. | 830 | * tell the callee that it can use the frame on its own. |
826 | */ | 831 | */ |
827 | static int batadv_bla_process_claim(struct bat_priv *bat_priv, | 832 | static int batadv_bla_process_claim(struct batadv_priv *bat_priv, |
828 | struct hard_iface *primary_if, | 833 | struct batadv_hard_iface *primary_if, |
829 | struct sk_buff *skb) | 834 | struct sk_buff *skb) |
830 | { | 835 | { |
831 | struct ethhdr *ethhdr; | 836 | struct ethhdr *ethhdr; |
@@ -926,9 +931,9 @@ static int batadv_bla_process_claim(struct bat_priv *bat_priv, | |||
926 | /* Check when we last heard from other nodes, and remove them in case of | 931 | /* Check when we last heard from other nodes, and remove them in case of |
927 | * a time out, or clean all backbone gws if now is set. | 932 | * a time out, or clean all backbone gws if now is set. |
928 | */ | 933 | */ |
929 | static void batadv_bla_purge_backbone_gw(struct bat_priv *bat_priv, int now) | 934 | static void batadv_bla_purge_backbone_gw(struct batadv_priv *bat_priv, int now) |
930 | { | 935 | { |
931 | struct backbone_gw *backbone_gw; | 936 | struct batadv_backbone_gw *backbone_gw; |
932 | struct hlist_node *node, *node_tmp; | 937 | struct hlist_node *node, *node_tmp; |
933 | struct hlist_head *head; | 938 | struct hlist_head *head; |
934 | struct batadv_hashtable *hash; | 939 | struct batadv_hashtable *hash; |
@@ -977,10 +982,11 @@ purge_now: | |||
977 | * Check when we heard last time from our own claims, and remove them in case of | 982 | * Check when we heard last time from our own claims, and remove them in case of |
978 | * a time out, or clean all claims if now is set | 983 | * a time out, or clean all claims if now is set |
979 | */ | 984 | */ |
980 | static void batadv_bla_purge_claims(struct bat_priv *bat_priv, | 985 | static void batadv_bla_purge_claims(struct batadv_priv *bat_priv, |
981 | struct hard_iface *primary_if, int now) | 986 | struct batadv_hard_iface *primary_if, |
987 | int now) | ||
982 | { | 988 | { |
983 | struct claim *claim; | 989 | struct batadv_claim *claim; |
984 | struct hlist_node *node; | 990 | struct hlist_node *node; |
985 | struct hlist_head *head; | 991 | struct hlist_head *head; |
986 | struct batadv_hashtable *hash; | 992 | struct batadv_hashtable *hash; |
@@ -1023,11 +1029,11 @@ purge_now: | |||
1023 | * | 1029 | * |
1024 | * Update the backbone gateways when the own orig address changes. | 1030 | * Update the backbone gateways when the own orig address changes. |
1025 | */ | 1031 | */ |
1026 | void batadv_bla_update_orig_address(struct bat_priv *bat_priv, | 1032 | void batadv_bla_update_orig_address(struct batadv_priv *bat_priv, |
1027 | struct hard_iface *primary_if, | 1033 | struct batadv_hard_iface *primary_if, |
1028 | struct hard_iface *oldif) | 1034 | struct batadv_hard_iface *oldif) |
1029 | { | 1035 | { |
1030 | struct backbone_gw *backbone_gw; | 1036 | struct batadv_backbone_gw *backbone_gw; |
1031 | struct hlist_node *node; | 1037 | struct hlist_node *node; |
1032 | struct hlist_head *head; | 1038 | struct hlist_head *head; |
1033 | struct batadv_hashtable *hash; | 1039 | struct batadv_hashtable *hash; |
@@ -1071,7 +1077,7 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv, | |||
1071 | 1077 | ||
1072 | 1078 | ||
1073 | /* (re)start the timer */ | 1079 | /* (re)start the timer */ |
1074 | static void batadv_bla_start_timer(struct bat_priv *bat_priv) | 1080 | static void batadv_bla_start_timer(struct batadv_priv *bat_priv) |
1075 | { | 1081 | { |
1076 | INIT_DELAYED_WORK(&bat_priv->bla_work, batadv_bla_periodic_work); | 1082 | INIT_DELAYED_WORK(&bat_priv->bla_work, batadv_bla_periodic_work); |
1077 | queue_delayed_work(batadv_event_workqueue, &bat_priv->bla_work, | 1083 | queue_delayed_work(batadv_event_workqueue, &bat_priv->bla_work, |
@@ -1086,15 +1092,15 @@ static void batadv_bla_periodic_work(struct work_struct *work) | |||
1086 | { | 1092 | { |
1087 | struct delayed_work *delayed_work = | 1093 | struct delayed_work *delayed_work = |
1088 | container_of(work, struct delayed_work, work); | 1094 | container_of(work, struct delayed_work, work); |
1089 | struct bat_priv *bat_priv = | 1095 | struct batadv_priv *bat_priv; |
1090 | container_of(delayed_work, struct bat_priv, bla_work); | ||
1091 | struct hlist_node *node; | 1096 | struct hlist_node *node; |
1092 | struct hlist_head *head; | 1097 | struct hlist_head *head; |
1093 | struct backbone_gw *backbone_gw; | 1098 | struct batadv_backbone_gw *backbone_gw; |
1094 | struct batadv_hashtable *hash; | 1099 | struct batadv_hashtable *hash; |
1095 | struct hard_iface *primary_if; | 1100 | struct batadv_hard_iface *primary_if; |
1096 | int i; | 1101 | int i; |
1097 | 1102 | ||
1103 | bat_priv = container_of(delayed_work, struct batadv_priv, bla_work); | ||
1098 | primary_if = batadv_primary_if_get_selected(bat_priv); | 1104 | primary_if = batadv_primary_if_get_selected(bat_priv); |
1099 | if (!primary_if) | 1105 | if (!primary_if) |
1100 | goto out; | 1106 | goto out; |
@@ -1140,11 +1146,11 @@ static struct lock_class_key batadv_claim_hash_lock_class_key; | |||
1140 | static struct lock_class_key batadv_backbone_hash_lock_class_key; | 1146 | static struct lock_class_key batadv_backbone_hash_lock_class_key; |
1141 | 1147 | ||
1142 | /* initialize all bla structures */ | 1148 | /* initialize all bla structures */ |
1143 | int batadv_bla_init(struct bat_priv *bat_priv) | 1149 | int batadv_bla_init(struct batadv_priv *bat_priv) |
1144 | { | 1150 | { |
1145 | int i; | 1151 | int i; |
1146 | uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00}; | 1152 | uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00}; |
1147 | struct hard_iface *primary_if; | 1153 | struct batadv_hard_iface *primary_if; |
1148 | 1154 | ||
1149 | batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla hash registering\n"); | 1155 | batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla hash registering\n"); |
1150 | 1156 | ||
@@ -1200,14 +1206,14 @@ int batadv_bla_init(struct bat_priv *bat_priv) | |||
1200 | * sent by another host, drop it. We allow equal packets from | 1206 | * sent by another host, drop it. We allow equal packets from |
1201 | * the same host however as this might be intended. | 1207 | * the same host however as this might be intended. |
1202 | */ | 1208 | */ |
1203 | int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, | 1209 | int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv, |
1204 | struct batadv_bcast_packet *bcast_packet, | 1210 | struct batadv_bcast_packet *bcast_packet, |
1205 | int hdr_size) | 1211 | int hdr_size) |
1206 | { | 1212 | { |
1207 | int i, length, curr; | 1213 | int i, length, curr; |
1208 | uint8_t *content; | 1214 | uint8_t *content; |
1209 | uint16_t crc; | 1215 | uint16_t crc; |
1210 | struct bcast_duplist_entry *entry; | 1216 | struct batadv_bcast_duplist_entry *entry; |
1211 | 1217 | ||
1212 | length = hdr_size - sizeof(*bcast_packet); | 1218 | length = hdr_size - sizeof(*bcast_packet); |
1213 | content = (uint8_t *)bcast_packet; | 1219 | content = (uint8_t *)bcast_packet; |
@@ -1260,12 +1266,12 @@ int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, | |||
1260 | * | 1266 | * |
1261 | * returns 1 if it is found, 0 otherwise | 1267 | * returns 1 if it is found, 0 otherwise |
1262 | */ | 1268 | */ |
1263 | int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) | 1269 | int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig) |
1264 | { | 1270 | { |
1265 | struct batadv_hashtable *hash = bat_priv->backbone_hash; | 1271 | struct batadv_hashtable *hash = bat_priv->backbone_hash; |
1266 | struct hlist_head *head; | 1272 | struct hlist_head *head; |
1267 | struct hlist_node *node; | 1273 | struct hlist_node *node; |
1268 | struct backbone_gw *backbone_gw; | 1274 | struct batadv_backbone_gw *backbone_gw; |
1269 | int i; | 1275 | int i; |
1270 | 1276 | ||
1271 | if (!atomic_read(&bat_priv->bridge_loop_avoidance)) | 1277 | if (!atomic_read(&bat_priv->bridge_loop_avoidance)) |
@@ -1300,11 +1306,11 @@ int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig) | |||
1300 | * returns 0. | 1306 | * returns 0. |
1301 | */ | 1307 | */ |
1302 | int batadv_bla_is_backbone_gw(struct sk_buff *skb, | 1308 | int batadv_bla_is_backbone_gw(struct sk_buff *skb, |
1303 | struct orig_node *orig_node, int hdr_size) | 1309 | struct batadv_orig_node *orig_node, int hdr_size) |
1304 | { | 1310 | { |
1305 | struct ethhdr *ethhdr; | 1311 | struct ethhdr *ethhdr; |
1306 | struct vlan_ethhdr *vhdr; | 1312 | struct vlan_ethhdr *vhdr; |
1307 | struct backbone_gw *backbone_gw; | 1313 | struct batadv_backbone_gw *backbone_gw; |
1308 | short vid = -1; | 1314 | short vid = -1; |
1309 | 1315 | ||
1310 | if (!atomic_read(&orig_node->bat_priv->bridge_loop_avoidance)) | 1316 | if (!atomic_read(&orig_node->bat_priv->bridge_loop_avoidance)) |
@@ -1336,9 +1342,9 @@ int batadv_bla_is_backbone_gw(struct sk_buff *skb, | |||
1336 | } | 1342 | } |
1337 | 1343 | ||
1338 | /* free all bla structures (for softinterface free or module unload) */ | 1344 | /* free all bla structures (for softinterface free or module unload) */ |
1339 | void batadv_bla_free(struct bat_priv *bat_priv) | 1345 | void batadv_bla_free(struct batadv_priv *bat_priv) |
1340 | { | 1346 | { |
1341 | struct hard_iface *primary_if; | 1347 | struct batadv_hard_iface *primary_if; |
1342 | 1348 | ||
1343 | cancel_delayed_work_sync(&bat_priv->bla_work); | 1349 | cancel_delayed_work_sync(&bat_priv->bla_work); |
1344 | primary_if = batadv_primary_if_get_selected(bat_priv); | 1350 | primary_if = batadv_primary_if_get_selected(bat_priv); |
@@ -1369,11 +1375,11 @@ void batadv_bla_free(struct bat_priv *bat_priv) | |||
1369 | * returns 1, otherwise it returns 0 and the caller shall further | 1375 | * returns 1, otherwise it returns 0 and the caller shall further |
1370 | * process the skb. | 1376 | * process the skb. |
1371 | */ | 1377 | */ |
1372 | int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | 1378 | int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid) |
1373 | { | 1379 | { |
1374 | struct ethhdr *ethhdr; | 1380 | struct ethhdr *ethhdr; |
1375 | struct claim search_claim, *claim = NULL; | 1381 | struct batadv_claim search_claim, *claim = NULL; |
1376 | struct hard_iface *primary_if; | 1382 | struct batadv_hard_iface *primary_if; |
1377 | int ret; | 1383 | int ret; |
1378 | 1384 | ||
1379 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 1385 | ethhdr = (struct ethhdr *)skb_mac_header(skb); |
@@ -1456,11 +1462,11 @@ out: | |||
1456 | * returns 1, otherwise it returns 0 and the caller shall further | 1462 | * returns 1, otherwise it returns 0 and the caller shall further |
1457 | * process the skb. | 1463 | * process the skb. |
1458 | */ | 1464 | */ |
1459 | int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | 1465 | int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid) |
1460 | { | 1466 | { |
1461 | struct ethhdr *ethhdr; | 1467 | struct ethhdr *ethhdr; |
1462 | struct claim search_claim, *claim = NULL; | 1468 | struct batadv_claim search_claim, *claim = NULL; |
1463 | struct hard_iface *primary_if; | 1469 | struct batadv_hard_iface *primary_if; |
1464 | int ret = 0; | 1470 | int ret = 0; |
1465 | 1471 | ||
1466 | primary_if = batadv_primary_if_get_selected(bat_priv); | 1472 | primary_if = batadv_primary_if_get_selected(bat_priv); |
@@ -1533,10 +1539,10 @@ out: | |||
1533 | int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) | 1539 | int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset) |
1534 | { | 1540 | { |
1535 | struct net_device *net_dev = (struct net_device *)seq->private; | 1541 | struct net_device *net_dev = (struct net_device *)seq->private; |
1536 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 1542 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
1537 | struct batadv_hashtable *hash = bat_priv->claim_hash; | 1543 | struct batadv_hashtable *hash = bat_priv->claim_hash; |
1538 | struct claim *claim; | 1544 | struct batadv_claim *claim; |
1539 | struct hard_iface *primary_if; | 1545 | struct batadv_hard_iface *primary_if; |
1540 | struct hlist_node *node; | 1546 | struct hlist_node *node; |
1541 | struct hlist_head *head; | 1547 | struct hlist_head *head; |
1542 | uint32_t i; | 1548 | uint32_t i; |
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h index d69f453d2b12..08d13cb1e3df 100644 --- a/net/batman-adv/bridge_loop_avoidance.h +++ b/net/batman-adv/bridge_loop_avoidance.h | |||
@@ -21,38 +21,38 @@ | |||
21 | #define _NET_BATMAN_ADV_BLA_H_ | 21 | #define _NET_BATMAN_ADV_BLA_H_ |
22 | 22 | ||
23 | #ifdef CONFIG_BATMAN_ADV_BLA | 23 | #ifdef CONFIG_BATMAN_ADV_BLA |
24 | int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); | 24 | int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid); |
25 | int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); | 25 | int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid); |
26 | int batadv_bla_is_backbone_gw(struct sk_buff *skb, | 26 | int batadv_bla_is_backbone_gw(struct sk_buff *skb, |
27 | struct orig_node *orig_node, int hdr_size); | 27 | struct batadv_orig_node *orig_node, int hdr_size); |
28 | int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset); | 28 | int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset); |
29 | int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig); | 29 | int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig); |
30 | int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, | 30 | int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv, |
31 | struct batadv_bcast_packet *bcast_packet, | 31 | struct batadv_bcast_packet *bcast_packet, |
32 | int hdr_size); | 32 | int hdr_size); |
33 | void batadv_bla_update_orig_address(struct bat_priv *bat_priv, | 33 | void batadv_bla_update_orig_address(struct batadv_priv *bat_priv, |
34 | struct hard_iface *primary_if, | 34 | struct batadv_hard_iface *primary_if, |
35 | struct hard_iface *oldif); | 35 | struct batadv_hard_iface *oldif); |
36 | int batadv_bla_init(struct bat_priv *bat_priv); | 36 | int batadv_bla_init(struct batadv_priv *bat_priv); |
37 | void batadv_bla_free(struct bat_priv *bat_priv); | 37 | void batadv_bla_free(struct batadv_priv *bat_priv); |
38 | 38 | ||
39 | #define BATADV_BLA_CRC_INIT 0 | 39 | #define BATADV_BLA_CRC_INIT 0 |
40 | #else /* ifdef CONFIG_BATMAN_ADV_BLA */ | 40 | #else /* ifdef CONFIG_BATMAN_ADV_BLA */ |
41 | 41 | ||
42 | static inline int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, | 42 | static inline int batadv_bla_rx(struct batadv_priv *bat_priv, |
43 | short vid) | 43 | struct sk_buff *skb, short vid) |
44 | { | 44 | { |
45 | return 0; | 45 | return 0; |
46 | } | 46 | } |
47 | 47 | ||
48 | static inline int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, | 48 | static inline int batadv_bla_tx(struct batadv_priv *bat_priv, |
49 | short vid) | 49 | struct sk_buff *skb, short vid) |
50 | { | 50 | { |
51 | return 0; | 51 | return 0; |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline int batadv_bla_is_backbone_gw(struct sk_buff *skb, | 54 | static inline int batadv_bla_is_backbone_gw(struct sk_buff *skb, |
55 | struct orig_node *orig_node, | 55 | struct batadv_orig_node *orig_node, |
56 | int hdr_size) | 56 | int hdr_size) |
57 | { | 57 | { |
58 | return 0; | 58 | return 0; |
@@ -64,14 +64,14 @@ static inline int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, | |||
64 | return 0; | 64 | return 0; |
65 | } | 65 | } |
66 | 66 | ||
67 | static inline int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, | 67 | static inline int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, |
68 | uint8_t *orig) | 68 | uint8_t *orig) |
69 | { | 69 | { |
70 | return 0; | 70 | return 0; |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline int | 73 | static inline int |
74 | batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, | 74 | batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv, |
75 | struct batadv_bcast_packet *bcast_packet, | 75 | struct batadv_bcast_packet *bcast_packet, |
76 | int hdr_size) | 76 | int hdr_size) |
77 | { | 77 | { |
@@ -79,18 +79,18 @@ batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv, | |||
79 | } | 79 | } |
80 | 80 | ||
81 | static inline void | 81 | static inline void |
82 | batadv_bla_update_orig_address(struct bat_priv *bat_priv, | 82 | batadv_bla_update_orig_address(struct batadv_priv *bat_priv, |
83 | struct hard_iface *primary_if, | 83 | struct batadv_hard_iface *primary_if, |
84 | struct hard_iface *oldif) | 84 | struct batadv_hard_iface *oldif) |
85 | { | 85 | { |
86 | } | 86 | } |
87 | 87 | ||
88 | static inline int batadv_bla_init(struct bat_priv *bat_priv) | 88 | static inline int batadv_bla_init(struct batadv_priv *bat_priv) |
89 | { | 89 | { |
90 | return 1; | 90 | return 1; |
91 | } | 91 | } |
92 | 92 | ||
93 | static inline void batadv_bla_free(struct bat_priv *bat_priv) | 93 | static inline void batadv_bla_free(struct batadv_priv *bat_priv) |
94 | { | 94 | { |
95 | } | 95 | } |
96 | 96 | ||
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 00273b92d76f..43b9c1763fff 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c | |||
@@ -36,15 +36,16 @@ | |||
36 | #define BATADV_DHCP_OPTIONS_OFFSET 240 | 36 | #define BATADV_DHCP_OPTIONS_OFFSET 240 |
37 | #define BATADV_DHCP_REQUEST 3 | 37 | #define BATADV_DHCP_REQUEST 3 |
38 | 38 | ||
39 | static void batadv_gw_node_free_ref(struct gw_node *gw_node) | 39 | static void batadv_gw_node_free_ref(struct batadv_gw_node *gw_node) |
40 | { | 40 | { |
41 | if (atomic_dec_and_test(&gw_node->refcount)) | 41 | if (atomic_dec_and_test(&gw_node->refcount)) |
42 | kfree_rcu(gw_node, rcu); | 42 | kfree_rcu(gw_node, rcu); |
43 | } | 43 | } |
44 | 44 | ||
45 | static struct gw_node *batadv_gw_get_selected_gw_node(struct bat_priv *bat_priv) | 45 | static struct batadv_gw_node * |
46 | batadv_gw_get_selected_gw_node(struct batadv_priv *bat_priv) | ||
46 | { | 47 | { |
47 | struct gw_node *gw_node; | 48 | struct batadv_gw_node *gw_node; |
48 | 49 | ||
49 | rcu_read_lock(); | 50 | rcu_read_lock(); |
50 | gw_node = rcu_dereference(bat_priv->curr_gw); | 51 | gw_node = rcu_dereference(bat_priv->curr_gw); |
@@ -59,10 +60,11 @@ out: | |||
59 | return gw_node; | 60 | return gw_node; |
60 | } | 61 | } |
61 | 62 | ||
62 | struct orig_node *batadv_gw_get_selected_orig(struct bat_priv *bat_priv) | 63 | struct batadv_orig_node * |
64 | batadv_gw_get_selected_orig(struct batadv_priv *bat_priv) | ||
63 | { | 65 | { |
64 | struct gw_node *gw_node; | 66 | struct batadv_gw_node *gw_node; |
65 | struct orig_node *orig_node = NULL; | 67 | struct batadv_orig_node *orig_node = NULL; |
66 | 68 | ||
67 | gw_node = batadv_gw_get_selected_gw_node(bat_priv); | 69 | gw_node = batadv_gw_get_selected_gw_node(bat_priv); |
68 | if (!gw_node) | 70 | if (!gw_node) |
@@ -84,10 +86,10 @@ out: | |||
84 | return orig_node; | 86 | return orig_node; |
85 | } | 87 | } |
86 | 88 | ||
87 | static void batadv_gw_select(struct bat_priv *bat_priv, | 89 | static void batadv_gw_select(struct batadv_priv *bat_priv, |
88 | struct gw_node *new_gw_node) | 90 | struct batadv_gw_node *new_gw_node) |
89 | { | 91 | { |
90 | struct gw_node *curr_gw_node; | 92 | struct batadv_gw_node *curr_gw_node; |
91 | 93 | ||
92 | spin_lock_bh(&bat_priv->gw_list_lock); | 94 | spin_lock_bh(&bat_priv->gw_list_lock); |
93 | 95 | ||
@@ -103,20 +105,21 @@ static void batadv_gw_select(struct bat_priv *bat_priv, | |||
103 | spin_unlock_bh(&bat_priv->gw_list_lock); | 105 | spin_unlock_bh(&bat_priv->gw_list_lock); |
104 | } | 106 | } |
105 | 107 | ||
106 | void batadv_gw_deselect(struct bat_priv *bat_priv) | 108 | void batadv_gw_deselect(struct batadv_priv *bat_priv) |
107 | { | 109 | { |
108 | atomic_set(&bat_priv->gw_reselect, 1); | 110 | atomic_set(&bat_priv->gw_reselect, 1); |
109 | } | 111 | } |
110 | 112 | ||
111 | static struct gw_node *batadv_gw_get_best_gw_node(struct bat_priv *bat_priv) | 113 | static struct batadv_gw_node * |
114 | batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv) | ||
112 | { | 115 | { |
113 | struct neigh_node *router; | 116 | struct batadv_neigh_node *router; |
114 | struct hlist_node *node; | 117 | struct hlist_node *node; |
115 | struct gw_node *gw_node, *curr_gw = NULL; | 118 | struct batadv_gw_node *gw_node, *curr_gw = NULL; |
116 | uint32_t max_gw_factor = 0, tmp_gw_factor = 0; | 119 | uint32_t max_gw_factor = 0, tmp_gw_factor = 0; |
117 | uint8_t max_tq = 0; | 120 | uint8_t max_tq = 0; |
118 | int down, up; | 121 | int down, up; |
119 | struct orig_node *orig_node; | 122 | struct batadv_orig_node *orig_node; |
120 | 123 | ||
121 | rcu_read_lock(); | 124 | rcu_read_lock(); |
122 | hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) { | 125 | hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) { |
@@ -183,10 +186,10 @@ next: | |||
183 | return curr_gw; | 186 | return curr_gw; |
184 | } | 187 | } |
185 | 188 | ||
186 | void batadv_gw_election(struct bat_priv *bat_priv) | 189 | void batadv_gw_election(struct batadv_priv *bat_priv) |
187 | { | 190 | { |
188 | struct gw_node *curr_gw = NULL, *next_gw = NULL; | 191 | struct batadv_gw_node *curr_gw = NULL, *next_gw = NULL; |
189 | struct neigh_node *router = NULL; | 192 | struct batadv_neigh_node *router = NULL; |
190 | char gw_addr[18] = { '\0' }; | 193 | char gw_addr[18] = { '\0' }; |
191 | 194 | ||
192 | /* The batman daemon checks here if we already passed a full originator | 195 | /* The batman daemon checks here if we already passed a full originator |
@@ -249,11 +252,11 @@ out: | |||
249 | batadv_neigh_node_free_ref(router); | 252 | batadv_neigh_node_free_ref(router); |
250 | } | 253 | } |
251 | 254 | ||
252 | void batadv_gw_check_election(struct bat_priv *bat_priv, | 255 | void batadv_gw_check_election(struct batadv_priv *bat_priv, |
253 | struct orig_node *orig_node) | 256 | struct batadv_orig_node *orig_node) |
254 | { | 257 | { |
255 | struct orig_node *curr_gw_orig; | 258 | struct batadv_orig_node *curr_gw_orig; |
256 | struct neigh_node *router_gw = NULL, *router_orig = NULL; | 259 | struct batadv_neigh_node *router_gw = NULL, *router_orig = NULL; |
257 | uint8_t gw_tq_avg, orig_tq_avg; | 260 | uint8_t gw_tq_avg, orig_tq_avg; |
258 | 261 | ||
259 | curr_gw_orig = batadv_gw_get_selected_orig(bat_priv); | 262 | curr_gw_orig = batadv_gw_get_selected_orig(bat_priv); |
@@ -303,11 +306,11 @@ out: | |||
303 | return; | 306 | return; |
304 | } | 307 | } |
305 | 308 | ||
306 | static void batadv_gw_node_add(struct bat_priv *bat_priv, | 309 | static void batadv_gw_node_add(struct batadv_priv *bat_priv, |
307 | struct orig_node *orig_node, | 310 | struct batadv_orig_node *orig_node, |
308 | uint8_t new_gwflags) | 311 | uint8_t new_gwflags) |
309 | { | 312 | { |
310 | struct gw_node *gw_node; | 313 | struct batadv_gw_node *gw_node; |
311 | int down, up; | 314 | int down, up; |
312 | 315 | ||
313 | gw_node = kzalloc(sizeof(*gw_node), GFP_ATOMIC); | 316 | gw_node = kzalloc(sizeof(*gw_node), GFP_ATOMIC); |
@@ -332,11 +335,12 @@ static void batadv_gw_node_add(struct bat_priv *bat_priv, | |||
332 | (up > 2048 ? "MBit" : "KBit")); | 335 | (up > 2048 ? "MBit" : "KBit")); |
333 | } | 336 | } |
334 | 337 | ||
335 | void batadv_gw_node_update(struct bat_priv *bat_priv, | 338 | void batadv_gw_node_update(struct batadv_priv *bat_priv, |
336 | struct orig_node *orig_node, uint8_t new_gwflags) | 339 | struct batadv_orig_node *orig_node, |
340 | uint8_t new_gwflags) | ||
337 | { | 341 | { |
338 | struct hlist_node *node; | 342 | struct hlist_node *node; |
339 | struct gw_node *gw_node, *curr_gw; | 343 | struct batadv_gw_node *gw_node, *curr_gw; |
340 | 344 | ||
341 | /* Note: We don't need a NULL check here, since curr_gw never gets | 345 | /* Note: We don't need a NULL check here, since curr_gw never gets |
342 | * dereferenced. If curr_gw is NULL we also should not exit as we may | 346 | * dereferenced. If curr_gw is NULL we also should not exit as we may |
@@ -385,15 +389,15 @@ unlock: | |||
385 | batadv_gw_node_free_ref(curr_gw); | 389 | batadv_gw_node_free_ref(curr_gw); |
386 | } | 390 | } |
387 | 391 | ||
388 | void batadv_gw_node_delete(struct bat_priv *bat_priv, | 392 | void batadv_gw_node_delete(struct batadv_priv *bat_priv, |
389 | struct orig_node *orig_node) | 393 | struct batadv_orig_node *orig_node) |
390 | { | 394 | { |
391 | batadv_gw_node_update(bat_priv, orig_node, 0); | 395 | batadv_gw_node_update(bat_priv, orig_node, 0); |
392 | } | 396 | } |
393 | 397 | ||
394 | void batadv_gw_node_purge(struct bat_priv *bat_priv) | 398 | void batadv_gw_node_purge(struct batadv_priv *bat_priv) |
395 | { | 399 | { |
396 | struct gw_node *gw_node, *curr_gw; | 400 | struct batadv_gw_node *gw_node, *curr_gw; |
397 | struct hlist_node *node, *node_tmp; | 401 | struct hlist_node *node, *node_tmp; |
398 | unsigned long timeout = msecs_to_jiffies(2 * BATADV_PURGE_TIMEOUT); | 402 | unsigned long timeout = msecs_to_jiffies(2 * BATADV_PURGE_TIMEOUT); |
399 | int do_deselect = 0; | 403 | int do_deselect = 0; |
@@ -427,12 +431,12 @@ void batadv_gw_node_purge(struct bat_priv *bat_priv) | |||
427 | } | 431 | } |
428 | 432 | ||
429 | /* fails if orig_node has no router */ | 433 | /* fails if orig_node has no router */ |
430 | static int batadv_write_buffer_text(struct bat_priv *bat_priv, | 434 | static int batadv_write_buffer_text(struct batadv_priv *bat_priv, |
431 | struct seq_file *seq, | 435 | struct seq_file *seq, |
432 | const struct gw_node *gw_node) | 436 | const struct batadv_gw_node *gw_node) |
433 | { | 437 | { |
434 | struct gw_node *curr_gw; | 438 | struct batadv_gw_node *curr_gw; |
435 | struct neigh_node *router; | 439 | struct batadv_neigh_node *router; |
436 | int down, up, ret = -1; | 440 | int down, up, ret = -1; |
437 | 441 | ||
438 | batadv_gw_bandwidth_to_kbit(gw_node->orig_node->gw_flags, &down, &up); | 442 | batadv_gw_bandwidth_to_kbit(gw_node->orig_node->gw_flags, &down, &up); |
@@ -464,9 +468,9 @@ out: | |||
464 | int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset) | 468 | int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset) |
465 | { | 469 | { |
466 | struct net_device *net_dev = (struct net_device *)seq->private; | 470 | struct net_device *net_dev = (struct net_device *)seq->private; |
467 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 471 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
468 | struct hard_iface *primary_if; | 472 | struct batadv_hard_iface *primary_if; |
469 | struct gw_node *gw_node; | 473 | struct batadv_gw_node *gw_node; |
470 | struct hlist_node *node; | 474 | struct hlist_node *node; |
471 | int gw_count = 0, ret = 0; | 475 | int gw_count = 0, ret = 0; |
472 | 476 | ||
@@ -639,12 +643,12 @@ bool batadv_gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len) | |||
639 | return true; | 643 | return true; |
640 | } | 644 | } |
641 | 645 | ||
642 | bool batadv_gw_out_of_range(struct bat_priv *bat_priv, | 646 | bool batadv_gw_out_of_range(struct batadv_priv *bat_priv, |
643 | struct sk_buff *skb, struct ethhdr *ethhdr) | 647 | struct sk_buff *skb, struct ethhdr *ethhdr) |
644 | { | 648 | { |
645 | struct neigh_node *neigh_curr = NULL, *neigh_old = NULL; | 649 | struct batadv_neigh_node *neigh_curr = NULL, *neigh_old = NULL; |
646 | struct orig_node *orig_dst_node = NULL; | 650 | struct batadv_orig_node *orig_dst_node = NULL; |
647 | struct gw_node *curr_gw = NULL; | 651 | struct batadv_gw_node *curr_gw = NULL; |
648 | bool ret, out_of_range = false; | 652 | bool ret, out_of_range = false; |
649 | unsigned int header_len = 0; | 653 | unsigned int header_len = 0; |
650 | uint8_t curr_tq_avg; | 654 | uint8_t curr_tq_avg; |
diff --git a/net/batman-adv/gateway_client.h b/net/batman-adv/gateway_client.h index 4529d42894ef..f0d129e323c8 100644 --- a/net/batman-adv/gateway_client.h +++ b/net/batman-adv/gateway_client.h | |||
@@ -20,19 +20,21 @@ | |||
20 | #ifndef _NET_BATMAN_ADV_GATEWAY_CLIENT_H_ | 20 | #ifndef _NET_BATMAN_ADV_GATEWAY_CLIENT_H_ |
21 | #define _NET_BATMAN_ADV_GATEWAY_CLIENT_H_ | 21 | #define _NET_BATMAN_ADV_GATEWAY_CLIENT_H_ |
22 | 22 | ||
23 | void batadv_gw_deselect(struct bat_priv *bat_priv); | 23 | void batadv_gw_deselect(struct batadv_priv *bat_priv); |
24 | void batadv_gw_election(struct bat_priv *bat_priv); | 24 | void batadv_gw_election(struct batadv_priv *bat_priv); |
25 | struct orig_node *batadv_gw_get_selected_orig(struct bat_priv *bat_priv); | 25 | struct batadv_orig_node * |
26 | void batadv_gw_check_election(struct bat_priv *bat_priv, | 26 | batadv_gw_get_selected_orig(struct batadv_priv *bat_priv); |
27 | struct orig_node *orig_node); | 27 | void batadv_gw_check_election(struct batadv_priv *bat_priv, |
28 | void batadv_gw_node_update(struct bat_priv *bat_priv, | 28 | struct batadv_orig_node *orig_node); |
29 | struct orig_node *orig_node, uint8_t new_gwflags); | 29 | void batadv_gw_node_update(struct batadv_priv *bat_priv, |
30 | void batadv_gw_node_delete(struct bat_priv *bat_priv, | 30 | struct batadv_orig_node *orig_node, |
31 | struct orig_node *orig_node); | 31 | uint8_t new_gwflags); |
32 | void batadv_gw_node_purge(struct bat_priv *bat_priv); | 32 | void batadv_gw_node_delete(struct batadv_priv *bat_priv, |
33 | struct batadv_orig_node *orig_node); | ||
34 | void batadv_gw_node_purge(struct batadv_priv *bat_priv); | ||
33 | int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset); | 35 | int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset); |
34 | bool batadv_gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len); | 36 | bool batadv_gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len); |
35 | bool batadv_gw_out_of_range(struct bat_priv *bat_priv, | 37 | bool batadv_gw_out_of_range(struct batadv_priv *bat_priv, |
36 | struct sk_buff *skb, struct ethhdr *ethhdr); | 38 | struct sk_buff *skb, struct ethhdr *ethhdr); |
37 | 39 | ||
38 | #endif /* _NET_BATMAN_ADV_GATEWAY_CLIENT_H_ */ | 40 | #endif /* _NET_BATMAN_ADV_GATEWAY_CLIENT_H_ */ |
diff --git a/net/batman-adv/gateway_common.c b/net/batman-adv/gateway_common.c index f5c3980aaea6..9001208d1752 100644 --- a/net/batman-adv/gateway_common.c +++ b/net/batman-adv/gateway_common.c | |||
@@ -137,7 +137,7 @@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff, | |||
137 | ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff, | 137 | ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff, |
138 | size_t count) | 138 | size_t count) |
139 | { | 139 | { |
140 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 140 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
141 | long gw_bandwidth_tmp = 0; | 141 | long gw_bandwidth_tmp = 0; |
142 | int up = 0, down = 0; | 142 | int up = 0, down = 0; |
143 | bool ret; | 143 | bool ret; |
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 0a14fdf9e877..eb765a778ba0 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -32,16 +32,17 @@ | |||
32 | 32 | ||
33 | void batadv_hardif_free_rcu(struct rcu_head *rcu) | 33 | void batadv_hardif_free_rcu(struct rcu_head *rcu) |
34 | { | 34 | { |
35 | struct hard_iface *hard_iface; | 35 | struct batadv_hard_iface *hard_iface; |
36 | 36 | ||
37 | hard_iface = container_of(rcu, struct hard_iface, rcu); | 37 | hard_iface = container_of(rcu, struct batadv_hard_iface, rcu); |
38 | dev_put(hard_iface->net_dev); | 38 | dev_put(hard_iface->net_dev); |
39 | kfree(hard_iface); | 39 | kfree(hard_iface); |
40 | } | 40 | } |
41 | 41 | ||
42 | struct hard_iface *batadv_hardif_get_by_netdev(const struct net_device *net_dev) | 42 | struct batadv_hard_iface * |
43 | batadv_hardif_get_by_netdev(const struct net_device *net_dev) | ||
43 | { | 44 | { |
44 | struct hard_iface *hard_iface; | 45 | struct batadv_hard_iface *hard_iface; |
45 | 46 | ||
46 | rcu_read_lock(); | 47 | rcu_read_lock(); |
47 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { | 48 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { |
@@ -75,10 +76,10 @@ static int batadv_is_valid_iface(const struct net_device *net_dev) | |||
75 | return 1; | 76 | return 1; |
76 | } | 77 | } |
77 | 78 | ||
78 | static struct hard_iface * | 79 | static struct batadv_hard_iface * |
79 | batadv_hardif_get_active(const struct net_device *soft_iface) | 80 | batadv_hardif_get_active(const struct net_device *soft_iface) |
80 | { | 81 | { |
81 | struct hard_iface *hard_iface; | 82 | struct batadv_hard_iface *hard_iface; |
82 | 83 | ||
83 | rcu_read_lock(); | 84 | rcu_read_lock(); |
84 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { | 85 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { |
@@ -97,11 +98,11 @@ out: | |||
97 | return hard_iface; | 98 | return hard_iface; |
98 | } | 99 | } |
99 | 100 | ||
100 | static void batadv_primary_if_update_addr(struct bat_priv *bat_priv, | 101 | static void batadv_primary_if_update_addr(struct batadv_priv *bat_priv, |
101 | struct hard_iface *oldif) | 102 | struct batadv_hard_iface *oldif) |
102 | { | 103 | { |
103 | struct batadv_vis_packet *vis_packet; | 104 | struct batadv_vis_packet *vis_packet; |
104 | struct hard_iface *primary_if; | 105 | struct batadv_hard_iface *primary_if; |
105 | 106 | ||
106 | primary_if = batadv_primary_if_get_selected(bat_priv); | 107 | primary_if = batadv_primary_if_get_selected(bat_priv); |
107 | if (!primary_if) | 108 | if (!primary_if) |
@@ -119,10 +120,10 @@ out: | |||
119 | batadv_hardif_free_ref(primary_if); | 120 | batadv_hardif_free_ref(primary_if); |
120 | } | 121 | } |
121 | 122 | ||
122 | static void batadv_primary_if_select(struct bat_priv *bat_priv, | 123 | static void batadv_primary_if_select(struct batadv_priv *bat_priv, |
123 | struct hard_iface *new_hard_iface) | 124 | struct batadv_hard_iface *new_hard_iface) |
124 | { | 125 | { |
125 | struct hard_iface *curr_hard_iface; | 126 | struct batadv_hard_iface *curr_hard_iface; |
126 | 127 | ||
127 | ASSERT_RTNL(); | 128 | ASSERT_RTNL(); |
128 | 129 | ||
@@ -143,7 +144,8 @@ out: | |||
143 | batadv_hardif_free_ref(curr_hard_iface); | 144 | batadv_hardif_free_ref(curr_hard_iface); |
144 | } | 145 | } |
145 | 146 | ||
146 | static bool batadv_hardif_is_iface_up(const struct hard_iface *hard_iface) | 147 | static bool |
148 | batadv_hardif_is_iface_up(const struct batadv_hard_iface *hard_iface) | ||
147 | { | 149 | { |
148 | if (hard_iface->net_dev->flags & IFF_UP) | 150 | if (hard_iface->net_dev->flags & IFF_UP) |
149 | return true; | 151 | return true; |
@@ -153,7 +155,7 @@ static bool batadv_hardif_is_iface_up(const struct hard_iface *hard_iface) | |||
153 | 155 | ||
154 | static void batadv_check_known_mac_addr(const struct net_device *net_dev) | 156 | static void batadv_check_known_mac_addr(const struct net_device *net_dev) |
155 | { | 157 | { |
156 | const struct hard_iface *hard_iface; | 158 | const struct batadv_hard_iface *hard_iface; |
157 | 159 | ||
158 | rcu_read_lock(); | 160 | rcu_read_lock(); |
159 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { | 161 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { |
@@ -177,8 +179,8 @@ static void batadv_check_known_mac_addr(const struct net_device *net_dev) | |||
177 | 179 | ||
178 | int batadv_hardif_min_mtu(struct net_device *soft_iface) | 180 | int batadv_hardif_min_mtu(struct net_device *soft_iface) |
179 | { | 181 | { |
180 | const struct bat_priv *bat_priv = netdev_priv(soft_iface); | 182 | const struct batadv_priv *bat_priv = netdev_priv(soft_iface); |
181 | const struct hard_iface *hard_iface; | 183 | const struct batadv_hard_iface *hard_iface; |
182 | /* allow big frames if all devices are capable to do so | 184 | /* allow big frames if all devices are capable to do so |
183 | * (have MTU > 1500 + BAT_HEADER_LEN) | 185 | * (have MTU > 1500 + BAT_HEADER_LEN) |
184 | */ | 186 | */ |
@@ -215,10 +217,11 @@ void batadv_update_min_mtu(struct net_device *soft_iface) | |||
215 | soft_iface->mtu = min_mtu; | 217 | soft_iface->mtu = min_mtu; |
216 | } | 218 | } |
217 | 219 | ||
218 | static void batadv_hardif_activate_interface(struct hard_iface *hard_iface) | 220 | static void |
221 | batadv_hardif_activate_interface(struct batadv_hard_iface *hard_iface) | ||
219 | { | 222 | { |
220 | struct bat_priv *bat_priv; | 223 | struct batadv_priv *bat_priv; |
221 | struct hard_iface *primary_if = NULL; | 224 | struct batadv_hard_iface *primary_if = NULL; |
222 | 225 | ||
223 | if (hard_iface->if_status != BATADV_IF_INACTIVE) | 226 | if (hard_iface->if_status != BATADV_IF_INACTIVE) |
224 | goto out; | 227 | goto out; |
@@ -245,7 +248,8 @@ out: | |||
245 | batadv_hardif_free_ref(primary_if); | 248 | batadv_hardif_free_ref(primary_if); |
246 | } | 249 | } |
247 | 250 | ||
248 | static void batadv_hardif_deactivate_interface(struct hard_iface *hard_iface) | 251 | static void |
252 | batadv_hardif_deactivate_interface(struct batadv_hard_iface *hard_iface) | ||
249 | { | 253 | { |
250 | if ((hard_iface->if_status != BATADV_IF_ACTIVE) && | 254 | if ((hard_iface->if_status != BATADV_IF_ACTIVE) && |
251 | (hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)) | 255 | (hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)) |
@@ -259,10 +263,10 @@ static void batadv_hardif_deactivate_interface(struct hard_iface *hard_iface) | |||
259 | batadv_update_min_mtu(hard_iface->soft_iface); | 263 | batadv_update_min_mtu(hard_iface->soft_iface); |
260 | } | 264 | } |
261 | 265 | ||
262 | int batadv_hardif_enable_interface(struct hard_iface *hard_iface, | 266 | int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, |
263 | const char *iface_name) | 267 | const char *iface_name) |
264 | { | 268 | { |
265 | struct bat_priv *bat_priv; | 269 | struct batadv_priv *bat_priv; |
266 | struct net_device *soft_iface; | 270 | struct net_device *soft_iface; |
267 | __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); | 271 | __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); |
268 | int ret; | 272 | int ret; |
@@ -354,10 +358,10 @@ err: | |||
354 | return ret; | 358 | return ret; |
355 | } | 359 | } |
356 | 360 | ||
357 | void batadv_hardif_disable_interface(struct hard_iface *hard_iface) | 361 | void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface) |
358 | { | 362 | { |
359 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 363 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
360 | struct hard_iface *primary_if = NULL; | 364 | struct batadv_hard_iface *primary_if = NULL; |
361 | 365 | ||
362 | if (hard_iface->if_status == BATADV_IF_ACTIVE) | 366 | if (hard_iface->if_status == BATADV_IF_ACTIVE) |
363 | batadv_hardif_deactivate_interface(hard_iface); | 367 | batadv_hardif_deactivate_interface(hard_iface); |
@@ -374,7 +378,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface) | |||
374 | 378 | ||
375 | primary_if = batadv_primary_if_get_selected(bat_priv); | 379 | primary_if = batadv_primary_if_get_selected(bat_priv); |
376 | if (hard_iface == primary_if) { | 380 | if (hard_iface == primary_if) { |
377 | struct hard_iface *new_if; | 381 | struct batadv_hard_iface *new_if; |
378 | 382 | ||
379 | new_if = batadv_hardif_get_active(hard_iface->soft_iface); | 383 | new_if = batadv_hardif_get_active(hard_iface->soft_iface); |
380 | batadv_primary_if_select(bat_priv, new_if); | 384 | batadv_primary_if_select(bat_priv, new_if); |
@@ -403,10 +407,10 @@ out: | |||
403 | batadv_hardif_free_ref(primary_if); | 407 | batadv_hardif_free_ref(primary_if); |
404 | } | 408 | } |
405 | 409 | ||
406 | static struct hard_iface * | 410 | static struct batadv_hard_iface * |
407 | batadv_hardif_add_interface(struct net_device *net_dev) | 411 | batadv_hardif_add_interface(struct net_device *net_dev) |
408 | { | 412 | { |
409 | struct hard_iface *hard_iface; | 413 | struct batadv_hard_iface *hard_iface; |
410 | int ret; | 414 | int ret; |
411 | 415 | ||
412 | ASSERT_RTNL(); | 416 | ASSERT_RTNL(); |
@@ -452,7 +456,7 @@ out: | |||
452 | return NULL; | 456 | return NULL; |
453 | } | 457 | } |
454 | 458 | ||
455 | static void batadv_hardif_remove_interface(struct hard_iface *hard_iface) | 459 | static void batadv_hardif_remove_interface(struct batadv_hard_iface *hard_iface) |
456 | { | 460 | { |
457 | ASSERT_RTNL(); | 461 | ASSERT_RTNL(); |
458 | 462 | ||
@@ -470,7 +474,7 @@ static void batadv_hardif_remove_interface(struct hard_iface *hard_iface) | |||
470 | 474 | ||
471 | void batadv_hardif_remove_interfaces(void) | 475 | void batadv_hardif_remove_interfaces(void) |
472 | { | 476 | { |
473 | struct hard_iface *hard_iface, *hard_iface_tmp; | 477 | struct batadv_hard_iface *hard_iface, *hard_iface_tmp; |
474 | 478 | ||
475 | rtnl_lock(); | 479 | rtnl_lock(); |
476 | list_for_each_entry_safe(hard_iface, hard_iface_tmp, | 480 | list_for_each_entry_safe(hard_iface, hard_iface_tmp, |
@@ -485,10 +489,11 @@ static int batadv_hard_if_event(struct notifier_block *this, | |||
485 | unsigned long event, void *ptr) | 489 | unsigned long event, void *ptr) |
486 | { | 490 | { |
487 | struct net_device *net_dev = ptr; | 491 | struct net_device *net_dev = ptr; |
488 | struct hard_iface *hard_iface = batadv_hardif_get_by_netdev(net_dev); | 492 | struct batadv_hard_iface *hard_iface; |
489 | struct hard_iface *primary_if = NULL; | 493 | struct batadv_hard_iface *primary_if = NULL; |
490 | struct bat_priv *bat_priv; | 494 | struct batadv_priv *bat_priv; |
491 | 495 | ||
496 | hard_iface = batadv_hardif_get_by_netdev(net_dev); | ||
492 | if (!hard_iface && event == NETDEV_REGISTER) | 497 | if (!hard_iface && event == NETDEV_REGISTER) |
493 | hard_iface = batadv_hardif_add_interface(net_dev); | 498 | hard_iface = batadv_hardif_add_interface(net_dev); |
494 | 499 | ||
diff --git a/net/batman-adv/hard-interface.h b/net/batman-adv/hard-interface.h index 4b60d580d290..3732366e7445 100644 --- a/net/batman-adv/hard-interface.h +++ b/net/batman-adv/hard-interface.h | |||
@@ -31,11 +31,11 @@ enum batadv_hard_if_state { | |||
31 | 31 | ||
32 | extern struct notifier_block batadv_hard_if_notifier; | 32 | extern struct notifier_block batadv_hard_if_notifier; |
33 | 33 | ||
34 | struct hard_iface* | 34 | struct batadv_hard_iface* |
35 | batadv_hardif_get_by_netdev(const struct net_device *net_dev); | 35 | batadv_hardif_get_by_netdev(const struct net_device *net_dev); |
36 | int batadv_hardif_enable_interface(struct hard_iface *hard_iface, | 36 | int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, |
37 | const char *iface_name); | 37 | const char *iface_name); |
38 | void batadv_hardif_disable_interface(struct hard_iface *hard_iface); | 38 | void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface); |
39 | void batadv_hardif_remove_interfaces(void); | 39 | void batadv_hardif_remove_interfaces(void); |
40 | int batadv_hardif_min_mtu(struct net_device *soft_iface); | 40 | int batadv_hardif_min_mtu(struct net_device *soft_iface); |
41 | void batadv_update_min_mtu(struct net_device *soft_iface); | 41 | void batadv_update_min_mtu(struct net_device *soft_iface); |
@@ -43,16 +43,16 @@ void batadv_hardif_free_rcu(struct rcu_head *rcu); | |||
43 | bool batadv_is_wifi_iface(int ifindex); | 43 | bool batadv_is_wifi_iface(int ifindex); |
44 | 44 | ||
45 | static inline void | 45 | static inline void |
46 | batadv_hardif_free_ref(struct hard_iface *hard_iface) | 46 | batadv_hardif_free_ref(struct batadv_hard_iface *hard_iface) |
47 | { | 47 | { |
48 | if (atomic_dec_and_test(&hard_iface->refcount)) | 48 | if (atomic_dec_and_test(&hard_iface->refcount)) |
49 | call_rcu(&hard_iface->rcu, batadv_hardif_free_rcu); | 49 | call_rcu(&hard_iface->rcu, batadv_hardif_free_rcu); |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline struct hard_iface * | 52 | static inline struct batadv_hard_iface * |
53 | batadv_primary_if_get_selected(struct bat_priv *bat_priv) | 53 | batadv_primary_if_get_selected(struct batadv_priv *bat_priv) |
54 | { | 54 | { |
55 | struct hard_iface *hard_iface; | 55 | struct batadv_hard_iface *hard_iface; |
56 | 56 | ||
57 | rcu_read_lock(); | 57 | rcu_read_lock(); |
58 | hard_iface = rcu_dereference(bat_priv->primary_if); | 58 | hard_iface = rcu_dereference(bat_priv->primary_if); |
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index ca07580c1b44..bde3cf747507 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c | |||
@@ -26,9 +26,9 @@ | |||
26 | #include "originator.h" | 26 | #include "originator.h" |
27 | #include "hard-interface.h" | 27 | #include "hard-interface.h" |
28 | 28 | ||
29 | static struct socket_client *batadv_socket_client_hash[256]; | 29 | static struct batadv_socket_client *batadv_socket_client_hash[256]; |
30 | 30 | ||
31 | static void batadv_socket_add_packet(struct socket_client *socket_client, | 31 | static void batadv_socket_add_packet(struct batadv_socket_client *socket_client, |
32 | struct batadv_icmp_packet_rr *icmp_packet, | 32 | struct batadv_icmp_packet_rr *icmp_packet, |
33 | size_t icmp_len); | 33 | size_t icmp_len); |
34 | 34 | ||
@@ -40,7 +40,7 @@ void batadv_socket_init(void) | |||
40 | static int batadv_socket_open(struct inode *inode, struct file *file) | 40 | static int batadv_socket_open(struct inode *inode, struct file *file) |
41 | { | 41 | { |
42 | unsigned int i; | 42 | unsigned int i; |
43 | struct socket_client *socket_client; | 43 | struct batadv_socket_client *socket_client; |
44 | 44 | ||
45 | nonseekable_open(inode, file); | 45 | nonseekable_open(inode, file); |
46 | 46 | ||
@@ -77,8 +77,8 @@ static int batadv_socket_open(struct inode *inode, struct file *file) | |||
77 | 77 | ||
78 | static int batadv_socket_release(struct inode *inode, struct file *file) | 78 | static int batadv_socket_release(struct inode *inode, struct file *file) |
79 | { | 79 | { |
80 | struct socket_client *socket_client = file->private_data; | 80 | struct batadv_socket_client *socket_client = file->private_data; |
81 | struct socket_packet *socket_packet; | 81 | struct batadv_socket_packet *socket_packet; |
82 | struct list_head *list_pos, *list_pos_tmp; | 82 | struct list_head *list_pos, *list_pos_tmp; |
83 | 83 | ||
84 | spin_lock_bh(&socket_client->lock); | 84 | spin_lock_bh(&socket_client->lock); |
@@ -86,7 +86,7 @@ static int batadv_socket_release(struct inode *inode, struct file *file) | |||
86 | /* for all packets in the queue ... */ | 86 | /* for all packets in the queue ... */ |
87 | list_for_each_safe(list_pos, list_pos_tmp, &socket_client->queue_list) { | 87 | list_for_each_safe(list_pos, list_pos_tmp, &socket_client->queue_list) { |
88 | socket_packet = list_entry(list_pos, | 88 | socket_packet = list_entry(list_pos, |
89 | struct socket_packet, list); | 89 | struct batadv_socket_packet, list); |
90 | 90 | ||
91 | list_del(list_pos); | 91 | list_del(list_pos); |
92 | kfree(socket_packet); | 92 | kfree(socket_packet); |
@@ -104,8 +104,8 @@ static int batadv_socket_release(struct inode *inode, struct file *file) | |||
104 | static ssize_t batadv_socket_read(struct file *file, char __user *buf, | 104 | static ssize_t batadv_socket_read(struct file *file, char __user *buf, |
105 | size_t count, loff_t *ppos) | 105 | size_t count, loff_t *ppos) |
106 | { | 106 | { |
107 | struct socket_client *socket_client = file->private_data; | 107 | struct batadv_socket_client *socket_client = file->private_data; |
108 | struct socket_packet *socket_packet; | 108 | struct batadv_socket_packet *socket_packet; |
109 | size_t packet_len; | 109 | size_t packet_len; |
110 | int error; | 110 | int error; |
111 | 111 | ||
@@ -127,7 +127,7 @@ static ssize_t batadv_socket_read(struct file *file, char __user *buf, | |||
127 | spin_lock_bh(&socket_client->lock); | 127 | spin_lock_bh(&socket_client->lock); |
128 | 128 | ||
129 | socket_packet = list_first_entry(&socket_client->queue_list, | 129 | socket_packet = list_first_entry(&socket_client->queue_list, |
130 | struct socket_packet, list); | 130 | struct batadv_socket_packet, list); |
131 | list_del(&socket_packet->list); | 131 | list_del(&socket_packet->list); |
132 | socket_client->queue_len--; | 132 | socket_client->queue_len--; |
133 | 133 | ||
@@ -147,14 +147,14 @@ static ssize_t batadv_socket_read(struct file *file, char __user *buf, | |||
147 | static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | 147 | static ssize_t batadv_socket_write(struct file *file, const char __user *buff, |
148 | size_t len, loff_t *off) | 148 | size_t len, loff_t *off) |
149 | { | 149 | { |
150 | struct socket_client *socket_client = file->private_data; | 150 | struct batadv_socket_client *socket_client = file->private_data; |
151 | struct bat_priv *bat_priv = socket_client->bat_priv; | 151 | struct batadv_priv *bat_priv = socket_client->bat_priv; |
152 | struct hard_iface *primary_if = NULL; | 152 | struct batadv_hard_iface *primary_if = NULL; |
153 | struct sk_buff *skb; | 153 | struct sk_buff *skb; |
154 | struct batadv_icmp_packet_rr *icmp_packet; | 154 | struct batadv_icmp_packet_rr *icmp_packet; |
155 | 155 | ||
156 | struct orig_node *orig_node = NULL; | 156 | struct batadv_orig_node *orig_node = NULL; |
157 | struct neigh_node *neigh_node = NULL; | 157 | struct batadv_neigh_node *neigh_node = NULL; |
158 | size_t packet_len = sizeof(struct batadv_icmp_packet); | 158 | size_t packet_len = sizeof(struct batadv_icmp_packet); |
159 | 159 | ||
160 | if (len < sizeof(struct batadv_icmp_packet)) { | 160 | if (len < sizeof(struct batadv_icmp_packet)) { |
@@ -255,7 +255,7 @@ out: | |||
255 | 255 | ||
256 | static unsigned int batadv_socket_poll(struct file *file, poll_table *wait) | 256 | static unsigned int batadv_socket_poll(struct file *file, poll_table *wait) |
257 | { | 257 | { |
258 | struct socket_client *socket_client = file->private_data; | 258 | struct batadv_socket_client *socket_client = file->private_data; |
259 | 259 | ||
260 | poll_wait(file, &socket_client->queue_wait, wait); | 260 | poll_wait(file, &socket_client->queue_wait, wait); |
261 | 261 | ||
@@ -275,7 +275,7 @@ static const struct file_operations batadv_fops = { | |||
275 | .llseek = no_llseek, | 275 | .llseek = no_llseek, |
276 | }; | 276 | }; |
277 | 277 | ||
278 | int batadv_socket_setup(struct bat_priv *bat_priv) | 278 | int batadv_socket_setup(struct batadv_priv *bat_priv) |
279 | { | 279 | { |
280 | struct dentry *d; | 280 | struct dentry *d; |
281 | 281 | ||
@@ -293,11 +293,11 @@ err: | |||
293 | return -ENOMEM; | 293 | return -ENOMEM; |
294 | } | 294 | } |
295 | 295 | ||
296 | static void batadv_socket_add_packet(struct socket_client *socket_client, | 296 | static void batadv_socket_add_packet(struct batadv_socket_client *socket_client, |
297 | struct batadv_icmp_packet_rr *icmp_packet, | 297 | struct batadv_icmp_packet_rr *icmp_packet, |
298 | size_t icmp_len) | 298 | size_t icmp_len) |
299 | { | 299 | { |
300 | struct socket_packet *socket_packet; | 300 | struct batadv_socket_packet *socket_packet; |
301 | 301 | ||
302 | socket_packet = kmalloc(sizeof(*socket_packet), GFP_ATOMIC); | 302 | socket_packet = kmalloc(sizeof(*socket_packet), GFP_ATOMIC); |
303 | 303 | ||
@@ -324,7 +324,8 @@ static void batadv_socket_add_packet(struct socket_client *socket_client, | |||
324 | 324 | ||
325 | if (socket_client->queue_len > 100) { | 325 | if (socket_client->queue_len > 100) { |
326 | socket_packet = list_first_entry(&socket_client->queue_list, | 326 | socket_packet = list_first_entry(&socket_client->queue_list, |
327 | struct socket_packet, list); | 327 | struct batadv_socket_packet, |
328 | list); | ||
328 | 329 | ||
329 | list_del(&socket_packet->list); | 330 | list_del(&socket_packet->list); |
330 | kfree(socket_packet); | 331 | kfree(socket_packet); |
@@ -339,7 +340,7 @@ static void batadv_socket_add_packet(struct socket_client *socket_client, | |||
339 | void batadv_socket_receive_packet(struct batadv_icmp_packet_rr *icmp_packet, | 340 | void batadv_socket_receive_packet(struct batadv_icmp_packet_rr *icmp_packet, |
340 | size_t icmp_len) | 341 | size_t icmp_len) |
341 | { | 342 | { |
342 | struct socket_client *hash; | 343 | struct batadv_socket_client *hash; |
343 | 344 | ||
344 | hash = batadv_socket_client_hash[icmp_packet->uid]; | 345 | hash = batadv_socket_client_hash[icmp_packet->uid]; |
345 | if (hash) | 346 | if (hash) |
diff --git a/net/batman-adv/icmp_socket.h b/net/batman-adv/icmp_socket.h index 7b8ad529b09c..29443a1dbb5c 100644 --- a/net/batman-adv/icmp_socket.h +++ b/net/batman-adv/icmp_socket.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define BATADV_ICMP_SOCKET "socket" | 23 | #define BATADV_ICMP_SOCKET "socket" |
24 | 24 | ||
25 | void batadv_socket_init(void); | 25 | void batadv_socket_init(void); |
26 | int batadv_socket_setup(struct bat_priv *bat_priv); | 26 | int batadv_socket_setup(struct batadv_priv *bat_priv); |
27 | void batadv_socket_receive_packet(struct batadv_icmp_packet_rr *icmp_packet, | 27 | void batadv_socket_receive_packet(struct batadv_icmp_packet_rr *icmp_packet, |
28 | size_t icmp_len); | 28 | size_t icmp_len); |
29 | 29 | ||
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 97144a98c66f..17dcdd90cb74 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | struct list_head batadv_hardif_list; | 40 | struct list_head batadv_hardif_list; |
41 | static int (*batadv_rx_handler[256])(struct sk_buff *, | 41 | static int (*batadv_rx_handler[256])(struct sk_buff *, |
42 | struct hard_iface *); | 42 | struct batadv_hard_iface *); |
43 | char batadv_routing_algo[20] = "BATMAN_IV"; | 43 | char batadv_routing_algo[20] = "BATMAN_IV"; |
44 | static struct hlist_head batadv_algo_list; | 44 | static struct hlist_head batadv_algo_list; |
45 | 45 | ||
@@ -92,7 +92,7 @@ static void __exit batadv_exit(void) | |||
92 | 92 | ||
93 | int batadv_mesh_init(struct net_device *soft_iface) | 93 | int batadv_mesh_init(struct net_device *soft_iface) |
94 | { | 94 | { |
95 | struct bat_priv *bat_priv = netdev_priv(soft_iface); | 95 | struct batadv_priv *bat_priv = netdev_priv(soft_iface); |
96 | int ret; | 96 | int ret; |
97 | 97 | ||
98 | spin_lock_init(&bat_priv->forw_bat_list_lock); | 98 | spin_lock_init(&bat_priv->forw_bat_list_lock); |
@@ -143,7 +143,7 @@ err: | |||
143 | 143 | ||
144 | void batadv_mesh_free(struct net_device *soft_iface) | 144 | void batadv_mesh_free(struct net_device *soft_iface) |
145 | { | 145 | { |
146 | struct bat_priv *bat_priv = netdev_priv(soft_iface); | 146 | struct batadv_priv *bat_priv = netdev_priv(soft_iface); |
147 | 147 | ||
148 | atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING); | 148 | atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING); |
149 | 149 | ||
@@ -175,7 +175,7 @@ void batadv_dec_module_count(void) | |||
175 | 175 | ||
176 | int batadv_is_my_mac(const uint8_t *addr) | 176 | int batadv_is_my_mac(const uint8_t *addr) |
177 | { | 177 | { |
178 | const struct hard_iface *hard_iface; | 178 | const struct batadv_hard_iface *hard_iface; |
179 | 179 | ||
180 | rcu_read_lock(); | 180 | rcu_read_lock(); |
181 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { | 181 | list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { |
@@ -192,7 +192,7 @@ int batadv_is_my_mac(const uint8_t *addr) | |||
192 | } | 192 | } |
193 | 193 | ||
194 | static int batadv_recv_unhandled_packet(struct sk_buff *skb, | 194 | static int batadv_recv_unhandled_packet(struct sk_buff *skb, |
195 | struct hard_iface *recv_if) | 195 | struct batadv_hard_iface *recv_if) |
196 | { | 196 | { |
197 | return NET_RX_DROP; | 197 | return NET_RX_DROP; |
198 | } | 198 | } |
@@ -204,13 +204,14 @@ int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev, | |||
204 | struct packet_type *ptype, | 204 | struct packet_type *ptype, |
205 | struct net_device *orig_dev) | 205 | struct net_device *orig_dev) |
206 | { | 206 | { |
207 | struct bat_priv *bat_priv; | 207 | struct batadv_priv *bat_priv; |
208 | struct batadv_ogm_packet *batadv_ogm_packet; | 208 | struct batadv_ogm_packet *batadv_ogm_packet; |
209 | struct hard_iface *hard_iface; | 209 | struct batadv_hard_iface *hard_iface; |
210 | uint8_t idx; | 210 | uint8_t idx; |
211 | int ret; | 211 | int ret; |
212 | 212 | ||
213 | hard_iface = container_of(ptype, struct hard_iface, batman_adv_ptype); | 213 | hard_iface = container_of(ptype, struct batadv_hard_iface, |
214 | batman_adv_ptype); | ||
214 | skb = skb_share_check(skb, GFP_ATOMIC); | 215 | skb = skb_share_check(skb, GFP_ATOMIC); |
215 | 216 | ||
216 | /* skb was released by skb_share_check() */ | 217 | /* skb was released by skb_share_check() */ |
@@ -290,9 +291,10 @@ static void batadv_recv_handler_init(void) | |||
290 | batadv_rx_handler[BATADV_ROAM_ADV] = batadv_recv_roam_adv; | 291 | batadv_rx_handler[BATADV_ROAM_ADV] = batadv_recv_roam_adv; |
291 | } | 292 | } |
292 | 293 | ||
293 | int batadv_recv_handler_register(uint8_t packet_type, | 294 | int |
294 | int (*recv_handler)(struct sk_buff *, | 295 | batadv_recv_handler_register(uint8_t packet_type, |
295 | struct hard_iface *)) | 296 | int (*recv_handler)(struct sk_buff *, |
297 | struct batadv_hard_iface *)) | ||
296 | { | 298 | { |
297 | if (batadv_rx_handler[packet_type] != &batadv_recv_unhandled_packet) | 299 | if (batadv_rx_handler[packet_type] != &batadv_recv_unhandled_packet) |
298 | return -EBUSY; | 300 | return -EBUSY; |
@@ -306,9 +308,9 @@ void batadv_recv_handler_unregister(uint8_t packet_type) | |||
306 | batadv_rx_handler[packet_type] = batadv_recv_unhandled_packet; | 308 | batadv_rx_handler[packet_type] = batadv_recv_unhandled_packet; |
307 | } | 309 | } |
308 | 310 | ||
309 | static struct bat_algo_ops *batadv_algo_get(char *name) | 311 | static struct batadv_algo_ops *batadv_algo_get(char *name) |
310 | { | 312 | { |
311 | struct bat_algo_ops *bat_algo_ops = NULL, *bat_algo_ops_tmp; | 313 | struct batadv_algo_ops *bat_algo_ops = NULL, *bat_algo_ops_tmp; |
312 | struct hlist_node *node; | 314 | struct hlist_node *node; |
313 | 315 | ||
314 | hlist_for_each_entry(bat_algo_ops_tmp, node, &batadv_algo_list, list) { | 316 | hlist_for_each_entry(bat_algo_ops_tmp, node, &batadv_algo_list, list) { |
@@ -322,9 +324,9 @@ static struct bat_algo_ops *batadv_algo_get(char *name) | |||
322 | return bat_algo_ops; | 324 | return bat_algo_ops; |
323 | } | 325 | } |
324 | 326 | ||
325 | int batadv_algo_register(struct bat_algo_ops *bat_algo_ops) | 327 | int batadv_algo_register(struct batadv_algo_ops *bat_algo_ops) |
326 | { | 328 | { |
327 | struct bat_algo_ops *bat_algo_ops_tmp; | 329 | struct batadv_algo_ops *bat_algo_ops_tmp; |
328 | int ret; | 330 | int ret; |
329 | 331 | ||
330 | bat_algo_ops_tmp = batadv_algo_get(bat_algo_ops->name); | 332 | bat_algo_ops_tmp = batadv_algo_get(bat_algo_ops->name); |
@@ -356,9 +358,9 @@ out: | |||
356 | return ret; | 358 | return ret; |
357 | } | 359 | } |
358 | 360 | ||
359 | int batadv_algo_select(struct bat_priv *bat_priv, char *name) | 361 | int batadv_algo_select(struct batadv_priv *bat_priv, char *name) |
360 | { | 362 | { |
361 | struct bat_algo_ops *bat_algo_ops; | 363 | struct batadv_algo_ops *bat_algo_ops; |
362 | int ret = -EINVAL; | 364 | int ret = -EINVAL; |
363 | 365 | ||
364 | bat_algo_ops = batadv_algo_get(name); | 366 | bat_algo_ops = batadv_algo_get(name); |
@@ -374,7 +376,7 @@ out: | |||
374 | 376 | ||
375 | int batadv_algo_seq_print_text(struct seq_file *seq, void *offset) | 377 | int batadv_algo_seq_print_text(struct seq_file *seq, void *offset) |
376 | { | 378 | { |
377 | struct bat_algo_ops *bat_algo_ops; | 379 | struct batadv_algo_ops *bat_algo_ops; |
378 | struct hlist_node *node; | 380 | struct hlist_node *node; |
379 | 381 | ||
380 | seq_printf(seq, "Available routing algorithms:\n"); | 382 | seq_printf(seq, "Available routing algorithms:\n"); |
@@ -388,7 +390,7 @@ int batadv_algo_seq_print_text(struct seq_file *seq, void *offset) | |||
388 | 390 | ||
389 | static int batadv_param_set_ra(const char *val, const struct kernel_param *kp) | 391 | static int batadv_param_set_ra(const char *val, const struct kernel_param *kp) |
390 | { | 392 | { |
391 | struct bat_algo_ops *bat_algo_ops; | 393 | struct batadv_algo_ops *bat_algo_ops; |
392 | char *algo_name = (char *)val; | 394 | char *algo_name = (char *)val; |
393 | size_t name_len = strlen(algo_name); | 395 | size_t name_len = strlen(algo_name); |
394 | 396 | ||
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h index 68e13ac08a0f..8193650e5496 100644 --- a/net/batman-adv/main.h +++ b/net/batman-adv/main.h | |||
@@ -164,16 +164,17 @@ int batadv_is_my_mac(const uint8_t *addr); | |||
164 | int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev, | 164 | int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev, |
165 | struct packet_type *ptype, | 165 | struct packet_type *ptype, |
166 | struct net_device *orig_dev); | 166 | struct net_device *orig_dev); |
167 | int batadv_recv_handler_register(uint8_t packet_type, | 167 | int |
168 | int (*recv_handler)(struct sk_buff *, | 168 | batadv_recv_handler_register(uint8_t packet_type, |
169 | struct hard_iface *)); | 169 | int (*recv_handler)(struct sk_buff *, |
170 | struct batadv_hard_iface *)); | ||
170 | void batadv_recv_handler_unregister(uint8_t packet_type); | 171 | void batadv_recv_handler_unregister(uint8_t packet_type); |
171 | int batadv_algo_register(struct bat_algo_ops *bat_algo_ops); | 172 | int batadv_algo_register(struct batadv_algo_ops *bat_algo_ops); |
172 | int batadv_algo_select(struct bat_priv *bat_priv, char *name); | 173 | int batadv_algo_select(struct batadv_priv *bat_priv, char *name); |
173 | int batadv_algo_seq_print_text(struct seq_file *seq, void *offset); | 174 | int batadv_algo_seq_print_text(struct seq_file *seq, void *offset); |
174 | 175 | ||
175 | #ifdef CONFIG_BATMAN_ADV_DEBUG | 176 | #ifdef CONFIG_BATMAN_ADV_DEBUG |
176 | int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...) | 177 | int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...) |
177 | __printf(2, 3); | 178 | __printf(2, 3); |
178 | 179 | ||
179 | #define batadv_dbg(type, bat_priv, fmt, arg...) \ | 180 | #define batadv_dbg(type, bat_priv, fmt, arg...) \ |
@@ -185,7 +186,7 @@ __printf(2, 3); | |||
185 | #else /* !CONFIG_BATMAN_ADV_DEBUG */ | 186 | #else /* !CONFIG_BATMAN_ADV_DEBUG */ |
186 | __printf(3, 4) | 187 | __printf(3, 4) |
187 | static inline void batadv_dbg(int type __always_unused, | 188 | static inline void batadv_dbg(int type __always_unused, |
188 | struct bat_priv *bat_priv __always_unused, | 189 | struct batadv_priv *bat_priv __always_unused, |
189 | const char *fmt __always_unused, ...) | 190 | const char *fmt __always_unused, ...) |
190 | { | 191 | { |
191 | } | 192 | } |
@@ -194,14 +195,14 @@ static inline void batadv_dbg(int type __always_unused, | |||
194 | #define batadv_info(net_dev, fmt, arg...) \ | 195 | #define batadv_info(net_dev, fmt, arg...) \ |
195 | do { \ | 196 | do { \ |
196 | struct net_device *_netdev = (net_dev); \ | 197 | struct net_device *_netdev = (net_dev); \ |
197 | struct bat_priv *_batpriv = netdev_priv(_netdev); \ | 198 | struct batadv_priv *_batpriv = netdev_priv(_netdev); \ |
198 | batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt, ## arg); \ | 199 | batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt, ## arg); \ |
199 | pr_info("%s: " fmt, _netdev->name, ## arg); \ | 200 | pr_info("%s: " fmt, _netdev->name, ## arg); \ |
200 | } while (0) | 201 | } while (0) |
201 | #define batadv_err(net_dev, fmt, arg...) \ | 202 | #define batadv_err(net_dev, fmt, arg...) \ |
202 | do { \ | 203 | do { \ |
203 | struct net_device *_netdev = (net_dev); \ | 204 | struct net_device *_netdev = (net_dev); \ |
204 | struct bat_priv *_batpriv = netdev_priv(_netdev); \ | 205 | struct batadv_priv *_batpriv = netdev_priv(_netdev); \ |
205 | batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt, ## arg); \ | 206 | batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt, ## arg); \ |
206 | pr_err("%s: " fmt, _netdev->name, ## arg); \ | 207 | pr_err("%s: " fmt, _netdev->name, ## arg); \ |
207 | } while (0) | 208 | } while (0) |
@@ -250,7 +251,7 @@ static inline bool batadv_has_timed_out(unsigned long timestamp, | |||
250 | #define batadv_seq_after(x, y) batadv_seq_before(y, x) | 251 | #define batadv_seq_after(x, y) batadv_seq_before(y, x) |
251 | 252 | ||
252 | /* Stop preemption on local cpu while incrementing the counter */ | 253 | /* Stop preemption on local cpu while incrementing the counter */ |
253 | static inline void batadv_add_counter(struct bat_priv *bat_priv, size_t idx, | 254 | static inline void batadv_add_counter(struct batadv_priv *bat_priv, size_t idx, |
254 | size_t count) | 255 | size_t count) |
255 | { | 256 | { |
256 | int cpu = get_cpu(); | 257 | int cpu = get_cpu(); |
@@ -261,7 +262,8 @@ static inline void batadv_add_counter(struct bat_priv *bat_priv, size_t idx, | |||
261 | #define batadv_inc_counter(b, i) batadv_add_counter(b, i, 1) | 262 | #define batadv_inc_counter(b, i) batadv_add_counter(b, i, 1) |
262 | 263 | ||
263 | /* Sum and return the cpu-local counters for index 'idx' */ | 264 | /* Sum and return the cpu-local counters for index 'idx' */ |
264 | static inline uint64_t batadv_sum_counter(struct bat_priv *bat_priv, size_t idx) | 265 | static inline uint64_t batadv_sum_counter(struct batadv_priv *bat_priv, |
266 | size_t idx) | ||
265 | { | 267 | { |
266 | uint64_t *counters; | 268 | uint64_t *counters; |
267 | int cpu; | 269 | int cpu; |
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index dc9c4bf63118..fc1ce26ac627 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | static void batadv_purge_orig(struct work_struct *work); | 31 | static void batadv_purge_orig(struct work_struct *work); |
32 | 32 | ||
33 | static void batadv_start_purge_timer(struct bat_priv *bat_priv) | 33 | static void batadv_start_purge_timer(struct batadv_priv *bat_priv) |
34 | { | 34 | { |
35 | INIT_DELAYED_WORK(&bat_priv->orig_work, batadv_purge_orig); | 35 | INIT_DELAYED_WORK(&bat_priv->orig_work, batadv_purge_orig); |
36 | queue_delayed_work(batadv_event_workqueue, | 36 | queue_delayed_work(batadv_event_workqueue, |
@@ -40,12 +40,13 @@ static void batadv_start_purge_timer(struct bat_priv *bat_priv) | |||
40 | /* returns 1 if they are the same originator */ | 40 | /* returns 1 if they are the same originator */ |
41 | static int batadv_compare_orig(const struct hlist_node *node, const void *data2) | 41 | static int batadv_compare_orig(const struct hlist_node *node, const void *data2) |
42 | { | 42 | { |
43 | const void *data1 = container_of(node, struct orig_node, hash_entry); | 43 | const void *data1 = container_of(node, struct batadv_orig_node, |
44 | hash_entry); | ||
44 | 45 | ||
45 | return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); | 46 | return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); |
46 | } | 47 | } |
47 | 48 | ||
48 | int batadv_originator_init(struct bat_priv *bat_priv) | 49 | int batadv_originator_init(struct batadv_priv *bat_priv) |
49 | { | 50 | { |
50 | if (bat_priv->orig_hash) | 51 | if (bat_priv->orig_hash) |
51 | return 0; | 52 | return 0; |
@@ -62,16 +63,17 @@ err: | |||
62 | return -ENOMEM; | 63 | return -ENOMEM; |
63 | } | 64 | } |
64 | 65 | ||
65 | void batadv_neigh_node_free_ref(struct neigh_node *neigh_node) | 66 | void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node) |
66 | { | 67 | { |
67 | if (atomic_dec_and_test(&neigh_node->refcount)) | 68 | if (atomic_dec_and_test(&neigh_node->refcount)) |
68 | kfree_rcu(neigh_node, rcu); | 69 | kfree_rcu(neigh_node, rcu); |
69 | } | 70 | } |
70 | 71 | ||
71 | /* increases the refcounter of a found router */ | 72 | /* increases the refcounter of a found router */ |
72 | struct neigh_node *batadv_orig_node_get_router(struct orig_node *orig_node) | 73 | struct batadv_neigh_node * |
74 | batadv_orig_node_get_router(struct batadv_orig_node *orig_node) | ||
73 | { | 75 | { |
74 | struct neigh_node *router; | 76 | struct batadv_neigh_node *router; |
75 | 77 | ||
76 | rcu_read_lock(); | 78 | rcu_read_lock(); |
77 | router = rcu_dereference(orig_node->router); | 79 | router = rcu_dereference(orig_node->router); |
@@ -83,12 +85,12 @@ struct neigh_node *batadv_orig_node_get_router(struct orig_node *orig_node) | |||
83 | return router; | 85 | return router; |
84 | } | 86 | } |
85 | 87 | ||
86 | struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface, | 88 | struct batadv_neigh_node * |
87 | const uint8_t *neigh_addr, | 89 | batadv_neigh_node_new(struct batadv_hard_iface *hard_iface, |
88 | uint32_t seqno) | 90 | const uint8_t *neigh_addr, uint32_t seqno) |
89 | { | 91 | { |
90 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 92 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
91 | struct neigh_node *neigh_node; | 93 | struct batadv_neigh_node *neigh_node; |
92 | 94 | ||
93 | neigh_node = kzalloc(sizeof(*neigh_node), GFP_ATOMIC); | 95 | neigh_node = kzalloc(sizeof(*neigh_node), GFP_ATOMIC); |
94 | if (!neigh_node) | 96 | if (!neigh_node) |
@@ -113,10 +115,10 @@ out: | |||
113 | static void batadv_orig_node_free_rcu(struct rcu_head *rcu) | 115 | static void batadv_orig_node_free_rcu(struct rcu_head *rcu) |
114 | { | 116 | { |
115 | struct hlist_node *node, *node_tmp; | 117 | struct hlist_node *node, *node_tmp; |
116 | struct neigh_node *neigh_node, *tmp_neigh_node; | 118 | struct batadv_neigh_node *neigh_node, *tmp_neigh_node; |
117 | struct orig_node *orig_node; | 119 | struct batadv_orig_node *orig_node; |
118 | 120 | ||
119 | orig_node = container_of(rcu, struct orig_node, rcu); | 121 | orig_node = container_of(rcu, struct batadv_orig_node, rcu); |
120 | 122 | ||
121 | spin_lock_bh(&orig_node->neigh_list_lock); | 123 | spin_lock_bh(&orig_node->neigh_list_lock); |
122 | 124 | ||
@@ -146,19 +148,19 @@ static void batadv_orig_node_free_rcu(struct rcu_head *rcu) | |||
146 | kfree(orig_node); | 148 | kfree(orig_node); |
147 | } | 149 | } |
148 | 150 | ||
149 | void batadv_orig_node_free_ref(struct orig_node *orig_node) | 151 | void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node) |
150 | { | 152 | { |
151 | if (atomic_dec_and_test(&orig_node->refcount)) | 153 | if (atomic_dec_and_test(&orig_node->refcount)) |
152 | call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu); | 154 | call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu); |
153 | } | 155 | } |
154 | 156 | ||
155 | void batadv_originator_free(struct bat_priv *bat_priv) | 157 | void batadv_originator_free(struct batadv_priv *bat_priv) |
156 | { | 158 | { |
157 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 159 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
158 | struct hlist_node *node, *node_tmp; | 160 | struct hlist_node *node, *node_tmp; |
159 | struct hlist_head *head; | 161 | struct hlist_head *head; |
160 | spinlock_t *list_lock; /* spinlock to protect write access */ | 162 | spinlock_t *list_lock; /* spinlock to protect write access */ |
161 | struct orig_node *orig_node; | 163 | struct batadv_orig_node *orig_node; |
162 | uint32_t i; | 164 | uint32_t i; |
163 | 165 | ||
164 | if (!hash) | 166 | if (!hash) |
@@ -188,10 +190,10 @@ void batadv_originator_free(struct bat_priv *bat_priv) | |||
188 | /* this function finds or creates an originator entry for the given | 190 | /* this function finds or creates an originator entry for the given |
189 | * address if it does not exits | 191 | * address if it does not exits |
190 | */ | 192 | */ |
191 | struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv, | 193 | struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv, |
192 | const uint8_t *addr) | 194 | const uint8_t *addr) |
193 | { | 195 | { |
194 | struct orig_node *orig_node; | 196 | struct batadv_orig_node *orig_node; |
195 | int size; | 197 | int size; |
196 | int hash_added; | 198 | int hash_added; |
197 | unsigned long reset_time; | 199 | unsigned long reset_time; |
@@ -264,15 +266,16 @@ free_orig_node: | |||
264 | return NULL; | 266 | return NULL; |
265 | } | 267 | } |
266 | 268 | ||
267 | static bool batadv_purge_orig_neighbors(struct bat_priv *bat_priv, | 269 | static bool |
268 | struct orig_node *orig_node, | 270 | batadv_purge_orig_neighbors(struct batadv_priv *bat_priv, |
269 | struct neigh_node **best_neigh_node) | 271 | struct batadv_orig_node *orig_node, |
272 | struct batadv_neigh_node **best_neigh_node) | ||
270 | { | 273 | { |
271 | struct hlist_node *node, *node_tmp; | 274 | struct hlist_node *node, *node_tmp; |
272 | struct neigh_node *neigh_node; | 275 | struct batadv_neigh_node *neigh_node; |
273 | bool neigh_purged = false; | 276 | bool neigh_purged = false; |
274 | unsigned long last_seen; | 277 | unsigned long last_seen; |
275 | struct hard_iface *if_incoming; | 278 | struct batadv_hard_iface *if_incoming; |
276 | 279 | ||
277 | *best_neigh_node = NULL; | 280 | *best_neigh_node = NULL; |
278 | 281 | ||
@@ -319,10 +322,10 @@ static bool batadv_purge_orig_neighbors(struct bat_priv *bat_priv, | |||
319 | return neigh_purged; | 322 | return neigh_purged; |
320 | } | 323 | } |
321 | 324 | ||
322 | static bool batadv_purge_orig_node(struct bat_priv *bat_priv, | 325 | static bool batadv_purge_orig_node(struct batadv_priv *bat_priv, |
323 | struct orig_node *orig_node) | 326 | struct batadv_orig_node *orig_node) |
324 | { | 327 | { |
325 | struct neigh_node *best_neigh_node; | 328 | struct batadv_neigh_node *best_neigh_node; |
326 | 329 | ||
327 | if (batadv_has_timed_out(orig_node->last_seen, | 330 | if (batadv_has_timed_out(orig_node->last_seen, |
328 | 2 * BATADV_PURGE_TIMEOUT)) { | 331 | 2 * BATADV_PURGE_TIMEOUT)) { |
@@ -341,13 +344,13 @@ static bool batadv_purge_orig_node(struct bat_priv *bat_priv, | |||
341 | return false; | 344 | return false; |
342 | } | 345 | } |
343 | 346 | ||
344 | static void _batadv_purge_orig(struct bat_priv *bat_priv) | 347 | static void _batadv_purge_orig(struct batadv_priv *bat_priv) |
345 | { | 348 | { |
346 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 349 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
347 | struct hlist_node *node, *node_tmp; | 350 | struct hlist_node *node, *node_tmp; |
348 | struct hlist_head *head; | 351 | struct hlist_head *head; |
349 | spinlock_t *list_lock; /* spinlock to protect write access */ | 352 | spinlock_t *list_lock; /* spinlock to protect write access */ |
350 | struct orig_node *orig_node; | 353 | struct batadv_orig_node *orig_node; |
351 | uint32_t i; | 354 | uint32_t i; |
352 | 355 | ||
353 | if (!hash) | 356 | if (!hash) |
@@ -383,16 +386,16 @@ static void _batadv_purge_orig(struct bat_priv *bat_priv) | |||
383 | 386 | ||
384 | static void batadv_purge_orig(struct work_struct *work) | 387 | static void batadv_purge_orig(struct work_struct *work) |
385 | { | 388 | { |
386 | struct delayed_work *delayed_work = | 389 | struct delayed_work *delayed_work; |
387 | container_of(work, struct delayed_work, work); | 390 | struct batadv_priv *bat_priv; |
388 | struct bat_priv *bat_priv = | ||
389 | container_of(delayed_work, struct bat_priv, orig_work); | ||
390 | 391 | ||
392 | delayed_work = container_of(work, struct delayed_work, work); | ||
393 | bat_priv = container_of(delayed_work, struct batadv_priv, orig_work); | ||
391 | _batadv_purge_orig(bat_priv); | 394 | _batadv_purge_orig(bat_priv); |
392 | batadv_start_purge_timer(bat_priv); | 395 | batadv_start_purge_timer(bat_priv); |
393 | } | 396 | } |
394 | 397 | ||
395 | void batadv_purge_orig_ref(struct bat_priv *bat_priv) | 398 | void batadv_purge_orig_ref(struct batadv_priv *bat_priv) |
396 | { | 399 | { |
397 | _batadv_purge_orig(bat_priv); | 400 | _batadv_purge_orig(bat_priv); |
398 | } | 401 | } |
@@ -400,13 +403,13 @@ void batadv_purge_orig_ref(struct bat_priv *bat_priv) | |||
400 | int batadv_orig_seq_print_text(struct seq_file *seq, void *offset) | 403 | int batadv_orig_seq_print_text(struct seq_file *seq, void *offset) |
401 | { | 404 | { |
402 | struct net_device *net_dev = (struct net_device *)seq->private; | 405 | struct net_device *net_dev = (struct net_device *)seq->private; |
403 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 406 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
404 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 407 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
405 | struct hlist_node *node, *node_tmp; | 408 | struct hlist_node *node, *node_tmp; |
406 | struct hlist_head *head; | 409 | struct hlist_head *head; |
407 | struct hard_iface *primary_if; | 410 | struct batadv_hard_iface *primary_if; |
408 | struct orig_node *orig_node; | 411 | struct batadv_orig_node *orig_node; |
409 | struct neigh_node *neigh_node, *neigh_node_tmp; | 412 | struct batadv_neigh_node *neigh_node, *neigh_node_tmp; |
410 | int batman_count = 0; | 413 | int batman_count = 0; |
411 | int last_seen_secs; | 414 | int last_seen_secs; |
412 | int last_seen_msecs; | 415 | int last_seen_msecs; |
@@ -484,7 +487,8 @@ out: | |||
484 | return ret; | 487 | return ret; |
485 | } | 488 | } |
486 | 489 | ||
487 | static int batadv_orig_node_add_if(struct orig_node *orig_node, int max_if_num) | 490 | static int batadv_orig_node_add_if(struct batadv_orig_node *orig_node, |
491 | int max_if_num) | ||
488 | { | 492 | { |
489 | void *data_ptr; | 493 | void *data_ptr; |
490 | size_t data_size, old_size; | 494 | size_t data_size, old_size; |
@@ -511,13 +515,14 @@ static int batadv_orig_node_add_if(struct orig_node *orig_node, int max_if_num) | |||
511 | return 0; | 515 | return 0; |
512 | } | 516 | } |
513 | 517 | ||
514 | int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num) | 518 | int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface, |
519 | int max_if_num) | ||
515 | { | 520 | { |
516 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 521 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
517 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 522 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
518 | struct hlist_node *node; | 523 | struct hlist_node *node; |
519 | struct hlist_head *head; | 524 | struct hlist_head *head; |
520 | struct orig_node *orig_node; | 525 | struct batadv_orig_node *orig_node; |
521 | uint32_t i; | 526 | uint32_t i; |
522 | int ret; | 527 | int ret; |
523 | 528 | ||
@@ -546,7 +551,7 @@ err: | |||
546 | return -ENOMEM; | 551 | return -ENOMEM; |
547 | } | 552 | } |
548 | 553 | ||
549 | static int batadv_orig_node_del_if(struct orig_node *orig_node, | 554 | static int batadv_orig_node_del_if(struct batadv_orig_node *orig_node, |
550 | int max_if_num, int del_if_num) | 555 | int max_if_num, int del_if_num) |
551 | { | 556 | { |
552 | void *data_ptr = NULL; | 557 | void *data_ptr = NULL; |
@@ -594,14 +599,15 @@ free_own_sum: | |||
594 | return 0; | 599 | return 0; |
595 | } | 600 | } |
596 | 601 | ||
597 | int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num) | 602 | int batadv_orig_hash_del_if(struct batadv_hard_iface *hard_iface, |
603 | int max_if_num) | ||
598 | { | 604 | { |
599 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 605 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
600 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 606 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
601 | struct hlist_node *node; | 607 | struct hlist_node *node; |
602 | struct hlist_head *head; | 608 | struct hlist_head *head; |
603 | struct hard_iface *hard_iface_tmp; | 609 | struct batadv_hard_iface *hard_iface_tmp; |
604 | struct orig_node *orig_node; | 610 | struct batadv_orig_node *orig_node; |
605 | uint32_t i; | 611 | uint32_t i; |
606 | int ret; | 612 | int ret; |
607 | 613 | ||
diff --git a/net/batman-adv/originator.h b/net/batman-adv/originator.h index 32e7e289a76e..9778e656dec7 100644 --- a/net/batman-adv/originator.h +++ b/net/batman-adv/originator.h | |||
@@ -22,20 +22,23 @@ | |||
22 | 22 | ||
23 | #include "hash.h" | 23 | #include "hash.h" |
24 | 24 | ||
25 | int batadv_originator_init(struct bat_priv *bat_priv); | 25 | int batadv_originator_init(struct batadv_priv *bat_priv); |
26 | void batadv_originator_free(struct bat_priv *bat_priv); | 26 | void batadv_originator_free(struct batadv_priv *bat_priv); |
27 | void batadv_purge_orig_ref(struct bat_priv *bat_priv); | 27 | void batadv_purge_orig_ref(struct batadv_priv *bat_priv); |
28 | void batadv_orig_node_free_ref(struct orig_node *orig_node); | 28 | void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node); |
29 | struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv, | 29 | struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv, |
30 | const uint8_t *addr); | 30 | const uint8_t *addr); |
31 | struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface, | 31 | struct batadv_neigh_node * |
32 | const uint8_t *neigh_addr, | 32 | batadv_neigh_node_new(struct batadv_hard_iface *hard_iface, |
33 | uint32_t seqno); | 33 | const uint8_t *neigh_addr, uint32_t seqno); |
34 | void batadv_neigh_node_free_ref(struct neigh_node *neigh_node); | 34 | void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node); |
35 | struct neigh_node *batadv_orig_node_get_router(struct orig_node *orig_node); | 35 | struct batadv_neigh_node * |
36 | batadv_orig_node_get_router(struct batadv_orig_node *orig_node); | ||
36 | int batadv_orig_seq_print_text(struct seq_file *seq, void *offset); | 37 | int batadv_orig_seq_print_text(struct seq_file *seq, void *offset); |
37 | int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num); | 38 | int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface, |
38 | int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num); | 39 | int max_if_num); |
40 | int batadv_orig_hash_del_if(struct batadv_hard_iface *hard_iface, | ||
41 | int max_if_num); | ||
39 | 42 | ||
40 | 43 | ||
41 | /* hashfunction to choose an entry in a hash table of given size | 44 | /* hashfunction to choose an entry in a hash table of given size |
@@ -60,13 +63,13 @@ static inline uint32_t batadv_choose_orig(const void *data, uint32_t size) | |||
60 | return hash % size; | 63 | return hash % size; |
61 | } | 64 | } |
62 | 65 | ||
63 | static inline struct orig_node *batadv_orig_hash_find(struct bat_priv *bat_priv, | 66 | static inline struct batadv_orig_node * |
64 | const void *data) | 67 | batadv_orig_hash_find(struct batadv_priv *bat_priv, const void *data) |
65 | { | 68 | { |
66 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 69 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
67 | struct hlist_head *head; | 70 | struct hlist_head *head; |
68 | struct hlist_node *node; | 71 | struct hlist_node *node; |
69 | struct orig_node *orig_node, *orig_node_tmp = NULL; | 72 | struct batadv_orig_node *orig_node, *orig_node_tmp = NULL; |
70 | int index; | 73 | int index; |
71 | 74 | ||
72 | if (!hash) | 75 | if (!hash) |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index e15790761105..b79e42e0c0b5 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -30,15 +30,15 @@ | |||
30 | #include "bridge_loop_avoidance.h" | 30 | #include "bridge_loop_avoidance.h" |
31 | 31 | ||
32 | static int batadv_route_unicast_packet(struct sk_buff *skb, | 32 | static int batadv_route_unicast_packet(struct sk_buff *skb, |
33 | struct hard_iface *recv_if); | 33 | struct batadv_hard_iface *recv_if); |
34 | 34 | ||
35 | void batadv_slide_own_bcast_window(struct hard_iface *hard_iface) | 35 | void batadv_slide_own_bcast_window(struct batadv_hard_iface *hard_iface) |
36 | { | 36 | { |
37 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 37 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
38 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 38 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
39 | struct hlist_node *node; | 39 | struct hlist_node *node; |
40 | struct hlist_head *head; | 40 | struct hlist_head *head; |
41 | struct orig_node *orig_node; | 41 | struct batadv_orig_node *orig_node; |
42 | unsigned long *word; | 42 | unsigned long *word; |
43 | uint32_t i; | 43 | uint32_t i; |
44 | size_t word_index; | 44 | size_t word_index; |
@@ -62,11 +62,11 @@ void batadv_slide_own_bcast_window(struct hard_iface *hard_iface) | |||
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | static void _batadv_update_route(struct bat_priv *bat_priv, | 65 | static void _batadv_update_route(struct batadv_priv *bat_priv, |
66 | struct orig_node *orig_node, | 66 | struct batadv_orig_node *orig_node, |
67 | struct neigh_node *neigh_node) | 67 | struct batadv_neigh_node *neigh_node) |
68 | { | 68 | { |
69 | struct neigh_node *curr_router; | 69 | struct batadv_neigh_node *curr_router; |
70 | 70 | ||
71 | curr_router = batadv_orig_node_get_router(orig_node); | 71 | curr_router = batadv_orig_node_get_router(orig_node); |
72 | 72 | ||
@@ -107,10 +107,11 @@ static void _batadv_update_route(struct bat_priv *bat_priv, | |||
107 | batadv_neigh_node_free_ref(curr_router); | 107 | batadv_neigh_node_free_ref(curr_router); |
108 | } | 108 | } |
109 | 109 | ||
110 | void batadv_update_route(struct bat_priv *bat_priv, struct orig_node *orig_node, | 110 | void batadv_update_route(struct batadv_priv *bat_priv, |
111 | struct neigh_node *neigh_node) | 111 | struct batadv_orig_node *orig_node, |
112 | struct batadv_neigh_node *neigh_node) | ||
112 | { | 113 | { |
113 | struct neigh_node *router = NULL; | 114 | struct batadv_neigh_node *router = NULL; |
114 | 115 | ||
115 | if (!orig_node) | 116 | if (!orig_node) |
116 | goto out; | 117 | goto out; |
@@ -126,8 +127,8 @@ out: | |||
126 | } | 127 | } |
127 | 128 | ||
128 | /* caller must hold the neigh_list_lock */ | 129 | /* caller must hold the neigh_list_lock */ |
129 | void batadv_bonding_candidate_del(struct orig_node *orig_node, | 130 | void batadv_bonding_candidate_del(struct batadv_orig_node *orig_node, |
130 | struct neigh_node *neigh_node) | 131 | struct batadv_neigh_node *neigh_node) |
131 | { | 132 | { |
132 | /* this neighbor is not part of our candidate list */ | 133 | /* this neighbor is not part of our candidate list */ |
133 | if (list_empty(&neigh_node->bonding_list)) | 134 | if (list_empty(&neigh_node->bonding_list)) |
@@ -142,11 +143,11 @@ out: | |||
142 | return; | 143 | return; |
143 | } | 144 | } |
144 | 145 | ||
145 | void batadv_bonding_candidate_add(struct orig_node *orig_node, | 146 | void batadv_bonding_candidate_add(struct batadv_orig_node *orig_node, |
146 | struct neigh_node *neigh_node) | 147 | struct batadv_neigh_node *neigh_node) |
147 | { | 148 | { |
148 | struct hlist_node *node; | 149 | struct hlist_node *node; |
149 | struct neigh_node *tmp_neigh_node, *router = NULL; | 150 | struct batadv_neigh_node *tmp_neigh_node, *router = NULL; |
150 | uint8_t interference_candidate = 0; | 151 | uint8_t interference_candidate = 0; |
151 | 152 | ||
152 | spin_lock_bh(&orig_node->neigh_list_lock); | 153 | spin_lock_bh(&orig_node->neigh_list_lock); |
@@ -215,8 +216,8 @@ out: | |||
215 | 216 | ||
216 | /* copy primary address for bonding */ | 217 | /* copy primary address for bonding */ |
217 | void | 218 | void |
218 | batadv_bonding_save_primary(const struct orig_node *orig_node, | 219 | batadv_bonding_save_primary(const struct batadv_orig_node *orig_node, |
219 | struct orig_node *orig_neigh_node, | 220 | struct batadv_orig_node *orig_neigh_node, |
220 | const struct batadv_ogm_packet *batman_ogm_packet) | 221 | const struct batadv_ogm_packet *batman_ogm_packet) |
221 | { | 222 | { |
222 | if (!(batman_ogm_packet->flags & BATADV_PRIMARIES_FIRST_HOP)) | 223 | if (!(batman_ogm_packet->flags & BATADV_PRIMARIES_FIRST_HOP)) |
@@ -230,7 +231,7 @@ batadv_bonding_save_primary(const struct orig_node *orig_node, | |||
230 | * 0 if the packet is to be accepted | 231 | * 0 if the packet is to be accepted |
231 | * 1 if the packet is to be ignored. | 232 | * 1 if the packet is to be ignored. |
232 | */ | 233 | */ |
233 | int batadv_window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff, | 234 | int batadv_window_protected(struct batadv_priv *bat_priv, int32_t seq_num_diff, |
234 | unsigned long *last_reset) | 235 | unsigned long *last_reset) |
235 | { | 236 | { |
236 | if (seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE || | 237 | if (seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE || |
@@ -248,7 +249,7 @@ int batadv_window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff, | |||
248 | } | 249 | } |
249 | 250 | ||
250 | bool batadv_check_management_packet(struct sk_buff *skb, | 251 | bool batadv_check_management_packet(struct sk_buff *skb, |
251 | struct hard_iface *hard_iface, | 252 | struct batadv_hard_iface *hard_iface, |
252 | int header_len) | 253 | int header_len) |
253 | { | 254 | { |
254 | struct ethhdr *ethhdr; | 255 | struct ethhdr *ethhdr; |
@@ -278,12 +279,12 @@ bool batadv_check_management_packet(struct sk_buff *skb, | |||
278 | return true; | 279 | return true; |
279 | } | 280 | } |
280 | 281 | ||
281 | static int batadv_recv_my_icmp_packet(struct bat_priv *bat_priv, | 282 | static int batadv_recv_my_icmp_packet(struct batadv_priv *bat_priv, |
282 | struct sk_buff *skb, size_t icmp_len) | 283 | struct sk_buff *skb, size_t icmp_len) |
283 | { | 284 | { |
284 | struct hard_iface *primary_if = NULL; | 285 | struct batadv_hard_iface *primary_if = NULL; |
285 | struct orig_node *orig_node = NULL; | 286 | struct batadv_orig_node *orig_node = NULL; |
286 | struct neigh_node *router = NULL; | 287 | struct batadv_neigh_node *router = NULL; |
287 | struct batadv_icmp_packet_rr *icmp_packet; | 288 | struct batadv_icmp_packet_rr *icmp_packet; |
288 | int ret = NET_RX_DROP; | 289 | int ret = NET_RX_DROP; |
289 | 290 | ||
@@ -333,12 +334,12 @@ out: | |||
333 | return ret; | 334 | return ret; |
334 | } | 335 | } |
335 | 336 | ||
336 | static int batadv_recv_icmp_ttl_exceeded(struct bat_priv *bat_priv, | 337 | static int batadv_recv_icmp_ttl_exceeded(struct batadv_priv *bat_priv, |
337 | struct sk_buff *skb) | 338 | struct sk_buff *skb) |
338 | { | 339 | { |
339 | struct hard_iface *primary_if = NULL; | 340 | struct batadv_hard_iface *primary_if = NULL; |
340 | struct orig_node *orig_node = NULL; | 341 | struct batadv_orig_node *orig_node = NULL; |
341 | struct neigh_node *router = NULL; | 342 | struct batadv_neigh_node *router = NULL; |
342 | struct batadv_icmp_packet *icmp_packet; | 343 | struct batadv_icmp_packet *icmp_packet; |
343 | int ret = NET_RX_DROP; | 344 | int ret = NET_RX_DROP; |
344 | 345 | ||
@@ -389,13 +390,14 @@ out: | |||
389 | } | 390 | } |
390 | 391 | ||
391 | 392 | ||
392 | int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if) | 393 | int batadv_recv_icmp_packet(struct sk_buff *skb, |
394 | struct batadv_hard_iface *recv_if) | ||
393 | { | 395 | { |
394 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 396 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
395 | struct batadv_icmp_packet_rr *icmp_packet; | 397 | struct batadv_icmp_packet_rr *icmp_packet; |
396 | struct ethhdr *ethhdr; | 398 | struct ethhdr *ethhdr; |
397 | struct orig_node *orig_node = NULL; | 399 | struct batadv_orig_node *orig_node = NULL; |
398 | struct neigh_node *router = NULL; | 400 | struct batadv_neigh_node *router = NULL; |
399 | int hdr_size = sizeof(struct batadv_icmp_packet); | 401 | int hdr_size = sizeof(struct batadv_icmp_packet); |
400 | int ret = NET_RX_DROP; | 402 | int ret = NET_RX_DROP; |
401 | 403 | ||
@@ -475,12 +477,12 @@ out: | |||
475 | * This method rotates the bonding list and increases the | 477 | * This method rotates the bonding list and increases the |
476 | * returned router's refcount. | 478 | * returned router's refcount. |
477 | */ | 479 | */ |
478 | static struct neigh_node * | 480 | static struct batadv_neigh_node * |
479 | batadv_find_bond_router(struct orig_node *primary_orig, | 481 | batadv_find_bond_router(struct batadv_orig_node *primary_orig, |
480 | const struct hard_iface *recv_if) | 482 | const struct batadv_hard_iface *recv_if) |
481 | { | 483 | { |
482 | struct neigh_node *tmp_neigh_node; | 484 | struct batadv_neigh_node *tmp_neigh_node; |
483 | struct neigh_node *router = NULL, *first_candidate = NULL; | 485 | struct batadv_neigh_node *router = NULL, *first_candidate = NULL; |
484 | 486 | ||
485 | rcu_read_lock(); | 487 | rcu_read_lock(); |
486 | list_for_each_entry_rcu(tmp_neigh_node, &primary_orig->bond_list, | 488 | list_for_each_entry_rcu(tmp_neigh_node, &primary_orig->bond_list, |
@@ -530,12 +532,12 @@ out: | |||
530 | * | 532 | * |
531 | * Increases the returned router's refcount | 533 | * Increases the returned router's refcount |
532 | */ | 534 | */ |
533 | static struct neigh_node * | 535 | static struct batadv_neigh_node * |
534 | batadv_find_ifalter_router(struct orig_node *primary_orig, | 536 | batadv_find_ifalter_router(struct batadv_orig_node *primary_orig, |
535 | const struct hard_iface *recv_if) | 537 | const struct batadv_hard_iface *recv_if) |
536 | { | 538 | { |
537 | struct neigh_node *tmp_neigh_node; | 539 | struct batadv_neigh_node *tmp_neigh_node; |
538 | struct neigh_node *router = NULL, *first_candidate = NULL; | 540 | struct batadv_neigh_node *router = NULL, *first_candidate = NULL; |
539 | 541 | ||
540 | rcu_read_lock(); | 542 | rcu_read_lock(); |
541 | list_for_each_entry_rcu(tmp_neigh_node, &primary_orig->bond_list, | 543 | list_for_each_entry_rcu(tmp_neigh_node, &primary_orig->bond_list, |
@@ -577,9 +579,9 @@ batadv_find_ifalter_router(struct orig_node *primary_orig, | |||
577 | return router; | 579 | return router; |
578 | } | 580 | } |
579 | 581 | ||
580 | int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) | 582 | int batadv_recv_tt_query(struct sk_buff *skb, struct batadv_hard_iface *recv_if) |
581 | { | 583 | { |
582 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 584 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
583 | struct batadv_tt_query_packet *tt_query; | 585 | struct batadv_tt_query_packet *tt_query; |
584 | uint16_t tt_size; | 586 | uint16_t tt_size; |
585 | struct ethhdr *ethhdr; | 587 | struct ethhdr *ethhdr; |
@@ -667,11 +669,11 @@ out: | |||
667 | return NET_RX_DROP; | 669 | return NET_RX_DROP; |
668 | } | 670 | } |
669 | 671 | ||
670 | int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) | 672 | int batadv_recv_roam_adv(struct sk_buff *skb, struct batadv_hard_iface *recv_if) |
671 | { | 673 | { |
672 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 674 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
673 | struct batadv_roam_adv_packet *roam_adv_packet; | 675 | struct batadv_roam_adv_packet *roam_adv_packet; |
674 | struct orig_node *orig_node; | 676 | struct batadv_orig_node *orig_node; |
675 | struct ethhdr *ethhdr; | 677 | struct ethhdr *ethhdr; |
676 | 678 | ||
677 | /* drop packet if it has not necessary minimum size */ | 679 | /* drop packet if it has not necessary minimum size */ |
@@ -731,13 +733,14 @@ out: | |||
731 | * bonding if possible. increases the found neighbors | 733 | * bonding if possible. increases the found neighbors |
732 | * refcount. | 734 | * refcount. |
733 | */ | 735 | */ |
734 | struct neigh_node *batadv_find_router(struct bat_priv *bat_priv, | 736 | struct batadv_neigh_node * |
735 | struct orig_node *orig_node, | 737 | batadv_find_router(struct batadv_priv *bat_priv, |
736 | const struct hard_iface *recv_if) | 738 | struct batadv_orig_node *orig_node, |
739 | const struct batadv_hard_iface *recv_if) | ||
737 | { | 740 | { |
738 | struct orig_node *primary_orig_node; | 741 | struct batadv_orig_node *primary_orig_node; |
739 | struct orig_node *router_orig; | 742 | struct batadv_orig_node *router_orig; |
740 | struct neigh_node *router; | 743 | struct batadv_neigh_node *router; |
741 | static uint8_t zero_mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; | 744 | static uint8_t zero_mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; |
742 | int bonding_enabled; | 745 | int bonding_enabled; |
743 | uint8_t *primary_addr; | 746 | uint8_t *primary_addr; |
@@ -842,11 +845,11 @@ static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size) | |||
842 | } | 845 | } |
843 | 846 | ||
844 | static int batadv_route_unicast_packet(struct sk_buff *skb, | 847 | static int batadv_route_unicast_packet(struct sk_buff *skb, |
845 | struct hard_iface *recv_if) | 848 | struct batadv_hard_iface *recv_if) |
846 | { | 849 | { |
847 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 850 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
848 | struct orig_node *orig_node = NULL; | 851 | struct batadv_orig_node *orig_node = NULL; |
849 | struct neigh_node *neigh_node = NULL; | 852 | struct batadv_neigh_node *neigh_node = NULL; |
850 | struct batadv_unicast_packet *unicast_packet; | 853 | struct batadv_unicast_packet *unicast_packet; |
851 | struct ethhdr *ethhdr = (struct ethhdr *)skb_mac_header(skb); | 854 | struct ethhdr *ethhdr = (struct ethhdr *)skb_mac_header(skb); |
852 | int ret = NET_RX_DROP; | 855 | int ret = NET_RX_DROP; |
@@ -927,12 +930,12 @@ out: | |||
927 | return ret; | 930 | return ret; |
928 | } | 931 | } |
929 | 932 | ||
930 | static int batadv_check_unicast_ttvn(struct bat_priv *bat_priv, | 933 | static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, |
931 | struct sk_buff *skb) { | 934 | struct sk_buff *skb) { |
932 | uint8_t curr_ttvn; | 935 | uint8_t curr_ttvn; |
933 | struct orig_node *orig_node; | 936 | struct batadv_orig_node *orig_node; |
934 | struct ethhdr *ethhdr; | 937 | struct ethhdr *ethhdr; |
935 | struct hard_iface *primary_if; | 938 | struct batadv_hard_iface *primary_if; |
936 | struct batadv_unicast_packet *unicast_packet; | 939 | struct batadv_unicast_packet *unicast_packet; |
937 | bool tt_poss_change; | 940 | bool tt_poss_change; |
938 | int is_old_ttvn; | 941 | int is_old_ttvn; |
@@ -1006,9 +1009,10 @@ static int batadv_check_unicast_ttvn(struct bat_priv *bat_priv, | |||
1006 | return 1; | 1009 | return 1; |
1007 | } | 1010 | } |
1008 | 1011 | ||
1009 | int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | 1012 | int batadv_recv_unicast_packet(struct sk_buff *skb, |
1013 | struct batadv_hard_iface *recv_if) | ||
1010 | { | 1014 | { |
1011 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 1015 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
1012 | struct batadv_unicast_packet *unicast_packet; | 1016 | struct batadv_unicast_packet *unicast_packet; |
1013 | int hdr_size = sizeof(*unicast_packet); | 1017 | int hdr_size = sizeof(*unicast_packet); |
1014 | 1018 | ||
@@ -1031,9 +1035,9 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1031 | } | 1035 | } |
1032 | 1036 | ||
1033 | int batadv_recv_ucast_frag_packet(struct sk_buff *skb, | 1037 | int batadv_recv_ucast_frag_packet(struct sk_buff *skb, |
1034 | struct hard_iface *recv_if) | 1038 | struct batadv_hard_iface *recv_if) |
1035 | { | 1039 | { |
1036 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 1040 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
1037 | struct batadv_unicast_frag_packet *unicast_packet; | 1041 | struct batadv_unicast_frag_packet *unicast_packet; |
1038 | int hdr_size = sizeof(*unicast_packet); | 1042 | int hdr_size = sizeof(*unicast_packet); |
1039 | struct sk_buff *new_skb = NULL; | 1043 | struct sk_buff *new_skb = NULL; |
@@ -1068,10 +1072,11 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb, | |||
1068 | } | 1072 | } |
1069 | 1073 | ||
1070 | 1074 | ||
1071 | int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | 1075 | int batadv_recv_bcast_packet(struct sk_buff *skb, |
1076 | struct batadv_hard_iface *recv_if) | ||
1072 | { | 1077 | { |
1073 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 1078 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
1074 | struct orig_node *orig_node = NULL; | 1079 | struct batadv_orig_node *orig_node = NULL; |
1075 | struct batadv_bcast_packet *bcast_packet; | 1080 | struct batadv_bcast_packet *bcast_packet; |
1076 | struct ethhdr *ethhdr; | 1081 | struct ethhdr *ethhdr; |
1077 | int hdr_size = sizeof(*bcast_packet); | 1082 | int hdr_size = sizeof(*bcast_packet); |
@@ -1158,11 +1163,12 @@ out: | |||
1158 | return ret; | 1163 | return ret; |
1159 | } | 1164 | } |
1160 | 1165 | ||
1161 | int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if) | 1166 | int batadv_recv_vis_packet(struct sk_buff *skb, |
1167 | struct batadv_hard_iface *recv_if) | ||
1162 | { | 1168 | { |
1163 | struct batadv_vis_packet *vis_packet; | 1169 | struct batadv_vis_packet *vis_packet; |
1164 | struct ethhdr *ethhdr; | 1170 | struct ethhdr *ethhdr; |
1165 | struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); | 1171 | struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); |
1166 | int hdr_size = sizeof(*vis_packet); | 1172 | int hdr_size = sizeof(*vis_packet); |
1167 | 1173 | ||
1168 | /* keep skb linear */ | 1174 | /* keep skb linear */ |
diff --git a/net/batman-adv/routing.h b/net/batman-adv/routing.h index ead4ae055776..9262279ea667 100644 --- a/net/batman-adv/routing.h +++ b/net/batman-adv/routing.h | |||
@@ -20,32 +20,40 @@ | |||
20 | #ifndef _NET_BATMAN_ADV_ROUTING_H_ | 20 | #ifndef _NET_BATMAN_ADV_ROUTING_H_ |
21 | #define _NET_BATMAN_ADV_ROUTING_H_ | 21 | #define _NET_BATMAN_ADV_ROUTING_H_ |
22 | 22 | ||
23 | void batadv_slide_own_bcast_window(struct hard_iface *hard_iface); | 23 | void batadv_slide_own_bcast_window(struct batadv_hard_iface *hard_iface); |
24 | bool batadv_check_management_packet(struct sk_buff *skb, | 24 | bool batadv_check_management_packet(struct sk_buff *skb, |
25 | struct hard_iface *hard_iface, | 25 | struct batadv_hard_iface *hard_iface, |
26 | int header_len); | 26 | int header_len); |
27 | void batadv_update_route(struct bat_priv *bat_priv, struct orig_node *orig_node, | 27 | void batadv_update_route(struct batadv_priv *bat_priv, |
28 | struct neigh_node *neigh_node); | 28 | struct batadv_orig_node *orig_node, |
29 | int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if); | 29 | struct batadv_neigh_node *neigh_node); |
30 | int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if); | 30 | int batadv_recv_icmp_packet(struct sk_buff *skb, |
31 | struct batadv_hard_iface *recv_if); | ||
32 | int batadv_recv_unicast_packet(struct sk_buff *skb, | ||
33 | struct batadv_hard_iface *recv_if); | ||
31 | int batadv_recv_ucast_frag_packet(struct sk_buff *skb, | 34 | int batadv_recv_ucast_frag_packet(struct sk_buff *skb, |
32 | struct hard_iface *recv_if); | 35 | struct batadv_hard_iface *recv_if); |
33 | int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if); | 36 | int batadv_recv_bcast_packet(struct sk_buff *skb, |
34 | int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if); | 37 | struct batadv_hard_iface *recv_if); |
35 | int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if); | 38 | int batadv_recv_vis_packet(struct sk_buff *skb, |
36 | int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if); | 39 | struct batadv_hard_iface *recv_if); |
37 | struct neigh_node *batadv_find_router(struct bat_priv *bat_priv, | 40 | int batadv_recv_tt_query(struct sk_buff *skb, |
38 | struct orig_node *orig_node, | 41 | struct batadv_hard_iface *recv_if); |
39 | const struct hard_iface *recv_if); | 42 | int batadv_recv_roam_adv(struct sk_buff *skb, |
40 | void batadv_bonding_candidate_del(struct orig_node *orig_node, | 43 | struct batadv_hard_iface *recv_if); |
41 | struct neigh_node *neigh_node); | 44 | struct batadv_neigh_node * |
42 | void batadv_bonding_candidate_add(struct orig_node *orig_node, | 45 | batadv_find_router(struct batadv_priv *bat_priv, |
43 | struct neigh_node *neigh_node); | 46 | struct batadv_orig_node *orig_node, |
44 | void batadv_bonding_save_primary(const struct orig_node *orig_node, | 47 | const struct batadv_hard_iface *recv_if); |
45 | struct orig_node *orig_neigh_node, | 48 | void batadv_bonding_candidate_del(struct batadv_orig_node *orig_node, |
49 | struct batadv_neigh_node *neigh_node); | ||
50 | void batadv_bonding_candidate_add(struct batadv_orig_node *orig_node, | ||
51 | struct batadv_neigh_node *neigh_node); | ||
52 | void batadv_bonding_save_primary(const struct batadv_orig_node *orig_node, | ||
53 | struct batadv_orig_node *orig_neigh_node, | ||
46 | const struct batadv_ogm_packet | 54 | const struct batadv_ogm_packet |
47 | *batman_ogm_packet); | 55 | *batman_ogm_packet); |
48 | int batadv_window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff, | 56 | int batadv_window_protected(struct batadv_priv *bat_priv, int32_t seq_num_diff, |
49 | unsigned long *last_reset); | 57 | unsigned long *last_reset); |
50 | 58 | ||
51 | #endif /* _NET_BATMAN_ADV_ROUTING_H_ */ | 59 | #endif /* _NET_BATMAN_ADV_ROUTING_H_ */ |
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 67c1c6c22f3b..3b4b2daa3b3e 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c | |||
@@ -32,7 +32,8 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work); | |||
32 | /* send out an already prepared packet to the given address via the | 32 | /* send out an already prepared packet to the given address via the |
33 | * specified batman interface | 33 | * specified batman interface |
34 | */ | 34 | */ |
35 | int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface, | 35 | int batadv_send_skb_packet(struct sk_buff *skb, |
36 | struct batadv_hard_iface *hard_iface, | ||
36 | const uint8_t *dst_addr) | 37 | const uint8_t *dst_addr) |
37 | { | 38 | { |
38 | struct ethhdr *ethhdr; | 39 | struct ethhdr *ethhdr; |
@@ -76,9 +77,9 @@ send_skb_err: | |||
76 | return NET_XMIT_DROP; | 77 | return NET_XMIT_DROP; |
77 | } | 78 | } |
78 | 79 | ||
79 | void batadv_schedule_bat_ogm(struct hard_iface *hard_iface) | 80 | void batadv_schedule_bat_ogm(struct batadv_hard_iface *hard_iface) |
80 | { | 81 | { |
81 | struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 82 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
82 | 83 | ||
83 | if ((hard_iface->if_status == BATADV_IF_NOT_IN_USE) || | 84 | if ((hard_iface->if_status == BATADV_IF_NOT_IN_USE) || |
84 | (hard_iface->if_status == BATADV_IF_TO_BE_REMOVED)) | 85 | (hard_iface->if_status == BATADV_IF_TO_BE_REMOVED)) |
@@ -96,7 +97,7 @@ void batadv_schedule_bat_ogm(struct hard_iface *hard_iface) | |||
96 | bat_priv->bat_algo_ops->bat_ogm_schedule(hard_iface); | 97 | bat_priv->bat_algo_ops->bat_ogm_schedule(hard_iface); |
97 | } | 98 | } |
98 | 99 | ||
99 | static void batadv_forw_packet_free(struct forw_packet *forw_packet) | 100 | static void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet) |
100 | { | 101 | { |
101 | if (forw_packet->skb) | 102 | if (forw_packet->skb) |
102 | kfree_skb(forw_packet->skb); | 103 | kfree_skb(forw_packet->skb); |
@@ -105,9 +106,10 @@ static void batadv_forw_packet_free(struct forw_packet *forw_packet) | |||
105 | kfree(forw_packet); | 106 | kfree(forw_packet); |
106 | } | 107 | } |
107 | 108 | ||
108 | static void _batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv, | 109 | static void |
109 | struct forw_packet *forw_packet, | 110 | _batadv_add_bcast_packet_to_list(struct batadv_priv *bat_priv, |
110 | unsigned long send_time) | 111 | struct batadv_forw_packet *forw_packet, |
112 | unsigned long send_time) | ||
111 | { | 113 | { |
112 | INIT_HLIST_NODE(&forw_packet->list); | 114 | INIT_HLIST_NODE(&forw_packet->list); |
113 | 115 | ||
@@ -132,12 +134,12 @@ static void _batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv, | |||
132 | * The skb is not consumed, so the caller should make sure that the | 134 | * The skb is not consumed, so the caller should make sure that the |
133 | * skb is freed. | 135 | * skb is freed. |
134 | */ | 136 | */ |
135 | int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv, | 137 | int batadv_add_bcast_packet_to_list(struct batadv_priv *bat_priv, |
136 | const struct sk_buff *skb, | 138 | const struct sk_buff *skb, |
137 | unsigned long delay) | 139 | unsigned long delay) |
138 | { | 140 | { |
139 | struct hard_iface *primary_if = NULL; | 141 | struct batadv_hard_iface *primary_if = NULL; |
140 | struct forw_packet *forw_packet; | 142 | struct batadv_forw_packet *forw_packet; |
141 | struct batadv_bcast_packet *bcast_packet; | 143 | struct batadv_bcast_packet *bcast_packet; |
142 | struct sk_buff *newskb; | 144 | struct sk_buff *newskb; |
143 | 145 | ||
@@ -187,14 +189,18 @@ out: | |||
187 | 189 | ||
188 | static void batadv_send_outstanding_bcast_packet(struct work_struct *work) | 190 | static void batadv_send_outstanding_bcast_packet(struct work_struct *work) |
189 | { | 191 | { |
190 | struct hard_iface *hard_iface; | 192 | struct batadv_hard_iface *hard_iface; |
191 | struct delayed_work *delayed_work = | 193 | struct delayed_work *delayed_work = |
192 | container_of(work, struct delayed_work, work); | 194 | container_of(work, struct delayed_work, work); |
193 | struct forw_packet *forw_packet = | 195 | struct batadv_forw_packet *forw_packet; |
194 | container_of(delayed_work, struct forw_packet, delayed_work); | ||
195 | struct sk_buff *skb1; | 196 | struct sk_buff *skb1; |
196 | struct net_device *soft_iface = forw_packet->if_incoming->soft_iface; | 197 | struct net_device *soft_iface; |
197 | struct bat_priv *bat_priv = netdev_priv(soft_iface); | 198 | struct batadv_priv *bat_priv; |
199 | |||
200 | forw_packet = container_of(delayed_work, struct batadv_forw_packet, | ||
201 | delayed_work); | ||
202 | soft_iface = forw_packet->if_incoming->soft_iface; | ||
203 | bat_priv = netdev_priv(soft_iface); | ||
198 | 204 | ||
199 | spin_lock_bh(&bat_priv->forw_bcast_list_lock); | 205 | spin_lock_bh(&bat_priv->forw_bcast_list_lock); |
200 | hlist_del(&forw_packet->list); | 206 | hlist_del(&forw_packet->list); |
@@ -235,10 +241,11 @@ void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work) | |||
235 | { | 241 | { |
236 | struct delayed_work *delayed_work = | 242 | struct delayed_work *delayed_work = |
237 | container_of(work, struct delayed_work, work); | 243 | container_of(work, struct delayed_work, work); |
238 | struct forw_packet *forw_packet = | 244 | struct batadv_forw_packet *forw_packet; |
239 | container_of(delayed_work, struct forw_packet, delayed_work); | 245 | struct batadv_priv *bat_priv; |
240 | struct bat_priv *bat_priv; | ||
241 | 246 | ||
247 | forw_packet = container_of(delayed_work, struct batadv_forw_packet, | ||
248 | delayed_work); | ||
242 | bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface); | 249 | bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface); |
243 | spin_lock_bh(&bat_priv->forw_bat_list_lock); | 250 | spin_lock_bh(&bat_priv->forw_bat_list_lock); |
244 | hlist_del(&forw_packet->list); | 251 | hlist_del(&forw_packet->list); |
@@ -264,10 +271,11 @@ out: | |||
264 | batadv_forw_packet_free(forw_packet); | 271 | batadv_forw_packet_free(forw_packet); |
265 | } | 272 | } |
266 | 273 | ||
267 | void batadv_purge_outstanding_packets(struct bat_priv *bat_priv, | 274 | void |
268 | const struct hard_iface *hard_iface) | 275 | batadv_purge_outstanding_packets(struct batadv_priv *bat_priv, |
276 | const struct batadv_hard_iface *hard_iface) | ||
269 | { | 277 | { |
270 | struct forw_packet *forw_packet; | 278 | struct batadv_forw_packet *forw_packet; |
271 | struct hlist_node *tmp_node, *safe_tmp_node; | 279 | struct hlist_node *tmp_node, *safe_tmp_node; |
272 | bool pending; | 280 | bool pending; |
273 | 281 | ||
diff --git a/net/batman-adv/send.h b/net/batman-adv/send.h index e3ac75ba432b..643329b787ed 100644 --- a/net/batman-adv/send.h +++ b/net/batman-adv/send.h | |||
@@ -20,14 +20,16 @@ | |||
20 | #ifndef _NET_BATMAN_ADV_SEND_H_ | 20 | #ifndef _NET_BATMAN_ADV_SEND_H_ |
21 | #define _NET_BATMAN_ADV_SEND_H_ | 21 | #define _NET_BATMAN_ADV_SEND_H_ |
22 | 22 | ||
23 | int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface, | 23 | int batadv_send_skb_packet(struct sk_buff *skb, |
24 | struct batadv_hard_iface *hard_iface, | ||
24 | const uint8_t *dst_addr); | 25 | const uint8_t *dst_addr); |
25 | void batadv_schedule_bat_ogm(struct hard_iface *hard_iface); | 26 | void batadv_schedule_bat_ogm(struct batadv_hard_iface *hard_iface); |
26 | int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv, | 27 | int batadv_add_bcast_packet_to_list(struct batadv_priv *bat_priv, |
27 | const struct sk_buff *skb, | 28 | const struct sk_buff *skb, |
28 | unsigned long delay); | 29 | unsigned long delay); |
29 | void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work); | 30 | void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work); |
30 | void batadv_purge_outstanding_packets(struct bat_priv *bat_priv, | 31 | void |
31 | const struct hard_iface *hard_iface); | 32 | batadv_purge_outstanding_packets(struct batadv_priv *bat_priv, |
33 | const struct batadv_hard_iface *hard_iface); | ||
32 | 34 | ||
33 | #endif /* _NET_BATMAN_ADV_SEND_H_ */ | 35 | #endif /* _NET_BATMAN_ADV_SEND_H_ */ |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 0a5d73a549f6..7a7d82185393 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -92,13 +92,13 @@ static int batadv_interface_release(struct net_device *dev) | |||
92 | 92 | ||
93 | static struct net_device_stats *batadv_interface_stats(struct net_device *dev) | 93 | static struct net_device_stats *batadv_interface_stats(struct net_device *dev) |
94 | { | 94 | { |
95 | struct bat_priv *bat_priv = netdev_priv(dev); | 95 | struct batadv_priv *bat_priv = netdev_priv(dev); |
96 | return &bat_priv->stats; | 96 | return &bat_priv->stats; |
97 | } | 97 | } |
98 | 98 | ||
99 | static int batadv_interface_set_mac_addr(struct net_device *dev, void *p) | 99 | static int batadv_interface_set_mac_addr(struct net_device *dev, void *p) |
100 | { | 100 | { |
101 | struct bat_priv *bat_priv = netdev_priv(dev); | 101 | struct batadv_priv *bat_priv = netdev_priv(dev); |
102 | struct sockaddr *addr = p; | 102 | struct sockaddr *addr = p; |
103 | 103 | ||
104 | if (!is_valid_ether_addr(addr->sa_data)) | 104 | if (!is_valid_ether_addr(addr->sa_data)) |
@@ -131,8 +131,8 @@ static int batadv_interface_tx(struct sk_buff *skb, | |||
131 | struct net_device *soft_iface) | 131 | struct net_device *soft_iface) |
132 | { | 132 | { |
133 | struct ethhdr *ethhdr = (struct ethhdr *)skb->data; | 133 | struct ethhdr *ethhdr = (struct ethhdr *)skb->data; |
134 | struct bat_priv *bat_priv = netdev_priv(soft_iface); | 134 | struct batadv_priv *bat_priv = netdev_priv(soft_iface); |
135 | struct hard_iface *primary_if = NULL; | 135 | struct batadv_hard_iface *primary_if = NULL; |
136 | struct batadv_bcast_packet *bcast_packet; | 136 | struct batadv_bcast_packet *bcast_packet; |
137 | struct vlan_ethhdr *vhdr; | 137 | struct vlan_ethhdr *vhdr; |
138 | __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); | 138 | __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); |
@@ -260,10 +260,10 @@ end: | |||
260 | } | 260 | } |
261 | 261 | ||
262 | void batadv_interface_rx(struct net_device *soft_iface, | 262 | void batadv_interface_rx(struct net_device *soft_iface, |
263 | struct sk_buff *skb, struct hard_iface *recv_if, | 263 | struct sk_buff *skb, struct batadv_hard_iface *recv_if, |
264 | int hdr_size) | 264 | int hdr_size) |
265 | { | 265 | { |
266 | struct bat_priv *bat_priv = netdev_priv(soft_iface); | 266 | struct batadv_priv *bat_priv = netdev_priv(soft_iface); |
267 | struct ethhdr *ethhdr; | 267 | struct ethhdr *ethhdr; |
268 | struct vlan_ethhdr *vhdr; | 268 | struct vlan_ethhdr *vhdr; |
269 | short vid __maybe_unused = -1; | 269 | short vid __maybe_unused = -1; |
@@ -338,7 +338,7 @@ static const struct net_device_ops batadv_netdev_ops = { | |||
338 | 338 | ||
339 | static void batadv_interface_setup(struct net_device *dev) | 339 | static void batadv_interface_setup(struct net_device *dev) |
340 | { | 340 | { |
341 | struct bat_priv *priv = netdev_priv(dev); | 341 | struct batadv_priv *priv = netdev_priv(dev); |
342 | 342 | ||
343 | ether_setup(dev); | 343 | ether_setup(dev); |
344 | 344 | ||
@@ -364,7 +364,7 @@ static void batadv_interface_setup(struct net_device *dev) | |||
364 | struct net_device *batadv_softif_create(const char *name) | 364 | struct net_device *batadv_softif_create(const char *name) |
365 | { | 365 | { |
366 | struct net_device *soft_iface; | 366 | struct net_device *soft_iface; |
367 | struct bat_priv *bat_priv; | 367 | struct batadv_priv *bat_priv; |
368 | int ret; | 368 | int ret; |
369 | size_t cnt_len = sizeof(uint64_t) * BATADV_CNT_NUM; | 369 | size_t cnt_len = sizeof(uint64_t) * BATADV_CNT_NUM; |
370 | 370 | ||
@@ -539,7 +539,7 @@ static void batadv_get_ethtool_stats(struct net_device *dev, | |||
539 | struct ethtool_stats *stats, | 539 | struct ethtool_stats *stats, |
540 | uint64_t *data) | 540 | uint64_t *data) |
541 | { | 541 | { |
542 | struct bat_priv *bat_priv = netdev_priv(dev); | 542 | struct batadv_priv *bat_priv = netdev_priv(dev); |
543 | int i; | 543 | int i; |
544 | 544 | ||
545 | for (i = 0; i < BATADV_CNT_NUM; i++) | 545 | for (i = 0; i < BATADV_CNT_NUM; i++) |
diff --git a/net/batman-adv/soft-interface.h b/net/batman-adv/soft-interface.h index 2711ba5b1233..852c683b06a1 100644 --- a/net/batman-adv/soft-interface.h +++ b/net/batman-adv/soft-interface.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | int batadv_skb_head_push(struct sk_buff *skb, unsigned int len); | 23 | int batadv_skb_head_push(struct sk_buff *skb, unsigned int len); |
24 | void batadv_interface_rx(struct net_device *soft_iface, struct sk_buff *skb, | 24 | void batadv_interface_rx(struct net_device *soft_iface, struct sk_buff *skb, |
25 | struct hard_iface *recv_if, int hdr_size); | 25 | struct batadv_hard_iface *recv_if, int hdr_size); |
26 | struct net_device *batadv_softif_create(const char *name); | 26 | struct net_device *batadv_softif_create(const char *name); |
27 | void batadv_softif_destroy(struct net_device *soft_iface); | 27 | void batadv_softif_destroy(struct net_device *soft_iface); |
28 | int batadv_softif_is_valid(const struct net_device *net_dev); | 28 | int batadv_softif_is_valid(const struct net_device *net_dev); |
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 48217cc6729d..245cc9a068d8 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -29,34 +29,35 @@ | |||
29 | 29 | ||
30 | #include <linux/crc16.h> | 30 | #include <linux/crc16.h> |
31 | 31 | ||
32 | static void batadv_send_roam_adv(struct bat_priv *bat_priv, uint8_t *client, | 32 | static void batadv_send_roam_adv(struct batadv_priv *bat_priv, uint8_t *client, |
33 | struct orig_node *orig_node); | 33 | struct batadv_orig_node *orig_node); |
34 | static void batadv_tt_purge(struct work_struct *work); | 34 | static void batadv_tt_purge(struct work_struct *work); |
35 | static void | 35 | static void |
36 | batadv_tt_global_del_orig_list(struct tt_global_entry *tt_global_entry); | 36 | batadv_tt_global_del_orig_list(struct batadv_tt_global_entry *tt_global_entry); |
37 | 37 | ||
38 | /* returns 1 if they are the same mac addr */ | 38 | /* returns 1 if they are the same mac addr */ |
39 | static int batadv_compare_tt(const struct hlist_node *node, const void *data2) | 39 | static int batadv_compare_tt(const struct hlist_node *node, const void *data2) |
40 | { | 40 | { |
41 | const void *data1 = container_of(node, struct tt_common_entry, | 41 | const void *data1 = container_of(node, struct batadv_tt_common_entry, |
42 | hash_entry); | 42 | hash_entry); |
43 | 43 | ||
44 | return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); | 44 | return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); |
45 | } | 45 | } |
46 | 46 | ||
47 | static void batadv_tt_start_timer(struct bat_priv *bat_priv) | 47 | static void batadv_tt_start_timer(struct batadv_priv *bat_priv) |
48 | { | 48 | { |
49 | INIT_DELAYED_WORK(&bat_priv->tt_work, batadv_tt_purge); | 49 | INIT_DELAYED_WORK(&bat_priv->tt_work, batadv_tt_purge); |
50 | queue_delayed_work(batadv_event_workqueue, &bat_priv->tt_work, | 50 | queue_delayed_work(batadv_event_workqueue, &bat_priv->tt_work, |
51 | msecs_to_jiffies(5000)); | 51 | msecs_to_jiffies(5000)); |
52 | } | 52 | } |
53 | 53 | ||
54 | static struct tt_common_entry * | 54 | static struct batadv_tt_common_entry * |
55 | batadv_tt_hash_find(struct batadv_hashtable *hash, const void *data) | 55 | batadv_tt_hash_find(struct batadv_hashtable *hash, const void *data) |
56 | { | 56 | { |
57 | struct hlist_head *head; | 57 | struct hlist_head *head; |
58 | struct hlist_node *node; | 58 | struct hlist_node *node; |
59 | struct tt_common_entry *tt_common_entry, *tt_common_entry_tmp = NULL; | 59 | struct batadv_tt_common_entry *tt_common_entry; |
60 | struct batadv_tt_common_entry *tt_common_entry_tmp = NULL; | ||
60 | uint32_t index; | 61 | uint32_t index; |
61 | 62 | ||
62 | if (!hash) | 63 | if (!hash) |
@@ -81,35 +82,37 @@ batadv_tt_hash_find(struct batadv_hashtable *hash, const void *data) | |||
81 | return tt_common_entry_tmp; | 82 | return tt_common_entry_tmp; |
82 | } | 83 | } |
83 | 84 | ||
84 | static struct tt_local_entry * | 85 | static struct batadv_tt_local_entry * |
85 | batadv_tt_local_hash_find(struct bat_priv *bat_priv, const void *data) | 86 | batadv_tt_local_hash_find(struct batadv_priv *bat_priv, const void *data) |
86 | { | 87 | { |
87 | struct tt_common_entry *tt_common_entry; | 88 | struct batadv_tt_common_entry *tt_common_entry; |
88 | struct tt_local_entry *tt_local_entry = NULL; | 89 | struct batadv_tt_local_entry *tt_local_entry = NULL; |
89 | 90 | ||
90 | tt_common_entry = batadv_tt_hash_find(bat_priv->tt_local_hash, data); | 91 | tt_common_entry = batadv_tt_hash_find(bat_priv->tt_local_hash, data); |
91 | if (tt_common_entry) | 92 | if (tt_common_entry) |
92 | tt_local_entry = container_of(tt_common_entry, | 93 | tt_local_entry = container_of(tt_common_entry, |
93 | struct tt_local_entry, common); | 94 | struct batadv_tt_local_entry, |
95 | common); | ||
94 | return tt_local_entry; | 96 | return tt_local_entry; |
95 | } | 97 | } |
96 | 98 | ||
97 | static struct tt_global_entry * | 99 | static struct batadv_tt_global_entry * |
98 | batadv_tt_global_hash_find(struct bat_priv *bat_priv, const void *data) | 100 | batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const void *data) |
99 | { | 101 | { |
100 | struct tt_common_entry *tt_common_entry; | 102 | struct batadv_tt_common_entry *tt_common_entry; |
101 | struct tt_global_entry *tt_global_entry = NULL; | 103 | struct batadv_tt_global_entry *tt_global_entry = NULL; |
102 | 104 | ||
103 | tt_common_entry = batadv_tt_hash_find(bat_priv->tt_global_hash, data); | 105 | tt_common_entry = batadv_tt_hash_find(bat_priv->tt_global_hash, data); |
104 | if (tt_common_entry) | 106 | if (tt_common_entry) |
105 | tt_global_entry = container_of(tt_common_entry, | 107 | tt_global_entry = container_of(tt_common_entry, |
106 | struct tt_global_entry, common); | 108 | struct batadv_tt_global_entry, |
109 | common); | ||
107 | return tt_global_entry; | 110 | return tt_global_entry; |
108 | 111 | ||
109 | } | 112 | } |
110 | 113 | ||
111 | static void | 114 | static void |
112 | batadv_tt_local_entry_free_ref(struct tt_local_entry *tt_local_entry) | 115 | batadv_tt_local_entry_free_ref(struct batadv_tt_local_entry *tt_local_entry) |
113 | { | 116 | { |
114 | if (atomic_dec_and_test(&tt_local_entry->common.refcount)) | 117 | if (atomic_dec_and_test(&tt_local_entry->common.refcount)) |
115 | kfree_rcu(tt_local_entry, common.rcu); | 118 | kfree_rcu(tt_local_entry, common.rcu); |
@@ -117,18 +120,18 @@ batadv_tt_local_entry_free_ref(struct tt_local_entry *tt_local_entry) | |||
117 | 120 | ||
118 | static void batadv_tt_global_entry_free_rcu(struct rcu_head *rcu) | 121 | static void batadv_tt_global_entry_free_rcu(struct rcu_head *rcu) |
119 | { | 122 | { |
120 | struct tt_common_entry *tt_common_entry; | 123 | struct batadv_tt_common_entry *tt_common_entry; |
121 | struct tt_global_entry *tt_global_entry; | 124 | struct batadv_tt_global_entry *tt_global_entry; |
122 | 125 | ||
123 | tt_common_entry = container_of(rcu, struct tt_common_entry, rcu); | 126 | tt_common_entry = container_of(rcu, struct batadv_tt_common_entry, rcu); |
124 | tt_global_entry = container_of(tt_common_entry, struct tt_global_entry, | 127 | tt_global_entry = container_of(tt_common_entry, |
125 | common); | 128 | struct batadv_tt_global_entry, common); |
126 | 129 | ||
127 | kfree(tt_global_entry); | 130 | kfree(tt_global_entry); |
128 | } | 131 | } |
129 | 132 | ||
130 | static void | 133 | static void |
131 | batadv_tt_global_entry_free_ref(struct tt_global_entry *tt_global_entry) | 134 | batadv_tt_global_entry_free_ref(struct batadv_tt_global_entry *tt_global_entry) |
132 | { | 135 | { |
133 | if (atomic_dec_and_test(&tt_global_entry->common.refcount)) { | 136 | if (atomic_dec_and_test(&tt_global_entry->common.refcount)) { |
134 | batadv_tt_global_del_orig_list(tt_global_entry); | 137 | batadv_tt_global_del_orig_list(tt_global_entry); |
@@ -139,25 +142,25 @@ batadv_tt_global_entry_free_ref(struct tt_global_entry *tt_global_entry) | |||
139 | 142 | ||
140 | static void batadv_tt_orig_list_entry_free_rcu(struct rcu_head *rcu) | 143 | static void batadv_tt_orig_list_entry_free_rcu(struct rcu_head *rcu) |
141 | { | 144 | { |
142 | struct tt_orig_list_entry *orig_entry; | 145 | struct batadv_tt_orig_list_entry *orig_entry; |
143 | 146 | ||
144 | orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu); | 147 | orig_entry = container_of(rcu, struct batadv_tt_orig_list_entry, rcu); |
145 | batadv_orig_node_free_ref(orig_entry->orig_node); | 148 | batadv_orig_node_free_ref(orig_entry->orig_node); |
146 | kfree(orig_entry); | 149 | kfree(orig_entry); |
147 | } | 150 | } |
148 | 151 | ||
149 | static void | 152 | static void |
150 | batadv_tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry) | 153 | batadv_tt_orig_list_entry_free_ref(struct batadv_tt_orig_list_entry *orig_entry) |
151 | { | 154 | { |
152 | /* to avoid race conditions, immediately decrease the tt counter */ | 155 | /* to avoid race conditions, immediately decrease the tt counter */ |
153 | atomic_dec(&orig_entry->orig_node->tt_size); | 156 | atomic_dec(&orig_entry->orig_node->tt_size); |
154 | call_rcu(&orig_entry->rcu, batadv_tt_orig_list_entry_free_rcu); | 157 | call_rcu(&orig_entry->rcu, batadv_tt_orig_list_entry_free_rcu); |
155 | } | 158 | } |
156 | 159 | ||
157 | static void batadv_tt_local_event(struct bat_priv *bat_priv, | 160 | static void batadv_tt_local_event(struct batadv_priv *bat_priv, |
158 | const uint8_t *addr, uint8_t flags) | 161 | const uint8_t *addr, uint8_t flags) |
159 | { | 162 | { |
160 | struct tt_change_node *tt_change_node, *entry, *safe; | 163 | struct batadv_tt_change_node *tt_change_node, *entry, *safe; |
161 | bool event_removed = false; | 164 | bool event_removed = false; |
162 | bool del_op_requested, del_op_entry; | 165 | bool del_op_requested, del_op_entry; |
163 | 166 | ||
@@ -215,7 +218,7 @@ int batadv_tt_len(int changes_num) | |||
215 | return changes_num * sizeof(struct batadv_tt_change); | 218 | return changes_num * sizeof(struct batadv_tt_change); |
216 | } | 219 | } |
217 | 220 | ||
218 | static int batadv_tt_local_init(struct bat_priv *bat_priv) | 221 | static int batadv_tt_local_init(struct batadv_priv *bat_priv) |
219 | { | 222 | { |
220 | if (bat_priv->tt_local_hash) | 223 | if (bat_priv->tt_local_hash) |
221 | return 0; | 224 | return 0; |
@@ -231,12 +234,12 @@ static int batadv_tt_local_init(struct bat_priv *bat_priv) | |||
231 | void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, | 234 | void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, |
232 | int ifindex) | 235 | int ifindex) |
233 | { | 236 | { |
234 | struct bat_priv *bat_priv = netdev_priv(soft_iface); | 237 | struct batadv_priv *bat_priv = netdev_priv(soft_iface); |
235 | struct tt_local_entry *tt_local_entry = NULL; | 238 | struct batadv_tt_local_entry *tt_local_entry = NULL; |
236 | struct tt_global_entry *tt_global_entry = NULL; | 239 | struct batadv_tt_global_entry *tt_global_entry = NULL; |
237 | struct hlist_head *head; | 240 | struct hlist_head *head; |
238 | struct hlist_node *node; | 241 | struct hlist_node *node; |
239 | struct tt_orig_list_entry *orig_entry; | 242 | struct batadv_tt_orig_list_entry *orig_entry; |
240 | int hash_added; | 243 | int hash_added; |
241 | 244 | ||
242 | tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr); | 245 | tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr); |
@@ -333,12 +336,12 @@ static void batadv_tt_realloc_packet_buff(unsigned char **packet_buff, | |||
333 | } | 336 | } |
334 | } | 337 | } |
335 | 338 | ||
336 | static void batadv_tt_prepare_packet_buff(struct bat_priv *bat_priv, | 339 | static void batadv_tt_prepare_packet_buff(struct batadv_priv *bat_priv, |
337 | unsigned char **packet_buff, | 340 | unsigned char **packet_buff, |
338 | int *packet_buff_len, | 341 | int *packet_buff_len, |
339 | int min_packet_len) | 342 | int min_packet_len) |
340 | { | 343 | { |
341 | struct hard_iface *primary_if; | 344 | struct batadv_hard_iface *primary_if; |
342 | int req_len; | 345 | int req_len; |
343 | 346 | ||
344 | primary_if = batadv_primary_if_get_selected(bat_priv); | 347 | primary_if = batadv_primary_if_get_selected(bat_priv); |
@@ -359,12 +362,12 @@ static void batadv_tt_prepare_packet_buff(struct bat_priv *bat_priv, | |||
359 | batadv_hardif_free_ref(primary_if); | 362 | batadv_hardif_free_ref(primary_if); |
360 | } | 363 | } |
361 | 364 | ||
362 | static int batadv_tt_changes_fill_buff(struct bat_priv *bat_priv, | 365 | static int batadv_tt_changes_fill_buff(struct batadv_priv *bat_priv, |
363 | unsigned char **packet_buff, | 366 | unsigned char **packet_buff, |
364 | int *packet_buff_len, | 367 | int *packet_buff_len, |
365 | int min_packet_len) | 368 | int min_packet_len) |
366 | { | 369 | { |
367 | struct tt_change_node *entry, *safe; | 370 | struct batadv_tt_change_node *entry, *safe; |
368 | int count = 0, tot_changes = 0, new_len; | 371 | int count = 0, tot_changes = 0, new_len; |
369 | unsigned char *tt_buff; | 372 | unsigned char *tt_buff; |
370 | 373 | ||
@@ -416,10 +419,10 @@ static int batadv_tt_changes_fill_buff(struct bat_priv *bat_priv, | |||
416 | int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset) | 419 | int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset) |
417 | { | 420 | { |
418 | struct net_device *net_dev = (struct net_device *)seq->private; | 421 | struct net_device *net_dev = (struct net_device *)seq->private; |
419 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 422 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
420 | struct batadv_hashtable *hash = bat_priv->tt_local_hash; | 423 | struct batadv_hashtable *hash = bat_priv->tt_local_hash; |
421 | struct tt_common_entry *tt_common_entry; | 424 | struct batadv_tt_common_entry *tt_common_entry; |
422 | struct hard_iface *primary_if; | 425 | struct batadv_hard_iface *primary_if; |
423 | struct hlist_node *node; | 426 | struct hlist_node *node; |
424 | struct hlist_head *head; | 427 | struct hlist_head *head; |
425 | uint32_t i; | 428 | uint32_t i; |
@@ -471,9 +474,10 @@ out: | |||
471 | return ret; | 474 | return ret; |
472 | } | 475 | } |
473 | 476 | ||
474 | static void batadv_tt_local_set_pending(struct bat_priv *bat_priv, | 477 | static void |
475 | struct tt_local_entry *tt_local_entry, | 478 | batadv_tt_local_set_pending(struct batadv_priv *bat_priv, |
476 | uint16_t flags, const char *message) | 479 | struct batadv_tt_local_entry *tt_local_entry, |
480 | uint16_t flags, const char *message) | ||
477 | { | 481 | { |
478 | batadv_tt_local_event(bat_priv, tt_local_entry->common.addr, | 482 | batadv_tt_local_event(bat_priv, tt_local_entry->common.addr, |
479 | tt_local_entry->common.flags | flags); | 483 | tt_local_entry->common.flags | flags); |
@@ -489,10 +493,10 @@ static void batadv_tt_local_set_pending(struct bat_priv *bat_priv, | |||
489 | tt_local_entry->common.addr, message); | 493 | tt_local_entry->common.addr, message); |
490 | } | 494 | } |
491 | 495 | ||
492 | void batadv_tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr, | 496 | void batadv_tt_local_remove(struct batadv_priv *bat_priv, const uint8_t *addr, |
493 | const char *message, bool roaming) | 497 | const char *message, bool roaming) |
494 | { | 498 | { |
495 | struct tt_local_entry *tt_local_entry = NULL; | 499 | struct batadv_tt_local_entry *tt_local_entry = NULL; |
496 | uint16_t flags; | 500 | uint16_t flags; |
497 | 501 | ||
498 | tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr); | 502 | tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr); |
@@ -509,17 +513,18 @@ out: | |||
509 | batadv_tt_local_entry_free_ref(tt_local_entry); | 513 | batadv_tt_local_entry_free_ref(tt_local_entry); |
510 | } | 514 | } |
511 | 515 | ||
512 | static void batadv_tt_local_purge_list(struct bat_priv *bat_priv, | 516 | static void batadv_tt_local_purge_list(struct batadv_priv *bat_priv, |
513 | struct hlist_head *head) | 517 | struct hlist_head *head) |
514 | { | 518 | { |
515 | struct tt_local_entry *tt_local_entry; | 519 | struct batadv_tt_local_entry *tt_local_entry; |
516 | struct tt_common_entry *tt_common_entry; | 520 | struct batadv_tt_common_entry *tt_common_entry; |
517 | struct hlist_node *node, *node_tmp; | 521 | struct hlist_node *node, *node_tmp; |
518 | 522 | ||
519 | hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, head, | 523 | hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, head, |
520 | hash_entry) { | 524 | hash_entry) { |
521 | tt_local_entry = container_of(tt_common_entry, | 525 | tt_local_entry = container_of(tt_common_entry, |
522 | struct tt_local_entry, common); | 526 | struct batadv_tt_local_entry, |
527 | common); | ||
523 | if (tt_local_entry->common.flags & BATADV_TT_CLIENT_NOPURGE) | 528 | if (tt_local_entry->common.flags & BATADV_TT_CLIENT_NOPURGE) |
524 | continue; | 529 | continue; |
525 | 530 | ||
@@ -536,7 +541,7 @@ static void batadv_tt_local_purge_list(struct bat_priv *bat_priv, | |||
536 | } | 541 | } |
537 | } | 542 | } |
538 | 543 | ||
539 | static void batadv_tt_local_purge(struct bat_priv *bat_priv) | 544 | static void batadv_tt_local_purge(struct batadv_priv *bat_priv) |
540 | { | 545 | { |
541 | struct batadv_hashtable *hash = bat_priv->tt_local_hash; | 546 | struct batadv_hashtable *hash = bat_priv->tt_local_hash; |
542 | struct hlist_head *head; | 547 | struct hlist_head *head; |
@@ -554,12 +559,12 @@ static void batadv_tt_local_purge(struct bat_priv *bat_priv) | |||
554 | 559 | ||
555 | } | 560 | } |
556 | 561 | ||
557 | static void batadv_tt_local_table_free(struct bat_priv *bat_priv) | 562 | static void batadv_tt_local_table_free(struct batadv_priv *bat_priv) |
558 | { | 563 | { |
559 | struct batadv_hashtable *hash; | 564 | struct batadv_hashtable *hash; |
560 | spinlock_t *list_lock; /* protects write access to the hash lists */ | 565 | spinlock_t *list_lock; /* protects write access to the hash lists */ |
561 | struct tt_common_entry *tt_common_entry; | 566 | struct batadv_tt_common_entry *tt_common_entry; |
562 | struct tt_local_entry *tt_local_entry; | 567 | struct batadv_tt_local_entry *tt_local; |
563 | struct hlist_node *node, *node_tmp; | 568 | struct hlist_node *node, *node_tmp; |
564 | struct hlist_head *head; | 569 | struct hlist_head *head; |
565 | uint32_t i; | 570 | uint32_t i; |
@@ -577,10 +582,10 @@ static void batadv_tt_local_table_free(struct bat_priv *bat_priv) | |||
577 | hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, | 582 | hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, |
578 | head, hash_entry) { | 583 | head, hash_entry) { |
579 | hlist_del_rcu(node); | 584 | hlist_del_rcu(node); |
580 | tt_local_entry = container_of(tt_common_entry, | 585 | tt_local = container_of(tt_common_entry, |
581 | struct tt_local_entry, | 586 | struct batadv_tt_local_entry, |
582 | common); | 587 | common); |
583 | batadv_tt_local_entry_free_ref(tt_local_entry); | 588 | batadv_tt_local_entry_free_ref(tt_local); |
584 | } | 589 | } |
585 | spin_unlock_bh(list_lock); | 590 | spin_unlock_bh(list_lock); |
586 | } | 591 | } |
@@ -590,7 +595,7 @@ static void batadv_tt_local_table_free(struct bat_priv *bat_priv) | |||
590 | bat_priv->tt_local_hash = NULL; | 595 | bat_priv->tt_local_hash = NULL; |
591 | } | 596 | } |
592 | 597 | ||
593 | static int batadv_tt_global_init(struct bat_priv *bat_priv) | 598 | static int batadv_tt_global_init(struct batadv_priv *bat_priv) |
594 | { | 599 | { |
595 | if (bat_priv->tt_global_hash) | 600 | if (bat_priv->tt_global_hash) |
596 | return 0; | 601 | return 0; |
@@ -603,9 +608,9 @@ static int batadv_tt_global_init(struct bat_priv *bat_priv) | |||
603 | return 0; | 608 | return 0; |
604 | } | 609 | } |
605 | 610 | ||
606 | static void batadv_tt_changes_list_free(struct bat_priv *bat_priv) | 611 | static void batadv_tt_changes_list_free(struct batadv_priv *bat_priv) |
607 | { | 612 | { |
608 | struct tt_change_node *entry, *safe; | 613 | struct batadv_tt_change_node *entry, *safe; |
609 | 614 | ||
610 | spin_lock_bh(&bat_priv->tt_changes_list_lock); | 615 | spin_lock_bh(&bat_priv->tt_changes_list_lock); |
611 | 616 | ||
@@ -622,10 +627,11 @@ static void batadv_tt_changes_list_free(struct bat_priv *bat_priv) | |||
622 | /* find out if an orig_node is already in the list of a tt_global_entry. | 627 | /* find out if an orig_node is already in the list of a tt_global_entry. |
623 | * returns 1 if found, 0 otherwise | 628 | * returns 1 if found, 0 otherwise |
624 | */ | 629 | */ |
625 | static bool batadv_tt_global_entry_has_orig(const struct tt_global_entry *entry, | 630 | static bool |
626 | const struct orig_node *orig_node) | 631 | batadv_tt_global_entry_has_orig(const struct batadv_tt_global_entry *entry, |
632 | const struct batadv_orig_node *orig_node) | ||
627 | { | 633 | { |
628 | struct tt_orig_list_entry *tmp_orig_entry; | 634 | struct batadv_tt_orig_list_entry *tmp_orig_entry; |
629 | const struct hlist_head *head; | 635 | const struct hlist_head *head; |
630 | struct hlist_node *node; | 636 | struct hlist_node *node; |
631 | bool found = false; | 637 | bool found = false; |
@@ -643,10 +649,10 @@ static bool batadv_tt_global_entry_has_orig(const struct tt_global_entry *entry, | |||
643 | } | 649 | } |
644 | 650 | ||
645 | static void | 651 | static void |
646 | batadv_tt_global_add_orig_entry(struct tt_global_entry *tt_global_entry, | 652 | batadv_tt_global_add_orig_entry(struct batadv_tt_global_entry *tt_global_entry, |
647 | struct orig_node *orig_node, int ttvn) | 653 | struct batadv_orig_node *orig_node, int ttvn) |
648 | { | 654 | { |
649 | struct tt_orig_list_entry *orig_entry; | 655 | struct batadv_tt_orig_list_entry *orig_entry; |
650 | 656 | ||
651 | orig_entry = kzalloc(sizeof(*orig_entry), GFP_ATOMIC); | 657 | orig_entry = kzalloc(sizeof(*orig_entry), GFP_ATOMIC); |
652 | if (!orig_entry) | 658 | if (!orig_entry) |
@@ -665,14 +671,15 @@ batadv_tt_global_add_orig_entry(struct tt_global_entry *tt_global_entry, | |||
665 | } | 671 | } |
666 | 672 | ||
667 | /* caller must hold orig_node refcount */ | 673 | /* caller must hold orig_node refcount */ |
668 | int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node, | 674 | int batadv_tt_global_add(struct batadv_priv *bat_priv, |
675 | struct batadv_orig_node *orig_node, | ||
669 | const unsigned char *tt_addr, uint8_t flags, | 676 | const unsigned char *tt_addr, uint8_t flags, |
670 | uint8_t ttvn) | 677 | uint8_t ttvn) |
671 | { | 678 | { |
672 | struct tt_global_entry *tt_global_entry = NULL; | 679 | struct batadv_tt_global_entry *tt_global_entry = NULL; |
673 | int ret = 0; | 680 | int ret = 0; |
674 | int hash_added; | 681 | int hash_added; |
675 | struct tt_common_entry *common; | 682 | struct batadv_tt_common_entry *common; |
676 | 683 | ||
677 | tt_global_entry = batadv_tt_global_hash_find(bat_priv, tt_addr); | 684 | tt_global_entry = batadv_tt_global_hash_find(bat_priv, tt_addr); |
678 | 685 | ||
@@ -746,13 +753,13 @@ out: | |||
746 | * it is assumed that the caller holds rcu_read_lock(); | 753 | * it is assumed that the caller holds rcu_read_lock(); |
747 | */ | 754 | */ |
748 | static void | 755 | static void |
749 | batadv_tt_global_print_entry(struct tt_global_entry *tt_global_entry, | 756 | batadv_tt_global_print_entry(struct batadv_tt_global_entry *tt_global_entry, |
750 | struct seq_file *seq) | 757 | struct seq_file *seq) |
751 | { | 758 | { |
752 | struct hlist_head *head; | 759 | struct hlist_head *head; |
753 | struct hlist_node *node; | 760 | struct hlist_node *node; |
754 | struct tt_orig_list_entry *orig_entry; | 761 | struct batadv_tt_orig_list_entry *orig_entry; |
755 | struct tt_common_entry *tt_common_entry; | 762 | struct batadv_tt_common_entry *tt_common_entry; |
756 | uint16_t flags; | 763 | uint16_t flags; |
757 | uint8_t last_ttvn; | 764 | uint8_t last_ttvn; |
758 | 765 | ||
@@ -774,11 +781,11 @@ batadv_tt_global_print_entry(struct tt_global_entry *tt_global_entry, | |||
774 | int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset) | 781 | int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset) |
775 | { | 782 | { |
776 | struct net_device *net_dev = (struct net_device *)seq->private; | 783 | struct net_device *net_dev = (struct net_device *)seq->private; |
777 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 784 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
778 | struct batadv_hashtable *hash = bat_priv->tt_global_hash; | 785 | struct batadv_hashtable *hash = bat_priv->tt_global_hash; |
779 | struct tt_common_entry *tt_common_entry; | 786 | struct batadv_tt_common_entry *tt_common_entry; |
780 | struct tt_global_entry *tt_global_entry; | 787 | struct batadv_tt_global_entry *tt_global; |
781 | struct hard_iface *primary_if; | 788 | struct batadv_hard_iface *primary_if; |
782 | struct hlist_node *node; | 789 | struct hlist_node *node; |
783 | struct hlist_head *head; | 790 | struct hlist_head *head; |
784 | uint32_t i; | 791 | uint32_t i; |
@@ -811,10 +818,10 @@ int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset) | |||
811 | rcu_read_lock(); | 818 | rcu_read_lock(); |
812 | hlist_for_each_entry_rcu(tt_common_entry, node, | 819 | hlist_for_each_entry_rcu(tt_common_entry, node, |
813 | head, hash_entry) { | 820 | head, hash_entry) { |
814 | tt_global_entry = container_of(tt_common_entry, | 821 | tt_global = container_of(tt_common_entry, |
815 | struct tt_global_entry, | 822 | struct batadv_tt_global_entry, |
816 | common); | 823 | common); |
817 | batadv_tt_global_print_entry(tt_global_entry, seq); | 824 | batadv_tt_global_print_entry(tt_global, seq); |
818 | } | 825 | } |
819 | rcu_read_unlock(); | 826 | rcu_read_unlock(); |
820 | } | 827 | } |
@@ -826,11 +833,11 @@ out: | |||
826 | 833 | ||
827 | /* deletes the orig list of a tt_global_entry */ | 834 | /* deletes the orig list of a tt_global_entry */ |
828 | static void | 835 | static void |
829 | batadv_tt_global_del_orig_list(struct tt_global_entry *tt_global_entry) | 836 | batadv_tt_global_del_orig_list(struct batadv_tt_global_entry *tt_global_entry) |
830 | { | 837 | { |
831 | struct hlist_head *head; | 838 | struct hlist_head *head; |
832 | struct hlist_node *node, *safe; | 839 | struct hlist_node *node, *safe; |
833 | struct tt_orig_list_entry *orig_entry; | 840 | struct batadv_tt_orig_list_entry *orig_entry; |
834 | 841 | ||
835 | spin_lock_bh(&tt_global_entry->list_lock); | 842 | spin_lock_bh(&tt_global_entry->list_lock); |
836 | head = &tt_global_entry->orig_list; | 843 | head = &tt_global_entry->orig_list; |
@@ -843,14 +850,14 @@ batadv_tt_global_del_orig_list(struct tt_global_entry *tt_global_entry) | |||
843 | } | 850 | } |
844 | 851 | ||
845 | static void | 852 | static void |
846 | batadv_tt_global_del_orig_entry(struct bat_priv *bat_priv, | 853 | batadv_tt_global_del_orig_entry(struct batadv_priv *bat_priv, |
847 | struct tt_global_entry *tt_global_entry, | 854 | struct batadv_tt_global_entry *tt_global_entry, |
848 | struct orig_node *orig_node, | 855 | struct batadv_orig_node *orig_node, |
849 | const char *message) | 856 | const char *message) |
850 | { | 857 | { |
851 | struct hlist_head *head; | 858 | struct hlist_head *head; |
852 | struct hlist_node *node, *safe; | 859 | struct hlist_node *node, *safe; |
853 | struct tt_orig_list_entry *orig_entry; | 860 | struct batadv_tt_orig_list_entry *orig_entry; |
854 | 861 | ||
855 | spin_lock_bh(&tt_global_entry->list_lock); | 862 | spin_lock_bh(&tt_global_entry->list_lock); |
856 | head = &tt_global_entry->orig_list; | 863 | head = &tt_global_entry->orig_list; |
@@ -867,9 +874,10 @@ batadv_tt_global_del_orig_entry(struct bat_priv *bat_priv, | |||
867 | spin_unlock_bh(&tt_global_entry->list_lock); | 874 | spin_unlock_bh(&tt_global_entry->list_lock); |
868 | } | 875 | } |
869 | 876 | ||
870 | static void batadv_tt_global_del_struct(struct bat_priv *bat_priv, | 877 | static void |
871 | struct tt_global_entry *tt_global_entry, | 878 | batadv_tt_global_del_struct(struct batadv_priv *bat_priv, |
872 | const char *message) | 879 | struct batadv_tt_global_entry *tt_global_entry, |
880 | const char *message) | ||
873 | { | 881 | { |
874 | batadv_dbg(BATADV_DBG_TT, bat_priv, | 882 | batadv_dbg(BATADV_DBG_TT, bat_priv, |
875 | "Deleting global tt entry %pM: %s\n", | 883 | "Deleting global tt entry %pM: %s\n", |
@@ -886,14 +894,15 @@ static void batadv_tt_global_del_struct(struct bat_priv *bat_priv, | |||
886 | * timer, otherwise we simply remove the originator scheduled for deletion. | 894 | * timer, otherwise we simply remove the originator scheduled for deletion. |
887 | */ | 895 | */ |
888 | static void | 896 | static void |
889 | batadv_tt_global_del_roaming(struct bat_priv *bat_priv, | 897 | batadv_tt_global_del_roaming(struct batadv_priv *bat_priv, |
890 | struct tt_global_entry *tt_global_entry, | 898 | struct batadv_tt_global_entry *tt_global_entry, |
891 | struct orig_node *orig_node, const char *message) | 899 | struct batadv_orig_node *orig_node, |
900 | const char *message) | ||
892 | { | 901 | { |
893 | bool last_entry = true; | 902 | bool last_entry = true; |
894 | struct hlist_head *head; | 903 | struct hlist_head *head; |
895 | struct hlist_node *node; | 904 | struct hlist_node *node; |
896 | struct tt_orig_list_entry *orig_entry; | 905 | struct batadv_tt_orig_list_entry *orig_entry; |
897 | 906 | ||
898 | /* no local entry exists, case 1: | 907 | /* no local entry exists, case 1: |
899 | * Check if this is the last one or if other entries exist. | 908 | * Check if this is the last one or if other entries exist. |
@@ -923,13 +932,13 @@ batadv_tt_global_del_roaming(struct bat_priv *bat_priv, | |||
923 | 932 | ||
924 | 933 | ||
925 | 934 | ||
926 | static void batadv_tt_global_del(struct bat_priv *bat_priv, | 935 | static void batadv_tt_global_del(struct batadv_priv *bat_priv, |
927 | struct orig_node *orig_node, | 936 | struct batadv_orig_node *orig_node, |
928 | const unsigned char *addr, | 937 | const unsigned char *addr, |
929 | const char *message, bool roaming) | 938 | const char *message, bool roaming) |
930 | { | 939 | { |
931 | struct tt_global_entry *tt_global_entry = NULL; | 940 | struct batadv_tt_global_entry *tt_global_entry = NULL; |
932 | struct tt_local_entry *local_entry = NULL; | 941 | struct batadv_tt_local_entry *local_entry = NULL; |
933 | 942 | ||
934 | tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr); | 943 | tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr); |
935 | if (!tt_global_entry) | 944 | if (!tt_global_entry) |
@@ -978,11 +987,12 @@ out: | |||
978 | batadv_tt_local_entry_free_ref(local_entry); | 987 | batadv_tt_local_entry_free_ref(local_entry); |
979 | } | 988 | } |
980 | 989 | ||
981 | void batadv_tt_global_del_orig(struct bat_priv *bat_priv, | 990 | void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, |
982 | struct orig_node *orig_node, const char *message) | 991 | struct batadv_orig_node *orig_node, |
992 | const char *message) | ||
983 | { | 993 | { |
984 | struct tt_global_entry *global_entry; | 994 | struct batadv_tt_global_entry *tt_global; |
985 | struct tt_common_entry *tt_common_entry; | 995 | struct batadv_tt_common_entry *tt_common_entry; |
986 | uint32_t i; | 996 | uint32_t i; |
987 | struct batadv_hashtable *hash = bat_priv->tt_global_hash; | 997 | struct batadv_hashtable *hash = bat_priv->tt_global_hash; |
988 | struct hlist_node *node, *safe; | 998 | struct hlist_node *node, *safe; |
@@ -999,19 +1009,19 @@ void batadv_tt_global_del_orig(struct bat_priv *bat_priv, | |||
999 | spin_lock_bh(list_lock); | 1009 | spin_lock_bh(list_lock); |
1000 | hlist_for_each_entry_safe(tt_common_entry, node, safe, | 1010 | hlist_for_each_entry_safe(tt_common_entry, node, safe, |
1001 | head, hash_entry) { | 1011 | head, hash_entry) { |
1002 | global_entry = container_of(tt_common_entry, | 1012 | tt_global = container_of(tt_common_entry, |
1003 | struct tt_global_entry, | 1013 | struct batadv_tt_global_entry, |
1004 | common); | 1014 | common); |
1005 | 1015 | ||
1006 | batadv_tt_global_del_orig_entry(bat_priv, global_entry, | 1016 | batadv_tt_global_del_orig_entry(bat_priv, tt_global, |
1007 | orig_node, message); | 1017 | orig_node, message); |
1008 | 1018 | ||
1009 | if (hlist_empty(&global_entry->orig_list)) { | 1019 | if (hlist_empty(&tt_global->orig_list)) { |
1010 | batadv_dbg(BATADV_DBG_TT, bat_priv, | 1020 | batadv_dbg(BATADV_DBG_TT, bat_priv, |
1011 | "Deleting global tt entry %pM: %s\n", | 1021 | "Deleting global tt entry %pM: %s\n", |
1012 | global_entry->common.addr, message); | 1022 | tt_global->common.addr, message); |
1013 | hlist_del_rcu(node); | 1023 | hlist_del_rcu(node); |
1014 | batadv_tt_global_entry_free_ref(global_entry); | 1024 | batadv_tt_global_entry_free_ref(tt_global); |
1015 | } | 1025 | } |
1016 | } | 1026 | } |
1017 | spin_unlock_bh(list_lock); | 1027 | spin_unlock_bh(list_lock); |
@@ -1019,17 +1029,18 @@ void batadv_tt_global_del_orig(struct bat_priv *bat_priv, | |||
1019 | orig_node->tt_initialised = false; | 1029 | orig_node->tt_initialised = false; |
1020 | } | 1030 | } |
1021 | 1031 | ||
1022 | static void batadv_tt_global_roam_purge_list(struct bat_priv *bat_priv, | 1032 | static void batadv_tt_global_roam_purge_list(struct batadv_priv *bat_priv, |
1023 | struct hlist_head *head) | 1033 | struct hlist_head *head) |
1024 | { | 1034 | { |
1025 | struct tt_common_entry *tt_common_entry; | 1035 | struct batadv_tt_common_entry *tt_common_entry; |
1026 | struct tt_global_entry *tt_global_entry; | 1036 | struct batadv_tt_global_entry *tt_global_entry; |
1027 | struct hlist_node *node, *node_tmp; | 1037 | struct hlist_node *node, *node_tmp; |
1028 | 1038 | ||
1029 | hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, head, | 1039 | hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, head, |
1030 | hash_entry) { | 1040 | hash_entry) { |
1031 | tt_global_entry = container_of(tt_common_entry, | 1041 | tt_global_entry = container_of(tt_common_entry, |
1032 | struct tt_global_entry, common); | 1042 | struct batadv_tt_global_entry, |
1043 | common); | ||
1033 | if (!(tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM)) | 1044 | if (!(tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM)) |
1034 | continue; | 1045 | continue; |
1035 | if (!batadv_has_timed_out(tt_global_entry->roam_at, | 1046 | if (!batadv_has_timed_out(tt_global_entry->roam_at, |
@@ -1045,7 +1056,7 @@ static void batadv_tt_global_roam_purge_list(struct bat_priv *bat_priv, | |||
1045 | } | 1056 | } |
1046 | } | 1057 | } |
1047 | 1058 | ||
1048 | static void batadv_tt_global_roam_purge(struct bat_priv *bat_priv) | 1059 | static void batadv_tt_global_roam_purge(struct batadv_priv *bat_priv) |
1049 | { | 1060 | { |
1050 | struct batadv_hashtable *hash = bat_priv->tt_global_hash; | 1061 | struct batadv_hashtable *hash = bat_priv->tt_global_hash; |
1051 | struct hlist_head *head; | 1062 | struct hlist_head *head; |
@@ -1063,12 +1074,12 @@ static void batadv_tt_global_roam_purge(struct bat_priv *bat_priv) | |||
1063 | 1074 | ||
1064 | } | 1075 | } |
1065 | 1076 | ||
1066 | static void batadv_tt_global_table_free(struct bat_priv *bat_priv) | 1077 | static void batadv_tt_global_table_free(struct batadv_priv *bat_priv) |
1067 | { | 1078 | { |
1068 | struct batadv_hashtable *hash; | 1079 | struct batadv_hashtable *hash; |
1069 | spinlock_t *list_lock; /* protects write access to the hash lists */ | 1080 | spinlock_t *list_lock; /* protects write access to the hash lists */ |
1070 | struct tt_common_entry *tt_common_entry; | 1081 | struct batadv_tt_common_entry *tt_common_entry; |
1071 | struct tt_global_entry *tt_global_entry; | 1082 | struct batadv_tt_global_entry *tt_global; |
1072 | struct hlist_node *node, *node_tmp; | 1083 | struct hlist_node *node, *node_tmp; |
1073 | struct hlist_head *head; | 1084 | struct hlist_head *head; |
1074 | uint32_t i; | 1085 | uint32_t i; |
@@ -1086,10 +1097,10 @@ static void batadv_tt_global_table_free(struct bat_priv *bat_priv) | |||
1086 | hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, | 1097 | hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, |
1087 | head, hash_entry) { | 1098 | head, hash_entry) { |
1088 | hlist_del_rcu(node); | 1099 | hlist_del_rcu(node); |
1089 | tt_global_entry = container_of(tt_common_entry, | 1100 | tt_global = container_of(tt_common_entry, |
1090 | struct tt_global_entry, | 1101 | struct batadv_tt_global_entry, |
1091 | common); | 1102 | common); |
1092 | batadv_tt_global_entry_free_ref(tt_global_entry); | 1103 | batadv_tt_global_entry_free_ref(tt_global); |
1093 | } | 1104 | } |
1094 | spin_unlock_bh(list_lock); | 1105 | spin_unlock_bh(list_lock); |
1095 | } | 1106 | } |
@@ -1099,8 +1110,9 @@ static void batadv_tt_global_table_free(struct bat_priv *bat_priv) | |||
1099 | bat_priv->tt_global_hash = NULL; | 1110 | bat_priv->tt_global_hash = NULL; |
1100 | } | 1111 | } |
1101 | 1112 | ||
1102 | static bool _batadv_is_ap_isolated(struct tt_local_entry *tt_local_entry, | 1113 | static bool |
1103 | struct tt_global_entry *tt_global_entry) | 1114 | _batadv_is_ap_isolated(struct batadv_tt_local_entry *tt_local_entry, |
1115 | struct batadv_tt_global_entry *tt_global_entry) | ||
1104 | { | 1116 | { |
1105 | bool ret = false; | 1117 | bool ret = false; |
1106 | 1118 | ||
@@ -1111,17 +1123,17 @@ static bool _batadv_is_ap_isolated(struct tt_local_entry *tt_local_entry, | |||
1111 | return ret; | 1123 | return ret; |
1112 | } | 1124 | } |
1113 | 1125 | ||
1114 | struct orig_node *batadv_transtable_search(struct bat_priv *bat_priv, | 1126 | struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv, |
1115 | const uint8_t *src, | 1127 | const uint8_t *src, |
1116 | const uint8_t *addr) | 1128 | const uint8_t *addr) |
1117 | { | 1129 | { |
1118 | struct tt_local_entry *tt_local_entry = NULL; | 1130 | struct batadv_tt_local_entry *tt_local_entry = NULL; |
1119 | struct tt_global_entry *tt_global_entry = NULL; | 1131 | struct batadv_tt_global_entry *tt_global_entry = NULL; |
1120 | struct orig_node *orig_node = NULL; | 1132 | struct batadv_orig_node *orig_node = NULL; |
1121 | struct neigh_node *router = NULL; | 1133 | struct batadv_neigh_node *router = NULL; |
1122 | struct hlist_head *head; | 1134 | struct hlist_head *head; |
1123 | struct hlist_node *node; | 1135 | struct hlist_node *node; |
1124 | struct tt_orig_list_entry *orig_entry; | 1136 | struct batadv_tt_orig_list_entry *orig_entry; |
1125 | int best_tq; | 1137 | int best_tq; |
1126 | 1138 | ||
1127 | if (src && atomic_read(&bat_priv->ap_isolation)) { | 1139 | if (src && atomic_read(&bat_priv->ap_isolation)) { |
@@ -1170,13 +1182,13 @@ out: | |||
1170 | } | 1182 | } |
1171 | 1183 | ||
1172 | /* Calculates the checksum of the local table of a given orig_node */ | 1184 | /* Calculates the checksum of the local table of a given orig_node */ |
1173 | static uint16_t batadv_tt_global_crc(struct bat_priv *bat_priv, | 1185 | static uint16_t batadv_tt_global_crc(struct batadv_priv *bat_priv, |
1174 | struct orig_node *orig_node) | 1186 | struct batadv_orig_node *orig_node) |
1175 | { | 1187 | { |
1176 | uint16_t total = 0, total_one; | 1188 | uint16_t total = 0, total_one; |
1177 | struct batadv_hashtable *hash = bat_priv->tt_global_hash; | 1189 | struct batadv_hashtable *hash = bat_priv->tt_global_hash; |
1178 | struct tt_common_entry *tt_common; | 1190 | struct batadv_tt_common_entry *tt_common; |
1179 | struct tt_global_entry *tt_global_entry; | 1191 | struct batadv_tt_global_entry *tt_global; |
1180 | struct hlist_node *node; | 1192 | struct hlist_node *node; |
1181 | struct hlist_head *head; | 1193 | struct hlist_head *head; |
1182 | uint32_t i; | 1194 | uint32_t i; |
@@ -1187,9 +1199,9 @@ static uint16_t batadv_tt_global_crc(struct bat_priv *bat_priv, | |||
1187 | 1199 | ||
1188 | rcu_read_lock(); | 1200 | rcu_read_lock(); |
1189 | hlist_for_each_entry_rcu(tt_common, node, head, hash_entry) { | 1201 | hlist_for_each_entry_rcu(tt_common, node, head, hash_entry) { |
1190 | tt_global_entry = container_of(tt_common, | 1202 | tt_global = container_of(tt_common, |
1191 | struct tt_global_entry, | 1203 | struct batadv_tt_global_entry, |
1192 | common); | 1204 | common); |
1193 | /* Roaming clients are in the global table for | 1205 | /* Roaming clients are in the global table for |
1194 | * consistency only. They don't have to be | 1206 | * consistency only. They don't have to be |
1195 | * taken into account while computing the | 1207 | * taken into account while computing the |
@@ -1201,7 +1213,7 @@ static uint16_t batadv_tt_global_crc(struct bat_priv *bat_priv, | |||
1201 | /* find out if this global entry is announced by this | 1213 | /* find out if this global entry is announced by this |
1202 | * originator | 1214 | * originator |
1203 | */ | 1215 | */ |
1204 | if (!batadv_tt_global_entry_has_orig(tt_global_entry, | 1216 | if (!batadv_tt_global_entry_has_orig(tt_global, |
1205 | orig_node)) | 1217 | orig_node)) |
1206 | continue; | 1218 | continue; |
1207 | 1219 | ||
@@ -1218,11 +1230,11 @@ static uint16_t batadv_tt_global_crc(struct bat_priv *bat_priv, | |||
1218 | } | 1230 | } |
1219 | 1231 | ||
1220 | /* Calculates the checksum of the local table */ | 1232 | /* Calculates the checksum of the local table */ |
1221 | static uint16_t batadv_tt_local_crc(struct bat_priv *bat_priv) | 1233 | static uint16_t batadv_tt_local_crc(struct batadv_priv *bat_priv) |
1222 | { | 1234 | { |
1223 | uint16_t total = 0, total_one; | 1235 | uint16_t total = 0, total_one; |
1224 | struct batadv_hashtable *hash = bat_priv->tt_local_hash; | 1236 | struct batadv_hashtable *hash = bat_priv->tt_local_hash; |
1225 | struct tt_common_entry *tt_common; | 1237 | struct batadv_tt_common_entry *tt_common; |
1226 | struct hlist_node *node; | 1238 | struct hlist_node *node; |
1227 | struct hlist_head *head; | 1239 | struct hlist_head *head; |
1228 | uint32_t i; | 1240 | uint32_t i; |
@@ -1250,9 +1262,9 @@ static uint16_t batadv_tt_local_crc(struct bat_priv *bat_priv) | |||
1250 | return total; | 1262 | return total; |
1251 | } | 1263 | } |
1252 | 1264 | ||
1253 | static void batadv_tt_req_list_free(struct bat_priv *bat_priv) | 1265 | static void batadv_tt_req_list_free(struct batadv_priv *bat_priv) |
1254 | { | 1266 | { |
1255 | struct tt_req_node *node, *safe; | 1267 | struct batadv_tt_req_node *node, *safe; |
1256 | 1268 | ||
1257 | spin_lock_bh(&bat_priv->tt_req_list_lock); | 1269 | spin_lock_bh(&bat_priv->tt_req_list_lock); |
1258 | 1270 | ||
@@ -1264,8 +1276,8 @@ static void batadv_tt_req_list_free(struct bat_priv *bat_priv) | |||
1264 | spin_unlock_bh(&bat_priv->tt_req_list_lock); | 1276 | spin_unlock_bh(&bat_priv->tt_req_list_lock); |
1265 | } | 1277 | } |
1266 | 1278 | ||
1267 | static void batadv_tt_save_orig_buffer(struct bat_priv *bat_priv, | 1279 | static void batadv_tt_save_orig_buffer(struct batadv_priv *bat_priv, |
1268 | struct orig_node *orig_node, | 1280 | struct batadv_orig_node *orig_node, |
1269 | const unsigned char *tt_buff, | 1281 | const unsigned char *tt_buff, |
1270 | uint8_t tt_num_changes) | 1282 | uint8_t tt_num_changes) |
1271 | { | 1283 | { |
@@ -1287,9 +1299,9 @@ static void batadv_tt_save_orig_buffer(struct bat_priv *bat_priv, | |||
1287 | spin_unlock_bh(&orig_node->tt_buff_lock); | 1299 | spin_unlock_bh(&orig_node->tt_buff_lock); |
1288 | } | 1300 | } |
1289 | 1301 | ||
1290 | static void batadv_tt_req_purge(struct bat_priv *bat_priv) | 1302 | static void batadv_tt_req_purge(struct batadv_priv *bat_priv) |
1291 | { | 1303 | { |
1292 | struct tt_req_node *node, *safe; | 1304 | struct batadv_tt_req_node *node, *safe; |
1293 | 1305 | ||
1294 | spin_lock_bh(&bat_priv->tt_req_list_lock); | 1306 | spin_lock_bh(&bat_priv->tt_req_list_lock); |
1295 | list_for_each_entry_safe(node, safe, &bat_priv->tt_req_list, list) { | 1307 | list_for_each_entry_safe(node, safe, &bat_priv->tt_req_list, list) { |
@@ -1305,10 +1317,11 @@ static void batadv_tt_req_purge(struct bat_priv *bat_priv) | |||
1305 | /* returns the pointer to the new tt_req_node struct if no request | 1317 | /* returns the pointer to the new tt_req_node struct if no request |
1306 | * has already been issued for this orig_node, NULL otherwise | 1318 | * has already been issued for this orig_node, NULL otherwise |
1307 | */ | 1319 | */ |
1308 | static struct tt_req_node *batadv_new_tt_req_node(struct bat_priv *bat_priv, | 1320 | static struct batadv_tt_req_node * |
1309 | struct orig_node *orig_node) | 1321 | batadv_new_tt_req_node(struct batadv_priv *bat_priv, |
1322 | struct batadv_orig_node *orig_node) | ||
1310 | { | 1323 | { |
1311 | struct tt_req_node *tt_req_node_tmp, *tt_req_node = NULL; | 1324 | struct batadv_tt_req_node *tt_req_node_tmp, *tt_req_node = NULL; |
1312 | 1325 | ||
1313 | spin_lock_bh(&bat_priv->tt_req_list_lock); | 1326 | spin_lock_bh(&bat_priv->tt_req_list_lock); |
1314 | list_for_each_entry(tt_req_node_tmp, &bat_priv->tt_req_list, list) { | 1327 | list_for_each_entry(tt_req_node_tmp, &bat_priv->tt_req_list, list) { |
@@ -1335,7 +1348,7 @@ unlock: | |||
1335 | static int batadv_tt_local_valid_entry(const void *entry_ptr, | 1348 | static int batadv_tt_local_valid_entry(const void *entry_ptr, |
1336 | const void *data_ptr) | 1349 | const void *data_ptr) |
1337 | { | 1350 | { |
1338 | const struct tt_common_entry *tt_common_entry = entry_ptr; | 1351 | const struct batadv_tt_common_entry *tt_common_entry = entry_ptr; |
1339 | 1352 | ||
1340 | if (tt_common_entry->flags & BATADV_TT_CLIENT_NEW) | 1353 | if (tt_common_entry->flags & BATADV_TT_CLIENT_NEW) |
1341 | return 0; | 1354 | return 0; |
@@ -1345,14 +1358,15 @@ static int batadv_tt_local_valid_entry(const void *entry_ptr, | |||
1345 | static int batadv_tt_global_valid(const void *entry_ptr, | 1358 | static int batadv_tt_global_valid(const void *entry_ptr, |
1346 | const void *data_ptr) | 1359 | const void *data_ptr) |
1347 | { | 1360 | { |
1348 | const struct tt_common_entry *tt_common_entry = entry_ptr; | 1361 | const struct batadv_tt_common_entry *tt_common_entry = entry_ptr; |
1349 | const struct tt_global_entry *tt_global_entry; | 1362 | const struct batadv_tt_global_entry *tt_global_entry; |
1350 | const struct orig_node *orig_node = data_ptr; | 1363 | const struct batadv_orig_node *orig_node = data_ptr; |
1351 | 1364 | ||
1352 | if (tt_common_entry->flags & BATADV_TT_CLIENT_ROAM) | 1365 | if (tt_common_entry->flags & BATADV_TT_CLIENT_ROAM) |
1353 | return 0; | 1366 | return 0; |
1354 | 1367 | ||
1355 | tt_global_entry = container_of(tt_common_entry, struct tt_global_entry, | 1368 | tt_global_entry = container_of(tt_common_entry, |
1369 | struct batadv_tt_global_entry, | ||
1356 | common); | 1370 | common); |
1357 | 1371 | ||
1358 | return batadv_tt_global_entry_has_orig(tt_global_entry, orig_node); | 1372 | return batadv_tt_global_entry_has_orig(tt_global_entry, orig_node); |
@@ -1361,11 +1375,11 @@ static int batadv_tt_global_valid(const void *entry_ptr, | |||
1361 | static struct sk_buff * | 1375 | static struct sk_buff * |
1362 | batadv_tt_response_fill_table(uint16_t tt_len, uint8_t ttvn, | 1376 | batadv_tt_response_fill_table(uint16_t tt_len, uint8_t ttvn, |
1363 | struct batadv_hashtable *hash, | 1377 | struct batadv_hashtable *hash, |
1364 | struct hard_iface *primary_if, | 1378 | struct batadv_hard_iface *primary_if, |
1365 | int (*valid_cb)(const void *, const void *), | 1379 | int (*valid_cb)(const void *, const void *), |
1366 | void *cb_data) | 1380 | void *cb_data) |
1367 | { | 1381 | { |
1368 | struct tt_common_entry *tt_common_entry; | 1382 | struct batadv_tt_common_entry *tt_common_entry; |
1369 | struct batadv_tt_query_packet *tt_response; | 1383 | struct batadv_tt_query_packet *tt_response; |
1370 | struct batadv_tt_change *tt_change; | 1384 | struct batadv_tt_change *tt_change; |
1371 | struct hlist_node *node; | 1385 | struct hlist_node *node; |
@@ -1425,16 +1439,16 @@ out: | |||
1425 | return skb; | 1439 | return skb; |
1426 | } | 1440 | } |
1427 | 1441 | ||
1428 | static int batadv_send_tt_request(struct bat_priv *bat_priv, | 1442 | static int batadv_send_tt_request(struct batadv_priv *bat_priv, |
1429 | struct orig_node *dst_orig_node, | 1443 | struct batadv_orig_node *dst_orig_node, |
1430 | uint8_t ttvn, uint16_t tt_crc, | 1444 | uint8_t ttvn, uint16_t tt_crc, |
1431 | bool full_table) | 1445 | bool full_table) |
1432 | { | 1446 | { |
1433 | struct sk_buff *skb = NULL; | 1447 | struct sk_buff *skb = NULL; |
1434 | struct batadv_tt_query_packet *tt_request; | 1448 | struct batadv_tt_query_packet *tt_request; |
1435 | struct neigh_node *neigh_node = NULL; | 1449 | struct batadv_neigh_node *neigh_node = NULL; |
1436 | struct hard_iface *primary_if; | 1450 | struct batadv_hard_iface *primary_if; |
1437 | struct tt_req_node *tt_req_node = NULL; | 1451 | struct batadv_tt_req_node *tt_req_node = NULL; |
1438 | int ret = 1; | 1452 | int ret = 1; |
1439 | size_t tt_req_len; | 1453 | size_t tt_req_len; |
1440 | 1454 | ||
@@ -1501,12 +1515,13 @@ out: | |||
1501 | } | 1515 | } |
1502 | 1516 | ||
1503 | static bool | 1517 | static bool |
1504 | batadv_send_other_tt_response(struct bat_priv *bat_priv, | 1518 | batadv_send_other_tt_response(struct batadv_priv *bat_priv, |
1505 | struct batadv_tt_query_packet *tt_request) | 1519 | struct batadv_tt_query_packet *tt_request) |
1506 | { | 1520 | { |
1507 | struct orig_node *req_dst_orig_node = NULL, *res_dst_orig_node = NULL; | 1521 | struct batadv_orig_node *req_dst_orig_node = NULL; |
1508 | struct neigh_node *neigh_node = NULL; | 1522 | struct batadv_orig_node *res_dst_orig_node = NULL; |
1509 | struct hard_iface *primary_if = NULL; | 1523 | struct batadv_neigh_node *neigh_node = NULL; |
1524 | struct batadv_hard_iface *primary_if = NULL; | ||
1510 | uint8_t orig_ttvn, req_ttvn, ttvn; | 1525 | uint8_t orig_ttvn, req_ttvn, ttvn; |
1511 | int ret = false; | 1526 | int ret = false; |
1512 | unsigned char *tt_buff; | 1527 | unsigned char *tt_buff; |
@@ -1634,12 +1649,12 @@ out: | |||
1634 | } | 1649 | } |
1635 | 1650 | ||
1636 | static bool | 1651 | static bool |
1637 | batadv_send_my_tt_response(struct bat_priv *bat_priv, | 1652 | batadv_send_my_tt_response(struct batadv_priv *bat_priv, |
1638 | struct batadv_tt_query_packet *tt_request) | 1653 | struct batadv_tt_query_packet *tt_request) |
1639 | { | 1654 | { |
1640 | struct orig_node *orig_node = NULL; | 1655 | struct batadv_orig_node *orig_node = NULL; |
1641 | struct neigh_node *neigh_node = NULL; | 1656 | struct batadv_neigh_node *neigh_node = NULL; |
1642 | struct hard_iface *primary_if = NULL; | 1657 | struct batadv_hard_iface *primary_if = NULL; |
1643 | uint8_t my_ttvn, req_ttvn, ttvn; | 1658 | uint8_t my_ttvn, req_ttvn, ttvn; |
1644 | int ret = false; | 1659 | int ret = false; |
1645 | unsigned char *tt_buff; | 1660 | unsigned char *tt_buff; |
@@ -1754,7 +1769,7 @@ out: | |||
1754 | return true; | 1769 | return true; |
1755 | } | 1770 | } |
1756 | 1771 | ||
1757 | bool batadv_send_tt_response(struct bat_priv *bat_priv, | 1772 | bool batadv_send_tt_response(struct batadv_priv *bat_priv, |
1758 | struct batadv_tt_query_packet *tt_request) | 1773 | struct batadv_tt_query_packet *tt_request) |
1759 | { | 1774 | { |
1760 | if (batadv_is_my_mac(tt_request->dst)) { | 1775 | if (batadv_is_my_mac(tt_request->dst)) { |
@@ -1768,8 +1783,8 @@ bool batadv_send_tt_response(struct bat_priv *bat_priv, | |||
1768 | } | 1783 | } |
1769 | } | 1784 | } |
1770 | 1785 | ||
1771 | static void _batadv_tt_update_changes(struct bat_priv *bat_priv, | 1786 | static void _batadv_tt_update_changes(struct batadv_priv *bat_priv, |
1772 | struct orig_node *orig_node, | 1787 | struct batadv_orig_node *orig_node, |
1773 | struct batadv_tt_change *tt_change, | 1788 | struct batadv_tt_change *tt_change, |
1774 | uint16_t tt_num_changes, uint8_t ttvn) | 1789 | uint16_t tt_num_changes, uint8_t ttvn) |
1775 | { | 1790 | { |
@@ -1799,10 +1814,10 @@ static void _batadv_tt_update_changes(struct bat_priv *bat_priv, | |||
1799 | orig_node->tt_initialised = true; | 1814 | orig_node->tt_initialised = true; |
1800 | } | 1815 | } |
1801 | 1816 | ||
1802 | static void batadv_tt_fill_gtable(struct bat_priv *bat_priv, | 1817 | static void batadv_tt_fill_gtable(struct batadv_priv *bat_priv, |
1803 | struct batadv_tt_query_packet *tt_response) | 1818 | struct batadv_tt_query_packet *tt_response) |
1804 | { | 1819 | { |
1805 | struct orig_node *orig_node = NULL; | 1820 | struct batadv_orig_node *orig_node = NULL; |
1806 | 1821 | ||
1807 | orig_node = batadv_orig_hash_find(bat_priv, tt_response->src); | 1822 | orig_node = batadv_orig_hash_find(bat_priv, tt_response->src); |
1808 | if (!orig_node) | 1823 | if (!orig_node) |
@@ -1829,8 +1844,8 @@ out: | |||
1829 | batadv_orig_node_free_ref(orig_node); | 1844 | batadv_orig_node_free_ref(orig_node); |
1830 | } | 1845 | } |
1831 | 1846 | ||
1832 | static void batadv_tt_update_changes(struct bat_priv *bat_priv, | 1847 | static void batadv_tt_update_changes(struct batadv_priv *bat_priv, |
1833 | struct orig_node *orig_node, | 1848 | struct batadv_orig_node *orig_node, |
1834 | uint16_t tt_num_changes, uint8_t ttvn, | 1849 | uint16_t tt_num_changes, uint8_t ttvn, |
1835 | struct batadv_tt_change *tt_change) | 1850 | struct batadv_tt_change *tt_change) |
1836 | { | 1851 | { |
@@ -1842,9 +1857,9 @@ static void batadv_tt_update_changes(struct bat_priv *bat_priv, | |||
1842 | atomic_set(&orig_node->last_ttvn, ttvn); | 1857 | atomic_set(&orig_node->last_ttvn, ttvn); |
1843 | } | 1858 | } |
1844 | 1859 | ||
1845 | bool batadv_is_my_client(struct bat_priv *bat_priv, const uint8_t *addr) | 1860 | bool batadv_is_my_client(struct batadv_priv *bat_priv, const uint8_t *addr) |
1846 | { | 1861 | { |
1847 | struct tt_local_entry *tt_local_entry = NULL; | 1862 | struct batadv_tt_local_entry *tt_local_entry = NULL; |
1848 | bool ret = false; | 1863 | bool ret = false; |
1849 | 1864 | ||
1850 | tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr); | 1865 | tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr); |
@@ -1862,11 +1877,11 @@ out: | |||
1862 | return ret; | 1877 | return ret; |
1863 | } | 1878 | } |
1864 | 1879 | ||
1865 | void batadv_handle_tt_response(struct bat_priv *bat_priv, | 1880 | void batadv_handle_tt_response(struct batadv_priv *bat_priv, |
1866 | struct batadv_tt_query_packet *tt_response) | 1881 | struct batadv_tt_query_packet *tt_response) |
1867 | { | 1882 | { |
1868 | struct tt_req_node *node, *safe; | 1883 | struct batadv_tt_req_node *node, *safe; |
1869 | struct orig_node *orig_node = NULL; | 1884 | struct batadv_orig_node *orig_node = NULL; |
1870 | struct batadv_tt_change *tt_change; | 1885 | struct batadv_tt_change *tt_change; |
1871 | 1886 | ||
1872 | batadv_dbg(BATADV_DBG_TT, bat_priv, | 1887 | batadv_dbg(BATADV_DBG_TT, bat_priv, |
@@ -1913,7 +1928,7 @@ out: | |||
1913 | batadv_orig_node_free_ref(orig_node); | 1928 | batadv_orig_node_free_ref(orig_node); |
1914 | } | 1929 | } |
1915 | 1930 | ||
1916 | int batadv_tt_init(struct bat_priv *bat_priv) | 1931 | int batadv_tt_init(struct batadv_priv *bat_priv) |
1917 | { | 1932 | { |
1918 | int ret; | 1933 | int ret; |
1919 | 1934 | ||
@@ -1930,9 +1945,9 @@ int batadv_tt_init(struct bat_priv *bat_priv) | |||
1930 | return 1; | 1945 | return 1; |
1931 | } | 1946 | } |
1932 | 1947 | ||
1933 | static void batadv_tt_roam_list_free(struct bat_priv *bat_priv) | 1948 | static void batadv_tt_roam_list_free(struct batadv_priv *bat_priv) |
1934 | { | 1949 | { |
1935 | struct tt_roam_node *node, *safe; | 1950 | struct batadv_tt_roam_node *node, *safe; |
1936 | 1951 | ||
1937 | spin_lock_bh(&bat_priv->tt_roam_list_lock); | 1952 | spin_lock_bh(&bat_priv->tt_roam_list_lock); |
1938 | 1953 | ||
@@ -1944,9 +1959,9 @@ static void batadv_tt_roam_list_free(struct bat_priv *bat_priv) | |||
1944 | spin_unlock_bh(&bat_priv->tt_roam_list_lock); | 1959 | spin_unlock_bh(&bat_priv->tt_roam_list_lock); |
1945 | } | 1960 | } |
1946 | 1961 | ||
1947 | static void batadv_tt_roam_purge(struct bat_priv *bat_priv) | 1962 | static void batadv_tt_roam_purge(struct batadv_priv *bat_priv) |
1948 | { | 1963 | { |
1949 | struct tt_roam_node *node, *safe; | 1964 | struct batadv_tt_roam_node *node, *safe; |
1950 | 1965 | ||
1951 | spin_lock_bh(&bat_priv->tt_roam_list_lock); | 1966 | spin_lock_bh(&bat_priv->tt_roam_list_lock); |
1952 | list_for_each_entry_safe(node, safe, &bat_priv->tt_roam_list, list) { | 1967 | list_for_each_entry_safe(node, safe, &bat_priv->tt_roam_list, list) { |
@@ -1966,10 +1981,10 @@ static void batadv_tt_roam_purge(struct bat_priv *bat_priv) | |||
1966 | * | 1981 | * |
1967 | * returns true if the ROAMING_ADV can be sent, false otherwise | 1982 | * returns true if the ROAMING_ADV can be sent, false otherwise |
1968 | */ | 1983 | */ |
1969 | static bool batadv_tt_check_roam_count(struct bat_priv *bat_priv, | 1984 | static bool batadv_tt_check_roam_count(struct batadv_priv *bat_priv, |
1970 | uint8_t *client) | 1985 | uint8_t *client) |
1971 | { | 1986 | { |
1972 | struct tt_roam_node *tt_roam_node; | 1987 | struct batadv_tt_roam_node *tt_roam_node; |
1973 | bool ret = false; | 1988 | bool ret = false; |
1974 | 1989 | ||
1975 | spin_lock_bh(&bat_priv->tt_roam_list_lock); | 1990 | spin_lock_bh(&bat_priv->tt_roam_list_lock); |
@@ -2010,14 +2025,14 @@ unlock: | |||
2010 | return ret; | 2025 | return ret; |
2011 | } | 2026 | } |
2012 | 2027 | ||
2013 | static void batadv_send_roam_adv(struct bat_priv *bat_priv, uint8_t *client, | 2028 | static void batadv_send_roam_adv(struct batadv_priv *bat_priv, uint8_t *client, |
2014 | struct orig_node *orig_node) | 2029 | struct batadv_orig_node *orig_node) |
2015 | { | 2030 | { |
2016 | struct neigh_node *neigh_node = NULL; | 2031 | struct batadv_neigh_node *neigh_node = NULL; |
2017 | struct sk_buff *skb = NULL; | 2032 | struct sk_buff *skb = NULL; |
2018 | struct batadv_roam_adv_packet *roam_adv_packet; | 2033 | struct batadv_roam_adv_packet *roam_adv_packet; |
2019 | int ret = 1; | 2034 | int ret = 1; |
2020 | struct hard_iface *primary_if; | 2035 | struct batadv_hard_iface *primary_if; |
2021 | size_t len = sizeof(*roam_adv_packet); | 2036 | size_t len = sizeof(*roam_adv_packet); |
2022 | 2037 | ||
2023 | /* before going on we have to check whether the client has | 2038 | /* before going on we have to check whether the client has |
@@ -2068,10 +2083,11 @@ out: | |||
2068 | 2083 | ||
2069 | static void batadv_tt_purge(struct work_struct *work) | 2084 | static void batadv_tt_purge(struct work_struct *work) |
2070 | { | 2085 | { |
2071 | struct delayed_work *delayed_work = | 2086 | struct delayed_work *delayed_work; |
2072 | container_of(work, struct delayed_work, work); | 2087 | struct batadv_priv *bat_priv; |
2073 | struct bat_priv *bat_priv = | 2088 | |
2074 | container_of(delayed_work, struct bat_priv, tt_work); | 2089 | delayed_work = container_of(work, struct delayed_work, work); |
2090 | bat_priv = container_of(delayed_work, struct batadv_priv, tt_work); | ||
2075 | 2091 | ||
2076 | batadv_tt_local_purge(bat_priv); | 2092 | batadv_tt_local_purge(bat_priv); |
2077 | batadv_tt_global_roam_purge(bat_priv); | 2093 | batadv_tt_global_roam_purge(bat_priv); |
@@ -2081,7 +2097,7 @@ static void batadv_tt_purge(struct work_struct *work) | |||
2081 | batadv_tt_start_timer(bat_priv); | 2097 | batadv_tt_start_timer(bat_priv); |
2082 | } | 2098 | } |
2083 | 2099 | ||
2084 | void batadv_tt_free(struct bat_priv *bat_priv) | 2100 | void batadv_tt_free(struct batadv_priv *bat_priv) |
2085 | { | 2101 | { |
2086 | cancel_delayed_work_sync(&bat_priv->tt_work); | 2102 | cancel_delayed_work_sync(&bat_priv->tt_work); |
2087 | 2103 | ||
@@ -2104,7 +2120,7 @@ static uint16_t batadv_tt_set_flags(struct batadv_hashtable *hash, | |||
2104 | uint16_t changed_num = 0; | 2120 | uint16_t changed_num = 0; |
2105 | struct hlist_head *head; | 2121 | struct hlist_head *head; |
2106 | struct hlist_node *node; | 2122 | struct hlist_node *node; |
2107 | struct tt_common_entry *tt_common_entry; | 2123 | struct batadv_tt_common_entry *tt_common_entry; |
2108 | 2124 | ||
2109 | if (!hash) | 2125 | if (!hash) |
2110 | goto out; | 2126 | goto out; |
@@ -2133,11 +2149,11 @@ out: | |||
2133 | } | 2149 | } |
2134 | 2150 | ||
2135 | /* Purge out all the tt local entries marked with BATADV_TT_CLIENT_PENDING */ | 2151 | /* Purge out all the tt local entries marked with BATADV_TT_CLIENT_PENDING */ |
2136 | static void batadv_tt_local_purge_pending_clients(struct bat_priv *bat_priv) | 2152 | static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv) |
2137 | { | 2153 | { |
2138 | struct batadv_hashtable *hash = bat_priv->tt_local_hash; | 2154 | struct batadv_hashtable *hash = bat_priv->tt_local_hash; |
2139 | struct tt_common_entry *tt_common; | 2155 | struct batadv_tt_common_entry *tt_common; |
2140 | struct tt_local_entry *tt_local_entry; | 2156 | struct batadv_tt_local_entry *tt_local; |
2141 | struct hlist_node *node, *node_tmp; | 2157 | struct hlist_node *node, *node_tmp; |
2142 | struct hlist_head *head; | 2158 | struct hlist_head *head; |
2143 | spinlock_t *list_lock; /* protects write access to the hash lists */ | 2159 | spinlock_t *list_lock; /* protects write access to the hash lists */ |
@@ -2162,17 +2178,17 @@ static void batadv_tt_local_purge_pending_clients(struct bat_priv *bat_priv) | |||
2162 | 2178 | ||
2163 | atomic_dec(&bat_priv->num_local_tt); | 2179 | atomic_dec(&bat_priv->num_local_tt); |
2164 | hlist_del_rcu(node); | 2180 | hlist_del_rcu(node); |
2165 | tt_local_entry = container_of(tt_common, | 2181 | tt_local = container_of(tt_common, |
2166 | struct tt_local_entry, | 2182 | struct batadv_tt_local_entry, |
2167 | common); | 2183 | common); |
2168 | batadv_tt_local_entry_free_ref(tt_local_entry); | 2184 | batadv_tt_local_entry_free_ref(tt_local); |
2169 | } | 2185 | } |
2170 | spin_unlock_bh(list_lock); | 2186 | spin_unlock_bh(list_lock); |
2171 | } | 2187 | } |
2172 | 2188 | ||
2173 | } | 2189 | } |
2174 | 2190 | ||
2175 | static int batadv_tt_commit_changes(struct bat_priv *bat_priv, | 2191 | static int batadv_tt_commit_changes(struct batadv_priv *bat_priv, |
2176 | unsigned char **packet_buff, | 2192 | unsigned char **packet_buff, |
2177 | int *packet_buff_len, int packet_min_len) | 2193 | int *packet_buff_len, int packet_min_len) |
2178 | { | 2194 | { |
@@ -2204,7 +2220,7 @@ static int batadv_tt_commit_changes(struct bat_priv *bat_priv, | |||
2204 | } | 2220 | } |
2205 | 2221 | ||
2206 | /* when calling this function (hard_iface == primary_if) has to be true */ | 2222 | /* when calling this function (hard_iface == primary_if) has to be true */ |
2207 | int batadv_tt_append_diff(struct bat_priv *bat_priv, | 2223 | int batadv_tt_append_diff(struct batadv_priv *bat_priv, |
2208 | unsigned char **packet_buff, int *packet_buff_len, | 2224 | unsigned char **packet_buff, int *packet_buff_len, |
2209 | int packet_min_len) | 2225 | int packet_min_len) |
2210 | { | 2226 | { |
@@ -2226,11 +2242,11 @@ int batadv_tt_append_diff(struct bat_priv *bat_priv, | |||
2226 | return tt_num_changes; | 2242 | return tt_num_changes; |
2227 | } | 2243 | } |
2228 | 2244 | ||
2229 | bool batadv_is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, | 2245 | bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, uint8_t *src, |
2230 | uint8_t *dst) | 2246 | uint8_t *dst) |
2231 | { | 2247 | { |
2232 | struct tt_local_entry *tt_local_entry = NULL; | 2248 | struct batadv_tt_local_entry *tt_local_entry = NULL; |
2233 | struct tt_global_entry *tt_global_entry = NULL; | 2249 | struct batadv_tt_global_entry *tt_global_entry = NULL; |
2234 | bool ret = false; | 2250 | bool ret = false; |
2235 | 2251 | ||
2236 | if (!atomic_read(&bat_priv->ap_isolation)) | 2252 | if (!atomic_read(&bat_priv->ap_isolation)) |
@@ -2257,8 +2273,8 @@ out: | |||
2257 | return ret; | 2273 | return ret; |
2258 | } | 2274 | } |
2259 | 2275 | ||
2260 | void batadv_tt_update_orig(struct bat_priv *bat_priv, | 2276 | void batadv_tt_update_orig(struct batadv_priv *bat_priv, |
2261 | struct orig_node *orig_node, | 2277 | struct batadv_orig_node *orig_node, |
2262 | const unsigned char *tt_buff, uint8_t tt_num_changes, | 2278 | const unsigned char *tt_buff, uint8_t tt_num_changes, |
2263 | uint8_t ttvn, uint16_t tt_crc) | 2279 | uint8_t ttvn, uint16_t tt_crc) |
2264 | { | 2280 | { |
@@ -2333,10 +2349,10 @@ request_table: | |||
2333 | * originator to another one. This entry is kept is still kept for consistency | 2349 | * originator to another one. This entry is kept is still kept for consistency |
2334 | * purposes | 2350 | * purposes |
2335 | */ | 2351 | */ |
2336 | bool batadv_tt_global_client_is_roaming(struct bat_priv *bat_priv, | 2352 | bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv, |
2337 | uint8_t *addr) | 2353 | uint8_t *addr) |
2338 | { | 2354 | { |
2339 | struct tt_global_entry *tt_global_entry; | 2355 | struct batadv_tt_global_entry *tt_global_entry; |
2340 | bool ret = false; | 2356 | bool ret = false; |
2341 | 2357 | ||
2342 | tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr); | 2358 | tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr); |
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h index 4e83b293992b..ffa87355096b 100644 --- a/net/batman-adv/translation-table.h +++ b/net/batman-adv/translation-table.h | |||
@@ -21,42 +21,43 @@ | |||
21 | #define _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ | 21 | #define _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ |
22 | 22 | ||
23 | int batadv_tt_len(int changes_num); | 23 | int batadv_tt_len(int changes_num); |
24 | int batadv_tt_init(struct bat_priv *bat_priv); | 24 | int batadv_tt_init(struct batadv_priv *bat_priv); |
25 | void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, | 25 | void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, |
26 | int ifindex); | 26 | int ifindex); |
27 | void batadv_tt_local_remove(struct bat_priv *bat_priv, | 27 | void batadv_tt_local_remove(struct batadv_priv *bat_priv, |
28 | const uint8_t *addr, const char *message, | 28 | const uint8_t *addr, const char *message, |
29 | bool roaming); | 29 | bool roaming); |
30 | int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset); | 30 | int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset); |
31 | void batadv_tt_global_add_orig(struct bat_priv *bat_priv, | 31 | void batadv_tt_global_add_orig(struct batadv_priv *bat_priv, |
32 | struct orig_node *orig_node, | 32 | struct batadv_orig_node *orig_node, |
33 | const unsigned char *tt_buff, int tt_buff_len); | 33 | const unsigned char *tt_buff, int tt_buff_len); |
34 | int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node, | 34 | int batadv_tt_global_add(struct batadv_priv *bat_priv, |
35 | struct batadv_orig_node *orig_node, | ||
35 | const unsigned char *addr, uint8_t flags, | 36 | const unsigned char *addr, uint8_t flags, |
36 | uint8_t ttvn); | 37 | uint8_t ttvn); |
37 | int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset); | 38 | int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset); |
38 | void batadv_tt_global_del_orig(struct bat_priv *bat_priv, | 39 | void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, |
39 | struct orig_node *orig_node, | 40 | struct batadv_orig_node *orig_node, |
40 | const char *message); | 41 | const char *message); |
41 | struct orig_node *batadv_transtable_search(struct bat_priv *bat_priv, | 42 | struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv, |
42 | const uint8_t *src, | 43 | const uint8_t *src, |
43 | const uint8_t *addr); | 44 | const uint8_t *addr); |
44 | void batadv_tt_free(struct bat_priv *bat_priv); | 45 | void batadv_tt_free(struct batadv_priv *bat_priv); |
45 | bool batadv_send_tt_response(struct bat_priv *bat_priv, | 46 | bool batadv_send_tt_response(struct batadv_priv *bat_priv, |
46 | struct batadv_tt_query_packet *tt_request); | 47 | struct batadv_tt_query_packet *tt_request); |
47 | bool batadv_is_my_client(struct bat_priv *bat_priv, const uint8_t *addr); | 48 | bool batadv_is_my_client(struct batadv_priv *bat_priv, const uint8_t *addr); |
48 | void batadv_handle_tt_response(struct bat_priv *bat_priv, | 49 | void batadv_handle_tt_response(struct batadv_priv *bat_priv, |
49 | struct batadv_tt_query_packet *tt_response); | 50 | struct batadv_tt_query_packet *tt_response); |
50 | bool batadv_is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, | 51 | bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, uint8_t *src, |
51 | uint8_t *dst); | 52 | uint8_t *dst); |
52 | void batadv_tt_update_orig(struct bat_priv *bat_priv, | 53 | void batadv_tt_update_orig(struct batadv_priv *bat_priv, |
53 | struct orig_node *orig_node, | 54 | struct batadv_orig_node *orig_node, |
54 | const unsigned char *tt_buff, uint8_t tt_num_changes, | 55 | const unsigned char *tt_buff, uint8_t tt_num_changes, |
55 | uint8_t ttvn, uint16_t tt_crc); | 56 | uint8_t ttvn, uint16_t tt_crc); |
56 | int batadv_tt_append_diff(struct bat_priv *bat_priv, | 57 | int batadv_tt_append_diff(struct batadv_priv *bat_priv, |
57 | unsigned char **packet_buff, int *packet_buff_len, | 58 | unsigned char **packet_buff, int *packet_buff_len, |
58 | int packet_min_len); | 59 | int packet_min_len); |
59 | bool batadv_tt_global_client_is_roaming(struct bat_priv *bat_priv, | 60 | bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv, |
60 | uint8_t *addr); | 61 | uint8_t *addr); |
61 | 62 | ||
62 | 63 | ||
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index fb61d9cd912f..2141c1304898 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h | |||
@@ -28,7 +28,7 @@ | |||
28 | (ETH_HLEN + max(sizeof(struct batadv_unicast_packet), \ | 28 | (ETH_HLEN + max(sizeof(struct batadv_unicast_packet), \ |
29 | sizeof(struct batadv_bcast_packet))) | 29 | sizeof(struct batadv_bcast_packet))) |
30 | 30 | ||
31 | struct hard_iface { | 31 | struct batadv_hard_iface { |
32 | struct list_head list; | 32 | struct list_head list; |
33 | int16_t if_num; | 33 | int16_t if_num; |
34 | char if_status; | 34 | char if_status; |
@@ -44,7 +44,7 @@ struct hard_iface { | |||
44 | struct rcu_head rcu; | 44 | struct rcu_head rcu; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | /* orig_node - structure for orig_list maintaining nodes of mesh | 47 | /* batadv_orig_node - structure for orig_list maintaining nodes of mesh |
48 | * @primary_addr: hosts primary interface address | 48 | * @primary_addr: hosts primary interface address |
49 | * @last_seen: when last packet from this node was received | 49 | * @last_seen: when last packet from this node was received |
50 | * @bcast_seqno_reset: time when the broadcast seqno window was reset | 50 | * @bcast_seqno_reset: time when the broadcast seqno window was reset |
@@ -58,10 +58,10 @@ struct hard_iface { | |||
58 | * @candidates: how many candidates are available | 58 | * @candidates: how many candidates are available |
59 | * @selected: next bonding candidate | 59 | * @selected: next bonding candidate |
60 | */ | 60 | */ |
61 | struct orig_node { | 61 | struct batadv_orig_node { |
62 | uint8_t orig[ETH_ALEN]; | 62 | uint8_t orig[ETH_ALEN]; |
63 | uint8_t primary_addr[ETH_ALEN]; | 63 | uint8_t primary_addr[ETH_ALEN]; |
64 | struct neigh_node __rcu *router; /* rcu protected pointer */ | 64 | struct batadv_neigh_node __rcu *router; /* rcu protected pointer */ |
65 | unsigned long *bcast_own; | 65 | unsigned long *bcast_own; |
66 | uint8_t *bcast_own_sum; | 66 | uint8_t *bcast_own_sum; |
67 | unsigned long last_seen; | 67 | unsigned long last_seen; |
@@ -93,7 +93,7 @@ struct orig_node { | |||
93 | atomic_t refcount; | 93 | atomic_t refcount; |
94 | struct rcu_head rcu; | 94 | struct rcu_head rcu; |
95 | struct hlist_node hash_entry; | 95 | struct hlist_node hash_entry; |
96 | struct bat_priv *bat_priv; | 96 | struct batadv_priv *bat_priv; |
97 | unsigned long last_frag_packet; | 97 | unsigned long last_frag_packet; |
98 | /* ogm_cnt_lock protects: bcast_own, bcast_own_sum, | 98 | /* ogm_cnt_lock protects: bcast_own, bcast_own_sum, |
99 | * neigh_node->real_bits, neigh_node->real_packet_count | 99 | * neigh_node->real_bits, neigh_node->real_packet_count |
@@ -106,18 +106,18 @@ struct orig_node { | |||
106 | struct list_head bond_list; | 106 | struct list_head bond_list; |
107 | }; | 107 | }; |
108 | 108 | ||
109 | struct gw_node { | 109 | struct batadv_gw_node { |
110 | struct hlist_node list; | 110 | struct hlist_node list; |
111 | struct orig_node *orig_node; | 111 | struct batadv_orig_node *orig_node; |
112 | unsigned long deleted; | 112 | unsigned long deleted; |
113 | atomic_t refcount; | 113 | atomic_t refcount; |
114 | struct rcu_head rcu; | 114 | struct rcu_head rcu; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | /* neigh_node | 117 | /* batadv_neigh_node |
118 | * @last_seen: when last packet via this neighbor was received | 118 | * @last_seen: when last packet via this neighbor was received |
119 | */ | 119 | */ |
120 | struct neigh_node { | 120 | struct batadv_neigh_node { |
121 | struct hlist_node list; | 121 | struct hlist_node list; |
122 | uint8_t addr[ETH_ALEN]; | 122 | uint8_t addr[ETH_ALEN]; |
123 | uint8_t real_packet_count; | 123 | uint8_t real_packet_count; |
@@ -130,13 +130,13 @@ struct neigh_node { | |||
130 | DECLARE_BITMAP(real_bits, BATADV_TQ_LOCAL_WINDOW_SIZE); | 130 | DECLARE_BITMAP(real_bits, BATADV_TQ_LOCAL_WINDOW_SIZE); |
131 | atomic_t refcount; | 131 | atomic_t refcount; |
132 | struct rcu_head rcu; | 132 | struct rcu_head rcu; |
133 | struct orig_node *orig_node; | 133 | struct batadv_orig_node *orig_node; |
134 | struct hard_iface *if_incoming; | 134 | struct batadv_hard_iface *if_incoming; |
135 | spinlock_t lq_update_lock; /* protects: tq_recv, tq_index */ | 135 | spinlock_t lq_update_lock; /* protects: tq_recv, tq_index */ |
136 | }; | 136 | }; |
137 | 137 | ||
138 | #ifdef CONFIG_BATMAN_ADV_BLA | 138 | #ifdef CONFIG_BATMAN_ADV_BLA |
139 | struct bcast_duplist_entry { | 139 | struct batadv_bcast_duplist_entry { |
140 | uint8_t orig[ETH_ALEN]; | 140 | uint8_t orig[ETH_ALEN]; |
141 | uint16_t crc; | 141 | uint16_t crc; |
142 | unsigned long entrytime; | 142 | unsigned long entrytime; |
@@ -159,7 +159,7 @@ enum batadv_counters { | |||
159 | BATADV_CNT_NUM, | 159 | BATADV_CNT_NUM, |
160 | }; | 160 | }; |
161 | 161 | ||
162 | struct bat_priv { | 162 | struct batadv_priv { |
163 | atomic_t mesh_state; | 163 | atomic_t mesh_state; |
164 | struct net_device_stats stats; | 164 | struct net_device_stats stats; |
165 | uint64_t __percpu *bat_counters; /* Per cpu counters */ | 165 | uint64_t __percpu *bat_counters; /* Per cpu counters */ |
@@ -190,7 +190,7 @@ struct bat_priv { | |||
190 | */ | 190 | */ |
191 | bool tt_poss_change; | 191 | bool tt_poss_change; |
192 | char num_ifaces; | 192 | char num_ifaces; |
193 | struct debug_log *debug_log; | 193 | struct batadv_debug_log *debug_log; |
194 | struct kobject *mesh_obj; | 194 | struct kobject *mesh_obj; |
195 | struct dentry *debug_dir; | 195 | struct dentry *debug_dir; |
196 | struct hlist_head forw_bat_list; | 196 | struct hlist_head forw_bat_list; |
@@ -209,7 +209,7 @@ struct bat_priv { | |||
209 | struct list_head tt_roam_list; | 209 | struct list_head tt_roam_list; |
210 | struct batadv_hashtable *vis_hash; | 210 | struct batadv_hashtable *vis_hash; |
211 | #ifdef CONFIG_BATMAN_ADV_BLA | 211 | #ifdef CONFIG_BATMAN_ADV_BLA |
212 | struct bcast_duplist_entry bcast_duplist[BATADV_DUPLIST_SIZE]; | 212 | struct batadv_bcast_duplist_entry bcast_duplist[BATADV_DUPLIST_SIZE]; |
213 | int bcast_duplist_curr; | 213 | int bcast_duplist_curr; |
214 | struct batadv_bla_claim_dst claim_dest; | 214 | struct batadv_bla_claim_dst claim_dest; |
215 | #endif | 215 | #endif |
@@ -231,29 +231,29 @@ struct bat_priv { | |||
231 | struct delayed_work orig_work; | 231 | struct delayed_work orig_work; |
232 | struct delayed_work vis_work; | 232 | struct delayed_work vis_work; |
233 | struct delayed_work bla_work; | 233 | struct delayed_work bla_work; |
234 | struct gw_node __rcu *curr_gw; /* rcu protected pointer */ | 234 | struct batadv_gw_node __rcu *curr_gw; /* rcu protected pointer */ |
235 | atomic_t gw_reselect; | 235 | atomic_t gw_reselect; |
236 | struct hard_iface __rcu *primary_if; /* rcu protected pointer */ | 236 | struct batadv_hard_iface __rcu *primary_if; /* rcu protected pointer */ |
237 | struct vis_info *my_vis_info; | 237 | struct batadv_vis_info *my_vis_info; |
238 | struct bat_algo_ops *bat_algo_ops; | 238 | struct batadv_algo_ops *bat_algo_ops; |
239 | }; | 239 | }; |
240 | 240 | ||
241 | struct socket_client { | 241 | struct batadv_socket_client { |
242 | struct list_head queue_list; | 242 | struct list_head queue_list; |
243 | unsigned int queue_len; | 243 | unsigned int queue_len; |
244 | unsigned char index; | 244 | unsigned char index; |
245 | spinlock_t lock; /* protects queue_list, queue_len, index */ | 245 | spinlock_t lock; /* protects queue_list, queue_len, index */ |
246 | wait_queue_head_t queue_wait; | 246 | wait_queue_head_t queue_wait; |
247 | struct bat_priv *bat_priv; | 247 | struct batadv_priv *bat_priv; |
248 | }; | 248 | }; |
249 | 249 | ||
250 | struct socket_packet { | 250 | struct batadv_socket_packet { |
251 | struct list_head list; | 251 | struct list_head list; |
252 | size_t icmp_len; | 252 | size_t icmp_len; |
253 | struct batadv_icmp_packet_rr icmp_packet; | 253 | struct batadv_icmp_packet_rr icmp_packet; |
254 | }; | 254 | }; |
255 | 255 | ||
256 | struct tt_common_entry { | 256 | struct batadv_tt_common_entry { |
257 | uint8_t addr[ETH_ALEN]; | 257 | uint8_t addr[ETH_ALEN]; |
258 | struct hlist_node hash_entry; | 258 | struct hlist_node hash_entry; |
259 | uint16_t flags; | 259 | uint16_t flags; |
@@ -261,31 +261,31 @@ struct tt_common_entry { | |||
261 | struct rcu_head rcu; | 261 | struct rcu_head rcu; |
262 | }; | 262 | }; |
263 | 263 | ||
264 | struct tt_local_entry { | 264 | struct batadv_tt_local_entry { |
265 | struct tt_common_entry common; | 265 | struct batadv_tt_common_entry common; |
266 | unsigned long last_seen; | 266 | unsigned long last_seen; |
267 | }; | 267 | }; |
268 | 268 | ||
269 | struct tt_global_entry { | 269 | struct batadv_tt_global_entry { |
270 | struct tt_common_entry common; | 270 | struct batadv_tt_common_entry common; |
271 | struct hlist_head orig_list; | 271 | struct hlist_head orig_list; |
272 | spinlock_t list_lock; /* protects the list */ | 272 | spinlock_t list_lock; /* protects the list */ |
273 | unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */ | 273 | unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */ |
274 | }; | 274 | }; |
275 | 275 | ||
276 | struct tt_orig_list_entry { | 276 | struct batadv_tt_orig_list_entry { |
277 | struct orig_node *orig_node; | 277 | struct batadv_orig_node *orig_node; |
278 | uint8_t ttvn; | 278 | uint8_t ttvn; |
279 | struct rcu_head rcu; | 279 | struct rcu_head rcu; |
280 | struct hlist_node list; | 280 | struct hlist_node list; |
281 | }; | 281 | }; |
282 | 282 | ||
283 | #ifdef CONFIG_BATMAN_ADV_BLA | 283 | #ifdef CONFIG_BATMAN_ADV_BLA |
284 | struct backbone_gw { | 284 | struct batadv_backbone_gw { |
285 | uint8_t orig[ETH_ALEN]; | 285 | uint8_t orig[ETH_ALEN]; |
286 | short vid; /* used VLAN ID */ | 286 | short vid; /* used VLAN ID */ |
287 | struct hlist_node hash_entry; | 287 | struct hlist_node hash_entry; |
288 | struct bat_priv *bat_priv; | 288 | struct batadv_priv *bat_priv; |
289 | unsigned long lasttime; /* last time we heard of this backbone gw */ | 289 | unsigned long lasttime; /* last time we heard of this backbone gw */ |
290 | atomic_t request_sent; | 290 | atomic_t request_sent; |
291 | atomic_t refcount; | 291 | atomic_t refcount; |
@@ -293,10 +293,10 @@ struct backbone_gw { | |||
293 | uint16_t crc; /* crc checksum over all claims */ | 293 | uint16_t crc; /* crc checksum over all claims */ |
294 | }; | 294 | }; |
295 | 295 | ||
296 | struct claim { | 296 | struct batadv_claim { |
297 | uint8_t addr[ETH_ALEN]; | 297 | uint8_t addr[ETH_ALEN]; |
298 | short vid; | 298 | short vid; |
299 | struct backbone_gw *backbone_gw; | 299 | struct batadv_backbone_gw *backbone_gw; |
300 | unsigned long lasttime; /* last time we heard of claim (locals only) */ | 300 | unsigned long lasttime; /* last time we heard of claim (locals only) */ |
301 | struct rcu_head rcu; | 301 | struct rcu_head rcu; |
302 | atomic_t refcount; | 302 | atomic_t refcount; |
@@ -304,18 +304,18 @@ struct claim { | |||
304 | }; | 304 | }; |
305 | #endif | 305 | #endif |
306 | 306 | ||
307 | struct tt_change_node { | 307 | struct batadv_tt_change_node { |
308 | struct list_head list; | 308 | struct list_head list; |
309 | struct batadv_tt_change change; | 309 | struct batadv_tt_change change; |
310 | }; | 310 | }; |
311 | 311 | ||
312 | struct tt_req_node { | 312 | struct batadv_tt_req_node { |
313 | uint8_t addr[ETH_ALEN]; | 313 | uint8_t addr[ETH_ALEN]; |
314 | unsigned long issued_at; | 314 | unsigned long issued_at; |
315 | struct list_head list; | 315 | struct list_head list; |
316 | }; | 316 | }; |
317 | 317 | ||
318 | struct tt_roam_node { | 318 | struct batadv_tt_roam_node { |
319 | uint8_t addr[ETH_ALEN]; | 319 | uint8_t addr[ETH_ALEN]; |
320 | atomic_t counter; | 320 | atomic_t counter; |
321 | unsigned long first_time; | 321 | unsigned long first_time; |
@@ -325,7 +325,7 @@ struct tt_roam_node { | |||
325 | /* forw_packet - structure for forw_list maintaining packets to be | 325 | /* forw_packet - structure for forw_list maintaining packets to be |
326 | * send/forwarded | 326 | * send/forwarded |
327 | */ | 327 | */ |
328 | struct forw_packet { | 328 | struct batadv_forw_packet { |
329 | struct hlist_node list; | 329 | struct hlist_node list; |
330 | unsigned long send_time; | 330 | unsigned long send_time; |
331 | uint8_t own; | 331 | uint8_t own; |
@@ -334,20 +334,20 @@ struct forw_packet { | |||
334 | uint32_t direct_link_flags; | 334 | uint32_t direct_link_flags; |
335 | uint8_t num_packets; | 335 | uint8_t num_packets; |
336 | struct delayed_work delayed_work; | 336 | struct delayed_work delayed_work; |
337 | struct hard_iface *if_incoming; | 337 | struct batadv_hard_iface *if_incoming; |
338 | }; | 338 | }; |
339 | 339 | ||
340 | /* While scanning for vis-entries of a particular vis-originator | 340 | /* While scanning for vis-entries of a particular vis-originator |
341 | * this list collects its interfaces to create a subgraph/cluster | 341 | * this list collects its interfaces to create a subgraph/cluster |
342 | * out of them later | 342 | * out of them later |
343 | */ | 343 | */ |
344 | struct if_list_entry { | 344 | struct batadv_if_list_entry { |
345 | uint8_t addr[ETH_ALEN]; | 345 | uint8_t addr[ETH_ALEN]; |
346 | bool primary; | 346 | bool primary; |
347 | struct hlist_node list; | 347 | struct hlist_node list; |
348 | }; | 348 | }; |
349 | 349 | ||
350 | struct debug_log { | 350 | struct batadv_debug_log { |
351 | char log_buff[BATADV_LOG_BUF_LEN]; | 351 | char log_buff[BATADV_LOG_BUF_LEN]; |
352 | unsigned long log_start; | 352 | unsigned long log_start; |
353 | unsigned long log_end; | 353 | unsigned long log_end; |
@@ -355,13 +355,13 @@ struct debug_log { | |||
355 | wait_queue_head_t queue_wait; | 355 | wait_queue_head_t queue_wait; |
356 | }; | 356 | }; |
357 | 357 | ||
358 | struct frag_packet_list_entry { | 358 | struct batadv_frag_packet_list_entry { |
359 | struct list_head list; | 359 | struct list_head list; |
360 | uint16_t seqno; | 360 | uint16_t seqno; |
361 | struct sk_buff *skb; | 361 | struct sk_buff *skb; |
362 | }; | 362 | }; |
363 | 363 | ||
364 | struct vis_info { | 364 | struct batadv_vis_info { |
365 | unsigned long first_seen; | 365 | unsigned long first_seen; |
366 | /* list of server-neighbors we received a vis-packet | 366 | /* list of server-neighbors we received a vis-packet |
367 | * from. we should not reply to them. | 367 | * from. we should not reply to them. |
@@ -370,40 +370,40 @@ struct vis_info { | |||
370 | struct list_head send_list; | 370 | struct list_head send_list; |
371 | struct kref refcount; | 371 | struct kref refcount; |
372 | struct hlist_node hash_entry; | 372 | struct hlist_node hash_entry; |
373 | struct bat_priv *bat_priv; | 373 | struct batadv_priv *bat_priv; |
374 | /* this packet might be part of the vis send queue. */ | 374 | /* this packet might be part of the vis send queue. */ |
375 | struct sk_buff *skb_packet; | 375 | struct sk_buff *skb_packet; |
376 | /* vis_info may follow here */ | 376 | /* vis_info may follow here */ |
377 | } __packed; | 377 | } __packed; |
378 | 378 | ||
379 | struct vis_info_entry { | 379 | struct batadv_vis_info_entry { |
380 | uint8_t src[ETH_ALEN]; | 380 | uint8_t src[ETH_ALEN]; |
381 | uint8_t dest[ETH_ALEN]; | 381 | uint8_t dest[ETH_ALEN]; |
382 | uint8_t quality; /* quality = 0 client */ | 382 | uint8_t quality; /* quality = 0 client */ |
383 | } __packed; | 383 | } __packed; |
384 | 384 | ||
385 | struct recvlist_node { | 385 | struct batadv_recvlist_node { |
386 | struct list_head list; | 386 | struct list_head list; |
387 | uint8_t mac[ETH_ALEN]; | 387 | uint8_t mac[ETH_ALEN]; |
388 | }; | 388 | }; |
389 | 389 | ||
390 | struct bat_algo_ops { | 390 | struct batadv_algo_ops { |
391 | struct hlist_node list; | 391 | struct hlist_node list; |
392 | char *name; | 392 | char *name; |
393 | /* init routing info when hard-interface is enabled */ | 393 | /* init routing info when hard-interface is enabled */ |
394 | int (*bat_iface_enable)(struct hard_iface *hard_iface); | 394 | int (*bat_iface_enable)(struct batadv_hard_iface *hard_iface); |
395 | /* de-init routing info when hard-interface is disabled */ | 395 | /* de-init routing info when hard-interface is disabled */ |
396 | void (*bat_iface_disable)(struct hard_iface *hard_iface); | 396 | void (*bat_iface_disable)(struct batadv_hard_iface *hard_iface); |
397 | /* (re-)init mac addresses of the protocol information | 397 | /* (re-)init mac addresses of the protocol information |
398 | * belonging to this hard-interface | 398 | * belonging to this hard-interface |
399 | */ | 399 | */ |
400 | void (*bat_iface_update_mac)(struct hard_iface *hard_iface); | 400 | void (*bat_iface_update_mac)(struct batadv_hard_iface *hard_iface); |
401 | /* called when primary interface is selected / changed */ | 401 | /* called when primary interface is selected / changed */ |
402 | void (*bat_primary_iface_set)(struct hard_iface *hard_iface); | 402 | void (*bat_primary_iface_set)(struct batadv_hard_iface *hard_iface); |
403 | /* prepare a new outgoing OGM for the send queue */ | 403 | /* prepare a new outgoing OGM for the send queue */ |
404 | void (*bat_ogm_schedule)(struct hard_iface *hard_iface); | 404 | void (*bat_ogm_schedule)(struct batadv_hard_iface *hard_iface); |
405 | /* send scheduled OGM */ | 405 | /* send scheduled OGM */ |
406 | void (*bat_ogm_emit)(struct forw_packet *forw_packet); | 406 | void (*bat_ogm_emit)(struct batadv_forw_packet *forw_packet); |
407 | }; | 407 | }; |
408 | 408 | ||
409 | #endif /* _NET_BATMAN_ADV_TYPES_H_ */ | 409 | #endif /* _NET_BATMAN_ADV_TYPES_H_ */ |
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index 8a2a3df17fff..c42b81d7e282 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | static struct sk_buff * | 32 | static struct sk_buff * |
33 | batadv_frag_merge_packet(struct list_head *head, | 33 | batadv_frag_merge_packet(struct list_head *head, |
34 | struct frag_packet_list_entry *tfp, | 34 | struct batadv_frag_packet_list_entry *tfp, |
35 | struct sk_buff *skb) | 35 | struct sk_buff *skb) |
36 | { | 36 | { |
37 | struct batadv_unicast_frag_packet *up; | 37 | struct batadv_unicast_frag_packet *up; |
@@ -80,7 +80,7 @@ err: | |||
80 | static void batadv_frag_create_entry(struct list_head *head, | 80 | static void batadv_frag_create_entry(struct list_head *head, |
81 | struct sk_buff *skb) | 81 | struct sk_buff *skb) |
82 | { | 82 | { |
83 | struct frag_packet_list_entry *tfp; | 83 | struct batadv_frag_packet_list_entry *tfp; |
84 | struct batadv_unicast_frag_packet *up; | 84 | struct batadv_unicast_frag_packet *up; |
85 | 85 | ||
86 | up = (struct batadv_unicast_frag_packet *)skb->data; | 86 | up = (struct batadv_unicast_frag_packet *)skb->data; |
@@ -98,7 +98,7 @@ static void batadv_frag_create_entry(struct list_head *head, | |||
98 | static int batadv_frag_create_buffer(struct list_head *head) | 98 | static int batadv_frag_create_buffer(struct list_head *head) |
99 | { | 99 | { |
100 | int i; | 100 | int i; |
101 | struct frag_packet_list_entry *tfp; | 101 | struct batadv_frag_packet_list_entry *tfp; |
102 | 102 | ||
103 | for (i = 0; i < BATADV_FRAG_BUFFER_SIZE; i++) { | 103 | for (i = 0; i < BATADV_FRAG_BUFFER_SIZE; i++) { |
104 | tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC); | 104 | tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC); |
@@ -115,11 +115,11 @@ static int batadv_frag_create_buffer(struct list_head *head) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static struct frag_packet_list_entry * | 118 | static struct batadv_frag_packet_list_entry * |
119 | batadv_frag_search_packet(struct list_head *head, | 119 | batadv_frag_search_packet(struct list_head *head, |
120 | const struct batadv_unicast_frag_packet *up) | 120 | const struct batadv_unicast_frag_packet *up) |
121 | { | 121 | { |
122 | struct frag_packet_list_entry *tfp; | 122 | struct batadv_frag_packet_list_entry *tfp; |
123 | struct batadv_unicast_frag_packet *tmp_up = NULL; | 123 | struct batadv_unicast_frag_packet *tmp_up = NULL; |
124 | uint16_t search_seqno; | 124 | uint16_t search_seqno; |
125 | 125 | ||
@@ -156,7 +156,7 @@ mov_tail: | |||
156 | 156 | ||
157 | void batadv_frag_list_free(struct list_head *head) | 157 | void batadv_frag_list_free(struct list_head *head) |
158 | { | 158 | { |
159 | struct frag_packet_list_entry *pf, *tmp_pf; | 159 | struct batadv_frag_packet_list_entry *pf, *tmp_pf; |
160 | 160 | ||
161 | if (!list_empty(head)) { | 161 | if (!list_empty(head)) { |
162 | 162 | ||
@@ -175,11 +175,12 @@ void batadv_frag_list_free(struct list_head *head) | |||
175 | * or the skb could be reassembled (skb_new will point to the new packet and | 175 | * or the skb could be reassembled (skb_new will point to the new packet and |
176 | * skb was freed) | 176 | * skb was freed) |
177 | */ | 177 | */ |
178 | int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | 178 | int batadv_frag_reassemble_skb(struct sk_buff *skb, |
179 | struct batadv_priv *bat_priv, | ||
179 | struct sk_buff **new_skb) | 180 | struct sk_buff **new_skb) |
180 | { | 181 | { |
181 | struct orig_node *orig_node; | 182 | struct batadv_orig_node *orig_node; |
182 | struct frag_packet_list_entry *tmp_frag_entry; | 183 | struct batadv_frag_packet_list_entry *tmp_frag_entry; |
183 | int ret = NET_RX_DROP; | 184 | int ret = NET_RX_DROP; |
184 | struct batadv_unicast_frag_packet *unicast_packet; | 185 | struct batadv_unicast_frag_packet *unicast_packet; |
185 | 186 | ||
@@ -219,11 +220,12 @@ out: | |||
219 | return ret; | 220 | return ret; |
220 | } | 221 | } |
221 | 222 | ||
222 | int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | 223 | int batadv_frag_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv, |
223 | struct hard_iface *hard_iface, const uint8_t dstaddr[]) | 224 | struct batadv_hard_iface *hard_iface, |
225 | const uint8_t dstaddr[]) | ||
224 | { | 226 | { |
225 | struct batadv_unicast_packet tmp_uc, *unicast_packet; | 227 | struct batadv_unicast_packet tmp_uc, *unicast_packet; |
226 | struct hard_iface *primary_if; | 228 | struct batadv_hard_iface *primary_if; |
227 | struct sk_buff *frag_skb; | 229 | struct sk_buff *frag_skb; |
228 | struct batadv_unicast_frag_packet *frag1, *frag2; | 230 | struct batadv_unicast_frag_packet *frag1, *frag2; |
229 | int uc_hdr_len = sizeof(*unicast_packet); | 231 | int uc_hdr_len = sizeof(*unicast_packet); |
@@ -286,12 +288,12 @@ out: | |||
286 | return ret; | 288 | return ret; |
287 | } | 289 | } |
288 | 290 | ||
289 | int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) | 291 | int batadv_unicast_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv) |
290 | { | 292 | { |
291 | struct ethhdr *ethhdr = (struct ethhdr *)skb->data; | 293 | struct ethhdr *ethhdr = (struct ethhdr *)skb->data; |
292 | struct batadv_unicast_packet *unicast_packet; | 294 | struct batadv_unicast_packet *unicast_packet; |
293 | struct orig_node *orig_node; | 295 | struct batadv_orig_node *orig_node; |
294 | struct neigh_node *neigh_node; | 296 | struct batadv_neigh_node *neigh_node; |
295 | int data_len = skb->len; | 297 | int data_len = skb->len; |
296 | int ret = 1; | 298 | int ret = 1; |
297 | 299 | ||
@@ -307,12 +309,14 @@ int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) | |||
307 | */ | 309 | */ |
308 | orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source, | 310 | orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source, |
309 | ethhdr->h_dest); | 311 | ethhdr->h_dest); |
312 | |||
310 | find_router: | 313 | find_router: |
311 | /* find_router(): | 314 | /* find_router(): |
312 | * - if orig_node is NULL it returns NULL | 315 | * - if orig_node is NULL it returns NULL |
313 | * - increases neigh_nodes refcount if found. | 316 | * - increases neigh_nodes refcount if found. |
314 | */ | 317 | */ |
315 | neigh_node = batadv_find_router(bat_priv, orig_node, NULL); | 318 | neigh_node = batadv_find_router(bat_priv, orig_node, NULL); |
319 | |||
316 | if (!neigh_node) | 320 | if (!neigh_node) |
317 | goto out; | 321 | goto out; |
318 | 322 | ||
diff --git a/net/batman-adv/unicast.h b/net/batman-adv/unicast.h index e0b6e335797e..1c46e2eb1ef9 100644 --- a/net/batman-adv/unicast.h +++ b/net/batman-adv/unicast.h | |||
@@ -25,12 +25,13 @@ | |||
25 | #define BATADV_FRAG_TIMEOUT 10000 /* purge frag list entries after time in ms */ | 25 | #define BATADV_FRAG_TIMEOUT 10000 /* purge frag list entries after time in ms */ |
26 | #define BATADV_FRAG_BUFFER_SIZE 6 /* number of list elements in buffer */ | 26 | #define BATADV_FRAG_BUFFER_SIZE 6 /* number of list elements in buffer */ |
27 | 27 | ||
28 | int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | 28 | int batadv_frag_reassemble_skb(struct sk_buff *skb, |
29 | struct batadv_priv *bat_priv, | ||
29 | struct sk_buff **new_skb); | 30 | struct sk_buff **new_skb); |
30 | void batadv_frag_list_free(struct list_head *head); | 31 | void batadv_frag_list_free(struct list_head *head); |
31 | int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv); | 32 | int batadv_unicast_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv); |
32 | int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | 33 | int batadv_frag_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv, |
33 | struct hard_iface *hard_iface, | 34 | struct batadv_hard_iface *hard_iface, |
34 | const uint8_t dstaddr[]); | 35 | const uint8_t dstaddr[]); |
35 | 36 | ||
36 | static inline int batadv_frag_can_reassemble(const struct sk_buff *skb, int mtu) | 37 | static inline int batadv_frag_can_reassemble(const struct sk_buff *skb, int mtu) |
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c index 309493d9128a..f09cc9ad6ad8 100644 --- a/net/batman-adv/vis.c +++ b/net/batman-adv/vis.c | |||
@@ -28,14 +28,17 @@ | |||
28 | 28 | ||
29 | #define BATADV_MAX_VIS_PACKET_SIZE 1000 | 29 | #define BATADV_MAX_VIS_PACKET_SIZE 1000 |
30 | 30 | ||
31 | static void batadv_start_vis_timer(struct bat_priv *bat_priv); | 31 | static void batadv_start_vis_timer(struct batadv_priv *bat_priv); |
32 | 32 | ||
33 | /* free the info */ | 33 | /* free the info */ |
34 | static void batadv_free_info(struct kref *ref) | 34 | static void batadv_free_info(struct kref *ref) |
35 | { | 35 | { |
36 | struct vis_info *info = container_of(ref, struct vis_info, refcount); | 36 | struct batadv_vis_info *info; |
37 | struct bat_priv *bat_priv = info->bat_priv; | 37 | struct batadv_priv *bat_priv; |
38 | struct recvlist_node *entry, *tmp; | 38 | struct batadv_recvlist_node *entry, *tmp; |
39 | |||
40 | info = container_of(ref, struct batadv_vis_info, refcount); | ||
41 | bat_priv = info->bat_priv; | ||
39 | 42 | ||
40 | list_del_init(&info->send_list); | 43 | list_del_init(&info->send_list); |
41 | spin_lock_bh(&bat_priv->vis_list_lock); | 44 | spin_lock_bh(&bat_priv->vis_list_lock); |
@@ -52,10 +55,10 @@ static void batadv_free_info(struct kref *ref) | |||
52 | /* Compare two vis packets, used by the hashing algorithm */ | 55 | /* Compare two vis packets, used by the hashing algorithm */ |
53 | static int batadv_vis_info_cmp(const struct hlist_node *node, const void *data2) | 56 | static int batadv_vis_info_cmp(const struct hlist_node *node, const void *data2) |
54 | { | 57 | { |
55 | const struct vis_info *d1, *d2; | 58 | const struct batadv_vis_info *d1, *d2; |
56 | const struct batadv_vis_packet *p1, *p2; | 59 | const struct batadv_vis_packet *p1, *p2; |
57 | 60 | ||
58 | d1 = container_of(node, struct vis_info, hash_entry); | 61 | d1 = container_of(node, struct batadv_vis_info, hash_entry); |
59 | d2 = data2; | 62 | d2 = data2; |
60 | p1 = (struct batadv_vis_packet *)d1->skb_packet->data; | 63 | p1 = (struct batadv_vis_packet *)d1->skb_packet->data; |
61 | p2 = (struct batadv_vis_packet *)d2->skb_packet->data; | 64 | p2 = (struct batadv_vis_packet *)d2->skb_packet->data; |
@@ -67,7 +70,7 @@ static int batadv_vis_info_cmp(const struct hlist_node *node, const void *data2) | |||
67 | */ | 70 | */ |
68 | static uint32_t batadv_vis_info_choose(const void *data, uint32_t size) | 71 | static uint32_t batadv_vis_info_choose(const void *data, uint32_t size) |
69 | { | 72 | { |
70 | const struct vis_info *vis_info = data; | 73 | const struct batadv_vis_info *vis_info = data; |
71 | const struct batadv_vis_packet *packet; | 74 | const struct batadv_vis_packet *packet; |
72 | const unsigned char *key; | 75 | const unsigned char *key; |
73 | uint32_t hash = 0; | 76 | uint32_t hash = 0; |
@@ -88,13 +91,13 @@ static uint32_t batadv_vis_info_choose(const void *data, uint32_t size) | |||
88 | return hash % size; | 91 | return hash % size; |
89 | } | 92 | } |
90 | 93 | ||
91 | static struct vis_info *batadv_vis_hash_find(struct bat_priv *bat_priv, | 94 | static struct batadv_vis_info * |
92 | const void *data) | 95 | batadv_vis_hash_find(struct batadv_priv *bat_priv, const void *data) |
93 | { | 96 | { |
94 | struct batadv_hashtable *hash = bat_priv->vis_hash; | 97 | struct batadv_hashtable *hash = bat_priv->vis_hash; |
95 | struct hlist_head *head; | 98 | struct hlist_head *head; |
96 | struct hlist_node *node; | 99 | struct hlist_node *node; |
97 | struct vis_info *vis_info, *vis_info_tmp = NULL; | 100 | struct batadv_vis_info *vis_info, *vis_info_tmp = NULL; |
98 | uint32_t index; | 101 | uint32_t index; |
99 | 102 | ||
100 | if (!hash) | 103 | if (!hash) |
@@ -123,7 +126,7 @@ static void batadv_vis_data_insert_interface(const uint8_t *interface, | |||
123 | struct hlist_head *if_list, | 126 | struct hlist_head *if_list, |
124 | bool primary) | 127 | bool primary) |
125 | { | 128 | { |
126 | struct if_list_entry *entry; | 129 | struct batadv_if_list_entry *entry; |
127 | struct hlist_node *pos; | 130 | struct hlist_node *pos; |
128 | 131 | ||
129 | hlist_for_each_entry(entry, pos, if_list, list) { | 132 | hlist_for_each_entry(entry, pos, if_list, list) { |
@@ -143,7 +146,7 @@ static void batadv_vis_data_insert_interface(const uint8_t *interface, | |||
143 | static void batadv_vis_data_read_prim_sec(struct seq_file *seq, | 146 | static void batadv_vis_data_read_prim_sec(struct seq_file *seq, |
144 | const struct hlist_head *if_list) | 147 | const struct hlist_head *if_list) |
145 | { | 148 | { |
146 | struct if_list_entry *entry; | 149 | struct batadv_if_list_entry *entry; |
147 | struct hlist_node *pos; | 150 | struct hlist_node *pos; |
148 | 151 | ||
149 | hlist_for_each_entry(entry, pos, if_list, list) { | 152 | hlist_for_each_entry(entry, pos, if_list, list) { |
@@ -155,9 +158,10 @@ static void batadv_vis_data_read_prim_sec(struct seq_file *seq, | |||
155 | } | 158 | } |
156 | 159 | ||
157 | /* read an entry */ | 160 | /* read an entry */ |
158 | static ssize_t batadv_vis_data_read_entry(struct seq_file *seq, | 161 | static ssize_t |
159 | const struct vis_info_entry *entry, | 162 | batadv_vis_data_read_entry(struct seq_file *seq, |
160 | const uint8_t *src, bool primary) | 163 | const struct batadv_vis_info_entry *entry, |
164 | const uint8_t *src, bool primary) | ||
161 | { | 165 | { |
162 | if (primary && entry->quality == 0) | 166 | if (primary && entry->quality == 0) |
163 | return seq_printf(seq, "TT %pM, ", entry->dest); | 167 | return seq_printf(seq, "TT %pM, ", entry->dest); |
@@ -168,9 +172,10 @@ static ssize_t batadv_vis_data_read_entry(struct seq_file *seq, | |||
168 | return 0; | 172 | return 0; |
169 | } | 173 | } |
170 | 174 | ||
171 | static void batadv_vis_data_insert_interfaces(struct hlist_head *list, | 175 | static void |
172 | struct batadv_vis_packet *packet, | 176 | batadv_vis_data_insert_interfaces(struct hlist_head *list, |
173 | struct vis_info_entry *entries) | 177 | struct batadv_vis_packet *packet, |
178 | struct batadv_vis_info_entry *entries) | ||
174 | { | 179 | { |
175 | int i; | 180 | int i; |
176 | 181 | ||
@@ -188,10 +193,10 @@ static void batadv_vis_data_insert_interfaces(struct hlist_head *list, | |||
188 | static void batadv_vis_data_read_entries(struct seq_file *seq, | 193 | static void batadv_vis_data_read_entries(struct seq_file *seq, |
189 | struct hlist_head *list, | 194 | struct hlist_head *list, |
190 | struct batadv_vis_packet *packet, | 195 | struct batadv_vis_packet *packet, |
191 | struct vis_info_entry *entries) | 196 | struct batadv_vis_info_entry *entries) |
192 | { | 197 | { |
193 | int i; | 198 | int i; |
194 | struct if_list_entry *entry; | 199 | struct batadv_if_list_entry *entry; |
195 | struct hlist_node *pos; | 200 | struct hlist_node *pos; |
196 | 201 | ||
197 | hlist_for_each_entry(entry, pos, list, list) { | 202 | hlist_for_each_entry(entry, pos, list, list) { |
@@ -213,11 +218,11 @@ static void batadv_vis_seq_print_text_bucket(struct seq_file *seq, | |||
213 | const struct hlist_head *head) | 218 | const struct hlist_head *head) |
214 | { | 219 | { |
215 | struct hlist_node *node; | 220 | struct hlist_node *node; |
216 | struct vis_info *info; | 221 | struct batadv_vis_info *info; |
217 | struct batadv_vis_packet *packet; | 222 | struct batadv_vis_packet *packet; |
218 | uint8_t *entries_pos; | 223 | uint8_t *entries_pos; |
219 | struct vis_info_entry *entries; | 224 | struct batadv_vis_info_entry *entries; |
220 | struct if_list_entry *entry; | 225 | struct batadv_if_list_entry *entry; |
221 | struct hlist_node *pos, *n; | 226 | struct hlist_node *pos, *n; |
222 | 227 | ||
223 | HLIST_HEAD(vis_if_list); | 228 | HLIST_HEAD(vis_if_list); |
@@ -225,7 +230,7 @@ static void batadv_vis_seq_print_text_bucket(struct seq_file *seq, | |||
225 | hlist_for_each_entry_rcu(info, node, head, hash_entry) { | 230 | hlist_for_each_entry_rcu(info, node, head, hash_entry) { |
226 | packet = (struct batadv_vis_packet *)info->skb_packet->data; | 231 | packet = (struct batadv_vis_packet *)info->skb_packet->data; |
227 | entries_pos = (uint8_t *)packet + sizeof(*packet); | 232 | entries_pos = (uint8_t *)packet + sizeof(*packet); |
228 | entries = (struct vis_info_entry *)entries_pos; | 233 | entries = (struct batadv_vis_info_entry *)entries_pos; |
229 | 234 | ||
230 | batadv_vis_data_insert_interface(packet->vis_orig, &vis_if_list, | 235 | batadv_vis_data_insert_interface(packet->vis_orig, &vis_if_list, |
231 | true); | 236 | true); |
@@ -243,10 +248,10 @@ static void batadv_vis_seq_print_text_bucket(struct seq_file *seq, | |||
243 | 248 | ||
244 | int batadv_vis_seq_print_text(struct seq_file *seq, void *offset) | 249 | int batadv_vis_seq_print_text(struct seq_file *seq, void *offset) |
245 | { | 250 | { |
246 | struct hard_iface *primary_if; | 251 | struct batadv_hard_iface *primary_if; |
247 | struct hlist_head *head; | 252 | struct hlist_head *head; |
248 | struct net_device *net_dev = (struct net_device *)seq->private; | 253 | struct net_device *net_dev = (struct net_device *)seq->private; |
249 | struct bat_priv *bat_priv = netdev_priv(net_dev); | 254 | struct batadv_priv *bat_priv = netdev_priv(net_dev); |
250 | struct batadv_hashtable *hash = bat_priv->vis_hash; | 255 | struct batadv_hashtable *hash = bat_priv->vis_hash; |
251 | uint32_t i; | 256 | uint32_t i; |
252 | int ret = 0; | 257 | int ret = 0; |
@@ -275,8 +280,8 @@ out: | |||
275 | /* add the info packet to the send list, if it was not | 280 | /* add the info packet to the send list, if it was not |
276 | * already linked in. | 281 | * already linked in. |
277 | */ | 282 | */ |
278 | static void batadv_send_list_add(struct bat_priv *bat_priv, | 283 | static void batadv_send_list_add(struct batadv_priv *bat_priv, |
279 | struct vis_info *info) | 284 | struct batadv_vis_info *info) |
280 | { | 285 | { |
281 | if (list_empty(&info->send_list)) { | 286 | if (list_empty(&info->send_list)) { |
282 | kref_get(&info->refcount); | 287 | kref_get(&info->refcount); |
@@ -287,7 +292,7 @@ static void batadv_send_list_add(struct bat_priv *bat_priv, | |||
287 | /* delete the info packet from the send list, if it was | 292 | /* delete the info packet from the send list, if it was |
288 | * linked in. | 293 | * linked in. |
289 | */ | 294 | */ |
290 | static void batadv_send_list_del(struct vis_info *info) | 295 | static void batadv_send_list_del(struct batadv_vis_info *info) |
291 | { | 296 | { |
292 | if (!list_empty(&info->send_list)) { | 297 | if (!list_empty(&info->send_list)) { |
293 | list_del_init(&info->send_list); | 298 | list_del_init(&info->send_list); |
@@ -296,10 +301,10 @@ static void batadv_send_list_del(struct vis_info *info) | |||
296 | } | 301 | } |
297 | 302 | ||
298 | /* tries to add one entry to the receive list. */ | 303 | /* tries to add one entry to the receive list. */ |
299 | static void batadv_recv_list_add(struct bat_priv *bat_priv, | 304 | static void batadv_recv_list_add(struct batadv_priv *bat_priv, |
300 | struct list_head *recv_list, const char *mac) | 305 | struct list_head *recv_list, const char *mac) |
301 | { | 306 | { |
302 | struct recvlist_node *entry; | 307 | struct batadv_recvlist_node *entry; |
303 | 308 | ||
304 | entry = kmalloc(sizeof(*entry), GFP_ATOMIC); | 309 | entry = kmalloc(sizeof(*entry), GFP_ATOMIC); |
305 | if (!entry) | 310 | if (!entry) |
@@ -312,11 +317,11 @@ static void batadv_recv_list_add(struct bat_priv *bat_priv, | |||
312 | } | 317 | } |
313 | 318 | ||
314 | /* returns 1 if this mac is in the recv_list */ | 319 | /* returns 1 if this mac is in the recv_list */ |
315 | static int batadv_recv_list_is_in(struct bat_priv *bat_priv, | 320 | static int batadv_recv_list_is_in(struct batadv_priv *bat_priv, |
316 | const struct list_head *recv_list, | 321 | const struct list_head *recv_list, |
317 | const char *mac) | 322 | const char *mac) |
318 | { | 323 | { |
319 | const struct recvlist_node *entry; | 324 | const struct batadv_recvlist_node *entry; |
320 | 325 | ||
321 | spin_lock_bh(&bat_priv->vis_list_lock); | 326 | spin_lock_bh(&bat_priv->vis_list_lock); |
322 | list_for_each_entry(entry, recv_list, list) { | 327 | list_for_each_entry(entry, recv_list, list) { |
@@ -333,18 +338,19 @@ static int batadv_recv_list_is_in(struct bat_priv *bat_priv, | |||
333 | * broken.. ). vis hash must be locked outside. is_new is set when the packet | 338 | * broken.. ). vis hash must be locked outside. is_new is set when the packet |
334 | * is newer than old entries in the hash. | 339 | * is newer than old entries in the hash. |
335 | */ | 340 | */ |
336 | static struct vis_info *batadv_add_packet(struct bat_priv *bat_priv, | 341 | static struct batadv_vis_info * |
337 | struct batadv_vis_packet *vis_packet, | 342 | batadv_add_packet(struct batadv_priv *bat_priv, |
338 | int vis_info_len, int *is_new, | 343 | struct batadv_vis_packet *vis_packet, int vis_info_len, |
339 | int make_broadcast) | 344 | int *is_new, int make_broadcast) |
340 | { | 345 | { |
341 | struct vis_info *info, *old_info; | 346 | struct batadv_vis_info *info, *old_info; |
342 | struct batadv_vis_packet *search_packet, *old_packet; | 347 | struct batadv_vis_packet *search_packet, *old_packet; |
343 | struct vis_info search_elem; | 348 | struct batadv_vis_info search_elem; |
344 | struct batadv_vis_packet *packet; | 349 | struct batadv_vis_packet *packet; |
345 | struct sk_buff *tmp_skb; | 350 | struct sk_buff *tmp_skb; |
346 | int hash_added; | 351 | int hash_added; |
347 | size_t len; | 352 | size_t len; |
353 | size_t max_entries; | ||
348 | 354 | ||
349 | *is_new = 0; | 355 | *is_new = 0; |
350 | /* sanity check */ | 356 | /* sanity check */ |
@@ -413,8 +419,9 @@ static struct vis_info *batadv_add_packet(struct bat_priv *bat_priv, | |||
413 | memcpy(packet->target_orig, batadv_broadcast_addr, ETH_ALEN); | 419 | memcpy(packet->target_orig, batadv_broadcast_addr, ETH_ALEN); |
414 | 420 | ||
415 | /* repair if entries is longer than packet. */ | 421 | /* repair if entries is longer than packet. */ |
416 | if (packet->entries * sizeof(struct vis_info_entry) > vis_info_len) | 422 | max_entries = vis_info_len / sizeof(struct batadv_vis_info_entry); |
417 | packet->entries = vis_info_len / sizeof(struct vis_info_entry); | 423 | if (packet->entries > max_entries) |
424 | packet->entries = max_entries; | ||
418 | 425 | ||
419 | batadv_recv_list_add(bat_priv, &info->recv_list, packet->sender_orig); | 426 | batadv_recv_list_add(bat_priv, &info->recv_list, packet->sender_orig); |
420 | 427 | ||
@@ -432,11 +439,11 @@ static struct vis_info *batadv_add_packet(struct bat_priv *bat_priv, | |||
432 | } | 439 | } |
433 | 440 | ||
434 | /* handle the server sync packet, forward if needed. */ | 441 | /* handle the server sync packet, forward if needed. */ |
435 | void batadv_receive_server_sync_packet(struct bat_priv *bat_priv, | 442 | void batadv_receive_server_sync_packet(struct batadv_priv *bat_priv, |
436 | struct batadv_vis_packet *vis_packet, | 443 | struct batadv_vis_packet *vis_packet, |
437 | int vis_info_len) | 444 | int vis_info_len) |
438 | { | 445 | { |
439 | struct vis_info *info; | 446 | struct batadv_vis_info *info; |
440 | int is_new, make_broadcast; | 447 | int is_new, make_broadcast; |
441 | int vis_server = atomic_read(&bat_priv->vis_mode); | 448 | int vis_server = atomic_read(&bat_priv->vis_mode); |
442 | 449 | ||
@@ -458,11 +465,11 @@ end: | |||
458 | } | 465 | } |
459 | 466 | ||
460 | /* handle an incoming client update packet and schedule forward if needed. */ | 467 | /* handle an incoming client update packet and schedule forward if needed. */ |
461 | void batadv_receive_client_update_packet(struct bat_priv *bat_priv, | 468 | void batadv_receive_client_update_packet(struct batadv_priv *bat_priv, |
462 | struct batadv_vis_packet *vis_packet, | 469 | struct batadv_vis_packet *vis_packet, |
463 | int vis_info_len) | 470 | int vis_info_len) |
464 | { | 471 | { |
465 | struct vis_info *info; | 472 | struct batadv_vis_info *info; |
466 | struct batadv_vis_packet *packet; | 473 | struct batadv_vis_packet *packet; |
467 | int is_new; | 474 | int is_new; |
468 | int vis_server = atomic_read(&bat_priv->vis_mode); | 475 | int vis_server = atomic_read(&bat_priv->vis_mode); |
@@ -506,14 +513,14 @@ end: | |||
506 | * | 513 | * |
507 | * Must be called with the originator hash locked | 514 | * Must be called with the originator hash locked |
508 | */ | 515 | */ |
509 | static int batadv_find_best_vis_server(struct bat_priv *bat_priv, | 516 | static int batadv_find_best_vis_server(struct batadv_priv *bat_priv, |
510 | struct vis_info *info) | 517 | struct batadv_vis_info *info) |
511 | { | 518 | { |
512 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 519 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
513 | struct neigh_node *router; | 520 | struct batadv_neigh_node *router; |
514 | struct hlist_node *node; | 521 | struct hlist_node *node; |
515 | struct hlist_head *head; | 522 | struct hlist_head *head; |
516 | struct orig_node *orig_node; | 523 | struct batadv_orig_node *orig_node; |
517 | struct batadv_vis_packet *packet; | 524 | struct batadv_vis_packet *packet; |
518 | int best_tq = -1; | 525 | int best_tq = -1; |
519 | uint32_t i; | 526 | uint32_t i; |
@@ -544,15 +551,15 @@ static int batadv_find_best_vis_server(struct bat_priv *bat_priv, | |||
544 | } | 551 | } |
545 | 552 | ||
546 | /* Return true if the vis packet is full. */ | 553 | /* Return true if the vis packet is full. */ |
547 | static bool batadv_vis_packet_full(const struct vis_info *info) | 554 | static bool batadv_vis_packet_full(const struct batadv_vis_info *info) |
548 | { | 555 | { |
549 | const struct batadv_vis_packet *packet; | 556 | const struct batadv_vis_packet *packet; |
550 | size_t num_items; | 557 | size_t num; |
551 | 558 | ||
552 | packet = (struct batadv_vis_packet *)info->skb_packet->data; | 559 | packet = (struct batadv_vis_packet *)info->skb_packet->data; |
553 | num_items = BATADV_MAX_VIS_PACKET_SIZE / sizeof(struct vis_info_entry); | 560 | num = BATADV_MAX_VIS_PACKET_SIZE / sizeof(struct batadv_vis_info_entry); |
554 | 561 | ||
555 | if (num_items < packet->entries + 1) | 562 | if (num < packet->entries + 1) |
556 | return true; | 563 | return true; |
557 | return false; | 564 | return false; |
558 | } | 565 | } |
@@ -560,17 +567,17 @@ static bool batadv_vis_packet_full(const struct vis_info *info) | |||
560 | /* generates a packet of own vis data, | 567 | /* generates a packet of own vis data, |
561 | * returns 0 on success, -1 if no packet could be generated | 568 | * returns 0 on success, -1 if no packet could be generated |
562 | */ | 569 | */ |
563 | static int batadv_generate_vis_packet(struct bat_priv *bat_priv) | 570 | static int batadv_generate_vis_packet(struct batadv_priv *bat_priv) |
564 | { | 571 | { |
565 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 572 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
566 | struct hlist_node *node; | 573 | struct hlist_node *node; |
567 | struct hlist_head *head; | 574 | struct hlist_head *head; |
568 | struct orig_node *orig_node; | 575 | struct batadv_orig_node *orig_node; |
569 | struct neigh_node *router; | 576 | struct batadv_neigh_node *router; |
570 | struct vis_info *info = bat_priv->my_vis_info; | 577 | struct batadv_vis_info *info = bat_priv->my_vis_info; |
571 | struct batadv_vis_packet *packet; | 578 | struct batadv_vis_packet *packet; |
572 | struct vis_info_entry *entry; | 579 | struct batadv_vis_info_entry *entry; |
573 | struct tt_common_entry *tt_common_entry; | 580 | struct batadv_tt_common_entry *tt_common_entry; |
574 | int best_tq = -1; | 581 | int best_tq = -1; |
575 | uint32_t i; | 582 | uint32_t i; |
576 | 583 | ||
@@ -610,7 +617,7 @@ static int batadv_generate_vis_packet(struct bat_priv *bat_priv) | |||
610 | goto next; | 617 | goto next; |
611 | 618 | ||
612 | /* fill one entry into buffer. */ | 619 | /* fill one entry into buffer. */ |
613 | entry = (struct vis_info_entry *) | 620 | entry = (struct batadv_vis_info_entry *) |
614 | skb_put(info->skb_packet, sizeof(*entry)); | 621 | skb_put(info->skb_packet, sizeof(*entry)); |
615 | memcpy(entry->src, | 622 | memcpy(entry->src, |
616 | router->if_incoming->net_dev->dev_addr, | 623 | router->if_incoming->net_dev->dev_addr, |
@@ -636,7 +643,7 @@ next: | |||
636 | rcu_read_lock(); | 643 | rcu_read_lock(); |
637 | hlist_for_each_entry_rcu(tt_common_entry, node, head, | 644 | hlist_for_each_entry_rcu(tt_common_entry, node, head, |
638 | hash_entry) { | 645 | hash_entry) { |
639 | entry = (struct vis_info_entry *) | 646 | entry = (struct batadv_vis_info_entry *) |
640 | skb_put(info->skb_packet, | 647 | skb_put(info->skb_packet, |
641 | sizeof(*entry)); | 648 | sizeof(*entry)); |
642 | memset(entry->src, 0, ETH_ALEN); | 649 | memset(entry->src, 0, ETH_ALEN); |
@@ -660,13 +667,13 @@ unlock: | |||
660 | /* free old vis packets. Must be called with this vis_hash_lock | 667 | /* free old vis packets. Must be called with this vis_hash_lock |
661 | * held | 668 | * held |
662 | */ | 669 | */ |
663 | static void batadv_purge_vis_packets(struct bat_priv *bat_priv) | 670 | static void batadv_purge_vis_packets(struct batadv_priv *bat_priv) |
664 | { | 671 | { |
665 | uint32_t i; | 672 | uint32_t i; |
666 | struct batadv_hashtable *hash = bat_priv->vis_hash; | 673 | struct batadv_hashtable *hash = bat_priv->vis_hash; |
667 | struct hlist_node *node, *node_tmp; | 674 | struct hlist_node *node, *node_tmp; |
668 | struct hlist_head *head; | 675 | struct hlist_head *head; |
669 | struct vis_info *info; | 676 | struct batadv_vis_info *info; |
670 | 677 | ||
671 | for (i = 0; i < hash->size; i++) { | 678 | for (i = 0; i < hash->size; i++) { |
672 | head = &hash->table[i]; | 679 | head = &hash->table[i]; |
@@ -687,17 +694,17 @@ static void batadv_purge_vis_packets(struct bat_priv *bat_priv) | |||
687 | } | 694 | } |
688 | } | 695 | } |
689 | 696 | ||
690 | static void batadv_broadcast_vis_packet(struct bat_priv *bat_priv, | 697 | static void batadv_broadcast_vis_packet(struct batadv_priv *bat_priv, |
691 | struct vis_info *info) | 698 | struct batadv_vis_info *info) |
692 | { | 699 | { |
693 | struct neigh_node *router; | 700 | struct batadv_neigh_node *router; |
694 | struct batadv_hashtable *hash = bat_priv->orig_hash; | 701 | struct batadv_hashtable *hash = bat_priv->orig_hash; |
695 | struct hlist_node *node; | 702 | struct hlist_node *node; |
696 | struct hlist_head *head; | 703 | struct hlist_head *head; |
697 | struct orig_node *orig_node; | 704 | struct batadv_orig_node *orig_node; |
698 | struct batadv_vis_packet *packet; | 705 | struct batadv_vis_packet *packet; |
699 | struct sk_buff *skb; | 706 | struct sk_buff *skb; |
700 | struct hard_iface *hard_iface; | 707 | struct batadv_hard_iface *hard_iface; |
701 | uint8_t dstaddr[ETH_ALEN]; | 708 | uint8_t dstaddr[ETH_ALEN]; |
702 | uint32_t i; | 709 | uint32_t i; |
703 | 710 | ||
@@ -743,11 +750,11 @@ static void batadv_broadcast_vis_packet(struct bat_priv *bat_priv, | |||
743 | } | 750 | } |
744 | } | 751 | } |
745 | 752 | ||
746 | static void batadv_unicast_vis_packet(struct bat_priv *bat_priv, | 753 | static void batadv_unicast_vis_packet(struct batadv_priv *bat_priv, |
747 | struct vis_info *info) | 754 | struct batadv_vis_info *info) |
748 | { | 755 | { |
749 | struct orig_node *orig_node; | 756 | struct batadv_orig_node *orig_node; |
750 | struct neigh_node *router = NULL; | 757 | struct batadv_neigh_node *router = NULL; |
751 | struct sk_buff *skb; | 758 | struct sk_buff *skb; |
752 | struct batadv_vis_packet *packet; | 759 | struct batadv_vis_packet *packet; |
753 | 760 | ||
@@ -773,10 +780,10 @@ out: | |||
773 | } | 780 | } |
774 | 781 | ||
775 | /* only send one vis packet. called from batadv_send_vis_packets() */ | 782 | /* only send one vis packet. called from batadv_send_vis_packets() */ |
776 | static void batadv_send_vis_packet(struct bat_priv *bat_priv, | 783 | static void batadv_send_vis_packet(struct batadv_priv *bat_priv, |
777 | struct vis_info *info) | 784 | struct batadv_vis_info *info) |
778 | { | 785 | { |
779 | struct hard_iface *primary_if; | 786 | struct batadv_hard_iface *primary_if; |
780 | struct batadv_vis_packet *packet; | 787 | struct batadv_vis_packet *packet; |
781 | 788 | ||
782 | primary_if = batadv_primary_if_get_selected(bat_priv); | 789 | primary_if = batadv_primary_if_get_selected(bat_priv); |
@@ -808,10 +815,10 @@ static void batadv_send_vis_packets(struct work_struct *work) | |||
808 | { | 815 | { |
809 | struct delayed_work *delayed_work = | 816 | struct delayed_work *delayed_work = |
810 | container_of(work, struct delayed_work, work); | 817 | container_of(work, struct delayed_work, work); |
811 | struct bat_priv *bat_priv = | 818 | struct batadv_priv *bat_priv; |
812 | container_of(delayed_work, struct bat_priv, vis_work); | 819 | struct batadv_vis_info *info; |
813 | struct vis_info *info; | ||
814 | 820 | ||
821 | bat_priv = container_of(delayed_work, struct batadv_priv, vis_work); | ||
815 | spin_lock_bh(&bat_priv->vis_hash_lock); | 822 | spin_lock_bh(&bat_priv->vis_hash_lock); |
816 | batadv_purge_vis_packets(bat_priv); | 823 | batadv_purge_vis_packets(bat_priv); |
817 | 824 | ||
@@ -840,7 +847,7 @@ static void batadv_send_vis_packets(struct work_struct *work) | |||
840 | /* init the vis server. this may only be called when if_list is already | 847 | /* init the vis server. this may only be called when if_list is already |
841 | * initialized (e.g. bat0 is initialized, interfaces have been added) | 848 | * initialized (e.g. bat0 is initialized, interfaces have been added) |
842 | */ | 849 | */ |
843 | int batadv_vis_init(struct bat_priv *bat_priv) | 850 | int batadv_vis_init(struct batadv_priv *bat_priv) |
844 | { | 851 | { |
845 | struct batadv_vis_packet *packet; | 852 | struct batadv_vis_packet *packet; |
846 | int hash_added; | 853 | int hash_added; |
@@ -914,15 +921,15 @@ err: | |||
914 | /* Decrease the reference count on a hash item info */ | 921 | /* Decrease the reference count on a hash item info */ |
915 | static void batadv_free_info_ref(struct hlist_node *node, void *arg) | 922 | static void batadv_free_info_ref(struct hlist_node *node, void *arg) |
916 | { | 923 | { |
917 | struct vis_info *info; | 924 | struct batadv_vis_info *info; |
918 | 925 | ||
919 | info = container_of(node, struct vis_info, hash_entry); | 926 | info = container_of(node, struct batadv_vis_info, hash_entry); |
920 | batadv_send_list_del(info); | 927 | batadv_send_list_del(info); |
921 | kref_put(&info->refcount, batadv_free_info); | 928 | kref_put(&info->refcount, batadv_free_info); |
922 | } | 929 | } |
923 | 930 | ||
924 | /* shutdown vis-server */ | 931 | /* shutdown vis-server */ |
925 | void batadv_vis_quit(struct bat_priv *bat_priv) | 932 | void batadv_vis_quit(struct batadv_priv *bat_priv) |
926 | { | 933 | { |
927 | if (!bat_priv->vis_hash) | 934 | if (!bat_priv->vis_hash) |
928 | return; | 935 | return; |
@@ -938,7 +945,7 @@ void batadv_vis_quit(struct bat_priv *bat_priv) | |||
938 | } | 945 | } |
939 | 946 | ||
940 | /* schedule packets for (re)transmission */ | 947 | /* schedule packets for (re)transmission */ |
941 | static void batadv_start_vis_timer(struct bat_priv *bat_priv) | 948 | static void batadv_start_vis_timer(struct batadv_priv *bat_priv) |
942 | { | 949 | { |
943 | INIT_DELAYED_WORK(&bat_priv->vis_work, batadv_send_vis_packets); | 950 | INIT_DELAYED_WORK(&bat_priv->vis_work, batadv_send_vis_packets); |
944 | queue_delayed_work(batadv_event_workqueue, &bat_priv->vis_work, | 951 | queue_delayed_work(batadv_event_workqueue, &bat_priv->vis_work, |
diff --git a/net/batman-adv/vis.h b/net/batman-adv/vis.h index d6bfcc7b6ac7..84e716ed8963 100644 --- a/net/batman-adv/vis.h +++ b/net/batman-adv/vis.h | |||
@@ -24,13 +24,13 @@ | |||
24 | #define BATADV_VIS_TIMEOUT 200000 | 24 | #define BATADV_VIS_TIMEOUT 200000 |
25 | 25 | ||
26 | int batadv_vis_seq_print_text(struct seq_file *seq, void *offset); | 26 | int batadv_vis_seq_print_text(struct seq_file *seq, void *offset); |
27 | void batadv_receive_server_sync_packet(struct bat_priv *bat_priv, | 27 | void batadv_receive_server_sync_packet(struct batadv_priv *bat_priv, |
28 | struct batadv_vis_packet *vis_packet, | 28 | struct batadv_vis_packet *vis_packet, |
29 | int vis_info_len); | 29 | int vis_info_len); |
30 | void batadv_receive_client_update_packet(struct bat_priv *bat_priv, | 30 | void batadv_receive_client_update_packet(struct batadv_priv *bat_priv, |
31 | struct batadv_vis_packet *vis_packet, | 31 | struct batadv_vis_packet *vis_packet, |
32 | int vis_info_len); | 32 | int vis_info_len); |
33 | int batadv_vis_init(struct bat_priv *bat_priv); | 33 | int batadv_vis_init(struct batadv_priv *bat_priv); |
34 | void batadv_vis_quit(struct bat_priv *bat_priv); | 34 | void batadv_vis_quit(struct batadv_priv *bat_priv); |
35 | 35 | ||
36 | #endif /* _NET_BATMAN_ADV_VIS_H_ */ | 36 | #endif /* _NET_BATMAN_ADV_VIS_H_ */ |