Lines Matching refs:tvlv
72 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_handler_get()
96 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_release() local
98 tvlv = container_of(ref, struct batadv_tvlv_container, refcount); in batadv_tvlv_container_release()
99 kfree(tvlv); in batadv_tvlv_container_release()
107 static void batadv_tvlv_container_put(struct batadv_tvlv_container *tvlv) in batadv_tvlv_container_put() argument
109 kref_put(&tvlv->refcount, batadv_tvlv_container_release); in batadv_tvlv_container_put()
127 struct batadv_tvlv_container *tvlv_tmp, *tvlv = NULL; in batadv_tvlv_container_get() local
129 lockdep_assert_held(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_get()
131 hlist_for_each_entry(tvlv_tmp, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_get()
139 tvlv = tvlv_tmp; in batadv_tvlv_container_get()
143 return tvlv; in batadv_tvlv_container_get()
158 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_list_size() local
161 lockdep_assert_held(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_list_size()
163 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_list_size()
165 tvlv_len += ntohs(tvlv->tvlv_hdr.len); in batadv_tvlv_container_list_size()
181 struct batadv_tvlv_container *tvlv) in batadv_tvlv_container_remove() argument
183 lockdep_assert_held(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_remove()
185 if (!tvlv) in batadv_tvlv_container_remove()
188 hlist_del(&tvlv->list); in batadv_tvlv_container_remove()
191 batadv_tvlv_container_put(tvlv); in batadv_tvlv_container_remove()
192 batadv_tvlv_container_put(tvlv); in batadv_tvlv_container_remove()
205 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_unregister() local
207 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_unregister()
208 tvlv = batadv_tvlv_container_get(bat_priv, type, version); in batadv_tvlv_container_unregister()
209 batadv_tvlv_container_remove(bat_priv, tvlv); in batadv_tvlv_container_unregister()
210 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_unregister()
246 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_register()
251 hlist_add_head(&tvlv_new->list, &bat_priv->tvlv.container_list); in batadv_tvlv_container_register()
252 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_register()
309 struct batadv_tvlv_container *tvlv; in batadv_tvlv_container_ogm_append() local
315 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
329 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_ogm_append()
331 tvlv_hdr->type = tvlv->tvlv_hdr.type; in batadv_tvlv_container_ogm_append()
332 tvlv_hdr->version = tvlv->tvlv_hdr.version; in batadv_tvlv_container_ogm_append()
333 tvlv_hdr->len = tvlv->tvlv_hdr.len; in batadv_tvlv_container_ogm_append()
335 memcpy(tvlv_value, tvlv + 1, ntohs(tvlv->tvlv_hdr.len)); in batadv_tvlv_container_ogm_append()
336 tvlv_value = (u8 *)tvlv_value + ntohs(tvlv->tvlv_hdr.len); in batadv_tvlv_container_ogm_append()
340 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
452 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_containers_process()
520 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
524 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
531 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
544 hlist_add_head_rcu(&tvlv_handler->list, &bat_priv->tvlv.handler_list); in batadv_tvlv_handler_register()
545 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
568 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_unregister()
570 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_unregister()