oam.h (160879B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 */ 9 10 #ifndef __BCM_OAM_H__ 11 #define __BCM_OAM_H__ 12 13 #include <bcm/mpls.h> 14 15 /* Miscellaneous OAM defines */ 16 #define BCM_OAM_GROUP_NAME_LENGTH 48 /* Group name length in 17 bytes */ 18 #define BCM_OAM_GROUP_INVALID -1 /* Invalid OAM group ID */ 19 #define BCM_OAM_ENDPOINT_INVALID -2 /* Invalid OAM endpoint 20 ID. */ 21 #define BCM_OAM_ENDPOINT_DEFAULT_INGRESS0 -3 /* OAM default endpoint, 22 ingress. */ 23 #define BCM_OAM_ENDPOINT_DEFAULT_INGRESS1 -4 /* OAM default endpoint, 24 ingress. */ 25 #define BCM_OAM_ENDPOINT_DEFAULT_INGRESS2 -5 /* OAM default endpoint, 26 ingress. */ 27 #define BCM_OAM_ENDPOINT_DEFAULT_INGRESS3 -6 /* OAM default endpoint, 28 ingress. */ 29 #define BCM_OAM_ENDPOINT_DEFAULT_EGRESS0 -11 /* OAM default endpoint, 30 egress. */ 31 #define BCM_OAM_ENDPOINT_DEFAULT_EGRESS1 -12 /* OAM default endpoint, 32 egress. */ 33 #define BCM_OAM_ENDPOINT_DEFAULT_EGRESS2 -13 /* OAM default endpoint, 34 egress. */ 35 #define BCM_OAM_ENDPOINT_DEFAULT_EGRESS3 -14 /* OAM default endpoint, 36 egress. */ 37 #define BCM_OAM_INTPRI_MAX 16 /* Internal priority max 38 value */ 39 #define BCM_OAM_CARRIER_CODE_MAX 6 /* ITU-T Carrier code 40 length */ 41 #define BCM_OAM_LM_COUNTER_MAX 3 /* Maximum number of Loss 42 Measurement counters 43 that can be touched by 44 an LM packet Tx 45 (Sample 1, Increment2) */ 46 #define BCM_OAM_MAX_NUM_TLVS_FOR_LBM 2 /* The max TLVS numbers 47 of LBM */ 48 #define BCM_OAM_MAX_NUM_SLINDING_WINDOWS 256 /* The max TLVS numbers 49 of LBM */ 50 #define BCM_OAM_MAX_NUM_TLVS_FOR_DM 1 /* The max TLVS numbers 51 of DM */ 52 53 /* OAM group flags */ 54 #define BCM_OAM_GROUP_REPLACE 0x01 /* Replace an existing 55 OAM group */ 56 #define BCM_OAM_GROUP_WITH_ID 0x02 /* Use the specified 57 group ID */ 58 #define BCM_OAM_GROUP_REMOTE_DEFECT_TX 0x04 /* Set the remote defect 59 indicator in outgoing 60 CCMs for this group */ 61 #define BCM_OAM_GROUP_COPY_ERRORS_TO_CPU 0x08 /* Copy mismatched MAID 62 packets to CPU */ 63 #define BCM_OAM_GROUP_COPY_TO_CPU 0x10 /* Copy the received CCM 64 packet to the CPU */ 65 #define BCM_OAM_GROUP_GET_FAULTS_ONLY 0x20 /* oam_group_get API gets 66 only fault status of 67 the group */ 68 #define BCM_OAM_GROUP_TYPE_BHH 0x40 /* Indicating that this 69 group belongs to BHH 70 endpoint */ 71 #define BCM_OAM_GROUP_FLEXIBLE_MAID_48_BYTE 0x80 /* fully flexible 48B 72 MAID format */ 73 #define BCM_OAM_GROUP_RX_NAME 0x100 /* This group has two 74 MAIDs, one for packets 75 transmitted and 76 another for packets 77 received. The MAID for 78 packets transmitted is 79 specified in the 80 'name' field, and the 81 MAID for packets 82 received is specified 83 in the 'rx_name' field */ 84 #define BCM_OAM_GROUP_FLEXIBLE_MAID_20_BYTE 0x200 /* Only 20 first bytes of 85 MAID name may be set. 86 One extra MEP-DB entry 87 will be allocated. */ 88 #define BCM_OAM_GROUP_FLEXIBLE_MAID_40_BYTE 0x400 /* Only 40 first bytes of 89 MAID name may be set. 90 Two extra MEP-DB entry 91 will be allocated. */ 92 93 /* OAM group fault flags */ 94 #define BCM_OAM_GROUP_FAULT_REMOTE 0x01 /* A remote defect indicator 95 is set in this group */ 96 #define BCM_OAM_GROUP_FAULT_CCM_TIMEOUT 0x02 /* A CCM timeout has occurred 97 in this group */ 98 #define BCM_OAM_GROUP_FAULT_CCM_ERROR 0x04 /* A CCM error has occurred 99 in this group */ 100 #define BCM_OAM_GROUP_FAULT_CCM_XCON 0x08 /* A CCM xcon has occurred in 101 this group */ 102 #define BCM_OAM_GROUP_FAULT_CCM_MAC 0x10 /* A CCM Mac defect has 103 occurred in this group */ 104 #define BCM_OAM_GROUP_RDI_TX BCM_OAM_GROUP_REMOTE_DEFECT_TX /* Set the remote defect 105 indicator in outgoing CCMs 106 for this group. */ 107 108 /* OAM endpoint flags and flags2 */ 109 #define BCM_OAM_ENDPOINT_REPLACE 0x0001 /* Replace an existing 110 OAM endpoint */ 111 #define BCM_OAM_ENDPOINT_WITH_ID 0x0002 /* Use the specified 112 endpoint ID */ 113 #define BCM_OAM_ENDPOINT_REMOTE 0x0004 /* Specifies that this is 114 a remote endpoint */ 115 #define BCM_OAM_ENDPOINT_UP_FACING 0x0008 /* Specifies that this 116 endpoint faces the 117 switching logic */ 118 #define BCM_OAM_ENDPOINT_CCM_RX 0x0010 /* Enables CCM reception. 119 This is only valid 120 for local endpoints. */ 121 #define BCM_OAM_ENDPOINT_LOOPBACK 0x0020 /* Enables loopback 122 response. This is 123 only valid for local 124 endpoints. */ 125 #define BCM_OAM_ENDPOINT_DELAY_MEASUREMENT 0x0040 /* Enables reception and 126 timestamping of delay 127 measurement messages. 128 This is only valid for 129 local endpoints. */ 130 #define BCM_OAM_ENDPOINT_LINKTRACE 0x0080 /* Enables reception of 131 linktrace messages. 132 This is only valid for 133 local endpoints. */ 134 #define BCM_OAM_ENDPOINT_PORT_STATE_TX 0x0100 /* Enables the 135 transmission of port 136 state in outgoing 137 CCMs. This is only 138 valid for local 139 endpoints. */ 140 #define BCM_OAM_ENDPOINT_INTERFACE_STATE_TX 0x0200 /* Enables the 141 transmission of 142 interface state in 143 outgoing CCMs. This 144 is only valid for 145 local endpoints. */ 146 #define BCM_OAM_ENDPOINT_LOSS_MEASUREMENT 0x0400 /* Enables the processing 147 of loss measurement 148 messages. This is 149 only valid for local 150 endpoints. */ 151 #define BCM_OAM_ENDPOINT_INTERMEDIATE 0x0800 /* Configures this as a 152 MIP. */ 153 #define BCM_OAM_ENDPOINT_PBB_TE 0x1000 /* Specifies that this is 154 a PBB-TE endpoint. */ 155 #define BCM_OAM_ENDPOINT_CCM_COPYTOCPU 0x2000 /* Copy received CCM to 156 CPU. This is only 157 valid for local 158 endpoints. */ 159 #define BCM_OAM_ENDPOINT_CCM_DROP 0x4000 /* Drop received CCM. 160 This is only valid for 161 local endpoints. */ 162 #define BCM_OAM_ENDPOINT_DM_COPYTOCPU 0x8000 /* Copy received delay 163 measurement messages 164 to CPU. This is only 165 valid for local 166 endpoints. */ 167 #define BCM_OAM_ENDPOINT_DM_DROP 0x10000 /* Drop received delay 168 measurement messages. 169 This is only valid for 170 local endpoints. */ 171 #define BCM_OAM_ENDPOINT_LB_COPYTOCPU 0x20000 /* Copy received loopback 172 messages to CPU. This 173 is only valid for 174 local endpoints. */ 175 #define BCM_OAM_ENDPOINT_LB_DROP 0x40000 /* Drop received loopback 176 messages. This is only 177 valid for local 178 endpoints. */ 179 #define BCM_OAM_ENDPOINT_LT_COPYTOCPU 0x80000 /* Copy received loopback 180 messages to CPU. This 181 is only valid for 182 local endpoints. */ 183 #define BCM_OAM_ENDPOINT_LT_DROP 0x100000 /* Drop received loopback 184 messages. This is only 185 valid for local 186 endpoints. */ 187 #define BCM_OAM_ENDPOINT_USE_QOS_MAP 0x200000 /* Use QoS map profile 188 specified on endpoint */ 189 #define BCM_OAM_ENDPOINT_MATCH_INNER_VLAN 0x400000 /* Selection of up MIP on 190 CEP (C-comp) rather 191 than on PEP (S-comp). 192 For doubly tagged 193 MEPs, count based on 194 C-comp rather than 195 S-comp */ 196 #define BCM_OAM_ENDPOINT_REMOTE_DEFECT_TX 0x800000 /* Set the remote defect 197 indicator in outgoing 198 CCMs for this 199 endpoint. */ 200 #define BCM_OAM_ENDPOINT_CCM_COPYFIRSTTOCPU 0x1000000 /* Copy only the first 201 (next) received CCM to 202 CPU. This is only 203 valid for local 204 endpoints. */ 205 #define BCM_OAM_ENDPOINT_PORT_STATE_UPDATE 0x2000000 /* Update port state. 206 This is only valid for 207 local endpoints. */ 208 #define BCM_OAM_ENDPOINT_INTERFACE_STATE_UPDATE 0x4000000 /* Update interface 209 state. This is only 210 valid for local 211 endpoints. */ 212 #define BCM_OAM_ENDPOINT_PRI_TAG 0x8000000 /* Messages generated 213 from this endpoint 214 should include a Pri 215 Tag. */ 216 #define BCM_OAM_ENDPOINT_REMOTE_EVENT_DISABLE 0x10000000 /* Do not generate 217 events. */ 218 #define BCM_OAM_ENDPOINT_REMOTE_DEFECT_AUTO_UPDATE 0x20000000 /* Auto update defect 219 state on timeout 220 event. */ 221 #define BCM_OAM_ENDPOINT_MATCH_OUTER_AND_INNER_VLAN 0x40000000 /* Selection of MEP based 222 on S and C VLAN */ 223 #define BCM_OAM_ENDPOINT_LMEP_PKT_FWD 0x80000000 /* Local endpoint CCMs 224 must be forwarded to a 225 remote unit for 226 processing. */ 227 #define BCM_OAM_ENDPOINT_RDI_TX BCM_OAM_ENDPOINT_REMOTE_DEFECT_TX /* Set the remote defect 228 indicator in outgoing 229 CCMs for this 230 endpoint. */ 231 #define BCM_OAM_ENDPOINT_RDI_AUTO_UPDATE BCM_OAM_ENDPOINT_REMOTE_DEFECT_AUTO_UPDATE /* Auto update defect 232 event. */ 233 #define BCM_OAM_ENDPOINT2_RDI_FROM_RX_DISABLE 0x1 /* RDI bit on outgoing 234 packets may be taken 235 from RDI indication on 236 received packets. */ 237 #define BCM_OAM_ENDPOINT2_RDI_FROM_LOC_DISABLE 0x2 /* RDI bit on outgoing 238 packets may be taken 239 from LOC indication of 240 peer endpoint. */ 241 #define BCM_OAM_ENDPOINT2_RDI_ON_LOC 0x4 /* MEP RDI update LOC 242 enable - update local 243 MEP RDI in case of 244 LOC. */ 245 #define BCM_OAM_ENDPOINT2_RDI_CLEAR_ON_LOC_CLEAR 0x8 /* MEP RDI update LOC 246 clean enable - update 247 local MEP RDI in case 248 of LOC clear (time-in) 249 event detected. */ 250 #define BCM_OAM_ENDPOINT2_RDI_ON_RX_RDI 0x10 /* MEP RDI update RX 251 enable - Update local 252 MEP RDI by copying the 253 RDI indication from 254 the last valid CCM 255 packet received. */ 256 #define BCM_OAM_ENDPOINT2_REMOTE_UPDATE_STATE_DISABLE 0x20 /* Disable updating RMEP 257 DB. */ 258 #define BCM_OAM_ENDPOINT2_RX_REMOTE_DEFECT_AUTO_UPDATE 0x40 /* Auto update defect 259 state on timeout event 260 for RX packets */ 261 #define BCM_OAM_ENDPOINT2_RX_REMOTE_EVENT_DISABLE 0x80 /* Do not generate events 262 for RX packets. */ 263 #define BCM_OAM_ENDPOINT2_HW_ACCELERATION_SET 0x100 /* Configure only HW 264 accelerator 265 properties. */ 266 #define BCM_OAM_ENDPOINT2_REDIRECT_TO_CPU 0x200 /* Used to send BHH 267 packets to CPU instead 268 of BTE */ 269 #define BCM_OAM_ENDPOINT2_GET_FAULTS_ONLY 0x200 /* oam_endpoint_get API 270 gets only fault status 271 of endpoint */ 272 #define BCM_OAM_ENDPOINT2_MPLS_INGRESS_ONLY 0x800 /* Endpoint with only an 273 ingress entry. 274 Applicable only for 275 endpoints of type 276 bcmOAMEndpointTypeBHHMPLS, 277 bcmOAMEndpointTypeBHHPWE */ 278 #define BCM_OAM_ENDPOINT2_UPDATE_COUNTER_ACTION 0x1000 /* Use along with 279 BCM_OAM_ENDPOINT_REPLACE 280 to update just the LM 281 parameters including 282 counters 283 incremented/sampled by 284 Tx CCM PDUs */ 285 #define BCM_OAM_ENDPOINT2_MPLS_EGRESS_ONLY 0x2000 /* Endpoint with only an 286 egress entry. 287 Applicable only for 288 endpoints of type 289 bcmOAMEndpointTypeBHHMPLS, 290 bcmOAMEndpointTypeBHHPWE */ 291 #define BCM_OAM_ENDPOINT_FLAGS2_MATCH_SINGLE_TAGGED_OUTER_VLAN 0x4000 /* Selection of MEP 292 look-up based on 293 Single outer tagged 294 packets only */ 295 #define BCM_OAM_ENDPOINT_FLAGS2_RDI_FROM_RX_DISABLE BCM_OAM_ENDPOINT2_RDI_FROM_RX_DISABLE /* RDI bit on outgoing 296 packets may be taken 297 from RDI indication on 298 received packets. */ 299 #define BCM_OAM_ENDPOINT_FLAGS2_RDI_FROM_LOC_DISABLE BCM_OAM_ENDPOINT2_RDI_FROM_LOC_DISABLE /* RDI bit on outgoing 300 packets may be taken 301 from LOC indication of 302 peer endpoint. */ 303 #define BCM_OAM_ENDPOINT_FLAGS2_RDI_ON_LOC BCM_OAM_ENDPOINT2_RDI_ON_LOC /* MEP RDI update LOC 304 enable - update local 305 MEP RDI in case of 306 LOC. */ 307 #define BCM_OAM_ENDPOINT_FLAGS2_RDI_CLEAR_ON_LOC_CLEAR BCM_OAM_ENDPOINT2_RDI_CLEAR_ON_LOC_CLEAR /* MEP RDI update LOC 308 clean enable - update 309 local MEP RDI in case 310 of LOC clear (time-in) 311 event detected. */ 312 #define BCM_OAM_ENDPOINT_FLAGS2_RDI_ON_RX_RDI BCM_OAM_ENDPOINT2_RDI_ON_RX_RDI /* MEP RDI update RX 313 enable - Update local 314 MEP RDI by copying the 315 RDI indication from 316 the last valid CCM 317 packet received. */ 318 #define BCM_OAM_ENDPOINT_FLAGS2_REMOTE_UPDATE_STATE_DISABLE BCM_OAM_ENDPOINT2_REMOTE_UPDATE_STATE_DISABLE /* Disable updating RMEP 319 DB. */ 320 #define BCM_OAM_ENDPOINT_FLAGS2_RX_REMOTE_DEFECT_AUTO_UPDATE BCM_OAM_ENDPOINT2_RX_REMOTE_DEFECT_AUTO_UPDATE /* Auto update defect 321 state on timeout event 322 for RX packets */ 323 #define BCM_OAM_ENDPOINT_FLAGS2_RX_REMOTE_EVENT_DISABLE BCM_OAM_ENDPOINT2_RX_REMOTE_EVENT_DISABLE /* Do not generate events 324 for RX packets. */ 325 #define BCM_OAM_ENDPOINT_FLAGS2_HW_ACCELERATION_SET BCM_OAM_ENDPOINT2_HW_ACCELERATION_SET /* Configure only HW 326 accelerator 327 properties. */ 328 #define BCM_OAM_ENDPOINT_FLAGS2_REDIRECT_TO_CPU BCM_OAM_ENDPOINT2_REDIRECT_TO_CPU /* Used to send BHH 329 packets to CPU instead 330 of BTE */ 331 #define BCM_OAM_ENDPOINT_FLAGS2_GET_FAULTS_ONLY BCM_OAM_ENDPOINT2_GET_FAULTS_ONLY /* oam_endpoint_get API 332 gets only fault status 333 of endpoint */ 334 #define BCM_OAM_ENDPOINT_FLAGS2_MPLS_INGRESS_ONLY BCM_OAM_ENDPOINT2_MPLS_INGRESS_ONLY /* Endpoint with only an 335 ingress entry. 336 Applicable only for 337 endpoints of type 338 bcmOAMEndpointTypeBHHMPLS, 339 bcmOAMEndpointTypeBHHPWE */ 340 #define BCM_OAM_ENDPOINT_FLAGS2_UPDATE_COUNTER_ACTION BCM_OAM_ENDPOINT2_UPDATE_COUNTER_ACTION /* Use along with 341 BCM_OAM_ENDPOINT_REPLACE 342 to update just the LM 343 counters updated by Tx 344 CCM packets */ 345 #define BCM_OAM_ENDPOINT_FLAGS2_MPLS_EGRESS_ONLY BCM_OAM_ENDPOINT2_MPLS_EGRESS_ONLY /* Endpoint with only an 346 egress entry. 347 Applicable only for 348 endpoints of type 349 bcmOAMEndpointTypeBHHMPLS, 350 bcmOAMEndpointTypeBHHPWE */ 351 #define BCM_OAM_ENDPOINT_FLAGS2_USE_DOUBLE_OUTLIF_INJ 0x8000 /* double outlif for OAM 352 over PWE injection */ 353 #define BCM_OAM_ENDPOINT_FLAGS2_VLAN_VP_UP_MEP_IN_HW 0x10000 /* Endpoint is Vlan 354 based VP UP MEP in HW 355 engine and use 356 tx_gport to honor the 357 vlan translation for 358 UP MEP TXed packed 359 from HW CCM engine */ 360 #define BCM_OAM_ENDPOINT_FLAGS2_EGRESS_INJECTION_DOWN 0x20000 /* Create egress 361 injection down 362 endpoint */ 363 #define BCM_OAM_ENDPOINT_FLAGS2_TX_STATISTICS 0x40000 /* Enable OAMP Tx Opcode 364 statistics */ 365 #define BCM_OAM_ENDPOINT_FLAGS2_RX_STATISTICS 0x80000 /* Enable OAMP Rx Opcode 366 statistics */ 367 #define BCM_OAM_ENDPOINT_FLAGS2_PER_OPCODE_STATISTICS 0x100000 /* Enable OAMP Tx/Rx Per 368 Opcode statistics, 369 count each opcode in 370 separate counter */ 371 #define BCM_OAM_ENDPOINT_FLAGS2_PUNT_NEXT_GOOD_PACKET 0x200000 /* Write-only flag. 372 Specifies if the next 373 received good packet 374 should be punted to 375 the CPU */ 376 #define BCM_OAM_ENDPOINT_FLAGS2_SIGNAL 0x400000 /* Indication support of 377 Signal Degradation for 378 Y1731oPWE(CCM) */ 379 #define BCM_OAM_ENDPOINT_FLAGS2_MPLS_LM_DM_ILM 0x800000 /* Inferred Loss 380 Measurement endpoint */ 381 382 /* OAM loss measurment flags */ 383 #define BCM_OAM_LM_PCP 0x0001 /* Use different counters for 384 different vlan tag packet priority 385 codes */ 386 387 /* OAM lif profile flags */ 388 #define BCM_OAM_LIF_PROFILE_FLAGS_DEFAULT_MEP_0 0x0001 /* Configure 389 ingress/egress LIF 390 Profile of 391 BCM_OAM_ENDPOINT_DEFAULT_INGRESS0 392 / EGRESS0 */ 393 #define BCM_OAM_LIF_PROFILE_FLAGS_DEFAULT_MEP_1 0x0002 /* Configure 394 ingress/egress LIF 395 Profile of 396 BCM_OAM_ENDPOINT_DEFAULT_INGRESS1 397 / EGRESS1 */ 398 #define BCM_OAM_LIF_PROFILE_FLAGS_DEFAULT_MEP_2 0x0004 /* Configure 399 ingress/egress LIF 400 Profile of 401 BCM_OAM_ENDPOINT_DEFAULT_INGRESS2 402 / EGRESS2 */ 403 #define BCM_OAM_LIF_PROFILE_FLAGS_DEFAULT_MEP_3 0x0008 /* Configure 404 ingress/egress LIF 405 Profile of 406 BCM_OAM_ENDPOINT_DEFAULT_INGRESS3 407 / EGRESS3 */ 408 409 /* OAM opcode flags */ 410 #define BCM_OAM_OPCODE_CCM_IN_HW 0x0001 /* Process CCMs in 411 Hardware */ 412 #define BCM_OAM_OPCODE_CCM_COPY_TO_CPU 0x0002 /* Copy CCMs to CPU */ 413 #define BCM_OAM_OPCODE_CCM_DROP 0x0004 /* Drop CCMs */ 414 #define BCM_OAM_OPCODE_LBM_IN_HW 0x0008 /* Process Loopback 415 Messages in Hardware */ 416 #define BCM_OAM_OPCODE_LBM_UC_COPY_TO_CPU 0x0010 /* Copy Unicast Loopback 417 Messages to CPU */ 418 #define BCM_OAM_OPCODE_LBM_UC_DROP 0x0020 /* Drop Unicast Loopback 419 Messages */ 420 #define BCM_OAM_OPCODE_LBM_MC_COPY_TO_CPU 0x0040 /* Copy Multicast 421 Loopback Messages to 422 CPU */ 423 #define BCM_OAM_OPCODE_LBM_MC_DROP 0x0080 /* Drop Multicast 424 Loopback Messages */ 425 #define BCM_OAM_OPCODE_LBR_COPY_TO_CPU 0x0100 /* Copy Loopback Reply to 426 CPU */ 427 #define BCM_OAM_OPCODE_LBR_DROP 0x0200 /* Drop Loopback Reply */ 428 #define BCM_OAM_OPCODE_LTM_COPY_TO_CPU 0x0400 /* Copy Linktrace 429 Messages to CPU */ 430 #define BCM_OAM_OPCODE_LTM_DROP 0x0800 /* Drop Linktrace 431 Messages */ 432 #define BCM_OAM_OPCODE_LTR_COPY_TO_CPU 0x1000 /* Copy Linktrace Reply 433 to CPU */ 434 #define BCM_OAM_OPCODE_LTR_DROP 0x2000 /* Drop Linktrace Reply */ 435 #define BCM_OAM_OPCODE_LMEP_PKT_FWD 0x4000 /* Forward CCMs to remote 436 device */ 437 #define BCM_OAM_OPCODE_OTHER_COPY_TO_CPU 0x8000 /* Copy other OAM opcode 438 to CPU */ 439 #define BCM_OAM_OPCODE_OTHER_DROP 0x10000 /* Drop other OAM opcode 440 to CPU */ 441 442 /* OAM endpoint fault flags */ 443 #define BCM_OAM_ENDPOINT_FAULT_CCM_TIMEOUT 0x01 /* Indicates a CCM 444 timeout. This is only 445 valid for remote 446 endpoints. */ 447 #define BCM_OAM_ENDPOINT_FAULT_REMOTE 0x02 /* Indicates that a 448 remote defect was 449 indicated in the last 450 CCM received from this 451 endpoint. This is 452 only valid for remote 453 endpoints and is 454 read-only. */ 455 #define BCM_OAM_ENDPOINT_FAULT_PORT_DOWN 0x04 /* Indicates that the 456 port on which the 457 endpoint resides is 458 down. This is valid 459 for both local and 460 remote endpoints but 461 is read-only for 462 remote endpoints. */ 463 #define BCM_OAM_ENDPOINT_FAULT_INTERFACE_DOWN 0x08 /* Indicates that the 464 interface on which teh 465 endpoint resides is 466 down. This is valid 467 for both local and 468 remote endpoints but 469 is read-only for 470 remote endpoints. */ 471 472 /* Constants for CCM periods defined by 802.1ag */ 473 #define BCM_OAM_ENDPOINT_CCM_PERIOD_DISABLED 0 474 #define BCM_OAM_ENDPOINT_CCM_PERIOD_3MS 3 475 #define BCM_OAM_ENDPOINT_CCM_PERIOD_10MS 10 476 #define BCM_OAM_ENDPOINT_CCM_PERIOD_100MS 100 477 #define BCM_OAM_ENDPOINT_CCM_PERIOD_1S 1000 478 #define BCM_OAM_ENDPOINT_CCM_PERIOD_10S 10000 479 #define BCM_OAM_ENDPOINT_CCM_PERIOD_1M 60000 480 #define BCM_OAM_ENDPOINT_CCM_PERIOD_10M 600000 481 482 /* OAM loss flags */ 483 #define BCM_OAM_LOSS_TX_ENABLE 0x0001 /* Enable Loss Packet 484 Transmission */ 485 #define BCM_OAM_LOSS_SINGLE_ENDED 0x0002 /* PDU used for ETH-LM 486 information is LMM/R */ 487 #define BCM_OAM_LOSS_FIRST_RX_COPY_TO_CPU 0x0004 /* Copy First received 488 Loss Measurement 489 Packet to CPU */ 490 #define BCM_OAM_LOSS_ALL_RX_COPY_TO_CPU 0x0008 /* Copy all received Loss 491 Measurement Packet to 492 CPU */ 493 #define BCM_OAM_LOSS_WITH_ID 0x0010 /* Use the specified loss 494 id */ 495 #define BCM_OAM_LOSS_PRI_INTERNAL 0x0020 /* Selects counting based 496 on internal COS rather 497 than packet priority */ 498 #define BCM_OAM_LOSS_DP_INTERNAL 0x0040 /* Selects counting based 499 on internal DP rather 500 than packet CFI */ 501 #define BCM_OAM_LOSS_COUNT_POST_TRAFFIC_CONDITIONING 0x0080 /* Specifies that OEM 502 loss measuements are 503 taken on the wire side 504 (pre traffic 505 conditioning) or on 506 the switching side 507 (post traffic 508 conditioning) of a 509 forwarding function */ 510 #define BCM_OAM_LOSS_COUNT_GREEN_AND_YELLOW 0x0100 /* Specifies whether the 511 OEM loss measurements 512 includes green only 513 frames or green and 514 yellow frames */ 515 #define BCM_OAM_LOSS_COUNT_CPU_RX_PKT 0x0200 /* Specifies that RX LM 516 counter needs to be 517 updated for packet 518 received from CPU */ 519 #define BCM_OAM_LOSS_COUNT_CPU_TX_PKT 0x0400 /* Specifies that TX LM 520 counter needs to be 521 updated for packet 522 received from CPU */ 523 #define BCM_OAM_LOSS_STATISTICS_EXTENDED 0x800 /* Specifies that 524 extended statistics 525 are to be maintained */ 526 #define BCM_OAM_LOSS_UPDATE 0x1000 /* Update LM settings for 527 given endpoint (leaves 528 statistics unchanged). */ 529 #define BCM_OAM_LOSS_SLM 0x2000 /* Transmit SLM/Rs (as 530 opposed to LMM/Rs). */ 531 #define BCM_OAM_LOSS_REPORT_MODE 0x4000 /* Enable report mode. */ 532 #define BCM_OAM_COMBINED_LOSS_DELAY 0x8000 /* Enable Combined Loss 533 and Delay mode for 534 MPLS LM/DM (RFC 6374), 535 both loss and delay 536 add should be called 537 with this flag for the 538 same endpoint Id */ 539 #define BCM_OAM_LOSS_UPDATE_NEXT_RECEIVED_SLR 0x10000 /* Set the LM DB to be 540 updated by next 541 received SLR. Applies 542 only to a single SLR. */ 543 544 /* OAM delay flags */ 545 #define BCM_OAM_DELAY_TX_ENABLE 0x0001 /* Enable Delay Packet 546 Transmission */ 547 #define BCM_OAM_DELAY_ONE_WAY 0x0002 /* One Way Mode */ 548 #define BCM_OAM_DELAY_FIRST_RX_COPY_TO_CPU 0x0004 /* Copy First received 549 Delay Measurement 550 Packet to CPU */ 551 #define BCM_OAM_DELAY_ALL_RX_COPY_TO_CPU 0x0008 /* Copy all received 552 Delay Measurement 553 Packet to CPU */ 554 #define BCM_OAM_DELAY_WITH_ID 0x0010 /* Use the specified 555 delay id */ 556 #define BCM_OAM_DELAY_UPDATE 0x20 /* Update DM settings for 557 given endpoint (leaves 558 statistics unchanged). */ 559 #define BCM_OAM_DELAY_REPORT_MODE 0x40 /* Enable report mode. */ 560 #define BCM_OAM_COMBINED_LOSS_DELAY_RSVD 0x8000 /* Enable Combined Loss 561 and Delay mode for 562 MPLS LM/DM (RFC 6374), 563 both loss and delay 564 add should be called 565 with this flag for the 566 same endpoint Id */ 567 568 /* OAM endpoint action flags */ 569 #define BCM_OAM_ENDPOINT_ACTION_DISABLE 0x00000001 /* Reset the endpoint 570 action(s) */ 571 572 /* Counter action values for loss add API */ 573 typedef enum bcm_oam_lm_counter_action_e { 574 bcmOamCounterActionNone = 0, /* No action */ 575 bcmOamCounterActionIncrement = 1, /* Increment Counter */ 576 bcmOamCounterActionSample = 2 /* Sample Counter */ 577 } bcm_oam_lm_counter_action_t; 578 579 /* OAM AIS flags */ 580 #define BCM_OAM_AIS_UPDATE 0x0001 /* Update AIS settings for given 581 endpoint. */ 582 #define BCM_OAM_AIS_MULTICAST 0x0002 /* Transmit AIS frames with 583 multicast DA address. */ 584 #define BCM_OAM_AIS_WITH_AIS_ID 0x0004 /* Use given ais_id */ 585 #define BCM_OAM_AIS_TRANSMIT_START 0x0008 /* Enable AIS transmission for 586 given local MEP */ 587 #define BCM_OAM_AIS_TRANSMIT_STOP 0x0010 /* Disable AIS transmission for 588 given local MEP */ 589 590 /* BHH Loopback flags, used to set flags field of bcm_oam_loopback_t */ 591 #define BCM_OAM_BHH_INC_REQUESTING_MEP_TLV 0x00000001 /* Include requesting MEP 592 ID TLV in message */ 593 #define BCM_OAM_BHH_SET_TTL 0x00000002 /* Set TLL field in LBM */ 594 #define BCM_OAM_BHH_LBM_INGRESS_DISCOVERY_MEP_TLV 0x00000010 /* Use ingress discovery 595 MEP ID TLV in LBM */ 596 #define BCM_OAM_BHH_LBM_EGRESS_DISCOVERY_MEP_TLV 0x00000020 /* Use egress discovery 597 MEP ID TLV in LBM */ 598 #define BCM_OAM_BHH_LBM_ICC_MEP_TLV 0x00000040 /* Use ICC based MEP ID 599 TLV in LBM */ 600 #define BCM_OAM_BHH_LBM_ICC_MIP_TLV 0x00000080 /* Use ICC based MIP ID 601 TLV in LBM */ 602 #define BCM_OAM_BHH_LBR_ICC_MEP_TLV 0x00000100 /* Use ICC based MEP ID 603 TLV in LBR */ 604 #define BCM_OAM_BHH_LBR_ICC_MIP_TLV 0x00000200 /* Use ICC based MIP ID 605 TLV in LBR */ 606 607 /* OAM loopback flags, used to set flags field in bcm_oam_loopback_t */ 608 #define BCM_OAM_LOOPBACK_UPDATE 0x1 /* Update Loopback settings 609 (leaves statistics 610 unchanged). */ 611 #define BCM_OAM_LOOPBACK_WITH_CTF_ID 0x2 612 #define BCM_OAM_LOOPBACK_WITH_GTF_ID 0x4 613 #define BCM_OAM_LOOPBACK_PERIOD_IN_PPS 0x8 /* Default is milliseconds. 614 flag may be used for 615 packet per second. */ 616 #define BCM_OAM_LOOPBACK_TX_ENABLE 0x400 /* Enable Loopback Packet 617 Transmission */ 618 619 /* OAM TST flags */ 620 #define BCM_OAM_TST_TX_UPDATE 0x1 /* Update Loopback settings (leaves 621 statistics unchanged). */ 622 #define BCM_OAM_TST_RX_UPDATE 0x2 623 #define BCM_OAM_TST_TX_WITH_ID 0x4 624 #define BCM_OAM_TST_RX_WITH_ID 0x8 625 626 /* OAM PSC flags */ 627 #define BCM_OAM_PSC_TX_BURST 0x0001 /* Trigger PSC Burst 628 Transmission */ 629 #define BCM_OAM_PSC_TX_ENABLE 0x0002 /* Enable PSC slow-rate 630 Transmission */ 631 #define BCM_OAM_PSC_REVERTIVE 0x0004 /* Enable Revertive mode */ 632 #define BCM_OAM_PSC_FIRST_RX_COPY_TO_CPU 0x0008 /* Copy First received 633 PSC message to CPU */ 634 #define BCM_OAM_PSC_ALL_RX_COPY_TO_CPU 0x0010 /* Copy all received PSC 635 message to CPU */ 636 637 /* OAM PW Status flags */ 638 #define BCM_OAM_PW_STATUS_TX_BURST 0x0001 /* Trigger PW Status 639 Burst Transmission */ 640 #define BCM_OAM_PW_STATUS_TX_ENABLE 0x0002 /* Enable PW Status 641 Packet Transmission */ 642 #define BCM_OAM_PW_STATUS_FIRST_RX_COPY_TO_CPU 0x0004 /* Copy First received PW 643 Status message to CPU */ 644 #define BCM_OAM_PW_STATUS_ALL_RX_COPY_TO_CPU 0x0008 /* Copy all received PW 645 Status message to CPU */ 646 647 /* 648 * Constants for FFD frequency defined by Y.1711, which will reuse ccm 649 * period field in endpoint objects 650 */ 651 #define BCM_OAM_ENDPOINT_FFD_FREQUENCY_10MS 10 652 #define BCM_OAM_ENDPOINT_FFD_FREQUENCY_20MS 20 653 #define BCM_OAM_ENDPOINT_FFD_FREQUENCY_50MS 50 654 #define BCM_OAM_ENDPOINT_FFD_FREQUENCY_100MS 100 655 #define BCM_OAM_ENDPOINT_FFD_FREQUENCY_200MS 200 656 #define BCM_OAM_ENDPOINT_FFD_FREQUENCY_500MS 500 657 658 /* OAM SD/SF flags */ 659 #define BCM_OAM_SD_SF_FLAGS_ALERT_METHOD 0x1 /* if set, issue event on 660 signal degradation / 661 signal fault set, 662 otherwise issue alert 663 on state change */ 664 #define BCM_OAM_SD_SF_FLAGS_ALERT_SUPRESS 0x2 /* Suppress alert event 665 generation */ 666 667 /* OAM Y.1711 ALARM flags */ 668 #define BCM_OAM_Y_1711_FLAGS_ALERT_METHOD 0x1 /* if alert_method 1, 669 issue event on 670 mismerge, mismatch or 671 excess indication set, 672 otherwise issue event 673 on state change */ 674 675 /* OAM Y.1711 ALARM flags */ 676 #define BCM_OAM_Y_1711_FLAGS_THRESHOLD 0x2 /* Use to configure 1711 677 threshold globally */ 678 679 /* OAM CSF flags */ 680 #define BCM_OAM_CSF_UPDATE 0x0001 /* Update CSF settings for given 681 endpoint. */ 682 683 /* CSF Type */ 684 #define BCM_OAM_CSF_LOS 0x0 /* Loss of Signal. */ 685 #define BCM_OAM_CSF_FDI 0x1 /* Forward Defect Indication. */ 686 #define BCM_OAM_CSF_RDI 0x2 /* Reverse Defect Indication. */ 687 #define BCM_OAM_CSF_DCI 0x3 /* Defect Clear Indication. */ 688 689 /* OAM endpoint types */ 690 typedef enum bcm_oam_endpoint_type_e { 691 bcmOAMEndpointTypeEthernet = 0, /* Ethernet endpoint */ 692 bcmOAMEndpointTypeMPLSPerformance = 1, /* MPLS performance monitoring endpoint */ 693 bcmOAMEndpointTypePSC = 2, /* Protection coordination state 694 protocol endpoint */ 695 bcmOAMEndpointTypeBHHMPLS = 3, /* BHH for MPLS-TP */ 696 bcmOAMEndpointTypeBHHMPLSVccv = 4, /* BHH for MPLS-TP Psuedowire Virtual 697 Circuit Connectivity Verification */ 698 bcmOAMEndpointTypeBHHPwe = 5, /* BHH for PWE */ 699 bcmOAMEndpointTypePwStatus = 6, /* Protection coordination state 700 protocol endpoint */ 701 bcmOAMEndpointTypeMplsLmDmSectionPort = 7, /* RFC 6374 Section loss/delay 702 measurement based on Port */ 703 bcmOAMEndpointTypeMplsLmDmSectionInnervlan = 8, /* RFC 6374 Section loss/delay 704 measurement based on Port and Inner 705 vlan */ 706 bcmOAMEndpointTypeMplsLmDmSectionOuterVlan = 9, /* RFC 6374 Section loss/delay 707 measurement based on Port and Outer 708 vlan */ 709 bcmOAMEndpointTypeMplsLmDmSectionOuterPlusInnerVlan = 10, /* RFC 6374 Section loss/delay 710 measurement based on Port and Outer 711 vlan and Inner vlan */ 712 bcmOAMEndpointTypeMplsLmDmPw = 11, /* RFC 6374 Section loss/delay 713 measurement based on Pseudowire */ 714 bcmOAMEndpointTypeMplsLmDmLsp = 12, /* RFC 6374 Section loss/delay 715 measurement based on LSP */ 716 bcmOAMEndpointTypeBhhSection = 13, /* BHH Section based on Port */ 717 bcmOAMEndpointTypeBhhSectionInnervlan = 14, /* BHH section based on Port and Inner 718 vlan */ 719 bcmOAMEndpointTypeBhhSectionOuterVlan = 15, /* BHH section based on Port and Outer 720 vlan */ 721 bcmOAMEndpointTypeBhhSectionOuterPlusInnerVlan = 16, /* BHH section based on Port and Outer 722 vlan and Inner vlan */ 723 bcmOAMEndpointTypeMPLSNetwork = 17, /* MPLS networks monitoring endpoint 724 for ITU-T Y.1711 */ 725 bcmOAMEndpointTypeBHHPweGAL = 18, /* BHH for PWE over GAL */ 726 bcmOAMEndpointTypeMplsLmDmSection = 19, /* RFC 6374 Section loss/delay 727 measurement based on SectionBHH for 728 PWE over GAL */ 729 bcmOAMEndpointTypeCount = 20 /* Always the last. Not an usable value. */ 730 } bcm_oam_endpoint_type_t; 731 732 /* VCCV Control Channel Type */ 733 typedef enum bcm_oam_vccv_type_e { 734 bcmOamBhhVccvChannelAch = 0, /* Channel ACH */ 735 bcmOamBhhVccvRouterAlert = 1, /* Router Alert */ 736 bcmOamBhhVccvTtl = 2, /* TTL */ 737 bcmOamBhhVccvGal13 = 3 /* GAL 13 */ 738 } bcm_oam_vccv_type_t; 739 740 /* OAM event types */ 741 typedef enum bcm_oam_event_type_e { 742 bcmOAMEventEndpointPortDown = 0, 743 bcmOAMEventEndpointPortUp = 1, 744 bcmOAMEventEndpointInterfaceDown = 2, 745 bcmOAMEventEndpointInterfaceUp = 3, 746 bcmOAMEventEndpointInterfaceTestingToUp = 4, 747 bcmOAMEventEndpointInterfaceUnknownToUp = 5, 748 bcmOAMEventEndpointInterfaceDormantToUp = 6, 749 bcmOAMEventEndpointInterfaceNotPresentToUp = 7, 750 bcmOAMEventEndpointInterfaceLLDownToUp = 8, 751 bcmOAMEventEndpointInterfaceTesting = 9, 752 bcmOAMEventEndpointInterfaceUnkonwn = 10, 753 bcmOAMEventEndpointInterfaceDormant = 11, 754 bcmOAMEventEndpointInterfaceNotPresent = 12, 755 bcmOAMEventEndpointInterfaceLLDown = 13, 756 bcmOAMEventGroupCCMxcon = 14, 757 bcmOAMEventGroupCCMError = 15, 758 bcmOAMEventGroupRemote = 16, 759 bcmOAMEventGroupCCMTimeout = 17, 760 bcmOAMEventBHHLBTimeout = 18, 761 bcmOAMEventBHHLBDiscoveryUpdate = 19, 762 bcmOAMEventBHHCCMTimeout = 20, 763 bcmOAMEventBHHCCMState = 21, 764 bcmOAMEventEndpointCCMTimeout = 22, 765 bcmOAMEventEndpointCCMTimein = 23, 766 bcmOAMEventEndpointCCMTimeoutEarly = 24, 767 bcmOAMEventEndpointRemote = 25, 768 bcmOAMEventEndpointRemoteUp = 26, 769 bcmOAMEventEndpointDmStatistics = 27, 770 bcmOAMEventEndpointLmStatistics = 28, 771 bcmOAMEventBHHCCMRdi = 29, 772 bcmOAMEventBHHCCMUnknownMegLevel = 30, 773 bcmOAMEventBHHCCMUnknownMegId = 31, 774 bcmOAMEventBHHCCMUnknownMepId = 32, 775 bcmOAMEventBHHCCMUnknownPeriod = 33, 776 bcmOAMEventBHHCCMUnknownPriority = 34, 777 bcmOAMEventBHHCCMRdiClear = 35, 778 bcmOAMEventBHHCCMUnknownMegLevelClear = 36, 779 bcmOAMEventBHHCCMUnknownMegIdClear = 37, 780 bcmOAMEventBHHCCMUnknownMepIdClear = 38, 781 bcmOAMEventBHHCCMUnknownPeriodClear = 39, 782 bcmOAMEventBHHCCMUnknownPriorityClear = 40, 783 bcmOAMEventBHHRawData = 41, 784 bcmOAMEventEthLmDmRawData = 42, 785 bcmOAMEventMplsLmDmRawData = 43, 786 bcmOAMEventGroupMACStatus = 44, 787 bcmOAMEventGroupCCMxconClear = 45, 788 bcmOAMEventGroupCCMErrorClear = 46, 789 bcmOAMEventGroupRemoteClear = 47, 790 bcmOAMEventGroupCCMTimeoutClear = 48, 791 bcmOAMEventGroupMACStatusClear = 49, 792 bcmOAMEventBHHCCMTimeoutClear = 50, 793 bcmOAMEventBhhPmCounterRollover = 51, 794 bcmOAMEventEthLmDmPmCounterRollover = 52, 795 bcmOAMEventMplsLmDmPmCounterRollover = 53, 796 bcmOAMEventCsfLos = 54, 797 bcmOAMEventCsfFdi = 55, 798 bcmOAMEventCsfRdi = 56, 799 bcmOAMEventCsfDci = 57, 800 bcmOAMEventEndpointSdSet = 58, /* Signal degradation set. For Y1731 or 801 MPLS networks endpoints */ 802 bcmOAMEventEndpointSdClear = 59, /* Signal degradation clear. For Y1731 803 or MPLS networks endpoints */ 804 bcmOAMEventEndpointSfSet = 60, /* Signal failure set. For Y1731 or MPLS 805 networks endpoints */ 806 bcmOAMEventEndpointSfClear = 61, /* Signal failure clear. For Y1731 or 807 MPLS networks endpoints */ 808 bcmOAMEventEndpointDExcessSet = 62, /* DExcess detect. For MPLS networks 809 endpoints */ 810 bcmOAMEventEndpointDMissmatch = 63, /* DMissmatch detect. For MPLS networks 811 endpoints */ 812 bcmOAMEventEndpointDMissmerge = 64, /* DMissmerge detect. For MPLS networks 813 endpoints */ 814 bcmOAMEventEndpointDAllClear = 65, /* DAllClear. For MPLS networks 815 endpoints */ 816 bcmOAMEventCount = 66 817 } bcm_oam_event_type_t; 818 819 /* OAM Group Fault Alarm Defects and Priorities */ 820 typedef enum bcm_oam_group_fault_alarm_defect_priority_e { 821 bcmOAMGroupFaultAlarmPriorityDefectsAll = 0, /* Generate fault alarm for all defects */ 822 bcmOAMGroupFaultAlarmPriorityDefectRDICCM = 1, /* Generate fault alarm when CCM 823 received by this Maintenance Endpoint 824 from some remote Maintenance Endpoint 825 contained RDI bit */ 826 bcmOAMGroupFaultAlarmPriorityDefectMACStatus = 2, /* Generate fault alarm when the last 827 CCM received by this MEP from some 828 remote MEP indicated that the 829 Transmitting Maintenance Endpoint's 830 associated MAC is reporting an error 831 status */ 832 bcmOAMGroupFaultAlarmPriorityDefectRemoteCCM = 3, /* Generate fault alarm when Maintenance 833 Endpoint is not receiving CCMs from 834 some other Maintenance Endpoint in 835 its configured list */ 836 bcmOAMGroupFaultAlarmPriorityDefectErrorCCM = 4, /* Generate fault alarm when Maintenance 837 Endpoint is receiving Invalid CCMs */ 838 bcmOAMGroupFaultAlarmPriorityDefectXconCCM = 5, /* Generate fault alarm when Maintenance 839 Endpoint is receiving CCMs that could 840 be from some other MA */ 841 bcmOAMGroupFaultAlarmPriorityDefectsNone = 6, /* No Defects are reported */ 842 bcmOAMGroupFaultAlarmPriorityCount = 7 843 } bcm_oam_group_fault_alarm_defect_priority_t; 844 845 /* OAM Timestamp Formats */ 846 typedef enum bcm_oam_timestamp_format_e { 847 bcmOAMTimestampFormatNTP = 0, /* Network Time Protocol version 4 848 64-bit timestamp format [RFC5905] */ 849 bcmOAMTimestampFormatIEEE1588v1 = 1 /* Low-order 64 bits of the IEEE 850 1588-2008 (1588v2) Precision Time 851 Protocol timestamp format [IEEE1588] */ 852 } bcm_oam_timestamp_format_t; 853 854 /* OAM action types */ 855 typedef enum bcm_oam_action_type_e { 856 bcmOAMActionCountEnable = 0, /* Enable counting. */ 857 bcmOAMActionMeterEnable = 1, /* Enable metering. */ 858 bcmOAMActionDrop = 2, /* Drop the packet. */ 859 bcmOAMActionCopyToCpu = 3, /* Send the packet to CPU. */ 860 bcmOAMActionFwdAsData = 4, /* Forward the packet as normal data 861 packet. */ 862 bcmOAMActionFwd = 5, /* Forward the packet to a specified 863 destination. */ 864 bcmOAMActionUcDrop = 6, /* Drop UC OAM packet. */ 865 bcmOAMActionUcCopyToCpu = 7, /* Send UC OAM packet to CPU. */ 866 bcmOAMActionUcFwdAsData = 8, /* Forward UC OAM packet as normal data 867 packet. */ 868 bcmOAMActionUcFwd = 9, /* Forward UC OAM packet to a specified 869 destination. */ 870 bcmOAMActionMcDrop = 10, /* Drop MC OAM packet. */ 871 bcmOAMActionMcCopyToCpu = 11, /* Send MC OAM packet to CPU. */ 872 bcmOAMActionMcFwdAsData = 12, /* Forward MC OAM packet as normal data 873 packet. */ 874 bcmOAMActionMcFwd = 13, /* Forward MC OAM packet to a specified 875 destination. */ 876 bcmOAMActionLowMdlDrop = 14, /* Drop low MDL packet. */ 877 bcmOAMActionLowMdlCopyToCpu = 15, /* copy low MDL packets to CPU. */ 878 bcmOAMActionLowMdlFwdAsData = 16, /* Forward low MDL packets as normal 879 data packets. */ 880 bcmOAMActionLowMdlFwd = 17, /* Forward low MDL packets to a 881 specified destination. */ 882 bcmOAMActionMyStationMissCopyToCpu = 18, /* Forward MY_STATION_MISS packets to 883 CPU. */ 884 bcmOAMActionMyStationMissDrop = 19, /* DROP MY_STATION_MISS packets. */ 885 bcmOAMActionMyStationMissFwdAsData = 20, /* Forward MY_STATION_MISS packets as 886 normal data packets. */ 887 bcmOAMActionMyStationMissFwd = 21, /* Forward MY_STATION_MISS packets to a 888 specified destination. */ 889 bcmOAMActionProcessInHw = 22, /* Process in internal OAM/CCM engine. */ 890 bcmOAMActionLowMdlCcmFwdAsRegularCcm = 23, /* Use same action as that of normal 891 CCM. */ 892 bcmOAMActionSLMEnable = 24, /* Count SLM packets, disable of data 893 packets counting. */ 894 bcmOAMActionLowMdlProcessInInternalOamEngine = 25, /* Process Low MDL packets in internal 895 OAM/CCM engine. */ 896 bcmOAMActionL2StationMissProcessInInternalOamEngine = 26, /* Process l2 station miss packets in 897 internal CCM engine. */ 898 bcmOAMActionL2StationHitProcessInInternalOamEngine = 27, /* Process L2 station hit packets in 899 internal CCM engine. */ 900 bcmOAMActionMCProcessInInternalOamEngine = 28, /* Process Multicast OAM packets in 901 internal OAM engine. */ 902 bcmOAMActionSampleTimeStamp = 29, /* Sample the time stamp value to DM 903 packet. */ 904 bcmOAMActionSampleLmCounter = 30, /* Sample the counter value to LM 905 packet. */ 906 bcmOAMActionCount = 31 /* Always Last. Not a usable value. */ 907 } bcm_oam_action_type_t; 908 909 /* OAM Control types */ 910 typedef enum bcm_oam_control_type_e { 911 bcmOamControlFlexibleDropPort = 0, /* Flexible drop control for Ingress 912 port-domain OAM */ 913 bcmOamControlFlexibleDropCVlan = 1, /* Flexible drop control for Ingress 914 C-VLAN domain OAM */ 915 bcmOamControlFlexibleDropSVlan = 2, /* Flexible drop control for Ingress 916 S-VLAN domain OAM */ 917 bcmOamControlFlexibleDropCPlusSVlan = 3, /* Flexible drop control for Ingress 918 C+S-VLAN domain OAM */ 919 bcmOamControlFlexibleDropVP = 4, /* Flexible drop control for Ingress VP 920 based(PBB-TE) OAM domain */ 921 bcmOamControlFlexibleDropEgressPort = 5, /* Flexible drop control for egress 922 port-domain OAM */ 923 bcmOamControlFlexibleDropEgressCVlan = 6, /* Flexible drop control for egress 924 C-VLAN domain OAM */ 925 bcmOamControlFlexibleDropEgressSVlan = 7, /* Flexible drop control for egress 926 S-VLAN domain OAM */ 927 bcmOamControlFlexibleDropEgressCPlusSVlan = 8, /* Flexible drop control for egress 928 C+S-VLAN domain OAM */ 929 bcmOamControlFlexibleDropEgressVP = 9, /* Flexible drop control for egress VP 930 based (PBB-TE) OAM domain */ 931 bcmOamControlFlexibleDropPasssiveSap = 10, /* Flexible drop control for S-VLAN 932 domain Passive OAM filtering */ 933 bcmOamControlFlexibleDropEgressPasssiveSap = 11, /* Flexible drop control for egress 934 S-VLAN domain Passive OAM filtering */ 935 bcmOamControlReportMode = 12, /* Accepts of one of the 936 bcm_oam_report_mode_type_t as the 937 arg. */ 938 bcmOamControlUnknownAchCount = 13, /* Count unknown ACH or Any VCCV packet 939 with or without ACH. */ 940 bcmOamControlNtpToD = 14, /* Set the NTP Time of Day used for DM. */ 941 bcmOamControl1588ToD = 15, /* Set the 1588 Time of Day used for DM. */ 942 bcmOamControlSrcMacLsbReserve = 16, /* Reserve Src-Mac LSB value to be used 943 for OAM endpoints (resource shared 944 with BFD endpoints) */ 945 bcmOamControlSrcMacLsbUnReserve = 17, /* Unreserve Src-Mac LSB value (resource 946 shared with BFD endpoints) */ 947 bcmOamControlLmPcpCounterRangeMax = 18, /* lm_counter_base_ids between Max and 948 Min will count by priority */ 949 bcmOamControlLmPcpCounterRangeMin = 19, /* lm_counter_base_ids between Max and 950 Min will count by priority */ 951 bcmOamControlOampPuntPacketIntPri = 20, /* Bits [1:0] of given value determine 952 the color (DP), bits [4:2] determine 953 the Traffic Class */ 954 bcmOamControlOampCCMWeight = 21, /* Given may be between 0 and 6 */ 955 bcmOamControlOampSATWeight = 22, /* Given may be between 0 and 6 */ 956 bcmOamControlOampResponseWeight = 23, /* Given may be between 0 and 6 */ 957 bcmOamControlOampStatsTxOpcode = 24, /* Enable/Disable counting of specific 958 opcode in Tx, may be used in 959 bcm_oam_control_indexed_set/get. The 960 Index is the OpCode (CCM OpCode also 961 controls counting BFD PDUs) */ 962 bcmOamControlOampStatsRxOpcode = 25, /* Enable/Disable counting of specific 963 opcode in Rx, may be used in 964 bcm_oam_control_indexed_set/get. The 965 Index is the OpCode (CCM OpCode also 966 controls counting BFD PDUs) */ 967 bcmOamControlOampStatsShift = 26, /* Used for building counter pointer for 968 OAMP Tx/Rx statistics */ 969 bcmOamControlNativeEthernetOverPweClassification = 27, /* If value is set, OAM packets over 970 native Ethernet over PWE is 971 recognized as data packet on PWE LIF. 972 If value is unset, OAM packet is 973 recognized as OAM packet */ 974 bcmOamControlEnableNextReceivedSlr = 28, /* When set, LM session should not be 975 used with self-contained MEP-DB 976 entries. */ 977 bcmOamControlMplsLmQueryControlCode = 29, /* Configures the Control Code in 978 transmitted LM Query PDU. */ 979 bcmOamControlMplsLmResponderControlCode = 30, /* Configures the Control Code in 980 transmitted LM Response PDU. */ 981 bcmOamControlMplsDmQueryControlCode = 31, /* Configures the Control Code in 982 transmitted DM Query PDU. */ 983 bcmOamControlMplsDmResponderControlCode = 32, /* Configures the Control Code in 984 transmitted DM Response PDU. */ 985 bcmOamControlMplsLmDmOampActionPerQueryControlCode = 33, /* Determine action per Control Code for 986 incoming Query packets in the OAMP - 987 set arg to 1 to ignore packets, 2 to 988 punt, and 0 to process measurement 989 data. */ 990 bcmOamControlMplsLmDmOampActionPerResponseControlCode = 34, /* Determine action per Control Code for 991 incoming Response packets in the OAMP 992 - set arg to 1 to ignore packets, 2 993 to punt, and 0 to process measurement 994 data. */ 995 bcmOamControlMplsOamMdlIgnore = 35, /* Enable/Disable ingoring MDL when 996 identifying Y.1731 OAM over MPLS-TP. */ 997 bcmOAMControlCount = 36 /* Always Last. Not a usable value. */ 998 } bcm_oam_control_type_t; 999 1000 /* Drop conditions that need to be ignored */ 1001 typedef enum bcm_oam_condition_e { 1002 bcmOamConditionPFCDrop = 0, /* PFC frames marked for drop */ 1003 bcmOamConditionFlowControlDrop = 1, /* VOQ Flow control packet marked for 1004 drop */ 1005 bcmOamConditionMacsaEqualsMacdaDrop = 2, /* Packet marked for drop by the DoS 1006 prevention logic due to MAC SA = MAC 1007 DA condition set via 1008 bcmSwitchDosAttackMACSAEqualMACDA */ 1009 bcmOamConditionAutoMulticastTunnelControlPacketDrop = 3, /* AMT(Auto Multicast Tunnel) control 1010 packet marked for drop due to AMT 1011 tunnel configuration being set to not 1012 to send AMT control packet to CPU */ 1013 bcmOamConditionUnknownSubportErrorDrop = 4, /* Packet marked for drop for coming 1014 from an unknown subtending port */ 1015 bcmOamConditionSubportPktTagDrop = 5, /* Packet with link layer tag marked for 1016 drop. This happens when 1017 bcmPortControlSubportPktTagDrop 1018 control is set to drop packets with 1019 LLTAG(TR101) */ 1020 bcmOamConditionNoSubportPktTagDrop = 6, /* Packet without link layer tag marked 1021 for drop. This happens when 1022 bcmPortControlNoSubportPktTagDrop 1023 control is set to drop packets with 1024 link layer tag(TR101) */ 1025 bcmOamConditionIngressFilterDrop = 7, /* Packet marked for drop due to port 1026 not being a member of VLAN. This 1027 happens when VLAN filtering is 1028 enabled by passing 1029 BCM_PORT_VLAN_MEMBER_INGRESS flags to 1030 bcm_port_vlan_member_set API */ 1031 bcmOamConditionEgressFilterDrop = 8, /* Packet marked for drop due to port 1032 not being a member of VLAN. This 1033 happens when VLAN filtering is 1034 enabled by passing 1035 BCM_PORT_VLAN_MEMBER_EGRESS flags to 1036 bcm_port_vlan_member_set API */ 1037 bcmOamConditionInvalidTpidDrop = 9, /* Packet marked for drop due to 1038 mismatch between packet VLAN TPID and 1039 configured VLAN TPID value (in VLAN 1040 profile) */ 1041 bcmOamConditionOamMetadataHeaderErrorDrop = 10, /* Packet marked for drop due to OLP 1042 (OAM metadata) header error */ 1043 bcmOamConditionFieldLookupDrop = 11, /* Packet marked for drop due to VFP 1044 action */ 1045 bcmOamConditionSATDrop = 12, /* Packet marked for drop by SAT */ 1046 bcmOamConditionVlanTranslateIngressMissDrop = 13, /* Packet marked for drop due to vlan 1047 translate miss. This drop is 1048 configured via VLAN control 1049 bcmVlanTranslateIngressMissDrop */ 1050 bcmOamConditionVlanTranslateEgressMissDrop = 14, /* Packet marked for drop due to vlan 1051 translate miss. This drop is 1052 configured via VLAN control 1053 bcmVlanTranslateEgressMissDrop */ 1054 bcmOamConditionMplsLabelLookupMissDrop = 15, /* Packet marked for drop due to MPLS 1055 label lookup miss */ 1056 bcmOamConditionMplsInvalidActionDrop = 16, /* Packet marked for drop due to MPLS 1057 lookup result configured with invalid 1058 action */ 1059 bcmOamConditionMplsInvalidPayloadDrop = 17, /* Packet marked for drop by MPLS 1060 processing due to invalid payload */ 1061 bcmOamConditionMplsTtlErrorDrop = 18, /* Packet marked for drop due to MPLS 1062 TTL check fail */ 1063 bcmOamConditionStgNotInForwardDrop = 19, /* Packet marked for drop due to 1064 Spanning tree not being in 1065 FORWARDING_STATE */ 1066 bcmOamConditionEgressTtlErrorDrop = 20, /* Packet marked for drop due to TTL 1067 error */ 1068 bcmOamConditionEgressStgBlockedDrop = 21, /* Packet marked for drop due to 1069 Spanning tree in blocking state */ 1070 bcmOamConditionEgressStgDisabledDrop = 22, /* Packet marked for drop due to 1071 Spanning tree in disable state */ 1072 bcmOamConditionEgressIPMCSameVlanPruneDrop = 23, /* IPMC packet marked for drop due to 1073 bcmSwitchIpmcSameVlanPruning setting. 1074 When this is set, trying to do L2 1075 switching for an IPMC packet results 1076 in packet drop */ 1077 bcmOamConditionEgressMMUErrorDrop = 24, /* Packet marked for drop due to MMU 1078 error - purge/age */ 1079 bcmOamConditionEgressBadTdipDrop = 25, /* Packet marked for drop due to bad 1080 tunnel destination IP in case of 6to4 1081 tunnels and ISATAP tunnels - possible 1082 reasons are incorrect prefix for IPv6 1083 DIP, IPv4 DIP/SIP is 1084 BC/Zero/loopback/Class-D , IPv4 SIP = 1085 DIP */ 1086 bcmOamConditionEgressUnknownVlanDrop = 26, /* Packet marked for drop due to unknown 1087 VLAN. This happens when 1088 bcmVlanDropUnknown vlan control is 1089 used to set dropping of unknown VLAN 1090 packets */ 1091 bcmOamConditionEgressCompositeErrorDrop = 27, /* Packet marked for drop due to parity 1092 error from memories or ISM lookup 1093 fail */ 1094 bcmOamConditionEgressSplitHorizonDrop = 28, /* Packet marked for drop due to split 1095 horizon check. This is done by 1096 enabling pruning for DVP network 1097 group via 1098 bcm_switch_network_group_config_set 1099 with 1100 BCM_SWITCH_NETWORK_GROUP_EGRESS_PRUNE_ENABLE */ 1101 bcmOamConditionEgressSVPRemovalDrop = 29, /* Packet marked for drop due to virtual 1102 port pruning - SVP = DVP and VP based 1103 pruning is enabled 1104 (DISABLE_VP_PRUNING is set to 0 in 1105 Source VP table) */ 1106 bcmOamConditionEgressNonUCPruneDrop = 30, /* Non-unicast packet marked for drop 1107 due to drop condition set in egress 1108 next hop via bcm_mpls_port_add API 1109 with BCM_MPLS_PORT_DROP flag */ 1110 bcmOamConditionCount = 31 /* Always Last. Not a usable value. */ 1111 } bcm_oam_condition_t; 1112 1113 /* OAM lookup types */ 1114 typedef enum bcm_oam_lookup_type_e { 1115 bcmOamLookupTypePort = 0, /* Port based Ethernet OAM */ 1116 bcmOamLookupTypeInnerVlan = 1, /* Inner Vlan based Ethernet OAM */ 1117 bcmOamLookupTypeOuterVlan = 2, /* Outer Vlan based Ethernet OAM */ 1118 bcmOamLookupTypeOuterPlusInnerVlan = 3, /* Outer+inner vlan based Ethernet OAM */ 1119 bcmOamLookupTypeVirtualPort = 4, /* VP based Ethernet OAM */ 1120 bcmOamLookupTypeOuterVlanPassive = 5, /* Outer Vlan based passive Ethernet OAM */ 1121 bcmOamLookupTypeMplsSection = 6, /* MPLS section OAM */ 1122 bcmOamLookupTypeMplsLsp = 7, /* MPLS LSP OAM */ 1123 bcmOamLookupTypeMplsPw = 8, /* MPLS Pseudo-wire OAM */ 1124 bcmOamLookupTypeEgressPort = 9, /* Egress Port based Ethernet OAM */ 1125 bcmOamLookupTypeEgressInnerVlan = 10, /* Egress inner VLAN based Ethernet OAM */ 1126 bcmOamLookupTypeEgressOuterVlan = 11, /* Egress Outer Vlan based Ethernet OAM */ 1127 bcmOamLookupTypeEgressOuterPlusInnerVlan = 12, /* Egress outer+inner VLAN based Eth-oam */ 1128 bcmOamLookupTypeEgressVirtualPort = 13, /* Egress VP based Ethernet OAM */ 1129 bcmOamLookupTypeEgressOuterVlanPassive = 14, /* Egress outer Vlan based passive 1130 Eth-OAM */ 1131 bcmOamLookupTypeEgressMplsSection = 15, /* Egress MPLS section OAM */ 1132 bcmOamLookupTypeEgressMplsLsp = 16, /* Egress MPLS LSP OAM */ 1133 bcmOamLookupTypeEgressMplsPw = 17, /* Egress MPLS Pseudo-wire OAM */ 1134 bcmOamLookupTypeCount = 18 /* Always Last. Not a usable value. */ 1135 } bcm_oam_lookup_type_t; 1136 1137 /* MPLS LM DM (RFC 6374) opcode types */ 1138 typedef enum bcm_oam_mpls_lm_dm_opcode_type_e { 1139 bcmOamMplsLmDmOpcodeTypeLm = 0, /* RFC 6374 Loss Measurement packet */ 1140 bcmOamMplsLmDmOpcodeTypeDm = 1, /* RFC6374 Delay Measurement Packet */ 1141 bcmOamMplsLmDmOpcodeTypeIlm = 2, /* RFC6374 Inferred Loss Measurement 1142 Packet */ 1143 bcmOamMplsLmDmOpcodeTypeLmPlusDm = 3, /* RFC 6374 LM+DM packet */ 1144 bcmOamMplsLmDmOpcodeTypeIlmPlusDm = 4, /* RFC 6374 ILM+DM packet */ 1145 bcmOamMplsLmDmOpcodeTypeMax = 5 /* Max number of opcodes. Not an usable 1146 value. */ 1147 } bcm_oam_mpls_lm_dm_opcode_type_t; 1148 1149 /* MPLS LM DM (RFC 6374) counter types */ 1150 typedef enum bcm_oam_lm_counter_type_e { 1151 bcmOamLmCounterTypePkt = 0, /* Counts packets */ 1152 bcmOamLmCounterTypeByte = 1, /* Counts bytes */ 1153 bcmOamLmCounterTypeCount = 2 /* Always the last value. Not usable. */ 1154 } bcm_oam_lm_counter_type_t; 1155 1156 /* MPLS LM DM (RFC 6374) counter sizes */ 1157 typedef enum bcm_oam_lm_counter_size_e { 1158 bcmOamLmCounterSize32Bit = 0, /* Counter size is 32 bit */ 1159 bcmOamLmCounterSize64Bit = 1, /* Counter size is 64 bit */ 1160 bcmOamLmCounterSizeCount = 2 /* Always the last value. Not usable. */ 1161 } bcm_oam_lm_counter_size_t; 1162 1163 /* OAM TLV pattern type */ 1164 typedef enum bcm_oam_tlv_pattern_type_e { 1165 bcmOamTlvTypeNone = 0, /* No TLV */ 1166 bcmOamTlvTypeData = 1, /* Type = Data (3) */ 1167 bcmOamTlvTypeTestPrbsWithCRC = 2, /* Type = Test (32), pattern type is 1168 PRBS with CRC */ 1169 bcmOamTlvTypeTestPrbsWithoutCRC = 3, /* Type = Test (32), pattern type is 1170 PRBS without CRC */ 1171 bcmOamTlvTypeTestNullWithCRC = 4, /* Type = Test (32), pattern type is 1172 NULL with CRC */ 1173 bcmOamTlvTypeTestNullWithoutCRC = 5, /* Type = Test (32), pattern type is 1174 NULL without CRC */ 1175 bcmOamTlvTypeCount = 6 1176 } bcm_oam_tlv_pattern_type_t; 1177 1178 /* OAM event callback flags */ 1179 #define BCM_OAM_EVENT_FLAGS_MULTIPLE 0x01 /* Indicates that more than 1180 one event of the given 1181 type has occurred. */ 1182 1183 typedef struct bcm_oam_event_types_s { 1184 SHR_BITDCL w[_SHR_BITDCLSIZE(bcmOAMEventCount)]; 1185 } bcm_oam_event_types_t; 1186 1187 typedef struct bcm_oam_conditions_s { 1188 SHR_BITDCL cbits[_SHR_BITDCLSIZE(bcmOamConditionCount)]; 1189 } bcm_oam_conditions_t; 1190 1191 typedef struct bcm_oam_lookup_types_s { 1192 SHR_BITDCL tbits[_SHR_BITDCLSIZE(bcmOamLookupTypeCount)]; 1193 } bcm_oam_lookup_types_t; 1194 1195 #define BCM_OAM_EVENT_TYPE_SET(_event_types, _event_type) SHR_BITSET(((_event_types).w), (_event_type)) 1196 1197 #define BCM_OAM_EVENT_TYPE_GET(_event_types, _event_type) SHR_BITGET(((_event_types).w), (_event_type)) 1198 1199 #define BCM_OAM_EVENT_TYPE_CLEAR(_event_types, _event_type) SHR_BITCLR(((_event_types).w), (_event_type)) 1200 1201 #define BCM_OAM_EVENT_TYPE_SET_ALL(_event_types) SHR_BITSET_RANGE(((_event_types).w), 0, bcmOAMEventCount) 1202 1203 #define BCM_OAM_EVENT_TYPE_CLEAR_ALL(_event_types) SHR_BITCLR_RANGE(((_event_types).w), 0, bcmOAMEventCount) 1204 1205 /* OAM Port Status TLV values */ 1206 #define BCM_OAM_PORT_TLV_BLOCKED 0x1 /* Port is blocked */ 1207 #define BCM_OAM_PORT_TLV_UP 0x2 /* Port is ready to pass data */ 1208 1209 /* OAM Interface Status TLV Values */ 1210 #define BCM_OAM_INTERFACE_TLV_UP 0x1 /* Interface is ready to 1211 pass packets */ 1212 #define BCM_OAM_INTERFACE_TLV_DOWN 0x2 /* Interface is down */ 1213 #define BCM_OAM_INTERFACE_TLV_TESTING 0x3 /* Interface is in some 1214 test mode */ 1215 #define BCM_OAM_INTERFACE_TLV_UNKNOWN 0x4 /* Interface is in an 1216 unknown state */ 1217 #define BCM_OAM_INTERFACE_TLV_DORMANT 0x5 /* Interface is in a 1218 pending state */ 1219 #define BCM_OAM_INTERFACE_TLV_NOTPRESENT 0x6 /* Interface is down 1220 because of hardware 1221 component */ 1222 #define BCM_OAM_INTERFACE_TLV_LLDOWN 0x7 /* Interface is down due 1223 to state of 1224 lower-layer interfaces */ 1225 1226 /* OAM group ID type */ 1227 typedef int bcm_oam_group_t; 1228 1229 /* 1230 * OAM group object. This is equivalent to an 802.1ag Maintenance 1231 * Association (MA). 1232 */ 1233 typedef struct bcm_oam_group_info_s { 1234 uint32 flags; 1235 bcm_oam_group_t id; 1236 uint8 name[BCM_OAM_GROUP_NAME_LENGTH]; /* This is equivalent to the Maintenance 1237 Association ID (MAID) in 802.1ag. 1238 Note that this is not a 1239 null-terminated string but an array 1240 of bytes. To avoid memory 1241 corruption, do not use string copy to 1242 populate this field. */ 1243 uint8 rx_name[BCM_OAM_GROUP_NAME_LENGTH]; /* Additional MAID used for received OAM 1244 packets. It is used when the flag 1245 BCM_OAM_GROUP_RX_NAME is set. When 1246 used, the received MAID values are 1247 compared to this MAID instead of the 1248 'name' field. */ 1249 uint32 faults; /* Fault flags */ 1250 uint32 persistent_faults; /* Persistent fault flags */ 1251 uint32 clear_persistent_faults; /* Persistent fault flags to clear on a 1252 'get' */ 1253 bcm_oam_group_fault_alarm_defect_priority_t lowest_alarm_priority; /* Generate fault alarm for this 1254 maintenance endpoint when defects of 1255 greater than or equal to this 1256 priority value are detected on this 1257 maintenance endpoint */ 1258 int group_name_index; /* Pointer to first extended data entry */ 1259 } bcm_oam_group_info_t; 1260 1261 /* OAM endpoint ID type */ 1262 typedef int bcm_oam_endpoint_t; 1263 1264 /* OAM additional data for mpls network */ 1265 typedef struct bcm_oam_mpls_network_info_s { 1266 uint8 function_type; /* FFD:0x07 or CV:0x01 */ 1267 bcm_ip6_t lsr_id; 1268 uint32 lsp_id; 1269 } bcm_oam_mpls_network_info_t; 1270 1271 /* OAM action profile encoding according type */ 1272 typedef int bcm_oam_profile_t; 1273 1274 /* 1275 * Type of default memory that should be allocated for endpoint 1276 * SelfContained - Full entry in endpoint area, LmDmOffloaded - Full 1277 * entry in extra data area, ShortEntry - Short entry in endpoint area. 1278 */ 1279 typedef enum bcm_oam_endpoint_memory_type_e { 1280 bcmOamEndpointMemoryTypeSelfContained = 0, 1281 bcmOamEndpointMemoryTypeLmDmOffloadedEntry = 1, 1282 bcmOamEndpointMemoryTypeShortEntry = 2 1283 } bcm_oam_endpoint_memory_type_t; 1284 1285 /* Signal degradation indication. */ 1286 typedef enum bcm_oam_endpoint_signal_e { 1287 bcmOamEndpointSignalOk = 0, 1288 bcmOamEndpointSignalError = 1 1289 } bcm_oam_endpoint_signal_t; 1290 1291 /* 1292 * OAM endpoint object. This is equivalent to an 802.1ag Maintenance 1293 * Endpoint (MEP). 1294 */ 1295 typedef struct bcm_oam_endpoint_info_s { 1296 uint32 flags; 1297 uint32 flags2; 1298 uint32 opcode_flags; /* OAM opcode flags */ 1299 uint32 lm_flags; /* OAM loss measurment flags */ 1300 bcm_oam_endpoint_t id; 1301 bcm_oam_endpoint_type_t type; 1302 bcm_oam_group_t group; /* The ID of the group to which this 1303 endpoint belongs */ 1304 uint16 name; /* A unique identifier of the endpoint 1305 within the group. This is equivalent 1306 to the MEPID in 802.1ag. */ 1307 bcm_oam_endpoint_t local_id; /* Used by remote endpoints only. */ 1308 int level; /* This is equivalent to the Maintenance 1309 Domain Level (MDL) in 802.1ag. */ 1310 int ccm_period; /* For local endpoints, this is the CCM 1311 transmission period in ms. For 1312 remote endpoints, this is the period 1313 on which CCM timeout is based. */ 1314 bcm_vlan_t vlan; /* The VLAN associated with this 1315 endpoint */ 1316 bcm_vlan_t inner_vlan; /* Configure with CVID for two-tag 1317 operation or set to 0 for one-tag */ 1318 bcm_gport_t gport; /* The gport associated with this 1319 endpoint */ 1320 bcm_gport_t tx_gport; /* TX gport associated with this 1321 endpoint */ 1322 int trunk_index; /* The trunk port index for this 1323 endpoint */ 1324 bcm_if_t intf_id; /* Interface Identifier */ 1325 bcm_mpls_label_t mpls_label; /* The MPLS label associated with 1326 packets received from the Peer 1327 Endpoint */ 1328 bcm_mpls_egress_label_t egress_label; /* The MPLS outgoing label information 1329 for the Local Endpoint */ 1330 bcm_oam_mpls_network_info_t mpls_network_info; /* MPLS networks information */ 1331 bcm_mac_t dst_mac_address; /* The destination MAC address 1332 associated with this endpoint */ 1333 bcm_mac_t src_mac_address; /* The source MAC address associated 1334 with this endpoint */ 1335 uint8 pkt_pri; /* Egress marking for outgoing CCMs */ 1336 uint8 inner_pkt_pri; /* Packet priority of inner encpsulated 1337 packet */ 1338 uint16 inner_tpid; /* Tpid of inner encpsulated packet */ 1339 uint16 outer_tpid; /* Tpid of outer encpsulated packet */ 1340 bcm_cos_t int_pri; /* Egress queuing for outgoing CCMs. For 1341 DownMEPs, this represents the index 1342 from the base queue. For UpMEPs, this 1343 represents the internal priority 1344 itself. */ 1345 uint8 cpu_qid; /* CPU queue for CCMs */ 1346 uint8 pri_map[BCM_OAM_INTPRI_MAX]; /* Priority mapping for LM counter table */ 1347 uint32 faults; /* Fault flags */ 1348 uint32 persistent_faults; /* Persistent fault flags */ 1349 uint32 clear_persistent_faults; /* Persistent fault flags to clear on a 1350 'get' */ 1351 int ing_map; /* Ingress QoS map profile */ 1352 int egr_map; /* Egress QoS map profile */ 1353 uint8 ms_pw_ttl; /* TTL used for multi-segment pseudowire */ 1354 uint8 port_state; /* Endpoint port status */ 1355 uint8 interface_state; /* Endpoint interface status */ 1356 bcm_oam_vccv_type_t vccv_type; /* VCCV pseudowire type */ 1357 bcm_vpn_t vpn; /* VPN id */ 1358 int lm_counter_base_id; /* Counter id associated with the mep */ 1359 uint8 lm_counter_if; /* Counter interface associated with the 1360 mep */ 1361 uint8 loc_clear_threshold; /* Number of packets required to reset 1362 the Loss-of-Continuity status per end 1363 point */ 1364 bcm_oam_timestamp_format_t timestamp_format; /* DM time stamp format - 1365 NTP/IEEE1588(PTP) */ 1366 uint16 subport_tpid; /* Tpid of subport Vlan in case of 1367 triple vlan encapsulation */ 1368 bcm_gport_t remote_gport; /* Local endpoint CCMs are forwarded to 1369 this remote unit for processing. */ 1370 bcm_gport_t mpls_out_gport; /* Out gport used for TX counting by BHH 1371 endpoints. */ 1372 int sampling_ratio; /* 0 - No packets sampled to the CPU. 1373 1-8 - Count of packets (with events) 1374 that need to arrive before one is 1375 sampled to the CPU. */ 1376 uint32 lm_payload_offset; /* Offset in bytes from TOP of the MPLS 1377 label stack from where the payload 1378 starts for byte count computation. */ 1379 uint32 lm_cos_offset; /* Offset of the Label from top of the 1380 stack which gives the EXP value for 1381 deriving the COS value - valid values 1382 are 0/1/2. */ 1383 bcm_oam_lm_counter_type_t lm_ctr_type; /* BYTE/PACKET. */ 1384 bcm_oam_lm_counter_size_t lm_ctr_sample_size; /* Valid values are 32/64. */ 1385 uint32 pri_map_id; /* OAM priority map id. */ 1386 int lm_ctr_pool_id; /* The loss measurement counter pool id 1387 from which the counters should be 1388 allocated. Valid values are 0/1/2. */ 1389 uint32 ccm_tx_update_lm_counter_base_id[BCM_OAM_LM_COUNTER_MAX]; /* The base index of the LM counter to 1390 be updated by Tx CCM packets */ 1391 uint32 ccm_tx_update_lm_counter_offset[BCM_OAM_LM_COUNTER_MAX]; /* Offset to the Base LM counter Id to 1392 be incremented by Tx CCM packets */ 1393 uint8 ccm_tx_update_lm_counter_action[BCM_OAM_LM_COUNTER_MAX]; /* LM Counter action (type 1394 bcm_oam_lm_counter_action_t) to be 1395 used by TX CCM packets */ 1396 uint8 ccm_tx_update_lm_counter_size; /* Number of LM counters to be 1397 incremented by Tx CCM packets */ 1398 uint32 session_id; /* OAM session id for packet processing 1399 in BTE. In FP based OAM - This will 1400 indicate flex counter base ID */ 1401 uint8 session_num_entries; /* Number of entries that can result in 1402 same session ID. In FP based OAM - 1403 This will indicate number of flex 1404 counter entries corresponding to same 1405 OAM session */ 1406 uint8 lm_count_profile; /* LM count profile for this endpoint. 1407 It will be 1 or 0 for selecting one 1408 of the two OAM LM count profiles. */ 1409 uint8 mpls_exp; /* EXP on which BHH will be running */ 1410 bcm_oam_endpoint_t action_reference_id; /* Reference endpoint id whose actions 1411 will be used on the new created 1412 endpoint. Default value: 1413 BCM_OAM_ENDPOINT_INVALID. API call 1414 will set the parameter to 1415 BCM_OAM_ENDPOINT_INVALID */ 1416 bcm_oam_profile_t acc_profile_id; /* Used by accelerated endpoints. */ 1417 bcm_oam_endpoint_memory_type_t endpoint_memory_type; /* Type of default endpoint memory */ 1418 int punt_good_packet_period; /* OAM good packets sampling period. 1419 Every punt_good_packet_period 1420 milliseconds, a single packet is 1421 punted to the CPU */ 1422 uint16 extra_data_index; /* Pointer to first extra data entry 1423 used per MEP for additional features */ 1424 bcm_oam_endpoint_signal_t rx_signal; /* Expected Signal Indication */ 1425 bcm_oam_endpoint_signal_t tx_signal; /* Transmitted Signal Indication */ 1426 } bcm_oam_endpoint_info_t; 1427 1428 /* OAM loss object. */ 1429 typedef struct bcm_oam_loss_s { 1430 uint32 flags; 1431 int loss_id; /* Oam Loss ID. */ 1432 bcm_oam_endpoint_t id; /* Endpoint ID of Local MEP. */ 1433 bcm_oam_endpoint_t remote_id; /* Endpoint ID of Remote MEP. */ 1434 int period; /* Frequency of loss tx period in 1435 milliseconds. */ 1436 int loss_threshold; /* Loss ratio (expressed in 100th of 1437 percent) which if exceeded will 1438 declare the period degraded with a 1439 Loss Measurement packet exception. A 1440 value of -1 for Loss Measurement 1441 exception on all received packets. */ 1442 int loss_nearend; /* Nearend loss (expressed in 100th of 1443 percent). A value os -1 if not 1444 available. */ 1445 int loss_farend; /* Farend loss (expressed in 100th of 1446 percent). A value os -1 if not 1447 available. */ 1448 uint32 loss_nearend_byte; /* Nearend loss in bytes. */ 1449 uint32 loss_farend_byte; /* Farend loss in bytes. */ 1450 uint32 loss_nearend_byte_upper; /* Nearend loss in bytes (Upper 32 bits 1451 in 64 bit byte count mode). */ 1452 uint32 loss_farend_byte_upper; /* Farend loss in bytes (Upper 32 bits 1453 in 64 bit byte count mode). */ 1454 int loss_nearend_max; /* Nearend maximal loss. A value os -1 1455 if not available. Reset when read. */ 1456 int loss_nearend_acc; /* Nearend accumulated loss. A value os 1457 -1 if not available. Reset when read. */ 1458 int loss_farend_max; /* Farend maximal loss. A value os -1 if 1459 not available. Reset when read. */ 1460 int loss_farend_acc; /* Farend accumulated loss. A value os 1461 -1 if not available. Reset when read. */ 1462 uint32 tx_nearend; /* Last local transmit frame count 1463 recorded at time of LMR */ 1464 uint32 rx_nearend; /* Last local receive frame count 1465 recorded at time of LMR */ 1466 uint32 tx_farend; /* Last peer transmit frame count 1467 recorded at time of LMR */ 1468 uint32 rx_farend; /* Last peer receive frame count 1469 recorded at time of LMR */ 1470 uint32 tx_nearend_byte; /* Local transmit byte count */ 1471 uint32 rx_nearend_byte; /* Local receive byte count */ 1472 uint32 tx_farend_byte; /* Peer transmit byte count */ 1473 uint32 rx_farend_byte; /* Peer receive byte count */ 1474 uint32 tx_nearend_byte_upper; /* Local transmit byte count (Upper 32 1475 bits in 64 bit byte count mode). */ 1476 uint32 rx_nearend_byte_upper; /* Local receive byte count (Upper 32 1477 bits in 64 bit byte count mode). */ 1478 uint32 tx_farend_byte_upper; /* Peer transmit byte count (Upper 32 1479 bits in 64 bit byte count mode). */ 1480 uint32 rx_farend_byte_upper; /* Peer receive byte count (Upper 32 1481 bits in 64 bit byte count mode). */ 1482 uint8 pkt_pri_bitmap; /* Bitmap of packet priorities which 1483 should be counted for LM. A value of 1484 zero is the equivalent of all ones. */ 1485 uint8 pkt_dp_bitmap; /* Bitmap of packet color or DP which 1486 should be counted for LM. A value of 1487 zero is the equivalent of all ones. */ 1488 uint8 pkt_pri; /* Egress marking for outgoing LM 1489 messages */ 1490 bcm_cos_t int_pri; /* Egress queuing for outgoing LM 1491 messages */ 1492 bcm_gport_t gport; /* For CEP only; may return a diverged 1493 LP */ 1494 uint32 rx_oam_packets; /* Count of OAM packets received by this 1495 endpoint */ 1496 uint32 tx_oam_packets; /* Count of OAM packets transmitted by 1497 this endpoint */ 1498 bcm_mac_t peer_da_mac_address; /* MAC DA in LMM injection in case peer 1499 endpoint is not configured in 1500 remote_id */ 1501 uint32 lm_counter_base_id[BCM_OAM_LM_COUNTER_MAX]; /* Base index of LM Counter group 1502 (returned during endpoint create) of 1503 the counter to be stamped or 1504 incremented */ 1505 uint32 lm_counter_offset[BCM_OAM_LM_COUNTER_MAX]; /* LM Counter offset from the base */ 1506 int lm_counter_action[BCM_OAM_LM_COUNTER_MAX]; /* LM Counter action (type 1507 bcm_oam_lm_counter_action_t) */ 1508 uint32 lm_counter_byte_offset[BCM_OAM_LM_COUNTER_MAX]; /* LM Counter byte offset for increment */ 1509 uint32 lm_counter_size; /* Valid index count in LM Counter array */ 1510 uint32 pm_id; /* Performance measurement ID in BTE */ 1511 int measurement_period; /* Slr measurement period in 1512 milliseconds. */ 1513 uint32 slm_counter_base_id; /* Must be even. Two counters are used, 1514 given counter for RX and given 1515 counter plus 1 for TX */ 1516 uint32 slm_counter_core_id; /* Slm counter core ID. */ 1517 } bcm_oam_loss_t; 1518 1519 /* OAM TLV object. */ 1520 typedef struct bcm_oam_tlv_s { 1521 bcm_oam_tlv_pattern_type_t tlv_type; 1522 int tlv_length; /* Length of the value field */ 1523 uint32 four_byte_repeatable_pattern; /* used when Type = Data (3) */ 1524 } bcm_oam_tlv_t; 1525 1526 /* OAM delay object. */ 1527 typedef struct bcm_oam_delay_s { 1528 uint32 flags; 1529 int delay_id; /* Oam Delay ID. */ 1530 bcm_oam_endpoint_t id; /* Endpoint ID of Local MEP. */ 1531 bcm_oam_endpoint_t remote_id; /* Endpoint ID of Remote MEP. */ 1532 int period; /* Frequency of delay tx period in 1533 milliseconds. Zero indicates single 1534 shot, -1 indicates disabling delay 1535 packets transmission */ 1536 bcm_time_spec_t delay_min; /* Minimal recorded delay to remote 1537 peer. Reset when read. */ 1538 bcm_time_spec_t delay_max; /* Maximul recorded delay to remote 1539 peer. Reset when read. */ 1540 bcm_time_spec_t delay; /* Last recorded delay to remote peer. */ 1541 bcm_time_spec_t txf; /* Time of transmit in forward 1542 direction. */ 1543 bcm_time_spec_t rxf; /* Time of reception in forward 1544 direction. */ 1545 bcm_time_spec_t txb; /* Time of transmit in backward 1546 direction. */ 1547 bcm_time_spec_t rxb; /* Time of reception in backward 1548 direction. */ 1549 uint8 pkt_pri; /* Egress marking for outgoing DM 1550 messages */ 1551 uint8 pkt_pri_bitmap; /* Bitmap of packet priorities which 1552 should be measured for DM. A value of 1553 zero is the equivalent of all ones. */ 1554 bcm_cos_t int_pri; /* Egress queuing for outgoing DM 1555 messages */ 1556 uint32 rx_oam_packets; /* Count of OAM packets received by this 1557 endpoint */ 1558 uint32 tx_oam_packets; /* Count of OAM packets transmitted by 1559 this endpoint */ 1560 bcm_oam_timestamp_format_t timestamp_format; /* OAM timestamp type */ 1561 bcm_mac_t peer_da_mac_address; /* MAC DA in DMM injection in case peer 1562 endpoint is not configured in 1563 remote_id */ 1564 uint32 pm_id; /* Performance measurement ID in BTE */ 1565 uint32 dm_tx_update_lm_counter_base_id[BCM_OAM_LM_COUNTER_MAX]; /* The base index of the LM counter to 1566 be updated by Tx DM packets */ 1567 uint32 dm_tx_update_lm_counter_offset[BCM_OAM_LM_COUNTER_MAX]; /* Offset to the Base LM counter Id to 1568 be incremented by Tx DM packets */ 1569 uint32 dm_tx_update_lm_counter_byte_offset[BCM_OAM_LM_COUNTER_MAX]; /* Byte offset in the Tx DM packet from 1570 which to increment the LM byte 1571 counter */ 1572 uint8 dm_tx_update_lm_counter_size; /* Number of LM counters to be 1573 incremented by Tx DM packets */ 1574 bcm_oam_tlv_t tlvs[BCM_OAM_MAX_NUM_TLVS_FOR_DM]; /* TLV contents of DM */ 1575 bcm_time_spec_t delay_min_near_end; /* Minimal recorded delay to local peer. 1576 Reset when read. */ 1577 bcm_time_spec_t delay_max_near_end; /* Maximul recorded delay to local peer. 1578 Reset when read. */ 1579 bcm_time_spec_t delay_near_end; /* Last recorded delay to local peer. */ 1580 } bcm_oam_delay_t; 1581 1582 /* OAM AIS (alarm indication signal) object. */ 1583 typedef struct bcm_oam_ais_s { 1584 uint32 flags; 1585 int ais_id; /* OAM AIS ID. */ 1586 bcm_oam_endpoint_t id; /* Endpoint ID of Local MEP. */ 1587 int period; /* Frequency of AIS tx period in 1588 milliseconds. */ 1589 int level; /* MD level on outgoing frames. */ 1590 bcm_mac_t peer_da_mac_address; /* MAC DA in AIS injection. */ 1591 uint8 pkt_pri; /* Egress marking for outgoing AIS messages. */ 1592 uint8 drop_eligible; /* Drop Eligibility for AIS. */ 1593 bcm_vlan_t outer_vlan; /* Outer vlan id for the AIS frame. */ 1594 uint8 outer_pkt_pri; /* Outer vlan packet prio for the AIS frame. */ 1595 uint16 outer_tpid; /* TPID of outer vlan for the AIS frame. */ 1596 bcm_vlan_t inner_vlan; /* Inner vlan id for the AIS frame. */ 1597 uint8 inner_pkt_pri; /* Inner vlan packet prio for the AIS frame. */ 1598 uint16 inner_tpid; /* TPID of inner vlan for the AIS frame. */ 1599 } bcm_oam_ais_t; 1600 1601 /* OAM TST TX object. */ 1602 typedef struct bcm_oam_tst_tx_s { 1603 bcm_oam_endpoint_t endpoint_id; /* Endpoint ID of Local MEP. */ 1604 int gtf_id; 1605 uint32 flags; 1606 bcm_mac_t peer_da_mac_address; /* MAC DA in TST injection. */ 1607 bcm_oam_tlv_t tlv; 1608 } bcm_oam_tst_tx_t; 1609 1610 /* OAM TST RX object. */ 1611 typedef struct bcm_oam_tst_rx_s { 1612 bcm_oam_endpoint_t endpoint_id; /* Endpoint ID of Local MEP. */ 1613 int ctf_id; 1614 uint32 flags; 1615 bcm_oam_tlv_t expected_tlv; 1616 uint64 rx_count; 1617 uint64 invalid_tlv_count; /* Count of invalid packets received 1618 (incorrect TLV) */ 1619 uint64 out_of_sequence; /* Count of out of sequence packets */ 1620 } bcm_oam_tst_rx_t; 1621 1622 /* OAM Signal Degradation/Signal Fault object. */ 1623 typedef struct bcm_oam_sd_sf_detection_s { 1624 bcm_oam_endpoint_t mep_id; /* Endpoint ID of Local MEP. */ 1625 bcm_oam_endpoint_t rmep_id; /* Endpoint ID of Remote MEP. */ 1626 uint16 sd_set_threshold; /* threshold of signal degradation 1627 indication */ 1628 uint16 sf_set_threshold; /* threshold of signal fault indication */ 1629 uint16 sd_clear_threshold; /* threshold of signal degradation clear */ 1630 uint16 sf_clear_threshold; /* threshold of signal fault clear */ 1631 uint8 flags; /* flags use to set alert method, 1632 suppress and others */ 1633 uint8 sd_indication; /* signal degradation indication */ 1634 uint8 sf_indication; /* signal fault indication */ 1635 uint16 sliding_window_length; /* size of the sliding window (1-256) */ 1636 uint16 sliding_window_cnt[BCM_OAM_MAX_NUM_SLINDING_WINDOWS]; /* 256 counters of per-period packets 1637 received */ 1638 uint16 sum_cnt; /* Sum of the sliding window packets 1639 (read-only) */ 1640 } bcm_oam_sd_sf_detection_t; 1641 1642 /* OAM Y.1711 alarm object. */ 1643 typedef struct bcm_oam_y_1711_alarm_s { 1644 bcm_oam_endpoint_t mep_id; /* Endpoint ID of Local MEP. */ 1645 bcm_oam_endpoint_t rmep_id; /* Endpoint ID of Remote MEP. */ 1646 uint8 d_excess_threshold; /* used for Y.1711 defects */ 1647 uint8 indicator_low_threshold; /* Y.1711 indicator control low threshold */ 1648 uint8 indicator_high_threshold; /* Y.1711 indicator control high threshold */ 1649 uint8 flags; /* flags use to set alert mothod and others */ 1650 uint8 d_excess; /* excess detect */ 1651 uint8 d_mismatch; /* mismatch detect */ 1652 uint8 d_mismerge; /* mismerge detect */ 1653 } bcm_oam_y_1711_alarm_t; 1654 1655 /* OAM loopback discovery record. */ 1656 typedef struct bcm_oam_loopback_discovery_record_s { 1657 uint32 flags; 1658 bcm_oam_endpoint_t id; /* Endpoint ID of discovered MEP/MIP. */ 1659 int ttl; /* TTL value to used to discover MEP/MIP. */ 1660 uint16 name; /* Discovered MEP ID */ 1661 } bcm_oam_loopback_discovery_record_t; 1662 1663 /* OAM loopback object. */ 1664 typedef struct bcm_oam_loopback_s { 1665 uint32 flags; 1666 bcm_oam_endpoint_t id; /* Endpoint ID of Local MEP. */ 1667 bcm_oam_endpoint_t remote_id; /* Endpoint ID of Remote MEP. */ 1668 int period; /* Frequency of loopback tx period in 1669 milliseconds or pps (packets/sec) 1670 depending on flags. Zero indicates 1671 single shot, -1 indicates disabling 1672 loopback packets transmission */ 1673 int ttl; /* TTL value to use in loopback message. */ 1674 bcm_oam_loopback_discovery_record_t discovered_me; /* Last ME discovered using loopback 1675 discovery. */ 1676 uint32 rx_count; /* Count of received packets since 1677 loopback add or last get. */ 1678 uint32 tx_count; /* Count of transmitted packets since 1679 loopback add or last get. */ 1680 uint32 drop_count; /* Count of dropped packets since 1681 loopback add or last get. */ 1682 uint32 unexpected_response; /* Count of unexpected response packets 1683 since loopback add or last get. */ 1684 uint32 out_of_sequence; /* Count of out of sequence packets. */ 1685 uint32 local_mipid_missmatch; /* Count of local mipid missmatch 1686 packets since loopback add or last 1687 get. */ 1688 uint32 remote_mipid_missmatch; /* Count of remote mipid missmatch 1689 packets since loopback add or last 1690 get. */ 1691 uint32 invalid_target_mep_tlv; /* Count of invalid target mep TLV 1692 packets since loopback add or last 1693 get. */ 1694 uint32 invalid_mep_tlv_subtype; /* Count of invalid mep TLV subtype 1695 packets since loopback add or last 1696 get. */ 1697 uint32 invalid_tlv_offset; /* Count of invalid TLV offset packets 1698 since loopback add or last get. */ 1699 bcm_mac_t peer_da_mac_address; /* MAC DA in loopback injection in case 1700 remote_id is not specified */ 1701 int num_tlvs; /* Number of TLV */ 1702 int invalid_tlv_count; /* Count of invalid packets received 1703 (incorrect TLV) */ 1704 int ctf_id; /* Ctf id number */ 1705 int gtf_id; /* Gtf id number */ 1706 bcm_oam_tlv_t tlvs[BCM_OAM_MAX_NUM_TLVS_FOR_LBM]; /* TLV contents of LBM */ 1707 uint32 lb_tx_update_lm_counter_base_id[BCM_OAM_LM_COUNTER_MAX]; /* The base index of the LM counter to 1708 be updated by Tx LB packets */ 1709 uint32 lb_tx_update_lm_counter_offset[BCM_OAM_LM_COUNTER_MAX]; /* Offset to the Base LM counter Id to 1710 be incremented by Tx LB packets */ 1711 uint8 lb_tx_update_lm_counter_size; /* Number of LM counters to be 1712 incremented by Tx LB packets */ 1713 bcm_cos_t int_pri; /* Optional: priority fields on ITMH 1714 header */ 1715 uint8 pkt_pri; /* Optional: priority fields on outer 1716 VLAN (PCP + DEI). -1 will ignore this 1717 field */ 1718 uint8 inner_pkt_pri; /* Optional: priority fields on inner 1719 VLAN (PCP + DEI) , when applicable. 1720 -1 will ignore this field */ 1721 } bcm_oam_loopback_t; 1722 1723 /* OAM PSC object. */ 1724 typedef struct bcm_oam_psc_s { 1725 uint32 flags; 1726 bcm_oam_endpoint_t id; /* Endpoint ID of Local MEP. */ 1727 bcm_oam_endpoint_t remote_id; /* Endpoint ID of Remote MEP. */ 1728 int version; /* Version number of message. */ 1729 int request; /* Request field. */ 1730 int pt; /* Protection type. */ 1731 uint8 fpath; /* The path reporting failure. */ 1732 uint8 path; /* The currently active path. */ 1733 int burst_rate; /* Burst interval in ms (suggested 3 ms). */ 1734 int slow_rate; /* Slow or normal interval in ms (suggested 1735 5000 ms). */ 1736 int tlv_length; /* Length of optional TLV. */ 1737 uint8 tlv; /* Optional TLV(s) of tlv_length. */ 1738 } bcm_oam_psc_t; 1739 1740 /* OAM PW Status object. */ 1741 typedef struct bcm_oam_pw_status_s { 1742 uint32 flags; 1743 bcm_oam_endpoint_t id; /* Endpoint ID of Local MEP. */ 1744 bcm_oam_endpoint_t remote_id; /* Endpoint ID of Remote MEP. */ 1745 int burst_rate; /* Burst interval in ms. */ 1746 int refresh; /* Refresh timer is copied into message and 1747 sets the local transmit interval in 1748 seconds. */ 1749 int ack; /* Copied into A field. */ 1750 uint8 tlv_length; /* Length of optional TLV. */ 1751 uint8 tlv; /* Optional TLV(s) of tlv_length. */ 1752 } bcm_oam_pw_status_t; 1753 1754 /* OAM CSF (alarm indication signal) object. */ 1755 typedef struct bcm_oam_csf_s { 1756 uint32 flags; /* CSF flags. */ 1757 uint32 type; /* CSF Type value in PDU. */ 1758 bcm_oam_endpoint_t id; /* Endpoint ID of Local MEP. */ 1759 int period; /* CSF Tx period in milliseconds. 1760 Supported values are 1000 and 60000 */ 1761 uint8 pkt_pri; /* Egress marking for outgoing CSF 1762 messages. */ 1763 bcm_cos_t int_pri; /* Egress queuing for outgoing CSF 1764 messages */ 1765 uint32 csf_tx_update_lm_counter_base_id[BCM_OAM_LM_COUNTER_MAX]; /* The base index of the LM counter to 1766 be updated by Tx CSF packets */ 1767 uint32 csf_tx_update_lm_counter_offset[BCM_OAM_LM_COUNTER_MAX]; /* Offset to the Base LM counter Id to 1768 be incremented by Tx CSF packets */ 1769 uint8 csf_tx_update_lm_counter_size; /* Number of LM counters to be 1770 incremented by Tx CSF packets */ 1771 } bcm_oam_csf_t; 1772 1773 typedef struct bcm_oam_endpoint_action_s { 1774 uint32 flags; 1775 SHR_BITDCL opcode_bmp[_SHR_BITDCLSIZE(256)]; 1776 SHR_BITDCL opcode_actions[_SHR_BITDCLSIZE(bcmOAMActionCount)]; 1777 bcm_gport_t destination; /* For remote handling. Can also be drop */ 1778 bcm_gport_t destination2; /* Another destination when required for 1779 example: MIP requires 2 destination 1780 traps, one for each direction */ 1781 } bcm_oam_endpoint_action_t; 1782 1783 #define BCM_OAM_ACTION_SET(_action, _action_type) SHR_BITSET(((_action).opcode_actions), (_action_type)) 1784 1785 #define BCM_OAM_ACTION_GET(_action, _action_type) SHR_BITGET(((_action).opcode_actions), (_action_type)) 1786 1787 #define BCM_OAM_ACTION_CLEAR(_action, _action_type) SHR_BITCLR(((_action).opcode_actions), (_action_type)) 1788 1789 #define BCM_OAM_ACTION_CLEAR_ALL(_action) SHR_BITCLR_RANGE(((_action).opcode_actions), 0, bcmOAMActionCount) 1790 1791 #define BCM_OAM_OPCODE_SET(_action, _opcode) SHR_BITSET(((_action).opcode_bmp), (_opcode)) 1792 1793 #define BCM_OAM_OPCODE_GET(_action, _opcode) SHR_BITGET(((_action).opcode_bmp), (_opcode)) 1794 1795 #define BCM_OAM_OPCODE_CLEAR(_action, _opcode) SHR_BITCLR(((_action).opcode_bmp), (_opcode)) 1796 1797 #define BCM_OAM_OPCODE_CLEAR_ALL(_action) SHR_BITCLR_RANGE(((_action).opcode_bmp), 0, 256) 1798 1799 #define BCM_OAM_LOOKUP_TYPE_SET(_type, _lookup_type) SHR_BITSET(((_type).tbits), _lookup_type) 1800 1801 #define BCM_OAM_LOOKUP_TYPE_GET(_type, _lookup_type) SHR_BITGET(((_type).tbits), _lookup_type) 1802 1803 #define BCM_OAM_LOOKUP_TYPE_CLEAR(_type, _lookup_type) SHR_BITCLR(((_type).tbits), _lookup_type) 1804 1805 #define BCM_OAM_LOOKUP_TYPE_CLEAR_ALL(_type) SHR_BITCLR_RANGE(((_type).tbits), 0, bcmOamLookupTypeCount) 1806 1807 #define BCM_OAM_CONDITION_SET(_condition, _drop) SHR_BITSET(((_condition).cbits), _drop) 1808 1809 #define BCM_OAM_CONDITION_GET(_condition, _drop) SHR_BITGET(((_condition).cbits), _drop) 1810 1811 #define BCM_OAM_CONDITION_CLEAR(_condition, _drop) SHR_BITCLR(((_condition).cbits), _drop) 1812 1813 #define BCM_OAM_CONDITION_CLEAR_ALL(_condition) SHR_BITCLR_RANGE(((_condition).cbits), 0, bcmOamConditionCount) 1814 1815 /* Callback function type for OAM group traversal */ 1816 typedef int (*bcm_oam_group_traverse_cb)( 1817 int unit, 1818 bcm_oam_group_info_t *group_info, 1819 void *user_data); 1820 1821 /* Callback function type for OAM endpoint traversal */ 1822 typedef int (*bcm_oam_endpoint_traverse_cb)( 1823 int unit, 1824 bcm_oam_endpoint_info_t *endpoint_info, 1825 void *user_data); 1826 1827 /* Callback function type for OAM event handling */ 1828 typedef int (*bcm_oam_event_cb)( 1829 int unit, 1830 uint32 flags, 1831 bcm_oam_event_type_t event_type, 1832 bcm_oam_group_t group, 1833 bcm_oam_endpoint_t endpoint, 1834 void *user_data); 1835 1836 typedef struct bcm_oam_performance_event_data_s { 1837 uint32 delta_FCB; /* TXFcb - RXFcb. Used for performance events of 1838 type bcmOAMEventEndpointLMStatistics. */ 1839 uint32 delta_FCf; /* TXFcf - RXFcb. Used for performance events of 1840 type bcmOAMEventEndpointLMStatistics. */ 1841 uint64 last_delay; /* Used for performance events of type 1842 bcmOAMEventEndpointDMStatistics. */ 1843 uint64 last_delay_near; /* Used for performance events of type one way 1844 bcmOAMEventEndpointDMStatistics in normal mode. */ 1845 } bcm_oam_performance_event_data_t; 1846 1847 /* Initialize a bcm_oam_performance_event_data_t structure. */ 1848 extern void bcm_oam_performance_event_data_t_init( 1849 bcm_oam_performance_event_data_t *performance_event_data_ptr); 1850 1851 /* Callback function type for OAM performance event handling */ 1852 typedef int (*bcm_oam_performance_event_cb)( 1853 int unit, 1854 bcm_oam_event_type_t event_type, 1855 bcm_oam_group_t group, 1856 bcm_oam_endpoint_t endpoint, 1857 bcm_oam_performance_event_data_t *event_data, 1858 void *user_data); 1859 1860 #ifndef BCM_HIDE_DISPATCHABLE 1861 1862 /* Initialize the BCM OAM subsystem. */ 1863 extern int bcm_oam_init( 1864 int unit); 1865 1866 /* Shut down the BCM OAM subsystem. */ 1867 extern int bcm_oam_detach( 1868 int unit); 1869 1870 #endif /* BCM_HIDE_DISPATCHABLE */ 1871 1872 /* Initialize a bcm_oam_group_info_t structure. */ 1873 extern void bcm_oam_group_info_t_init( 1874 bcm_oam_group_info_t *group_info); 1875 1876 #ifndef BCM_HIDE_DISPATCHABLE 1877 1878 /* Create or replace an OAM group object. */ 1879 extern int bcm_oam_group_create( 1880 int unit, 1881 bcm_oam_group_info_t *group_info); 1882 1883 /* Get an OAM group object. */ 1884 extern int bcm_oam_group_get( 1885 int unit, 1886 bcm_oam_group_t group, 1887 bcm_oam_group_info_t *group_info); 1888 1889 /* Destroy an OAM group object. */ 1890 extern int bcm_oam_group_destroy( 1891 int unit, 1892 bcm_oam_group_t group); 1893 1894 /* Destroy all OAM group objects. */ 1895 extern int bcm_oam_group_destroy_all( 1896 int unit); 1897 1898 /* Traverse the set of OAM groups. */ 1899 extern int bcm_oam_group_traverse( 1900 int unit, 1901 bcm_oam_group_traverse_cb cb, 1902 void *user_data); 1903 1904 #endif /* BCM_HIDE_DISPATCHABLE */ 1905 1906 /* Initialize a bcm_oam_endpoint_info_t structure. */ 1907 extern void bcm_oam_endpoint_info_t_init( 1908 bcm_oam_endpoint_info_t *endpoint_info); 1909 1910 #ifndef BCM_HIDE_DISPATCHABLE 1911 1912 /* Create or replace an OAM endpoint object. */ 1913 extern int bcm_oam_endpoint_create( 1914 int unit, 1915 bcm_oam_endpoint_info_t *endpoint_info); 1916 1917 /* Get an OAM endpoint object. */ 1918 extern int bcm_oam_endpoint_get( 1919 int unit, 1920 bcm_oam_endpoint_t endpoint, 1921 bcm_oam_endpoint_info_t *endpoint_info); 1922 1923 /* Destroy an OAM endpoint object. */ 1924 extern int bcm_oam_endpoint_destroy( 1925 int unit, 1926 bcm_oam_endpoint_t endpoint); 1927 1928 /* Destroy all OAM endpoint objects. */ 1929 extern int bcm_oam_endpoint_destroy_all( 1930 int unit, 1931 bcm_oam_group_t group); 1932 1933 /* Traverse the set of OAM endpoints in a group. */ 1934 extern int bcm_oam_endpoint_traverse( 1935 int unit, 1936 bcm_oam_group_t group, 1937 bcm_oam_endpoint_traverse_cb cb, 1938 void *user_data); 1939 1940 #endif /* BCM_HIDE_DISPATCHABLE */ 1941 1942 /* Initialize a bcm_oam_loss_t structure. */ 1943 extern void bcm_oam_loss_t_init( 1944 bcm_oam_loss_t *loss_ptr); 1945 1946 #ifndef BCM_HIDE_DISPATCHABLE 1947 1948 /* Add an OAM loss object */ 1949 extern int bcm_oam_loss_add( 1950 int unit, 1951 bcm_oam_loss_t *loss_ptr); 1952 1953 /* Get an OAM loss object */ 1954 extern int bcm_oam_loss_get( 1955 int unit, 1956 bcm_oam_loss_t *loss_ptr); 1957 1958 /* Delete an OAM loss object */ 1959 extern int bcm_oam_loss_delete( 1960 int unit, 1961 bcm_oam_loss_t *loss_ptr); 1962 1963 #endif /* BCM_HIDE_DISPATCHABLE */ 1964 1965 /* Initialize a bcm_oam_delay_t structure. */ 1966 extern void bcm_oam_delay_t_init( 1967 bcm_oam_delay_t *delay_ptr); 1968 1969 #ifndef BCM_HIDE_DISPATCHABLE 1970 1971 /* Add an OAM delay object */ 1972 extern int bcm_oam_delay_add( 1973 int unit, 1974 bcm_oam_delay_t *delay_ptr); 1975 1976 /* Get an OAM delay object */ 1977 extern int bcm_oam_delay_get( 1978 int unit, 1979 bcm_oam_delay_t *delay_ptr); 1980 1981 /* Delete an OAM delay object */ 1982 extern int bcm_oam_delay_delete( 1983 int unit, 1984 bcm_oam_delay_t *delay_ptr); 1985 1986 #endif /* BCM_HIDE_DISPATCHABLE */ 1987 1988 /* Initialize a bcm_oam_ais_t structure. */ 1989 extern void bcm_oam_ais_t_init( 1990 bcm_oam_ais_t *ais_ptr); 1991 1992 /* Initialize a bcm_oam_endpoint_action_t structure. */ 1993 extern void bcm_oam_endpoint_action_t_init( 1994 bcm_oam_endpoint_action_t *action_ptr); 1995 1996 #ifndef BCM_HIDE_DISPATCHABLE 1997 1998 /* Add an OAM ais object */ 1999 extern int bcm_oam_ais_add( 2000 int unit, 2001 bcm_oam_ais_t *ais_ptr); 2002 2003 /* Get an OAM ais object */ 2004 extern int bcm_oam_ais_get( 2005 int unit, 2006 bcm_oam_ais_t *ais_ptr); 2007 2008 /* Delete an OAM ais object */ 2009 extern int bcm_oam_ais_delete( 2010 int unit, 2011 bcm_oam_ais_t *ais_ptr); 2012 2013 #endif /* BCM_HIDE_DISPATCHABLE */ 2014 2015 /* Initialize a bcm_oam_tst_rx_t structure. */ 2016 extern void bcm_oam_tst_rx_t_init( 2017 bcm_oam_tst_rx_t *tst_rx_info); 2018 2019 #ifndef BCM_HIDE_DISPATCHABLE 2020 2021 /* Add an OAM TST rx object */ 2022 extern int bcm_oam_tst_rx_add( 2023 int unit, 2024 bcm_oam_tst_rx_t *tst_ptr); 2025 2026 /* Get an OAM TST rx object */ 2027 extern int bcm_oam_tst_rx_get( 2028 int unit, 2029 bcm_oam_tst_rx_t *tst_ptr); 2030 2031 /* Delete an OAM TST rx object */ 2032 extern int bcm_oam_tst_rx_delete( 2033 int unit, 2034 bcm_oam_tst_rx_t *tst_ptr); 2035 2036 #endif /* BCM_HIDE_DISPATCHABLE */ 2037 2038 /* Initialize a bcm_oam_tst_tx_t structure. */ 2039 extern void bcm_oam_tst_tx_t_init( 2040 bcm_oam_tst_tx_t *tst_tx_info); 2041 2042 #ifndef BCM_HIDE_DISPATCHABLE 2043 2044 /* Add an OAM TST tx object */ 2045 extern int bcm_oam_tst_tx_add( 2046 int unit, 2047 bcm_oam_tst_tx_t *tst_ptr); 2048 2049 /* Get an OAM TST tx object */ 2050 extern int bcm_oam_tst_tx_get( 2051 int unit, 2052 bcm_oam_tst_tx_t *tst_ptr); 2053 2054 /* Delete an OAM TST tx object */ 2055 extern int bcm_oam_tst_tx_delete( 2056 int unit, 2057 bcm_oam_tst_tx_t *tst_ptr); 2058 2059 #endif /* BCM_HIDE_DISPATCHABLE */ 2060 2061 /* Initialize a bcm_oam_sd_sf_detection_t structure. */ 2062 extern void bcm_oam_sd_sf_detection_t_init( 2063 bcm_oam_sd_sf_detection_t *sd_sf_ptr); 2064 2065 #ifndef BCM_HIDE_DISPATCHABLE 2066 2067 /* Add an OAM SD/SF detection object */ 2068 extern int bcm_oam_sd_sf_detection_add( 2069 int unit, 2070 bcm_oam_sd_sf_detection_t *sd_sf_ptr); 2071 2072 /* Get an OAM SD/SF detection object */ 2073 extern int bcm_oam_sd_sf_detection_get( 2074 int unit, 2075 bcm_oam_sd_sf_detection_t *sd_sf_ptr); 2076 2077 /* Delete an OAM SD/SF detection object */ 2078 extern int bcm_oam_sd_sf_detection_delete( 2079 int unit, 2080 bcm_oam_sd_sf_detection_t *sd_sf_ptr); 2081 2082 #endif /* BCM_HIDE_DISPATCHABLE */ 2083 2084 /* Initialize a Y.1711 Alarm structure */ 2085 extern void bcm_oam_y_1711_alarm_t_init( 2086 bcm_oam_y_1711_alarm_t *alarm_ptr); 2087 2088 #ifndef BCM_HIDE_DISPATCHABLE 2089 2090 /* Add an OAM y_1711 alarm object */ 2091 extern int bcm_oam_y_1711_alarm_add( 2092 int unit, 2093 bcm_oam_y_1711_alarm_t *alarm_ptr); 2094 2095 /* Get an OAM y_1711 alarm object */ 2096 extern int bcm_oam_y_1711_alarm_get( 2097 int unit, 2098 bcm_oam_y_1711_alarm_t *alarm_ptr); 2099 2100 /* Delete an OAM Y.1711 alarm object */ 2101 extern int bcm_oam_y_1711_alarm_delete( 2102 int unit, 2103 bcm_oam_y_1711_alarm_t *alarm_ptr); 2104 2105 #endif /* BCM_HIDE_DISPATCHABLE */ 2106 2107 /* Initialize an OAM PSC structure */ 2108 extern void bcm_oam_psc_t_init( 2109 bcm_oam_psc_t *psc_ptr); 2110 2111 #ifndef BCM_HIDE_DISPATCHABLE 2112 2113 /* Add an OAM PSC object */ 2114 extern int bcm_oam_psc_add( 2115 int unit, 2116 bcm_oam_psc_t *psc_ptr); 2117 2118 /* Get an OAM PSC object */ 2119 extern int bcm_oam_psc_get( 2120 int unit, 2121 bcm_oam_psc_t *psc_ptr); 2122 2123 /* Delete an OAM PSC object */ 2124 extern int bcm_oam_psc_delete( 2125 int unit, 2126 bcm_oam_psc_t *psc_ptr); 2127 2128 #endif /* BCM_HIDE_DISPATCHABLE */ 2129 2130 /* Initialize an OAM PW Status structure */ 2131 extern void bcm_oam_pw_status_t_init( 2132 bcm_oam_pw_status_t *pw_status_ptr); 2133 2134 #ifndef BCM_HIDE_DISPATCHABLE 2135 2136 /* Add an OAM PW Status object */ 2137 extern int bcm_oam_pw_status_add( 2138 int unit, 2139 bcm_oam_pw_status_t *pw_status_ptr); 2140 2141 /* Get an OAM PW Status object */ 2142 extern int bcm_oam_pw_status_get( 2143 int unit, 2144 bcm_oam_pw_status_t *pw_status_ptr); 2145 2146 /* Delete an OAM PW Status object */ 2147 extern int bcm_oam_pw_status_delete( 2148 int unit, 2149 bcm_oam_pw_status_t *pw_status_ptr); 2150 2151 #endif /* BCM_HIDE_DISPATCHABLE */ 2152 2153 /* Initialize a bcm_oam_csf_t structure. */ 2154 extern void bcm_oam_csf_t_init( 2155 bcm_oam_csf_t *csf_ptr); 2156 2157 #ifndef BCM_HIDE_DISPATCHABLE 2158 2159 /* Add an OAM csf object */ 2160 extern int bcm_oam_csf_add( 2161 int unit, 2162 bcm_oam_csf_t *csf_ptr); 2163 2164 /* Get an OAM csf object */ 2165 extern int bcm_oam_csf_get( 2166 int unit, 2167 bcm_oam_csf_t *csf_ptr); 2168 2169 /* Delete an OAM csf object */ 2170 extern int bcm_oam_csf_delete( 2171 int unit, 2172 bcm_oam_csf_t *csf_ptr); 2173 2174 /* Register a handler for OAM events. */ 2175 extern int bcm_oam_event_register( 2176 int unit, 2177 bcm_oam_event_types_t event_types, 2178 bcm_oam_event_cb cb, 2179 void *user_data); 2180 2181 /* Unregister a handler for OAM events. */ 2182 extern int bcm_oam_event_unregister( 2183 int unit, 2184 bcm_oam_event_types_t event_types, 2185 bcm_oam_event_cb cb); 2186 2187 /* Register a handler for OAM performance events. */ 2188 extern int bcm_oam_performance_event_register( 2189 int unit, 2190 bcm_oam_event_types_t event_types, 2191 bcm_oam_performance_event_cb cb, 2192 void *user_data); 2193 2194 /* Unregister a handler for OAM performance events. */ 2195 extern int bcm_oam_performance_event_unregister( 2196 int unit, 2197 bcm_oam_event_types_t event_types, 2198 bcm_oam_performance_event_cb cb); 2199 2200 #endif /* BCM_HIDE_DISPATCHABLE */ 2201 2202 /* Initialize a bcm_oam_loopback_t structure. */ 2203 extern void bcm_oam_loopback_t_init( 2204 bcm_oam_loopback_t *loopback_ptr); 2205 2206 #ifndef BCM_HIDE_DISPATCHABLE 2207 2208 /* Add an OAM loopback object */ 2209 extern int bcm_oam_loopback_add( 2210 int unit, 2211 bcm_oam_loopback_t *loopback_ptr); 2212 2213 /* Get an OAM loopback object */ 2214 extern int bcm_oam_loopback_get( 2215 int unit, 2216 bcm_oam_loopback_t *loopback_ptr); 2217 2218 /* Delete an OAM loopback object */ 2219 extern int bcm_oam_loopback_delete( 2220 int unit, 2221 bcm_oam_loopback_t *loopback_ptr); 2222 2223 /* Set actions for different OAM opcodes. */ 2224 extern int bcm_oam_endpoint_action_set( 2225 int unit, 2226 bcm_oam_endpoint_t id, 2227 bcm_oam_endpoint_action_t *action); 2228 2229 /* Configure device-wide OAM control. */ 2230 extern int bcm_oam_control_set( 2231 int unit, 2232 bcm_oam_control_type_t type, 2233 uint64 arg); 2234 2235 /* Get device-wide OAM control value. */ 2236 extern int bcm_oam_control_get( 2237 int unit, 2238 bcm_oam_control_type_t type, 2239 uint64 *arg); 2240 2241 /* Set Ethernet Y1731 opcode profile mapping. */ 2242 extern int bcm_oam_opcode_map_set( 2243 int unit, 2244 int opcode, 2245 int profile); 2246 2247 /* Get Ethernet Y1731 opcode profile mapping. */ 2248 extern int bcm_oam_opcode_map_get( 2249 int unit, 2250 int opcode, 2251 int *profile); 2252 2253 /* Enable/Disable a drop condition for an OAM lookup type */ 2254 extern int bcm_oam_lookup_enable_set( 2255 int unit, 2256 bcm_oam_lookup_type_t type, 2257 bcm_oam_condition_t condition, 2258 int enable); 2259 2260 /* Enable/Disable multiple drop conditions for OAM lookup types. */ 2261 extern int bcm_oam_lookup_enable_multi_set( 2262 int unit, 2263 bcm_oam_lookup_types_t types, 2264 bcm_oam_conditions_t conditions, 2265 int enable); 2266 2267 /* Get the drop conditions that are ignored for an OAM lookup type */ 2268 extern int bcm_oam_lookup_enable_get( 2269 int unit, 2270 bcm_oam_lookup_type_t type, 2271 bcm_oam_conditions_t *condition); 2272 2273 #endif /* BCM_HIDE_DISPATCHABLE */ 2274 2275 /* 2276 * OAM report mode types. To be used as the arg parameter when calling 2277 * bcm_oam_control_set/get() with the type parameter set to 2278 * bcmOamControlReportMode. 2279 */ 2280 typedef enum bcm_oam_report_mode_type_e { 2281 bcmOamReportModeTypeNormal = 0, /* Default report mode. */ 2282 bcmOamReportModeTypeCompact = 1, 2283 bcmOamReportModeTypeRaw = 2, /* Report mode events will be disabled 2284 when report mode is set to raw. */ 2285 bcmOamReportModeTypeCount = 3 2286 } bcm_oam_report_mode_type_t; 2287 2288 #define BCM_OAM_MAX_PM_PROFILE_BIN_EDGES 7 /* Maximum number of bin 2289 edges in each PM 2290 profile */ 2291 2292 /* PM profile creation flags */ 2293 #define BCM_OAM_PM_PROFILE_REPLACE 0x0001 /* Replace an existing OAM PM 2294 profile */ 2295 #define BCM_OAM_PM_PROFILE_WITH_ID 0x0002 /* Use the specified PM profile 2296 ID */ 2297 2298 /* OAM PM profile ID type */ 2299 typedef int bcm_oam_pm_profile_t; 2300 2301 /* PM profile info structure */ 2302 typedef struct bcm_oam_pm_profile_info_s { 2303 bcm_oam_pm_profile_t id; 2304 uint32 flags; 2305 uint32 bin_edges[BCM_OAM_MAX_PM_PROFILE_BIN_EDGES]; /* Bin edges */ 2306 } bcm_oam_pm_profile_info_t; 2307 2308 #ifndef BCM_HIDE_DISPATCHABLE 2309 2310 /* Create or replace an OAM Performance monitoring bin profile. */ 2311 extern int bcm_oam_pm_profile_create( 2312 int unit, 2313 bcm_oam_pm_profile_info_t *profile_info); 2314 2315 /* Delete an OAM Performance monitoring bin profile */ 2316 extern int bcm_oam_pm_profile_delete( 2317 int unit, 2318 bcm_oam_pm_profile_t profile_id); 2319 2320 /* Delete all the OAM Performance monitoring bin profiles. */ 2321 extern int bcm_oam_pm_profile_delete_all( 2322 int unit); 2323 2324 /* Get an OAM Performance monitoring bin profile */ 2325 extern int bcm_oam_pm_profile_get( 2326 int unit, 2327 bcm_oam_pm_profile_info_t *profile_info); 2328 2329 /* Attach a PM profile to an OAM endpoint */ 2330 extern int bcm_oam_pm_profile_attach( 2331 int unit, 2332 bcm_oam_endpoint_t endpoint_id, 2333 int profile_id); 2334 2335 /* Detach a PM profile from an endpoint */ 2336 extern int bcm_oam_pm_profile_detach( 2337 int unit, 2338 bcm_oam_endpoint_t endpoint_id, 2339 int profile_id); 2340 2341 /* Get the PM profile attached to an OAM endpoint */ 2342 extern int bcm_oam_pm_profile_attach_get( 2343 int unit, 2344 bcm_oam_endpoint_t endpoint_id, 2345 int *profile_id); 2346 2347 #endif /* BCM_HIDE_DISPATCHABLE */ 2348 2349 /* Callback function type for PM profiles traversal */ 2350 typedef int (*bcm_oam_pm_profile_traverse_cb)( 2351 int unit, 2352 bcm_oam_pm_profile_info_t *profile_info, 2353 void *user_data); 2354 2355 #ifndef BCM_HIDE_DISPATCHABLE 2356 2357 /* Traverse the list of pm profiles using the callback function */ 2358 extern int bcm_oam_pm_profile_traverse( 2359 int unit, 2360 bcm_oam_pm_profile_traverse_cb cb, 2361 void *user_data); 2362 2363 #endif /* BCM_HIDE_DISPATCHABLE */ 2364 2365 /* PM stats structure */ 2366 typedef struct bcm_oam_pm_stats_s { 2367 uint32 far_loss_min; /* Minimum Frame loss at far-end */ 2368 uint32 far_tx_min; /* Minimum Frame transmitted at far-end */ 2369 uint32 far_loss_max; /* Maximum Frame loss at far-end */ 2370 uint32 far_tx_max; /* Maximum Frame transmitted at far-end */ 2371 uint32 far_loss; /* Total far loss at far-end */ 2372 uint32 near_loss_min; /* Minimum Frame loss at near-end */ 2373 uint32 near_tx_min; /* Minimum Frame transmitted at near-end */ 2374 uint32 near_loss_max; /* Maximum Frame loss at near-end */ 2375 uint32 near_tx_max; /* Maximum Frame transmitted at near-end */ 2376 uint32 near_loss; /* Total near loss at near-end */ 2377 uint32 lm_tx_count; /* Count of LM packets transmitted from 2378 local node during sampling interval */ 2379 uint32 DM_min; /* Minimum Frame delay */ 2380 uint32 DM_max; /* Maximum Frame delay */ 2381 uint32 DM_avg; /* Frame delay */ 2382 uint32 dm_tx_count; /* Count of DM packets transmitted from 2383 local node during sampling interval */ 2384 uint8 profile_id; /* Profile number associated with this 2385 session to measure the DM frames */ 2386 uint32 bin_counters[BCM_OAM_MAX_PM_PROFILE_BIN_EDGES+1]; /* Bins Count of associated profile */ 2387 uint32 lm_rx_count; /* Count of LM packets received in local 2388 node during sampling interval */ 2389 uint32 dm_rx_count; /* Count of DM packets received in local 2390 node during sampling interval */ 2391 uint32 far_total_tx_pkt_count; /* Total Tx data packets at far-end */ 2392 uint32 near_total_tx_pkt_count; /* Total Tx data packets at near-end */ 2393 uint32 flags; /* Flags related to PM processed stats */ 2394 } bcm_oam_pm_stats_t; 2395 2396 #ifndef BCM_HIDE_DISPATCHABLE 2397 2398 /* Get the processed stats for a given endpoint */ 2399 extern int bcm_oam_pm_stats_get( 2400 int unit, 2401 bcm_oam_endpoint_t endpoint_id, 2402 bcm_oam_pm_stats_t *stats_ptr); 2403 2404 #endif /* BCM_HIDE_DISPATCHABLE */ 2405 2406 #define BCM_OAM_PM_RAW_DATA_MAX_SAMPLES 10 /* Maximum number of samples 2407 in each buffer in Raw 2408 sampling mode */ 2409 2410 /* PM raw counters structure. */ 2411 typedef struct bcm_oam_pm_raw_counter_s { 2412 uint32 tx_fcf; /* Count of packets transmitted by local node */ 2413 uint32 rx_fcf; /* Count of packets received by remote node */ 2414 uint32 tx_fcb; /* Count of packets transmitted by remote node */ 2415 uint32 rx_fcb; /* Count of packets received by local node */ 2416 } bcm_oam_pm_raw_counter_t; 2417 2418 /* PM raw timestamp structure. */ 2419 typedef struct bcm_oam_pm_raw_timestamp_s { 2420 uint32 tx_tsf_secs; /* Time stamp upper of DM packets transmitted by 2421 local node */ 2422 uint32 tx_tsf_nsecs; /* Time stamp lower of DM packets transmitted by 2423 local node */ 2424 uint32 rx_tsf_secs; /* Time stamp upper of DM packets received by remote 2425 node */ 2426 uint32 rx_tsf_nsecs; /* Time stamp lower of DM packets received by remote 2427 node */ 2428 uint32 tx_tsb_secs; /* Time stamp upper of DM packets transmitted by 2429 remote node */ 2430 uint32 tx_tsb_nsecs; /* Time stamp lower of DM packets transmitted by 2431 remote node */ 2432 uint32 rx_tsb_secs; /* Time stamp upper of DM packets received by local 2433 node */ 2434 uint32 rx_tsb_nsecs; /* Time stamp lower of DM packets received by local 2435 node */ 2436 } bcm_oam_pm_raw_timestamp_t; 2437 2438 /* PM raw samples structure. */ 2439 typedef struct bcm_oam_pm_raw_samples_s { 2440 int pm_id; /* Performance measurement ID in BTE */ 2441 uint32 lm_count; /* Number of LM samples collected as 2442 part of this buffer */ 2443 uint32 dm_count; /* Number of DM samples collected as 2444 part of this buffer */ 2445 bcm_oam_pm_raw_counter_t raw_counter[BCM_OAM_PM_RAW_DATA_MAX_SAMPLES]; /* LM counters collected as part of this 2446 buffer */ 2447 bcm_oam_pm_raw_timestamp_t raw_timestamp[BCM_OAM_PM_RAW_DATA_MAX_SAMPLES]; /* DM Timestamps collected as part of 2448 this buffer */ 2449 } bcm_oam_pm_raw_samples_t; 2450 2451 #define BCM_OAM_MAX_PM_ENDPOINTS 256 /* Maximum number of endpoints 2452 allowed in Raw sampling mode */ 2453 2454 /* PM raw buffer structure. */ 2455 typedef struct bcm_oam_pm_raw_buffer_s { 2456 uint32 seq_num; /* Seq No. of the data buffer */ 2457 bcm_oam_pm_raw_samples_t raw_sample[BCM_OAM_MAX_PM_ENDPOINTS]; /* Raw data buffer */ 2458 } bcm_oam_pm_raw_buffer_t; 2459 2460 #define BCM_OAM_MAX_PM_BUFFERS 8 /* Maximum number of buffers allowed 2461 in Raw sampling mode */ 2462 2463 /* PM raw data structure. */ 2464 typedef struct bcm_oam_pm_raw_data_s { 2465 uint32 pm_endpoint_count; /* Active PM endpoints configured */ 2466 uint8 read_index; /* Application read index */ 2467 uint8 write_index; /* BTE write index */ 2468 bcm_oam_pm_raw_buffer_t raw_buffer[BCM_OAM_MAX_PM_BUFFERS]; /* Raw data buffer */ 2469 } bcm_oam_pm_raw_data_t; 2470 2471 /* Callback function type for OAM event handling */ 2472 typedef int (*bcm_oam_pm_event_cb)( 2473 int unit, 2474 bcm_oam_event_type_t event_type, 2475 bcm_oam_pm_raw_data_t *raw_data, 2476 void *user_data); 2477 2478 #ifndef BCM_HIDE_DISPATCHABLE 2479 2480 /* Register a callback for handling OAM PM events */ 2481 extern int bcm_oam_pm_event_register( 2482 int unit, 2483 bcm_oam_event_types_t event_types, 2484 bcm_oam_pm_event_cb cb, 2485 void *user_data); 2486 2487 /* Unregister a callback handling OAM PM events */ 2488 extern int bcm_oam_pm_event_unregister( 2489 int unit, 2490 bcm_oam_event_types_t event_types, 2491 bcm_oam_pm_event_cb cb); 2492 2493 /* Indicate SDK that the application has read buffer upto the read_index. */ 2494 extern int bcm_oam_pm_raw_data_read_done( 2495 int unit, 2496 bcm_oam_event_types_t event_types, 2497 uint32 read_index); 2498 2499 #endif /* BCM_HIDE_DISPATCHABLE */ 2500 2501 /* Types of OAM protocols */ 2502 typedef enum bcm_oam_protocol_type_e { 2503 bcmOamProtocolEth = 0, /* ETH-OAM Protocol */ 2504 bcmOamProtocolBhh = 1, /* BHH-OAM Protocol */ 2505 bcmOamProtocolMplsLmDm = 2, /* MPLS LM/DM Protocol */ 2506 bcmOamProtocolMax = 3 /* Max No. of Protcols.Not an usable 2507 value.Always at the end */ 2508 } bcm_oam_protocol_type_t; 2509 2510 /* Types of OAM protocols */ 2511 typedef enum bcm_oam_opcode_e { 2512 bcmOamOpcodeCCM = 1, /* Opcode for CCM */ 2513 bcmOamOpcodeLBR = 2, /* Opcode for LBR */ 2514 bcmOamOpcodeLBM = 3, /* Opcode for LBM */ 2515 bcmOamOpcodeLTR = 4, /* Opcode for LTR */ 2516 bcmOamOpcodeLTM = 5, /* Opcode for LTM */ 2517 bcmOamOpcodeAIS = 33, /* Opcode for AIS */ 2518 bcmOamOpcodeLCK = 35, /* Opcode for LCK */ 2519 bcmOamOpcodeTST = 37, /* Opcode for TST */ 2520 bcmOamOpcodeLinearAPS = 39, /* Opcode for Linear APS */ 2521 bcmOamOpcodeRingAPS = 40, /* Opcode for Ring APS */ 2522 bcmOamOpcodeMCC = 41, /* Opcode for MCC */ 2523 bcmOamOpcodeLMR = 42, /* Opcode for LMR */ 2524 bcmOamOpcodeLMM = 43, /* Opcode for LMM */ 2525 bcmOamOpcode1DM = 45, /* Opcode for 1DM */ 2526 bcmOamOpcodeDMR = 46, /* Opcode for DMR */ 2527 bcmOamOpcodeDMM = 47, /* Opcode for DMM */ 2528 bcmOamOpcodeEXR = 48, /* Opcode for EXR */ 2529 bcmOamOpcodeEXM = 49, /* Opcode for EXM */ 2530 bcmOamOpcodeVSR = 50, /* Opcode for VSR */ 2531 bcmOamOpcodeVSM = 51, /* Opcode for VSM */ 2532 bcmOamOpcodeCSF = 52, /* Opcode for MCC */ 2533 bcmOamOpcode1SL = 53, /* Opcode for 1SL */ 2534 bcmOamOpcodeSLR = 54, /* Opcode for SLR */ 2535 bcmOamOpcodeSLM = 55, /* Opcode for 1DM */ 2536 bcmOamOpcodeMax = 256 /* Max. Opcodes.Not an usable value.Always last */ 2537 } bcm_oam_opcode_t; 2538 2539 /* Struture to set the Opcodes bitmap */ 2540 typedef struct bcm_oam_opcodes_s { 2541 SHR_BITDCL opcode_bmp[_SHR_BITDCLSIZE(256)]; /* Opcodes bitmap vector */ 2542 } bcm_oam_opcodes_t; 2543 2544 #define BCM_OAM_OPCODES_BITMAP_SET(_opcodes_bitmap, _opcode_) SHR_BITSET(((_opcodes_bitmap).opcode_bmp), (_opcode_)) 2545 2546 #define BCM_OAM_OPCODES_BITMAP_GET(_opcodes_bitmap, _opcode_) SHR_BITGET(((_opcodes_bitmap).opcode_bmp), (_opcode_)) 2547 2548 #define BCM_OAM_OPCODES_BITMAP_CLEAR(_opcodes_bitmap, _opcode_) SHR_BITCLR(((_opcodes_bitmap).opcode_bmp), (_opcode_)) 2549 2550 #define BCM_OAM_OPCODES_BITMAP_SET_ALL(_opcodes_bitmap) SHR_BITSET_RANGE(((_opcodes_bitmap).opcode_bmp), 0, bcmOamOpcodeMax) 2551 2552 #define BCM_OAM_OPCODES_BITMAP_CLEAR_ALL(_opcodes_bitmap) SHR_BITCLR_RANGE(((_opcodes_bitmap).opcode_bmp), 0, bcmOamOpcodeMax) 2553 2554 #ifndef BCM_HIDE_DISPATCHABLE 2555 2556 /* Set the Group for the specified opcodes of the Protocols */ 2557 extern int bcm_oam_opcode_group_set( 2558 int unit, 2559 bcm_oam_protocol_type_t protocol, 2560 bcm_oam_opcodes_t opcodes, 2561 uint8 opcode_group); 2562 2563 /* Get the opcode group for each opcode of each protocol */ 2564 extern int bcm_oam_opcode_group_get( 2565 int unit, 2566 bcm_oam_protocol_type_t protocol, 2567 bcm_oam_opcode_t opcode, 2568 uint8 *opcode_group); 2569 2570 #endif /* BCM_HIDE_DISPATCHABLE */ 2571 2572 /* OAM BHH endpoint/group fault flags */ 2573 #define BCM_OAM_BHH_FAULT_CCM_TIMEOUT 0x01 /* A BHH CCM time out 2574 alarm */ 2575 #define BCM_OAM_BHH_FAULT_CCM_RDI 0x02 /* A BHH CCM with RDI 2576 alarm */ 2577 #define BCM_OAM_BHH_FAULT_CCM_UNKNOWN_MEG_LEVEL 0x04 /* A BHH CCM with unknown 2578 MEG level alarm */ 2579 #define BCM_OAM_BHH_FAULT_CCM_UNKNOWN_MEG_ID 0x08 /* A BHH CCM with unknown 2580 MEG ID alarm */ 2581 #define BCM_OAM_BHH_FAULT_CCM_UNKNOWN_MEP_ID 0x10 /* A BHH CCM with unknown 2582 MEP ID alarm */ 2583 #define BCM_OAM_BHH_FAULT_CCM_UNKNOWN_PERIOD 0x20 /* A BHH CCM with unknown 2584 period alarm */ 2585 #define BCM_OAM_BHH_FAULT_CCM_UNKNOWN_PRIORITY 0x40 /* A BHH CCM with unknown 2586 priority alarm */ 2587 #define BCM_OAM_ENDPOINT_BHH_FAULT_CSF_LOS 0x80 /* CSF Loss of Signal */ 2588 #define BCM_OAM_ENDPOINT_BHH_FAULT_CSF_FDI 0x100 /* CSF Forward Defect 2589 Indication */ 2590 #define BCM_OAM_ENDPOINT_BHH_FAULT_CSF_RDI 0x200 /* CSF Reverse Defect 2591 Indication */ 2592 2593 /* Flags will be sent back as bitmap in processed stats structure */ 2594 #define BCM_OAM_PM_STATS_PROCESSED_COUNTER_ROLLOVER 0x0001 /* Flag bit in flags 2595 field of PM stats 2596 structure to indicate 2597 counter roll-over */ 2598 2599 #ifndef BCM_HIDE_DISPATCHABLE 2600 2601 /* Attach an egress MPLS gport to a MPLS LSP endpoint */ 2602 extern int bcm_oam_endpoint_gport_egress_attach( 2603 int unit, 2604 bcm_oam_endpoint_t endpoint, 2605 bcm_gport_t gport); 2606 2607 /* Detach an egress MPLS gport from a MPLS LSP endpoint */ 2608 extern int bcm_oam_endpoint_gport_egress_detach( 2609 int unit, 2610 bcm_oam_endpoint_t endpoint, 2611 bcm_gport_t gport); 2612 2613 /* Get the list of MPLS gports attached to a MPLS LSP endpoint */ 2614 extern int bcm_oam_endpoint_gport_egress_attach_get( 2615 int unit, 2616 bcm_oam_endpoint_t endpoint, 2617 int max_count, 2618 bcm_gport_t *gport, 2619 int *count); 2620 2621 /* Attach an egress interface to a MPLS LSP endpoint */ 2622 extern int bcm_oam_endpoint_egress_intf_egress_attach( 2623 int unit, 2624 bcm_oam_endpoint_t endpoint_id, 2625 bcm_if_t egress_intf); 2626 2627 /* Detach an egress interface from a MPLS LSP endpoint */ 2628 extern int bcm_oam_endpoint_egress_intf_egress_detach( 2629 int unit, 2630 bcm_oam_endpoint_t endpoint_id, 2631 bcm_if_t egress_intf); 2632 2633 /* Get the list of Egress interfaces attached to MPLS LSP endpoint */ 2634 extern int bcm_oam_endpoint_egress_intf_egress_attach_get( 2635 int unit, 2636 bcm_oam_endpoint_t endpoint_id, 2637 int max_count, 2638 bcm_if_t *egress_intf, 2639 int *count); 2640 2641 #endif /* BCM_HIDE_DISPATCHABLE */ 2642 2643 /* Fault status of each endpoint alongwith endpoint id */ 2644 typedef struct bcm_oam_endpoint_fault_s { 2645 bcm_oam_endpoint_t endpoint_id; /* Endpoint id assocaietd with the faults 2646 bitmap */ 2647 uint32 faults; /* Faults bitmap for the endpoint */ 2648 } bcm_oam_endpoint_fault_t; 2649 2650 #ifndef BCM_HIDE_DISPATCHABLE 2651 2652 /* 2653 * Retrieve all faults for all valid end points up to a maximum of 2654 * "max_endpoints" for a given protocol 2655 */ 2656 extern int bcm_oam_endpoint_faults_multi_get( 2657 int unit, 2658 uint32 flags, 2659 bcm_oam_protocol_type_t endpoint_protocol, 2660 uint32 max_endpoints, 2661 bcm_oam_endpoint_fault_t *faults, 2662 uint32 *endpoint_count); 2663 2664 /* Set the packet header on the protection packets injected by the OAMP */ 2665 extern int bcm_oam_protection_packet_header_set( 2666 int unit, 2667 bcm_pkt_blk_t *packet_header); 2668 2669 /* Get the packet header of the protection packets injected by the OAMP */ 2670 extern int bcm_oam_protection_packet_header_get( 2671 int unit, 2672 bcm_pkt_blk_t *packet_header); 2673 2674 /* 2675 * Create a Hardware profile entry for setting count profile of OAM 2676 * opcodes 2677 */ 2678 extern int bcm_oam_opcodes_count_profile_create( 2679 int unit, 2680 uint8 *lm_count_profile); 2681 2682 /* Set the counting profile of opcodes for a given Loss count profile id */ 2683 extern int bcm_oam_opcodes_count_profile_set( 2684 int unit, 2685 uint8 lm_count_profile, 2686 uint8 count_enable, 2687 bcm_oam_opcodes_t *opcodes_bitmap); 2688 2689 /* 2690 * Get the opcodes for a given counting profile for a given Loss count 2691 * profile id 2692 */ 2693 extern int bcm_oam_opcodes_count_profile_get( 2694 int unit, 2695 uint8 lm_count_profile, 2696 uint8 count_enable, 2697 bcm_oam_opcodes_t *opcodes_bitmap); 2698 2699 /* Delete the count profile with the given id */ 2700 extern int bcm_oam_opcodes_count_profile_delete( 2701 int unit, 2702 uint8 lm_count_profile); 2703 2704 /* Add ports to trunk mapping to port-trunk database in OAM */ 2705 extern int bcm_oam_trunk_ports_add( 2706 int unit, 2707 bcm_gport_t trunk_gport, 2708 int max_ports, 2709 bcm_gport_t *port_arr); 2710 2711 /* Delete ports to trunk mapping from port-trunk database in OAM */ 2712 extern int bcm_oam_trunk_ports_delete( 2713 int unit, 2714 bcm_gport_t trunk_gport, 2715 int max_ports, 2716 bcm_gport_t *port_arr); 2717 2718 /* Get ports to trunk mapping from port-trunk database in OAM */ 2719 extern int bcm_oam_trunk_ports_get( 2720 int unit, 2721 bcm_gport_t trunk_gport, 2722 int max_ports, 2723 bcm_gport_t *port_arr, 2724 int *port_count); 2725 2726 #endif /* BCM_HIDE_DISPATCHABLE */ 2727 2728 /* MPLS OAM/BFD channel types */ 2729 typedef enum bcm_oam_mpls_tp_channel_type_e { 2730 bcmOamMplsTpChannelPweBfd = 0, /* BFD control Channel type */ 2731 bcmOamMplsTpChannelPweonoam = 1, /* PWE OAM channel type - significant 2732 only in TX direction, use 2733 bcmOamMplsTpChannelY1731 in RX 2734 direction */ 2735 bcmOamMplsTpChannelY1731 = 2, /* Y1731 OAM channel type */ 2736 bcmOamMplsTpChannelMplsTpBfd = 3, /* BFD MPLS-TP channel type */ 2737 bcmOamMplsTpChannelMplsDirectLm = 4, /* RFC 6374 Direct LM channel type. */ 2738 bcmOamMplsTpChannelMplsDm = 5, /* RFC 6374 DM channel type. */ 2739 bcmOamMplsTpChannelTypeCount = 6 /* Always Last. Not a usable value. */ 2740 } bcm_oam_mpls_tp_channel_type_t; 2741 2742 #ifndef BCM_HIDE_DISPATCHABLE 2743 2744 /* 2745 * Set a list of values for MPLS TP OAM/BFD channel types that can be 2746 * received in a packet 2747 */ 2748 extern int bcm_oam_mpls_tp_channel_type_rx_set( 2749 int unit, 2750 bcm_oam_mpls_tp_channel_type_t channel_type, 2751 int num_values, 2752 int *list_of_values); 2753 2754 /* 2755 * Get the list of values for MPLS TP OAM/BFD channel types that can be 2756 * received in a packet 2757 */ 2758 extern int bcm_oam_mpls_tp_channel_type_rx_get( 2759 int unit, 2760 bcm_oam_mpls_tp_channel_type_t channel_type, 2761 int num_values, 2762 int *list_of_values, 2763 int *value_count); 2764 2765 /* 2766 * Set a value for MPLS TP OAM/BFD channel types that would be 2767 * transmitted in a packet generated by OAMP 2768 */ 2769 extern int bcm_oam_mpls_tp_channel_type_tx_set( 2770 int unit, 2771 bcm_oam_mpls_tp_channel_type_t channel_type, 2772 int value); 2773 2774 /* 2775 * Get the value for MPLS TP OAM/BFD channel types that would be 2776 * transmitted in a packet generated by OAMP 2777 */ 2778 extern int bcm_oam_mpls_tp_channel_type_tx_get( 2779 int unit, 2780 bcm_oam_mpls_tp_channel_type_t channel_type, 2781 int *value); 2782 2783 /* 2784 * Deletes a list of values for MPLS TP OAM/BFD channel types that can be 2785 * received in a packet 2786 */ 2787 extern int bcm_oam_mpls_tp_channel_type_rx_delete( 2788 int unit, 2789 bcm_oam_mpls_tp_channel_type_t channel_type, 2790 int num_values, 2791 int *list_of_values); 2792 2793 /* 2794 * Delete a value for MPLS TP OAM/BFD channel types that would be 2795 * transmitted in a packet generated by OAMP 2796 */ 2797 extern int bcm_oam_mpls_tp_channel_type_tx_delete( 2798 int unit, 2799 bcm_oam_mpls_tp_channel_type_t channel_type, 2800 int value); 2801 2802 #endif /* BCM_HIDE_DISPATCHABLE */ 2803 2804 /* Used for Invalid OAM action profile indication. */ 2805 #define BCM_OAM_PROFILE_INVALID -1 2806 2807 /* Flags for action profile. */ 2808 #define BCM_OAM_PROFILE_WITH_ID 0x1 /* Used by oam action 2809 profile create profile 2810 create with id. */ 2811 #define BCM_OAM_PROFILE_LM_TYPE_DUAL_ENDED 0x2 /* When LM is done via 2812 CCM PDU. */ 2813 #define BCM_OAM_PROFILE_DM_TYPE_NTP 0x4 /* Use NTP format for DM. */ 2814 #define BCM_OAM_PROFILE_LM_TYPE_NONE 0x8 /* Disable counter 2815 stamping on LMM/LMR 2816 SLM/SLR packets. */ 2817 #define BCM_OAM_PROFILE_TYPE_SECTION 0x10 /* Set Profile for 2818 MPLS-Section. */ 2819 #define BCM_OAM_PROFILE_HIERARCHICAL_LM_DISABLE 0x20 /* Disable Hierarchical 2820 LM by MD-level. */ 2821 2822 /* OAM Action key flags. */ 2823 #define BCM_OAM_ACTION_KEY_MPLS_LM_DM_OPCODE 0x1 /* Indicates that 2824 mpls_lm_dm_opcode 2825 field is used instead 2826 of opcode. */ 2827 2828 /* bcm_oam_profile_type_t will represent the oam action profile type. */ 2829 typedef enum bcm_oam_profile_type_e { 2830 bcmOAMProfileIngressLIF = 0, 2831 bcmOAMProfileEgressLIF = 1, 2832 bcmOAMProfileIngressAcceleratedEndpoint = 2, 2833 bcmOAMProfileEgressAcceleratedEndpoint = 3, 2834 bcmOAMProfileCount = 4 2835 } bcm_oam_profile_type_t; 2836 2837 /* MAC types for OAM packets. Used for action profile configuration. */ 2838 typedef enum bcm_oam_dest_mac_type_e { 2839 bcmOAMDestMacTypeMcast = 0, 2840 bcmOAMDestMacTypeMyCfmMac = 1, 2841 bcmOAMDestMacTypeUknownUcast = 2, 2842 bcmOAMDestMacTypeCount = 3 2843 } bcm_oam_dest_mac_type_t; 2844 2845 /* Endpoint type used for action profile configuration */ 2846 typedef enum bcm_oam_match_type_e { 2847 bcmOAMMatchTypeMIP = 0, 2848 bcmOAMMatchTypeMEP = 1, 2849 bcmOAMMatchTypePassive = 2, 2850 bcmOAMMatchTypeLowMDL = 3, 2851 bcmOAMMatchTypeCount = 4 2852 } bcm_oam_match_type_t; 2853 2854 /* OAM action key. */ 2855 typedef struct bcm_oam_action_key_s { 2856 uint32 flags; 2857 bcm_oam_opcode_t opcode; 2858 bcm_oam_mpls_lm_dm_opcode_type_t mpls_lm_dm_opcode; 2859 bcm_oam_dest_mac_type_t dest_mac_type; 2860 bcm_oam_match_type_t endpoint_type; 2861 uint8 inject; 2862 } bcm_oam_action_key_t; 2863 2864 /* OAM action result. */ 2865 typedef struct bcm_oam_action_result_s { 2866 uint32 flags; 2867 uint8 counter_increment; 2868 uint8 meter_enable; 2869 bcm_gport_t destination; 2870 } bcm_oam_action_result_t; 2871 2872 #ifndef BCM_HIDE_DISPATCHABLE 2873 2874 /* Function allocate oam profile. */ 2875 extern int bcm_oam_profile_create( 2876 int unit, 2877 uint32 flags, 2878 bcm_oam_profile_type_t oam_profile_type, 2879 bcm_oam_profile_t *profile_id); 2880 2881 /* Function release oam profile. */ 2882 extern int bcm_oam_profile_delete( 2883 int unit, 2884 uint32 flags, 2885 bcm_oam_profile_t profile_id); 2886 2887 /* Function return oam lif profile according lif. */ 2888 extern int bcm_oam_lif_profile_get( 2889 int unit, 2890 uint32 flags, 2891 bcm_gport_t gport, 2892 bcm_oam_profile_t *ingress_oam_profile, 2893 bcm_oam_profile_t *egress_oam_profile); 2894 2895 /* 2896 * Function return oam lif profile according lif. If some end point 2897 * already exist on given LIF, profile will be updated in OAM-LIF-DB 2898 * table and stored in sw state.If no endpoint yet defined on given LIF, 2899 * profile will be stored in sw state. 2900 */ 2901 extern int bcm_oam_lif_profile_set( 2902 int unit, 2903 uint32 flags, 2904 bcm_gport_t gport, 2905 bcm_oam_profile_t ingress_oam_profile, 2906 bcm_oam_profile_t egress_oam_profile); 2907 2908 /* Function return action. */ 2909 extern int bcm_oam_profile_action_get( 2910 int unit, 2911 uint32 flags, 2912 bcm_oam_profile_t profile_id, 2913 bcm_oam_action_key_t *oam_action_key, 2914 bcm_oam_action_result_t *oam_action_result); 2915 2916 /* Function return action. */ 2917 extern int bcm_oam_profile_action_set( 2918 int unit, 2919 uint32 flags, 2920 bcm_oam_profile_t profile_id, 2921 bcm_oam_action_key_t *oam_action_key, 2922 bcm_oam_action_result_t *oam_action_result); 2923 2924 #endif /* BCM_HIDE_DISPATCHABLE */ 2925 2926 /* OAM UP MEP PDU Type */ 2927 typedef enum bcm_oam_upmep_pdu_type_e { 2928 bcmOamUpmepPduTypeCcm = 0, /* Used to set the CPU queue for UP MEP CCM 2929 packets */ 2930 bcmOamUpmepPduTypeLmDm = 1, /* Used to set the CPU queue for UP MEP 2931 LM/DM packets */ 2932 bcmOamUpmepPduTypeSlowpath = 2, /* Used to set the CPU queue for UP MEP 2933 slowpath packets */ 2934 bcmOamUpmepPduTypeError = 3, /* Used to set the CPU queue for UP MEP 2935 Error packets */ 2936 bcmOamUpmepPduTypeCount = 4 /* Must be last. Not a usable value. */ 2937 } bcm_oam_upmep_pdu_type_t; 2938 2939 /* OAM Leap Second Control Modes */ 2940 typedef enum bcm_oam_leap_sec_control_mode_e { 2941 bcmOamLeapUpperSecIncr = 1, /* Increment IEEE1588_TIME_SEC_UPPER counter, Do 2942 not increment IEEE1588_TIME_1_SEC counter */ 2943 bcmOamLeap1SecIncr = 2 /* Do not increment IEEE1588_TIME_SEC_UPPER, 2944 Increment IEEE1588_TIME_1_SEC counter */ 2945 } bcm_oam_leap_sec_control_mode_t; 2946 2947 #ifndef BCM_HIDE_DISPATCHABLE 2948 2949 /* Configure device-wide UP MEP PDU type CPU queue */ 2950 extern int bcm_oam_upmep_cosq_set( 2951 int unit, 2952 bcm_oam_upmep_pdu_type_t upmep_pdu_type, 2953 bcm_cos_queue_t cosq); 2954 2955 /* Query device-wide UP MEP PDU type CPU queue */ 2956 extern int bcm_oam_upmep_cosq_get( 2957 int unit, 2958 bcm_oam_upmep_pdu_type_t upmep_pdu_type, 2959 bcm_cos_queue_t *cosq); 2960 2961 #endif /* BCM_HIDE_DISPATCHABLE */ 2962 2963 /* Initialize a bcm_oam_action_key_t structure. */ 2964 extern void bcm_oam_action_key_t_init( 2965 bcm_oam_action_key_t *action_key_ptr); 2966 2967 /* Initialize a bcm_oam_action_result_t structure. */ 2968 extern void bcm_oam_action_result_t_init( 2969 bcm_oam_action_result_t *action_result_ptr); 2970 2971 /* OAM reflector encap flags */ 2972 #define BCM_OAM_REFELCTOR_ENCAP_WITH_ID 0x1 /* Allocate the specified 2973 encap id for OAM reflector */ 2974 2975 #ifndef BCM_HIDE_DISPATCHABLE 2976 2977 /* Create encap_id for OAM reflector. */ 2978 extern int bcm_oam_reflector_encap_create( 2979 int unit, 2980 uint32 flags, 2981 bcm_if_t *encap_id); 2982 2983 /* Create / Destroy encap ID for OAM reflector. */ 2984 extern int bcm_oam_reflector_encap_destroy( 2985 int unit, 2986 uint32 flags, 2987 bcm_if_t encap_id); 2988 2989 /* 2990 * Function Get encoded oam profile id and associated flags from raw OAM 2991 * profile id and OAM profile type. 2992 */ 2993 extern int bcm_oam_profile_id_get_by_type( 2994 int unit, 2995 uint8 profile_id, 2996 bcm_oam_profile_type_t oam_profile_type, 2997 uint32 *flags, 2998 bcm_oam_profile_t *enc_profile_id); 2999 3000 #endif /* BCM_HIDE_DISPATCHABLE */ 3001 3002 typedef struct bcm_oam_control_key_s { 3003 bcm_oam_control_type_t type; /* OAM control type */ 3004 int index; /* OAM control index */ 3005 } bcm_oam_control_key_t; 3006 3007 #ifndef BCM_HIDE_DISPATCHABLE 3008 3009 /* Configure indexed OAM control. */ 3010 extern int bcm_oam_control_indexed_set( 3011 int unit, 3012 bcm_oam_control_key_t key, 3013 uint64 arg); 3014 3015 /* Get indexed OAM control value. */ 3016 extern int bcm_oam_control_indexed_get( 3017 int unit, 3018 bcm_oam_control_key_t key, 3019 uint64 *arg); 3020 3021 #endif /* BCM_HIDE_DISPATCHABLE */ 3022 3023 typedef struct bcm_oam_tod_leap_control_s { 3024 uint8 leap_ctrl_enable; /* Flag to enable/disable Leap Second 3025 Control */ 3026 bcm_oam_leap_sec_control_mode_t leap_sec_control; /* Leap Second control mode */ 3027 } bcm_oam_tod_leap_control_t; 3028 3029 #ifndef BCM_HIDE_DISPATCHABLE 3030 3031 /* Configure TOD Leap Second Control */ 3032 extern int bcm_oam_tod_leap_control_set( 3033 int unit, 3034 bcm_oam_timestamp_format_t ts_format, 3035 bcm_oam_tod_leap_control_t leap_info); 3036 3037 /* Query TOD Leap Second Control */ 3038 extern int bcm_oam_tod_leap_control_get( 3039 int unit, 3040 bcm_oam_timestamp_format_t ts_format, 3041 bcm_oam_tod_leap_control_t *leap_info); 3042 3043 #endif /* BCM_HIDE_DISPATCHABLE */ 3044 3045 #endif /* __BCM_OAM_H__ */