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

mpls_lm_dm_msg.h (6974B)


      1 /* 
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6  *
      7  * File:    mpls_lm_dm_msg.h
      8  * Purpose: MPLS_LM_DM Messages definitions common to SDK and uKernel.
      9  *
     10  *          Messages between SDK and uKernel.
     11  */
     12 
     13 #ifndef   _SOC_SHARED_MPLS_LM_DM_MSG_H_
     14 #define   _SOC_SHARED_MPLS_LM_DM_MSG_H_
     15 
     16 #ifdef BCM_UKERNEL
     17   /* Build for uKernel not SDK */
     18   #include "sdk_typedefs.h"
     19 #else
     20   #include <sal/types.h>
     21 #endif
     22 
     23 #include <soc/shared/mos_msg_common.h>
     24 #include <soc/shared/mpls_lm_dm_pkt.h>
     25 /* #include <shared/mpls_lm_dm.h> */
     26 
     27 
     28 
     29 /*****************************************
     30  * MPLS_LM_DM uController Error codes
     31  */
     32 typedef enum shr_mpls_lm_dm_uc_error_e {
     33     SHR_MPLS_LM_DM_UC_E_NONE = 0,
     34     SHR_MPLS_LM_DM_UC_E_INTERNAL,
     35     SHR_MPLS_LM_DM_UC_E_MEMORY,
     36     SHR_MPLS_LM_DM_UC_E_PARAM,
     37     SHR_MPLS_LM_DM_UC_E_RESOURCE,
     38     SHR_MPLS_LM_DM_UC_E_EXISTS,
     39     SHR_MPLS_LM_DM_UC_E_NOT_FOUND,
     40     SHR_MPLS_LM_DM_UC_E_UNAVAIL,
     41     SHR_MPLS_LM_DM_UC_E_VERSION,
     42     SHR_MPLS_LM_DM_UC_E_INIT
     43 } shr_mpls_lm_dm_uc_error_t;
     44 
     45 /********************************
     46  * MPLS_LM_DM Control Messages
     47  *
     48  *   SDK Host <--> uController
     49  */
     50 
     51 /*
     52  * The MPLS_LM_DM Encapsulation is maintained in the uKernel
     53  * It contains the encapsulation for all current MPLS_LM_DM sessions.
     54  *
     55  * A MPLS_LM_DM encapsulation currently includes:
     56  *     L2 + [MPLS-TP]
     57  *     DMAC + SMAC + VLAN*2 + MPLS_ETH_TYPE + 9*MPLS_LABELS + ACH_HEADER
     58  *     6 + 6 + 4*2 + 2 + 9*4 + 4 = 62
     59  *
     60  * A MPLS_LM_DM encapsulation does NOT include the MPLS_LM_DM PDU (MPLS_LM_DM Control Packet).
     61  * This is built by the uKernel side.
     62  */
     63 #define SHR_MPLS_LM_DM_MAX_ENCAP_LENGTH     62
     64 
     65 /*
     66  * MPLS_LM_DM Initialization control message
     67  */
     68 typedef struct shr_mpls_lm_dm_msg_ctrl_init_s {
     69     uint32  num_sessions;        /* Max number of MPLS_LM_DM sessions */
     70     uint32  rx_channel;          /* Local RX DMA channel (0..3) */
     71 } shr_mpls_lm_dm_msg_ctrl_init_t;
     72 
     73 /*
     74  * MPLS_LM_DM Loss Measurement add
     75  */
     76 typedef struct shr_mpls_lm_dm_msg_ctrl_loss_add_s {
     77     uint32  flags;
     78     uint32  sess_id;    /* MPLS_LM_DM session (endpoint) id */
     79     uint32  period;
     80     uint32  int_pri;
     81     uint8   pkt_pri;
     82     uint16  l2_encap_length; /* L2 Encap Lenght */
     83     uint8   l2_encap_data[SHR_MPLS_LM_DM_MAX_ENCAP_LENGTH]; /* L2 Encap Data */
     84     /* OLP (L2 + OAM) Encap Data */
     85     uint8   olp_encap_data[MPLS_LM_DM_OLP_HDR_LEN]; 
     86     uint8   ctr_size;
     87     uint32  ctr_base_id[3];
     88     uint8   ctr_offset[3];
     89     uint8   ctr_action[3];
     90     uint8   ctr_byte_offset[3];
     91 } shr_mpls_lm_dm_msg_ctrl_loss_add_t;
     92 
     93 /*
     94  * MPLS_LM_DM Loss Measurement delete
     95  */
     96 typedef struct shr_mpls_lm_dm_msg_ctrl_loss_delete_s {
     97     uint32  flags;
     98     uint32  sess_id;    /* MPLS_LM_DM session (endpoint) id */
     99 } shr_mpls_lm_dm_msg_ctrl_loss_delete_t;
    100 
    101 /*
    102  * MPLS_LM_DM Loss Measurement get
    103  */
    104 typedef struct shr_mpls_lm_dm_msg_ctrl_loss_get_s {
    105     uint32  flags;
    106     uint32  sess_id;    /* MPLS_LM_DM session (endpoint) id */
    107 } shr_mpls_lm_dm_msg_ctrl_loss_get_t;
    108 
    109 /*
    110  * MPLS_LM_DM Loss Measurement get
    111  */
    112 typedef struct shr_mpls_lm_dm_msg_ctrl_loss_data_s {
    113     uint32  flags;
    114     uint32  sess_id;    /* MPLS_LM_DM session (endpoint) id */
    115     uint32  period;
    116     uint32  loss_threshold;             
    117     uint32  loss_nearend;               
    118     uint32  loss_farend;    
    119     uint32  tx_nearend;            
    120     uint32  rx_nearend;              
    121     uint32  tx_farend;               
    122     uint32  rx_farend;               
    123     uint32  rx_oam_packets;          
    124     uint32  tx_oam_packets;          
    125     uint32  int_pri;
    126     uint8   pkt_pri;         
    127     uint8   ctr_size;
    128     uint32  ctr_base_id[3];
    129     uint8   ctr_offset[3];
    130     uint8   ctr_action[3];
    131     uint8   ctr_byte_offset[3];
    132     uint32  tx_nearend_upper;
    133     uint32  rx_nearend_upper;
    134     uint32  tx_farend_upper;
    135     uint32  rx_farend_upper;
    136     uint32  loss_nearend_upper;
    137     uint32  loss_farend_upper;
    138 } shr_mpls_lm_dm_msg_ctrl_loss_data_t;
    139 
    140 /*
    141  * MPLS_LM_DM Delay Measurement add
    142  */
    143 typedef struct shr_mpls_lm_dm_msg_ctrl_delay_add_s {
    144     uint32  flags;
    145     uint32  sess_id;    /* MPLS_LM_DM session (endpoint) id */
    146     uint32  period;
    147     uint32  int_pri;    
    148     uint8   pkt_pri;         
    149     uint8   dm_format;
    150     uint16  l2_encap_length; /* L2 Encap Lenght */
    151     uint8   l2_encap_data[SHR_MPLS_LM_DM_MAX_ENCAP_LENGTH]; /* L2 Encap Data */
    152     uint8   olp_encap_data[MPLS_LM_DM_OLP_HDR_LEN]; 
    153 } shr_mpls_lm_dm_msg_ctrl_delay_add_t;
    154 
    155 /*
    156  * MPLS_LM_DM Delay Measurement delete
    157  */
    158 typedef struct shr_mpls_lm_dm_msg_ctrl_delay_delete_s {
    159     uint32  flags;
    160     uint32  sess_id;    /* MPLS_LM_DM session (endpoint) id */
    161 } shr_mpls_lm_dm_msg_ctrl_delay_delete_t;
    162 
    163 /*
    164  * MPLS_LM_DM Delay Measurement get
    165  */
    166 typedef struct shr_mpls_lm_dm_msg_ctrl_delay_get_s {
    167     uint32  flags;
    168     uint32  sess_id;    /* MPLS_LM_DM session (endpoint) id */
    169 }shr_mpls_lm_dm_msg_ctrl_delay_get_t;
    170 
    171 /*
    172  * MPLS_LM_DM Delay Measurement get
    173  */
    174 typedef struct shr_mpls_lm_dm_msg_ctrl_delay_data_s {
    175     uint32  flags;
    176     uint32  sess_id;    /* MPLS_LM_DM session (endpoint) id */
    177     uint32  period;
    178     uint32  delay_seconds;
    179     uint32  delay_nanoseconds;
    180     uint32  txf_seconds;  
    181     uint32  txf_nanoseconds;
    182     uint32  rxf_seconds;
    183     uint32  rxf_nanoseconds;
    184     uint32  txb_seconds;
    185     uint32  txb_nanoseconds;
    186     uint32  rxb_seconds;
    187     uint32  rxb_nanoseconds;
    188     uint32  rx_oam_packets;
    189     uint32  tx_oam_packets; 
    190     uint32  int_pri;    
    191     uint8   pkt_pri;         
    192     uint8   dm_format;         
    193 }shr_mpls_lm_dm_msg_ctrl_delay_data_t;
    194 
    195 
    196 /*
    197  * MPLS_LM_DM control messages
    198  */
    199 typedef union shr_mpls_lm_dm_msg_ctrl_s {
    200     shr_mpls_lm_dm_msg_ctrl_init_t          init;
    201     shr_mpls_lm_dm_msg_ctrl_loss_add_t      loss_add;
    202     shr_mpls_lm_dm_msg_ctrl_loss_delete_t   loss_del;
    203     shr_mpls_lm_dm_msg_ctrl_loss_get_t      loss_get;
    204     shr_mpls_lm_dm_msg_ctrl_loss_data_t     loss_data;
    205     shr_mpls_lm_dm_msg_ctrl_delay_add_t     delay_add;
    206     shr_mpls_lm_dm_msg_ctrl_delay_delete_t  delay_del;
    207     shr_mpls_lm_dm_msg_ctrl_delay_get_t     delay_get;
    208     shr_mpls_lm_dm_msg_ctrl_delay_data_t    delay_data;
    209 } shr_mpls_lm_dm_msg_ctrl_t;
    210 
    211 
    212 /****************************************
    213  * MPLS_LM_DM event message
    214  */
    215 #define MPLS_LM_DM_BTE_EVENT_STATE                      0x0001
    216 
    217 
    218 /*
    219  *  The MPLS_LM_DM event message is defined as a short message (use mos_msg_data_t).
    220  *
    221  *  The fields of mos_msg_data_t are used as followed:
    222  *      mclass   (uint8)  - MOS_MSG_CLASS_MPLS_LM_DM_EVENT
    223  *      subclass (uint8)  - Unused
    224  *      len      (uint16) - MPLS_LM_DM Session ID
    225  *      data     (uint32) - Events mask
    226  */
    227 typedef mos_msg_data_t  mpls_lm_dm_msg_event_t;
    228 
    229 /****************************************
    230  * MPLS_LM_DM event message
    231  */
    232 #define MPLS_LM_DM_BTE_EVENT_PM_STATS_COUNTER_ROLLOVER   0x000001
    233 
    234 #endif /* _SOC_SHARED_MPLS_LM_DM_MSG_H_ */