Lines Matching refs:bat_priv
62 * @bat_priv: the bat priv with all the soft interface information
69 batadv_tvlv_handler_get(struct batadv_priv *bat_priv, u8 type, u8 version)
75 &bat_priv->tvlv.handler_list, list) {
121 * @bat_priv: the bat priv with all the soft interface information
131 batadv_tvlv_container_get(struct batadv_priv *bat_priv, u8 type, u8 version)
135 lockdep_assert_held(&bat_priv->tvlv.container_list_lock);
137 hlist_for_each_entry(tvlv_tmp, &bat_priv->tvlv.container_list, list) {
155 * @bat_priv: the bat priv with all the soft interface information
162 static u16 batadv_tvlv_container_list_size(struct batadv_priv *bat_priv)
167 lockdep_assert_held(&bat_priv->tvlv.container_list_lock);
169 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) {
180 * @bat_priv: the bat priv with all the soft interface information
186 static void batadv_tvlv_container_remove(struct batadv_priv *bat_priv,
189 lockdep_assert_held(&bat_priv->tvlv.container_list_lock);
204 * @bat_priv: the bat priv with all the soft interface information
208 void batadv_tvlv_container_unregister(struct batadv_priv *bat_priv,
213 spin_lock_bh(&bat_priv->tvlv.container_list_lock);
214 tvlv = batadv_tvlv_container_get(bat_priv, type, version);
215 batadv_tvlv_container_remove(bat_priv, tvlv);
216 spin_unlock_bh(&bat_priv->tvlv.container_list_lock);
222 * @bat_priv: the bat priv with all the soft interface information
231 void batadv_tvlv_container_register(struct batadv_priv *bat_priv,
252 spin_lock_bh(&bat_priv->tvlv.container_list_lock);
253 tvlv_old = batadv_tvlv_container_get(bat_priv, type, version);
254 batadv_tvlv_container_remove(bat_priv, tvlv_old);
257 hlist_add_head(&tvlv_new->list, &bat_priv->tvlv.container_list);
258 spin_unlock_bh(&bat_priv->tvlv.container_list_lock);
300 * @bat_priv: the bat priv with all the soft interface information
311 u16 batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv,
321 spin_lock_bh(&bat_priv->tvlv.container_list_lock);
322 tvlv_value_len = batadv_tvlv_container_list_size(bat_priv);
335 hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) {
346 spin_unlock_bh(&bat_priv->tvlv.container_list_lock);
353 * @bat_priv: the bat priv with all the soft interface information
365 static int batadv_tvlv_call_handler(struct batadv_priv *bat_priv,
382 tvlv_handler->ogm_handler(bat_priv, orig_node,
396 return tvlv_handler->unicast_handler(bat_priv, src,
407 * @bat_priv: the bat priv with all the soft interface information
418 int batadv_tvlv_containers_process(struct batadv_priv *bat_priv,
439 tvlv_handler = batadv_tvlv_handler_get(bat_priv,
443 ret |= batadv_tvlv_call_handler(bat_priv, tvlv_handler,
458 &bat_priv->tvlv.handler_list, list) {
461 tvlv_handler->ogm_handler(bat_priv, orig_node,
474 * @bat_priv: the bat priv with all the soft interface information
478 void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv,
494 batadv_tvlv_containers_process(bat_priv, true, orig_node, NULL, NULL,
502 * @bat_priv: the bat priv with all the soft interface information
512 void batadv_tvlv_handler_register(struct batadv_priv *bat_priv,
513 void (*optr)(struct batadv_priv *bat_priv,
518 int (*uptr)(struct batadv_priv *bat_priv,
526 spin_lock_bh(&bat_priv->tvlv.handler_list_lock);
528 tvlv_handler = batadv_tvlv_handler_get(bat_priv, type, version);
530 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock);
537 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock);
550 hlist_add_head_rcu(&tvlv_handler->list, &bat_priv->tvlv.handler_list);
551 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock);
560 * @bat_priv: the bat priv with all the soft interface information
564 void batadv_tvlv_handler_unregister(struct batadv_priv *bat_priv,
569 tvlv_handler = batadv_tvlv_handler_get(bat_priv, type, version);
574 spin_lock_bh(&bat_priv->tvlv.handler_list_lock);
576 spin_unlock_bh(&bat_priv->tvlv.handler_list_lock);
583 * @bat_priv: the bat priv with all the soft interface information
591 void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, u8 *src,
603 orig_node = batadv_orig_hash_find(bat_priv, dst);