Lines Matching refs:tt

92 	struct batadv_tt_common_entry *tt;  in batadv_choose_tt()  local
95 tt = (struct batadv_tt_common_entry *)data; in batadv_choose_tt()
96 hash = jhash(&tt->addr, ETH_ALEN, hash); in batadv_choose_tt()
97 hash = jhash(&tt->vid, sizeof(tt->vid), hash); in batadv_choose_tt()
116 struct batadv_tt_common_entry to_search, *tt, *tt_tmp = NULL; in batadv_tt_hash_find() local
129 hlist_for_each_entry_rcu(tt, head, hash_entry) { in batadv_tt_hash_find()
130 if (!batadv_compare_eth(tt, addr)) in batadv_tt_hash_find()
133 if (tt->vid != vid) in batadv_tt_hash_find()
136 if (!atomic_inc_not_zero(&tt->refcount)) in batadv_tt_hash_find()
139 tt_tmp = tt; in batadv_tt_hash_find()
163 tt_common_entry = batadv_tt_hash_find(bat_priv->tt.local_hash, addr, in batadv_tt_local_hash_find()
188 tt_common_entry = batadv_tt_hash_find(bat_priv->tt.global_hash, addr, in batadv_tt_global_hash_find()
259 atomic_add(v, &vlan->tt.num_entries); in batadv_tt_local_size_mod()
304 if (atomic_add_return(v, &vlan->tt.num_entries) == 0) { in batadv_tt_global_size_mod()
388 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_local_event()
389 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_local_event()
423 list_add_tail(&tt_change_node->list, &bat_priv->tt.changes_list); in batadv_tt_local_event()
426 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_local_event()
429 atomic_dec(&bat_priv->tt.local_changes); in batadv_tt_local_event()
431 atomic_inc(&bat_priv->tt.local_changes); in batadv_tt_local_event()
473 tt_local_entries += atomic_read(&vlan->tt.num_entries); in batadv_tt_local_table_transmit_size()
488 if (bat_priv->tt.local_hash) in batadv_tt_local_init()
491 bat_priv->tt.local_hash = batadv_hash_new(1024); in batadv_tt_local_init()
493 if (!bat_priv->tt.local_hash) in batadv_tt_local_init()
496 batadv_hash_set_lock_class(bat_priv->tt.local_hash, in batadv_tt_local_init()
511 batadv_hash_remove(bat_priv->tt.global_hash, batadv_compare_tt, in batadv_tt_global_free()
610 (u8)atomic_read(&bat_priv->tt.vn)); in batadv_tt_local_add()
632 hash_added = batadv_hash_add(bat_priv->tt.local_hash, batadv_compare_tt, in batadv_tt_local_add()
746 num_entries += atomic_read(&vlan->tt.num_entries); in batadv_tt_prepare_tvlv_global_data()
772 tt_vlan->crc = htonl(vlan->tt.crc); in batadv_tt_prepare_tvlv_global_data()
820 num_entries += atomic_read(&vlan->tt.num_entries); in batadv_tt_prepare_tvlv_local_data()
840 (*tt_data)->ttvn = atomic_read(&bat_priv->tt.vn); in batadv_tt_prepare_tvlv_local_data()
846 tt_vlan->crc = htonl(vlan->tt.crc); in batadv_tt_prepare_tvlv_local_data()
874 tt_diff_entries_num = atomic_read(&bat_priv->tt.local_changes); in batadv_tt_tvlv_container_update()
893 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_tvlv_container_update()
894 atomic_set(&bat_priv->tt.local_changes, 0); in batadv_tt_tvlv_container_update()
896 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_tvlv_container_update()
907 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_tvlv_container_update()
910 spin_lock_bh(&bat_priv->tt.last_changeset_lock); in batadv_tt_tvlv_container_update()
911 kfree(bat_priv->tt.last_changeset); in batadv_tt_tvlv_container_update()
912 bat_priv->tt.last_changeset_len = 0; in batadv_tt_tvlv_container_update()
913 bat_priv->tt.last_changeset = NULL; in batadv_tt_tvlv_container_update()
920 bat_priv->tt.last_changeset = kzalloc(tt_diff_len, GFP_ATOMIC); in batadv_tt_tvlv_container_update()
921 if (bat_priv->tt.last_changeset) { in batadv_tt_tvlv_container_update()
922 memcpy(bat_priv->tt.last_changeset, in batadv_tt_tvlv_container_update()
924 bat_priv->tt.last_changeset_len = tt_diff_len; in batadv_tt_tvlv_container_update()
927 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_tt_tvlv_container_update()
939 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_seq_print_text()
959 net_dev->name, (u8)atomic_read(&bat_priv->tt.vn)); in batadv_tt_local_seq_print_text()
1004 vlan->tt.crc); in batadv_tt_local_seq_print_text()
1081 tt_entry_exists = batadv_hash_remove(bat_priv->tt.local_hash, in batadv_tt_local_remove()
1150 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_purge()
1176 if (!bat_priv->tt.local_hash) in batadv_tt_local_table_free()
1179 hash = bat_priv->tt.local_hash; in batadv_tt_local_table_free()
1208 bat_priv->tt.local_hash = NULL; in batadv_tt_local_table_free()
1213 if (bat_priv->tt.global_hash) in batadv_tt_global_init()
1216 bat_priv->tt.global_hash = batadv_hash_new(1024); in batadv_tt_global_init()
1218 if (!bat_priv->tt.global_hash) in batadv_tt_global_init()
1221 batadv_hash_set_lock_class(bat_priv->tt.global_hash, in batadv_tt_global_init()
1231 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_changes_list_free()
1233 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_changes_list_free()
1239 atomic_set(&bat_priv->tt.local_changes, 0); in batadv_tt_changes_list_free()
1240 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_changes_list_free()
1397 hash_added = batadv_hash_add(bat_priv->tt.global_hash, in batadv_tt_global_add()
1583 last_ttvn, vlan->tt.crc, in batadv_tt_global_print_entry()
1615 last_ttvn, vlan->tt.crc, in batadv_tt_global_print_entry()
1629 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_seq_print_text()
1868 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_del_orig()
1934 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_purge()
1981 if (!bat_priv->tt.global_hash) in batadv_tt_global_table_free()
1984 hash = bat_priv->tt.global_hash; in batadv_tt_global_table_free()
2004 bat_priv->tt.global_hash = NULL; in batadv_tt_global_table_free()
2113 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_crc()
2189 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_crc()
2238 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_list_free()
2240 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_tt_req_list_free()
2245 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_list_free()
2274 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_purge()
2275 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_tt_req_purge()
2282 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_purge()
2299 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_node_new()
2300 hlist_for_each_entry(tt_req_node_tmp, &bat_priv->tt.req_list, list) { in batadv_tt_req_node_new()
2314 hlist_add_head(&tt_req_node->list, &bat_priv->tt.req_list); in batadv_tt_req_node_new()
2316 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_node_new()
2440 crc = vlan->tt.crc; in batadv_tt_global_check_crc()
2461 vlan->tt.crc = batadv_tt_local_crc(bat_priv, vlan->vid); in batadv_tt_local_update_crc()
2488 vlan->tt.crc = crc; in batadv_tt_global_update_crc()
2564 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_send_tt_request()
2567 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_send_tt_request()
2660 batadv_tt_tvlv_generate(bat_priv, bat_priv->tt.global_hash, in batadv_send_other_tt_response()
2734 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_send_my_tt_response()
2736 my_ttvn = (u8)atomic_read(&bat_priv->tt.vn); in batadv_send_my_tt_response()
2751 !bat_priv->tt.last_changeset) in batadv_send_my_tt_response()
2760 spin_lock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
2762 tt_len = bat_priv->tt.last_changeset_len; in batadv_send_my_tt_response()
2771 memcpy(tt_change, bat_priv->tt.last_changeset, in batadv_send_my_tt_response()
2772 bat_priv->tt.last_changeset_len); in batadv_send_my_tt_response()
2773 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
2775 req_ttvn = (u8)atomic_read(&bat_priv->tt.vn); in batadv_send_my_tt_response()
2789 batadv_tt_tvlv_generate(bat_priv, bat_priv->tt.local_hash, in batadv_send_my_tt_response()
2813 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
2815 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_send_my_tt_response()
3000 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_handle_tt_response()
3001 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_handle_tt_response()
3008 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_handle_tt_response()
3018 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_list_free()
3020 list_for_each_entry_safe(node, safe, &bat_priv->tt.roam_list, list) { in batadv_tt_roam_list_free()
3025 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_list_free()
3032 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_purge()
3033 list_for_each_entry_safe(node, safe, &bat_priv->tt.roam_list, list) { in batadv_tt_roam_purge()
3041 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_purge()
3055 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_check_roam_count()
3059 list_for_each_entry(tt_roam_node, &bat_priv->tt.roam_list, list) { in batadv_tt_check_roam_count()
3084 list_add(&tt_roam_node->list, &bat_priv->tt.roam_list); in batadv_tt_check_roam_count()
3089 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_check_roam_count()
3148 bat_priv = container_of(priv_tt, struct batadv_priv, tt); in batadv_tt_purge()
3155 queue_delayed_work(batadv_event_workqueue, &bat_priv->tt.work, in batadv_tt_purge()
3164 cancel_delayed_work_sync(&bat_priv->tt.work); in batadv_tt_free()
3172 kfree(bat_priv->tt.last_changeset); in batadv_tt_free()
3186 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_set_flags()
3225 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_purge_pending_clients()
3280 lockdep_assert_held(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes_nolock()
3285 if (atomic_read(&bat_priv->tt.local_changes) < 1) { in batadv_tt_local_commit_changes_nolock()
3286 if (!batadv_atomic_dec_not_zero(&bat_priv->tt.ogm_append_cnt)) in batadv_tt_local_commit_changes_nolock()
3297 atomic_inc(&bat_priv->tt.vn); in batadv_tt_local_commit_changes_nolock()
3300 (u8)atomic_read(&bat_priv->tt.vn)); in batadv_tt_local_commit_changes_nolock()
3303 atomic_set(&bat_priv->tt.ogm_append_cnt, BATADV_TT_OGM_APPEND_MAX); in batadv_tt_local_commit_changes_nolock()
3314 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes()
3316 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes()
3527 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_resize_to_mtu()
3550 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_resize_to_mtu()
3753 INIT_DELAYED_WORK(&bat_priv->tt.work, batadv_tt_purge); in batadv_tt_init()
3754 queue_delayed_work(batadv_event_workqueue, &bat_priv->tt.work, in batadv_tt_init()
3772 struct batadv_tt_global_entry *tt; in batadv_tt_global_is_isolated() local
3775 tt = batadv_tt_global_hash_find(bat_priv, addr, vid); in batadv_tt_global_is_isolated()
3776 if (!tt) in batadv_tt_global_is_isolated()
3779 ret = tt->common.flags & BATADV_TT_CLIENT_ISOLA; in batadv_tt_global_is_isolated()
3781 batadv_tt_global_entry_free_ref(tt); in batadv_tt_global_is_isolated()