Lines Matching refs:gw_node

59  * batadv_gw_node_release() - release gw_node from lists and queue for free
61 * @ref: kref pointer of the gw_node
65 struct batadv_gw_node *gw_node;
67 gw_node = container_of(ref, struct batadv_gw_node, refcount);
69 batadv_orig_node_put(gw_node->orig_node);
70 kfree_rcu(gw_node, rcu);
82 struct batadv_gw_node *gw_node;
85 gw_node = rcu_dereference(bat_priv->gw.curr_gw);
86 if (!gw_node)
89 if (!kref_get_unless_zero(&gw_node->refcount))
90 gw_node = NULL;
94 return gw_node;
106 struct batadv_gw_node *gw_node;
109 gw_node = batadv_gw_get_selected_gw_node(bat_priv);
110 if (!gw_node)
114 orig_node = gw_node->orig_node;
124 batadv_gw_node_put(gw_node);
329 struct batadv_gw_node *gw_node;
336 gw_node = kzalloc(sizeof(*gw_node), GFP_ATOMIC);
337 if (!gw_node)
340 kref_init(&gw_node->refcount);
341 INIT_HLIST_NODE(&gw_node->list);
343 gw_node->orig_node = orig_node;
344 gw_node->bandwidth_down = ntohl(gateway->bandwidth_down);
345 gw_node->bandwidth_up = ntohl(gateway->bandwidth_up);
347 kref_get(&gw_node->refcount);
348 hlist_add_head_rcu(&gw_node->list, &bat_priv->gw.gateway_list);
359 /* don't return reference to new gw_node */
360 batadv_gw_node_put(gw_node);
373 struct batadv_gw_node *gw_node_tmp, *gw_node = NULL;
384 gw_node = gw_node_tmp;
389 return gw_node;
403 struct batadv_gw_node *gw_node, *curr_gw = NULL;
406 gw_node = batadv_gw_node_get(bat_priv, orig_node);
407 if (!gw_node) {
414 if (gw_node->bandwidth_down == ntohl(gateway->bandwidth_down) &&
415 gw_node->bandwidth_up == ntohl(gateway->bandwidth_up))
421 gw_node->bandwidth_down / 10,
422 gw_node->bandwidth_down % 10,
423 gw_node->bandwidth_up / 10,
424 gw_node->bandwidth_up % 10,
430 gw_node->bandwidth_down = ntohl(gateway->bandwidth_down);
431 gw_node->bandwidth_up = ntohl(gateway->bandwidth_up);
442 if (!hlist_unhashed(&gw_node->list)) {
443 hlist_del_init_rcu(&gw_node->list);
444 batadv_gw_node_put(gw_node);
450 if (gw_node == curr_gw)
457 batadv_gw_node_put(gw_node);
482 struct batadv_gw_node *gw_node;
486 hlist_for_each_entry_safe(gw_node, node_tmp,
488 hlist_del_init_rcu(&gw_node->list);
489 batadv_gw_node_put(gw_node);
689 struct batadv_gw_node *gw_node = NULL;
707 gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);
708 if (!gw_node)
765 batadv_gw_node_put(gw_node);