bhh_sdk_msg.h (8418B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * * 7 * File: bhh_sdk_msg.h 8 */ 9 10 #ifndef BHH_SDK_MSG_H_ 11 #define BHH_SDK_MSG_H_ 12 13 /* 14 * BHH Statistics control messages (Request/Reply) 15 */ 16 17 typedef struct bhh_sdk_version_exchange_msg_s { 18 uint32 version; /* BHH SDK or appl version */ 19 }bhh_sdk_version_exchange_msg_t; 20 21 22 typedef struct bhh_sdk_msg_ctrl_sess_get_s { 23 uint32 sess_id; 24 uint8 enable; 25 uint8 passive; 26 uint8 local_demand; 27 uint8 remote_demand; 28 uint8 local_sess_state; 29 uint8 remote_sess_state; 30 uint8 mel; 31 uint16 mep_id; 32 uint8 meg_id[SHR_BHH_MEG_ID_LENGTH]; 33 uint32 local_period; 34 uint8 encap_type; 35 uint32 encap_length; /* BHH encapsulation length */ 36 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; /* Encapsulation data */ 37 uint32 tx_port; 38 uint32 tx_cos; 39 uint32 tx_pri; 40 uint32 tx_qnum; 41 uint32 mpls_label; 42 uint32 if_num; 43 uint32 flags; 44 uint16 remote_mep_id; 45 uint32 fault_flags; 46 uint32 remote_period; 47 uint8 priority; 48 } bhh_sdk_msg_ctrl_sess_get_t; 49 50 /* 51 * * BHH Loss Measurement get 52 */ 53 typedef struct bhh_sdk_msg_ctrl_loss_get_s { 54 uint32 flags; 55 uint32 sess_id; /* BHH session (endpoint) id */ 56 uint32 period; 57 uint32 loss_threshold; 58 uint32 loss_nearend; 59 uint32 loss_farend; 60 uint32 tx_nearend; 61 uint32 rx_nearend; 62 uint32 tx_farend; 63 uint32 rx_farend; 64 uint32 rx_oam_packets; 65 uint32 tx_oam_packets; 66 uint32 int_pri; 67 uint8 pkt_pri; 68 uint16 encap_length; 69 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 70 } bhh_sdk_msg_ctrl_loss_get_t; 71 72 /* Flag to indicate the feature that only Final event is given if Timeout and 73 * State change are present in BHH event mask */ 74 #define BHH_SDK_MSG_CTRL_INIT_ONLY_FINAL_EVENT 0x00000001 75 76 /* 77 * BHH Initialization control message 78 */ 79 typedef struct bhh_sdk_msg_ctrl_init_s { 80 uint32 num_sessions; /* Max number of BHH sessions */ 81 uint32 rx_channel; /* Local RX DMA channel (0..3) */ 82 uint32 node_id; /* Node ident */ 83 uint8 carrier_code[SHR_BHH_CARRIER_CODE_LEN]; 84 uint32 data_collection_mode;/* LM/DM data collection mode */ 85 uint16 max_encap_length; /* Max length of encap */ 86 uint32 flags; /* Flags that can be used to indicate configurations */ 87 } bhh_sdk_msg_ctrl_init_t; 88 89 90 /* 91 * BHH Session enable message 92 */ 93 typedef struct bhh_sdk_msg_ctrl_rmep_create_s { 94 uint32 sess_id; 95 uint32 flags; 96 uint16 remote_mep_id; 97 uint8 enable; 98 uint32 period; 99 } bhh_sdk_msg_ctrl_rmep_create_t; 100 101 /* 102 * BHH Loss Measurement add 103 */ 104 typedef struct bhh_sdk_msg_ctrl_loss_add_s { 105 uint32 flags; 106 uint32 sess_id; /* BHH session (endpoint) id */ 107 uint32 period; 108 uint32 int_pri; 109 uint8 pkt_pri; 110 uint16 encap_length; 111 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 112 } bhh_sdk_msg_ctrl_loss_add_t; 113 114 /* 115 * BHH Delay Measurement add 116 */ 117 typedef struct bhh_sdk_msg_ctrl_delay_add_s { 118 uint32 flags; 119 uint32 sess_id; /* BHH session (endpoint) id */ 120 uint32 period; 121 uint32 int_pri; 122 uint8 pkt_pri; 123 uint8 dm_format; 124 uint16 encap_length; 125 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 126 uint16 data_tlv_len; /*Because of memory constraint in FW specific data pattern 127 is not supported in Data tlv value*/ 128 } bhh_sdk_msg_ctrl_delay_add_t; 129 130 /* 131 * BHH Loopback add 132 */ 133 typedef struct bhh_sdk_msg_ctrl_loopback_add_s { 134 uint32 flags; 135 uint32 sess_id; /* BHH session (endpoint) id */ 136 uint32 period; 137 uint32 ttl; 138 uint32 int_pri; 139 uint16 encap_length; 140 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 141 uint8 pkt_pri; 142 } bhh_sdk_msg_ctrl_loopback_add_t; 143 144 typedef struct bhh_sdk_msg_ctrl_sess_set_s { 145 uint32 sess_id; 146 uint32 flags; 147 uint8 passive; 148 uint8 mel; /* MEG level */ 149 uint16 mep_id; 150 uint8 meg_id[SHR_BHH_MEG_ID_LENGTH]; 151 uint32 period; 152 uint8 encap_type; /* Raw, UDP-IPv4/IPv6, used for UDP checksum */ 153 uint32 encap_length; /* BHH encapsulation length */ 154 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; /* Encapsulation data */ 155 uint32 tx_port; 156 uint32 tx_cos; 157 uint32 tx_pri; 158 uint32 tx_qnum; 159 uint32 mpls_label; 160 uint32 if_num; 161 uint32 lm_counter_index; 162 uint16 inner_vlan; 163 uint16 outer_vlan; 164 uint8 endpoint_type; 165 uint8 num_session_entries; 166 uint8 priority; 167 uint16 rx_port; 168 uint8 trunk_valid; 169 } bhh_sdk_msg_ctrl_sess_set_t; 170 171 /* 172 * BHH Session Update 173 */ 174 typedef struct bhh_sdk_msg_session_update_s { 175 uint32 flags; 176 uint32 sess_id; 177 uint8 msg_type; 178 uint8 rdi; 179 uint16 encap_length; 180 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 181 } bhh_sdk_msg_session_update_t; 182 183 /* 184 * BHH Delay Measurement get 185 */ 186 typedef struct bhh_sdk_msg_ctrl_delay_get_s { 187 uint32 flags; 188 uint32 sess_id; /* BHH session (endpoint) id */ 189 uint32 period; 190 uint32 delay_seconds; 191 uint32 delay_nanoseconds; 192 uint32 txf_seconds; 193 uint32 txf_nanoseconds; 194 uint32 rxf_seconds; 195 uint32 rxf_nanoseconds; 196 uint32 txb_seconds; 197 uint32 txb_nanoseconds; 198 uint32 rxb_seconds; 199 uint32 rxb_nanoseconds; 200 uint32 rx_oam_packets; 201 uint32 tx_oam_packets; 202 uint32 int_pri; 203 uint8 pkt_pri; 204 uint8 dm_format; 205 uint16 encap_length; 206 uint16 data_tlv_len; 207 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 208 } bhh_sdk_msg_ctrl_delay_get_t; 209 210 /* 211 * BHH Loopback get 212 */ 213 typedef struct bhh_sdk_msg_ctrl_loopback_get_s { 214 uint32 flags; 215 uint32 sess_id; /* BHH session (endpoint) id */ 216 uint32 period; 217 uint32 ttl; 218 uint32 discovery_flags; 219 uint32 discovery_id; 220 uint32 discovery_ttl; 221 uint32 rx_count; 222 uint32 tx_count; 223 uint32 drop_count; 224 uint32 unexpected_response; 225 uint32 out_of_sequence; 226 uint32 local_mipid_missmatch; 227 uint32 remote_mipid_missmatch; 228 uint32 invalid_target_mep_tlv; 229 uint32 invalid_mep_tlv_subtype; 230 uint32 invalid_tlv_offset; 231 uint32 int_pri; 232 uint16 encap_length; 233 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 234 uint8 pkt_pri; 235 } bhh_sdk_msg_ctrl_loopback_get_t; 236 237 /* 238 * BHH Trunk Map update 239 */ 240 typedef struct bhh_uc_msg_ctrl_trunk_map_update_s { 241 uint16 num_ports; 242 uint16 trunk_id; 243 uint16 port_list[SHR_BHH_MAX_PORTS]; 244 } bhh_sdk_msg_ctrl_trunk_map_update_t; 245 246 /* 247 * BHH Trunk Map get 248 */ 249 typedef struct bhh_uc_msg_ctrl_trunk_map_get_s { 250 uint16 num_ports; 251 uint16 trunk_id; 252 uint16 port_list[SHR_BHH_MAX_PORTS]; 253 } bhh_sdk_msg_ctrl_trunk_map_get_t; 254 255 /* 256 * BHH control messages 257 */ 258 typedef union bhh_sdk_msg_ctrl_s { 259 bhh_sdk_msg_ctrl_init_t init; 260 bhh_sdk_msg_ctrl_sess_set_t sess_set; 261 bhh_sdk_msg_ctrl_sess_get_t sess_get; 262 shr_bhh_msg_ctrl_sess_delete_t sess_delete; 263 shr_bhh_msg_ctrl_stat_req_t stat_req; 264 shr_bhh_msg_ctrl_stat_reply_t stat_reply; 265 bhh_sdk_msg_ctrl_loopback_add_t loopback_add; 266 bhh_sdk_msg_ctrl_loopback_get_t loopback_get; 267 shr_bhh_msg_ctrl_pm_stats_get_t pm_stats_get; 268 bhh_sdk_version_exchange_msg_t bhh_ver_msg; 269 bhh_sdk_msg_ctrl_loss_add_t loss_add; 270 bhh_sdk_msg_ctrl_loss_get_t loss_get; 271 bhh_sdk_msg_ctrl_delay_add_t delay_add; 272 bhh_sdk_msg_ctrl_delay_get_t delay_get; 273 bhh_sdk_msg_ctrl_trunk_map_update_t trunk_update; 274 bhh_sdk_msg_ctrl_trunk_map_get_t trunk_get; 275 } bhh_sdk_msg_ctrl_t; 276 277 /* 278 * BHH CSF add message 279 */ 280 typedef struct bhh_sdk_msg_ctrl_csf_add_s { 281 uint16 sess_id; 282 uint32 flags; 283 uint8 type; 284 uint32 period; 285 uint8 int_pri; 286 uint8 pkt_pri; 287 uint16 encap_length; 288 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 289 } bhh_sdk_msg_ctrl_csf_add_t; 290 291 /* 292 * BHH CSF Measurement get 293 */ 294 typedef struct bhh_sdk_msg_ctrl_csf_get_s { 295 uint32 flags; 296 uint32 type; 297 uint32 period; 298 uint32 int_pri; 299 uint8 pkt_pri; 300 uint16 encap_length; 301 uint8 encap_data[SHR_BHH_MAX_ENCAP_LENGTH]; 302 uint32 tx_csf_packets; 303 } bhh_sdk_msg_ctrl_csf_get_t; 304 305 #endif /* BHH_SDK_MSG_H_ */ 306