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

oam_init.h (2928B)


      1 /** \file oam_init.h
      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 #ifndef _OAM_INIT_INCLUDED__
     10 /*
     11  * {
     12  */
     13 #define _OAM_INIT_INCLUDED__
     14 
     15 #ifndef BCM_DNX_SUPPORT
     16 #error "This file is for use by DNX (JR2) family only!"
     17 #endif
     18 
     19 /*
     20  * }
     21  */
     22 #include <soc/dnx/dbal/dbal.h>
     23 
     24 /**
     25  * \brief -
     26  * Initialize OAM module.
     27  * This function calls initialazation functions for
     28  * OAM procedures
     29  * 
     30  * Called from init sequence as part of dnx init pp sequence
     31  *
     32  * \par DIRECT INPUT:
     33  *    \param [in] unit -
     34  *     Relevant unit.
     35  * \par DIRECT OUTPUT:
     36  *    \retval Error indication according to shr_error_e enum
     37  */
     38 shr_error_e dnx_oam_init(
     39     int unit);
     40 
     41 /**
     42  * \brief -
     43  * De-initialize OAM module. 
     44  *  
     45  * Called from init sequence as part of dnx deinit pp sequence
     46  *
     47  * \par DIRECT INPUT:
     48  *    \param [in] unit -
     49  *     Relevant unit.
     50  * \par DIRECT OUTPUT:
     51  *    \retval Error indication according to shr_error_e enum
     52  */
     53 shr_error_e dnx_oam_deinit(
     54     int unit);
     55 
     56 /**
     57  * \brief -
     58  * Map OAM opcode(8 bits) to internal opcode(4 bits) and set OAM counter offset.
     59  * Mapping is done via:
     60  *             ingress(DBAL_TABLE_INGRESS_ETHERNET_OAM_OPCODE_MAP table) &
     61  *             egress(DBAL_TABLE_EGRESS_ETHERNET_OAM_OPCODE_MAP table)
     62  *
     63  * Called from init sequence and could be called for re-map some opcode, that are not used by standart as
     64  * a part of bcm_oam_opcode_map_set() api.
     65  *
     66  * \param [in] unit -
     67  *     Relevant unit.
     68  * \param [in] opcode -
     69  *     OAM opcode that should be mapped
     70  * \param [in] internal_opcode
     71  *     Internal OAM opcode
     72  * \return
     73  *   \retval Non-zero (!= _SHR_E_NONE) in case of an error
     74  *   \retval Zero (= _SHR_E_NONE) in case of NO ERROR
     75  */
     76 shr_error_e dnx_oam_opcode_map_set(
     77     int unit,
     78     int opcode,
     79     dbal_enum_value_field_oam_internal_opcode_e internal_opcode);
     80 
     81 /**
     82  * \brief -
     83  * Set enable/disable of ignoring MDL when identifying
     84  * Y.1731 OAM over MPLS-TP
     85  *
     86  * \param [in] unit -
     87  *     Relevant unit.
     88  * \param [in] control_value -
     89  *     set enabling when value is 1
     90  *     set disabling when value is 0
     91  * \return
     92  *   \retval Non-zero (!= _SHR_E_NONE) in case of an error
     93  *   \retval Zero (= _SHR_E_NONE) in case of NO ERROR
     94  */
     95 shr_error_e dnx_oam_mpls_tp_mdl_ignore_set(
     96     int unit,
     97     uint32 control_value);
     98 
     99 /**
    100  * \brief -
    101  * Get enable/disable of ignoring MDL when identifying
    102  * Y.1731 OAM over MPLS-TP
    103  *
    104  * \param [in] unit -
    105  *     Relevant unit.
    106  * \param [out] *control_value -
    107  *     value is 1 when enabled
    108  *     value is 0 when disabled
    109  * \return
    110  *   \retval Non-zero (!= _SHR_E_NONE) in case of an error
    111  *   \retval Zero (= _SHR_E_NONE) in case of NO ERROR
    112  */
    113 shr_error_e dnx_oam_mpls_tp_mdl_ignore_get(
    114     int unit,
    115     uint32 *control_value);
    116 #endif/*_OAM_INIT_INCLUDED__*/