1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2014-2021 Broadcom 3 * All rights reserved. 4 */ 5 6 #ifndef _TF_UTIL_H_ 7 #define _TF_UTIL_H_ 8 9 #include "tf_core.h" 10 #include "tf_device.h" 11 12 /** 13 * Helper function converting direction to text string 14 * 15 * [in] dir 16 * Receive or transmit direction identifier 17 * 18 * Returns: 19 * Pointer to a char string holding the string for the direction 20 */ 21 const char *tf_dir_2_str(enum tf_dir dir); 22 23 /** 24 * Helper function converting identifier to text string 25 * 26 * [in] id_type 27 * Identifier type 28 * 29 * Returns: 30 * Pointer to a char string holding the string for the identifier 31 */ 32 const char *tf_ident_2_str(enum tf_identifier_type id_type); 33 34 /** 35 * Helper function converting tcam type to text string 36 * 37 * [in] tcam_type 38 * TCAM type 39 * 40 * Returns: 41 * Pointer to a char string holding the string for the tcam 42 */ 43 const char *tf_tcam_tbl_2_str(enum tf_tcam_tbl_type tcam_type); 44 45 /** 46 * Helper function converting tbl type to text string 47 * 48 * [in] tbl_type 49 * Table type 50 * 51 * Returns: 52 * Pointer to a char string holding the string for the table type 53 */ 54 const char *tf_tbl_type_2_str(enum tf_tbl_type tbl_type); 55 56 /** 57 * Helper function converting em tbl type to text string 58 * 59 * [in] em_type 60 * EM type 61 * 62 * Returns: 63 * Pointer to a char string holding the string for the EM type 64 */ 65 const char *tf_em_tbl_type_2_str(enum tf_em_tbl_type em_type); 66 67 /** 68 * Helper function converting device module type and module type to 69 * text string. 70 * 71 * [in] dm_type 72 * Device Module type 73 * 74 * [in] mod_type 75 * Module specific type 76 * 77 * Returns: 78 * Pointer to a char string holding the string for the EM type 79 */ 80 const char *tf_device_module_type_subtype_2_str 81 (enum tf_device_module_type dm_type, 82 uint16_t mod_type); 83 84 /** 85 * Helper function converting device module type to text string 86 * 87 * [in] dm_type 88 * Device Module type 89 * 90 * [in] mod_type 91 * Module specific type 92 * 93 * Returns: 94 * Pointer to a char string holding the string for the EM type 95 */ 96 const char *tf_device_module_type_2_str(enum tf_device_module_type dm_type); 97 98 #endif /* _TF_UTIL_H_ */ 99