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

fp_oam.h (7045B)


      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-2019 Broadcom Inc. All rights reserved.
      7  */
      8 
      9 #ifndef __BCM_INT_FP_OAM_H__
     10 #define __BCM_INT_FP_OAM_H__
     11 
     12 #include "soc/shared/ccm.h"
     13 #include "soc/shared/ccm_msg.h"
     14 
     15 #include "bcm_int/esw/bhh.h"
     16 
     17 #if defined(INCLUDE_MPLS_LM_DM)
     18 #include "bcm_int/esw/mpls_lm_dm.h"
     19 #endif /* INCLUDE_MPLS_LM_DM */
     20 
     21 /* Direction + isLocal + Group ID + Endpoint Name + Level + Gport + 2VIDs */
     22 #define _FP_OAM_HASH_KEY_SIZE ( sizeof(uint8)                   +   \
     23                                 sizeof(uint8)                   +   \
     24                                 sizeof(bcm_oam_group_t)         +   \
     25                                 sizeof(uint16)                  +   \
     26                                 sizeof(int)                     +   \
     27                                 sizeof(bcm_gport_t)             +   \
     28                                 sizeof(bcm_vlan_t)              +   \
     29                                 sizeof(bcm_vlan_t) )
     30 
     31 typedef uint8 _bcm_fp_oam_hash_key_t[_FP_OAM_HASH_KEY_SIZE];
     32 
     33 
     34 
     35 /*
     36  * Typedef:
     37  *     _bcm_fp_oam_group_data_t
     38  * Purpose:
     39  *     Group information.
     40  */
     41 typedef struct _bcm_fp_oam_group_data_s
     42 {
     43     int                 in_use; /* Group status */
     44     ccm_group_data_t    group_data; /* Group data stores on UK */
     45 } _bcm_fp_oam_group_data_t;
     46 
     47 
     48 /*
     49  * Typedef:
     50  *     _bcm_fp_oam_hash_data_t
     51  * Purpose:
     52  *     Endpoint hash table data structure.
     53  */
     54 typedef struct _bcm_fp_oam_mep_data_s
     55 {
     56     int in_use;                         /* Endpoint status */
     57     ccm_mep_data_t        mep_data;/* CCM Data Stored on UK */
     58 } _bcm_fp_oam_mep_data_t;
     59 
     60 
     61 /*
     62  * Typedef:
     63  *     _bcm_fp_oam_control_t
     64  * Purpose:
     65  *     OAM module control structure. One structure for each XGS device.
     66  */
     67 typedef struct _bcm_fp_oam_control_s {
     68 
     69     int                         init;           /* TRUE if OAM module has */
     70                                                 /* been initialized */
     71     int                         unit;           /* oc unit number */
     72     sal_mutex_t                 oc_lock;        /* Protection mutex */
     73 
     74     uint32                      group_count;    /* Total groups count */
     75     uint32                      mep_count;      /* Total mep count */
     76 
     77     /* Group Data */
     78     shr_idxres_list_handle_t    group_pool;     /* Group indices pool */
     79     _bcm_fp_oam_group_data_t    *group_data;    /* Group Data */
     80 
     81     /* LMEP Data */
     82     shr_idxres_list_handle_t    mep_pool;       /* LMEP indices pool */
     83     _bcm_fp_oam_mep_data_t      *mep_data;      /* LMEP Data */
     84     shr_htb_hash_table_t        mep_htbl;       /* LMEP+RMEP hash table */
     85 
     86     /* CCM Event handling data elements */
     87     uint32                      event_mask;     /* Event mask */
     88     _bcm_oam_event_handler_t    *event_handler_list_p; /* Event handlers LL */
     89     int                         event_handler_cnt[bcmOAMEventCount];
     90     sal_thread_t                event_thread_id; /* Event thread Prio */
     91 
     92     /* CCM UC Messaging data elements */
     93     int                         ccm_uc_num;     /* UC Num for CCM App */
     94     uint8                       *dma_buffer;    /* DMA Buffer for F/w Msging */
     95     uint32                      dma_buffer_len; /* Max DMA Msg size */
     96     int                         ccm_ukernel_ready; /* UKERNEL ready or not */
     97 
     98 #if defined(INCLUDE_BHH)
     99     shr_idxres_list_handle_t    bhh_group_pool; /* BHH Group indices pool */
    100     _bhh_fp_oam_group_data_t    *bhh_group_data;/* BHH Group Data */
    101     _bhh_fp_oam_ep_data_t       *bhh_ep_data;   /* BHH EP Data */
    102     shr_htb_hash_table_t        bhh_mep_htbl;   /* BHH MEP hash table */
    103     shr_idxres_list_handle_t    bhh_pool;       /* BHH endpoint indices pool. */
    104     int                         rx_channel;     /* Local RX DMA channel for   */
    105                                                 /*                BHH packets */
    106     int                         bhh_uc_num;     /* uController number running */
    107                                                 /*                   BHH appl */
    108     int                         bhh_dma_buffer_len;/* DMA max buffer size     */
    109     uint8*                      bhh_dma_buffer; /* DMA buffer                 */
    110     uint8*                      bhh_dmabuf_reply;/* DMA reply buffer          */
    111     int                         bhh_endpoint_count;/*Number of BHH sessions on*/
    112                                                    /*  FW*/
    113     int                         bhh_base_group_id; /* BHH base group ID*/ 
    114     int                         bhh_base_endpoint_id;/* BHH base endpoint ID*/  
    115     sal_thread_t                bhh_event_thread_id;/* Event handler thread id*/
    116     uint32                      bhh_event_mask;/*Events registered with uKernel*/
    117     int                         ukernel_not_ready;/* UKERNEL ready or not     */
    118     uint16                      bhh_max_encap_length;
    119     uint8                       pm_bhh_lmdm_data_collection_mode;/*PM mode */
    120     uint32                      pm_bhh_raw_data_num_buffers;/* Num of raw data*/
    121                                                             /* buffers */
    122     int                         pm_bhh_dma_buffer_len; /* DMA max buffer size */
    123     uint8*                      pm_bhh_dma_buffer;     /* DMA buffer */
    124     bcm_oam_pm_raw_data_t       pm_bhh_raw_data_info;
    125 #endif /* INCLUDE_BHH */
    126 
    127 #if defined(INCLUDE_MPLS_LM_DM)
    128     int                         mpls_lm_dm_dma_buffer_len;/* DMA max buffer size */
    129     uint8*                      mpls_lm_dm_dma_buffer; /* DMA buffer */
    130     uint8                       mpls_lm_dm_uc_num; /* uC running MPLS_LM_DM app */
    131     uint8                       mpls_lm_dm_ukernel_ready; /* UC state */
    132     uint8                       mpls_lm_dm_rx_channel;/* Local RX DMA channel
    133                                                        for MPLS_LM_DM packets */
    134     uint16                      mpls_lm_dm_max_ep_count; /* MAX number of EP */
    135     bcm_oam_endpoint_t          mpls_lm_dm_base_endpoint_id;/* MPLS LM/DM base
    136                                                                endpoint ID */
    137     shr_idxres_list_handle_t    mpls_lm_dm_pool; /* MPLS_LM_DM session-Id pool */
    138     _bcm_fp_oam_mpls_lm_dm_ep_data_t *mpls_lm_dm_ep_data; /* EP data ptr */
    139     uint8                       pm_mpls_lm_dm_data_collection_mode;/*PM mode */
    140     uint32                      pm_mpls_lm_dm_raw_data_num_buffers; /* Num of raw data buffers */
    141     bcm_oam_pm_raw_data_t       pm_mpls_lm_dm_raw_data_info;
    142     sal_thread_t                mpls_lm_dm_pm_event_thread_id;
    143 #endif /* INCLUDE_MPLS_LM_DM */
    144 #if defined(INCLUDE_BHH) || defined(INCLUDE_MPLS_LM_DM)
    145     _bcm_oam_pm_event_handler_t *pm_event_handler_list_p;
    146     int                         pm_read_done_index[3];
    147     int                         pm_write_done_index[3];
    148     int                         pm_num_free_raw_data_buffers[3];
    149 #endif /* INCLUDE_BHH || INCLUDE_MPLS_LM_DM */
    150 } _bcm_fp_oam_control_t;
    151 
    152 
    153 #endif /* !__BCM_INT_FP_OAM_H__ */