field_destination.h (5126B)
1 /*! \file field_destination.h 2 * 3 * Field destination headfiles to declare internal APIs for ltsw devices. 4 */ 5 /* 6 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 7 * 8 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 9 */ 10 11 #ifndef BCMI_LTSW_FIELD_DESTINATION_H 12 #define BCMI_LTSW_FIELD_DESTINATION_H 13 /*! 14 * \brief Field destination init. 15 * 16 * \param [in] unit Unit number. 17 * 18 * \retval SHR_E_NONE No errors. 19 * \retval !SHR_E_NONE Failure. 20 */ 21 extern int 22 bcmint_ltsw_field_destination_init(int unit); 23 24 /*! 25 * \brief Field destination deinit. 26 * 27 * \param [in] unit Unit number. 28 * 29 * \retval SHR_E_NONE No errors. 30 * \retval !SHR_E_NONE Failure. 31 */ 32 extern int 33 bcmint_ltsw_field_destination_deinit(int unit); 34 35 /*! 36 * \brief Get the mirror index used by the Field destination entry. 37 * 38 * \param [in] unit Unit number. 39 * \param [in] match Match info. 40 * \param [out] mirror_index Mirror index. 41 * 42 * \retval SHR_E_NONE No errors. 43 * \retval !SHR_E_NONE Failure. 44 */ 45 extern int 46 bcmint_ltsw_field_destination_mirror_index_get( 47 int unit, 48 bcm_field_destination_match_t *match, 49 int *mirror_index); 50 51 /*! 52 * \brief Add a field destination entry. 53 * 54 * \param [in] unit Unit number. 55 * \param [in] options Entry operation options. 56 * \param [in] match Match info. 57 * \param [in] action Action info. 58 * 59 * \retval SHR_E_NONE No errors. 60 * \retval !SHR_E_NONE Failure. 61 */ 62 extern int 63 bcmint_ltsw_field_destination_entry_add( 64 int unit, 65 uint32 options, 66 bcm_field_destination_match_t *match, 67 bcm_field_destination_action_t *action); 68 69 /*! 70 * \brief Get a field destination entry. 71 * 72 * \param [in] unit Unit number. 73 * \param [in/out] match Match info. 74 * \param [out] action Action info. 75 * 76 * \retval SHR_E_NONE No errors. 77 * \retval !SHR_E_NONE Failure. 78 */ 79 extern int 80 bcmint_ltsw_field_destination_entry_get( 81 int unit, 82 bcm_field_destination_match_t *match, 83 bcm_field_destination_action_t *action); 84 85 /*! 86 * \brief Traverse field destination entries. 87 * 88 * \param [in] unit Unit number. 89 * \param [in] callback User callback. 90 * \param [in] user_data User cookie. 91 * 92 * \retval SHR_E_NONE No errors. 93 * \retval !SHR_E_NONE Failure. 94 */ 95 extern int 96 bcmint_ltsw_field_destination_entry_traverse( 97 int unit, 98 bcm_field_destination_entry_traverse_cb callback, 99 void *user_data); 100 101 /*! 102 * \brief Delete a field destination entry. 103 * 104 * \param [in] unit Unit number. 105 * \param [in] match Match info. 106 * 107 * \retval SHR_E_NONE No errors. 108 * \retval !SHR_E_NONE Failure. 109 */ 110 extern int 111 bcmint_ltsw_field_destination_entry_delete( 112 int unit, 113 bcm_field_destination_match_t *match); 114 115 /*! 116 * \brief Attach a flex counter to the given field destination entry. 117 * 118 * \param [in] unit Unit number. 119 * \param [in] match Match info. 120 * \param [in] ctr_id Statistic counter ID. 121 * 122 * \retval SHR_E_NONE No errors. 123 * \retval !SHR_E_NONE Failure. 124 */ 125 extern int 126 bcmint_ltsw_field_destination_stat_attach( 127 int unit, 128 bcm_field_destination_match_t *match, 129 uint32_t ctr_id); 130 131 /*! 132 * \brief Detach a flex counter from the given field destination entry. 133 * 134 * \param [in] unit Unit number. 135 * \param [in] match Match info. 136 * 137 * \retval SHR_E_NONE No errors. 138 * \retval !SHR_E_NONE Failure. 139 */ 140 extern int 141 bcmint_ltsw_field_destination_stat_detach( 142 int unit, 143 bcm_field_destination_match_t *match); 144 145 /*! 146 * \brief Get the counter ID of a flex counter attached to 147 * the given field destination entry. 148 * 149 * \param [in] unit Unit number. 150 * \param [in] match Match info. 151 * \param [out] ctr_id Counter ID. 152 * 153 * \retval SHR_E_NONE No errors. 154 * \retval !SHR_E_NONE Failure. 155 */ 156 extern int 157 bcmint_ltsw_field_destination_stat_id_get( 158 int unit, 159 bcm_field_destination_match_t *match, 160 uint32_t *ctr_id); 161 162 163 /*! 164 * \brief Set the flexctr object for the given field destination entry. 165 * 166 * \param [in] unit Unit number. 167 * \param [in] match Match info. 168 * \param [in] value Flexctr object value. 169 * 170 * \retval SHR_E_NONE No errors. 171 * \retval !SHR_E_NONE Failure. 172 */ 173 extern int 174 bcmint_ltsw_field_destination_flexctr_object_set( 175 int unit, 176 bcm_field_destination_match_t *match, 177 uint32_t value); 178 179 /*! 180 * \brief Get the flexctr object of the given field destination entry. 181 * 182 * \param [in] unit Unit number. 183 * \param [in] match Match info. 184 * \param [out] value Flexctr object value. 185 * 186 * \retval SHR_E_NONE No errors. 187 * \retval !SHR_E_NONE Failure. 188 */ 189 extern int 190 bcmint_ltsw_field_destination_flexctr_object_get( 191 int unit, 192 bcm_field_destination_match_t *match, 193 uint32_t *value); 194 195 #endif /* BCMI_LTSW_FIELD_DESTINATION_H */