openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

stat.h (175738B)


      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_STAT_H__
     11 #define __BCM_STAT_H__
     12 
     13 #include <bcm/types.h>
     14 
     15 /* 
     16  * Statistics counters.
     17  * 
     18  * Note: the following RFC 2465 MIBs are not supported:
     19  * 
     20  *   snmpIpv6IfStatsInTooBigErrors,
     21  *   snmpIpv6IfStatsInNoRoutes,
     22  *   snmpIpv6IfStatsInUnknownProtos,
     23  *   snmpIpv6IfStatsInTruncatedPkts,
     24  *   snmpIpv6IfStatsInDelivers,
     25  *   snmpIpv6IfStatsOutRequests,
     26  *   snmpIpv6IfStatsOutFragOKs,
     27  *   snmpIpv6IfStatsOutFragFails,
     28  *   snmpIpv6IfStatsOutFragCreates,
     29  *   snmpIpv6IfStatsReasmReqds,
     30  *   snmpIpv6IfStatsReasmOKs,
     31  *   snmpIpv6IfStatsReasmFails,
     32  */
     33 typedef enum bcm_stat_val_e {
     34     snmpIfInOctets = 0,                 /* RFC 1213 */
     35     snmpIfInUcastPkts = 1,              /* RFC 1213 */
     36     snmpIfInNUcastPkts = 2,             /* RFC 1213 */
     37     snmpIfInDiscards = 3,               /* RFC 1213 */
     38     snmpIfInErrors = 4,                 /* RFC 1213 */
     39     snmpIfInUnknownProtos = 5,          /* RFC 1213 */
     40     snmpIfOutOctets = 6,                /* RFC 1213 */
     41     snmpIfOutUcastPkts = 7,             /* RFC 1213 */
     42     snmpIfOutNUcastPkts = 8,            /* RFC 1213 */
     43     snmpIfOutDiscards = 9,              /* RFC 1213 */
     44     snmpIfOutErrors = 10,               /* RFC 1213 */
     45     snmpIfOutQLen = 11,                 /* RFC 1213 */
     46     snmpIpInReceives = 12,              /* RFC 1213 */
     47     snmpIpInHdrErrors = 13,             /* RFC 1213 */
     48     snmpIpForwDatagrams = 14,           /* RFC 1213 */
     49     snmpIpInDiscards = 15,              /* RFC 1213 */
     50     snmpDot1dBasePortDelayExceededDiscards = 16, /* RFC 1493 */
     51     snmpDot1dBasePortMtuExceededDiscards = 17, /* RFC 1493 */
     52     snmpDot1dTpPortInFrames = 18,       /* RFC 1493 */
     53     snmpDot1dTpPortOutFrames = 19,      /* RFC 1493 */
     54     snmpDot1dPortInDiscards = 20,       /* RFC 1493 */
     55     snmpEtherStatsDropEvents = 21,      /* RFC 1757 (EtherStat) */
     56     snmpEtherStatsMulticastPkts = 22,   /* RFC 1757 (EtherStat) */
     57     snmpEtherStatsBroadcastPkts = 23,   /* RFC 1757 (EtherStat) */
     58     snmpEtherStatsUndersizePkts = 24,   /* RFC 1757 (EtherStat) */
     59     snmpEtherStatsFragments = 25,       /* RFC 1757 (EtherStat) */
     60     snmpEtherStatsPkts64Octets = 26,    /* RFC 1757 (EtherStat) */
     61     snmpEtherStatsPkts65to127Octets = 27, /* RFC 1757 (EtherStat) */
     62     snmpEtherStatsPkts128to255Octets = 28, /* RFC 1757 (EtherStat) */
     63     snmpEtherStatsPkts256to511Octets = 29, /* RFC 1757 (EtherStat) */
     64     snmpEtherStatsPkts512to1023Octets = 30, /* RFC 1757 (EtherStat) */
     65     snmpEtherStatsPkts1024to1518Octets = 31, /* RFC 1757 (EtherStat) */
     66     snmpEtherStatsOversizePkts = 32,    /* RFC 1757 (EtherStat) */
     67     snmpEtherRxOversizePkts = 33,       /* Rx component of
     68                                            snmpEtherStatsOversizePkts */
     69     snmpEtherTxOversizePkts = 34,       /* Tx component of
     70                                            snmpEtherStatsOversizePkts */
     71     snmpEtherStatsJabbers = 35,         /* RFC 1757 (EtherStat) */
     72     snmpEtherStatsOctets = 36,          /* RFC 1757 (EtherStat) */
     73     snmpEtherStatsPkts = 37,            /* RFC 1757 (EtherStat) */
     74     snmpEtherStatsCollisions = 38,      /* RFC 1757 (EtherStat) */
     75     snmpEtherStatsCRCAlignErrors = 39,  /* RFC 1757 (EtherStat) */
     76     snmpEtherStatsTXNoErrors = 40,      /* RFC 1757 (EtherStat) */
     77     snmpEtherStatsRXNoErrors = 41,      /* RFC 1757 (EtherStat) */
     78     snmpDot3StatsAlignmentErrors = 42,  /* RFC 2665 */
     79     snmpDot3StatsFCSErrors = 43,        /* RFC 2665 */
     80     snmpDot3StatsSingleCollisionFrames = 44, /* RFC 2665 */
     81     snmpDot3StatsMultipleCollisionFrames = 45, /* RFC 2665 */
     82     snmpDot3StatsSQETTestErrors = 46,   /* RFC 2665 */
     83     snmpDot3StatsDeferredTransmissions = 47, /* RFC 2665 */
     84     snmpDot3StatsLateCollisions = 48,   /* RFC 2665 */
     85     snmpDot3StatsExcessiveCollisions = 49, /* RFC 2665 */
     86     snmpDot3StatsInternalMacTransmitErrors = 50, /* RFC 2665 */
     87     snmpDot3StatsCarrierSenseErrors = 51, /* RFC 2665 */
     88     snmpDot3StatsFrameTooLongs = 52,    /* RFC 2665 */
     89     snmpDot3StatsInternalMacReceiveErrors = 53, /* RFC 2665 */
     90     snmpDot3StatsSymbolErrors = 54,     /* RFC 2665 */
     91     snmpDot3ControlInUnknownOpcodes = 55, /* RFC 2665 */
     92     snmpDot3InPauseFrames = 56,         /* RFC 2665 */
     93     snmpDot3OutPauseFrames = 57,        /* RFC 2665 */
     94     snmpIfHCInOctets = 58,              /* RFC 2233 */
     95     snmpIfHCInUcastPkts = 59,           /* RFC 2233 */
     96     snmpIfHCInMulticastPkts = 60,       /* RFC 2233 */
     97     snmpIfHCInBroadcastPkts = 61,       /* RFC 2233 */
     98     snmpIfHCOutOctets = 62,             /* RFC 2233 */
     99     snmpIfHCOutUcastPkts = 63,          /* RFC 2233 */
    100     snmpIfHCOutMulticastPkts = 64,      /* RFC 2233 */
    101     snmpIfHCOutBroadcastPckts = 65,     /* RFC 2233 */
    102     snmpIpv6IfStatsInReceives = 66,     /* RFC 2465 */
    103     snmpIpv6IfStatsInHdrErrors = 67,    /* RFC 2465 */
    104     snmpIpv6IfStatsInAddrErrors = 68,   /* RFC 2465 */
    105     snmpIpv6IfStatsInDiscards = 69,     /* RFC 2465 */
    106     snmpIpv6IfStatsOutForwDatagrams = 70, /* RFC 2465 */
    107     snmpIpv6IfStatsOutDiscards = 71,    /* RFC 2465 */
    108     snmpIpv6IfStatsInMcastPkts = 72,    /* RFC 2465 */
    109     snmpIpv6IfStatsOutMcastPkts = 73,   /* RFC 2465 */
    110     snmpIfInBroadcastPkts = 74,         /* RFC 1573 */
    111     snmpIfInMulticastPkts = 75,         /* RFC 1573 */
    112     snmpIfOutBroadcastPkts = 76,        /* RFC 1573 */
    113     snmpIfOutMulticastPkts = 77,        /* RFC 1573 */
    114     snmpIeee8021PfcRequests = 78,       /* IEEE 802.1bb */
    115     snmpIeee8021PfcIndications = 79,    /* IEEE 802.1bb */
    116     snmpBcmReceivedUndersizePkts = 80,  /* Broadcom-specific */
    117     snmpBcmTransmittedUndersizePkts = 81, /* Broadcom-specific */
    118     snmpBcmIPMCBridgedPckts = 82,       /* Broadcom-specific */
    119     snmpBcmIPMCRoutedPckts = 83,        /* Broadcom-specific */
    120     snmpBcmIPMCInDroppedPckts = 84,     /* Broadcom-specific */
    121     snmpBcmIPMCOutDroppedPckts = 85,    /* Broadcom-specific */
    122     snmpBcmEtherStatsPkts1519to1522Octets = 86, /* Broadcom-specific */
    123     snmpBcmEtherStatsPkts1522to2047Octets = 87, /* Broadcom-specific */
    124     snmpBcmEtherStatsPkts2048to4095Octets = 88, /* Broadcom-specific */
    125     snmpBcmEtherStatsPkts4095to9216Octets = 89, /* Broadcom-specific */
    126     snmpBcmReceivedPkts64Octets = 90,   /* Broadcom-specific */
    127     snmpBcmReceivedPkts65to127Octets = 91, /* Broadcom-specific */
    128     snmpBcmReceivedPkts128to255Octets = 92, /* Broadcom-specific */
    129     snmpBcmReceivedPkts256to511Octets = 93, /* Broadcom-specific */
    130     snmpBcmReceivedPkts512to1023Octets = 94, /* Broadcom-specific */
    131     snmpBcmReceivedPkts1024to1518Octets = 95, /* Broadcom-specific */
    132     snmpBcmReceivedPkts1519to2047Octets = 96, /* Broadcom-specific */
    133     snmpBcmReceivedPkts2048to4095Octets = 97, /* Broadcom-specific */
    134     snmpBcmReceivedPkts4095to9216Octets = 98, /* Broadcom-specific */
    135     snmpBcmTransmittedPkts64Octets = 99, /* Broadcom-specific */
    136     snmpBcmTransmittedPkts65to127Octets = 100, /* Broadcom-specific */
    137     snmpBcmTransmittedPkts128to255Octets = 101, /* Broadcom-specific */
    138     snmpBcmTransmittedPkts256to511Octets = 102, /* Broadcom-specific */
    139     snmpBcmTransmittedPkts512to1023Octets = 103, /* Broadcom-specific */
    140     snmpBcmTransmittedPkts1024to1518Octets = 104, /* Broadcom-specific */
    141     snmpBcmTransmittedPkts1519to2047Octets = 105, /* Broadcom-specific */
    142     snmpBcmTransmittedPkts2048to4095Octets = 106, /* Broadcom-specific */
    143     snmpBcmTransmittedPkts4095to9216Octets = 107, /* Broadcom-specific */
    144     snmpBcmTxControlCells = 108,        /* Fabric TX Control cells counter.
    145                                            (Broadcom-specific) */
    146     snmpBcmTxDataCells = 109,           /* Fabric TX Data cell counter.
    147                                            (Broadcom-specific) */
    148     snmpBcmTxDataBytes = 110,           /* Fabric TX Data byte counter.
    149                                            (Broadcom-specific) */
    150     snmpBcmRxCrcErrors = 111,           /* Fabric RX CRC errors counter.
    151                                            (Broadcom-specific) */
    152     snmpBcmRxFecCorrectable = 112,      /* Fabric RX LFEC/FEC correctable error.
    153                                            (Broadcom-specific) */
    154     snmpBcmRxBecCrcErrors = 113,        /* Fabric RX BEC crc error.
    155                                            (Broadcom-specific) */
    156     snmpBcmRxDisparityErrors = 114,     /* Fabric RX 8b/10b disparity errors.
    157                                            (Broadcom-specific) */
    158     snmpBcmRxControlCells = 115,        /* Fabric RX Control cells counter.
    159                                            (Broadcom-specific) */
    160     snmpBcmRxDataCells = 116,           /* Fabric RX Data cell counter.
    161                                            (Broadcom-specific) */
    162     snmpBcmRxDataBytes = 117,           /* Fabric RX Data byte counter.
    163                                            (Broadcom-specific) */
    164     snmpBcmRxDroppedRetransmittedControl = 118, /* Fabric RX dropped retransmitted
    165                                            control. (Broadcom-specific) */
    166     snmpBcmTxBecRetransmit = 119,       /* Fabric TX BEC retransmit.
    167                                            (Broadcom-specific) */
    168     snmpBcmRxBecRetransmit = 120,       /* Fabric RX BEC retransmit.
    169                                            (Broadcom-specific) */
    170     snmpBcmTxAsynFifoRate = 121,        /* Fabric TX Asyn FIFO rate at units of
    171                                            40 bits. (Broadcom-specific) */
    172     snmpBcmRxAsynFifoRate = 122,        /* Fabric RX Asyn FIFO rate at units of
    173                                            40 bits. (Broadcom-specific) */
    174     snmpBcmRxFecUncorrectable = 123,    /* Fabric RX LFEC/FEC uncorrectable
    175                                            erros. (Broadcom-specific) */
    176     snmpBcmRxBecRxFault = 124,          /* Fabric RX BEC RX fault.
    177                                            (Broadcom-specific) */
    178     snmpBcmRxCodeErrors = 125,          /* Fabric RX 8b/10b code errors.
    179                                            (Broadcom-specific) */
    180     snmpBcmRxRsFecBitError = 126,       /* Fabric RX RS-FEC bit error counter.
    181                                            (Broadcom-specific) */
    182     snmpBcmRxRsFecSymbolError = 127,    /* RX RS-FEC symbol error counter.
    183                                            (Broadcom-specific) */
    184     snmpBcmRxLlfcPrimary = 128,         /* Fabric RX LLFC Primary.
    185                                            (Broadcom-specific) */
    186     snmpBcmRxLlfcSecondary = 129,       /* Fabric RX LLFC Secondary.
    187                                            (Broadcom-specific) */
    188     snmpBcmCustomReceive0 = 130,        /* Broadcom-specific */
    189     snmpBcmCustomReceive1 = 131,        /* Broadcom-specific */
    190     snmpBcmCustomReceive2 = 132,        /* Broadcom-specific */
    191     snmpBcmCustomReceive3 = 133,        /* Broadcom-specific */
    192     snmpBcmCustomReceive4 = 134,        /* Broadcom-specific */
    193     snmpBcmCustomReceive5 = 135,        /* Broadcom-specific */
    194     snmpBcmCustomReceive6 = 136,        /* Broadcom-specific */
    195     snmpBcmCustomReceive7 = 137,        /* Broadcom-specific */
    196     snmpBcmCustomReceive8 = 138,        /* Broadcom-specific */
    197     snmpBcmCustomTransmit0 = 139,       /* Broadcom-specific */
    198     snmpBcmCustomTransmit1 = 140,       /* Broadcom-specific */
    199     snmpBcmCustomTransmit2 = 141,       /* Broadcom-specific */
    200     snmpBcmCustomTransmit3 = 142,       /* Broadcom-specific */
    201     snmpBcmCustomTransmit4 = 143,       /* Broadcom-specific */
    202     snmpBcmCustomTransmit5 = 144,       /* Broadcom-specific */
    203     snmpBcmCustomTransmit6 = 145,       /* Broadcom-specific */
    204     snmpBcmCustomTransmit7 = 146,       /* Broadcom-specific */
    205     snmpBcmCustomTransmit8 = 147,       /* Broadcom-specific */
    206     snmpBcmCustomTransmit9 = 148,       /* Broadcom-specific */
    207     snmpBcmCustomTransmit10 = 149,      /* Broadcom-specific */
    208     snmpBcmCustomTransmit11 = 150,      /* Broadcom-specific */
    209     snmpBcmCustomTransmit12 = 151,      /* Broadcom-specific */
    210     snmpBcmCustomTransmit13 = 152,      /* Broadcom-specific */
    211     snmpBcmCustomTransmit14 = 153,      /* Broadcom-specific */
    212     snmpDot3StatsInRangeLengthError = 154, /* RFC 1284 */
    213     snmpDot3OmpEmulationCRC8Errors = 155, /* RFC 4837 */
    214     snmpDot3MpcpRxGate = 156,           /* RFC 4837 */
    215     snmpDot3MpcpRxRegister = 157,       /* RFC 4837 */
    216     snmpDot3MpcpTxRegRequest = 158,     /* RFC 4837 */
    217     snmpDot3MpcpTxRegAck = 159,         /* RFC 4837 */
    218     snmpDot3MpcpTxReport = 160,         /* RFC 4837 */
    219     snmpDot3EponFecCorrectedBlocks = 161, /* RFC 4837 */
    220     snmpDot3EponFecUncorrectableBlocks = 162, /* RFC 4837 */
    221     snmpBcmPonInDroppedOctets = 163,    /* Broadcom-specific */
    222     snmpBcmPonOutDroppedOctets = 164,   /* Broadcom-specific */
    223     snmpBcmPonInDelayedOctets = 165,    /* Broadcom-specific */
    224     snmpBcmPonOutDelayedOctets = 166,   /* Broadcom-specific */
    225     snmpBcmPonInDelayedHundredUs = 167, /* Broadcom-specific */
    226     snmpBcmPonOutDelayedHundredUs = 168, /* Broadcom-specific */
    227     snmpBcmPonInFrameErrors = 169,      /* Broadcom-specific */
    228     snmpBcmPonInOamFrames = 170,        /* Broadcom-specific */
    229     snmpBcmPonOutOamFrames = 171,       /* Broadcom-specific */
    230     snmpBcmPonOutUnusedOctets = 172,    /* Broadcom-specific */
    231     snmpBcmEtherStatsPkts9217to16383Octets = 173, /* Broadcom-specific */
    232     snmpBcmReceivedPkts9217to16383Octets = 174, /* Broadcom-specific */
    233     snmpBcmTransmittedPkts9217to16383Octets = 175, /* Broadcom-specific */
    234     snmpBcmRxVlanTagFrame = 176,        /* Broadcom-specific */
    235     snmpBcmRxDoubleVlanTagFrame = 177,  /* Broadcom-specific */
    236     snmpBcmTxVlanTagFrame = 178,        /* Broadcom-specific */
    237     snmpBcmTxDoubleVlanTagFrame = 179,  /* Broadcom-specific */
    238     snmpBcmRxPFCControlFrame = 180,     /* PFC Receive Control Frame */
    239     snmpBcmTxPFCControlFrame = 181,     /* PFC Transmit Control Frame */
    240     snmpBcmRxPFCFrameXonPriority0 = 182, /* Receive PFC Frame Priority 0 XON to
    241                                            XOFF */
    242     snmpBcmRxPFCFrameXonPriority1 = 183, /* Receive PFC Frame Priority 1 XON to
    243                                            XOFF */
    244     snmpBcmRxPFCFrameXonPriority2 = 184, /* Receive PFC Frame Priority 2 XON to
    245                                            XOFF */
    246     snmpBcmRxPFCFrameXonPriority3 = 185, /* Receive PFC Frame Priority 3 XON to
    247                                            XOFF */
    248     snmpBcmRxPFCFrameXonPriority4 = 186, /* Receive PFC Frame Priority 4 XON to
    249                                            XOFF */
    250     snmpBcmRxPFCFrameXonPriority5 = 187, /* Receive PFC Frame Priority 5 XON to
    251                                            XOFF */
    252     snmpBcmRxPFCFrameXonPriority6 = 188, /* Receive PFC Frame Priority 6 XON to
    253                                            XOFF */
    254     snmpBcmRxPFCFrameXonPriority7 = 189, /* Receive PFC Frame Priority 7 XON to
    255                                            XOFF */
    256     snmpBcmRxPFCFramePriority0 = 190,   /* Receive PFC Frame Priority 0 */
    257     snmpBcmRxPFCFramePriority1 = 191,   /* Receive PFC Frame Priority 1 */
    258     snmpBcmRxPFCFramePriority2 = 192,   /* Receive PFC Frame Priority 2 */
    259     snmpBcmRxPFCFramePriority3 = 193,   /* Receive PFC Frame Priority 3 */
    260     snmpBcmRxPFCFramePriority4 = 194,   /* Receive PFC Frame Priority 4 */
    261     snmpBcmRxPFCFramePriority5 = 195,   /* Receive PFC Frame Priority 5 */
    262     snmpBcmRxPFCFramePriority6 = 196,   /* Receive PFC Frame Priority 6 */
    263     snmpBcmRxPFCFramePriority7 = 197,   /* Receive PFC Frame Priority 7 */
    264     snmpBcmTxPFCFramePriority0 = 198,   /* Transmit PFC Frame Priority 0 */
    265     snmpBcmTxPFCFramePriority1 = 199,   /* Transmit PFC Frame Priority 1 */
    266     snmpBcmTxPFCFramePriority2 = 200,   /* Transmit PFC Frame Priority 2 */
    267     snmpBcmTxPFCFramePriority3 = 201,   /* Transmit PFC Frame Priority 3 */
    268     snmpBcmTxPFCFramePriority4 = 202,   /* Transmit PFC Frame Priority 4 */
    269     snmpBcmTxPFCFramePriority5 = 203,   /* Transmit PFC Frame Priority 5 */
    270     snmpBcmTxPFCFramePriority6 = 204,   /* Transmit PFC Frame Priority 6 */
    271     snmpBcmTxPFCFramePriority7 = 205,   /* Transmit PFC Frame Priority 7 */
    272     snmpFcmPortClass3RxFrames = 206,    /* RFC 4044 */
    273     snmpFcmPortClass3TxFrames = 207,    /* RFC 4044 */
    274     snmpFcmPortClass3Discards = 208,    /* RFC 4044 */
    275     snmpFcmPortClass2RxFrames = 209,    /* RFC 4044 */
    276     snmpFcmPortClass2TxFrames = 210,    /* RFC 4044 */
    277     snmpFcmPortClass2Discards = 211,    /* RFC 4044 */
    278     snmpFcmPortInvalidCRCs = 212,       /* RFC 4044 */
    279     snmpFcmPortDelimiterErrors = 213,   /* RFC 4044 */
    280     snmpBcmSampleIngressPkts = 214,     /* Total number of packets eligible to
    281                                            be sampled by Ingress Sampler.
    282                                            (Broadcom-specific) */
    283     snmpBcmSampleIngressSnapshotPkts = 215, /* Total number of eligible packets when
    284                                            the last packet was sampled by
    285                                            Ingress sampler. (Broadcom-specific) */
    286     snmpBcmSampleIngressSampledPkts = 216, /* Total number of packets sampled by
    287                                            Ingress sampler. (Broadcom-specific) */
    288     snmpBcmSampleFlexPkts = 217,        /* Total number of packets eligible to
    289                                            be sampled by Flex sampler enabled by
    290                                            IFP ingress sampling policy action.
    291                                            (Broadcom-specific) */
    292     snmpBcmSampleFlexSnapshotPkts = 218, /* Total number of eligible packets when
    293                                            the last packet was sampled by Flex
    294                                            sampler enabled by IFP ingress
    295                                            sampling policy action.
    296                                            (Broadcom-specific) */
    297     snmpBcmSampleFlexSampledPkts = 219, /* Total number of packets sampled by
    298                                            Flex sampler enabled by IFP ingress
    299                                            sampling policy action.
    300                                            (Broadcom-specific) */
    301     snmpBcmEgressProtectionDataDrop = 220, /* Egress Protection data drop in EPIPE.
    302                                            (Broadcom-specific) */
    303     snmpBcmTxE2ECCControlFrames = 221,  /* Total number of End to End Congestion
    304                                            Control(E2E-CC) Head of line(HOL)
    305                                            packets or DMVoQ flow control packets
    306                                            transmitted on each of the ports.
    307                                            (Broadcom-specific) */
    308     snmpBcmE2EHOLDropPkts = 222,        /* Total number of packets dropped due
    309                                            to E2EHOL (End to End Head of Line)
    310                                            drop status. (Broadcom-specific) */
    311     snmpEtherStatsTxCRCAlignErrors = 223, /* RFC 1757 (EtherStat) */
    312     snmpEtherStatsTxJabbers = 224,      /* RFC 1757 (EtherStat) */
    313     snmpBcmMacMergeTxFrag = 225,        /* Number of additional mPackets
    314                                            transmitted due to preemption. */
    315     snmpBcmMacMergeTxVerifyFrame = 226, /* Number of transmitted verify
    316                                            mPackets. */
    317     snmpBcmMacMergeTxReplyFrame = 227,  /* Number of transmitted reply mPackets. */
    318     snmpBcmMacMergeRxFrameAssErrors = 228, /* Number of packets with reassembly
    319                                            errors in MAC receive direction. */
    320     snmpBcmMacMergeRxFrameSmdErrors = 229, /* Number of received packets rejected
    321                                            due to unknown SMD value or arriving
    322                                            with an SMD-C when no packet is in
    323                                            progress. */
    324     snmpBcmMacMergeRxFrameAss = 230,    /* Number of received packets that were
    325                                            successfully reassembled. */
    326     snmpBcmMacMergeRxFrag = 231,        /* Number of additional mPackets
    327                                            received due to preemption. */
    328     snmpBcmMacMergeRxVerifyFrame = 232, /* Number of received verify mPackets. */
    329     snmpBcmMacMergeRxReplyFrame = 233,  /* Number of received reply mPackets. */
    330     snmpBcmMacMergeRxFinalFragSizeError = 234, /* Number of the received mPackets which
    331                                            are less than non-final fragments
    332                                            size. */
    333     snmpBcmMacMergeRxFragSizeError = 235, /* Number of received mPackets which are
    334                                            less than final fragments size. */
    335     snmpBcmMacMergeRxDiscard = 236,     /* Number of all discarded mPackets
    336                                            because of error conditions. */
    337     snmpBcmMacMergeHoldCount = 237,     /* Number of hold request primitive
    338                                            events. */
    339     snmpBcmRxBipErrorCount = 238,       /* RX BER and BIP counter. */
    340     snmpBcmTxEcnErrors = 239,           /* Egress ECN error counter. */
    341     snmpBcmRxDot3LengthMismatches = 240, /* Number of the received good frames in
    342                                            which the 802.3 length field is valid
    343                                            (<= 0x600) and does not match the
    344                                            number of data bytes actually
    345                                            received. */
    346     snmpBcmReceivedTruncatedPkts = 241, /* Number of the received truncated
    347                                            frame counter. */
    348     snmpBcmReceivedPreemptPkts64Octets = 242, /* Broadcom-specific */
    349     snmpBcmReceivedPreemptPkts65to127Octets = 243, /* Broadcom-specific */
    350     snmpBcmReceivedPreemptPkts128to255Octets = 244, /* Broadcom-specific */
    351     snmpBcmReceivedPreemptPkts256to511Octets = 245, /* Broadcom-specific */
    352     snmpBcmReceivedPreemptPkts512to1023Octets = 246, /* Broadcom-specific */
    353     snmpBcmReceivedPreemptPkts1024to1518Octets = 247, /* Broadcom-specific */
    354     snmpBcmReceivedPreemptPkts1519to2047Octets = 248, /* Broadcom-specific */
    355     snmpBcmReceivedPreemptPkts2048to4095Octets = 249, /* Broadcom-specific */
    356     snmpBcmReceivedPreemptPkts4095to9216Octets = 250, /* Broadcom-specific */
    357     snmpBcmReceivedPreemptPkts9217to16383Octets = 251, /* Broadcom-specific */
    358     snmpBcmTransmittedPreemptPkts64Octets = 252, /* Broadcom-specific */
    359     snmpBcmTransmittedPreemptPkts65to127Octets = 253, /* Broadcom-specific */
    360     snmpBcmTransmittedPreemptPkts128to255Octets = 254, /* Broadcom-specific */
    361     snmpBcmTransmittedPreemptPkts256to511Octets = 255, /* Broadcom-specific */
    362     snmpBcmTransmittedPreemptPkts512to1023Octets = 256, /* Broadcom-specific */
    363     snmpBcmTransmittedPreemptPkts1024to1518Octets = 257, /* Broadcom-specific */
    364     snmpBcmTransmittedPreemptPkts1519to2047Octets = 258, /* Broadcom-specific */
    365     snmpBcmTransmittedPreemptPkts2048to4095Octets = 259, /* Broadcom-specific */
    366     snmpBcmTransmittedPreemptPkts4095to9216Octets = 260, /* Broadcom-specific */
    367     snmpBcmTransmittedPreemptPkts9217to16383Octets = 261, /* Broadcom-specific */
    368     snmpBcmIfInUcastPreemptPkts = 262,  /* Broadcom-specific */
    369     snmpBcmIfInPreemptOctets = 263,     /* Broadcom-specific */
    370     snmpBcmIfInPreemptErrors = 264,     /* Broadcom-specific */
    371     snmpBcmIfInMulticastPreemptPkts = 265, /* Broadcom-specific */
    372     snmpBcmIfInBroadcastPreemptPkts = 266, /* Broadcom-specific */
    373     snmpBcmIfOutPreemptOctets = 267,    /* Broadcom-specific */
    374     snmpBcmIfOutUcastPreemptPkts = 268, /* Broadcom-specific */
    375     snmpBcmIfOutBroadcastPreemptPkts = 269, /* Broadcom-specific */
    376     snmpBcmIfOutMulticastPreemptPkts = 270, /* Broadcom-specific */
    377     snmpBcmEtherStatsBroadcastPreemptPkts = 271, /* Broadcom-specific */
    378     snmpBcmEtherStatsMulticastPreemptPkts = 272, /* Broadcom-specific */
    379     snmpBcmEtherStatsCRCAlignPreemptErrors = 273, /* Broadcom-specific */
    380     snmpBcmEtherStatsUndersizePreemptPkts = 274, /* Broadcom-specific */
    381     snmpBcmEtherStatsOversizePreemptPkts = 275, /* Broadcom-specific */
    382     snmpBcmEtherStatsPreemptFragments = 276, /* Broadcom-specific */
    383     snmpBcmEtherStatsPreemptJabbers = 277, /* Broadcom-specific */
    384     snmpBcmEtherStatsPreemptPkts = 278, /* Broadcom-specific */
    385     snmpBcmEtherStatsPreemptOctets = 279, /* Broadcom-specific */
    386     snmpBcmIfOutPreemptErrors = 280,    /* Broadcom-specific */
    387     snmpBcmCustomReceive9 = 281,        /* Broadcom-specific */
    388     snmpBcmCustomReceive10 = 282,       /* Broadcom-specific */
    389     snmpBcmCustomReceive11 = 283,       /* Broadcom-specific */
    390     snmpBcmCustomReceive12 = 284,       /* Broadcom-specific */
    391     snmpBcmCustomReceive13 = 285,       /* Broadcom-specific */
    392     snmpBcmCustomReceive14 = 286,       /* Broadcom-specific */
    393     snmpBcmCustomReceive15 = 287,       /* Broadcom-specific */
    394     snmpBcmRxTunnelDecapEcnPkts = 288,  /* Number of ECN marked packets received
    395                                            on a terminating tunnel. */
    396     snmpBcmTxEcnPkts = 289,             /* Number of the transmitted ECN marked
    397                                            packets. */
    398     snmpValCount = 290 
    399 } bcm_stat_val_t;
    400 
    401 #define BCM_STAT_NAME_INITIALIZER \
    402 { \
    403     "snmpIfInOctets", \
    404     "snmpIfInUcastPkts", \
    405     "snmpIfInNUcastPkts", \
    406     "snmpIfInDiscards", \
    407     "snmpIfInErrors", \
    408     "snmpIfInUnknownProtos", \
    409     "snmpIfOutOctets", \
    410     "snmpIfOutUcastPkts", \
    411     "snmpIfOutNUcastPkts", \
    412     "snmpIfOutDiscards", \
    413     "snmpIfOutErrors", \
    414     "snmpIfOutQLen", \
    415     "snmpIpInReceives", \
    416     "snmpIpInHdrErrors", \
    417     "snmpIpForwDatagrams", \
    418     "snmpIpInDiscards", \
    419     "snmpDot1dBasePortDelayExceededDiscards", \
    420     "snmpDot1dBasePortMtuExceededDiscards", \
    421     "snmpDot1dTpPortInFrames", \
    422     "snmpDot1dTpPortOutFrames", \
    423     "snmpDot1dPortInDiscards", \
    424     "snmpEtherStatsDropEvents", \
    425     "snmpEtherStatsMulticastPkts", \
    426     "snmpEtherStatsBroadcastPkts", \
    427     "snmpEtherStatsUndersizePkts", \
    428     "snmpEtherStatsFragments", \
    429     "snmpEtherStatsPkts64Octets", \
    430     "snmpEtherStatsPkts65to127Octets", \
    431     "snmpEtherStatsPkts128to255Octets", \
    432     "snmpEtherStatsPkts256to511Octets", \
    433     "snmpEtherStatsPkts512to1023Octets", \
    434     "snmpEtherStatsPkts1024to1518Octets", \
    435     "snmpEtherStatsOversizePkts", \
    436     "snmpEtherRxOversizePkts", \
    437     "snmpEtherTxOversizePkts", \
    438     "snmpEtherStatsJabbers", \
    439     "snmpEtherStatsOctets", \
    440     "snmpEtherStatsPkts", \
    441     "snmpEtherStatsCollisions", \
    442     "snmpEtherStatsCRCAlignErrors", \
    443     "snmpEtherStatsTXNoErrors", \
    444     "snmpEtherStatsRXNoErrors", \
    445     "snmpDot3StatsAlignmentErrors", \
    446     "snmpDot3StatsFCSErrors", \
    447     "snmpDot3StatsSingleCollisionFrames", \
    448     "snmpDot3StatsMultipleCollisionFrames", \
    449     "snmpDot3StatsSQETTestErrors", \
    450     "snmpDot3StatsDeferredTransmissions", \
    451     "snmpDot3StatsLateCollisions", \
    452     "snmpDot3StatsExcessiveCollisions", \
    453     "snmpDot3StatsInternalMacTransmitErrors", \
    454     "snmpDot3StatsCarrierSenseErrors", \
    455     "snmpDot3StatsFrameTooLongs", \
    456     "snmpDot3StatsInternalMacReceiveErrors", \
    457     "snmpDot3StatsSymbolErrors", \
    458     "snmpDot3ControlInUnknownOpcodes", \
    459     "snmpDot3InPauseFrames", \
    460     "snmpDot3OutPauseFrames", \
    461     "snmpIfHCInOctets", \
    462     "snmpIfHCInUcastPkts", \
    463     "snmpIfHCInMulticastPkts", \
    464     "snmpIfHCInBroadcastPkts", \
    465     "snmpIfHCOutOctets", \
    466     "snmpIfHCOutUcastPkts", \
    467     "snmpIfHCOutMulticastPkts", \
    468     "snmpIfHCOutBroadcastPckts", \
    469     "snmpIpv6IfStatsInReceives", \
    470     "snmpIpv6IfStatsInHdrErrors", \
    471     "snmpIpv6IfStatsInAddrErrors", \
    472     "snmpIpv6IfStatsInDiscards", \
    473     "snmpIpv6IfStatsOutForwDatagrams", \
    474     "snmpIpv6IfStatsOutDiscards", \
    475     "snmpIpv6IfStatsInMcastPkts", \
    476     "snmpIpv6IfStatsOutMcastPkts", \
    477     "snmpIfInBroadcastPkts", \
    478     "snmpIfInMulticastPkts", \
    479     "snmpIfOutBroadcastPkts", \
    480     "snmpIfOutMulticastPkts", \
    481     "snmpIeee8021PfcRequests", \
    482     "snmpIeee8021PfcIndications", \
    483     "snmpBcmReceivedUndersizePkts", \
    484     "snmpBcmTransmittedUndersizePkts", \
    485     "snmpBcmIPMCBridgedPckts", \
    486     "snmpBcmIPMCRoutedPckts", \
    487     "snmpBcmIPMCInDroppedPckts", \
    488     "snmpBcmIPMCOutDroppedPckts", \
    489     "snmpBcmEtherStatsPkts1519to1522Octets", \
    490     "snmpBcmEtherStatsPkts1522to2047Octets", \
    491     "snmpBcmEtherStatsPkts2048to4095Octets", \
    492     "snmpBcmEtherStatsPkts4095to9216Octets", \
    493     "snmpBcmReceivedPkts64Octets", \
    494     "snmpBcmReceivedPkts65to127Octets", \
    495     "snmpBcmReceivedPkts128to255Octets", \
    496     "snmpBcmReceivedPkts256to511Octets", \
    497     "snmpBcmReceivedPkts512to1023Octets", \
    498     "snmpBcmReceivedPkts1024to1518Octets", \
    499     "snmpBcmReceivedPkts1519to2047Octets", \
    500     "snmpBcmReceivedPkts2048to4095Octets", \
    501     "snmpBcmReceivedPkts4095to9216Octets", \
    502     "snmpBcmTransmittedPkts64Octets", \
    503     "snmpBcmTransmittedPkts65to127Octets", \
    504     "snmpBcmTransmittedPkts128to255Octets", \
    505     "snmpBcmTransmittedPkts256to511Octets", \
    506     "snmpBcmTransmittedPkts512to1023Octets", \
    507     "snmpBcmTransmittedPkts1024to1518Octets", \
    508     "snmpBcmTransmittedPkts1519to2047Octets", \
    509     "snmpBcmTransmittedPkts2048to4095Octets", \
    510     "snmpBcmTransmittedPkts4095to9216Octets", \
    511     "snmpBcmTxControlCells", \
    512     "snmpBcmTxDataCells", \
    513     "snmpBcmTxDataBytes", \
    514     "snmpBcmRxCrcErrors", \
    515     "snmpBcmRxFecCorrectable", \
    516     "snmpBcmRxBecCrcErrors", \
    517     "snmpBcmRxDisparityErrors", \
    518     "snmpBcmRxControlCells", \
    519     "snmpBcmRxDataCells", \
    520     "snmpBcmRxDataBytes", \
    521     "snmpBcmRxDroppedRetransmittedControl", \
    522     "snmpBcmTxBecRetransmit", \
    523     "snmpBcmRxBecRetransmit", \
    524     "snmpBcmTxAsynFifoRate", \
    525     "snmpBcmRxAsynFifoRate", \
    526     "snmpBcmRxFecUncorrectable", \
    527     "snmpBcmRxBecRxFault", \
    528     "snmpBcmRxCodeErrors", \
    529     "snmpBcmRxRsFecBitError", \
    530     "snmpBcmRxRsFecSymbolError", \
    531     "snmpBcmRxLlfcPrimary", \
    532     "snmpBcmRxLlfcSecondary", \
    533     "snmpBcmCustomReceive0", \
    534     "snmpBcmCustomReceive1", \
    535     "snmpBcmCustomReceive2", \
    536     "snmpBcmCustomReceive3", \
    537     "snmpBcmCustomReceive4", \
    538     "snmpBcmCustomReceive5", \
    539     "snmpBcmCustomReceive6", \
    540     "snmpBcmCustomReceive7", \
    541     "snmpBcmCustomReceive8", \
    542     "snmpBcmCustomTransmit0", \
    543     "snmpBcmCustomTransmit1", \
    544     "snmpBcmCustomTransmit2", \
    545     "snmpBcmCustomTransmit3", \
    546     "snmpBcmCustomTransmit4", \
    547     "snmpBcmCustomTransmit5", \
    548     "snmpBcmCustomTransmit6", \
    549     "snmpBcmCustomTransmit7", \
    550     "snmpBcmCustomTransmit8", \
    551     "snmpBcmCustomTransmit9", \
    552     "snmpBcmCustomTransmit10", \
    553     "snmpBcmCustomTransmit11", \
    554     "snmpBcmCustomTransmit12", \
    555     "snmpBcmCustomTransmit13", \
    556     "snmpBcmCustomTransmit14", \
    557     "snmpDot3StatsInRangeLengthError", \
    558     "snmpDot3OmpEmulationCRC8Errors", \
    559     "snmpDot3MpcpRxGate", \
    560     "snmpDot3MpcpRxRegister", \
    561     "snmpDot3MpcpTxRegRequest", \
    562     "snmpDot3MpcpTxRegAck", \
    563     "snmpDot3MpcpTxReport", \
    564     "snmpDot3EponFecCorrectedBlocks", \
    565     "snmpDot3EponFecUncorrectableBlocks", \
    566     "snmpBcmPonInDroppedOctets", \
    567     "snmpBcmPonOutDroppedOctets", \
    568     "snmpBcmPonInDelayedOctets", \
    569     "snmpBcmPonOutDelayedOctets", \
    570     "snmpBcmPonInDelayedHundredUs", \
    571     "snmpBcmPonOutDelayedHundredUs", \
    572     "snmpBcmPonInFrameErrors", \
    573     "snmpBcmPonInOamFrames", \
    574     "snmpBcmPonOutOamFrames", \
    575     "snmpBcmPonOutUnusedOctets", \
    576     "snmpBcmEtherStatsPkts9217to16383Octets", \
    577     "snmpBcmReceivedPkts9217to16383Octets", \
    578     "snmpBcmTransmittedPkts9217to16383Octets", \
    579     "snmpBcmRxVlanTagFrame", \
    580     "snmpBcmRxDoubleVlanTagFrame", \
    581     "snmpBcmTxVlanTagFrame", \
    582     "snmpBcmTxDoubleVlanTagFrame", \
    583     "snmpBcmRxPFCControlFrame", \
    584     "snmpBcmTxPFCControlFrame", \
    585     "snmpBcmRxPFCFrameXonPriority0", \
    586     "snmpBcmRxPFCFrameXonPriority1", \
    587     "snmpBcmRxPFCFrameXonPriority2", \
    588     "snmpBcmRxPFCFrameXonPriority3", \
    589     "snmpBcmRxPFCFrameXonPriority4", \
    590     "snmpBcmRxPFCFrameXonPriority5", \
    591     "snmpBcmRxPFCFrameXonPriority6", \
    592     "snmpBcmRxPFCFrameXonPriority7", \
    593     "snmpBcmRxPFCFramePriority0", \
    594     "snmpBcmRxPFCFramePriority1", \
    595     "snmpBcmRxPFCFramePriority2", \
    596     "snmpBcmRxPFCFramePriority3", \
    597     "snmpBcmRxPFCFramePriority4", \
    598     "snmpBcmRxPFCFramePriority5", \
    599     "snmpBcmRxPFCFramePriority6", \
    600     "snmpBcmRxPFCFramePriority7", \
    601     "snmpBcmTxPFCFramePriority0", \
    602     "snmpBcmTxPFCFramePriority1", \
    603     "snmpBcmTxPFCFramePriority2", \
    604     "snmpBcmTxPFCFramePriority3", \
    605     "snmpBcmTxPFCFramePriority4", \
    606     "snmpBcmTxPFCFramePriority5", \
    607     "snmpBcmTxPFCFramePriority6", \
    608     "snmpBcmTxPFCFramePriority7", \
    609     "snmpFcmPortClass3RxFrames", \
    610     "snmpFcmPortClass3TxFrames", \
    611     "snmpFcmPortClass3Discards", \
    612     "snmpFcmPortClass2RxFrames", \
    613     "snmpFcmPortClass2TxFrames", \
    614     "snmpFcmPortClass2Discards", \
    615     "snmpFcmPortInvalidCRCs", \
    616     "snmpFcmPortDelimiterErrors", \
    617     "snmpBcmSampleIngressPkts", \
    618     "snmpBcmSampleIngressSnapshotPkts", \
    619     "snmpBcmSampleIngressSampledPkts", \
    620     "snmpBcmSampleFlexPkts", \
    621     "snmpBcmSampleFlexSnapshotPkts", \
    622     "snmpBcmSampleFlexSampledPkts", \
    623     "snmpBcmEgressProtectionDataDrop", \
    624     "snmpBcmTxE2ECCControlFrames", \
    625     "snmpBcmE2EHOLDropPkts", \
    626     "snmpEtherStatsTxCRCAlignErrors", \
    627     "snmpEtherStatsTxJabbers", \
    628     "snmpBcmMacMergeTxFrag", \
    629     "snmpBcmMacMergeTxVerifyFrame", \
    630     "snmpBcmMacMergeTxReplyFrame", \
    631     "snmpBcmMacMergeRxFrameAssErrors", \
    632     "snmpBcmMacMergeRxFrameSmdErrors", \
    633     "snmpBcmMacMergeRxFrameAss", \
    634     "snmpBcmMacMergeRxFrag", \
    635     "snmpBcmMacMergeRxVerifyFrame", \
    636     "snmpBcmMacMergeRxReplyFrame", \
    637     "snmpBcmMacMergeRxFinalFragSizeError", \
    638     "snmpBcmMacMergeRxFragSizeError", \
    639     "snmpBcmMacMergeRxDiscard", \
    640     "snmpBcmMacMergeHoldCount", \
    641     "snmpBcmRxBipErrorCount", \
    642     "snmpBcmTxEcnErrors", \
    643     "snmpBcmRxDot3LengthMismatches", \
    644     "snmpBcmReceivedTruncatedPkts", \
    645     "snmpBcmReceivedPreemptPkts64Octets", \
    646     "snmpBcmReceivedPreemptPkts65to127Octets", \
    647     "snmpBcmReceivedPreemptPkts128to255Octets", \
    648     "snmpBcmReceivedPreemptPkts256to511Octets", \
    649     "snmpBcmReceivedPreemptPkts512to1023Octets", \
    650     "snmpBcmReceivedPreemptPkts1024to1518Octets", \
    651     "snmpBcmReceivedPreemptPkts1519to2047Octets", \
    652     "snmpBcmReceivedPreemptPkts2048to4095Octets", \
    653     "snmpBcmReceivedPreemptPkts4095to9216Octets", \
    654     "snmpBcmReceivedPreemptPkts9217to16383Octets", \
    655     "snmpBcmTransmittedPreemptPkts64Octets", \
    656     "snmpBcmTransmittedPreemptPkts65to127Octets", \
    657     "snmpBcmTransmittedPreemptPkts128to255Octets", \
    658     "snmpBcmTransmittedPreemptPkts256to511Octets", \
    659     "snmpBcmTransmittedPreemptPkts512to1023Octets", \
    660     "snmpBcmTransmittedPreemptPkts1024to1518Octets", \
    661     "snmpBcmTransmittedPreemptPkts1519to2047Octets", \
    662     "snmpBcmTransmittedPreemptPkts2048to4095Octets", \
    663     "snmpBcmTransmittedPreemptPkts4095to9216Octets", \
    664     "snmpBcmTransmittedPreemptPkts9217to16383Octets", \
    665     "snmpBcmIfInUcastPreemptPkts", \
    666     "snmpBcmIfInPreemptOctets", \
    667     "snmpBcmIfInPreemptErrors", \
    668     "snmpBcmIfInMulticastPreemptPkts", \
    669     "snmpBcmIfInBroadcastPreemptPkts", \
    670     "snmpBcmIfOutPreemptOctets", \
    671     "snmpBcmIfOutUcastPreemptPkts", \
    672     "snmpBcmIfOutBroadcastPreemptPkts", \
    673     "snmpBcmIfOutMulticastPreemptPkts", \
    674     "snmpBcmEtherStatsBroadcastPreemptPkts", \
    675     "snmpBcmEtherStatsMulticastPreemptPkts", \
    676     "snmpBcmEtherStatsCRCAlignPreemptErrors", \
    677     "snmpBcmEtherStatsUndersizePreemptPkts", \
    678     "snmpBcmEtherStatsOversizePreemptPkts", \
    679     "snmpBcmEtherStatsPreemptFragments", \
    680     "snmpBcmEtherStatsPreemptJabbers", \
    681     "snmpBcmEtherStatsPreemptPkts", \
    682     "snmpBcmEtherStatsPreemptOctets", \
    683     "snmpBcmIfOutPreemptErrors", \
    684     "snmpBcmCustomReceive9", \
    685     "snmpBcmCustomReceive10", \
    686     "snmpBcmCustomReceive11", \
    687     "snmpBcmCustomReceive12", \
    688     "snmpBcmCustomReceive13", \
    689     "snmpBcmCustomReceive14", \
    690     "snmpBcmCustomReceive15", \
    691     "snmpBcmRxTunnelDecapEcnPkts", \
    692     "snmpBcmTxEcnPkts"  \
    693 }
    694 
    695 /* bcm_custom_stat_trigger_e */
    696 typedef enum bcm_custom_stat_trigger_e {
    697     bcmDbgCntRIPD4 = 0,                 /* Rx: IPv4 L3 discard packets. */
    698     bcmDbgCntRIPC4 = 1,                 /* Rx: Good L3 (V4 packets) includes
    699                                            tunneled. */
    700     bcmDbgCntRIPHE4 = 2,                /* Rx: IPv4 header error packets. */
    701     bcmDbgCntIMRP4 = 3,                 /* Rx: Routed IPv4 multicast packets. */
    702     bcmDbgCntRIPD6 = 4,                 /* Rx: IPv6 L3 discard packets. */
    703     bcmDbgCntRIPC6 = 5,                 /* Rx: Good L3 (V6 packets) includes
    704                                            tunneled. */
    705     bcmDbgCntRIPHE6 = 6,                /* Rx: IPv6 header error packets. */
    706     bcmDbgCntIMRP6 = 7,                 /* Rx: Routed IPv6 multicast packets. */
    707     bcmDbgCntRDISC = 8,                 /* Rx: IBP discard and CBP full. */
    708     bcmDbgCntRUC = 9,                   /* Rx: Good unicast (L2+L3) packets. */
    709     bcmDbgCntRPORTD = 10,               /* Rx: Packets droppped when ingress
    710                                            port is not in forwarding state. */
    711     bcmDbgCntPDISC = 11,                /* Rx: policy discard - DST_DISCARD,
    712                                            SRC_DISCARD, RATE_CONTROL... */
    713     bcmDbgCntIMBP = 12,                 /* Rx: Bridged multicast packets. */
    714     bcmDbgCntRFILDR = 13,               /* Rx: Packets dropped by FP. */
    715     bcmDbgCntRIMDR = 14,                /* Rx: Multicast (L2+L3) packets that
    716                                            are dropped. */
    717     bcmDbgCntRDROP = 15,                /* Rx: Port bitmap zero drop condition. */
    718     bcmDbgCntIRPSE = 16,                /* Rx: HiGig IPIC pause packets. */
    719     bcmDbgCntIRHOL = 17,                /* Rx: HiGig End-to-End HOL packets
    720                                            (BCM56504/56700/56800/56580). */
    721     bcmDbgCntIRIBP = 18,                /* Rx: HiGig End-to-End IBP packets
    722                                            (BCM56504/56700/56800/56580). */
    723     bcmDbgCntDSL3HE = 19,               /* Rx: DOS L3 header error packets. */
    724     bcmDbgCntIUNKHDR = 20,              /* Rx: Unknown HiGig header type packet
    725                                            (BCM56700/56800/56580). */
    726     bcmDbgCntDSL4HE = 21,               /* Rx: DOS L4 header error packets. */
    727     bcmDbgCntIMIRROR = 22,              /* Rx: HiGig mirror packet
    728                                            (BCM56700/56800/56580). */
    729     bcmDbgCntDSICMP = 23,               /* Rx: DOS ICMP error packets. */
    730     bcmDbgCntDSFRAG = 24,               /* Rx: DOS fragment error packets. */
    731     bcmDbgCntMTUERR = 25,               /* Rx: Packets trapped to CPU due to
    732                                            egress L3 MTU violation. */
    733     bcmDbgCntRTUN = 26,                 /* Rx: Tunnel packets. */
    734     bcmDbgCntRTUNE = 27,                /* Rx: tunnel error packets. */
    735     bcmDbgCntVLANDR = 28,               /* Rx: VLAN drops. */
    736     bcmDbgCntRHGUC = 29,                /* Rx: HiGig lookup UC cases (BCM56504
    737                                            B0). */
    738     bcmDbgCntRHGMC = 30,                /* Rx: HiGig lookup MC cases (BCM56504
    739                                            B0). */
    740     bcmDbgCntMPLS = 31,                 /* Rx: MPLS packets (BCM5660x only). */
    741     bcmDbgCntMACLMT = 32,               /* Rx: packets dropped due to MAC Limit
    742                                            is hit. */
    743     bcmDbgCntMPLSERR = 33,              /* Rx: MPLS packets with error (BCM5660x
    744                                            only). */
    745     bcmDbgCntURPFERR = 34,              /* Rx: L3 source URPF check Fail
    746                                            (BCM5660x only). */
    747     bcmDbgCntHGHDRE = 35,               /* Rx: HiGig Header error packets
    748                                            (BCM56700/56800/56580/56514). */
    749     bcmDbgCntMCIDXE = 36,               /* Rx: Multicast Index error packets
    750                                            (BCM56700/56800/56580). */
    751     bcmDbgCntLAGLUP = 37,               /* Rx: LAG failover loopback packets
    752                                            (BCM56700/56800/56580). */
    753     bcmDbgCntLAGLUPD = 38,              /* Rx: LAG backup port down
    754                                            (BCM56700/56800/56580). */
    755     bcmDbgCntPARITYD = 39,              /* Rx: Parity error packets
    756                                            (BCM56700/56800/56580). */
    757     bcmDbgCntVFPDR = 40,                /* Rx: VLAN FP drop case (BCM56514). */
    758     bcmDbgCntURPF = 41,                 /* Rx: Unicast RPF drop case (BCM56514). */
    759     bcmDbgCntDSTDISCARDDROP = 42,       /* Rx: L2/L3 lookup DST_DISCARD drop. */
    760     bcmDbgCntCLASSBASEDMOVEDROP = 43,   /* Rx: Class based learning drop. */
    761     bcmDbgCntMACLMT_NODROP = 44,        /* Rx: Mac limit exceeded and packet not
    762                                            dropped. */
    763     bcmDbgCntMACSAEQUALMACDA = 45,      /* Rx: Dos Attack L2 Packets MACSA
    764                                            equals to MACDA. */
    765     bcmDbgCntMACLMT_DROP = 46,          /* Rx: Mac limit exceeded and packet
    766                                            dropped. */
    767     bcmDbgCntTGIP4 = 47,                /* Tx: Good IPv4 L3 UC packets. */
    768     bcmDbgCntTIPD4 = 48,                /* Tx: IPv4 L3 UC Aged and Drop packets. */
    769     bcmDbgCntTGIPMC4 = 49,              /* Tx: Good IPv4 IPMC packets. */
    770     bcmDbgCntTIPMCD4 = 50,              /* Tx: IPv4 IPMC Aged and Drop packets. */
    771     bcmDbgCntTGIP6 = 51,                /* Tx: Good IPv6 L3 UC packets. */
    772     bcmDbgCntTIPD6 = 52,                /* Tx: IPv6 L3 UC Aged and Drop Packets. */
    773     bcmDbgCntTGIPMC6 = 53,              /* Tx: Good IPv6 IPMC packets. */
    774     bcmDbgCntTIPMCD6 = 54,              /* Tx: IPv6 IPMC Aged and Drop packets. */
    775     bcmDbgCntTTNL = 55,                 /* Tx: Tunnel packets. */
    776     bcmDbgCntTTNLE = 56,                /* Tx: Tunnel error packets. */
    777     bcmDbgCntTTTLD = 57,                /* Tx: Packets dropped due to TTL
    778                                            threshold counter. */
    779     bcmDbgCntTCFID = 58,                /* Tx: Packets dropped when CFI set &
    780                                            pket is untagged or L3 switched for
    781                                            IPMC. */
    782     bcmDbgCntTVLAN = 59,                /* Tx: VLAN tagged packets. */
    783     bcmDbgCntTVLAND = 60,               /* Tx: Packets dropped due to invalid
    784                                            VLAN counter. */
    785     bcmDbgCntTVXLTMD = 61,              /* Tx: Packets dropped due to miss in
    786                                            VXLT table counter. */
    787     bcmDbgCntTSTGD = 62,                /* Tx: Packets dropped due to Spanning
    788                                            Tree State not in forwarding state. */
    789     bcmDbgCntTAGED = 63,                /* Tx: Packets dropped due to packet
    790                                            aged counter. */
    791     bcmDbgCntTL2MCD = 64,               /* Tx: L2 MC packets. */
    792     bcmDbgCntTPKTD = 65,                /* Tx: Packets dropped due to any
    793                                            condition. */
    794     bcmDbgCntTMIRR = 66,                /* Tx: Packets with mirroring flag. */
    795     bcmDbgCntTSIPL = 67,                /* Tx: Packets with SIP Link Local Drop
    796                                            flag (BCM56504/56700/56800/56580). */
    797     bcmDbgCntTHGUC = 68,                /* Tx: HiGig Looked-up L3UC packets
    798                                            (BCM56504_B0/56700/56800/56580). */
    799     bcmDbgCntTHGMC = 69,                /* Tx: HiGig Looked-up L3MC packets
    800                                            (BCM56504_B0/56700/56800/56580). */
    801     bcmDbgCntTHIGIG2 = 70,              /* Tx: Unknown HiGig2 Drops
    802                                            (BCM56700/56800/56580). */
    803     bcmDbgCntTHGI = 71,                 /* Tx: Unknown HiGig drops
    804                                            (BCM56700/56800/56580). */
    805     bcmDbgCntTL2_MTU = 72,              /* Tx: L2 MTU fail drops
    806                                            (BCM56700/56800/56580). */
    807     bcmDbgCntTPARITY_ERR = 73,          /* Tx: Parity error drops
    808                                            (BCM56700/56800/56580). */
    809     bcmDbgCntTIP_LEN_FAIL = 74,         /* Tx: IP Length check fail drops
    810                                            (BCM56700/56800/56580). */
    811     bcmDbgCntTMTUD = 75,                /* Tx: EBAD_MTU_drops (BCM5660x only). */
    812     bcmDbgCntTSLLD = 76,                /* Tx: ESIP_LINK_LOCAL (BCM5660x only). */
    813     bcmDbgCntTL2MPLS = 77,              /* Tx: L2_MPLS_ENCAP_TX (BCM5660x only). */
    814     bcmDbgCntTL3MPLS = 78,              /* Tx: L3_MPLS_ENCAP_TX (BCM5660x only). */
    815     bcmDbgCntTMPLS = 79,                /* Tx: MPLS_TX (BCM5660x only). */
    816     bcmDbgCntTMODIDTOOLARGEDROP = 80,   /* Tx: MODID greater than 31 drop
    817                                            counter. */
    818     bcmDbgCntPKTMODTOOLARGEDROP = 81,   /* Tx: Byte additions too large drop
    819                                            counter. */
    820     bcmDbgCntRX_SYMBOL = 82,            /* Fabric I/F => Rx Errors (e.g.8B10B) */
    821     bcmDbgCntTIME_ALIGNMENT_EVEN = 83,  /* Fabric I/F => Time Alignment (even) */
    822     bcmDbgCntTIME_ALIGNMENT_ODD = 84,   /* Fabric I/F => Time Alignment (odd) */
    823     bcmDbgCntBIT_INTERLEAVED_PARITY_EVEN = 85, /* Fabric I/F => BIP (even) */
    824     bcmDbgCntBIT_INTERLEAVED_PARITY_ODD = 86, /* Fabric I/F => BIP (odd) */
    825     bcmDbgCntFcmPortClass3RxFrames = 87, /* FCOE L3 RX frames */
    826     bcmDbgCntFcmPortClass3RxDiscards = 88, /* FCOE L3 RX discarded frames */
    827     bcmDbgCntFcmPortClass3TxFrames = 89, /* FCOE L3 TX frames */
    828     bcmDbgCntFcmPortClass2RxFrames = 90, /* FCOE L2 RX frames */
    829     bcmDbgCntFcmPortClass2RxDiscards = 91, /* FCOE L2 RX discarded frames */
    830     bcmDbgCntFcmPortClass2TxFrames = 92, /* FCOE L2 TX frames */
    831     bcmDbgCntNonHGoE = 93,              /* Non HGoE Rx frames on an HGoE port */
    832     bcmDbgCntHGoE = 94,                 /* HGoE Rx frames */
    833     bcmDbgCntEgressProtectionDataDrop = 95, /* Egress Protection data drop in EPIPE */
    834     bcmDbgCntVntagRxError = 96,         /* Rx: VNTAG error packets */
    835     bcmDbgCntNivRxForwardingError = 97, /* Rx: NIV/PE packets dropped due to
    836                                            forwarding error */
    837     bcmDbgCntIfpTriggerPfcRxDrop = 98,  /* Rx: Original ingress packets dropped
    838                                            due to IFP PfcTx action */
    839     bcmDbgCntEcnTxError = 99,           /* Tx: Egress packets dropped due to ECN
    840                                            error */
    841     bcmDbgCntNivTxPrune = 100,          /* Tx: Egress NIV/PE packets dropped due
    842                                            to pruning check */
    843     bcmDbgCntRxHigigLoopbackDrop = 101, /* Rx: HiGig loopback packets dropped. */
    844     bcmDbgCntRxHigigUnknownOpcodeDrop = 102, /* Rx: HiGig packets dropped due to
    845                                            unknown opcode. */
    846     bcmDbgCntRxIpInIpDrop = 103,        /* Rx: IPinIP tunnel process failure. */
    847     bcmDbgCntRxMimDrop = 104,           /* Rx: MiM tunnel process failure. */
    848     bcmDbgCntRxTunnelInterfaceError = 105, /* Rx: IP multicast tunnel incoming
    849                                            interface is incorrect. */
    850     bcmDbgCntRxMplsControlWordInvalid = 106, /* Rx: MPLS invalid control word. */
    851     bcmDbgCntRxMplsGalNotBosDrop = 107, /* Rx: MPLS Generic Label is not BOS. */
    852     bcmDbgCntRxMplsPayloadInvalid = 108, /* Rx: MPLS invalid payload. */
    853     bcmDbgCntRxMplsEntropyDrop = 109,   /* Rx: MPLS entropy label in unallowed
    854                                            range. */
    855     bcmDbgCntRxMplsLabelLookupMiss = 110, /* Rx: MPLS label lookup miss. */
    856     bcmDbgCntRxMplsActionInvalid = 111, /* Rx: MPLS invalid action. */
    857     bcmDbgCntRxTunnelTtlError = 112,    /* Rx: Tunnel TTL check failure. */
    858     bcmDbgCntRxTunnelShimError = 113,   /* Rx: Tunnel shim header error. */
    859     bcmDbgCntRxTunnelObjectValidationFail = 114, /* Rx: Tunnel termination failure as not
    860                                            all packet forwarding objects got
    861                                            assigned. */
    862     bcmDbgCntRxVlanMismatch = 115,      /* Rx: VLAN ID invalid. */
    863     bcmDbgCntRxVlanMemberMismatch = 116, /* Rx: Ingress port not in VLAN
    864                                            membership. */
    865     bcmDbgCntRxTpidMismatch = 117,      /* Rx: VLAN TPID mismatch. */
    866     bcmDbgCntRxPrivateVlanMismatch = 118, /* Rx: PVLAN VID mismatch. */
    867     bcmDbgCntRxMacIpBindError = 119,    /* Rx: MAC to IP bind check failure. */
    868     bcmDbgCntRxVlanTranslate2LookupMiss = 120, /* Rx: VLAN Translate2 lookup miss. */
    869     bcmDbgCntRxL3TunnelLookupMiss = 121, /* Rx: L3 Tunnel lookup miss. */
    870     bcmDbgCntRxMplsLookupMiss = 122,    /* Rx: MPLS lookup miss. */
    871     bcmDbgCntRxVlanTranslate1LookupMiss = 123, /* Rx: VLAN Translate1 lookup miss. */
    872     bcmDbgCntRxFcoeVftDrop = 124,       /* Rx: FVT header error. */
    873     bcmDbgCntRxFcoeSrcBindError = 125,  /* Rx: FCOE source bind check failure. */
    874     bcmDbgCntRxFcoeSrcFpmaError = 126,  /* Rx: Source FPMA prefix check failure. */
    875     bcmDbgCntRxVfiP2pDrop = 127,        /* Rx: PT2PT service but packets arrived
    876                                            from a VP that is not programmed in
    877                                            PT2PT connection. */
    878     bcmDbgCntRxStgDrop = 128,           /* Rx: Spanning tree state not in
    879                                            forwarding state. */
    880     bcmDbgCntRxCompositeError = 129,    /* Rx: HW related error like lookup
    881                                            table with parity error. */
    882     bcmDbgCntRxBpduDrop = 130,          /* Rx: BPUD packets dropped due to
    883                                            PORT_TABLE.DROP_BPDU. */
    884     bcmDbgCntRxProtocolDrop = 131,      /* Rx: Protocol packets dropped due to
    885                                            PROTOCOL_PKT_CONTROL config. */
    886     bcmDbgCntRxUnknownMacSaDrop = 132,  /* Rx: Unknown source MAC packets
    887                                            dropped due to CML_OFFSET.DROP. */
    888     bcmDbgCntRxSrcRouteDrop = 133,      /* Rx: Packets dropped due to MACSA is
    889                                            multicast(bit 40 == 1). */
    890     bcmDbgCntRxL2SrcDiscardDrop = 134,  /* Rx: L2 SRC_DISCARD drop. */
    891     bcmDbgCntRxL2SrcStaticMoveDrop = 135, /* Rx: Port movement of static L2 addr. */
    892     bcmDbgCntRxL2DstDiscardDrop = 136,  /* Rx: L2 DST_DISCARD drop. */
    893     bcmDbgCntRxL3DisableDrop = 137,     /* Rx: Packets dropped due to
    894                                            PORT_TABLE.V4L3_ENABLE/V6L3_ENABLE
    895                                            unset. */
    896     bcmDbgCntRxMacSaEqual0Drop = 138,   /* Rx: Packets dropped due to MACSA ==
    897                                            0. */
    898     bcmDbgCntRxVlanCrossConnectOrNonUnicastDrop = 139, /* Rx: L2 forwarding lookup miss or PBT
    899                                            non unicast packets drop. */
    900     bcmDbgCntRxTimeSyncDrop = 140,      /* Rx: Network time sync packets
    901                                            dropped. */
    902     bcmDbgCntRxIpmcDrop = 141,          /* Rx: IPMC process failure. */
    903     bcmDbgCntRxMyStationDrop = 142,     /* Rx: MY_STATION.DISCARD drop. */
    904     bcmDbgCntRxPrivateVlanVpFilterDrop = 143, /* Rx: Private vlan drop based on
    905                                            src/dst virtual port type. */
    906     bcmDbgCntRxL3DstDiscardDrop = 144,  /* Rx: L3 DST_DISCARD drop. */
    907     bcmDbgCntRxTunnelDecapEcnError = 145, /* Rx: Tunnel decap ECN error. */
    908     bcmDbgCntRxL3SrcDiscardDrop = 146,  /* Rx: L3 SRC_DISCARD drop. */
    909     bcmDbgCntRxFcoeZoneLookupMiss = 147, /* Rx: FCOE_ZONE lookup miss. */
    910     bcmDbgCntRxL3TtlError = 148,        /* Rx: L3 TTL check failure. */
    911     bcmDbgCntRxL3HeaderError = 149,     /* Rx: L3 header error. */
    912     bcmDbgCntRxL2HeaderError = 150,     /* Rx: L2 header error. */
    913     bcmDbgCntRxL3DstLookupDrop = 151,   /* Rx: IPMC processing drop, or
    914                                            L3_DESTINATION == 0 for L3UC packets. */
    915     bcmDbgCntRxL2TtlError = 152,        /* Rx: L2 ZONE TTL check failure. */
    916     bcmDbgCntRxL2RpfError = 153,        /* Rx: Incoming port/lag/svp check
    917                                            failure enforced L2 entry. */
    918     bcmDbgCntRxTagUntagDiscardDrop = 154, /* Rx: Packets dropped due to
    919                                            PORT_DIS_UNTAG/PORT_DIS_TAG. */
    920     bcmDbgCntRxStormControlDrop = 155,  /* Rx: Storm control metering drop. */
    921     bcmDbgCntRxFcoeZoneError = 156,     /* Rx: FCOE_ZONE check failure. */
    922     bcmDbgCntRxFieldChangeL2NoRedirectDrop = 157, /* Rx: FP Changes L2 Fields packets is
    923                                            not eligible for routing. Redirect
    924                                            action must be deployed to select
    925                                            packet destination. */
    926     bcmDbgCntRxNextHopDrop = 158,       /* Rx: NEXT_HOP drop. */
    927     bcmDbgCntRxNatDrop = 159,           /* Rx: NAT process failure, e.g.
    928                                            destination lookup miss or Hairpin
    929                                            drop. */
    930     bcmDbgCntIngressProtectionDataDrop = 160, /* Rx: Protection data drop. */
    931     bcmDbgCntRxSrcKnockoutDrop = 161,   /* Rx: SGPP == DGPP or SVP == DVP, etc. */
    932     bcmDbgCntRxMplsSeqNumberError = 162, /* Rx: MPLS control word sequence number
    933                                            error. */
    934     bcmDbgCntRxBlockMaskDrop = 163,     /* Rx: Packets dropped due to bitmap of
    935                                            ports to be blocked. */
    936     bcmDbgCntRxDlbRhResolutionError = 164, /* Rx: DLB or RH resolution error. */
    937     bcmDbgCntTxFwdDomainNotFoundDrop = 165, /* Tx: Forwarding domain not found. */
    938     bcmDbgCntTxNotFwdDomainMemberDrop = 166, /* Tx: Not forwarding domain member. */
    939     bcmDbgCntTxIpmcL2SrcPortPruneDrop = 167, /* Tx: IPMC L2 self port drop, VLAN ID
    940                                            in the packet is the same as the VLAN
    941                                            ID in EGR_L3_INTF. */
    942     bcmDbgCntTxNonUnicastPruneDrop = 168, /* Tx: Non unicast pruning. */
    943     bcmDbgCntTxSvpRemoveDrop = 169,     /* Tx: Virtual port pruning. */
    944     bcmDbgCntTxVplagPruneDrop = 170,    /* Tx: VPLAG pruning. */
    945     bcmDbgCntTxSplitHorizonDrop = 171,  /* Tx: Packets dropped due to split
    946                                            horizon check. This is done by
    947                                            enabling pruning for DVP network
    948                                            group. */
    949     bcmDbgCntTxMmuPurgeDrop = 172,      /* Tx: Packets dropped due to MMU purge. */
    950     bcmDbgCntTxStgDisableDrop = 173,    /* Tx: Packets dropped due to STG
    951                                            disabled. */
    952     bcmDbgCntTxEgressPortDrop = 174,    /* Tx: Packets dropped due to
    953                                            EGR_LPORT_PROFILE.DROP. */
    954     bcmDbgCntTxEgressFilterDrop = 175,  /* Tx: Packets dropped by EFP. */
    955     bcmDbgCntTxVisibilityDrop = 176,    /* Tx: Visibility packets dropped. */
    956     bcmDbgCntRxMacControlDrop = 177,    /* Rx: Packets dropped due to MAC
    957                                            control frame. */
    958     bcmDbgCntRxProtocolErrorIP4 = 178,  /* Rx: Packets dropped due to IPv4
    959                                            protocol error. */
    960     bcmDbgCntRxProtocolErrorIP6 = 179,  /* Rx: Packets dropped due to IPv6
    961                                            protocol error. */
    962     bcmDbgCntRxLAGFailLoopback = 180,   /* Rx: LAG fail loopback packets in
    963                                            packet discard stage. */
    964     bcmDbgCntRxEcmpResolutionError = 181, /* Rx: Packets dropped due to ECMP
    965                                            resolution error. */
    966     bcmDbgCntRxPfmDrop = 182,           /* Rx: Packets dropped due to PFM. */
    967     bcmDbgCntRxTunnelError = 183,       /* Rx: Packets dropped due to tunnel
    968                                            errors. */
    969     bcmDbgCntRxBFDUnknownAchError = 184, /* Rx: BFD packets with non-zero version
    970                                            in the ACH header or the ACH channel
    971                                            type is unknown. */
    972     bcmDbgCntRxBFDUnknownControlFrames = 185, /* Rx: Unrecognized BFD control packets
    973                                            received from the PW VCCM type 1/2/3
    974                                            or MPLS-TP control channel. */
    975     bcmDbgCntRxBFDUnknownVersionDiscards = 186, /* Rx: Unknown BFD version or discard
    976                                            dropped. */
    977     bcmDbgCntRxDSL2HE = 187,            /* Rx: Dos Attack L2 Packets. */
    978     bcmDbgCntRxEgressMaskDrop = 188,    /* Rx: Packets dropped due to egress
    979                                            mask. */
    980     bcmDbgCntRxFieldRedirectMaskDrop = 189, /* Rx: Packets dropped due to FP
    981                                            redirection mask. */
    982     bcmDbgCntRxFieldDelayDrop = 190,    /* Rx: Packets dropped due to ingress FP
    983                                            delayed action. */
    984     bcmDbgCntRxEgressMaskSrcPortDrop = 191, /* Rx: Packets dropped due to block
    985                                            traffic from egress based on the
    986                                            ingress port. */
    987     bcmDbgCntRxMacBlockMaskDrop = 192,  /* Rx: Packets dropped due to MAC block
    988                                            mask. */
    989     bcmDbgCntRxMCError = 193,           /* Rx: Packets dropped due to multicast
    990                                            errors. */
    991     bcmDbgCntRxNonUnicastMaskDrop = 194, /* Rx: Packets dropped due to unknown
    992                                            unicast, unknown multicast, known
    993                                            multicast, and broadcast block masks. */
    994     bcmDbgCntRxNonUnicastLAGMaskDrop = 195, /* Rx: Packets dropped due to multicast
    995                                            and broadcast trunk block mask. */
    996     bcmDbgCntRxStgMaskDrop = 196,       /* Rx: Packets dropped due to spanning
    997                                            tree group state. */
    998     bcmDbgCntRxVlanBlockMaskDrop = 197, /* Rx: Packets dropped due to VLAN
    999                                            blocked ports. */
   1000     bcmDbgCntRxEgressVlanMemberMismatch = 198, /* Rx: Packets dropped due to mismatched
   1001                                            egress port for the VLAN. */
   1002     bcmDbgCntTxCellTooSmall = 199,      /* Tx: Multi-cell packets whose SOP cell
   1003                                            size is smaller than 64 bytes after
   1004                                            decap. */
   1005     bcmDbgCntTxLoopbackToLoopbackDrop = 200, /* Tx: Packets dropped due to loopback
   1006                                            packet destination is also loopback
   1007                                            port. */
   1008     bcmDbgCntRxINTDataplaneProbeDrop = 201, /* Rx: INT (Inband Network Telemetry)
   1009                                            dataplane probe packets dropped due
   1010                                            to exception, including turn around
   1011                                            and hop limit exceeded. */
   1012     bcmDbgCntRxINTVectorMismatch = 202, /* Rx: INT (Inband Network Telemetry)
   1013                                            packets dropped due to request vector
   1014                                            match failure. */
   1015     bcmDbgCntRxVfiAdaptLookupMiss = 203, /* Rx: Packets dropped due to the first
   1016                                            lookup miss drop or both the first
   1017                                            and the second lookup miss drop
   1018                                            during ingress VFI adaption. */
   1019     bcmDbgCntRxNextHopOrL3EifRangeError = 204, /* Rx: Packets dropped due to overlay
   1020                                            and underlay next hop or L3 egress
   1021                                            interface ID range error. */
   1022     bcmDbgCntRxVxlanDecapSrcIpLookupMiss = 205, /* Rx: VXLAN packet dropped due to
   1023                                            source IP lookup miss during tunnel
   1024                                            decapsulation. */
   1025     bcmDbgCntNum = 206                  /* Must be last one. */
   1026 } bcm_custom_stat_trigger_t;
   1027 
   1028 /* Custom receive flags. */
   1029 #define BCM_DBG_CNT_RIPD4       0x00000001 /* Rx IPv4 L3 discard packets. */
   1030 #define BCM_DBG_CNT_RIPC4       0x00000002 /* Good rx L3 (V4 packets) includes
   1031                                               tunneled. */
   1032 #define BCM_DBG_CNT_RIPHE4      0x00000004 /* Rx IPv4 header error packets. */
   1033 #define BCM_DBG_CNT_IMRP4       0x00000008 /* Routed IPv4 multicast packets. */
   1034 #define BCM_DBG_CNT_RIPD6       0x00000010 /* Rx IPv6 L3 discard packet. */
   1035 #define BCM_DBG_CNT_RIPC6       0x00000020 /* Good rx L3 (V6 packets) includes
   1036                                               tunneled. */
   1037 #define BCM_DBG_CNT_RIPHE6      0x00000040 /* Rx IPv6 header error packets. */
   1038 #define BCM_DBG_CNT_IMRP6       0x00000080 /* Routed IPv6 multicast packets. */
   1039 #define BCM_DBG_CNT_RDISC       0x00000100 /* IBP discard and CBP full. */
   1040 #define BCM_DBG_CNT_RUC         0x00000200 /* Good rx unicast (L2+L3) packets. */
   1041 #define BCM_DBG_CNT_RPORTD      0x00000400 /* Packets droppped when ingress port
   1042                                               is not in forwarding state. */
   1043 #define BCM_DBG_CNT_PDISC       0x00000800 /* Rx policy discard - DST_DISCARD,
   1044                                               SRC_DISCARD, RATE_CONTROL... */
   1045 #define BCM_DBG_CNT_IMBP        0x00001000 /* Bridged multicast packets. */
   1046 #define BCM_DBG_CNT_RFILDR      0x00002000 /* Packets dropped by FP. */
   1047 #define BCM_DBG_CNT_RIMDR       0x00004000 /* Multicast (L2+L3) packets that are
   1048                                               dropped. */
   1049 #define BCM_DBG_CNT_RDROP       0x00008000 /* Port bitmap zero drop condition. */
   1050 #define BCM_DBG_CNT_IRPSE       0x00010000 /* HiGig IPIC pause rx. */
   1051 #define BCM_DBG_CNT_IRHOL       0x00020000 /* HiGig End-to-End HOL rx packets
   1052                                               (BCM56504/56700/56800/56580). */
   1053 #define BCM_DBG_CNT_IRIBP       0x00040000 /* HiGig End-to-End IBP rx packets
   1054                                               (BCM56504/56700/56800/56580). */
   1055 #define BCM_DBG_CNT_DSL3HE      0x00080000 /* DOS L3 header error packets. */
   1056 #define BCM_DBG_CNT_IUNKHDR     0x00080000 /* Unknown HiGig header type packet
   1057                                               (BCM56700/56800/56580). */
   1058 #define BCM_DBG_CNT_DSL4HE      0x00100000 /* DOS L4 header error packets. */
   1059 #define BCM_DBG_CNT_IMIRROR     0x00100000 /* HiGig mirror packet
   1060                                               (BCM56700/56800/56580). */
   1061 #define BCM_DBG_CNT_DSICMP      0x00200000 /* DOS ICMP error packets. */
   1062 #define BCM_DBG_CNT_DSFRAG      0x00400000 /* DOS fragment error packets. */
   1063 #define BCM_DBG_CNT_MTUERR      0x00800000 /* Packets trapped to CPU due to
   1064                                               egress L3 MTU violation. */
   1065 #define BCM_DBG_CNT_RTUN        0x01000000 /* Number of tunnel packets received. */
   1066 #define BCM_DBG_CNT_RTUNE       0x02000000 /* Rx tunnel error packets. */
   1067 #define BCM_DBG_CNT_VLANDR      0x04000000 /* Rx VLAN drops. */
   1068 #define BCM_DBG_CNT_RHGUC       0x08000000 /* Rx HiGig lookup UC cases (BCM56504
   1069                                               B0 only). */
   1070 #define BCM_DBG_CNT_RHGMC       0x10000000 /* Rx HiGig lookup MC cases (BCM56504
   1071                                               B0 only). */
   1072 #define BCM_DBG_CNT_MPLS        0x20000000 /* Received MPLS Packets (BCM5660x
   1073                                               only). */
   1074 #define BCM_DBG_CNT_MACLMT      0x20000000 /* packets dropped due to MAC Limit
   1075                                               is hit. */
   1076 #define BCM_DBG_CNT_MPLSERR     0x40000000 /* Received MPLS Packets with Error
   1077                                               (BCM5660x only). */
   1078 #define BCM_DBG_CNT_URPFERR     0x80000000 /* L3 src URPF check Fail (BCM5660x
   1079                                               only). */
   1080 #define BCM_DBG_CNT_HGHDRE      0x08000000 /* HiGig Header error packets
   1081                                               (BCM56700/56800/56580). */
   1082 #define BCM_DBG_CNT_MCIDXE      0x10000000 /* Multicast Index error packets
   1083                                               (BCM56700/56800/56580). */
   1084 #define BCM_DBG_CNT_LAGLUP      0x20000000 /* LAG failover loopback packets
   1085                                               (BCM56700/56800/56580). */
   1086 #define BCM_DBG_CNT_LAGLUPD     0x40000000 /* LAG backup port down
   1087                                               (BCM56700/56800/56580). */
   1088 #define BCM_DBG_CNT_PARITYD     0x80000000 /* Parity error packets
   1089                                               (BCM56700/56800/56580). */
   1090 #define BCM_FB_DBG_CNT_RMASK    0x07ffffff /* Internal. */
   1091 #define BCM_RP_DBG_CNT_RMASK    0x27ffffff /* Internal. */
   1092 #define BCM_FB_B0_DBG_CNT_RMASK 0x1fffffff /* Internal. */
   1093 #define BCM_HB_DBG_CNT_RMASK    0xffffffff /* Internal. */
   1094 
   1095 /* Custom transmit flags. */
   1096 #define BCM_DBG_CNT_TGIP4               0x00000001 /* Tx Good IPv4 L3 UC
   1097                                                       packets. */
   1098 #define BCM_DBG_CNT_TIPD4               0x00000002 /* Tx IPv4 L3 UC Aged and
   1099                                                       Drop packets. */
   1100 #define BCM_DBG_CNT_TGIPMC4             0x00000004 /* Tx Good IPv4 IPMC packets. */
   1101 #define BCM_DBG_CNT_TIPMCD4             0x00000008 /* Tx IPv4 IPMC Aged and Drop
   1102                                                       packets. */
   1103 #define BCM_DBG_CNT_TGIP6               0x00000010 /* Tx Good IPv6 L3 UC
   1104                                                       packets. */
   1105 #define BCM_DBG_CNT_TIPD6               0x00000020 /* Tx IPv6 L3 UC Aged and
   1106                                                       Drop Packets. */
   1107 #define BCM_DBG_CNT_TGIPMC6             0x00000040 /* Tx Good IPv6 IPMC packets. */
   1108 #define BCM_DBG_CNT_TIPMCD6             0x00000080 /* Tx IPv6 IPMC Aged and Drop
   1109                                                       packets. */
   1110 #define BCM_DBG_CNT_TTNL                0x00000100 /* Tx Tunnel packets. */
   1111 #define BCM_DBG_CNT_TTNLE               0x00000200 /* Tx Tunnel error packets. */
   1112 #define BCM_DBG_CNT_TTTLD               0x00000400 /* Pkts dropped due to TTL
   1113                                                       threshold counter. */
   1114 #define BCM_DBG_CNT_TCFID               0x00000800 /* Pkts dropped when CFI set
   1115                                                       & pket is untagged or L3
   1116                                                       switched for IPMC. */
   1117 #define BCM_DBG_CNT_TVLAN               0x00001000 /* Tx VLAN tagged packets. */
   1118 #define BCM_DBG_CNT_TVLAND              0x00002000 /* Pkts dropped due to
   1119                                                       invalid VLAN counter. */
   1120 #define BCM_DBG_CNT_TVXLTMD             0x00004000 /* Pkts dropped due to miss
   1121                                                       in VXLT table counter. */
   1122 #define BCM_DBG_CNT_TSTGD               0x00008000 /* Pkts dropped due to
   1123                                                       Spanning Tree State not in
   1124                                                       forwarding state. */
   1125 #define BCM_DBG_CNT_TAGED               0x00010000 /* Pkts dropped due to packet
   1126                                                       aged counter. */
   1127 #define BCM_DBG_CNT_TL2MCD              0x00020000 /* L2 MC packet drop counter. */
   1128 #define BCM_DBG_CNT_TPKTD               0x00040000 /* Pkts dropped due to any
   1129                                                       condition. */
   1130 #define BCM_DBG_CNT_TMIRR               0x00080000 /* mirroring flag. */
   1131 #define BCM_DBG_CNT_TSIPL               0x00100000 /* SIP Link Local Drop flag
   1132                                                       (BCM56504/56700/56800/56580). */
   1133 #define BCM_DBG_CNT_THGUC               0x00200000 /* HiGig Lookedup L3UC Pkts
   1134                                                       (BCM56504_B0/56700/56800/56580). */
   1135 #define BCM_DBG_CNT_THGMC               0x00400000 /* HiGig Lookedup L3MC Pkts
   1136                                                       (BCM56504_B0/56700/56800/56580). */
   1137 #define BCM_DBG_CNT_THIGIG2             0x00800000 /* Unknown HiGig2 Drop
   1138                                                       (BCM56700/56800/56580). */
   1139 #define BCM_DBG_CNT_THGI                0x01000000 /* Unknown HiGig drop
   1140                                                       (BCM56700/56800/56580). */
   1141 #define BCM_DBG_CNT_TL2_MTU             0x02000000 /* L2 MTU fail drop
   1142                                                       (BCM56700/56800/56580). */
   1143 #define BCM_DBG_CNT_TPARITY_ERR         0x04000000 /* Parity Error drop
   1144                                                       (BCM56700/56800/56580). */
   1145 #define BCM_DBG_CNT_TIP_LEN_FAIL        0x08000000 /* IP Length check fail drop
   1146                                                       (BCM56700/56800/56580). */
   1147 #define BCM_DBG_CNT_TMTUD               0x01000000 /* EBAD_MTU_DROP (BCM5660x
   1148                                                       only). */
   1149 #define BCM_DBG_CNT_TSLLD               0x10000000 /* ESIP_LINK_LOCAL (BCM5660x
   1150                                                       only). */
   1151 #define BCM_DBG_CNT_TL2MPLS             0x20000000 /* L2_MPLS_ENCAP_TX (BCM5660x
   1152                                                       only). */
   1153 #define BCM_DBG_CNT_TL3MPLS             0x40000000 /* L3_MPLS_ENCAP_TX (BCM5660x
   1154                                                       only). */
   1155 #define BCM_DBG_CNT_TMPLS               0x80000000 /* MPLS_TX (BCM5660x only). */
   1156 #define BCM_DBG_CNT_MODIDTOOLARGEDROP   0x10000000 /* MODID greater than 31 drop
   1157                                                       counter. */
   1158 #define BCM_DBG_CNT_PKTMODTOOLARGEDROP  0x20000000 /* Byte additions too large
   1159                                                       drop counter. */
   1160 #define BCM_FB_DBG_CNT_TMASK            0x001fffff /* Internal. */
   1161 #define BCM_RP_DBG_CNT_TMASK            0x001fffff /* Internal. */
   1162 #define BCM_FB_B0_DBG_CNT_TMASK         0x007fffff /* Internal. */
   1163 #define BCM_HB_DBG_CNT_TMASK            0x0fffffff /* Internal. */
   1164 #define BCM_TRX_DBG_CNT_TMASK           0x3fffffff /* Internal. */
   1165 
   1166 #ifndef BCM_HIDE_DISPATCHABLE
   1167 
   1168 /* Initialize the BCM statistics module. */
   1169 extern int bcm_stat_init(
   1170     int unit);
   1171 
   1172 #endif /* BCM_HIDE_DISPATCHABLE */
   1173 
   1174 #define bcm_stat_enable_set(unit, port, enable)             /* Gone */
   1175 #define bcm_stat_enable_get(unit, port, enable_ptr)             /* Gone */
   1176 
   1177 #ifndef BCM_HIDE_DISPATCHABLE
   1178 
   1179 /* Clear the port-based statistics for the indicated device port. */
   1180 extern int bcm_stat_clear(
   1181     int unit, 
   1182     bcm_port_t port);
   1183 
   1184 /* Synchronize software counters with hardware. */
   1185 extern int bcm_stat_sync(
   1186     int unit);
   1187 
   1188 /* Get the specified statistics from the device. */
   1189 extern int bcm_stat_get(
   1190     int unit, 
   1191     bcm_port_t port, 
   1192     bcm_stat_val_t type, 
   1193     uint64 *value);
   1194 
   1195 /* Get the specified statistics from the device. */
   1196 extern int bcm_stat_get32(
   1197     int unit, 
   1198     bcm_port_t port, 
   1199     bcm_stat_val_t type, 
   1200     uint32 *value);
   1201 
   1202 /* Get the specified statistics from the device. */
   1203 extern int bcm_stat_multi_get(
   1204     int unit, 
   1205     bcm_port_t port, 
   1206     int nstat, 
   1207     bcm_stat_val_t *stat_arr, 
   1208     uint64 *value_arr);
   1209 
   1210 /* Get the specified statistics from the device. */
   1211 extern int bcm_stat_multi_get32(
   1212     int unit, 
   1213     bcm_port_t port, 
   1214     int nstat, 
   1215     bcm_stat_val_t *stat_arr, 
   1216     uint32 *value_arr);
   1217 
   1218 /* 
   1219  * Force an immediate counter update and get statistics for a specified
   1220  * device.
   1221  *  Note: If bcm_stat_sync_get was continuously called for a counter, the
   1222  * corresponding
   1223  * rate calculated with CLI "show counter" will be incorrect.
   1224  */
   1225 extern int bcm_stat_sync_get(
   1226     int unit, 
   1227     bcm_port_t port, 
   1228     bcm_stat_val_t type, 
   1229     uint64 *value);
   1230 
   1231 /* 
   1232  * Force an immediate counter update and get statistics for a specified
   1233  * device.
   1234  *  Note: If bcm_stat_sync_get was continuously called for a counter, the
   1235  * corresponding
   1236  * rate calculated with CLI "show counter" will be incorrect.
   1237  */
   1238 extern int bcm_stat_sync_get32(
   1239     int unit, 
   1240     bcm_port_t port, 
   1241     bcm_stat_val_t type, 
   1242     uint32 *value);
   1243 
   1244 /* 
   1245  * Force an immediate counter update and get a set of statistics for a
   1246  * specified device.
   1247  */
   1248 extern int bcm_stat_sync_multi_get(
   1249     int unit, 
   1250     bcm_port_t port, 
   1251     int nstat, 
   1252     bcm_stat_val_t *stat_arr, 
   1253     uint64 *value_arr);
   1254 
   1255 /* 
   1256  * Force an immediate counter update and get a set of statistics for a
   1257  * specified device.
   1258  */
   1259 extern int bcm_stat_sync_multi_get32(
   1260     int unit, 
   1261     bcm_port_t port, 
   1262     int nstat, 
   1263     bcm_stat_val_t *stat_arr, 
   1264     uint32 *value_arr);
   1265 
   1266 /* 
   1267  * Get hardware statistics for a specified device without counter update.
   1268  *  Note: Not all statistics types are supported and implemented.
   1269  * Currently types snmpBcmRxPFCFramePriority0-7 and
   1270  * snmpBcmRxPFCFrameXonPriority0-7
   1271  * are implemented.
   1272  */
   1273 extern int bcm_stat_direct_get(
   1274     int unit, 
   1275     bcm_port_t port, 
   1276     bcm_stat_val_t type, 
   1277     uint64 *value);
   1278 
   1279 /* 
   1280  * Get a set of hardware statistics for a specified device without
   1281  * counter update.
   1282  */
   1283 extern int bcm_stat_direct_multi_get(
   1284     int unit, 
   1285     bcm_port_t port, 
   1286     int nstat, 
   1287     bcm_stat_val_t *stat_arr, 
   1288     uint64 *value_arr);
   1289 
   1290 /* Set/get debug counter to count certain packet types. */
   1291 extern int bcm_stat_custom_set(
   1292     int unit, 
   1293     bcm_port_t port, 
   1294     bcm_stat_val_t type, 
   1295     uint32 flags);
   1296 
   1297 /* Set/get debug counter to count certain packet types. */
   1298 extern int bcm_stat_custom_get(
   1299     int unit, 
   1300     bcm_port_t port, 
   1301     bcm_stat_val_t type, 
   1302     uint32 *flags);
   1303 
   1304 /* Add a certain packet type to debug counter to count. */
   1305 extern int bcm_stat_custom_add(
   1306     int unit, 
   1307     bcm_port_t port, 
   1308     bcm_stat_val_t type, 
   1309     bcm_custom_stat_trigger_t trigger);
   1310 
   1311 /* Delete the specified packet type from debug counter. */
   1312 extern int bcm_stat_custom_delete(
   1313     int unit, 
   1314     bcm_port_t port, 
   1315     bcm_stat_val_t type, 
   1316     bcm_custom_stat_trigger_t trigger);
   1317 
   1318 /* Delete all packet types from debug counter. */
   1319 extern int bcm_stat_custom_delete_all(
   1320     int unit, 
   1321     bcm_port_t port, 
   1322     bcm_stat_val_t type);
   1323 
   1324 /* Check if the specified packet type is part of a given debug counter. */
   1325 extern int bcm_stat_custom_check(
   1326     int unit, 
   1327     bcm_port_t port, 
   1328     bcm_stat_val_t type, 
   1329     bcm_custom_stat_trigger_t trigger, 
   1330     int *result);
   1331 
   1332 /* Get the dedicated counter associated with a given drop event. */
   1333 extern int bcm_stat_drop_event_counter_get(
   1334     int unit, 
   1335     bcm_pkt_drop_event_t type, 
   1336     uint64 *value);
   1337 
   1338 /* 
   1339  * Get the dedicated counter associated with a given drop event with sync
   1340  * mode.
   1341  */
   1342 extern int bcm_stat_drop_event_counter_sync_get(
   1343     int unit, 
   1344     bcm_pkt_drop_event_t type, 
   1345     uint64 *value);
   1346 
   1347 /* Clear the dedicated counter associated a the given drop event. */
   1348 extern int bcm_stat_drop_event_counter_set(
   1349     int unit, 
   1350     bcm_pkt_drop_event_t type, 
   1351     uint64 value);
   1352 
   1353 /* Get the dedicated counter associated with a given trace event. */
   1354 extern int bcm_stat_trace_event_counter_get(
   1355     int unit, 
   1356     bcm_pkt_trace_event_t type, 
   1357     uint64 *value);
   1358 
   1359 /* 
   1360  * Get the dedicated counter associated with a given trace event with
   1361  * sync mode.
   1362  */
   1363 extern int bcm_stat_trace_event_counter_sync_get(
   1364     int unit, 
   1365     bcm_pkt_trace_event_t type, 
   1366     uint64 *value);
   1367 
   1368 /* Clear the dedicated counter associated with a given trace event. */
   1369 extern int bcm_stat_trace_event_counter_set(
   1370     int unit, 
   1371     bcm_pkt_trace_event_t type, 
   1372     uint64 value);
   1373 
   1374 #endif /* BCM_HIDE_DISPATCHABLE */
   1375 
   1376 /* TCP flags related flex attributes values */
   1377 typedef enum bcm_stat_group_mode_attr_tcp_flags_e {
   1378     bcmStatGroupModeAttrTcpFlagsTypeSyn = 0, /* Synchronisation flag */
   1379     bcmStatGroupModeAttrTcpFlagsTypeFin = 1, /* Finish flag */
   1380     bcmStatGroupModeAttrTcpFlagsTypeRst = 2, /* Reset flag */
   1381     bcmStatGroupModeAttrTcpFlagsTypePsh = 3, /* Push flag */
   1382     bcmStatGroupModeAttrTcpFlagsTypeAck = 4, /* Acknowledgement flag */
   1383     bcmStatGroupModeAttrTcpFlagsTypeUrg = 5, /* Urgent flag */
   1384     bcmStatGroupModeAttrTcpFlagsTypeEce = 6, /* ECN capable flag */
   1385     bcmStatGroupModeAttrTcpFlagsTypeCwr = 7 /* Congestion Window Reduced flag */
   1386 } bcm_stat_group_mode_attr_tcp_flags_t;
   1387 
   1388 /* FC Type related flex attribute values. */
   1389 typedef enum bcm_stat_group_mode_attr_flowcontrolpkt_type_e {
   1390     bcmStatGroupModeAttrFlowControlPktTypeData = 0, /* Data */
   1391     bcmStatGroupModeAttrFlowControlPktTypePause = 1, /* Pause */
   1392     bcmStatGroupModeAttrFlowControlPktTypePfc = 2, /* PFC */
   1393     bcmStatGroupModeAttrFlowControlPktTypeE2ecc = 3 /* E2ECC */
   1394 } bcm_stat_group_mode_attr_flowcontrolpkt_type_t;
   1395 
   1396 /* Vlan related flex attributes values */
   1397 typedef enum bcm_stat_group_mode_attr_vlan_e {
   1398     bcmStatGroupModeAttrVlanUnTagged = 1, /* UnTagged Vlan */
   1399     bcmStatGroupModeAttrVlanInnerTag = 2, /* Inner Tagged Vlan */
   1400     bcmStatGroupModeAttrVlanOuterTag = 3, /* Outer Tagged Vlan */
   1401     bcmStatGroupModeAttrVlanStackedTag = 4, /* Both Inner and Outer Tagged Vlan */
   1402     bcmStatGroupModeAttrVlanAll = 5     /* UnTagged,Inner and Outer Tagged Vlan */
   1403 } bcm_stat_group_mode_attr_vlan_t;
   1404 
   1405 #ifndef BCM_HIDE_DISPATCHABLE
   1406 
   1407 /* Clear specific statistics for a port from the device */
   1408 extern int bcm_stat_clear_single(
   1409     int unit, 
   1410     bcm_port_t port, 
   1411     bcm_stat_val_t type);
   1412 
   1413 #endif /* BCM_HIDE_DISPATCHABLE */
   1414 
   1415 /* Packet type related flex attributes values */
   1416 typedef enum bcm_stat_group_mode_attr_pkt_type_e {
   1417     bcmStatGroupModeAttrPktTypeAll = 1, /* All Packet Types */
   1418     bcmStatGroupModeAttrPktTypeUnknown = 2, /* Unknown Packet */
   1419     bcmStatGroupModeAttrPktTypeControl = 3, /* Control Packet */
   1420     bcmStatGroupModeAttrPktTypeOAM = 4, /* OAM Packet */
   1421     bcmStatGroupModeAttrPktTypeBFD = 5, /* BFD Packet */
   1422     bcmStatGroupModeAttrPktTypeBPDU = 6, /* BPDU Packet */
   1423     bcmStatGroupModeAttrPktTypeICNM = 7, /* ICNM Packet */
   1424     bcmStatGroupModeAttrPktType1588 = 8, /* 1588 Packet */
   1425     bcmStatGroupModeAttrPktTypeKnownL2UC = 9, /* Known L2 Unicast Packet */
   1426     bcmStatGroupModeAttrPktTypeUnknownL2UC = 10, /* Unknown L2 Unicast Packet */
   1427     bcmStatGroupModeAttrPktTypeL2BC = 11, /* L2 Broadcast Packet */
   1428     bcmStatGroupModeAttrPktTypeKnownL2MC = 12, /* Known L2 Multicast Packet */
   1429     bcmStatGroupModeAttrPktTypeUnknownL2MC = 13, /* Unknown L2 Multicast Packet */
   1430     bcmStatGroupModeAttrPktTypeKnownL3UC = 14, /* Known L3 Unicast Packet */
   1431     bcmStatGroupModeAttrPktTypeUnknownL3UC = 15, /* Unknown L3 Unicast Packet */
   1432     bcmStatGroupModeAttrPktTypeKnownIPMC = 16, /* Known IPMC Packet */
   1433     bcmStatGroupModeAttrPktTypeUnknownIPMC = 17, /* Unknown IPMC Packet */
   1434     bcmStatGroupModeAttrPktTypeKnownMplsL2 = 18, /* Known MPLS L2 Packet */
   1435     bcmStatGroupModeAttrPktTypeKnownMplsL3 = 19, /* Known MPLS L3 Packet */
   1436     bcmStatGroupModeAttrPktTypeKnownMpls = 20, /* Known MPLS Packet */
   1437     bcmStatGroupModeAttrPktTypeUnknownMpls = 21, /* Unknown MPLS Packet */
   1438     bcmStatGroupModeAttrPktTypeKnownMplsMulticast = 22, /* Known MPLS Multicast Packet */
   1439     bcmStatGroupModeAttrPktTypeKnownMim = 23, /* Known MiM Packet */
   1440     bcmStatGroupModeAttrPktTypeUnknownMim = 24, /* Unknown MiM Packet */
   1441     bcmStatGroupModeAttrPktTypeKnownTrill = 25, /* Known TRILL Packet */
   1442     bcmStatGroupModeAttrPktTypeUnknownTrill = 26, /* Unknown TRILL Packet */
   1443     bcmStatGroupModeAttrPktTypeKnownNiv = 27, /* Known  NIV Packet */
   1444     bcmStatGroupModeAttrPktTypeUnknownNiv = 28, /* Unknown  NIV Packet */
   1445     bcmStatGroupModeAttrPktTypeL2UC = 29, /* Unicast L2 Packet */
   1446     bcmStatGroupModeAttrPktTypeL2NonUC = 30 /* Non Unicast L2 Packet */
   1447 } bcm_stat_group_mode_attr_pkt_type_t;
   1448 
   1449 /* Stat Group Mode Attribute Selectors */
   1450 typedef enum bcm_stat_group_mode_attr_e {
   1451     bcmStatGroupModeAttrColor = 1,      /* Color Selector: Possible
   1452                                            Value:bcmColorGreen|Yellow|REd or
   1453                                            oxFFFFFFFF */
   1454     bcmStatGroupModeAttrFieldIngressColor = 2, /* Field Ingress Color Selector:
   1455                                            Possible
   1456                                            Values:bcmColorGreen|Yellow|REd or
   1457                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1458                                            all */
   1459     bcmStatGroupModeAttrIntPri = 3,     /* Internal Priority Selector: Possible
   1460                                            Values: 0 to 15 or
   1461                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1462                                            all */
   1463     bcmStatGroupModeAttrVlan = 4,       /* Vlan Type Selector: Possible Values:
   1464                                            bcmStatGroupModeVlanAttr */
   1465     bcmStatGroupModeAttrOuterPri = 5,   /* Outer Vlan Priority Selector:
   1466                                            Possible Values: 0 to 7 or
   1467                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1468                                            all */
   1469     bcmStatGroupModeAttrInnerPri = 6,   /* Inner Vlan Priority Selector:
   1470                                            Possible Values: 0 to 7 or
   1471                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1472                                            all */
   1473     bcmStatGroupModeAttrPort = 7,       /* Logical Port Selector: Possible
   1474                                            Values:<MaxLogicalPort> or
   1475                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1476                                            all */
   1477     bcmStatGroupModeAttrTosDscp = 8,    /* Type Of Service Selector(DSCP :
   1478                                            Differentiated services Code Point):
   1479                                            Possible Values:<6b:TOS Val> or
   1480                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1481                                            all */
   1482     bcmStatGroupModeAttrTosEcn = 9,     /* Type Of Service Selector(ECN:
   1483                                            Explicit Congestion Notification):
   1484                                            Possible Values:<2b:TOS Val> or
   1485                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1486                                            all */
   1487     bcmStatGroupModeAttrPktType = 10,   /* Packet Type Selector: Possible
   1488                                            Values:<bcmStatGroupModeAttrPktType*> */
   1489     bcmStatGroupModeAttrIngNetworkGroup = 11, /* Ingress Network Group Selector:
   1490                                            Possible Values:<Value> or
   1491                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1492                                            all */
   1493     bcmStatGroupModeAttrEgrNetworkGroup = 12, /* Egress Network Group Selector:
   1494                                            Possible Values:<Value> or
   1495                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1496                                            all */
   1497     bcmStatGroupModeAttrDrop = 13,      /* Drop Selector: Possible Values:<0 or
   1498                                            1> */
   1499     bcmStatGroupModeAttrPacketTypeIp = 14, /* Ip Packet Selector: Possible
   1500                                            Values:<0 or 1> */
   1501     bcmStatGroupModeAttrColorMplsLabelFirst = 15, /* Color Selector derived from first
   1502                                            Mpls label: Possible
   1503                                            Value:bcmColorGreen|Yellow|REd or
   1504                                            oxFFFFFFFF */
   1505     bcmStatGroupModeAttrIntPriMplsLabelFirst = 16, /* Internal Priority Selector derived
   1506                                            from first Mpls label: Possible
   1507                                            Values: 0 to 15 or
   1508                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1509                                            all */
   1510     bcmStatGroupModeAttrColorMplsLabelSecond = 17, /* Color Selector derived from second
   1511                                            Mpls label: Possible
   1512                                            Value:bcmColorGreen|Yellow|REd or
   1513                                            oxFFFFFFFF */
   1514     bcmStatGroupModeAttrIntPriMplsLabelSecond = 18, /* Internal Priority Selector derived
   1515                                            from second Mpls label: Possible
   1516                                            Values: 0 to 15 or
   1517                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1518                                            all */
   1519     bcmStatGroupModeAttrColorMplsLabelThird = 19, /* Color Selector derived from third
   1520                                            Mpls label: Possible
   1521                                            Value:bcmColorGreen|Yellow|REd or
   1522                                            oxFFFFFFFF */
   1523     bcmStatGroupModeAttrIntPriMplsLabelThird = 20, /* Internal Priority Selector derived
   1524                                            from third Mpls label: Possible
   1525                                            Values: 0 to 15 or
   1526                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1527                                            all */
   1528     bcmStatGroupModeAttrPktCfiPri = 21, /* Vlan tag CFI, PRI Selector: Possible
   1529                                            Values: 0 to 15 or
   1530                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1531                                            all */
   1532     bcmStatGroupModeAttrUdf = 22,       /* UDF. Possible Values:< max 8b valid
   1533                                            bit in UDF Val> or <max 7b valid bit
   1534                                            in UDF Val> when AttrDrop is enabled */
   1535     bcmStatGroupModeAttrCos = 23,       /* MMU cos Selector: Possible Values: 0
   1536                                            to 15 or
   1537                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1538                                            all */
   1539     bcmStatGroupModeAttrQueueType = 24, /* Queue Type Selector: Possible Values:
   1540                                            0 for MC queue, or 1 for UC queue or
   1541                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1542                                            all */
   1543     bcmStatGroupModeAttrCongestionMarked = 25, /* Congestion marked status Selector:
   1544                                            Possible Values: 0 to 1 or
   1545                                            STAT_GROUP_MODE_ATTR_ALL_VALUES for
   1546                                            all */
   1547     bcmStatGroupModeAttrClassType = 26, /* User defined class to identify a set
   1548                                            of attributes combined together */
   1549     bcmStatGroupModeAttrTcpFlagsType = 27, /* TCP flags selector derived from TCP
   1550                                            flags field in the packet */
   1551     bcmStatGroupModeAttrIntCongestion = 28, /* Internal Congestion selector derived
   1552                                            form ECN to internal congestion
   1553                                            mapped value */
   1554     bcmStatGroupModeAttrFlowControlPktType = 29, /* Indicates type of Flow Control Packet */
   1555     bcmStatGroupModePortGroup = 30,     /* User defined group to identify a set
   1556                                            of ports */
   1557     bcmStatGroupModeAttrMaxValue = 31   /* This should be the maximum value
   1558                                            defined in this enum */
   1559 } bcm_stat_group_mode_attr_t;
   1560 
   1561 /* Unique constants */
   1562 #define BCM_STAT_GROUP_MODE_ATTR_ALL_VALUES 0xFFFFFFFF /* A unique constant for
   1563                                                           using all attr values */
   1564 
   1565 /* Stat Group Mode Flags */
   1566 #define BCM_STAT_GROUP_MODE_INGRESS         0x00000001 /* Stat Group Mode
   1567                                                           Ingress */
   1568 #define BCM_STAT_GROUP_MODE_EGRESS          0x00000002 /* Stat Group Mode Egress */
   1569 #define BCM_STAT_GROUP_MODE_CAPABILITY_OAM  0x00000004 /* Stat Group Mode With
   1570                                                           OAM Capability */
   1571 #define BCM_STAT_GROUP_MODE_UDF             0x00000008 /* Stat Group Mode UDF */
   1572 
   1573 /* Ingress and Egress Statistics Accounting Objects */
   1574 typedef enum bcm_stat_object_e {
   1575     bcmStatObjectIngPort = 0,           /* Ingress Port Object */
   1576     bcmStatObjectIngVlan = 1,           /* Ingress Vlan Object */
   1577     bcmStatObjectIngVlanXlate = 2,      /* Ingress Vlan Translate Object */
   1578     bcmStatObjectIngVfi = 3,            /* Ingress VFI Object */
   1579     bcmStatObjectIngL3Intf = 4,         /* Ingress L3 Interface Object */
   1580     bcmStatObjectIngVrf = 5,            /* Ingress VRF Object */
   1581     bcmStatObjectIngPolicy = 6,         /* Ingress Policy Object */
   1582     bcmStatObjectIngFieldStageLookup = 6, /* Ingress VFP Object */
   1583     bcmStatObjectIngMplsVcLabel = 7,    /* Ingress MPLS VC Label Object */
   1584     bcmStatObjectIngMplsSwitchLabel = 8, /* Ingress MPLS Switch Label Object */
   1585     bcmStatObjectEgrPort = 9,           /* Egress Port Object */
   1586     bcmStatObjectEgrVlan = 10,          /* Egress Vlan Object */
   1587     bcmStatObjectEgrVlanXlate = 11,     /* Egress Vlan Translate Object */
   1588     bcmStatObjectEgrVfi = 12,           /* Egress VFI Object */
   1589     bcmStatObjectEgrL3Intf = 13,        /* Egress L3 Interface Object */
   1590     bcmStatObjectIngMplsFrrLabel = 14,  /* Ingress MPLS Fast Reroute Label
   1591                                            Object */
   1592     bcmStatObjectIngL3Host = 15,        /* L3 Host without L3 Egress Object */
   1593     bcmStatObjectIngTrill = 16,         /* Ingress Trill Object */
   1594     bcmStatObjectIngMimLookupId = 17,   /* Ingress MiM I-SID Object */
   1595     bcmStatObjectIngL2Gre = 18,         /* Ingress L2 GRE Object */
   1596     bcmStatObjectIngEXTPolicy = 19,     /* Ingress external FP Object */
   1597     bcmStatObjectIngFieldStageExternal = 19, /* Ingress external FP Object */
   1598     bcmStatObjectEgrWlan = 20,          /* Egress WLAN Object */
   1599     bcmStatObjectEgrMim = 21,           /* Egress MiM Object */
   1600     bcmStatObjectEgrMimLookupId = 22,   /* Egress MiM I-SID Object */
   1601     bcmStatObjectEgrL2Gre = 23,         /* Egress L2 GRE Object */
   1602     bcmStatObjectIngVxlan = 24,         /* Ingress Vxlan Object */
   1603     bcmStatObjectIngVsan = 25,          /* Ingress FCOE VSAN Object */
   1604     bcmStatObjectIngFcoe = 26,          /* Ingress FCOE Object */
   1605     bcmStatObjectIngL3Route = 27,       /* Ingress L2 Route Defip Object */
   1606     bcmStatObjectEgrVxlan = 28,         /* Egress Vxlan Object */
   1607     bcmStatObjectEgrL3Nat = 29,         /* Egress L3 NAT Object */
   1608     bcmStatObjectIngNiv = 30,           /* Ingress Niv Object */
   1609     bcmStatObjectIngIpmc = 32,          /* Ingress IPMC Object */
   1610     bcmStatObjectEgrNiv = 31,           /* Egress Niv Object */
   1611     bcmStatObjectIngVxlanDip = 33,      /* Ingress Vxlan Dip Object */
   1612     bcmStatObjectIngFieldStageIngress = 34, /* Ingress FP Object */
   1613     bcmStatObjectEgrFieldStageEgress = 35, /* Egress FP Object */
   1614     bcmStatObjectEgrMplsTunnelLabel = 36, /* Egress MPLS Tunnel Label */
   1615     bcmStatObjectIngExactMatch = 37,    /* Exact Match FP Object */
   1616     bcmStatObjectIngGport = 38,         /* Ingress GPort Object */
   1617     bcmStatObjectIngVlanXlateSecondLookup = 39, /* Ingress Vlan Translate Second Lookup
   1618                                            Object */
   1619     bcmStatObjectEgrVlanXlateSecondLookup = 40, /* Egress Vlan Translate Second Lookup
   1620                                            Object */
   1621     bcmStatObjectIngMplsSwitchSecondLabel = 41, /* Mpls Entry Lookup object for the
   1622                                            Second Label */
   1623     bcmStatObjectEgrMplsTunnelSecondLabel = 42, /* Egress Mpls Tunnel Second Label
   1624                                            Object */
   1625     bcmStatObjectEgrDvpAttr = 43,       /* Egress DVP Attribute table object */
   1626     bcmStatObjectMaxValue = 44          /* This should be the maximum value
   1627                                            defined in this enum */
   1628 } bcm_stat_object_t;
   1629 
   1630 #define BCM_STAT_OBJECT \
   1631 { \
   1632     "IngPort", \
   1633     "IngVlan", \
   1634     "IngVlanXlate", \
   1635     "IngVfi", \
   1636     "IngL3Intf", \
   1637     "IngVrf", \
   1638     "IngPolicy", \
   1639     "IngMplsVcLabel", \
   1640     "IngMplsSwitchLabel", \
   1641     "EgrPort", \
   1642     "EgrVlan", \
   1643     "EgrVlanXlate", \
   1644     "EgrVfi", \
   1645     "EgrL3Intf", \
   1646     "IngMplsFrrLabel", \
   1647     "IngL3Host", \
   1648     "IngTrill", \
   1649     "IngMimLookupId", \
   1650     "IngL2Gre", \
   1651     "IngEXTPolicy", \
   1652     "EgrWlan", \
   1653     "EgrMim", \
   1654     "EgrMimLookupId", \
   1655     "EgrL2Gre", \
   1656     "IngVxlan", \
   1657     "IngVsan", \
   1658     "IngFcoe", \
   1659     "IngL3Route", \
   1660     "EgrVxlan", \
   1661     "EgrL3Nat", \
   1662     "IngNiv", \
   1663     "IngIpmc", \
   1664     "EgrNiv", \
   1665     "IngVxlanDip", \
   1666     "IngFieldStageIngress", \
   1667     "EgrFieldStageEgress", \
   1668     "EgrMplsTunnelLabel", \
   1669     "IngExactMatch", \
   1670     "IngGport", \
   1671     "IngVlanXlateSecondLookup", \
   1672     "EgrVlanXlateSecondLookup", \
   1673     "IngMplsSwitchSecondLabel", \
   1674     "EgrMplsTunnelSecondLabel", \
   1675     "EgrDvpAttr", \
   1676     "MaxValue"  \
   1677 }
   1678 
   1679 /* Flex stat pool direction */
   1680 typedef enum bcm_stat_flex_direction_e {
   1681     bcmStatFlexDirectionIngress = 0,    /* Ingress direction */
   1682     bcmStatFlexDirectionEgress = 1,     /* Egress direction */
   1683     bcmStatFlexDirectionCount = 2       /* Max value defined for this enum */
   1684 } bcm_stat_flex_direction_t;
   1685 
   1686 /* BCM Header types */
   1687 typedef enum bcm_stat_pp_metadata_header_type_e {
   1688     bcmStatPpMetadataHeaderTypeEth = 0, 
   1689     bcmStatPpMetadataHeaderTypeIpv4 = 1, 
   1690     bcmStatPpMetadataHeaderTypeIpv6 = 2, 
   1691     bcmStatPpMetadataHeaderTypeMpls = 3, 
   1692     bcmStatPpMetadataHeaderTypeArp = 4, 
   1693     bcmStatPpMetadataHeaderTypeFcoe = 5, 
   1694     bcmStatPpMetadataHeaderTypeSrv6 = 6, 
   1695     bcmStatPpMetadataHeaderTypeTcp = 7, 
   1696     bcmStatPpMetadataHeaderTypeUdp = 8, 
   1697     bcmStatPpMetadataHeaderTypeBfd = 9, 
   1698     bcmStatPpMetadataHeaderTypeIcmp = 10, 
   1699     bcmStatPpMetadataHeaderTypeOthers = 11, 
   1700     bcmStatPpMetadataHeaderTypeCount = 12 
   1701 } bcm_stat_pp_metadata_header_type_t;
   1702 
   1703 /* Defines the IFP specific parameters. */
   1704 typedef enum bcm_stat_group_mode_hint_type_e {
   1705     bcmStatGroupAllocHintIngressFieldGroup = 1, 
   1706     bcmStatGroupAllocHintVlanFieldGroup = 2, 
   1707     bcmStatGroupAllocHintExactMatchFieldGroup = 3, 
   1708     bcmStatGroupAllocHintEgressFieldGroup = 4, 
   1709     bcmStatGroupAllocHintCount = 5      /* Max value defined for this enum */
   1710 } bcm_stat_group_mode_hint_type_t;
   1711 
   1712 /* Flex pool statistics information */
   1713 typedef struct bcm_stat_flex_pool_stat_info_s {
   1714     uint32 pool_id;                     /* pool ID */
   1715     uint32 total_entries;               /* The size of this pool */
   1716     uint32 used_entries;                /* Entries that are allocated (but not
   1717                                            necessarily assigned) */
   1718     uint32 attached_entries;            /* he number of used_entries that are
   1719                                            actually assigned to an object */
   1720     uint32 free_entries;                /* The result of deducting used_entries
   1721                                            from total_entries */
   1722     SHR_BITDCL used_by_objects[_SHR_BITDCLSIZE(bcmStatObjectMaxValue)]; 
   1723 } bcm_stat_flex_pool_stat_info_t;
   1724 
   1725 /* PP Metadata information */
   1726 typedef struct bcm_stat_pp_metadata_info_s {
   1727     uint32 flags;                       /* See BCM_STAT_PP_METADATA_XXX */
   1728     bcm_stat_pp_metadata_header_type_t header_type; /* Header type of the packet */
   1729     uint32 address_type_flags;          /* See
   1730                                            BCM_STAT_PP_METADATA_ADDRESS_TYPE_XXX */
   1731     uint32 metadata;                    /* The metadata value to use */
   1732 } bcm_stat_pp_metadata_info_t;
   1733 
   1734 /* Stat Flex Group Attribute Selector */
   1735 typedef struct bcm_stat_group_mode_attr_selector_s {
   1736     uint32 counter_offset;              /* Counter Offset */
   1737     bcm_stat_group_mode_attr_t attr;    /* Attribute Selector */
   1738     uint32 attr_value;                  /* Attribute Values */
   1739     uint32 udf_bitmap;                  /* valid UDF bits, should be same in one
   1740                                            mode id */
   1741 } bcm_stat_group_mode_attr_selector_t;
   1742 
   1743 /* Stat Flex Group Hint */
   1744 typedef struct bcm_stat_group_mode_hint_s {
   1745     bcm_stat_group_mode_hint_type_t type; /* Hint type */
   1746     uint32 value;                       /* Hint value */
   1747 } bcm_stat_group_mode_hint_t;
   1748 
   1749 /* Stat Flex Group Attribute Selector */
   1750 typedef struct bcm_stat_group_mode_id_config_s {
   1751     uint32 flags;                       /* Counter Mode Flags */
   1752     uint32 total_counters;              /* Total Number of Counters */
   1753     bcm_stat_group_mode_hint_t hint;    /* Stat Hint */
   1754 } bcm_stat_group_mode_id_config_t;
   1755 
   1756 /* Counter Statistics Values */
   1757 typedef struct bcm_stat_value_s {
   1758     uint32 packets;     /* packets value */
   1759     uint64 bytes;       /* bytes value */
   1760     uint64 packets64;   /* 64-bit accumulated packets value */
   1761 } bcm_stat_value_t;
   1762 
   1763 /* Statistics Group Modes */
   1764 typedef enum bcm_stat_group_mode_e {
   1765     bcmStatGroupModeSingle = 0,         /* A single counter used for all traffic
   1766                                            types */
   1767     bcmStatGroupModeTrafficType = 1,    /* A dedicated counter per traffic type
   1768                                            Unicast, multicast, broadcast */
   1769     bcmStatGroupModeDlfAll = 2,         /* A pair of counters where the base
   1770                                            counter is used for dlf and the other
   1771                                            counter is used for all traffic types */
   1772     bcmStatGroupModeDlfIntPri = 3,      /* N+1 counters where the base counter
   1773                                            is used for dlf and next N are used
   1774                                            per Cos */
   1775     bcmStatGroupModeTyped = 4,          /* A dedicated counter for unknown
   1776                                            unicast, known unicast, multicast,
   1777                                            broadcast */
   1778     bcmStatGroupModeTypedAll = 5,       /* A dedicated counter for unknown
   1779                                            unicast, known unicast, multicast,
   1780                                            broadcast and one for all traffic(not
   1781                                            already counted) */
   1782     bcmStatGroupModeTypedIntPri = 6,    /* A dedicated counter for unknown
   1783                                            unicast, known unicast,
   1784                                            multicast,broadcast and N internal
   1785                                            priority counters for traffic (not
   1786                                            already counted) */
   1787     bcmStatGroupModeSingleWithControl = 7, /* A single counter used for all traffic
   1788                                            types with an additional counter for
   1789                                            control traffic */
   1790     bcmStatGroupModeTrafficTypeWithControl = 8, /* A dedicated counter per traffic type
   1791                                            unicast, multicast, broadcast with an
   1792                                            additional counter for control
   1793                                            traffic */
   1794     bcmStatGroupModeDlfAllWithControl = 9, /* A pair of counters where the base
   1795                                            counter is used for control, the next
   1796                                            one for dlf and the other counter is
   1797                                            used for all traffic types */
   1798     bcmStatGroupModeDlfIntPriWithControl = 10, /* N+2 counters where the base counter
   1799                                            is used for control, the next one for
   1800                                            dlf and next N are used per Cos */
   1801     bcmStatGroupModeTypedWithControl = 11, /* A dedicated counter for control,
   1802                                            unknown unicast, known unicast,
   1803                                            multicast, broadcast */
   1804     bcmStatGroupModeTypedAllWithControl = 12, /* A dedicated counter for control,
   1805                                            unknown unicast, known
   1806                                            unicast,multicast, broadcast and one
   1807                                            for all traffic (not already counted) */
   1808     bcmStatGroupModeTypedIntPriWithControl = 13, /* A dedicated counter for control,
   1809                                            unknown unicast, known unicast,
   1810                                            multicast, broadcast and N internal
   1811                                            priority counters for traffic (not
   1812                                            already counted) */
   1813     bcmStatGroupModeDot1P = 14,         /* A set of 8(2^3) counters selected
   1814                                            based on Vlan priority */
   1815     bcmStatGroupModeIntPri = 15,        /* A set of 16(2^4) counters based on
   1816                                            internal priority */
   1817     bcmStatGroupModeIntPriCng = 16,     /* A set of 64 counters(2^(4+2)) based
   1818                                            on Internal priority+CNG */
   1819     bcmStatGroupModeSvpType = 17,       /* A set of 2 counters(2^1) based on SVP
   1820                                            type */
   1821     bcmStatGroupModeDscp = 18,          /* A set of 64 counters(2^6) based on
   1822                                            DSCP bits */
   1823     bcmStatGroupModeDvpType = 19,       /* A set of 2 counters(2^1) based on DVP
   1824                                            type */
   1825     bcmStatGroupModeCng = 20,           /* A set of 4 counters based on Pre IFP
   1826                                            packet color bits */
   1827     bcmStatGroupModeMplsCngLabelFirst = 21, /* A set of 4 counters based on Pre IFP
   1828                                            packet color bits based on first Mpls
   1829                                            Label */
   1830     bcmStatGroupModeMplsIntPriLabelFirst = 22, /* A set of 16(2^4) counters based on
   1831                                            internal priority based on first Mpls
   1832                                            Label */
   1833     bcmStatGroupModeMplsCngLabelSecond = 23, /* A set of 4 counters based on Pre IFP
   1834                                            packet color bits based on second
   1835                                            Mpls Label */
   1836     bcmStatGroupModeMplsIntPriLabelSecond = 24, /* A set of 16(2^4) counters based on
   1837                                            internal priority based on second
   1838                                            Mpls Label */
   1839     bcmStatGroupModeMplsCngLabelThird = 25, /* A set of 4 counters based on Pre IFP
   1840                                            packet color bits based on third Mpls
   1841                                            Label */
   1842     bcmStatGroupModeMplsIntPriLabelThird = 26, /* A set of 16(2^4) counters based on
   1843                                            internal priority based on third Mpls
   1844                                            Label */
   1845     bcmStatGroupModeCount = 27          /* This should be the maximum value
   1846                                            defined for the enum */
   1847 } bcm_stat_group_mode_t;
   1848 
   1849 /* Flex statistics type */
   1850 typedef enum bcm_stat_flex_stat_e {
   1851     bcmStatFlexStatPackets = 0, /* Packets statistics */
   1852     bcmStatFlexStatBytes = 1,   /* Bytes statistics */
   1853     bcmStatFlexStatCount = 2    /* Max value defined for this enum */
   1854 } bcm_stat_flex_stat_t;
   1855 
   1856 #ifndef BCM_HIDE_DISPATCHABLE
   1857 
   1858 /* Retrieves the flex counter details for a given direction */
   1859 extern int bcm_stat_flex_pool_info_multi_get(
   1860     int unit, 
   1861     bcm_stat_flex_direction_t direction, 
   1862     uint32 num_pools, 
   1863     bcm_stat_flex_pool_stat_info_t *flex_pool_stat, 
   1864     uint32 *actual_num_pools);
   1865 
   1866 #endif /* BCM_HIDE_DISPATCHABLE */
   1867 
   1868 /* Initialize an attribute selector of Stat Flex Group Mode */
   1869 extern void bcm_stat_group_mode_attr_selector_t_init(
   1870     bcm_stat_group_mode_attr_selector_t *attr_selector);
   1871 
   1872 /* Initialize a bcm_stat_value_t data structure */
   1873 extern void bcm_stat_value_t_init(
   1874     bcm_stat_value_t *stat_value);
   1875 
   1876 #ifndef BCM_HIDE_DISPATCHABLE
   1877 
   1878 /* 
   1879  * Create Customized Stat Group mode for given Counter Attributes
   1880  * In BCM56860, OAM LM is supported through Flex Counters, When
   1881  * BCM_STAT_GROUP_MODE_CAPABILITY_OAM flag is passed along with
   1882  * BCM_STAT_GROUP_MODE_INGRESS or BCM_STAT_GROUP_MODE_EGRESS, it
   1883  * instructs the API to create a stat group suitable for OAM.
   1884  * In BCM56160, the packet cfi_pri offset map of Vlan Flow Counters
   1885  * is supported through this function to get the mode_id. And use
   1886  * this mode_id to create the customized group mode by
   1887  * bcm_stat_custom_group_create.
   1888  * Counters with same counter_offset and with same attribute
   1889  * type but different attributes values are counted whenever either
   1890  * of the value(s) are true whereas with different attribute
   1891  * types the counter is incremented only when all of the attributes
   1892  * satisfy
   1893  * with their respective values.
   1894  *  The multiple attributes that are being used in the creation of the
   1895  * mode_id
   1896  * should be added for all the counter offsets to ensure proper
   1897  * configuration.
   1898  *  This API will be deprecated in the second half of 2016.
   1899  *  stats mode id should be created using
   1900  * bcm_stat_group_mode_id_config_create API
   1901  */
   1902 extern int bcm_stat_group_mode_id_create(
   1903     int unit, 
   1904     uint32 flags, 
   1905     uint32 total_counters, 
   1906     uint32 num_selectors, 
   1907     bcm_stat_group_mode_attr_selector_t *attr_selectors, 
   1908     uint32 *mode_id);
   1909 
   1910 /* 
   1911  * Create Customized Stat class identifiers for combining Counter
   1912  * Attributes.
   1913  * This API is supported on enabling the config property named
   1914  * flex_stat_attributes_class.
   1915  */
   1916 extern int bcm_stat_group_mode_attr_class_id_create(
   1917     int unit, 
   1918     bcm_stat_group_mode_attr_t attr, 
   1919     uint32 num_of_attr_values, 
   1920     uint32 *attr_values, 
   1921     bcm_stat_group_mode_attr_class_id_t *attr_class_id);
   1922 
   1923 /* Create group identifiers for combining ports. */
   1924 extern int bcm_stat_port_group_create(
   1925     int unit, 
   1926     uint32 num_gports, 
   1927     bcm_gport_t *gport, 
   1928     uint32 *group_id);
   1929 
   1930 /* Retrieves Customized Stat Group mode Attributes for given mode_id */
   1931 extern int bcm_stat_group_mode_id_get(
   1932     int unit, 
   1933     uint32 mode_id, 
   1934     uint32 *flags, 
   1935     uint32 *total_counters, 
   1936     uint32 num_selectors, 
   1937     bcm_stat_group_mode_attr_selector_t *attr_selectors, 
   1938     uint32 *actual_num_selectors);
   1939 
   1940 /* Destroys Customized Group mode */
   1941 extern int bcm_stat_group_mode_id_destroy(
   1942     int unit, 
   1943     uint32 mode_id);
   1944 
   1945 /* 
   1946  * Destroy Customized Stat class identifiers for combining Counter
   1947  * Attributes.
   1948  * This API is supported on enabling the config property named
   1949  * flex_stat_attributes_class.
   1950  */
   1951 extern int bcm_stat_group_mode_attr_class_id_destroy(
   1952     int unit, 
   1953     bcm_stat_group_mode_attr_class_id_t attr_class_id);
   1954 
   1955 /* Destroy group identifiers for combined ports. */
   1956 extern int bcm_stat_port_group_destroy(
   1957     int unit, 
   1958     uint32 group_id);
   1959 
   1960 /* Associate an accounting object to customized group mode */
   1961 extern int bcm_stat_custom_group_create(
   1962     int unit, 
   1963     uint32 mode_id, 
   1964     bcm_stat_object_t object, 
   1965     uint32 *stat_counter_id, 
   1966     uint32 *num_entries);
   1967 
   1968 #endif /* BCM_HIDE_DISPATCHABLE */
   1969 
   1970 /* Initialize the structure for Stat Flex config */
   1971 extern void bcm_stat_group_mode_id_config_t_init(
   1972     bcm_stat_group_mode_id_config_t *stat_config);
   1973 
   1974 #ifndef BCM_HIDE_DISPATCHABLE
   1975 
   1976 /* 
   1977  * Create Customized Stat Group mode for given Counter Attributes
   1978  * In BCM56960, a custom stat group for Ingress Field groups can be
   1979  * created by
   1980  * specifying stat_config->hint.type as
   1981  * bcmStatGroupAllocHintIngressFieldGroup
   1982  * and setting the actual field group id in stat_config->hint.value.
   1983  */
   1984 extern int bcm_stat_group_mode_id_config_create(
   1985     int unit, 
   1986     uint32 options, 
   1987     bcm_stat_group_mode_id_config_t *stat_config, 
   1988     uint32 num_selectors, 
   1989     bcm_stat_group_mode_attr_selector_t *attr_sel, 
   1990     uint32 *mode_id);
   1991 
   1992 /* 
   1993  * Retrieves Customized Stat Group mode Attributes for given custom
   1994  * mode_id
   1995  */
   1996 extern int bcm_stat_group_mode_id_config_get(
   1997     int unit, 
   1998     uint32 mode_id, 
   1999     bcm_stat_group_mode_id_config_t *config, 
   2000     uint32 num_selectors, 
   2001     bcm_stat_group_mode_attr_selector_t *attr_sel, 
   2002     uint32 *actual_num_selectors);
   2003 
   2004 #endif /* BCM_HIDE_DISPATCHABLE */
   2005 
   2006 /* Initialize the hint structure */
   2007 extern void bcm_stat_group_mode_hint_t_init(
   2008     bcm_stat_group_mode_hint_t *stat_hint);
   2009 
   2010 #ifndef BCM_HIDE_DISPATCHABLE
   2011 
   2012 /* Create Counter Entries group for given accounting object */
   2013 extern int bcm_stat_group_create(
   2014     int unit, 
   2015     bcm_stat_object_t object, 
   2016     bcm_stat_group_mode_t group_mode, 
   2017     uint32 *stat_counter_id, 
   2018     uint32 *num_entries);
   2019 
   2020 /* Destroy counter Entries group */
   2021 extern int bcm_stat_group_destroy(
   2022     int unit, 
   2023     uint32 stat_counter_id);
   2024 
   2025 /* Dump contents of specified group */
   2026 extern int bcm_stat_group_dump(
   2027     int unit, 
   2028     bcm_stat_object_t object, 
   2029     bcm_stat_group_mode_t group_mode);
   2030 
   2031 /* Dump contents of all configured groups */
   2032 extern int bcm_stat_group_dump_all(
   2033     int unit);
   2034 
   2035 /* Get all Stat Ids attached to flex object. */
   2036 extern int bcm_stat_id_get_all(
   2037     int unit, 
   2038     bcm_stat_object_t object, 
   2039     int stat_max, 
   2040     uint32 *stat_array, 
   2041     int *stat_count);
   2042 
   2043 #endif /* BCM_HIDE_DISPATCHABLE */
   2044 
   2045 /* A range of counter pointers. */
   2046 typedef struct bcm_stat_counter_pointer_range_s {
   2047     int start; 
   2048     int end; 
   2049 } bcm_stat_counter_pointer_range_t;
   2050 
   2051 /* 
   2052  * Define the counting source of a counter engine. That is, what block to
   2053  * count, and what to count in a block
   2054  */
   2055 typedef enum bcm_stat_counter_source_type_e {
   2056     bcmStatCounterSourceIngressOam = 0, 
   2057     bcmStatCounterSourceEgressOam = 1, 
   2058     bcmStatCounterSourceIngressVsi = 2, 
   2059     bcmStatCounterSourceIngressInlif = 3, 
   2060     bcmStatCounterSourceIngressCnm = 4, 
   2061     bcmStatCounterSourceIngressField = 5, 
   2062     bcmStatCounterSourceEgressField = 6, 
   2063     bcmStatCounterSourceIngressLatency = 7, 
   2064     bcmStatCounterSourceIngressVoq = 8, 
   2065     bcmStatCounterSourceIngressVsq = 9, 
   2066     bcmStatCounterSourceEgressTransmitVsi = 10, 
   2067     bcmStatCounterSourceEgressReceiveVsi = 11, 
   2068     bcmStatCounterSourceEgressTransmitOutlif = 12, 
   2069     bcmStatCounterSourceEgressReceiveOutlif = 13, 
   2070     bcmStatCounterSourceEgressTransmitQueue = 14, 
   2071     bcmStatCounterSourceEgressTransmitTmPort = 15, 
   2072     bcmStatCounterSourceEgressReceiveQueue = 16, 
   2073     bcmStatCounterSourceEgressReceiveTmPort = 17, 
   2074     bcmStatCounterSourceEgressReceiveTm = 18, 
   2075     bcmStatCounterSourceIngressExtStat = 19, 
   2076     bcmStatCounterSourceCount = 20      /* Must be last one. */
   2077 } bcm_stat_counter_source_type_t;
   2078 
   2079 /* Counter Engine Source Configuration */
   2080 typedef struct bcm_stat_counter_source_s {
   2081     bcm_core_t core_id;                 /* The counting source core */
   2082     bcm_stat_counter_source_type_t engine_source; /* Counting source */
   2083     bcm_stat_counter_pointer_range_t pointer_range; /* The range of counter  pointers. */
   2084     int command_id;                     /* Defines what counting command to
   2085                                            read. */
   2086     int num_voqs_per_entry;             /* Defines how many consecutive VOQs are
   2087                                            counted in one counter set. Only
   2088                                            relevant for
   2089                                            bcm_stat_counter_engine_source_ingress_voq. */
   2090     int offset;                         /* Constant offset added on top of the
   2091                                            counter pointer value, applicable for
   2092                                            ERPP sources only. */
   2093 } bcm_stat_counter_source_t;
   2094 
   2095 /* 
   2096  * An entry counter set offset mapping, consists of color X {forward,
   2097  * drop}
   2098  */
   2099 typedef struct bcm_stat_counter_set_entry_s {
   2100     bcm_color_t color;          /* Counter color (Drop Precedence) */
   2101     uint8 is_forward_not_drop;  /* If set, the counter refers to Forward packet
   2102                                    counters. Otherwise, to dropped packet
   2103                                    counters. */
   2104 } bcm_stat_counter_set_entry_t;
   2105 
   2106 /* Mapping of an entry to a counter set offset */
   2107 typedef struct bcm_stat_counter_set_entry_mapping_s {
   2108     bcm_stat_counter_set_entry_t entry; /* The entrys value, consists of color X
   2109                                            {forward, drop} */
   2110     int offset; 
   2111 } bcm_stat_counter_set_entry_mapping_t;
   2112 
   2113 #define BCM_STAT_COUNTER_MAPPING_MAX_SIZE   8          /* The maximum legal size
   2114                                                           of a counter set */
   2115 
   2116 /* Flags for Stat PP metadata */
   2117 #define BCM_STAT_PP_METADATA_INGRESS        0x1        /* Configure Ingress side */
   2118 #define BCM_STAT_PP_METADATA_EGRESS         0x2        /* Configure Egress side */
   2119 #define BCM_STAT_PP_METADATA_TUNNEL         0x4        /* Tunnel termination for
   2120                                                           ingress side, Tunnel
   2121                                                           encapsulation for
   2122                                                           egress side */
   2123 #define BCM_STAT_PP_METADATA_FORWARD        0x8        /* Forwarding */
   2124 #define BCM_STAT_PP_METADATA_FORWARD_PLUS_ONE 0x10       /* Next layer after
   2125                                                           forwarding */
   2126 
   2127 /* Address type flags */
   2128 #define BCM_STAT_PP_METADATA_ADDRESS_TYPE_UCAST 0x1        /* Unicast address flow */
   2129 #define BCM_STAT_PP_METADATA_ADDRESS_TYPE_MCAST 0x2        /* Multicast address flow */
   2130 #define BCM_STAT_PP_METADATA_ADDRESS_TYPE_BCAST 0x4        /* Broadcast address flow */
   2131 #define BCM_STAT_PP_METADATA_ADDRESS_TYPE_UNKNOWN 0x8        /* Unknown address flow */
   2132 
   2133 /* Counter configuration struct */
   2134 typedef struct bcm_stat_counter_set_mapping_s {
   2135     int counter_set_size;               /* The size of the counter set, cannot
   2136                                            an entry mapped to a value above it,
   2137                                            will not be counted */
   2138     int num_of_mapping_entries;         /* The number of valid entries in
   2139                                            entry_mapping array */
   2140     bcm_stat_counter_set_entry_mapping_t entry_mapping[BCM_STAT_COUNTER_MAPPING_MAX_SIZE]; /* An array of color X {forward, drop}
   2141                                            mapped to count an offset in the
   2142                                            counter set */
   2143 } bcm_stat_counter_set_mapping_t;
   2144 
   2145 /* Defines the width of an entry, and what statistics to gather. */
   2146 typedef enum bcm_stat_counter_format_type_e {
   2147     bcmStatCounterFormatPacketsAndBytes = 0, 
   2148     bcmStatCounterFormatPackets = 1, 
   2149     bcmStatCounterFormatBytes = 2, 
   2150     bcmStatCounterFormatDoublePackets = 3, /* doubles that total number of entries
   2151                                            for a counter engine */
   2152     bcmStatCounterFormatMaxVoqSize = 4, /* Not relevant for Jer2 */
   2153     bcmStatCounterFormatMaxSize = 4,    /* Always double mode */
   2154     bcmStatCounterFormatIngressLatency = 5, 
   2155     bcmStatCounterFormatCount = 6       /* Must be last one. */
   2156 } bcm_stat_counter_format_type_t;
   2157 
   2158 /* Counter configuration struct */
   2159 typedef struct bcm_stat_counter_format_s {
   2160     bcm_stat_counter_format_type_t format_type; /* Counting format: defines the width of
   2161                                            an entry, and what statistics to
   2162                                            gather. */
   2163     bcm_stat_counter_set_mapping_t counter_set_mapping; /* counter set configuration: defines
   2164                                            the size of a counter set, and what
   2165                                            each offset inside a set counts. */
   2166 } bcm_stat_counter_format_t;
   2167 
   2168 /* Counter configuration struct */
   2169 typedef struct bcm_stat_counter_config_s {
   2170     bcm_stat_counter_format_t format; 
   2171     bcm_stat_counter_source_t source; 
   2172 } bcm_stat_counter_config_t;
   2173 
   2174 #define BCM_STAT_COUNTER_CLEAR_CONFIGURATION 0x1        /* Disables the counter
   2175                                                           engine counting clears
   2176                                                           its configuration. */
   2177 #define BCM_STAT_COUNTER_CACHE              0x2        /* Clears the counter
   2178                                                           cache. */
   2179 #define BCM_STAT_COUNTER_SYMMETRICAL_MULTICORE_ENGINE 0x4        /* If this flag is
   2180                                                           specified then
   2181                                                           consecutive counter
   2182                                                           engines are configured
   2183                                                           for each core, each
   2184                                                           statistics gathering
   2185                                                           is aggregated for
   2186                                                           symmetrical sources.
   2187                                                           config->source.core_id
   2188                                                           must be BCM_CORE_ALL. */
   2189 #define BCM_STAT_COUNTER_IGNORE_COLORS      0x8        /* Ignore colors from
   2190                                                           counter set mapping. */
   2191 #define BCM_STAT_COUNTER_IGNORE_DISPOSITION 0x10       /* Ignore disposition
   2192                                                           (forward or drop) from
   2193                                                           counter set mapping. */
   2194 #define BCM_STAT_COUNTER_MULTIPLE_SOURCES_PER_ENGINE 0x20       /* Connect 2 sources to
   2195                                                           one engine - for QAX
   2196                                                           OAM. */
   2197 #define BCM_STAT_COUNTER_OFFSET_VALID       0x40       /* Defines if to consider
   2198                                                           the offset parameter
   2199                                                           in the structure
   2200                                                           bcm_stat_counter_source_t. */
   2201 
   2202 /* Couner engine type */
   2203 typedef struct bcm_stat_counter_engine_s {
   2204     uint32 flags; 
   2205     int engine_id; 
   2206 } bcm_stat_counter_engine_t;
   2207 
   2208 #ifndef BCM_HIDE_DISPATCHABLE
   2209 
   2210 /* Configures a counter engine. */
   2211 extern int bcm_stat_counter_config_set(
   2212     int unit, 
   2213     bcm_stat_counter_engine_t *engine, 
   2214     bcm_stat_counter_config_t *config);
   2215 
   2216 /* Configures a counter engine. */
   2217 extern int bcm_stat_counter_config_get(
   2218     int unit, 
   2219     bcm_stat_counter_engine_t *engine, 
   2220     bcm_stat_counter_config_t *config);
   2221 
   2222 /* Get the specified statistic of a given counter */
   2223 extern int bcm_stat_flex_counter_get(
   2224     int unit, 
   2225     uint32 stat_counter_id, 
   2226     bcm_stat_flex_stat_t stat, 
   2227     uint32 num_entries, 
   2228     uint32 *counter_indexes, 
   2229     bcm_stat_value_t *counter_values);
   2230 
   2231 /* Get the synced specified statistic of a given counter */
   2232 extern int bcm_stat_flex_counter_sync_get(
   2233     int unit, 
   2234     uint32 stat_counter_id, 
   2235     bcm_stat_flex_stat_t stat, 
   2236     uint32 num_entries, 
   2237     uint32 *counter_indexes, 
   2238     bcm_stat_value_t *counter_values);
   2239 
   2240 /* Set counter value of a given counter */
   2241 extern int bcm_stat_flex_counter_set(
   2242     int unit, 
   2243     uint32 stat_counter_id, 
   2244     bcm_stat_flex_stat_t stat, 
   2245     uint32 num_entries, 
   2246     uint32 *counter_indexes, 
   2247     bcm_stat_value_t *counter_values);
   2248 
   2249 /* Set statistics PP metadata value */
   2250 extern int bcm_stat_pp_metadata_set(
   2251     int unit, 
   2252     bcm_stat_pp_metadata_info_t *metadata_info);
   2253 
   2254 /* Get statistics PP metadata value */
   2255 extern int bcm_stat_pp_metadata_get(
   2256     int unit, 
   2257     bcm_stat_pp_metadata_info_t *metadata_info);
   2258 
   2259 #endif /* BCM_HIDE_DISPATCHABLE */
   2260 
   2261 typedef enum bcm_stat_counter_lif_stack_id_e {
   2262     bcmStatCounterLifStackIdNone = -1,  /* Do not issue a counter command. */
   2263     bcmStatCounterLifStackId0 = 0,      /* Issue a counter command with the
   2264                                            outermost LIF. */
   2265     bcmStatCounterLifStackId1 = 1,      /* Issue a counter command with LIF 1 in
   2266                                            the packet stack. */
   2267     bcmStatCounterLifStackId2 = 2,      /* Issue a counter command with LIF 2 in
   2268                                            the packet stack. */
   2269     bcmStatCounterLifStackId3 = 3       /* Issue a counter command with the
   2270                                            innermost LIF. */
   2271 } bcm_stat_counter_lif_stack_id_t;
   2272 
   2273 #define BCM_STAT_COUNT_LIF_NUMBER_OF_STACK_IDS 4          /* The maximal number of
   2274                                                           LIFs in the packet
   2275                                                           stack */
   2276 
   2277 /* 
   2278  * An entry in a mask of range IDs per stack ID level, each value defines
   2279  * a result of LIF value compared with the LIF ranges.
   2280  */
   2281 typedef enum bcm_stat_counter_lif_range_id_e {
   2282     bcmStatCounterLifRangeIdLifInvalid = -2, /* The LIF does not exist in the packet
   2283                                            stack. */
   2284     bcmStatCounterLifRangeIdNotInAny = -1, /* The LIF is not in any range. */
   2285     bcmBcmStatCounterLifRangeId0 = 0,   /* The LIF is in any range 0. */
   2286     bcmBcmStatCounterLifRangeId1 = 1    /* The LIF is in any range 1. */
   2287 } bcm_stat_counter_lif_range_id_t;
   2288 
   2289 /* 
   2290  * Defines the mask of range IDs per stack ID level, for which the packet
   2291  * will be counted.
   2292  */
   2293 typedef struct bcm_stat_counter_lif_mask_s {
   2294     bcm_stat_counter_lif_range_id_t lif_counting_mask[BCM_STAT_COUNT_LIF_NUMBER_OF_STACK_IDS]; /* An entry in a mask of range IDs per
   2295                                            stack ID level, each value defines a
   2296                                            result of LIF value compared with the
   2297                                            LIF ranges. */
   2298 } bcm_stat_counter_lif_mask_t;
   2299 
   2300 #ifndef BCM_HIDE_DISPATCHABLE
   2301 
   2302 /* 
   2303  * Creates a {counting_source, counting_mask} to lif_stack_level mapping.
   2304  * For Issuing a counter command with the the LIF in
   2305  * lif_stack_id_to_count in the packet LIF stack.
   2306  */
   2307 extern int bcm_stat_counter_lif_counting_set(
   2308     int unit, 
   2309     uint32 flags, 
   2310     bcm_stat_counter_source_t *source, 
   2311     bcm_stat_counter_lif_mask_t *counting_mask, 
   2312     bcm_stat_counter_lif_stack_id_t lif_stack_id_to_count);
   2313 
   2314 /* 
   2315  * Creates a {counting_source, counting_mask} to lif_stack_level mapping.
   2316  * For Issuing a counter command with the the LIF in
   2317  * lif_stack_id_to_count in the packet LIF stack.
   2318  */
   2319 extern int bcm_stat_counter_lif_counting_get(
   2320     int unit, 
   2321     uint32 flags, 
   2322     bcm_stat_counter_source_t *source, 
   2323     bcm_stat_counter_lif_mask_t *counting_mask, 
   2324     bcm_stat_counter_lif_stack_id_t *lif_stack_id_to_count);
   2325 
   2326 #endif /* BCM_HIDE_DISPATCHABLE */
   2327 
   2328 /* A range of LIF IDs. */
   2329 typedef struct bcm_stat_counter_lif_counting_range_s {
   2330     int start; 
   2331     int end; 
   2332     int is_double_entry; 
   2333 } bcm_stat_counter_lif_counting_range_t;
   2334 
   2335 #ifndef BCM_HIDE_DISPATCHABLE
   2336 
   2337 /* Set A range of LIF IDs. */
   2338 extern int bcm_stat_counter_lif_counting_range_set(
   2339     int unit, 
   2340     uint32 flags, 
   2341     bcm_stat_counter_source_type_t source, 
   2342     bcm_stat_counter_lif_range_id_t range_id, 
   2343     bcm_stat_counter_lif_counting_range_t *lif_range);
   2344 
   2345 /* Set A range of LIF IDs. */
   2346 extern int bcm_stat_counter_lif_counting_range_get(
   2347     int unit, 
   2348     uint32 flags, 
   2349     bcm_stat_counter_source_type_t source, 
   2350     bcm_stat_counter_lif_range_id_t range_id, 
   2351     bcm_stat_counter_lif_counting_range_t *lif_range);
   2352 
   2353 #endif /* BCM_HIDE_DISPATCHABLE */
   2354 
   2355 /* 
   2356  * Enable parameter 'engine_range_offse' in structure
   2357  * bcm_stat_lif_counting_source_t.
   2358  */
   2359 #define BCM_STAT_COUNT_LIF_ENGINE_RANGE_OFFSET_ENABLE 0x1        
   2360 
   2361 /* LIF Counting Source. */
   2362 typedef struct bcm_stat_lif_counting_source_s {
   2363     bcm_stat_counter_source_type_t type; 
   2364     int command_id; 
   2365     int stif_counter_id; 
   2366     uint32 offset; 
   2367     int engine_range_offset;            /* Positive or negative offset to align
   2368                                            the profile range to the engine
   2369                                            range. relevant only for out lif
   2370                                            counting in QAX/QUX. */
   2371 } bcm_stat_lif_counting_source_t;
   2372 
   2373 /* LIF Counting Configuration. */
   2374 typedef struct bcm_stat_lif_counting_s {
   2375     bcm_stat_lif_counting_source_t source; 
   2376     bcm_stat_counter_lif_counting_range_t range; 
   2377 } bcm_stat_lif_counting_t;
   2378 
   2379 /* stat counter value structure . */
   2380 typedef struct bcm_stat_counter_value_s {
   2381     uint64 value;   /* value of one statistic */
   2382 } bcm_stat_counter_value_t;
   2383 
   2384 /* stat counter Input data in order to know which counter to read. */
   2385 typedef struct bcm_stat_counter_input_data_s {
   2386     bcm_gport_t counter_source_gport;   /* counter source gport, (for example:
   2387                                            global lif, If the source is Lif) */
   2388     uint32 counter_source_id;           /* Object-stat-id (counter_set id) that
   2389                                            the user wants to read (the
   2390                                            counter_pointer value as sent to the
   2391                                            crps.) */
   2392     bcm_stat_counter_source_type_t counter_source_type; /* type of source to count.not in used
   2393                                            for 88690 device and above */
   2394     int command_id;                     /* command id */
   2395     bcm_core_t core_id;                 /* core id to count from */
   2396     int database_id;                    /* determine the database that user want
   2397                                            to read from. (not in use before
   2398                                            device 88690). */
   2399     int type_id;                        /* determine the source_type_id that
   2400                                            user want to read from. (not in use
   2401                                            before device 88690). */
   2402     int nstat;                          /* size of statistics array to count */
   2403     int *stat_arr;                      /* statistic array to count */
   2404 } bcm_stat_counter_input_data_t;
   2405 
   2406 /* stat counter output data. */
   2407 typedef struct bcm_stat_counter_output_data_s {
   2408     bcm_stat_counter_value_t *value_arr; /* array with the values read for each
   2409                                            statistic */
   2410 } bcm_stat_counter_output_data_t;
   2411 
   2412 #define BCM_STAT_LIF_COUNTING_PROFILE_NONE  -1         /* An indicator for a LIF
   2413                                                           to be uncounted */
   2414 
   2415 #ifndef BCM_HIDE_DISPATCHABLE
   2416 
   2417 /* 
   2418  * Configure a LIF-counting-profile - define it's range - and what
   2419  * counter-command collects it.
   2420  */
   2421 extern int bcm_stat_lif_counting_profile_set(
   2422     int unit, 
   2423     uint32 flags, 
   2424     int lif_counting_profile, 
   2425     bcm_stat_lif_counting_t *lif_counting);
   2426 
   2427 /* 
   2428  * Configure a LIF-counting-profile - define it's range - and what
   2429  * counter-command collects it.
   2430  */
   2431 extern int bcm_stat_lif_counting_profile_get(
   2432     int unit, 
   2433     uint32 flags, 
   2434     int lif_counting_profile, 
   2435     bcm_stat_lif_counting_t *lif_counting);
   2436 
   2437 /* Set A priority of a LIF in a stack */
   2438 extern int bcm_stat_lif_counting_stack_level_priority_set(
   2439     int unit, 
   2440     uint32 flags, 
   2441     bcm_stat_lif_counting_source_t *source, 
   2442     bcm_stat_counter_lif_stack_id_t lif_stack_level, 
   2443     int priority);
   2444 
   2445 /* Set A priority of a LIF in a stack */
   2446 extern int bcm_stat_lif_counting_stack_level_priority_get(
   2447     int unit, 
   2448     uint32 flags, 
   2449     bcm_stat_lif_counting_source_t *source, 
   2450     bcm_stat_counter_lif_stack_id_t lif_stack_level, 
   2451     int *priority);
   2452 
   2453 #endif /* BCM_HIDE_DISPATCHABLE */
   2454 
   2455 /* 
   2456  * different types of filters to be filtered in or out by the counter
   2457  * proccesor
   2458  */
   2459 typedef enum bcm_stat_counter_filter_e {
   2460     bcmStatCounterTotalPDsThresholdViolated, /* Total PDs Threshold Violated - for
   2461                                            Egress Receive engine source */
   2462     bcmStatCounterTotalPDsUcPoolSizeThresholdViolated, /* Total PDs Uc Pool Size Threshold
   2463                                            Violated - for Egress Receive engine
   2464                                            source */
   2465     bcmStatCounterPerPortUcPDsThresholdViolated, /* Per Port Uc PDs Threshold Violated -
   2466                                            for Egress Receive engine source */
   2467     bcmStatCounterPerQueueUcPDsThresholdViolated, /* Per Queue Uc PDs Threshold Violated -
   2468                                            for Egress Receive engine source */
   2469     bcmStatCounterPerPortUcDBsThresholdViolated, /* Per Port Uc DBs Threshold Violated -
   2470                                            for Egress Receive engine source */
   2471     bcmStatCounterPerQueueUcDBsThresholdViolated, /* Per Queue Uc DBs Threshold Violated -
   2472                                            for Egress Receive engine source */
   2473     bcmStatCounterPerQueueDisableBit,   /* Stat Counter Per Queue Disable Bit -
   2474                                            for Egress Receive engine source */
   2475     bcmStatCounterTotalPDsMcPoolSizeThresholdViolated, /* Total PDs Mc Pool Size Threshold
   2476                                            Violated - for Egress Receive engine
   2477                                            source */
   2478     bcmStatCounterPerInterfacePDsThreholdViolated, /* Per Interface PDs Threhold Violated -
   2479                                            for Egress Receive engine source */
   2480     bcmStatCounterMcSPThresholdViolated, /* Mc SP Threshold Violated - for Egress
   2481                                            Receive engine source */
   2482     bcmStatCounterPerMcTCThresholdViolated, /* Per Mc TC Threshold Violated - for
   2483                                            Egress Receive engine source */
   2484     bcmStatCounterMcPDsPerPortThresholdViolated, /* Mc PDs Per Port Threshold Violated -
   2485                                            for Egress Receive engine source */
   2486     bcmStatCounterMcPDsPerQueueThresholdViolated, /* Mc PDs Per Queue Threshold Violated -
   2487                                            for Egress Receive engine source */
   2488     bcmStatCounterMcPerPortSizeThresholdViolated, /* Mc Per Port Size Threshold Violated -
   2489                                            for Egress Receive engine source */
   2490     bcmStatCounterMcPerQueueSizeThresholdViolated, /* Mc Per Queue Size Threshold Violated
   2491                                            - for Egress Receive engine source */
   2492     bcmStatCounterGlobalRejectDiscards, /* Global Reject Discards - for Ingress
   2493                                            engine source */
   2494     bcmStatCounterDramRejectDiscards,   /* Dram Reject Discards - for Ingress
   2495                                            engine source */
   2496     bcmStatCounterVoqTailDropDiscards,  /* Voq Tail Drop Discards - for Ingress
   2497                                            engine source */
   2498     bcmStatCounterVoqStatisticsDiscards, /* Voq Statistics Discards - for Ingress
   2499                                            engine source */
   2500     bcmStatCounterVsqTailDropDiscards,  /* Vsq Tail Drop Discards - for Ingress
   2501                                            engine source */
   2502     bcmStatCounterVsqStatisticsDiscards, /* Vsq Statistics Discards - for Ingress
   2503                                            engine source */
   2504     bcmStatCounterQueueNotValidDiscard, /* Queue Not Valid Discard - for Ingress
   2505                                            engine source */
   2506     bcmStatCounterOtherDiscards,        /* Other Discards - for Ingress engine
   2507                                            source */
   2508     bcmStatCounterDropReasonCount       /* Number of Drop Reasons - should
   2509                                            always be last entry */
   2510 } bcm_stat_counter_filter_t;
   2511 
   2512 #define BCM_STAT_COUNTER_TM_COMMAND 0xFF       /* flag for dedicated engine
   2513                                                   using TM command */
   2514 
   2515 #ifndef BCM_HIDE_DISPATCHABLE
   2516 
   2517 /* set counter source to filter in or out certain filter criteria. */
   2518 extern int bcm_stat_counter_filter_set(
   2519     int unit, 
   2520     bcm_stat_counter_source_t source, 
   2521     bcm_stat_counter_filter_t *filter_array, 
   2522     int filter_count, 
   2523     int is_active);
   2524 
   2525 /* 
   2526  * determine which filter criteria a certain counter source is filtering
   2527  * out.
   2528  */
   2529 extern int bcm_stat_counter_filter_get(
   2530     int unit, 
   2531     bcm_stat_counter_source_t source, 
   2532     int filter_max_count, 
   2533     bcm_stat_counter_filter_t *filter_array, 
   2534     int *filter_count);
   2535 
   2536 /* determine if counter is filtering out certain filter criterion. */
   2537 extern int bcm_stat_counter_filter_is_active_get(
   2538     int unit, 
   2539     bcm_stat_counter_source_t source, 
   2540     bcm_stat_counter_filter_t filter, 
   2541     int *is_active);
   2542 
   2543 /* 
   2544  * Get 64 bit counter values array for a multiple (or single if array
   2545  * size=1) statistic types belong to one source counter set.
   2546  */
   2547 extern int bcm_stat_counter_get(
   2548     int unit, 
   2549     uint32 flags, 
   2550     bcm_stat_counter_input_data_t *stat_counter_input_data, 
   2551     bcm_stat_counter_output_data_t *stat_counter_output_data);
   2552 
   2553 #endif /* BCM_HIDE_DISPATCHABLE */
   2554 
   2555 /* Init function to the structure "bcm_stat_counter_input_data_t". */
   2556 extern void bcm_stat_counter_input_data_t_init(
   2557     bcm_stat_counter_input_data_t *stat_input_data);
   2558 
   2559 /* Initialize a stat_flex_pool_stat_info object struct. */
   2560 extern void bcm_stat_flex_pool_stat_info_t_init(
   2561     bcm_stat_flex_pool_stat_info_t *stat_flex_pool_stat_info);
   2562 
   2563 /* Structure bcm_stat_egress_receive_tm_pointer_format_t */
   2564 typedef struct bcm_stat_egress_receive_tm_pointer_format_s {
   2565     uint32 queue_pair_mask;     /* Which bits to consider from the queue pair
   2566                                    field when building the counter pointer. */
   2567     uint32 traffic_class_mask;  /* Which bits to consider from the traffic class
   2568                                    field when building the counter pointer. */
   2569     uint32 cast_mask;           /* Consider (or not) the cast bit when building
   2570                                    the counter pointer. */
   2571 } bcm_stat_egress_receive_tm_pointer_format_t;
   2572 
   2573 #ifndef BCM_HIDE_DISPATCHABLE
   2574 
   2575 /* 
   2576  * Set the format of the counter pointer that is sent from egress receive
   2577  * tm.
   2578  */
   2579 extern int bcm_stat_egress_receive_tm_pointer_format_set(
   2580     int unit, 
   2581     int flags, 
   2582     bcm_stat_egress_receive_tm_pointer_format_t *pointer_format);
   2583 
   2584 /* 
   2585  * Get the format of the counter pointer that is sent from egress receive
   2586  * tm.
   2587  */
   2588 extern int bcm_stat_egress_receive_tm_pointer_format_get(
   2589     int unit, 
   2590     int flags, 
   2591     bcm_stat_egress_receive_tm_pointer_format_t *pointer_format);
   2592 
   2593 #endif /* BCM_HIDE_DISPATCHABLE */
   2594 
   2595 /* Defines the counter database id and core */
   2596 typedef struct bcm_stat_counter_database_s {
   2597     int database_id;    /* Database id. */
   2598     bcm_core_t core_id; /* Core id. */
   2599 } bcm_stat_counter_database_t;
   2600 
   2601 #define BCM_STAT_DATABASE_CREATE_WITH_ID    0x00000001 /* Create a counter
   2602                                                           database with id */
   2603 
   2604 #ifndef BCM_HIDE_DISPATCHABLE
   2605 
   2606 /* API creates a counter database */
   2607 extern int bcm_stat_counter_database_create(
   2608     int unit, 
   2609     uint32 flags, 
   2610     bcm_core_t core_id, 
   2611     int *database_id);
   2612 
   2613 /* API destroy a counter database */
   2614 extern int bcm_stat_counter_database_destroy(
   2615     int unit, 
   2616     uint32 flags, 
   2617     bcm_stat_counter_database_t *database);
   2618 
   2619 #endif /* BCM_HIDE_DISPATCHABLE */
   2620 
   2621 /* Defines the counter engine id and core */
   2622 typedef struct bcm_stat_engine_s {
   2623     int engine_id;      /* Engine id. */
   2624     bcm_core_t core_id; /* Core id. Must give explicit core. */
   2625 } bcm_stat_engine_t;
   2626 
   2627 /* 
   2628  * Enable/disable the engines belong to the database - counting and
   2629  * eviction.
   2630  */
   2631 typedef struct bcm_stat_counter_enable_s {
   2632     int enable_counting;    /* Engine input - if set, the engine may receive
   2633                                counter pointers and can count. */
   2634     int enable_eviction;    /* Engine output - if set the engine eviction
   2635                                mechanism (scanner) works and counters evicted to
   2636                                the relevant DMA FIFO. */
   2637 } bcm_stat_counter_enable_t;
   2638 
   2639 #ifndef BCM_HIDE_DISPATCHABLE
   2640 
   2641 /* 
   2642  * API enable/disable the engines belong to the database - counting and
   2643  * eviction (input and output). Enable should be made after configure all
   2644  * parameters of the database.
   2645  */
   2646 extern int bcm_stat_counter_database_enable_set(
   2647     int unit, 
   2648     uint32 flags, 
   2649     bcm_stat_counter_database_t *database, 
   2650     bcm_stat_counter_enable_t *enable);
   2651 
   2652 /* determine the enabler status of the database. */
   2653 extern int bcm_stat_counter_database_enable_get(
   2654     int unit, 
   2655     uint32 flags, 
   2656     bcm_stat_counter_database_t *database, 
   2657     bcm_stat_counter_enable_t *enable);
   2658 
   2659 /* API attach new engine to database */
   2660 extern int bcm_stat_counter_engine_attach(
   2661     int unit, 
   2662     uint32 flags, 
   2663     bcm_stat_counter_database_t *database, 
   2664     int engine_id);
   2665 
   2666 /* API detach engine from database */
   2667 extern int bcm_stat_counter_engine_detach(
   2668     int unit, 
   2669     uint32 flags, 
   2670     bcm_stat_counter_database_t *database, 
   2671     int engine_id);
   2672 
   2673 #endif /* BCM_HIDE_DISPATCHABLE */
   2674 
   2675 /* Enum which defines the engine control options */
   2676 typedef enum bcm_stat_counter_engine_control_e {
   2677     bcmStatCounterClearAll = 0,         /* Clear all counters belong to an
   2678                                            engine. clear HW/SW counters. (depend
   2679                                            on the flags. default is both, but
   2680                                            not simultaneously) */
   2681     bcmStatCounterSequentialSamplingInterval = 1, /* Setting the sequential sampling
   2682                                            interval. micro-seconds units */
   2683     bcmStatCounterEngineEvictionEnable = 2 /* Enable/Disable HW eviction for a
   2684                                            specific engine */
   2685 } bcm_stat_counter_engine_control_t;
   2686 
   2687 /* Enum which defines the counter database control options. */
   2688 typedef enum bcm_stat_counter_database_control_e {
   2689     bcmStatCounterDatabaseClearAll = 0, /* Clear all counters belong to a
   2690                                            database. clear HW/SW counters.
   2691                                            (depend on the flags. default is
   2692                                            both, but not simultaneously) */
   2693     bcmStatCounterOverflowMode = 1      /* Allow the user to choose the counter
   2694                                            overflow mode */
   2695 } bcm_stat_counter_database_control_t;
   2696 
   2697 #define BCM_STAT_COUNTER_CONTROL_CLEAR_SW_ONLY 0x1        /* Refer to control enum
   2698                                                           bcmStatCounterClearAll
   2699                                                           - clear only SW
   2700                                                           counters memory. */
   2701 #define BCM_STAT_COUNTER_CONTROL_CLEAR_HW_ONLY 0x2        /* Refer to control enum
   2702                                                           bcmStatCounterClearAll
   2703                                                           - clear only HW
   2704                                                           counters memory. */
   2705 
   2706 #ifndef BCM_HIDE_DISPATCHABLE
   2707 
   2708 /* 
   2709  * API which control some counter engine operations on genral crps
   2710  * operations.
   2711  */
   2712 extern int bcm_stat_counter_engine_control_set(
   2713     int unit, 
   2714     uint32 flags, 
   2715     bcm_stat_engine_t *engine, 
   2716     bcm_stat_counter_engine_control_t control, 
   2717     uint32 arg);
   2718 
   2719 /* 
   2720  * Get the value of one control element. Can't be used for enum
   2721  * bcmStatCounterClearAll.
   2722  */
   2723 extern int bcm_stat_counter_engine_control_get(
   2724     int unit, 
   2725     uint32 flags, 
   2726     bcm_stat_engine_t *engine, 
   2727     bcm_stat_counter_engine_control_t control, 
   2728     uint32 *arg);
   2729 
   2730 /* API which control some counter database operations. */
   2731 extern int bcm_stat_counter_database_control_set(
   2732     int unit, 
   2733     uint32 flags, 
   2734     bcm_stat_counter_database_t *database, 
   2735     bcm_stat_counter_database_control_t control, 
   2736     uint32 arg);
   2737 
   2738 /* 
   2739  * Get the value of one control counter database element. Can't be used
   2740  * for enum bcmStatCounterClearAll.
   2741  */
   2742 extern int bcm_stat_counter_database_control_get(
   2743     int unit, 
   2744     uint32 flags, 
   2745     bcm_stat_counter_database_t *database, 
   2746     bcm_stat_counter_database_control_t control, 
   2747     uint32 *arg);
   2748 
   2749 #endif /* BCM_HIDE_DISPATCHABLE */
   2750 
   2751 #define BCM_STAT_MAX_NUMBER_OF_OBJECT_TYPES 4          /* Defines the number of
   2752                                                           object types */
   2753 
   2754 /* Define the counting source of a counter engine. */
   2755 typedef enum bcm_stat_counter_interface_type_e {
   2756     bcmStatCounterInterfaceIngressReceivePp = 0, 
   2757     bcmStatCounterInterfaceIngressOam = 1, 
   2758     bcmStatCounterInterfaceIngressVoq = 2, 
   2759     bcmStatCounterInterfaceIngressTransmitPp = 3, 
   2760     bcmStatCounterInterfaceEgressReceivePp = 4, 
   2761     bcmStatCounterInterfaceEgressReceiveQueue = 5, 
   2762     bcmStatCounterInterfaceEgressTransmitPp = 6, 
   2763     bcmStatCounterInterfaceEgressOam = 7, 
   2764     bcmStatCounterInterfaceOamp = 8, 
   2765     bcmStatCounterInterfaceCount = 9 
   2766 } bcm_stat_counter_interface_type_t;
   2767 
   2768 /* Set of counter engine parameters per type. */
   2769 typedef struct bcm_stat_counter_type_config_s {
   2770     uint32 valid;               /* Defines type addmission to an engine. */
   2771     uint32 object_type_offset;  /* Counter offset for the type which is add in
   2772                                    the counter mapping process.
   2773                                    units=object-stat-id */
   2774     int start;                  /* Holds the base counter pointer that the
   2775                                    engine should refer to. units=object-stat-id.
   2776                                    If the engine is concatenate to other engines
   2777                                    (prev or next), the range (start/end) should
   2778                                    be the same for all engines in the
   2779                                    'engines-link-list' and it should refer to
   2780                                    the total range that need to count. (driver
   2781                                    will calculate the specific range for each
   2782                                    engine) */
   2783     int end;                    /* Holds the last object-stat-id pointer that
   2784                                    the engine should refer to.
   2785                                    units=object-stat-id. If the engine is
   2786                                    concatenate to other engines (prev or next),
   2787                                    the range (start/end) should be the same for
   2788                                    all engines in the 'engines-link-list' and it
   2789                                    should refer to the total range that need to
   2790                                    count. (driver will calculate the specific
   2791                                    range for each engine) */
   2792 } bcm_stat_counter_type_config_t;
   2793 
   2794 /* Defines the counter engine id and core */
   2795 typedef struct bcm_stat_counter_interface_s {
   2796     bcm_stat_counter_interface_type_t source; /* Counting source. */
   2797     int command_id;                     /* Command id (interface id). */
   2798     bcm_stat_counter_type_config_t type_config[BCM_STAT_MAX_NUMBER_OF_OBJECT_TYPES]; /* Set of parameters configured per
   2799                                            object type. */
   2800     bcm_stat_counter_format_type_t format_type; /* Format of the counter and it
   2801                                            arithmetic action. */
   2802     int counter_set_size;               /* The size of the counter set. */
   2803 } bcm_stat_counter_interface_t;
   2804 
   2805 #define BCM_STAT_COUNTER_MODIFY_RANGE_ONLY  0x00000001 /* Allow to change only
   2806                                                           the range and the
   2807                                                           parameter
   2808                                                           next_consecutive_engine_id
   2809                                                           per type on the fly,
   2810                                                           while engine is
   2811                                                           active. */
   2812 #define BCM_STAT_COUNTER_END_TO_END_LATENCY 0x00000002 /* If flag set, driver
   2813                                                           select the latency
   2814                                                           value as an input to
   2815                                                           the engine, otherwise
   2816                                                           select packet size. */
   2817 
   2818 #ifndef BCM_HIDE_DISPATCHABLE
   2819 
   2820 /* API is used to configure the database interface. */
   2821 extern int bcm_stat_counter_interface_set(
   2822     int unit, 
   2823     uint32 flags, 
   2824     bcm_stat_counter_database_t *database, 
   2825     bcm_stat_counter_interface_t *config);
   2826 
   2827 /* API is used to get the database interface configuration. */
   2828 extern int bcm_stat_counter_interface_get(
   2829     int unit, 
   2830     uint32 flags, 
   2831     bcm_stat_counter_database_t *database, 
   2832     bcm_stat_counter_interface_t *config);
   2833 
   2834 #endif /* BCM_HIDE_DISPATCHABLE */
   2835 
   2836 /* Enum of the fields(types) that can be used in the expansion format. */
   2837 typedef enum bcm_stat_expansion_types_e {
   2838     bcmStatExpansionTypeTmDropReason = 0, 
   2839     bcmStatExpansionTypeDispositionIsDrop = 1, 
   2840     bcmStatExpansionTypeDropPrecedenceMeter0Valid = 2, 
   2841     bcmStatExpansionTypeDropPrecedenceMeter0Value = 3, 
   2842     bcmStatExpansionTypeDropPrecedenceMeter1Valid = 4, 
   2843     bcmStatExpansionTypDropPrecedenceMeter1Value = 5, 
   2844     bcmStatExpansionTypeDropPrecedenceMeter2Valid = 6, 
   2845     bcmStatExpansionTypeDropPrecedenceMeter2Value = 7, 
   2846     bcmStatExpansionTypeTrafficClass = 8, 
   2847     bcmStatExpansionTypeDropPrecedenceMeterResolved = 9, /* Final dp. */
   2848     bcmStatExpansionTypeDropPrecedenceInput = 10, 
   2849     bcmStatExpansionTypeSystemMultiCast = 11, 
   2850     bcmStatExpansionTypeEcnEligibleAndCni = 12, 
   2851     bcmStatExpansionTypePortMetaData = 13, 
   2852     bcmStatExpansionTypePpDropReason = 14, 
   2853     bcmStatExpansionTypeMetaData = 15, 
   2854     bcmStatExpansionTypeDiscardPp = 16, 
   2855     bcmStatExpansionTypeDiscardTm = 17, 
   2856     bcmStatExpansionTypeEgressTmActionType = 18, 
   2857     bcmStatExpansionTypeLatencyBin = 19, 
   2858     bcmStatExpansionTypeLatencyFlowProfile = 20, 
   2859     bcmStatExpansionTypeTmLastCopy = 21, 
   2860     bcmStatExpansionTypeMax = 22 
   2861 } bcm_stat_expansion_types_t;
   2862 
   2863 /* Defines the counter interface key. */
   2864 typedef struct bcm_stat_counter_interface_key_s {
   2865     bcm_core_t core_id;                 /* Core id explicit. */
   2866     bcm_stat_counter_interface_type_t interface_source; /* Source. */
   2867     int command_id;                     /* Command id. */
   2868     int type_id;                        /* Object type id [0..3] . */
   2869 } bcm_stat_counter_interface_key_t;
   2870 
   2871 /* Define the type and bitmap (if relevant) for each expansion element. */
   2872 typedef struct bcm_stat_expansion_element_s {
   2873     bcm_stat_expansion_types_t type; 
   2874     uint32 bitmap;                      /* Select specific bits from the type
   2875                                            for the expansion. relevant only if
   2876                                            user selected metadata or
   2877                                            portMetaData types. */
   2878 } bcm_stat_expansion_element_t;
   2879 
   2880 /* Defines the expansion selection elements. */
   2881 typedef struct bcm_stat_expansion_select_s {
   2882     int nof_elements;                   /* Nof elements. */
   2883     bcm_stat_expansion_element_t expansion_elements[bcmStatExpansionTypeMax]; /* Array which selects the expansion 
   2884                                            types (and bitmaps) that will
   2885                                            generate the expansion. */
   2886 } bcm_stat_expansion_select_t;
   2887 
   2888 #ifndef BCM_HIDE_DISPATCHABLE
   2889 
   2890 /* 
   2891  * API is used to configure the expansion selection per interface.It is
   2892  * not allowed to create different expansions for different types belong
   2893  * to the same interface, if the types are access to the same engine.
   2894  */
   2895 extern int bcm_stat_counter_expansion_select_set(
   2896     int unit, 
   2897     uint32 flags, 
   2898     bcm_stat_counter_interface_key_t *interface, 
   2899     bcm_stat_expansion_select_t *expansion_select);
   2900 
   2901 /* API is used to get the expansion selection configuration. */
   2902 extern int bcm_stat_counter_expansion_select_get(
   2903     int unit, 
   2904     uint32 flags, 
   2905     bcm_stat_counter_interface_key_t *interface, 
   2906     bcm_stat_expansion_select_t *expansion_select);
   2907 
   2908 #endif /* BCM_HIDE_DISPATCHABLE */
   2909 
   2910 #define BCM_STAT_COUNTER_MAPPING_FULL_SPREAD 0x1        /* Used to configure full
   2911                                                           spread for the entire
   2912                                                           expansion. All other
   2913                                                           parameters in the
   2914                                                           strucutre
   2915                                                           bcm_stat_counter_set_map_t
   2916                                                           are ignored.This flag
   2917                                                           is allowed only if the
   2918                                                           expansion is no bigger
   2919                                                           than 5 bits */
   2920 
   2921 /* 
   2922  * Expansion data key. use it to determine the entry to the HW expansion
   2923  * data table.
   2924  */
   2925 typedef struct bcm_stat_expansion_data_key_s {
   2926     bcm_stat_expansion_types_t type;    /* Type/filed from the expansion
   2927                                            selection. */
   2928     int value;                          /* Value for the type. -1 refer to all
   2929                                            values. */
   2930 } bcm_stat_expansion_data_key_t;
   2931 
   2932 /* Defines the value of the HW expansion data mapping table. */
   2933 typedef struct bcm_stat_expansion_data_value_s {
   2934     int counter_set_offset; /* Counter set offset. */
   2935     int valid;              /* Admission for this expansion data(value). */
   2936 } bcm_stat_expansion_data_value_t;
   2937 
   2938 #define BCM_STAT_MAX_NOF_EXPANSION_KEY_ELEMENTS 0x7        /* max size of elements
   2939                                                           that create the
   2940                                                           key(entry) for the
   2941                                                           data expansion table. */
   2942 
   2943 /* 
   2944  * Defines the set of conditions that will generate the exact key for the
   2945  * HW data mapping table, and set it's value.
   2946  */
   2947 typedef struct bcm_stat_expansion_data_mapping_s {
   2948     int nof_key_conditions;             /* max bcmStatExpansionTypeMax. */
   2949     bcm_stat_expansion_data_key_t key[BCM_STAT_MAX_NOF_EXPANSION_KEY_ELEMENTS]; /* Build the key from number of type
   2950                                            values. */
   2951     bcm_stat_expansion_data_value_t value; /* Set the output value of the table
   2952                                            {admission and counter set offset}. */
   2953 } bcm_stat_expansion_data_mapping_t;
   2954 
   2955 /* 
   2956  * Defines the counter set size of the engine and the counter set
   2957  * mapping.
   2958  */
   2959 typedef struct bcm_stat_counter_set_map_s {
   2960     int nof_entries;                    /* Nof entries to the expansion data
   2961                                            mapping array. */
   2962     bcm_stat_expansion_data_mapping_t *expansion_data_mapping; /* Data mapping array. max size=1024. */
   2963 } bcm_stat_counter_set_map_t;
   2964 
   2965 #ifndef BCM_HIDE_DISPATCHABLE
   2966 
   2967 /* API determine the counter set mapping. */
   2968 extern int bcm_stat_counter_set_mapping_set(
   2969     int unit, 
   2970     uint32 flags, 
   2971     bcm_stat_counter_database_t *database, 
   2972     bcm_stat_counter_set_map_t *counter_set_map);
   2973 
   2974 /* API get the counter set mapping. */
   2975 extern int bcm_stat_counter_set_mapping_get(
   2976     int unit, 
   2977     uint32 flags, 
   2978     bcm_stat_counter_database_t *database, 
   2979     bcm_stat_counter_set_map_t *counter_set_map);
   2980 
   2981 #endif /* BCM_HIDE_DISPATCHABLE */
   2982 
   2983 /* Destination types for each DMA FIFO. */
   2984 typedef enum bcm_eviction_destination_type_e {
   2985     bcmStatEvictionDestinationLocalHost = 0 
   2986 } bcm_eviction_destination_type_t;
   2987 
   2988 /* Eviction record format enum. */
   2989 typedef enum bcm_eviction_record_format_e {
   2990     bcmStatEvictionRecordFormatPhysical = 0, 
   2991     bcmStatEvictionRecordFormatLogical = 1 
   2992 } bcm_eviction_record_format_t;
   2993 
   2994 /* enum selects the source data type for conditional eviction. */
   2995 typedef enum bcm_stat_eviction_conditional_source_e {
   2996     bcmStatEvictionConditionalSourceCommandData = 0, 
   2997     bcmStatEvictionConditionalSourceUserData = 1 
   2998 } bcm_stat_eviction_conditional_source_t;
   2999 
   3000 /* Enum select the qualifier for conditional eviction. */
   3001 typedef enum bcm_stat_eviction_conditional_qual_e {
   3002     bcmStatEvictionConditionalQualAndEqualZero = 0, 
   3003     bcmStatEvictionConditionalQualAndNoneEqualZero = 1, 
   3004     bcmStatEvictionConditionalQualAndEqualAllOnes = 2, 
   3005     bcmStatEvictionConditionalQualAndNoneEqualAllOnes = 3, 
   3006     bcmStatEvictionConditionalQualOrEqualZero = 4, 
   3007     bcmStatEvictionConditionalQualOrNoneEqualZero = 5, 
   3008     bcmStatEvictionConditionalQualOrEqualAllOnes = 6, 
   3009     bcmStatEvictionConditionalQualOrNoneEqualAllOnes = 7, 
   3010     bcmStatEvictionConditionalQualDataBiggerThanSource = 8, 
   3011     bcmStatEvictionConditionalQualSourceBiggerThanData = 9, 
   3012     bcmStatEvictionConditionalQualSourceEqualToData = 10 
   3013 } bcm_stat_eviction_conditional_qual_t;
   3014 
   3015 #define BCM_STAT_EVICTION_CONDITIONAL_ACTION_EVICT_COUNTER 0x00000001 /* conditional eviction
   3016                                                           action evict counter */
   3017 #define BCM_STAT_EVICTION_CONDITIONAL_ACTION_RESET_COUNTER 0x00000002 /* conditional eviction
   3018                                                           action reset counter */
   3019 #define BCM_STAT_EVICTION_CONDITIONAL_ACTION_EVICT_TIME 0x00000004 /* conditional eviction
   3020                                                           action evict time */
   3021 #define BCM_STAT_EVICTION_CONDITIONAL_ACTION_INTERRUPT 0x00000008 /* conditional eviction
   3022                                                           action interrupt */
   3023 #define BCM_STAT_EVICTION_CONDITIONAL_ACTION_NO_EVICTION 0x00000010 /* conditional eviction
   3024                                                           action no eviction */
   3025 
   3026 /* structure holds the conditional eviction configuration. */
   3027 typedef struct bcm_stat_eviction_conditional_s {
   3028     bcm_stat_eviction_conditional_source_t condition_source_select; /* select the source to perform the
   3029                                            condition operation. */
   3030     uint64 condition_user_data;         /* if source is UserData, set the data
   3031                                            value */
   3032     bcm_stat_eviction_conditional_qual_t qualifier; /* conditional qualifier */
   3033     uint32 action_flags;                /* conditional action flags */
   3034 } bcm_stat_eviction_conditional_t;
   3035 
   3036 /* Holds the configuration of the eviction per engine. */
   3037 typedef struct bcm_stat_eviction_s {
   3038     int dma_fifo_select;                /* DMA FIFO to select. */
   3039     bcm_eviction_destination_type_t type; /* Dest type. */
   3040     bcm_eviction_record_format_t record_format; /* (physical, logical). */
   3041     int eviction_event_id;              /* Relevant only for logical format. */
   3042     int eviction_algorithmic_disable;   /* If set, disable algorithmic (or
   3043                                            probabilistic) scanning */
   3044     bcm_stat_eviction_conditional_t cond; /* Set of parameters configured the
   3045                                            conditional eviction. */
   3046 } bcm_stat_eviction_t;
   3047 
   3048 #define BCM_STAT_EVICTION_CONDITIONAL_ENABLE 0x00000001 /* if set, conditional
   3049                                                           eviction is enabled */
   3050 
   3051 #ifndef BCM_HIDE_DISPATCHABLE
   3052 
   3053 /* API to set the engine eviction configuration . */
   3054 extern int bcm_stat_counter_eviction_set(
   3055     int unit, 
   3056     uint32 flags, 
   3057     bcm_stat_engine_t *engine, 
   3058     bcm_stat_eviction_t *eviction);
   3059 
   3060 /* API to get the engine eviction configuration. */
   3061 extern int bcm_stat_counter_eviction_get(
   3062     int unit, 
   3063     uint32 flags, 
   3064     bcm_stat_engine_t *engine, 
   3065     bcm_stat_eviction_t *eviction);
   3066 
   3067 #endif /* BCM_HIDE_DISPATCHABLE */
   3068 
   3069 #define BCM_STAT_COUNTER_CLEAR_ON_READ  0x1        /* Used to clear on read SW
   3070                                                       counters */
   3071 
   3072 /* 
   3073  * Configuration of statistics to get, from a counter_set and engine
   3074  * which defined explicitly.
   3075  */
   3076 typedef struct bcm_stat_counter_explicit_input_data_s {
   3077     bcm_stat_engine_t engine; 
   3078     int object_stat_id;         /* The counter pointer that is being sent to the
   3079                                    counter processor. */
   3080     int type_id; 
   3081     int nstat; 
   3082     int *stat_arr; 
   3083 } bcm_stat_counter_explicit_input_data_t;
   3084 
   3085 #ifndef BCM_HIDE_DISPATCHABLE
   3086 
   3087 /* 
   3088  * API gets array of statistics for explicit counter_set and engine,
   3089  * given by the user.
   3090  */
   3091 extern int bcm_stat_counter_explicit_get(
   3092     int unit, 
   3093     uint32 flags, 
   3094     bcm_stat_counter_explicit_input_data_t *stat_counter_input_data, 
   3095     bcm_stat_counter_output_data_t *stat_counter_output_data);
   3096 
   3097 #endif /* BCM_HIDE_DISPATCHABLE */
   3098 
   3099 /* init bcm_stat_engine_t */
   3100 extern void bcm_stat_engine_t_init(
   3101     bcm_stat_engine_t *stat_engine);
   3102 
   3103 /* init bcm_stat_counter_database_t */
   3104 extern void bcm_stat_counter_database_t_init(
   3105     bcm_stat_counter_database_t *stat_counter_database);
   3106 
   3107 /* init bcm_stat_counter_explicit_input_data_t */
   3108 extern void bcm_stat_counter_explicit_input_data_t_init(
   3109     bcm_stat_counter_explicit_input_data_t *stat_counter_explicit_input_data);
   3110 
   3111 /* init bcm_stat_eviction_t */
   3112 extern void bcm_stat_eviction_t_init(
   3113     bcm_stat_eviction_t *stat_eviction);
   3114 
   3115 /* init bcm_stat_counter_set_map_t */
   3116 extern void bcm_stat_counter_set_map_t_init(
   3117     bcm_stat_counter_set_map_t *stat_counter_set_map);
   3118 
   3119 /* init bcm_stat_expansion_data_mapping_t */
   3120 extern void bcm_stat_expansion_data_mapping_t_init(
   3121     bcm_stat_expansion_data_mapping_t *stat_expansion_data_mapping);
   3122 
   3123 /* init bcm_stat_counter_interface_key_t */
   3124 extern void bcm_stat_counter_interface_key_t_init(
   3125     bcm_stat_counter_interface_key_t *stat_counter_interface_key);
   3126 
   3127 /* init bcm_stat_expansion_select_t */
   3128 extern void bcm_stat_expansion_select_t_init(
   3129     bcm_stat_expansion_select_t *stat_expansion_select);
   3130 
   3131 /* init bcm_stat_counter_interface_t */
   3132 extern void bcm_stat_counter_interface_t_init(
   3133     bcm_stat_counter_interface_t *stat_counter_interface);
   3134 
   3135 /* init bcm_stat_counter_enable_t */
   3136 extern void bcm_stat_counter_enable_t_init(
   3137     bcm_stat_counter_enable_t *stat_counter_enable);
   3138 
   3139 /* init bcm_stat_counter_output_data_t */
   3140 extern void bcm_stat_counter_output_data_t_init(
   3141     bcm_stat_counter_output_data_t *stat_counter_output_data);
   3142 
   3143 typedef struct bcm_stat_eviction_boundaries_s {
   3144     int start; 
   3145     int end; 
   3146 } bcm_stat_eviction_boundaries_t;
   3147 
   3148 /* Return sequential eviction boundaries to the default values. */
   3149 #define BCM_STAT_EVICTION_RANGE_ALL 0x00000001 
   3150 
   3151 #ifndef BCM_HIDE_DISPATCHABLE
   3152 
   3153 /* Modify sequential boundaries. */
   3154 extern int bcm_stat_eviction_boundaries_set(
   3155     int unit, 
   3156     uint32 flags, 
   3157     bcm_stat_engine_t *engine, 
   3158     bcm_stat_eviction_boundaries_t *boundaries);
   3159 
   3160 /* Get the values of the sequential boundaries. */
   3161 extern int bcm_stat_eviction_boundaries_get(
   3162     int unit, 
   3163     uint32 flags, 
   3164     bcm_stat_engine_t *engine, 
   3165     bcm_stat_eviction_boundaries_t *boundaries);
   3166 
   3167 #endif /* BCM_HIDE_DISPATCHABLE */
   3168 
   3169 /* 
   3170  * Defines the types (that user can select) of packet size adjustment per
   3171  * stat source block.
   3172  */
   3173 typedef enum bcm_stat_pkt_size_adjust_select_type_e {
   3174     bcmStatPktSizeSelectCounterIngressHeaderTruncate = 0 
   3175 } bcm_stat_pkt_size_adjust_select_type_t;
   3176 
   3177 /* 
   3178  * Defines the key parameters to select a packet size adjustment type
   3179  * (For counter processor, per source and command_id)
   3180  */
   3181 typedef struct bcm_stat_counter_command_id_key_s {
   3182     bcm_core_t core_id;                 /* Support specific core or ALL. */
   3183     bcm_stat_counter_interface_type_t source; /* Select source. */
   3184     int command_id;                     /* Select the command id. */
   3185 } bcm_stat_counter_command_id_key_t;
   3186 
   3187 #ifndef BCM_HIDE_DISPATCHABLE
   3188 
   3189 /* 
   3190  * Enable/disable a packet size adjustment type (currently just
   3191  * header-truncate), for ingress packet size adjustment calculation
   3192  * (compensation).
   3193  */
   3194 extern int bcm_stat_pkt_size_adjust_select_set(
   3195     int unit, 
   3196     int flags, 
   3197     bcm_stat_counter_command_id_key_t *key, 
   3198     bcm_stat_pkt_size_adjust_select_type_t select_type, 
   3199     int enable);
   3200 
   3201 /* 
   3202  * Get if packet size adjustment type is enabled or disabled according to
   3203  * the given key.
   3204  */
   3205 extern int bcm_stat_pkt_size_adjust_select_get(
   3206     int unit, 
   3207     int flags, 
   3208     bcm_stat_counter_command_id_key_t *key, 
   3209     bcm_stat_pkt_size_adjust_select_type_t select_type, 
   3210     int *enable);
   3211 
   3212 #endif /* BCM_HIDE_DISPATCHABLE */
   3213 
   3214 #define BCM_STAT_COUNTER_OVERFLOW_MODE_RESET 0          /* Refer to control enum
   3215                                                           bcmStatCounterOverflowMode
   3216                                                           - reset to 0. */
   3217 #define BCM_STAT_COUNTER_OVERFLOW_MODE_WRAP_AROUND 1          /* Refer to control enum
   3218                                                           bcmStatCounterOverflowMode
   3219                                                           - handle overflow for
   3220                                                           source OAM. */
   3221 #define BCM_STAT_COUNTER_OVERFLOW_MODE_FIXED_AT_MAX 2          /* Refer to control enum
   3222                                                           bcmStatCounterOverflowMode
   3223                                                           - use mode stuck all
   3224                                                           at ones. */
   3225 
   3226 /* Filter groups */
   3227 typedef enum bcm_stat_counter_group_filter_e {
   3228     bcmStatCounterGroupFilterGlobalResourcesDrop = 0, 
   3229     bcmStatCounterGroupFilterVoqResourcesDrop = 1, 
   3230     bcmStatCounterGroupFilterWredDrop = 2, 
   3231     bcmStatCounterGroupFilterOcbResourcesDrop = 3, 
   3232     bcmStatCounterGroupFilterVsqResourcesDrop = 4, 
   3233     bcmStatCounterGroupFilterLatencyDrop = 5, 
   3234     bcmStatCounterGroupFilterMiscDrop = 6, 
   3235     bcmStatCounterGroupFilterUserDefinedGroup = 7, 
   3236     bcmStatCounterGroupFilterCount = 8 
   3237 } bcm_stat_counter_group_filter_t;
   3238 
   3239 #ifndef BCM_HIDE_DISPATCHABLE
   3240 
   3241 /* Set counter source to filter in or out certain filter criteria. */
   3242 extern int bcm_stat_counter_filter_group_set(
   3243     int unit, 
   3244     uint32 flags, 
   3245     bcm_stat_counter_command_id_key_t *key, 
   3246     bcm_stat_counter_group_filter_t filter, 
   3247     int is_active);
   3248 
   3249 /* Determine if given filter criteria is active or not. */
   3250 extern int bcm_stat_counter_filter_group_get(
   3251     int unit, 
   3252     uint32 flags, 
   3253     bcm_stat_counter_command_id_key_t *key, 
   3254     bcm_stat_counter_group_filter_t filter, 
   3255     int *is_active);
   3256 
   3257 #endif /* BCM_HIDE_DISPATCHABLE */
   3258 
   3259 /* init bcm_stat_counter_command_id_key_t */
   3260 extern void bcm_stat_counter_command_id_key_t_init(
   3261     bcm_stat_counter_command_id_key_t *stat_counter_command_id_key);
   3262 
   3263 /* init bcm_stat_eviction_boundaries_t */
   3264 extern void bcm_stat_eviction_boundaries_t_init(
   3265     bcm_stat_eviction_boundaries_t *stat_eviction_boundaries);
   3266 
   3267 #define BCM_STAT_EXTERNAL       0x00000001 
   3268 
   3269 #define BCM_STAT_FULL_MASK      0xFFFFFFFF /* mask the whole field */
   3270 
   3271 #define BCM_STAT_INGRESS        0x1        
   3272 #define BCM_STAT_EGRESS         0x2        
   3273 
   3274 #define BCM_STAT_SOURCE_MAPPING_FIRST_PORT  0x1        
   3275 #define BCM_STAT_SOURCE_MAPPING_SECOND_PORT 0x2        
   3276 
   3277 /* List of elements that build the statistics interface record format */
   3278 typedef enum bcm_stat_stif_record_element_type_e {
   3279     bcmStatStifRecordElementObj0 = 0,   /* mask=BCM_STAT_FULL_MASK must be set */
   3280     bcmStatStifRecordElementObj1 = 1,   /* mask=BCM_STAT_FULL_MASK must be set */
   3281     bcmStatStifRecordElementObj2 = 2,   /* mask=BCM_STAT_FULL_MASK must be set */
   3282     bcmStatStifRecordElementObj3 = 3,   /*  mask=BCM_STAT_FULL_MASK must be set */
   3283     bcmStatStifRecordElementPacketSize = 4, /* mask=BCM_STAT_FULL_MASK must be set */
   3284     bcmStatStifRecordElementOpCode = 5, /* mask=BCM_STAT_FULL_MASK must be used.
   3285                                            8 bits represent 4 objs opCode */
   3286     bcmStatStifRecordElementIngressDispositionIsDrop = 6, 
   3287     bcmStatStifRecordElementIngressTmDropReason = 7, 
   3288     bcmStatStifRecordElementIngressTrafficClass = 8, 
   3289     bcmStatStifRecordElementIngressIncomingDropPrecedence = 9, 
   3290     bcmStatStifRecordElementIngressDropPrecedenceMeterResolved = 10, 
   3291     bcmStatStifRecordElementIngressDropPrecedenceMeter0Valid = 11, 
   3292     bcmStatStifRecordElementIngressDropPrecedenceMeter0Value = 12, 
   3293     bcmStatStifRecordElementIngressDropPrecedenceMeter1Valid = 13, 
   3294     bcmStatStifRecordElementIngressDropPrecedenceMeter1Value = 14, 
   3295     bcmStatStifRecordElementIngressDropPrecedenceMeter2Valid = 15, 
   3296     bcmStatStifRecordElementIngressDropPrecedenceMeter2Value = 16, 
   3297     bcmStatStifRecordElementIngressCore = 17, 
   3298     bcmStatStifRecordElementIngressPpMetaData = 18, 
   3299     bcmStatStifRecordElementIngressQueueNumber = 19, 
   3300     bcmStatStifRecordElementEgressMetaDataMultiCast = 20, /* mask=BCM_STAT_FULL_MASK must be set */
   3301     bcmStatStifRecordElementEgressMetaDataPpDropReason = 21, /* mask=BCM_STAT_FULL_MASK must be set */
   3302     bcmStatStifRecordElementEgressMetaDataPort = 22, /* mask=BCM_STAT_FULL_MASK must be set */
   3303     bcmStatStifRecordElementEgressMetaDataEcnEligibleAndCni = 23, /* mask=BCM_STAT_FULL_MASK must be set */
   3304     bcmStatStifRecordElementEgressMetaDataTrafficClass = 24, /* mask=BCM_STAT_FULL_MASK must be set */
   3305     bcmStatStifRecordElementEgressMetaDataDropPrecedence = 25, /* mask=BCM_STAT_FULL_MASK must be set */
   3306     bcmStatStifRecordElementEgressMetaDataObj0 = 26, /* mask=BCM_STAT_FULL_MASK must be set */
   3307     bcmStatStifRecordElementEgressMetaDataObj1 = 27, /* mask=BCM_STAT_FULL_MASK must be set */
   3308     bcmStatStifRecordElementEgressMetaDataObj2 = 28, /* mask=BCM_STAT_FULL_MASK must be set */
   3309     bcmStatStifRecordElementEgressMetaDataObj3 = 29, /* mask=BCM_STAT_FULL_MASK must be set */
   3310     bcmStatStifRecordElementEgressMetaDataCore = 30, /* mask=BCM_STAT_FULL_MASK must be set */
   3311     bcmStatStifRecordElementIngressIsLastCopy = 31 /* Enable last copy for MC */
   3312 } bcm_stat_stif_record_element_type_t;
   3313 
   3314 /* 
   3315  * Structure holds one element and its position, in the statistics
   3316  * interface record format
   3317  */
   3318 typedef struct bcm_stat_stif_record_format_element_s {
   3319     bcm_stat_stif_record_element_type_t element_type; 
   3320     uint32 mask; 
   3321 } bcm_stat_stif_record_format_element_t;
   3322 
   3323 #ifndef BCM_HIDE_DISPATCHABLE
   3324 
   3325 /* 
   3326  * API set the statistics interface record format (for billing mode
   3327  * INGRESS or EGRESS)
   3328  */
   3329 extern int bcm_stat_stif_record_format_set(
   3330     int unit, 
   3331     int flags, 
   3332     int nof_elements, 
   3333     bcm_stat_stif_record_format_element_t *record_format_elements);
   3334 
   3335 /* 
   3336  * API get the statistics interface record format (for billing mode
   3337  * INGRESS or EGRESS)
   3338  */
   3339 extern int bcm_stat_stif_record_format_get(
   3340     int unit, 
   3341     int flags, 
   3342     int max_nof_elements, 
   3343     bcm_stat_stif_record_format_element_t *elements_array, 
   3344     int *nof_elements);
   3345 
   3346 #endif /* BCM_HIDE_DISPATCHABLE */
   3347 
   3348 /* 
   3349  * List of statistics interface sources that generate the statistics
   3350  * records.
   3351  */
   3352 typedef enum bcm_stat_stif_source_type_e {
   3353     bcmStatStifSourceIngressEnqueue = 0, 
   3354     bcmStatStifSourceIngressDequeue = 1, 
   3355     bcmStatStifSourceIngressScrubber = 2, 
   3356     bcmStatStifSourceEgressDequeue = 3 
   3357 } bcm_stat_stif_source_type_t;
   3358 
   3359 /* 
   3360  * Structure hold one statistic interface source which generate
   3361  * statistics records.
   3362  */
   3363 typedef struct bcm_stat_stif_source_s {
   3364     bcm_core_t core; 
   3365     bcm_stat_stif_source_type_t src_type; 
   3366 } bcm_stat_stif_source_t;
   3367 
   3368 #ifndef BCM_HIDE_DISPATCHABLE
   3369 
   3370 /* 
   3371  * API map statistics source (statistics interface source) to logical
   3372  * port. port=invalid means disconnect the source
   3373  */
   3374 extern int bcm_stat_stif_source_mapping_set(
   3375     int unit, 
   3376     int flags, 
   3377     bcm_stat_stif_source_t source, 
   3378     bcm_port_t port);
   3379 
   3380 /* 
   3381  * API get the mapping of statistics source to its logical port.
   3382  * port=invalid means that the source is disconnected
   3383  */
   3384 extern int bcm_stat_stif_source_mapping_get(
   3385     int unit, 
   3386     int flags, 
   3387     bcm_stat_stif_source_t source, 
   3388     bcm_port_t *port);
   3389 
   3390 #endif /* BCM_HIDE_DISPATCHABLE */
   3391 
   3392 /* List of stat control types. */
   3393 typedef enum bcm_stat_control_e {
   3394     bcmStatControlStifFcEnable = 0, 
   3395     bcmStatControlCounterThreadEnable = 1 /* General enabler for the SW BG thread
   3396                                            of counter collecting. Irelevant for
   3397                                            specific engine. (one thread for all
   3398                                            engines) */
   3399 } bcm_stat_control_t;
   3400 
   3401 #ifndef BCM_HIDE_DISPATCHABLE
   3402 
   3403 /* API stat control set. */
   3404 extern int bcm_stat_control_set(
   3405     int unit, 
   3406     int flags, 
   3407     bcm_stat_control_t type, 
   3408     int arg);
   3409 
   3410 /* API stat control get. */
   3411 extern int bcm_stat_control_get(
   3412     int unit, 
   3413     int flags, 
   3414     bcm_stat_control_t type, 
   3415     int *arg);
   3416 
   3417 #endif /* BCM_HIDE_DISPATCHABLE */
   3418 
   3419 /* Stat Flex Counter Information */
   3420 typedef struct bcm_stat_custom_counter_info_s {
   3421     uint32 ctr_tbl_mode_id;         /* Counter table Mode Identifier */
   3422     uint32 ctr_tbl_pool_id;         /* Counter table Pool Id */
   3423     uint32 ctr_tbl_pool_base_idx;   /* Counter table Pool Base Index */
   3424     uint32 offset_tbl_base_idx;     /* Offset table Pool Base Index */
   3425     uint32 num_counters;            /* Number of counter entries created */
   3426     uint32 stat_counter_id;         /* Stat Counter Id */
   3427     bcm_stat_object_t object;       /* Stat Accounting object */
   3428 } bcm_stat_custom_counter_info_t;
   3429 
   3430 #ifndef BCM_HIDE_DISPATCHABLE
   3431 
   3432 /* 
   3433  * Associate an accounting object to customized group mode with user
   3434  * configured pool id.
   3435  */
   3436 extern int bcm_stat_custom_group_id_create(
   3437     int unit, 
   3438     uint32 mode_id, 
   3439     bcm_stat_object_t object, 
   3440     uint32 pool_id, 
   3441     uint32 base_idx, 
   3442     bcm_stat_custom_counter_info_t *counter_info);
   3443 
   3444 #endif /* BCM_HIDE_DISPATCHABLE */
   3445 
   3446 /* bcm_stat_custom_base_index_action_e */
   3447 typedef enum bcm_stat_custom_base_index_action_e {
   3448     bcmStatCustomBaseIdxAlloc = 0,  /* Counter Base Index Alloc */
   3449     bcmStatCustomBaseIdxMove = 1    /* Counter Base Index Move */
   3450 } bcm_stat_custom_base_index_action_t;
   3451 
   3452 #ifndef BCM_HIDE_DISPATCHABLE
   3453 
   3454 /* 
   3455  * This function is used to move the old set of counters to new free
   3456  * location provided by user.
   3457  */
   3458 extern int bcm_stat_custom_counter_id_move(
   3459     int unit, 
   3460     bcm_stat_custom_base_index_action_t idx_action, 
   3461     bcm_stat_custom_counter_info_t counter_info_old, 
   3462     bcm_stat_custom_counter_info_t *counter_info_new);
   3463 
   3464 #endif /* BCM_HIDE_DISPATCHABLE */
   3465 
   3466 /* Initialize flex stat counter information */
   3467 extern void bcm_stat_custom_counter_info_t_init(
   3468     bcm_stat_custom_counter_info_t *counter_info);
   3469 
   3470 /* PP statistic profile. */
   3471 typedef struct bcm_stat_pp_profile_info_s {
   3472     int counter_command_id;             /* Command id (interface id). */
   3473     int stat_object_type;               /* Statistic object type in range
   3474                                            0-BCM_STAT_MAX_NUMBER_OF_OBJECT_TYPES-1 */
   3475     int meter_command_id;               /* Relevant only for egress */
   3476     int meter_qos_map_id;               /* Relevant only for egress */
   3477     uint8 is_meter_enable;              /* Allow metering */
   3478     uint8 is_fp_cs_var;                 /* Enable PMF2 context selection */
   3479     int ingress_tunnel_metadata_size;   /* Ingress metadata size in buffer (in
   3480                                            bits) for terminated headers */
   3481     int ingress_tunnel_metadata_start_bit; /* Ingress metadata start bit in buffer
   3482                                            for terminated headers */
   3483     int ingress_forward_metadata_size;  /* Ingress metadata size in buffer (in
   3484                                            bits) for forwarding header */
   3485     int ingress_forward_metadata_start_bit; /* Ingress metadata start bit in buffer
   3486                                            for forwarding header */
   3487     int ingress_fwd_plus_one_metadata_size; /* Ingress metadata size in buffer (in
   3488                                            bits) for forwarding plus one header */
   3489     int ingress_fwd_plus_one_metadata_start_bit; /* Ingress metadata start bit in buffer
   3490                                            for forwarding plus one header */
   3491     uint8 is_protection_fec;            /* Support protection-FEC */
   3492 } bcm_stat_pp_profile_info_t;
   3493 
   3494 #ifndef BCM_HIDE_DISPATCHABLE
   3495 
   3496 /* Map {statistic command, statistic profile} to the profile properties */
   3497 extern int bcm_stat_pp_profile_create(
   3498     int unit, 
   3499     int flags, 
   3500     bcm_stat_counter_interface_type_t engine_source, 
   3501     int *stat_pp_profile, 
   3502     bcm_stat_pp_profile_info_t *stat_pp_profile_info);
   3503 
   3504 /* Get profile properties according to stat_pp_profile */
   3505 extern int bcm_stat_pp_profile_get(
   3506     int unit, 
   3507     int stat_pp_profile, 
   3508     bcm_stat_pp_profile_info_t *stat_pp_profile_info);
   3509 
   3510 /* Delete profile properties according to stat_pp_profile */
   3511 extern int bcm_stat_pp_profile_delete(
   3512     int unit, 
   3513     int stat_pp_profile);
   3514 
   3515 #endif /* BCM_HIDE_DISPATCHABLE */
   3516 
   3517 /* Stat PP profile flags */
   3518 #define BCM_STAT_PP_PROFILE_WITH_ID 0x0001     /* Add stat profile instance
   3519                                                   using a specific id. */
   3520 #define BCM_STAT_PP_PROFILE_REPLACE 0x0002     /* Replace data in an existing
   3521                                                   stat profile instance. */
   3522 
   3523 /* Initialize stat_pp_profile_info_t */
   3524 extern void bcm_stat_pp_profile_info_t_init(
   3525     bcm_stat_pp_profile_info_t *pp_profile);
   3526 
   3527 /* PP statistic profile information */
   3528 typedef struct bcm_stat_pp_info_s {
   3529     uint32 flags;           /* BCM_STAT_INFO_WITH_ID, BCM_STAT_INFO_REPLACE */
   3530     uint32 stat_id;         /* object statistic id (the counter_pointer value as
   3531                                sent to the crps) */
   3532     int stat_pp_profile;    /* profile */
   3533 } bcm_stat_pp_info_t;
   3534 
   3535 /* Initialize stat_pp_info_t structure */
   3536 extern void bcm_stat_pp_info_t_init(
   3537     bcm_stat_pp_info_t *stat_pp_info);
   3538 
   3539 #ifndef BCM_HIDE_DISPATCHABLE
   3540 
   3541 /* 
   3542  * Map physical or logical port to stat id and stat profile. In case of
   3543  * DPC LIF the api can accept core parameter to distinguish between the
   3544  * stat id on the two cores.
   3545  */
   3546 extern int bcm_gport_stat_set(
   3547     int unit, 
   3548     bcm_gport_t gport, 
   3549     bcm_core_t core_id, 
   3550     bcm_stat_counter_interface_type_t engine_source, 
   3551     bcm_stat_pp_info_t stat_info);
   3552 
   3553 /* 
   3554  * Get mapping of physical or logical port to stat id and stat profile.
   3555  * In case of DPC LIF the api can accept core parameter to distinguish
   3556  * between the stat id on the two cores.
   3557  */
   3558 extern int bcm_gport_stat_get(
   3559     int unit, 
   3560     bcm_gport_t gport, 
   3561     bcm_core_t core_id, 
   3562     bcm_stat_counter_interface_type_t engine_source, 
   3563     bcm_stat_pp_info_t *stat_info);
   3564 
   3565 #endif /* BCM_HIDE_DISPATCHABLE */
   3566 
   3567 /* 
   3568  * Structure holds the key for decoding the stat-id of end to end latency
   3569  * per destination port.
   3570  */
   3571 typedef struct bcm_stat_latency_port_stat_id_key_s {
   3572     int is_multicast;   /* Multicast. */
   3573     int traffic_class;  /* Traffic class. */
   3574     bcm_port_t port;    /* Port. */
   3575 } bcm_stat_latency_port_stat_id_key_t;
   3576 
   3577 #ifndef BCM_HIDE_DISPATCHABLE
   3578 
   3579 /* 
   3580  * For end to end latency per destination port, API give back the decoded
   3581  * latency stat-id.
   3582  */
   3583 extern int bcm_stat_latency_port_stat_id_get(
   3584     int unit, 
   3585     int flags, 
   3586     bcm_stat_latency_port_stat_id_key_t *key, 
   3587     int *stat_id);
   3588 
   3589 /* Set drop reasons to be part of certain group. */
   3590 extern int bcm_stat_group_drop_reasons_set(
   3591     int unit, 
   3592     uint32 flags, 
   3593     bcm_stat_counter_group_filter_t group, 
   3594     bcm_cosq_drop_reason_t *drop_reasons_array, 
   3595     int drop_reasons_count);
   3596 
   3597 /* Get drop reasons represented by given group. */
   3598 extern int bcm_stat_group_drop_reasons_get(
   3599     int unit, 
   3600     uint32 flags, 
   3601     bcm_stat_counter_group_filter_t group, 
   3602     int max_drop_reason_count, 
   3603     bcm_cosq_drop_reason_t *drop_reasons_array, 
   3604     int *drop_reasons_count);
   3605 
   3606 /* Modify sequential boundaries - in stat object id resolution. */
   3607 extern int bcm_stat_database_eviction_boundaries_set(
   3608     int unit, 
   3609     uint32 flags, 
   3610     bcm_stat_counter_database_t *database, 
   3611     int type_id, 
   3612     bcm_stat_eviction_boundaries_t *boundaries);
   3613 
   3614 /* 
   3615  * Get the values of the sequential boundaries - in stat object id
   3616  * resolution.
   3617  */
   3618 extern int bcm_stat_database_eviction_boundaries_get(
   3619     int unit, 
   3620     uint32 flags, 
   3621     bcm_stat_counter_database_t *database, 
   3622     int type_id, 
   3623     bcm_stat_eviction_boundaries_t *boundaries);
   3624 
   3625 #endif /* BCM_HIDE_DISPATCHABLE */
   3626 
   3627 extern void bcm_stat_pp_metadata_info_t_init(
   3628     bcm_stat_pp_metadata_info_t *metadata_info);
   3629 
   3630 #endif /* __BCM_STAT_H__ */