aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-06-03 16:19:22 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-07-01 16:47:19 -0400
commit39c75a51eda38ca5ce8b75f0a62a621eb3820a54 (patch)
tree22eb93745b165356b042c840e7581d844d9c2550 /net/batman-adv
parentacd34afa89772f6379b642bb979d0a112328c769 (diff)
batman-adv: Prefix main enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/bat_iv_ogm.c48
-rw-r--r--net/batman-adv/bat_sysfs.c12
-rw-r--r--net/batman-adv/bat_sysfs.h4
-rw-r--r--net/batman-adv/bitarray.c4
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c46
-rw-r--r--net/batman-adv/gateway_client.c25
-rw-r--r--net/batman-adv/icmp_socket.c8
-rw-r--r--net/batman-adv/main.c10
-rw-r--r--net/batman-adv/main.h36
-rw-r--r--net/batman-adv/originator.c12
-rw-r--r--net/batman-adv/routing.c18
-rw-r--r--net/batman-adv/send.c11
-rw-r--r--net/batman-adv/soft-interface.c6
-rw-r--r--net/batman-adv/translation-table.c35
14 files changed, 140 insertions, 135 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 58bbb20663d5..f9981e608c13 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -188,7 +188,7 @@ static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet,
188 fwd_str = (packet_num > 0 ? "Forwarding" : (forw_packet->own ? 188 fwd_str = (packet_num > 0 ? "Forwarding" : (forw_packet->own ?
189 "Sending own" : 189 "Sending own" :
190 "Forwarding")); 190 "Forwarding"));
191 batadv_dbg(DBG_BATMAN, bat_priv, 191 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
192 "%s %spacket (originator %pM, seqno %u, TQ %d, TTL %d, IDF %s, ttvn %d) on interface %s [%pM]\n", 192 "%s %spacket (originator %pM, seqno %u, TQ %d, TTL %d, IDF %s, ttvn %d) on interface %s [%pM]\n",
193 fwd_str, (packet_num > 0 ? "aggregated " : ""), 193 fwd_str, (packet_num > 0 ? "aggregated " : ""),
194 batman_ogm_packet->orig, 194 batman_ogm_packet->orig,
@@ -252,7 +252,7 @@ static void batadv_iv_ogm_emit(struct forw_packet *forw_packet)
252 (forw_packet->own && (forw_packet->if_incoming != primary_if))) { 252 (forw_packet->own && (forw_packet->if_incoming != primary_if))) {
253 253
254 /* FIXME: what about aggregated packets ? */ 254 /* FIXME: what about aggregated packets ? */
255 batadv_dbg(DBG_BATMAN, bat_priv, 255 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
256 "%s packet (originator %pM, seqno %u, TTL %d) on interface %s [%pM]\n", 256 "%s packet (originator %pM, seqno %u, TTL %d) on interface %s [%pM]\n",
257 (forw_packet->own ? "Sending own" : "Forwarding"), 257 (forw_packet->own ? "Sending own" : "Forwarding"),
258 batman_ogm_packet->orig, 258 batman_ogm_packet->orig,
@@ -385,7 +385,7 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,
385 /* own packet should always be scheduled */ 385 /* own packet should always be scheduled */
386 if (!own_packet) { 386 if (!own_packet) {
387 if (!batadv_atomic_dec_not_zero(&bat_priv->batman_queue_left)) { 387 if (!batadv_atomic_dec_not_zero(&bat_priv->batman_queue_left)) {
388 batadv_dbg(DBG_BATMAN, bat_priv, 388 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
389 "batman packet queue full\n"); 389 "batman packet queue full\n");
390 goto out; 390 goto out;
391 } 391 }
@@ -535,7 +535,7 @@ static void batadv_iv_ogm_forward(struct orig_node *orig_node,
535 uint8_t tt_num_changes; 535 uint8_t tt_num_changes;
536 536
537 if (batman_ogm_packet->header.ttl <= 1) { 537 if (batman_ogm_packet->header.ttl <= 1) {
538 batadv_dbg(DBG_BATMAN, bat_priv, "ttl exceeded\n"); 538 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "ttl exceeded\n");
539 return; 539 return;
540 } 540 }
541 541
@@ -561,7 +561,7 @@ static void batadv_iv_ogm_forward(struct orig_node *orig_node,
561 batman_ogm_packet->tq = batadv_hop_penalty(batman_ogm_packet->tq, 561 batman_ogm_packet->tq = batadv_hop_penalty(batman_ogm_packet->tq,
562 bat_priv); 562 bat_priv);
563 563
564 batadv_dbg(DBG_BATMAN, bat_priv, 564 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
565 "Forwarding packet: tq: %i, ttl: %i\n", 565 "Forwarding packet: tq: %i, ttl: %i\n",
566 batman_ogm_packet->tq, batman_ogm_packet->header.ttl); 566 batman_ogm_packet->tq, batman_ogm_packet->header.ttl);
567 567
@@ -642,7 +642,7 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv,
642 uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; 642 uint8_t bcast_own_sum_orig, bcast_own_sum_neigh;
643 uint8_t *neigh_addr; 643 uint8_t *neigh_addr;
644 644
645 batadv_dbg(DBG_BATMAN, bat_priv, 645 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
646 "update_originator(): Searching and updating originator entry of received packet\n"); 646 "update_originator(): Searching and updating originator entry of received packet\n");
647 647
648 rcu_read_lock(); 648 rcu_read_lock();
@@ -685,7 +685,7 @@ batadv_iv_ogm_orig_update(struct bat_priv *bat_priv,
685 if (!neigh_node) 685 if (!neigh_node)
686 goto unlock; 686 goto unlock;
687 } else 687 } else
688 batadv_dbg(DBG_BATMAN, bat_priv, 688 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
689 "Updating existing last-hop neighbor of originator\n"); 689 "Updating existing last-hop neighbor of originator\n");
690 690
691 rcu_read_unlock(); 691 rcu_read_unlock();
@@ -866,7 +866,7 @@ static int batadv_iv_ogm_calc_tq(struct orig_node *orig_node,
866 combined_tq /= BATADV_TQ_MAX_VALUE * BATADV_TQ_MAX_VALUE; 866 combined_tq /= BATADV_TQ_MAX_VALUE * BATADV_TQ_MAX_VALUE;
867 batman_ogm_packet->tq = combined_tq; 867 batman_ogm_packet->tq = combined_tq;
868 868
869 batadv_dbg(DBG_BATMAN, bat_priv, 869 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
870 "bidirectional: orig = %-15pM neigh = %-15pM => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, total tq: %3i\n", 870 "bidirectional: orig = %-15pM neigh = %-15pM => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, total tq: %3i\n",
871 orig_node->orig, orig_neigh_node->orig, total_count, 871 orig_node->orig, orig_neigh_node->orig, total_count,
872 neigh_rq_count, tq_own, 872 neigh_rq_count, tq_own,
@@ -948,7 +948,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
948 rcu_read_unlock(); 948 rcu_read_unlock();
949 949
950 if (need_update) { 950 if (need_update) {
951 batadv_dbg(DBG_BATMAN, bat_priv, 951 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
952 "updating last_seqno: old %u, new %u\n", 952 "updating last_seqno: old %u, new %u\n",
953 orig_node->last_real_seqno, seqno); 953 orig_node->last_real_seqno, seqno);
954 orig_node->last_real_seqno = seqno; 954 orig_node->last_real_seqno = seqno;
@@ -1007,7 +1007,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
1007 if (batadv_compare_eth(ethhdr->h_source, batman_ogm_packet->orig)) 1007 if (batadv_compare_eth(ethhdr->h_source, batman_ogm_packet->orig))
1008 is_single_hop_neigh = true; 1008 is_single_hop_neigh = true;
1009 1009
1010 batadv_dbg(DBG_BATMAN, bat_priv, 1010 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1011 "Received BATMAN packet via NB: %pM, IF: %s [%pM] (from OG: %pM, via prev OG: %pM, seqno %u, ttvn %u, crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n", 1011 "Received BATMAN packet via NB: %pM, IF: %s [%pM] (from OG: %pM, via prev OG: %pM, seqno %u, ttvn %u, crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n",
1012 ethhdr->h_source, if_incoming->net_dev->name, 1012 ethhdr->h_source, if_incoming->net_dev->name,
1013 if_incoming->net_dev->dev_addr, batman_ogm_packet->orig, 1013 if_incoming->net_dev->dev_addr, batman_ogm_packet->orig,
@@ -1044,21 +1044,21 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
1044 rcu_read_unlock(); 1044 rcu_read_unlock();
1045 1045
1046 if (batman_ogm_packet->header.version != BATADV_COMPAT_VERSION) { 1046 if (batman_ogm_packet->header.version != BATADV_COMPAT_VERSION) {
1047 batadv_dbg(DBG_BATMAN, bat_priv, 1047 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1048 "Drop packet: incompatible batman version (%i)\n", 1048 "Drop packet: incompatible batman version (%i)\n",
1049 batman_ogm_packet->header.version); 1049 batman_ogm_packet->header.version);
1050 return; 1050 return;
1051 } 1051 }
1052 1052
1053 if (is_my_addr) { 1053 if (is_my_addr) {
1054 batadv_dbg(DBG_BATMAN, bat_priv, 1054 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1055 "Drop packet: received my own broadcast (sender: %pM)\n", 1055 "Drop packet: received my own broadcast (sender: %pM)\n",
1056 ethhdr->h_source); 1056 ethhdr->h_source);
1057 return; 1057 return;
1058 } 1058 }
1059 1059
1060 if (is_broadcast) { 1060 if (is_broadcast) {
1061 batadv_dbg(DBG_BATMAN, bat_priv, 1061 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1062 "Drop packet: ignoring all packets with broadcast source addr (sender: %pM)\n", 1062 "Drop packet: ignoring all packets with broadcast source addr (sender: %pM)\n",
1063 ethhdr->h_source); 1063 ethhdr->h_source);
1064 return; 1064 return;
@@ -1097,21 +1097,21 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
1097 spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock); 1097 spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock);
1098 } 1098 }
1099 1099
1100 batadv_dbg(DBG_BATMAN, bat_priv, 1100 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1101 "Drop packet: originator packet from myself (via neighbor)\n"); 1101 "Drop packet: originator packet from myself (via neighbor)\n");
1102 batadv_orig_node_free_ref(orig_neigh_node); 1102 batadv_orig_node_free_ref(orig_neigh_node);
1103 return; 1103 return;
1104 } 1104 }
1105 1105
1106 if (is_my_oldorig) { 1106 if (is_my_oldorig) {
1107 batadv_dbg(DBG_BATMAN, bat_priv, 1107 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1108 "Drop packet: ignoring all rebroadcast echos (sender: %pM)\n", 1108 "Drop packet: ignoring all rebroadcast echos (sender: %pM)\n",
1109 ethhdr->h_source); 1109 ethhdr->h_source);
1110 return; 1110 return;
1111 } 1111 }
1112 1112
1113 if (batman_ogm_packet->flags & BATADV_NOT_BEST_NEXT_HOP) { 1113 if (batman_ogm_packet->flags & BATADV_NOT_BEST_NEXT_HOP) {
1114 batadv_dbg(DBG_BATMAN, bat_priv, 1114 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1115 "Drop packet: ignoring all packets not forwarded from the best next hop (sender: %pM)\n", 1115 "Drop packet: ignoring all packets not forwarded from the best next hop (sender: %pM)\n",
1116 ethhdr->h_source); 1116 ethhdr->h_source);
1117 return; 1117 return;
@@ -1125,14 +1125,14 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
1125 if_incoming); 1125 if_incoming);
1126 1126
1127 if (is_duplicate == -1) { 1127 if (is_duplicate == -1) {
1128 batadv_dbg(DBG_BATMAN, bat_priv, 1128 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1129 "Drop packet: packet within seqno protection time (sender: %pM)\n", 1129 "Drop packet: packet within seqno protection time (sender: %pM)\n",
1130 ethhdr->h_source); 1130 ethhdr->h_source);
1131 goto out; 1131 goto out;
1132 } 1132 }
1133 1133
1134 if (batman_ogm_packet->tq == 0) { 1134 if (batman_ogm_packet->tq == 0) {
1135 batadv_dbg(DBG_BATMAN, bat_priv, 1135 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1136 "Drop packet: originator packet with tq equal 0\n"); 1136 "Drop packet: originator packet with tq equal 0\n");
1137 goto out; 1137 goto out;
1138 } 1138 }
@@ -1151,7 +1151,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
1151 (batadv_compare_eth(router->addr, prev_sender)) && 1151 (batadv_compare_eth(router->addr, prev_sender)) &&
1152 !(batadv_compare_eth(batman_ogm_packet->orig, prev_sender)) && 1152 !(batadv_compare_eth(batman_ogm_packet->orig, prev_sender)) &&
1153 (batadv_compare_eth(router->addr, router_router->addr))) { 1153 (batadv_compare_eth(router->addr, router_router->addr))) {
1154 batadv_dbg(DBG_BATMAN, bat_priv, 1154 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1155 "Drop packet: ignoring all rebroadcast packets that may make me loop (sender: %pM)\n", 1155 "Drop packet: ignoring all rebroadcast packets that may make me loop (sender: %pM)\n",
1156 ethhdr->h_source); 1156 ethhdr->h_source);
1157 goto out; 1157 goto out;
@@ -1172,7 +1172,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
1172 * don't route towards it 1172 * don't route towards it
1173 */ 1173 */
1174 if (!is_single_hop_neigh && (!orig_neigh_router)) { 1174 if (!is_single_hop_neigh && (!orig_neigh_router)) {
1175 batadv_dbg(DBG_BATMAN, bat_priv, 1175 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1176 "Drop packet: OGM via unknown neighbor!\n"); 1176 "Drop packet: OGM via unknown neighbor!\n");
1177 goto out_neigh; 1177 goto out_neigh;
1178 } 1178 }
@@ -1201,25 +1201,25 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
1201 is_single_hop_neigh, 1201 is_single_hop_neigh,
1202 is_from_best_next_hop, if_incoming); 1202 is_from_best_next_hop, if_incoming);
1203 1203
1204 batadv_dbg(DBG_BATMAN, bat_priv, 1204 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1205 "Forwarding packet: rebroadcast neighbor packet with direct link flag\n"); 1205 "Forwarding packet: rebroadcast neighbor packet with direct link flag\n");
1206 goto out_neigh; 1206 goto out_neigh;
1207 } 1207 }
1208 1208
1209 /* multihop originator */ 1209 /* multihop originator */
1210 if (!is_bidirect) { 1210 if (!is_bidirect) {
1211 batadv_dbg(DBG_BATMAN, bat_priv, 1211 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1212 "Drop packet: not received via bidirectional link\n"); 1212 "Drop packet: not received via bidirectional link\n");
1213 goto out_neigh; 1213 goto out_neigh;
1214 } 1214 }
1215 1215
1216 if (is_duplicate) { 1216 if (is_duplicate) {
1217 batadv_dbg(DBG_BATMAN, bat_priv, 1217 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1218 "Drop packet: duplicate packet received\n"); 1218 "Drop packet: duplicate packet received\n");
1219 goto out_neigh; 1219 goto out_neigh;
1220 } 1220 }
1221 1221
1222 batadv_dbg(DBG_BATMAN, bat_priv, 1222 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1223 "Forwarding packet: rebroadcast originator packet\n"); 1223 "Forwarding packet: rebroadcast originator packet\n");
1224 batadv_iv_ogm_forward(orig_node, ethhdr, batman_ogm_packet, 1224 batadv_iv_ogm_forward(orig_node, ethhdr, batman_ogm_packet,
1225 is_single_hop_neigh, is_from_best_next_hop, 1225 is_single_hop_neigh, is_from_best_next_hop,
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c
index e27bfe3dd278..c4794c6edf2f 100644
--- a/net/batman-adv/bat_sysfs.c
+++ b/net/batman-adv/bat_sysfs.c
@@ -485,7 +485,7 @@ BATADV_ATTR_SIF_UINT(gw_sel_class, S_IRUGO | S_IWUSR, 1, BATADV_TQ_MAX_VALUE,
485static BATADV_ATTR(gw_bandwidth, S_IRUGO | S_IWUSR, batadv_show_gw_bwidth, 485static BATADV_ATTR(gw_bandwidth, S_IRUGO | S_IWUSR, batadv_show_gw_bwidth,
486 batadv_store_gw_bwidth); 486 batadv_store_gw_bwidth);
487#ifdef CONFIG_BATMAN_ADV_DEBUG 487#ifdef CONFIG_BATMAN_ADV_DEBUG
488BATADV_ATTR_SIF_UINT(log_level, S_IRUGO | S_IWUSR, 0, DBG_ALL, NULL); 488BATADV_ATTR_SIF_UINT(log_level, S_IRUGO | S_IWUSR, 0, BATADV_DBG_ALL, NULL);
489#endif 489#endif
490 490
491static struct bat_attribute *batadv_mesh_attrs[] = { 491static struct bat_attribute *batadv_mesh_attrs[] = {
@@ -723,8 +723,8 @@ void batadv_sysfs_del_hardif(struct kobject **hardif_obj)
723 *hardif_obj = NULL; 723 *hardif_obj = NULL;
724} 724}
725 725
726int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type, 726int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type,
727 enum uev_action action, const char *data) 727 enum batadv_uev_action action, const char *data)
728{ 728{
729 int ret = -ENOMEM; 729 int ret = -ENOMEM;
730 struct hard_iface *primary_if = NULL; 730 struct hard_iface *primary_if = NULL;
@@ -756,7 +756,7 @@ int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
756 batadv_uev_action_str[action]); 756 batadv_uev_action_str[action]);
757 757
758 /* If the event is DEL, ignore the data field */ 758 /* If the event is DEL, ignore the data field */
759 if (action != UEV_DEL) { 759 if (action != BATADV_UEV_DEL) {
760 uevent_env[2] = kmalloc(strlen(BATADV_UEV_DATA_VAR) + 760 uevent_env[2] = kmalloc(strlen(BATADV_UEV_DATA_VAR) +
761 strlen(data) + 1, GFP_ATOMIC); 761 strlen(data) + 1, GFP_ATOMIC);
762 if (!uevent_env[2]) 762 if (!uevent_env[2])
@@ -775,10 +775,10 @@ out:
775 batadv_hardif_free_ref(primary_if); 775 batadv_hardif_free_ref(primary_if);
776 776
777 if (ret) 777 if (ret)
778 batadv_dbg(DBG_BATMAN, bat_priv, 778 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
779 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", 779 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",
780 batadv_uev_type_str[type], 780 batadv_uev_type_str[type],
781 batadv_uev_action_str[action], 781 batadv_uev_action_str[action],
782 (action == UEV_DEL ? "NULL" : data), ret); 782 (action == BATADV_UEV_DEL ? "NULL" : data), ret);
783 return ret; 783 return ret;
784} 784}
diff --git a/net/batman-adv/bat_sysfs.h b/net/batman-adv/bat_sysfs.h
index 23a8390851a6..28c2948d6a6a 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);
36int batadv_sysfs_add_hardif(struct kobject **hardif_obj, 36int batadv_sysfs_add_hardif(struct kobject **hardif_obj,
37 struct net_device *dev); 37 struct net_device *dev);
38void batadv_sysfs_del_hardif(struct kobject **hardif_obj); 38void batadv_sysfs_del_hardif(struct kobject **hardif_obj);
39int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type, 39int batadv_throw_uevent(struct bat_priv *bat_priv, enum batadv_uev_type type,
40 enum 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 4a009b550895..835d3b60a477 100644
--- a/net/batman-adv/bitarray.c
+++ b/net/batman-adv/bitarray.c
@@ -66,7 +66,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
66 /* sequence number is much newer, probably missed a lot of packets */ 66 /* sequence number is much newer, probably missed a lot of packets */
67 if (seq_num_diff >= BATADV_TQ_LOCAL_WINDOW_SIZE && 67 if (seq_num_diff >= BATADV_TQ_LOCAL_WINDOW_SIZE &&
68 seq_num_diff < BATADV_EXPECTED_SEQNO_RANGE) { 68 seq_num_diff < BATADV_EXPECTED_SEQNO_RANGE) {
69 batadv_dbg(DBG_BATMAN, bat_priv, 69 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
70 "We missed a lot of packets (%i) !\n", 70 "We missed a lot of packets (%i) !\n",
71 seq_num_diff - 1); 71 seq_num_diff - 1);
72 bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE); 72 bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
@@ -83,7 +83,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
83 if (seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE || 83 if (seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE ||
84 seq_num_diff >= BATADV_EXPECTED_SEQNO_RANGE) { 84 seq_num_diff >= BATADV_EXPECTED_SEQNO_RANGE) {
85 85
86 batadv_dbg(DBG_BATMAN, bat_priv, 86 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
87 "Other host probably restarted!\n"); 87 "Other host probably restarted!\n");
88 88
89 bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE); 89 bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index c37513100f53..b463402281b1 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -297,7 +297,7 @@ static void batadv_bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
297 * set Ethernet SRC to the clients mac 297 * set Ethernet SRC to the clients mac
298 */ 298 */
299 memcpy(ethhdr->h_source, mac, ETH_ALEN); 299 memcpy(ethhdr->h_source, mac, ETH_ALEN);
300 batadv_dbg(DBG_BLA, bat_priv, 300 batadv_dbg(BATADV_DBG_BLA, bat_priv,
301 "bla_send_claim(): CLAIM %pM on vid %d\n", mac, vid); 301 "bla_send_claim(): CLAIM %pM on vid %d\n", mac, vid);
302 break; 302 break;
303 case BATADV_CLAIM_TYPE_DEL: 303 case BATADV_CLAIM_TYPE_DEL:
@@ -305,7 +305,7 @@ static void batadv_bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
305 * set HW SRC to the clients mac 305 * set HW SRC to the clients mac
306 */ 306 */
307 memcpy(hw_src, mac, ETH_ALEN); 307 memcpy(hw_src, mac, ETH_ALEN);
308 batadv_dbg(DBG_BLA, bat_priv, 308 batadv_dbg(BATADV_DBG_BLA, bat_priv,
309 "bla_send_claim(): UNCLAIM %pM on vid %d\n", mac, 309 "bla_send_claim(): UNCLAIM %pM on vid %d\n", mac,
310 vid); 310 vid);
311 break; 311 break;
@@ -314,7 +314,7 @@ static void batadv_bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
314 * set HW SRC to the special mac containg the crc 314 * set HW SRC to the special mac containg the crc
315 */ 315 */
316 memcpy(hw_src, mac, ETH_ALEN); 316 memcpy(hw_src, mac, ETH_ALEN);
317 batadv_dbg(DBG_BLA, bat_priv, 317 batadv_dbg(BATADV_DBG_BLA, bat_priv,
318 "bla_send_claim(): ANNOUNCE of %pM on vid %d\n", 318 "bla_send_claim(): ANNOUNCE of %pM on vid %d\n",
319 ethhdr->h_source, vid); 319 ethhdr->h_source, vid);
320 break; 320 break;
@@ -324,7 +324,7 @@ static void batadv_bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
324 */ 324 */
325 memcpy(hw_src, mac, ETH_ALEN); 325 memcpy(hw_src, mac, ETH_ALEN);
326 memcpy(ethhdr->h_dest, mac, ETH_ALEN); 326 memcpy(ethhdr->h_dest, mac, ETH_ALEN);
327 batadv_dbg(DBG_BLA, bat_priv, 327 batadv_dbg(BATADV_DBG_BLA, bat_priv,
328 "bla_send_claim(): REQUEST of %pM to %pMon vid %d\n", 328 "bla_send_claim(): REQUEST of %pM to %pMon vid %d\n",
329 ethhdr->h_source, ethhdr->h_dest, vid); 329 ethhdr->h_source, ethhdr->h_dest, vid);
330 break; 330 break;
@@ -365,7 +365,7 @@ static struct backbone_gw *batadv_bla_get_backbone_gw(struct bat_priv *bat_priv,
365 if (entry) 365 if (entry)
366 return entry; 366 return entry;
367 367
368 batadv_dbg(DBG_BLA, bat_priv, 368 batadv_dbg(BATADV_DBG_BLA, bat_priv,
369 "bla_get_backbone_gw(): not found (%pM, %d), creating new entry\n", 369 "bla_get_backbone_gw(): not found (%pM, %d), creating new entry\n",
370 orig, vid); 370 orig, vid);
371 371
@@ -439,7 +439,7 @@ static void batadv_bla_answer_request(struct bat_priv *bat_priv,
439 struct backbone_gw *backbone_gw; 439 struct backbone_gw *backbone_gw;
440 int i; 440 int i;
441 441
442 batadv_dbg(DBG_BLA, bat_priv, 442 batadv_dbg(BATADV_DBG_BLA, bat_priv,
443 "bla_answer_request(): received a claim request, send all of our own claims again\n"); 443 "bla_answer_request(): received a claim request, send all of our own claims again\n");
444 444
445 backbone_gw = batadv_backbone_hash_find(bat_priv, 445 backbone_gw = batadv_backbone_hash_find(bat_priv,
@@ -480,8 +480,8 @@ static void batadv_bla_send_request(struct backbone_gw *backbone_gw)
480 /* first, remove all old entries */ 480 /* first, remove all old entries */
481 batadv_bla_del_backbone_claims(backbone_gw); 481 batadv_bla_del_backbone_claims(backbone_gw);
482 482
483 batadv_dbg(DBG_BLA, backbone_gw->bat_priv, "Sending REQUEST to %pM\n", 483 batadv_dbg(BATADV_DBG_BLA, backbone_gw->bat_priv,
484 backbone_gw->orig); 484 "Sending REQUEST to %pM\n", backbone_gw->orig);
485 485
486 /* send request */ 486 /* send request */
487 batadv_bla_send_claim(backbone_gw->bat_priv, backbone_gw->orig, 487 batadv_bla_send_claim(backbone_gw->bat_priv, backbone_gw->orig,
@@ -546,7 +546,7 @@ static void batadv_bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac,
546 claim->backbone_gw = backbone_gw; 546 claim->backbone_gw = backbone_gw;
547 547
548 atomic_set(&claim->refcount, 2); 548 atomic_set(&claim->refcount, 2);
549 batadv_dbg(DBG_BLA, bat_priv, 549 batadv_dbg(BATADV_DBG_BLA, bat_priv,
550 "bla_add_claim(): adding new entry %pM, vid %d to hash ...\n", 550 "bla_add_claim(): adding new entry %pM, vid %d to hash ...\n",
551 mac, vid); 551 mac, vid);
552 hash_added = batadv_hash_add(bat_priv->claim_hash, 552 hash_added = batadv_hash_add(bat_priv->claim_hash,
@@ -565,7 +565,7 @@ static void batadv_bla_add_claim(struct bat_priv *bat_priv, const uint8_t *mac,
565 /* no need to register a new backbone */ 565 /* no need to register a new backbone */
566 goto claim_free_ref; 566 goto claim_free_ref;
567 567
568 batadv_dbg(DBG_BLA, bat_priv, 568 batadv_dbg(BATADV_DBG_BLA, bat_priv,
569 "bla_add_claim(): changing ownership for %pM, vid %d\n", 569 "bla_add_claim(): changing ownership for %pM, vid %d\n",
570 mac, vid); 570 mac, vid);
571 571
@@ -599,8 +599,8 @@ static void batadv_bla_del_claim(struct bat_priv *bat_priv, const uint8_t *mac,
599 if (!claim) 599 if (!claim)
600 return; 600 return;
601 601
602 batadv_dbg(DBG_BLA, bat_priv, "bla_del_claim(): %pM, vid %d\n", mac, 602 batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla_del_claim(): %pM, vid %d\n",
603 vid); 603 mac, vid);
604 604
605 batadv_hash_remove(bat_priv->claim_hash, batadv_compare_claim, 605 batadv_hash_remove(bat_priv->claim_hash, batadv_compare_claim,
606 batadv_choose_claim, claim); 606 batadv_choose_claim, claim);
@@ -633,12 +633,12 @@ static int batadv_handle_announce(struct bat_priv *bat_priv,
633 backbone_gw->lasttime = jiffies; 633 backbone_gw->lasttime = jiffies;
634 crc = ntohs(*((__be16 *)(&an_addr[4]))); 634 crc = ntohs(*((__be16 *)(&an_addr[4])));
635 635
636 batadv_dbg(DBG_BLA, bat_priv, 636 batadv_dbg(BATADV_DBG_BLA, bat_priv,
637 "handle_announce(): ANNOUNCE vid %d (sent by %pM)... CRC = %04x\n", 637 "handle_announce(): ANNOUNCE vid %d (sent by %pM)... CRC = %04x\n",
638 vid, backbone_gw->orig, crc); 638 vid, backbone_gw->orig, crc);
639 639
640 if (backbone_gw->crc != crc) { 640 if (backbone_gw->crc != crc) {
641 batadv_dbg(DBG_BLA, backbone_gw->bat_priv, 641 batadv_dbg(BATADV_DBG_BLA, backbone_gw->bat_priv,
642 "handle_announce(): CRC FAILED for %pM/%d (my = %04x, sent = %04x)\n", 642 "handle_announce(): CRC FAILED for %pM/%d (my = %04x, sent = %04x)\n",
643 backbone_gw->orig, backbone_gw->vid, 643 backbone_gw->orig, backbone_gw->vid,
644 backbone_gw->crc, crc); 644 backbone_gw->crc, crc);
@@ -674,7 +674,7 @@ static int batadv_handle_request(struct bat_priv *bat_priv,
674 if (!batadv_compare_eth(ethhdr->h_dest, primary_if->net_dev->dev_addr)) 674 if (!batadv_compare_eth(ethhdr->h_dest, primary_if->net_dev->dev_addr))
675 return 1; 675 return 1;
676 676
677 batadv_dbg(DBG_BLA, bat_priv, 677 batadv_dbg(BATADV_DBG_BLA, bat_priv,
678 "handle_request(): REQUEST vid %d (sent by %pM)...\n", 678 "handle_request(): REQUEST vid %d (sent by %pM)...\n",
679 vid, ethhdr->h_source); 679 vid, ethhdr->h_source);
680 680
@@ -702,7 +702,7 @@ static int batadv_handle_unclaim(struct bat_priv *bat_priv,
702 return 1; 702 return 1;
703 703
704 /* this must be an UNCLAIM frame */ 704 /* this must be an UNCLAIM frame */
705 batadv_dbg(DBG_BLA, bat_priv, 705 batadv_dbg(BATADV_DBG_BLA, bat_priv,
706 "handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n", 706 "handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n",
707 claim_addr, vid, backbone_gw->orig); 707 claim_addr, vid, backbone_gw->orig);
708 708
@@ -804,7 +804,7 @@ static int batadv_check_claim_group(struct bat_priv *bat_priv,
804 804
805 /* if our mesh friends mac is bigger, use it for ourselves. */ 805 /* if our mesh friends mac is bigger, use it for ourselves. */
806 if (ntohs(bla_dst->group) > ntohs(bla_dst_own->group)) { 806 if (ntohs(bla_dst->group) > ntohs(bla_dst_own->group)) {
807 batadv_dbg(DBG_BLA, bat_priv, 807 batadv_dbg(BATADV_DBG_BLA, bat_priv,
808 "taking other backbones claim group: %04x\n", 808 "taking other backbones claim group: %04x\n",
809 ntohs(bla_dst->group)); 809 ntohs(bla_dst->group));
810 bla_dst_own->group = bla_dst->group; 810 bla_dst_own->group = bla_dst->group;
@@ -882,7 +882,7 @@ static int batadv_bla_process_claim(struct bat_priv *bat_priv,
882 ret = batadv_check_claim_group(bat_priv, primary_if, hw_src, hw_dst, 882 ret = batadv_check_claim_group(bat_priv, primary_if, hw_src, hw_dst,
883 ethhdr); 883 ethhdr);
884 if (ret == 1) 884 if (ret == 1)
885 batadv_dbg(DBG_BLA, bat_priv, 885 batadv_dbg(BATADV_DBG_BLA, bat_priv,
886 "bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", 886 "bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n",
887 ethhdr->h_source, vid, hw_src, hw_dst); 887 ethhdr->h_source, vid, hw_src, hw_dst);
888 888
@@ -917,7 +917,7 @@ static int batadv_bla_process_claim(struct bat_priv *bat_priv,
917 break; 917 break;
918 } 918 }
919 919
920 batadv_dbg(DBG_BLA, bat_priv, 920 batadv_dbg(BATADV_DBG_BLA, bat_priv,
921 "bla_process_claim(): ERROR - this looks like a claim frame, but is useless. eth src %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", 921 "bla_process_claim(): ERROR - this looks like a claim frame, but is useless. eth src %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n",
922 ethhdr->h_source, vid, hw_src, hw_dst); 922 ethhdr->h_source, vid, hw_src, hw_dst);
923 return 1; 923 return 1;
@@ -952,7 +952,7 @@ static void batadv_bla_purge_backbone_gw(struct bat_priv *bat_priv, int now)
952 BATADV_BLA_BACKBONE_TIMEOUT)) 952 BATADV_BLA_BACKBONE_TIMEOUT))
953 continue; 953 continue;
954 954
955 batadv_dbg(DBG_BLA, backbone_gw->bat_priv, 955 batadv_dbg(BATADV_DBG_BLA, backbone_gw->bat_priv,
956 "bla_purge_backbone_gw(): backbone gw %pM timed out\n", 956 "bla_purge_backbone_gw(): backbone gw %pM timed out\n",
957 backbone_gw->orig); 957 backbone_gw->orig);
958 958
@@ -1004,7 +1004,7 @@ static void batadv_bla_purge_claims(struct bat_priv *bat_priv,
1004 BATADV_BLA_CLAIM_TIMEOUT)) 1004 BATADV_BLA_CLAIM_TIMEOUT))
1005 continue; 1005 continue;
1006 1006
1007 batadv_dbg(DBG_BLA, bat_priv, 1007 batadv_dbg(BATADV_DBG_BLA, bat_priv,
1008 "bla_purge_claims(): %pM, vid %d, time out\n", 1008 "bla_purge_claims(): %pM, vid %d, time out\n",
1009 claim->addr, claim->vid); 1009 claim->addr, claim->vid);
1010 1010
@@ -1146,7 +1146,7 @@ int batadv_bla_init(struct bat_priv *bat_priv)
1146 uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00}; 1146 uint8_t claim_dest[ETH_ALEN] = {0xff, 0x43, 0x05, 0x00, 0x00, 0x00};
1147 struct hard_iface *primary_if; 1147 struct hard_iface *primary_if;
1148 1148
1149 batadv_dbg(DBG_BLA, bat_priv, "bla hash registering\n"); 1149 batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla hash registering\n");
1150 1150
1151 /* setting claim destination address */ 1151 /* setting claim destination address */
1152 memcpy(&bat_priv->claim_dest.magic, claim_dest, 3); 1152 memcpy(&bat_priv->claim_dest.magic, claim_dest, 3);
@@ -1181,7 +1181,7 @@ int batadv_bla_init(struct bat_priv *bat_priv)
1181 batadv_hash_set_lock_class(bat_priv->backbone_hash, 1181 batadv_hash_set_lock_class(bat_priv->backbone_hash,
1182 &batadv_backbone_hash_lock_class_key); 1182 &batadv_backbone_hash_lock_class_key);
1183 1183
1184 batadv_dbg(DBG_BLA, bat_priv, "bla hashes initialized\n"); 1184 batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla hashes initialized\n");
1185 1185
1186 batadv_bla_start_timer(bat_priv); 1186 batadv_bla_start_timer(bat_priv);
1187 return 0; 1187 return 0;
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 3b50c3143310..00273b92d76f 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -218,21 +218,24 @@ void batadv_gw_election(struct bat_priv *bat_priv)
218 } 218 }
219 219
220 if ((curr_gw) && (!next_gw)) { 220 if ((curr_gw) && (!next_gw)) {
221 batadv_dbg(DBG_BATMAN, bat_priv, 221 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
222 "Removing selected gateway - no gateway in range\n"); 222 "Removing selected gateway - no gateway in range\n");
223 batadv_throw_uevent(bat_priv, UEV_GW, UEV_DEL, NULL); 223 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_DEL,
224 NULL);
224 } else if ((!curr_gw) && (next_gw)) { 225 } else if ((!curr_gw) && (next_gw)) {
225 batadv_dbg(DBG_BATMAN, bat_priv, 226 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
226 "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n", 227 "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n",
227 next_gw->orig_node->orig, 228 next_gw->orig_node->orig,
228 next_gw->orig_node->gw_flags, router->tq_avg); 229 next_gw->orig_node->gw_flags, router->tq_avg);
229 batadv_throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr); 230 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_ADD,
231 gw_addr);
230 } else { 232 } else {
231 batadv_dbg(DBG_BATMAN, bat_priv, 233 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
232 "Changing route to gateway %pM (gw_flags: %i, tq: %i)\n", 234 "Changing route to gateway %pM (gw_flags: %i, tq: %i)\n",
233 next_gw->orig_node->orig, 235 next_gw->orig_node->orig,
234 next_gw->orig_node->gw_flags, router->tq_avg); 236 next_gw->orig_node->gw_flags, router->tq_avg);
235 batadv_throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr); 237 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_CHANGE,
238 gw_addr);
236 } 239 }
237 240
238 batadv_gw_select(bat_priv, next_gw); 241 batadv_gw_select(bat_priv, next_gw);
@@ -283,7 +286,7 @@ void batadv_gw_check_election(struct bat_priv *bat_priv,
283 (orig_tq_avg - gw_tq_avg < atomic_read(&bat_priv->gw_sel_class))) 286 (orig_tq_avg - gw_tq_avg < atomic_read(&bat_priv->gw_sel_class)))
284 goto out; 287 goto out;
285 288
286 batadv_dbg(DBG_BATMAN, bat_priv, 289 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
287 "Restarting gateway selection: better gateway found (tq curr: %i, tq new: %i)\n", 290 "Restarting gateway selection: better gateway found (tq curr: %i, tq new: %i)\n",
288 gw_tq_avg, orig_tq_avg); 291 gw_tq_avg, orig_tq_avg);
289 292
@@ -320,7 +323,7 @@ static void batadv_gw_node_add(struct bat_priv *bat_priv,
320 spin_unlock_bh(&bat_priv->gw_list_lock); 323 spin_unlock_bh(&bat_priv->gw_list_lock);
321 324
322 batadv_gw_bandwidth_to_kbit(new_gwflags, &down, &up); 325 batadv_gw_bandwidth_to_kbit(new_gwflags, &down, &up);
323 batadv_dbg(DBG_BATMAN, bat_priv, 326 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
324 "Found new gateway %pM -> gw_class: %i - %i%s/%i%s\n", 327 "Found new gateway %pM -> gw_class: %i - %i%s/%i%s\n",
325 orig_node->orig, new_gwflags, 328 orig_node->orig, new_gwflags,
326 (down > 2048 ? down / 1024 : down), 329 (down > 2048 ? down / 1024 : down),
@@ -347,7 +350,7 @@ void batadv_gw_node_update(struct bat_priv *bat_priv,
347 if (gw_node->orig_node != orig_node) 350 if (gw_node->orig_node != orig_node)
348 continue; 351 continue;
349 352
350 batadv_dbg(DBG_BATMAN, bat_priv, 353 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
351 "Gateway class of originator %pM changed from %i to %i\n", 354 "Gateway class of originator %pM changed from %i to %i\n",
352 orig_node->orig, gw_node->orig_node->gw_flags, 355 orig_node->orig, gw_node->orig_node->gw_flags,
353 new_gwflags); 356 new_gwflags);
@@ -356,7 +359,7 @@ void batadv_gw_node_update(struct bat_priv *bat_priv,
356 359
357 if (new_gwflags == BATADV_NO_FLAGS) { 360 if (new_gwflags == BATADV_NO_FLAGS) {
358 gw_node->deleted = jiffies; 361 gw_node->deleted = jiffies;
359 batadv_dbg(DBG_BATMAN, bat_priv, 362 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
360 "Gateway %pM removed from gateway list\n", 363 "Gateway %pM removed from gateway list\n",
361 orig_node->orig); 364 orig_node->orig);
362 365
@@ -403,7 +406,7 @@ void batadv_gw_node_purge(struct bat_priv *bat_priv)
403 &bat_priv->gw_list, list) { 406 &bat_priv->gw_list, list) {
404 if (((!gw_node->deleted) || 407 if (((!gw_node->deleted) ||
405 (time_before(jiffies, gw_node->deleted + timeout))) && 408 (time_before(jiffies, gw_node->deleted + timeout))) &&
406 atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE) 409 atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE)
407 continue; 410 continue;
408 411
409 if (curr_gw == gw_node) 412 if (curr_gw == gw_node)
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index a64cce2c4808..61b52b379564 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -158,7 +158,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
158 size_t packet_len = sizeof(struct icmp_packet); 158 size_t packet_len = sizeof(struct icmp_packet);
159 159
160 if (len < sizeof(struct icmp_packet)) { 160 if (len < sizeof(struct icmp_packet)) {
161 batadv_dbg(DBG_BATMAN, bat_priv, 161 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
162 "Error - can't send packet from char device: invalid packet size\n"); 162 "Error - can't send packet from char device: invalid packet size\n");
163 return -EINVAL; 163 return -EINVAL;
164 } 164 }
@@ -188,14 +188,14 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
188 } 188 }
189 189
190 if (icmp_packet->header.packet_type != BATADV_ICMP) { 190 if (icmp_packet->header.packet_type != BATADV_ICMP) {
191 batadv_dbg(DBG_BATMAN, bat_priv, 191 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
192 "Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n"); 192 "Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n");
193 len = -EINVAL; 193 len = -EINVAL;
194 goto free_skb; 194 goto free_skb;
195 } 195 }
196 196
197 if (icmp_packet->msg_type != BATADV_ECHO_REQUEST) { 197 if (icmp_packet->msg_type != BATADV_ECHO_REQUEST) {
198 batadv_dbg(DBG_BATMAN, bat_priv, 198 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
199 "Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n"); 199 "Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n");
200 len = -EINVAL; 200 len = -EINVAL;
201 goto free_skb; 201 goto free_skb;
@@ -211,7 +211,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
211 goto free_skb; 211 goto free_skb;
212 } 212 }
213 213
214 if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE) 214 if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
215 goto dst_unreach; 215 goto dst_unreach;
216 216
217 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst); 217 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst);
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index b3f0a2e5e2ef..24d651da6fd7 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -132,7 +132,7 @@ int batadv_mesh_init(struct net_device *soft_iface)
132 goto err; 132 goto err;
133 133
134 atomic_set(&bat_priv->gw_reselect, 0); 134 atomic_set(&bat_priv->gw_reselect, 0);
135 atomic_set(&bat_priv->mesh_state, MESH_ACTIVE); 135 atomic_set(&bat_priv->mesh_state, BATADV_MESH_ACTIVE);
136 136
137 return 0; 137 return 0;
138 138
@@ -145,7 +145,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
145{ 145{
146 struct bat_priv *bat_priv = netdev_priv(soft_iface); 146 struct bat_priv *bat_priv = netdev_priv(soft_iface);
147 147
148 atomic_set(&bat_priv->mesh_state, MESH_DEACTIVATING); 148 atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
149 149
150 batadv_purge_outstanding_packets(bat_priv, NULL); 150 batadv_purge_outstanding_packets(bat_priv, NULL);
151 151
@@ -160,7 +160,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
160 160
161 free_percpu(bat_priv->bat_counters); 161 free_percpu(bat_priv->bat_counters);
162 162
163 atomic_set(&bat_priv->mesh_state, MESH_INACTIVE); 163 atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
164} 164}
165 165
166void batadv_inc_module_count(void) 166void batadv_inc_module_count(void)
@@ -230,7 +230,7 @@ int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
230 230
231 bat_priv = netdev_priv(hard_iface->soft_iface); 231 bat_priv = netdev_priv(hard_iface->soft_iface);
232 232
233 if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE) 233 if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
234 goto err_free; 234 goto err_free;
235 235
236 /* discard frames on not active interfaces */ 236 /* discard frames on not active interfaces */
@@ -240,7 +240,7 @@ int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
240 batman_ogm_packet = (struct batman_ogm_packet *)skb->data; 240 batman_ogm_packet = (struct batman_ogm_packet *)skb->data;
241 241
242 if (batman_ogm_packet->header.version != BATADV_COMPAT_VERSION) { 242 if (batman_ogm_packet->header.version != BATADV_COMPAT_VERSION) {
243 batadv_dbg(DBG_BATMAN, bat_priv, 243 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
244 "Drop packet: incompatible batman version (%i)\n", 244 "Drop packet: incompatible batman version (%i)\n",
245 batman_ogm_packet->header.version); 245 batman_ogm_packet->header.version);
246 goto err_free; 246 goto err_free;
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 09660b4041f9..68e13ac08a0f 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -95,23 +95,23 @@
95#define BATADV_RESET_PROTECTION_MS 30000 95#define BATADV_RESET_PROTECTION_MS 30000
96#define BATADV_EXPECTED_SEQNO_RANGE 65536 96#define BATADV_EXPECTED_SEQNO_RANGE 65536
97 97
98enum mesh_state { 98enum batadv_mesh_state {
99 MESH_INACTIVE, 99 BATADV_MESH_INACTIVE,
100 MESH_ACTIVE, 100 BATADV_MESH_ACTIVE,
101 MESH_DEACTIVATING 101 BATADV_MESH_DEACTIVATING,
102}; 102};
103 103
104#define BATADV_BCAST_QUEUE_LEN 256 104#define BATADV_BCAST_QUEUE_LEN 256
105#define BATADV_BATMAN_QUEUE_LEN 256 105#define BATADV_BATMAN_QUEUE_LEN 256
106 106
107enum uev_action { 107enum batadv_uev_action {
108 UEV_ADD = 0, 108 BATADV_UEV_ADD = 0,
109 UEV_DEL, 109 BATADV_UEV_DEL,
110 UEV_CHANGE 110 BATADV_UEV_CHANGE,
111}; 111};
112 112
113enum uev_type { 113enum batadv_uev_type {
114 UEV_GW = 0 114 BATADV_UEV_GW = 0,
115}; 115};
116 116
117#define BATADV_GW_THRESHOLD 50 117#define BATADV_GW_THRESHOLD 50
@@ -124,12 +124,12 @@ enum uev_type {
124#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 124#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
125 125
126/* all messages related to routing / flooding / broadcasting / etc */ 126/* all messages related to routing / flooding / broadcasting / etc */
127enum dbg_level { 127enum batadv_dbg_level {
128 DBG_BATMAN = 1 << 0, 128 BATADV_DBG_BATMAN = 1 << 0,
129 DBG_ROUTES = 1 << 1, /* route added / changed / deleted */ 129 BATADV_DBG_ROUTES = 1 << 1, /* route added / changed / deleted */
130 DBG_TT = 1 << 2, /* translation table operations */ 130 BATADV_DBG_TT = 1 << 2, /* translation table operations */
131 DBG_BLA = 1 << 3, /* bridge loop avoidance */ 131 BATADV_DBG_BLA = 1 << 3, /* bridge loop avoidance */
132 DBG_ALL = 15 132 BATADV_DBG_ALL = 15,
133}; 133};
134 134
135/* Kernel headers */ 135/* Kernel headers */
@@ -195,14 +195,14 @@ static inline void batadv_dbg(int type __always_unused,
195 do { \ 195 do { \
196 struct net_device *_netdev = (net_dev); \ 196 struct net_device *_netdev = (net_dev); \
197 struct bat_priv *_batpriv = netdev_priv(_netdev); \ 197 struct bat_priv *_batpriv = netdev_priv(_netdev); \
198 batadv_dbg(DBG_ALL, _batpriv, fmt, ## arg); \ 198 batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt, ## arg); \
199 pr_info("%s: " fmt, _netdev->name, ## arg); \ 199 pr_info("%s: " fmt, _netdev->name, ## arg); \
200 } while (0) 200 } while (0)
201#define batadv_err(net_dev, fmt, arg...) \ 201#define batadv_err(net_dev, fmt, arg...) \
202 do { \ 202 do { \
203 struct net_device *_netdev = (net_dev); \ 203 struct net_device *_netdev = (net_dev); \
204 struct bat_priv *_batpriv = netdev_priv(_netdev); \ 204 struct bat_priv *_batpriv = netdev_priv(_netdev); \
205 batadv_dbg(DBG_ALL, _batpriv, fmt, ## arg); \ 205 batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt, ## arg); \
206 pr_err("%s: " fmt, _netdev->name, ## arg); \ 206 pr_err("%s: " fmt, _netdev->name, ## arg); \
207 } while (0) 207 } while (0)
208 208
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 9e60cc0e6a7f..4ddea31bfd60 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -102,7 +102,7 @@ struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface,
102 /* extra reference for return */ 102 /* extra reference for return */
103 atomic_set(&neigh_node->refcount, 2); 103 atomic_set(&neigh_node->refcount, 2);
104 104
105 batadv_dbg(DBG_BATMAN, bat_priv, 105 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
106 "Creating new neighbor %pM, initial seqno %d\n", 106 "Creating new neighbor %pM, initial seqno %d\n",
107 neigh_addr, seqno); 107 neigh_addr, seqno);
108 108
@@ -200,8 +200,8 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
200 if (orig_node) 200 if (orig_node)
201 return orig_node; 201 return orig_node;
202 202
203 batadv_dbg(DBG_BATMAN, bat_priv, "Creating new originator: %pM\n", 203 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
204 addr); 204 "Creating new originator: %pM\n", addr);
205 205
206 orig_node = kzalloc(sizeof(*orig_node), GFP_ATOMIC); 206 orig_node = kzalloc(sizeof(*orig_node), GFP_ATOMIC);
207 if (!orig_node) 207 if (!orig_node)
@@ -293,12 +293,12 @@ static bool batadv_purge_orig_neighbors(struct bat_priv *bat_priv,
293 if ((if_incoming->if_status == BATADV_IF_INACTIVE) || 293 if ((if_incoming->if_status == BATADV_IF_INACTIVE) ||
294 (if_incoming->if_status == BATADV_IF_NOT_IN_USE) || 294 (if_incoming->if_status == BATADV_IF_NOT_IN_USE) ||
295 (if_incoming->if_status == BATADV_IF_TO_BE_REMOVED)) 295 (if_incoming->if_status == BATADV_IF_TO_BE_REMOVED))
296 batadv_dbg(DBG_BATMAN, bat_priv, 296 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
297 "neighbor purge: originator %pM, neighbor: %pM, iface: %s\n", 297 "neighbor purge: originator %pM, neighbor: %pM, iface: %s\n",
298 orig_node->orig, neigh_node->addr, 298 orig_node->orig, neigh_node->addr,
299 if_incoming->net_dev->name); 299 if_incoming->net_dev->name);
300 else 300 else
301 batadv_dbg(DBG_BATMAN, bat_priv, 301 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
302 "neighbor timeout: originator %pM, neighbor: %pM, last_seen: %u\n", 302 "neighbor timeout: originator %pM, neighbor: %pM, last_seen: %u\n",
303 orig_node->orig, neigh_node->addr, 303 orig_node->orig, neigh_node->addr,
304 jiffies_to_msecs(last_seen)); 304 jiffies_to_msecs(last_seen));
@@ -326,7 +326,7 @@ static bool batadv_purge_orig_node(struct bat_priv *bat_priv,
326 326
327 if (batadv_has_timed_out(orig_node->last_seen, 327 if (batadv_has_timed_out(orig_node->last_seen,
328 2 * BATADV_PURGE_TIMEOUT)) { 328 2 * BATADV_PURGE_TIMEOUT)) {
329 batadv_dbg(DBG_BATMAN, bat_priv, 329 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
330 "Originator timeout: originator %pM, last_seen %u\n", 330 "Originator timeout: originator %pM, last_seen %u\n",
331 orig_node->orig, 331 orig_node->orig,
332 jiffies_to_msecs(orig_node->last_seen)); 332 jiffies_to_msecs(orig_node->last_seen));
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 8e43a951694f..b8c47dcb5853 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -72,20 +72,20 @@ static void _batadv_update_route(struct bat_priv *bat_priv,
72 72
73 /* route deleted */ 73 /* route deleted */
74 if ((curr_router) && (!neigh_node)) { 74 if ((curr_router) && (!neigh_node)) {
75 batadv_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n", 75 batadv_dbg(BATADV_DBG_ROUTES, bat_priv,
76 orig_node->orig); 76 "Deleting route towards: %pM\n", orig_node->orig);
77 batadv_tt_global_del_orig(bat_priv, orig_node, 77 batadv_tt_global_del_orig(bat_priv, orig_node,
78 "Deleted route towards originator"); 78 "Deleted route towards originator");
79 79
80 /* route added */ 80 /* route added */
81 } else if ((!curr_router) && (neigh_node)) { 81 } else if ((!curr_router) && (neigh_node)) {
82 82
83 batadv_dbg(DBG_ROUTES, bat_priv, 83 batadv_dbg(BATADV_DBG_ROUTES, bat_priv,
84 "Adding route towards: %pM (via %pM)\n", 84 "Adding route towards: %pM (via %pM)\n",
85 orig_node->orig, neigh_node->addr); 85 orig_node->orig, neigh_node->addr);
86 /* route changed */ 86 /* route changed */
87 } else if (neigh_node && curr_router) { 87 } else if (neigh_node && curr_router) {
88 batadv_dbg(DBG_ROUTES, bat_priv, 88 batadv_dbg(BATADV_DBG_ROUTES, bat_priv,
89 "Changing route towards: %pM (now via %pM - was via %pM)\n", 89 "Changing route towards: %pM (now via %pM - was via %pM)\n",
90 orig_node->orig, neigh_node->addr, 90 orig_node->orig, neigh_node->addr,
91 curr_router->addr); 91 curr_router->addr);
@@ -240,7 +240,7 @@ int batadv_window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
240 return 1; 240 return 1;
241 241
242 *last_reset = jiffies; 242 *last_reset = jiffies;
243 batadv_dbg(DBG_BATMAN, bat_priv, 243 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
244 "old packet received, start protection\n"); 244 "old packet received, start protection\n");
245 } 245 }
246 246
@@ -618,7 +618,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
618 else 618 else
619 tt_flag = '.'; 619 tt_flag = '.';
620 620
621 batadv_dbg(DBG_TT, bat_priv, 621 batadv_dbg(BATADV_DBG_TT, bat_priv,
622 "Routing TT_REQUEST to %pM [%c]\n", 622 "Routing TT_REQUEST to %pM [%c]\n",
623 tt_query->dst, 623 tt_query->dst,
624 tt_flag); 624 tt_flag);
@@ -650,7 +650,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
650 tt_flag = 'F'; 650 tt_flag = 'F';
651 else 651 else
652 tt_flag = '.'; 652 tt_flag = '.';
653 batadv_dbg(DBG_TT, bat_priv, 653 batadv_dbg(BATADV_DBG_TT, bat_priv,
654 "Routing TT_RESPONSE to %pM [%c]\n", 654 "Routing TT_RESPONSE to %pM [%c]\n",
655 tt_query->dst, 655 tt_query->dst,
656 tt_flag); 656 tt_flag);
@@ -703,7 +703,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
703 if (!orig_node) 703 if (!orig_node)
704 goto out; 704 goto out;
705 705
706 batadv_dbg(DBG_TT, bat_priv, 706 batadv_dbg(BATADV_DBG_TT, bat_priv,
707 "Received ROAMING_ADV from %pM (client %pM)\n", 707 "Received ROAMING_ADV from %pM (client %pM)\n",
708 roam_adv_packet->src, roam_adv_packet->client); 708 roam_adv_packet->src, roam_adv_packet->client);
709 709
@@ -992,7 +992,7 @@ static int batadv_check_unicast_ttvn(struct bat_priv *bat_priv,
992 batadv_orig_node_free_ref(orig_node); 992 batadv_orig_node_free_ref(orig_node);
993 } 993 }
994 994
995 batadv_dbg(DBG_ROUTES, bat_priv, 995 batadv_dbg(BATADV_DBG_ROUTES, bat_priv,
996 "TTVN mismatch (old_ttvn %u new_ttvn %u)! Rerouting unicast packet (for %pM) to %pM\n", 996 "TTVN mismatch (old_ttvn %u new_ttvn %u)! Rerouting unicast packet (for %pM) to %pM\n",
997 unicast_packet->ttvn, curr_ttvn, ethhdr->h_dest, 997 unicast_packet->ttvn, curr_ttvn, ethhdr->h_dest,
998 unicast_packet->dest); 998 unicast_packet->dest);
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 8de6e25fcc38..aad981859688 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -142,7 +142,8 @@ int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv,
142 struct sk_buff *newskb; 142 struct sk_buff *newskb;
143 143
144 if (!batadv_atomic_dec_not_zero(&bat_priv->bcast_queue_left)) { 144 if (!batadv_atomic_dec_not_zero(&bat_priv->bcast_queue_left)) {
145 batadv_dbg(DBG_BATMAN, bat_priv, "bcast packet queue full\n"); 145 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
146 "bcast packet queue full\n");
146 goto out; 147 goto out;
147 } 148 }
148 149
@@ -199,7 +200,7 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work)
199 hlist_del(&forw_packet->list); 200 hlist_del(&forw_packet->list);
200 spin_unlock_bh(&bat_priv->forw_bcast_list_lock); 201 spin_unlock_bh(&bat_priv->forw_bcast_list_lock);
201 202
202 if (atomic_read(&bat_priv->mesh_state) == MESH_DEACTIVATING) 203 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_DEACTIVATING)
203 goto out; 204 goto out;
204 205
205 /* rebroadcast packet */ 206 /* rebroadcast packet */
@@ -243,7 +244,7 @@ void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work)
243 hlist_del(&forw_packet->list); 244 hlist_del(&forw_packet->list);
244 spin_unlock_bh(&bat_priv->forw_bat_list_lock); 245 spin_unlock_bh(&bat_priv->forw_bat_list_lock);
245 246
246 if (atomic_read(&bat_priv->mesh_state) == MESH_DEACTIVATING) 247 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_DEACTIVATING)
247 goto out; 248 goto out;
248 249
249 bat_priv->bat_algo_ops->bat_ogm_emit(forw_packet); 250 bat_priv->bat_algo_ops->bat_ogm_emit(forw_packet);
@@ -271,11 +272,11 @@ void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
271 bool pending; 272 bool pending;
272 273
273 if (hard_iface) 274 if (hard_iface)
274 batadv_dbg(DBG_BATMAN, bat_priv, 275 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
275 "purge_outstanding_packets(): %s\n", 276 "purge_outstanding_packets(): %s\n",
276 hard_iface->net_dev->name); 277 hard_iface->net_dev->name);
277 else 278 else
278 batadv_dbg(DBG_BATMAN, bat_priv, 279 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
279 "purge_outstanding_packets()\n"); 280 "purge_outstanding_packets()\n");
280 281
281 /* free bcast list */ 282 /* free bcast list */
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 3aae91d0d59a..0a00324e67e3 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -105,7 +105,7 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
105 return -EADDRNOTAVAIL; 105 return -EADDRNOTAVAIL;
106 106
107 /* only modify transtable if it has been initialized before */ 107 /* only modify transtable if it has been initialized before */
108 if (atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE) { 108 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) {
109 batadv_tt_local_remove(bat_priv, dev->dev_addr, 109 batadv_tt_local_remove(bat_priv, dev->dev_addr,
110 "mac address changed", false); 110 "mac address changed", false);
111 batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX); 111 batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX);
@@ -143,7 +143,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
143 short vid __maybe_unused = -1; 143 short vid __maybe_unused = -1;
144 bool do_bcast = false; 144 bool do_bcast = false;
145 145
146 if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE) 146 if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
147 goto dropped; 147 goto dropped;
148 148
149 soft_iface->trans_start = jiffies; 149 soft_iface->trans_start = jiffies;
@@ -398,7 +398,7 @@ struct net_device *batadv_softif_create(const char *name)
398 atomic_set(&bat_priv->bcast_queue_left, BATADV_BCAST_QUEUE_LEN); 398 atomic_set(&bat_priv->bcast_queue_left, BATADV_BCAST_QUEUE_LEN);
399 atomic_set(&bat_priv->batman_queue_left, BATADV_BATMAN_QUEUE_LEN); 399 atomic_set(&bat_priv->batman_queue_left, BATADV_BATMAN_QUEUE_LEN);
400 400
401 atomic_set(&bat_priv->mesh_state, MESH_INACTIVE); 401 atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
402 atomic_set(&bat_priv->bcast_seqno, 1); 402 atomic_set(&bat_priv->bcast_seqno, 1);
403 atomic_set(&bat_priv->ttvn, 0); 403 atomic_set(&bat_priv->ttvn, 0);
404 atomic_set(&bat_priv->tt_local_changes, 0); 404 atomic_set(&bat_priv->tt_local_changes, 0);
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 309d691abe64..6d03cb11071a 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -252,7 +252,7 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
252 if (!tt_local_entry) 252 if (!tt_local_entry)
253 goto out; 253 goto out;
254 254
255 batadv_dbg(DBG_TT, bat_priv, 255 batadv_dbg(BATADV_DBG_TT, bat_priv,
256 "Creating new local tt entry: %pM (ttvn: %d)\n", addr, 256 "Creating new local tt entry: %pM (ttvn: %d)\n", addr,
257 (uint8_t)atomic_read(&bat_priv->ttvn)); 257 (uint8_t)atomic_read(&bat_priv->ttvn));
258 258
@@ -484,7 +484,7 @@ static void batadv_tt_local_set_pending(struct bat_priv *bat_priv,
484 */ 484 */
485 tt_local_entry->common.flags |= BATADV_TT_CLIENT_PENDING; 485 tt_local_entry->common.flags |= BATADV_TT_CLIENT_PENDING;
486 486
487 batadv_dbg(DBG_TT, bat_priv, 487 batadv_dbg(BATADV_DBG_TT, bat_priv,
488 "Local tt entry (%pM) pending to be removed: %s\n", 488 "Local tt entry (%pM) pending to be removed: %s\n",
489 tt_local_entry->common.addr, message); 489 tt_local_entry->common.addr, message);
490} 490}
@@ -726,7 +726,7 @@ int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
726 orig_node, ttvn); 726 orig_node, ttvn);
727 } 727 }
728 728
729 batadv_dbg(DBG_TT, bat_priv, 729 batadv_dbg(BATADV_DBG_TT, bat_priv,
730 "Creating new global tt entry: %pM (via %pM)\n", 730 "Creating new global tt entry: %pM (via %pM)\n",
731 tt_global_entry->common.addr, orig_node->orig); 731 tt_global_entry->common.addr, orig_node->orig);
732 732
@@ -856,7 +856,7 @@ batadv_tt_global_del_orig_entry(struct bat_priv *bat_priv,
856 head = &tt_global_entry->orig_list; 856 head = &tt_global_entry->orig_list;
857 hlist_for_each_entry_safe(orig_entry, node, safe, head, list) { 857 hlist_for_each_entry_safe(orig_entry, node, safe, head, list) {
858 if (orig_entry->orig_node == orig_node) { 858 if (orig_entry->orig_node == orig_node) {
859 batadv_dbg(DBG_TT, bat_priv, 859 batadv_dbg(BATADV_DBG_TT, bat_priv,
860 "Deleting %pM from global tt entry %pM: %s\n", 860 "Deleting %pM from global tt entry %pM: %s\n",
861 orig_node->orig, 861 orig_node->orig,
862 tt_global_entry->common.addr, message); 862 tt_global_entry->common.addr, message);
@@ -871,7 +871,8 @@ static void batadv_tt_global_del_struct(struct bat_priv *bat_priv,
871 struct tt_global_entry *tt_global_entry, 871 struct tt_global_entry *tt_global_entry,
872 const char *message) 872 const char *message)
873{ 873{
874 batadv_dbg(DBG_TT, bat_priv, "Deleting global tt entry %pM: %s\n", 874 batadv_dbg(BATADV_DBG_TT, bat_priv,
875 "Deleting global tt entry %pM: %s\n",
875 tt_global_entry->common.addr, message); 876 tt_global_entry->common.addr, message);
876 877
877 batadv_hash_remove(bat_priv->tt_global_hash, batadv_compare_tt, 878 batadv_hash_remove(bat_priv->tt_global_hash, batadv_compare_tt,
@@ -1006,7 +1007,7 @@ void batadv_tt_global_del_orig(struct bat_priv *bat_priv,
1006 orig_node, message); 1007 orig_node, message);
1007 1008
1008 if (hlist_empty(&global_entry->orig_list)) { 1009 if (hlist_empty(&global_entry->orig_list)) {
1009 batadv_dbg(DBG_TT, bat_priv, 1010 batadv_dbg(BATADV_DBG_TT, bat_priv,
1010 "Deleting global tt entry %pM: %s\n", 1011 "Deleting global tt entry %pM: %s\n",
1011 global_entry->common.addr, message); 1012 global_entry->common.addr, message);
1012 hlist_del_rcu(node); 1013 hlist_del_rcu(node);
@@ -1035,7 +1036,7 @@ static void batadv_tt_global_roam_purge_list(struct bat_priv *bat_priv,
1035 BATADV_TT_CLIENT_ROAM_TIMEOUT)) 1036 BATADV_TT_CLIENT_ROAM_TIMEOUT))
1036 continue; 1037 continue;
1037 1038
1038 batadv_dbg(DBG_TT, bat_priv, 1039 batadv_dbg(BATADV_DBG_TT, bat_priv,
1039 "Deleting global tt entry (%pM): Roaming timeout\n", 1040 "Deleting global tt entry (%pM): Roaming timeout\n",
1040 tt_global_entry->common.addr); 1041 tt_global_entry->common.addr);
1041 1042
@@ -1471,7 +1472,7 @@ static int batadv_send_tt_request(struct bat_priv *bat_priv,
1471 if (!neigh_node) 1472 if (!neigh_node)
1472 goto out; 1473 goto out;
1473 1474
1474 batadv_dbg(DBG_TT, bat_priv, 1475 batadv_dbg(BATADV_DBG_TT, bat_priv,
1475 "Sending TT_REQUEST to %pM via %pM [%c]\n", 1476 "Sending TT_REQUEST to %pM via %pM [%c]\n",
1476 dst_orig_node->orig, neigh_node->addr, 1477 dst_orig_node->orig, neigh_node->addr,
1477 (full_table ? 'F' : '.')); 1478 (full_table ? 'F' : '.'));
@@ -1511,7 +1512,7 @@ static bool batadv_send_other_tt_response(struct bat_priv *bat_priv,
1511 struct sk_buff *skb = NULL; 1512 struct sk_buff *skb = NULL;
1512 struct tt_query_packet *tt_response; 1513 struct tt_query_packet *tt_response;
1513 1514
1514 batadv_dbg(DBG_TT, bat_priv, 1515 batadv_dbg(BATADV_DBG_TT, bat_priv,
1515 "Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n", 1516 "Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n",
1516 tt_request->src, tt_request->ttvn, tt_request->dst, 1517 tt_request->src, tt_request->ttvn, tt_request->dst,
1517 (tt_request->flags & BATADV_TT_FULL_TABLE ? 'F' : '.')); 1518 (tt_request->flags & BATADV_TT_FULL_TABLE ? 'F' : '.'));
@@ -1599,7 +1600,7 @@ static bool batadv_send_other_tt_response(struct bat_priv *bat_priv,
1599 if (full_table) 1600 if (full_table)
1600 tt_response->flags |= BATADV_TT_FULL_TABLE; 1601 tt_response->flags |= BATADV_TT_FULL_TABLE;
1601 1602
1602 batadv_dbg(DBG_TT, bat_priv, 1603 batadv_dbg(BATADV_DBG_TT, bat_priv,
1603 "Sending TT_RESPONSE %pM via %pM for %pM (ttvn: %u)\n", 1604 "Sending TT_RESPONSE %pM via %pM for %pM (ttvn: %u)\n",
1604 res_dst_orig_node->orig, neigh_node->addr, 1605 res_dst_orig_node->orig, neigh_node->addr,
1605 req_dst_orig_node->orig, req_ttvn); 1606 req_dst_orig_node->orig, req_ttvn);
@@ -1641,7 +1642,7 @@ static bool batadv_send_my_tt_response(struct bat_priv *bat_priv,
1641 struct sk_buff *skb = NULL; 1642 struct sk_buff *skb = NULL;
1642 struct tt_query_packet *tt_response; 1643 struct tt_query_packet *tt_response;
1643 1644
1644 batadv_dbg(DBG_TT, bat_priv, 1645 batadv_dbg(BATADV_DBG_TT, bat_priv,
1645 "Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n", 1646 "Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n",
1646 tt_request->src, tt_request->ttvn, 1647 tt_request->src, tt_request->ttvn,
1647 (tt_request->flags & BATADV_TT_FULL_TABLE ? 'F' : '.')); 1648 (tt_request->flags & BATADV_TT_FULL_TABLE ? 'F' : '.'));
@@ -1720,7 +1721,7 @@ static bool batadv_send_my_tt_response(struct bat_priv *bat_priv,
1720 if (full_table) 1721 if (full_table)
1721 tt_response->flags |= BATADV_TT_FULL_TABLE; 1722 tt_response->flags |= BATADV_TT_FULL_TABLE;
1722 1723
1723 batadv_dbg(DBG_TT, bat_priv, 1724 batadv_dbg(BATADV_DBG_TT, bat_priv,
1724 "Sending TT_RESPONSE to %pM via %pM [%c]\n", 1725 "Sending TT_RESPONSE to %pM via %pM [%c]\n",
1725 orig_node->orig, neigh_node->addr, 1726 orig_node->orig, neigh_node->addr,
1726 (tt_response->flags & BATADV_TT_FULL_TABLE ? 'F' : '.')); 1727 (tt_response->flags & BATADV_TT_FULL_TABLE ? 'F' : '.'));
@@ -1860,7 +1861,7 @@ void batadv_handle_tt_response(struct bat_priv *bat_priv,
1860 struct tt_req_node *node, *safe; 1861 struct tt_req_node *node, *safe;
1861 struct orig_node *orig_node = NULL; 1862 struct orig_node *orig_node = NULL;
1862 1863
1863 batadv_dbg(DBG_TT, bat_priv, 1864 batadv_dbg(BATADV_DBG_TT, bat_priv,
1864 "Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n", 1865 "Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n",
1865 tt_response->src, tt_response->ttvn, 1866 tt_response->src, tt_response->ttvn,
1866 ntohs(tt_response->tt_data), 1867 ntohs(tt_response->tt_data),
@@ -2039,7 +2040,7 @@ static void batadv_send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
2039 if (!neigh_node) 2040 if (!neigh_node)
2040 goto out; 2041 goto out;
2041 2042
2042 batadv_dbg(DBG_TT, bat_priv, 2043 batadv_dbg(BATADV_DBG_TT, bat_priv,
2043 "Sending ROAMING_ADV to %pM (client %pM) via %pM\n", 2044 "Sending ROAMING_ADV to %pM (client %pM) via %pM\n",
2044 orig_node->orig, client, neigh_node->addr); 2045 orig_node->orig, client, neigh_node->addr);
2045 2046
@@ -2146,7 +2147,7 @@ static void batadv_tt_local_purge_pending_clients(struct bat_priv *bat_priv)
2146 if (!(tt_common->flags & BATADV_TT_CLIENT_PENDING)) 2147 if (!(tt_common->flags & BATADV_TT_CLIENT_PENDING))
2147 continue; 2148 continue;
2148 2149
2149 batadv_dbg(DBG_TT, bat_priv, 2150 batadv_dbg(BATADV_DBG_TT, bat_priv,
2150 "Deleting local tt entry (%pM): pending\n", 2151 "Deleting local tt entry (%pM): pending\n",
2151 tt_common->addr); 2152 tt_common->addr);
2152 2153
@@ -2181,7 +2182,7 @@ static int batadv_tt_commit_changes(struct bat_priv *bat_priv,
2181 2182
2182 /* Increment the TTVN only once per OGM interval */ 2183 /* Increment the TTVN only once per OGM interval */
2183 atomic_inc(&bat_priv->ttvn); 2184 atomic_inc(&bat_priv->ttvn);
2184 batadv_dbg(DBG_TT, bat_priv, 2185 batadv_dbg(BATADV_DBG_TT, bat_priv,
2185 "Local changes committed, updating to ttvn %u\n", 2186 "Local changes committed, updating to ttvn %u\n",
2186 (uint8_t)atomic_read(&bat_priv->ttvn)); 2187 (uint8_t)atomic_read(&bat_priv->ttvn));
2187 bat_priv->tt_poss_change = false; 2188 bat_priv->tt_poss_change = false;
@@ -2306,7 +2307,7 @@ void batadv_tt_update_orig(struct bat_priv *bat_priv,
2306 if (!orig_node->tt_initialised || ttvn != orig_ttvn || 2307 if (!orig_node->tt_initialised || ttvn != orig_ttvn ||
2307 orig_node->tt_crc != tt_crc) { 2308 orig_node->tt_crc != tt_crc) {
2308request_table: 2309request_table:
2309 batadv_dbg(DBG_TT, bat_priv, 2310 batadv_dbg(BATADV_DBG_TT, bat_priv,
2310 "TT inconsistency for %pM. Need to retrieve the correct information (ttvn: %u last_ttvn: %u crc: %u last_crc: %u num_changes: %u)\n", 2311 "TT inconsistency for %pM. Need to retrieve the correct information (ttvn: %u last_ttvn: %u crc: %u last_crc: %u num_changes: %u)\n",
2311 orig_node->orig, ttvn, orig_ttvn, tt_crc, 2312 orig_node->orig, ttvn, orig_ttvn, tt_crc,
2312 orig_node->tt_crc, tt_num_changes); 2313 orig_node->tt_crc, tt_num_changes);