Lines Matching refs:tt

106 	const struct batadv_tt_common_entry *tt;  in batadv_choose_tt()  local
109 tt = data; in batadv_choose_tt()
110 hash = jhash(&tt->addr, ETH_ALEN, hash); in batadv_choose_tt()
111 hash = jhash(&tt->vid, sizeof(tt->vid), hash); in batadv_choose_tt()
130 struct batadv_tt_common_entry to_search, *tt, *tt_tmp = NULL; in batadv_tt_hash_find() local
143 hlist_for_each_entry_rcu(tt, head, hash_entry) { in batadv_tt_hash_find()
144 if (!batadv_compare_eth(tt, addr)) in batadv_tt_hash_find()
147 if (tt->vid != vid) in batadv_tt_hash_find()
150 if (!kref_get_unless_zero(&tt->refcount)) in batadv_tt_hash_find()
153 tt_tmp = tt; in batadv_tt_hash_find()
177 tt_common_entry = batadv_tt_hash_find(bat_priv->tt.local_hash, addr, in batadv_tt_local_hash_find()
202 tt_common_entry = batadv_tt_hash_find(bat_priv->tt.global_hash, addr, in batadv_tt_global_hash_find()
329 atomic_add(v, &vlan->tt.num_entries); in batadv_tt_local_size_mod()
374 if (atomic_add_return(v, &vlan->tt.num_entries) == 0) { in batadv_tt_global_size_mod()
482 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_local_event()
483 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_local_event()
517 list_add_tail(&tt_change_node->list, &bat_priv->tt.changes_list); in batadv_tt_local_event()
520 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_local_event()
523 atomic_dec(&bat_priv->tt.local_changes); in batadv_tt_local_event()
525 atomic_inc(&bat_priv->tt.local_changes); in batadv_tt_local_event()
567 tt_local_entries += atomic_read(&vlan->tt.num_entries); in batadv_tt_local_table_transmit_size()
582 if (bat_priv->tt.local_hash) in batadv_tt_local_init()
585 bat_priv->tt.local_hash = batadv_hash_new(1024); in batadv_tt_local_init()
587 if (!bat_priv->tt.local_hash) in batadv_tt_local_init()
590 batadv_hash_set_lock_class(bat_priv->tt.local_hash, in batadv_tt_local_init()
608 tt_removed_node = batadv_hash_remove(bat_priv->tt.global_hash, in batadv_tt_global_free()
723 (u8)atomic_read(&bat_priv->tt.vn)); in batadv_tt_local_add()
747 hash_added = batadv_hash_add(bat_priv->tt.local_hash, batadv_compare_tt, in batadv_tt_local_add()
857 num_entries += atomic_read(&vlan->tt.num_entries); in batadv_tt_prepare_tvlv_global_data()
883 tt_vlan->crc = htonl(vlan->tt.crc); in batadv_tt_prepare_tvlv_global_data()
932 vlan_entries = atomic_read(&vlan->tt.num_entries); in batadv_tt_prepare_tvlv_local_data()
957 (*tt_data)->ttvn = atomic_read(&bat_priv->tt.vn); in batadv_tt_prepare_tvlv_local_data()
962 vlan_entries = atomic_read(&vlan->tt.num_entries); in batadv_tt_prepare_tvlv_local_data()
967 tt_vlan->crc = htonl(vlan->tt.crc); in batadv_tt_prepare_tvlv_local_data()
996 tt_diff_entries_num = atomic_read(&bat_priv->tt.local_changes); in batadv_tt_tvlv_container_update()
1015 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_tvlv_container_update()
1016 atomic_set(&bat_priv->tt.local_changes, 0); in batadv_tt_tvlv_container_update()
1018 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_tvlv_container_update()
1029 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_tvlv_container_update()
1032 spin_lock_bh(&bat_priv->tt.last_changeset_lock); in batadv_tt_tvlv_container_update()
1033 kfree(bat_priv->tt.last_changeset); in batadv_tt_tvlv_container_update()
1034 bat_priv->tt.last_changeset_len = 0; in batadv_tt_tvlv_container_update()
1035 bat_priv->tt.last_changeset = NULL; in batadv_tt_tvlv_container_update()
1042 bat_priv->tt.last_changeset = kzalloc(tt_diff_len, GFP_ATOMIC); in batadv_tt_tvlv_container_update()
1043 if (bat_priv->tt.last_changeset) { in batadv_tt_tvlv_container_update()
1044 memcpy(bat_priv->tt.last_changeset, in batadv_tt_tvlv_container_update()
1046 bat_priv->tt.last_changeset_len = tt_diff_len; in batadv_tt_tvlv_container_update()
1049 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_tt_tvlv_container_update()
1086 crc = vlan->tt.crc; in batadv_tt_local_dump_entry()
1196 hash = bat_priv->tt.local_hash; in batadv_tt_local_dump()
1283 tt_removed_node = batadv_hash_remove(bat_priv->tt.local_hash, in batadv_tt_local_remove()
1346 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_purge()
1371 if (!bat_priv->tt.local_hash) in batadv_tt_local_table_free()
1374 hash = bat_priv->tt.local_hash; in batadv_tt_local_table_free()
1395 bat_priv->tt.local_hash = NULL; in batadv_tt_local_table_free()
1400 if (bat_priv->tt.global_hash) in batadv_tt_global_init()
1403 bat_priv->tt.global_hash = batadv_hash_new(1024); in batadv_tt_global_init()
1405 if (!bat_priv->tt.global_hash) in batadv_tt_global_init()
1408 batadv_hash_set_lock_class(bat_priv->tt.global_hash, in batadv_tt_global_init()
1418 spin_lock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_changes_list_free()
1420 list_for_each_entry_safe(entry, safe, &bat_priv->tt.changes_list, in batadv_tt_changes_list_free()
1426 atomic_set(&bat_priv->tt.local_changes, 0); in batadv_tt_changes_list_free()
1427 spin_unlock_bh(&bat_priv->tt.changes_list_lock); in batadv_tt_changes_list_free()
1646 hash_added = batadv_hash_add(bat_priv->tt.global_hash, in batadv_tt_global_add()
1816 crc = vlan->tt.crc; in batadv_tt_global_dump_subentry()
1973 hash = bat_priv->tt.global_hash; in batadv_tt_global_dump()
2201 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_del_orig()
2267 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_purge()
2314 if (!bat_priv->tt.global_hash) in batadv_tt_global_table_free()
2317 hash = bat_priv->tt.global_hash; in batadv_tt_global_table_free()
2337 bat_priv->tt.global_hash = NULL; in batadv_tt_global_table_free()
2442 struct batadv_hashtable *hash = bat_priv->tt.global_hash; in batadv_tt_global_crc()
2522 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_crc()
2597 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_list_free()
2599 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_tt_req_list_free()
2604 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_list_free()
2633 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_purge()
2634 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_tt_req_purge()
2641 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_purge()
2658 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_node_new()
2659 hlist_for_each_entry(tt_req_node_tmp, &bat_priv->tt.req_list, list) { in batadv_tt_req_node_new()
2675 hlist_add_head(&tt_req_node->list, &bat_priv->tt.req_list); in batadv_tt_req_node_new()
2677 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_tt_req_node_new()
2835 crc = vlan->tt.crc; in batadv_tt_global_check_crc()
2868 vlan->tt.crc = batadv_tt_local_crc(bat_priv, vlan->vid); in batadv_tt_local_update_crc()
2895 vlan->tt.crc = crc; in batadv_tt_global_update_crc()
2973 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_send_tt_request()
2978 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_send_tt_request()
3073 batadv_tt_tvlv_generate(bat_priv, bat_priv->tt.global_hash, in batadv_send_other_tt_response()
3145 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_send_my_tt_response()
3147 my_ttvn = (u8)atomic_read(&bat_priv->tt.vn); in batadv_send_my_tt_response()
3162 !bat_priv->tt.last_changeset) in batadv_send_my_tt_response()
3171 spin_lock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
3173 tt_len = bat_priv->tt.last_changeset_len; in batadv_send_my_tt_response()
3182 memcpy(tt_change, bat_priv->tt.last_changeset, in batadv_send_my_tt_response()
3183 bat_priv->tt.last_changeset_len); in batadv_send_my_tt_response()
3184 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
3186 req_ttvn = (u8)atomic_read(&bat_priv->tt.vn); in batadv_send_my_tt_response()
3200 batadv_tt_tvlv_generate(bat_priv, bat_priv->tt.local_hash, in batadv_send_my_tt_response()
3224 spin_unlock_bh(&bat_priv->tt.last_changeset_lock); in batadv_send_my_tt_response()
3226 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_send_my_tt_response()
3407 spin_lock_bh(&bat_priv->tt.req_list_lock); in batadv_handle_tt_response()
3408 hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { in batadv_handle_tt_response()
3415 spin_unlock_bh(&bat_priv->tt.req_list_lock); in batadv_handle_tt_response()
3424 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_list_free()
3426 list_for_each_entry_safe(node, safe, &bat_priv->tt.roam_list, list) { in batadv_tt_roam_list_free()
3431 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_list_free()
3438 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_purge()
3439 list_for_each_entry_safe(node, safe, &bat_priv->tt.roam_list, list) { in batadv_tt_roam_purge()
3447 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_roam_purge()
3466 spin_lock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_check_roam_count()
3470 list_for_each_entry(tt_roam_node, &bat_priv->tt.roam_list, list) { in batadv_tt_check_roam_count()
3496 list_add(&tt_roam_node->list, &bat_priv->tt.roam_list); in batadv_tt_check_roam_count()
3501 spin_unlock_bh(&bat_priv->tt.roam_list_lock); in batadv_tt_check_roam_count()
3559 bat_priv = container_of(priv_tt, struct batadv_priv, tt); in batadv_tt_purge()
3566 queue_delayed_work(batadv_event_workqueue, &bat_priv->tt.work, in batadv_tt_purge()
3581 cancel_delayed_work_sync(&bat_priv->tt.work); in batadv_tt_free()
3589 kfree(bat_priv->tt.last_changeset); in batadv_tt_free()
3603 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_set_flags()
3640 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_purge_pending_clients()
3687 lockdep_assert_held(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes_nolock()
3689 if (atomic_read(&bat_priv->tt.local_changes) < 1) { in batadv_tt_local_commit_changes_nolock()
3690 if (!batadv_atomic_dec_not_zero(&bat_priv->tt.ogm_append_cnt)) in batadv_tt_local_commit_changes_nolock()
3701 atomic_inc(&bat_priv->tt.vn); in batadv_tt_local_commit_changes_nolock()
3704 (u8)atomic_read(&bat_priv->tt.vn)); in batadv_tt_local_commit_changes_nolock()
3707 atomic_set(&bat_priv->tt.ogm_append_cnt, BATADV_TT_OGM_APPEND_MAX); in batadv_tt_local_commit_changes_nolock()
3718 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes()
3720 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_commit_changes()
3950 spin_lock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_resize_to_mtu()
3973 spin_unlock_bh(&bat_priv->tt.commit_lock); in batadv_tt_local_resize_to_mtu()
4178 INIT_DELAYED_WORK(&bat_priv->tt.work, batadv_tt_purge); in batadv_tt_init()
4179 queue_delayed_work(batadv_event_workqueue, &bat_priv->tt.work, in batadv_tt_init()
4197 struct batadv_tt_global_entry *tt; in batadv_tt_global_is_isolated() local
4200 tt = batadv_tt_global_hash_find(bat_priv, addr, vid); in batadv_tt_global_is_isolated()
4201 if (!tt) in batadv_tt_global_is_isolated()
4204 ret = tt->common.flags & BATADV_TT_CLIENT_ISOLA; in batadv_tt_global_is_isolated()
4206 batadv_tt_global_entry_put(tt); in batadv_tt_global_is_isolated()