openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

techsupport.h (5568B)


      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  * 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 
     17 #define DUMP_TABLE_CHANGED      (0x1 << 0)
     18 #define DUMP_DIAG_CMDS          (0x1 << 1)
     19 #define DUMP_REGISTERS          (0x1 << 2)
     20 #define DUMP_MEMORIES           (0x1 << 3)
     21 #define DUMP_LIST               (0x1 << 4)
     22 #define DUMP_SW                 (0x1 << 5)
     23 
     24 #define DUMP    "dump "
     25 #define GET_REG "getreg "
     26 #define CHANGE  "chg "
     27 #define DIAG    "diag"
     28 #define REG     "reg"
     29 #define MEM     "mem"
     30 #define VERBOSE "verbose"
     31 #ifndef BCM_SW_STATE_DUMP_DISABLE
     32 #define SW "sw"
     33 #endif /* BCM_SW_STATE_DUMP_DISABLE */
     34 #define LIST    "list"
     35 #define TECHSUPPORT "techsupport "
     36 #define MAX_STR_LEN 80
     37 
     38 #define COMMAND_ETRAP "etrap"
     39 #define COMMAND_INT "int"
     40 #define COMMAND_LATENCY_HISTOGRAM "histogram"
     41 #define COMMAND_ALPM "alpm"
     42 #define COMMAND_BASIC  "basic"
     43 #define COMMAND_COS    "cos"
     44 #define COMMAND_EFP    "efp"
     45 #define COMMAND_IFP    "ifp"
     46 #define COMMAND_L3UC   "l3uc"
     47 #define COMMAND_L3MC   "l3mc"
     48 #define COMMAND_MPLS   "mpls"
     49 #define COMMAND_MMU    "mmu"
     50 #define COMMAND_RIOT   "riot"
     51 #define COMMAND_NIV    "niv"
     52 #define COMMAND_VFP    "vfp"
     53 #define COMMAND_VLAN   "vlan"
     54 #define COMMAND_VXLAN  "vxlan"
     55 #define COMMAND_LOAD_BALANCE "load-balance"
     56 #define COMMAND_OAM    "oam"
     57 #define COMMAND_TCB "tcb"
     58 #define COMMAND_DGM "dgm"
     59 #define COMMAND_PSTAT "pstat"
     60 #define COMMAND_FLEX_FLOW "flex_flow"
     61 #define COMMAND_PHY "PHY"
     62 #define COMMAND_LEDUP "LEDUP"
     63 #define COMMAND_CMIC "cmic"
     64 #define COMMAND_VISIBILITY "visibility"
     65 #ifdef BCM_WARM_BOOT_SUPPORT
     66 #define COMMAND_WARMBOOT "warmboot"
     67 #endif
     68 #define COMMAND_CANCUN "cancun"
     69  /* registername and type(global or per port) */
     70 
     71 typedef enum register_type_e {
     72     register_type_per_port = 1,
     73     register_type_global
     74 }register_type_t;
     75 
     76 typedef struct techsupport_reg_s {
     77     soc_reg_t reg;
     78     register_type_t register_type; /*Currently all registers default to register_type_global*/
     79 } techsupport_reg_t ;
     80 
     81 
     82 typedef struct techsupport_data_s {
     83     char ** techsupport_data_diag_cmdlist;
     84     techsupport_reg_t *techsupport_data_reg_list;
     85     soc_mem_t *techsupport_data_mem_list;
     86     char ** techsupport_data_device_diag_cmdlist;
     87 #ifndef BCM_SW_STATE_DUMP_DISABLE
     88     char ** techsupport_data_sw_dump_cmdlist;
     89     char ** techsupport_data_device_sw_dump_cmdlist;
     90 #endif /* BCM_SW_STATE_DUMP_DISABLE */
     91  }techsupport_data_t;
     92 
     93 typedef struct mbcm_techsupport_s {
     94     const char *techsupport_feature_name;
     95     techsupport_data_t *techsupport_data;
     96 } mbcm_techsupport_t;
     97 
     98 int techsupport_feature_process(int unit, args_t *a,
     99                           techsupport_data_t *techsupport_feature_data);
    100 
    101 void techsupport_command_execute(int unit, char *command);
    102 cmd_result_t command_techsupport(int unit, args_t *a);
    103 int techsupport_l3uc(int unit, args_t *a, techsupport_data_t *techsupport_data);
    104 int techsupport_basic(int unit, args_t *a, techsupport_data_t *techsupport_data);
    105 int techsupport_l3mc(int unit, args_t *a, techsupport_data_t *techsupport_data);
    106 int techsupport_mpls(int unit, args_t *a, techsupport_data_t *techsupport_data);
    107 int techsupport_mmu(int unit, args_t *a, techsupport_data_t *techsupport_data);
    108 int techsupport_niv(int unit, args_t *a, techsupport_data_t *techsupport_data);
    109 int techsupport_riot(int unit, args_t *a, techsupport_data_t *techsupport_data);
    110 int techsupport_vlan(int unit, args_t *a, techsupport_data_t *techsupport_data);
    111 int techsupport_vxlan(int unit, args_t *a, techsupport_data_t *techsupport_data);
    112 int techsupport_flex_flow(int unit, args_t *a, techsupport_data_t *techsupport_data);
    113 int techsupport_cos(int unit, args_t *a, techsupport_data_t *techsupport_data);
    114 int techsupport_efp(int unit, args_t *a, techsupport_data_t *techsupport_data);
    115 int techsupport_ifp(int unit, args_t *a, techsupport_data_t *techsupport_data);
    116 int techsupport_vfp(int unit, args_t *a, techsupport_data_t *techsupport_data);
    117 int techsupport_loadbalance(int unit, args_t *a, techsupport_data_t *techsupport_data);
    118 int techsupport_oam(int unit, args_t *a, techsupport_data_t *techsupport_data);
    119 int techsupport_tcb(int unit, args_t *a, techsupport_data_t *techsupport_data);
    120 int techsupport_dgm(int unit, args_t *a, techsupport_data_t *techsupport_data);
    121 int techsupport_pstat(int unit, args_t *a, techsupport_data_t *techsupport_data);
    122 int techsupport_phy(int unit, args_t *a, techsupport_data_t *techsupport_data);
    123 int techsupport_ledup(int unit, args_t *a, techsupport_data_t *techsupport_data);
    124 int techsupport_cmic(int unit, args_t *a, techsupport_data_t *techsupport_data);
    125 int techsupport_visibility(int unit, args_t *a, techsupport_data_t *techsupport_data);
    126 #ifdef BCM_WARM_BOOT_SUPPORT
    127 int techsupport_warmboot(int unit, args_t *a, techsupport_data_t *techsupport_data);
    128 #endif
    129 int techsupport_etrap(int unit, args_t *a, techsupport_data_t *techsupport_data);
    130 int techsupport_int(int unit, args_t *a, techsupport_data_t *techsupport_data);
    131 int techsupport_histogram(int unit, args_t *a, techsupport_data_t *techsupport_data);
    132 int techsupport_alpm(int unit, args_t *a, techsupport_data_t *techsupport_data);
    133 int techsupport_cancun(int unit, args_t *a, techsupport_data_t *techsupport_data);