Lines Matching refs:orig_node
62 struct batadv_orig_node *orig_node, *orig_node_tmp = NULL; in batadv_orig_hash_find() local
72 hlist_for_each_entry_rcu(orig_node, head, hash_entry) { in batadv_orig_hash_find()
73 if (!batadv_compare_eth(orig_node, data)) in batadv_orig_hash_find()
76 if (!kref_get_unless_zero(&orig_node->refcount)) in batadv_orig_hash_find()
79 orig_node_tmp = orig_node; in batadv_orig_hash_find()
113 batadv_orig_node_vlan_get(struct batadv_orig_node *orig_node, in batadv_orig_node_vlan_get() argument
119 hlist_for_each_entry_rcu(tmp, &orig_node->vlan_list, list) { in batadv_orig_node_vlan_get()
148 batadv_orig_node_vlan_new(struct batadv_orig_node *orig_node, in batadv_orig_node_vlan_new() argument
153 spin_lock_bh(&orig_node->vlan_list_lock); in batadv_orig_node_vlan_new()
156 vlan = batadv_orig_node_vlan_get(orig_node, vid); in batadv_orig_node_vlan_new()
168 hlist_add_head_rcu(&vlan->list, &orig_node->vlan_list); in batadv_orig_node_vlan_new()
171 spin_unlock_bh(&orig_node->vlan_list_lock); in batadv_orig_node_vlan_new()
293 batadv_orig_router_get(struct batadv_orig_node *orig_node, in batadv_orig_router_get() argument
300 hlist_for_each_entry_rcu(orig_ifinfo, &orig_node->ifinfo_list, list) { in batadv_orig_router_get()
325 batadv_orig_ifinfo_get(struct batadv_orig_node *orig_node, in batadv_orig_ifinfo_get() argument
331 hlist_for_each_entry_rcu(tmp, &orig_node->ifinfo_list, in batadv_orig_ifinfo_get()
359 batadv_orig_ifinfo_new(struct batadv_orig_node *orig_node, in batadv_orig_ifinfo_new() argument
365 spin_lock_bh(&orig_node->neigh_list_lock); in batadv_orig_ifinfo_new()
367 orig_ifinfo = batadv_orig_ifinfo_get(orig_node, if_outgoing); in batadv_orig_ifinfo_new()
387 &orig_node->ifinfo_list); in batadv_orig_ifinfo_new()
389 spin_unlock_bh(&orig_node->neigh_list_lock); in batadv_orig_ifinfo_new()
481 batadv_neigh_node_get(const struct batadv_orig_node *orig_node, in batadv_neigh_node_get() argument
488 hlist_for_each_entry_rcu(tmp_neigh_node, &orig_node->neigh_list, list) { in batadv_neigh_node_get()
517 struct batadv_orig_node *orig_node) in batadv_hardif_neigh_create() argument
536 ether_addr_copy(hardif_neigh->orig, orig_node->orig); in batadv_hardif_neigh_create()
564 struct batadv_orig_node *orig_node) in batadv_hardif_neigh_get_or_create() argument
573 return batadv_hardif_neigh_create(hard_iface, neigh_addr, orig_node); in batadv_hardif_neigh_get_or_create()
619 batadv_neigh_node_create(struct batadv_orig_node *orig_node, in batadv_neigh_node_create() argument
626 spin_lock_bh(&orig_node->neigh_list_lock); in batadv_neigh_node_create()
628 neigh_node = batadv_neigh_node_get(orig_node, hard_iface, neigh_addr); in batadv_neigh_node_create()
633 neigh_addr, orig_node); in batadv_neigh_node_create()
648 neigh_node->orig_node = orig_node; in batadv_neigh_node_create()
659 hlist_add_head_rcu(&neigh_node->list, &orig_node->neigh_list); in batadv_neigh_node_create()
661 batadv_dbg(BATADV_DBG_BATMAN, orig_node->bat_priv, in batadv_neigh_node_create()
663 neigh_addr, orig_node->orig, hard_iface->net_dev->name); in batadv_neigh_node_create()
666 spin_unlock_bh(&orig_node->neigh_list_lock); in batadv_neigh_node_create()
682 batadv_neigh_node_get_or_create(struct batadv_orig_node *orig_node, in batadv_neigh_node_get_or_create() argument
689 neigh_node = batadv_neigh_node_get(orig_node, hard_iface, neigh_addr); in batadv_neigh_node_get_or_create()
693 return batadv_neigh_node_create(orig_node, hard_iface, neigh_addr); in batadv_neigh_node_get_or_create()
838 struct batadv_orig_node *orig_node; in batadv_orig_node_free_rcu() local
840 orig_node = container_of(rcu, struct batadv_orig_node, rcu); in batadv_orig_node_free_rcu()
842 batadv_mcast_purge_orig(orig_node); in batadv_orig_node_free_rcu()
844 batadv_frag_purge_orig(orig_node, NULL); in batadv_orig_node_free_rcu()
846 kfree(orig_node->tt_buff); in batadv_orig_node_free_rcu()
847 kfree(orig_node); in batadv_orig_node_free_rcu()
859 struct batadv_orig_node *orig_node; in batadv_orig_node_release() local
864 orig_node = container_of(ref, struct batadv_orig_node, refcount); in batadv_orig_node_release()
866 spin_lock_bh(&orig_node->neigh_list_lock); in batadv_orig_node_release()
870 &orig_node->neigh_list, list) { in batadv_orig_node_release()
876 &orig_node->ifinfo_list, list) { in batadv_orig_node_release()
881 last_candidate = orig_node->last_bonding_candidate; in batadv_orig_node_release()
882 orig_node->last_bonding_candidate = NULL; in batadv_orig_node_release()
883 spin_unlock_bh(&orig_node->neigh_list_lock); in batadv_orig_node_release()
888 spin_lock_bh(&orig_node->vlan_list_lock); in batadv_orig_node_release()
889 hlist_for_each_entry_safe(vlan, node_tmp, &orig_node->vlan_list, list) { in batadv_orig_node_release()
893 spin_unlock_bh(&orig_node->vlan_list_lock); in batadv_orig_node_release()
896 batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL); in batadv_orig_node_release()
898 call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu); in batadv_orig_node_release()
911 struct batadv_orig_node *orig_node; in batadv_originator_free() local
926 hlist_for_each_entry_safe(orig_node, node_tmp, in batadv_originator_free()
928 hlist_del_rcu(&orig_node->hash_entry); in batadv_originator_free()
929 batadv_orig_node_put(orig_node); in batadv_originator_free()
950 struct batadv_orig_node *orig_node; in batadv_orig_node_new() local
958 orig_node = kzalloc(sizeof(*orig_node), GFP_ATOMIC); in batadv_orig_node_new()
959 if (!orig_node) in batadv_orig_node_new()
962 INIT_HLIST_HEAD(&orig_node->neigh_list); in batadv_orig_node_new()
963 INIT_HLIST_HEAD(&orig_node->vlan_list); in batadv_orig_node_new()
964 INIT_HLIST_HEAD(&orig_node->ifinfo_list); in batadv_orig_node_new()
965 spin_lock_init(&orig_node->bcast_seqno_lock); in batadv_orig_node_new()
966 spin_lock_init(&orig_node->neigh_list_lock); in batadv_orig_node_new()
967 spin_lock_init(&orig_node->tt_buff_lock); in batadv_orig_node_new()
968 spin_lock_init(&orig_node->tt_lock); in batadv_orig_node_new()
969 spin_lock_init(&orig_node->vlan_list_lock); in batadv_orig_node_new()
971 batadv_nc_init_orig(orig_node); in batadv_orig_node_new()
974 kref_init(&orig_node->refcount); in batadv_orig_node_new()
976 orig_node->bat_priv = bat_priv; in batadv_orig_node_new()
977 ether_addr_copy(orig_node->orig, addr); in batadv_orig_node_new()
978 batadv_dat_init_orig_node_addr(orig_node); in batadv_orig_node_new()
979 atomic_set(&orig_node->last_ttvn, 0); in batadv_orig_node_new()
980 orig_node->tt_buff = NULL; in batadv_orig_node_new()
981 orig_node->tt_buff_len = 0; in batadv_orig_node_new()
982 orig_node->last_seen = jiffies; in batadv_orig_node_new()
984 orig_node->bcast_seqno_reset = reset_time; in batadv_orig_node_new()
987 orig_node->mcast_flags = BATADV_MCAST_WANT_NO_RTR4; in batadv_orig_node_new()
988 orig_node->mcast_flags |= BATADV_MCAST_WANT_NO_RTR6; in batadv_orig_node_new()
989 INIT_HLIST_NODE(&orig_node->mcast_want_all_unsnoopables_node); in batadv_orig_node_new()
990 INIT_HLIST_NODE(&orig_node->mcast_want_all_ipv4_node); in batadv_orig_node_new()
991 INIT_HLIST_NODE(&orig_node->mcast_want_all_ipv6_node); in batadv_orig_node_new()
992 spin_lock_init(&orig_node->mcast_handler_lock); in batadv_orig_node_new()
996 vlan = batadv_orig_node_vlan_new(orig_node, BATADV_NO_FLAGS); in batadv_orig_node_new()
1006 INIT_HLIST_HEAD(&orig_node->fragments[i].fragment_list); in batadv_orig_node_new()
1007 spin_lock_init(&orig_node->fragments[i].lock); in batadv_orig_node_new()
1008 orig_node->fragments[i].size = 0; in batadv_orig_node_new()
1011 return orig_node; in batadv_orig_node_new()
1013 kfree(orig_node); in batadv_orig_node_new()
1067 struct batadv_orig_node *orig_node) in batadv_purge_orig_ifinfo() argument
1074 spin_lock_bh(&orig_node->neigh_list_lock); in batadv_purge_orig_ifinfo()
1078 &orig_node->ifinfo_list, list) { in batadv_purge_orig_ifinfo()
1093 orig_node->orig, if_outgoing->net_dev->name); in batadv_purge_orig_ifinfo()
1099 if (orig_node->last_bonding_candidate == orig_ifinfo) { in batadv_purge_orig_ifinfo()
1100 orig_node->last_bonding_candidate = NULL; in batadv_purge_orig_ifinfo()
1105 spin_unlock_bh(&orig_node->neigh_list_lock); in batadv_purge_orig_ifinfo()
1119 struct batadv_orig_node *orig_node) in batadv_purge_orig_neighbors() argument
1127 spin_lock_bh(&orig_node->neigh_list_lock); in batadv_purge_orig_neighbors()
1131 &orig_node->neigh_list, list) { in batadv_purge_orig_neighbors()
1144 orig_node->orig, neigh_node->addr, in batadv_purge_orig_neighbors()
1149 orig_node->orig, neigh_node->addr, in batadv_purge_orig_neighbors()
1164 spin_unlock_bh(&orig_node->neigh_list_lock); in batadv_purge_orig_neighbors()
1178 struct batadv_orig_node *orig_node, in batadv_find_best_neighbor() argument
1185 hlist_for_each_entry_rcu(neigh, &orig_node->neigh_list, list) { in batadv_find_best_neighbor()
1214 struct batadv_orig_node *orig_node) in batadv_purge_orig_node() argument
1220 if (batadv_has_timed_out(orig_node->last_seen, in batadv_purge_orig_node()
1224 orig_node->orig, in batadv_purge_orig_node()
1225 jiffies_to_msecs(orig_node->last_seen)); in batadv_purge_orig_node()
1228 changed_ifinfo = batadv_purge_orig_ifinfo(bat_priv, orig_node); in batadv_purge_orig_node()
1229 changed_neigh = batadv_purge_orig_neighbors(bat_priv, orig_node); in batadv_purge_orig_node()
1235 best_neigh_node = batadv_find_best_neighbor(bat_priv, orig_node, in batadv_purge_orig_node()
1237 batadv_update_route(bat_priv, orig_node, BATADV_IF_DEFAULT, in batadv_purge_orig_node()
1255 orig_node, in batadv_purge_orig_node()
1257 batadv_update_route(bat_priv, orig_node, hard_iface, in batadv_purge_orig_node()
1279 struct batadv_orig_node *orig_node; in batadv_purge_orig_ref() local
1291 hlist_for_each_entry_safe(orig_node, node_tmp, in batadv_purge_orig_ref()
1293 if (batadv_purge_orig_node(bat_priv, orig_node)) { in batadv_purge_orig_ref()
1294 batadv_gw_node_delete(bat_priv, orig_node); in batadv_purge_orig_ref()
1295 hlist_del_rcu(&orig_node->hash_entry); in batadv_purge_orig_ref()
1296 batadv_tt_global_del_orig(orig_node->bat_priv, in batadv_purge_orig_ref()
1297 orig_node, -1, in batadv_purge_orig_ref()
1299 batadv_orig_node_put(orig_node); in batadv_purge_orig_ref()
1303 batadv_frag_purge_orig(orig_node, in batadv_purge_orig_ref()