Lines Matching refs:bat_priv
66 batadv_tvlv_handler_get(struct batadv_priv *bat_priv, u8 type, u8 version) in batadv_tvlv_handler_get() argument
72 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_handler_get()
125 batadv_tvlv_container_get(struct batadv_priv *bat_priv, u8 type, u8 version) in batadv_tvlv_container_get() argument
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()
156 static u16 batadv_tvlv_container_list_size(struct batadv_priv *bat_priv) in batadv_tvlv_container_list_size() argument
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()
180 static void batadv_tvlv_container_remove(struct batadv_priv *bat_priv, in batadv_tvlv_container_remove() argument
183 lockdep_assert_held(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_remove()
202 void batadv_tvlv_container_unregister(struct batadv_priv *bat_priv, in batadv_tvlv_container_unregister() argument
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()
225 void batadv_tvlv_container_register(struct batadv_priv *bat_priv, in batadv_tvlv_container_register() argument
246 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_register()
247 tvlv_old = batadv_tvlv_container_get(bat_priv, type, version); in batadv_tvlv_container_register()
248 batadv_tvlv_container_remove(bat_priv, tvlv_old); 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()
305 u16 batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv, in batadv_tvlv_container_ogm_append() argument
315 spin_lock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
316 tvlv_value_len = batadv_tvlv_container_list_size(bat_priv); in batadv_tvlv_container_ogm_append()
329 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) { in batadv_tvlv_container_ogm_append()
340 spin_unlock_bh(&bat_priv->tvlv.container_list_lock); in batadv_tvlv_container_ogm_append()
359 static int batadv_tvlv_call_handler(struct batadv_priv *bat_priv, in batadv_tvlv_call_handler() argument
376 tvlv_handler->ogm_handler(bat_priv, orig_node, in batadv_tvlv_call_handler()
390 return tvlv_handler->unicast_handler(bat_priv, src, in batadv_tvlv_call_handler()
412 int batadv_tvlv_containers_process(struct batadv_priv *bat_priv, in batadv_tvlv_containers_process() argument
433 tvlv_handler = batadv_tvlv_handler_get(bat_priv, in batadv_tvlv_containers_process()
437 ret |= batadv_tvlv_call_handler(bat_priv, tvlv_handler, in batadv_tvlv_containers_process()
452 &bat_priv->tvlv.handler_list, list) { in batadv_tvlv_containers_process()
455 tvlv_handler->ogm_handler(bat_priv, orig_node, in batadv_tvlv_containers_process()
472 void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv, in batadv_tvlv_ogm_receive() argument
488 batadv_tvlv_containers_process(bat_priv, true, orig_node, NULL, NULL, in batadv_tvlv_ogm_receive()
506 void batadv_tvlv_handler_register(struct batadv_priv *bat_priv, in batadv_tvlv_handler_register() argument
507 void (*optr)(struct batadv_priv *bat_priv, in batadv_tvlv_handler_register() argument
512 int (*uptr)(struct batadv_priv *bat_priv, in batadv_tvlv_handler_register() argument
520 spin_lock_bh(&bat_priv->tvlv.handler_list_lock); in batadv_tvlv_handler_register()
522 tvlv_handler = batadv_tvlv_handler_get(bat_priv, type, version); 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()
558 void batadv_tvlv_handler_unregister(struct batadv_priv *bat_priv, in batadv_tvlv_handler_unregister() argument
563 tvlv_handler = batadv_tvlv_handler_get(bat_priv, type, version); in batadv_tvlv_handler_unregister()
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()
585 void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, u8 *src, in batadv_tvlv_unicast_send() argument
597 orig_node = batadv_orig_hash_find(bat_priv, dst); in batadv_tvlv_unicast_send()