.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
1 | 2 | /* Copyright 2011-2014 Autronica Fire and Security AS |
---|
2 | | - * |
---|
3 | | - * This program is free software; you can redistribute it and/or modify it |
---|
4 | | - * under the terms of the GNU General Public License as published by the Free |
---|
5 | | - * Software Foundation; either version 2 of the License, or (at your option) |
---|
6 | | - * any later version. |
---|
7 | 3 | * |
---|
8 | 4 | * Author(s): |
---|
9 | 5 | * 2011-2014 Arvid Brodin, arvid.brodin@alten.se |
---|
| 6 | + * |
---|
| 7 | + * include file for HSR and PRP. |
---|
10 | 8 | */ |
---|
11 | 9 | |
---|
12 | 10 | #ifndef __HSR_FRAMEREG_H |
---|
.. | .. |
---|
16 | 14 | |
---|
17 | 15 | struct hsr_node; |
---|
18 | 16 | |
---|
19 | | -void hsr_del_node(struct list_head *self_node_db); |
---|
20 | | -struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[], |
---|
21 | | - u16 seq_out); |
---|
22 | | -struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, |
---|
23 | | - bool is_sup); |
---|
24 | | -void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, |
---|
25 | | - struct hsr_port *port); |
---|
| 17 | +struct hsr_frame_info { |
---|
| 18 | + struct sk_buff *skb_std; |
---|
| 19 | + struct sk_buff *skb_hsr; |
---|
| 20 | + struct sk_buff *skb_prp; |
---|
| 21 | + struct hsr_port *port_rcv; |
---|
| 22 | + struct hsr_node *node_src; |
---|
| 23 | + u16 sequence_nr; |
---|
| 24 | + bool is_supervision; |
---|
| 25 | + bool is_vlan; |
---|
| 26 | + bool is_local_dest; |
---|
| 27 | + bool is_local_exclusive; |
---|
| 28 | + bool is_from_san; |
---|
| 29 | +}; |
---|
| 30 | + |
---|
| 31 | +void hsr_del_self_node(struct hsr_priv *hsr); |
---|
| 32 | +void hsr_del_nodes(struct list_head *node_db); |
---|
| 33 | +struct hsr_node *hsr_get_node(struct hsr_port *port, struct list_head *node_db, |
---|
| 34 | + struct sk_buff *skb, bool is_sup, |
---|
| 35 | + enum hsr_port_type rx_port); |
---|
| 36 | +void hsr_handle_sup_frame(struct hsr_frame_info *frame); |
---|
26 | 37 | bool hsr_addr_is_self(struct hsr_priv *hsr, unsigned char *addr); |
---|
27 | 38 | |
---|
28 | 39 | void hsr_addr_subst_source(struct hsr_node *node, struct sk_buff *skb); |
---|
.. | .. |
---|
36 | 47 | |
---|
37 | 48 | void hsr_prune_nodes(struct timer_list *t); |
---|
38 | 49 | |
---|
39 | | -int hsr_create_self_node(struct list_head *self_node_db, |
---|
| 50 | +int hsr_create_self_node(struct hsr_priv *hsr, |
---|
40 | 51 | unsigned char addr_a[ETH_ALEN], |
---|
41 | 52 | unsigned char addr_b[ETH_ALEN]); |
---|
42 | 53 | |
---|
.. | .. |
---|
52 | 63 | int *if2_age, |
---|
53 | 64 | u16 *if2_seq); |
---|
54 | 65 | |
---|
| 66 | +void prp_handle_san_frame(bool san, enum hsr_port_type port, |
---|
| 67 | + struct hsr_node *node); |
---|
| 68 | +void prp_update_san_info(struct hsr_node *node, bool is_sup); |
---|
| 69 | + |
---|
| 70 | +struct hsr_node { |
---|
| 71 | + struct list_head mac_list; |
---|
| 72 | + unsigned char macaddress_A[ETH_ALEN]; |
---|
| 73 | + unsigned char macaddress_B[ETH_ALEN]; |
---|
| 74 | + /* Local slave through which AddrB frames are received from this node */ |
---|
| 75 | + enum hsr_port_type addr_B_port; |
---|
| 76 | + unsigned long time_in[HSR_PT_PORTS]; |
---|
| 77 | + bool time_in_stale[HSR_PT_PORTS]; |
---|
| 78 | + unsigned long time_out[HSR_PT_PORTS]; |
---|
| 79 | + /* if the node is a SAN */ |
---|
| 80 | + bool san_a; |
---|
| 81 | + bool san_b; |
---|
| 82 | + u16 seq_out[HSR_PT_PORTS]; |
---|
| 83 | + struct rcu_head rcu_head; |
---|
| 84 | +}; |
---|
| 85 | + |
---|
55 | 86 | #endif /* __HSR_FRAMEREG_H */ |
---|