Lines Matching refs:tt
107 struct batadv_tt_common_entry *tt; in batadv_choose_tt() local
110 tt = (struct batadv_tt_common_entry *)data; in batadv_choose_tt()
111 hash = jhash(&tt->addr, ETH_ALEN, hash); in batadv_choose_tt()
112 hash = jhash(&tt->vid, sizeof(tt->vid), hash); in batadv_choose_tt()
131 struct batadv_tt_common_entry to_search, *tt, *tt_tmp = NULL; in batadv_tt_hash_find() local
144 hlist_for_each_entry_rcu(tt, head, hash_entry) { in batadv_tt_hash_find()
145 if (!batadv_compare_eth(tt, addr)) in batadv_tt_hash_find()
148 if (tt->vid != vid) in batadv_tt_hash_find()
151 if (!kref_get_unless_zero(&tt->refcount)) in batadv_tt_hash_find()
154 tt_tmp = tt; in batadv_tt_hash_find()
178 tt_common_entry = batadv_tt_hash_find(bat_priv->tt.local_hash, addr, in batadv_tt_local_hash_find()
203 tt_common_entry = batadv_tt_hash_find(bat_priv->tt.global_hash, addr, in batadv_tt_global_hash_find()
330 atomic_add(v, &vlan->tt.num_entries); in batadv_tt_local_size_mod()
375 if (atomic_add_return(v, &vlan->tt.num_entries) == 0) { in batadv_tt_global_size_mod()
483 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_local_event()
484 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_local_event()
518 list_add_tail(&tt_change_node->list, &bat_priv->tt.changes_list); in batadv_tt_local_event()
521 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_local_event()
524 atomic_dec(&bat_priv->tt.local_changes); in batadv_tt_local_event()
526 atomic_inc(&bat_priv->tt.local_changes); in batadv_tt_local_event()
568 tt_local_entries += atomic_read(&vlan->tt.num_entries); in batadv_tt_local_table_transmit_size()
583 if (bat_priv->tt.local_hash) in batadv_tt_local_init()
586 bat_priv->tt.local_hash = batadv_hash_new(1024); in batadv_tt_local_init()
588 if (!bat_priv->tt.local_hash) in batadv_tt_local_init()
591 batadv_hash_set_lock_class(bat_priv->tt.local_hash, in batadv_tt_local_init()
609 tt_removed_node = batadv_hash_remove(bat_priv->tt.global_hash, in batadv_tt_global_free()
724 (u8)atomic_read(&bat_priv->tt.vn)); in batadv_tt_local_add()
748 hash_added = batadv_hash_add(bat_priv->tt.local_hash, batadv_compare_tt, in batadv_tt_local_add()
862 num_entries += atomic_read(&vlan->tt.num_entries); in batadv_tt_prepare_tvlv_global_data()
888 tt_vlan->crc = htonl(vlan->tt.crc); in batadv_tt_prepare_tvlv_global_data()
937 vlan_entries = atomic_read(&vlan->tt.num_entries); in batadv_tt_prepare_tvlv_local_data()
962 (*tt_data)->ttvn = atomic_read(&bat_priv->tt.vn); in batadv_tt_prepare_tvlv_local_data()
967 vlan_entries = atomic_read(&vlan->tt.num_entries); in batadv_tt_prepare_tvlv_local_data()
972 tt_vlan->crc = htonl(vlan->tt.crc); in batadv_tt_prepare_tvlv_local_data()
1001 tt_diff_entries_num = atomic_read(&bat_priv->tt.local_changes); in batadv_tt_tvlv_container_update()
1020 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_tvlv_container_update()
1021 atomic_set(&bat_priv->tt.local_changes, 0); in batadv_tt_tvlv_container_update()
1023 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_tvlv_container_update()
1034 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_tvlv_container_update()
1037 spin_lock_bh(&bat_priv->tt.last_changeset_lock); in batadv_tt_tvlv_container_update()
1038 kfree(bat_priv->tt.last_changeset); in batadv_tt_tvlv_container_update()
1039 bat_priv->tt.last_changeset_len = 0; in batadv_tt_tvlv_container_update()
1040 bat_priv->tt.last_changeset = NULL; in batadv_tt_tvlv_container_update()
1047 bat_priv->tt.last_changeset = kzalloc(tt_diff_len, GFP_ATOMIC); in batadv_tt_tvlv_container_update()
1048 if (bat_priv->tt.last_changeset) { in batadv_tt_tvlv_container_update()
1049 memcpy(bat_priv->tt.last_changeset, in batadv_tt_tvlv_container_update()
1051 bat_priv->tt.last_changeset_len = tt_diff_len; in batadv_tt_tvlv_container_update()
1054 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_tt_tvlv_container_update()
1075 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_seq_print_text()
1093 net_dev->name, (u8)atomic_read(&bat_priv->tt.vn)); in batadv_tt_local_seq_print_text()
1129 tt_local->vlan->tt.crc); in batadv_tt_local_seq_print_text()
1169 crc = vlan->tt.crc; in batadv_tt_local_dump_entry()
1279 hash = bat_priv->tt.local_hash; in batadv_tt_local_dump()
1368 tt_removed_node = batadv_hash_remove(bat_priv->tt.local_hash, in batadv_tt_local_remove()
1432 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_purge()
1457 if (!bat_priv->tt.local_hash) in batadv_tt_local_table_free()
1460 hash = bat_priv->tt.local_hash; in batadv_tt_local_table_free()
1481 bat_priv->tt.local_hash = NULL; in batadv_tt_local_table_free()
1486 if (bat_priv->tt.global_hash) in batadv_tt_global_init()
1489 bat_priv->tt.global_hash = batadv_hash_new(1024); in batadv_tt_global_init()
1491 if (!bat_priv->tt.global_hash) in batadv_tt_global_init()
1494 batadv_hash_set_lock_class(bat_priv->tt.global_hash, in batadv_tt_global_init()
1504 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_changes_list_free()
1506 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_changes_list_free()
1512 atomic_set(&bat_priv->tt.local_changes, 0); in batadv_tt_changes_list_free()
1513 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_changes_list_free()
1733 hash_added = batadv_hash_add(bat_priv->tt.global_hash, in batadv_tt_global_add()
1922 last_ttvn, vlan->tt.crc, in batadv_tt_global_print_entry()
1954 last_ttvn, vlan->tt.crc, in batadv_tt_global_print_entry()
1975 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_seq_print_text()
2040 crc = vlan->tt.crc; in batadv_tt_global_dump_subentry()
2197 hash = bat_priv->tt.global_hash; in batadv_tt_global_dump()
2429 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_del_orig()
2495 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_purge()
2542 if (!bat_priv->tt.global_hash) in batadv_tt_global_table_free()
2545 hash = bat_priv->tt.global_hash; in batadv_tt_global_table_free()
2565 bat_priv->tt.global_hash = NULL; in batadv_tt_global_table_free()
2672 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_crc()
2752 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_crc()
2827 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_list_free()
2829 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_tt_req_list_free()
2834 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_list_free()
2863 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_purge()
2864 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_tt_req_purge()
2871 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_purge()
2888 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_node_new()
2889 hlist_for_each_entry(tt_req_node_tmp, &bat_priv->tt.req_list, list) { in batadv_tt_req_node_new()
2905 hlist_add_head(&tt_req_node->list, &bat_priv->tt.req_list); in batadv_tt_req_node_new()
2907 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_node_new()
3065 crc = vlan->tt.crc; in batadv_tt_global_check_crc()
3098 vlan->tt.crc = batadv_tt_local_crc(bat_priv, vlan->vid); in batadv_tt_local_update_crc()
3125 vlan->tt.crc = crc; in batadv_tt_global_update_crc()
3204 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_send_tt_request()
3209 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_send_tt_request()
3305 batadv_tt_tvlv_generate(bat_priv, bat_priv->tt.global_hash, in batadv_send_other_tt_response()
3379 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_send_my_tt_response()
3381 my_ttvn = (u8)atomic_read(&bat_priv->tt.vn); in batadv_send_my_tt_response()
3396 !bat_priv->tt.last_changeset) in batadv_send_my_tt_response()
3405 spin_lock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
3407 tt_len = bat_priv->tt.last_changeset_len; in batadv_send_my_tt_response()
3416 memcpy(tt_change, bat_priv->tt.last_changeset, in batadv_send_my_tt_response()
3417 bat_priv->tt.last_changeset_len); in batadv_send_my_tt_response()
3418 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
3420 req_ttvn = (u8)atomic_read(&bat_priv->tt.vn); in batadv_send_my_tt_response()
3434 batadv_tt_tvlv_generate(bat_priv, bat_priv->tt.local_hash, in batadv_send_my_tt_response()
3458 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
3460 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_send_my_tt_response()
3645 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_handle_tt_response()
3646 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_handle_tt_response()
3653 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_handle_tt_response()
3663 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_list_free()
3665 list_for_each_entry_safe(node, safe, &bat_priv->tt.roam_list, list) { in batadv_tt_roam_list_free()
3670 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_list_free()
3677 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_purge()
3678 list_for_each_entry_safe(node, safe, &bat_priv->tt.roam_list, list) { in batadv_tt_roam_purge()
3686 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_purge()
3705 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_check_roam_count()
3709 list_for_each_entry(tt_roam_node, &bat_priv->tt.roam_list, list) { in batadv_tt_check_roam_count()
3735 list_add(&tt_roam_node->list, &bat_priv->tt.roam_list); in batadv_tt_check_roam_count()
3740 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_check_roam_count()
3799 bat_priv = container_of(priv_tt, struct batadv_priv, tt); in batadv_tt_purge()
3806 queue_delayed_work(batadv_event_workqueue, &bat_priv->tt.work, in batadv_tt_purge()
3821 cancel_delayed_work_sync(&bat_priv->tt.work); in batadv_tt_free()
3829 kfree(bat_priv->tt.last_changeset); in batadv_tt_free()
3843 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_set_flags()
3880 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_purge_pending_clients()
3927 lockdep_assert_held(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes_nolock()
3929 if (atomic_read(&bat_priv->tt.local_changes) < 1) { in batadv_tt_local_commit_changes_nolock()
3930 if (!batadv_atomic_dec_not_zero(&bat_priv->tt.ogm_append_cnt)) in batadv_tt_local_commit_changes_nolock()
3941 atomic_inc(&bat_priv->tt.vn); in batadv_tt_local_commit_changes_nolock()
3944 (u8)atomic_read(&bat_priv->tt.vn)); in batadv_tt_local_commit_changes_nolock()
3947 atomic_set(&bat_priv->tt.ogm_append_cnt, BATADV_TT_OGM_APPEND_MAX); in batadv_tt_local_commit_changes_nolock()
3958 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes()
3960 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes()
4190 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_resize_to_mtu()
4213 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_resize_to_mtu()
4419 INIT_DELAYED_WORK(&bat_priv->tt.work, batadv_tt_purge); in batadv_tt_init()
4420 queue_delayed_work(batadv_event_workqueue, &bat_priv->tt.work, in batadv_tt_init()
4438 struct batadv_tt_global_entry *tt; in batadv_tt_global_is_isolated() local
4441 tt = batadv_tt_global_hash_find(bat_priv, addr, vid); in batadv_tt_global_is_isolated()
4442 if (!tt) in batadv_tt_global_is_isolated()
4445 ret = tt->common.flags & BATADV_TT_CLIENT_ISOLA; in batadv_tt_global_is_isolated()
4447 batadv_tt_global_entry_put(tt); in batadv_tt_global_is_isolated()