0001
0002
0003 #ifndef _BR_PRIVATE_CFM_H_
0004 #define _BR_PRIVATE_CFM_H_
0005
0006 #include "br_private.h"
0007 #include <uapi/linux/cfm_bridge.h>
0008
0009 struct br_cfm_mep_create {
0010 enum br_cfm_domain domain;
0011 enum br_cfm_mep_direction direction;
0012 u32 ifindex;
0013 };
0014
0015 int br_cfm_mep_create(struct net_bridge *br,
0016 const u32 instance,
0017 struct br_cfm_mep_create *const create,
0018 struct netlink_ext_ack *extack);
0019
0020 int br_cfm_mep_delete(struct net_bridge *br,
0021 const u32 instance,
0022 struct netlink_ext_ack *extack);
0023
0024 struct br_cfm_mep_config {
0025 u32 mdlevel;
0026 u32 mepid;
0027 struct mac_addr unicast_mac;
0028 };
0029
0030 int br_cfm_mep_config_set(struct net_bridge *br,
0031 const u32 instance,
0032 const struct br_cfm_mep_config *const config,
0033 struct netlink_ext_ack *extack);
0034
0035 struct br_cfm_maid {
0036 u8 data[CFM_MAID_LENGTH];
0037 };
0038
0039 struct br_cfm_cc_config {
0040
0041 struct br_cfm_maid exp_maid;
0042
0043
0044
0045 enum br_cfm_ccm_interval exp_interval;
0046
0047 bool enable;
0048 };
0049
0050 int br_cfm_cc_config_set(struct net_bridge *br,
0051 const u32 instance,
0052 const struct br_cfm_cc_config *const config,
0053 struct netlink_ext_ack *extack);
0054
0055 int br_cfm_cc_peer_mep_add(struct net_bridge *br, const u32 instance,
0056 u32 peer_mep_id,
0057 struct netlink_ext_ack *extack);
0058 int br_cfm_cc_peer_mep_remove(struct net_bridge *br, const u32 instance,
0059 u32 peer_mep_id,
0060 struct netlink_ext_ack *extack);
0061
0062
0063
0064
0065
0066 int br_cfm_cc_rdi_set(struct net_bridge *br, const u32 instance,
0067 const bool rdi, struct netlink_ext_ack *extack);
0068
0069
0070 struct br_cfm_cc_ccm_tx_info {
0071 struct mac_addr dmac;
0072
0073
0074
0075
0076 u32 period;
0077
0078 bool seq_no_update;
0079 bool if_tlv;
0080 u8 if_tlv_value;
0081 bool port_tlv;
0082 u8 port_tlv_value;
0083
0084
0085
0086 };
0087
0088 int br_cfm_cc_ccm_tx(struct net_bridge *br, const u32 instance,
0089 const struct br_cfm_cc_ccm_tx_info *const tx_info,
0090 struct netlink_ext_ack *extack);
0091
0092 struct br_cfm_mep_status {
0093
0094 bool opcode_unexp_seen;
0095 bool version_unexp_seen;
0096 bool rx_level_low_seen;
0097 };
0098
0099 struct br_cfm_cc_peer_status {
0100
0101 u8 port_tlv_value;
0102 u8 if_tlv_value;
0103
0104
0105 u8 ccm_defect:1;
0106
0107
0108 u8 rdi:1;
0109
0110
0111 u8 seen:1;
0112 u8 tlv_seen:1;
0113
0114 u8 seq_unexp_seen:1;
0115 };
0116
0117 struct br_cfm_mep {
0118
0119 struct hlist_node head;
0120 u32 instance;
0121 struct br_cfm_mep_create create;
0122 struct br_cfm_mep_config config;
0123 struct br_cfm_cc_config cc_config;
0124 struct br_cfm_cc_ccm_tx_info cc_ccm_tx_info;
0125
0126 struct hlist_head peer_mep_list;
0127 struct net_bridge_port __rcu *b_port;
0128 unsigned long ccm_tx_end;
0129 struct delayed_work ccm_tx_dwork;
0130 u32 ccm_tx_snumber;
0131 u32 ccm_rx_snumber;
0132 struct br_cfm_mep_status status;
0133 bool rdi;
0134 struct rcu_head rcu;
0135 };
0136
0137 struct br_cfm_peer_mep {
0138 struct hlist_node head;
0139 struct br_cfm_mep *mep;
0140 struct delayed_work ccm_rx_dwork;
0141 u32 mepid;
0142 struct br_cfm_cc_peer_status cc_status;
0143 u32 ccm_rx_count_miss;
0144 struct rcu_head rcu;
0145 };
0146
0147 #endif