Lines Matching refs:tvlv

139 	spin_lock_init(&bat_priv->tvlv.container_list_lock);  in batadv_mesh_init()
140 spin_lock_init(&bat_priv->tvlv.handler_list_lock); in batadv_mesh_init()
157 INIT_HLIST_HEAD(&bat_priv->tvlv.container_list); in batadv_mesh_init()
158 INIT_HLIST_HEAD(&bat_priv->tvlv.handler_list); in batadv_mesh_init()
652 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_handler_get()
675 static void batadv_tvlv_container_free_ref(struct batadv_tvlv_container *tvlv) in batadv_tvlv_container_free_ref() argument
677 if (atomic_dec_and_test(&tvlv->refcount)) in batadv_tvlv_container_free_ref()
678 kfree(tvlv); in batadv_tvlv_container_free_ref()
696 struct batadv_tvlv_container *tvlv_tmp, *tvlv = NULL; in batadv_tvlv_container_get() local
698 hlist_for_each_entry(tvlv_tmp, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_get()
708 tvlv = tvlv_tmp; in batadv_tvlv_container_get()
712 return tvlv; in batadv_tvlv_container_get()
727 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_list_size() local
730 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_list_size()
732 tvlv_len += ntohs(tvlv->tvlv_hdr.len); in batadv_tvlv_container_list_size()
748 struct batadv_tvlv_container *tvlv) in batadv_tvlv_container_remove() argument
750 lockdep_assert_held(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_container_remove()
752 if (!tvlv) in batadv_tvlv_container_remove()
755 hlist_del(&tvlv->list); in batadv_tvlv_container_remove()
758 batadv_tvlv_container_free_ref(tvlv); in batadv_tvlv_container_remove()
759 batadv_tvlv_container_free_ref(tvlv); in batadv_tvlv_container_remove()
772 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_unregister() local
774 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_unregister()
775 tvlv = batadv_tvlv_container_get(bat_priv, type, version); in batadv_tvlv_container_unregister()
776 batadv_tvlv_container_remove(bat_priv, tvlv); in batadv_tvlv_container_unregister()
777 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_unregister()
813 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_register()
816 hlist_add_head(&tvlv_new->list, &bat_priv->tvlv.container_list); in batadv_tvlv_container_register()
817 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_register()
871 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_ogm_append() local
877 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
891 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_ogm_append()
893 tvlv_hdr->type = tvlv->tvlv_hdr.type; in batadv_tvlv_container_ogm_append()
894 tvlv_hdr->version = tvlv->tvlv_hdr.version; in batadv_tvlv_container_ogm_append()
895 tvlv_hdr->len = tvlv->tvlv_hdr.len; in batadv_tvlv_container_ogm_append()
897 memcpy(tvlv_value, tvlv + 1, ntohs(tvlv->tvlv_hdr.len)); in batadv_tvlv_container_ogm_append()
898 tvlv_value = (u8 *)tvlv_value + ntohs(tvlv->tvlv_hdr.len); in batadv_tvlv_container_ogm_append()
902 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
1014 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_containers_process()
1100 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
1101 hlist_add_head_rcu(&tvlv_handler->list, &bat_priv->tvlv.handler_list); in batadv_tvlv_handler_register()
1102 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
1122 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_unregister()
1124 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_unregister()