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

buffer.c (1417B)


      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  * Diag CLI Buffer command
      8  */
      9 
     10 #include <soc/defs.h>
     11 #if defined(BCM_TRIDENT_SUPPORT) || defined(BCM_TRIUMPH3_SUPPORT)
     12 
     13 #include <appl/diag/system.h>
     14 #include <appl/diag/parse.h>
     15 #include <shared/bsl.h>
     16 #include <bcm/error.h>
     17 
     18 #ifdef BCM_TRIDENT_SUPPORT
     19 #include <soc/trident.h>
     20 #endif /*BCM_TRIDENT_SUPPORT */
     21 
     22 #ifdef BCM_TRIUMPH3_SUPPORT
     23 #include <soc/triumph3.h>
     24 #endif /*BCM_TRIUMPH3_SUPPORT */
     25 
     26 char cmd_buffer_usage[] =
     27     "  buffer <object> [<attribute>=<value>] ...\n"
     28     "  buffer check\n";
     29 
     30 cmd_result_t
     31 cmd_buffer(int unit, args_t *arg)
     32 {
     33     char *subcmd;
     34     int rv = 0;
     35 
     36     subcmd = ARG_GET(arg);
     37     if (subcmd == NULL) {
     38         return CMD_USAGE;
     39     }
     40 
     41     if (!sal_strcasecmp(subcmd, "check")) {
     42 #ifdef BCM_TRIUMPH3_SUPPORT
     43         if (SOC_IS_TRIUMPH3(unit)) {
     44             rv = soc_tr3_mmu_config_init(unit, TRUE);
     45         }
     46 #endif
     47 
     48 #ifdef BCM_TRIDENT_SUPPORT
     49         if (SOC_IS_TRIDENT(unit)) {
     50             rv = soc_trident_mmu_config_init(unit, TRUE);
     51         }
     52 #endif
     53     } else {
     54         return CMD_USAGE;
     55     }
     56 
     57     if (rv < 0) {
     58         cli_out("%s: ERROR: %s\n", ARG_CMD(arg), bcm_errmsg(rv));
     59         return CMD_FAIL;
     60     }
     61 
     62     return CMD_OK;
     63 }
     64 
     65 #endif /* BCM_TRIDENT_SUPPORT */