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

flexdigest.h (69635B)


      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_FLEXDIGEST_H__
     11 #define __BCM_FLEXDIGEST_H__
     12 
     13 #include <bcm/types.h>
     14 
     15 #ifndef BCM_HIDE_DISPATCHABLE
     16 
     17 /* Initialize the flex digest module. */
     18 extern int bcm_flexdigest_init(
     19     int unit);
     20 
     21 /* Detach the flex-digest module. */
     22 extern int bcm_flexdigest_detach(
     23     int unit);
     24 
     25 #endif /* BCM_HIDE_DISPATCHABLE */
     26 
     27 /* Options to control flex digest profiles. */
     28 #define BCM_FLEXDIGEST_PROFILE_CREATE_OPTIONS_WITH_ID (1 << 0)   /* Use input profile Id
     29                                                           instead of allocating
     30                                                           one. */
     31 
     32 /* The control type for flex digest normalization seed profile. */
     33 typedef enum bcm_flexdigest_norm_seed_control_e {
     34     bcmFlexDigestNormSeedControlBinASeed = 0, /* The Seed A in normalization seed
     35                                            profile. */
     36     bcmFlexDigestNormSeedControlBinBSeed = 1, /* The Seed B in normalization seed
     37                                            profile. */
     38     bcmFlexDigestNormSeedControlBinCSeed = 2, /* The Seed C in normalization seed
     39                                            profile. */
     40     bcmFlexDigestNormSeedControlCount = 3 /* Always last. Not a usable value. */
     41 } bcm_flexdigest_norm_seed_control_t;
     42 
     43 #define BCM_FLEXDIGEST_NORM_SEED_CONTROL_STRINGS \
     44 { \
     45     "BinASeed", \
     46     "BinBSeed", \
     47     "BinCSeed"  \
     48 }
     49 
     50 #ifndef BCM_HIDE_DISPATCHABLE
     51 
     52 /* Create a flex digest normalization seed profile. */
     53 extern int bcm_flexdigest_norm_seed_profile_create(
     54     int unit, 
     55     uint32 options, 
     56     int *seed_profile_id);
     57 
     58 /* Destroy a flex digest normalization seed profile. */
     59 extern int bcm_flexdigest_norm_seed_profile_destroy(
     60     int unit, 
     61     int seed_profile_id);
     62 
     63 /* Destroy all flex digest normalization seed profiles. */
     64 extern int bcm_flexdigest_norm_seed_profile_destroy_all(
     65     int unit);
     66 
     67 /* Configure the flex digest normalization seed profile. */
     68 extern int bcm_flexdigest_norm_seed_profile_set(
     69     int unit, 
     70     int seed_profile_id, 
     71     bcm_flexdigest_norm_seed_control_t type, 
     72     int value);
     73 
     74 /* Get the flex digest normalization seed profile configuration. */
     75 extern int bcm_flexdigest_norm_seed_profile_get(
     76     int unit, 
     77     int seed_profile_id, 
     78     bcm_flexdigest_norm_seed_control_t type, 
     79     int *value);
     80 
     81 #endif /* BCM_HIDE_DISPATCHABLE */
     82 
     83 /* The control type for flex digest normalization profile. */
     84 typedef enum bcm_flexdigest_norm_profile_control_e {
     85     bcmFlexDigestNormProfileControlNorm = 0, /* Configure this to enable or disable
     86                                            normalization. */
     87     bcmFlexDigestNormProfileControlSeedId = 1, /* The seed profile identifier in
     88                                            normalization profile. */
     89     bcmFlexDigestNormProfileControlCount = 2 /* Always last. Not a usable value. */
     90 } bcm_flexdigest_norm_profile_control_t;
     91 
     92 #define BCM_FLEXDIGEST_NORM_PROFILE_CONTROL_STRINGS \
     93 { \
     94     "Norm", \
     95     "SeedId"  \
     96 }
     97 
     98 #ifndef BCM_HIDE_DISPATCHABLE
     99 
    100 /* Create a flex digest normalization profile. */
    101 extern int bcm_flexdigest_norm_profile_create(
    102     int unit, 
    103     uint32 options, 
    104     int *norm_profile_id);
    105 
    106 /* Destroy a flex digest normalization profile. */
    107 extern int bcm_flexdigest_norm_profile_destroy(
    108     int unit, 
    109     int norm_profile_id);
    110 
    111 /* Destroy all flex digest normalization profiles. */
    112 extern int bcm_flexdigest_norm_profile_destroy_all(
    113     int unit);
    114 
    115 /* Configure flex digest normalization profile. */
    116 extern int bcm_flexdigest_norm_profile_set(
    117     int unit, 
    118     int norm_profile_id, 
    119     bcm_flexdigest_norm_profile_control_t type, 
    120     int value);
    121 
    122 /* Get flex digest normalization profile configuration. */
    123 extern int bcm_flexdigest_norm_profile_get(
    124     int unit, 
    125     int norm_profile_id, 
    126     bcm_flexdigest_norm_profile_control_t type, 
    127     int *value);
    128 
    129 #endif /* BCM_HIDE_DISPATCHABLE */
    130 
    131 /* 
    132  * List of flex digest qualifiers.
    133  * 
    134  * Flex digest lookup qualifiers are collected into qualifier sets
    135  * (qsets), which are used to allocate flex digest lookup groups.
    136  */
    137 typedef enum bcm_flexdigest_qualify_e {
    138     bcmFlexDigestQualifyMatchId = 0,    /* Qualifies on match identifier. */
    139     bcmFlexDigestQualifyL4Valid = 1,    /* Qualifies on L4 valid. */
    140     bcmFlexDigestQualifyMyStation1Hit = 2, /* Qualifies on my station 1 hit. */
    141     bcmFlexDigestQualifyTunnelProcessingResults1 = 3, /* Qualifies on tunnel processing
    142                                            results 1. */
    143     bcmFlexDigestQualifyTunnelProcessingResultsRaw = 4, /* Qualifies on tunnel processing
    144                                            results raw. */
    145     bcmFlexDigestQualifyFlexHve2ResultSet1 = 5, /* Qualifies on flex HVE2 result set 1. */
    146     bcmFlexDigestQualifyFixedHve2ResultSet0 = 6, /* Qualifies on fixed HVE2 result Set 0. */
    147     bcmFlexDigestQualifyFlexHve1ResultSet1 = 7, /* Qualifies on flex HVE1 result set 1. */
    148     bcmFlexDigestQualifyFixedHve1ResultSet0 = 8, /* Qualifies on fixed HVE1 result Set 0. */
    149     bcmFlexDigestQualifyL2IifFlexDigestCtrlIdB = 9, /* Qualifies on l2 iif flex digest ctrl
    150                                            id B. */
    151     bcmFlexDigestQualifyL2IifFlexDigestCtrlIdA = 10, /* Qualifies on l2 iif flex digest ctrl
    152                                            id A. */
    153     bcmFlexDigestQualifyProtocolPktOpaqueCtrlId = 11, /* Qualifies on protocol pkt opaque ctrl
    154                                            id. */
    155     bcmFlexDigestQualifyVfiOpaqueCtrlId = 12, /* Qualifies on vfi opaque ctrl id. */
    156     bcmFlexDigestQualifySvpOpaqueCtrlId = 13, /* Qualifies on svp opaque ctrl id */
    157     bcmFlexDigestQualifyL3IifOpaqueCtrlId = 14, /* Qualifies on l3 iif opaque ctrl id. */
    158     bcmFlexDigestQualifyL2IifOpaqueCtrlId = 15, /* Qualifies on l2 iif opaque ctrl id. */
    159     bcmFlexDigestQualifyCount = 16      /* Always last. Not a usable value. */
    160 } bcm_flexdigest_qualify_t;
    161 
    162 #define BCM_FLEXDIGEST_QUALIFY_STRINGS \
    163 { \
    164     "MatchId", \
    165     "L4Valid", \
    166     "MyStation1Hit", \
    167     "TunnelProcessingResults1", \
    168     "TunnelProcessingResultsRaw", \
    169     "FlexHve2ResultSet1", \
    170     "FixedHve2ResultSet0", \
    171     "FlexHve1ResultSet1", \
    172     "FixedHve1ResultSet0", \
    173     "L2IifFlexDigestCtrlIdB", \
    174     "L2IifFlexDigestCtrlIdA", \
    175     "ProtocolPktOpaqueCtrlId", \
    176     "VfiOpaqueCtrlId", \
    177     "SvpOpaqueCtrlId", \
    178     "L3IifOpaqueCtrlId", \
    179     "L2IifOpaqueCtrlId"  \
    180 }
    181 
    182 /* 
    183  * The maximum value of Flex Digest qualifiers.
    184  * 
    185  * Use this definition to indicate the maximum value of qualifiers. It is
    186  * used to .
    187  */
    188 #define BCM_FLEXDIGEST_QUALIFY_MAX  (bcmFlexDigestQualifyCount) /* Must be >=
    189                                                   bcmFlexDigestQualifyCount. */
    190 
    191 /* 
    192  * List of flex digest matches.
    193  * 
    194  * flex digest lookup matching criteria are associated into logical match
    195  * identifier, which are used to be qualified in flex digest lookup
    196  * group.
    197  */
    198 typedef enum bcm_flexdigest_match_e {
    199     bcmFlexDigestMatchSysHdrLoopBack = 0, /* Zone0: System Header: Loopback. */
    200     bcmFlexDigestMatchOuterL2HdrVntag = 1, /* Zone1: Outer L2 Header: Vntag. */
    201     bcmFlexDigestMatchOuterL2HdrSnapOrLlc = 2, /* Zone1: Outer L2 Header: Snap or LLC. */
    202     bcmFlexDigestMatchOuterL2HdrOtag = 3, /* Zone1: Outer L2 Header: Otag. */
    203     bcmFlexDigestMatchOuterL2HdrL2 = 4, /* Zone1: Outer L2 Header: L2. */
    204     bcmFlexDigestMatchOuterL2HdrItag = 5, /* Zone1: Outer L2 Header: Itag. */
    205     bcmFlexDigestMatchOuterL2HdrHg3Ext0 = 6, /* Zone1: Outer L2 Header: Highg3 ext 0. */
    206     bcmFlexDigestMatchOuterL2HdrHg3Base = 7, /* Zone1: Outer L2 Header: Highg3 base. */
    207     bcmFlexDigestMatchOuterL2HdrEtag = 8, /* Zone1: Outer L2 Header: Etag. */
    208     bcmFlexDigestMatchOuterL3L4HdrVxlan = 9, /* Zone2: Outer L3 L4 Header: Vxlan. */
    209     bcmFlexDigestMatchOuterL3L4HdrUnknownL5 = 10, /* Zone2: Outer L3 L4 Header: UnknownL5. */
    210     bcmFlexDigestMatchOuterL3L4HdrUnknownL4 = 11, /* Zone2: Outer L3 L4 Header: UnknownL4. */
    211     bcmFlexDigestMatchOuterL3L4HdrUnknownL3 = 12, /* Zone2: Outer L3 L4 Header: UnknownL3. */
    212     bcmFlexDigestMatchOuterL3L4HdrUdp = 13, /* Zone2: Outer L3 L4 Header: Udp. */
    213     bcmFlexDigestMatchOuterL3L4HdrTcpLast16Bytes = 14, /* Zone2: Outer L3 L4 Header:
    214                                            TcpLast16Bytes. */
    215     bcmFlexDigestMatchOuterL3L4HdrTcpFirst4Bytes = 15, /* Zone2: Outer L3 L4 Header:
    216                                            TcpFirst4Bytes. */
    217     bcmFlexDigestMatchOuterL3L4HdrRarp = 16, /* Zone2: Outer L3 L4 Header: Rarp. */
    218     bcmFlexDigestMatchOuterL3L4HdrP1588 = 17, /* Zone2: Outer L3 L4 Header: P1588. */
    219     bcmFlexDigestMatchOuterL3L4HdrMplsCw = 18, /* Zone2: Outer L3 L4 Header: MplsCw. */
    220     bcmFlexDigestMatchOuterL3L4HdrMplsAch = 19, /* Zone2: Outer L3 L4 Header: MplsAch. */
    221     bcmFlexDigestMatchOuterL3L4HdrMpls6 = 20, /* Zone2: Outer L3 L4 Header: Mpls6. */
    222     bcmFlexDigestMatchOuterL3L4HdrMpls5 = 21, /* Zone2: Outer L3 L4 Header: Mpls5. */
    223     bcmFlexDigestMatchOuterL3L4HdrMpls4 = 22, /* Zone2: Outer L3 L4 Header: Mpls4. */
    224     bcmFlexDigestMatchOuterL3L4HdrMpls3 = 23, /* Zone2: Outer L3 L4 Header: Mpls3. */
    225     bcmFlexDigestMatchOuterL3L4HdrMpls2 = 24, /* Zone2: Outer L3 L4 Header: Mpls2. */
    226     bcmFlexDigestMatchOuterL3L4HdrMpls1 = 25, /* Zone2: Outer L3 L4 Header: Mpls1. */
    227     bcmFlexDigestMatchOuterL3L4HdrMpls0 = 26, /* Zone2: Outer L3 L4 Header: Mpls0. */
    228     bcmFlexDigestMatchOuterL3L4HdrMacInMac = 27, /* Zone2: Outer L3 L4 Header: MacInMac. */
    229     bcmFlexDigestMatchOuterL3L4HdrIpv6 = 28, /* Zone2: Outer L3 L4 Header: Ipv6. */
    230     bcmFlexDigestMatchOuterL3L4HdrIpv4 = 29, /* Zone2: Outer L3 L4 Header: Ipv4. */
    231     bcmFlexDigestMatchOuterL3L4HdrIgmp = 30, /* Zone2: Outer L3 L4 Header: Igmp. */
    232     bcmFlexDigestMatchOuterL3L4HdrIcmp = 31, /* Zone2: Outer L3 L4 Header: Icmp. */
    233     bcmFlexDigestMatchOuterL3L4HdrGreSeq = 32, /* Zone2: Outer L3 L4 Header: GreSeq. */
    234     bcmFlexDigestMatchOuterL3L4HdrGreRout = 33, /* Zone2: Outer L3 L4 Header: GreRout. */
    235     bcmFlexDigestMatchOuterL3L4HdrGreKey = 34, /* Zone2: Outer L3 L4 Header: GreKey. */
    236     bcmFlexDigestMatchOuterL3L4HdrGreChksum = 35, /* Zone2: Outer L3 L4 Header: GreChksum. */
    237     bcmFlexDigestMatchOuterL3L4HdrGre = 36, /* Zone2: Outer L3 L4 Header: Gre. */
    238     bcmFlexDigestMatchOuterL3L4HdrGpe = 37, /* Zone2: Outer L3 L4 Header: Gpe. */
    239     bcmFlexDigestMatchOuterL3L4HdrFragExt2 = 38, /* Zone2: Outer L3 L4 Header: FragExt2. */
    240     bcmFlexDigestMatchOuterL3L4HdrFragExt1 = 39, /* Zone2: Outer L3 L4 Header: FragExt1. */
    241     bcmFlexDigestMatchOuterL3L4HdrEtherType = 40, /* Zone2: Outer L3 L4 Header: EtherType. */
    242     bcmFlexDigestMatchOuterL3L4HdrEspExt = 41, /* Zone2: Outer L3 L4 Header: EspExt. */
    243     bcmFlexDigestMatchOuterL3L4HdrBfd = 42, /* Zone2: Outer L3 L4 Header: Bfd. */
    244     bcmFlexDigestMatchOuterL3L4HdrAuthExt2 = 43, /* Zone2: Outer L3 L4 Header: AuthExt2. */
    245     bcmFlexDigestMatchOuterL3L4HdrAuthExt1 = 44, /* Zone2: Outer L3 L4 Header: AuthExt1. */
    246     bcmFlexDigestMatchOuterL3L4HdrArp = 45, /* Zone2: Outer L3 L4 Header: Arp. */
    247     bcmFlexDigestMatchOuterL3L4HdrIfaMetadata = 46, /* Zone2: Outer L3 L4 Header: IFA
    248                                            metadata. */
    249     bcmFlexDigestMatchInnerL2HdrVntag = 47, /* Zone3: Inner L2 Header: Vntag. */
    250     bcmFlexDigestMatchInnerL2HdrSnapOrLlc = 48, /* Zone3: Inner L2 Header: Snap or LLC. */
    251     bcmFlexDigestMatchInnerL2HdrOtag = 49, /* Zone3: Inner L2 Header: Otag. */
    252     bcmFlexDigestMatchInnerL2HdrL2 = 50, /* Zone3: Inner L2 Header: L2. */
    253     bcmFlexDigestMatchInnerL2HdrItag = 51, /* Zone3: Inner L2 Header: Itag. */
    254     bcmFlexDigestMatchInnerL2HdrEtag = 52, /* Zone3: Inner L2 Header: Etag. */
    255     bcmFlexDigestMatchInnerL3L4HdrUnknownL5 = 53, /* Zone4: Inner L3 L4 Header: UnknownL5. */
    256     bcmFlexDigestMatchInnerL3L4HdrUnknownL4 = 54, /* Zone4: Inner L3 L4 Header: UnknownL4. */
    257     bcmFlexDigestMatchInnerL3L4HdrUnknownL3 = 55, /* Zone4: Inner L3 L4 Header: UnknownL3. */
    258     bcmFlexDigestMatchInnerL3L4HdrUdp = 56, /* Zone4: Inner L3 L4 Header: Udp. */
    259     bcmFlexDigestMatchInnerL3L4HdrTcpLast16Bytes = 57, /* Zone4: Inner L3 L4 Header:
    260                                            TcpLast16Bytes. */
    261     bcmFlexDigestMatchInnerL3L4HdrTcpFirst4Bytes = 58, /* Zone4: Inner L3 L4 Header:
    262                                            TcpFirst4Bytes. */
    263     bcmFlexDigestMatchInnerL3L4HdrRarp = 59, /* Zone4: Inner L3 L4 Header: Rarp. */
    264     bcmFlexDigestMatchInnerL3L4HdrP1588 = 60, /* Zone4: Inner L3 L4 Header: P1588. */
    265     bcmFlexDigestMatchInnerL3L4HdrIpv6 = 61, /* Zone4: Inner L3 L4 Header: Ipv6. */
    266     bcmFlexDigestMatchInnerL3L4HdrIpv4 = 62, /* Zone4: Inner L3 L4 Header: Ipv4. */
    267     bcmFlexDigestMatchInnerL3L4HdrIgmp = 63, /* Zone4: Inner L3 L4 Header: Igmp. */
    268     bcmFlexDigestMatchInnerL3L4HdrIcmp = 64, /* Zone4: Inner L3 L4 Header: Icmp. */
    269     bcmFlexDigestMatchInnerL3L4HdrFragExt2 = 65, /* Zone4: Inner L3 L4 Header: FragExt2. */
    270     bcmFlexDigestMatchInnerL3L4HdrFragExt1 = 66, /* Zone4: Inner L3 L4 Header: FragExt1. */
    271     bcmFlexDigestMatchInnerL3L4HdrEtherType = 67, /* Zone4: Inner L3 L4 Header: EtherType. */
    272     bcmFlexDigestMatchInnerL3L4HdrEspExt = 68, /* Zone4: Inner L3 L4 Header: EspExt. */
    273     bcmFlexDigestMatchInnerL3L4HdrBfd = 69, /* Zone4: Inner L3 L4 Header: Bfd. */
    274     bcmFlexDigestMatchInnerL3L4HdrAuthExt2 = 70, /* Zone4: Inner L3 L4 Header: AuthExt2.. */
    275     bcmFlexDigestMatchInnerL3L4HdrAuthExt1 = 71, /* Zone4: Inner L3 L4 Header: AuthExt1. */
    276     bcmFlexDigestMatchInnerL3L4HdrArp = 72, /* Zone4: Inner L3 L4 Header: Arp. */
    277     bcmFlexDigestMatchSysHdrEpNih = 73, /* Zone0: System Header: EP NIH. */
    278     bcmFlexDigestMatchOuterL2HdrSvtag = 74, /* Zone1: Outer L2 Header: SVTAG. */
    279     bcmFlexDigestMatchOuterL3L4HdrIfaHeader = 75, /* Zone2: Outer L3 L4 Header: IFA
    280                                            header. */
    281     bcmFlexDigestMatchCount = 76        /* Always last. Not a usable value. */
    282 } bcm_flexdigest_match_t;
    283 
    284 #define BCM_FLEXDIGEST_MATCH_STRINGS \
    285 { \
    286     "SysHdrLoopBack", \
    287     "OuterL2HdrVntag", \
    288     "OuterL2HdrSnapOrLlc", \
    289     "OuterL2HdrOtag", \
    290     "OuterL2HdrL2", \
    291     "OuterL2HdrItag", \
    292     "OuterL2HdrHg3Ext0", \
    293     "OuterL2HdrHg3Base", \
    294     "OuterL2HdrEtag", \
    295     "OuterL3L4HdrVxlan", \
    296     "OuterL3L4HdrUnknownL5", \
    297     "OuterL3L4HdrUnknownL4", \
    298     "OuterL3L4HdrUnknownL3", \
    299     "OuterL3L4HdrUdp", \
    300     "OuterL3L4HdrTcpLast16Bytes", \
    301     "OuterL3L4HdrTcpFirst4Bytes", \
    302     "OuterL3L4HdrRarp", \
    303     "OuterL3L4HdrP1588", \
    304     "OuterL3L4HdrMplsCw", \
    305     "OuterL3L4HdrMplsAch", \
    306     "OuterL3L4HdrMpls6", \
    307     "OuterL3L4HdrMpls5", \
    308     "OuterL3L4HdrMpls4", \
    309     "OuterL3L4HdrMpls3", \
    310     "OuterL3L4HdrMpls2", \
    311     "OuterL3L4HdrMpls1", \
    312     "OuterL3L4HdrMpls0", \
    313     "OuterL3L4HdrMacInMac", \
    314     "OuterL3L4HdrIpv6", \
    315     "OuterL3L4HdrIpv4", \
    316     "OuterL3L4HdrIgmp", \
    317     "OuterL3L4HdrIcmp", \
    318     "OuterL3L4HdrGreSeq", \
    319     "OuterL3L4HdrGreRout", \
    320     "OuterL3L4HdrGreKey", \
    321     "OuterL3L4HdrGreChksum", \
    322     "OuterL3L4HdrGre", \
    323     "OuterL3L4HdrGpe", \
    324     "OuterL3L4HdrFragExt2", \
    325     "OuterL3L4HdrFragExt1", \
    326     "OuterL3L4HdrEtherType", \
    327     "OuterL3L4HdrEspExt", \
    328     "OuterL3L4HdrBfd", \
    329     "OuterL3L4HdrAuthExt2", \
    330     "OuterL3L4HdrAuthExt1", \
    331     "OuterL3L4HdrArp", \
    332     "OuterL3L4HdrIfaMetadata", \
    333     "InnerL2HdrVntag", \
    334     "InnerL2HdrSnapOrLlc", \
    335     "InnerL2HdrOtag", \
    336     "InnerL2HdrL2", \
    337     "InnerL2HdrItag", \
    338     "InnerL2HdrEtag", \
    339     "InnerL3L4HdrUnknownL5", \
    340     "InnerL3L4HdrUnknownL4", \
    341     "InnerL3L4HdrUnknownL3", \
    342     "InnerL3L4HdrUdp", \
    343     "InnerL3L4HdrTcpLast16Bytes", \
    344     "InnerL3L4HdrTcpFirst4Bytes", \
    345     "InnerL3L4HdrRarp", \
    346     "InnerL3L4HdrP1588", \
    347     "InnerL3L4HdrIpv6", \
    348     "InnerL3L4HdrIpv4", \
    349     "InnerL3L4HdrIgmp", \
    350     "InnerL3L4HdrIcmp", \
    351     "InnerL3L4HdrFragExt2", \
    352     "InnerL3L4HdrFragExt1", \
    353     "InnerL3L4HdrEtherType", \
    354     "InnerL3L4HdrEspExt", \
    355     "InnerL3L4HdrBfd", \
    356     "InnerL3L4HdrAuthExt2", \
    357     "InnerL3L4HdrAuthExt1", \
    358     "InnerL3L4HdrArp", \
    359     "SysHdrEpNih", \
    360     "OuterL2HdrSvtag", \
    361     "OuterL3L4HdrIfaHeader"  \
    362 }
    363 
    364 /* 
    365  * List of flex digest actions.
    366  * 
    367  * flex digest policy table actions.
    368  */
    369 typedef enum bcm_flexdigest_action_e {
    370     bcmFlexDigestActionExtractBinSetACmds0 = 0, /* Extract bin set A commands for bin 0. */
    371     bcmFlexDigestActionExtractBinSetACmds1 = 1, /* Extract bin set A commands for bin 1. */
    372     bcmFlexDigestActionExtractBinSetACmds2 = 2, /* Extract bin set A commands for bin 2. */
    373     bcmFlexDigestActionExtractBinSetACmds3 = 3, /* Extract bin set A commands for bin 3. */
    374     bcmFlexDigestActionExtractBinSetACmds4 = 4, /* Extract bin set A commands for bin 4. */
    375     bcmFlexDigestActionExtractBinSetACmds5 = 5, /* Extract bin set A commands for bin 5. */
    376     bcmFlexDigestActionExtractBinSetACmds6 = 6, /* Extract bin set A commands for bin 6. */
    377     bcmFlexDigestActionExtractBinSetACmds7 = 7, /* Extract bin set A commands for bin 7. */
    378     bcmFlexDigestActionExtractBinSetACmds8 = 8, /* Extract bin set A commands for bin 8. */
    379     bcmFlexDigestActionExtractBinSetACmds9 = 9, /* Extract bin set A commands for bin 9. */
    380     bcmFlexDigestActionExtractBinSetACmds10 = 10, /* Extract bin set A commands for bin
    381                                            10. */
    382     bcmFlexDigestActionExtractBinSetACmds11 = 11, /* Extract bin set A commands for bin
    383                                            11. */
    384     bcmFlexDigestActionExtractBinSetACmds12 = 12, /* Extract bin set A commands for bin
    385                                            12. */
    386     bcmFlexDigestActionExtractBinSetACmds13 = 13, /* Extract bin set A commands for bin
    387                                            13. */
    388     bcmFlexDigestActionExtractBinSetACmds14 = 14, /* Extract bin set A commands for bin
    389                                            14. */
    390     bcmFlexDigestActionExtractBinSetACmds15 = 15, /* Extract bin set A commands for bin
    391                                            15. */
    392     bcmFlexDigestActionExtractBinSetBCmds0 = 16, /* Extract bin set B commands for bin 0. */
    393     bcmFlexDigestActionExtractBinSetBCmds1 = 17, /* Extract bin set B commands for bin 1. */
    394     bcmFlexDigestActionExtractBinSetBCmds2 = 18, /* Extract bin set B commands for bin 2. */
    395     bcmFlexDigestActionExtractBinSetBCmds3 = 19, /* Extract bin set B commands for bin 3. */
    396     bcmFlexDigestActionExtractBinSetBCmds4 = 20, /* Extract bin set B commands for bin 4. */
    397     bcmFlexDigestActionExtractBinSetBCmds5 = 21, /* Extract bin set B commands for bin 5. */
    398     bcmFlexDigestActionExtractBinSetBCmds6 = 22, /* Extract bin set B commands for bin 6. */
    399     bcmFlexDigestActionExtractBinSetBCmds7 = 23, /* Extract bin set B commands for bin 7. */
    400     bcmFlexDigestActionExtractBinSetBCmds8 = 24, /* Extract bin set B commands for bin 8. */
    401     bcmFlexDigestActionExtractBinSetBCmds9 = 25, /* Extract bin set B commands for bin 9. */
    402     bcmFlexDigestActionExtractBinSetBCmds10 = 26, /* Extract bin set B commands for bin
    403                                            10. */
    404     bcmFlexDigestActionExtractBinSetBCmds11 = 27, /* Extract bin set B commands for bin
    405                                            11. */
    406     bcmFlexDigestActionExtractBinSetBCmds12 = 28, /* Extract bin set B commands for bin
    407                                            12. */
    408     bcmFlexDigestActionExtractBinSetBCmds13 = 29, /* Extract bin set B commands for bin
    409                                            13. */
    410     bcmFlexDigestActionExtractBinSetBCmds14 = 30, /* Extract bin set B commands for bin
    411                                            14. */
    412     bcmFlexDigestActionExtractBinSetBCmds15 = 31, /* Extract bin set B commands for bin
    413                                            15. */
    414     bcmFlexDigestActionExtractBinSetCCmds0 = 32, /* Extract bin set C commands for bin 0. */
    415     bcmFlexDigestActionExtractBinSetCCmds1 = 33, /* Extract bin set C commands for bin 1. */
    416     bcmFlexDigestActionExtractBinSetCCmds2 = 34, /* Extract bin set C commands for bin 2. */
    417     bcmFlexDigestActionExtractBinSetCCmds3 = 35, /* Extract bin set C commands for bin 3. */
    418     bcmFlexDigestActionExtractBinSetCCmds4 = 36, /* Extract bin set C commands for bin 4. */
    419     bcmFlexDigestActionExtractBinSetCCmds5 = 37, /* Extract bin set C commands for bin 5. */
    420     bcmFlexDigestActionExtractBinSetCCmds6 = 38, /* Extract bin set C commands for bin 6. */
    421     bcmFlexDigestActionExtractBinSetCCmds7 = 39, /* Extract bin set C commands for bin 7. */
    422     bcmFlexDigestActionExtractBinSetCCmds8 = 40, /* Extract bin set C commands for bin 8. */
    423     bcmFlexDigestActionExtractBinSetCCmds9 = 41, /* Extract bin set C commands for bin 9. */
    424     bcmFlexDigestActionExtractBinSetCCmds10 = 42, /* Extract bin set C commands for bin
    425                                            10. */
    426     bcmFlexDigestActionExtractBinSetCCmds11 = 43, /* Extract bin set C commands for bin
    427                                            11. */
    428     bcmFlexDigestActionExtractBinSetCCmds12 = 44, /* Extract bin set C commands for bin
    429                                            12. */
    430     bcmFlexDigestActionExtractBinSetCCmds13 = 45, /* Extract bin set C commands for bin
    431                                            13. */
    432     bcmFlexDigestActionExtractBinSetCCmds14 = 46, /* Extract bin set C commands for bin
    433                                            14. */
    434     bcmFlexDigestActionExtractBinSetCCmds15 = 47, /* Extract bin set C commands for bin
    435                                            15. */
    436     bcmFlexDigestActionCount = 48       /* Always last. Not a usable value. */
    437 } bcm_flexdigest_action_t;
    438 
    439 #define BCM_FLEXDIGEST_ACTION_STRINGS \
    440 { \
    441     "ExtractBinSetACmds0", \
    442     "ExtractBinSetACmds1", \
    443     "ExtractBinSetACmds2", \
    444     "ExtractBinSetACmds3", \
    445     "ExtractBinSetACmds4", \
    446     "ExtractBinSetACmds5", \
    447     "ExtractBinSetACmds6", \
    448     "ExtractBinSetACmds7", \
    449     "ExtractBinSetACmds8", \
    450     "ExtractBinSetACmds9", \
    451     "ExtractBinSetACmds10", \
    452     "ExtractBinSetACmds11", \
    453     "ExtractBinSetACmds12", \
    454     "ExtractBinSetACmds13", \
    455     "ExtractBinSetACmds14", \
    456     "ExtractBinSetACmds15", \
    457     "ExtractBinSetBCmds0", \
    458     "ExtractBinSetBCmds1", \
    459     "ExtractBinSetBCmds2", \
    460     "ExtractBinSetBCmds3", \
    461     "ExtractBinSetBCmds4", \
    462     "ExtractBinSetBCmds5", \
    463     "ExtractBinSetBCmds6", \
    464     "ExtractBinSetBCmds7", \
    465     "ExtractBinSetBCmds8", \
    466     "ExtractBinSetBCmds9", \
    467     "ExtractBinSetBCmds10", \
    468     "ExtractBinSetBCmds11", \
    469     "ExtractBinSetBCmds12", \
    470     "ExtractBinSetBCmds13", \
    471     "ExtractBinSetBCmds14", \
    472     "ExtractBinSetBCmds15", \
    473     "ExtractBinSetCCmds0", \
    474     "ExtractBinSetCCmds1", \
    475     "ExtractBinSetCCmds2", \
    476     "ExtractBinSetCCmds3", \
    477     "ExtractBinSetCCmds4", \
    478     "ExtractBinSetCCmds5", \
    479     "ExtractBinSetCCmds6", \
    480     "ExtractBinSetCCmds7", \
    481     "ExtractBinSetCCmds8", \
    482     "ExtractBinSetCCmds9", \
    483     "ExtractBinSetCCmds10", \
    484     "ExtractBinSetCCmds11", \
    485     "ExtractBinSetCCmds12", \
    486     "ExtractBinSetCCmds13", \
    487     "ExtractBinSetCCmds14", \
    488     "ExtractBinSetCCmds15"  \
    489 }
    490 
    491 /* Flex digest Policy table Command Field Selector. */
    492 #define BCM_FLEXDIGEST_FIELD_OUTER_MACSA_0_15 1          /* The outer MACSA 0-15
    493                                                           bits. */
    494 #define BCM_FLEXDIGEST_FIELD_OUTER_MACSA_16_31 2          /* The outer MACSA 16-31
    495                                                           bits. */
    496 #define BCM_FLEXDIGEST_FIELD_OUTER_MACSA_32_47 3          /* The outer MACSA 32-47
    497                                                           bits. */
    498 #define BCM_FLEXDIGEST_FIELD_OUTER_MACDA_0_15 4          /* The outer MACDA 0-15
    499                                                           bits. */
    500 #define BCM_FLEXDIGEST_FIELD_OUTER_MACDA_16_31 5          /* The outer MACDA 16-31
    501                                                           bits. */
    502 #define BCM_FLEXDIGEST_FIELD_OUTER_MACDA_32_47 6          /* The outer MACDA 32-47
    503                                                           bits. */
    504 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_SIP_0_15 7          /* The outer IP HDR SIP
    505                                                           0-15 bits. */
    506 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_SIP_16_31 8          /* The outer IP HDR SIP
    507                                                           16-31 bits. */
    508 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_SIP_32_47 9          /* The outer IP HDR SIP
    509                                                           32-47 bits. */
    510 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_SIP_48_63 10         /* The outer IP HDR SIP
    511                                                           48-63 bits. */
    512 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_SIP_64_79 11         /* The outer IP HDR SIP
    513                                                           64-79 bits. */
    514 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_SIP_80_95 12         /* The outer IP HDR SIP
    515                                                           80-95 bits. */
    516 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_SIP_96_111 13         /* The outer IP HDR SIP
    517                                                           96-111 bits. */
    518 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_SIP_112_127 14         /* The outer IP HDR SIP
    519                                                           112-127 bits. */
    520 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_DIP_0_15 15         /* The outer IP HDR DIP
    521                                                           0-15 bits. */
    522 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_DIP_16_31 16         /* The outer IP HDR DIP
    523                                                           16-31 bits. */
    524 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_DIP_32_47 17         /* The outer IP HDR DIP
    525                                                           32-47 bits. */
    526 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_DIP_48_63 18         /* The outer IP HDR DIP
    527                                                           48-63 bits. */
    528 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_DIP_64_79 19         /* The outer IP HDR DIP
    529                                                           64-79 bits. */
    530 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_DIP_80_95 20         /* The outer IP HDR DIP
    531                                                           80-95 bits. */
    532 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_DIP_96_111 21         /* The outer IP HDR DIP
    533                                                           96-111 bits. */
    534 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_DIP_112_127 22         /* The outer IP HDR DIP
    535                                                           112-127 bits. */
    536 #define BCM_FLEXDIGEST_FIELD_OUTER_ITAG_0_15 23         /* The outer ITAG 0-15
    537                                                           bits. */
    538 #define BCM_FLEXDIGEST_FIELD_OUTER_ITAG_16_31 24         /* The outer ITAG 16-31
    539                                                           bits. */
    540 #define BCM_FLEXDIGEST_FIELD_OUTER_VXLAN_VN_ID_RESERVED_2_0_15 25         /* The outer VXLAN VN ID
    541                                                           RESERVED 2 0-15 bits. */
    542 #define BCM_FLEXDIGEST_FIELD_OUTER_VXLAN_VN_ID_RESERVED_2_16_31 26         /* The outer VXLAN VN ID
    543                                                           RESERVED 2 16-31 bits. */
    544 #define BCM_FLEXDIGEST_FIELD_OUTER_OTAG_0_15 27         /* The outer OTAG 0-15
    545                                                           bits. */
    546 #define BCM_FLEXDIGEST_FIELD_OUTER_OTAG_16_31 28         /* The outer OTAG 16-31
    547                                                           bits. */
    548 #define BCM_FLEXDIGEST_FIELD_OUTER_L4_DST_PORT 29         /* The outer L4 DST PORT. */
    549 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_PROTOCOL 30         /* The outer IP HDR
    550                                                           PROTOCOL. */
    551 #define BCM_FLEXDIGEST_FIELD_OUTER_ETHERTYPE 31         /* The outer ETHERTYPE. */
    552 #define BCM_FLEXDIGEST_FIELD_OUTER_L4_SRC_PORT 32         /* The outer L4 SRC PORT. */
    553 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_FIRST_TWO_BYTES 33         /* The outer IP HDR FIRST
    554                                                           TWO BYTES. */
    555 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_FLOW_LABEL 34         /* The outer IP HDR FLOW
    556                                                           LABEL. */
    557 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_EXT_HDR1_PROTOCOL 35         /* The outer IP EXT HDR1
    558                                                           PROTOCOL. */
    559 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_HDR_TTL 36         /* The outer IP HDR TTL. */
    560 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_EXT_HDR2_PROTOCOL 37         /* The outer IP EXT HDR2
    561                                                           PROTOCOL. */
    562 #define BCM_FLEXDIGEST_FIELD_OUTER_L5_BYTES_4_7_0_15 38         /* The outer L5 BYTES 4
    563                                                           to 7 0-15 bits. */
    564 #define BCM_FLEXDIGEST_FIELD_OUTER_L5_BYTES_4_7_16_31 39         /* The outer L5 BYTES 4
    565                                                           to 7 16-31 bits. */
    566 #define BCM_FLEXDIGEST_FIELD_OUTER_IP_LAST_PROTOCOL 40         /* The outer IP last
    567                                                           protocol. */
    568 #define BCM_FLEXDIGEST_FIELD_INNER_MACSA_0_15 41         /* The inner MACSA 0-15
    569                                                           bits. */
    570 #define BCM_FLEXDIGEST_FIELD_INNER_MACSA_16_31 42         /* The inner MACSA 16-31
    571                                                           bits. */
    572 #define BCM_FLEXDIGEST_FIELD_INNER_MACSA_32_47 43         /* The inner MACSA 32-47
    573                                                           bits. */
    574 #define BCM_FLEXDIGEST_FIELD_INNER_MACDA_0_15 44         /* The inner MACDA 0-15
    575                                                           bits. */
    576 #define BCM_FLEXDIGEST_FIELD_INNER_MACDA_16_31 45         /* The inner MACDA 16-31
    577                                                           bits. */
    578 #define BCM_FLEXDIGEST_FIELD_INNER_MACDA_32_47 46         /* The inner MACDA 32-47
    579                                                           bits. */
    580 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_SIP_0_15 47         /* The inner IP HDR SIP
    581                                                           0-15 bits. */
    582 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_SIP_16_31 48         /* The inner IP HDR SIP
    583                                                           16-31 bits. */
    584 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_SIP_32_47 49         /* The inner IP HDR SIP
    585                                                           32-47 bits. */
    586 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_SIP_48_63 50         /* The inner IP HDR SIP
    587                                                           48-63 bits. */
    588 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_SIP_64_79 51         /* The inner IP HDR SIP
    589                                                           64-79 bits. */
    590 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_SIP_80_95 52         /* The inner IP HDR SIP
    591                                                           80-95 bits. */
    592 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_SIP_96_111 53         /* The inner IP HDR SIP
    593                                                           96-111 bits. */
    594 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_SIP_112_127 54         /* The inner IP HDR SIP
    595                                                           112-127 bits. */
    596 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_DIP_0_15 55         /* The inner IP HDR DIP
    597                                                           0-15 bits. */
    598 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_DIP_16_31 56         /* The inner IP HDR DIP
    599                                                           16-31 bits. */
    600 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_DIP_32_47 57         /* The inner IP HDR DIP
    601                                                           32-47 bits. */
    602 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_DIP_48_63 58         /* The inner IP HDR DIP
    603                                                           48-63 bits. */
    604 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_DIP_64_79 59         /* The inner IP HDR DIP
    605                                                           64-79 bits. */
    606 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_DIP_80_95 60         /* The inner IP HDR DIP
    607                                                           80-95 bits. */
    608 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_DIP_96_111 61         /* The inner IP HDR DIP
    609                                                           96-111 bits. */
    610 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_DIP_112_127 62         /* The inner IP HDR DIP
    611                                                           112-127 bits. */
    612 #define BCM_FLEXDIGEST_FIELD_INNER_ITAG_0_15 63         /* The inner ITAG 0-15
    613                                                           bits. */
    614 #define BCM_FLEXDIGEST_FIELD_INNER_ITAG_16_31 64         /* The inner ITAG 16-31
    615                                                           bits. */
    616 #define BCM_FLEXDIGEST_FIELD_INNER_OTAG_0_15 65         /* The inner OTAG 0-15
    617                                                           bits. */
    618 #define BCM_FLEXDIGEST_FIELD_INNER_OTAG_16_31 66         /* The inner OTAG 16-31
    619                                                           bits. */
    620 #define BCM_FLEXDIGEST_FIELD_INNER_L4_DST_PORT 67         /* The inner L4 DST PORT. */
    621 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_PROTOCOL 68         /* The inner IP HDR
    622                                                           PROTOCOL. */
    623 #define BCM_FLEXDIGEST_FIELD_INNER_ETHERTYPE 69         /* The inner ETHERTYPE. */
    624 #define BCM_FLEXDIGEST_FIELD_INNER_L4_SRC_PORT 70         /* The inner L4 SRC PORT. */
    625 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_FIRST_TWO_BYTES 71         /* The inner IP HDR FIRST
    626                                                           TWO BYTES. */
    627 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_FLOW_LABEL 72         /* The inner IP HDR FLOW
    628                                                           LABEL. */
    629 #define BCM_FLEXDIGEST_FIELD_INNER_IP_EXT_HDR1_PROTOCOL 73         /* The inner IP EXT HDR1
    630                                                           PROTOCOL. */
    631 #define BCM_FLEXDIGEST_FIELD_INNER_IP_HDR_TTL 74         /* The inner IP HDR TTL. */
    632 #define BCM_FLEXDIGEST_FIELD_INNER_IP_EXT_HDR2_PROTOCOL 75         /* The inner IP EXT HDR2
    633                                                           PROTOCOL. */
    634 #define BCM_FLEXDIGEST_FIELD_INNER_L5_BYTES_4_7_0_15 76         /* The inner L5 BYTES 4
    635                                                           to 7 0-15 bits. */
    636 #define BCM_FLEXDIGEST_FIELD_INNER_L5_BYTES_4_7_16_31 77         /* The inner L5 BYTES 4
    637                                                           to 7 16-31 bits. */
    638 #define BCM_FLEXDIGEST_FIELD_INNER_IP_LAST_PROTOCOL 78         /* The inner IP last
    639                                                           protocol. */
    640 #define BCM_FLEXDIGEST_FIELD_SYSTEM_SOURCE  79         /* The system source. */
    641 #define BCM_FLEXDIGEST_FIELD_INGRESS_PP_PORT 80         /* The ingress pp port. */
    642 #define BCM_FLEXDIGEST_FIELD_L2_IIF         81         /* The L2 IIF. */
    643 #define BCM_FLEXDIGEST_FIELD_L3_IIF         82         /* The L3 IIF. */
    644 #define BCM_FLEXDIGEST_FIELD_SVP            83         /* The SVP. */
    645 #define BCM_FLEXDIGEST_FIELD_VFI            84         /* The VFI. */
    646 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_XOR_SIP_0_15 85         /* The normalized outer
    647                                                           xor SIP 0-15 bits. */
    648 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_XOR_SIP_16_31 86         /* The normalized outer
    649                                                           xor SIP 16-31 bits. */
    650 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_XOR_DIP_0_15 87         /* The normalized outer
    651                                                           xor DIP 0-15 bits. */
    652 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_XOR_DIP_16_31 88         /* The normalized outer
    653                                                           xor DIP 16-31 bits. */
    654 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_XOR_SIP_0_15 89         /* The normalized inner
    655                                                           xor SIP 0-15 bits. */
    656 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_XOR_SIP_16_31 90         /* The normalized inner
    657                                                           xor SIP 16-31 bits. */
    658 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_XOR_DIP_0_15 91         /* The normalized inner
    659                                                           xor DIP 0-15 bits. */
    660 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_XOR_DIP_16_31 92         /* The normalized inner
    661                                                           xor DIP 16-31 bits. */
    662 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_IP_ADDR_XOR_HI_0_15 93         /* The normalized outer
    663                                                           IP addr xor high 0-15
    664                                                           bits. */
    665 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_IP_ADDR_XOR_HI_16_31 94         /* The normalized outer
    666                                                           IP addr xor high 16-31
    667                                                           bits. */
    668 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_IP_ADDR_XOR_LO_0_15 95         /* The normalized outer
    669                                                           IP addr xor low 0-15
    670                                                           bits. */
    671 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_IP_ADDR_XOR_LO_16_31 96         /* The normalized outer
    672                                                           IP addr xor low 16-31
    673                                                           bits. */
    674 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_IP_ADDR_XOR_HI_0_15 97         /* The normalized inner
    675                                                           IP addr xor high 0-15
    676                                                           bits. */
    677 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_IP_ADDR_XOR_HI_16_31 98         /* The normalized inner
    678                                                           IP addr xor high 16-31
    679                                                           bits. */
    680 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_IP_ADDR_XOR_LO_0_15 99         /* The normalized inner
    681                                                           IP addr xor low 0-15
    682                                                           bits. */
    683 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_IP_ADDR_XOR_LO_16_31 100        /* The normalized inner
    684                                                           IP addr xor low 16-31
    685                                                           bits. */
    686 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_IP_ADDR_LSB32_HI_0_15 101        /* The normalized outer
    687                                                           IP addr lsb32 high
    688                                                           0-15 bits. */
    689 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_IP_ADDR_LSB32_HI_16_31 102        /* The normalized outer
    690                                                           IP addr lsb32 high
    691                                                           16-31 bits. */
    692 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_IP_ADDR_LSB32_LO_0_15 103        /* The normalized outer
    693                                                           IP addr lsb32 low 0-15
    694                                                           bits. */
    695 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_IP_ADDR_LSB32_LO_16_31 104        /* The normalized outer
    696                                                           IP addr lsb32 low
    697                                                           16-31 bits. */
    698 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_IP_ADDR_LSB32_HI_0_15 105        /* The normalized inner
    699                                                           IP addr lsb32 high
    700                                                           0-15 bits. */
    701 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_IP_ADDR_LSB32_HI_16_31 106        /* The normalized inner
    702                                                           IP addr lsb32 high
    703                                                           16-31 bits. */
    704 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_IP_ADDR_LSB32_LO_0_15 107        /* The normalized inner
    705                                                           IP addr lsb32 low 0-15
    706                                                           bits. */
    707 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_IP_ADDR_LSB32_LO_16_31 108        /* The normalized inner
    708                                                           IP addr lsb32 low
    709                                                           16-31 bits. */
    710 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_L4_PORT_XOR_HI 109        /* The normalized outer
    711                                                           L4 port xor high. */
    712 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_L4_PORT_XOR_LO 110        /* The normalized outer
    713                                                           L4 port xor low. */
    714 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_L4_PORT_XOR_HI 111        /* The normalized inner
    715                                                           L4 port xor high. */
    716 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_L4_PORT_XOR_LO 112        /* The normalized inner
    717                                                           L4 port xor low. */
    718 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_L4_PORT_LSB32_HI 113        /* The normalized outer
    719                                                           L4 port lsb high. */
    720 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_OUTER_L4_PORT_LSB32_LO 114        /* The normalized outer
    721                                                           L4 port lsb low. */
    722 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_L4_PORT_LSB32_HI 115        /* The normalized inner
    723                                                           L4 port lsb high. */
    724 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_INNER_L4_PORT_LSB32_LO 116        /* The normalized inner
    725                                                           L4 port lsb low. */
    726 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_SEED_A_0_15 117        /* The normalized see A
    727                                                           0-15 bits. */
    728 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_SEED_A_16_31 118        /* The normalized see A
    729                                                           16-31 bits. */
    730 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_SEED_B_0_15 119        /* The normalized see B
    731                                                           0-15 bits. */
    732 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_SEED_B_16_31 120        /* The normalized see B
    733                                                           16-31 bits. */
    734 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_SEED_C_0_15 121        /* The normalized see C
    735                                                           0-15 bits. */
    736 #define BCM_FLEXDIGEST_FIELD_NORMALIZED_SEED_C_16_31 122        /* The normalized see C
    737                                                           16-31 bits. */
    738 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_0 123        /* The outer UDF two
    739                                                           bytes container 0. */
    740 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_1 124        /* The outer UDF two
    741                                                           bytes container 1. */
    742 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_2 125        /* The outer UDF two
    743                                                           bytes container 2. */
    744 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_3 126        /* The outer UDF two
    745                                                           bytes container 3. */
    746 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_4 127        /* The outer UDF two
    747                                                           bytes container 4. */
    748 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_5 128        /* The outer UDF two
    749                                                           bytes container 5. */
    750 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_6 129        /* The outer UDF two
    751                                                           bytes container 6. */
    752 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_7 130        /* The outer UDF two
    753                                                           bytes container 7. */
    754 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_8 131        /* The outer UDF two
    755                                                           bytes container 8. */
    756 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_TWO_BYTE_9 132        /* The outer UDF two
    757                                                           bytes container 9. */
    758 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_ONE_BYTE_0 133        /* The outer UDF one byte
    759                                                           container 0. */
    760 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_ONE_BYTE_1 134        /* The outer UDF one byte
    761                                                           container 1. */
    762 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_ONE_BYTE_2 135        /* The outer UDF one byte
    763                                                           container 2. */
    764 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_ONE_BYTE_3 136        /* The outer UDF one byte
    765                                                           container 3. */
    766 #define BCM_FLEXDIGEST_FIELD_OUTER_UDF_ONE_BYTE_4 137        /* The outer UDF one byte
    767                                                           container 4. */
    768 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_0 138        /* The inner UDF two
    769                                                           bytes container 0. */
    770 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_1 139        /* The inner UDF two
    771                                                           bytes container 1. */
    772 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_2 140        /* The inner UDF two
    773                                                           bytes container 2. */
    774 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_3 141        /* The inner UDF two
    775                                                           bytes container 3. */
    776 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_4 142        /* The inner UDF two
    777                                                           bytes container 4. */
    778 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_5 143        /* The inner UDF two
    779                                                           bytes container 5. */
    780 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_6 144        /* The inner UDF two
    781                                                           bytes container 6. */
    782 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_7 145        /* The inner UDF two
    783                                                           bytes container 7. */
    784 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_8 146        /* The inner UDF two
    785                                                           bytes container 8. */
    786 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_TWO_BYTE_9 147        /* The inner UDF two
    787                                                           bytes container 9. */
    788 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_ONE_BYTE_0 148        /* The inner UDF one byte
    789                                                           container 0. */
    790 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_ONE_BYTE_1 149        /* The inner UDF one byte
    791                                                           container 1. */
    792 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_ONE_BYTE_2 150        /* The inner UDF one byte
    793                                                           container 2. */
    794 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_ONE_BYTE_3 151        /* The inner UDF one byte
    795                                                           container 3. */
    796 #define BCM_FLEXDIGEST_FIELD_INNER_UDF_ONE_BYTE_4 152        /* The inner UDF one byte
    797                                                           container 4. */
    798 
    799 /* Flex digest qset defines the set of fields used for lookup. */
    800 typedef struct bcm_flexdigest_qset_s {
    801     SHR_BITDCL w[_SHR_BITDCLSIZE(BCM_FLEXDIGEST_QUALIFY_MAX)]; 
    802 } bcm_flexdigest_qset_t;
    803 
    804 /* 
    805  * The flex digest qualifier set operations.
    806  * 
    807  * The flex digest qualifiers are collected into qualifier sets (qsets)
    808  * which are used to allocate flex digest groups. The type
    809  * bcm_flexdigest_qset_t is an opaque collection of these requested
    810  * group capabilities.
    811  * 
    812  * The following macros are used to initialize a qualifier set and add,
    813  * remove or test individual qualifier bits in the qualifier set.
    814  */
    815 #define BCM_FLEXDIGEST_QSET_INIT(qset)  \
    816     sal_memset(&(qset), 0, sizeof(bcm_flexdigest_qset_t)) /* Clear a bcm_flexdigest_qset_t. */
    817 #define BCM_FLEXDIGEST_QSET_ADD(qset, q)  \
    818     SHR_BITSET(((qset).w), (q)) /* Add a qualifier into qualifier
    819                                                   set. */
    820 #define BCM_FLEXDIGEST_QSET_REMOVE(qset, q)  \
    821     SHR_BITCLR(((qset).w), (q)) /* Remove a qualifier from
    822                                                   qualifier set. */
    823 #define BCM_FLEXDIGEST_QSET_TEST(qset, q)  \
    824     SHR_BITGET(((qset).w), (q)) /* To test whether a qualifier
    825                                                   exists in qualifier set or
    826                                                   not. */
    827 
    828 /* 
    829  * Group Priority.
    830  * 
    831  * Numerically higher values are higher priority. Each priority value may
    832  * be used only once. BCM_FLEXDIGEST_GROUP_PRIO_ANY can be used to have a
    833  * priority assigned automatically.
    834  */
    835 #define BCM_FLEXDIGEST_GROUP_PRIO_ANY   (-1)       /* To indicate that the
    836                                                       priority is assigned
    837                                                       automatically. */
    838 
    839 /* Initialize the flex digest Qualifier Set structure. */
    840 extern void bcm_flexdigest_qset_t_init(
    841     bcm_flexdigest_qset_t *qset);
    842 
    843 /* Opaque handle to a flex digest group. */
    844 typedef int bcm_flexdigest_group_t;
    845 
    846 /* Opaque handle to a flex digest entry. */
    847 typedef int bcm_flexdigest_entry_t;
    848 
    849 /* Opaque handle to a flex digest logical match identifier. */
    850 typedef uint16 bcm_flexdigest_match_id_t;
    851 
    852 #ifndef BCM_HIDE_DISPATCHABLE
    853 
    854 /* Create a flex digest group. */
    855 extern int bcm_flexdigest_group_create(
    856     int unit, 
    857     bcm_flexdigest_qset_t qset, 
    858     int pri, 
    859     bcm_flexdigest_group_t *group);
    860 
    861 /* Create a flex digest group. */
    862 extern int bcm_flexdigest_group_create_id(
    863     int unit, 
    864     bcm_flexdigest_qset_t qset, 
    865     int pri, 
    866     bcm_flexdigest_group_t group);
    867 
    868 /* Get the flex digest group configuration. */
    869 extern int bcm_flexdigest_group_get(
    870     int unit, 
    871     bcm_flexdigest_group_t group, 
    872     bcm_flexdigest_qset_t *qset, 
    873     int *pri);
    874 
    875 /* Destroy a flex digest group. */
    876 extern int bcm_flexdigest_group_destroy(
    877     int unit, 
    878     bcm_flexdigest_group_t group);
    879 
    880 /* Destroy all flex digest groups. */
    881 extern int bcm_flexdigest_group_destroy_all(
    882     int unit);
    883 
    884 /* Create a flex digest lookup entry for a given groups. */
    885 extern int bcm_flexdigest_entry_create(
    886     int unit, 
    887     bcm_flexdigest_group_t group, 
    888     bcm_flexdigest_entry_t *entry);
    889 
    890 /* Create a flex digest lookup entry with entry Identifier. */
    891 extern int bcm_flexdigest_entry_create_id(
    892     int unit, 
    893     bcm_flexdigest_group_t group, 
    894     bcm_flexdigest_entry_t entry);
    895 
    896 /* Destroy a flex digest lookup entry. */
    897 extern int bcm_flexdigest_entry_destroy(
    898     int unit, 
    899     bcm_flexdigest_entry_t entry);
    900 
    901 /* Destroy all flex digest lookup entries in a group. */
    902 extern int bcm_flexdigest_entry_destroy_all(
    903     int unit, 
    904     bcm_flexdigest_group_t group);
    905 
    906 /* Configure a flex digest lookup entry priority. */
    907 extern int bcm_flexdigest_entry_priority_set(
    908     int unit, 
    909     bcm_flexdigest_entry_t entry, 
    910     int pri);
    911 
    912 /* Get the flex digest lookup entry priority. */
    913 extern int bcm_flexdigest_entry_priority_get(
    914     int unit, 
    915     bcm_flexdigest_entry_t entry, 
    916     int *pri);
    917 
    918 /* Install a flex digest lookup entry into hardware. */
    919 extern int bcm_flexdigest_entry_install(
    920     int unit, 
    921     bcm_flexdigest_entry_t entry);
    922 
    923 /* Reinstall a flex digest lookup entry into hardware. */
    924 extern int bcm_flexdigest_entry_reinstall(
    925     int unit, 
    926     bcm_flexdigest_entry_t entry);
    927 
    928 /* Remove a flex digest lookup entry from hardware. */
    929 extern int bcm_flexdigest_entry_remove(
    930     int unit, 
    931     bcm_flexdigest_entry_t entry);
    932 
    933 /* Create a logical match identifier for flex digest lookup entry key. */
    934 extern int bcm_flexdigest_match_id_create(
    935     int unit, 
    936     bcm_flexdigest_match_id_t *match_id);
    937 
    938 /* Destroy a logical match identifier. */
    939 extern int bcm_flexdigest_match_id_destroy(
    940     int unit, 
    941     bcm_flexdigest_match_id_t match_id);
    942 
    943 /* Destroy all logical match identifiers. */
    944 extern int bcm_flexdigest_match_id_destroy_all(
    945     int unit);
    946 
    947 /* Add a matching criteria into a logical match identifiers. */
    948 extern int bcm_flexdigest_match_add(
    949     int unit, 
    950     bcm_flexdigest_match_id_t match_id, 
    951     bcm_flexdigest_match_t match);
    952 
    953 /* Delete a matching rule from a logical match identifiers. */
    954 extern int bcm_flexdigest_match_delete(
    955     int unit, 
    956     bcm_flexdigest_match_id_t match_id, 
    957     bcm_flexdigest_match_t match);
    958 
    959 /* 
    960  * Delete all matching criterias associated with a logical match
    961  * identifiers.
    962  */
    963 extern int bcm_flexdigest_match_delete_all(
    964     int unit, 
    965     bcm_flexdigest_match_id_t match_id);
    966 
    967 /* Get the matching criterias from a logical match identifiers. */
    968 extern int bcm_flexdigest_match_get(
    969     int unit, 
    970     bcm_flexdigest_match_id_t match_id, 
    971     int array_size, 
    972     bcm_flexdigest_match_t *match_array, 
    973     int *count);
    974 
    975 /* Add MatchId qualifier into a flex digest entry. */
    976 extern int bcm_flexdigest_qualify_MatchId(
    977     int unit, 
    978     bcm_flexdigest_entry_t entry, 
    979     bcm_flexdigest_match_id_t match_id);
    980 
    981 /* Get the data/mask configuration for MatchId qualifier. */
    982 extern int bcm_flexdigest_qualify_MatchId_get(
    983     int unit, 
    984     bcm_flexdigest_entry_t entry, 
    985     bcm_flexdigest_match_id_t *match_id);
    986 
    987 /* Add L4Valid qualifier into a flex digest entry. */
    988 extern int bcm_flexdigest_qualify_L4Valid(
    989     int unit, 
    990     bcm_flexdigest_entry_t entry, 
    991     uint8 data, 
    992     uint8 mask);
    993 
    994 /* Get the data/mask configuration for L4Valid qualifier. */
    995 extern int bcm_flexdigest_qualify_L4Valid_get(
    996     int unit, 
    997     bcm_flexdigest_entry_t entry, 
    998     uint8 *data, 
    999     uint8 *mask);
   1000 
   1001 /* Add MyStation1Hit qualifier into a flex digest entry. */
   1002 extern int bcm_flexdigest_qualify_MyStation1Hit(
   1003     int unit, 
   1004     bcm_flexdigest_entry_t entry, 
   1005     uint8 data, 
   1006     uint8 mask);
   1007 
   1008 /* Get the data/mask configuration for MyStation1Hit qualifier. */
   1009 extern int bcm_flexdigest_qualify_MyStation1Hit_get(
   1010     int unit, 
   1011     bcm_flexdigest_entry_t entry, 
   1012     uint8 *data, 
   1013     uint8 *mask);
   1014 
   1015 /* Add TunnelProcessingResults1 qualifier into a flex digest entry. */
   1016 extern int bcm_flexdigest_qualify_TunnelProcessingResults1(
   1017     int unit, 
   1018     bcm_flexdigest_entry_t entry, 
   1019     uint8 data, 
   1020     uint8 mask);
   1021 
   1022 /* 
   1023  * Get the data/mask configuration for TunnelProcessingResults1
   1024  * qualifier.
   1025  */
   1026 extern int bcm_flexdigest_qualify_TunnelProcessingResults1_get(
   1027     int unit, 
   1028     bcm_flexdigest_entry_t entry, 
   1029     uint8 *data, 
   1030     uint8 *mask);
   1031 
   1032 /* Add TunnelProcessingResultsRaw qualifier into a flex digest entry. */
   1033 extern int bcm_flexdigest_qualify_TunnelProcessingResultsRaw(
   1034     int unit, 
   1035     bcm_flexdigest_entry_t entry, 
   1036     uint8 data, 
   1037     uint8 mask);
   1038 
   1039 /* 
   1040  * Get the data/mask configuration for TunnelProcessingResultsRaw
   1041  * qualifier.
   1042  */
   1043 extern int bcm_flexdigest_qualify_TunnelProcessingResultsRaw_get(
   1044     int unit, 
   1045     bcm_flexdigest_entry_t entry, 
   1046     uint8 *data, 
   1047     uint8 *mask);
   1048 
   1049 /* Add FlexHve2ResultSet1 qualifier into a flex digest entry. */
   1050 extern int bcm_flexdigest_qualify_FlexHve2ResultSet1(
   1051     int unit, 
   1052     bcm_flexdigest_entry_t entry, 
   1053     uint8 data, 
   1054     uint8 mask);
   1055 
   1056 /* Get the data/mask configuration for FlexHve2ResultSet1 qualifier. */
   1057 extern int bcm_flexdigest_qualify_FlexHve2ResultSet1_get(
   1058     int unit, 
   1059     bcm_flexdigest_entry_t entry, 
   1060     uint8 *data, 
   1061     uint8 *mask);
   1062 
   1063 /* Add FixedHve2ResultSet0 qualifier into a flex digest entry. */
   1064 extern int bcm_flexdigest_qualify_FixedHve2ResultSet0(
   1065     int unit, 
   1066     bcm_flexdigest_entry_t entry, 
   1067     uint8 data, 
   1068     uint8 mask);
   1069 
   1070 /* Get the data/mask configuration for FixedHve2ResultSet0 qualifier. */
   1071 extern int bcm_flexdigest_qualify_FixedHve2ResultSet0_get(
   1072     int unit, 
   1073     bcm_flexdigest_entry_t entry, 
   1074     uint8 *data, 
   1075     uint8 *mask);
   1076 
   1077 /* Add FlexHve1ResultSet1 qualifier into a flex digest entry. */
   1078 extern int bcm_flexdigest_qualify_FlexHve1ResultSet1(
   1079     int unit, 
   1080     bcm_flexdigest_entry_t entry, 
   1081     uint8 data, 
   1082     uint8 mask);
   1083 
   1084 /* Get the data/mask configuration for FlexHve1ResultSet1 qualifier. */
   1085 extern int bcm_flexdigest_qualify_FlexHve1ResultSet1_get(
   1086     int unit, 
   1087     bcm_flexdigest_entry_t entry, 
   1088     uint8 *data, 
   1089     uint8 *mask);
   1090 
   1091 /* Add FixedHve1ResultSet0 qualifier into a flex digest entry. */
   1092 extern int bcm_flexdigest_qualify_FixedHve1ResultSet0(
   1093     int unit, 
   1094     bcm_flexdigest_entry_t entry, 
   1095     uint8 data, 
   1096     uint8 mask);
   1097 
   1098 /* Get the data/mask configuration for FixedHve1ResultSet0 qualifier. */
   1099 extern int bcm_flexdigest_qualify_FixedHve1ResultSet0_get(
   1100     int unit, 
   1101     bcm_flexdigest_entry_t entry, 
   1102     uint8 *data, 
   1103     uint8 *mask);
   1104 
   1105 /* Add L2IifFlexDigestCtrlIdB qualifier into a flex digest entry. */
   1106 extern int bcm_flexdigest_qualify_L2IifFlexDigestCtrlIdB(
   1107     int unit, 
   1108     bcm_flexdigest_entry_t entry, 
   1109     uint8 data, 
   1110     uint8 mask);
   1111 
   1112 /* Get the data/mask configuration for L2IifFlexDigestCtrlIdB qualifier. */
   1113 extern int bcm_flexdigest_qualify_L2IifFlexDigestCtrlIdB_get(
   1114     int unit, 
   1115     bcm_flexdigest_entry_t entry, 
   1116     uint8 *data, 
   1117     uint8 *mask);
   1118 
   1119 /* Add L2IifFlexDigestCtrlIdA qualifier into a flex digest entry. */
   1120 extern int bcm_flexdigest_qualify_L2IifFlexDigestCtrlIdA(
   1121     int unit, 
   1122     bcm_flexdigest_entry_t entry, 
   1123     uint8 data, 
   1124     uint8 mask);
   1125 
   1126 /* Get the data/mask configuration for L2IifFlexDigestCtrlIdA qualifier. */
   1127 extern int bcm_flexdigest_qualify_L2IifFlexDigestCtrlIdA_get(
   1128     int unit, 
   1129     bcm_flexdigest_entry_t entry, 
   1130     uint8 *data, 
   1131     uint8 *mask);
   1132 
   1133 /* Add ProtocolPktOpaqueCtrlId qualifier into a flex digest entry. */
   1134 extern int bcm_flexdigest_qualify_ProtocolPktOpaqueCtrlId(
   1135     int unit, 
   1136     bcm_flexdigest_entry_t entry, 
   1137     uint8 data, 
   1138     uint8 mask);
   1139 
   1140 /* Get the data/mask configuration for ProtocolPktOpaqueCtrlId qualifier. */
   1141 extern int bcm_flexdigest_qualify_ProtocolPktOpaqueCtrlId_get(
   1142     int unit, 
   1143     bcm_flexdigest_entry_t entry, 
   1144     uint8 *data, 
   1145     uint8 *mask);
   1146 
   1147 /* Add VfiOpaqueCtrlId qualifier into a flex digest entry. */
   1148 extern int bcm_flexdigest_qualify_VfiOpaqueCtrlId(
   1149     int unit, 
   1150     bcm_flexdigest_entry_t entry, 
   1151     uint8 data, 
   1152     uint8 mask);
   1153 
   1154 /* Get the data/mask configuration for VfiOpaqueCtrlId qualifier. */
   1155 extern int bcm_flexdigest_qualify_VfiOpaqueCtrlId_get(
   1156     int unit, 
   1157     bcm_flexdigest_entry_t entry, 
   1158     uint8 *data, 
   1159     uint8 *mask);
   1160 
   1161 /* Add SvpOpaqueCtrlId qualifier into a flex digest entry. */
   1162 extern int bcm_flexdigest_qualify_SvpOpaqueCtrlId(
   1163     int unit, 
   1164     bcm_flexdigest_entry_t entry, 
   1165     uint8 data, 
   1166     uint8 mask);
   1167 
   1168 /* Get the data/mask configuration for SvpOpaqueCtrlId qualifier. */
   1169 extern int bcm_flexdigest_qualify_SvpOpaqueCtrlId_get(
   1170     int unit, 
   1171     bcm_flexdigest_entry_t entry, 
   1172     uint8 *data, 
   1173     uint8 *mask);
   1174 
   1175 /* Add L3IifOpaqueCtrlId qualifier into a flex digest entry. */
   1176 extern int bcm_flexdigest_qualify_L3IifOpaqueCtrlId(
   1177     int unit, 
   1178     bcm_flexdigest_entry_t entry, 
   1179     uint8 data, 
   1180     uint8 mask);
   1181 
   1182 /* Get the data/mask configuration for L3IifOpaqueCtrlId qualifier. */
   1183 extern int bcm_flexdigest_qualify_L3IifOpaqueCtrlId_get(
   1184     int unit, 
   1185     bcm_flexdigest_entry_t entry, 
   1186     uint8 *data, 
   1187     uint8 *mask);
   1188 
   1189 /* Add L2IifOpaqueCtrlId qualifier into a flex digest entry. */
   1190 extern int bcm_flexdigest_qualify_L2IifOpaqueCtrlId(
   1191     int unit, 
   1192     bcm_flexdigest_entry_t entry, 
   1193     uint8 data, 
   1194     uint8 mask);
   1195 
   1196 /* Get the data/mask configuration for L2IifOpaqueCtrlId qualifier. */
   1197 extern int bcm_flexdigest_qualify_L2IifOpaqueCtrlId_get(
   1198     int unit, 
   1199     bcm_flexdigest_entry_t entry, 
   1200     uint8 *data, 
   1201     uint8 *mask);
   1202 
   1203 /* Remove match criteria from a flex digest processor entry. */
   1204 extern int bcm_flexdigest_qualifier_delete(
   1205     int unit, 
   1206     bcm_flexdigest_entry_t entry, 
   1207     bcm_flexdigest_qualify_t qual_id);
   1208 
   1209 /* Delete a qualifier from a flex digest entry. */
   1210 extern int bcm_flexdigest_qualifier_delete_all(
   1211     int unit, 
   1212     bcm_flexdigest_entry_t entry);
   1213 
   1214 /* Add an action and parameters into a lookup entry. */
   1215 extern int bcm_flexdigest_action_add(
   1216     int unit, 
   1217     bcm_flexdigest_entry_t entry, 
   1218     bcm_flexdigest_action_t action, 
   1219     uint16 param0, 
   1220     uint16 param1);
   1221 
   1222 /* Delete an action and parameters from a lookup entry. */
   1223 extern int bcm_flexdigest_action_delete(
   1224     int unit, 
   1225     bcm_flexdigest_entry_t entry, 
   1226     bcm_flexdigest_action_t action);
   1227 
   1228 /* Delete all actions from a lookup entry. */
   1229 extern int bcm_flexdigest_action_delete_all(
   1230     int unit, 
   1231     bcm_flexdigest_entry_t entry);
   1232 
   1233 /* Get an action parameters from a lookup entry. */
   1234 extern int bcm_flexdigest_action_get(
   1235     int unit, 
   1236     bcm_flexdigest_entry_t entry, 
   1237     bcm_flexdigest_action_t action, 
   1238     uint16 *param0, 
   1239     uint16 *param1);
   1240 
   1241 #if defined(BROADCOM_DEBUG)
   1242 /* Show current software state of the flexdigest module. */
   1243 extern int bcm_flexdigest_show(
   1244     int unit, 
   1245     const char *pfx);
   1246 #endif
   1247 
   1248 #if defined(BROADCOM_DEBUG)
   1249 /* Show contents of a flexdigest group. */
   1250 extern int bcm_flexdigest_group_dump(
   1251     int unit, 
   1252     bcm_field_group_t group);
   1253 #endif
   1254 
   1255 #if defined(BROADCOM_DEBUG)
   1256 /* Show contents of a flexdigest entry. */
   1257 extern int bcm_flexdigest_entry_dump(
   1258     int unit, 
   1259     bcm_field_entry_t entry);
   1260 #endif
   1261 
   1262 #endif /* BCM_HIDE_DISPATCHABLE */
   1263 
   1264 /* List of FlexDigest functions: used only in XFS devices */
   1265 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC16  1          /* 16-bit CRC16. */
   1266 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC16XOR1 2          /* 8-bit CRC16 + 8-bit
   1267                                                           XOR1. */
   1268 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC16XOR2 3          /* 8-bit CRC16 + 8-bit
   1269                                                           XOR2. */
   1270 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC16XOR4 4          /* 8-bit CRC16 + 8-bit
   1271                                                           XOR4. */
   1272 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC16XOR8 5          /* 8-bit CRC16 + 8-bit
   1273                                                           XOR8. */
   1274 #define BCM_FLEXDIGEST_HASH_FUNCTION_XOR16  6          /* 16-bit XOR. */
   1275 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC16CCITT 7          /* 16-bit CRC using CCITT
   1276                                                           polynomial. */
   1277 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC32LO 8          /* Lower 16-bit of CRC32. */
   1278 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC32HI 9          /* Higher 16-bit of
   1279                                                           CRC32. */
   1280 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC32_ETH_LO 10         /* Lower 16-bit of
   1281                                                           Ethernet CRC32. */
   1282 #define BCM_FLEXDIGEST_HASH_FUNCTION_CRC32_ETH_HI 11         /* Higher 16-bit of
   1283                                                           Ethernet CRC32. */
   1284 #define BCM_FLEXDIGEST_HASH_FUNCTION_KOOPMAN_LO 12         /* Lower 16-bit of
   1285                                                           Koopman CRC32. */
   1286 #define BCM_FLEXDIGEST_HASH_FUNCTION_KOOPMAN_HI 13         /* Higher 16-bit of
   1287                                                           Koopman CRC32. */
   1288 #define BCM_FLEXDIGEST_HASH_FUNCTION_VERSATILE_HASH_0 14         /* Bits[15:0] of
   1289                                                           versatile hash. */
   1290 #define BCM_FLEXDIGEST_HASH_FUNCTION_VERSATILE_HASH_1 15         /* Bits[31:16] of
   1291                                                           versatile hash. */
   1292 
   1293 /* The control type for flex digest Hash profile. */
   1294 typedef enum bcm_flexdigest_hash_profile_control_e {
   1295     bcmFlexDigestHashProfileControlPreProcessBinA = 0, /* Enable hash pre-processing for bin
   1296                                            set A. */
   1297     bcmFlexDigestHashProfileControlPreProcessBinB = 1, /* Enable hash pre-processing for bin
   1298                                            set B. */
   1299     bcmFlexDigestHashProfileControlPreProcessBinC = 2, /* Enable hash pre-processing for bin
   1300                                            set C. */
   1301     bcmFlexDigestHashProfileControlXorSaltBinA = 3, /* Enable hash salt for bin set A. */
   1302     bcmFlexDigestHashProfileControlXorSaltBinB = 4, /* Enable hash salt for bin set B. */
   1303     bcmFlexDigestHashProfileControlXorSaltBinC = 5, /* Enable hash salt for bin set C. */
   1304     bcmFlexDigestHashProfileControlBinA0FunctionSelection = 6, /* The hash function select for A0
   1305                                            field. */
   1306     bcmFlexDigestHashProfileControlBinA1FunctionSelection = 7, /* The hash function select for A1
   1307                                            field. */
   1308     bcmFlexDigestHashProfileControlBinB0FunctionSelection = 8, /* The hash function select for B0
   1309                                            field. */
   1310     bcmFlexDigestHashProfileControlBinB1FunctionSelection = 9, /* The hash function select for B1
   1311                                            field. */
   1312     bcmFlexDigestHashProfileControlBinC0FunctionSelection = 10, /* The hash function select for C0
   1313                                            field. */
   1314     bcmFlexDigestHashProfileControlBinC1FunctionSelection = 11, /* The hash function select for C1
   1315                                            field. */
   1316     bcmFlexDigestHashProfileControlCount = 12 /* Always last. Not a usable value. */
   1317 } bcm_flexdigest_hash_profile_control_t;
   1318 
   1319 #define BCM_FLEXDIGEST_HASH_PROFILE_CONTROL_STRINGS \
   1320 { \
   1321     "PreProcessBinA", \
   1322     "PreProcessBinB", \
   1323     "PreProcessBinC", \
   1324     "XorSaltBinA", \
   1325     "XorSaltBinB", \
   1326     "XorSaltBinC", \
   1327     "BinA0FunctionSelection", \
   1328     "BinA1FunctionSelection", \
   1329     "BinB0FunctionSelection", \
   1330     "BinB1FunctionSelection", \
   1331     "BinC0FunctionSelection", \
   1332     "BinC1FunctionSelection"  \
   1333 }
   1334 
   1335 #ifndef BCM_HIDE_DISPATCHABLE
   1336 
   1337 /* Create a flex digest hashing profile. */
   1338 extern int bcm_flexdigest_hash_profile_create(
   1339     int unit, 
   1340     uint32 options, 
   1341     int *hash_profile_id);
   1342 
   1343 /* Destroy a flex digest hashing profile. */
   1344 extern int bcm_flexdigest_hash_profile_destroy(
   1345     int unit, 
   1346     int hash_profile_id);
   1347 
   1348 /* Destroy all flex digest hashing profiles. */
   1349 extern int bcm_flexdigest_hash_profile_destroy_all(
   1350     int unit);
   1351 
   1352 /* Configure a flex digest hashing profiles. */
   1353 extern int bcm_flexdigest_hash_profile_set(
   1354     int unit, 
   1355     int hash_profile_id, 
   1356     bcm_flexdigest_hash_profile_control_t type, 
   1357     int value);
   1358 
   1359 /* Get a flex digest hashing profiles. */
   1360 extern int bcm_flexdigest_hash_profile_get(
   1361     int unit, 
   1362     int hash_profile_id, 
   1363     bcm_flexdigest_hash_profile_control_t type, 
   1364     int *value);
   1365 
   1366 #endif /* BCM_HIDE_DISPATCHABLE */
   1367 
   1368 /* The bin set for flex digest hashing. */
   1369 typedef enum bcm_flexdigest_hash_bin_set_e {
   1370     bcmFlexDigestHashBinA = 0,      /* Flex digest hash Bin Set A. */
   1371     bcmFlexDigestHashBinB = 1,      /* Flex digest hash Bin Set B. */
   1372     bcmFlexDigestHashBinC = 2,      /* Flex digest hash Bin Set C. */
   1373     bcmFlexDigestHashBinCount = 3   /* Always last. Not a usable value. */
   1374 } bcm_flexdigest_hash_bin_set_t;
   1375 
   1376 #define BCM_FLEXDIGEST_HASH_BIN_SET_STRINGS \
   1377 { \
   1378     "BinA", \
   1379     "BinB", \
   1380     "BinC"  \
   1381 }
   1382 
   1383 #ifndef BCM_HIDE_DISPATCHABLE
   1384 
   1385 /* Configure salt for a specific hashing bin set. */
   1386 extern int bcm_flexdigest_hash_salt_set(
   1387     int unit, 
   1388     bcm_flexdigest_hash_bin_set_t bin_set, 
   1389     int array_size, 
   1390     uint16 *salt_array);
   1391 
   1392 /* Get salt configuration for a specific hashing bin set. */
   1393 extern int bcm_flexdigest_hash_salt_get(
   1394     int unit, 
   1395     bcm_flexdigest_hash_bin_set_t bin_set, 
   1396     int array_size, 
   1397     uint16 *salt_array, 
   1398     int *count);
   1399 
   1400 #endif /* BCM_HIDE_DISPATCHABLE */
   1401 
   1402 /* Flex digest device-wide control types. */
   1403 typedef enum bcm_flexdigest_control_e {
   1404     bcmFlexDigestControlHashVersatileRandomSeedBinA = 0, /* Unsigned 32-bit random seed value of
   1405                                            versatile hash for hashing bin set A. */
   1406     bcmFlexDigestControlHashVersatileRandomSeedBinB = 1, /* Unsigned 32-bit random seed value of
   1407                                            versatile hash for hashing bin set B. */
   1408     bcmFlexDigestControlHashVersatileRandomSeedBinC = 2, /* Unsigned 32-bit random seed value of
   1409                                            versatile hash for hashing bin set C. */
   1410     bcmFlexDigestControlCount = 3       /* Always last. Not a usable value. */
   1411 } bcm_flexdigest_control_t;
   1412 
   1413 #define BCM_FLEXDIGEST_CONTROL_STRINGS \
   1414 { \
   1415     "HashVersatileRandomSeedBinA", \
   1416     "HashVersatileRandomSeedBinB", \
   1417     "HashVersatileRandomSeedBinC"  \
   1418 }
   1419 
   1420 #ifndef BCM_HIDE_DISPATCHABLE
   1421 
   1422 /* Set a device-wide flex digest control value. */
   1423 extern int bcm_flexdigest_control_set(
   1424     int unit, 
   1425     bcm_flexdigest_control_t type, 
   1426     int arg);
   1427 
   1428 /* Get a device-wide flex digest control value. */
   1429 extern int bcm_flexdigest_control_get(
   1430     int unit, 
   1431     bcm_flexdigest_control_t type, 
   1432     int *arg);
   1433 
   1434 #endif /* BCM_HIDE_DISPATCHABLE */
   1435 
   1436 #endif /* __BCM_FLEXDIGEST_H__ */