Lines Matching refs:tvlv_handler
40 struct batadv_tvlv_handler *tvlv_handler; in batadv_tvlv_handler_release() local
42 tvlv_handler = container_of(ref, struct batadv_tvlv_handler, refcount); in batadv_tvlv_handler_release()
43 kfree_rcu(tvlv_handler, rcu); in batadv_tvlv_handler_release()
51 static void batadv_tvlv_handler_put(struct batadv_tvlv_handler *tvlv_handler) in batadv_tvlv_handler_put() argument
53 if (!tvlv_handler) in batadv_tvlv_handler_put()
56 kref_put(&tvlv_handler->refcount, batadv_tvlv_handler_release); in batadv_tvlv_handler_put()
71 struct batadv_tvlv_handler *tvlv_handler_tmp, *tvlv_handler = NULL; in batadv_tvlv_handler_get() local
85 tvlv_handler = tvlv_handler_tmp; in batadv_tvlv_handler_get()
90 return tvlv_handler; in batadv_tvlv_handler_get()
365 struct batadv_tvlv_handler *tvlv_handler, in batadv_tvlv_call_handler() argument
374 if (!tvlv_handler) in batadv_tvlv_call_handler()
380 if (!tvlv_handler->ogm_handler) in batadv_tvlv_call_handler()
386 tvlv_handler->ogm_handler(bat_priv, orig_node, in batadv_tvlv_call_handler()
389 tvlv_handler->flags |= BATADV_TVLV_HANDLER_OGM_CALLED; in batadv_tvlv_call_handler()
395 if (!tvlv_handler->unicast_handler) in batadv_tvlv_call_handler()
401 return tvlv_handler->unicast_handler(bat_priv, src, in batadv_tvlv_call_handler()
408 if (!tvlv_handler->mcast_handler) in batadv_tvlv_call_handler()
415 return tvlv_handler->mcast_handler(bat_priv, skb); in batadv_tvlv_call_handler()
440 struct batadv_tvlv_handler *tvlv_handler; in batadv_tvlv_containers_process() local
455 tvlv_handler = batadv_tvlv_handler_get(bat_priv, in batadv_tvlv_containers_process()
459 ret |= batadv_tvlv_call_handler(bat_priv, tvlv_handler, in batadv_tvlv_containers_process()
463 batadv_tvlv_handler_put(tvlv_handler); in batadv_tvlv_containers_process()
473 hlist_for_each_entry_rcu(tvlv_handler, in batadv_tvlv_containers_process()
475 if (!tvlv_handler->ogm_handler) in batadv_tvlv_containers_process()
478 if ((tvlv_handler->flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND) && in batadv_tvlv_containers_process()
479 !(tvlv_handler->flags & BATADV_TVLV_HANDLER_OGM_CALLED)) in batadv_tvlv_containers_process()
480 tvlv_handler->ogm_handler(bat_priv, orig_node, in batadv_tvlv_containers_process()
483 tvlv_handler->flags &= ~BATADV_TVLV_HANDLER_OGM_CALLED; in batadv_tvlv_containers_process()
549 struct batadv_tvlv_handler *tvlv_handler; in batadv_tvlv_handler_register() local
553 tvlv_handler = batadv_tvlv_handler_get(bat_priv, type, version); in batadv_tvlv_handler_register()
554 if (tvlv_handler) { in batadv_tvlv_handler_register()
556 batadv_tvlv_handler_put(tvlv_handler); in batadv_tvlv_handler_register()
560 tvlv_handler = kzalloc(sizeof(*tvlv_handler), GFP_ATOMIC); in batadv_tvlv_handler_register()
561 if (!tvlv_handler) { in batadv_tvlv_handler_register()
566 tvlv_handler->ogm_handler = optr; in batadv_tvlv_handler_register()
567 tvlv_handler->unicast_handler = uptr; in batadv_tvlv_handler_register()
568 tvlv_handler->mcast_handler = mptr; in batadv_tvlv_handler_register()
569 tvlv_handler->type = type; in batadv_tvlv_handler_register()
570 tvlv_handler->version = version; in batadv_tvlv_handler_register()
571 tvlv_handler->flags = flags; in batadv_tvlv_handler_register()
572 kref_init(&tvlv_handler->refcount); in batadv_tvlv_handler_register()
573 INIT_HLIST_NODE(&tvlv_handler->list); in batadv_tvlv_handler_register()
575 kref_get(&tvlv_handler->refcount); in batadv_tvlv_handler_register()
576 hlist_add_head_rcu(&tvlv_handler->list, &bat_priv->tvlv.handler_list); in batadv_tvlv_handler_register()
580 batadv_tvlv_handler_put(tvlv_handler); in batadv_tvlv_handler_register()
593 struct batadv_tvlv_handler *tvlv_handler; in batadv_tvlv_handler_unregister() local
595 tvlv_handler = batadv_tvlv_handler_get(bat_priv, type, version); in batadv_tvlv_handler_unregister()
596 if (!tvlv_handler) in batadv_tvlv_handler_unregister()
599 batadv_tvlv_handler_put(tvlv_handler); in batadv_tvlv_handler_unregister()
601 hlist_del_rcu(&tvlv_handler->list); in batadv_tvlv_handler_unregister()
603 batadv_tvlv_handler_put(tvlv_handler); in batadv_tvlv_handler_unregister()