diff options
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r-- | net/batman-adv/translation-table.c | 89 |
1 files changed, 43 insertions, 46 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index c9507057c98e..1f8692127840 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -309,21 +309,21 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset) | |||
309 | 309 | ||
310 | primary_if = primary_if_get_selected(bat_priv); | 310 | primary_if = primary_if_get_selected(bat_priv); |
311 | if (!primary_if) { | 311 | if (!primary_if) { |
312 | ret = seq_printf(seq, "BATMAN mesh %s disabled - " | 312 | ret = seq_printf(seq, |
313 | "please specify interfaces to enable it\n", | 313 | "BATMAN mesh %s disabled - please specify interfaces to enable it\n", |
314 | net_dev->name); | 314 | net_dev->name); |
315 | goto out; | 315 | goto out; |
316 | } | 316 | } |
317 | 317 | ||
318 | if (primary_if->if_status != IF_ACTIVE) { | 318 | if (primary_if->if_status != IF_ACTIVE) { |
319 | ret = seq_printf(seq, "BATMAN mesh %s disabled - " | 319 | ret = seq_printf(seq, |
320 | "primary interface not active\n", | 320 | "BATMAN mesh %s disabled - primary interface not active\n", |
321 | net_dev->name); | 321 | net_dev->name); |
322 | goto out; | 322 | goto out; |
323 | } | 323 | } |
324 | 324 | ||
325 | seq_printf(seq, "Locally retrieved addresses (from %s) " | 325 | seq_printf(seq, |
326 | "announced via TT (TTVN: %u):\n", | 326 | "Locally retrieved addresses (from %s) announced via TT (TTVN: %u):\n", |
327 | net_dev->name, (uint8_t)atomic_read(&bat_priv->ttvn)); | 327 | net_dev->name, (uint8_t)atomic_read(&bat_priv->ttvn)); |
328 | 328 | ||
329 | for (i = 0; i < hash->size; i++) { | 329 | for (i = 0; i < hash->size; i++) { |
@@ -365,8 +365,9 @@ static void tt_local_set_pending(struct bat_priv *bat_priv, | |||
365 | * response issued before the net ttvn increment (consistency check) */ | 365 | * response issued before the net ttvn increment (consistency check) */ |
366 | tt_local_entry->common.flags |= TT_CLIENT_PENDING; | 366 | tt_local_entry->common.flags |= TT_CLIENT_PENDING; |
367 | 367 | ||
368 | bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: " | 368 | bat_dbg(DBG_TT, bat_priv, |
369 | "%s\n", tt_local_entry->common.addr, message); | 369 | "Local tt entry (%pM) pending to be removed: %s\n", |
370 | tt_local_entry->common.addr, message); | ||
370 | } | 371 | } |
371 | 372 | ||
372 | void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr, | 373 | void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr, |
@@ -574,15 +575,15 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset) | |||
574 | 575 | ||
575 | primary_if = primary_if_get_selected(bat_priv); | 576 | primary_if = primary_if_get_selected(bat_priv); |
576 | if (!primary_if) { | 577 | if (!primary_if) { |
577 | ret = seq_printf(seq, "BATMAN mesh %s disabled - please " | 578 | ret = seq_printf(seq, |
578 | "specify interfaces to enable it\n", | 579 | "BATMAN mesh %s disabled - please specify interfaces to enable it\n", |
579 | net_dev->name); | 580 | net_dev->name); |
580 | goto out; | 581 | goto out; |
581 | } | 582 | } |
582 | 583 | ||
583 | if (primary_if->if_status != IF_ACTIVE) { | 584 | if (primary_if->if_status != IF_ACTIVE) { |
584 | ret = seq_printf(seq, "BATMAN mesh %s disabled - " | 585 | ret = seq_printf(seq, |
585 | "primary interface not active\n", | 586 | "BATMAN mesh %s disabled - primary interface not active\n", |
586 | net_dev->name); | 587 | net_dev->name); |
587 | goto out; | 588 | goto out; |
588 | } | 589 | } |
@@ -602,18 +603,18 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset) | |||
602 | tt_global_entry = container_of(tt_common_entry, | 603 | tt_global_entry = container_of(tt_common_entry, |
603 | struct tt_global_entry, | 604 | struct tt_global_entry, |
604 | common); | 605 | common); |
605 | seq_printf(seq, " * %pM (%3u) via %pM (%3u) " | 606 | seq_printf(seq, |
606 | "[%c%c]\n", | 607 | " * %pM (%3u) via %pM (%3u) [%c%c]\n", |
607 | tt_global_entry->common.addr, | 608 | tt_global_entry->common.addr, |
608 | tt_global_entry->ttvn, | 609 | tt_global_entry->ttvn, |
609 | tt_global_entry->orig_node->orig, | 610 | tt_global_entry->orig_node->orig, |
610 | (uint8_t) atomic_read( | 611 | (uint8_t) atomic_read( |
611 | &tt_global_entry->orig_node-> | 612 | &tt_global_entry->orig_node-> |
612 | last_ttvn), | 613 | last_ttvn), |
613 | (tt_global_entry->common.flags & | 614 | (tt_global_entry->common.flags & |
614 | TT_CLIENT_ROAM ? 'R' : '.'), | 615 | TT_CLIENT_ROAM ? 'R' : '.'), |
615 | (tt_global_entry->common.flags & | 616 | (tt_global_entry->common.flags & |
616 | TT_CLIENT_WIFI ? 'W' : '.')); | 617 | TT_CLIENT_WIFI ? 'W' : '.')); |
617 | } | 618 | } |
618 | rcu_read_unlock(); | 619 | rcu_read_unlock(); |
619 | } | 620 | } |
@@ -710,8 +711,7 @@ void tt_global_del_orig(struct bat_priv *bat_priv, | |||
710 | common); | 711 | common); |
711 | if (tt_global_entry->orig_node == orig_node) { | 712 | if (tt_global_entry->orig_node == orig_node) { |
712 | bat_dbg(DBG_TT, bat_priv, | 713 | bat_dbg(DBG_TT, bat_priv, |
713 | "Deleting global tt entry %pM " | 714 | "Deleting global tt entry %pM (via %pM): %s\n", |
714 | "(via %pM): %s\n", | ||
715 | tt_global_entry->common.addr, | 715 | tt_global_entry->common.addr, |
716 | tt_global_entry->orig_node->orig, | 716 | tt_global_entry->orig_node->orig, |
717 | message); | 717 | message); |
@@ -751,8 +751,8 @@ static void tt_global_roam_purge(struct bat_priv *bat_priv) | |||
751 | TT_CLIENT_ROAM_TIMEOUT)) | 751 | TT_CLIENT_ROAM_TIMEOUT)) |
752 | continue; | 752 | continue; |
753 | 753 | ||
754 | bat_dbg(DBG_TT, bat_priv, "Deleting global " | 754 | bat_dbg(DBG_TT, bat_priv, |
755 | "tt entry (%pM): Roaming timeout\n", | 755 | "Deleting global tt entry (%pM): Roaming timeout\n", |
756 | tt_global_entry->common.addr); | 756 | tt_global_entry->common.addr); |
757 | atomic_dec(&tt_global_entry->orig_node->tt_size); | 757 | atomic_dec(&tt_global_entry->orig_node->tt_size); |
758 | hlist_del_rcu(node); | 758 | hlist_del_rcu(node); |
@@ -1134,8 +1134,9 @@ static int send_tt_request(struct bat_priv *bat_priv, | |||
1134 | if (!neigh_node) | 1134 | if (!neigh_node) |
1135 | goto out; | 1135 | goto out; |
1136 | 1136 | ||
1137 | bat_dbg(DBG_TT, bat_priv, "Sending TT_REQUEST to %pM via %pM " | 1137 | bat_dbg(DBG_TT, bat_priv, |
1138 | "[%c]\n", dst_orig_node->orig, neigh_node->addr, | 1138 | "Sending TT_REQUEST to %pM via %pM [%c]\n", |
1139 | dst_orig_node->orig, neigh_node->addr, | ||
1139 | (full_table ? 'F' : '.')); | 1140 | (full_table ? 'F' : '.')); |
1140 | 1141 | ||
1141 | send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr); | 1142 | send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr); |
@@ -1172,9 +1173,8 @@ static bool send_other_tt_response(struct bat_priv *bat_priv, | |||
1172 | struct tt_query_packet *tt_response; | 1173 | struct tt_query_packet *tt_response; |
1173 | 1174 | ||
1174 | bat_dbg(DBG_TT, bat_priv, | 1175 | bat_dbg(DBG_TT, bat_priv, |
1175 | "Received TT_REQUEST from %pM for " | 1176 | "Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n", |
1176 | "ttvn: %u (%pM) [%c]\n", tt_request->src, | 1177 | tt_request->src, tt_request->ttvn, tt_request->dst, |
1177 | tt_request->ttvn, tt_request->dst, | ||
1178 | (tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); | 1178 | (tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); |
1179 | 1179 | ||
1180 | /* Let's get the orig node of the REAL destination */ | 1180 | /* Let's get the orig node of the REAL destination */ |
@@ -1299,9 +1299,8 @@ static bool send_my_tt_response(struct bat_priv *bat_priv, | |||
1299 | struct tt_query_packet *tt_response; | 1299 | struct tt_query_packet *tt_response; |
1300 | 1300 | ||
1301 | bat_dbg(DBG_TT, bat_priv, | 1301 | bat_dbg(DBG_TT, bat_priv, |
1302 | "Received TT_REQUEST from %pM for " | 1302 | "Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n", |
1303 | "ttvn: %u (me) [%c]\n", tt_request->src, | 1303 | tt_request->src, tt_request->ttvn, |
1304 | tt_request->ttvn, | ||
1305 | (tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); | 1304 | (tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); |
1306 | 1305 | ||
1307 | 1306 | ||
@@ -1504,10 +1503,9 @@ void handle_tt_response(struct bat_priv *bat_priv, | |||
1504 | struct tt_req_node *node, *safe; | 1503 | struct tt_req_node *node, *safe; |
1505 | struct orig_node *orig_node = NULL; | 1504 | struct orig_node *orig_node = NULL; |
1506 | 1505 | ||
1507 | bat_dbg(DBG_TT, bat_priv, "Received TT_RESPONSE from %pM for " | 1506 | bat_dbg(DBG_TT, bat_priv, |
1508 | "ttvn %d t_size: %d [%c]\n", | 1507 | "Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n", |
1509 | tt_response->src, tt_response->ttvn, | 1508 | tt_response->src, tt_response->ttvn, tt_response->tt_data, |
1510 | tt_response->tt_data, | ||
1511 | (tt_response->flags & TT_FULL_TABLE ? 'F' : '.')); | 1509 | (tt_response->flags & TT_FULL_TABLE ? 'F' : '.')); |
1512 | 1510 | ||
1513 | orig_node = orig_hash_find(bat_priv, tt_response->src); | 1511 | orig_node = orig_hash_find(bat_priv, tt_response->src); |
@@ -1771,8 +1769,9 @@ static void tt_local_purge_pending_clients(struct bat_priv *bat_priv) | |||
1771 | if (!(tt_common_entry->flags & TT_CLIENT_PENDING)) | 1769 | if (!(tt_common_entry->flags & TT_CLIENT_PENDING)) |
1772 | continue; | 1770 | continue; |
1773 | 1771 | ||
1774 | bat_dbg(DBG_TT, bat_priv, "Deleting local tt entry " | 1772 | bat_dbg(DBG_TT, bat_priv, |
1775 | "(%pM): pending\n", tt_common_entry->addr); | 1773 | "Deleting local tt entry (%pM): pending\n", |
1774 | tt_common_entry->addr); | ||
1776 | 1775 | ||
1777 | atomic_dec(&bat_priv->num_local_tt); | 1776 | atomic_dec(&bat_priv->num_local_tt); |
1778 | hlist_del_rcu(node); | 1777 | hlist_del_rcu(node); |
@@ -1877,12 +1876,10 @@ void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node, | |||
1877 | if (!orig_node->tt_initialised || ttvn != orig_ttvn || | 1876 | if (!orig_node->tt_initialised || ttvn != orig_ttvn || |
1878 | orig_node->tt_crc != tt_crc) { | 1877 | orig_node->tt_crc != tt_crc) { |
1879 | request_table: | 1878 | request_table: |
1880 | bat_dbg(DBG_TT, bat_priv, "TT inconsistency for %pM. " | 1879 | bat_dbg(DBG_TT, bat_priv, |
1881 | "Need to retrieve the correct information " | 1880 | "TT inconsistency for %pM. Need to retrieve the correct information (ttvn: %u last_ttvn: %u crc: %u last_crc: %u num_changes: %u)\n", |
1882 | "(ttvn: %u last_ttvn: %u crc: %u last_crc: " | 1881 | orig_node->orig, ttvn, orig_ttvn, tt_crc, |
1883 | "%u num_changes: %u)\n", orig_node->orig, ttvn, | 1882 | orig_node->tt_crc, tt_num_changes); |
1884 | orig_ttvn, tt_crc, orig_node->tt_crc, | ||
1885 | tt_num_changes); | ||
1886 | send_tt_request(bat_priv, orig_node, ttvn, tt_crc, | 1883 | send_tt_request(bat_priv, orig_node, ttvn, tt_crc, |
1887 | full_table); | 1884 | full_table); |
1888 | return; | 1885 | return; |