phymod_symbol_dump.c (1089B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 */ 7 8 #include <phymod/phymod_symbols.h> 9 10 #if PHYMOD_CONFIG_INCLUDE_CHIP_SYMBOLS == 1 11 12 /* 13 * Function: 14 * phymod_symbol_dump 15 * Purpose: 16 * Lookup symbol name and display all fields 17 * Parameters: 18 * name - symbol name 19 * symbols - symbol table to search 20 * data - symbol data (one or more 32-bit words) 21 * Returns: 22 * -1 if symbol not found 23 */ 24 int 25 phymod_symbol_dump(const char *name, const phymod_symbols_t *symbols, 26 uint32_t *data, 27 int (*print_str)(const char *str)) 28 { 29 int rv; 30 phymod_symbol_t symbol; 31 32 if ((rv = phymod_symbols_find(name, symbols, &symbol)) == 0) { 33 phymod_symbol_show_fields(&symbol, symbols->field_names, data, 0, 34 print_str, 35 phymod_symbol_field_filter, data); 36 } 37 38 return rv; 39 } 40 41 #endif /* PHYMOD_CONFIG_INCLUDE_CHIP_SYMBOLS */