Lines Matching refs:node
73 struct hsr_node *node; in find_node_by_addr_A() local
75 list_for_each_entry_rcu(node, node_db, mac_list) { in find_node_by_addr_A()
76 if (ether_addr_equal(node->macaddress_A, addr)) in find_node_by_addr_A()
77 return node; in find_node_by_addr_A()
131 struct hsr_node *node; in hsr_del_nodes() local
134 list_for_each_entry_safe(node, tmp, node_db, mac_list) in hsr_del_nodes()
135 kfree(node); in hsr_del_nodes()
139 struct hsr_node *node) in prp_handle_san_frame() argument
143 node->san_a = true; in prp_handle_san_frame()
148 node->san_b = true; in prp_handle_san_frame()
161 struct hsr_node *new_node, *node; in hsr_add_node() local
190 list_for_each_entry_rcu(node, node_db, mac_list, in hsr_add_node()
192 if (ether_addr_equal(node->macaddress_A, addr)) in hsr_add_node()
194 if (ether_addr_equal(node->macaddress_B, addr)) in hsr_add_node()
203 return node; in hsr_add_node()
206 void prp_update_san_info(struct hsr_node *node, bool is_sup) in prp_update_san_info() argument
211 node->san_a = false; in prp_update_san_info()
212 node->san_b = false; in prp_update_san_info()
222 struct hsr_node *node; in hsr_get_node() local
233 list_for_each_entry_rcu(node, node_db, mac_list) { in hsr_get_node()
234 if (ether_addr_equal(node->macaddress_A, ethhdr->h_source)) { in hsr_get_node()
236 hsr->proto_ops->update_san_info(node, is_sup); in hsr_get_node()
237 return node; in hsr_get_node()
239 if (ether_addr_equal(node->macaddress_B, ethhdr->h_source)) { in hsr_get_node()
241 hsr->proto_ops->update_san_info(node, is_sup); in hsr_get_node()
242 return node; in hsr_get_node()
247 list_for_each_entry_rcu(node, &hsr->proxy_node_db, mac_list) { in hsr_get_node()
248 if (ether_addr_equal(node->macaddress_A, ethhdr->h_source)) { in hsr_get_node()
250 hsr->proto_ops->update_san_info(node, is_sup); in hsr_get_node()
251 return node; in hsr_get_node()
416 void hsr_addr_subst_source(struct hsr_node *node, struct sk_buff *skb) in hsr_addr_subst_source() argument
423 memcpy(ð_hdr(skb)->h_source, node->macaddress_A, ETH_ALEN); in hsr_addr_subst_source()
466 void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port, in hsr_register_frame_in() argument
474 seq_nr_before(sequence_nr, node->seq_out[port->type])) in hsr_register_frame_in()
477 node->time_in[port->type] = jiffies; in hsr_register_frame_in()
478 node->time_in_stale[port->type] = false; in hsr_register_frame_in()
491 struct hsr_node *node = frame->node_src; in hsr_register_frame_out() local
494 spin_lock_bh(&node->seq_out_lock); in hsr_register_frame_out()
495 if (seq_nr_before_or_eq(sequence_nr, node->seq_out[port->type]) && in hsr_register_frame_out()
496 time_is_after_jiffies(node->time_out[port->type] + in hsr_register_frame_out()
498 spin_unlock_bh(&node->seq_out_lock); in hsr_register_frame_out()
502 node->time_out[port->type] = jiffies; in hsr_register_frame_out()
503 node->seq_out[port->type] = sequence_nr; in hsr_register_frame_out()
504 spin_unlock_bh(&node->seq_out_lock); in hsr_register_frame_out()
531 struct hsr_node *node; in prp_register_frame_out() local
548 node = frame->node_src; in prp_register_frame_out()
555 spin_lock_bh(&node->seq_out_lock); in prp_register_frame_out()
556 if (time_is_before_jiffies(node->time_out[port->type] + in prp_register_frame_out()
558 (node->seq_start[rcv_port] == node->seq_expected[rcv_port] && in prp_register_frame_out()
559 node->seq_start[other_port] == node->seq_expected[other_port])) { in prp_register_frame_out()
563 node->seq_start[rcv_port] = sequence_nr; in prp_register_frame_out()
564 } else if (seq_nr_before(sequence_nr, node->seq_expected[other_port]) && in prp_register_frame_out()
565 seq_nr_before_or_eq(node->seq_start[other_port], sequence_nr)) { in prp_register_frame_out()
569 node->seq_start[other_port] = sequence_exp; in prp_register_frame_out()
570 node->seq_expected[rcv_port] = sequence_exp; in prp_register_frame_out()
571 node->seq_start[rcv_port] = node->seq_expected[rcv_port]; in prp_register_frame_out()
572 spin_unlock_bh(&node->seq_out_lock); in prp_register_frame_out()
579 node->seq_start[other_port] = node->seq_expected[other_port]; in prp_register_frame_out()
580 node->seq_expected[rcv_port] = sequence_exp; in prp_register_frame_out()
581 sequence_diff = sequence_exp - node->seq_start[rcv_port]; in prp_register_frame_out()
583 node->seq_start[rcv_port] = sequence_exp - PRP_DROP_WINDOW_LEN; in prp_register_frame_out()
585 node->time_out[port->type] = jiffies; in prp_register_frame_out()
586 node->seq_out[port->type] = sequence_nr; in prp_register_frame_out()
587 spin_unlock_bh(&node->seq_out_lock); in prp_register_frame_out()
596 struct hsr_node *node) in get_late_port() argument
598 if (node->time_in_stale[HSR_PT_SLAVE_A]) in get_late_port()
600 if (node->time_in_stale[HSR_PT_SLAVE_B]) in get_late_port()
603 if (time_after(node->time_in[HSR_PT_SLAVE_B], in get_late_port()
604 node->time_in[HSR_PT_SLAVE_A] + in get_late_port()
607 if (time_after(node->time_in[HSR_PT_SLAVE_A], in get_late_port()
608 node->time_in[HSR_PT_SLAVE_B] + in get_late_port()
621 struct hsr_node *node; in hsr_prune_nodes() local
628 list_for_each_entry_safe(node, tmp, &hsr->node_db, mac_list) { in hsr_prune_nodes()
634 if (hsr_addr_is_self(hsr, node->macaddress_A)) in hsr_prune_nodes()
638 time_a = node->time_in[HSR_PT_SLAVE_A]; in hsr_prune_nodes()
639 time_b = node->time_in[HSR_PT_SLAVE_B]; in hsr_prune_nodes()
643 node->time_in_stale[HSR_PT_SLAVE_A] = true; in hsr_prune_nodes()
645 node->time_in_stale[HSR_PT_SLAVE_B] = true; in hsr_prune_nodes()
652 if (node->time_in_stale[HSR_PT_SLAVE_A] || in hsr_prune_nodes()
653 (!node->time_in_stale[HSR_PT_SLAVE_B] && in hsr_prune_nodes()
661 port = get_late_port(hsr, node); in hsr_prune_nodes()
663 hsr_nl_ringerror(hsr, node->macaddress_A, port); in hsr_prune_nodes()
670 hsr_nl_nodedown(hsr, node->macaddress_A); in hsr_prune_nodes()
671 if (!node->removed) { in hsr_prune_nodes()
672 list_del_rcu(&node->mac_list); in hsr_prune_nodes()
673 node->removed = true; in hsr_prune_nodes()
675 kfree_rcu(node, rcu_head); in hsr_prune_nodes()
690 struct hsr_node *node; in hsr_prune_proxy_nodes() local
694 list_for_each_entry_safe(node, tmp, &hsr->proxy_node_db, mac_list) { in hsr_prune_proxy_nodes()
696 if (hsr_addr_is_redbox(hsr, node->macaddress_A)) in hsr_prune_proxy_nodes()
699 timestamp = node->time_in[HSR_PT_INTERLINK]; in hsr_prune_proxy_nodes()
704 hsr_nl_nodedown(hsr, node->macaddress_A); in hsr_prune_proxy_nodes()
705 if (!node->removed) { in hsr_prune_proxy_nodes()
706 list_del_rcu(&node->mac_list); in hsr_prune_proxy_nodes()
707 node->removed = true; in hsr_prune_proxy_nodes()
709 kfree_rcu(node, rcu_head); in hsr_prune_proxy_nodes()
724 struct hsr_node *node; in hsr_get_next_node() local
727 node = list_first_or_null_rcu(&hsr->node_db, in hsr_get_next_node()
729 if (node) in hsr_get_next_node()
730 ether_addr_copy(addr, node->macaddress_A); in hsr_get_next_node()
731 return node; in hsr_get_next_node()
734 node = _pos; in hsr_get_next_node()
735 list_for_each_entry_continue_rcu(node, &hsr->node_db, mac_list) { in hsr_get_next_node()
736 ether_addr_copy(addr, node->macaddress_A); in hsr_get_next_node()
737 return node; in hsr_get_next_node()
752 struct hsr_node *node; in hsr_get_node_data() local
756 node = find_node_by_addr_A(&hsr->node_db, addr); in hsr_get_node_data()
757 if (!node) in hsr_get_node_data()
760 ether_addr_copy(addr_b, node->macaddress_B); in hsr_get_node_data()
762 tdiff = jiffies - node->time_in[HSR_PT_SLAVE_A]; in hsr_get_node_data()
763 if (node->time_in_stale[HSR_PT_SLAVE_A]) in hsr_get_node_data()
772 tdiff = jiffies - node->time_in[HSR_PT_SLAVE_B]; in hsr_get_node_data()
773 if (node->time_in_stale[HSR_PT_SLAVE_B]) in hsr_get_node_data()
783 *if1_seq = node->seq_out[HSR_PT_SLAVE_B]; in hsr_get_node_data()
784 *if2_seq = node->seq_out[HSR_PT_SLAVE_A]; in hsr_get_node_data()
786 if (node->addr_B_port != HSR_PT_NONE) { in hsr_get_node_data()
787 port = hsr_port_get_hsr(hsr, node->addr_B_port); in hsr_get_node_data()