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

srv6.h (2534B)


      1 /*! \file bcm_int/dnx/srv6/srv6.h
      2  *
      3  * Internal DNX SRv6 APIs
      4  *
      5  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      6  * 
      7  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      8  */
      9 
     10 #include <bcm/types.h>
     11 #include <bcm_int/dnx_dispatch.h>
     12 #include <soc/dnx/dbal/dbal.h>
     13 
     14 #ifndef _SRV6_API_INCLUDED__
     15 /*
     16  * {
     17  */
     18 #define _SRV6_API_INCLUDED__
     19 
     20 #ifndef BCM_DNX_SUPPORT
     21 #error "This file is for use by DNX (JR2) family only!"
     22 #endif
     23 
     24 /*
     25  * Include files
     26  * {
     27  */
     28 
     29 /*
     30  * }
     31  */
     32 
     33 /*
     34  * DEFINEs
     35  * {
     36  */
     37 /*
     38  * }
     39  */
     40 /*
     41  * MACROs
     42  * {
     43  */
     44 /*
     45  * }
     46  */
     47 
     48 /*
     49  * INERNAL TYPES
     50  * {
     51  */
     52 /*
     53  * }
     54  */
     55 
     56 /*
     57  * APIS
     58  * {
     59  */
     60 /**
     61  * \brief 
     62  *      Initialize DNX SRv6 module 
     63  * \param [in] unit -
     64  *     Relevant unit.
     65  * \return
     66  *   shr_error_e -\n
     67  *     See error code description.
     68  * \see
     69  *   shr_error_e
     70  */
     71 shr_error_e dnx_srv6_init(
     72     int unit);
     73 
     74 /**
     75  * \brief - API sets the SRv6 Virtual Register and SW States for:
     76  *          - Set to Egress PSP mode - '1', or USP - '0'.
     77  *            Default after BCM Init is USP.
     78  *          - Set Encapsulation Reduced mode - '1', or Normal - '0'.
     79  *            Default after BCM Init is Normal.
     80  *
     81  *   \param [in] unit - unit ID
     82  *   \param [in] type - switch control type:
     83  *                        bcmSwitchSRV6EgressPSPEnable - use to set to Egress PSP mode
     84  *                        bcmSwitchSRV6ReducedModeEnable use to set to Reduced encapsulation mode
     85  *    \param [in] value - the value to set above modes - 1 or 0.
     86  *
     87  * \return
     88  *   \retval shr_error_e - Negative in case of an error, zero in case all ok.
     89  */
     90 shr_error_e dnx_switch_srv6_modes_set(
     91     int unit,
     92     bcm_switch_control_t type,
     93     int value);
     94 
     95 /**
     96  * \brief - API gets the SRv6 Virtual Register and SW States for:
     97  *          - Get the Egress PSP mode - '1', or USP - '0'.
     98  *          - Get Encapsulation Reduced mode - '1', or Normal - '0'.
     99  *
    100  *   \param [in] unit - unit ID
    101  *   \param [in] type - switch control type:
    102  *                        bcmSwitchSRV6EgressPSPEnable - use to set to Egress PSP mode
    103  *                        bcmSwitchSRV6ReducedModeEnable use to set to Reduced encapsulation mode
    104  *    \param [in] value - the value of the Egress or encapsulation mode as set by type
    105  *
    106  * \return
    107  *   \retval shr_error_e - Negative in case of an error, zero in case all ok.
    108  */
    109 shr_error_e dnx_switch_srv6_modes_get(
    110     int unit,
    111     bcm_switch_control_t type,
    112     int *value);
    113 
    114 /*
    115  * } 
    116  */
    117 #endif/*_SRv6_API_INCLUDED__*/