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

oob.h (9856B)


      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  * DO NOT EDIT THIS FILE!
      9  * This file is auto-generated.
     10  * Edits to this file will be lost when it is regenerated.
     11  */
     12 
     13 #ifndef __BCM_OOB_H__
     14 #define __BCM_OOB_H__
     15 
     16 #include <bcm/types.h>
     17 
     18 #define BCM_OOB_FC_TX_FCN_EN    0x00000001 /* Fast Congestion Notification
     19                                               Enable Flag */
     20 #define BCM_OOB_FC_TX_ING_EN    0x00000002 /* OOB FC Tx Ingress Congestion
     21                                               Notification Enable Flag */
     22 #define BCM_OOB_FC_TX_EGR_EN    0x00000004 /* OOB FC Tx Egress Congestion
     23                                               Notification Enable Flag */
     24 #define BCM_OOB_FC_TX_POOL_EN   0x00000008 /* OOB FC Tx Pool Congestion
     25                                               Notification Enable Flag */
     26 
     27 /* 
     28  * Enum that controls the way the egress queues congetion state will be
     29  * reported via OOB FC Tx
     30  */
     31 typedef enum bcm_oob_egress_mode_e {
     32     bcmOOBFCTxReportUCOnly = 0,     /* OOB FC Tx only reports unicast queues
     33                                        congestion state only. */
     34     bcmOOBFCTxReportMCOnly = 1,     /* OOB FC Tx only reports multicast queues
     35                                        congestion state only. */
     36     bcmOOBFCTxReportCos = 2,        /* OOB FC Tx only reports Cos queues level
     37                                        congestion state. */
     38     bcmOOBFCTxReportUCAndMC = 3,    /* OOB FC Tx only reports both UC and MC
     39                                        queues congestion state. */
     40     bcmOOBFCTxReportCount = 4       /* Must be last. */
     41 } bcm_oob_egress_mode_t;
     42 
     43 /* OOB FC TX global configuration settings. */
     44 typedef struct bcm_oob_fc_tx_config_s {
     45     uint32 flags;                   /* Enable flags */
     46     uint8 inter_pkt_gap;            /* Inter Packet Gap in Clock cycles */
     47     bcm_service_pool_id_t gcs_id;   /* Global Congestion Service Pool ID */
     48     bcm_oob_egress_mode_t egr_mode; /* Egress Congestion Reporting Mode */
     49 } bcm_oob_fc_tx_config_t;
     50 
     51 /* OOB FC TX Egress Queue configuration settings. */
     52 typedef struct bcm_oob_fc_tx_queue_config_s {
     53     bcm_cos_queue_t cosq;   /* UC or MC queue number */
     54     uint8 queue_enable;     /* Enable/disable queue congestion reporting */
     55     uint32 queue_offset;    /* Queue bit offset within OOBFC message */
     56 } bcm_oob_fc_tx_queue_config_t;
     57 
     58 /* Initialize a OOB FC Queue Config Structure. */
     59 extern void bcm_oob_fc_tx_queue_config_t_init(
     60     bcm_oob_fc_tx_queue_config_t *config);
     61 
     62 #ifndef BCM_HIDE_DISPATCHABLE
     63 
     64 /* Set OOBFC per-queue config within a profile. */
     65 extern int bcm_oob_fc_tx_queue_profile_set(
     66     int unit, 
     67     int profile_id, 
     68     int count, 
     69     bcm_oob_fc_tx_queue_config_t *config);
     70 
     71 /* Get OOBFC per-queue config within a profile. */
     72 extern int bcm_oob_fc_tx_queue_profile_get(
     73     int unit, 
     74     int profile_id, 
     75     int max_count, 
     76     bcm_oob_fc_tx_queue_config_t *config, 
     77     int *count);
     78 
     79 /* Set port to OOB port mapping. */
     80 extern int bcm_oob_fc_tx_port_mapping_set(
     81     int unit, 
     82     int count, 
     83     int *port_array, 
     84     int *oob_port_array);
     85 
     86 /* Get port to OOB port mapping. */
     87 extern int bcm_oob_fc_tx_port_mapping_get(
     88     int unit, 
     89     int max_count, 
     90     int *port_array, 
     91     int *oob_port_array, 
     92     int *count);
     93 
     94 #endif /* BCM_HIDE_DISPATCHABLE */
     95 
     96 /* Initialize a OOB FC Tx Global Config Structure. */
     97 extern void bcm_oob_fc_tx_config_t_init(
     98     bcm_oob_fc_tx_config_t *config);
     99 
    100 /* OOB FC TX Channel info. */
    101 typedef struct bcm_oob_fc_tx_info_s {
    102     uint8 ing_base;     /* Ingress Channel Base */
    103     uint8 ucast_base;   /* Unicast Queue Channel Base */
    104     uint8 mcast_base;   /* Multicast Queue Channel Base */
    105     uint8 cos_base;     /* Cos Queue Channel Base */
    106     uint8 pool_base;    /* Pool Channel Base */
    107 } bcm_oob_fc_tx_info_t;
    108 
    109 /* Initialize a OOB FC Tx Global Info Structure. */
    110 extern void bcm_oob_fc_tx_info_t_init(
    111     bcm_oob_fc_tx_info_t *info);
    112 
    113 /* OOB FC RX Interface Configuration. */
    114 typedef struct bcm_oob_fc_rx_config_s {
    115     uint8 channel_base; /* Channel Base of the first HCFC packet for OOB FC Rx
    116                            Interface */
    117     int enable;         /* enable=1 (Enable) and enable=0 (Disable) OOB FC Rx
    118                            Interface */
    119 } bcm_oob_fc_rx_config_t;
    120 
    121 /* Initialize a OOB FC Rx per interface Global Config Structure. */
    122 extern void bcm_oob_fc_rx_config_t_init(
    123     bcm_oob_fc_rx_config_t *config);
    124 
    125 #ifndef BCM_HIDE_DISPATCHABLE
    126 
    127 /* OOB FC Tx side global configuration API */
    128 extern int bcm_oob_fc_tx_config_set(
    129     int unit, 
    130     bcm_oob_fc_tx_config_t *config);
    131 
    132 /* OOB FC Tx side global configuration get API */
    133 extern int bcm_oob_fc_tx_config_get(
    134     int unit, 
    135     bcm_oob_fc_tx_config_t *config);
    136 
    137 /* OOB FC Tx side global info get API */
    138 extern int bcm_oob_fc_tx_info_get(
    139     int unit, 
    140     bcm_oob_fc_tx_info_t *info);
    141 
    142 /* 
    143  * OOB FC Rx Interface side Traffic Class to Priority Mapping Multi Set
    144  * API
    145  */
    146 extern int bcm_oob_fc_rx_port_tc_mapping_multi_set(
    147     int unit, 
    148     bcm_oob_fc_rx_intf_id_t intf_id, 
    149     bcm_gport_t gport, 
    150     int array_count, 
    151     uint32 *tc, 
    152     uint32 *pri_bmp);
    153 
    154 /* 
    155  * OOB FC Rx Interface side Traffic Class to Priority Mapping Multi Get
    156  * API
    157  */
    158 extern int bcm_oob_fc_rx_port_tc_mapping_multi_get(
    159     int unit, 
    160     bcm_oob_fc_rx_intf_id_t intf_id, 
    161     bcm_gport_t gport, 
    162     int array_max, 
    163     uint32 *tc, 
    164     uint32 *pri_bmp, 
    165     int *array_count);
    166 
    167 /* OOB FC Rx Interface side Traffic Class to Priority Mapping set API */
    168 extern int bcm_oob_fc_rx_port_tc_mapping_set(
    169     int unit, 
    170     bcm_oob_fc_rx_intf_id_t intf_id, 
    171     bcm_gport_t gport, 
    172     uint32 tc, 
    173     uint32 pri_bmp);
    174 
    175 /* OOB FC Rx Interface side Traffic Class to Priority Mapping get API */
    176 extern int bcm_oob_fc_rx_port_tc_mapping_get(
    177     int unit, 
    178     bcm_oob_fc_rx_intf_id_t intf_id, 
    179     bcm_gport_t gport, 
    180     uint32 tc, 
    181     uint32 *pri_bmp);
    182 
    183 /* OOB FC Rx Interface side Configuration set API */
    184 extern int bcm_oob_fc_rx_config_set(
    185     int unit, 
    186     bcm_oob_fc_rx_intf_id_t intf_id, 
    187     bcm_oob_fc_rx_config_t *config, 
    188     int array_count, 
    189     bcm_gport_t *gport_array);
    190 
    191 /* OOB FC Rx Interface side Configuration get API */
    192 extern int bcm_oob_fc_rx_config_get(
    193     int unit, 
    194     bcm_oob_fc_rx_intf_id_t intf_id, 
    195     bcm_oob_fc_rx_config_t *config, 
    196     int array_max, 
    197     bcm_gport_t *gport_array, 
    198     int *array_count);
    199 
    200 /* OOB FC Rx Interface side Channel offset value for a port */
    201 extern int bcm_oob_fc_rx_port_offset_get(
    202     int unit, 
    203     bcm_oob_fc_rx_intf_id_t intf_id, 
    204     bcm_gport_t gport, 
    205     uint32 *offset);
    206 
    207 #endif /* BCM_HIDE_DISPATCHABLE */
    208 
    209 #define BCM_OOB_STATS_TIMESTAMP_EN  0x00000001 /* Enable Flag for reporting
    210                                                   Timestamp */
    211 #define BCM_OOB_STATS_POOL_EN       0x00000002 /* Enable Flag for reporting
    212                                                   Instantaneous service pool
    213                                                   size */
    214 #define BCM_OOB_STATS_QUEUE_EN      0x00000004 /* Enable Flag for reporting
    215                                                   Instantaneous UC Queue size */
    216 
    217 #define BCM_OOB_STATS_INGRESS   0x01       /* Ingress side resource */
    218 #define BCM_OOB_STATS_EGRESS    0x02       /* Egress side resource */
    219 
    220 /* OOB Stats global configuration settings. */
    221 typedef struct bcm_oob_stats_config_s {
    222     uint32 flags;           /* Enable flags */
    223     uint8 inter_pkt_gap;    /* Inter Packet Gap in Clock cycles */
    224     uint8 config_id;        /* Global Config ID */
    225 } bcm_oob_stats_config_t;
    226 
    227 #ifndef BCM_HIDE_DISPATCHABLE
    228 
    229 /* OOB STATS global configuration set API */
    230 extern int bcm_oob_stats_config_set(
    231     int unit, 
    232     bcm_oob_stats_config_t *config);
    233 
    234 /* OOB STATS global configuration get API */
    235 extern int bcm_oob_stats_config_get(
    236     int unit, 
    237     bcm_oob_stats_config_t *config);
    238 
    239 #endif /* BCM_HIDE_DISPATCHABLE */
    240 
    241 /* Initialize a OOB STATS Global Config Structure. */
    242 extern void bcm_oob_stats_config_t_init(
    243     bcm_oob_stats_config_t *config);
    244 
    245 #ifndef BCM_HIDE_DISPATCHABLE
    246 
    247 /* OOB STATS configuration of service pool list multi set API */
    248 extern int bcm_oob_stats_pool_mapping_multi_set(
    249     int unit, 
    250     int array_count, 
    251     int *offset_array, 
    252     uint8 *dir_array, 
    253     bcm_service_pool_id_t *pool_array);
    254 
    255 /* OOB STATS configuration of service pool list multi get API */
    256 extern int bcm_oob_stats_pool_mapping_multi_get(
    257     int unit, 
    258     int array_max, 
    259     int *offset_array, 
    260     uint8 *dir_array, 
    261     bcm_service_pool_id_t *pool_array, 
    262     int *array_count);
    263 
    264 /* OOB STATS configuration of service pool list set API */
    265 extern int bcm_oob_stats_pool_mapping_set(
    266     int unit, 
    267     int offset, 
    268     uint8 dir, 
    269     bcm_service_pool_id_t pool);
    270 
    271 /* OOB STATS configuration of service pool list get API */
    272 extern int bcm_oob_stats_pool_mapping_get(
    273     int unit, 
    274     int offset, 
    275     uint8 *dir, 
    276     bcm_service_pool_id_t *pool);
    277 
    278 /* OOB STATS configuration of Queue list set API */
    279 extern int bcm_oob_stats_queue_mapping_multi_set(
    280     int unit, 
    281     int array_count, 
    282     int *offset_array, 
    283     bcm_gport_t *gport_array);
    284 
    285 /* OOB STATS configuration of Queue list get API */
    286 extern int bcm_oob_stats_queue_mapping_multi_get(
    287     int unit, 
    288     int array_max, 
    289     int *offset_array, 
    290     bcm_gport_t *gport_array, 
    291     int *array_count);
    292 
    293 /* OOB STATS configuration of Queue list set API */
    294 extern int bcm_oob_stats_queue_mapping_set(
    295     int unit, 
    296     int offset, 
    297     bcm_gport_t gport);
    298 
    299 /* OOB STATS configuration of Queue list get API */
    300 extern int bcm_oob_stats_queue_mapping_get(
    301     int unit, 
    302     int offset, 
    303     bcm_gport_t *gport);
    304 
    305 #endif /* BCM_HIDE_DISPATCHABLE */
    306 
    307 #endif /* __BCM_OOB_H__ */