• Home
  • Raw
  • Download

Lines Matching refs:node

43 	struct hsr_node *node;  in hsr_addr_is_self()  local
45 node = list_first_or_null_rcu(&hsr->self_node_db, struct hsr_node, in hsr_addr_is_self()
47 if (!node) { in hsr_addr_is_self()
52 if (ether_addr_equal(addr, node->macaddress_A)) in hsr_addr_is_self()
54 if (ether_addr_equal(addr, node->macaddress_B)) in hsr_addr_is_self()
65 struct hsr_node *node; in find_node_by_addr_A() local
67 list_for_each_entry_rcu(node, node_db, mac_list) { in find_node_by_addr_A()
68 if (ether_addr_equal(node->macaddress_A, addr)) in find_node_by_addr_A()
69 return node; in find_node_by_addr_A()
83 struct hsr_node *node, *oldnode; in hsr_create_self_node() local
85 node = kmalloc(sizeof(*node), GFP_KERNEL); in hsr_create_self_node()
86 if (!node) in hsr_create_self_node()
89 ether_addr_copy(node->macaddress_A, addr_a); in hsr_create_self_node()
90 ether_addr_copy(node->macaddress_B, addr_b); in hsr_create_self_node()
96 list_replace_rcu(&oldnode->mac_list, &node->mac_list); in hsr_create_self_node()
100 list_add_tail_rcu(&node->mac_list, self_node_db); in hsr_create_self_node()
110 struct hsr_node *node; in hsr_del_self_node() local
113 node = list_first_or_null_rcu(self_node_db, struct hsr_node, mac_list); in hsr_del_self_node()
114 if (node) { in hsr_del_self_node()
115 list_del_rcu(&node->mac_list); in hsr_del_self_node()
116 kfree_rcu(node, rcu_head); in hsr_del_self_node()
123 struct hsr_node *node; in hsr_del_nodes() local
126 list_for_each_entry_safe(node, tmp, node_db, mac_list) in hsr_del_nodes()
127 kfree(node); in hsr_del_nodes()
131 struct hsr_node *node) in prp_handle_san_frame() argument
135 node->san_a = true; in prp_handle_san_frame()
140 node->san_b = true; in prp_handle_san_frame()
153 struct hsr_node *new_node, *node; in hsr_add_node() local
179 list_for_each_entry_rcu(node, node_db, mac_list, in hsr_add_node()
181 if (ether_addr_equal(node->macaddress_A, addr)) in hsr_add_node()
183 if (ether_addr_equal(node->macaddress_B, addr)) in hsr_add_node()
192 return node; in hsr_add_node()
195 void prp_update_san_info(struct hsr_node *node, bool is_sup) in prp_update_san_info() argument
200 node->san_a = false; in prp_update_san_info()
201 node->san_b = false; in prp_update_san_info()
211 struct hsr_node *node; in hsr_get_node() local
222 list_for_each_entry_rcu(node, node_db, mac_list) { in hsr_get_node()
223 if (ether_addr_equal(node->macaddress_A, ethhdr->h_source)) { in hsr_get_node()
225 hsr->proto_ops->update_san_info(node, is_sup); in hsr_get_node()
226 return node; in hsr_get_node()
228 if (ether_addr_equal(node->macaddress_B, ethhdr->h_source)) { in hsr_get_node()
230 hsr->proto_ops->update_san_info(node, is_sup); in hsr_get_node()
231 return node; in hsr_get_node()
353 void hsr_addr_subst_source(struct hsr_node *node, struct sk_buff *skb) in hsr_addr_subst_source() argument
360 memcpy(&eth_hdr(skb)->h_source, node->macaddress_A, ETH_ALEN); in hsr_addr_subst_source()
399 void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port, in hsr_register_frame_in() argument
407 seq_nr_before(sequence_nr, node->seq_out[port->type])) in hsr_register_frame_in()
410 node->time_in[port->type] = jiffies; in hsr_register_frame_in()
411 node->time_in_stale[port->type] = false; in hsr_register_frame_in()
422 int hsr_register_frame_out(struct hsr_port *port, struct hsr_node *node, in hsr_register_frame_out() argument
425 spin_lock_bh(&node->seq_out_lock); in hsr_register_frame_out()
426 if (seq_nr_before_or_eq(sequence_nr, node->seq_out[port->type]) && in hsr_register_frame_out()
427 time_is_after_jiffies(node->time_out[port->type] + in hsr_register_frame_out()
429 spin_unlock_bh(&node->seq_out_lock); in hsr_register_frame_out()
433 node->time_out[port->type] = jiffies; in hsr_register_frame_out()
434 node->seq_out[port->type] = sequence_nr; in hsr_register_frame_out()
435 spin_unlock_bh(&node->seq_out_lock); in hsr_register_frame_out()
440 struct hsr_node *node) in get_late_port() argument
442 if (node->time_in_stale[HSR_PT_SLAVE_A]) in get_late_port()
444 if (node->time_in_stale[HSR_PT_SLAVE_B]) in get_late_port()
447 if (time_after(node->time_in[HSR_PT_SLAVE_B], in get_late_port()
448 node->time_in[HSR_PT_SLAVE_A] + in get_late_port()
451 if (time_after(node->time_in[HSR_PT_SLAVE_A], in get_late_port()
452 node->time_in[HSR_PT_SLAVE_B] + in get_late_port()
465 struct hsr_node *node; in hsr_prune_nodes() local
472 list_for_each_entry_safe(node, tmp, &hsr->node_db, mac_list) { in hsr_prune_nodes()
478 if (hsr_addr_is_self(hsr, node->macaddress_A)) in hsr_prune_nodes()
482 time_a = node->time_in[HSR_PT_SLAVE_A]; in hsr_prune_nodes()
483 time_b = node->time_in[HSR_PT_SLAVE_B]; in hsr_prune_nodes()
487 node->time_in_stale[HSR_PT_SLAVE_A] = true; in hsr_prune_nodes()
489 node->time_in_stale[HSR_PT_SLAVE_B] = true; in hsr_prune_nodes()
496 if (node->time_in_stale[HSR_PT_SLAVE_A] || in hsr_prune_nodes()
497 (!node->time_in_stale[HSR_PT_SLAVE_B] && in hsr_prune_nodes()
505 port = get_late_port(hsr, node); in hsr_prune_nodes()
507 hsr_nl_ringerror(hsr, node->macaddress_A, port); in hsr_prune_nodes()
514 hsr_nl_nodedown(hsr, node->macaddress_A); in hsr_prune_nodes()
515 if (!node->removed) { in hsr_prune_nodes()
516 list_del_rcu(&node->mac_list); in hsr_prune_nodes()
517 node->removed = true; in hsr_prune_nodes()
519 kfree_rcu(node, rcu_head); in hsr_prune_nodes()
533 struct hsr_node *node; in hsr_get_next_node() local
536 node = list_first_or_null_rcu(&hsr->node_db, in hsr_get_next_node()
538 if (node) in hsr_get_next_node()
539 ether_addr_copy(addr, node->macaddress_A); in hsr_get_next_node()
540 return node; in hsr_get_next_node()
543 node = _pos; in hsr_get_next_node()
544 list_for_each_entry_continue_rcu(node, &hsr->node_db, mac_list) { in hsr_get_next_node()
545 ether_addr_copy(addr, node->macaddress_A); in hsr_get_next_node()
546 return node; in hsr_get_next_node()
561 struct hsr_node *node; in hsr_get_node_data() local
565 node = find_node_by_addr_A(&hsr->node_db, addr); in hsr_get_node_data()
566 if (!node) in hsr_get_node_data()
569 ether_addr_copy(addr_b, node->macaddress_B); in hsr_get_node_data()
571 tdiff = jiffies - node->time_in[HSR_PT_SLAVE_A]; in hsr_get_node_data()
572 if (node->time_in_stale[HSR_PT_SLAVE_A]) in hsr_get_node_data()
581 tdiff = jiffies - node->time_in[HSR_PT_SLAVE_B]; in hsr_get_node_data()
582 if (node->time_in_stale[HSR_PT_SLAVE_B]) in hsr_get_node_data()
592 *if1_seq = node->seq_out[HSR_PT_SLAVE_B]; in hsr_get_node_data()
593 *if2_seq = node->seq_out[HSR_PT_SLAVE_A]; in hsr_get_node_data()
595 if (node->addr_B_port != HSR_PT_NONE) { in hsr_get_node_data()
596 port = hsr_port_get_hsr(hsr, node->addr_B_port); in hsr_get_node_data()