cosq_dbal_utils.h (2287B)
1 /** 2 * \file cosq_dbal_utils.h 3 * 4 * 5 * Generic DBAL access functionality 6 * 7 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 8 * 9 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 10 */ 11 12 #ifndef COSQ_DBAL_UTILS_H_INCLUDED 13 /* { */ 14 #define COSQ_DBAL_UTILS_H_INCLUDED 15 16 #ifndef BCM_DNX_SUPPORT 17 #error "This file is for use by DNX (JR2) family only!" 18 #endif 19 20 #include <bcm/types.h> 21 #include <bcm/cosq.h> 22 #include <soc/dnx/dbal/dbal.h> 23 #include <sal/core/libc.h> 24 25 /* 26 * Definess: 27 * { 28 */ 29 /* 30 * } 31 */ 32 /* 33 * Typedefs: 34 * { 35 */ 36 typedef struct 37 { 38 dbal_fields_e id; 39 uint32 value; 40 } dnx_cosq_dbal_field_t; 41 /* 42 * } 43 */ 44 /* 45 * Functions 46 * { 47 */ 48 /** 49 * \brief - set a value to dbal table entry 50 * 51 * \param [in] unit - unit index 52 * \param [in] table_id - dbal table ID 53 * \param [in] nof_keys - number of keys in the dbal table 54 * \param [in] key - array of keys (id and value) 55 * \param [in] result - dbal result field (id and value) 56 * 57 * \return 58 * shr_error_e 59 * 60 * \remark 61 * * 62 * \see 63 * * None 64 */ 65 shr_error_e dnx_cosq_dbal_entry_set( 66 int unit, 67 dbal_tables_e table_id, 68 int nof_keys, 69 dnx_cosq_dbal_field_t key[], 70 dnx_cosq_dbal_field_t * result); 71 72 /** 73 * \brief - get a value from dbal table entry 74 * 75 * \param [in] unit - unit index 76 * \param [in] table_id - dbal table ID 77 * \param [in] nof_keys - number of keys in the dbal table 78 * \param [in] key - array of keys (id and value) 79 * \param [in,out] result - dbal result field (id and value) 80 * 81 * \return 82 * shr_error_e 83 * 84 * \remark 85 * * 86 * \see 87 * * None 88 */ 89 shr_error_e dnx_cosq_dbal_entry_get( 90 int unit, 91 dbal_tables_e table_id, 92 int nof_keys, 93 dnx_cosq_dbal_field_t key[], 94 dnx_cosq_dbal_field_t * result); 95 96 /** 97 * \brief - return TRUE iff a key exists in the table 98 * 99 * \param [in] unit - unit index 100 * \param [in] table_id - dbal table ID 101 * \param [in] key_field_id - ID of key field 102 * \param [out] exists - does key exist in the table 103 * 104 * \return 105 * shr_error_e 106 * 107 * \remark 108 * * 109 * \see 110 * * None 111 */ 112 shr_error_e dnx_cosq_dbal_key_exists_in_table( 113 int unit, 114 dbal_tables_e table_id, 115 dbal_fields_e key_field_id, 116 int *exists); 117 /* 118 * } 119 */ 120 /* } */ 121 #endif