Lines Matching refs:bat_priv
69 batadv_tvlv_handler_get(struct batadv_priv *bat_priv, u8 type, u8 version) in batadv_tvlv_handler_get() argument
75 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_handler_get()
131 batadv_tvlv_container_get(struct batadv_priv *bat_priv, u8 type, u8 version) in batadv_tvlv_container_get() argument
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()
162 static u16 batadv_tvlv_container_list_size(struct batadv_priv *bat_priv) in batadv_tvlv_container_list_size() argument
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()
186 static void batadv_tvlv_container_remove(struct batadv_priv *bat_priv, in batadv_tvlv_container_remove() argument
189 lockdep_assert_held(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_remove()
208 void batadv_tvlv_container_unregister(struct batadv_priv *bat_priv, in batadv_tvlv_container_unregister() argument
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()
231 void batadv_tvlv_container_register(struct batadv_priv *bat_priv, in batadv_tvlv_container_register() argument
252 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_register()
253 tvlv_old = batadv_tvlv_container_get(bat_priv, type, version); in batadv_tvlv_container_register()
254 batadv_tvlv_container_remove(bat_priv, tvlv_old); 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()
311 u16 batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv, in batadv_tvlv_container_ogm_append() argument
321 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
322 tvlv_value_len = batadv_tvlv_container_list_size(bat_priv); in batadv_tvlv_container_ogm_append()
335 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_ogm_append()
346 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
365 static int batadv_tvlv_call_handler(struct batadv_priv *bat_priv, in batadv_tvlv_call_handler() argument
382 tvlv_handler->ogm_handler(bat_priv, orig_node, in batadv_tvlv_call_handler()
396 return tvlv_handler->unicast_handler(bat_priv, src, in batadv_tvlv_call_handler()
418 int batadv_tvlv_containers_process(struct batadv_priv *bat_priv, in batadv_tvlv_containers_process() argument
439 tvlv_handler = batadv_tvlv_handler_get(bat_priv, in batadv_tvlv_containers_process()
443 ret |= batadv_tvlv_call_handler(bat_priv, tvlv_handler, in batadv_tvlv_containers_process()
457 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_containers_process()
460 tvlv_handler->ogm_handler(bat_priv, orig_node, in batadv_tvlv_containers_process()
477 void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv, in batadv_tvlv_ogm_receive() argument
493 batadv_tvlv_containers_process(bat_priv, true, orig_node, NULL, NULL, in batadv_tvlv_ogm_receive()
511 void batadv_tvlv_handler_register(struct batadv_priv *bat_priv, in batadv_tvlv_handler_register() argument
512 void (*optr)(struct batadv_priv *bat_priv, in batadv_tvlv_handler_register() argument
517 int (*uptr)(struct batadv_priv *bat_priv, in batadv_tvlv_handler_register() argument
525 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
527 tvlv_handler = batadv_tvlv_handler_get(bat_priv, type, version); in batadv_tvlv_handler_register()
529 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
536 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
549 hlist_add_head_rcu(&tvlv_handler->list, &bat_priv->tvlv.handler_list); in batadv_tvlv_handler_register()
550 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
563 void batadv_tvlv_handler_unregister(struct batadv_priv *bat_priv, in batadv_tvlv_handler_unregister() argument
568 tvlv_handler = batadv_tvlv_handler_get(bat_priv, type, version); in batadv_tvlv_handler_unregister()
573 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_unregister()
575 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_unregister()
590 void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, const u8 *src, in batadv_tvlv_unicast_send() argument
602 orig_node = batadv_orig_hash_find(bat_priv, dst); in batadv_tvlv_unicast_send()