techsupport.h (6329B)
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-2020 Broadcom Inc. All rights reserved. 6 * 7 * File: techsupport.h 8 * Purpose: This file contains the declarations of all the functions and 9 * data structures that is being used in the TechSupport utility. 10 */ 11 12 #include <appl/diag/parse.h> 13 #include <soc/mcm/allenum.h> 14 #include <appl/diag/shell.h> 15 #include <bcm/switch.h> 16 #include <soc/defs.h> 17 18 #define DUMP_TABLE_CHANGED (0x1 << 0) 19 #define DUMP_DIAG_CMDS (0x1 << 1) 20 #define DUMP_REGISTERS (0x1 << 2) 21 #define DUMP_MEMORIES (0x1 << 3) 22 #define DUMP_LIST (0x1 << 4) 23 #define DUMP_SW (0x1 << 5) 24 25 #define DUMP "dump " 26 #define GET_REG "getreg " 27 #define CHANGE "chg " 28 #define DIAG "diag" 29 #define REG "reg" 30 #define MEM "mem" 31 #define VERBOSE "verbose" 32 #ifndef BCM_SW_STATE_DUMP_DISABLE 33 #define SW "sw" 34 #endif /* BCM_SW_STATE_DUMP_DISABLE */ 35 #define LIST "list" 36 #define SCRIPT_GEN "generate-script" 37 #define TECHSUPPORT "techsupport " 38 #define MAX_STR_LEN 80 39 40 #define COMMAND_ETRAP "etrap" 41 #define COMMAND_INT "int" 42 #define COMMAND_LATENCY_HISTOGRAM "histogram" 43 #define COMMAND_ALPM "alpm" 44 #define COMMAND_BASIC "basic" 45 #define COMMAND_COS "cos" 46 #define COMMAND_EFP "efp" 47 #define COMMAND_IFP "ifp" 48 #define COMMAND_L3UC "l3uc" 49 #define COMMAND_L3MC "l3mc" 50 #define COMMAND_MPLS "mpls" 51 #define COMMAND_MMU "mmu" 52 #define COMMAND_RIOT "riot" 53 #define COMMAND_NIV "niv" 54 #define COMMAND_VFP "vfp" 55 #define COMMAND_VLAN "vlan" 56 #define COMMAND_VXLAN "vxlan" 57 #define COMMAND_LOAD_BALANCE "load-balance" 58 #define COMMAND_OAM "oam" 59 #define COMMAND_TCB "tcb" 60 #define COMMAND_DGM "dgm" 61 #define COMMAND_PSTAT "pstat" 62 #define COMMAND_FLEX_FLOW "flex_flow" 63 #define COMMAND_PHY "PHY" 64 #define COMMAND_LEDUP "LEDUP" 65 #define COMMAND_CMIC "cmic" 66 #define COMMAND_VISIBILITY "visibility" 67 #ifdef BCM_WARM_BOOT_SUPPORT 68 #define COMMAND_WARMBOOT "warmboot" 69 #endif 70 #define COMMAND_CANCUN "cancun" 71 #ifdef INCLUDE_XFLOW_MACSEC 72 #define COMMAND_XFLOW_MACSEC "xflow-macsec" 73 #endif 74 #ifdef BCM_FLOWTRACKER_SUPPORT 75 #define COMMAND_FLOWTRACKER "flowtracker" 76 #endif 77 #ifdef BCM_MONTEREY_SUPPORT 78 #define COMMAND_CPRI "cpri" 79 #define COMMAND_RSVD4 "rsvd4" 80 #endif 81 /* registername and type(global or per port) */ 82 83 typedef enum register_type_e { 84 register_type_per_port = 1, 85 register_type_global 86 }register_type_t; 87 88 typedef struct techsupport_reg_s { 89 soc_reg_t reg; 90 register_type_t register_type; /*Currently all registers default to register_type_global*/ 91 } techsupport_reg_t ; 92 93 94 typedef struct techsupport_data_s { 95 char ** techsupport_data_diag_cmdlist; 96 techsupport_reg_t *techsupport_data_reg_list; 97 soc_mem_t *techsupport_data_mem_list; 98 char ** techsupport_data_device_diag_cmdlist; 99 #ifndef BCM_SW_STATE_DUMP_DISABLE 100 char ** techsupport_data_sw_dump_cmdlist; 101 char ** techsupport_data_device_sw_dump_cmdlist; 102 #endif /* BCM_SW_STATE_DUMP_DISABLE */ 103 }techsupport_data_t; 104 105 typedef struct mbcm_techsupport_s { 106 const char *techsupport_feature_name; 107 techsupport_data_t *techsupport_data; 108 } mbcm_techsupport_t; 109 110 int techsupport_feature_process(int unit, args_t *a, 111 techsupport_data_t *techsupport_feature_data); 112 113 void techsupport_command_execute(int unit, char *command); 114 cmd_result_t command_techsupport(int unit, args_t *a); 115 int techsupport_l3uc(int unit, args_t *a, techsupport_data_t *techsupport_data); 116 int techsupport_basic(int unit, args_t *a, techsupport_data_t *techsupport_data); 117 int techsupport_l3mc(int unit, args_t *a, techsupport_data_t *techsupport_data); 118 int techsupport_mpls(int unit, args_t *a, techsupport_data_t *techsupport_data); 119 int techsupport_mmu(int unit, args_t *a, techsupport_data_t *techsupport_data); 120 int techsupport_niv(int unit, args_t *a, techsupport_data_t *techsupport_data); 121 int techsupport_riot(int unit, args_t *a, techsupport_data_t *techsupport_data); 122 int techsupport_vlan(int unit, args_t *a, techsupport_data_t *techsupport_data); 123 int techsupport_vxlan(int unit, args_t *a, techsupport_data_t *techsupport_data); 124 int techsupport_flex_flow(int unit, args_t *a, techsupport_data_t *techsupport_data); 125 int techsupport_cos(int unit, args_t *a, techsupport_data_t *techsupport_data); 126 int techsupport_efp(int unit, args_t *a, techsupport_data_t *techsupport_data); 127 int techsupport_ifp(int unit, args_t *a, techsupport_data_t *techsupport_data); 128 int techsupport_vfp(int unit, args_t *a, techsupport_data_t *techsupport_data); 129 int techsupport_loadbalance(int unit, args_t *a, techsupport_data_t *techsupport_data); 130 int techsupport_oam(int unit, args_t *a, techsupport_data_t *techsupport_data); 131 int techsupport_tcb(int unit, args_t *a, techsupport_data_t *techsupport_data); 132 int techsupport_dgm(int unit, args_t *a, techsupport_data_t *techsupport_data); 133 int techsupport_pstat(int unit, args_t *a, techsupport_data_t *techsupport_data); 134 int techsupport_phy(int unit, args_t *a, techsupport_data_t *techsupport_data); 135 int techsupport_ledup(int unit, args_t *a, techsupport_data_t *techsupport_data); 136 int techsupport_cmic(int unit, args_t *a, techsupport_data_t *techsupport_data); 137 int techsupport_visibility(int unit, args_t *a, techsupport_data_t *techsupport_data); 138 #ifdef BCM_MONTEREY_SUPPORT 139 int techsupport_cpri(int unit, args_t *a, techsupport_data_t *techsupport_data); 140 int techsupport_rsvd4(int unit, args_t *a, techsupport_data_t *techsupport_data); 141 #endif 142 #ifdef BCM_WARM_BOOT_SUPPORT 143 int techsupport_warmboot(int unit, args_t *a, techsupport_data_t *techsupport_data); 144 #endif 145 int techsupport_etrap(int unit, args_t *a, techsupport_data_t *techsupport_data); 146 int techsupport_int(int unit, args_t *a, techsupport_data_t *techsupport_data); 147 int techsupport_histogram(int unit, args_t *a, techsupport_data_t *techsupport_data); 148 int techsupport_alpm(int unit, args_t *a, techsupport_data_t *techsupport_data); 149 int techsupport_cancun(int unit, args_t *a, techsupport_data_t *techsupport_data); 150 #ifdef INCLUDE_XFLOW_MACSEC 151 int techsupport_xflow_macsec(int unit, args_t *a, techsupport_data_t *techsupport_data); 152 #endif 153 #ifdef BCM_FLOWTRACKER_SUPPORT 154 int techsupport_flowtracker(int unit, args_t *a, techsupport_data_t *techsupport_data); 155 #endif