Lines Matching refs:tvlv
75 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_handler_get()
99 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_release() local
101 tvlv = container_of(ref, struct batadv_tvlv_container, refcount); in batadv_tvlv_container_release()
102 kfree(tvlv); in batadv_tvlv_container_release()
110 static void batadv_tvlv_container_put(struct batadv_tvlv_container *tvlv) in batadv_tvlv_container_put() argument
112 if (!tvlv) in batadv_tvlv_container_put()
115 kref_put(&tvlv->refcount, batadv_tvlv_container_release); in batadv_tvlv_container_put()
133 struct batadv_tvlv_container *tvlv_tmp, *tvlv = NULL; in batadv_tvlv_container_get() local
135 lockdep_assert_held(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_get()
137 hlist_for_each_entry(tvlv_tmp, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_get()
145 tvlv = tvlv_tmp; in batadv_tvlv_container_get()
149 return tvlv; in batadv_tvlv_container_get()
164 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_list_size() local
167 lockdep_assert_held(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_list_size()
169 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_list_size()
171 tvlv_len += ntohs(tvlv->tvlv_hdr.len); in batadv_tvlv_container_list_size()
187 struct batadv_tvlv_container *tvlv) in batadv_tvlv_container_remove() argument
189 lockdep_assert_held(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_remove()
191 if (!tvlv) in batadv_tvlv_container_remove()
194 hlist_del(&tvlv->list); in batadv_tvlv_container_remove()
197 batadv_tvlv_container_put(tvlv); in batadv_tvlv_container_remove()
198 batadv_tvlv_container_put(tvlv); in batadv_tvlv_container_remove()
211 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_unregister() local
213 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_unregister()
214 tvlv = batadv_tvlv_container_get(bat_priv, type, version); in batadv_tvlv_container_unregister()
215 batadv_tvlv_container_remove(bat_priv, tvlv); in batadv_tvlv_container_unregister()
216 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_unregister()
252 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_register()
257 hlist_add_head(&tvlv_new->list, &bat_priv->tvlv.container_list); in batadv_tvlv_container_register()
258 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_register()
315 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_ogm_append() local
321 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
335 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_ogm_append()
337 tvlv_hdr->type = tvlv->tvlv_hdr.type; in batadv_tvlv_container_ogm_append()
338 tvlv_hdr->version = tvlv->tvlv_hdr.version; in batadv_tvlv_container_ogm_append()
339 tvlv_hdr->len = tvlv->tvlv_hdr.len; in batadv_tvlv_container_ogm_append()
341 memcpy(tvlv_value, tvlv + 1, ntohs(tvlv->tvlv_hdr.len)); in batadv_tvlv_container_ogm_append()
342 tvlv_value = (u8 *)tvlv_value + ntohs(tvlv->tvlv_hdr.len); in batadv_tvlv_container_ogm_append()
346 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
474 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_containers_process()
551 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
555 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
562 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
576 hlist_add_head_rcu(&tvlv_handler->list, &bat_priv->tvlv.handler_list); in batadv_tvlv_handler_register()
577 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
600 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_unregister()
602 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_unregister()