[][openwrt][common][app][Add ethswbox MR1 V1.3.0.0 for Mxl862xx]
[Description]
Add ethswbox MR1 V1.3.0.0 for Mxl862xx
[Release-log]
N/A
Change-Id: Ida83dd5aed9725e503ab35e8172c875f0043469e
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9697310
diff --git a/feed/app/ethswbox/Makefile b/feed/app/ethswbox/Makefile
index d8819df..c9b1226 100644
--- a/feed/app/ethswbox/Makefile
+++ b/feed/app/ethswbox/Makefile
@@ -24,7 +24,6 @@
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
- CFLAGS="$(TARGET_CFLAGS) -Wall -Wextra" \
LDFLAGS="$(TARGET_LDFLAGS)"
endef
diff --git a/feed/app/ethswbox/src/Makefile b/feed/app/ethswbox/src/Makefile
index 0756c79..a07c35b 100644
--- a/feed/app/ethswbox/src/Makefile
+++ b/feed/app/ethswbox/src/Makefile
@@ -1,27 +1,32 @@
# SPDX-License-Identifier: GPL-2.0-or-later */
#
+CFLAGS = -Wall -Wextra -DCONFIG_GSWIP_MAC -DCONFIG_GSWIP_EVLAN \
+ -DCONFIG_GSWIP_MCAST -DCONFIG_GSWIP_STP
+
# Include directories
-INCLUDES := -Iexample/cli/cmds \
- -Iexample/cli/ \
- -Iexample/fapi \
- -Iexample/os \
- -Iexample \
- -Iswitch_hostapi/include/gpy \
- -Iswitch_hostapi/include/gswip \
- -Iswitch_hostapi/src \
- -Iswitch_ioctl/src
+INCLUDES := -Iexample/ethswbox_sdk/src \
+ -Iexample/ethswbox_sdk/src/cli \
+ -Iexample/ethswbox_sdk/src/cli/cmds \
+ -Iexample/ethswbox_sdk/src/fapi \
+ -Iexample/ethswbox_sdk/src/os \
+ -Iswitch_hostapi/include/gpy \
+ -Iswitch_hostapi/include/gswip \
+ -Iswitch_hostapi/src \
+ -Iswitch_ioctl/src
# Source files
-SRCS := $(wildcard example/cli/cmds/*.c) \
- $(wildcard example/cli/*.c) \
- $(wildcard example/fapi/*.c) \
+SRCS := $(wildcard example/ethswbox_sdk/src/cli/*.c) \
+ $(wildcard example/ethswbox_sdk/src/cli/cmds/*.c) \
+ $(wildcard example/ethswbox_sdk/src/fapi/*.c) \
+ $(wildcard example/ethswbox_sdk/src/os/*.c) \
$(wildcard switch_ioctl/src/*.c) \
switch_hostapi/src/gsw_api.c \
switch_hostapi/src/gsw_cli_common.c \
- switch_hostapi/src/host_adapt.c \
+ switch_hostapi/src/gsw_ss.c \
+ switch_hostapi/src/host_adapt_user.c \
switch_hostapi/src/host_api_impl.c \
- switch_hostapi/src/host_smdio_ssb.c \
+ switch_hostapi/src/host_smdio_ssb_user.c \
switch_hostapi/src/mdio_relay.c \
switch_hostapi/src/sys_misc.c
@@ -36,7 +41,7 @@
all: $(TARGET)
$(TARGET): $(OBJS)
- $(CC) $(LDFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
diff --git a/feed/app/ethswbox/src/example/CMakeLists.txt b/feed/app/ethswbox/src/example/CMakeLists.txt
deleted file mode 100644
index 303d705..0000000
--- a/feed/app/ethswbox/src/example/CMakeLists.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-cmake_minimum_required(VERSION 3.1)
-project(EthSwBox VERSION 1.0.0
- DESCRIPTION "Ethernet SW Toolbox for RPI4 Standalone MxL862xxEthTool"
- LANGUAGES C)
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
- ${CMAKE_CURRENT_SOURCE_DIR})
-
-
-
-#####################
-# OS directory #
-#####################
-SET (os_DIR os)
-#add_library (os ${os_SRCS})
-
-
-#####################
-# Example directory #
-#####################
-SET (example_DIR .)
-
-
-#####################
-# CLI directory #
-#####################
-SET (cli_DIR cli)
-SET (cli_SRCS ${cli_DIR}/cmds/cmds.c
- ${cli_DIR}/cmds/cmds_fapi.c
- ${cli_DIR}/cmds/cmds_apps_ssb.c
- )
-
-add_library (cli ${cli_SRCS})
-
-
-#########################
-# FAPI directory #
-#########################
-SET (fapi_DIR fapi)
-SET (fapi_SRCS ${fapi_DIR}/fapi_gsw_hostapi_mdio_relay.c
- ${fapi_DIR}/fapi_gsw_hostapi.c)
-
-add_library (fapi ${fapi_SRCS})
-
-
-####################
-# GSW HOSTAPI directory #
-####################
-SET (gsw_hostapi_DIR ../switch_hostapi)
-
-SET (gsw_hostapi_SRCS ${gsw_hostapi_DIR}/src/gsw_api.c
- ${gsw_hostapi_DIR}/src/host_adapt.c
- ${gsw_hostapi_DIR}/src/host_api_impl.c
- ${gsw_hostapi_DIR}/src/mdio_relay.c
- ${gsw_hostapi_DIR}/src/gsw_cli_common.c
- ${gsw_hostapi_DIR}/src/sys_misc.c
- ${gsw_hostapi_DIR}/src/host_smdio_ssb.c
- )
-add_library (gsw_hostapi ${gsw_hostapi_SRCS})
-
-
-#########################
-# Includes path #
-#########################
-include_directories (${example_DIR}
- ${fapi_DIR}
- ${cli_DIR}
- ${cli_DIR}/cmds
- ${gsw_hostapi_DIR}/src
- ${gsw_hostapi_DIR}/include/gpy
- ${gsw_hostapi_DIR}/include/gswip
- ${os_DIR}
- )
-
-
-#########################
-# Definition #
-#########################
-#add_definitions(-DCONFIG_GSWIP_EVLAN -DCONFIG_GSWIP_MAC -DCONFIG_GSWIP_MCAST -DCONFIG_GSWIP_STP)
-
-
-#############################
-# ethswbox application #
-#############################
-add_executable(ethswbox ${cli_DIR}/ethswbox.c)
-target_link_libraries(ethswbox cli fapi gsw_hostapi)
diff --git a/feed/app/ethswbox/src/example/cli/cmds/cmds.c b/feed/app/ethswbox/src/example/cli/cmds/cmds.c
deleted file mode 100644
index 08ddf3c..0000000
--- a/feed/app/ethswbox/src/example/cli/cmds/cmds.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/******************************************************************************
-
- Copyright 2022 Maxlinear
-
- SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
-
- For licensing information, see the file 'LICENSE' in the root folder of
- this software module.
-******************************************************************************/
-
-/**
- \file cmds.c
-*/
-
-
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "os_types.h"
-
-#include "cmds.h"
-#include "cmds_fapi.h"
-#include "cmds_apps_ssb.h"
-
-
-/* ========================================================================== */
-/* Function prototypes */
-/* ========================================================================== */
-static CmdArgs_t* cmds_update_args (int prmc, char *name, char *prmv[]);
-static unsigned long int string2val (char *s);
-static void cmds_help (void);
-
-
-
-/* command arguments */
-static CmdArgs_t cmds_Args;
-
-static CmdArgs_t* cmds_update_args (int prmc, char *name, char *prmv[])
-{
- int i;
- memset (&cmds_Args, 0, sizeof (cmds_Args));
-
- for (i = 0; i < ARG_COUNT; i++)
- {
- if (prmc > i)
- {
- cmds_Args.prmvi[i] = (int)string2val(prmv[i]);
- cmds_Args.prmvs[i] = prmv[i];
- }
- else
- break;
- }
-
- cmds_Args.name = name;
- cmds_Args.prmc = prmc;
-
- return &cmds_Args;
-}
-
-
-/*
- * string2val:
- * hexadecimal -> 0x[0-9 AaBbCcDdEeFf]
- * decimal -> [0-9]
- * illegal: return 0;
- */
-static unsigned long int string2val (char *s)
-{
- int base = 10;
- char *p = s;
-
- /* hexadecimal value start with 0x */
- if (s[0] == '0' && s[1] == 'x')
- {
- base = 16;
- p += 2;
-
- for ( ; *p; p++)
- {
- if ((*p < '0' || *p > 'f') || (*p > '9' && *p < 'A') || (*p > 'F' && *p < 'a'))
- {
- printf ("string2val: Illegal hexadecimal value!\n");
- return 0;
- }
- }
- }
- else
- {
- /* otherwise decimal value */
- base = 10;
- for ( ; *p; p++)
- {
- if ((*p < '0' || *p > '9'))
- {
- return 0;
- }
- }
- }
-
- /* return the value according to base 10 or 16 */
- return strtoul (s, &p, base);
-}
-
-
-
-
-OS_boolean_t cmds(char *name, int prmc, char *prmv[],
- int *err)
-{
- OS_boolean_t api_executed;
- int ret;
- CmdArgs_t* pCmdArgs;
-
- pCmdArgs = cmds_update_args (prmc, name, prmv);
-
- if (cmds_fapi (pCmdArgs, &ret) == OS_TRUE)
- {
- return ret;
- }
- if (cmds_ssb (pCmdArgs, &ret) == OS_TRUE)
- {
- return ret;
- }
-
- ret = OS_SUCCESS;
- api_executed = OS_TRUE;
-
- /*****************************************
- * CLI CMD *
- *****************************************/
- if ((strcmp(name, "cmds-help") == 0 ) || (strcmp(name, "cmds-?") == 0))
- {
- cmds_help ();
- }
-
-
- /***************
- * No command *
- ***************/
- else
- {
- api_executed = OS_FALSE;
- }
-
- *err = ret;
- return api_executed;
-}
-
-
-int cmds_symlink_set (void)
-{
- int ret = 0;
-
- /* Create cmds symbolic links */
- ret |= cmds_fapi_symlink_set ();
- ret |= cmds_ssb_symlink_set ();
- return ret;
-}
-
-
-static void cmds_help (void)
-{
- printf ("+------------------------------------------------------------------+\n");
- printf ("| HELP ! |\n");
- printf ("| Ethernet Software Toolbox (%s) |\n", ETHSWBOX_VERSION_STR);
- printf ("| |\n");
- printf ("| CMDS |\n");
- printf ("+------------------------------------------------------------------+\n");
- printf ("| |\n");
- printf ("+------------------------------------------------------------------+\n");
- printf ("\n");
-}
\ No newline at end of file
diff --git a/feed/app/ethswbox/src/example/cli/cmds/cmds_apps_ssb.c b/feed/app/ethswbox/src/example/cli/cmds/cmds_apps_ssb.c
deleted file mode 100644
index 94ccc76..0000000
--- a/feed/app/ethswbox/src/example/cli/cmds/cmds_apps_ssb.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/******************************************************************************
-
- Copyright 2022 Maxlinear
-
- SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
-
- For licensing information, see the file 'LICENSE' in the root folder of
- this software module.
-******************************************************************************/
-
-/**
- \file cmds_lif.c
- Implements CLI commands for lif mdio
-
-*/
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "os_types.h"
-
-#include "cmds.h"
-#include "cmds_apps_ssb.h"
-#include "host_smdio_ssb.h"
-
-
-/* ========================================================================== */
-/* Function prototypes */
-/* ========================================================================== */
-static void cmds_ssb_help (void);
-
-
-
-
-OS_boolean_t cmds_ssb (CmdArgs_t* pArgs, int *err)
-{
- OS_boolean_t api_executed;
- int32_t ret;
-
- if (pArgs == NULL)
- {
- *err = OS_ERROR;
- return OS_TRUE;
- }
-
- ret = OS_SUCCESS;
- api_executed = OS_TRUE;
-
-
- /******************************************
- * ssb CLI cmds *
- ******************************************/
-
- if ((strcmp(pArgs->name, "cmds-lif-help") == 0 ) || (strcmp(pArgs->name, "cmds-lif-?") == 0))
- {
- cmds_ssb_help ();
- }
-
- /***************************************
- * cmds_ssb: *
- * - ssb-read-file *
- * ************************************/
-
- else if (strcmp(pArgs->name, "ssb_smdio_download") == 0)
- {
- char* file_to_read;
- unsigned char *pdata;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: ssb_smdio_download\n");
- printf ("file_path: Path to File\n");
-
- goto goto_end_help;
- }
- file_to_read = pArgs->prmvs [0];
-
- ssb_load(file_to_read);
- }
-
-
-
- /***************
- * No command *
- ***************/
- else
- {
- api_executed = OS_FALSE;
- }
-
-goto_end_help:
- *err = ( int)ret;
- return api_executed;
-}
-
-
-int cmds_ssb_symlink_set (void)
-{
- system ("ln -sf ./ethswbox /usr/sbin/ssb_smdio_download");
- return OS_SUCCESS;
-}
-
-
-static void cmds_ssb_help (void)
-{
- printf ("+------------------------------------------------------------------+\n");
- printf ("| HELP ! |\n");
- printf ("| |\n");
- printf ("+------------------------------------------------------------------+\n");
- printf ("| ssb_smdio_download : Load FW |\n");
- printf ("\n");
-}
diff --git a/feed/app/ethswbox/src/example/cli/cmds/cmds_apps_ssb.h b/feed/app/ethswbox/src/example/cli/cmds/cmds_apps_ssb.h
deleted file mode 100644
index aabdb41..0000000
--- a/feed/app/ethswbox/src/example/cli/cmds/cmds_apps_ssb.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _CMDS_APPS_SSB_H
-#define _CMDS_APPS_SSB_H
-/******************************************************************************
-
- Copyright 2022 Maxlinear
-
- SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
-
- For licensing information, see the file 'LICENSE' in the root folder of
- this software module.
-******************************************************************************/
-
-/**
-
- \file cmd_apps_ssb.h
-
-*/
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* ========================================================================== */
-/* Function prototypes */
-/* ========================================================================== */
-extern OS_boolean_t cmds_ssb (CmdArgs_t* pArgs, int *err);
-extern int cmds_ssb_symlink_set (void);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/feed/app/ethswbox/src/example/cli/cmds/cmds_fapi.c b/feed/app/ethswbox/src/example/cli/cmds/cmds_fapi.c
deleted file mode 100644
index ce96191..0000000
--- a/feed/app/ethswbox/src/example/cli/cmds/cmds_fapi.c
+++ /dev/null
@@ -1,3110 +0,0 @@
-
-/******************************************************************************
-
- Copyright 2022 Maxlinear
-
- SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
-
- For licensing information, see the file 'LICENSE' in the root folder of
- this software module.
-******************************************************************************/
-
-/**
- \file cmds_fapi.c
- Implements CLI commands for lif mdio
-
-*/
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "os_types.h"
-
-#include "cmds.h"
-#include "cmds_fapi.h"
-#include "host_adapt.h"
-#include "fapi_gsw_hostapi.h"
-#include "fapi_gsw_hostapi_mdio_relay.h"
-
-#define slif_lib ""
-
-/* ========================================================================== */
-/* Function prototypes */
-/* ========================================================================== */
-static void cmds_fapi_help (void);
-
-
-OS_boolean_t cmds_fapi (CmdArgs_t* pArgs, int *err)
-{
- OS_boolean_t api_executed;
- int32_t ret;
-
- if (pArgs == NULL)
- {
- *err = OS_ERROR;
- return OS_TRUE;
- }
-
- ret = OS_SUCCESS;
- api_executed = OS_TRUE;
-
- /******************************************
- * lif CLI cmds *
- ******************************************/
-
- if ((strcmp(pArgs->name, "cmds-fapi-help") == 0 ) || (strcmp(pArgs->name, "cmds-gsw-?") == 0))
- {
- cmds_fapi_help ();
- }
-
- /***************************************
- * gsw_API: *
- * - api-gsw-internal-read *
- * - api-gsw-internal-write *
- * - api-gsw-get-links *
- * - api-gsw-read *
- * - api-gsw-write *
- * ************************************/
-
- else if (strcmp(pArgs->name, "fapi-int-gphy-write") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 4)
- {
- printf ("Usage: fapi-int-gphy-write phy=<> mmd=<> reg=<reg> data=<>\n");
- printf ("phy: phy id\n");
- printf ("mmd: mmd addres\n");
- printf ("reg: mdio register\n");
- printf ("data: value to write\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
-
- api_gsw_get_links(slib);
- ret = fapi_int_gphy_write(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-int-gphy-read") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 3)
- {
- printf ("Usage: fapi-int-gphy-read phy=<> mmd=<> reg=<reg>\n");
- printf ("phy: phy id\n");
- printf ("mmd: mmd addres\n");
- printf ("reg: mdio register\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
-
- api_gsw_get_links(slib);
- ret = fapi_int_gphy_read(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-ext-mdio-write") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 4)
- {
- printf ("Usage: fapi-ext-mdio-write phy=<> mmd=<> reg=<reg> data=<>\n");
- printf ("phy: phy address\n");
- printf ("mmd: mmd addres\n");
- printf ("reg: mdio register\n");
- printf ("data: value to write\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
-
- api_gsw_get_links(slib);
- ret = fapi_ext_mdio_write(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-ext-mdio-read") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 3)
- {
- printf ("Usage: fapi-ext-mdio-read phy=<> mmd=<> reg=<reg>\n");
- printf ("phy: phy address\n");
- printf ("mmd: mmd addres\n");
- printf ("reg: mdio register\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
-
- api_gsw_get_links(slib);
- ret = fapi_ext_mdio_read(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-ext-mdio-mod") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 4)
- {
- printf ("Usage: fapi-ext-mdio-write phy=<> mmd=<> reg=<reg> mask=<> data=<>\n");
- printf ("phy: phy address\n");
- printf ("mmd: mmd addres\n");
- printf ("reg: mdio register\n");
- printf ("mask: mask\n");
- printf ("data: data to write\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
-
- api_gsw_get_links(slib);
- ret = fapi_ext_mdio_mod(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-int-gphy-mod") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 3)
- {
- printf ("Usage: fapi-ext-mdio-read phy=<> mmd=<> reg=<reg> mask=<> data=<>\n");
- printf ("phy: phy id\n");
- printf ("mmd: mmd addres\n");
- printf ("reg: mdio register\n");
- printf ("mask: mask\n");
- printf ("data: data to write\n");
-
- goto goto_end_help;
- }
-
- slib = slif_lib;
-
- api_gsw_get_links(slib);
- ret = fapi_int_gphy_mod(pArgs->prmc, pArgs->prmvs);
- }
-
-
- else if (strcmp(pArgs->name, "fapi-GSW-RegisterGet") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-RegisterGet nRegAddr=<reg>\n");
- printf ("reg: register\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
-
- api_gsw_get_links(slib);
- ret = fapi_GSW_RegisterGet(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-RegisterSet") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-RegisterSet nRegAddr=<reg> nData=<data>\n");
- printf ("reg: register\n");
- printf ("data: data to write\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_RegisterSet(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-RegisterMod") == 0)
- {
-
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-RegisterMod nRegAddr=<reg> nData=<data> nMask=<mask>\n");
- printf ("nRegAddr: register\n");
- printf ("nData: data to write\n");
- printf ("nMask: mask\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_RegisterMod(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-PortLinkCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PortLinkCfgGet nPortId=<port>\n");
- printf ("port: port index <1-8>\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PortLinkCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-PortLinkCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PortLinkCfgSet nPortId=<port> [bDuplexForce=<> eDuplex=<> bSpeedForce=<> eSpeed=<> bLinkForce=<> eLink=<> eMII_Mode=<> eMII_Type=<> eClkMode=<> bLPI=<>]\n");
- printf ("port: port index <1-8>\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PortLinkCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-RMON-Clear") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-RMON-Clear nRmonId=<ID> eRmonType=<TYPE>\n");
- printf ("ID: RMON Counters Identifier\n");
- printf ("TYPE: RMON Counters Type\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_RMON_Clear(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-MonitorPortCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MonitorPortCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-MonitorPortCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MonitorPortCfgSet nPortId=<port> nSubIfId=<ID>\n");
- printf ("port: port index <1-8>\n");
- printf ("ID: Monitoring Sub-IF id\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MonitorPortCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
-
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-PortCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-PortCfgGet nPortId=<port>\n");
- printf ("port: port index <1-8>\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_PortCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-PortCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-PortCfgSet nPortId=<port> eClassMode=<CLASS> nTrafficClass=<TR>\n");
- printf ("port: port index <1-8>\n");
- printf ("eClassMode: Select the packet header field\n");
- printf ("nTrafficClass: Default port priority\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_PortCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-DSCP-ClassGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_DSCP_ClassGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-DSCP-ClassSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-DSCP-ClassSet nTrafficClass=<TC> nDSCP=<DSCP>\n");
- printf ("nTrafficClass: Configures the DSCP to traffic class mapping\n");
- printf ("nDSCP: DSCP to drop precedence assignment\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_DSCP_ClassSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-PCP-ClassGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_PCP_ClassGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-PCP-ClassSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-PCP-ClassSet nTrafficClass=<TC> nPCP=<priority>\n");
- printf ("nTrafficClass: Configures the PCP to traffic class mapping\n");
- printf ("nPCP: priority to drop precedence assignment\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_PCP_ClassSet(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-SVLAN-PCP-ClassGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_SVLAN_PCP_ClassGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-SVLAN-PCP-ClassSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-SVLAN-PCP-ClassSet nTrafficClass=<TC> nPCP=<priority>\n");
- printf ("nTrafficClass: Configures the SVLAN PCP to traffic class mapping\n");
- printf ("nPCP: priority to drop precedence assignment\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_SVLAN_PCP_ClassSet(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-ShaperCfgGet nRateShaperId=<Id>\n");
- printf ("id: Rate shaper index\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_ShaperCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-ShaperCfgSet nRateShaperId=<Id> bEnable=<En> nCbs=<CB> nRate=<Rt>\n");
- printf ("id: Rate shaper index\n");
- printf ("En: Enable/Disable the rate shaper\n");
- printf ("CB: Committed Burst Size\n");
- printf ("Rt: Rate [kbit/s]\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_ShaperCfgSet(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperQueueGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-ShaperQueueGet nQueueId=<Id>\n");
- printf ("id: Rate shaper index\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_ShaperQueueGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperQueueAssign") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-ShaperQueueAssign nQueueId=<QId> nRateShaperId=<RId>\n");
- printf ("QId: Queue index\n");
- printf ("RId: Rate shaper index\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_ShaperQueueAssign(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperQueueDeassign") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-ShaperQueueDeassign nQueueId=<QId> nRateShaperId=<RId>\n");
- printf ("QId: Queue index\n");
- printf ("RId: Rate shaper index\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_ShaperQueueDeassign(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-SchedulerCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-SchedulerCfgGet nQueueId=<QId>\n");
- printf ("QId: Queue index\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_SchedulerCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-SchedulerCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-SchedulerCfgSet nQueueId=<QId> eType=<Type> nWeight=<We>\n");
- printf ("QId: Queue index\n");
- printf ("Type: Scheduler Type\n");
- printf ("We: Weight in Token. Parameter used for WFQ configuration\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_SchedulerCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_WredCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-WredCfgSet eProfile=<Prof> eMode=<Md> eThreshMode=<THR> nRed_Min=<RMin> nRed_Max=<RMax> nYellow_Min=<YMin> nYellow_Max=<YMax> nGreen_Min=<GMin> nGreen_Max=<GMax>\n");
- printf ("Prof: Drop Probability Profile\n");
- printf ("Md: Automatic or Manual Mode of Thresholds Config\n");
- printf ("THR: WRED Threshold Mode Config\n");
- printf ("RMin: WRED Red Threshold Min\n");
- printf ("RMax: WRED Red Threshold Max\n");
- printf ("YMin: WRED Yellow Threshold Min\n");
- printf ("YMax: WRED Yellow Threshold Max\n");
- printf ("GMin: WRED Green Threshold Min\n");
- printf ("GMax: WRED Green Threshold Max\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_WredCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredQueueCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-WredQueueCfgSet nQueueId=<QId>\n");
- printf ("QId: Queue Index\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_WredQueueCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredQueueCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-WredQueueCfgSet nQueueId=<QId> nRed_Min=<RMin> nRed_Max=<RMax> nYellow_Min=<YMin> nYellow_Max=<YMax> nGreen_Min=<GMin> nGreen_Max=<GMax>\n");
- printf ("QId: Queue Index\n");
- printf ("RMin: WRED Red Threshold Min\n");
- printf ("RMax: WRED Red Threshold Max\n");
- printf ("YMin: WRED Yellow Threshold Min\n");
- printf ("YMax: WRED Yellow Threshold Max\n");
- printf ("GMin: WRED Green Threshold Min\n");
- printf ("GMax: WRED Green Threshold Max\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_WredQueueCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredPortCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-WredPortCfgGet nPortId=<port>\n");
- printf ("port: Port Index\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_WredPortCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredPortCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-WredPortCfgSet nPortId=<port> nRed_Min=<RMin> nRed_Max=<RMax> nYellow_Min=<YMin> nYellow_Max=<YMax> nGreen_Min=<GMin> nGreen_Max=<GMax>\n");
- printf ("port: Port Index\n");
- printf ("RMin: WRED Red Threshold Min\n");
- printf ("RMax: WRED Red Threshold Max\n");
- printf ("YMin: WRED Yellow Threshold Min\n");
- printf ("YMax: WRED Yellow Threshold Max\n");
- printf ("GMin: WRED Green Threshold Min\n");
- printf ("GMax: WRED Green Threshold Max\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_WredPortCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-TrunkingCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_TrunkingCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-TrunkingCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-TrunkingCfgSet bIP_Src=<bIP_Src> bIP_Dst=<bIP_Dst> bMAC_Src=<bMAC_Src> bMAC_Dst=<bMAC_Dst> bSrc_Port=<bSrc_Port> bDst_Port=<bDst_Port>\n");
- printf ("bIP_Src: MAC source address Use\n");
- printf ("bIP_Dst: MAC destination address Use\n");
- printf ("bMAC_Src: MAC source address Use\n");
- printf ("bMAC_Dst: MAC destination address Use\n");
- printf ("bSrc_Port: TCP/UDP source Port Use\n");
- printf ("bDst_Port: TCP/UDP Destination Port Use\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_TrunkingCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableClear") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MAC_TableClear(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableClear-Cond") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MAC-TableClear-Cond eType=<> nPortId=<>\n");
- printf ("eType: MAC table clear type\n");
- printf ("nPortId: Physical port id\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
-
- ret = fapi_GSW_MAC_TableCondClear(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-CfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_CfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-CfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-CfgSet bIP_Src=<bIP_Src> bIP_Dst=<bIP_Dst> bMAC_Src=<bMAC_Src> bMAC_Dst=<bMAC_Dst> bSrc_Port=<bSrc_Port> bDst_Port=<bDst_Port>\n");
- printf ("eMAC_TableAgeTimer: MAC table aging timer\n");
- printf ("nAgeTimer: MAC table aging timer in seconds\n");
- printf ("nMaxPacketLen: Maximum Ethernet packet length\n");
- printf ("bLearningLimitAction: Automatic MAC address table learning limitation {False: Drop/True: Forward}\n");
- printf ("bMAC_LockingAction: Accept or discard MAC port locking violation packets {False: Drop/True: Forward}\n");
- printf ("bMAC_SpoofingAction: Accept or discard MAC spoofing and port MAC locking violation packets {False: Drop/True: Forward}\n");
- printf ("bDst_bPauseMAC_ModeSrcPort: Pause frame MAC source address mode\n");
- printf ("nPauseMAC_Src: Pause frame MAC source address\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_CfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableEntryRemove") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MAC-TableEntryRemove nFId=<FId> nMAC=<MAC> nTci=<Tci>\n");
- printf ("FId: Filtering Identifier (FID)\n");
- printf ("MAC: MAC Address to be removed from the table\n");
- printf ("Tci: TCI for (GSWIP-3.2) B-Step\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MAC_TableEntryRemove(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableEntryQuery") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 2)
- {
- printf ("Usage: fapi-GSW-TableEntryQuery nFId=<FId> nMAC=<MAC> nTci=<Tci> nFilterFlag=<Flag>\n");
- printf ("FId: Filtering Identifier (FID)\n");
- printf ("MAC: MAC Address to be removed from the table\n");
- printf ("Tci: TCI for (GSWIP-3.2) B-Step\n");
- printf ("Flag: Source/Destination MAC address filtering flag {Value 0 - not filter, 1 - source address filter, 2 - destination address filter, 3 - both source and destination filter}\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MAC_TableEntryQuery(pArgs->prmc, pArgs->prmvs);
-
- }
-
-
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-FlowctrlCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_FlowctrlCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-FlowctrlCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-FlowctrlCfgSet nFlowCtrlNonConform_Min=<NCMin> nFlowCtrlNonConform_Max=<NCMax> nFlowCtrlConform_Min=<CMin> nFlowCtrlConform_Max=<CMax>\n");
- printf ("NCMin: Global Buffer Non Conforming Flow Control Threshold Minimum\n");
- printf ("NCMax: Global Buffer Non Conforming Flow Control Threshold Maximum\n");
- printf ("CMin: Global Buffer Conforming Flow Control Threshold Minimum\n");
- printf ("CMax: Global Buffer Conforming Flow Control Threshold Maximum\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_FlowctrlCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-FlowctrlPortCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-FlowctrlPortCfgGet nPortId=<port>\n");
- printf ("port: Ethernet Port number\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_FlowctrlPortCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-FlowctrlPortCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-FlowctrlPortCfgSet nPortId=<port> nFlowCtrl_Min=<Min> nFlowCtrl_Max=<Max>\n");
- printf ("port: Ethernet Port number\n");
- printf ("Min: Ingress Port occupied Buffer Flow Control Threshold Minimum\n");
- printf ("Max: Ingress Port occupied Buffer Flow Control Threshold Maximum\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_FlowctrlPortCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableEntryAdd") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MAC-TableEntryAdd\n");
- printf ("nFId=<> : Filtering Identifier (FID)\n");
- printf ("nPortId=<> : Ethernet Port number (zero-based counting)\n");
- printf ("nAgeTimer=<> : Aging Time, given in multiples of 1 second in a range\n");
- printf ("bStaticEntry=<> : Static Entry (value will be aged out if the entry is not set to static)\n");
- printf ("nTrafficClass=<> : Egress queue traffic class\n");
- printf ("bIgmpControlled=<> : Packet is marked as IGMP controlled if destination MAC address matches MAC in this entry\n");
- printf ("nFilterFlag=<> : Source/Destination MAC address filtering flag\n");
- printf ("nSVLAN_Id=<> : STAG VLAN Id. Only applicable in case SVLAN support is enabled on the device\n");
- printf ("nSubIfId=<> : In GSWIP-3.1, this field is sub interface ID for WLAN logical port\n");
- printf ("nMAC=<> : MAC Address to add to the table\n");
- printf ("nAssociatedMAC=<> : Associated Mac address\n");
- printf ("nTci=<> : TCI for (GSWIP-3.2) B-Step\n");
- printf ("nPortMapValueIndex0=<> : Bridge Port Map 0\n");
- printf ("nPortMapValueIndex1=<> : Bridge Port Map 1\n");
- printf ("nPortMapValueIndex2=<> : Bridge Port Map 2\n");
- printf ("nPortMapValueIndex3=<> : Bridge Port Map 3\n");
- printf ("nPortMapValueIndex4=<> : Bridge Port Map 4\n");
- printf ("nPortMapValueIndex5=<> : Bridge Port Map 5\n");
- printf ("nPortMapValueIndex6=<> : Bridge Port Map 6\n");
- printf ("nPortMapValueIndex7=<> : Bridge Port Map 7\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MAC_TableEntryAdd(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableEntryRead") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MAC_TableEntryRead(pArgs->prmc, pArgs->prmvs);
-
- }
-
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-QueuePortGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-QueuePortGet nPortId=<> nTrafficClassId=<> bRedirectionBypass=<> bExtrationEnable=<>\n");
- printf ("nPortId=<> : Ethernet Port number (zero-based counting)\n");
- printf ("nTrafficClassId=<> : Traffic Class index\n");
- printf ("bRedirectionBypass=<> : Queue Redirection bypass Option\n");
- printf ("bExtrationEnable=<> : Forward CPU (extraction) before external QoS queueing \n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_QueuePortGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-QueuePortSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-QueuePortSet nPortId=<> nTrafficClassId=<> bRedirectionBypass=<> bExtrationEnable=<> eQMapMode=<> nQueueId=<> nRedirectPortId=<> bEnableIngressPceBypass=<> bReservedPortMode=<>\n");
- printf ("nPortId=<> : Ethernet Port number (zero-based counting)\n");
- printf ("nTrafficClassId=<> : Traffic Class index\n");
- printf ("bRedirectionBypass=<> : Queue Redirection bypass Option\n");
- printf ("bExtrationEnable=<> : Forward CPU (extraction) before external QoS queueing \n");
- printf ("eQMapMode=<> : Ethernet Port number (zero-based counting)\n");
- printf ("nQueueId=<> : Traffic Class index\n");
- printf ("nRedirectPortId=<> : Queue Redirection bypass Option\n");
- printf ("bEnableIngressPceBypass=<> : Forward CPU (extraction) before external QoS queueing \n");
- printf ("bReservedPortMode=<> : Ethernet Port number (zero-based counting)\n");
-
-
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_QueuePortSet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-BridgePortConfigGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-BridgePortConfigGet nBridgePortId=<> eMask=<>\n");
- printf ("nBridgePortId=<> : Bridge ID\n");
- printf ("eMask=<> : Mask for updating/retrieving fields\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_BridgePortConfigGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-BridgePortConfigSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-BridgePortConfigGet\n");
- printf ("nBridgePortId=<> : Bridge ID\n");
- printf ("nBridgeId=<> : Bridge ID\n");
- printf ("bIngressExtendedVlanEnable=<>\n");
- printf ("nIngressExtendedVlanBlockId=<>\n");
- printf ("bEgressExtendedVlanEnable=<>\n");
- printf ("nEgressExtendedVlanBlockId=<>\n");
- printf ("eIngressMarkingMode=<>\n");
- printf ("eEgressRemarkingMode=<>\n");
- printf ("bIngressMeteringEnable=<>\n");
- printf ("nIngressTrafficMeterId=<>\n");
- printf ("bEgressMeteringEnable=<>\n");
- printf ("nEgressTrafficMeterId=<>\n");
- printf ("bEgressBroadcastSubMeteringEnable=<>\n");
- printf ("bEgressMulticastSubMeteringEnable=<>\n");
- printf ("bEgressUnknownMulticastIPSubMeteringEnable=<>\n");
- printf ("bEgressUnknownMulticastNonIPSubMeteringEnable=<>\n");
- printf ("bEgressUnknownUnicastSubMeteringEnable=<>\n");
- printf ("nEgressBroadcastSubMeteringId=<>\n");
- printf ("nEgressMulticastSubMeteringId=<>\n");
- printf ("nEgressUnknownMulticastIPSubMeteringId=<>\n");
- printf ("nEgressUnknownMulticastNonIPSubMeteringId=<>\n");
- printf ("nEgressUnknownUnicastSubMeteringId=<>\n");
- printf ("nDestLogicalPortId=<>\n");
- printf ("nDestSubIfIdGroup=<>\n");
- printf ("bPmapperEnable=<>\n");
- printf ("ePmapperMappingMode=<>\n");
- printf ("nPmapperDestSubIfIdGroup=<>\n");
- printf ("bBridgePortMapEnable=<>\n");
- printf ("Index=<>\n");
- printf ("MapValue=<>\n");
- printf ("bMcDestIpLookupDisable=<>\n");
- printf ("bMcSrcIpLookupEnable=<>\n");
- printf ("bDestMacLookupDisable=<>\n");
- printf ("bSrcMacLearningDisable=<>\n");
- printf ("bMacSpoofingDetectEnable=<>\n");
- printf ("bPortLockEnable=<>\n");
- printf ("bMacLearningLimitEnable=<>\n");
- printf ("nMacLearningLimit=<>\n");
- printf ("bIngressVlanFilterEnable=<>\n");
- printf ("nIngressVlanFilterBlockId=<>\n");
- printf ("bBypassEgressVlanFilter1=<>\n");
- printf ("bEgressVlanFilter1Enable=<>\n");
- printf ("nEgressVlanFilter1BlockId=<>\n");
- printf ("bEgressVlanFilter2Enable=<>\n");
- printf ("nEgressVlanFilter2BlockId=<>\n");
- printf ("bVlanTagSelection=<>\n");
- printf ("bVlanSrcMacPriorityEnable=<>\n");
- printf ("bVlanSrcMacDEIEnable=<>\n");
- printf ("bVlanSrcMacVidEnable=<>\n");
- printf ("bVlanDstMacPriorityEnable=<>\n");
- printf ("bVlanDstMacDEIEnable=<>\n");
- printf ("bVlanDstMacVidEnable=<>\n");
- printf ("bVlanBasedMultiCastLookup=<>\n");
- printf ("bVlanMulticastPriorityEnable=<>\n");
- printf ("bVlanMulticastDEIEnable=<>\n");
- printf ("bVlanMulticastVidEnable=<>\n");
- printf ("bForce=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_BridgePortConfigSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-CtpPortConfigGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-CtpPortConfigGet nLogicalPortId=<> nSubIfIdGroup=<> eMask=<>\n");
- printf ("nLogicalPortId=<> : Bridge ID\n");
- printf ("nSubIfIdGroup=<> : Sub interface ID group\n");
- printf ("eMask=<> : Mask for updating/retrieving fields\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_CtpPortConfigGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-CtpPortConfigSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-CtpPortConfigSet\n");
- printf ("nLogicalPortId=<>\n");
- printf ("nSubIfIdGroup=<>\n");
- printf( "nBridgePortId=<>\n");
- printf( "bForcedTrafficClass=<>\n");
- printf( "nDefaultTrafficClass=<>\n");
- printf( "bIngressExtendedVlanEnable=<>\n");
- printf( "nIngressExtendedVlanBlockId=<>\n");
- printf( "bIngressExtendedVlanIgmpEnable=<>\n");
- printf( "nIngressExtendedVlanBlockIdIgmp=<>\n");
- printf( "bEgressExtendedVlanEnable=<>\n");
- printf( "nEgressExtendedVlanBlockId=<>\n");
- printf( "bEgressExtendedVlanIgmpEnable=<>\n");
- printf( "nEgressExtendedVlanBlockIdIgmp=<>\n");
- printf( "bIngressNto1VlanEnable=<>\n");
- printf( "bEgressNto1VlanEnable=<>\n");
- printf( "eIngressMarkingMode=<>\n");
- printf( "eEgressMarkingMode=<>\n");
- printf( "bEgressMarkingOverrideEnable=<>\n");
- printf( "eEgressMarkingModeOverride=<>\n");
- printf( "eEgressRemarkingMode=<>\n");
- printf( "bIngressMeteringEnable=<>\n");
- printf( "nIngressTrafficMeterId=<>\n");
- printf( "bEgressMeteringEnable=<>\n");
- printf( "nEgressTrafficMeterId=<>\n");
- printf( "bBridgingBypass=<>\n");
- printf( "nDestLogicalPortId=<>\n");
- printf( "nDestSubIfIdGroup=<>\n");
- printf( "bPmapperEnable=<>\n");
- printf( "ePmapperMappingMode=<>\n");
- printf( "nFirstFlowEntryIndex=<>\n");
- printf( "nNumberOfFlowEntries=<>\n");
- printf( "bIngressLoopbackEnable=<>\n");
- printf( "bIngressDaSaSwapEnable=<>\n");
- printf( "bEgressLoopbackEnable=<>\n");
- printf( "bEgressDaSaSwapEnable=<>\n");
- printf( "bIngressMirrorEnable=<>\n");
- printf( "bEgressMirrorEnable=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_CtpPortConfigSet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-BridgeAlloc") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_BridgeAlloc(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-BridgeFree") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-BridgeFree nBridgeId=<>\n");
- printf ("nBridgeId: Bridge ID (FID) to which this bridge port is associated\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_BridgeFree(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-BridgeConfigGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-BridgeConfigGet nBridgeId=<> eMask=<>\n");
- printf ("nBridgeId: Bridge ID (FID) to which this bridge port is associated\n");
- printf ("eMask: Mask\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_BridgeConfigGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-BridgeConfigSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-BridgeConfigSet\n");
- printf("nBridgeId=<>\n");
- printf("bMacLearningLimitEnable=<>\n");
- printf("nMacLearningLimit=<>\n");
- printf("eForwardBroadcast=<>\n");
- printf("eForwardUnknownMulticastIp=<>\n");
- printf("eForwardUnknownMulticastNonIp=<>\n");
- printf("eForwardUnknownUnicast=<>\n");
- printf("bBroadcastMeterEnable=<>\n");
- printf("nBroadcastMeterId=<>\n");
- printf("bMulticastMeterEnable=<>\n");
- printf("nMulticastMeterId=<>\n");
- printf("bUnknownMulticastIpMeterEnable=<>\n");
- printf("nUnknownMulticastIpMeterId=<>\n");
- printf("bUnknownMulticastNonIpMeterEnable=<>\n");
- printf("nUnknownMulticastNonIpMeterId=<>\n");
- printf("bUnknownUniCastMeterEnable=<>\n");
- printf("nUnknownUniCastMeterId=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_BridgeConfigSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
-
-
- // ###################
-
-
- else if (strcmp(pArgs->name, "fapi-GSW-ExtendedVlanAlloc") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-ExtendedVlanAlloc nNumberOfEntries=<>\n");
- printf ("nNumberOfEntries: Total number of extended VLAN entries are requested\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_ExtendedVlanAlloc(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-ExtendedVlanFree") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-ExtendedVlanFree nExtendedVlanBlockId=<>\n");
- printf ("nExtendedVlanBlockId: Block Id\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_ExtendedVlanFree(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-ExtendedVlanGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-ExtendedVlanGet\n");
- printf ("nExtendedVlanBlockId=<>\n");
- printf ("nEntryIndex=<>\n");
- printf ("bOriginalPacketFilterMode=<>\n");
- printf ("eFilter_4_Tpid_Mode=<>\n");
- printf ("eTreatment_4_Tpid_Mode=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_ExtendedVlanGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-ExtendedVlanSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-ExtendedVlanSet\n");
- printf("nExtendedVlanBlockId=<>\n");
- printf("nEntryIndex=<>\n");
- printf("eOuterVlanFilterVlanType=<>\n");
- printf("bOuterVlanFilterPriorityEnable=<>\n");
- printf("nOuterVlanFilterPriorityVal=<>\n");
- printf("bOuterVlanFilterVidEnable=<>\n");
- printf("nOuterVlanFilterVidVal=<>\n");
- printf("eOuterVlanFilterTpid=<>\n");
- printf("eOuterVlanFilterDei=<>\n");
- printf("eInnerVlanFilterVlanType=<>\n");
- printf("bInnerVlanFilterPriorityEnable=<>\n");
- printf("nInnerVlanFilterPriorityVal=<>\n");
- printf("bInnerVlanFilterVidEnable=<>\n");
- printf("nInnerVlanFilterVidVal=<>\n");
- printf("eInnerVlanFilterTpid=<>\n");
- printf("eInnerVlanFilterDei=<>\n");
- printf("eEtherType=<>\n");
- printf("eRemoveTagAction=<>\n");
- printf("bOuterVlanActionEnable=<>\n");
- printf("eOuterVlanActionPriorityMode=<>\n");
- printf("eOuterVlanActionPriorityVal=<>\n");
- printf("eOuterVlanActionVidMode=<>\n");
- printf("eOuterVlanActionVidVal=<>\n");
- printf("eOuterVlanActionTpid=<>\n");
- printf("eOuterVlanActioneDei=<>\n");
- printf("bInnerVlanActionEnable=<>\n");
- printf("eInnerVlanActionPriorityMode=<>\n");
- printf("eInnerVlanActionPriorityVal=<>\n");
- printf("eInnerVlanActionVidMode=<>\n");
- printf("eInnerVlanActionVidVal=<>\n");
- printf("eInnerVlanActionTpid=<>\n");
- printf("eInnerVlanActioneDei=<>\n");
- printf("bReassignBridgePortEnable=<>\n");
- printf("nNewBridgePortId=<>\n");
- printf("bNewDscpEnable=<>\n");
- printf("nNewDscp=<>\n");
- printf("bNewTrafficClassEnable=<>\n");
- printf("nNewTrafficClass=<>\n");
- printf("bNewMeterEnable=<>\n");
- printf("sNewTrafficMeterId=<>\n");
- printf("bLoopbackEnable=<>\n");
- printf("bDaSaSwapEnable=<>\n");
- printf("bMirrorEnable=<>\n");
- printf("bDscp2PcpMapEnable=<>\n");
- printf("nDscp2PcpMapValue=<>\n");
- printf("bOriginalPacketFilterMode=<>\n");
- printf("eFilter_4_Tpid_Mode=<>\n");
- printf("eTreatment_4_Tpid_Mode=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_ExtendedVlanSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-VlanFilterAlloc") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- if (pArgs->prmc < 3)
- {
- printf ("Usage: fapi-GSW-VlanFilterAlloc nNumberOfEntries=<> bDiscardUntagged=<> bDiscardUnmatchedTagged=<>\n");
- printf ("nNumberOfEntries: Total number of extended VLAN entries are requested\n");
- printf ("bDiscardUntagged: Discard packet without VLAN tag\n");
- printf ("bDiscardUnmatchedTagged: Discard packet not matching\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_VlanFilterAlloc(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-VlanFilterFree") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-VlanFilterFree nVlanFilterBlockId=<>\n");
- printf ("nVlanFilterBlockId: Block Id\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_VlanFilterFree(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-VlanFilterGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-VlanFilterGet nVlanFilterBlockId=<> nEntryIndex=<>\n");
- printf ("nVlanFilterBlockId: Block Id\n");
- printf ("nEntryIndex: Entry Index\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_VlanFilterGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-VlanFilterSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-VlanFilterSet nVlanFilterBlockId=<> nEntryIndex=<> eVlanFilterMask=<> nVal=<> bDiscardMatched=<>\n");
- printf("nVlanFilterBlockId=<>\n");
- printf("nEntryIndex=<>\n");
- printf("eVlanFilterMask=<>\n");
- printf("nVal=<>\n");
- printf("bDiscardMatched=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_VlanFilterSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-STP-PortCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-STP-PortCfgGet nPortId=<>\n");
- printf ("nPortId: Port Id\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_STP_PortCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-STP-PortCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 2)
- {
- printf ("Usage: fapi-GSW-STP-PortCfgSet nPortId=<> ePortState=<>\n");
- printf("nPortId=<>\n");
- printf("ePortState=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_STP_PortCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-STP-BPDU-RuleGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_STP_BPDU_RuleGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-STP-BPDU-RuleSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-STP-BPDU-RuleSet eForwardPort=<> nForwardPortId=<>\n");
- printf("eForwardPort=<>\n");
- printf("nForwardPortId=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_STP_BPDU_RuleSet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-Debug-RMON-Port-Get") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 2)
- {
- printf ("Usage: fapi-GSW-Debug-RMON-Port-Get nPortId=<> ePortType=<>\n");
- printf("nPortId=<>\n");
- printf("ePortType=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Debug_RMON_Port_Get(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-QoS-MeterCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-MeterCfgGet nMeterId=<> \n");
- printf("nMeterId: Meter index (zero-based counting)\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_MeterCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
-
-else if (strcmp(pArgs->name, "fapi-GSW-QoS-MeterCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-MeterCfgSet\n");
- printf("nMeterId: Meter index (zero-based counting)\n");
- printf("bEnable=<>\n");
- printf("eMtrType=<>\n");
- printf("nCbs=<>\n");
- printf("nEbs=<>\n");
- printf("nCbs_ls=<>\n");
- printf("nEbs_ls=<>\n");
- printf("nRate=<>\n");
- printf("nPiRate=<>\n");
- printf("cMeterName=<>\n");
- printf("nColourBlindMode=<>\n");
- printf("bPktMode=<>\n");
- printf("bLocalOverhd=<>\n");
- printf("nLocaloverhd=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_MeterCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
-
-
-else if (strcmp(pArgs->name, "fapi-GSW-MAC-DefaultFilterGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MAC-DefaultFilterGet eType=<>\n");
- printf("eType: MAC Address Filter Type\n");
-
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MAC_DefaultFilterGet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-MAC-DefaultFilterSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MAC-DefaultFilterSet eType=<>\n");
- printf("eType: MAC Address Filter Type\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MAC_DefaultFilterSet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-CTP-PortAssignmentGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-CTP-PortAssignmentGet nLogicalPortId=<>\n");
- printf("nLogicalPortId=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_CTP_PortAssignmentGet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-CTP-PortAssignmentSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-CTP-PortAssignmentSet\n");
- printf("nLogicalPortId=<>\n");
- printf("nFirstCtpPortId=<>\n");
- printf("nNumberOfCtpPort=<>\n");
- printf("eMode=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_CTP_PortAssignmentSet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-GLBL-CfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PMAC-GLBL-CfgSet\n");
- printf("nPmacId=<>\n");
- printf("bRxFCSDis=<>\n");
- printf("eProcFlagsEgCfg=<>\n");
- printf("nBslThreshold0=<>\n");
- printf("nBslThreshold1=<>\n");
- printf("nBslThreshold2=<>\n");
- printf("bAPadEna=<>\n");
- printf("bPadEna=<>\n");
- printf("bVPadEna=<>\n");
- printf("bSVPadEna=<>\n");
- printf("bTxFCSDis=<>\n");
- printf("bIPTransChkRegDis=<>\n");
- printf("bIPTransChkVerDis=<>\n");
- printf("bJumboEna=<>\n");
- printf("nMaxJumboLen=<>\n");
- printf("nJumboThreshLen=<>\n");
- printf("bLongFrmChkDis=<>\n");
- printf("eShortFrmChkType=<>\n");
- printf("bProcFlagsEgCfgEna=<>\n");
-
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_GLBL_CfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-GLBL-CfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PMAC-GLBL-CfgGet\n");
- printf("nPmacId=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_GLBL_CfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-BM-CfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 2)
- {
- printf ("Usage: fapi-GSW-PMAC-BM-CfgSet\n");
- printf("nTxDmaChanId=<>\n");
- printf("nPmacId=<>\n");
- printf("txQMask=<>\n");
- printf("rxPortMask=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_BM_CfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-BM-CfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 2)
- {
- printf ("Usage: fapi-GSW-PMAC-BM-CfgGet\n");
- printf("nTxDmaChanId=<>\n");
- printf("nPmacId=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_BM_CfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-EG-CfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PMAC-EG-CfgSet\n");
- printf("nPmacId=<>\n");
- printf("bRedirEnable=<>\n");
- printf("bBslSegmentDisable=<>\n");
- printf("nBslTrafficClass=<>\n");;
- printf("bResDW1Enable=<>\n");
- printf("bRes2DW0Enable=<>\n");
- printf("bRes1DW0Enable=<>\n");
- printf("bTCEnable=<>\n");
- printf("nDestPortId=<>\n");
- printf("bProcFlagsSelect=<>\n");
- printf("nTrafficClass=<>\n");
- printf("nFlowIDMsb=<>\n");
- printf("bMpe1Flag=<>\n");
- printf("bMpe2Flag=<>\n");
- printf("bEncFlag=<>\n");
- printf("bDecFlag=<>\n");
- printf("nRxDmaChanId=<>\n");
- printf("bRemL2Hdr=<>\n");
- printf("numBytesRem=<>\n");
- printf("bFcsEna=<>\n");
- printf("bPmacEna=<>\n");
- printf("nResDW1=<>\n");
- printf("nRes1DW0=<>\n");
- printf("nRes2DW0=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_EG_CfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-EG-CfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PMAC-EG-CfgGet\n");
- printf("nPmacId=<>\n");
- printf("nDestPortId=<>\n");
- printf("bProcFlagsSelect=<>\n");
- printf("nTrafficClass=<>\n");
- printf("nFlowIDMsb=<>\n");
- printf("bMpe1Flag=<>\n");
- printf("bMpe2Flag=<>\n");
- printf("bEncFlag=<>\n");
- printf("bDecFlag=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_EG_CfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-IG-CfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PMAC-IG-CfgGet\n");
- printf("nPmacId=<>\n");
- printf("nTxDmaChanId=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_IG_CfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-IG-CfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PMAC-IG-CfgSet\n");
- printf("nPmacId=<>\n");
- printf("nTxDmaChanId=<>\n");
- printf("bErrPktsDisc=<>\n");
- printf("bPmapDefault=<>\n");
- printf("bPmapEna=<>\n");
- printf("bClassDefault=<>\n");
- printf("bClassEna=<>\n");
- printf("eSubId=<>\n");
- printf("bSpIdDefault=<>\n");
- printf("bPmacPresent=<>\n");
- printf("defPmacHdr=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_IG_CfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-
-else if (strcmp(pArgs->name, "fapi-GSW-PceRuleRead") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PceRuleRead\n");
- printf("pattern.nIndex=<>\n");
- printf("nLogicalPortId=<>\n");
- printf("nSubIfIdGroup=<>\n");
- printf("region=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PceRuleRead(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PceRuleWrite") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PceRuleWrite\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PceRuleWrite(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PceRuleDelete") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PceRuleDelete\n");
- printf("pattern.nIndex=<>\n");
- printf("nLogicalPortId=<>\n");
- printf("nSubIfIdGroup=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PceRuleDelete(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PceRuleAlloc") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PceRuleAlloc\n");
- printf("num_of_rules=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PceRuleAlloc(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PceRuleFree") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PceRuleFree\n");
- printf("blockid=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PceRuleFree(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PceRuleEnable") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PceRuleEnable\n");
- printf("nLogicalPortId=<>\n");
- printf("nSubIfIdGroup=<>\n");
- printf("region=<>\n");
- printf("pattern.nIndex=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PceRuleEnable(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-PceRuleDisable") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PceRuleDisable\n");
- printf("nLogicalPortId=<>\n");
- printf("nSubIfIdGroup=<>\n");
- printf("region=<>\n");
- printf("pattern.nIndex=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PceRuleDisable(pArgs->prmc, pArgs->prmvs);
-
- }
-
-else if (strcmp(pArgs->name, "fapi-GSW-MulticastRouterPortAdd") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MulticastRouterPortAdd\n");
- printf("nPortId=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MulticastRouterPortAdd(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-MulticastRouterPortRemove") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MulticastRouterPortRemove\n");
- printf("nPortId=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MulticastRouterPortRemove(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-MulticastSnoopCfgGet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MulticastSnoopCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-MulticastSnoopCfgSet") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MulticastSnoopCfgSet\n");
- printf("eIGMP_Mode=<>\n");
- printf("bCrossVLAN=<>\n");
- printf("eForwardPort=<>\n");
- printf("nForwardPortId=<>\n");
- printf("nClassOfService=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MulticastSnoopCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-MulticastRouterPortRead") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MulticastRouterPortRead(pArgs->prmc, pArgs->prmvs);
-
- }
-
-else if (strcmp(pArgs->name, "fapi-GSW-MulticastTableEntryAdd") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MulticastTableEntryRemove\n");
- printf ("nPortId=<> : Bridge Port ID\n");
- printf ("nSubIfId=<> : Sub-Interface Id\n");
- printf ("eIPVersion=<> : Selection to use IPv4 or IPv6.\n");
- printf ("uIP_Gda=<> : Group Destination IP address (GDA).\n");
- printf ("uIP_Gsa=<> : Group Source IP address.\n");
- printf ("nFID=<> : Filtering Identifier (FID)\n");
- printf ("bExclSrcIP=<> : Includes or Excludes Source IP.\n");
- printf ("eModeMember=<> : Group member filter mode.\n");
- printf ("nTci=<> : TCI for (GSWIP-3.2) B-Step\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MulticastTableEntryAdd(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-MulticastTableEntryRead") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MulticastTableEntryRead(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-MulticastTableEntryRemove") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-MulticastTableEntryRemove\n");
- printf ("nPortId=<> : Bridge Port ID\n");
- printf ("nSubIfId=<> : Sub-Interface Id\n");
- printf ("eIPVersion=<> : Selection to use IPv4 or IPv6.\n");
- printf ("uIP_Gda=<> : Group Destination IP address (GDA).\n");
- printf ("uIP_Gsa=<> : Group Source IP address.\n");
- printf ("nFID=<> : Filtering Identifier (FID)\n");
- printf ("bExclSrcIP=<> : Includes or Excludes Source IP.\n");
- printf ("eModeMember=<> : Group member filter mode.\n");
- printf ("nTci=<> : TCI for (GSWIP-3.2) B-Step\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_MulticastTableEntryRemove(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-FW-Update") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_FW_Update(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-FW-Version") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_FW_Version(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-PVT-Meas") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PVT_Meas(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-Delay") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-Delay\n");
- printf ("nMsec=<> : Delay Time in milliseconds\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Delay(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-GPIO-Configure") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-GPIO-Configure\n");
- printf ("nEnableMaskIndex0=<> : GPIO Enable Mask Index 0\n");
- printf ("nEnableMaskIndex1=<> : GPIO Enable Mask Index 1\n");
- printf ("nEnableMaskIndex2=<> : GPIO Enable Mask Index 2\n");
- printf ("nAltSel0Index0=<> : GPIO Alt Select 0 Index 0\n");
- printf ("nAltSel0Index1=<> : GPIO Alt Select 0 Index 1\n");
- printf ("nAltSel0Index2=<> : GPIO Alt Select 0 Index 2\n");
- printf ("nAltSel1Index0=<> : GPIO Alt Select 1 Index 0\n");
- printf ("nAltSel1Index1=<> : GPIO Alt Select 1 Index 1\n");
- printf ("nAltSel1Index2=<> : GPIO Alt Select 1 Index 2\n");
- printf ("nDirIndex0=<> : GPIO Direction Index 0\n");
- printf ("nDirIndex1=<> : GPIO Direction Index 1\n");
- printf ("nDirIndex2=<> : GPIO Direction Index 2\n");
- printf ("nOutValueIndex0=<> : GPIO Out Value Index 0\n");
- printf ("nOutValueIndex1=<> : GPIO Out Value Index 1\n");
- printf ("nOutValueIndex2=<> : GPIO Out Value Index 2\n");
- printf("nTimeoutValue=<> : GPIO Timeout in milliseconds\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_GPIO_Configure(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-Reboot") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Reboot(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-SysReg-Rd") == 0)
- {
- char* slib ="";
- uint16_t reg = 0;
- GSW_Device_t* gsw_dev;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-SysReg-Rd addr=<addr>\n");
- printf ("reg: register address\n");
- goto goto_end_help;
- }
-
- slib = slif_lib;
-
- api_gsw_get_links(slib);
- ret = fapi_GSW_SysReg_Rd(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-VlanCounterMapSet") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-VlanCounterMapSet\n");
- printf("nCounterIndex=<>\n");
- printf("nCtpPortId=<>\n");
- printf("bPriorityEnable=<>\n");
- printf("nPriorityVal=<>\n");
- printf("bVidEnable=<>\n");
- printf("nVidVal=<>\n");
- printf("bVlanTagSelectionEnable=<>\n");
- printf("eVlanCounterMappingType=<>\n");
- printf("eVlanCounterMappingFilterType=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_VlanCounterMapSet(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-VlanCounterMapGet") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-VlanCounterMapGet\n");
- printf("nCounterIndex=<>\n");
- printf("eVlanCounterMappingType=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_VlanCounterMapGet(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-Vlan-RMON-Get") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-Vlan-RMON-Get\n");
- printf("nVlanCounterIndex=<>\n");
- printf("eVlanRmonType=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Vlan_RMON_Get(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-Vlan-RMON-Clear") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-Vlan-RMON-Clear\n");
- printf("nVlanCounterIndex=<>\n");
- printf("eVlanRmonType=<>\n");
- printf("eClearAll=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Vlan_RMON_Clear(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-Vlan-RMONControl-Set") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-Vlan-RMONControl-Set\n");
- printf("bVlanRmonEnable=<>\n");
- printf("bIncludeBroadCastPktCounting=<>\n");
- printf("nVlanLastEntry=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Vlan_RMONControl_Set(pArgs->prmc, pArgs->prmvs);
- }
- else if (strcmp(pArgs->name, "fapi-GSW-Vlan-RMONControl-Get") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Vlan_RMONControl_Get(pArgs->prmc, pArgs->prmvs);
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-PBB-TunnelTempate-Config-Get") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PBB-TunnelTempate-Config-Get\n");
- printf ("nTunnelTemplateId:\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PBB_TunnelTempate_Config_Get(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-PBB-TunnelTempate-Config-Set") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PBB-TunnelTempate-Config-Set\n");
- printf ("nTunnelTemplateId:\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PBB_TunnelTempate_Config_Set(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-PBB-TunnelTempate-Alloc") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PBB_TunnelTempate_Alloc(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-PBB-TunnelTempate-Free") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PBB-TunnelTempate-Free\n");
- printf ("nTunnelTemplateId:\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PBB_TunnelTempate_Free(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-CPU-PortCfgGet") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-CPU-PortCfgGet\n");
- printf ("nPortId:\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_CPU_PortCfgGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-CPU-PortCfgSet") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-CPU-PortCfgSet\n");
- printf ("nPortId:\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_CPU_PortCfgSet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-RMON-MeterGet") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-RMON-MeterGet\n");
- printf ("nMeterId:\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_RMON_MeterGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-RMON-FlowGet") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-RMON-FlowGet\n");
- printf("bIndexd=<>\n");
- printf("nIndex=<>\n");
- printf("nPortId=<>\n");
- printf("nFlowId=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_RMON_FlowGet(pArgs->prmc, pArgs->prmvs);
-
- }
-
- else if (strcmp(pArgs->name, "fapi-GSW-RMON-TFlowClear") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-RMON-TFlowClear\n");
- printf("bIndexd=<>\n");
- printf("nIndex=<>\n");
- printf("nPortId=<>\n");
- printf("nFlowId=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_RMON_FlowGet(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-BridgePortAlloc") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_BridgePortAlloc(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-BridgePortFree") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-BridgePortFree\n");
- printf("nBridgePortId:<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_BridgePortFree(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-UnFreeze") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_UnFreeze(pArgs->prmc, pArgs->prmvs);
-
- }
- else if (strcmp(pArgs->name, "fapi-GSW-Freeze") == 0)
- {
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Freeze(pArgs->prmc, pArgs->prmvs);
-
- }
-
-else if (strcmp(pArgs->name, "fapi-GSW-QoS-MeterFree") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-QoS-MeterFree nMeterId=<>\n");
- printf("nMeterId: Meter index (zero-based counting)\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_MeterFree(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-QoS-MeterAlloc") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_QoS_MeterAlloc(pArgs->prmc, pArgs->prmvs);
-
- }
-
-else if (strcmp(pArgs->name, "fapi-GSW-PMAC-RMON-Get") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-PMAC-RMON-Get\n");
- printf("nPmacId=<>\n");
- printf("nPortId=<>\n");
- printf("b64BitMode=<>\n");
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_PMAC_RMON_Get(pArgs->prmc, pArgs->prmvs);
-
- }
-else if (strcmp(pArgs->name, "fapi-GSW-Debug-PMAC-RMON-Get-All") == 0)
- {
-
- char* slib ="";
- uint16_t phy = 0;
- GSW_Device_t* gsw_dev;
- uint16_t myval;
-
- if (pArgs->prmc < 1)
- {
- printf ("Usage: fapi-GSW-Debug-PMAC-RMON-Get-All\n");
- printf("nPmacId=<>\n");
- printf("Start=<>\n");
- printf("End=<>\n");
-
- goto goto_end_help;
- }
- slib = slif_lib;
- api_gsw_get_links(slib);
- ret = fapi_GSW_Debug_PMAC_RMON_Get_All(pArgs->prmc, pArgs->prmvs);
-
- }
- // else if (strcmp(pArgs->name, "fapi-GSW-Debug-RMON-Port-GetAll") == 0)
- // {
- // char* slib ="";
- // uint16_t phy = 0;
- // GSW_Device_t* gsw_dev;
- // uint16_t myval;
-
- // if (pArgs->prmc < 1)
- // {
- // printf ("Usage: fapi-GSW-Debug-RMON-Port-GetAll ePortType=<> Start=<> End=<>\n");
- // printf ("ePortType: Port Type\n");
- // printf ("Start: Start Port\n");
- // printf ("End: End Port\n");
- // goto goto_end_help;
- // }
- // slib = slif_lib;
- // api_gsw_get_links(slib);
- // ret = fapi_GSW_DEBUG_RMON_Port_Get_All(pArgs->prmc, pArgs->prmvs);
-
- // }
-
-
- /***************
- * No command *
- ***************/
- else
- {
- api_executed = OS_FALSE;
- }
-
-goto_end_help:
- *err = ( int)ret;
- return api_executed;
-}
-
-
-
-
-int cmds_fapi_symlink_set (void)
-{
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RegisterGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RegisterMod");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RegisterSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PortLinkCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PortLinkCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-Clear");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MonitorPortCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MonitorPortCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PortCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PortCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-DSCP-ClassGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-DSCP-ClassSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PCP-ClassGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PCP-ClassSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-SVLAN-PCP-ClassGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-SVLAN-PCP-ClassSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperQueueGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperQueueAssign");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperQueueDeassign");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-SchedulerCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-SchedulerCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredQueueCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredQueueCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredPortCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredPortCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-TrunkingCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-TrunkingCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableClear");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableClear-Cond");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableEntryRemove");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableEntryQuery");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-FlowctrlCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-FlowctrlCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-FlowctrlPortCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-FlowctrlPortCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableEntryAdd");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableEntryRead");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-QueuePortSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-QueuePortGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortConfigGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortConfigSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CtpPortConfigGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CtpPortConfigSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-int-gphy-read");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-int-gphy-write");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-ext-mdio-read");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-ext-mdio-write");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-int-gphy-mod");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-ext-mdio-mod");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgeConfigGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgeConfigSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgeFree");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgeAlloc");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-ExtendedVlanGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-ExtendedVlanSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-ExtendedVlanFree");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-ExtendedVlanAlloc");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanFilterGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanFilterSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanFilterFree");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanFilterAlloc");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-STP-PortCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-STP-PortCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-STP-BPDU-RuleSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-STP-BPDU-RuleGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Debug-RMON-Port-Get");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-MeterCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-MeterCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-DefaultFilterGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-DefaultFilterSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CTP-PortAssignmentGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CTP-PortAssignmentSet");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-GLBL-CfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-GLBL-CfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-BM-CfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-BM-CfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-EG-CfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-EG-CfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-IG-CfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-IG-CfgSet");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleDelete");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleRead");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleWrite");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleAlloc");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleFree");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleEnable");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleDisable");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastRouterPortAdd");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastRouterPortRemove");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastSnoopCfgGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastSnoopCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastRouterPortRead");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastTableEntryAdd");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastTableEntryRead");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastTableEntryRemove");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-FW-Update");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-FW-Version");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PVT-Meas");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Delay");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-GPIO-Configure");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Reboot");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-SysReg-Rd");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanCounterMapSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanCounterMapGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Vlan-RMON-Get");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Vlan-RMON-Clear");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Vlan-RMONControl-Set");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Vlan-RMONControl-Get");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PBB-TunnelTempate-Config-Set");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PBB-TunnelTempate-Config-Get");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PBB-TunnelTempate-Alloc");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PBB-TunnelTempate-Free");
- // system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Debug-RMON-Port-GetAll");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CPU-PortCfgSet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CPU-PortCfgGet");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-MeterGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-FlowGet");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-TFlowClear");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortAlloc");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortFree");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Freeze");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-UnFreeze");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-MeterFree");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-MeterAlloc");
-
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-RMON-Get");
- system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Debug-PMAC-RMON-Get-All");
-
- return OS_SUCCESS;
-}
-
-
-static void cmds_fapi_help (void)
-{
- printf ("+-----------------------------------------------------------------------+\n");
- printf ("| HELP ! |\n");
- printf ("| CMDS - gsw |\n");
- printf ("| |\n");
- printf ("+-----------------------------------------------------------------------+\n");
- printf ("| fapi_GSW_RegisterGet |\n");
- printf ("\n");
-}
diff --git a/feed/app/ethswbox/src/example/cli/ethswbox.c b/feed/app/ethswbox/src/example/cli/ethswbox.c
deleted file mode 100644
index adec61a..0000000
--- a/feed/app/ethswbox/src/example/cli/ethswbox.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/******************************************************************************
-
- Copyright 2022 Maxlinear
-
- SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
-
- For licensing information, see the file 'LICENSE' in the root folder of
- this software module.
-******************************************************************************/
-
-/**
-
- \file ethswbox.c
-
-*/
-#include "os_types.h"
-#include "ethswbox_version.h"
-
-#include "cmds.h"
-
-int ethswbox_main(int argc, char *argv[])
-{
- int ret = OS_ERROR;
- int prmc;
- char **prmv;
-
- char *name = argv[0];
-
- if (strchr (name, '/') != NULL) do
- {
- /* move behind next / */
- name = strchr (name, '/') + 1;
-
- if (name == NULL)
- return ret;
- }
- while (strlen(name) > 0 && strchr (name, '/') != NULL);
- if (name == NULL || strcmp(name, "ethswbox") == 0)
- {
- printf ("Ethernet SW Toolbox version %s.55 ... Updating symbolic links!\n", ETHSWBOX_VERSION_STR);
- ret |= cmds_symlink_set ();
-
- return (int)ret;
- }
-
- /* remove the name parameter from the parameter count */
- prmc = argc;
- prmc--;
- prmv = &argv[1];
- /*
- name: command name
- dev: device number
- prmc: parameter counter without device number
- prmv: parameters
- */
-#if 1
- {
- int i;
- printf ("cmd: %s %d: ", name, prmc);
- for (i = 0; i< prmc; i++)
- {
- printf ("%s ",prmv[i]);
- }
- printf ("\n");
- }
-#endif
-
- /* invoke CLI command parser */
- if (cmds (name, prmc, prmv, &ret) == OS_TRUE)
- {
- goto end;
- }
-
-end:
-
- return ret;
-}
-
-
-int main(int argc, char *argv[])
-{
- int ret = 0;
- if (argv != NULL)
- ret = ethswbox_main (argc, argv);
- return ret;
-}
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_access.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_access.c
new file mode 100644
index 0000000..5623d76
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_access.c
@@ -0,0 +1,88 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+/**
+ \file smdio_access.c
+ GPHY mode flashless load FW example.
+
+*/
+
+#include "smdio_access.h"
+#include "lif_api.h"
+
+#define SMIDO_SB_PHY_ADDR_REG 0x1F
+#define SMIDO_SB_PHY_DATA_REG 0x0
+
+int smdio_write(uint8_t lif_id, uint8_t phy, uint16_t phy_reg, uint16_t phy_reg_data)
+{
+ int ret = 0;
+
+ /* Write address to register 0x1f */
+ ret = lif_mdio_c22_write(lif_id, phy, SMIDO_SB_PHY_ADDR_REG, phy_reg);
+ if (ret == 0)
+ {
+ /* Write data to offset 0x0 */
+ ret = lif_mdio_c22_write(lif_id, phy, SMIDO_SB_PHY_DATA_REG, phy_reg_data);
+ }
+
+ return ret;
+}
+
+int smdio_cont_write(uint8_t lif_id, uint8_t phy, uint16_t phy_reg, uint16_t phy_reg_data[8], uint8_t num)
+{
+ int ret = 0;
+
+ /* Write address to register 0x1f */
+ ret = lif_mdio_c22_write(lif_id, phy, SMIDO_SB_PHY_ADDR_REG, phy_reg);
+ if (ret == 0)
+ {
+ /* Write data to offset 0x0 */
+ for (uint8_t i = 0; i < (num & 0xF); i++)
+ {
+ ret = lif_mdio_c22_write(lif_id, phy, SMIDO_SB_PHY_DATA_REG, phy_reg_data[i]);
+ }
+ }
+
+ return ret;
+}
+
+int smdio_read(uint8_t lif_id, uint8_t phy, uint16_t phy_reg)
+{
+ int ret = 0;
+ uint16_t readdata = -1;
+
+ /* Write address to register 0x1f */
+ ret = lif_mdio_c22_write(lif_id, phy, SMIDO_SB_PHY_ADDR_REG, phy_reg);
+ if (ret == 0)
+ {
+ /* Read data from offset 0x0 */
+ readdata = lif_mdio_c22_read(lif_id, phy, SMIDO_SB_PHY_DATA_REG);
+ }
+
+ return readdata;
+}
+
+int mdio_read(uint8_t lif_id, uint8_t phy, uint16_t phy_reg)
+{
+ int ret = 0;
+
+ ret = lif_mdio_c22_read(lif_id, phy, phy_reg);
+
+ return ret;
+}
+
+int smdio_init(void)
+{
+ /* Ensure the MDIO link is operational.
+ this initialization is performed at the startup
+ please check "cmds" entry point in cmds.c for an initialization
+ example for RPI4 Host. */
+
+ return 0;
+}
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_access.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_access.h
new file mode 100644
index 0000000..9f25fa6
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_access.h
@@ -0,0 +1,27 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+/**
+ \file smdio_access.h
+ GPHY mode flashless load FW example.
+
+*/
+
+#ifndef __SMDIO_ACCESS_H__
+#define __SMDIO_ACCESS_H__
+
+#include <stdint.h>
+
+int smdio_write(uint8_t lid, uint8_t phy, uint16_t phy_reg, uint16_t phy_reg_data);
+int smdio_cont_write(uint8_t lid, uint8_t phy, uint16_t phy_reg, uint16_t phy_reg_data[8], uint8_t num);
+int smdio_read(uint8_t lid, uint8_t phy, uint16_t phy_reg);
+int mdio_read(uint8_t lid, uint8_t phy, uint16_t phy_reg);
+int smdio_init(void);
+
+#endif /* __SMDIO_ACCESS_H__ */
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_ssb.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_ssb.c
new file mode 100644
index 0000000..f7944d9
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_ssb.c
@@ -0,0 +1,443 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+/**
+ \file smdio_ssb.c
+ GPHY mode flashless load FW example.
+
+*/
+#include "smdio_ssb.h"
+#include "smdio_access.h"
+
+#include <os_linux.h>
+#include <os_types.h>
+#include <stdbool.h>
+
+#define SB_PDI_CTRL 0xE100
+#define SB_PDI_ADDR 0xE101
+#define SB_PDI_DATA 0xE102
+#define SB_PDI_STAT 0xE103
+
+#define SB1_ADDR 0x7800
+#define SB_PDI_CTRL_RD 0x01
+#define SB_PDI_CTRL_WR 0x02
+#define SB_PDI_RST 0x0
+#define min(a, b) ((a) < (b) ? (a) : (b))
+
+#define FW_DL_FLASHLESS_MAGIC_ER 0x0
+#define FW_DL_FLASHLESS_MAGIC 0xC33C
+
+#define SMDIO_GPHY_ID 0x1F
+
+#define SMDIO_PHY_NR 8
+static uint8_t SMDIO_PHY_ID[SMDIO_PHY_NR] = {16, 17, 18, 19, 20, 21, 22, 23};
+
+/**
+ * Reset SB PDI registers
+ */
+static void smdio_ssb_pdi_reset(uint8_t lid, uint8_t phy)
+{
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_RST);
+ smdio_write(lid, phy, SB_PDI_ADDR, SB_PDI_RST);
+ smdio_write(lid, phy, SB_PDI_DATA, SB_PDI_RST);
+}
+
+int ssb_flashless_load(uint8_t lid, char *fw_path)
+{
+ int ret, i;
+ FILE *fwin;
+ int filesize;
+ uint8_t *pDataBuf;
+
+#if 0
+ /* SMDIO Interface Initialization */
+ smdio_init();
+#endif
+
+ /* Open, read the FW to be updated */
+ fwin = fopen(fw_path, "rb");
+ if (fwin == NULL)
+ {
+ printf("Failed to open FW file \"%s\".\n", fw_path);
+ return -errno;
+ }
+
+ fseek(fwin, 0L, SEEK_END);
+ filesize = ftell(fwin);
+ printf("FW size: %d bytes\n", filesize);
+ rewind(fwin);
+
+ pDataBuf = (uint8_t *)malloc(filesize);
+ if (pDataBuf == NULL)
+ {
+ printf("Failed to allocate memory (malloc) \n");
+ ret = fclose(fwin);
+ return -errno;
+ }
+
+ ret = fread(pDataBuf, 1, filesize, fwin);
+ if (ret != filesize)
+ {
+ printf("Failed to read FW file \"%s\".\n", fw_path);
+ free(pDataBuf);
+ ret = fclose(fwin);
+ return -errno;
+ }
+ fclose(fwin);
+
+ /* Update the FW thru the the SMDIO interface */
+ ret = smdio_ssb_write(lid, SMDIO_GPHY_ID, (uint8_t *)pDataBuf, filesize);
+ free(pDataBuf);
+ if (ret != 0)
+ {
+ printf("FW Upload Failed - FW Write Failed\n");
+ return -errno;
+ }
+
+ /* Successful update: the device is rebooting in GPY mode
+ which takes less that 2 seconds. We wait for 2 seconds
+ that the device is up before to check the registers */
+ sleep(2);
+ ret = check_registers(lid);
+ if (ret != 0)
+ {
+ printf("FW Upload Failed - Register Read Failed\n");
+ return -errno;
+ }
+ printf("FW Upload Sucessful\n");
+
+ return ret;
+}
+
+/**
+ * Check ID and FW registers after FW Download
+ */
+int check_registers(uint8_t lid)
+{
+ int ret, i;
+
+ for (int i = 0; i < SMDIO_PHY_NR; i++)
+ {
+ if ((mdio_read(lid, SMDIO_PHY_ID[i], 3) == 0xffff) || (mdio_read(lid, SMDIO_PHY_ID[i], 0x1e) == 0xffff))
+ return -1;
+ i++;
+ }
+
+ return 0;
+}
+
+/**
+ * Target side will set PDI STAT to 0x0, after host side set it to 0x1
+ */
+static bool smdio_ssb_wait_pdi_stat_is_dwn_magic(uint8_t lid, uint32_t phy)
+{
+ /* Test 10000 times to avoid endless loop */
+ int loop = 0;
+ int val = 0;
+
+ while (loop < 10000)
+ {
+ val = smdio_read(lid, phy, SB_PDI_STAT);
+ if ((val == FW_DL_FLASHLESS_MAGIC) || (val == FW_DL_FLASHLESS_MAGIC_ER))
+ return true;
+ loop++;
+ }
+
+ return false;
+}
+
+static bool smdio_ssb_wait_pdi_stat_is_zero(uint8_t lid, uint32_t phy)
+{
+ /* Test 10000 times to avoid endless loop */
+ int loop = 0;
+
+ while (loop < 10000)
+ {
+ if (smdio_read(lid, phy, SB_PDI_STAT) == 0x0)
+ return true;
+ loop++;
+ }
+
+ return false;
+}
+
+/**
+ * Write data to SSB from offset 0x0
+ *
+ * pdata - data pointer to be writen to SB
+ * len - size of data
+ *
+ * return size of data writen to SB if successful
+ */
+int smdio_ssb_write(uint8_t lid, uint8_t phy, uint8_t *pdata, uint32_t len)
+{
+ uint32_t word_idx = 0;
+ uint32_t slice_cnt = 0;
+ uint16_t data_arr[8] = {0};
+ uint8_t num = 0;
+
+ if (!pdata)
+ {
+ printf("Data can not be NULL\n");
+ return -EINVAL;
+ }
+
+ /* Initialize SMDIO and SSB PDI */
+ smdio_ssb_pdi_reset(lid, phy);
+
+ /* Wait for target MCUBoot to select the next slice */
+ if (!smdio_ssb_wait_pdi_stat_is_dwn_magic(lid, phy))
+ {
+ printf("Target MCUBoot not responsive\n");
+ return -ECANCELED;
+ }
+
+ /* Trigger the write operation */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_CTRL_WR);
+
+ uint32_t idx = 0;
+ while (idx < len)
+ {
+ num = 0;
+ do
+ {
+ /*Target MCUBoot selected slice and ready
+ 16 bits data */
+ uint16_t fdata = 0x0;
+ if (idx + 1 < len)
+ {
+ fdata = ((pdata[idx + 1]) << 8) | pdata[idx];
+ idx += 2;
+ }
+ else if (idx < len)
+ { /* last byte of data, padding high 8bits with 0s */
+ fdata |= (uint16_t)pdata[idx];
+ idx++;
+ }
+ else
+ { /* no more data */
+ break;
+ }
+ data_arr[num] = fdata;
+ num++;
+ } while (num < 8);
+ smdio_cont_write(lid, phy, SB_PDI_DATA, data_arr, num);
+
+ word_idx += num;
+ if (word_idx == 16384)
+ { /* 32KB is done, need to set SB PDI addr to 0x7800 */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_RST);
+ smdio_write(lid, phy, SB_PDI_ADDR, SB1_ADDR);
+ /* Continue to write SB1 32KB */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_CTRL_WR);
+ }
+ else if (word_idx == 32768)
+ { /* One slice is done */
+ smdio_ssb_pdi_reset(lid, phy);
+ /* Notidy target MCUBoot one slice is done */
+ smdio_write(lid, phy, SB_PDI_STAT, 0x1);
+ sleep(0.003);
+
+ /* Prepare for next slice */
+ slice_cnt++;
+ word_idx = 0;
+ smdio_ssb_pdi_reset(lid, phy);
+
+ /* Wait for target MCUBoot to select the next slice */
+ if (!smdio_ssb_wait_pdi_stat_is_dwn_magic(lid, phy))
+ {
+ printf("Target MCUBoot not responsive\n");
+ return -ECANCELED;
+ }
+ /* Trigger next slice write */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_CTRL_WR);
+ }
+ }
+
+ /* all data wroten to SSB
+ loop until to slice 7 to allow MCUBoot to know firmware download completed */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_RST);
+ while (slice_cnt < 8)
+ {
+ smdio_write(lid, phy, SB_PDI_STAT, 0x1);
+ slice_cnt++;
+ if (slice_cnt == 8)
+ break;
+
+ sleep(0.003);
+ /* Wait for target MCUBoot to select the next slice */
+ if (!smdio_ssb_wait_pdi_stat_is_dwn_magic(lid, phy))
+ {
+ printf("Target MCUBoot not responsive\n");
+ return -ECANCELED;
+ }
+ }
+
+ smdio_ssb_pdi_reset(lid, phy);
+
+ return 0;
+}
+
+#ifdef SMDIO_TEST_TARGET
+/**
+ * Read data from SSB offset 0x0
+ * data patter is increased by 1 for one uint32_t
+ * Maximum is one slice SB size 64KB
+ * It is used for only for testing purpose
+ *
+ * len - number of uint32_t value to be read
+ *
+ * return size of data read from SB if successful
+ */
+int smdio_ssb_read_verify((uint8_t lid, uint8_t phy, uint32_t len)
+{
+ uint32_t word_idx = 0;
+ uint32_t val = 0;
+
+ if (len < 1 || len > 16384)
+ {
+ printf("data size overflow one slice SB size\n");
+ return -EINVAL;
+ }
+
+ /* Initialize SMDIO and SSB PDI */
+ smdio_ssb_pdi_reset(lid, phy);
+
+ /* Wait for target MCUBoot to select the next slice */
+ if (!smdio_ssb_wait_pdi_stat_is_zero(lid, phy))
+ {
+ printf("Target MCUBoot not responsive\n");
+ return -ECANCELED;
+ }
+ /* Trigger read operation */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_CTRL_RD);
+ for (uint32_t idx = 0; idx < len; idx++)
+ {
+ /* Lower 16 bits write to lower address */
+ uint32_t lowData = smdio_read(lid, phy, SB_PDI_DATA) & 0xFFFF;
+ uint32_t highData = (smdio_read(lid, phy, SB_PDI_DATA) & 0xFFFF) << 16;
+ val = lowData | highData;
+ if (val != idx)
+ {
+ printf("%dth uint32_t value is not expected\n", idx);
+ return -1;
+ }
+
+ if (idx % 32 == 0)
+ printf(".");
+ word_idx += 2;
+ if (word_idx == 16384)
+ { /* 32KB is done, need to set SB PDI addr to 0x7800 */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_RST);
+ smdio_write(lid, phy, SB_PDI_ADDR, SB1_ADDR);
+ /**/ Continue to write SB1 32KB * /
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_CTRL_RD);
+ }
+ }
+
+ printf("%d uint32_t value are verified successfully\n", len);
+ smdio_ssb_pdi_reset(lid, phy);
+
+ return len;
+}
+#endif
+
+/**
+ * Write data to SSB from offset 0x0
+ * data patter is increased by 1 for one uint32_t
+ * It is used for only for testing purpose
+ *
+ * len - number of uint32_t value to be writen
+ *
+ * return size of data writen to SSB if successful
+ */
+int smdio_ssb_write_verify(uint8_t lid, uint8_t phy, uint32_t len)
+{
+ uint32_t word_idx = 0;
+ uint32_t slice_cnt = 0;
+ uint16_t data_arr[8] = {0};
+ uint8_t num = 0;
+
+ if (len < 1 || len > 0x20000)
+ {
+ printf("data size overflow one slice SB size\n");
+ return -EINVAL;
+ }
+
+ smdio_ssb_pdi_reset(lid, phy);
+
+ /* Trigger write */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_CTRL_WR);
+ uint32_t idx = 0;
+ while (idx < len)
+ {
+
+ num = 0;
+ for (uint8_t i = 0; i < 4; i++)
+ {
+ if (idx + i < len)
+ {
+ data_arr[2 * i] = (0x20f00000 + (idx + i) * 4) & 0xFFFF;
+ data_arr[2 * i + 1] = ((0x20f00000 + (idx + i) * 4) >> 16) & 0xFFFF;
+ num += 2;
+ }
+ }
+ smdio_cont_write(lid, phy, SB_PDI_DATA, data_arr, num);
+ idx += num / 2;
+ word_idx += num;
+
+ if (word_idx == 16384)
+ { /* 32KB is done, need to set SB PDI addr to 0x7800 */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_RST);
+ smdio_write(lid, phy, SB_PDI_ADDR, SB1_ADDR);
+ /* Continue to write SB1 32KB */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_CTRL_WR);
+ }
+ else if (word_idx == 32768)
+ { /* One slice is done */
+ smdio_ssb_pdi_reset(lid, phy);
+ /* Notidy target MCUBoot one slice is done */
+ smdio_write(lid, phy, SB_PDI_STAT, 0x1);
+ sleep(0.003);
+
+ /* Prepare for next slice */
+ slice_cnt++;
+ word_idx = 0;
+
+ /* Wait for target MCUBoot to select the next slice */
+ if (!smdio_ssb_wait_pdi_stat_is_zero(lid, phy))
+ {
+ printf("Target MCUBoot not responsive\n");
+ return -ECANCELED;
+ }
+ /* Trigger next slice write */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_CTRL_WR);
+ }
+ }
+
+ /* all data written to SSB
+ loop until to slice 8 to allow MCUBoot to know firmware download completed */
+ smdio_write(lid, phy, SB_PDI_CTRL, SB_PDI_RST);
+ while (slice_cnt <= 8)
+ {
+ smdio_write(lid, phy, SB_PDI_STAT, 0x1);
+ slice_cnt++;
+ sleep(0.003);
+ /* Wait for target MCUBoot to select the next slice */
+ if (!smdio_ssb_wait_pdi_stat_is_zero(lid, phy))
+ {
+ printf("Target MCUBoot not responsive\n");
+ return -ECANCELED;
+ }
+ }
+
+ smdio_ssb_pdi_reset(lid, phy);
+
+ return len;
+}
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_ssb.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_ssb.h
new file mode 100644
index 0000000..3af4bae
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/apps/download/smdio_ssb.h
@@ -0,0 +1,66 @@
+
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+/**
+ \file smdio_ssb.h
+ GPHY mode flashless load FW example.
+
+*/
+
+#ifndef __SMDIO_SSB_H__
+#define __SMDIO_SSB_H__
+#include <stdint.h>
+
+/**
+ * Read FW file
+ */
+int ssb_flashless_load(uint8_t lid, char *fw_path);
+
+/**
+ * Check Register Status
+ */
+int check_registers(uint8_t lid);
+
+/**
+ * Write data to SSB from offset 0x0
+ *
+ * pdata - data pointer to be writen to SSB
+ * len - size of data pointer
+ *
+ * return size of data writen to SB if successful
+ */
+int smdio_ssb_write(uint8_t lid, uint8_t phy_id, uint8_t *pdata, uint32_t len);
+
+#ifdef SMDIO_TEST_TARGET
+/**
+ * Read data from SSB offset 0x0
+ * data patter is increased by 1 for one uint32_t
+ * Maximum is one slice SSB size 64KB
+ * It is used for only for testing purpose
+ *
+ * len - number of uint32_t value to be read
+ *
+ * return size of data read from SB if successful
+ */
+int smdio_ssb_read_verify(uint8_t lid, uint8_t phy_id, uint32_t len);
+#endif
+
+/**
+ * Write data to SSB from offset 0x0
+ * data patter is increased by 1 for one uint32_t
+ * It is used for only for testing purpose
+ *
+ * len - number of uint32_t value to be writen
+ *
+ * return size of data writen to SSB if successful
+ */
+int smdio_ssb_write_verify(uint8_t lid, uint8_t phy_id, uint32_t len);
+
+#endif /* #define __SMDIO_SSB_H__ */
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds.c
new file mode 100644
index 0000000..0083a05
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds.c
@@ -0,0 +1,163 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+/**
+ \file cmds.c
+*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "os_types.h"
+#include "os_linux.h"
+
+#include "cmds.h"
+#include "cmds_fapi.h"
+#include "cmds_apps_ssb.h"
+
+/* ========================================================================== */
+/* Function prototypes */
+/* ========================================================================== */
+static CmdArgs_t *cmds_update_args(int prmc, char *name, char *prmv[]);
+static unsigned long int string2val(char *s);
+static void cmds_help(void);
+
+/* command arguments */
+static CmdArgs_t cmds_Args;
+
+static CmdArgs_t *cmds_update_args(int prmc, char *name, char *prmv[])
+{
+ int i;
+ memset(&cmds_Args, 0, sizeof(cmds_Args));
+
+ for (i = 0; i < ARG_COUNT; i++)
+ {
+ if (prmc > i)
+ {
+ cmds_Args.prmvi[i] = (int)string2val(prmv[i]);
+ cmds_Args.prmvs[i] = prmv[i];
+ }
+ else
+ break;
+ }
+
+ cmds_Args.name = name;
+ cmds_Args.prmc = prmc;
+
+ return &cmds_Args;
+}
+
+/*
+ * string2val:
+ * hexadecimal -> 0x[0-9 AaBbCcDdEeFf]
+ * decimal -> [0-9]
+ * illegal: return 0;
+ */
+static unsigned long int string2val(char *s)
+{
+ int base = 10;
+ char *p = s;
+
+ /* hexadecimal value start with 0x */
+ if (s[0] == '0' && s[1] == 'x')
+ {
+ base = 16;
+ p += 2;
+
+ for (; *p; p++)
+ {
+ if ((*p < '0' || *p > 'f') || (*p > '9' && *p < 'A') || (*p > 'F' && *p < 'a'))
+ {
+ printf("string2val: Illegal hexadecimal value!\n");
+ return 0;
+ }
+ }
+ }
+ else
+ {
+ /* otherwise decimal value */
+ base = 10;
+ for (; *p; p++)
+ {
+ if ((*p < '0' || *p > '9'))
+ {
+ return 0;
+ }
+ }
+ }
+
+ /* return the value according to base 10 or 16 */
+ return strtoul(s, &p, base);
+}
+
+OS_boolean_t cmds(char *name, int prmc, char *prmv[],
+ int *err)
+{
+ OS_boolean_t api_executed;
+ int ret;
+ CmdArgs_t *pCmdArgs;
+
+ pCmdArgs = cmds_update_args(prmc, name, prmv);
+
+ if (cmds_fapi(pCmdArgs, &ret) == OS_TRUE)
+ {
+ return ret;
+ }
+ if (cmds_ssb(pCmdArgs, &ret) == OS_TRUE)
+ {
+ return ret;
+ }
+
+ ret = OS_SUCCESS;
+ api_executed = OS_TRUE;
+
+ /*****************************************
+ * CLI CMD *
+ *****************************************/
+ if ((strcmp(name, "cmds-help") == 0) || (strcmp(name, "cmds-?") == 0))
+ {
+ cmds_help();
+ }
+
+ /***************
+ * No command *
+ ***************/
+ else
+ {
+ api_executed = OS_FALSE;
+ }
+
+ *err = ret;
+ return api_executed;
+}
+
+int cmds_symlink_set(void)
+{
+ int ret = 0;
+
+ /* Create cmds symbolic links */
+ ret |= cmds_fapi_symlink_set();
+ ret |= cmds_ssb_symlink_set();
+ return ret;
+}
+
+static void cmds_help(void)
+{
+ printf("+------------------------------------------------------------------+\n");
+ printf("| HELP ! |\n");
+ printf("| Ethernet Software Toolbox (%s) |\n", ETHSWBOX_VERSION_STR);
+ printf("| |\n");
+ printf("| CMDS |\n");
+ printf("+------------------------------------------------------------------+\n");
+ printf("| |\n");
+ printf("+------------------------------------------------------------------+\n");
+ printf("\n");
+}
\ No newline at end of file
diff --git a/feed/app/ethswbox/src/example/cli/cmds/cmds.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds.h
similarity index 76%
rename from feed/app/ethswbox/src/example/cli/cmds/cmds.h
rename to feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds.h
index d01b72a..e73d239 100644
--- a/feed/app/ethswbox/src/example/cli/cmds/cmds.h
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds.h
@@ -13,33 +13,32 @@
/**
\file cmds.h
-
+
*/
#include "ethswbox_version.h"
#ifdef __cplusplus
- extern "C" {
+extern "C"
+{
#endif
-
/* ========================================================================== */
/* Function prototypes */
/* ========================================================================== */
extern OS_boolean_t cmds(char *name, int prmc, char *prmv[], int *err);
-extern int cmds_symlink_set (void);
-
+ extern int cmds_symlink_set(void);
-#define ARG_COUNT 50
-/* Global command arguments */
-typedef struct {
- char *name;
- int prmc;
- int prmvi[ARG_COUNT];
- char*prmvs[ARG_COUNT];
-} CmdArgs_t;
-
+#define ARG_COUNT 50
+ /* Global command arguments */
+ typedef struct
+ {
+ char *name;
+ int prmc;
+ int prmvi[ARG_COUNT];
+ char *prmvs[ARG_COUNT];
+ } CmdArgs_t;
#ifdef __cplusplus
}
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_apps_ssb.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_apps_ssb.c
new file mode 100644
index 0000000..b8a524f
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_apps_ssb.c
@@ -0,0 +1,104 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+/**
+ \file cmds_lif.c
+ Implements CLI commands for lif mdio
+
+*/
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "os_types.h"
+#include "os_linux.h"
+
+#include "cmds.h"
+#include "cmds_apps_ssb.h"
+#include "host_smdio_ssb.h"
+
+/* ========================================================================== */
+/* Function prototypes */
+/* ========================================================================== */
+static void cmds_ssb_help(void);
+
+OS_boolean_t cmds_ssb(CmdArgs_t *pArgs, int *err)
+{
+ OS_boolean_t api_executed;
+ int32_t ret;
+
+ if (pArgs == NULL)
+ {
+ *err = OS_ERROR;
+ return OS_TRUE;
+ }
+
+ ret = OS_SUCCESS;
+ api_executed = OS_TRUE;
+
+ /******************************************
+ * ssb CLI cmds *
+ ******************************************/
+
+ if ((strcmp(pArgs->name, "cmds-lif-help") == 0) || (strcmp(pArgs->name, "cmds-lif-?") == 0))
+ {
+ cmds_ssb_help();
+ }
+
+ /***************************************
+ * cmds_ssb: *
+ * - ssb-read-file *
+ * ************************************/
+
+ else if (strcmp(pArgs->name, "ssb_smdio_download") == 0)
+ {
+ char *file_to_read;
+ unsigned char *pdata;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: ssb_smdio_download\n");
+ printf("file_path: Path to File\n");
+
+ goto goto_end_help;
+ }
+ file_to_read = pArgs->prmvs[0];
+
+ ssb_load(file_to_read);
+ }
+
+ /***************
+ * No command *
+ ***************/
+ else
+ {
+ api_executed = OS_FALSE;
+ }
+
+goto_end_help:
+ *err = (int)ret;
+ return api_executed;
+}
+
+int cmds_ssb_symlink_set(void)
+{
+ system ("ln -sf ./ethswbox /usr/sbin/ssb_smdio_download");
+ return OS_SUCCESS;
+}
+
+static void cmds_ssb_help(void)
+{
+ printf("+------------------------------------------------------------------+\n");
+ printf("| HELP ! |\n");
+ printf("| |\n");
+ printf("+------------------------------------------------------------------+\n");
+ printf("| ssb_smdio_download : Load FW |\n");
+ printf("\n");
+}
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_apps_ssb.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_apps_ssb.h
new file mode 100644
index 0000000..4589610
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_apps_ssb.h
@@ -0,0 +1,34 @@
+#ifndef _CMDS_APPS_SSB_H
+#define _CMDS_APPS_SSB_H
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+/**
+
+ \file cmd_apps_ssb.h
+
+*/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ /* ========================================================================== */
+ /* Function prototypes */
+ /* ========================================================================== */
+ extern OS_boolean_t cmds_ssb(CmdArgs_t *pArgs, int *err);
+ extern int cmds_ssb_symlink_set(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_fapi.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_fapi.c
new file mode 100644
index 0000000..9a26d94
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_fapi.c
@@ -0,0 +1,3866 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+/**
+ \file cmds_fapi.c
+ Implements CLI commands for lif mdio
+
+*/
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "os_types.h"
+#include "os_linux.h"
+
+#include "cmds.h"
+#include "cmds_fapi.h"
+#include "host_adapt.h"
+#include "fapi_gsw_hostapi.h"
+#include "fapi_gsw_hostapi_mdio_relay.h"
+
+#define slif_lib ""
+
+/* ========================================================================== */
+/* Function prototypes */
+/* ========================================================================== */
+static void cmds_fapi_help(void);
+
+OS_boolean_t cmds_fapi(CmdArgs_t *pArgs, int *err)
+{
+ OS_boolean_t api_executed;
+ int32_t ret;
+
+ if (pArgs == NULL)
+ {
+ *err = OS_ERROR;
+ return OS_TRUE;
+ }
+
+ ret = OS_SUCCESS;
+ api_executed = OS_TRUE;
+
+ /******************************************
+ * lif CLI cmds *
+ ******************************************/
+
+ if ((strcmp(pArgs->name, "cmds-fapi-help") == 0) || (strcmp(pArgs->name, "cmds-gsw-?") == 0))
+ {
+ cmds_fapi_help();
+ }
+
+ /****************************************
+ * gsw_API: *
+ * - api-gsw-internal-read *
+ * - api-gsw-internal-write *
+ * - api-gsw-get-links *
+ * - api-gsw-read *
+ * - api-gsw-write *
+ * *************************************/
+
+ else if (strcmp(pArgs->name, "fapi-int-gphy-write") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 4)
+ {
+ printf("Usage: fapi-int-gphy-write phy=<> mmd=<> reg=<reg> data=<>\n");
+ printf("phy: phy id\n");
+ printf("mmd: mmd addres\n");
+ printf("reg: mdio register\n");
+ printf("data: value to write\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_int_gphy_write(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-int-gphy-read") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 3)
+ {
+ printf("Usage: fapi-int-gphy-read phy=<> mmd=<> reg=<reg>\n");
+ printf("phy: phy id\n");
+ printf("mmd: mmd addres\n");
+ printf("reg: mdio register\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_int_gphy_read(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-ext-mdio-write") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 4)
+ {
+ printf("Usage: fapi-ext-mdio-write phy=<> mmd=<> reg=<reg> data=<>\n");
+ printf("phy: phy address\n");
+ printf("mmd: mmd addres\n");
+ printf("reg: mdio register\n");
+ printf("data: value to write\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_ext_mdio_write(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-ext-mdio-read") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 3)
+ {
+ printf("Usage: fapi-ext-mdio-read phy=<> mmd=<> reg=<reg>\n");
+ printf("phy: phy address\n");
+ printf("mmd: mmd addres\n");
+ printf("reg: mdio register\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_ext_mdio_read(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-ext-mdio-mod") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 4)
+ {
+ printf("Usage: fapi-ext-mdio-mod phy=<> mmd=<> reg=<reg> mask=<> data=<>\n");
+ printf("phy: phy address\n");
+ printf("mmd: mmd addres\n");
+ printf("reg: mdio register\n");
+ printf("mask: mask\n");
+ printf("data: data to write\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_ext_mdio_mod(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-int-gphy-mod") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 3)
+ {
+ printf("Usage: fapi-int-gphy-mod phy=<> mmd=<> reg=<reg> mask=<> data=<>\n");
+ printf("phy: phy id\n");
+ printf("mmd: mmd addres\n");
+ printf("reg: mdio register\n");
+ printf("mask: mask\n");
+ printf("data: data to write\n");
+
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_int_gphy_mod(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-RegisterGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RegisterGet nRegAddr=<reg>\n");
+ printf("reg: register\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RegisterGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-RegisterSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RegisterSet nRegAddr=<reg> nData=<data>\n");
+ printf("reg: register\n");
+ printf("data: data to write\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RegisterSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-RegisterMod") == 0)
+ {
+
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RegisterMod nRegAddr=<reg> nData=<data> nMask=<mask>\n");
+ printf("nRegAddr: register\n");
+ printf("nData: data to write\n");
+ printf("nMask: mask\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RegisterMod(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-PortLinkCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PortLinkCfgGet nPortId=<port>\n");
+ printf("port: port index <1-8>\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PortLinkCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PortLinkCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PortLinkCfgSet nPortId=<port> [bDuplexForce=<> eDuplex=<> bSpeedForce=<> eSpeed=<> bLinkForce=<> eLink=<> eMII_Mode=<> eMII_Type=<> eClkMode=<> bLPI=<>]\n");
+ printf("port: port index <1-8>\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PortLinkCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-RMON-Clear") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RMON-Clear nRmonId=<ID> eRmonType=<TYPE>\n");
+ printf("ID: RMON Counters Identifier\n");
+ printf("TYPE: RMON Counters Type\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RMON_Clear(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-MonitorPortCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MonitorPortCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MonitorPortCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MonitorPortCfgSet nPortId=<port> nSubIfId=<ID>\n");
+ printf("port: port index <1-8>\n");
+ printf("ID: Monitoring Sub-IF id\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MonitorPortCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-PortCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-PortCfgGet nPortId=<port>\n");
+ printf("port: port index <1-8>\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_PortCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-PortCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-PortCfgSet nPortId=<port> eClassMode=<CLASS> nTrafficClass=<TR>\n");
+ printf("port: port index <1-8>\n");
+ printf("eClassMode: Select the packet header field\n");
+ printf("nTrafficClass: Default port priority\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_PortCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-CPU-PortGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc != 0)
+ {
+ printf("Usage: fapi-GSW-CPU-PortGet\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CPU_PortGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-CPU-PortSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc != 1)
+ {
+ printf("Usage!: fapi-GSW-CPU-PortSet nPortId=x\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CPU_PortSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-DSCP-ClassGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_DSCP_ClassGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-DSCP-ClassSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-DSCP-ClassSet nTrafficClass=<TC> nDSCP=<DSCP>\n");
+ printf("nTrafficClass: Configures the DSCP to traffic class mapping\n");
+ printf("nDSCP: DSCP to drop precedence assignment\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_DSCP_ClassSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-PCP-ClassGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_PCP_ClassGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-PCP-ClassSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-PCP-ClassSet nTrafficClass=<TC> nPCP=<priority>\n");
+ printf("nTrafficClass: Configures the PCP to traffic class mapping\n");
+ printf("nPCP: priority to drop precedence assignment\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_PCP_ClassSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-SVLAN-PCP-ClassGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_SVLAN_PCP_ClassGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-SVLAN-PCP-ClassSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-SVLAN-PCP-ClassSet nTrafficClass=<TC> nPCP=<priority>\n");
+ printf("nTrafficClass: Configures the SVLAN PCP to traffic class mapping\n");
+ printf("nPCP: priority to drop precedence assignment\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_SVLAN_PCP_ClassSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-ShaperCfgGet nRateShaperId=<Id>\n");
+ printf("id: Rate shaper index\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ShaperCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-ShaperCfgSet nRateShaperId=<Id> bEnable=<En> nCbs=<CB> nRate=<Rt>\n");
+ printf("id: Rate shaper index\n");
+ printf("En: Enable/Disable the rate shaper\n");
+ printf("CB: Committed Burst Size\n");
+ printf("Rt: Rate [kbit/s]\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ShaperCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperQueueGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-ShaperQueueGet nQueueId=<Id>\n");
+ printf("id: Rate shaper index\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ShaperQueueGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperQueueAssign") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-ShaperQueueAssign nQueueId=<QId> nRateShaperId=<RId>\n");
+ printf("QId: Queue index\n");
+ printf("RId: Rate shaper index\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ShaperQueueAssign(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ShaperQueueDeassign") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-ShaperQueueDeassign nQueueId=<QId> nRateShaperId=<RId>\n");
+ printf("QId: Queue index\n");
+ printf("RId: Rate shaper index\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ShaperQueueDeassign(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-SchedulerCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-SchedulerCfgGet nQueueId=<QId>\n");
+ printf("QId: Queue index\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_SchedulerCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-SchedulerCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-SchedulerCfgSet nQueueId=<QId> eType=<Type> nWeight=<We>\n");
+ printf("QId: Queue index\n");
+ printf("Type: Scheduler Type\n");
+ printf("We: Weight in Token. Parameter used for WFQ configuration\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_SchedulerCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_WredCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-WredCfgSet eProfile=<Prof> eMode=<Md> eThreshMode=<THR> nRed_Min=<RMin> nRed_Max=<RMax> nYellow_Min=<YMin> nYellow_Max=<YMax> nGreen_Min=<GMin> nGreen_Max=<GMax>\n");
+ printf("Prof: Drop Probability Profile\n");
+ printf("Md: Automatic or Manual Mode of Thresholds Config\n");
+ printf("THR: WRED Threshold Mode Config\n");
+ printf("RMin: WRED Red Threshold Min\n");
+ printf("RMax: WRED Red Threshold Max\n");
+ printf("YMin: WRED Yellow Threshold Min\n");
+ printf("YMax: WRED Yellow Threshold Max\n");
+ printf("GMin: WRED Green Threshold Min\n");
+ printf("GMax: WRED Green Threshold Max\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_WredCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredQueueCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-WredQueueCfgSet nQueueId=<QId>\n");
+ printf("QId: Queue Index\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_WredQueueCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredQueueCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-WredQueueCfgSet nQueueId=<QId> nRed_Min=<RMin> nRed_Max=<RMax> nYellow_Min=<YMin> nYellow_Max=<YMax> nGreen_Min=<GMin> nGreen_Max=<GMax>\n");
+ printf("QId: Queue Index\n");
+ printf("RMin: WRED Red Threshold Min\n");
+ printf("RMax: WRED Red Threshold Max\n");
+ printf("YMin: WRED Yellow Threshold Min\n");
+ printf("YMax: WRED Yellow Threshold Max\n");
+ printf("GMin: WRED Green Threshold Min\n");
+ printf("GMax: WRED Green Threshold Max\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_WredQueueCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredPortCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-WredPortCfgGet nPortId=<port>\n");
+ printf("port: Port Index\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_WredPortCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-WredPortCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-WredPortCfgSet nPortId=<port> nRed_Min=<RMin> nRed_Max=<RMax> nYellow_Min=<YMin> nYellow_Max=<YMax> nGreen_Min=<GMin> nGreen_Max=<GMax>\n");
+ printf("port: Port Index\n");
+ printf("RMin: WRED Red Threshold Min\n");
+ printf("RMax: WRED Red Threshold Max\n");
+ printf("YMin: WRED Yellow Threshold Min\n");
+ printf("YMax: WRED Yellow Threshold Max\n");
+ printf("GMin: WRED Green Threshold Min\n");
+ printf("GMax: WRED Green Threshold Max\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_WredPortCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-TrunkingCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_TrunkingCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-TrunkingCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-TrunkingCfgSet bIP_Src=<bIP_Src> bIP_Dst=<bIP_Dst> bMAC_Src=<bMAC_Src> bMAC_Dst=<bMAC_Dst> bSrc_Port=<bSrc_Port> bDst_Port=<bDst_Port>\n");
+ printf("bIP_Src: MAC source address Use\n");
+ printf("bIP_Dst: MAC destination address Use\n");
+ printf("bMAC_Src: MAC source address Use\n");
+ printf("bMAC_Dst: MAC destination address Use\n");
+ printf("bSrc_Port: TCP/UDP source Port Use\n");
+ printf("bDst_Port: TCP/UDP Destination Port Use\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_TrunkingCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableClear") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MAC_TableClear(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableClear-Cond") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MAC-TableClear-Cond eType=<> nPortId=<>\n");
+ printf("eType: MAC table clear type\n");
+ printf("nPortId: Physical port id\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+
+ ret = fapi_GSW_MAC_TableCondClear(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-CfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-CfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-CfgSet bIP_Src=<bIP_Src> bIP_Dst=<bIP_Dst> bMAC_Src=<bMAC_Src> bMAC_Dst=<bMAC_Dst> bSrc_Port=<bSrc_Port> bDst_Port=<bDst_Port>\n");
+ printf("eMAC_TableAgeTimer: MAC table aging timer\n");
+ printf("nAgeTimer: MAC table aging timer in seconds\n");
+ printf("nMaxPacketLen: Maximum Ethernet packet length\n");
+ printf("bLearningLimitAction: Automatic MAC address table learning limitation {False: Drop/True: Forward}\n");
+ printf("bMAC_LockingAction: Accept or discard MAC port locking violation packets {False: Drop/True: Forward}\n");
+ printf("bMAC_SpoofingAction: Accept or discard MAC spoofing and port MAC locking violation packets {False: Drop/True: Forward}\n");
+ printf("bDst_bPauseMAC_ModeSrcPort: Pause frame MAC source address mode\n");
+ printf("nPauseMAC_Src: Pause frame MAC source address\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableEntryRemove") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MAC-TableEntryRemove nFId=<FId> nMAC=<MAC> nTci=<Tci>\n");
+ printf("FId: Filtering Identifier (FID)\n");
+ printf("MAC: MAC Address to be removed from the table\n");
+ printf("Tci: TCI for (GSWIP-3.2) B-Step\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MAC_TableEntryRemove(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableEntryQuery") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-TableEntryQuery nFId=<FId> nMAC=<MAC> nTci=<Tci> nFilterFlag=<Flag>\n");
+ printf("FId: Filtering Identifier (FID)\n");
+ printf("MAC: MAC Address to be removed from the table\n");
+ printf("Tci: TCI for (GSWIP-3.2) B-Step\n");
+ printf("Flag: Source/Destination MAC address filtering flag {Value 0 - not filter, 1 - source address filter, 2 - destination address filter, 3 - both source and destination filter}\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MAC_TableEntryQuery(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-FlowctrlCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_FlowctrlCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-FlowctrlCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-FlowctrlCfgSet nFlowCtrlNonConform_Min=<NCMin> nFlowCtrlNonConform_Max=<NCMax> nFlowCtrlConform_Min=<CMin> nFlowCtrlConform_Max=<CMax>\n");
+ printf("NCMin: Global Buffer Non Conforming Flow Control Threshold Minimum\n");
+ printf("NCMax: Global Buffer Non Conforming Flow Control Threshold Maximum\n");
+ printf("CMin: Global Buffer Conforming Flow Control Threshold Minimum\n");
+ printf("CMax: Global Buffer Conforming Flow Control Threshold Maximum\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_FlowctrlCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-FlowctrlPortCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-FlowctrlPortCfgGet nPortId=<port>\n");
+ printf("port: Ethernet Port number\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_FlowctrlPortCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-FlowctrlPortCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-FlowctrlPortCfgSet nPortId=<port> nFlowCtrl_Min=<Min> nFlowCtrl_Max=<Max>\n");
+ printf("port: Ethernet Port number\n");
+ printf("Min: Ingress Port occupied Buffer Flow Control Threshold Minimum\n");
+ printf("Max: Ingress Port occupied Buffer Flow Control Threshold Maximum\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_FlowctrlPortCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableEntryAdd") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MAC-TableEntryAdd\n");
+ printf("nFId=<> : Filtering Identifier (FID)\n");
+ printf("nPortId=<> : Ethernet Port number (zero-based counting)\n");
+ printf("nAgeTimer=<> : Aging Time, given in multiples of 1 second in a range\n");
+ printf("bStaticEntry=<> : Static Entry (value will be aged out if the entry is not set to static)\n");
+ printf("nTrafficClass=<> : Egress queue traffic class\n");
+ printf("bIgmpControlled=<> : Packet is marked as IGMP controlled if destination MAC address matches MAC in this entry\n");
+ printf("nFilterFlag=<> : Source/Destination MAC address filtering flag\n");
+ printf("nSVLAN_Id=<> : STAG VLAN Id. Only applicable in case SVLAN support is enabled on the device\n");
+ printf("nSubIfId=<> : In GSWIP-3.1, this field is sub interface ID for WLAN logical port\n");
+ printf("nMAC=<> : MAC Address to add to the table\n");
+ printf("nAssociatedMAC=<> : Associated Mac address\n");
+ printf("nTci=<> : TCI for (GSWIP-3.2) B-Step\n");
+ printf("nPortMapValueIndex0=<> : Bridge Port Map 0\n");
+ printf("nPortMapValueIndex1=<> : Bridge Port Map 1\n");
+ printf("nPortMapValueIndex2=<> : Bridge Port Map 2\n");
+ printf("nPortMapValueIndex3=<> : Bridge Port Map 3\n");
+ printf("nPortMapValueIndex4=<> : Bridge Port Map 4\n");
+ printf("nPortMapValueIndex5=<> : Bridge Port Map 5\n");
+ printf("nPortMapValueIndex6=<> : Bridge Port Map 6\n");
+ printf("nPortMapValueIndex7=<> : Bridge Port Map 7\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MAC_TableEntryAdd(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MAC-TableEntryRead") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MAC_TableEntryRead(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-QueuePortGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-QueuePortGet nPortId=<> nTrafficClassId=<> bRedirectionBypass=<> bExtrationEnable=<>\n");
+ printf("nPortId=<> : Ethernet Port number (zero-based counting)\n");
+ printf("nTrafficClassId=<> : Traffic Class index\n");
+ printf("bRedirectionBypass=<> : Queue Redirection bypass Option\n");
+ printf("bExtrationEnable=<> : Forward CPU (extraction) before external QoS queueing \n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_QueuePortGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-QueuePortSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-QueuePortSet nPortId=<> nTrafficClassId=<> bRedirectionBypass=<> bExtrationEnable=<> eQMapMode=<> nQueueId=<> nRedirectPortId=<> bEnableIngressPceBypass=<> bReservedPortMode=<>\n");
+ printf("nPortId=<> : Ethernet Port number (zero-based counting)\n");
+ printf("nTrafficClassId=<> : Traffic Class index\n");
+ printf("bRedirectionBypass=<> : Queue Redirection bypass Option\n");
+ printf("bExtrationEnable=<> : Forward CPU (extraction) before external QoS queueing \n");
+ printf("eQMapMode=<> : Ethernet Port number (zero-based counting)\n");
+ printf("nQueueId=<> : Traffic Class index\n");
+ printf("nRedirectPortId=<> : Queue Redirection bypass Option\n");
+ printf("bEnableIngressPceBypass=<> : Forward CPU (extraction) before external QoS queueing \n");
+ printf("bReservedPortMode=<> : Ethernet Port number (zero-based counting)\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_QueuePortSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-QueueCfgSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 3)
+ {
+ printf("Usage: fapi-GSW-QoS-QueueCfgSett nQueueId=(0~255) bEnable=0/1 nPortId=(0~15)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_QueueCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-QueueCfgGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage!: fapi-GSW-QoS-QueueCfgGet nQueueId=n(0~255)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_QueueCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgePortConfigGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-BridgePortConfigGet nBridgePortId=<> eMask=<>\n");
+ printf("nBridgePortId=<> : Bridge ID\n");
+ printf("eMask=<> : Mask for updating/retrieving fields\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgePortConfigGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgePortConfigSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-BridgePortConfigGet\n");
+ printf("nBridgePortId=<> : Bridge ID\n");
+ printf("nBridgeId=<> : Bridge ID\n");
+ printf("bIngressExtendedVlanEnable=<>\n");
+ printf("nIngressExtendedVlanBlockId=<>\n");
+ printf("bEgressExtendedVlanEnable=<>\n");
+ printf("nEgressExtendedVlanBlockId=<>\n");
+ printf("eIngressMarkingMode=<>\n");
+ printf("eEgressRemarkingMode=<>\n");
+ printf("bIngressMeteringEnable=<>\n");
+ printf("nIngressTrafficMeterId=<>\n");
+ printf("bEgressMeteringEnable=<>\n");
+ printf("nEgressTrafficMeterId=<>\n");
+ printf("bEgressBroadcastSubMeteringEnable=<>\n");
+ printf("bEgressMulticastSubMeteringEnable=<>\n");
+ printf("bEgressUnknownMulticastIPSubMeteringEnable=<>\n");
+ printf("bEgressUnknownMulticastNonIPSubMeteringEnable=<>\n");
+ printf("bEgressUnknownUnicastSubMeteringEnable=<>\n");
+ printf("nEgressBroadcastSubMeteringId=<>\n");
+ printf("nEgressMulticastSubMeteringId=<>\n");
+ printf("nEgressUnknownMulticastIPSubMeteringId=<>\n");
+ printf("nEgressUnknownMulticastNonIPSubMeteringId=<>\n");
+ printf("nEgressUnknownUnicastSubMeteringId=<>\n");
+ printf("nDestLogicalPortId=<>\n");
+ printf("nDestSubIfIdGroup=<>\n");
+ printf("bPmapperEnable=<>\n");
+ printf("ePmapperMappingMode=<>\n");
+ printf("nPmapperDestSubIfIdGroup=<>\n");
+ printf("bBridgePortMapEnable=<>\n");
+ printf("Index=<>\n");
+ printf("MapValue=<>\n");
+ printf("bMcDestIpLookupDisable=<>\n");
+ printf("bMcSrcIpLookupEnable=<>\n");
+ printf("bDestMacLookupDisable=<>\n");
+ printf("bSrcMacLearningDisable=<>\n");
+ printf("bMacSpoofingDetectEnable=<>\n");
+ printf("bPortLockEnable=<>\n");
+ printf("bMacLearningLimitEnable=<>\n");
+ printf("nMacLearningLimit=<>\n");
+ printf("bIngressVlanFilterEnable=<>\n");
+ printf("nIngressVlanFilterBlockId=<>\n");
+ printf("bBypassEgressVlanFilter1=<>\n");
+ printf("bEgressVlanFilter1Enable=<>\n");
+ printf("nEgressVlanFilter1BlockId=<>\n");
+ printf("bEgressVlanFilter2Enable=<>\n");
+ printf("nEgressVlanFilter2BlockId=<>\n");
+ printf("bVlanTagSelection=<>\n");
+ printf("bVlanSrcMacPriorityEnable=<>\n");
+ printf("bVlanSrcMacDEIEnable=<>\n");
+ printf("bVlanSrcMacVidEnable=<>\n");
+ printf("bVlanDstMacPriorityEnable=<>\n");
+ printf("bVlanDstMacDEIEnable=<>\n");
+ printf("bVlanDstMacVidEnable=<>\n");
+ printf("bVlanMulticastPriorityEnable=<>\n");
+ printf("bVlanMulticastDEIEnable=<>\n");
+ printf("bVlanMulticastVidEnable=<>\n");
+ printf("nLoopViolationCount=<>\n");
+ printf("bForce=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgePortConfigSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-CtpPortConfigGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-CtpPortConfigGet nLogicalPortId=<> nSubIfIdGroup=<> eMask=<>\n");
+ printf("nLogicalPortId=<> : Bridge ID\n");
+ printf("nSubIfIdGroup=<> : Sub interface ID group\n");
+ printf("eMask=<> : Mask for updating/retrieving fields\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CtpPortConfigGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-CtpPortConfigSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-CtpPortConfigSet\n");
+ printf("nLogicalPortId=<>\n");
+ printf("nSubIfIdGroup=<>\n");
+ printf("nBridgePortId=<>\n");
+ printf("bForcedTrafficClass=<>\n");
+ printf("nDefaultTrafficClass=<>\n");
+ printf("bIngressExtendedVlanEnable=<>\n");
+ printf("nIngressExtendedVlanBlockId=<>\n");
+ printf("bIngressExtendedVlanIgmpEnable=<>\n");
+ printf("nIngressExtendedVlanBlockIdIgmp=<>\n");
+ printf("bEgressExtendedVlanEnable=<>\n");
+ printf("nEgressExtendedVlanBlockId=<>\n");
+ printf("bEgressExtendedVlanIgmpEnable=<>\n");
+ printf("nEgressExtendedVlanBlockIdIgmp=<>\n");
+ printf("bIngressNto1VlanEnable=<>\n");
+ printf("bEgressNto1VlanEnable=<>\n");
+ printf("eIngressMarkingMode=<>\n");
+ printf("eEgressMarkingMode=<>\n");
+ printf("bEgressMarkingOverrideEnable=<>\n");
+ printf("eEgressMarkingModeOverride=<>\n");
+ printf("eEgressRemarkingMode=<>\n");
+ printf("bIngressMeteringEnable=<>\n");
+ printf("nIngressTrafficMeterId=<>\n");
+ printf("bEgressMeteringEnable=<>\n");
+ printf("nEgressTrafficMeterId=<>\n");
+ printf("bBridgingBypass=<>\n");
+ printf("nDestLogicalPortId=<>\n");
+ printf("nDestSubIfIdGroup=<>\n");
+ printf("bPmapperEnable=<>\n");
+ printf("ePmapperMappingMode=<>\n");
+ printf("nFirstFlowEntryIndex=<>\n");
+ printf("nNumberOfFlowEntries=<>\n");
+ printf("bIngressLoopbackEnable=<>\n");
+ printf("bIngressDaSaSwapEnable=<>\n");
+ printf("bEgressLoopbackEnable=<>\n");
+ printf("bEgressDaSaSwapEnable=<>\n");
+ printf("bIngressMirrorEnable=<>\n");
+ printf("bEgressMirrorEnable=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CtpPortConfigSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgeAlloc") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgeAlloc(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgeFree") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-BridgeFree nBridgeId=<>\n");
+ printf("nBridgeId: Bridge ID (FID) to which this bridge port is associated\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgeFree(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgeConfigGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-BridgeConfigGet nBridgeId=<> eMask=<>\n");
+ printf("nBridgeId: Bridge ID (FID) to which this bridge port is associated\n");
+ printf("eMask: Mask\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgeConfigGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgeConfigSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-BridgeConfigSet\n");
+ printf("nBridgeId=<>\n");
+ printf("bMacLearningLimitEnable=<>\n");
+ printf("nMacLearningLimit=<>\n");
+ printf("eForwardBroadcast=<>\n");
+ printf("eForwardUnknownMulticastIp=<>\n");
+ printf("eForwardUnknownMulticastNonIp=<>\n");
+ printf("eForwardUnknownUnicast=<>\n");
+ printf("bBroadcastMeterEnable=<>\n");
+ printf("nBroadcastMeterId=<>\n");
+ printf("bMulticastMeterEnable=<>\n");
+ printf("nMulticastMeterId=<>\n");
+ printf("bUnknownMulticastIpMeterEnable=<>\n");
+ printf("nUnknownMulticastIpMeterId=<>\n");
+ printf("bUnknownMulticastNonIpMeterEnable=<>\n");
+ printf("nUnknownMulticastNonIpMeterId=<>\n");
+ printf("bUnknownUniCastMeterEnable=<>\n");
+ printf("nUnknownUniCastMeterId=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgeConfigSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ // ###################
+
+ else if (strcmp(pArgs->name, "fapi-GSW-ExtendedVlanAlloc") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-ExtendedVlanAlloc nNumberOfEntries=<>\n");
+ printf("nNumberOfEntries: Total number of extended VLAN entries are requested\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_ExtendedVlanAlloc(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-ExtendedVlanFree") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-ExtendedVlanFree nExtendedVlanBlockId=<>\n");
+ printf("nExtendedVlanBlockId: Block Id\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_ExtendedVlanFree(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-ExtendedVlanGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-ExtendedVlanGet\n");
+ printf("nExtendedVlanBlockId=<>\n");
+ printf("nEntryIndex=<>\n");
+ printf("bOriginalPacketFilterMode=<>\n");
+ printf("eFilter_4_Tpid_Mode=<>\n");
+ printf("eTreatment_4_Tpid_Mode=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_ExtendedVlanGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-ExtendedVlanSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-ExtendedVlanSet\n");
+ printf("nExtendedVlanBlockId=<>\n");
+ printf("nEntryIndex=<>\n");
+ printf("eOuterVlanFilterVlanType=<>\n");
+ printf("bOuterVlanFilterPriorityEnable=<>\n");
+ printf("nOuterVlanFilterPriorityVal=<>\n");
+ printf("bOuterVlanFilterVidEnable=<>\n");
+ printf("nOuterVlanFilterVidVal=<>\n");
+ printf("eOuterVlanFilterTpid=<>\n");
+ printf("eOuterVlanFilterDei=<>\n");
+ printf("eInnerVlanFilterVlanType=<>\n");
+ printf("bInnerVlanFilterPriorityEnable=<>\n");
+ printf("nInnerVlanFilterPriorityVal=<>\n");
+ printf("bInnerVlanFilterVidEnable=<>\n");
+ printf("nInnerVlanFilterVidVal=<>\n");
+ printf("eInnerVlanFilterTpid=<>\n");
+ printf("eInnerVlanFilterDei=<>\n");
+ printf("eEtherType=<>\n");
+ printf("eRemoveTagAction=<>\n");
+ printf("bOuterVlanActionEnable=<>\n");
+ printf("eOuterVlanActionPriorityMode=<>\n");
+ printf("eOuterVlanActionPriorityVal=<>\n");
+ printf("eOuterVlanActionVidMode=<>\n");
+ printf("eOuterVlanActionVidVal=<>\n");
+ printf("eOuterVlanActionTpid=<>\n");
+ printf("eOuterVlanActioneDei=<>\n");
+ printf("bInnerVlanActionEnable=<>\n");
+ printf("eInnerVlanActionPriorityMode=<>\n");
+ printf("eInnerVlanActionPriorityVal=<>\n");
+ printf("eInnerVlanActionVidMode=<>\n");
+ printf("eInnerVlanActionVidVal=<>\n");
+ printf("eInnerVlanActionTpid=<>\n");
+ printf("eInnerVlanActioneDei=<>\n");
+ printf("bReassignBridgePortEnable=<>\n");
+ printf("nNewBridgePortId=<>\n");
+ printf("bNewDscpEnable=<>\n");
+ printf("nNewDscp=<>\n");
+ printf("bNewTrafficClassEnable=<>\n");
+ printf("nNewTrafficClass=<>\n");
+ printf("bNewMeterEnable=<>\n");
+ printf("sNewTrafficMeterId=<>\n");
+ printf("bLoopbackEnable=<>\n");
+ printf("bDaSaSwapEnable=<>\n");
+ printf("bMirrorEnable=<>\n");
+ printf("bDscp2PcpMapEnable=<>\n");
+ printf("nDscp2PcpMapValue=<>\n");
+ printf("bOriginalPacketFilterMode=<>\n");
+ printf("eFilter_4_Tpid_Mode=<>\n");
+ printf("eTreatment_4_Tpid_Mode=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_ExtendedVlanSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-VlanFilterAlloc") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ if (pArgs->prmc < 3)
+ {
+ printf("Usage: fapi-GSW-VlanFilterAlloc nNumberOfEntries=<> bDiscardUntagged=<> bDiscardUnmatchedTagged=<>\n");
+ printf("nNumberOfEntries: Total number of extended VLAN entries are requested\n");
+ printf("bDiscardUntagged: Discard packet without VLAN tag\n");
+ printf("bDiscardUnmatchedTagged: Discard packet not matching\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_VlanFilterAlloc(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-VlanFilterFree") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-VlanFilterFree nVlanFilterBlockId=<>\n");
+ printf("nVlanFilterBlockId: Block Id\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_VlanFilterFree(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-VlanFilterGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-VlanFilterGet nVlanFilterBlockId=<> nEntryIndex=<>\n");
+ printf("nVlanFilterBlockId: Block Id\n");
+ printf("nEntryIndex: Entry Index\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_VlanFilterGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-VlanFilterSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-VlanFilterSet nVlanFilterBlockId=<> nEntryIndex=<> eVlanFilterMask=<> nVal=<> bDiscardMatched=<>\n");
+ printf("nVlanFilterBlockId=<>\n");
+ printf("nEntryIndex=<>\n");
+ printf("eVlanFilterMask=<>\n");
+ printf("nVal=<>\n");
+ printf("bDiscardMatched=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_VlanFilterSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-STP-PortCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-STP-PortCfgGet nPortId=<>\n");
+ printf("nPortId: Port Id\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_STP_PortCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-STP-PortCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-STP-PortCfgSet nPortId=<> ePortState=<>\n");
+ printf("nPortId=<>\n");
+ printf("ePortState=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_STP_PortCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-STP-BPDU-RuleGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_STP_BPDU_RuleGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-STP-BPDU-RuleSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-STP-BPDU-RuleSet eForwardPort=<> nForwardPortId=<>\n");
+ printf("eForwardPort=<>\n");
+ printf("nForwardPortId=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_STP_BPDU_RuleSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Debug-RMON-Port-Get") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-Debug-RMON-Port-Get nPortId=<> ePortType=<>\n");
+ printf("nPortId=<>\n");
+ printf("ePortType=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Debug_RMON_Port_Get(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-MeterCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-MeterCfgGet nMeterId=<> \n");
+ printf("nMeterId: Meter index (zero-based counting)\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_MeterCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-MeterCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-MeterCfgSet\n");
+ printf("nMeterId: Meter index (zero-based counting)\n");
+ printf("bEnable=<>\n");
+ printf("eMtrType=<>\n");
+ printf("nCbs=<>\n");
+ printf("nEbs=<>\n");
+ printf("nRate=<>\n");
+ printf("nPiRate=<>\n");
+ printf("cMeterName=<>\n");
+ printf("nColourBlindMode=<>\n");
+ printf("bPktMode=<>\n");
+ printf("bLocalOverhd=<>\n");
+ printf("nLocaloverhd=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_MeterCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-MAC-DefaultFilterGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MAC-DefaultFilterGet eType=<>\n");
+ printf("eType: MAC Address Filter Type\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MAC_DefaultFilterGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MAC-DefaultFilterSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MAC-DefaultFilterSet eType=<>\n");
+ printf("eType: MAC Address Filter Type\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MAC_DefaultFilterSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-CTP-PortAssignmentGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-CTP-PortAssignmentGet nLogicalPortId=<>\n");
+ printf("nLogicalPortId=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CTP_PortAssignmentGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-CTP-PortAssignmentSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-CTP-PortAssignmentSet\n");
+ printf("nLogicalPortId=<>\n");
+ printf("nFirstCtpPortId=<>\n");
+ printf("nNumberOfCtpPort=<>\n");
+ printf("eMode=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CTP_PortAssignmentSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-GLBL-CfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PMAC-GLBL-CfgSet\n");
+ printf("nPmacId=<>\n");
+ printf("bRxFCSDis=<>\n");
+ printf("eProcFlagsEgCfg=<>\n");
+ printf("nBslThreshold0=<>\n");
+ printf("nBslThreshold1=<>\n");
+ printf("nBslThreshold2=<>\n");
+ printf("bAPadEna=<>\n");
+ printf("bPadEna=<>\n");
+ printf("bVPadEna=<>\n");
+ printf("bSVPadEna=<>\n");
+ printf("bTxFCSDis=<>\n");
+ printf("bIPTransChkRegDis=<>\n");
+ printf("bIPTransChkVerDis=<>\n");
+ printf("bJumboEna=<>\n");
+ printf("nMaxJumboLen=<>\n");
+ printf("nJumboThreshLen=<>\n");
+ printf("bLongFrmChkDis=<>\n");
+ printf("eShortFrmChkType=<>\n");
+ printf("bProcFlagsEgCfgEna=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_GLBL_CfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-GLBL-CfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PMAC-GLBL-CfgGet\n");
+ printf("nPmacId=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_GLBL_CfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-BM-CfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-PMAC-BM-CfgSet\n");
+ printf("nTxDmaChanId=<>\n");
+ printf("nPmacId=<>\n");
+ printf("txQMask=<>\n");
+ printf("rxPortMask=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_BM_CfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-BM-CfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-PMAC-BM-CfgGet\n");
+ printf("nTxDmaChanId=<>\n");
+ printf("nPmacId=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_BM_CfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-EG-CfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PMAC-EG-CfgSet\n");
+ printf("nPmacId=<>\n");
+ printf("bRedirEnable=<>\n");
+ printf("bBslSegmentDisable=<>\n");
+ printf("nBslTrafficClass=<>\n");
+ ;
+ printf("bResDW1Enable=<>\n");
+ printf("bRes2DW0Enable=<>\n");
+ printf("bRes1DW0Enable=<>\n");
+ printf("bTCEnable=<>\n");
+ printf("nDestPortId=<>\n");
+ printf("bProcFlagsSelect=<>\n");
+ printf("nTrafficClass=<>\n");
+ printf("nFlowIDMsb=<>\n");
+ printf("bMpe1Flag=<>\n");
+ printf("bMpe2Flag=<>\n");
+ printf("bEncFlag=<>\n");
+ printf("bDecFlag=<>\n");
+ printf("nRxDmaChanId=<>\n");
+ printf("bRemL2Hdr=<>\n");
+ printf("numBytesRem=<>\n");
+ printf("bFcsEna=<>\n");
+ printf("bPmacEna=<>\n");
+ printf("nResDW1=<>\n");
+ printf("nRes1DW0=<>\n");
+ printf("nRes2DW0=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_EG_CfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-EG-CfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PMAC-EG-CfgGet\n");
+ printf("nPmacId=<>\n");
+ printf("nDestPortId=<>\n");
+ printf("bProcFlagsSelect=<>\n");
+ printf("nTrafficClass=<>\n");
+ printf("nFlowIDMsb=<>\n");
+ printf("bMpe1Flag=<>\n");
+ printf("bMpe2Flag=<>\n");
+ printf("bEncFlag=<>\n");
+ printf("bDecFlag=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_EG_CfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-IG-CfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PMAC-IG-CfgGet\n");
+ printf("nPmacId=<>\n");
+ printf("nTxDmaChanId=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_IG_CfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-IG-CfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PMAC-IG-CfgSet\n");
+ printf("nPmacId=<>\n");
+ printf("nTxDmaChanId=<>\n");
+ printf("bErrPktsDisc=<>\n");
+ printf("bPmapDefault=<>\n");
+ printf("bPmapEna=<>\n");
+ printf("bClassDefault=<>\n");
+ printf("bClassEna=<>\n");
+ printf("eSubId=<>\n");
+ printf("bSpIdDefault=<>\n");
+ printf("bPmacPresent=<>\n");
+ printf("defPmacHdr=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_IG_CfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleRead") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PceRuleRead\n");
+ printf("pattern.nIndex=<>\n");
+ printf("nLogicalPortId=<>\n");
+ printf("nSubIfIdGroup=<>\n");
+ printf("region=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PceRuleRead(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleWrite") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-PceRuleWrite nLogicalPortId=<> pattern.nIndex=<>\n");
+ printf("nLogicalPortId=<>\n");
+ printf("nSubIfIdGroup=<>\n");
+ printf("region=<>\n");
+ printf("pattern.nIndex=<>\n");
+ printf("pattern.bEnable=<>\n");
+ printf("pattern.bPortIdEnable=<>\n");
+ printf("pattern.nPortId=<>\n");
+ printf("pattern.bPortId_Exclude=<>\n");
+ printf("pattern.bSubIfIdEnable=<>\n");
+ printf("pattern.nSubIfId=<>\n");
+ printf("pattern.eSubIfIdType=<>\n");
+ printf("pattern.bSubIfId_Exclude=<>\n");
+ printf("pattern.bInsertionFlag_Enable=<>\n");
+ printf("pattern.nInsertionFlag=<>\n");
+ printf("pattern.bDSCP_Enable=<>\n");
+ printf("pattern.nDSCP=<>\n");
+ printf("pattern.bDSCP_Exclude=<>\n");
+ printf("pattern.bInner_DSCP_Enable=<>\n");
+ printf("pattern.nInnerDSCP=<>\n");
+ printf("pattern.bInnerDSCP_Exclude=<>\n");
+ printf("pattern.bPCP_Enable=<>\n");
+ printf("pattern.nPCP=<>\n");
+ printf("pattern.bCTAG_PCP_DEI_Exclude=<>\n");
+ printf("pattern.bSTAG_PCP_DEI_Enable=<>\n");
+ printf("pattern.nSTAG_PCP_DEI=<>\n");
+ printf("pattern.bSTAG_PCP_DEI_Exclude=<>\n");
+ printf("pattern.bPktLngEnable=<>\n");
+ printf("pattern.nPktLng=<>\n");
+ printf("pattern.nPktLngRange=<>\n");
+ printf("pattern.bPktLng_Exclude=<>\n");
+ printf("pattern.bMAC_DstEnable=<>\n");
+ printf("pattern.nMAC_Dst=<>\n");
+ printf("pattern.nMAC_DstMask=<>\n");
+ printf("pattern.bDstMAC_Exclude=<>\n");
+ printf("pattern.bMAC_SrcEnable=<>\n");
+ printf("pattern.nMAC_Src=<>\n");
+ printf("pattern.nMAC_SrcMask=<>\n");
+ printf("pattern.bSrcMAC_Exclude=<>\n");
+ printf("pattern.bAppDataMSB_Enable=<>\n");
+ printf("pattern.nAppDataMSB=<>\n");
+ printf("pattern.bAppMaskRangeMSB_Select=<>\n");
+ printf("pattern.nAppMaskRangeMSB=<>\n");
+ printf("pattern.bAppMSB_Exclude=<>\n");
+ printf("pattern.bAppDataLSB_Enable=<>\n");
+ printf("pattern.nAppDataLSB=<>\n");
+ printf("pattern.bAppMaskRangeLSB_Select=<>\n");
+ printf("pattern.nAppMaskRangeLSB=<>\n");
+ printf("pattern.bAppLSB_Exclude=<>\n");
+ printf("pattern.eDstIP_Select=<>\n");
+ printf("pattern.nDstIP=<>\n");
+ printf("pattern.nDstIP=<>\n");
+ printf("pattern.nDstIP_Mask=<>\n");
+ printf("pattern.bDstIP_Exclude=<>\n");
+ printf("pattern.eInnerDstIP_Select=<>\n");
+ printf("pattern.nInnerDstIP=<>\n");
+ printf("pattern.nInnerDstIP=<>\n");
+ printf("pattern.nInnerDstIP_Mask=<>\n");
+ printf("pattern.bInnerDstIP_Exclude=<>\n");
+ printf("pattern.eSrcIP_Select=<>\n");
+ printf("pattern.nSrcIP=<>\n");
+ printf("pattern.nSrcIP=<>\n");
+ printf("pattern.nSrcIP_Mask=<>\n");
+ printf("pattern.bSrcIP_Exclude=<>\n");
+ printf("pattern.eInnerSrcIP_Select=<>\n");
+ printf("pattern.nInnerSrcIP=<>\n");
+ printf("pattern.nInnerSrcIP=<>\n");
+ printf("pattern.nInnerSrcIP_Mask=<>\n");
+ printf("pattern.bInnerSrcIP_Exclude=<>\n");
+ printf("pattern.bEtherTypeEnable=<>\n");
+ printf("pattern.nEtherType=<>\n");
+ printf("pattern.nEtherTypeMask=<>\n");
+ printf("pattern.bEtherType_Exclude=<>\n");
+ printf("pattern.bProtocolEnable=<>\n");
+ printf("pattern.nProtocol=<>\n");
+ printf("pattern.nProtocolMask=<>\n");
+ printf("pattern.bProtocol_Exclude=<>\n");
+ printf("pattern.bInnerProtocolEnable=<>\n");
+ printf("pattern.nInnerProtocol=<>\n");
+ printf("pattern.nInnerProtocolMask=<>\n");
+ printf("pattern.bInnerProtocol_Exclude=<>\n");
+ printf("pattern.bSessionIdEnable=<>\n");
+ printf("pattern.nSessionId=<>\n");
+ printf("pattern.bSessionId_Exclude=<>\n");
+ printf("pattern.bPPP_ProtocolEnable=<>\n");
+ printf("pattern.nPPP_Protocol=<>\n");
+ printf("pattern.nPPP_ProtocolMask=<>\n");
+ printf("pattern.bPPP_Protocol_Exclude=<>\n");
+ printf("pattern.bVid=<>\n");
+ printf("pattern.nVid=<>\n");
+ printf("pattern.bVidRange_Select=<>\n");
+ printf("pattern.nVidRange=<>\n");
+ printf("pattern.bVid_Exclude=<>\n");
+ printf("pattern.bSLAN_Vid=<>\n");
+ printf("pattern.nSLAN_Vid=<>\n");
+ printf("pattern.bSLANVid_Exclude=<>\n");
+ printf("pattern.bPayload1_SrcEnable=<>\n");
+ printf("pattern.nPayload1=<>\n");
+ printf("pattern.bPayload1MaskRange_Select=<>\n");
+ printf("pattern.nPayload1_Mask=<>\n");
+ printf("pattern.bPayload1_Exclude=<>\n");
+ printf("pattern.bPayload2_SrcEnable=<>\n");
+ printf("pattern.nPayload2=<>\n");
+ printf("pattern.bPayload2MaskRange_Select=<>\n");
+ printf("pattern.nPayload2_Mask=<>\n");
+ printf("pattern.bPayload2_Exclude=<>\n");
+ printf("pattern.bParserFlagLSB_Enable=<>\n");
+ printf("pattern.nParserFlagLSB=<>\n");
+ printf("pattern.nParserFlagLSB_Mask=<>\n");
+ printf("pattern.bParserFlagLSB_Exclude=<>\n");
+ printf("pattern.bParserFlagMSB_Enable=<>\n");
+ printf("pattern.nParserFlagMSB=<>\n");
+ printf("pattern.nParserFlagMSB_Mask=<>\n");
+ printf("pattern.bParserFlagMSB_Exclude=<>\n");
+ printf("pattern.bParserFlag1LSB_Enable=<>\n");
+ printf("pattern.nParserFlag1LSB=<>\n");
+ printf("pattern.nParserFlag1LSB_Mask=<>\n");
+ printf("pattern.bParserFlag1LSB_Exclude=<>\n");
+ printf("pattern.bParserFlag1MSB_Enable=<>\n");
+ printf("pattern.nParserFlag1MSB=<>\n");
+ printf("pattern.nParserFlag1MSB_Mask=<>\n");
+ printf("pattern.bParserFlag1MSB_Exclude=<>\n");
+ printf("pattern.bVid_Original=<>\n");
+ printf("pattern.nOuterVidRange=<>\n");
+ printf("pattern.bSVidRange_Select=<>\n");
+ printf("pattern.bOuterVid_Original=<>\n");
+ printf("action.eTrafficClassAction=<>\n");
+ printf("action.nTrafficClassAlternate=<>\n");
+ printf("action.eSnoopingTypeAction=<>\n");
+ printf("action.eLearningAction=<>\n");
+ printf("action.eIrqAction=<>\n");
+ printf("action.eCrossStateAction=<>\n");
+ printf("action.eCritFrameAction=<>\n");
+ printf("action.eTimestampAction=<>\n");
+ printf("action.ePortMapAction=<>\n");
+ printf("action.nForwardPortMap=<>\n");
+ printf("action.nForwardPortMap[1~7]=<>\n");
+ printf("action.bRemarkAction=<>\n");
+ printf("action.bRemarkPCP=<>\n");
+ printf("action.bRemarkSTAG_PCP=<>\n");
+ printf("action.bRemarkSTAG_DEI=<>\n");
+ printf("action.bRemarkDSCP=<>\n");
+ printf("action.bRemarkClass=<>\n");
+ printf("action.eMeterAction=<>\n");
+ printf("action.nMeterId=<>\n");
+ printf("action.bRMON_Action=<>\n");
+ printf("action.nRMON_Id=<>\n");
+ printf("action.eVLAN_Action=<>\n");
+ printf("action.nVLAN_Id=<>\n");
+ printf("action.nFId=<>\n");
+ printf("action.bFidEnable=<>\n");
+ printf("action.eSVLAN_Action=<>\n");
+ printf("action.nSVLAN_Id=<>\n");
+ printf("action.eVLAN_CrossAction=<>\n");
+ printf("action.bPortBitMapMuxControl=<>\n");
+ printf("action.bCVLAN_Ignore_Control=<>\n");
+ printf("action.bPortLinkSelection=<>\n");
+ printf("action.bPortTrunkAction=<>\n");
+ printf("action.bFlowID_Action=<>\n");
+ printf("action.nFlowID=<>\n");
+ printf("action.bRoutExtId_Action=<>\n");
+ printf("action.nRoutExtId=<>\n");
+ printf("action.bRtDstPortMaskCmp_Action=<>\n");
+ printf("action.bRtSrcPortMaskCmp_Action=<>\n");
+ printf("action.bRtDstIpMaskCmp_Action=<>\n");
+ printf("action.bRtSrcIpMaskCmp_Action=<>\n");
+ printf("action.bRtInnerIPasKey_Action=<>\n");
+ printf("action.bRtAccelEna_Action=<>\n");
+ printf("action.bRtCtrlEna_Action=<>\n");
+ printf("action.eProcessPath_Action=<>\n");
+ printf("action.ePortFilterType_Action=<>\n");
+ printf("action.bOamEnable=<>\n");
+ printf("action.nRecordId=<>\n");
+ printf("action.bExtractEnable=<>\n");
+ printf("action.eColorFrameAction=<>\n");
+ printf("action.bExtendedVlanEnable=<>\n");
+ printf("action.nExtendedVlanBlockId=<>\n");
+ printf("pattern.bFlexibleField4Enable=<>\n");
+ printf("pattern.bFlexibleField4_ExcludeEnable=<>\n");
+ printf("pattern.bFlexibleField4_RangeEnable=<>\n");
+ printf("pattern.nFlexibleField4_ParserIndex=<>\n");
+ printf("pattern.nFlexibleField4_Value=<>\n");
+ printf("pattern.nFlexibleField4_MaskOrRange=<>\n");
+ printf("pattern.bFlexibleField3Enable=<>\n");
+ printf("pattern.bFlexibleField3_ExcludeEnable=<>\n");
+ printf("pattern.bFlexibleField3_RangeEnable=<>\n");
+ printf("pattern.nFlexibleField3_ParserIndex=<>\n");
+ printf("pattern.nFlexibleField3_Value=<>\n");
+ printf("pattern.nFlexibleField3_MaskOrRange=<>\n");
+ printf("pattern.bFlexibleField2Enable=<>\n");
+ printf("pattern.bFlexibleField2_ExcludeEnable=<>\n");
+ printf("pattern.bFlexibleField2_RangeEnable=<>\n");
+ printf("pattern.nFlexibleField2_ParserIndex=<>\n");
+ printf("pattern.nFlexibleField2_Value=<>\n");
+ printf("pattern.nFlexibleField2_MaskOrRange=<>\n");
+ printf("pattern.bFlexibleField1Enable=<>\n");
+ printf("pattern.bFlexibleField1_ExcludeEnable=<>\n");
+ printf("pattern.bFlexibleField1_RangeEnable=<>\n");
+ printf("pattern.nFlexibleField1_ParserIndex=<>\n");
+ printf("pattern.nFlexibleField1_Value=<>\n");
+ printf("pattern.nFlexibleField1_MaskOrRange=<>\n");
+ printf("action.bPBB_Action_Enable=<>\n");
+ printf("action.sPBB_Action.bIheaderActionEnable=<>\n");
+ printf("action.sPBB_Action.eIheaderOpMode=<>\n");
+ printf("action.sPBB_Action.bTunnelIdKnownTrafficEnable=<>\n");
+ printf("action.sPBB_Action.nTunnelIdKnownTraffic=<>\n");
+ printf("action.sPBB_Action.bTunnelIdUnKnownTrafficEnable=<>\n");
+ printf("action.sPBB_Action.nTunnelIdUnKnownTraffic=<>\n");
+ printf("action.sPBB_Action.bB_DstMac_FromMacTableEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_B_SrcMacEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_B_DstMacEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_I_TAG_ResEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_I_TAG_UacEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_I_TAG_DeiEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_I_TAG_PcpEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_I_TAG_SidEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_I_TAG_TpidEnable=<>\n");
+ printf("action.sPBB_Action.bBtagActionEnable=<>\n");
+ printf("action.sPBB_Action.eBtagOpMode=<>\n");
+ printf("action.sPBB_Action.bProcessIdKnownTrafficEnable=<>\n");
+ printf("action.sPBB_Action.nProcessIdKnownTraffic=<>\n");
+ printf("action.sPBB_Action.bProcessIdUnKnownTrafficEnable=<>\n");
+ printf("action.sPBB_Action.nProcessIdUnKnownTraffic=<>\n");
+ printf("action.sPBB_Action.bReplace_B_TAG_DeiEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_B_TAG_PcpEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_B_TAG_VidEnable=<>\n");
+ printf("action.sPBB_Action.bReplace_B_TAG_TpidEnable=<>\n");
+ printf("action.sPBB_Action.bMacTableMacinMacActionEnable=<>\n");
+ printf("action.sPBB_Action.eMacTableMacinMacSelect=<>\n");
+ printf("action.bDestSubIf_Action_Enable=<>\n");
+ printf("action.sDestSubIF_Action.bDestSubIFIDActionEnable=<>\n");
+ printf("action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable=<>\n");
+ printf("action.sDestSubIF_Action.nDestSubIFGrp_Field=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PceRuleWrite(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleDelete") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-PceRuleDelete\n");
+ printf("nLogicalPortId=<>\n");
+ printf("nSubIfIdGroup=<>\n");
+ printf("region=<>\n");
+ printf("pattern.nIndex=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PceRuleDelete(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleAlloc") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PceRuleAlloc\n");
+ printf("num_of_rules=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PceRuleAlloc(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleFree") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PceRuleFree\n");
+ printf("blockid=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PceRuleFree(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleEnable") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PceRuleEnable\n");
+ printf("nLogicalPortId=<>\n");
+ printf("nSubIfIdGroup=<>\n");
+ printf("region=<>\n");
+ printf("pattern.nIndex=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PceRuleEnable(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleDisable") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PceRuleDisable\n");
+ printf("nLogicalPortId=<>\n");
+ printf("nSubIfIdGroup=<>\n");
+ printf("region=<>\n");
+ printf("pattern.nIndex=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PceRuleDisable(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-MulticastRouterPortAdd") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MulticastRouterPortAdd\n");
+ printf("nPortId=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MulticastRouterPortAdd(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MulticastRouterPortRemove") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MulticastRouterPortRemove\n");
+ printf("nPortId=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MulticastRouterPortRemove(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MulticastSnoopCfgGet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MulticastSnoopCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MulticastSnoopCfgSet") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MulticastSnoopCfgSet\n");
+ printf("eIGMP_Mode=<>\n");
+ printf("bCrossVLAN=<>\n");
+ printf("eForwardPort=<>\n");
+ printf("nForwardPortId=<>\n");
+ printf("nClassOfService=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MulticastSnoopCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MulticastRouterPortRead") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MulticastRouterPortRead(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-MulticastTableEntryAdd") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MulticastTableEntryRemove\n");
+ printf("nPortId=<> : Bridge Port ID\n");
+ printf("nSubIfId=<> : Sub-Interface Id\n");
+ printf("eIPVersion=<> : Selection to use IPv4 or IPv6.\n");
+ printf("uIP_Gda=<> : Group Destination IP address (GDA).\n");
+ printf("uIP_Gsa=<> : Group Source IP address.\n");
+ printf("nFID=<> : Filtering Identifier (FID)\n");
+ printf("bExclSrcIP=<> : Includes or Excludes Source IP.\n");
+ printf("eModeMember=<> : Group member filter mode.\n");
+ printf("nTci=<> : TCI for (GSWIP-3.2) B-Step\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MulticastTableEntryAdd(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MulticastTableEntryRead") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MulticastTableEntryRead(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-MulticastTableEntryRemove") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-MulticastTableEntryRemove\n");
+ printf("nPortId=<> : Bridge Port ID\n");
+ printf("nSubIfId=<> : Sub-Interface Id\n");
+ printf("eIPVersion=<> : Selection to use IPv4 or IPv6.\n");
+ printf("uIP_Gda=<> : Group Destination IP address (GDA).\n");
+ printf("uIP_Gsa=<> : Group Source IP address.\n");
+ printf("nFID=<> : Filtering Identifier (FID)\n");
+ printf("bExclSrcIP=<> : Includes or Excludes Source IP.\n");
+ printf("eModeMember=<> : Group member filter mode.\n");
+ printf("nTci=<> : TCI for (GSWIP-3.2) B-Step\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_MulticastTableEntryRemove(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-FW-Update") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_FW_Update(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-FW-Version") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_FW_Version(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PVT-Meas") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PVT_Meas(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Delay") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-Delay\n");
+ printf("nMsec=<> : Delay Time in milliseconds\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Delay(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-GPIO-Configure") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-GPIO-Configure\n");
+ printf("nEnableMaskIndex0=<> : GPIO Enable Mask Index 0\n");
+ printf("nEnableMaskIndex1=<> : GPIO Enable Mask Index 1\n");
+ printf("nEnableMaskIndex2=<> : GPIO Enable Mask Index 2\n");
+ printf("nAltSel0Index0=<> : GPIO Alt Select 0 Index 0\n");
+ printf("nAltSel0Index1=<> : GPIO Alt Select 0 Index 1\n");
+ printf("nAltSel0Index2=<> : GPIO Alt Select 0 Index 2\n");
+ printf("nAltSel1Index0=<> : GPIO Alt Select 1 Index 0\n");
+ printf("nAltSel1Index1=<> : GPIO Alt Select 1 Index 1\n");
+ printf("nAltSel1Index2=<> : GPIO Alt Select 1 Index 2\n");
+ printf("nDirIndex0=<> : GPIO Direction Index 0\n");
+ printf("nDirIndex1=<> : GPIO Direction Index 1\n");
+ printf("nDirIndex2=<> : GPIO Direction Index 2\n");
+ printf("nOutValueIndex0=<> : GPIO Out Value Index 0\n");
+ printf("nOutValueIndex1=<> : GPIO Out Value Index 1\n");
+ printf("nOutValueIndex2=<> : GPIO Out Value Index 2\n");
+ printf("nTimeoutValue=<> : GPIO Timeout in milliseconds\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_GPIO_Configure(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Reboot") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Reboot(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-SysReg-Rd") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-SysReg-Rd addr=<addr>\n");
+ printf("addr=<> : 32-bit register address\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_SysReg_Rd(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-SysReg-Wr") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-SysReg-Wr addr=<addr> val=<val>\n");
+ printf("addr=<> : 32-bit register address\n");
+ printf("val=<> : register value\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_SysReg_Wr(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-SysReg-Mod") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-SysReg-Mod addr=<addr> val=<val> mask=<mask>\n");
+ printf("addr=<> : 32-bit register address\n");
+ printf("val=<> : register value\n");
+ printf("mask=<> : register value mask\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_SysReg_Mod(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Cml-Clk-Get") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-Cml-Clk-Get nClk=<>\n");
+ printf("nClk=<> : CML Clock Output (0 or 1)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Cml_Clk_Get(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Cml-Clk-Set") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-Cml-Clk-Set nClk=<>\n");
+ printf("nClk=<> : CML Clock Output (0 or 1)\n");
+ printf("bEn=<> : Enable or disable CML Clock Output\n");
+ printf("nEnable=<> : Enable CML Clock Output\n");
+ printf("bSrcSel=<> : Change clock source selection\n");
+ printf("nSrcSel=<> : Clock source {Value0 - 50MHz, 1 - 156.25MHz, 2 - 25MHz}\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Cml_Clk_Set(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Sfp-Get") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-Sfp-Get nPortId=<> nOption=<>\n");
+ printf("nPortId=<> : Port id (0 or 1)\n");
+ printf("nOption=<> : Option id (0 - SFP mode/speed/link-status, 1 - flow control)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Sfp_Get(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Sfp-Set") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-Sfp-Set nPortId=<> nOption=<>\n");
+ printf("nPortId=<> : Port id (0 or 1)\n");
+ printf("nOption=<> : Option id (0 - SFP mode/speed/link-status, 1 - flow control)\n");
+ printf("nMode=<> : SFP mode {Value0 - auto, 1 - fix, 2 - disable}\n");
+ printf("nSpeed=<> : Select speed when mode is 1\n");
+ printf(" {Value0 - 10G Quad USXGMII, 1 - 1000BaseX ANeg, 2 - 10G XFI,\n");
+ printf(" 3 - 10G Single USXGMII, 4 - 2.5G SGMII, 5 - 2500 Single USXGMI,\n");
+ printf(" 6 - 2500BaseX NonANeg, 7 - 1000BaseX NonANeg, 8 - 1G SGMI}\n");
+ printf("bFlowCtrlEn=<> : flow control {Value0 - disable, 1 - enable}\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Sfp_Set(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-VlanCounterMapSet") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-VlanCounterMapSet\n");
+ printf("nCounterIndex=<>\n");
+ printf("nCtpPortId=<>\n");
+ printf("bPriorityEnable=<>\n");
+ printf("nPriorityVal=<>\n");
+ printf("bVidEnable=<>\n");
+ printf("nVidVal=<>\n");
+ printf("bVlanTagSelectionEnable=<>\n");
+ printf("eVlanCounterMappingType=<>\n");
+ printf("eVlanCounterMappingFilterType=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_VlanCounterMapSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-VlanCounterMapGet") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-VlanCounterMapGet\n");
+ printf("nCounterIndex=<>\n");
+ printf("eVlanCounterMappingType=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_VlanCounterMapGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Vlan-RMON-Get") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-Vlan-RMON-Get\n");
+ printf("nVlanCounterIndex=<>\n");
+ printf("eVlanRmonType=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Vlan_RMON_Get(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Vlan-RMON-Clear") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-Vlan-RMON-Clear\n");
+ printf("nVlanCounterIndex=<>\n");
+ printf("eVlanRmonType=<>\n");
+ printf("eClearAll=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Vlan_RMON_Clear(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Vlan-RMONControl-Set") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-Vlan-RMONControl-Set\n");
+ printf("bVlanRmonEnable=<>\n");
+ printf("bIncludeBroadCastPktCounting=<>\n");
+ printf("nVlanLastEntry=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Vlan_RMONControl_Set(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Vlan-RMONControl-Get") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Vlan_RMONControl_Get(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-PBB-TunnelTempate-Config-Get") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PBB-TunnelTempate-Config-Get\n");
+ printf("nTunnelTemplateId:\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PBB_TunnelTempate_Config_Get(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PBB-TunnelTempate-Config-Set") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PBB-TunnelTempate-Config-Set\n");
+ printf("nTunnelTemplateId:\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PBB_TunnelTempate_Config_Set(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PBB-TunnelTempate-Alloc") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PBB_TunnelTempate_Alloc(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-PBB-TunnelTempate-Free") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PBB-TunnelTempate-Free\n");
+ printf("nTunnelTemplateId:\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PBB_TunnelTempate_Free(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-CPU-PortCfgGet") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-CPU-PortCfgGet\n");
+ printf("nPortId:\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CPU_PortCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-CPU-PortCfgSet") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-CPU-PortCfgSet\n");
+ printf("nPortId:\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_CPU_PortCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-RMON-PortGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RMON-PortGet\n");
+ printf("nPortId=<> : Ethernet Port number.\n");
+ printf("ePortType=<> : Port Type.\n");
+ printf("nSubIfIdGroup=<> : Sub interface ID group.\n");
+ printf("bPceBypass=<> : Separate set of CTP Tx counters when PCE is bypassed.\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RMON_PortGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-RMON-ModeSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RMON-ModeSet\n");
+ printf("eRmonType=<> : RMON Counters Type.\n");
+ printf("eCountMode=<> : RMON Counters Mode.\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RMON_ModeSet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-RMON-MeterGet") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RMON-MeterGet\n");
+ printf("nMeterId:\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RMON_MeterGet(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-RMON-FlowGet") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RMON-FlowGet\n");
+ printf("bIndexd=<>\n");
+ printf("nIndex=<>\n");
+ printf("nPortId=<>\n");
+ printf("nFlowId=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RMON_FlowGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-RMON-TFlowClear") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-RMON-TFlowClear\n");
+ printf("bIndexd=<>\n");
+ printf("nIndex=<>\n");
+ printf("nPortId=<>\n");
+ printf("nFlowId=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_RMON_TFlowClear(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgePortAlloc") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgePortAlloc(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgePortFree") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-BridgePortFree\n");
+ printf("nBridgePortId:<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgePortFree(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-UnFreeze") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_UnFreeze(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Freeze") == 0)
+ {
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Freeze(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-MeterFree") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-MeterFree nMeterId=<>\n");
+ printf("nMeterId: Meter index (zero-based counting)\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_MeterFree(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-MeterAlloc") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_MeterAlloc(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-PMAC-RMON-Get") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PMAC-RMON-Get\n");
+ printf("nPmacId=<>\n");
+ printf("nPortId=<>\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PMAC_RMON_Get(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Debug-PMAC-RMON-Get-All") == 0)
+ {
+
+ char *slib = "";
+ uint16_t phy = 0;
+ GSW_Device_t *gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-Debug-PMAC-RMON-Get-All\n");
+ printf("nPmacId=<>\n");
+ printf("Start=<>\n");
+ printf("End=<>\n");
+
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Debug_PMAC_RMON_Get_All(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-Debug-RMON-Port-GetAll") == 0)
+ {
+ char* slib ="";
+ uint16_t phy = 0;
+ GSW_Device_t* gsw_dev;
+ uint16_t myval;
+
+ if (pArgs->prmc < 1)
+ {
+ printf ("Usage: fapi-GSW-Debug-RMON-Port-GetAll ePortType=<> Start=<> End=<>\n");
+ printf ("ePortType: Port Type\n");
+ printf ("Start: Start Port\n");
+ printf ("End: End Port\n");
+ goto goto_end_help;
+ }
+ slib = slif_lib;
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_DEBUG_RMON_Port_Get_All(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-SS-Sptag-Get") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-SS-Sptag-Get pid=<>\n");
+ printf("pid=<> : Port ID\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_SS_Sptag_Get(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-SS-Sptag-Set") == 0)
+ {
+ char *slib = "";
+ uint16_t reg = 0;
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-SS-Sptag-Set pid=<> mask=<>\n");
+ printf("pid=<> : Port ID\n");
+ printf("mask=<> : bit 0=rx, bit 1=tx, bit 2=rx_pen, bit 3=tx_pen\n");
+ printf("rx=<> : RX special tag mode\n");
+ printf("tx=<> : TX special tag mode\n");
+ printf("rx_pen=<> : RX special tag info over preamble\n");
+ printf("tx_pen=<> : TX special tag info over preamble\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_SS_Sptag_Set(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-DSCP-DropPrecedenceCfgGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc > 0)
+ {
+ printf("Usage: fapi-GSW-QoS-DSCP-DropPrecedenceCfgGet\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_DSCP_DropPrecedenceCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-DSCP-DropPrecedenceCfgSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+
+ if (pArgs->prmc < 2)
+ {
+ printf("Usage: fapi-GSW-QoS-DSCP-DropPrecedenceCfgSet nIndex=n nVal=x (0~63) \n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_DSCP_DropPrecedenceCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ColorMarkingTableGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-ColorMarkingTableGet eMode=n (0~7)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ColorMarkingTableGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ColorMarkingTableSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-ColorMarkingTableSet eMode=n (3~7) nIndex=m (0~15/63) nPriority=x (0~7) nColor=y (0~3)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ColorMarkingTableSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ColorReMarkingTableGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-ColorReMarkingTableGet eMode=n (3~7)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ColorReMarkingTableGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-ColorReMarkingTableSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 3)
+ {
+ printf("Cmd Format: GSW_QOS_COLOR_REMARKING_TBL_SET eMode=n (3~6) nIndex=m (0~15) dei=0/1 pcp=x (0~7)\n");
+ printf("\tor: GSW_QOS_COLOR_REMARKING_TBL_SET eMode=7 nIndex=m (0~15) dscp=x\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_ColorReMarkingTableSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-DSCP2-PCPTableGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-DSCP2-PCPTableGet nIndex=n (0~7)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_DSCP2_PCPTableGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-DSCP2-PCPTableSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 3)
+ {
+ printf("Usage: fapi-GSW-QoS-DSCP2-PCPTableSet nIndex=n (0~7) nDscpIndex=m (0~63) nVal=x)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_DSCP2_PCPTableSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-PortReMarkingCfgGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-PortReMarkingCfgGet nPortId=n (0~15)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_PortReMarkingCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-PortReMarkingCfgSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 4)
+ {
+ printf("Usage: fapi-GSW-QoS-PortReMarkingCfgSet nPortId=n bDscpIngrEn=0/1 bDscpEgrEn=0/1 bPcpIngrEn=0/1\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_PortReMarkingCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-StormCfgGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc > 0)
+ {
+ printf("Usage!: fapi-GSW-QoS-StormCfgGet\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_StormCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-StormCfgSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-QoS-StormCfgSet bEn=0/1 \n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_StormCfgSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-StormCfgGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc > 0)
+ {
+ printf("Usage!: fapi-GSW-QoS-StormCfgGet\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_StormCfgGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-PmapperTableGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage!: fapi-GSW-QoS-PmapperTableGet nPmapperId=n (0~31)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_PmapperTableGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-QoS-PmapperTableSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 3)
+ {
+ printf("Usage!: fapi-GSW-QoS-PmapperTableset nPmapperId=n (0~31) nEntryIndex=m (0~72) nVal=x\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_QoS_PmapperTableSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleBlockSize") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage: fapi-GSW-PceRuleBlockSize blockid=0\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Pce_RuleBlockSize(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-BridgePortLoopRead") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage!: fapi-GSW-BridgePortLoopRead nBridgePortId=x\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_BridgePort_LoopRead(pArgs->prmc, pArgs->prmvs);
+ }
+ else if (strcmp(pArgs->name, "fapi-GSW-TflowCountModeGet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage!: fapi-GSW-TflowCountModeGet eCntType=(0~3)\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_TflowCountModeGet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-TflowCountModeSet") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 5)
+ {
+ printf("Usage!: fapi-GSW-TflowCountModeSet eCntType=(0~3) eCntMode=(0~3) nBrpLsb=x nCtpLsb=y nPortMsb=z\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_TflowCountModeSet(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-Mac-TableLoopDetect") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 1)
+ {
+ printf("Usage!: fapi-GSW-Mac-TableLoopDetect bp_map_in[0~3]=x\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_Mac_TableLoopDetect(pArgs->prmc, pArgs->prmvs);
+ }
+
+ else if (strcmp(pArgs->name, "fapi-GSW-PceRuleMove") == 0)
+ {
+ char *slib = "";
+ GSW_Device_t *gsw_dev;
+
+ if (pArgs->prmc < 4)
+ {
+ printf("Usage: fapi-GSW-PceRuleMove\n");
+ printf("cur.nLogicalPortId=x1 cur.pattern.nIndex=y1 cur.nSubIfIdGroup=z1 cur.region=s1\n");
+ printf("new.nLogicalPortId=x2 new.pattern.nIndex=y2 new.nSubIfIdGroup=z2 new.region=s2\n");
+ goto goto_end_help;
+ }
+
+ slib = slif_lib;
+
+ api_gsw_get_links(slib);
+ ret = fapi_GSW_PCE_RuleMove(pArgs->prmc, pArgs->prmvs);
+ }
+
+ /***************
+ * No command *
+ ***************/
+ else
+ {
+ api_executed = OS_FALSE;
+ }
+
+goto_end_help:
+ *err = (int)ret;
+ return api_executed;
+}
+
+int cmds_fapi_symlink_set(void)
+{
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RegisterGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RegisterMod");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RegisterSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PortLinkCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PortLinkCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-Clear");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MonitorPortCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MonitorPortCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PortCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PortCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-DSCP-ClassGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-DSCP-ClassSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PCP-ClassGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PCP-ClassSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-SVLAN-PCP-ClassGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-SVLAN-PCP-ClassSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperQueueGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperQueueAssign");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ShaperQueueDeassign");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-SchedulerCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-SchedulerCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredQueueCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredQueueCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredPortCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-WredPortCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-TrunkingCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-TrunkingCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableClear");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableClear-Cond");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableEntryRemove");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableEntryQuery");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-FlowctrlCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-FlowctrlCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-FlowctrlPortCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-FlowctrlPortCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableEntryAdd");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-TableEntryRead");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-QueuePortSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-QueuePortGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-QueueCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-QueueCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortConfigGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortConfigSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CtpPortConfigGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CtpPortConfigSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-int-gphy-read");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-int-gphy-write");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-ext-mdio-read");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-ext-mdio-write");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-int-gphy-mod");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-ext-mdio-mod");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgeConfigGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgeConfigSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgeFree");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgeAlloc");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-ExtendedVlanGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-ExtendedVlanSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-ExtendedVlanFree");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-ExtendedVlanAlloc");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanFilterGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanFilterSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanFilterFree");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanFilterAlloc");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-STP-PortCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-STP-PortCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-STP-BPDU-RuleSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-STP-BPDU-RuleGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Debug-RMON-Port-Get");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-MeterCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-MeterCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-DefaultFilterGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MAC-DefaultFilterSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CTP-PortAssignmentGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CTP-PortAssignmentSet");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-GLBL-CfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-GLBL-CfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-BM-CfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-BM-CfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-EG-CfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-EG-CfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-IG-CfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-IG-CfgSet");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleDelete");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleRead");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleWrite");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleAlloc");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleFree");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleEnable");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleDisable");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastRouterPortAdd");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastRouterPortRemove");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastSnoopCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastSnoopCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastRouterPortRead");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastTableEntryAdd");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastTableEntryRead");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-MulticastTableEntryRemove");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-FW-Update");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-FW-Version");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PVT-Meas");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Delay");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-GPIO-Configure");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Reboot");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-SysReg-Rd");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-SysReg-Wr");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-SysReg-Mod");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Cml-Clk-Get");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Cml-Clk-Set");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Sfp-Get");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Sfp-Set");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanCounterMapSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-VlanCounterMapGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Vlan-RMON-Get");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Vlan-RMON-Clear");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Vlan-RMONControl-Set");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Vlan-RMONControl-Get");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PBB-TunnelTempate-Config-Set");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PBB-TunnelTempate-Config-Get");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PBB-TunnelTempate-Alloc");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PBB-TunnelTempate-Free");
+ system ("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Debug-RMON-Port-GetAll");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CPU-PortCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CPU-PortCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CPU-PortSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-CPU-PortGet");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-PortGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-ModeSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-MeterGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-FlowGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-RMON-TFlowClear");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortAlloc");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortFree");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Freeze");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-UnFreeze");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortLoopGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-MeterFree");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-MeterAlloc");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PMAC-RMON-Get");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Debug-PMAC-RMON-Get-All");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-SS-Sptag-Set");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-SS-Sptag-Get");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-DSCP-DropPrecedenceCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-DSCP-DropPrecedenceCfgSet");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ColorMarkingTableGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ColorMarkingTableSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ColorReMarkingTableGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-ColorReMarkingTableSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-DSCP2-PCPTableGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-DSCP2-PCPTableSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PortReMarkingCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PortReMarkingCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-StormCfgGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-StormCfgSet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PmapperTableGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-QoS-PmapperTableSet");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleBlockSize");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-BridgePortLoopRead");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-TflowCountModeGet");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-TflowCountModeSet");
+
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-Mac-TableLoopDetect");
+ system("ln -sf ./ethswbox /usr/sbin/fapi-GSW-PceRuleMove");
+
+ return OS_SUCCESS;
+}
+
+static void cmds_fapi_help(void)
+{
+ printf("+-----------------------------------------------------------------------+\n");
+ printf("| HELP ! |\n");
+ printf("| CMDS - gsw |\n");
+ printf("| |\n");
+ printf("+-----------------------------------------------------------------------+\n");
+ printf("| fapi_GSW_RegisterGet |\n");
+ printf("\n");
+}
diff --git a/feed/app/ethswbox/src/example/cli/cmds/cmds_fapi.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_fapi.h
similarity index 85%
rename from feed/app/ethswbox/src/example/cli/cmds/cmds_fapi.h
rename to feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_fapi.h
index fb450de..89d0726 100644
--- a/feed/app/ethswbox/src/example/cli/cmds/cmds_fapi.h
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/cmds/cmds_fapi.h
@@ -14,19 +14,19 @@
/**
\file cmds_fapi.h
-
+
*/
#ifdef __cplusplus
- extern "C" {
+ extern "C"
+{
#endif
-
+
/* ========================================================================== */
/* Function prototypes */
/* ========================================================================== */
-extern OS_boolean_t cmds_fapi (CmdArgs_t* pArgs, int *err);
-extern int cmds_fapi_symlink_set (void);
-
+extern OS_boolean_t cmds_fapi(CmdArgs_t *pArgs, int *err);
+extern int cmds_fapi_symlink_set(void);
#ifdef __cplusplus
}
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/ethswbox.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/ethswbox.c
new file mode 100644
index 0000000..7c5137f
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/ethswbox.c
@@ -0,0 +1,87 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+/**
+
+ \file ethswbox.c
+
+*/
+#include "os_types.h"
+#include "os_linux.h"
+
+#include "ethswbox_version.h"
+
+#include "cmds.h"
+
+int ethswbox_main(int argc, char *argv[])
+{
+ int ret = OS_ERROR;
+ int prmc;
+ char **prmv;
+
+ char *name = argv[0];
+
+ if (strchr(name, '/') != NULL)
+ do
+ {
+ /* move behind next / */
+ name = strchr(name, '/') + 1;
+
+ if (name == NULL)
+ return ret;
+ } while (strlen(name) > 0 && strchr(name, '/') != NULL);
+ if (name == NULL || strcmp(name, "ethswbox") == 0)
+ {
+ printf("Ethernet SW Toolbox version %s.0 ... Updating symbolic links!\n", ETHSWBOX_VERSION_STR);
+ ret |= cmds_symlink_set();
+
+ return (int)ret;
+ }
+
+ /* remove the name parameter from the parameter count */
+ prmc = argc;
+ prmc--;
+ prmv = &argv[1];
+ /*
+ name: command name
+ dev: device number
+ prmc: parameter counter without device number
+ prmv: parameters
+ */
+#if 1
+ {
+ int i;
+ printf("cmd: %s %d: ", name, prmc);
+ for (i = 0; i < prmc; i++)
+ {
+ printf("%s ", prmv[i]);
+ }
+ printf("\n");
+ }
+#endif
+
+ /* invoke CLI command parser */
+ if (cmds(name, prmc, prmv, &ret) == OS_TRUE)
+ {
+ goto end;
+ }
+
+end:
+
+ return ret;
+}
+
+int main(int argc, char *argv[])
+{
+ int ret = 0;
+ if (argv != NULL)
+ ret = ethswbox_main(argc, argv);
+ return ret;
+}
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/ethswbox.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/ethswbox.h
new file mode 100644
index 0000000..ad8fed1
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/cli/ethswbox.h
@@ -0,0 +1,30 @@
+#ifndef _ETHSWBOX_H
+#define _ETHSWBOX_H
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+/**
+
+ \file ethswbox.h
+
+*/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ int ethswbox_main(int argc, char *argv[]);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ETHSWBOX_H */
diff --git a/feed/app/ethswbox/src/example/ethswbox_version.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/ethswbox_version.h
similarity index 97%
rename from feed/app/ethswbox/src/example/ethswbox_version.h
rename to feed/app/ethswbox/src/example/ethswbox_sdk/src/ethswbox_version.h
index 53c9399..e9e0b69 100644
--- a/feed/app/ethswbox/src/example/ethswbox_version.h
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/ethswbox_version.h
@@ -15,7 +15,7 @@
/** ETHSWBOX version, major number */
#define ETHSWBOX_VER_MAJOR 1
/** ETHSWBOX version, minor number */
-#define ETHSWBOX_VER_MINOR 0
+#define ETHSWBOX_VER_MINOR 1
/** ETHSWBOX version, build number */
#define ETHSWBOX_VER_STEP 0
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi.c
new file mode 100644
index 0000000..be0b6c8
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi.c
@@ -0,0 +1,8195 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+#include <os_types.h>
+#include <os_linux.h>
+#include <gsw_device.h>
+#include <gsw_api.h>
+#include <host_adapt.h>
+#include <gsw_cli_common.h>
+#include <gsw_ss.h>
+#include <sys_misc.h>
+
+#include <sys/socket.h>
+#include <arpa/inet.h>
+
+//#include <gsw_priv.h>
+#define lif_id 0
+#define NUM_TC 16
+#define MAX_NUM_OF_DISPLAY_PORTS 2
+
+// #############################################
+static int multicastParamRead(int argc, char *argv[], GSW_multicastTable_t *param)
+{
+ int ipParamCnt1 = 0;
+ int ipParamCnt2 = 0;
+
+ memset(param, 0, sizeof(GSW_multicastTable_t));
+
+ scanParamArg(argc, argv, "nPortId", sizeof(param->nPortId), ¶m->nPortId);
+ scanParamArg(argc, argv, "nSubIfId", sizeof(param->nSubIfId), ¶m->nSubIfId);
+ scanParamArg(argc, argv, "eIPVersion", sizeof(param->eIPVersion), ¶m->eIPVersion);
+ scanParamArg(argc, argv, "eModeMember", sizeof(param->eModeMember), ¶m->eModeMember);
+ scanParamArg(argc, argv, "nFID", sizeof(param->nFID), ¶m->nFID);
+ scanParamArg(argc, argv, "bExclSrcIP", sizeof(param->bExclSrcIP), ¶m->bExclSrcIP);
+
+ if (param->eIPVersion == GSW_IP_SELECT_IPV4)
+ {
+ ipParamCnt1 = scanIPv4_Arg(argc, argv, "uIP_Gda", ¶m->uIP_Gda.nIPv4);
+ ipParamCnt2 = scanIPv4_Arg(argc, argv, "uIP_Gsa", ¶m->uIP_Gsa.nIPv4);
+ }
+ else
+ {
+ ipParamCnt1 = scanIPv6_Arg(argc, argv, "uIP_Gda", param->uIP_Gda.nIPv6);
+ ipParamCnt2 = scanIPv6_Arg(argc, argv, "uIP_Gsa", param->uIP_Gsa.nIPv6);
+ }
+
+ scanParamArg(argc, argv, "nTci", sizeof(param->nTci), ¶m->nTci);
+
+ if ((param->eModeMember != GSW_IGMP_MEMBER_DONT_CARE) &&
+ (ipParamCnt1 == 0) && (ipParamCnt2 == 0))
+ return (-2);
+
+ if (ipParamCnt1 == 0)
+ return (-3);
+
+ return 0;
+}
+
+static void dump_multicast_table_entry(GSW_multicastTableRead_t *ptr)
+{
+ char sipaddr[64], dipaddr[64];
+
+ // #ifdef CONFIG_NETWORKING
+ if (ptr->eIPVersion == GSW_IP_SELECT_IPV4)
+ {
+ uint32_t dip = htonl(ptr->uIP_Gda.nIPv4);
+
+ inet_ntop(AF_INET, &dip, dipaddr, sizeof(dipaddr));
+ }
+ else
+ {
+ uint16_t dip[8], i;
+
+ for (i = 0; i < ARRAY_SIZE(dip); i++)
+ dip[i] = htons(ptr->uIP_Gda.nIPv6[i]);
+ inet_ntop(AF_INET6, dip, dipaddr, sizeof(dipaddr));
+ }
+ // #endif
+ printf(" %39s |", dipaddr);
+
+ if (ptr->eModeMember != GSW_IGMP_MEMBER_DONT_CARE)
+ {
+ // #ifdef CONFIG_NETWORKING
+ if (ptr->eIPVersion == GSW_IP_SELECT_IPV4)
+ {
+ uint32_t sip = htonl(ptr->uIP_Gsa.nIPv4);
+
+ inet_ntop(AF_INET, &sip, sipaddr, sizeof(sipaddr));
+ }
+ else
+ {
+ uint16_t sip[8], i;
+
+ for (i = 0; i < ARRAY_SIZE(sip); i++)
+ sip[i] = htons(ptr->uIP_Gsa.nIPv6[i]);
+ inet_ntop(AF_INET6, sip, sipaddr, sizeof(sipaddr));
+ }
+ // #endif
+
+ printf(" %39s |", sipaddr);
+ printf(" %11s |", (ptr->eModeMember == GSW_IGMP_MEMBER_INCLUDE) ? "INCLUDE" : "EXCLUDE");
+ }
+ else
+ {
+ printf(" %39s |", "");
+ printf(" %11s |", "DON'T CARE");
+ }
+
+ printf(" %9d |", ptr->hitstatus);
+
+ if (ptr->nTci)
+ {
+ printf(" Pri %d, CFI/Dei %d, ID %d",
+ ((ptr->nTci & 0xE000) >> 13),
+ ((ptr->nTci & 0x1000) >> 12),
+ (ptr->nTci & 0x0FFF));
+ }
+ printf("\n");
+}
+
+struct _tbl_dump_
+{
+ char *tbl_type;
+ char *tbl_name;
+ u32 entries;
+ u32 tbl_addr;
+};
+
+typedef struct
+{
+ u16 num_key;
+ u16 num_mask;
+ u16 num_val;
+} gsw_pce_tbl_t;
+
+struct _tbl_dump_ tbl_dump_gsw33[] = {
+ {"PCE", "Tflow Table", 512, 0x0F},
+ {"PCE", "Parser Microcode Table", 256, 0x00},
+ {"PCE", "VLANMAP Table", 1024, 0x02},
+ {"PCE", "PPPoE Table", 16, 0x03},
+ {"PCE", "Protocol Table", 32, 0x04},
+ {"PCE", "Flags Table", 64, 0x18},
+ {"PCE", "App Table", 64, 0x05},
+ {"PCE", "IP MSB Table", 64, 0x06},
+ {"PCE", "IP LSB Table", 64, 0x07},
+ {"PCE", "IP Pktlen Table", 16, 0x08},
+ {"PCE", "CTAG Pcp Table", 16, 0x09}, //
+ {"PCE", "Dscp Table", 64, 0x0A},
+ {"PCE", "Mac Br Table", 4096, 0x0B},
+ {"PCE", "Mult Sw Table", 1024, 0x0D}, //
+ {"PCE", "Mult Hw Table", 64, 0x0E},
+ {"PCE", "Qmap Table", 576, 0x11}, //
+ {"PCE", "IGCTP Table", 288, 0x12},
+ {"PCE", "EGCTP Table", 288, 0x13},
+ {"PCE", "IGBRG Table", 128, 0x14},
+ {"PCE", "EGBRG Table", 128, 0x15},
+ {"PCE", "Mac Da Table", 64, 0x16},
+ {"PCE", "Mac Sa Table", 64, 0x17},
+ {"PCE", "BRGCFG Table", 64, 0x19},
+ {"PCE", "Spcp Table", 16, 0x1A},
+ {"PCE", "COLMARK Table", 128, 0x1B},
+ {"PCE", "REMARK Table", 80, 0x1C},
+ {"PCE", "Payload Table", 64, 0x1D},
+ {"PCE", "Extended VLAN Table", 1024, 0x1E},
+ {"PCE", "P-Mapping Table", 292, 0x1F},
+ {"PCE", "Dscp2Pcp Table", 64, 0xC},
+ {"PCE", "PBB Tunnel Table", 256, 0x10},
+};
+
+static const gsw_pce_tbl_t gsw_pce_tbl_33[] = {
+ {0, 0, 4}, {2, 0, 0}, {1, 0, 1}, {1, 0, 0}, {1, 1, 0}, {1, 1, 0}, {4, 4, 0}, {4, 4, 0}, {1, 1, 0}, {0, 0, 1}, {0, 0, 1}, {5, 0, 10}, {0, 0, 2}, {20, 0, 10}, {2, 0, 5}, {34, 0, 31}, {0, 0, 11}, {0, 0, 1}, {0, 0, 9}, {0, 0, 7}, {0, 0, 27}, {0, 0, 14}, {3, 1, 0}, {3, 1, 0}, {1, 1, 0}, {0, 0, 10}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {1, 1, 0}, {4, 0, 6}, {0, 0, 1}};
+
+// #############################################################################################################
+
+GSW_return_t fapi_GSW_RegisterMod(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_register_mod_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nRegAddr", sizeof(param.nRegAddr), ¶m.nRegAddr);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nRegAddr\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nData", sizeof(param.nData), ¶m.nData);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nData\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nMask", sizeof(param.nMask), ¶m.nMask);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nMask\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RegisterMod(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RegisterMod failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_RegisterMod done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_RegisterGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_register_t Param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nRegAddr", sizeof(Param.nRegAddr), &Param.nRegAddr);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nRegAddr\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RegisterGet(gsw_dev, &Param);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RegisterGet failed with ret code", ret);
+ else
+ printf("fapi_GSW_RegisterGet:\n\t reg=0x%x val=0x%x\n", Param.nRegAddr, Param.nData);
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_RegisterSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_register_t Param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nRegAddr", sizeof(Param.nRegAddr), &Param.nRegAddr);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nRegAddr\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nData", sizeof(Param.nData), &Param.nData);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nData\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RegisterSet(gsw_dev, &Param);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RegisterSet failed with ret code", ret);
+ else
+ printf("fapi_GSW_RegisterSet:\n\t reg=%x val=%x\n", Param.nRegAddr, Param.nData);
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PortLinkCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_portLinkCfg_t Param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(Param.nPortId), &Param.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PortLinkCfgGet(gsw_dev, &Param);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PortLinkCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PortLinkCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nPortId", Param.nPortId);
+ printf("\t%40s:\t%s\n", "bDuplexForce", Param.bDuplexForce ? "true" : "false");
+ printf("\t%40s:\t0x%x\n", "eDuplex", Param.eDuplex);
+ printf("\t%40s:\t%s\n", "bSpeedForce", Param.bSpeedForce ? "true" : "false");
+ printf("\t%40s:\t0x%x\n", "eSpeed", Param.eSpeed);
+ printf("\t%40s:\t%s\n", "bLinkForce", Param.bLinkForce ? "true" : "false");
+ printf("\t%40s:\t0x%x\n", "eLink", Param.eLink);
+ printf("\t%40s:\t0x%x\n", "eMII_Mode", Param.eMII_Mode);
+ printf("\t%40s:\t0x%x\n", "eMII_Type", Param.eMII_Type);
+ printf("\t%40s:\t0x%x\n", " eClkMode", Param.eClkMode);
+ printf("\t%40s:\t%s\n", "bLPI", Param.bLPI ? "true" : "false");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PortLinkCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_portLinkCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PortLinkCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_PortLinkCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "bDuplexForce", sizeof(param.bDuplexForce), ¶m.bDuplexForce);
+ scanParamArg(prmc, prmv, "eDuplex", sizeof(param.eDuplex), ¶m.eDuplex);
+ scanParamArg(prmc, prmv, "bSpeedForce", sizeof(param.bSpeedForce), ¶m.bSpeedForce);
+ scanParamArg(prmc, prmv, "eSpeed", sizeof(param.eSpeed), ¶m.eSpeed);
+ scanParamArg(prmc, prmv, "bLinkForce", sizeof(param.bLinkForce), ¶m.bLinkForce);
+ scanParamArg(prmc, prmv, "eLink", sizeof(param.eLink), ¶m.eLink);
+ scanParamArg(prmc, prmv, "eMII_Mode", sizeof(param.eMII_Mode), ¶m.eMII_Mode);
+ scanParamArg(prmc, prmv, "eMII_Type", sizeof(param.eMII_Type), ¶m.eMII_Type);
+ scanParamArg(prmc, prmv, "eClkMode", sizeof(param.eClkMode), ¶m.eClkMode);
+ scanParamArg(prmc, prmv, "bLPI", sizeof(param.bLPI), ¶m.bLPI);
+
+ ret = GSW_PortLinkCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PortLinkCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PortLinkCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_RMON_Clear(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_RMON_clear_t param = {0};
+
+ scanParamArg(prmc, prmv, "nRmonId", sizeof(param.nRmonId), ¶m.nRmonId);
+ scanParamArg(prmc, prmv, "eRmonType", sizeof(param.eRmonType), ¶m.eRmonType);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RMON_Clear(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_Clear failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_RMON_Clear done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MonitorPortCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_monitorPortCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_monitorPortCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MonitorPortCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MonitorPortCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MonitorPortCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MonitorPortCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_monitorPortCfg_t param;
+
+ memset(¶m, 0, sizeof(GSW_monitorPortCfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MonitorPortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MonitorPortCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MonitorPortCfgGet done\n");
+ printf("\t%40s:\t0x%x\n", "nPortId", param.nPortId);
+ printf("\t%40s:\t0x%x\n", "nSubIfId", param.nSubIfId);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_PortCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_portCfg_t Param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(Param.nPortId), &Param.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_PortCfgGet(gsw_dev, &Param);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_PortCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_PortCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nPortId", Param.nPortId);
+ printf("\t%40s:\t0x%x\n", "eClassMode", Param.eClassMode);
+ printf("\t%40s:\t0x%x\n", "nTrafficClass", Param.nTrafficClass);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_PortCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_portCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_PortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_PortCfgGet failed with ret code", ret);
+ return ret;
+ }
+ else
+ {
+ printf("fapi_GSW_QoS_PortCfgSet done\n");
+ }
+
+ scanParamArg(prmc, prmv, "eClassMode", sizeof(param.eClassMode), ¶m.eClassMode);
+ scanParamArg(prmc, prmv, "nTrafficClass", sizeof(param.nTrafficClass), ¶m.nTrafficClass);
+
+ ret = GSW_QoS_PortCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_PortCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_PortCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_DSCP_ClassGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_DSCP_ClassCfg_t param = {0};
+ int i;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_DSCP_ClassGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_DSCP_ClassGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_DSCP_ClassGet:\n");
+ for (i = 0; i < 64; i++)
+ printf("\tnTrafficClass[%d] = %d\n", i, param.nTrafficClass[i]);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_DSCP_ClassSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_DSCP_ClassCfg_t param = {0};
+ int rret;
+ unsigned char nTrafficClass;
+ unsigned int nDSCP;
+
+ rret = scanParamArg(prmc, prmv, "nTrafficClass", sizeof(nTrafficClass), &nTrafficClass);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nTrafficClass\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nDSCP", sizeof(nDSCP), &nDSCP);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nDSCP\n");
+ return OS_ERROR;
+ }
+
+ if (nDSCP >= 64)
+ {
+ printf("ERROR: Given \"nDSCP\" is out of range (63)\n");
+ return (-3);
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_DSCP_ClassGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_DSCP_ClassSet failed with ret code", ret);
+ return ret;
+ }
+ param.nTrafficClass[nDSCP] = nTrafficClass;
+
+ ret = GSW_QoS_DSCP_ClassSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_DSCP_ClassSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_DSCP_ClassSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_PCP_ClassGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_PCP_ClassCfg_t param = {0};
+ int i;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_PCP_ClassGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_PCP_ClassGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_PCP_ClassGet:\n");
+ for (i = 0; i < 16; i++)
+ printf("\tnTrafficClass[%d] = %d\n", i, (int)param.nTrafficClass[i]);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_PCP_ClassSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_PCP_ClassCfg_t param = {0};
+ int rret;
+ unsigned char nTrafficClass;
+ unsigned int nPCP;
+
+ rret = scanParamArg(prmc, prmv, "nTrafficClass", sizeof(nTrafficClass), &nTrafficClass);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nTrafficClass\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nPCP", sizeof(nPCP), &nPCP);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPCP\n");
+ return OS_ERROR;
+ }
+
+ if (nPCP >= 16)
+ {
+ printf("ERROR: Given \"nPCP\" is out of range (7)\n");
+ return (-3);
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_PCP_ClassGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_PCP_ClassGet failed with ret code", ret);
+ return ret;
+ }
+ param.nTrafficClass[nPCP] = nTrafficClass;
+
+ ret = GSW_QoS_PCP_ClassSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_PCP_ClassSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_PCP_ClassSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_SVLAN_PCP_ClassGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_SVLAN_PCP_ClassCfg_t PCP_ClassCfg = {0};
+ int i;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_SVLAN_PCP_ClassGet(gsw_dev, &PCP_ClassCfg);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_SVLAN_PCP_ClassGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_SVLAN_PCP_ClassGet:\n");
+ for (i = 0; i < 16; i++)
+ printf("\tnTrafficClass[%d] = %d\n", i, (int)PCP_ClassCfg.nTrafficClass[i]);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_SVLAN_PCP_ClassSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_SVLAN_PCP_ClassCfg_t PCP_ClassCfg = {0};
+ int rret;
+ unsigned char nTrafficClass;
+ unsigned int nPCP;
+
+ rret = scanParamArg(prmc, prmv, "nTrafficClass", sizeof(nTrafficClass), &nTrafficClass);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nTrafficClass\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nPCP", sizeof(nPCP), &nPCP);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPCP\n");
+ return OS_ERROR;
+ }
+
+ if (nPCP >= 16)
+ {
+ printf("ERROR: Given \"nPCP\" is out of range (7)\n");
+ return (-3);
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_SVLAN_PCP_ClassGet(gsw_dev, &PCP_ClassCfg);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_SVLAN_PCP_ClassGet failed with ret code", ret);
+ return ret;
+ }
+ PCP_ClassCfg.nTrafficClass[nPCP] = nTrafficClass;
+
+ ret = GSW_QoS_SVLAN_PCP_ClassSet(gsw_dev, &PCP_ClassCfg);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_SVLAN_PCP_ClassSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_SVLAN_PCP_ClassSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ShaperCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_ShaperCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nRateShaperId", sizeof(param.nRateShaperId), ¶m.nRateShaperId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nRateShaperId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_ShaperCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_ShaperCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nRateShaperId", param.nRateShaperId);
+ printf("\t%40s:\t%s\n", "bEnable", (param.bEnable > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t0x%x\n", "nCbs", param.nCbs);
+ printf("\t%40s:\t0x%x\n", "nRate", param.nRate);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ShaperCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_ShaperCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nRateShaperId", sizeof(param.nRateShaperId), ¶m.nRateShaperId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nRateShaperId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_ShaperCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_ShaperCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "bEnable", sizeof(param.bEnable), ¶m.bEnable);
+ scanParamArg(prmc, prmv, "nCbs", sizeof(param.nCbs), ¶m.nCbs);
+ scanParamArg(prmc, prmv, "nRate", sizeof(param.nRate), ¶m.nRate);
+
+ ret = GSW_QoS_ShaperCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_ShaperCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ShaperQueueAssign(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_ShaperQueue_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nRateShaperId", sizeof(param.nRateShaperId), ¶m.nRateShaperId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nRateShaperId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_ShaperQueueAssign(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperQueueAssign failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_ShaperQueueAssign done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ShaperQueueDeassign(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_ShaperQueue_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nRateShaperId", sizeof(param.nRateShaperId), ¶m.nRateShaperId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nRateShaperId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_ShaperQueueDeassign(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperQueueDeassign failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_ShaperQueueDeassign done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ShaperQueueGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_ShaperQueueGet_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_ShaperQueueGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperQueueGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_ShaperQueueGet:\n");
+ printf("\t%40s:\t0x%x\n", "nQueueId", param.nQueueId);
+ printf("\t%40s\n", "<Shaper 0>");
+ printf("\t%40s:\t%s\n", "bAssigned", (param.sShaper[0].bAssigned > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%u (0x%x)\n", "nRateShaperId", param.sShaper[0].nRateShaperId, param.sShaper[0].nRateShaperId);
+ printf("\t%40s\n", "<Shaper 1>");
+ printf("\t%40s:\t%s\n", "bAssigned", (param.sShaper[1].bAssigned > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%u (0x%x)\n", "nRateShaperId", param.sShaper[1].nRateShaperId, param.sShaper[1].nRateShaperId);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_SchedulerCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_schedulerCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_schedulerCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_SchedulerCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_SchedulerCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_SchedulerCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nQueueId", param.nQueueId);
+ printf("\t%40s:\t0x%x\n", "eType", param.eType);
+ printf("\t%40s:\t%u (0x%x)\n", "nWeight", param.nWeight, param.nWeight);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_SchedulerCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_schedulerCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_schedulerCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_SchedulerCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_SchedulerCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "eType", sizeof(param.eType), ¶m.eType);
+ scanParamArg(prmc, prmv, "nWeight", sizeof(param.nWeight), ¶m.nWeight);
+
+ ret = GSW_QoS_SchedulerCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_SchedulerCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_SchedulerCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_WredCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_WRED_Cfg_t param = {0};
+
+ memset(¶m, 0, sizeof(GSW_QoS_WRED_Cfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_WredCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_WredCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "eProfile", param.eProfile);
+ printf("\t%40s:\t0x%x\n", "eMode", param.eMode);
+ printf("\t%40s:\t0x%x\n", "eThreshMode", param.eThreshMode);
+ printf("\t%40s:\t0x%x\n", "nRed_Min", param.nRed_Min);
+ printf("\t%40s:\t0x%x\n", "nRed_Max", param.nRed_Max);
+ printf("\t%40s:\t0x%x\n", "nYellow_Min", param.nYellow_Min);
+ printf("\t%40s:\t0x%x\n", "nYellow_Max", param.nYellow_Max);
+ printf("\t%40s:\t0x%x\n", "nGreen_Min", param.nGreen_Min);
+ printf("\t%40s:\t0x%x\n", "nGreen_Max", param.nGreen_Max);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_WredCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_WRED_Cfg_t param = {0};
+
+ memset(¶m, 0, sizeof(GSW_QoS_WRED_Cfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_WredCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_WredCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "eProfile", sizeof(param.eProfile), ¶m.eProfile);
+ scanParamArg(prmc, prmv, "eMode", sizeof(param.eMode), ¶m.eMode);
+ scanParamArg(prmc, prmv, "eThreshMode", sizeof(param.eThreshMode), ¶m.eThreshMode);
+ scanParamArg(prmc, prmv, "nRed_Min", sizeof(param.nRed_Min), ¶m.nRed_Min);
+ scanParamArg(prmc, prmv, "nRed_Max", sizeof(param.nRed_Max), ¶m.nRed_Max);
+ scanParamArg(prmc, prmv, "nYellow_Min", sizeof(param.nYellow_Min), ¶m.nYellow_Min);
+ scanParamArg(prmc, prmv, "nYellow_Max", sizeof(param.nYellow_Max), ¶m.nYellow_Max);
+ scanParamArg(prmc, prmv, "nGreen_Min", sizeof(param.nGreen_Min), ¶m.nGreen_Min);
+ scanParamArg(prmc, prmv, "nGreen_Max", sizeof(param.nGreen_Max), ¶m.nGreen_Max);
+
+ ret = GSW_QoS_WredCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_WredCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_WredQueueCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_WRED_QueueCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_WRED_QueueCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_WredQueueCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredQueueCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_WredQueueCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nQueueId", param.nQueueId);
+ printf("\t%40s:\t0x%x\n", "nRed_Min", param.nRed_Min);
+ printf("\t%40s:\t0x%x\n", "nRed_Max", param.nRed_Max);
+ printf("\t%40s:\t0x%x\n", "nYellow_Min", param.nYellow_Min);
+ printf("\t%40s:\t0x%x\n", "nYellow_Max", param.nYellow_Max);
+ printf("\t%40s:\t0x%x\n", "nGreen_Min", param.nGreen_Min);
+ printf("\t%40s:\t0x%x\n", "nGreen_Max", param.nGreen_Max);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_WredQueueCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_WRED_QueueCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_WRED_QueueCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_WredQueueCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_WredQueueCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "nRed_Min", sizeof(param.nRed_Min), ¶m.nRed_Min);
+ scanParamArg(prmc, prmv, "nRed_Max", sizeof(param.nRed_Max), ¶m.nRed_Max);
+ scanParamArg(prmc, prmv, "nYellow_Min", sizeof(param.nYellow_Min), ¶m.nYellow_Min);
+ scanParamArg(prmc, prmv, "nYellow_Max", sizeof(param.nYellow_Max), ¶m.nYellow_Max);
+ scanParamArg(prmc, prmv, "nGreen_Min", sizeof(param.nGreen_Min), ¶m.nGreen_Min);
+ scanParamArg(prmc, prmv, "nGreen_Max", sizeof(param.nGreen_Max), ¶m.nGreen_Max);
+
+ ret = GSW_QoS_WredQueueCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredQueueCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_WredQueueCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_WredPortCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_WRED_PortCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_WRED_PortCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_WredPortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredPortCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_WredPortCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nPortId", param.nPortId);
+ printf("\t%40s:\t0x%x\n", "nRed_Min", param.nRed_Min);
+ printf("\t%40s:\t0x%x\n", "nRed_Max", param.nRed_Max);
+ printf("\t%40s:\t0x%x\n", "nYellow_Min", param.nYellow_Min);
+ printf("\t%40s:\t0x%x\n", "nYellow_Max", param.nYellow_Max);
+ printf("\t%40s:\t0x%x\n", "nGreen_Min", param.nGreen_Min);
+ printf("\t%40s:\t0x%x\n", "nGreen_Max", param.nGreen_Max);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_WredPortCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_WRED_PortCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_WRED_PortCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_WredPortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_WredPortCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "nRed_Min", sizeof(param.nRed_Min), ¶m.nRed_Min);
+ scanParamArg(prmc, prmv, "nRed_Max", sizeof(param.nRed_Max), ¶m.nRed_Max);
+ scanParamArg(prmc, prmv, "nYellow_Min", sizeof(param.nYellow_Min), ¶m.nYellow_Min);
+ scanParamArg(prmc, prmv, "nYellow_Max", sizeof(param.nYellow_Max), ¶m.nYellow_Max);
+ scanParamArg(prmc, prmv, "nGreen_Min", sizeof(param.nGreen_Min), ¶m.nGreen_Min);
+ scanParamArg(prmc, prmv, "nGreen_Max", sizeof(param.nGreen_Max), ¶m.nGreen_Max);
+
+ ret = GSW_QoS_WredPortCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredPortCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_WredPortCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_TrunkingCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_trunkingCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_trunkingCfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_TrunkingCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Trunking_CfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_Trunking_CfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "bIP_Src", param.bIP_Src);
+ printf("\t%40s:\t0x%x\n", "bIP_Dst", param.bIP_Dst);
+ printf("\t%40s:\t0x%x\n", "bMAC_Src", param.bMAC_Src);
+ printf("\t%40s:\t0x%x\n", "bMAC_Dst", param.bMAC_Dst);
+ printf("\t%40s:\t0x%x\n", "bSrc_Port", param.bSrc_Port);
+ printf("\t%40s:\t0x%x\n", "bDst_Port", param.bDst_Port);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_TrunkingCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_trunkingCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_trunkingCfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_TrunkingCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_TrunkingCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "bIP_Src", sizeof(param.bIP_Src), ¶m.bIP_Src);
+ scanParamArg(prmc, prmv, "bIP_Dst", sizeof(param.bIP_Dst), ¶m.bIP_Dst);
+ scanParamArg(prmc, prmv, "bMAC_Src", sizeof(param.bMAC_Src), ¶m.bMAC_Src);
+ scanParamArg(prmc, prmv, "bMAC_Dst", sizeof(param.bMAC_Dst), ¶m.bMAC_Dst);
+ scanParamArg(prmc, prmv, "bSrc_Port", sizeof(param.bSrc_Port), ¶m.bSrc_Port);
+ scanParamArg(prmc, prmv, "bDst_Port", sizeof(param.bDst_Port), ¶m.bDst_Port);
+
+ ret = GSW_TrunkingCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Trunking_CfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_Trunking_CfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MAC_TableClear(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MAC_TableClear(gsw_dev);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_TableClear failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MAC_TableClear done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MAC_TableCondClear(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ GSW_MAC_tableClearCond_t param = {0};
+
+ scanParamArg(prmc, prmv, "eType", sizeof(param.eType), ¶m.eType);
+ scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MAC_TableClearCond(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_TableCondClear failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MAC_TableCondClear done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_cfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_cfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_CfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_CfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "eMAC_TableAgeTimer", param.eMAC_TableAgeTimer);
+ printf("\t%40s:\t%u\n", "nAgeTimer", param.nAgeTimer);
+ printf("\t%40s:\t%u\n", "nMaxPacketLen", param.nMaxPacketLen);
+ printf("\t%40s:\t%d\n", "bLearningLimitAction", param.bLearningLimitAction);
+ printf("\t%40s:\t%d\n", "bMAC_LockingAction", param.bMAC_LockingAction);
+ printf("\t%40s:\t%d\n", "bMAC_SpoofingAction", param.bMAC_SpoofingAction);
+ printf("\t%40s:\t%d\n", "bPauseMAC_ModeSrc", param.bPauseMAC_ModeSrc);
+ printf("\t%40s:\t", "nPauseMAC_Src");
+ printMAC_Address(param.nPauseMAC_Src);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_cfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_cfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_CfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "eMAC_TableAgeTimer", sizeof(param.eMAC_TableAgeTimer), ¶m.eMAC_TableAgeTimer);
+ scanParamArg(prmc, prmv, "nAgeTimer", sizeof(param.nAgeTimer), ¶m.nAgeTimer);
+ scanParamArg(prmc, prmv, "nMaxPacketLen", sizeof(param.nMaxPacketLen), ¶m.nMaxPacketLen);
+ scanParamArg(prmc, prmv, "bLearningLimitAction", sizeof(param.bLearningLimitAction), ¶m.bLearningLimitAction);
+ scanParamArg(prmc, prmv, "bMAC_LockingAction", sizeof(param.bLearningLimitAction), ¶m.bMAC_LockingAction);
+ scanParamArg(prmc, prmv, "bMAC_SpoofingAction", sizeof(param.bLearningLimitAction), ¶m.bMAC_SpoofingAction);
+ scanParamArg(prmc, prmv, "bPauseMAC_ModeSrc", sizeof(param.bPauseMAC_ModeSrc), ¶m.bPauseMAC_ModeSrc);
+ scanMAC_Arg(prmc, prmv, "nPauseMAC_Src", param.nPauseMAC_Src);
+
+ ret = GSW_CfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_CfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_CfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MAC_TableEntryRemove(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_MAC_tableRemove_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_MAC_tableRemove_t));
+
+ rret = scanMAC_Arg(prmc, prmv, "nMAC", param.nMAC);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nMAC\n");
+ return OS_ERROR;
+ }
+
+ printMAC_Address(param.nMAC);
+ scanParamArg(prmc, prmv, "nFId", sizeof(param.nFId), ¶m.nFId);
+ scanParamArg(prmc, prmv, "nTci", sizeof(param.nTci), ¶m.nTci);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MAC_TableEntryRemove(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_TableEntryRemove failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MAC_TableEntryRemove done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MAC_TableEntryQuery(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_MAC_tableQuery_t param = {0};
+ int rret, i = 0;
+
+ memset(¶m, 0, sizeof(GSW_MAC_tableQuery_t));
+
+ rret = scanMAC_Arg(prmc, prmv, "nMAC", param.nMAC);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nMAC\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nFId", sizeof(param.nFId), ¶m.nFId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nFId\n");
+ return OS_ERROR;
+ }
+ scanParamArg(prmc, prmv, "nFilterFlag", sizeof(param.nFilterFlag), ¶m.nFilterFlag);
+ scanParamArg(prmc, prmv, "nTci", sizeof(param.nTci), ¶m.nTci);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MAC_TableEntryQuery(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "GSW_MAC_TableEntryQuery failed with ret code", ret);
+ else
+ {
+ printf("%40s:\t", "nMAC");
+ printMAC_Address(param.nMAC);
+ printf("\n");
+ printf("%40s:\t%d\n", "nFId", param.nFId);
+ printf("%40s:\t%d\n", "nFilterFlag", param.nFilterFlag);
+ printf("%40s:\t%s\n", "bFound", (param.bFound > 0) ? "1" : "0");
+ printf("%40s:\t%s\n", "bStaticEntry", (param.bStaticEntry > 0) ? "TRUE" : "FALSE");
+ printf("%40s:\t%d\n", "nSVLAN_Id", param.nSVLAN_Id);
+
+ if (param.bStaticEntry)
+ {
+ for (i = 0; i < 8; i++)
+ {
+ printf("%35s[ %d ]:\t0x%x\n", "PortMap", i, param.nPortMap[i]);
+ }
+
+ printf("%40s:\t%d\n", "bIgmpControlled", param.bIgmpControlled);
+ printf("%40s:\t%d\n", "Hit Status", param.hitstatus);
+ }
+ else
+ { /*Dynamic Entry*/
+ printf("%40s:\t%u\n", "nPortId", param.nPortId);
+ // printf("%40s:\t%d\n", "nSubIfId", param.nSubIfId); //TODO need use in along with param.nPortId?
+ printf("%40s:\t%d\n", "AgeTimer", param.nAgeTimer);
+ printf("%40s:\t%s\n", "bEntryChanged", (param.bEntryChanged > 0) ? "TRUE" : "FALSE");
+ printf("%40s:\t%d\n", "FirstBridgePortId", param.nFirstBridgePortId);
+ printf("%40s:\t", "nAssociatedMAC");
+ printMAC_Address(param.nAssociatedMAC);
+ printf("\n");
+ }
+
+ if (param.nTci)
+ {
+ printf("\t%40s:\t%d\n", "VLAN PRI", ((param.nTci & 0xE000) >> 13));
+ printf("\t%40s:\t%d\n", "VLAN CFI/DEI", ((param.nTci & 0x1000) >> 12));
+ printf("\t%40s:\t%d\n", "VLAN ID", (param.nTci & 0x0FFF));
+ }
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_FlowctrlCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_FlowCtrlCfg_t param = {0};
+
+ memset(¶m, 0, sizeof(GSW_QoS_FlowCtrlCfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_FlowctrlCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_FlowctrlCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_FlowctrlCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nFlowCtrlNonConform_Min", param.nFlowCtrlNonConform_Min);
+ printf("\t%40s:\t0x%x\n", "nFlowCtrlNonConform_Max", param.nFlowCtrlNonConform_Max);
+ printf("\t%40s:\t0x%x\n", "nFlowCtrlConform_Min", param.nFlowCtrlConform_Min);
+ printf("\t%40s:\t0x%x\n", "nFlowCtrlConform_Max", param.nFlowCtrlConform_Max);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_FlowctrlCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_FlowCtrlCfg_t param = {0};
+ int cnt;
+
+ memset(¶m, 0, sizeof(GSW_QoS_FlowCtrlCfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_FlowctrlCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_FlowctrlCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ cnt = scanParamArg(prmc, prmv, "nFlowCtrlNonConform_Min", sizeof(param.nFlowCtrlNonConform_Min), ¶m.nFlowCtrlNonConform_Min);
+ cnt += scanParamArg(prmc, prmv, "nFlowCtrlNonConform_Max", sizeof(param.nFlowCtrlNonConform_Max), ¶m.nFlowCtrlNonConform_Max);
+ cnt += scanParamArg(prmc, prmv, "nFlowCtrlConform_Min", sizeof(param.nFlowCtrlConform_Min), ¶m.nFlowCtrlConform_Min);
+ cnt += scanParamArg(prmc, prmv, "nFlowCtrlConform_Max", sizeof(param.nFlowCtrlConform_Max), ¶m.nFlowCtrlConform_Max);
+
+ if (cnt)
+ {
+ ret = GSW_QoS_FlowctrlCfgSet(gsw_dev, ¶m);
+ }
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_FlowctrlCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_FlowctrlCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_FlowctrlPortCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_FlowCtrlPortCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_FlowCtrlPortCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_FlowctrlPortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_FlowctrlPortCfgGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_FlowctrlPortCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nPortId", param.nPortId);
+ printf("\t%40s:\t0x%x\n", "nFlowCtrl_Min", param.nFlowCtrl_Min);
+ printf("\t%40s:\t0x%x\n", "nFlowCtrl_Max", param.nFlowCtrl_Max);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_FlowctrlPortCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+ GSW_QoS_FlowCtrlPortCfg_t param = {0};
+ int rret, cnt;
+
+ memset(¶m, 0, sizeof(GSW_QoS_FlowCtrlPortCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_FlowctrlPortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_FlowctrlPortCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ cnt = scanParamArg(prmc, prmv, "nFlowCtrl_Min", sizeof(param.nFlowCtrl_Min), ¶m.nFlowCtrl_Min);
+ cnt += scanParamArg(prmc, prmv, "nFlowCtrl_Max", sizeof(param.nFlowCtrl_Max), ¶m.nFlowCtrl_Max);
+ if (cnt)
+ {
+ ret = GSW_QoS_FlowctrlPortCfgSet(gsw_dev, ¶m);
+ }
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_FlowctrlPortCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_FlowctrlPortCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MAC_TableEntryAdd(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_MAC_tableAdd_t param = {0};
+
+ memset(¶m, 0, sizeof(GSW_MAC_tableAdd_t));
+
+ scanParamArg(prmc, prmv, "nFId", sizeof(param.nFId), ¶m.nFId);
+ scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ scanParamArg(prmc, prmv, "nAgeTimer", sizeof(param.nAgeTimer), ¶m.nAgeTimer);
+ scanParamArg(prmc, prmv, "bStaticEntry", sizeof(param.bStaticEntry), ¶m.bStaticEntry);
+ scanParamArg(prmc, prmv, "nTrafficClass", sizeof(param.nTrafficClass), ¶m.nTrafficClass);
+ scanParamArg(prmc, prmv, "bIgmpControlled", sizeof(param.bIgmpControlled), ¶m.bIgmpControlled);
+ scanParamArg(prmc, prmv, "nFilterFlag", sizeof(param.nFilterFlag), ¶m.nFilterFlag);
+ scanParamArg(prmc, prmv, "nSVLAN_Id", sizeof(param.bIgmpControlled), ¶m.nSVLAN_Id);
+ scanParamArg(prmc, prmv, "nSubIfId", sizeof(param.nSubIfId), ¶m.nSubIfId);
+ scanMAC_Arg(prmc, prmv, "nMAC", param.nMAC);
+ scanMAC_Arg(prmc, prmv, "nAssociatedMAC", param.nAssociatedMAC);
+ scanParamArg(prmc, prmv, "nTci", sizeof(param.nTci), ¶m.nTci);
+ scanParamArg(prmc, prmv, "nPortMapValueIndex0", sizeof(param.nPortMap[0]), ¶m.nPortMap[0]);
+ scanParamArg(prmc, prmv, "nPortMapValueIndex1", sizeof(param.nPortMap[1]), ¶m.nPortMap[1]);
+ scanParamArg(prmc, prmv, "nPortMapValueIndex2", sizeof(param.nPortMap[2]), ¶m.nPortMap[2]);
+ scanParamArg(prmc, prmv, "nPortMapValueIndex3", sizeof(param.nPortMap[3]), ¶m.nPortMap[3]);
+ scanParamArg(prmc, prmv, "nPortMapValueIndex4", sizeof(param.nPortMap[4]), ¶m.nPortMap[4]);
+ scanParamArg(prmc, prmv, "nPortMapValueIndex5", sizeof(param.nPortMap[5]), ¶m.nPortMap[5]);
+ scanParamArg(prmc, prmv, "nPortMapValueIndex6", sizeof(param.nPortMap[6]), ¶m.nPortMap[6]);
+ scanParamArg(prmc, prmv, "nPortMapValueIndex7", sizeof(param.nPortMap[7]), ¶m.nPortMap[7]);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MAC_TableEntryAdd(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_TableEntryAdd failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MAC_TableEntryAdd done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MAC_TableEntryRead(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int i = 0;
+ GSW_MAC_tableRead_t MAC_tableRead = {0};
+
+ memset(&MAC_tableRead, 0, sizeof(GSW_MAC_tableRead_t));
+
+ for (i = 0; i < 71; i++)
+ printf("-");
+ printf("\n");
+ printf("%-18s|%-5s|%-10s|%-5s|%-5s|%-5s|%-8s\n",
+ "MAC Address", "Port", "Age", "SID", "FID", "Hit", "Stat/Dyn");
+ for (i = 0; i < 71; i++)
+ printf("-");
+ printf("\n");
+
+ MAC_tableRead.bInitial = 1;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ for (;;)
+ {
+ ret = GSW_MAC_TableEntryRead(gsw_dev, &MAC_tableRead);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_MAC_TableEntryRead failed with ret code", ret);
+ return ret;
+ }
+
+ if (MAC_tableRead.bLast == 1)
+ break;
+
+ if (checkValidMAC_Address(MAC_tableRead.nMAC))
+ {
+ if ((MAC_tableRead.nAgeTimer == 0) && (MAC_tableRead.bStaticEntry == 0))
+ {
+ /* Do nothing */
+ continue;
+ }
+ }
+
+ if (MAC_tableRead.bStaticEntry)
+ {
+ unsigned int i = 0;
+ printMAC_Address(MAC_tableRead.nMAC);
+ if (MAC_tableRead.nPortId & 0x80000000)
+ printf(" |MAP |");
+ else
+ printf(" |%-5d|", MAC_tableRead.nPortId);
+ printf("%-10d|%-5d|%-5d|%-5d|Static\n",
+ MAC_tableRead.nAgeTimer,
+ MAC_tableRead.nSubIfId,
+ MAC_tableRead.nFId,
+ MAC_tableRead.hitstatus);
+ printf("%-19s%-5s%-10s%-5s%-5s%-9s%-9s|%-9s: 0x%x\n",
+ "", "", "", "", "", "", "",
+ "nFilterFlag(key)", MAC_tableRead.nFilterFlag);
+
+ for (i = 0; i < ARRAY_SIZE(MAC_tableRead.nPortMap); i++)
+ {
+ if (!MAC_tableRead.nPortMap[i])
+ continue;
+
+ printf("%-19s%-5s%-10s%-5s%-5s%-9s%-9s|%-8s[%d]: 0x%x\n",
+ "", "", "", "", "", "", "",
+ "PortMap", i, MAC_tableRead.nPortMap[i]);
+ }
+ }
+ else
+ {
+ printMAC_Address(MAC_tableRead.nMAC);
+ printf(" |%-5d|%-10d|%-5d|%-5d|%-5d|Dynamic\n",
+ MAC_tableRead.nPortId,
+ MAC_tableRead.nAgeTimer,
+ MAC_tableRead.nSubIfId,
+ MAC_tableRead.nFId,
+ MAC_tableRead.hitstatus);
+ }
+
+ if (MAC_tableRead.nTci)
+ {
+ printf("%-19s%-5s%-10s%-5s%-55s%-9s%-9s|%-18s: %d\n",
+ "", "", "", "", "", "", "",
+ "VLAN PRI", ((MAC_tableRead.nTci & 0xE000) >> 13));
+ printf("%-19s%-5s%-10s%-5s%-55s%-9s%-9s|%-18s: %d\n",
+ "", "", "", "", "", "", "",
+ "VLAN CFI/DEI", ((MAC_tableRead.nTci & 0x1000) >> 12));
+ printf("%-19s%-5s%-10s%-5s%-55s%-9s%-9s|%-18s: %d\n",
+ "", "", "", "", "", "", "",
+ "VLAN ID", (MAC_tableRead.nTci & 0x0FFF));
+ }
+ memset(&MAC_tableRead, 0x00, sizeof(MAC_tableRead));
+ }
+
+ for (i = 0; i < 71; i++)
+ printf("-");
+ printf("\n");
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_QueuePortSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_queuePort_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_queuePort_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+ scanParamArg(prmc, prmv, "nTrafficClassId", sizeof(param.nTrafficClassId), ¶m.nTrafficClassId);
+ scanParamArg(prmc, prmv, "bRedirectionBypass", sizeof(param.bRedirectionBypass), ¶m.bRedirectionBypass);
+ scanParamArg(prmc, prmv, "bExtrationEnable", sizeof(param.bExtrationEnable), ¶m.bExtrationEnable);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_QueuePortGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_QueuePortGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "eQMapMode", sizeof(param.eQMapMode), ¶m.eQMapMode);
+ scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ scanParamArg(prmc, prmv, "nRedirectPortId", sizeof(param.nRedirectPortId), ¶m.nRedirectPortId);
+ scanParamArg(prmc, prmv, "bEnableIngressPceBypass", sizeof(param.bEnableIngressPceBypass), ¶m.bEnableIngressPceBypass);
+ scanParamArg(prmc, prmv, "bReservedPortMode", sizeof(param.bReservedPortMode), ¶m.bReservedPortMode);
+
+ ret = GSW_QoS_QueuePortSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_QueuePortSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_QueuePortSet done\n");
+ }
+
+ return ret;
+}
+
+static int print_queues_gswip32(uint16_t port)
+{
+ GSW_QoS_queuePort_t queuePortParam = {0};
+ int tc;
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ queuePortParam.nPortId = port;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+
+ for (tc = 0; tc < NUM_TC * 4; tc++)
+ {
+ queuePortParam.nTrafficClassId = tc & GENMASK(3, 0);
+ queuePortParam.bRedirectionBypass = (tc & BIT(4)) >> 4;
+ queuePortParam.bExtrationEnable = (tc & BIT(5)) >> 5;
+
+ if (queuePortParam.nTrafficClassId == 0)
+ {
+ printf("\n");
+ printf(" Port | Traffic Class | bRedirectionBypass | bPceIngressBypass | bExtrationEnable | Egress Queue | nRedirectPortId\n");
+ printf("------------------------------------------------------------------------------------------------------------------\n");
+ }
+
+ ret = GSW_QoS_QueuePortGet(gsw_dev, &queuePortParam);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_QueuePortGet failed with ret code", ret);
+ return ret;
+ }
+
+ printf(" %4d | %13d | %18d ",
+ queuePortParam.nPortId,
+ queuePortParam.nTrafficClassId,
+ queuePortParam.bRedirectionBypass);
+
+ if (queuePortParam.bRedirectionBypass)
+ printf("| %17s ", "n/a");
+ else
+ printf("| %17d ", queuePortParam.bEnableIngressPceBypass);
+
+ if (queuePortParam.bRedirectionBypass || !queuePortParam.bEnableIngressPceBypass)
+ printf("| %16d ", queuePortParam.bExtrationEnable);
+ else
+ printf("| %16s ", "n/a");
+
+ printf("| %12d | %15d\n",
+ queuePortParam.nQueueId,
+ queuePortParam.nRedirectPortId);
+
+ if (queuePortParam.nTrafficClassId == NUM_TC - 1)
+ printf("------------------------------------------------------------------------------------------------------------------\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_QueueCfgGet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_queueCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_queueCfg_t));
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_QueueCfgGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_QueueCfgGet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("\tnQueueId: %d\n", param.nQueueId);
+ printf("\tbEnable: %d\n", param.bEnable);
+ printf("\tnPortId: %d\n", param.nPortId);
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_QueueCfgSet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_queueCfg_t param = {0};
+ int rret;
+ uint8_t bEnable = 0, nPortId = 0;
+
+ memset(¶m, 0, sizeof(GSW_QoS_queueCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nQueueId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "bEnable", sizeof(param.bEnable), ¶m.bEnable);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: bEnable\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+ if (param.nPortId > 15)
+ {
+ printf("nPortId (%d) is out of range (0~15)\n", param.nPortId);
+ return OS_ERROR;
+ }
+ param.bEnable = param.bEnable % 2;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_QueueCfgSet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ {
+ printf("fapi_GSW_QoS_QueueCfgSet failed with ret code: %d\n", ret);
+ return ret;
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_QueuePortGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = -1;
+ GSW_QoS_queuePort_t queuePortParam = {0};
+
+ memset(&queuePortParam, 0, sizeof(GSW_QoS_queuePort_t));
+
+ if (scanParamArg(prmc, prmv, "nPortId", sizeof(queuePortParam.nPortId), &queuePortParam.nPortId))
+ {
+ if (scanParamArg(prmc, prmv, "nTrafficClassId", sizeof(queuePortParam.nTrafficClassId), &queuePortParam.nTrafficClassId))
+ {
+ scanParamArg(prmc, prmv, "bRedirectionBypass", sizeof(queuePortParam.bRedirectionBypass), &queuePortParam.bRedirectionBypass);
+
+ scanParamArg(prmc, prmv, "bExtrationEnable", sizeof(queuePortParam.bExtrationEnable), &queuePortParam.bExtrationEnable);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_QueuePortGet(gsw_dev, &queuePortParam);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_QoS_QueuePortGet failed with ret code", ret);
+ return ret;
+ }
+
+ printf("fapi_GSW_QoS_FlowctrlPortCfgGet:\n");
+ printf("\t%40s:\t0x%x\n", "nPortId", queuePortParam.nPortId);
+ printf("\t%40s:\t0x%x\n", "nTrafficClassId", queuePortParam.nTrafficClassId);
+ printf("\t%40s:\t0x%x\n", "bRedirectionBypass", queuePortParam.bRedirectionBypass);
+ printf("\t%40s:\t0x%x\n", "bEnableIngressPceBypass", queuePortParam.bEnableIngressPceBypass);
+ printf("\t%40s:\t0x%x\n", "bExtrationEnable", queuePortParam.bExtrationEnable);
+
+ if (queuePortParam.eQMapMode == GSW_QOS_QMAP_SINGLE_MODE)
+ printf("\t%40s:\tSingle\n", "eQMapMode");
+ else
+ printf("\t%40s:\tSubifid\n", "eQMapMode");
+ printf("\t%40s:\t0x%x\n", "nQueueId", queuePortParam.nQueueId);
+ printf("\t%40s:\t0x%x\n", "nRedirectPortId", queuePortParam.nRedirectPortId);
+ return ret;
+ }
+ else
+ {
+ return print_queues_gswip32(queuePortParam.nPortId);
+ }
+ }
+ printf("Parameter \"nPortId\" is missing.\n");
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgePortConfigGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_BRIDGE_portConfig_t sVar = {0};
+ int rret;
+ unsigned int i;
+
+ rret = scanParamArg(prmc, prmv, "nBridgePortId", sizeof(sVar.nBridgePortId), &sVar.nBridgePortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nBridgePortId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "eMask", sizeof(sVar.eMask), &sVar.eMask);
+ if (!sVar.eMask)
+ sVar.eMask = 0xFFFFFFFF;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgePortConfigGet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgePortConfigGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t0x%x\n", "nBridgePortId", sVar.nBridgePortId);
+ printf("\t%40s:\t0x%x\n", "eMask", sVar.eMask);
+ printf("\t%40s:\t0x%x\n", "nBridgeId", sVar.nBridgeId);
+ printf("\t%40s:\t0x%x\n", "bIngressExtendedVlanEnable", sVar.bIngressExtendedVlanEnable);
+ printf("\t%40s:\t0x%x\n", "nIngressExtendedVlanBlockId", sVar.nIngressExtendedVlanBlockId);
+ printf("\t%40s:\t0x%x\n", "bEgressExtendedVlanEnable", sVar.bEgressExtendedVlanEnable);
+ printf("\t%40s:\t0x%x\n", "nEgressExtendedVlanBlockId", sVar.nEgressExtendedVlanBlockId);
+ printf("\t%40s:\t0x%x\n", "eIngressMarkingMode", sVar.eIngressMarkingMode);
+ printf("\t%40s:\t0x%x\n", "eEgressRemarkingMode", sVar.eEgressRemarkingMode);
+ printf("\t%40s:\t0x%x\n", "bIngressMeteringEnable", sVar.bIngressMeteringEnable);
+ printf("\t%40s:\t0x%x\n", "nIngressTrafficMeterId", sVar.nIngressTrafficMeterId);
+ printf("\t%40s:\t0x%x\n", "bEgressMeteringEnable", sVar.bEgressSubMeteringEnable[5]);
+ printf("\t%40s:\t0x%x\n", "nEgressTrafficMeterId", sVar.nEgressTrafficSubMeterId[5]);
+ printf("\t%40s:\t0x%x\n", "bEgressBroadcastSubMeteringEnable", sVar.bEgressSubMeteringEnable[0]);
+ printf("\t%40s:\t0x%x\n", "bEgressMulticastSubMeteringEnable", sVar.bEgressSubMeteringEnable[1]);
+ printf("\t%40s:\t0x%x\n", "bEgressUnknownMulticastIPSubMeteringEnable", sVar.bEgressSubMeteringEnable[2]);
+ printf("\t%40s:\t0x%x\n", "bEgressUnknownMulticastNonIPSubMeteringEnable", sVar.bEgressSubMeteringEnable[3]);
+ printf("\t%40s:\t0x%x\n", "bEgressUnknownUnicastSubMeteringEnable", sVar.bEgressSubMeteringEnable[4]);
+ printf("\t%40s:\t0x%x\n", "nEgressBroadcastSubMeteringId", sVar.nEgressTrafficSubMeterId[0]);
+ printf("\t%40s:\t0x%x\n", "nEgressMulticastSubMeteringId", sVar.nEgressTrafficSubMeterId[1]);
+ printf("\t%40s:\t0x%x\n", "bEgressUnknownMulticastIPSubMeteringEnable", sVar.nEgressTrafficSubMeterId[2]);
+ printf("\t%40s:\t0x%x\n", "bEgressUnknownMulticastNonIPSubMeteringEnable", sVar.nEgressTrafficSubMeterId[3]);
+ printf("\t%40s:\t0x%x\n", "bEgressUnknownUnicastSubMeteringEnable", sVar.nEgressTrafficSubMeterId[4]);
+ printf("\t%40s:\t0x%x\n", "nDestLogicalPortId", sVar.nDestLogicalPortId);
+ printf("\t%40s:\t0x%x\n", "nDestSubIfIdGroup", sVar.nDestSubIfIdGroup);
+ printf("\t%40s:\t0x%x\n", "bPmapperEnable", sVar.bPmapperEnable);
+
+ if (sVar.bPmapperEnable)
+ {
+ printf("\t%40s:\t0x%x\n", "ePmapperMappingMode", sVar.ePmapperMappingMode);
+ printf("\t%40s:\t0x%x\n", "nPmapperId", sVar.sPmapper.nPmapperId);
+ for (i = 0; i < 73; i++)
+ printf("\t%40s[%u]:\t0x%x\n", "nDestSubIfIdGroup", i, sVar.sPmapper.nDestSubIfIdGroup[i]);
+ }
+
+ for (i = 0; i < ARRAY_SIZE(sVar.nBridgePortMap); i++)
+ printf("\t%40s[%u]:\t0x%x\n", "nBridgePortMapIndex", i, sVar.nBridgePortMap[i]);
+
+ printf("\t%40s:\t0x%x\n", "bMcDestIpLookupDisable", sVar.bMcDestIpLookupDisable);
+ printf("\t%40s:\t0x%x\n", "bMcSrcIpLookupEnable", sVar.bMcSrcIpLookupEnable);
+ printf("\t%40s:\t0x%x\n", "bDestMacLookupDisable", sVar.bDestMacLookupDisable);
+ printf("\t%40s:\t0x%x\n", "bSrcMacLearningDisable", sVar.bSrcMacLearningDisable);
+ printf("\t%40s:\t0x%x\n", "bMacSpoofingDetectEnable", sVar.bMacSpoofingDetectEnable);
+ printf("\t%40s:\t0x%x\n", "bPortLockEnable", sVar.bPortLockEnable);
+ printf("\t%40s:\t0x%x\n", "bMacLearningLimitEnable", sVar.bMacLearningLimitEnable);
+ printf("\t%40s:\t0x%x\n", "nMacLearningLimit", sVar.nMacLearningLimit);
+ printf("\t%40s:\t0x%x\n", "nMacLearningCount", sVar.nMacLearningCount);
+ printf("\t%40s:\t0x%x\n", "bIngressVlanFilterEnable", sVar.bIngressVlanFilterEnable);
+ printf("\t%40s:\t0x%x\n", "nIngressVlanFilterBlockId", sVar.nIngressVlanFilterBlockId);
+ printf("\t%40s:\t0x%x\n", "bBypassEgressVlanFilter1", sVar.bBypassEgressVlanFilter1);
+ printf("\t%40s:\t0x%x\n", "bEgressVlanFilter1Enable", sVar.bEgressVlanFilter1Enable);
+ printf("\t%40s:\t0x%x\n", "nEgressVlanFilter1BlockId", sVar.nEgressVlanFilter1BlockId);
+ printf("\t%40s:\t0x%x\n", "bEgressVlanFilter2Enable", sVar.bEgressVlanFilter2Enable);
+ printf("\t%40s:\t0x%x\n", "nEgressVlanFilter2BlockId", sVar.nEgressVlanFilter2BlockId);
+ printf("\t%40s:\t0x%x\n", "bVlanTagSelection", sVar.bVlanTagSelection);
+ printf("\t%40s:\t0x%x\n", "bVlanSrcMacPriorityEnable", sVar.bVlanSrcMacPriorityEnable);
+ printf("\t%40s:\t0x%x\n", "bVlanSrcMacDEIEnable", sVar.bVlanSrcMacDEIEnable);
+ printf("\t%40s:\t0x%x\n", "bVlanSrcMacVidEnable", sVar.bVlanSrcMacVidEnable);
+ printf("\t%40s:\t0x%x\n", "bVlanDstMacPriorityEnable", sVar.bVlanDstMacPriorityEnable);
+ printf("\t%40s:\t0x%x\n", "bVlanDstMacDEIEnable", sVar.bVlanDstMacDEIEnable);
+ printf("\t%40s:\t0x%x\n", "bVlanDstMacVidEnable", sVar.bVlanDstMacVidEnable);
+ printf("\t%40s:\t0x%x\n", "bVlanMulticastPriorityEnable", sVar.bVlanMulticastPriorityEnable);
+ printf("\t%40s:\t0x%x\n", "bVlanMulticastDEIEnable", sVar.bVlanMulticastDEIEnable);
+ printf("\t%40s:\t0x%x\n", "bVlanMulticastVidEnable", sVar.bVlanMulticastVidEnable);
+ printf("\t%40s:\t0x%x\n", "bLoopViolationCounters", sVar.nLoopViolationCount);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgePortConfigSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_BRIDGE_portConfig_t sVar;
+ int rret;
+ unsigned int i, bBridgePortMapEnable = 0, MapValue = 0;
+ u16 Index = 0;
+
+ memset(&sVar, 0x00, sizeof(sVar));
+
+ rret = scanParamArg(prmc, prmv, "nBridgePortId", sizeof(sVar.nBridgePortId), &sVar.nBridgePortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nBridgePortId\n");
+ return OS_ERROR;
+ }
+
+ sVar.eMask = 0xFFFFFFFF;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgePortConfigGet(gsw_dev, &sVar);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_BridgePortConfigGet failed with ret code", ret);
+ return ret;
+ }
+ sVar.eMask = 0x0;
+
+ scanParamArg(prmc, prmv, "nBridgeId", sizeof(sVar.eMask), &sVar.nBridgeId);
+ if (findStringParam(prmc, prmv, "nBridgeId"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_BRIDGE_ID;
+
+ scanParamArg(prmc, prmv, "bIngressExtendedVlanEnable", sizeof(sVar.bIngressExtendedVlanEnable), &sVar.bIngressExtendedVlanEnable);
+ if (findStringParam(prmc, prmv, "bIngressExtendedVlanEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN;
+
+ scanParamArg(prmc, prmv, "nIngressExtendedVlanBlockId", sizeof(sVar.nIngressExtendedVlanBlockId), &sVar.nIngressExtendedVlanBlockId);
+ scanParamArg(prmc, prmv, "bEgressExtendedVlanEnable", sizeof(sVar.bEgressExtendedVlanEnable), &sVar.bEgressExtendedVlanEnable);
+ if (findStringParam(prmc, prmv, "bEgressExtendedVlanEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN;
+
+ scanParamArg(prmc, prmv, "nEgressExtendedVlanBlockId", sizeof(sVar.nEgressExtendedVlanBlockId), &sVar.nEgressExtendedVlanBlockId);
+ scanParamArg(prmc, prmv, "eIngressMarkingMode", sizeof(sVar.eIngressMarkingMode), &sVar.eIngressMarkingMode);
+ if (findStringParam(prmc, prmv, "eIngressMarkingMode"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_MARKING;
+
+ scanParamArg(prmc, prmv, "eEgressRemarkingMode", sizeof(sVar.eEgressRemarkingMode), &sVar.eEgressRemarkingMode);
+ if (findStringParam(prmc, prmv, "eEgressRemarkingMode"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_REMARKING;
+
+ scanParamArg(prmc, prmv, "bIngressMeteringEnable", sizeof(sVar.bIngressMeteringEnable), &sVar.bIngressMeteringEnable);
+ if (findStringParam(prmc, prmv, "bIngressMeteringEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_METER;
+
+ scanParamArg(prmc, prmv, "nIngressTrafficMeterId", sizeof(sVar.nIngressTrafficMeterId), &sVar.nIngressTrafficMeterId);
+ scanParamArg(prmc, prmv, "bEgressMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[5]), &sVar.bEgressSubMeteringEnable[5]);
+ if (findStringParam(prmc, prmv, "bEgressMeteringEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
+
+ scanParamArg(prmc, prmv, "nEgressTrafficMeterId", sizeof(sVar.nEgressTrafficSubMeterId[5]), &sVar.nEgressTrafficSubMeterId[5]);
+ scanParamArg(prmc, prmv, "bEgressBroadcastSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[0]), &sVar.bEgressSubMeteringEnable[0]);
+ if (findStringParam(prmc, prmv, "bEgressBroadcastSubMeteringEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
+
+ scanParamArg(prmc, prmv, "bEgressMulticastSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[1]), &sVar.bEgressSubMeteringEnable[1]);
+ if (findStringParam(prmc, prmv, "bEgressMulticastSubMeteringEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
+
+ scanParamArg(prmc, prmv, "bEgressUnknownMulticastIPSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[2]), &sVar.bEgressSubMeteringEnable[2]);
+ if (findStringParam(prmc, prmv, "bEgressUnknownMulticastIPSubMeteringEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
+
+ scanParamArg(prmc, prmv, "bEgressUnknownMulticastNonIPSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[3]), &sVar.bEgressSubMeteringEnable[3]);
+ if (findStringParam(prmc, prmv, "bEgressUnknownMulticastNonIPSubMeteringEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
+
+ scanParamArg(prmc, prmv, "bEgressUnknownUnicastSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[4]), &sVar.bEgressSubMeteringEnable[4]);
+ if (findStringParam(prmc, prmv, "bEgressUnknownUnicastSubMeteringEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
+
+ scanParamArg(prmc, prmv, "nEgressBroadcastSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[0]), &sVar.nEgressTrafficSubMeterId[0]);
+ scanParamArg(prmc, prmv, "nEgressMulticastSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[1]), &sVar.nEgressTrafficSubMeterId[1]);
+ scanParamArg(prmc, prmv, "nEgressUnknownMulticastIPSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[2]), &sVar.nEgressTrafficSubMeterId[2]);
+ scanParamArg(prmc, prmv, "nEgressUnknownMulticastNonIPSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[3]), &sVar.nEgressTrafficSubMeterId[3]);
+ scanParamArg(prmc, prmv, "nEgressUnknownUnicastSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[4]), &sVar.nEgressTrafficSubMeterId[4]);
+
+ scanParamArg(prmc, prmv, "nDestLogicalPortId", sizeof(sVar.nDestLogicalPortId), &sVar.nDestLogicalPortId);
+ if (findStringParam(prmc, prmv, "nDestLogicalPortId"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_CTP_MAPPING;
+
+ scanParamArg(prmc, prmv, "nDestSubIfIdGroup", sizeof(sVar.nDestSubIfIdGroup), &sVar.nDestSubIfIdGroup);
+ if (findStringParam(prmc, prmv, "nDestSubIfIdGroup"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_CTP_MAPPING;
+
+ scanParamArg(prmc, prmv, "bPmapperEnable", sizeof(sVar.bPmapperEnable), &sVar.bPmapperEnable);
+ if (findStringParam(prmc, prmv, "bPmapperEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_CTP_MAPPING;
+
+ if (sVar.bPmapperEnable)
+ {
+ scanParamArg(prmc, prmv, "ePmapperMappingMode", sizeof(sVar.ePmapperMappingMode), &sVar.ePmapperMappingMode);
+ scanPMAP_Arg(prmc, prmv, "nPmapperDestSubIfIdGroup", sVar.sPmapper.nDestSubIfIdGroup);
+ printf("i. The first entry of each P-mapper index is for Non-IP and Non-VLAN tagging packets\n");
+ printf("ii. The entry 8 to 1 of each P-mapper index is for PCP mapping entries\n");
+ printf("iii.The entry 72 to 9 of each P-mapper index is for DSCP mapping entries\n");
+ printf("User Configured nDestSubIfIdGroup list as below\n");
+
+ for (i = 0; i <= 72; i++)
+ printf("sVar.sPmapper.nDestSubIfIdGroup[%d] = %d\n", i, sVar.sPmapper.nDestSubIfIdGroup[i]);
+ }
+
+ scanParamArg(prmc, prmv, "bBridgePortMapEnable", sizeof(bBridgePortMapEnable), &bBridgePortMapEnable);
+ if (findStringParam(prmc, prmv, "bBridgePortMapEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_BRIDGE_PORT_MAP;
+ if (bBridgePortMapEnable)
+ {
+ char buf[] = "nBridgePortMapIndex[0]";
+
+ scanParamArg(prmc, prmv, "Index", sizeof(Index), &Index);
+ scanParamArg(prmc, prmv, "MapValue", sizeof(MapValue), &MapValue);
+
+ if (Index >= ARRAY_SIZE(sVar.nBridgePortMap))
+ {
+ printf("Invalid BridgePortMap Index %d\n", Index);
+ return -1;
+ }
+ sVar.nBridgePortMap[Index] = MapValue;
+
+ for (i = 0; i < ARRAY_SIZE(sVar.nBridgePortMap); i++)
+ {
+ buf[20] = '0' + i;
+ scanParamArg(prmc, prmv, buf, sizeof(sVar.nBridgePortMap[i]), sVar.nBridgePortMap + i);
+ }
+ }
+
+ scanParamArg(prmc, prmv, "bMcDestIpLookupDisable", sizeof(sVar.bMcDestIpLookupDisable), &sVar.bMcDestIpLookupDisable);
+ if (findStringParam(prmc, prmv, "bMcDestIpLookupDisable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MC_DEST_IP_LOOKUP;
+
+ scanParamArg(prmc, prmv, "bMcSrcIpLookupEnable", sizeof(sVar.bMcSrcIpLookupEnable), &sVar.bMcSrcIpLookupEnable);
+ if (findStringParam(prmc, prmv, "bMcSrcIpLookupEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MC_SRC_IP_LOOKUP;
+
+ scanParamArg(prmc, prmv, "bDestMacLookupDisable", sizeof(sVar.bDestMacLookupDisable), &sVar.bDestMacLookupDisable);
+ if (findStringParam(prmc, prmv, "bDestMacLookupDisable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MC_DEST_MAC_LOOKUP;
+
+ scanParamArg(prmc, prmv, "bSrcMacLearningDisable", sizeof(sVar.bSrcMacLearningDisable), &sVar.bSrcMacLearningDisable);
+ if (findStringParam(prmc, prmv, "bSrcMacLearningDisable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MC_SRC_MAC_LEARNING;
+
+ scanParamArg(prmc, prmv, "bMacSpoofingDetectEnable", sizeof(sVar.bMacSpoofingDetectEnable), &sVar.bMacSpoofingDetectEnable);
+ if (findStringParam(prmc, prmv, "bMacSpoofingDetectEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MAC_SPOOFING;
+
+ scanParamArg(prmc, prmv, "bPortLockEnable", sizeof(sVar.bPortLockEnable), &sVar.bPortLockEnable);
+ if (findStringParam(prmc, prmv, "bPortLockEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_PORT_LOCK;
+
+ scanParamArg(prmc, prmv, "bMacLearningLimitEnable", sizeof(sVar.bMacLearningLimitEnable), &sVar.bMacLearningLimitEnable);
+ if (findStringParam(prmc, prmv, "bMacLearningLimitEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MAC_LEARNING_LIMIT;
+
+ scanParamArg(prmc, prmv, "nMacLearningLimit", sizeof(sVar.nMacLearningLimit), &sVar.nMacLearningLimit);
+
+ scanParamArg(prmc, prmv, "bIngressVlanFilterEnable", sizeof(sVar.bIngressVlanFilterEnable), &sVar.bIngressVlanFilterEnable);
+ if (findStringParam(prmc, prmv, "bIngressVlanFilterEnable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN_FILTER;
+
+ scanParamArg(prmc, prmv, "nIngressVlanFilterBlockId", sizeof(sVar.nIngressVlanFilterBlockId), &sVar.nIngressVlanFilterBlockId);
+
+ scanParamArg(prmc, prmv, "bBypassEgressVlanFilter1", sizeof(sVar.bBypassEgressVlanFilter1), &sVar.bBypassEgressVlanFilter1);
+ if (findStringParam(prmc, prmv, "bBypassEgressVlanFilter1"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN_FILTER;
+
+ scanParamArg(prmc, prmv, "bEgressVlanFilter1Enable", sizeof(sVar.bEgressVlanFilter1Enable), &sVar.bEgressVlanFilter1Enable);
+ if (findStringParam(prmc, prmv, "bEgressVlanFilter1Enable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN_FILTER1;
+
+ scanParamArg(prmc, prmv, "nEgressVlanFilter1BlockId", sizeof(sVar.nEgressVlanFilter1BlockId), &sVar.nEgressVlanFilter1BlockId);
+
+ scanParamArg(prmc, prmv, "bEgressVlanFilter2Enable", sizeof(sVar.bEgressVlanFilter2Enable), &sVar.bEgressVlanFilter2Enable);
+ if (findStringParam(prmc, prmv, "bEgressVlanFilter2Enable"))
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN_FILTER2;
+
+ scanParamArg(prmc, prmv, "nEgressVlanFilter2BlockId", sizeof(sVar.nEgressVlanFilter2BlockId), &sVar.nEgressVlanFilter2BlockId);
+
+ /* VLAN based MAC learning/look-up */
+ if (findStringParam(prmc, prmv, "bVlanTagSelection"))
+ {
+ scanParamArg(prmc, prmv, "bVlanTagSelection", sizeof(sVar.bVlanTagSelection), &sVar.bVlanTagSelection);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING;
+ }
+
+ if (findStringParam(prmc, prmv, "bVlanSrcMacPriorityEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanSrcMacPriorityEnable", sizeof(sVar.bVlanSrcMacPriorityEnable), &sVar.bVlanSrcMacPriorityEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING;
+ }
+
+ if (findStringParam(prmc, prmv, "bVlanSrcMacDEIEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanSrcMacDEIEnable", sizeof(sVar.bVlanSrcMacDEIEnable), &sVar.bVlanSrcMacDEIEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING;
+ }
+
+ if (findStringParam(prmc, prmv, "bVlanSrcMacVidEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanSrcMacVidEnable", sizeof(sVar.bVlanSrcMacVidEnable), &sVar.bVlanSrcMacVidEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING;
+ }
+
+ if (findStringParam(prmc, prmv, "bVlanDstMacPriorityEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanDstMacPriorityEnable", sizeof(sVar.bVlanDstMacPriorityEnable), &sVar.bVlanDstMacPriorityEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING;
+ }
+
+ if (findStringParam(prmc, prmv, "bVlanDstMacDEIEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanDstMacDEIEnable", sizeof(sVar.bVlanDstMacDEIEnable), &sVar.bVlanDstMacDEIEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING;
+ }
+
+ if (findStringParam(prmc, prmv, "bVlanDstMacVidEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanDstMacVidEnable", sizeof(sVar.bVlanDstMacVidEnable), &sVar.bVlanDstMacVidEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING;
+ }
+
+ /* VLAN based multicast */
+ if (findStringParam(prmc, prmv, "bVlanMulticastPriorityEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanMulticastPriorityEnable", sizeof(sVar.bVlanMulticastPriorityEnable), &sVar.bVlanMulticastPriorityEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MULTICAST_LOOKUP;
+ }
+
+ if (findStringParam(prmc, prmv, "bVlanMulticastDEIEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanMulticastDEIEnable", sizeof(sVar.bVlanMulticastDEIEnable), &sVar.bVlanMulticastDEIEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MULTICAST_LOOKUP;
+ }
+
+ if (findStringParam(prmc, prmv, "bVlanMulticastVidEnable"))
+ {
+ scanParamArg(prmc, prmv, "bVlanMulticastVidEnable", sizeof(sVar.bVlanMulticastVidEnable), &sVar.bVlanMulticastVidEnable);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MULTICAST_LOOKUP;
+ }
+
+ if (findStringParam(prmc, prmv, "nLoopViolationCount"))
+ {
+ scanParamArg(prmc, prmv, "nLoopViolationCount", sizeof(sVar.nLoopViolationCount), &sVar.nLoopViolationCount);
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_LOOP_VIOLATION_COUNTER;
+ }
+
+ if (findStringParam(prmc, prmv, "bForce"))
+ {
+ sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_FORCE;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgePortConfigSet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgePortConfigSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_BridgePortConfigSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CtpPortConfigGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_CTP_portConfig_t sVar = {0};
+ int rret;
+ unsigned int i;
+
+ memset(&sVar, 0x00, sizeof(sVar));
+
+ rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(sVar.nLogicalPortId), &sVar.nLogicalPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nLogicalPortId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(sVar.nSubIfIdGroup), &sVar.nSubIfIdGroup);
+ scanParamArg(prmc, prmv, "eMask", sizeof(sVar.eMask), &sVar.eMask);
+ if (!sVar.eMask)
+ sVar.eMask = 0xFFFFFFFF;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CtpPortConfigGet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_CtpPortConfigGet failed with ret code", ret);
+ else
+ {
+ printf("\t nLogicalPortId = %u", sVar.nLogicalPortId);
+ printf("\n\t nSubIfIdGroup = %u", sVar.nSubIfIdGroup);
+ printf("\n\t eMask = 0x%x", sVar.eMask);
+ printf("\n\t nBridgePortId = %u", sVar.nBridgePortId);
+ printf("\n\t bForcedTrafficClass = %u", sVar.bForcedTrafficClass);
+ printf("\n\t nDefaultTrafficClass = %u", sVar.nDefaultTrafficClass);
+ printf("\n\t bIngressExtendedVlanEnable = %u", sVar.bIngressExtendedVlanEnable);
+ printf("\n\t nIngressExtendedVlanBlockId = %u", sVar.nIngressExtendedVlanBlockId);
+ printf("\n\t bIngressExtendedVlanIgmpEnable = %u", sVar.bIngressExtendedVlanIgmpEnable);
+ printf("\n\t nIngressExtendedVlanBlockIdIgmp = %u", sVar.nIngressExtendedVlanBlockIdIgmp);
+ printf("\n\t bEgressExtendedVlanEnable = %u", sVar.bEgressExtendedVlanEnable);
+ printf("\n\t nEgressExtendedVlanBlockId = %u", sVar.nEgressExtendedVlanBlockId);
+ printf("\n\t bEgressExtendedVlanIgmpEnable = %u", sVar.bEgressExtendedVlanIgmpEnable);
+ printf("\n\t nEgressExtendedVlanBlockIdIgmp = %u", sVar.nEgressExtendedVlanBlockIdIgmp);
+ printf("\n\t bIngressNto1VlanEnable = %u", sVar.bIngressNto1VlanEnable);
+ printf("\n\t bEgressNto1VlanEnable = %u", sVar.bEgressNto1VlanEnable);
+ printf("\n\t eIngressMarkingMode = %u", sVar.eIngressMarkingMode);
+ printf("\n\t eEgressMarkingMode = %u", sVar.eEgressMarkingMode);
+ printf("\n\t bEgressMarkingOverrideEnable = %u", sVar.eEgressMarkingModeOverride);
+ printf("\n\t eEgressRemarkingMode = %u", sVar.eEgressRemarkingMode);
+ printf("\n\t bIngressMeteringEnable = %u", sVar.bIngressMeteringEnable);
+ printf("\n\t nIngressTrafficMeterId = %u", sVar.nIngressTrafficMeterId);
+ printf("\n\t bEgressMeteringEnable = %u", sVar.bEgressMeteringEnable);
+ printf("\n\t nEgressTrafficMeterId = %u", sVar.nEgressTrafficMeterId);
+ printf("\n\t bBridgingBypass = %u", sVar.bBridgingBypass);
+ printf("\n\t nDestLogicalPortId = %u", sVar.nDestLogicalPortId);
+ printf("\n\t nDestSubIfIdGroup = %u", sVar.nDestSubIfIdGroup);
+ printf("\n\t bPmapperEnable = %u", sVar.bPmapperEnable);
+ if (sVar.bPmapperEnable)
+ {
+ printf("\n\t ePmapperMappingMode = %u", sVar.ePmapperMappingMode);
+ printf("\n\t nPmapperId = %u", sVar.sPmapper.nPmapperId);
+
+ for (i = 0; i < 73; i++)
+ printf("\n\t nDestSubIfIdGroup[%u] = %u", i, sVar.sPmapper.nDestSubIfIdGroup[i]);
+ }
+
+ printf("\n\t nFirstFlowEntryIndex = %u", sVar.nFirstFlowEntryIndex);
+ printf("\n\t nNumberOfFlowEntries = %u", sVar.nNumberOfFlowEntries);
+ printf("\n\t bIngressDaSaSwapEnable = %u", sVar.bIngressDaSaSwapEnable);
+ printf("\n\t bEgressDaSaSwapEnable = %u", sVar.bEgressDaSaSwapEnable);
+ printf("\n\t bIngressLoopbackEnable = %u", sVar.bIngressLoopbackEnable);
+ printf("\n\t bEgressLoopbackEnable = %u", sVar.bEgressLoopbackEnable);
+ printf("\n\t bIngressMirrorEnable = %u", sVar.bIngressMirrorEnable);
+ printf("\n\t bEgressMirrorEnable = %u", sVar.bEgressMirrorEnable);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CtpPortConfigSet(int prmc, char *prmv[])
+{
+ GSW_CTP_portConfig_t sVar = {0};
+ memset(&sVar, 0x00, sizeof(sVar));
+ unsigned int i;
+ GSW_Device_t *dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(sVar.nLogicalPortId), &sVar.nLogicalPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nLogicalPortId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(sVar.nSubIfIdGroup), &sVar.nSubIfIdGroup);
+ sVar.eMask = 0xFFFFFFFF;
+
+ dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CtpPortConfigGet(dev, &sVar);
+ sVar.eMask = 0x0;
+
+ scanParamArg(prmc, prmv, "nBridgePortId", sizeof(sVar.nBridgePortId), &sVar.nBridgePortId);
+ if (findStringParam(prmc, prmv, "nBridgePortId"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_BRIDGE_PORT_ID;
+
+ scanParamArg(prmc, prmv, "bForcedTrafficClass", sizeof(sVar.bForcedTrafficClass), &sVar.bForcedTrafficClass);
+ if (findStringParam(prmc, prmv, "bForcedTrafficClass"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_FORCE_TRAFFIC_CLASS;
+
+ scanParamArg(prmc, prmv, "nDefaultTrafficClass", sizeof(sVar.nDefaultTrafficClass), &sVar.nDefaultTrafficClass);
+ if (findStringParam(prmc, prmv, "nDefaultTrafficClass"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_FORCE_TRAFFIC_CLASS;
+
+ scanParamArg(prmc, prmv, "bIngressExtendedVlanEnable", sizeof(sVar.bIngressExtendedVlanEnable), &sVar.bIngressExtendedVlanEnable);
+ if (findStringParam(prmc, prmv, "bIngressExtendedVlanEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_INGRESS_VLAN;
+
+ scanParamArg(prmc, prmv, "nIngressExtendedVlanBlockId", sizeof(sVar.nIngressExtendedVlanBlockId), &sVar.nIngressExtendedVlanBlockId);
+
+ scanParamArg(prmc, prmv, "bIngressExtendedVlanIgmpEnable", sizeof(sVar.bIngressExtendedVlanIgmpEnable), &sVar.bIngressExtendedVlanIgmpEnable);
+ if (findStringParam(prmc, prmv, "bIngressExtendedVlanIgmpEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_INGRESS_VLAN_IGMP;
+
+ scanParamArg(prmc, prmv, "nIngressExtendedVlanBlockIdIgmp", sizeof(sVar.nIngressExtendedVlanBlockIdIgmp), &sVar.nIngressExtendedVlanBlockIdIgmp);
+
+ scanParamArg(prmc, prmv, "bEgressExtendedVlanEnable", sizeof(sVar.bEgressExtendedVlanEnable), &sVar.bEgressExtendedVlanEnable);
+ if (findStringParam(prmc, prmv, "bEgressExtendedVlanEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_EGRESS_VLAN;
+
+ scanParamArg(prmc, prmv, "nEgressExtendedVlanBlockId", sizeof(sVar.nEgressExtendedVlanBlockId), &sVar.nEgressExtendedVlanBlockId);
+
+ scanParamArg(prmc, prmv, "bEgressExtendedVlanIgmpEnable", sizeof(sVar.bEgressExtendedVlanIgmpEnable), &sVar.bEgressExtendedVlanIgmpEnable);
+ if (findStringParam(prmc, prmv, "bEgressExtendedVlanIgmpEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_EGRESS_VLAN_IGMP;
+
+ scanParamArg(prmc, prmv, "nEgressExtendedVlanBlockIdIgmp", sizeof(sVar.nEgressExtendedVlanBlockIdIgmp), &sVar.nEgressExtendedVlanBlockIdIgmp);
+
+ scanParamArg(prmc, prmv, "bIngressNto1VlanEnable", sizeof(sVar.bIngressNto1VlanEnable), &sVar.bIngressNto1VlanEnable);
+ if (findStringParam(prmc, prmv, "bIngressNto1VlanEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_INRESS_NTO1_VLAN;
+
+ scanParamArg(prmc, prmv, "bEgressNto1VlanEnable", sizeof(sVar.bEgressNto1VlanEnable), &sVar.bEgressNto1VlanEnable);
+ if (findStringParam(prmc, prmv, "bEgressNto1VlanEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_EGRESS_NTO1_VLAN;
+
+ scanParamArg(prmc, prmv, "eIngressMarkingMode", sizeof(sVar.eIngressMarkingMode), &sVar.eIngressMarkingMode);
+ if (findStringParam(prmc, prmv, "eIngressMarkingMode"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_INGRESS_MARKING;
+
+ scanParamArg(prmc, prmv, "eEgressMarkingMode", sizeof(sVar.eEgressMarkingMode), &sVar.eEgressMarkingMode);
+ if (findStringParam(prmc, prmv, "eEgressMarkingMode"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_EGRESS_MARKING;
+
+ scanParamArg(prmc, prmv, "bEgressMarkingOverrideEnable", sizeof(sVar.bEgressMarkingOverrideEnable), &sVar.bEgressMarkingOverrideEnable);
+ if (findStringParam(prmc, prmv, "bEgressMarkingOverrideEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_EGRESS_MARKING_OVERRIDE;
+
+ scanParamArg(prmc, prmv, "eEgressMarkingModeOverride", sizeof(sVar.eEgressMarkingModeOverride), &sVar.eEgressMarkingModeOverride);
+
+ scanParamArg(prmc, prmv, "eEgressRemarkingMode", sizeof(sVar.eEgressRemarkingMode), &sVar.eEgressRemarkingMode);
+ if (findStringParam(prmc, prmv, "eEgressRemarkingMode"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_EGRESS_REMARKING;
+
+ scanParamArg(prmc, prmv, "bIngressMeteringEnable", sizeof(sVar.bIngressMeteringEnable), &sVar.bIngressMeteringEnable);
+
+ if (findStringParam(prmc, prmv, "bIngressMeteringEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_INGRESS_METER;
+
+ scanParamArg(prmc, prmv, "nIngressTrafficMeterId", sizeof(sVar.nIngressTrafficMeterId), &sVar.nIngressTrafficMeterId);
+
+ scanParamArg(prmc, prmv, "bEgressMeteringEnable", sizeof(sVar.bEgressMeteringEnable), &sVar.bEgressMeteringEnable);
+ if (findStringParam(prmc, prmv, "bEgressMeteringEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_EGRESS_METER;
+
+ scanParamArg(prmc, prmv, "nEgressTrafficMeterId", sizeof(sVar.nEgressTrafficMeterId), &sVar.nEgressTrafficMeterId);
+
+ scanParamArg(prmc, prmv, "bBridgingBypass", sizeof(sVar.bBridgingBypass), &sVar.bBridgingBypass);
+ if (findStringParam(prmc, prmv, "bBridgingBypass"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_BRIDGING_BYPASS;
+
+ scanParamArg(prmc, prmv, "nDestLogicalPortId", sizeof(sVar.nDestLogicalPortId), &sVar.nDestLogicalPortId);
+ scanParamArg(prmc, prmv, "nDestSubIfIdGroup", sizeof(sVar.nDestSubIfIdGroup), &sVar.nDestSubIfIdGroup);
+
+ scanParamArg(prmc, prmv, "bPmapperEnable", sizeof(sVar.bPmapperEnable), &sVar.bPmapperEnable);
+ if (sVar.bPmapperEnable)
+ {
+ scanParamArg(prmc, prmv, "ePmapperMappingMode", sizeof(sVar.ePmapperMappingMode), &sVar.ePmapperMappingMode);
+ scanPMAP_Arg(prmc, prmv, "nPmapperDestSubIfIdGroup", sVar.sPmapper.nDestSubIfIdGroup);
+ printf("i. The first entry of each P-mapper index is for Non-IP and Non-VLAN tagging packets\n");
+ printf("ii. The entry 8 to 1 of each P-mapper index is for PCP mapping entries\n");
+ printf("iii.The entry 72 to 9 of each P-mapper index is for DSCP mapping entries\n");
+ printf("User Configured nDestSubIfIdGroup list as below\n");
+
+ for (i = 0; i <= 72; i++)
+ printf("sVar.sPmapper.nDestSubIfIdGroup[%d] = %d\n", i, sVar.sPmapper.nDestSubIfIdGroup[i]);
+ }
+
+ scanParamArg(prmc, prmv, "nFirstFlowEntryIndex", sizeof(sVar.nFirstFlowEntryIndex), &sVar.nFirstFlowEntryIndex);
+ if (findStringParam(prmc, prmv, "nFirstFlowEntryIndex"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_FLOW_ENTRY;
+
+ scanParamArg(prmc, prmv, "nNumberOfFlowEntries", sizeof(sVar.nNumberOfFlowEntries), &sVar.nNumberOfFlowEntries);
+
+ scanParamArg(prmc, prmv, "bIngressLoopbackEnable", sizeof(sVar.bIngressLoopbackEnable), &sVar.bIngressLoopbackEnable);
+ if (findStringParam(prmc, prmv, "bIngressLoopbackEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
+
+ scanParamArg(prmc, prmv, "bIngressDaSaSwapEnable", sizeof(sVar.bIngressDaSaSwapEnable), &sVar.bIngressDaSaSwapEnable);
+ if (findStringParam(prmc, prmv, "bIngressDaSaSwapEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
+
+ scanParamArg(prmc, prmv, "bEgressLoopbackEnable", sizeof(sVar.bEgressLoopbackEnable), &sVar.bEgressLoopbackEnable);
+ if (findStringParam(prmc, prmv, "bEgressLoopbackEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
+
+ scanParamArg(prmc, prmv, "bEgressDaSaSwapEnable", sizeof(sVar.bEgressDaSaSwapEnable), &sVar.bEgressDaSaSwapEnable);
+ if (findStringParam(prmc, prmv, "bEgressDaSaSwapEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
+
+ scanParamArg(prmc, prmv, "bIngressMirrorEnable", sizeof(sVar.bIngressMirrorEnable), &sVar.bIngressMirrorEnable);
+ if (findStringParam(prmc, prmv, "bIngressMirrorEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
+
+ scanParamArg(prmc, prmv, "bEgressMirrorEnable", sizeof(sVar.bEgressMirrorEnable), &sVar.bEgressMirrorEnable);
+ if (findStringParam(prmc, prmv, "bEgressMirrorEnable"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
+
+ if (findStringParam(prmc, prmv, "bForce"))
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_FORCE;
+
+ ret = GSW_CtpPortConfigSet(dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_CtpPortConfigSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_CtpPortConfigSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgeAlloc(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_BRIDGE_alloc_t param = {0};
+
+ memset(¶m, 0x00, sizeof(param));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgeAlloc(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgeAlloc failed with ret code", ret);
+ else
+ {
+ printf("\n\t Allocated Bridge ID = %u\n", param.nBridgeId);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgeFree(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_BRIDGE_alloc_t param = {0};
+ int rret;
+
+ memset(¶m, 0x00, sizeof(param));
+
+ rret = scanParamArg(prmc, prmv, "nBridgeId", sizeof(param.nBridgeId), ¶m.nBridgeId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nBridgeId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgeFree(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgeFree failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_BridgeFree done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgeConfigGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_BRIDGE_config_t param = {0};
+ int rret;
+
+ memset(¶m, 0x00, sizeof(param));
+
+ rret = scanParamArg(prmc, prmv, "nBridgeId", sizeof(param.nBridgeId), ¶m.nBridgeId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nBridgeId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "eMask", sizeof(param.eMask), ¶m.eMask);
+ if (!param.eMask)
+ param.eMask = 0xFFFFFFFF;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgeConfigGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgeConfigGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_BridgeConfigGet done\n");
+ printf("%40s:\t%u\n", "nBridgeId", param.nBridgeId);
+ printf("%40s:\t0x%x\n", "eMask", param.eMask);
+ printf("%40s:\t%u\n", "bMacLearningLimitEnable", param.bMacLearningLimitEnable);
+ printf("%40s:\t%u\n", "nMacLearningLimit", param.nMacLearningLimit);
+ printf("%40s:\t%u\n", "nMacLearningCount", param.nMacLearningCount);
+ printf("%40s:\t%u\n", "nLearningDiscardEvent", param.nLearningDiscardEvent);
+ printf("%40s:\t%u\n", "eForwardBroadcast", param.eForwardBroadcast);
+ printf("%40s:\t%u\n", "eForwardUnknownMulticastIp", param.eForwardUnknownMulticastIp);
+ printf("%40s:\t%u\n", "eForwardUnknownMulticastNonIp", param.eForwardUnknownMulticastNonIp);
+ printf("%40s:\t%u\n", "eForwardUnknownUnicast", param.eForwardUnknownUnicast);
+ printf("%40s:\t%u\n", "bBroadcastMeterEnable", param.bSubMeteringEnable[0]);
+ printf("%40s:\t%u\n", "nBroadcastMeterId", param.nTrafficSubMeterId[0]);
+ printf("%40s:\t%u\n", "bMulticastMeterEnable", param.bSubMeteringEnable[1]);
+ printf("%40s:\t%u\n", "nMulticastMeterId", param.nTrafficSubMeterId[1]);
+ printf("%40s:\t%u\n", "bUnknownMulticastIpMeterEnable", param.bSubMeteringEnable[2]);
+ printf("%40s:\t%u\n", "nUnknownMulticastIpMeterId", param.nTrafficSubMeterId[2]);
+ printf("%40s:\t%u\n", "bUnknownMulticastNonIpMeterEnable", param.bSubMeteringEnable[3]);
+ printf("%40s:\t%u\n", "nUnknownMulticastNonIpMeterId", param.nTrafficSubMeterId[3]);
+ printf("%40s:\t%u\n", "bUnknownUniCastMeterEnable", param.bSubMeteringEnable[4]);
+ printf("%40s:\t%u\n", "nUnknownUniCastMeterId", param.nTrafficSubMeterId[4]);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgeConfigSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_BRIDGE_config_t sVar = {0};
+ memset(&sVar, 0x00, sizeof(sVar));
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nBridgeId", sizeof(sVar.nBridgeId), &sVar.nBridgeId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nBridgeId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "bMacLearningLimitEnable", sizeof(sVar.bMacLearningLimitEnable), &sVar.bMacLearningLimitEnable);
+ if (findStringParam(prmc, prmv, "bMacLearningLimitEnable"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_MAC_LEARNING_LIMIT;
+
+ scanParamArg(prmc, prmv, "nMacLearningLimit", sizeof(sVar.nMacLearningLimit), &sVar.nMacLearningLimit);
+
+ scanParamArg(prmc, prmv, "eForwardBroadcast", sizeof(sVar.eForwardBroadcast), &sVar.eForwardBroadcast);
+ if (findStringParam(prmc, prmv, "eForwardBroadcast"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE;
+
+ scanParamArg(prmc, prmv, "eForwardUnknownMulticastIp", sizeof(sVar.eForwardUnknownMulticastIp), &sVar.eForwardUnknownMulticastIp);
+ if (findStringParam(prmc, prmv, "eForwardUnknownMulticastIp"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE;
+
+ scanParamArg(prmc, prmv, "eForwardUnknownMulticastNonIp", sizeof(sVar.eForwardUnknownMulticastNonIp), &sVar.eForwardUnknownMulticastNonIp);
+ if (findStringParam(prmc, prmv, "eForwardUnknownMulticastNonIp"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE;
+
+ scanParamArg(prmc, prmv, "eForwardUnknownUnicast", sizeof(sVar.eForwardUnknownUnicast), &sVar.eForwardUnknownUnicast);
+ if (findStringParam(prmc, prmv, "eForwardUnknownUnicast"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE;
+
+ scanParamArg(prmc, prmv, "bBroadcastMeterEnable", sizeof(sVar.bSubMeteringEnable[0]), &sVar.bSubMeteringEnable[0]);
+ if (findStringParam(prmc, prmv, "bBroadcastMeterEnable"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
+
+ scanParamArg(prmc, prmv, "nBroadcastMeterId", sizeof(sVar.nTrafficSubMeterId[0]), &sVar.nTrafficSubMeterId[0]);
+
+ scanParamArg(prmc, prmv, "bMulticastMeterEnable", sizeof(sVar.bSubMeteringEnable[1]), &sVar.bSubMeteringEnable[1]);
+ if (findStringParam(prmc, prmv, "bMulticastMeterEnable"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
+
+ scanParamArg(prmc, prmv, "nMulticastMeterId", sizeof(sVar.nTrafficSubMeterId[1]), &sVar.nTrafficSubMeterId[1]);
+
+ scanParamArg(prmc, prmv, "bUnknownMulticastIpMeterEnable", sizeof(sVar.bSubMeteringEnable[2]), &sVar.bSubMeteringEnable[2]);
+ if (findStringParam(prmc, prmv, "bUnknownMulticastIpMeterEnable"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
+
+ scanParamArg(prmc, prmv, "nUnknownMulticastIpMeterId", sizeof(sVar.nTrafficSubMeterId[2]), &sVar.nTrafficSubMeterId[2]);
+
+ scanParamArg(prmc, prmv, "bUnknownMulticastNonIpMeterEnable", sizeof(sVar.bSubMeteringEnable[3]), &sVar.bSubMeteringEnable[3]);
+ if (findStringParam(prmc, prmv, "bUnknownMulticastNonIpMeterEnable"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
+
+ scanParamArg(prmc, prmv, "nUnknownMulticastNonIpMeterId", sizeof(sVar.nTrafficSubMeterId[3]), &sVar.nTrafficSubMeterId[3]);
+
+ scanParamArg(prmc, prmv, "bUnknownUniCastMeterEnable", sizeof(sVar.bSubMeteringEnable[4]), &sVar.bSubMeteringEnable[4]);
+ if (findStringParam(prmc, prmv, "bUnknownUniCastMeterEnable"))
+ sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
+
+ scanParamArg(prmc, prmv, "nUnknownUniCastMeterId", sizeof(sVar.nTrafficSubMeterId[4]), &sVar.nTrafficSubMeterId[4]);
+ if (findStringParam(prmc, prmv, "bForce"))
+ {
+ sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_FORCE;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgeConfigSet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgeConfigSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_BridgeConfigSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_ExtendedVlanAlloc(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_EXTENDEDVLAN_alloc_t param = {0};
+ int rret;
+
+ memset(¶m, 0x00, sizeof(param));
+
+ rret = scanParamArg(prmc, prmv, "nNumberOfEntries", sizeof(param.nNumberOfEntries), ¶m.nNumberOfEntries);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nNumberOfEntries\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_ExtendedVlanAlloc(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_ExtendedVlanAlloc failed with ret code", ret);
+ else
+ {
+ printf("\n\tAllocated ExtendedVlanblock = %u", param.nExtendedVlanBlockId);
+ printf("\n\tNumber of block entries associated with ExtendedVlanblock %d = %u\n",
+ param.nExtendedVlanBlockId, param.nNumberOfEntries);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_ExtendedVlanFree(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_EXTENDEDVLAN_alloc_t param = {0};
+ int rret;
+
+ memset(¶m, 0x00, sizeof(param));
+
+ rret = scanParamArg(prmc, prmv, "nExtendedVlanBlockId", sizeof(param.nExtendedVlanBlockId), ¶m.nExtendedVlanBlockId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nExtendedVlanBlockId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_ExtendedVlanFree(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_ExtendedVlanFree failed with ret code", ret);
+ else
+ {
+ printf("\n\tNumber of deleted entries associated with ExVlanblock %d = %u\n",
+ param.nExtendedVlanBlockId, param.nNumberOfEntries);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_ExtendedVlanGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ unsigned char f = 0;
+ GSW_EXTENDEDVLAN_config_t sVar = {0};
+ int rret;
+
+ memset(&sVar, 0x00, sizeof(sVar));
+
+ rret = scanParamArg(prmc, prmv, "nExtendedVlanBlockId", sizeof(sVar.nExtendedVlanBlockId), &sVar.nExtendedVlanBlockId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nExtendedVlanBlockId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nEntryIndex", sizeof(sVar.nEntryIndex), &sVar.nEntryIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nEntryIndex\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_ExtendedVlanGet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_ExtendedVlanGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_ExtendedVlanGet done\n");
+
+ printf("%40s:\t%u\n", "nExtendedVlanBlockId", sVar.nExtendedVlanBlockId);
+ printf("%40s:\t%u\n", "nEntryIndex", sVar.nEntryIndex);
+
+ printf("%40s:\t%u\n", "eOuterVlanFilterVlanType", sVar.sFilter.sOuterVlan.eType);
+ printf("%40s:\t%u\n", "bOuterVlanFilterPriorityEnable", sVar.sFilter.sOuterVlan.bPriorityEnable);
+ printf("%40s:\t%u\n", "nOuterVlanFilterPriorityVal", sVar.sFilter.sOuterVlan.nPriorityVal);
+ printf("%40s:\t%u\n", "bOuterVlanFilterVidEnable", sVar.sFilter.sOuterVlan.bVidEnable);
+ printf("%40s:\t%u\n", "nOuterVlanFilterVidVal", sVar.sFilter.sOuterVlan.nVidVal);
+ printf("%40s:\t%u\n", "eOuterVlanFilterTpid", sVar.sFilter.sOuterVlan.eTpid);
+ printf("%40s:\t%u\n", "eOuterVlanFilterDei", sVar.sFilter.sOuterVlan.eDei);
+
+ printf("%40s:\t%u\n", "eInnerVlanFilterVlanType", sVar.sFilter.sInnerVlan.eType);
+ printf("%40s:\t%u\n", "bInnerVlanFilterPriorityEnable", sVar.sFilter.sInnerVlan.bPriorityEnable);
+ printf("%40s:\t%u\n", "nInnerVlanFilterPriorityVal", sVar.sFilter.sInnerVlan.nPriorityVal);
+ printf("%40s:\t%u\n", "bInnerVlanFilterVidEnable", sVar.sFilter.sInnerVlan.bVidEnable);
+ printf("%40s:\t%u\n", "nInnerVlanFilterVidVal", sVar.sFilter.sInnerVlan.nVidVal);
+ printf("%40s:\t%u\n", "eInnerVlanFilterTpid", sVar.sFilter.sInnerVlan.eTpid);
+ printf("%40s:\t%u\n", "eInnerVlanFilterDei", sVar.sFilter.sInnerVlan.eDei);
+
+ printf("%40s:\t%u\n", "eEtherType", sVar.sFilter.eEtherType);
+ printf("%40s:\t%u\n", "eRemoveTagAction", sVar.sTreatment.eRemoveTag);
+
+ printf("%40s:\t%u\n", "bOuterVlanActionEnable", sVar.sTreatment.bAddOuterVlan);
+
+ printf("%40s:\t%u\n", "eOuterVlanActionPriorityMode", sVar.sTreatment.sOuterVlan.ePriorityMode);
+ printf("%40s:\t%u\n", "eOuterVlanActionPriorityVal", sVar.sTreatment.sOuterVlan.ePriorityVal);
+ printf("%40s:\t%u\n", "eOuterVlanActionVidMode", sVar.sTreatment.sOuterVlan.eVidMode);
+ printf("%40s:\t%u\n", "eOuterVlanActionVidVal", sVar.sTreatment.sOuterVlan.eVidVal);
+ printf("%40s:\t%u\n", "eOuterVlanActionTpid", sVar.sTreatment.sOuterVlan.eTpid);
+ printf("%40s:\t%u\n", "eOuterVlanActioneDei", sVar.sTreatment.sOuterVlan.eDei);
+
+ printf("%40s:\t%u\n", "bInnerVlanActionEnable", sVar.sTreatment.bAddInnerVlan);
+
+ printf("%40s:\t%u\n", "eInnerVlanActionPriorityMode", sVar.sTreatment.sInnerVlan.ePriorityMode);
+ printf("%40s:\t%u\n", "eInnerVlanActionPriorityVal", sVar.sTreatment.sInnerVlan.ePriorityVal);
+ printf("%40s:\t%u\n", "eInnerVlanActionVidMode", sVar.sTreatment.sInnerVlan.eVidMode);
+ printf("%40s:\t%u\n", "eInnerVlanActionVidVal", sVar.sTreatment.sInnerVlan.eVidVal);
+ printf("%40s:\t%u\n", "eInnerVlanActionTpid", sVar.sTreatment.sInnerVlan.eTpid);
+ printf("%40s:\t%u\n", "eInnerVlanActioneDei", sVar.sTreatment.sInnerVlan.eDei);
+
+ printf("%40s:\t%u\n", "bNewDscpEnable", sVar.sTreatment.bNewDscpEnable);
+ printf("%40s:\t%u\n", "nNewDscp", sVar.sTreatment.nNewDscp);
+ printf("%40s:\t%u\n", "bNewTrafficClassEnable", sVar.sTreatment.bNewTrafficClassEnable);
+ printf("%40s:\t%u\n", "nNewTrafficClass", sVar.sTreatment.nNewTrafficClass);
+ printf("%40s:\t%u\n", "bNewMeterEnable", sVar.sTreatment.bNewMeterEnable);
+ printf("%40s:\t%u\n", "sNewTrafficMeterId", sVar.sTreatment.sNewTrafficMeterId);
+ printf("%40s:\t%u\n", "bLoopbackEnable", sVar.sTreatment.bLoopbackEnable);
+ printf("%40s:\t%u\n", "bDaSaSwapEnable", sVar.sTreatment.bDaSaSwapEnable);
+ printf("%40s:\t%u\n", "bMirrorEnable", sVar.sTreatment.bMirrorEnable);
+ printf("%40s:\t%u\n", "bReassignBridgePortEnable", sVar.sTreatment.bReassignBridgePort);
+ printf("%40s:\t%u\n", "nNewBridgePortId", sVar.sTreatment.nNewBridgePortId);
+ if (sVar.sTreatment.sOuterVlan.ePriorityMode == GSW_EXTENDEDVLAN_TREATMENT_DSCP ||
+ sVar.sTreatment.sInnerVlan.ePriorityMode == GSW_EXTENDEDVLAN_TREATMENT_DSCP)
+ {
+ for (f = 0; f < 64; f++)
+ printf("\n\t nDscp2PcpMap[%d] = %u", f, sVar.sTreatment.nDscp2PcpMap[f]);
+ }
+
+ scanParamArg(prmc, prmv, "bOriginalPacketFilterMode", sizeof(sVar.sFilter.bOriginalPacketFilterMode), &sVar.sFilter.bOriginalPacketFilterMode);
+ scanParamArg(prmc, prmv, "eFilter_4_Tpid_Mode", sizeof(sVar.sFilter.eFilter_4_Tpid_Mode), &sVar.sFilter.eFilter_4_Tpid_Mode);
+ scanParamArg(prmc, prmv, "eTreatment_4_Tpid_Mode", sizeof(sVar.sTreatment.eTreatment_4_Tpid_Mode), &sVar.sTreatment.eTreatment_4_Tpid_Mode);
+ printf("%40s:\t%u\n", "bOriginalPacketFilterMode", sVar.sFilter.bOriginalPacketFilterMode);
+ printf("%40s:\t%u\n", "eFilter_4_Tpid_Mode", sVar.sFilter.eFilter_4_Tpid_Mode);
+ printf("%40s:\t%u\n", "eTreatment_4_Tpid_Mode", sVar.sTreatment.eTreatment_4_Tpid_Mode);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_ExtendedVlanSet(int prmc, char *prmv[])
+{
+ unsigned char bDscp2PcpMapEnable = 0, nDscp2PcpMapValue = 0, f = 0;
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_EXTENDEDVLAN_config_t sVar = {0};
+
+ memset(&sVar, 0x00, sizeof(sVar));
+
+ scanParamArg(prmc, prmv, "nExtendedVlanBlockId", sizeof(sVar.nExtendedVlanBlockId), &sVar.nExtendedVlanBlockId);
+ scanParamArg(prmc, prmv, "nEntryIndex", sizeof(sVar.nEntryIndex), &sVar.nEntryIndex);
+
+ scanParamArg(prmc, prmv, "eOuterVlanFilterVlanType", sizeof(sVar.sFilter.sOuterVlan.eType), &sVar.sFilter.sOuterVlan.eType);
+ scanParamArg(prmc, prmv, "bOuterVlanFilterPriorityEnable", sizeof(sVar.sFilter.sOuterVlan.bPriorityEnable), &sVar.sFilter.sOuterVlan.bPriorityEnable);
+ scanParamArg(prmc, prmv, "nOuterVlanFilterPriorityVal", sizeof(sVar.sFilter.sOuterVlan.nPriorityVal), &sVar.sFilter.sOuterVlan.nPriorityVal);
+ scanParamArg(prmc, prmv, "bOuterVlanFilterVidEnable", sizeof(sVar.sFilter.sOuterVlan.bVidEnable), &sVar.sFilter.sOuterVlan.bVidEnable);
+ scanParamArg(prmc, prmv, "nOuterVlanFilterVidVal", sizeof(sVar.sFilter.sOuterVlan.nVidVal), &sVar.sFilter.sOuterVlan.nVidVal);
+ scanParamArg(prmc, prmv, "eOuterVlanFilterTpid", sizeof(sVar.sFilter.sOuterVlan.eTpid), &sVar.sFilter.sOuterVlan.eTpid);
+ scanParamArg(prmc, prmv, "eOuterVlanFilterDei", sizeof(sVar.sFilter.sOuterVlan.eDei), &sVar.sFilter.sOuterVlan.eDei);
+
+ scanParamArg(prmc, prmv, "eInnerVlanFilterVlanType", sizeof(sVar.sFilter.sInnerVlan.eType), &sVar.sFilter.sInnerVlan.eType);
+ scanParamArg(prmc, prmv, "bInnerVlanFilterPriorityEnable", sizeof(sVar.sFilter.sInnerVlan.bPriorityEnable), &sVar.sFilter.sInnerVlan.bPriorityEnable);
+ scanParamArg(prmc, prmv, "nInnerVlanFilterPriorityVal", sizeof(sVar.sFilter.sInnerVlan.nPriorityVal), &sVar.sFilter.sInnerVlan.nPriorityVal);
+ scanParamArg(prmc, prmv, "bInnerVlanFilterVidEnable", sizeof(sVar.sFilter.sInnerVlan.bVidEnable), &sVar.sFilter.sInnerVlan.bVidEnable);
+ scanParamArg(prmc, prmv, "nInnerVlanFilterVidVal", sizeof(sVar.sFilter.sInnerVlan.nVidVal), &sVar.sFilter.sInnerVlan.nVidVal);
+ scanParamArg(prmc, prmv, "eInnerVlanFilterTpid", sizeof(sVar.sFilter.sInnerVlan.eTpid), &sVar.sFilter.sInnerVlan.eTpid);
+ scanParamArg(prmc, prmv, "eInnerVlanFilterDei", sizeof(sVar.sFilter.sInnerVlan.eDei), &sVar.sFilter.sInnerVlan.eDei);
+
+ scanParamArg(prmc, prmv, "eEtherType", sizeof(sVar.sFilter.eEtherType), &sVar.sFilter.eEtherType);
+ scanParamArg(prmc, prmv, "eRemoveTagAction", sizeof(sVar.sTreatment.eRemoveTag), &sVar.sTreatment.eRemoveTag);
+
+ scanParamArg(prmc, prmv, "bOuterVlanActionEnable", sizeof(sVar.sTreatment.bAddOuterVlan), &sVar.sTreatment.bAddOuterVlan);
+ scanParamArg(prmc, prmv, "eOuterVlanActionPriorityMode", sizeof(sVar.sTreatment.sOuterVlan.ePriorityMode), &sVar.sTreatment.sOuterVlan.ePriorityMode);
+ scanParamArg(prmc, prmv, "eOuterVlanActionPriorityVal", sizeof(sVar.sTreatment.sOuterVlan.ePriorityVal), &sVar.sTreatment.sOuterVlan.ePriorityVal);
+ scanParamArg(prmc, prmv, "eOuterVlanActionVidMode", sizeof(sVar.sTreatment.sOuterVlan.eVidMode), &sVar.sTreatment.sOuterVlan.eVidMode);
+ scanParamArg(prmc, prmv, "eOuterVlanActionVidVal", sizeof(sVar.sTreatment.sOuterVlan.eVidVal), &sVar.sTreatment.sOuterVlan.eVidVal);
+ scanParamArg(prmc, prmv, "eOuterVlanActionTpid", sizeof(sVar.sTreatment.sOuterVlan.eTpid), &sVar.sTreatment.sOuterVlan.eTpid);
+ scanParamArg(prmc, prmv, "eOuterVlanActioneDei", sizeof(sVar.sTreatment.sOuterVlan.eDei), &sVar.sTreatment.sOuterVlan.eDei);
+
+ scanParamArg(prmc, prmv, "bInnerVlanActionEnable", sizeof(sVar.sTreatment.bAddInnerVlan), &sVar.sTreatment.bAddInnerVlan);
+ scanParamArg(prmc, prmv, "eInnerVlanActionPriorityMode", sizeof(sVar.sTreatment.sInnerVlan.ePriorityMode), &sVar.sTreatment.sInnerVlan.ePriorityMode);
+ scanParamArg(prmc, prmv, "eInnerVlanActionPriorityVal", sizeof(sVar.sTreatment.sInnerVlan.ePriorityVal), &sVar.sTreatment.sInnerVlan.ePriorityVal);
+ scanParamArg(prmc, prmv, "eInnerVlanActionVidMode", sizeof(sVar.sTreatment.sInnerVlan.eVidMode), &sVar.sTreatment.sInnerVlan.eVidMode);
+ scanParamArg(prmc, prmv, "eInnerVlanActionVidVal", sizeof(sVar.sTreatment.sInnerVlan.eVidVal), &sVar.sTreatment.sInnerVlan.eVidVal);
+ scanParamArg(prmc, prmv, "eInnerVlanActionTpid", sizeof(sVar.sTreatment.sInnerVlan.eTpid), &sVar.sTreatment.sInnerVlan.eTpid);
+ scanParamArg(prmc, prmv, "eInnerVlanActioneDei", sizeof(sVar.sTreatment.sInnerVlan.eDei), &sVar.sTreatment.sInnerVlan.eDei);
+
+ scanParamArg(prmc, prmv, "bReassignBridgePortEnable", sizeof(sVar.sTreatment.bReassignBridgePort), &sVar.sTreatment.bReassignBridgePort);
+ scanParamArg(prmc, prmv, "nNewBridgePortId", sizeof(sVar.sTreatment.nNewBridgePortId), &sVar.sTreatment.nNewBridgePortId);
+
+ scanParamArg(prmc, prmv, "bNewDscpEnable", sizeof(sVar.sTreatment.bNewDscpEnable), &sVar.sTreatment.bNewDscpEnable);
+ scanParamArg(prmc, prmv, "nNewDscp", sizeof(sVar.sTreatment.nNewDscp), &sVar.sTreatment.nNewDscp);
+
+ scanParamArg(prmc, prmv, "bNewTrafficClassEnable", sizeof(sVar.sTreatment.bNewTrafficClassEnable), &sVar.sTreatment.bNewTrafficClassEnable);
+ scanParamArg(prmc, prmv, "nNewTrafficClass", sizeof(sVar.sTreatment.nNewTrafficClass), &sVar.sTreatment.nNewTrafficClass);
+
+ scanParamArg(prmc, prmv, "bNewMeterEnable", sizeof(sVar.sTreatment.bNewMeterEnable), &sVar.sTreatment.bNewMeterEnable);
+ scanParamArg(prmc, prmv, "sNewTrafficMeterId", sizeof(sVar.sTreatment.sNewTrafficMeterId), &sVar.sTreatment.sNewTrafficMeterId);
+
+ scanParamArg(prmc, prmv, "bLoopbackEnable", sizeof(sVar.sTreatment.bLoopbackEnable), &sVar.sTreatment.bLoopbackEnable);
+ scanParamArg(prmc, prmv, "bDaSaSwapEnable", sizeof(sVar.sTreatment.bDaSaSwapEnable), &sVar.sTreatment.bDaSaSwapEnable);
+ scanParamArg(prmc, prmv, "bMirrorEnable", sizeof(sVar.sTreatment.bMirrorEnable), &sVar.sTreatment.bMirrorEnable);
+
+ scanParamArg(prmc, prmv, "bDscp2PcpMapEnable", sizeof(bDscp2PcpMapEnable), &bDscp2PcpMapEnable);
+ scanParamArg(prmc, prmv, "nDscp2PcpMapValue", sizeof(nDscp2PcpMapValue), &nDscp2PcpMapValue);
+ if (bDscp2PcpMapEnable)
+ {
+ for (f = 0; f < 64; f++)
+ sVar.sTreatment.nDscp2PcpMap[f] = nDscp2PcpMapValue;
+ }
+
+ scanParamArg(prmc, prmv, "bOriginalPacketFilterMode", sizeof(sVar.sFilter.bOriginalPacketFilterMode), &sVar.sFilter.bOriginalPacketFilterMode);
+ scanParamArg(prmc, prmv, "eFilter_4_Tpid_Mode", sizeof(sVar.sFilter.eFilter_4_Tpid_Mode), &sVar.sFilter.eFilter_4_Tpid_Mode);
+ scanParamArg(prmc, prmv, "eTreatment_4_Tpid_Mode", sizeof(sVar.sTreatment.eTreatment_4_Tpid_Mode), &sVar.sTreatment.eTreatment_4_Tpid_Mode);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_ExtendedVlanSet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_ExtendedVlanSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_ExtendedVlanSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_VlanFilterAlloc(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_VLANFILTER_alloc_t param = {0};
+ int rret;
+
+ memset(¶m, 0x00, sizeof(param));
+
+ rret = scanParamArg(prmc, prmv, "nNumberOfEntries", sizeof(param.nNumberOfEntries), ¶m.nNumberOfEntries);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nNumberOfEntries\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "bDiscardUntagged", sizeof(param.bDiscardUntagged), ¶m.bDiscardUntagged);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: bDiscardUntagged\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "bDiscardUnmatchedTagged", sizeof(param.bDiscardUnmatchedTagged), ¶m.bDiscardUnmatchedTagged);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: bDiscardUnmatchedTagged\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_VlanFilterAlloc(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanFilterAlloc failed with ret code", ret);
+ else
+ {
+ printf("\n\tAllocated VlanFilterblock = %u", param.nVlanFilterBlockId);
+ printf("\n\t Number of block entries associated with VlanFilterblock %d = %u\n",
+ param.nVlanFilterBlockId, param.nNumberOfEntries);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_VlanFilterFree(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_VLANFILTER_alloc_t param = {0};
+ int rret;
+
+ memset(¶m, 0x00, sizeof(param));
+
+ rret = scanParamArg(prmc, prmv, "nVlanFilterBlockId", sizeof(param.nVlanFilterBlockId), ¶m.nVlanFilterBlockId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVlanFilterBlockId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_VlanFilterFree(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanFilterFree failed with ret code", ret);
+ else
+ {
+ printf("\n\t Number of deleted entries associated with VlanFilterblock %d = %u\n",
+ param.nVlanFilterBlockId, param.nNumberOfEntries);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_VlanFilterGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ unsigned char f = 0;
+
+ GSW_VLANFILTER_config_t sVar = {0};
+ int rret;
+
+ memset(&sVar, 0x00, sizeof(sVar));
+
+ rret = scanParamArg(prmc, prmv, "nVlanFilterBlockId", sizeof(sVar.nVlanFilterBlockId), &sVar.nVlanFilterBlockId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVlanFilterBlockId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nEntryIndex", sizeof(sVar.nEntryIndex), &sVar.nEntryIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nEntryIndex\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_VlanFilterGet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanFilterGet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_VlanFilterGet done\n");
+ printf("%40s:\t%u\n", "nVlanFilterBlockId", sVar.nVlanFilterBlockId);
+ printf("%40s:\t%u\n", "nEntryIndex", sVar.nEntryIndex);
+ printf("%40s:\t%u\n", "eVlanFilterMask", sVar.eVlanFilterMask);
+ printf("%40s:\t%u\n", "nVal", sVar.nVal);
+ printf("%40s:\t%u\n", "bDiscardMatched", sVar.bDiscardMatched);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_VlanFilterSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ unsigned char f = 0;
+ GSW_VLANFILTER_config_t sVar = {0};
+ int rret;
+
+ memset(&sVar, 0x00, sizeof(sVar));
+
+ rret = scanParamArg(prmc, prmv, "nVlanFilterBlockId", sizeof(sVar.nVlanFilterBlockId), &sVar.nVlanFilterBlockId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVlanFilterBlockId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nEntryIndex", sizeof(sVar.nEntryIndex), &sVar.nEntryIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nEntryIndex\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "eVlanFilterMask", sizeof(sVar.eVlanFilterMask), &sVar.eVlanFilterMask);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eVlanFilterMask\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nVal", sizeof(sVar.nVal), &sVar.nVal);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVal\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "bDiscardMatched", sizeof(sVar.bDiscardMatched), &sVar.bDiscardMatched);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: bDiscardMatched\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_VlanFilterSet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanFilterSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_VlanFilterSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_STP_PortCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_STP_portCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_STP_PortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_STP_PortCfgGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "nPortId", param.nPortId);
+ printf("\t%40s:\t%x\n", "ePortState", param.ePortState);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_STP_PortCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_STP_portCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "ePortState", sizeof(param.ePortState), ¶m.ePortState);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: ePortState\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_STP_PortCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_STP_PortCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_STP_PortCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_STP_BPDU_RuleGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_STP_BPDU_Rule_t param = {0};
+ int rret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_STP_BPDU_RuleGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_STP_BPDU_RuleGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "eForwardPort", param.eForwardPort);
+ printf("\t%40s:\t%x\n", "nForwardPortId", param.nForwardPortId);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_STP_BPDU_RuleSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_STP_BPDU_Rule_t param = {0};
+ int rret;
+
+ scanParamArg(prmc, prmv, "eForwardPort", sizeof(param.eForwardPort), ¶m.eForwardPort);
+ scanParamArg(prmc, prmv, "nForwardPortId", sizeof(param.nForwardPortId), ¶m.nForwardPortId);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_STP_BPDU_RuleSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_STP_BPDU_RuleSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_STP_BPDU_RuleSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_MeterCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_meterCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nMeterId", sizeof(param.nMeterId), ¶m.nMeterId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nMeterId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_MeterCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_MeterCfgGet failed with ret code", ret);
+ else
+ {
+ printf("Returned values:\n----------------\n");
+ printf("\t%40s:\t%s\n", "bEnable", (param.bEnable > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%x\n", "nMeterId", param.nMeterId);
+ printf("\t%40s:\t%x\n", "eMtrType", param.eMtrType);
+ printf("\t%40s:\t%u (0x%x)\n", "nCbs", param.nCbs, param.nCbs);
+ printf("\t%40s:\t%u (0x%x)\n", "nEbs", param.nEbs, param.nEbs);
+ printf("\t%40s:\t%u (0x%x)\n", "nRate", param.nRate, param.nRate);
+ printf("\t%40s:\t%u (0x%x)\n", "nPiRate", param.nPiRate, param.nPiRate);
+ // printf("\t%40s:\t%x\n", "cMeterName", param.cMeterName);
+ printf("\t%40s:\t%x\n", "nColourBlindMode", param.nColourBlindMode);
+ printf("\t%40s:\t%x\n", "bPktMode", param.bPktMode);
+ printf("\t%40s:\t%s\n", "bLocalOverhd", (param.bLocalOverhd > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%u (0x%x)\n", "nLocaloverhd", param.nLocaloverhd, param.nLocaloverhd);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_MeterCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_meterCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nMeterId", sizeof(param.nMeterId), ¶m.nMeterId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nMeterId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "bEnable", sizeof(param.bEnable), ¶m.bEnable);
+ scanParamArg(prmc, prmv, "eMtrType", sizeof(param.eMtrType), ¶m.eMtrType);
+ scanParamArg(prmc, prmv, "nCbs", sizeof(param.nCbs), ¶m.nCbs);
+ scanParamArg(prmc, prmv, "nEbs", sizeof(param.nEbs), ¶m.nEbs);
+ scanParamArg(prmc, prmv, "nRate", sizeof(param.nRate), ¶m.nRate);
+ scanParamArg(prmc, prmv, "nPiRate", sizeof(param.nPiRate), ¶m.nPiRate);
+ scanParamArg(prmc, prmv, "cMeterName", sizeof(param.cMeterName), ¶m.cMeterName);
+ scanParamArg(prmc, prmv, "nColourBlindMode", sizeof(param.nColourBlindMode), ¶m.nColourBlindMode);
+ scanParamArg(prmc, prmv, "bPktMode", sizeof(param.bPktMode), ¶m.bPktMode);
+ scanParamArg(prmc, prmv, "bLocalOverhd", sizeof(param.bLocalOverhd), ¶m.bLocalOverhd);
+ scanParamArg(prmc, prmv, "nLocaloverhd", sizeof(param.nLocaloverhd), ¶m.nLocaloverhd);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_MeterCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_MeterCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_MeterCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MAC_DefaultFilterGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_MACFILTER_default_t param = {0};
+ int rret, i;
+
+ rret = scanParamArg(prmc, prmv, "eType", sizeof(param.eType), ¶m.eType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eType\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_DefaultMacFilterGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_DefaultFilterGet failed with ret code", ret);
+ else
+ {
+ printf("Returned values:\n----------------\n");
+ for (i = 0; i <= 7; i++)
+ printf("\t nPortmap[%d] = 0x%x\n", i, param.nPortmap[i]);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MAC_DefaultFilterSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_MACFILTER_default_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "eType", sizeof(param.eType), ¶m.eType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eType\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_DefaultMacFilterSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_DefaultFilterSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MAC_DefaultFilterSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CTP_PortAssignmentGet(int prmc, char *prmv[])
+{
+ GSW_CTP_portAssignment_t sVar = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(sVar.nLogicalPortId), &sVar.nLogicalPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nLogicalPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CTP_PortAssignmentGet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_CTP_PortAssignmentGet failed with ret code", ret);
+ else
+ {
+ printf("\n\t nLogicalPortId = %u", sVar.nLogicalPortId);
+ printf("\n\t nFirstCtpPortId = %u", sVar.nFirstCtpPortId);
+ printf("\n\t nNumberOfCtpPort = %u", sVar.nNumberOfCtpPort);
+ printf("\n\t eMode = %u", sVar.eMode);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CTP_PortAssignmentSet(int prmc, char *prmv[])
+{
+ GSW_CTP_portAssignment_t sVar = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(sVar.nLogicalPortId), &sVar.nLogicalPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nLogicalPortId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nFirstCtpPortId", sizeof(sVar.nFirstCtpPortId), &sVar.nFirstCtpPortId);
+ scanParamArg(prmc, prmv, "nNumberOfCtpPort", sizeof(sVar.nNumberOfCtpPort), &sVar.nNumberOfCtpPort);
+ scanParamArg(prmc, prmv, "eMode", sizeof(sVar.eMode), &sVar.eMode);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CTP_PortAssignmentSet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_CTP_PortAssignmentSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_CTP_PortAssignmentSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_IG_CfgSet(int prmc, char *prmv[])
+{
+ GSW_PMAC_Ig_Cfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nTxDmaChanId", sizeof(param.nTxDmaChanId), ¶m.nTxDmaChanId);
+ scanParamArg(prmc, prmv, "bErrPktsDisc", sizeof(param.bErrPktsDisc), ¶m.bErrPktsDisc);
+ scanParamArg(prmc, prmv, "bPmapDefault", sizeof(param.bPmapDefault), ¶m.bPmapDefault);
+ scanParamArg(prmc, prmv, "bPmapEna", sizeof(param.bPmapEna), ¶m.bPmapEna);
+ scanParamArg(prmc, prmv, "bClassDefault", sizeof(param.bClassDefault), ¶m.bClassDefault);
+ scanParamArg(prmc, prmv, "bClassEna", sizeof(param.bClassEna), ¶m.bClassEna);
+ scanParamArg(prmc, prmv, "eSubId", sizeof(param.eSubId), ¶m.eSubId);
+ scanParamArg(prmc, prmv, "bSpIdDefault", sizeof(param.bSpIdDefault), ¶m.bSpIdDefault);
+ scanParamArg(prmc, prmv, "bPmacPresent", sizeof(param.bPmacPresent), ¶m.bPmacPresent);
+ scanPMAC_Arg(prmc, prmv, "defPmacHdr", param.defPmacHdr);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_IG_CfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_IG_CfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PMAC_IG_CfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_IG_CfgGet(int prmc, char *prmv[])
+{
+ GSW_PMAC_Ig_Cfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nTxDmaChanId", sizeof(param.nTxDmaChanId), ¶m.nTxDmaChanId);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_IG_CfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_IG_CfgGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "nPmacId ", param.nPmacId);
+ printf("\t%40s:\t%x\n", "nTxDmaChanId", param.nTxDmaChanId);
+ printf("\t%40s:\t%x\n", "bErrPktsDisc", param.bErrPktsDisc);
+ printf("\t%40s:\t%x\n", "bPmapDefault", param.bPmapDefault);
+ printf("\t%40s:\t%x\n", "bPmapEna", param.bPmapEna);
+ printf("\t%40s:\t%x\n", "bClassDefault", param.bClassDefault);
+ printf("\t%40s:\t%x\n", "bClassEna", param.bClassEna);
+ printf("\t%40s:\t%x\n", "eSubId ", param.eSubId);
+ printf("\t%40s:\t%x\n", "bSpIdDefault", param.bSpIdDefault);
+ printf("\t%40s:\t%x\n", "bPmacPresent", param.bPmacPresent);
+ printf("\t%40s:\t", "defPmacHdr");
+ printf("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+ param.defPmacHdr[0],
+ param.defPmacHdr[1],
+ param.defPmacHdr[2],
+ param.defPmacHdr[3],
+ param.defPmacHdr[4],
+ param.defPmacHdr[5],
+ param.defPmacHdr[6],
+ param.defPmacHdr[7]);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_EG_CfgGet(int prmc, char *prmv[])
+{
+ GSW_PMAC_Eg_Cfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nDestPortId", sizeof(param.nDestPortId), ¶m.nDestPortId);
+ scanParamArg(prmc, prmv, "bProcFlagsSelect", sizeof(param.bProcFlagsSelect), ¶m.bProcFlagsSelect);
+ scanParamArg(prmc, prmv, "nTrafficClass", sizeof(param.nTrafficClass), ¶m.nTrafficClass);
+ scanParamArg(prmc, prmv, "nFlowIDMsb", sizeof(param.nFlowIDMsb), ¶m.nFlowIDMsb);
+ scanParamArg(prmc, prmv, "bMpe1Flag", sizeof(param.bMpe1Flag), ¶m.bMpe1Flag);
+ scanParamArg(prmc, prmv, "bMpe2Flag", sizeof(param.bMpe2Flag), ¶m.bMpe2Flag);
+ scanParamArg(prmc, prmv, "bEncFlag", sizeof(param.bEncFlag), ¶m.bEncFlag);
+ scanParamArg(prmc, prmv, "bDecFlag", sizeof(param.bDecFlag), ¶m.bDecFlag);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_EG_CfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_EG_CfgGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "nPmacId ", param.nPmacId);
+ printf("\t%40s:\t%x\n", "nDestPortId", param.nDestPortId);
+ printf("\t%40s:\t%x\n", "nTrafficClass", param.nTrafficClass);
+ printf("\t%40s:\t%x\n", "bMpe1Flag", param.bMpe1Flag);
+ printf("\t%40s:\t%x\n", "bMpe2Flag", param.bMpe2Flag);
+ printf("\t%40s:\t%x\n", "bDecFlag", param.bDecFlag);
+ printf("\t%40s:\t%x\n", "bEncFlag", param.bEncFlag);
+ printf("\t%40s:\t%x\n", "nFlowIDMsb", param.nFlowIDMsb);
+ printf("\t%40s:\t%x\n", "bProcFlagsSelect", param.bProcFlagsSelect);
+ printf("\t%40s:\t%x\n", "nRxDmaChanId", param.nRxDmaChanId);
+ printf("\t%40s:\t%x\n", "bRemL2Hdr", param.bRemL2Hdr);
+ printf("\t%40s:\t%x\n", "numBytesRem", param.numBytesRem);
+ printf("\t%40s:\t%x\n", "bFcsEna ", param.bFcsEna);
+ printf("\t%40s:\t%x\n", "bPmacEna", param.bPmacEna);
+ printf("\t%40s:\t%x\n", "bRedirEnable", param.bRedirEnable);
+ printf("\t%40s:\t%x\n", "bBslSegmentDisable", param.bBslSegmentDisable);
+ printf("\t%40s:\t%x\n", "nBslTrafficClass", param.nBslTrafficClass);
+ printf("\t%40s:\t%x\n", "bResDW1Enable", param.bResDW1Enable);
+ printf("\t%40s:\t%x\n", "nResDW1", param.nResDW1);
+ printf("\t%40s:\t%x\n", "bRes1DW0Enable", param.bRes1DW0Enable);
+ printf("\t%40s:\t%x\n", "nRes1DW0", param.nRes1DW0);
+ printf("\t%40s:\t%x\n", "bRes2DW0Enable", param.bRes2DW0Enable);
+ printf("\t%40s:\t%x\n", "nRes2DW0", param.nRes2DW0);
+ printf("\t%40s:\t%x\n", "bTCEnable", param.bTCEnable);
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_EG_CfgSet(int prmc, char *prmv[])
+{
+ GSW_PMAC_Eg_Cfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "bRedirEnable", sizeof(param.bRedirEnable), ¶m.bRedirEnable);
+ scanParamArg(prmc, prmv, "bBslSegmentDisable", sizeof(param.bBslSegmentDisable), ¶m.bBslSegmentDisable);
+ scanParamArg(prmc, prmv, "nBslTrafficClass", sizeof(param.nBslTrafficClass), ¶m.nBslTrafficClass);
+ scanParamArg(prmc, prmv, "bResDW1Enable", sizeof(param.bResDW1Enable), ¶m.bResDW1Enable);
+ scanParamArg(prmc, prmv, "bRes2DW0Enable", sizeof(param.bRes2DW0Enable), ¶m.bRes2DW0Enable);
+ scanParamArg(prmc, prmv, "bRes1DW0Enable", sizeof(param.bRes1DW0Enable), ¶m.bRes1DW0Enable);
+ scanParamArg(prmc, prmv, "bTCEnable", sizeof(param.bTCEnable), ¶m.bTCEnable);
+ scanParamArg(prmc, prmv, "nDestPortId", sizeof(param.nDestPortId), ¶m.nDestPortId);
+ scanParamArg(prmc, prmv, "bProcFlagsSelect", sizeof(param.bProcFlagsSelect), ¶m.bProcFlagsSelect);
+ scanParamArg(prmc, prmv, "nTrafficClass", sizeof(param.nTrafficClass), ¶m.nTrafficClass);
+ scanParamArg(prmc, prmv, "nFlowIDMsb", sizeof(param.nFlowIDMsb), ¶m.nFlowIDMsb);
+ scanParamArg(prmc, prmv, "bMpe1Flag", sizeof(param.bMpe1Flag), ¶m.bMpe1Flag);
+ scanParamArg(prmc, prmv, "bMpe2Flag", sizeof(param.bMpe2Flag), ¶m.bMpe2Flag);
+ scanParamArg(prmc, prmv, "bEncFlag", sizeof(param.bEncFlag), ¶m.bEncFlag);
+ scanParamArg(prmc, prmv, "bDecFlag", sizeof(param.bDecFlag), ¶m.bDecFlag);
+ scanParamArg(prmc, prmv, "nRxDmaChanId", sizeof(param.nRxDmaChanId), ¶m.nRxDmaChanId);
+ scanParamArg(prmc, prmv, "bRemL2Hdr", sizeof(param.bRemL2Hdr), ¶m.bRemL2Hdr);
+ scanParamArg(prmc, prmv, "numBytesRem", sizeof(param.numBytesRem), ¶m.numBytesRem);
+ scanParamArg(prmc, prmv, "bFcsEna", sizeof(param.bFcsEna), ¶m.bFcsEna);
+ scanParamArg(prmc, prmv, "bPmacEna", sizeof(param.bPmacEna), ¶m.bPmacEna);
+ scanParamArg(prmc, prmv, "nResDW1", sizeof(param.nResDW1), ¶m.nResDW1);
+ scanParamArg(prmc, prmv, "nRes1DW0", sizeof(param.nRes1DW0), ¶m.nRes1DW0);
+ scanParamArg(prmc, prmv, "nRes2DW0", sizeof(param.nRes2DW0), ¶m.nRes2DW0);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_EG_CfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_EG_CfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PMAC_EG_CfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_BM_CfgGet(int prmc, char *prmv[])
+{
+ GSW_PMAC_BM_Cfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nTxDmaChanId", sizeof(param.nTxDmaChanId), ¶m.nTxDmaChanId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nTxDmaChanId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_BM_CfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_BM_CfgGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "nTxDmaChanId ", param.nTxDmaChanId);
+ printf("\t%40s:\t%x\n", "txQMask ", param.txQMask);
+ printf("\t%40s:\t%x\n", "rxPortMask ", param.rxPortMask);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_BM_CfgSet(int prmc, char *prmv[])
+{
+ GSW_PMAC_BM_Cfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nTxDmaChanId", sizeof(param.nTxDmaChanId), ¶m.nTxDmaChanId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nTxDmaChanId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "txQMask", sizeof(param.txQMask), ¶m.txQMask);
+ scanParamArg(prmc, prmv, "rxPortMask", sizeof(param.rxPortMask), ¶m.rxPortMask);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_BM_CfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_BM_CfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PMAC_BM_CfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_GLBL_CfgGet(int prmc, char *prmv[])
+{
+ GSW_PMAC_Glbl_Cfg_t param = {0};
+ unsigned int i = 0;
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_GLBL_CfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_GLBL_CfgGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "nPmacId", param.nPmacId);
+ printf("\t%40s:\t%x\n", "bAPadEna", param.bAPadEna);
+ printf("\t%40s:\t%x\n", "bPadEna", param.bPadEna);
+ printf("\t%40s:\t%x\n", "bVPadEna", param.bVPadEna);
+ printf("\t%40s:\t%x\n", "bSVPadEna", param.bSVPadEna);
+ printf("\t%40s:\t%x\n", "bRxFCSDis", param.bRxFCSDis);
+ printf("\t%40s:\t%x\n", "bTxFCSDis", param.bTxFCSDis);
+ printf("\t%40s:\t%x\n", "bIPTransChkRegDis", param.bIPTransChkRegDis);
+ printf("\t%40s:\t%x\n", "bIPTransChkVerDis", param.bIPTransChkVerDis);
+ printf("\t%40s:\t%x\n", "bJumboEna", param.bJumboEna);
+ printf("\t%40s:\t%u\n", "nMaxJumboLen", param.nMaxJumboLen);
+ printf("\t%40s:\t%x\n", "nJumboThreshLen", param.nJumboThreshLen);
+ printf("\t%40s:\t%x\n", "bLongFrmChkDis", param.bLongFrmChkDis);
+ printf("\t%40s:\t%x\n", "eShortFrmChkType", param.eShortFrmChkType);
+ printf("\t%40s:\t%x\n", "bProcFlagsEgCfgEna", param.bProcFlagsEgCfgEna);
+ printf("\t%40s:\t%x\n", "eProcFlagsEgCfg", param.eProcFlagsEgCfg);
+
+ for (i = 0; i <= 2; i++)
+ printf("\t%40s[%i]:\t%u\n", "nBslThreshold", i, param.nBslThreshold[i]);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_GLBL_CfgSet(int prmc, char *prmv[])
+{
+ GSW_PMAC_Glbl_Cfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_GLBL_CfgGet(gsw_dev, ¶m);
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "bRxFCSDis", sizeof(param.bRxFCSDis), ¶m.bRxFCSDis);
+ scanParamArg(prmc, prmv, "eProcFlagsEgCfg", sizeof(param.eProcFlagsEgCfg), ¶m.eProcFlagsEgCfg);
+ scanParamArg(prmc, prmv, "nBslThreshold0", sizeof(param.nBslThreshold[0]), ¶m.nBslThreshold[0]);
+ scanParamArg(prmc, prmv, "nBslThreshold1", sizeof(param.nBslThreshold[1]), ¶m.nBslThreshold[1]);
+ scanParamArg(prmc, prmv, "nBslThreshold2", sizeof(param.nBslThreshold[2]), ¶m.nBslThreshold[2]);
+ scanParamArg(prmc, prmv, "bAPadEna", sizeof(param.bAPadEna), ¶m.bAPadEna);
+ scanParamArg(prmc, prmv, "bPadEna", sizeof(param.bPadEna), ¶m.bPadEna);
+ scanParamArg(prmc, prmv, "bVPadEna", sizeof(param.bVPadEna), ¶m.bVPadEna);
+ scanParamArg(prmc, prmv, "bSVPadEna", sizeof(param.bSVPadEna), ¶m.bSVPadEna);
+ scanParamArg(prmc, prmv, "bTxFCSDis", sizeof(param.bTxFCSDis), ¶m.bTxFCSDis);
+ scanParamArg(prmc, prmv, "bIPTransChkRegDis", sizeof(param.bIPTransChkRegDis), ¶m.bIPTransChkRegDis);
+ scanParamArg(prmc, prmv, "bIPTransChkVerDis", sizeof(param.bIPTransChkVerDis), ¶m.bIPTransChkVerDis);
+ scanParamArg(prmc, prmv, "bJumboEna", sizeof(param.bJumboEna), ¶m.bJumboEna);
+ scanParamArg(prmc, prmv, "nMaxJumboLen", sizeof(param.nMaxJumboLen), ¶m.nMaxJumboLen);
+ scanParamArg(prmc, prmv, "nJumboThreshLen", sizeof(param.nJumboThreshLen), ¶m.nJumboThreshLen);
+ scanParamArg(prmc, prmv, "bLongFrmChkDis", sizeof(param.bLongFrmChkDis), ¶m.bLongFrmChkDis);
+ scanParamArg(prmc, prmv, "eShortFrmChkType", sizeof(param.eShortFrmChkType), ¶m.eShortFrmChkType);
+ scanParamArg(prmc, prmv, "bProcFlagsEgCfgEna", sizeof(param.bProcFlagsEgCfgEna), ¶m.bProcFlagsEgCfgEna);
+
+ ret = GSW_PMAC_GLBL_CfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_GLBL_CfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PMAC_GLBL_CfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PceRuleRead(int prmc, char *prmv[])
+{
+ GSW_PCE_rule_t pce_rule = {0};
+ int i;
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.pattern.nIndex), &pce_rule.pattern.nIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: pattern.nIndex\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
+ scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
+ scanParamArg(prmc, prmv, "region", sizeof(pce_rule.region), &pce_rule.region);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleRead(gsw_dev, &pce_rule);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleRead failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PceRuleRead done\n");
+
+ if (pce_rule.pattern.bEnable)
+ {
+ printf("\n\tp.nIndex = %u", pce_rule.pattern.nIndex);
+
+ if (pce_rule.pattern.bMAC_DstEnable)
+ {
+ printf("\n\tp.bMAC_DstEnable = %u", pce_rule.pattern.bMAC_DstEnable);
+ printf("\n\tp.bDstMAC_Exclude = %u", pce_rule.pattern.bDstMAC_Exclude);
+ printf("\n\tp.nMAC_Dst = ");
+
+ for (i = 0; i < 6; i++)
+ {
+ printf("%2.2x", pce_rule.pattern.nMAC_Dst[i]);
+ }
+ printf("\n\tp.nMAC_DstMask = 0x%x", pce_rule.pattern.nMAC_DstMask);
+ }
+
+ if (pce_rule.pattern.bMAC_SrcEnable)
+ {
+ printf("\n\tp.bMAC_SrcEnable = %u", pce_rule.pattern.bMAC_SrcEnable);
+ printf("\n\tp.bSrcMAC_Exclude = %u", pce_rule.pattern.bSrcMAC_Exclude);
+ printf("\n\tp.nMAC_Src = ");
+
+ for (i = 0; i < 6; i++)
+ {
+ printf("%2.2x", pce_rule.pattern.nMAC_Src[i]);
+ }
+ printf("\n\tp.nMAC_SrcMask = 0x%x", pce_rule.pattern.nMAC_SrcMask);
+ }
+
+ if (pce_rule.pattern.eDstIP_Select)
+ {
+ printf("\n\tp.eDstIP_Select = %u", pce_rule.pattern.eDstIP_Select);
+ printf("\n\tp.bDstIP_Exclude = %u", pce_rule.pattern.bDstIP_Exclude);
+
+ if (pce_rule.pattern.eDstIP_Select == GSW_PCE_IP_V4)
+ {
+ printf("\n\tp.nDstIP = 0x%x", pce_rule.pattern.nDstIP.nIPv4);
+ printf("\n\tp.nDstIP_Mask = 0x%x", pce_rule.pattern.nDstIP_Mask);
+ }
+ else if (pce_rule.pattern.eDstIP_Select == GSW_PCE_IP_V6)
+ {
+ printf("\n\tp.nDstIP = ");
+
+ for (i = 0; i < 8; i++)
+ {
+ if (i == 7)
+ printf("%x", pce_rule.pattern.nDstIP.nIPv6[i]);
+ else
+ printf("%x:", pce_rule.pattern.nDstIP.nIPv6[i]);
+ }
+ printf("\n\tp.nDstIP_Mask = 0x%x", pce_rule.pattern.nDstIP_Mask);
+ }
+ }
+
+ if (pce_rule.pattern.eInnerDstIP_Select)
+ {
+ printf("\n\tp.eInnerDstIP_Select = %u", pce_rule.pattern.eInnerDstIP_Select);
+ printf("\n\tp.bInnerDstIP_Exclude = %u", pce_rule.pattern.bInnerDstIP_Exclude);
+
+ if (pce_rule.pattern.eInnerDstIP_Select == GSW_PCE_IP_V4)
+ {
+ printf("\n\tp.nInnerDstIP = 0x%x", pce_rule.pattern.nInnerDstIP.nIPv4);
+ printf("\n\tp.nInnerDstIP_Mask = 0x%x", pce_rule.pattern.nInnerDstIP_Mask);
+ }
+ else if (pce_rule.pattern.eInnerDstIP_Select == GSW_PCE_IP_V6)
+ {
+ printf("\n\tp.nInnerDstIP = ");
+
+ for (i = 0; i < 8; i++)
+ {
+ if (i == 7)
+ printf("%x", pce_rule.pattern.nInnerDstIP.nIPv6[i]);
+ else
+ printf("%x:", pce_rule.pattern.nInnerDstIP.nIPv6[i]);
+ }
+ printf("\n\tp.nInnerDstIP_Mask = 0x%x", pce_rule.pattern.nInnerDstIP_Mask);
+ }
+ }
+
+ if (pce_rule.pattern.eSrcIP_Select)
+ {
+ printf("\n\tp.eSrcIP_Select = %u", pce_rule.pattern.eSrcIP_Select);
+ printf("\n\tp.bSrcIP_Exclude = %u", pce_rule.pattern.bSrcIP_Exclude);
+
+ if (pce_rule.pattern.eSrcIP_Select == GSW_PCE_IP_V4)
+ {
+ printf("\n\tp.nSrcIP = 0x%x", pce_rule.pattern.nSrcIP.nIPv4);
+ printf("\n\tp.nSrcIP_Mask = 0x%x", pce_rule.pattern.nSrcIP_Mask);
+ }
+ else if (pce_rule.pattern.eSrcIP_Select == GSW_PCE_IP_V6)
+ {
+ printf("\n\tp.nSrcIP = ");
+
+ for (i = 0; i < 8; i++)
+ {
+ if (i == 7)
+ printf("%x", pce_rule.pattern.nSrcIP.nIPv6[i]);
+ else
+ printf("%x:", pce_rule.pattern.nSrcIP.nIPv6[i]);
+ }
+ printf("\n\tp.nSrcIP_Mask = 0x%x", pce_rule.pattern.nSrcIP_Mask);
+ }
+ }
+
+ if (pce_rule.pattern.eInnerSrcIP_Select)
+ {
+ printf("\n\tp.eInnerSrcIP_Select = %u", pce_rule.pattern.eInnerSrcIP_Select);
+ printf("\n\tp.bInnerSrcIP_Exclude = %u", pce_rule.pattern.bInnerSrcIP_Exclude);
+
+ if (pce_rule.pattern.eInnerSrcIP_Select == GSW_PCE_IP_V4)
+ {
+ printf("\n\tp.nInnerSrcIP = 0x%x", pce_rule.pattern.nInnerSrcIP.nIPv4);
+ printf("\n\tp.nInnerSrcIP_Mask = 0x%x", pce_rule.pattern.nInnerSrcIP_Mask);
+ }
+ else if (pce_rule.pattern.eInnerSrcIP_Select == GSW_PCE_IP_V6)
+ {
+ printf("\n\tp.nInnerSrcIP = ");
+
+ for (i = 0; i < 8; i++)
+ {
+ if (i == 7)
+ printf("%x", pce_rule.pattern.nInnerSrcIP.nIPv6[i]);
+ else
+ printf("%x:", pce_rule.pattern.nInnerSrcIP.nIPv6[i]);
+ }
+ printf("\n\tp.nInnerSrcIP_Mask = 0x%x", pce_rule.pattern.nInnerSrcIP_Mask);
+ }
+ }
+
+ if (pce_rule.pattern.bVid)
+ {
+ printf("\n\tp.bVid = %u", pce_rule.pattern.bVid);
+ printf("\n\tp.bVid_Exclude = %u", pce_rule.pattern.bVid_Exclude);
+ printf("\n\tp.nVid = %u", pce_rule.pattern.nVid);
+
+ if (pce_rule.pattern.bVidRange_Select)
+ printf("\n\tp.bVidRange_Select = %u (Range Key)", pce_rule.pattern.bVidRange_Select);
+ else
+ printf("\n\tp.bVidRange_Select = %u (Mask Key)", pce_rule.pattern.bVidRange_Select);
+
+ printf("\n\tp.nVidRange = %u", pce_rule.pattern.nVidRange);
+ printf("\n\tp.bVid_Original = %u", pce_rule.pattern.bVid_Original);
+ }
+
+ if (pce_rule.pattern.bSLAN_Vid)
+ {
+ printf("\n\tp.bSLAN_Vid = %u", pce_rule.pattern.bSLAN_Vid);
+ printf("\n\tp.bSLANVid_Exclude = %u", pce_rule.pattern.bSLANVid_Exclude);
+ printf("\n\tp.nSLAN_Vid = %u", pce_rule.pattern.nSLAN_Vid);
+
+ if (pce_rule.pattern.bSVidRange_Select)
+ printf("\n\tp.bSVidRange_Select = %u (Range Key)", pce_rule.pattern.bSVidRange_Select);
+ else
+ printf("\n\tp.bSVidRange_Select = %u (Mask Key)", pce_rule.pattern.bSVidRange_Select);
+
+ printf("\n\tp.nOuterVidRange = %u", pce_rule.pattern.nOuterVidRange);
+ printf("\n\tp.bOuterVid_Original = %u", pce_rule.pattern.bOuterVid_Original);
+ }
+
+ if (pce_rule.pattern.bPortIdEnable)
+ {
+ printf("\n\tp.bPortIdEnable = %u", pce_rule.pattern.bPortIdEnable);
+ printf("\n\tp.bPortId_Exclude = %u", pce_rule.pattern.bPortId_Exclude);
+ printf("\n\tp.nPortId = %u", pce_rule.pattern.nPortId);
+ }
+
+ if (pce_rule.pattern.bSubIfIdEnable)
+ {
+ printf("\n\tp.bSubIfIdEnable = %u", pce_rule.pattern.bSubIfIdEnable);
+ printf("\n\tp.bSubIfId_Exclude = %u", pce_rule.pattern.bSubIfId_Exclude);
+ printf("\n\tp.eSubIfIdType = %u", pce_rule.pattern.eSubIfIdType);
+ printf("\n\tp.nSubIfId = %u", pce_rule.pattern.nSubIfId);
+ }
+
+ if (pce_rule.pattern.bPktLngEnable)
+ {
+ printf("\n\tp.bPktLngEnable = %u", pce_rule.pattern.bPktLngEnable);
+ printf("\n\tp.bPktLng_Exclude = %u", pce_rule.pattern.bPktLng_Exclude);
+ printf("\n\tp.nPktLng = %u", pce_rule.pattern.nPktLng);
+ printf("\n\tp.nPktLngRange = %u", pce_rule.pattern.nPktLngRange);
+ }
+
+ if (pce_rule.pattern.bPayload1_SrcEnable)
+ {
+ printf("\n\tp.bPayload1_Exclude = %u", pce_rule.pattern.bPayload1_Exclude);
+ printf("\n\tp.nPayload1 = 0x%x", pce_rule.pattern.nPayload1);
+ printf("\n\tp.bPayload1MaskRange_Select = %u", pce_rule.pattern.bPayload1MaskRange_Select);
+ printf("\n\tp.nPayload1_Mask = 0x%x", pce_rule.pattern.nPayload1_Mask);
+ }
+
+ if (pce_rule.pattern.bPayload2_SrcEnable)
+ {
+ printf("\n\tp.bPayload2_Exclude = %u", pce_rule.pattern.bPayload2_Exclude);
+ printf("\n\tp.nPayload2 = 0x%x", pce_rule.pattern.nPayload2);
+ printf("\n\tp.bPayload2MaskRange_Select = %u", pce_rule.pattern.bPayload2MaskRange_Select);
+ printf("\n\tp.nPayload2_Mask = 0x%x", pce_rule.pattern.nPayload2_Mask);
+ }
+
+ if (pce_rule.pattern.bParserFlagLSB_Enable)
+ {
+ printf("\n\tp.bParserFlagLSB_Exclude = %u", pce_rule.pattern.bParserFlagLSB_Exclude);
+ printf("\n\tp.nParserFlagLSB = 0x%x", pce_rule.pattern.nParserFlagLSB);
+ printf("\n\tp.nParserFlagLSB_Mask = 0x%x", pce_rule.pattern.nParserFlagLSB_Mask);
+ }
+
+ if (pce_rule.pattern.bParserFlagMSB_Enable)
+ {
+ printf("\n\tp.bParserFlagMSB_Exclude = %u", pce_rule.pattern.bParserFlagMSB_Exclude);
+ printf("\n\tp.nParserFlagMSB = 0x%x", pce_rule.pattern.nParserFlagMSB);
+ printf("\n\tp.nParserFlagMSB_Mask = 0x%x", pce_rule.pattern.nParserFlagMSB_Mask);
+ }
+
+ if (pce_rule.pattern.bParserFlag1LSB_Enable)
+ {
+ printf("\n\tp.bParserFlag1LSB_Exclude = %u", pce_rule.pattern.bParserFlag1LSB_Exclude);
+ printf("\n\tp.nParserFlag1LSB = 0x%x", pce_rule.pattern.nParserFlag1LSB);
+ printf("\n\tp.nParserFlag1LSB_Mask = 0x%x", pce_rule.pattern.nParserFlag1LSB_Mask);
+ }
+
+ if (pce_rule.pattern.bParserFlag1MSB_Enable)
+ {
+ printf("\n\tp.bParserFlag1MSB_Exclude = %u", pce_rule.pattern.bParserFlag1MSB_Exclude);
+ printf("\n\tp.nParserFlag1MSB = 0x%x", pce_rule.pattern.nParserFlag1MSB);
+ printf("\n\tp.nParserFlag1MSB_Mask = 0x%x", pce_rule.pattern.nParserFlag1MSB_Mask);
+ }
+
+ if (pce_rule.action.eVLAN_Action)
+ {
+ printf("\n\ta.eVLAN_Action = %u", pce_rule.action.eVLAN_Action);
+ printf("\n\ta.nVLAN_Id = %u", pce_rule.action.nVLAN_Id);
+ }
+
+ if (pce_rule.action.eSVLAN_Action)
+ {
+ printf("\n\ta.eSVLAN_Action = %u", pce_rule.action.eSVLAN_Action);
+ printf("\n\ta.nSVLAN_Id = %u", pce_rule.action.nSVLAN_Id);
+ }
+
+ if (pce_rule.action.eVLAN_CrossAction)
+ printf("\n\ta.eVLAN_CrossAction = %u", pce_rule.action.eVLAN_CrossAction);
+
+ if (pce_rule.action.bPortBitMapMuxControl)
+ printf("\n\ta.bPortBitMapMuxControl = %u", pce_rule.action.bPortBitMapMuxControl);
+
+ if (pce_rule.action.bCVLAN_Ignore_Control)
+ printf("\n\ta.bCVLAN_Ignore_Control = %u", pce_rule.action.bCVLAN_Ignore_Control);
+
+ if (pce_rule.action.eLearningAction)
+ printf("\n\ta.eLearningAction = %u", pce_rule.action.eLearningAction);
+
+ if (pce_rule.action.eSnoopingTypeAction)
+ printf("\n\ta.eSnoopingTypeAction = %u", pce_rule.action.eSnoopingTypeAction);
+
+ if (pce_rule.pattern.bEtherTypeEnable)
+ {
+ printf("\n\tp.bEtherType_Exclude = 0x%x", pce_rule.pattern.bEtherType_Exclude);
+ printf("\n\tp.nEtherType = 0x%x", pce_rule.pattern.nEtherType);
+ printf("\n\tp.nEtherTypeMask = 0x%x", pce_rule.pattern.nEtherTypeMask);
+ }
+
+ if (pce_rule.pattern.bProtocolEnable)
+ {
+ printf("\n\tp.bProtocol_Exclude = 0x%x", pce_rule.pattern.bProtocol_Exclude);
+ printf("\n\tp.nProtocol = 0x%x", pce_rule.pattern.nProtocol);
+ printf("\n\tp.nProtocolMask = 0x%x", pce_rule.pattern.nProtocolMask);
+ }
+
+ if (pce_rule.pattern.bInnerProtocolEnable)
+ {
+ printf("\n\tp.bInnerProtocol_Exclude = 0x%x", pce_rule.pattern.bInnerProtocol_Exclude);
+ printf("\n\tp.nInnerProtocol = 0x%x", pce_rule.pattern.nInnerProtocol);
+ printf("\n\tp.nInnerProtocolMask = 0x%x", pce_rule.pattern.nInnerProtocolMask);
+ }
+
+ if (pce_rule.pattern.bSessionIdEnable)
+ {
+ printf("\n\tp.bSessionIdEnable = 0x%x", pce_rule.pattern.bSessionIdEnable);
+ printf("\n\tp.bSessionId_Exclude = 0x%x", pce_rule.pattern.bSessionId_Exclude);
+ printf("\n\tp.nSessionId = 0x%x", pce_rule.pattern.nSessionId);
+ }
+
+ if (pce_rule.pattern.bPPP_ProtocolEnable)
+ {
+ printf("\n\tp.bPPP_Protocol_Exclude = 0x%x", pce_rule.pattern.bPPP_Protocol_Exclude);
+ printf("\n\tp.nPPP_Protocol = 0x%x", pce_rule.pattern.nPPP_Protocol);
+ printf("\n\tp.nPPP_ProtocolMask = 0x%x", pce_rule.pattern.nPPP_ProtocolMask);
+ }
+
+ if (pce_rule.pattern.bAppDataMSB_Enable)
+ {
+ printf("\n\tp.bAppMSB_Exclude = 0x%x", pce_rule.pattern.bAppMSB_Exclude);
+ printf("\n\tp.nAppDataMSB = 0x%x", pce_rule.pattern.nAppDataMSB);
+ printf("\n\tp.bAppMaskRangeMSB_Select = %u", pce_rule.pattern.bAppMaskRangeMSB_Select);
+ printf("\n\tp.nAppMaskRangeMSB = 0x%x", pce_rule.pattern.nAppMaskRangeMSB);
+ }
+
+ if (pce_rule.pattern.bAppDataLSB_Enable)
+ {
+ printf("\n\tp.bAppLSB_Exclude = 0x%x", pce_rule.pattern.bAppLSB_Exclude);
+ printf("\n\tp.nAppDataLSB = 0x%x", pce_rule.pattern.nAppDataLSB);
+ printf("\n\tp.bAppMaskRangeLSB_Select = %u", pce_rule.pattern.bAppMaskRangeLSB_Select);
+ printf("\n\tp.nAppMaskRangeLSB = 0x%x", pce_rule.pattern.nAppMaskRangeLSB);
+ }
+
+ if (pce_rule.pattern.bDSCP_Enable)
+ {
+ printf("\n\tp.bDSCP_Exclude = %u", pce_rule.pattern.bDSCP_Exclude);
+ printf("\n\tp.nDSCP = %u", pce_rule.pattern.nDSCP);
+ }
+
+ if (pce_rule.pattern.bInner_DSCP_Enable)
+ {
+ printf("\n\tp.bInnerDSCP_Exclude = %u", pce_rule.pattern.bInnerDSCP_Exclude);
+ printf("\n\tp.nInnerDSCP = %u", pce_rule.pattern.nInnerDSCP);
+ }
+
+ if (pce_rule.action.bRemarkAction)
+ printf("\n\ta.bRemarkAction = Enabled val = %u", pce_rule.action.bRemarkAction);
+
+ if (pce_rule.action.bRemarkPCP)
+ printf("\n\ta.bRemarkPCP = Disabled val = %u", pce_rule.action.bRemarkPCP);
+
+ if (pce_rule.action.bRemarkDSCP)
+ printf("\n\ta.bRemarkDSCP = Disabled val = %u", pce_rule.action.bRemarkDSCP);
+
+ if (pce_rule.action.bRemarkClass)
+ printf("\n\ta.bRemarkClass = Disabled val = %u", pce_rule.action.bRemarkClass);
+
+ if (pce_rule.action.bRemarkSTAG_PCP)
+ printf("\n\ta.bRemarkSTAG_PCP = Disabled val = %u", pce_rule.action.bRemarkSTAG_PCP);
+
+ if (pce_rule.action.bRemarkSTAG_DEI)
+ printf("\n\ta.bRemarkSTAG_DEI = Disabled val = %u", pce_rule.action.bRemarkSTAG_DEI);
+
+ if ((pce_rule.action.bRMON_Action) || (pce_rule.action.bFlowID_Action))
+ {
+ printf("\n\ta.nFlowID/nRmon_ID = %u", pce_rule.action.nFlowID);
+ }
+
+ if (pce_rule.pattern.bPCP_Enable)
+ {
+ printf("\n\tp.bPCP_Enable = %u", pce_rule.pattern.bPCP_Enable);
+ printf("\n\tp.bCTAG_PCP_DEI_Exclude = %u", pce_rule.pattern.bCTAG_PCP_DEI_Exclude);
+ printf("\n\tp.nPCP = %u", pce_rule.pattern.nPCP);
+ }
+
+ if (pce_rule.pattern.bSTAG_PCP_DEI_Enable)
+ {
+ printf("\n\tp.bSTAG_PCP_DEI_Enable = %u", pce_rule.pattern.bSTAG_PCP_DEI_Enable);
+ printf("\n\tp.bSTAG_PCP_DEI_Exclude = %u", pce_rule.pattern.bSTAG_PCP_DEI_Exclude);
+ printf("\n\tp.nSTAG_PCP_DEI = %u", pce_rule.pattern.nSTAG_PCP_DEI);
+ }
+
+ if (pce_rule.action.ePortMapAction)
+ {
+ printf("\n\ta.ePortMapAction = 0x%x", pce_rule.action.ePortMapAction);
+
+ for (i = 0; i < 8; i++)
+ {
+ if (pce_rule.action.nForwardPortMap[i])
+ printf("\n\ta.nForwardPortMap[%d] = 0x%x", i, pce_rule.action.nForwardPortMap[i]);
+ }
+ }
+
+ if (pce_rule.action.eTrafficClassAction)
+ {
+ printf("\n\ta.eTrafficClassAction = %u", pce_rule.action.eTrafficClassAction);
+ printf("\n\ta.nTrafficClassAlternate = %u", pce_rule.action.nTrafficClassAlternate);
+ }
+
+ if (pce_rule.action.bPortTrunkAction)
+ {
+ printf("\n\ta.bPortTrunkAction = Enabled");
+ printf("\n\ta.bPortLinkSelection = %u", pce_rule.action.bPortLinkSelection);
+ }
+
+ if (pce_rule.action.bExtendedVlanEnable)
+ {
+ printf("\n\ta.bExtendedVlanEnable = Enabled");
+ printf("\n\ta.nExtendedVlanBlockId = %u", pce_rule.action.nExtendedVlanBlockId);
+ }
+
+ if (pce_rule.action.ePortFilterType_Action)
+ {
+ printf("\n\ta.ePortFilterType_Action = %u", pce_rule.action.ePortFilterType_Action);
+
+ for (i = 0; i < 8; i++)
+ {
+ if (pce_rule.action.nForwardPortMap[i])
+ printf("\n\ta.nForwardPortMap[%d] = 0x%x", i, pce_rule.action.nForwardPortMap[i]);
+ }
+ }
+
+ if (pce_rule.action.eProcessPath_Action)
+ printf("\n\ta.eProcessPath_Action = %u", pce_rule.action.eProcessPath_Action);
+
+ if (pce_rule.action.bOamEnable)
+ printf("\n\ta.bOamEnable = %u", pce_rule.action.bOamEnable);
+
+ if (pce_rule.action.bExtractEnable)
+ printf("\n\ta.bExtractEnable = %u", pce_rule.action.bExtractEnable);
+
+ if (pce_rule.action.bOamEnable || pce_rule.action.bExtractEnable)
+ printf("\n\ta.nRecordId = %u", pce_rule.action.nRecordId);
+
+ if (pce_rule.action.eColorFrameAction != GSW_PCE_ACTION_COLOR_FRAME_DISABLE)
+ printf("\n\ta.eColorFrameAction = %u", pce_rule.action.eColorFrameAction);
+
+ if (pce_rule.action.eMeterAction)
+ {
+ printf("\n\ta.eMeterAction = %u", pce_rule.action.eMeterAction);
+ printf("\n\ta.nMeterId = %u", pce_rule.action.nMeterId);
+ }
+
+ if (pce_rule.action.bFidEnable)
+ printf("\n\ta.nFId = %u", pce_rule.action.nFId);
+
+ if (pce_rule.pattern.bInsertionFlag_Enable)
+ printf("\n\tp.nInsertionFlag = %u", pce_rule.pattern.nInsertionFlag);
+
+ if (pce_rule.action.eCrossStateAction == GSW_PCE_ACTION_CROSS_STATE_CROSS)
+ printf("\n\tp.eCrossStateAction = GSW_PCE_ACTION_CROSS_STATE_CROSS");
+ else if (pce_rule.action.eCrossStateAction == GSW_PCE_ACTION_CROSS_STATE_REGULAR)
+ printf("\n\tp.eCrossStateAction = GSW_PCE_ACTION_CROSS_STATE_REGULAR");
+ else
+ printf("\n\tp.eCrossStateAction = GSW_PCE_ACTION_CROSS_STATE_DISABLE");
+
+ /*Applicable only for GSWIP 3.2*/
+ if (pce_rule.pattern.bFlexibleField4Enable)
+ {
+ printf("\n\tp.bFlexibleField4_ExcludeEnable = %u", pce_rule.pattern.bFlexibleField4_ExcludeEnable);
+ printf("\n\tp.bFlexibleField4_RangeEnable = %u", pce_rule.pattern.bFlexibleField4_RangeEnable);
+ printf("\n\tp.nFlexibleField4_ParserIndex = %u", pce_rule.pattern.nFlexibleField4_ParserIndex);
+ printf("\n\tp.nFlexibleField4_Value = %u", pce_rule.pattern.nFlexibleField4_Value);
+ printf("\n\tp.nFlexibleField4_MaskOrRange = %u", pce_rule.pattern.nFlexibleField4_MaskOrRange);
+ }
+
+ if (pce_rule.pattern.bFlexibleField3Enable)
+ {
+ printf("\n\tp.bFlexibleField3_ExcludeEnable = %u", pce_rule.pattern.bFlexibleField3_ExcludeEnable);
+ printf("\n\tp.bFlexibleField3_RangeEnable = %u", pce_rule.pattern.bFlexibleField3_RangeEnable);
+ printf("\n\tp.nFlexibleField3_ParserIndex = %u", pce_rule.pattern.nFlexibleField3_ParserIndex);
+ printf("\n\tp.nFlexibleField3_Value = %u", pce_rule.pattern.nFlexibleField3_Value);
+ printf("\n\tp.nFlexibleField3_MaskOrRange = %u", pce_rule.pattern.nFlexibleField3_MaskOrRange);
+ }
+
+ if (pce_rule.pattern.bFlexibleField2Enable)
+ {
+ printf("\n\tp.bFlexibleField2_ExcludeEnable = %u", pce_rule.pattern.bFlexibleField2_ExcludeEnable);
+ printf("\n\tp.bFlexibleField2_RangeEnable = %u", pce_rule.pattern.bFlexibleField2_RangeEnable);
+ printf("\n\tp.nFlexibleField2_ParserIndex = %u", pce_rule.pattern.nFlexibleField2_ParserIndex);
+ printf("\n\tp.nFlexibleField2_Value = %u", pce_rule.pattern.nFlexibleField2_Value);
+ printf("\n\tp.nFlexibleField2_MaskOrRange = %u", pce_rule.pattern.nFlexibleField2_MaskOrRange);
+ }
+
+ if (pce_rule.pattern.bFlexibleField1Enable)
+ {
+ printf("\n\tp.bFlexibleField1_ExcludeEnable = %u", pce_rule.pattern.bFlexibleField1_ExcludeEnable);
+ printf("\n\tp.bFlexibleField1_RangeEnable = %u", pce_rule.pattern.bFlexibleField1_RangeEnable);
+ printf("\n\tp.nFlexibleField1_ParserIndex = %u", pce_rule.pattern.nFlexibleField1_ParserIndex);
+ printf("\n\tp.nFlexibleField1_Value = %u", pce_rule.pattern.nFlexibleField1_Value);
+ printf("\n\tp.nFlexibleField1_MaskOrRange = %u", pce_rule.pattern.nFlexibleField1_MaskOrRange);
+ }
+
+ if (pce_rule.action.sPBB_Action.bIheaderActionEnable)
+ {
+ printf("\n\ta.sPBB_Action.bIheaderActionEnable = %u", pce_rule.action.sPBB_Action.bIheaderActionEnable);
+
+ switch (pce_rule.action.sPBB_Action.eIheaderOpMode)
+ {
+ case GSW_PCE_I_HEADER_OPERATION_INSERT:
+ printf("\n\ta.sPBB_Action.eIheaderOpMode = GSW_PCE_I_HEADER_OPERATION_INSERT");
+ printf("\n\ta.sPBB_Action.nTunnelIdKnownTraffic = %u", pce_rule.action.sPBB_Action.nTunnelIdKnownTraffic);
+ printf("\n\ta.sPBB_Action.nTunnelIdUnKnownTraffic = %u", pce_rule.action.sPBB_Action.nTunnelIdUnKnownTraffic);
+ printf("\n\ta.sPBB_Action.bB_DstMac_FromMacTableEnable = %u", pce_rule.action.sPBB_Action.bB_DstMac_FromMacTableEnable);
+ break;
+
+ case GSW_PCE_I_HEADER_OPERATION_REPLACE:
+ printf("\n\ta.sPBB_Action.eIheaderOpMode = GSW_PCE_I_HEADER_OPERATION_REPLACE");
+ printf("\n\ta.sPBB_Action.nTunnelIdKnownTraffic = %u", pce_rule.action.sPBB_Action.nTunnelIdKnownTraffic);
+ printf("\n\ta.sPBB_Action.nTunnelIdUnKnownTraffic = %u", pce_rule.action.sPBB_Action.nTunnelIdUnKnownTraffic);
+ printf("\n\ta.sPBB_Action.bReplace_B_SrcMacEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_SrcMacEnable);
+ printf("\n\ta.sPBB_Action.bReplace_B_DstMacEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_DstMacEnable);
+ printf("\n\ta.sPBB_Action.bReplace_I_TAG_ResEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_ResEnable);
+ printf("\n\ta.sPBB_Action.bReplace_I_TAG_UacEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_UacEnable);
+ printf("\n\ta.sPBB_Action.bReplace_I_TAG_DeiEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_DeiEnable);
+ printf("\n\ta.sPBB_Action.bReplace_I_TAG_PcpEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_PcpEnable);
+ printf("\n\ta.sPBB_Action.bReplace_I_TAG_SidEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_SidEnable);
+ printf("\n\ta.sPBB_Action.bReplace_I_TAG_TpidEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_TpidEnable);
+ break;
+
+ case GSW_PCE_I_HEADER_OPERATION_REMOVE:
+ printf("\n\ta.sPBB_Action.eIheaderOpMode = GSW_PCE_I_HEADER_OPERATION_REMOVE");
+ break;
+
+ case GSW_PCE_I_HEADER_OPERATION_NOCHANGE:
+ printf("\n\ta.sPBB_Action.eIheaderOpMode = GSW_PCE_I_HEADER_OPERATION_NOCHANGE");
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ /*Applicable only for GSWIP 3.2*/
+ if (pce_rule.action.sPBB_Action.bBtagActionEnable)
+ {
+ printf("\n\ta.sPBB_Action.bBtagActionEnable = %u", pce_rule.action.sPBB_Action.bBtagActionEnable);
+
+ switch (pce_rule.action.sPBB_Action.eBtagOpMode)
+ {
+ case GSW_PCE_B_TAG_OPERATION_INSERT:
+ printf("\n\ta.sPBB_Action.eBtagOpMode = GSW_PCE_B_TAG_OPERATION_INSERT");
+ printf("\n\ta.sPBB_Action.nProcessIdKnownTraffic = %u", pce_rule.action.sPBB_Action.nProcessIdKnownTraffic);
+ printf("\n\ta.sPBB_Action.nProcessIdUnKnownTraffic = %u", pce_rule.action.sPBB_Action.nProcessIdUnKnownTraffic);
+ break;
+
+ case GSW_PCE_B_TAG_OPERATION_REPLACE:
+ printf("\n\ta.sPBB_Action.eBtagOpMode = GSW_PCE_B_TAG_OPERATION_REPLACE");
+ printf("\n\ta.sPBB_Action.nProcessIdKnownTraffic = %u", pce_rule.action.sPBB_Action.nProcessIdKnownTraffic);
+ printf("\n\ta.sPBB_Action.nProcessIdUnKnownTraffic = %u", pce_rule.action.sPBB_Action.nProcessIdUnKnownTraffic);
+ printf("\n\ta.sPBB_Action.bReplace_B_TAG_DeiEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_TAG_DeiEnable);
+ printf("\n\ta.sPBB_Action.bReplace_B_TAG_PcpEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_TAG_PcpEnable);
+ printf("\n\ta.sPBB_Action.bReplace_B_TAG_VidEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_TAG_VidEnable);
+ printf("\n\ta.sPBB_Action.bReplace_B_TAG_TpidEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_TAG_TpidEnable);
+ break;
+
+ case GSW_PCE_B_TAG_OPERATION_REMOVE:
+ printf("\n\ta.sPBB_Action.eBtagOpMode = GSW_PCE_B_TAG_OPERATION_REMOVE");
+ break;
+
+ case GSW_PCE_B_TAG_OPERATION_NOCHANGE:
+ printf("\n\ta.sPBB_Action.eBtagOpMode = GSW_PCE_B_TAG_OPERATION_NOCHANGE");
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ /*Applicable only for GSWIP 3.2*/
+ if (pce_rule.action.sPBB_Action.bMacTableMacinMacActionEnable)
+ {
+ printf("\n\ta.sPBB_Action.bMacTableMacinMacActionEnable = %u", pce_rule.action.sPBB_Action.bMacTableMacinMacActionEnable);
+
+ switch (pce_rule.action.sPBB_Action.eMacTableMacinMacSelect)
+ {
+ case GSW_PCE_OUTER_MAC_SELECTED:
+ printf("\n\ta.sPBB_Action.eMacTableMacinMacSelect = GSW_PCE_OUTER_MAC_SELECTED");
+ break;
+
+ case GSW_PCE_INNER_MAC_SELECTED:
+ printf("\n\ta.sPBB_Action.eMacTableMacinMacSelect = GSW_PCE_INNER_MAC_SELECTED");
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (pce_rule.action.bDestSubIf_Action_Enable)
+ {
+ printf("\n\ta.sDestSubIF_Action.bDestSubIFIDActionEnable = %u", pce_rule.action.sDestSubIF_Action.bDestSubIFIDActionEnable);
+ printf("\n\ta.sDestSubIF_Action.bDestSubIFIDAssignmentEnable = %u", pce_rule.action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable);
+ printf("\n\ta.sDestSubIF_Action.nDestSubIFGrp_Field = %u", pce_rule.action.sDestSubIF_Action.nDestSubIFGrp_Field);
+ }
+ }
+ else
+ {
+ printf("\n\tp.nIndex rule not set at = %u", pce_rule.pattern.nIndex);
+ }
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PceRuleWrite(int prmc, char *prmv[])
+{
+ GSW_PCE_rule_t pce_rule = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ memset(&pce_rule, 0, sizeof(GSW_PCE_rule_t));
+
+ rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nLogicalPortId\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.pattern.nIndex), &pce_rule.pattern.nIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: pattern.nIndex\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
+ scanParamArg(prmc, prmv, "region", sizeof(pce_rule.region), &pce_rule.region);
+
+ scanParamArg(prmc, prmv, "pattern.bEnable", sizeof(pce_rule.pattern.bEnable), &pce_rule.pattern.bEnable);
+ scanParamArg(prmc, prmv, "pattern.bPortIdEnable", sizeof(pce_rule.pattern.bPortIdEnable), &pce_rule.pattern.bPortIdEnable);
+ scanParamArg(prmc, prmv, "pattern.nPortId", sizeof(pce_rule.pattern.nPortId), &pce_rule.pattern.nPortId);
+ scanParamArg(prmc, prmv, "pattern.bPortId_Exclude", sizeof(pce_rule.pattern.bPortId_Exclude), &pce_rule.pattern.bPortId_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bSubIfIdEnable", sizeof(pce_rule.pattern.bSubIfIdEnable), &pce_rule.pattern.bSubIfIdEnable);
+ scanParamArg(prmc, prmv, "pattern.nSubIfId", sizeof(pce_rule.pattern.nSubIfId), &pce_rule.pattern.nSubIfId);
+ scanParamArg(prmc, prmv, "pattern.eSubIfIdType", sizeof(pce_rule.pattern.eSubIfIdType), &pce_rule.pattern.eSubIfIdType);
+ scanParamArg(prmc, prmv, "pattern.bSubIfId_Exclude", sizeof(pce_rule.pattern.bSubIfId_Exclude), &pce_rule.pattern.bSubIfId_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bInsertionFlag_Enable", sizeof(pce_rule.pattern.bInsertionFlag_Enable), &pce_rule.pattern.bInsertionFlag_Enable);
+ scanParamArg(prmc, prmv, "pattern.nInsertionFlag", sizeof(pce_rule.pattern.nInsertionFlag), &pce_rule.pattern.nInsertionFlag);
+ scanParamArg(prmc, prmv, "pattern.bDSCP_Enable", sizeof(pce_rule.pattern.bDSCP_Enable), &pce_rule.pattern.bDSCP_Enable);
+ scanParamArg(prmc, prmv, "pattern.nDSCP", sizeof(pce_rule.pattern.nDSCP), &pce_rule.pattern.nDSCP);
+ scanParamArg(prmc, prmv, "pattern.bDSCP_Exclude", sizeof(pce_rule.pattern.bDSCP_Exclude), &pce_rule.pattern.bDSCP_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bInner_DSCP_Enable", sizeof(pce_rule.pattern.bInner_DSCP_Enable), &pce_rule.pattern.bInner_DSCP_Enable);
+ scanParamArg(prmc, prmv, "pattern.nInnerDSCP", sizeof(pce_rule.pattern.nInnerDSCP), &pce_rule.pattern.nInnerDSCP);
+ scanParamArg(prmc, prmv, "pattern.bInnerDSCP_Exclude", sizeof(pce_rule.pattern.bInnerDSCP_Exclude), &pce_rule.pattern.bInnerDSCP_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bPCP_Enable", sizeof(pce_rule.pattern.bPCP_Enable), &pce_rule.pattern.bPCP_Enable);
+ scanParamArg(prmc, prmv, "pattern.nPCP", sizeof(pce_rule.pattern.nPCP), &pce_rule.pattern.nPCP);
+ scanParamArg(prmc, prmv, "pattern.bCTAG_PCP_DEI_Exclude", sizeof(pce_rule.pattern.bCTAG_PCP_DEI_Exclude), &pce_rule.pattern.bCTAG_PCP_DEI_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bSTAG_PCP_DEI_Enable", sizeof(pce_rule.pattern.bSTAG_PCP_DEI_Enable), &pce_rule.pattern.bSTAG_PCP_DEI_Enable);
+ scanParamArg(prmc, prmv, "pattern.nSTAG_PCP_DEI", sizeof(pce_rule.pattern.nSTAG_PCP_DEI), &pce_rule.pattern.nSTAG_PCP_DEI);
+ scanParamArg(prmc, prmv, "pattern.bSTAG_PCP_DEI_Exclude", sizeof(pce_rule.pattern.bSTAG_PCP_DEI_Exclude), &pce_rule.pattern.bSTAG_PCP_DEI_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bPktLngEnable", sizeof(pce_rule.pattern.bPktLngEnable), &pce_rule.pattern.bPktLngEnable);
+ scanParamArg(prmc, prmv, "pattern.nPktLng", sizeof(pce_rule.pattern.nPktLng), &pce_rule.pattern.nPktLng);
+ scanParamArg(prmc, prmv, "pattern.nPktLngRange", sizeof(pce_rule.pattern.nPktLngRange), &pce_rule.pattern.nPktLngRange);
+ scanParamArg(prmc, prmv, "pattern.bPktLng_Exclude", sizeof(pce_rule.pattern.bPktLng_Exclude), &pce_rule.pattern.bPktLng_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bMAC_DstEnable", sizeof(pce_rule.pattern.bMAC_DstEnable), &pce_rule.pattern.bMAC_DstEnable);
+ scanMAC_Arg(prmc, prmv, "pattern.nMAC_Dst", pce_rule.pattern.nMAC_Dst);
+ scanParamArg(prmc, prmv, "pattern.nMAC_DstMask", sizeof(pce_rule.pattern.nMAC_DstMask), &pce_rule.pattern.nMAC_DstMask);
+ scanParamArg(prmc, prmv, "pattern.bDstMAC_Exclude", sizeof(pce_rule.pattern.bDstMAC_Exclude), &pce_rule.pattern.bDstMAC_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bMAC_SrcEnable", sizeof(pce_rule.pattern.bMAC_SrcEnable), &pce_rule.pattern.bMAC_SrcEnable);
+ scanMAC_Arg(prmc, prmv, "pattern.nMAC_Src", pce_rule.pattern.nMAC_Src);
+ scanParamArg(prmc, prmv, "pattern.nMAC_SrcMask", sizeof(pce_rule.pattern.nMAC_SrcMask), &pce_rule.pattern.nMAC_SrcMask);
+ scanParamArg(prmc, prmv, "pattern.bSrcMAC_Exclude", sizeof(pce_rule.pattern.bSrcMAC_Exclude), &pce_rule.pattern.bSrcMAC_Exclude);
+ scanParamArg(prmc, prmv, "pattern.bAppDataMSB_Enable", sizeof(pce_rule.pattern.bAppDataMSB_Enable), &pce_rule.pattern.bAppDataMSB_Enable);
+ scanParamArg(prmc, prmv, "pattern.nAppDataMSB", sizeof(pce_rule.pattern.nAppDataMSB), &pce_rule.pattern.nAppDataMSB);
+ scanParamArg(prmc, prmv, "pattern.bAppMaskRangeMSB_Select", sizeof(pce_rule.pattern.bAppMaskRangeMSB_Select), &pce_rule.pattern.bAppMaskRangeMSB_Select);
+ scanParamArg(prmc, prmv, "pattern.nAppMaskRangeMSB", sizeof(pce_rule.pattern.nAppMaskRangeMSB), &pce_rule.pattern.nAppMaskRangeMSB);
+ scanParamArg(prmc, prmv, "pattern.bAppMSB_Exclude", sizeof(pce_rule.pattern.bAppMSB_Exclude), &pce_rule.pattern.bAppMSB_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bAppDataLSB_Enable", sizeof(pce_rule.pattern.bAppDataLSB_Enable), &pce_rule.pattern.bAppDataLSB_Enable);
+ scanParamArg(prmc, prmv, "pattern.nAppDataLSB", sizeof(pce_rule.pattern.nAppDataLSB), &pce_rule.pattern.nAppDataLSB);
+ scanParamArg(prmc, prmv, "pattern.bAppMaskRangeLSB_Select", sizeof(pce_rule.pattern.bAppMaskRangeLSB_Select), &pce_rule.pattern.bAppMaskRangeLSB_Select);
+ scanParamArg(prmc, prmv, "pattern.nAppMaskRangeLSB", sizeof(pce_rule.pattern.nAppMaskRangeLSB), &pce_rule.pattern.nAppMaskRangeLSB);
+ scanParamArg(prmc, prmv, "pattern.bAppLSB_Exclude", sizeof(pce_rule.pattern.bAppLSB_Exclude), &pce_rule.pattern.bAppLSB_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.eDstIP_Select", sizeof(pce_rule.pattern.eDstIP_Select), &pce_rule.pattern.eDstIP_Select);
+ if (pce_rule.pattern.eDstIP_Select == GSW_PCE_IP_V4)
+ scanIPv4_Arg(prmc, prmv, "pattern.nDstIP", &pce_rule.pattern.nDstIP.nIPv4);
+ else if (pce_rule.pattern.eDstIP_Select == GSW_PCE_IP_V6)
+ scanIPv6_Arg(prmc, prmv, "pattern.nDstIP", pce_rule.pattern.nDstIP.nIPv6);
+
+ scanParamArg(prmc, prmv, "pattern.nDstIP_Mask", sizeof(pce_rule.pattern.nDstIP_Mask), &pce_rule.pattern.nDstIP_Mask);
+ scanParamArg(prmc, prmv, "pattern.bDstIP_Exclude", sizeof(pce_rule.pattern.bDstIP_Exclude), &pce_rule.pattern.bDstIP_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.eInnerDstIP_Select", sizeof(pce_rule.pattern.eInnerDstIP_Select), &pce_rule.pattern.eInnerDstIP_Select);
+ if (pce_rule.pattern.eInnerDstIP_Select == GSW_PCE_IP_V4)
+ scanIPv4_Arg(prmc, prmv, "pattern.nInnerDstIP", &pce_rule.pattern.nInnerDstIP.nIPv4);
+ else if (pce_rule.pattern.eInnerDstIP_Select == GSW_PCE_IP_V6)
+ scanIPv6_Arg(prmc, prmv, "pattern.nInnerDstIP", pce_rule.pattern.nInnerDstIP.nIPv6);
+
+ scanParamArg(prmc, prmv, "pattern.nInnerDstIP_Mask", sizeof(pce_rule.pattern.nInnerDstIP_Mask), &pce_rule.pattern.nInnerDstIP_Mask);
+ scanParamArg(prmc, prmv, "pattern.bInnerDstIP_Exclude", sizeof(pce_rule.pattern.bInnerDstIP_Exclude), &pce_rule.pattern.bInnerDstIP_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.eSrcIP_Select", sizeof(pce_rule.pattern.eSrcIP_Select), &pce_rule.pattern.eSrcIP_Select);
+ if (pce_rule.pattern.eSrcIP_Select == GSW_PCE_IP_V4)
+ scanIPv4_Arg(prmc, prmv, "pattern.nSrcIP", &pce_rule.pattern.nSrcIP.nIPv4);
+ else if (pce_rule.pattern.eSrcIP_Select == GSW_PCE_IP_V6)
+ scanIPv6_Arg(prmc, prmv, "pattern.nSrcIP", pce_rule.pattern.nSrcIP.nIPv6);
+
+ scanParamArg(prmc, prmv, "pattern.nSrcIP_Mask", sizeof(pce_rule.pattern.nSrcIP_Mask), &pce_rule.pattern.nSrcIP_Mask);
+ scanParamArg(prmc, prmv, "pattern.bSrcIP_Exclude", sizeof(pce_rule.pattern.bSrcIP_Exclude), &pce_rule.pattern.bSrcIP_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.eInnerSrcIP_Select", sizeof(pce_rule.pattern.eInnerSrcIP_Select), &pce_rule.pattern.eInnerSrcIP_Select);
+ if (pce_rule.pattern.eInnerSrcIP_Select == GSW_PCE_IP_V4)
+ scanIPv4_Arg(prmc, prmv, "pattern.nInnerSrcIP", &pce_rule.pattern.nInnerSrcIP.nIPv4);
+ else if (pce_rule.pattern.eInnerSrcIP_Select == GSW_PCE_IP_V6)
+ scanIPv6_Arg(prmc, prmv, "pattern.nInnerSrcIP", pce_rule.pattern.nInnerSrcIP.nIPv6);
+
+ scanParamArg(prmc, prmv, "pattern.nInnerSrcIP_Mask", sizeof(pce_rule.pattern.nInnerSrcIP_Mask), &pce_rule.pattern.nInnerSrcIP_Mask);
+ scanParamArg(prmc, prmv, "pattern.bInnerSrcIP_Exclude", sizeof(pce_rule.pattern.bInnerSrcIP_Exclude), &pce_rule.pattern.bInnerSrcIP_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bEtherTypeEnable", sizeof(pce_rule.pattern.bEtherTypeEnable), &pce_rule.pattern.bEtherTypeEnable);
+ scanParamArg(prmc, prmv, "pattern.nEtherType", sizeof(pce_rule.pattern.nEtherType), &pce_rule.pattern.nEtherType);
+ scanParamArg(prmc, prmv, "pattern.nEtherTypeMask", sizeof(pce_rule.pattern.nEtherTypeMask), &pce_rule.pattern.nEtherTypeMask);
+ scanParamArg(prmc, prmv, "pattern.bEtherType_Exclude", sizeof(pce_rule.pattern.bEtherType_Exclude), &pce_rule.pattern.bEtherType_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bProtocolEnable", sizeof(pce_rule.pattern.bProtocolEnable), &pce_rule.pattern.bProtocolEnable);
+ scanParamArg(prmc, prmv, "pattern.nProtocol", sizeof(pce_rule.pattern.nProtocol), &pce_rule.pattern.nProtocol);
+ scanParamArg(prmc, prmv, "pattern.nProtocolMask", sizeof(pce_rule.pattern.nProtocolMask), &pce_rule.pattern.nProtocolMask);
+ scanParamArg(prmc, prmv, "pattern.bProtocol_Exclude", sizeof(pce_rule.pattern.bProtocol_Exclude), &pce_rule.pattern.bProtocol_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bInnerProtocolEnable", sizeof(pce_rule.pattern.bInnerProtocolEnable), &pce_rule.pattern.bInnerProtocolEnable);
+ scanParamArg(prmc, prmv, "pattern.nInnerProtocol", sizeof(pce_rule.pattern.nInnerProtocol), &pce_rule.pattern.nInnerProtocol);
+ scanParamArg(prmc, prmv, "pattern.nInnerProtocolMask", sizeof(pce_rule.pattern.nInnerProtocolMask), &pce_rule.pattern.nInnerProtocolMask);
+ scanParamArg(prmc, prmv, "pattern.bInnerProtocol_Exclude", sizeof(pce_rule.pattern.bInnerProtocol_Exclude), &pce_rule.pattern.bInnerProtocol_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bSessionIdEnable", sizeof(pce_rule.pattern.bSessionIdEnable), &pce_rule.pattern.bSessionIdEnable);
+ scanParamArg(prmc, prmv, "pattern.nSessionId", sizeof(pce_rule.pattern.nSessionId), &pce_rule.pattern.nSessionId);
+ scanParamArg(prmc, prmv, "pattern.bSessionId_Exclude", sizeof(pce_rule.pattern.bSessionId_Exclude), &pce_rule.pattern.bSessionId_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bPPP_ProtocolEnable", sizeof(pce_rule.pattern.bPPP_ProtocolEnable), &pce_rule.pattern.bPPP_ProtocolEnable);
+ scanParamArg(prmc, prmv, "pattern.nPPP_Protocol", sizeof(pce_rule.pattern.nPPP_Protocol), &pce_rule.pattern.nPPP_Protocol);
+ scanParamArg(prmc, prmv, "pattern.nPPP_ProtocolMask", sizeof(pce_rule.pattern.nPPP_ProtocolMask), &pce_rule.pattern.nPPP_ProtocolMask);
+ scanParamArg(prmc, prmv, "pattern.bPPP_Protocol_Exclude", sizeof(pce_rule.pattern.bPPP_Protocol_Exclude), &pce_rule.pattern.bPPP_Protocol_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bVid", sizeof(pce_rule.pattern.bVid), &pce_rule.pattern.bVid);
+ scanParamArg(prmc, prmv, "pattern.nVid", sizeof(pce_rule.pattern.nVid), &pce_rule.pattern.nVid);
+ scanParamArg(prmc, prmv, "pattern.bVidRange_Select", sizeof(pce_rule.pattern.bVidRange_Select), &pce_rule.pattern.bVidRange_Select);
+ scanParamArg(prmc, prmv, "pattern.nVidRange", sizeof(pce_rule.pattern.nVidRange), &pce_rule.pattern.nVidRange);
+ scanParamArg(prmc, prmv, "pattern.bVid_Exclude", sizeof(pce_rule.pattern.bVid_Exclude), &pce_rule.pattern.bVid_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bSLAN_Vid", sizeof(pce_rule.pattern.bSLAN_Vid), &pce_rule.pattern.bSLAN_Vid);
+ scanParamArg(prmc, prmv, "pattern.nSLAN_Vid", sizeof(pce_rule.pattern.nSLAN_Vid), &pce_rule.pattern.nSLAN_Vid);
+ scanParamArg(prmc, prmv, "pattern.bSLANVid_Exclude", sizeof(pce_rule.pattern.bSLANVid_Exclude), &pce_rule.pattern.bSLANVid_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bPayload1_SrcEnable", sizeof(pce_rule.pattern.bPayload1_SrcEnable), &pce_rule.pattern.bPayload1_SrcEnable);
+ scanParamArg(prmc, prmv, "pattern.nPayload1", sizeof(pce_rule.pattern.nPayload1), &pce_rule.pattern.nPayload1);
+ scanParamArg(prmc, prmv, "pattern.bPayload1MaskRange_Select", sizeof(pce_rule.pattern.bPayload1MaskRange_Select), &pce_rule.pattern.bPayload1MaskRange_Select);
+ scanParamArg(prmc, prmv, "pattern.nPayload1_Mask", sizeof(pce_rule.pattern.nPayload1_Mask), &pce_rule.pattern.nPayload1_Mask);
+ scanParamArg(prmc, prmv, "pattern.bPayload1_Exclude", sizeof(pce_rule.pattern.bPayload1_Exclude), &pce_rule.pattern.bPayload1_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bPayload2_SrcEnable", sizeof(pce_rule.pattern.bPayload2_SrcEnable), &pce_rule.pattern.bPayload2_SrcEnable);
+ scanParamArg(prmc, prmv, "pattern.nPayload2", sizeof(pce_rule.pattern.nPayload2), &pce_rule.pattern.nPayload2);
+ scanParamArg(prmc, prmv, "pattern.bPayload2MaskRange_Select", sizeof(pce_rule.pattern.bPayload2MaskRange_Select), &pce_rule.pattern.bPayload2MaskRange_Select);
+ scanParamArg(prmc, prmv, "pattern.nPayload2_Mask", sizeof(pce_rule.pattern.nPayload2_Mask), &pce_rule.pattern.nPayload2_Mask);
+ scanParamArg(prmc, prmv, "pattern.bPayload2_Exclude", sizeof(pce_rule.pattern.bPayload2_Exclude), &pce_rule.pattern.bPayload2_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bParserFlagLSB_Enable", sizeof(pce_rule.pattern.bParserFlagLSB_Enable), &pce_rule.pattern.bParserFlagLSB_Enable);
+ scanParamArg(prmc, prmv, "pattern.nParserFlagLSB", sizeof(pce_rule.pattern.nParserFlagLSB), &pce_rule.pattern.nParserFlagLSB);
+ scanParamArg(prmc, prmv, "pattern.nParserFlagLSB_Mask", sizeof(pce_rule.pattern.nParserFlagLSB_Mask), &pce_rule.pattern.nParserFlagLSB_Mask);
+ scanParamArg(prmc, prmv, "pattern.bParserFlagLSB_Exclude", sizeof(pce_rule.pattern.bParserFlagLSB_Exclude), &pce_rule.pattern.bParserFlagLSB_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bParserFlagMSB_Enable", sizeof(pce_rule.pattern.bParserFlagMSB_Enable), &pce_rule.pattern.bParserFlagMSB_Enable);
+ scanParamArg(prmc, prmv, "pattern.nParserFlagMSB", sizeof(pce_rule.pattern.nParserFlagMSB), &pce_rule.pattern.nParserFlagMSB);
+ scanParamArg(prmc, prmv, "pattern.nParserFlagMSB_Mask", sizeof(pce_rule.pattern.nParserFlagMSB_Mask), &pce_rule.pattern.nParserFlagMSB_Mask);
+ scanParamArg(prmc, prmv, "pattern.bParserFlagMSB_Exclude", sizeof(pce_rule.pattern.bParserFlagMSB_Exclude), &pce_rule.pattern.bParserFlagMSB_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bParserFlag1LSB_Enable", sizeof(pce_rule.pattern.bParserFlag1LSB_Enable), &pce_rule.pattern.bParserFlag1LSB_Enable);
+ scanParamArg(prmc, prmv, "pattern.nParserFlag1LSB", sizeof(pce_rule.pattern.nParserFlag1LSB), &pce_rule.pattern.nParserFlag1LSB);
+ scanParamArg(prmc, prmv, "pattern.nParserFlag1LSB_Mask", sizeof(pce_rule.pattern.nParserFlag1LSB_Mask), &pce_rule.pattern.nParserFlag1LSB_Mask);
+ scanParamArg(prmc, prmv, "pattern.bParserFlag1LSB_Exclude", sizeof(pce_rule.pattern.bParserFlag1LSB_Exclude), &pce_rule.pattern.bParserFlag1LSB_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bParserFlag1MSB_Enable", sizeof(pce_rule.pattern.bParserFlag1MSB_Enable), &pce_rule.pattern.bParserFlag1MSB_Enable);
+ scanParamArg(prmc, prmv, "pattern.nParserFlag1MSB", sizeof(pce_rule.pattern.nParserFlag1MSB), &pce_rule.pattern.nParserFlag1MSB);
+ scanParamArg(prmc, prmv, "pattern.nParserFlag1MSB_Mask", sizeof(pce_rule.pattern.nParserFlag1MSB_Mask), &pce_rule.pattern.nParserFlag1MSB_Mask);
+ scanParamArg(prmc, prmv, "pattern.bParserFlag1MSB_Exclude", sizeof(pce_rule.pattern.bParserFlag1MSB_Exclude), &pce_rule.pattern.bParserFlag1MSB_Exclude);
+
+ scanParamArg(prmc, prmv, "pattern.bVid_Original", sizeof(pce_rule.pattern.bVid_Original), &pce_rule.pattern.bVid_Original);
+ scanParamArg(prmc, prmv, "pattern.nOuterVidRange", sizeof(pce_rule.pattern.nOuterVidRange), &pce_rule.pattern.nOuterVidRange);
+ scanParamArg(prmc, prmv, "pattern.bSVidRange_Select", sizeof(pce_rule.pattern.bSVidRange_Select), &pce_rule.pattern.bSVidRange_Select);
+ scanParamArg(prmc, prmv, "pattern.bOuterVid_Original", sizeof(pce_rule.pattern.bOuterVid_Original), &pce_rule.pattern.bOuterVid_Original);
+
+ scanParamArg(prmc, prmv, "action.eTrafficClassAction", sizeof(pce_rule.action.eTrafficClassAction), &pce_rule.action.eTrafficClassAction);
+ scanParamArg(prmc, prmv, "action.nTrafficClassAlternate", sizeof(pce_rule.action.nTrafficClassAlternate), &pce_rule.action.nTrafficClassAlternate);
+ scanParamArg(prmc, prmv, "action.eSnoopingTypeAction", sizeof(pce_rule.action.eSnoopingTypeAction), &pce_rule.action.eSnoopingTypeAction);
+ scanParamArg(prmc, prmv, "action.eLearningAction", sizeof(pce_rule.action.eLearningAction), &pce_rule.action.eLearningAction);
+ scanParamArg(prmc, prmv, "action.eIrqAction", sizeof(pce_rule.action.eIrqAction), &pce_rule.action.eIrqAction);
+ scanParamArg(prmc, prmv, "action.eCrossStateAction", sizeof(pce_rule.action.eCrossStateAction), &pce_rule.action.eCrossStateAction);
+ scanParamArg(prmc, prmv, "action.eCritFrameAction", sizeof(pce_rule.action.eCritFrameAction), &pce_rule.action.eCritFrameAction);
+ scanParamArg(prmc, prmv, "action.eTimestampAction", sizeof(pce_rule.action.eTimestampAction), &pce_rule.action.eTimestampAction);
+ scanParamArg(prmc, prmv, "action.ePortMapAction", sizeof(pce_rule.action.ePortMapAction), &pce_rule.action.ePortMapAction);
+ scanParamArg(prmc, prmv, "action.nForwardPortMap", sizeof(pce_rule.action.nForwardPortMap[0]), &pce_rule.action.nForwardPortMap[0]);
+ scanParamArg(prmc, prmv, "action.nForwardPortMap[1]", sizeof(pce_rule.action.nForwardPortMap[1]), &pce_rule.action.nForwardPortMap[1]);
+ scanParamArg(prmc, prmv, "action.nForwardPortMap[2]", sizeof(pce_rule.action.nForwardPortMap[2]), &pce_rule.action.nForwardPortMap[2]);
+ scanParamArg(prmc, prmv, "action.nForwardPortMap[3]", sizeof(pce_rule.action.nForwardPortMap[3]), &pce_rule.action.nForwardPortMap[3]);
+ scanParamArg(prmc, prmv, "action.nForwardPortMap[4]", sizeof(pce_rule.action.nForwardPortMap[4]), &pce_rule.action.nForwardPortMap[4]);
+ scanParamArg(prmc, prmv, "action.nForwardPortMap[5]", sizeof(pce_rule.action.nForwardPortMap[5]), &pce_rule.action.nForwardPortMap[5]);
+ scanParamArg(prmc, prmv, "action.nForwardPortMap[6]", sizeof(pce_rule.action.nForwardPortMap[6]), &pce_rule.action.nForwardPortMap[6]);
+ scanParamArg(prmc, prmv, "action.nForwardPortMap[7]", sizeof(pce_rule.action.nForwardPortMap[7]), &pce_rule.action.nForwardPortMap[7]);
+ scanParamArg(prmc, prmv, "action.bRemarkAction", sizeof(pce_rule.action.bRemarkAction), &pce_rule.action.bRemarkAction);
+ scanParamArg(prmc, prmv, "action.bRemarkPCP", sizeof(pce_rule.action.bRemarkAction), &pce_rule.action.bRemarkPCP);
+ scanParamArg(prmc, prmv, "action.bRemarkSTAG_PCP", sizeof(pce_rule.action.bRemarkSTAG_PCP), &pce_rule.action.bRemarkSTAG_PCP);
+ scanParamArg(prmc, prmv, "action.bRemarkSTAG_DEI", sizeof(pce_rule.action.bRemarkSTAG_DEI), &pce_rule.action.bRemarkSTAG_DEI);
+ scanParamArg(prmc, prmv, "action.bRemarkDSCP", sizeof(pce_rule.action.bRemarkDSCP), &pce_rule.action.bRemarkDSCP);
+ scanParamArg(prmc, prmv, "action.bRemarkClass", sizeof(pce_rule.action.bRemarkClass), &pce_rule.action.bRemarkClass);
+ scanParamArg(prmc, prmv, "action.eMeterAction", sizeof(pce_rule.action.eMeterAction), &pce_rule.action.eMeterAction);
+ scanParamArg(prmc, prmv, "action.nMeterId", sizeof(pce_rule.action.nMeterId), &pce_rule.action.nMeterId);
+ scanParamArg(prmc, prmv, "action.bRMON_Action", sizeof(pce_rule.action.bRMON_Action), &pce_rule.action.bRMON_Action);
+ scanParamArg(prmc, prmv, "action.nRMON_Id", sizeof(pce_rule.action.nRMON_Id), &pce_rule.action.nRMON_Id);
+ scanParamArg(prmc, prmv, "action.eVLAN_Action", sizeof(pce_rule.action.eVLAN_Action), &pce_rule.action.eVLAN_Action);
+ scanParamArg(prmc, prmv, "action.nVLAN_Id", sizeof(pce_rule.action.nVLAN_Id), &pce_rule.action.nVLAN_Id);
+ scanParamArg(prmc, prmv, "action.nFId", sizeof(pce_rule.action.nFId), &pce_rule.action.nFId);
+ scanParamArg(prmc, prmv, "action.bFidEnable", sizeof(pce_rule.action.bFidEnable), &pce_rule.action.bFidEnable);
+
+ scanParamArg(prmc, prmv, "action.eSVLAN_Action", sizeof(pce_rule.action.eSVLAN_Action), &pce_rule.action.eSVLAN_Action);
+ scanParamArg(prmc, prmv, "action.nSVLAN_Id", sizeof(pce_rule.action.nSVLAN_Id), &pce_rule.action.nSVLAN_Id);
+ scanParamArg(prmc, prmv, "action.eVLAN_CrossAction", sizeof(pce_rule.action.eVLAN_CrossAction), &pce_rule.action.eVLAN_CrossAction);
+ scanParamArg(prmc, prmv, "action.bPortBitMapMuxControl", sizeof(pce_rule.action.bPortBitMapMuxControl), &pce_rule.action.bPortBitMapMuxControl);
+ scanParamArg(prmc, prmv, "action.bCVLAN_Ignore_Control", sizeof(pce_rule.action.bCVLAN_Ignore_Control), &pce_rule.action.bCVLAN_Ignore_Control);
+ scanParamArg(prmc, prmv, "action.bPortLinkSelection", sizeof(pce_rule.action.bPortLinkSelection), &pce_rule.action.bPortLinkSelection);
+ scanParamArg(prmc, prmv, "action.bPortTrunkAction", sizeof(pce_rule.action.bPortTrunkAction), &pce_rule.action.bPortTrunkAction);
+
+ scanParamArg(prmc, prmv, "action.bFlowID_Action", sizeof(pce_rule.action.bFlowID_Action), &pce_rule.action.bFlowID_Action);
+ scanParamArg(prmc, prmv, "action.nFlowID", sizeof(pce_rule.action.nFlowID), &pce_rule.action.nFlowID);
+
+ scanParamArg(prmc, prmv, "action.bRoutExtId_Action", sizeof(pce_rule.action.bRoutExtId_Action), &pce_rule.action.bRoutExtId_Action);
+ scanParamArg(prmc, prmv, "action.nRoutExtId", sizeof(pce_rule.action.nRoutExtId), &pce_rule.action.nRoutExtId);
+
+ scanParamArg(prmc, prmv, "action.bRtDstPortMaskCmp_Action", sizeof(pce_rule.action.bRtDstPortMaskCmp_Action), &pce_rule.action.bRtDstPortMaskCmp_Action);
+ scanParamArg(prmc, prmv, "action.bRtSrcPortMaskCmp_Action", sizeof(pce_rule.action.bRtSrcPortMaskCmp_Action), &pce_rule.action.bRtSrcPortMaskCmp_Action);
+ scanParamArg(prmc, prmv, "action.bRtDstIpMaskCmp_Action", sizeof(pce_rule.action.bRtDstIpMaskCmp_Action), &pce_rule.action.bRtDstIpMaskCmp_Action);
+ scanParamArg(prmc, prmv, "action.bRtSrcIpMaskCmp_Action", sizeof(pce_rule.action.bRtSrcIpMaskCmp_Action), &pce_rule.action.bRtSrcIpMaskCmp_Action);
+ scanParamArg(prmc, prmv, "action.bRtInnerIPasKey_Action", sizeof(pce_rule.action.bRtInnerIPasKey_Action), &pce_rule.action.bRtInnerIPasKey_Action);
+
+ scanParamArg(prmc, prmv, "action.bRtAccelEna_Action", sizeof(pce_rule.action.bRtAccelEna_Action), &pce_rule.action.bRtAccelEna_Action);
+ scanParamArg(prmc, prmv, "action.bRtCtrlEna_Action", sizeof(pce_rule.action.bRtCtrlEna_Action), &pce_rule.action.bRtCtrlEna_Action);
+ scanParamArg(prmc, prmv, "action.eProcessPath_Action", sizeof(pce_rule.action.eProcessPath_Action), &pce_rule.action.eProcessPath_Action);
+ scanParamArg(prmc, prmv, "action.ePortFilterType_Action", sizeof(pce_rule.action.ePortFilterType_Action), &pce_rule.action.ePortFilterType_Action);
+
+ scanParamArg(prmc, prmv, "action.bOamEnable", sizeof(pce_rule.action.bOamEnable), &pce_rule.action.bOamEnable);
+ scanParamArg(prmc, prmv, "action.nRecordId", sizeof(pce_rule.action.nRecordId), &pce_rule.action.nRecordId);
+ scanParamArg(prmc, prmv, "action.bExtractEnable", sizeof(pce_rule.action.bExtractEnable), &pce_rule.action.bExtractEnable);
+ scanParamArg(prmc, prmv, "action.eColorFrameAction", sizeof(pce_rule.action.eColorFrameAction), &pce_rule.action.eColorFrameAction);
+ scanParamArg(prmc, prmv, "action.bExtendedVlanEnable", sizeof(pce_rule.action.bExtendedVlanEnable), &pce_rule.action.bExtendedVlanEnable);
+ scanParamArg(prmc, prmv, "action.nExtendedVlanBlockId", sizeof(pce_rule.action.nExtendedVlanBlockId), &pce_rule.action.nExtendedVlanBlockId);
+
+ /*Aplicable for GSWIP 3.2*/
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField4Enable",
+ sizeof(pce_rule.pattern.bFlexibleField4Enable), &pce_rule.pattern.bFlexibleField4Enable);
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField4_ExcludeEnable",
+ sizeof(pce_rule.pattern.bFlexibleField4_ExcludeEnable), &pce_rule.pattern.bFlexibleField4_ExcludeEnable);
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField4_RangeEnable",
+ sizeof(pce_rule.pattern.bFlexibleField4_RangeEnable), &pce_rule.pattern.bFlexibleField4_RangeEnable);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField4_ParserIndex",
+ sizeof(pce_rule.pattern.nFlexibleField4_ParserIndex), &pce_rule.pattern.nFlexibleField4_ParserIndex);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField4_Value",
+ sizeof(pce_rule.pattern.nFlexibleField4_Value), &pce_rule.pattern.nFlexibleField4_Value);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField4_MaskOrRange",
+ sizeof(pce_rule.pattern.nFlexibleField4_MaskOrRange), &pce_rule.pattern.nFlexibleField4_MaskOrRange);
+
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField3Enable",
+ sizeof(pce_rule.pattern.bFlexibleField3Enable), &pce_rule.pattern.bFlexibleField3Enable);
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField3_ExcludeEnable",
+ sizeof(pce_rule.pattern.bFlexibleField3_ExcludeEnable), &pce_rule.pattern.bFlexibleField3_ExcludeEnable);
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField3_RangeEnable",
+ sizeof(pce_rule.pattern.bFlexibleField3_RangeEnable), &pce_rule.pattern.bFlexibleField3_RangeEnable);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField3_ParserIndex",
+ sizeof(pce_rule.pattern.nFlexibleField3_ParserIndex), &pce_rule.pattern.nFlexibleField3_ParserIndex);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField3_Value",
+ sizeof(pce_rule.pattern.nFlexibleField3_Value), &pce_rule.pattern.nFlexibleField3_Value);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField3_MaskOrRange",
+ sizeof(pce_rule.pattern.nFlexibleField3_MaskOrRange), &pce_rule.pattern.nFlexibleField3_MaskOrRange);
+
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField2Enable",
+ sizeof(pce_rule.pattern.bFlexibleField2Enable), &pce_rule.pattern.bFlexibleField2Enable);
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField2_ExcludeEnable",
+ sizeof(pce_rule.pattern.bFlexibleField2_ExcludeEnable), &pce_rule.pattern.bFlexibleField2_ExcludeEnable);
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField2_RangeEnable",
+ sizeof(pce_rule.pattern.bFlexibleField2_RangeEnable), &pce_rule.pattern.bFlexibleField2_RangeEnable);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField2_ParserIndex",
+ sizeof(pce_rule.pattern.nFlexibleField2_ParserIndex), &pce_rule.pattern.nFlexibleField2_ParserIndex);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField2_Value",
+ sizeof(pce_rule.pattern.nFlexibleField2_Value), &pce_rule.pattern.nFlexibleField2_Value);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField2_MaskOrRange",
+ sizeof(pce_rule.pattern.nFlexibleField2_MaskOrRange), &pce_rule.pattern.nFlexibleField2_MaskOrRange);
+
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField1Enable",
+ sizeof(pce_rule.pattern.bFlexibleField1Enable), &pce_rule.pattern.bFlexibleField1Enable);
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField1_ExcludeEnable",
+ sizeof(pce_rule.pattern.bFlexibleField1_ExcludeEnable), &pce_rule.pattern.bFlexibleField1_ExcludeEnable);
+ scanParamArg(prmc, prmv, "pattern.bFlexibleField1_RangeEnable",
+ sizeof(pce_rule.pattern.bFlexibleField1_RangeEnable), &pce_rule.pattern.bFlexibleField1_RangeEnable);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField1_ParserIndex",
+ sizeof(pce_rule.pattern.nFlexibleField1_ParserIndex), &pce_rule.pattern.nFlexibleField1_ParserIndex);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField1_Value",
+ sizeof(pce_rule.pattern.nFlexibleField1_Value), &pce_rule.pattern.nFlexibleField1_Value);
+ scanParamArg(prmc, prmv, "pattern.nFlexibleField1_MaskOrRange",
+ sizeof(pce_rule.pattern.nFlexibleField1_MaskOrRange), &pce_rule.pattern.nFlexibleField1_MaskOrRange);
+
+ scanParamArg(prmc, prmv, "action.bPBB_Action_Enable", sizeof(pce_rule.action.bPBB_Action_Enable), &pce_rule.action.bPBB_Action_Enable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bIheaderActionEnable",
+ sizeof(pce_rule.action.sPBB_Action.bIheaderActionEnable), &pce_rule.action.sPBB_Action.bIheaderActionEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.eIheaderOpMode",
+ sizeof(pce_rule.action.sPBB_Action.eIheaderOpMode), &pce_rule.action.sPBB_Action.eIheaderOpMode);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bTunnelIdKnownTrafficEnable",
+ sizeof(pce_rule.action.sPBB_Action.bTunnelIdKnownTrafficEnable), &pce_rule.action.sPBB_Action.bTunnelIdKnownTrafficEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.nTunnelIdKnownTraffic",
+ sizeof(pce_rule.action.sPBB_Action.nTunnelIdKnownTraffic), &pce_rule.action.sPBB_Action.nTunnelIdKnownTraffic);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bTunnelIdUnKnownTrafficEnable",
+ sizeof(pce_rule.action.sPBB_Action.bTunnelIdUnKnownTrafficEnable), &pce_rule.action.sPBB_Action.bTunnelIdUnKnownTrafficEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.nTunnelIdUnKnownTraffic",
+ sizeof(pce_rule.action.sPBB_Action.nTunnelIdUnKnownTraffic), &pce_rule.action.sPBB_Action.nTunnelIdUnKnownTraffic);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bB_DstMac_FromMacTableEnable",
+ sizeof(pce_rule.action.sPBB_Action.bB_DstMac_FromMacTableEnable), &pce_rule.action.sPBB_Action.bB_DstMac_FromMacTableEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_SrcMacEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_B_SrcMacEnable), &pce_rule.action.sPBB_Action.bReplace_B_SrcMacEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_DstMacEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_B_DstMacEnable), &pce_rule.action.sPBB_Action.bReplace_B_DstMacEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_ResEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_ResEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_ResEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_UacEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_UacEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_UacEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_DeiEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_DeiEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_DeiEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_PcpEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_PcpEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_PcpEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_SidEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_SidEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_SidEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_TpidEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_TpidEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_TpidEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bBtagActionEnable",
+ sizeof(pce_rule.action.sPBB_Action.bBtagActionEnable), &pce_rule.action.sPBB_Action.bBtagActionEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.eBtagOpMode",
+ sizeof(pce_rule.action.sPBB_Action.eBtagOpMode), &pce_rule.action.sPBB_Action.eBtagOpMode);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bProcessIdKnownTrafficEnable",
+ sizeof(pce_rule.action.sPBB_Action.bProcessIdKnownTrafficEnable), &pce_rule.action.sPBB_Action.bProcessIdKnownTrafficEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.nProcessIdKnownTraffic",
+ sizeof(pce_rule.action.sPBB_Action.nProcessIdKnownTraffic), &pce_rule.action.sPBB_Action.nProcessIdKnownTraffic);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bProcessIdUnKnownTrafficEnable",
+ sizeof(pce_rule.action.sPBB_Action.bProcessIdUnKnownTrafficEnable), &pce_rule.action.sPBB_Action.bProcessIdUnKnownTrafficEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.nProcessIdUnKnownTraffic",
+ sizeof(pce_rule.action.sPBB_Action.nProcessIdUnKnownTraffic), &pce_rule.action.sPBB_Action.nProcessIdUnKnownTraffic);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_TAG_DeiEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_B_TAG_DeiEnable), &pce_rule.action.sPBB_Action.bReplace_B_TAG_DeiEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_TAG_PcpEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_B_TAG_PcpEnable), &pce_rule.action.sPBB_Action.bReplace_B_TAG_PcpEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_TAG_VidEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_B_TAG_VidEnable), &pce_rule.action.sPBB_Action.bReplace_B_TAG_VidEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_TAG_TpidEnable",
+ sizeof(pce_rule.action.sPBB_Action.bReplace_B_TAG_TpidEnable), &pce_rule.action.sPBB_Action.bReplace_B_TAG_TpidEnable);
+
+ scanParamArg(prmc, prmv, "action.sPBB_Action.bMacTableMacinMacActionEnable",
+ sizeof(pce_rule.action.sPBB_Action.bMacTableMacinMacActionEnable), &pce_rule.action.sPBB_Action.bMacTableMacinMacActionEnable);
+ scanParamArg(prmc, prmv, "action.sPBB_Action.eMacTableMacinMacSelect",
+ sizeof(pce_rule.action.sPBB_Action.eMacTableMacinMacSelect), &pce_rule.action.sPBB_Action.eMacTableMacinMacSelect);
+
+ scanParamArg(prmc, prmv, "action.bDestSubIf_Action_Enable",
+ sizeof(pce_rule.action.bDestSubIf_Action_Enable), &pce_rule.action.bDestSubIf_Action_Enable);
+ scanParamArg(prmc, prmv, "action.sDestSubIF_Action.bDestSubIFIDActionEnable",
+ sizeof(pce_rule.action.sDestSubIF_Action.bDestSubIFIDActionEnable), &pce_rule.action.sDestSubIF_Action.bDestSubIFIDActionEnable);
+ scanParamArg(prmc, prmv, "action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable",
+ sizeof(pce_rule.action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable), &pce_rule.action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable);
+ scanParamArg(prmc, prmv, "action.sDestSubIF_Action.nDestSubIFGrp_Field",
+ sizeof(pce_rule.action.sDestSubIF_Action.nDestSubIFGrp_Field), &pce_rule.action.sDestSubIF_Action.nDestSubIFGrp_Field);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleWrite(gsw_dev, &pce_rule);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleWrite failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PceRuleWrite done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PceRuleDelete(int prmc, char *prmv[])
+{
+ GSW_PCE_ruleEntry_t pce_rule;
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ memset(&pce_rule, 0, sizeof(GSW_PCE_ruleEntry_t));
+
+ rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nLogicalPortId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.nIndex), &pce_rule.nIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: pattern.nIndex\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
+ scanParamArg(prmc, prmv, "region", sizeof(pce_rule.region), &pce_rule.region);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleDelete(gsw_dev, &pce_rule);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleDelete failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PceRuleDelete done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PceRuleAlloc(int prmc, char *prmv[])
+{
+ GSW_PCE_rule_alloc_t alloc = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "num_of_rules", sizeof(alloc.num_of_rules), &alloc.num_of_rules);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: num_of_rules\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleAlloc(gsw_dev, &alloc);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleAlloc failed with ret code", ret);
+ else
+ {
+ printf("\n\tret = %d", ret);
+ printf("\n\tblockid = %u", alloc.blockid);
+ printf("\n\tnum_of_rules = %u", alloc.num_of_rules);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PceRuleFree(int prmc, char *prmv[])
+{
+ GSW_PCE_rule_alloc_t alloc = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "blockid", sizeof(alloc.num_of_rules), &alloc.blockid);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: blockid\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleFree(gsw_dev, &alloc);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleFree failed with ret code", ret);
+ else
+ {
+ printf("\n\tret = %d", ret);
+ printf("\n\tblockid = %u", alloc.blockid);
+ printf("\n\tnum_of_rules = %u", alloc.num_of_rules);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PceRuleEnable(int prmc, char *prmv[])
+{
+ GSW_PCE_ruleEntry_t pce_rule = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
+ scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
+ scanParamArg(prmc, prmv, "region", sizeof(pce_rule.subifidgroup), &pce_rule.region);
+ scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.nIndex), &pce_rule.nIndex);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleEnable(gsw_dev, &pce_rule);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleEnable failed with ret code", ret);
+ else
+ {
+ printf("\n\tret = %d", ret);
+ printf("\n\tregion = %u", pce_rule.region);
+ printf("\n\tpattern.nIndex = %u", pce_rule.nIndex);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PceRuleDisable(int prmc, char *prmv[])
+{
+ GSW_PCE_ruleEntry_t pce_rule = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
+ scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
+ scanParamArg(prmc, prmv, "region", sizeof(pce_rule.subifidgroup), &pce_rule.region);
+ scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.nIndex), &pce_rule.nIndex);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleDisable(gsw_dev, &pce_rule);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleDisable failed with ret code", ret);
+ else
+ {
+ printf("\n\tret = %d", ret);
+ printf("\n\tregion = %u", pce_rule.region);
+ printf("\n\tpattern.nIndex = %u", pce_rule.nIndex);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+// int gsw_dump_pce_mem(int prmc, char *prmv[])
+// {
+// GSW_table_t sVar = {0};
+// GSW_register_t reg = {0};
+// unsigned int i = 0, j = 0, k = 0, m = 0;
+// int num_of_elem;
+// GSW_Device_t *gsw_dev;
+// GSW_return_t ret;
+// int rret;
+// gsw_dev = gsw_get_struc(lif_id,0);
+
+// num_of_elem = (sizeof(tbl_dump_gsw33) / sizeof(struct _tbl_dump_));
+
+// for (i = 0; i < num_of_elem; i++) {
+// printf("===========================================\n");
+// printf("Table Name: %s\n", tbl_dump_gsw33[i].tbl_name);
+// printf("===========================================\n");
+
+// for (j = 0; j < tbl_dump_gsw33[i].entries; j++) {
+// memset(&sVar, 0, sizeof(sVar));
+
+// printf("Table Idx: %02d\n", j);
+// sVar.tbl_entry = j;
+// sVar.tbl_addr = tbl_dump_gsw33[i].tbl_addr;
+// sVar.tbl_id = 1;
+// gsw_cli_ops->gsw_debug_ops.DumpMem(gsw_dev, &sVar);
+
+// for (k = 0; k < gsw_pce_tbl_33[sVar.tbl_addr].num_key; k++)
+// printf("\tKey %d: %04x\n", k, sVar.ptdata.key[k]);
+
+// for (k = 0; k < gsw_pce_tbl_33[sVar.tbl_addr].num_mask; k++)
+// printf("\tMask %d: %04x\n", k, sVar.ptdata.mask[k]);
+
+// for (k = 0; k < gsw_pce_tbl_33[sVar.tbl_addr].num_val; k++)
+// printf("\tVal %d: %04x\n", k, sVar.ptdata.val[k]);
+
+// printf("\tValid: %x\n", sVar.ptdata.valid);
+// printf("\tType: %x\n", sVar.ptdata.type);
+// printf("\n");
+
+// for (m = 0; m < 500000; m++);
+// }
+// }
+// printf("===========================================\n");
+// for (i = 0; i < 0xEFF; i++) {
+
+// reg.nData = 0;
+// reg.nRegAddr = i;
+// GSW_RegisterGet(gsw_dev, ®);
+// printf("%08x: %08x\n", (0xC0D52000 + (i * 0x4)), reg.nData);
+// }
+
+// return ret;
+// }
+
+GSW_return_t fapi_GSW_MulticastRouterPortAdd(int prmc, char *prmv[])
+{
+ GSW_multicastRouter_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MulticastRouterPortAdd(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastRouterPortAdd failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MulticastRouterPortAdd done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MulticastRouterPortRemove(int prmc, char *prmv[])
+{
+ GSW_multicastRouter_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MulticastRouterPortRemove(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastRouterPortRemove failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MulticastRouterPortRemove done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MulticastSnoopCfgGet(int prmc, char *prmv[])
+{
+ GSW_multicastSnoopCfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MulticastSnoopCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastSnoopCfgGet failed with ret code", ret);
+ else
+ {
+ printf("Returned values:\n----------------\n");
+ printf("\t%40s:\t0x%x\n", "eIGMP_Mode", param.eIGMP_Mode);
+ printf("\t%40s:\t%s\n", "bCrossVLAN", (param.bCrossVLAN > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t0x%x\n", "eForwardPort", param.eForwardPort);
+ printf("\t%40s:\t0x%x\n", "nForwardPortId", param.nForwardPortId);
+ printf("\t%40s:\t0x%x\n", "nClassOfService", param.nClassOfService);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MulticastSnoopCfgSet(int prmc, char *prmv[])
+{
+ GSW_multicastSnoopCfg_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MulticastSnoopCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_MulticastSnoopCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "eIGMP_Mode", sizeof(param.eIGMP_Mode), ¶m.eIGMP_Mode);
+ scanParamArg(prmc, prmv, "bCrossVLAN", sizeof(param.bCrossVLAN), ¶m.bCrossVLAN);
+ scanParamArg(prmc, prmv, "eForwardPort", sizeof(param.eForwardPort), ¶m.eForwardPort);
+ scanParamArg(prmc, prmv, "nForwardPortId", sizeof(param.nForwardPortId), ¶m.nForwardPortId);
+ scanParamArg(prmc, prmv, "nClassOfService", sizeof(param.nClassOfService), ¶m.nClassOfService);
+
+ ret = GSW_MulticastSnoopCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastSnoopCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MulticastSnoopCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MulticastRouterPortRead(int prmc, char *prmv[])
+{
+ GSW_multicastRouterRead_t multicastRouterRead = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ multicastRouterRead.bInitial = 1;
+ gsw_dev = gsw_get_struc(lif_id, 0);
+
+ for (;;)
+ {
+ ret = GSW_MulticastRouterPortRead(gsw_dev, &multicastRouterRead);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastRouterPortRead failed with ret code", ret);
+ return ret;
+ }
+
+ if (multicastRouterRead.bLast == 1)
+ break;
+
+ printf("\t%40s:\t%d\n", "Router Port", multicastRouterRead.nPortId);
+ memset(&multicastRouterRead, 0x00, sizeof(multicastRouterRead));
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MulticastTableEntryAdd(int prmc, char *prmv[])
+{
+ GSW_multicastTable_t param;
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int retval;
+
+ retval = multicastParamRead(prmc, prmv, ¶m);
+ if (retval != 0)
+ return retval;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MulticastTableEntryAdd(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastTableEntryAdd failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MulticastTableEntryAdd done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MulticastTableEntryRead(int prmc, char *prmv[])
+{
+ GSW_multicastTableRead_t multicastTableRead;
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int k = 0, valid = 0;
+ u8 mcasthitsts_en = 0;
+ GSW_register_t param = {0};
+
+ memset(¶m, 0, sizeof(GSW_register_t));
+ param.nRegAddr = 0x456;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RegisterGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_RegisterGet failed with ret code", ret);
+ return ret;
+ }
+
+ if (param.nData & 0x2000)
+ mcasthitsts_en = 1;
+ else
+ mcasthitsts_en = 0;
+
+ printf("-----------------------------------------------------------------------------------------------------------------------------------------------\n");
+ printf("| %4s | %6s | %3s | %39s | %39s | %11s | %9s | %9s\n", "Port", "Sub Id", "FID", "GDA", "GSA", "Member Mode", "HitStatus", "VLAN Info");
+ printf("-----------------------------------------------------------------------------------------------------------------------------------------------\n");
+
+ memset(&multicastTableRead, 0x00, sizeof(multicastTableRead));
+ multicastTableRead.bInitial = 1;
+
+ for (;;)
+ {
+ ret = GSW_MulticastTableEntryRead(gsw_dev, &multicastTableRead);
+ if (ret < 0)
+ break;
+
+ if (multicastTableRead.bLast == 1)
+ break;
+
+ if ((multicastTableRead.nPortId == 0) && (multicastTableRead.nSubIfId == 0) && (multicastTableRead.nFID == 0))
+ {
+ valid = 0;
+
+ for (k = 0; k < 8; k++)
+ {
+ if (multicastTableRead.uIP_Gsa.nIPv6[k] != 0)
+ valid = 1;
+ }
+
+ for (k = 0; k < 8; k++)
+ {
+ if (multicastTableRead.uIP_Gda.nIPv6[k] != 0)
+ valid = 1;
+ }
+
+ for (k = 0; k < ARRAY_SIZE(multicastTableRead.nPortMap); k++)
+ {
+ if (multicastTableRead.nPortMap[k] != 0)
+ valid = 1;
+ }
+
+ if (valid == 0)
+ continue;
+ }
+
+ if (multicastTableRead.nPortId & GSW_PORTMAP_FLAG_GET(GSW_multicastTableRead_t))
+ {
+
+ unsigned int i = 0, j = 0, mask = 1;
+
+ for (j = 0; j < ARRAY_SIZE(multicastTableRead.nPortMap); j++)
+ {
+ i = 0;
+ mask = 1;
+
+ if (!multicastTableRead.nPortMap[j])
+ continue;
+
+ while (mask <= (1 << 16))
+ {
+ if (mask & multicastTableRead.nPortMap[j])
+ {
+ if (mcasthitsts_en && (j == 7) && (mask == (1 << 15)))
+ {
+ break;
+ }
+
+ printf("| %4d |", (j * 16) + i);
+ printf(" %6d |", multicastTableRead.nSubIfId);
+ printf(" %3d |", multicastTableRead.nFID);
+ dump_multicast_table_entry(&multicastTableRead);
+ }
+
+ i++;
+ mask = 1 << i;
+ }
+ }
+ }
+ else
+ {
+ printf("| %4d |", multicastTableRead.nPortId);
+ printf(" %6d |", multicastTableRead.nSubIfId);
+ printf(" %3d |", multicastTableRead.nFID);
+ dump_multicast_table_entry(&multicastTableRead);
+ }
+
+ memset(&multicastTableRead, 0x00, sizeof(multicastTableRead));
+ }
+
+ printf("-----------------------------------------------------------------------------------------------------------------------------------------------\n");
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_MulticastTableEntryRemove(int prmc, char *prmv[])
+{
+ GSW_multicastTable_t param;
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int retval;
+
+ retval = multicastParamRead(prmc, prmv, ¶m);
+ if (retval != 0)
+ return retval;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MulticastTableEntryRemove(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastTableEntryRemove failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_MulticastTableEntryRemove done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_FW_Update(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_fw_update(gsw_dev);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_FW_Update failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_FW_Update done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_FW_Version(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ struct sys_fw_image_version sys_img_ver = {0};
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_fw_version(gsw_dev, &sys_img_ver);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_FW_Version failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "Major", sys_img_ver.major);
+ printf("\t%40s:\t%x\n", "Minor", sys_img_ver.minor);
+ printf("\t%40s:\t%u\n", "Revision", sys_img_ver.revision);
+ printf("\t%40s:\t%u\n", "APP Revision", sys_img_ver.app_revision);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PVT_Meas(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ struct sys_sensor_value sensor_value_temp = {0};
+ struct sys_sensor_value sensor_value_volt = {0};
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_pvt_temp(gsw_dev, &sensor_value_temp);
+ ret = sys_misc_pvt_voltage(gsw_dev, &sensor_value_volt);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PVT_Temp failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%d.%d\n", "Temp", sensor_value_temp.val1, sensor_value_temp.val2);
+ printf("\t%40s:\t%d.%d\n", "Voltage", sensor_value_volt.val1, sensor_value_volt.val2);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Delay(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_delay param = {0};
+
+ rret = scanParamArg(prmc, prmv, "nMsec", sizeof(param.m_sec), ¶m.m_sec);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nMsec\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_delay(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Delay failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_Delay done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_GPIO_Configure(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_gpio_config param = {0};
+
+ scanParamArg(prmc, prmv, "nEnableMaskIndex0", sizeof(param.enable_mask[0]), ¶m.enable_mask[0]);
+ scanParamArg(prmc, prmv, "nEnableMaskIndex1", sizeof(param.enable_mask[1]), ¶m.enable_mask[1]);
+ scanParamArg(prmc, prmv, "nEnableMaskIndex2", sizeof(param.enable_mask[2]), ¶m.enable_mask[2]);
+ scanParamArg(prmc, prmv, "nAltSel0Index0", sizeof(param.alt_sel_0[0]), ¶m.alt_sel_0[0]);
+ scanParamArg(prmc, prmv, "nAltSel0Index1", sizeof(param.alt_sel_0[1]), ¶m.alt_sel_0[1]);
+ scanParamArg(prmc, prmv, "nAltSel0Index2", sizeof(param.alt_sel_0[2]), ¶m.alt_sel_0[2]);
+ scanParamArg(prmc, prmv, "nAltSel1Index0", sizeof(param.alt_sel_1[0]), ¶m.alt_sel_1[0]);
+ scanParamArg(prmc, prmv, "nAltSel1Index1", sizeof(param.alt_sel_1[1]), ¶m.alt_sel_1[1]);
+ scanParamArg(prmc, prmv, "nAltSel1Index2", sizeof(param.alt_sel_1[2]), ¶m.alt_sel_1[2]);
+ scanParamArg(prmc, prmv, "nDirIndex0", sizeof(param.dir[0]), ¶m.dir[0]);
+ scanParamArg(prmc, prmv, "nDirIndex1", sizeof(param.dir[1]), ¶m.dir[1]);
+ scanParamArg(prmc, prmv, "nDirIndex2", sizeof(param.dir[2]), ¶m.dir[2]);
+ scanParamArg(prmc, prmv, "nOutValueIndex0", sizeof(param.out_val[0]), ¶m.out_val[0]);
+ scanParamArg(prmc, prmv, "nOutValueIndex1", sizeof(param.out_val[1]), ¶m.out_val[1]);
+ scanParamArg(prmc, prmv, "nOutValueIndex2", sizeof(param.out_val[2]), ¶m.out_val[2]);
+ scanParamArg(prmc, prmv, "nTimeoutValue", sizeof(param.timeout_val), ¶m.timeout_val);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_gpio_configure(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_GPIO_Configure failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_GPIO_Configure done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Reboot(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_reboot(gsw_dev);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Reboot failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_Reboot done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_SysReg_Rd(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_reg_rw sys_reg = {0};
+
+ rret = scanParamArg(prmc, prmv, "addr", sizeof(sys_reg.addr), &sys_reg.addr);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: addr\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_reg_rd(gsw_dev, &sys_reg);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_SysReg_Rd failed with ret code", ret);
+ else
+ printf("fapi_GSW_SysReg_Rd:\n\t addr=0x%x val=0x%x\n", sys_reg.addr, sys_reg.val);
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_SysReg_Wr(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_reg_rw sys_reg = {0};
+
+ rret = scanParamArg(prmc, prmv, "addr", sizeof(sys_reg.addr), &sys_reg.addr);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: addr\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "val", sizeof(sys_reg.val), &sys_reg.val);
+ if (rret < 1)
+ {
+ printf("parameter not Found: val\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_reg_wr(gsw_dev, &sys_reg);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_SysReg_Wr failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_SysReg_Wr done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_SysReg_Mod(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_reg_mod sys_reg = {0};
+
+ rret = scanParamArg(prmc, prmv, "addr", sizeof(sys_reg.addr), &sys_reg.addr);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: addr\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "val", sizeof(sys_reg.val), &sys_reg.val);
+ if (rret < 1)
+ {
+ printf("parameter not Found: val\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "mask", sizeof(sys_reg.mask), &sys_reg.mask);
+ if (rret < 1)
+ {
+ printf("parameter not Found: mask\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_reg_mod(gsw_dev, &sys_reg);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_SysReg_Mod failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_SysReg_Mod done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Cml_Clk_Get(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_cml_clk param = {0};
+ unsigned char nClk;
+
+ rret = scanParamArg(prmc, prmv, "nClk", sizeof(nClk), &nClk);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nClk\n");
+ return OS_ERROR;
+ }
+
+ param.clk = nClk;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_cml_clk_get(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Cml_Clk_Get failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%d\n", "Clock", param.clk);
+ printf("\t%40s:\t%d\n", "Enable", param.en);
+ printf("\t%40s:\t%d\n", "Source Selection", param.src_sel);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Cml_Clk_Set(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_cml_clk param = {0};
+ unsigned char nClk;
+ unsigned char bEn;
+ unsigned char nEnable;
+ unsigned char bSrcSel;
+ unsigned char nSrcSel;
+
+ rret = scanParamArg(prmc, prmv, "nClk", sizeof(nClk), &nClk);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nClk\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "bEn", sizeof(bEn), &bEn);
+ scanParamArg(prmc, prmv, "nEnable", sizeof(nEnable), &nEnable);
+ scanParamArg(prmc, prmv, "bSrcSel", sizeof(bSrcSel), &bSrcSel);
+ scanParamArg(prmc, prmv, "nSrcSel", sizeof(nSrcSel), &nSrcSel);
+
+ param.clk = nClk;
+ param.en_val = bEn;
+ param.en = nEnable;
+ param.src_val = bSrcSel;
+ param.src_sel = nSrcSel;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_cml_clk_set(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Cml_Clk_Set failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_Cml_Clk_Set done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Sfp_Get(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_sfp_cfg cfg = {0};
+ unsigned char nPort;
+ unsigned char nOption;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(nPort), &nPort);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nOption", sizeof(nOption), &nOption);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nOption\n");
+ return OS_ERROR;
+ }
+
+ cfg.port_id = nPort;
+ cfg.option = nOption;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_sfp_get(gsw_dev, &cfg);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Sfp_Get failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%d\n", "nPortId", cfg.port_id);
+ printf("\t%40s:\t%d\n", "nOption", cfg.option);
+ if (cfg.option)
+ {
+ printf("\t%40s:\t%d\n", "bFlowCtrlEn", cfg.fc_en);
+ }
+ else
+ {
+ printf("\t%40s:\t%d\n", "nMode", cfg.mode);
+ printf("\t%40s:\t%d\n", "nSpeed", cfg.speed);
+ printf("\t%40s:\t%d\n", "nLink", cfg.link);
+ }
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Sfp_Set(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+ struct sys_sfp_cfg cfg = {0};
+ uint8_t val;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(val), &val);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+ cfg.port_id = val;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = sys_misc_sfp_get(gsw_dev, &cfg);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "sys_misc_sfp_get failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "nOption", sizeof(val), &val);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nOption\n");
+ return OS_ERROR;
+ }
+
+ cfg.option = val;
+ if (cfg.option)
+ {
+ scanParamArg(prmc, prmv, "bFlowCtrlEn", sizeof(val), &val);
+ cfg.fc_en = val;
+ }
+ else
+ {
+ scanParamArg(prmc, prmv, "nMode", sizeof(val), &val);
+ cfg.mode = val;
+ scanParamArg(prmc, prmv, "nSpeed", sizeof(val), &val);
+ cfg.speed = val;
+ }
+
+ ret = sys_misc_sfp_set(gsw_dev, &cfg);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Sfp_Set failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_Sfp_Set done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Debug_RMON_Port_Get(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_Debug_RMON_Port_cnt_t sVar;
+ memset(&sVar, 0, sizeof(GSW_Debug_RMON_Port_cnt_t));
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(sVar.nPortId), &sVar.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "ePortType", sizeof(sVar.ePortType), &sVar.ePortType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: ePortType\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_Debug_RMON_Port_Get(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Debug_RMON_Port_Get failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "nPortId", sVar.nPortId);
+ printf("\t%40s:\t%x\n", "ePortType", sVar.ePortType);
+ printf("\t%40s:\t%s\n", "RMON Counter BitMode", "64");
+ printf("\n\n");
+ printf("\t%40s:\t%u\n", "nRxGoodPkts", sVar.nRxGoodPkts);
+ printf("\t%40s:\t%u\n", "nRxUnicastPkts", sVar.nRxUnicastPkts);
+ printf("\t%40s:\t%u\n", "nRxBroadcastPkts", sVar.nRxBroadcastPkts);
+ printf("\t%40s:\t%u\n", "nRxMulticastPkts", sVar.nRxMulticastPkts);
+ printf("\t%40s:\t%u\n", "nRxFCSErrorPkts", sVar.nRxFCSErrorPkts);
+ printf("\t%40s:\t%u\n", "nRxUnderSizeGoodPkts", sVar.nRxUnderSizeGoodPkts);
+ printf("\t%40s:\t%u\n", "nRxOversizeGoodPkts", sVar.nRxOversizeGoodPkts);
+ printf("\t%40s:\t%u\n", "nRxUnderSizeErrorPkts", sVar.nRxUnderSizeErrorPkts);
+ printf("\t%40s:\t%u\n", "nRxOversizeErrorPkts", sVar.nRxOversizeErrorPkts);
+ printf("\t%40s:\t%u\n", "nRxFilteredPkts", sVar.nRxFilteredPkts);
+ printf("\t%40s:\t%u\n", "nRx64BytePkts", sVar.nRx64BytePkts);
+ printf("\t%40s:\t%u\n", "nRx127BytePkts", sVar.nRx127BytePkts);
+ printf("\t%40s:\t%u\n", "nRx255BytePkts", sVar.nRx255BytePkts);
+ printf("\t%40s:\t%u\n", "nRx511BytePkts", sVar.nRx511BytePkts);
+ printf("\t%40s:\t%u\n", "nRx1023BytePkts", sVar.nRx1023BytePkts);
+ printf("\t%40s:\t%u\n", "nRxMaxBytePkts", sVar.nRxMaxBytePkts);
+ printf("\t%40s:\t%u\n", "nRxDroppedPkts", sVar.nRxDroppedPkts);
+ printf("\t%40s:\t%u\n", "nRxExtendedVlanDiscardPkts", sVar.nRxExtendedVlanDiscardPkts);
+ printf("\t%40s:\t%u\n", "nMtuExceedDiscardPkts", sVar.nMtuExceedDiscardPkts);
+ printf("\t%40s:\t%llu 0x%llx\n", "nRxGoodBytes", (unsigned long long)sVar.nRxGoodBytes, (unsigned long long)sVar.nRxGoodBytes);
+ printf("\t%40s:\t%llu 0x%llx\n", "nRxBadBytes", (unsigned long long)sVar.nRxBadBytes, (unsigned long long)sVar.nRxBadBytes);
+
+ /*Valid only for GSWIP3.2*/
+ printf("\t%40s:\t%u\n", "nRxUnicastPktsYellowRed", sVar.nRxUnicastPktsYellowRed);
+ printf("\t%40s:\t%u\n", "nRxBroadcastPktsYellowRed", sVar.nRxBroadcastPktsYellowRed);
+ printf("\t%40s:\t%u\n", "nRxMulticastPktsYellowRed", sVar.nRxMulticastPktsYellowRed);
+ printf("\t%40s:\t%u\n", "nRxGoodPktsYellowRed", sVar.nRxGoodPktsYellowRed);
+ printf("\t%40s:\t%llu 0x%llx\n", "nRxGoodBytesYellowRed", (unsigned long long)sVar.nRxGoodBytesYellowRed, (unsigned long long)sVar.nRxGoodBytesYellowRed);
+
+ printf("\n\n");
+ printf("\t%40s:\t%u\n", "nTxGoodPkts", sVar.nTxGoodPkts);
+ printf("\t%40s:\t%u\n", "nTxUnicastPkts", sVar.nTxUnicastPkts);
+ printf("\t%40s:\t%u\n", "nTxBroadcastPkts", sVar.nTxBroadcastPkts);
+ printf("\t%40s:\t%u\n", "nTxMulticastPkts", sVar.nTxMulticastPkts);
+ printf("\t%40s:\t%u\n", "nTx64BytePkts", sVar.nTx64BytePkts);
+ printf("\t%40s:\t%u\n", "nTx127BytePkts", sVar.nTx127BytePkts);
+ printf("\t%40s:\t%u\n", "nTx255BytePkts", sVar.nTx255BytePkts);
+ printf("\t%40s:\t%u\n", "nTx511BytePkts", sVar.nTx511BytePkts);
+ printf("\t%40s:\t%u\n", "nTx1023BytePkts", sVar.nTx1023BytePkts);
+ printf("\t%40s:\t%u\n", "nTxMaxBytePkts", sVar.nTxMaxBytePkts);
+ printf("\t%40s:\t%u\n", "nTxDroppedPkts", sVar.nTxDroppedPkts);
+ printf("\t%40s:\t%u\n", "nTxOversizeGoodPkts", sVar.nTxOversizeGoodPkts);
+ printf("\t%40s:\t%u\n", "nTxUnderSizeGoodPkts", sVar.nTxUnderSizeGoodPkts);
+ printf("\t%40s:\t%u\n", "nTxAcmDroppedPkts", sVar.nTxAcmDroppedPkts);
+ printf("\t%40s:\t%llu 0x%llx\n", "nTxGoodBytes", (unsigned long long)sVar.nTxGoodBytes, (unsigned long long)sVar.nTxGoodBytes);
+
+ printf("\t%40s:\t%u\n", "nTxUnicastPktsYellowRed", sVar.nTxUnicastPktsYellowRed);
+ printf("\t%40s:\t%u\n", "nTxBroadcastPktsYellowRed", sVar.nTxBroadcastPktsYellowRed);
+ printf("\t%40s:\t%u\n", "nTxMulticastPktsYellowRed", sVar.nTxMulticastPktsYellowRed);
+ printf("\t%40s:\t%u\n", "nTxGoodPktsYellowRed", sVar.nTxGoodPktsYellowRed);
+ printf("\t%40s:\t%llu 0x%llx\n", "nTxGoodBytesYellowRed", (unsigned long long)sVar.nTxGoodBytesYellowRed, (unsigned long long)sVar.nTxGoodBytesYellowRed);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_DEBUG_RMON_Port_Get_All(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+ GSW_Debug_RMON_Port_cnt_t *sVar_rx;
+ GSW_Debug_RMON_Port_cnt_t *sVar_tx;
+ u32 i = 0, j = 0, start = 0, end = 0, max_read = 0;
+ GSW_RMON_portType_t eCounerType = 0;
+
+ scanParamArg(prmc, prmv, "ePortType", sizeof(eCounerType), &eCounerType);
+ scanParamArg(prmc, prmv, "Start", sizeof(start), &start);
+ scanParamArg(prmc, prmv, "End", sizeof(end), &end);
+
+ max_read = end - start;
+ if (max_read > 16 || end > 16)
+ {
+ printf("Display only 16 ports, please check start and end\n");
+ return -1;
+ }
+
+ sVar_rx = malloc(sizeof(*sVar_rx) * (max_read + 1) * 2);
+ if (!sVar_rx)
+ {
+ printf("\n\tERROR: failed in buffer allocation\n");
+ return -ENOMEM;
+ }
+
+ sVar_tx = &sVar_rx[max_read + 1];
+
+ for (j = 0; j < 2; j++) {
+ if (eCounerType == GSW_RMON_CTP_PORT_RX && j == 1) {
+ eCounerType = GSW_RMON_CTP_PORT_TX;
+ } else if (eCounerType == GSW_RMON_BRIDGE_PORT_RX && j == 1) {
+ eCounerType = GSW_RMON_BRIDGE_PORT_TX;
+ }
+
+ switch (eCounerType) {
+ case 0:
+ case 1:
+ printf("Reading CTP Port %s Counters\n", j ? "Tx" : "Rx");
+ break;
+ case 2:
+ case 3:
+ printf("Reading BRIDGE Port %s Counters\n", j ? "Tx" : "Rx");
+ break;
+ case 4:
+ printf("Reading Bypass-PCE Port Tx Counters\n");
+ break;
+ default:
+ break;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ if (j == 0) { // Getting RX port RMON
+ for (i = 0; i <= max_read; i++) {
+ sVar_rx[i].nPortId = start + i;
+ sVar_rx[i].ePortType = eCounerType;
+
+ ret = GSW_Debug_RMON_Port_Get(gsw_dev, &sVar_rx[i]);
+ if (ret < 0)
+ {
+ free(sVar_rx);
+ printf("\t%40s:\t0x%x\n", "GSW_Debug_RMON_Port_Get failed with ret code", ret);
+ return ret;
+ }
+ }
+ } else { // Getting TX port RMON
+ for (i = 0; i <= max_read; i++) {
+ sVar_tx[i].nPortId = start + i;
+ sVar_tx[i].ePortType = eCounerType;
+
+ ret = GSW_Debug_RMON_Port_Get(gsw_dev, &sVar_tx[i]);
+ if (ret < 0)
+ {
+ free(sVar_rx);
+ printf("\t%40s:\t0x%x\n", "GSW_Debug_RMON_Port_Get failed with ret code", ret);
+ return ret;
+ }
+ }
+ }
+ }
+
+ printf("\n\n");
+ printf("Port : ");
+
+ for (i = start; i <= end; i++)
+ printf("%11u", i);
+
+ printf("\n");
+
+ if (sVar_rx[0].ePortType != 4) {
+ printf("\n");
+ printf("nRxGoodPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxGoodPkts + sVar_rx[i].nRxGoodPktsYellowRed);
+
+ printf("\n");
+ printf("nRxUnicastPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxUnicastPkts + sVar_rx[i].nRxUnicastPktsYellowRed);
+
+ printf("\n");
+ printf("nRxBroadcastPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxBroadcastPkts + sVar_rx[i].nRxBroadcastPktsYellowRed);
+
+ printf("\n");
+ printf("nRxMulticastPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxMulticastPkts + sVar_rx[i].nRxMulticastPktsYellowRed);
+
+ printf("\n");
+ printf("nRxFCSErrorPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxFCSErrorPkts);
+
+ printf("\n");
+ printf("nRxUnderSizeGoodPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxUnderSizeGoodPkts);
+
+ printf("\n");
+ printf("nRxOversizeGoodPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxOversizeGoodPkts);
+
+ printf("\n");
+ printf("nRxUnderSizeErrorPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxUnderSizeErrorPkts);
+
+ printf("\n");
+ printf("nRxOversizeErrorPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxOversizeErrorPkts);
+
+ printf("\n");
+ printf("nRxFilteredPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxFilteredPkts);
+
+ printf("\n");
+ printf("nRx64BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRx64BytePkts);
+
+ printf("\n");
+ printf("nRx127BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRx127BytePkts);
+
+ printf("\n");
+ printf("nRx255BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRx255BytePkts);
+
+ printf("\n");
+ printf("nRx511BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRx511BytePkts);
+
+ printf("\n");
+ printf("nRx1023BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRx1023BytePkts);
+
+ printf("\n");
+ printf("nRxMaxBytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxMaxBytePkts);
+
+ printf("\n");
+ printf("nRxDroppedPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxDroppedPkts);
+
+ printf("\n");
+ printf("nRxExtendedVlanDiscardPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nRxExtendedVlanDiscardPkts);
+
+ printf("\n");
+ printf("nMtuExceedDiscardPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_rx[i].nMtuExceedDiscardPkts);
+
+ printf("\n");
+ printf("nRxGoodBytes : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", (u32)(sVar_rx[i].nRxGoodBytes + sVar_rx[i].nRxGoodBytesYellowRed));
+
+ printf("\n");
+ printf("nRxBadBytes : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", (u32)sVar_rx[i].nRxBadBytes);
+
+ printf("\n");
+ }
+
+ printf("\n");
+ printf("nTxGoodPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxGoodPkts + sVar_tx[i].nTxGoodPktsYellowRed);
+
+ printf("\n");
+ printf("nTxUnicastPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxUnicastPkts + sVar_tx[i].nTxUnicastPktsYellowRed);
+
+ printf("\n");
+ printf("nTxBroadcastPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxBroadcastPkts + sVar_tx[i].nTxBroadcastPktsYellowRed);
+
+ printf("\n");
+ printf("nTxMulticastPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxMulticastPkts + sVar_tx[i].nTxMulticastPktsYellowRed);
+
+ printf("\n");
+ printf("nTx64BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTx64BytePkts);
+
+ printf("\n");
+ printf("nTx127BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTx127BytePkts);
+
+ printf("\n");
+ printf("nTx255BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTx255BytePkts);
+
+ printf("\n");
+ printf("nTx511BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTx511BytePkts);
+
+ printf("\n");
+ printf("nTx1023BytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTx1023BytePkts);
+
+ printf("\n");
+ printf("nTxMaxBytePkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxMaxBytePkts);
+
+ printf("\n");
+ printf("nTxDroppedPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxDroppedPkts);
+
+ printf("\n");
+ printf("nTxOversizeGoodPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxOversizeGoodPkts);
+
+ printf("\n");
+ printf("nTxUnderSizeGoodPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxUnderSizeGoodPkts);
+
+ printf("\n");
+ printf("nTxAcmDroppedPkts : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", sVar_tx[i].nTxAcmDroppedPkts);
+
+ printf("\n");
+ printf("nTxGoodBytes : ");
+ for (i = 0; i <= max_read; i++)
+ printf("%11u", (u32)(sVar_tx[i].nTxGoodBytes + sVar_tx[i].nTxGoodBytesYellowRed));
+
+ printf("\n");
+ free(sVar_rx);
+
+ return 0;
+}
+
+GSW_return_t fapi_GSW_CPU_PortCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_CPU_PortCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CPU_PortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PortCfgGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%s\n", "bCPU_PortValid", (param.bCPU_PortValid > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%s\n", "bSpecialTagIngress", (param.bSpecialTagIngress > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%s\n", "bSpecialTagEgress", (param.bSpecialTagEgress > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%s\n", "bFcsCheck", (param.bFcsCheck > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%s\n", "bFcsGenerate", (param.bFcsGenerate > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%d\n", "bSpecialTagEthType", param.bSpecialTagEthType);
+ printf("\t%40s:\t%s\n", "bTsPtp", (param.bTsPtp > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%s\n", "bTsNonptp", (param.bTsNonptp > 0) ? "TRUE" : "FALSE");
+ printf("\t%40s:\t%d\n", "eNoMPEParserCfg", param.eNoMPEParserCfg);
+ printf("\t%40s:\t%d\n", "eMPE1ParserCfg", param.eMPE1ParserCfg);
+ printf("\t%40s:\t%d\n", "eMPE2ParserCfg", param.eMPE2ParserCfg);
+ printf("\t%40s:\t%d\n", "eMPE1MPE2ParserCfg", param.eMPE1MPE2ParserCfg);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CPU_PortGet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_CPU_Port_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_CPU_Port_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CPU_PortGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_CPU_PortGet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("\tnPortId: %d\n", param.nPortId);
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CPU_PortSet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_CPU_Port_t param = {0};
+ int rret;
+ uint8_t nEntryIndex = 0, nVal = 0, index;
+
+ memset(¶m, 0, sizeof(GSW_CPU_Port_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CPU_PortSet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ {
+ printf("fapi_GSW_CPU_PortSet failed with ret code: %d\n", ret);
+ return ret;
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_CPU_PortCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_CPU_PortCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_CPU_PortCfgGet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("\t%40s:\t0x%x\n", "GSW_CPU_PortCfgGet failed with ret code", ret);
+ return ret;
+ }
+
+ scanParamArg(prmc, prmv, "bCPU_PortValid", sizeof(param.bCPU_PortValid), ¶m.bCPU_PortValid);
+ scanParamArg(prmc, prmv, "bSpecialTagIngress", sizeof(param.bSpecialTagIngress), ¶m.bSpecialTagIngress);
+ scanParamArg(prmc, prmv, "bSpecialTagEgress", sizeof(param.bSpecialTagEgress), ¶m.bSpecialTagEgress);
+ scanParamArg(prmc, prmv, "bFcsCheck", sizeof(param.bFcsCheck), ¶m.bFcsCheck);
+ scanParamArg(prmc, prmv, "bFcsGenerate", sizeof(param.bFcsGenerate), ¶m.bFcsGenerate);
+ scanParamArg(prmc, prmv, "bSpecialTagEthType", sizeof(param.bSpecialTagEthType), ¶m.bSpecialTagEthType);
+ scanParamArg(prmc, prmv, "bTsPtp", sizeof(param.bTsPtp), ¶m.bTsPtp);
+ scanParamArg(prmc, prmv, "bTsNonptp", sizeof(param.bTsNonptp), ¶m.bTsNonptp);
+
+ scanParamArg(prmc, prmv, "eNoMPEParserCfg", sizeof(param.eNoMPEParserCfg), ¶m.eNoMPEParserCfg);
+ scanParamArg(prmc, prmv, "eMPE1ParserCfg", sizeof(param.eMPE1ParserCfg), ¶m.eMPE1ParserCfg);
+ scanParamArg(prmc, prmv, "eMPE2ParserCfg", sizeof(param.eMPE2ParserCfg), ¶m.eMPE2ParserCfg);
+ scanParamArg(prmc, prmv, "eMPE1MPE2ParserCfg", sizeof(param.eMPE1MPE2ParserCfg), ¶m.eMPE1MPE2ParserCfg);
+
+ ret = GSW_CPU_PortCfgSet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_CPU_PortCfgSet failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_CPU_PortCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_VlanCounterMapSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_VlanCounterMapping_config_t sVar = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nCounterIndex", sizeof(sVar.nCounterIndex), &sVar.nCounterIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nCounterIndex\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nCtpPortId", sizeof(sVar.nCtpPortId), &sVar.nCtpPortId);
+ scanParamArg(prmc, prmv, "bPriorityEnable", sizeof(sVar.bPriorityEnable), &sVar.bPriorityEnable);
+ scanParamArg(prmc, prmv, "nPriorityVal", sizeof(sVar.nPriorityVal), &sVar.nPriorityVal);
+ scanParamArg(prmc, prmv, "bVidEnable", sizeof(sVar.bVidEnable), &sVar.bVidEnable);
+ scanParamArg(prmc, prmv, "nVidVal", sizeof(sVar.nVidVal), &sVar.nVidVal);
+ scanParamArg(prmc, prmv, "bVlanTagSelectionEnable", sizeof(sVar.bVlanTagSelectionEnable), &sVar.bVlanTagSelectionEnable);
+ scanParamArg(prmc, prmv, "eVlanCounterMappingType", sizeof(sVar.eVlanCounterMappingType), &sVar.eVlanCounterMappingType);
+ scanParamArg(prmc, prmv, "eVlanCounterMappingFilterType", sizeof(sVar.eVlanCounterMappingFilterType), &sVar.eVlanCounterMappingFilterType);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_VlanCounterMapSet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanCounterMapSet failed with ret code", ret);
+ else
+ {
+
+ printf("fapi_GSW_VlanCounterMapSet done\n");
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_VlanCounterMapGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_VlanCounterMapping_config_t sVar = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nCounterIndex", sizeof(sVar.nCounterIndex), &sVar.nCounterIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nCounterIndex\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "eVlanCounterMappingType", sizeof(sVar.eVlanCounterMappingType), &sVar.eVlanCounterMappingType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eVlanCounterMappingType\n");
+ return OS_ERROR;
+ }
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_VlanCounterMapGet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanCounterMapGet failed with ret code", ret);
+ else
+ {
+ printf("\n\t nCounterIndex = %u", sVar.nCounterIndex);
+ printf("\n\t nCtpPortId = %u", sVar.nCtpPortId);
+ printf("\n\t bPriorityEnable = %u", sVar.bPriorityEnable);
+ printf("\n\t nPriorityVal = %u", sVar.nPriorityVal);
+ printf("\n\t bVidEnable = %u", sVar.bVidEnable);
+ printf("\n\t nVidVal = %u", sVar.nVidVal);
+ printf("\n\t bVlanTagSelectionEnable = %u", sVar.bVlanTagSelectionEnable);
+ printf("\n\t eVlanCounterMappingType = %u", sVar.eVlanCounterMappingType);
+ printf("\n\t eVlanCounterMappingFilterType = %u", sVar.eVlanCounterMappingFilterType);
+ printf("\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Vlan_RMON_Get(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_VLAN_RMON_cnt_t sVar = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nVlanCounterIndex", sizeof(sVar.nVlanCounterIndex), &sVar.nVlanCounterIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVlanCounterIndex\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "eVlanRmonType", sizeof(sVar.eVlanRmonType), &sVar.eVlanRmonType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eVlanRmonType\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_Vlan_RMON_Get(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Vlan_RMON_Get failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%lu\n", "nByteCount", (sVar.nByteCount));
+ printf("\t%40s:\t%u\n", "nTotalPktCount", (sVar.nTotalPktCount));
+ printf("\t%40s:\t%u\n", "nMulticastPktCount", (sVar.nMulticastPktCount));
+ printf("\t%40s:\t%u\n", "nDropPktCount", (sVar.nDropPktCount));
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Vlan_RMON_Clear(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_VLAN_RMON_cnt_t sVar = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nVlanCounterIndex", sizeof(sVar.nVlanCounterIndex), &sVar.nVlanCounterIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVlanCounterIndex\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "eVlanRmonType", sizeof(sVar.eVlanRmonType), &sVar.eVlanRmonType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eVlanRmonType\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "eClearAll", sizeof(sVar.eVlanRmonType), &sVar.clear_all);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_Vlan_RMON_Clear(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Vlan_RMON_Clear failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_Vlan_RMON_Clear done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Vlan_RMONControl_Set(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_VLAN_RMON_control_t sVar = {0};
+
+ scanParamArg(prmc, prmv, "bVlanRmonEnable", sizeof(sVar.bVlanRmonEnable), &sVar.bVlanRmonEnable);
+ scanParamArg(prmc, prmv, "bIncludeBroadCastPktCounting", sizeof(sVar.bIncludeBroadCastPktCounting), &sVar.bIncludeBroadCastPktCounting);
+ scanParamArg(prmc, prmv, "nVlanLastEntry", sizeof(sVar.nVlanLastEntry), &sVar.nVlanLastEntry);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_Vlan_RMONControl_Set(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Vlan_RMONControl_Set failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_Vlan_RMONControl_Set done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Vlan_RMONControl_Get(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_VLAN_RMON_control_t sVar = {0};
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_Vlan_RMONControl_Get(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Vlan_RMONControl_Get failed with ret code", ret);
+ else
+ {
+ printf("\n\t bVlanRmonEnable = %u", sVar.bVlanRmonEnable);
+ printf("\n\t bIncludeBroadCastPktCounting = %u", sVar.bIncludeBroadCastPktCounting);
+ printf("\n\t nVlanLastEntry = %u\n", sVar.nVlanLastEntry);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PBB_TunnelTempate_Config_Set(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_PBB_Tunnel_Template_Config_t sVar = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nTunnelTemplateId", sizeof(sVar.nTunnelTemplateId), &sVar.nTunnelTemplateId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nTunnelTemplateId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "bIheaderDstMACEnable", sizeof(sVar.bIheaderDstMACEnable), &sVar.bIheaderDstMACEnable);
+ scanMAC_Arg(prmc, prmv, "nIheaderDstMAC", sVar.nIheaderDstMAC);
+ scanParamArg(prmc, prmv, "bIheaderSrcMACEnable", sizeof(sVar.bIheaderSrcMACEnable), &sVar.bIheaderSrcMACEnable);
+ scanMAC_Arg(prmc, prmv, "nIheaderSrcMAC", sVar.nIheaderSrcMAC);
+
+ scanParamArg(prmc, prmv, "bItagEnable", sizeof(sVar.bItagEnable), &sVar.bItagEnable);
+ scanParamArg(prmc, prmv, "bItagTpidEnable", sizeof(sVar.sItag.bTpidEnable), &sVar.sItag.bTpidEnable);
+ scanParamArg(prmc, prmv, "nItagTpid", sizeof(sVar.sItag.nTpid), &sVar.sItag.nTpid);
+ scanParamArg(prmc, prmv, "bItagPcpEnable", sizeof(sVar.sItag.bPcpEnable), &sVar.sItag.bPcpEnable);
+ scanParamArg(prmc, prmv, "nItagPcp", sizeof(sVar.sItag.nPcp), &sVar.sItag.nPcp);
+ scanParamArg(prmc, prmv, "bItagDeiEnable", sizeof(sVar.sItag.bDeiEnable), &sVar.sItag.bDeiEnable);
+ scanParamArg(prmc, prmv, "nItagDei", sizeof(sVar.sItag.nDei), &sVar.sItag.nDei);
+ scanParamArg(prmc, prmv, "bItagUacEnable", sizeof(sVar.sItag.bUacEnable), &sVar.sItag.bUacEnable);
+ scanParamArg(prmc, prmv, "nItagUac", sizeof(sVar.sItag.nUac), &sVar.sItag.nUac);
+ scanParamArg(prmc, prmv, "bItagResEnable", sizeof(sVar.sItag.bResEnable), &sVar.sItag.bResEnable);
+ scanParamArg(prmc, prmv, "nItagRes", sizeof(sVar.sItag.nRes), &sVar.sItag.nRes);
+ scanParamArg(prmc, prmv, "bItagSidEnable", sizeof(sVar.sItag.bSidEnable), &sVar.sItag.bSidEnable);
+ scanParamArg(prmc, prmv, "nItagSid", sizeof(sVar.sItag.nSid), &sVar.sItag.nSid);
+
+ scanParamArg(prmc, prmv, "bBtagEnable", sizeof(sVar.bBtagEnable), &sVar.bBtagEnable);
+ scanParamArg(prmc, prmv, "bBtagTpidEnable", sizeof(sVar.sBtag.bTpidEnable), &sVar.sBtag.bTpidEnable);
+ scanParamArg(prmc, prmv, "nBtagTpid", sizeof(sVar.sBtag.nTpid), &sVar.sBtag.nTpid);
+ scanParamArg(prmc, prmv, "bBtagPcpEnable", sizeof(sVar.sBtag.bPcpEnable), &sVar.sBtag.bPcpEnable);
+ scanParamArg(prmc, prmv, "nBtagPcp", sizeof(sVar.sBtag.nPcp), &sVar.sBtag.nPcp);
+ scanParamArg(prmc, prmv, "bBtagDeiEnable", sizeof(sVar.sBtag.bDeiEnable), &sVar.sBtag.bDeiEnable);
+ scanParamArg(prmc, prmv, "nBtagDei", sizeof(sVar.sBtag.nDei), &sVar.sBtag.nDei);
+ scanParamArg(prmc, prmv, "bBtagVidEnable", sizeof(sVar.sBtag.bVidEnable), &sVar.sBtag.bVidEnable);
+ scanParamArg(prmc, prmv, "nBtagVid", sizeof(sVar.sBtag.nVid), &sVar.sBtag.nVid);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PBB_TunnelTempate_Config_Set(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PBB_TunnelTempate_Config_Set failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_PBB_TunnelTempate_Config_Set done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PBB_TunnelTempate_Config_Get(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_PBB_Tunnel_Template_Config_t sVar = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nTunnelTemplateId", sizeof(sVar.nTunnelTemplateId), &sVar.nTunnelTemplateId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nTunnelTemplateId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PBB_TunnelTempate_Config_Get(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PBB_TunnelTempate_Config_Get failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%u\n", "nTunnelTemplateId", sVar.nTunnelTemplateId);
+ printf("\n\t nTunnelTemplateId = %u", sVar.nTunnelTemplateId);
+ printf("\n\t nIheaderDstMAC =");
+ printMAC_Address(sVar.nIheaderDstMAC);
+ printf("\n\t nIheaderSrcMAC =");
+ printMAC_Address(sVar.nIheaderSrcMAC);
+ printf("\n");
+ printf("\t%40s:\t%x\n", "nItagTpid", sVar.sItag.nTpid);
+ printf("\t%40s:\t%u\n", "nItagPcp", sVar.sItag.nPcp);
+ printf("\t%40s:\t%u\n", "nItagDei", sVar.sItag.nDei);
+ printf("\t%40s:\t%u\n", "nItagUac", sVar.sItag.nUac);
+ printf("\t%40s:\t%u\n", "nItagRes", sVar.sItag.nRes);
+ printf("\t%40s:\t%u\n", "nItagSid", sVar.sItag.nSid);
+ printf("\t%40s:\t%x\n", "nBtagTpid", sVar.sBtag.nTpid);
+ printf("\t%40s:\t%u\n", "nBtagPcp", sVar.sBtag.nPcp);
+ printf("\t%40s:\t%u\n", "nBtagDei", sVar.sBtag.nDei);
+ printf("\t%40s:\t%u\n", "nBtagVid", sVar.sBtag.nVid);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PBB_TunnelTempate_Free(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_PBB_Tunnel_Template_Config_t sVar = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nTunnelTemplateId", sizeof(sVar.nTunnelTemplateId), &sVar.nTunnelTemplateId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nTunnelTemplateId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PBB_TunnelTempate_Free(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PBB_TunnelTempate_Free failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "Freed nTunnelTemplateId", sVar.nTunnelTemplateId);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PBB_TunnelTempate_Alloc(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_PBB_Tunnel_Template_Config_t sVar = {0};
+ int rret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PBB_TunnelTempate_Alloc(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PBB_TunnelTempate_Alloc failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "Allocated nTunnelTemplateId", sVar.nTunnelTemplateId);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_RMON_FlowGet(int prmc, char *prmv[])
+{
+ GSW_RMON_flowGet_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ scanParamArg(prmc, prmv, "bIndex", sizeof(param.bIndex), ¶m.bIndex);
+ scanParamArg(prmc, prmv, "nIndex", sizeof(param.nIndex), ¶m.nIndex);
+ scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ scanParamArg(prmc, prmv, "nFlowId", sizeof(param.nFlowId), ¶m.nFlowId);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RMON_FlowGet(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_FlowGet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "nIndex", param.nIndex);
+ printf("\t%40s:\t%x\n", "nRxPkts", param.nRxPkts);
+ printf("\t%40s:\t%x\n", "nTxPkts", param.nTxPkts);
+ printf("\t%40s:\t%x\n", "nTxPceBypassPkts", param.nTxPceBypassPkts);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_RMON_PortGet(int prmc, char *prmv[])
+{
+ GSW_RMON_Port_cnt_t sVar = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ scanParamArg(prmc, prmv, "nPortId", sizeof(sVar.nPortId), &sVar.nPortId);
+ scanParamArg(prmc, prmv, "ePortType", sizeof(sVar.ePortType), &sVar.ePortType);
+ scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(sVar.nSubIfIdGroup), &sVar.nSubIfIdGroup);
+ scanParamArg(prmc, prmv, "bPceBypass", sizeof(sVar.bPceBypass), &sVar.bPceBypass);
+
+ if (sVar.ePortType != GSW_CTP_PORT && sVar.ePortType != GSW_BRIDGE_PORT)
+ sVar.ePortType = GSW_CTP_PORT;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RMON_Port_Get(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_PortGet failed with ret code", ret);
+ else
+ {
+ printf("nPortId : %d\n", sVar.nPortId);
+
+ switch (sVar.ePortType)
+ {
+ case GSW_LOGICAL_PORT:
+ printf("ePortType : GSW_LOGICAL_PORT\n");
+ break;
+ case GSW_PHYSICAL_PORT:
+ printf("ePortType : GSW_PHYSICAL_PORT\n");
+ break;
+ case GSW_CTP_PORT:
+ printf("ePortType : GSW_CTP_PORT\n");
+ break;
+ case GSW_BRIDGE_PORT:
+ printf("ePortType : GSW_BRIDGE_PORT\n");
+ break;
+ default:
+ printf("ePortType : UNKNOWN\n");
+ }
+
+ printf("nSubIfIdGroup : %d\n", sVar.nSubIfIdGroup);
+ printf("bPceBypass : %d\n", sVar.bPceBypass);
+
+ if (!sVar.bPceBypass)
+ {
+ printf("\n\n");
+ printf("nRxGoodPkts : %u\n", sVar.nRxGoodPkts);
+ printf("nRxUnicastPkts : %u\n", sVar.nRxUnicastPkts);
+ printf("nRxBroadcastPkts : %u\n", sVar.nRxBroadcastPkts);
+ printf("nRxMulticastPkts : %u\n", sVar.nRxMulticastPkts);
+ printf("nRxFCSErrorPkts : %u\n", sVar.nRxFCSErrorPkts);
+ printf("nRxUnderSizeGoodPkts : %u\n", sVar.nRxUnderSizeGoodPkts);
+ printf("nRxOversizeGoodPkts : %u\n", sVar.nRxOversizeGoodPkts);
+ printf("nRxUnderSizeErrorPkts : %u\n", sVar.nRxUnderSizeErrorPkts);
+ printf("nRxOversizeErrorPkts : %u\n", sVar.nRxOversizeErrorPkts);
+ printf("nRxFilteredPkts : %u\n", sVar.nRxFilteredPkts);
+ printf("nRx64BytePkts : %u\n", sVar.nRx64BytePkts);
+ printf("nRx127BytePkts : %u\n", sVar.nRx127BytePkts);
+ printf("nRx255BytePkts : %u\n", sVar.nRx255BytePkts);
+ printf("nRx511BytePkts : %u\n", sVar.nRx511BytePkts);
+ printf("nRx1023BytePkts : %u\n", sVar.nRx1023BytePkts);
+ printf("nRxMaxBytePkts : %u\n", sVar.nRxMaxBytePkts);
+ printf("nRxDroppedPkts : %u\n", sVar.nRxDroppedPkts);
+ printf("nRxExtendedVlanDiscardPkts : %u\n", sVar.nRxExtendedVlanDiscardPkts);
+ printf("nMtuExceedDiscardPkts : %u\n", sVar.nMtuExceedDiscardPkts);
+ printf("nRxGoodBytes : %llu (0x%llx)\n", (unsigned long long)sVar.nRxGoodBytes, (unsigned long long)sVar.nRxGoodBytes);
+ printf("nRxBadBytes : %llu (0x%llx)\n", (unsigned long long)sVar.nRxBadBytes, (unsigned long long)sVar.nRxBadBytes);
+ }
+
+ printf("\n\n");
+ printf("nTxGoodPkts : %u\n", sVar.nTxGoodPkts);
+ printf("nTxUnicastPkts : %u\n", sVar.nTxUnicastPkts);
+ printf("nTxBroadcastPkts : %u\n", sVar.nTxBroadcastPkts);
+ printf("nTxMulticastPkts : %u\n", sVar.nTxMulticastPkts);
+ printf("nTx64BytePkts : %u\n", sVar.nTx64BytePkts);
+ printf("nTx127BytePkts : %u\n", sVar.nTx127BytePkts);
+ printf("nTx255BytePkts : %u\n", sVar.nTx255BytePkts);
+ printf("nTx511BytePkts : %u\n", sVar.nTx511BytePkts);
+ printf("nTx1023BytePkts : %u\n", sVar.nTx1023BytePkts);
+ printf("nTxMaxBytePkts : %u\n", sVar.nTxMaxBytePkts);
+ printf("nTxDroppedPkts : %u\n", sVar.nTxDroppedPkts);
+ printf("nTxOversizeGoodPkts : %u\n", sVar.nTxOversizeGoodPkts);
+ printf("nTxUnderSizeGoodPkts : %u\n", sVar.nTxUnderSizeGoodPkts);
+ printf("nTxAcmDroppedPkts : %u\n", sVar.nTxAcmDroppedPkts);
+ printf("nTxGoodBytes : %llu (0x%llx)\n", (unsigned long long)sVar.nTxGoodBytes, (unsigned long long)sVar.nTxGoodBytes);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_RMON_ModeSet(int prmc, char *prmv[])
+{
+ GSW_RMON_mode_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "eRmonType", sizeof(param.eRmonType), ¶m.eRmonType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eRmonType\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "eCountMode", sizeof(param.eCountMode), ¶m.eCountMode);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eCountMode\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RMON_Mode_Set(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_ModeSet failed with ret code", ret);
+ else
+ {
+ printf("\t%40s\n", "fapi_GSW_RMON_ModeSet done");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_RMON_MeterGet(int prmc, char *prmv[])
+{
+ GSW_RMON_Meter_cnt_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ scanParamArg(prmc, prmv, "nMeterId", sizeof(param.nMeterId), ¶m.nMeterId);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RMON_Meter_Get(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_Meter_Get failed with ret code", ret);
+ else
+ {
+ printf("\t%40s:\t%x\n", "nMeterId", param.nMeterId);
+ printf("\t%40s:\t%x\n", "nGreenCount", param.nGreenCount);
+ printf("\t%40s:\t%x\n", "nYellowCount", param.nYellowCount);
+ printf("\t%40s:\t%x\n", "nRedCount", param.nRedCount);
+ printf("\t%40s:\t%x\n", "nResCount", param.nResCount);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_RMON_TFlowClear(int prmc, char *prmv[])
+{
+ GSW_RMON_flowGet_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ scanParamArg(prmc, prmv, "bIndex", sizeof(param.bIndex), ¶m.bIndex);
+ scanParamArg(prmc, prmv, "nIndex", sizeof(param.nIndex), ¶m.nIndex);
+ scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ scanParamArg(prmc, prmv, "nFlowId", sizeof(param.nFlowId), ¶m.nFlowId);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_RmonTflowClear(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_TFlowClear failed with ret code", ret);
+ else
+ {
+ printf("\t%40s\n", "fapi_GSW_RMON_TFlowClear done");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgePortFree(int prmc, char *prmv[])
+{
+ GSW_BRIDGE_portAlloc_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nBridgePortId", sizeof(param.nBridgePortId), ¶m.nBridgePortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nBridgePortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgePortFree(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgePortFree failed with ret code", ret);
+ else
+ {
+ printf("\t%40s\n", "fapi_GSW_BridgePortFree done");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgePortAlloc(int prmc, char *prmv[])
+{
+ GSW_BRIDGE_portAlloc_t param = {0};
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgePortAlloc(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgePortAlloc failed with ret code", ret);
+ else
+ {
+ printf("\n\tAllocated nBridgePortId = %u\n", param.nBridgePortId);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Freeze(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_Freeze(gsw_dev);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_Freeze failed with ret code", ret);
+ else
+ {
+ printf("\t%40s\n", "fapi_GSW_Freeze done");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_UnFreeze(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_UnFreeze(gsw_dev);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_UnFreeze failed with ret code", ret);
+ else
+ {
+ printf("\t%40s\n", "fapi_GSW_UnFreeze done");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_MeterAlloc(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_meterCfg_t param = {0};
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_MeterAlloc(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_MeterAlloc failed with ret code", ret);
+ else
+ {
+ printf("\n\tAllocated nMeterId = %u\n", param.nMeterId);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_MeterFree(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_meterCfg_t param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nMeterId", sizeof(param.nMeterId), ¶m.nMeterId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nMeterId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_MeterFree(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_MeterFree failed with ret code", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_MeterFree done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PMAC_RMON_Get(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_PMAC_Cnt_t sVar = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(sVar.nPmacId), &sVar.nPmacId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmacId\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "nPortId", sizeof(sVar.nTxDmaChanId), &sVar.nTxDmaChanId);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PMAC_CountGet(gsw_dev, &sVar);
+ if (ret < 0)
+ printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_RMON_Get failed with ret code", ret);
+ else
+ {
+ printf("\t nPmacId = %u\n\n", sVar.nPmacId);
+ printf("\t nPortId = %u\n", sVar.nTxDmaChanId);
+ printf("\t Egress Total Packet Count = %u\n", sVar.nEgressPktsCount);
+ printf("\t Egress Total Byte Count = %u\n", sVar.nEgressBytesCount);
+ printf("\t Egress Checksum Error Packet Count = %u\n", sVar.nChkSumErrPktsCount);
+ printf("\t Egress Checksum Error Byte Count = %u\n", sVar.nChkSumErrBytesCount);
+ printf("\t Egress Header Packet Count = %u\n", sVar.nEgressHdrPktsCount);
+ printf("\t Egress Header Byte Count = %u\n", sVar.nEgressHdrBytesCount);
+ printf("\t Egress Header Discard Packet Count = %u\n", sVar.nEgressHdrDiscPktsCount);
+ printf("\t Egress Header Discard Byte Count = %u\n\n", sVar.nEgressHdrDiscBytesCount);
+ printf("\t DMA TxCh = %u\n", sVar.nTxDmaChanId);
+ printf("\t Ingress Total Packet Count = %u\n", sVar.nIngressPktsCount);
+ printf("\t Ingress Total Byte Count = %u\n", sVar.nIngressBytesCount);
+ printf("\t Ingress Discard Packet Count = %u\n", sVar.nDiscPktsCount);
+ printf("\t Ingress Discard Byte Count = %u\n", sVar.nDiscBytesCount);
+ printf("\t Ingress Header Packet Count = %u\n", sVar.nIngressHdrPktsCount);
+ printf("\t Ingress Header Byte Count = %u\n", sVar.nIngressHdrBytesCount);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_Debug_PMAC_RMON_Get_All(int prmc, char *prmv[])
+{
+ GSW_PMAC_Cnt_t *eg, *ig;
+ u32 i = 0;
+ u32 start = 0, end = 16;
+ u32 max_read = 0;
+ u8 pmacId = 0;
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+
+ scanParamArg(prmc, prmv, "nPmacId", sizeof(pmacId), &pmacId);
+ scanParamArg(prmc, prmv, "Start", sizeof(start), &start);
+ scanParamArg(prmc, prmv, "End", sizeof(end), &end);
+
+ max_read = end - start;
+ if (max_read > 16 || end > 16)
+ {
+ printf("Display only 16 ports, please check start and end\n");
+ return -1;
+ }
+
+ eg = malloc(sizeof(*eg) * max_read);
+ if (!eg)
+ {
+ printf("\n\tERROR: failed in buffer allocation\n");
+ return -ENOMEM;
+ }
+
+ ig = eg;
+
+ printf("\n");
+ printf("Reading PmacId %d: %s\n", pmacId, "Egress");
+ printf("Reading PmacId %d: %s\n", pmacId, "Ingress");
+ gsw_dev = gsw_get_struc(lif_id, 0);
+
+ for (i = 0; i < max_read; i++)
+ {
+ eg[i].nPmacId = pmacId;
+ eg[i].nTxDmaChanId = start + i;
+
+ ret = GSW_PMAC_CountGet(gsw_dev, &eg[i]);
+ if (ret < 0)
+ {
+ free(eg);
+ printf("\t%40s:\t0x%x\n", "GSW_PMAC_CountGet failed with ret code", ret);
+ return ret;
+ }
+ }
+
+ printf("\n");
+ printf("Rx Logical Port : ");
+ for (i = start; i < end; i++)
+ printf("%11u", i);
+
+ printf("\n");
+ printf("\n");
+ printf("Egress Checksum Error Packet Count : ");
+
+ for (i = 0; i < max_read; i++)
+ printf("%11u", eg[i].nChkSumErrPktsCount);
+
+ printf("\n");
+ printf("Egress Checksum Error Byte Count : ");
+
+ for (i = 0; i < max_read; i++)
+ printf("%11u", eg[i].nChkSumErrBytesCount);
+
+ printf("\n");
+ printf("Egress Total Packet Count : ");
+
+ for (i = 0; i < max_read; i++)
+ printf("%11u", eg[i].nEgressPktsCount);
+
+ printf("\n");
+ printf("Egress Total Byte Count : ");
+
+ for (i = 0; i < max_read; i++)
+ printf("%11u", eg[i].nEgressBytesCount);
+
+ printf("\n");
+ printf("\n");
+ printf("\n");
+
+ printf("DMA TxCh : ");
+ for (i = start; i < end; i++)
+ printf("%11u", i);
+
+ printf("\n");
+ printf("\n");
+
+ printf("Ingress Discard Packet Count : ");
+
+ for (i = 0; i < max_read; i++)
+ printf("%11u", ig[i].nDiscPktsCount);
+
+ printf("\n");
+ printf("Ingress Discard Byte Count : ");
+
+ for (i = 0; i < max_read; i++)
+ printf("%11u", ig[i].nDiscBytesCount);
+
+ printf("\n");
+ printf("Ingress Total Packet Count : ");
+
+ for (i = 0; i < max_read; i++)
+ printf("%11u", ig[i].nIngressPktsCount);
+
+ printf("\n");
+ printf("Ingress Total Byte Count : ");
+
+ for (i = 0; i < max_read; i++)
+ printf("%11u", ig[i].nIngressBytesCount);
+ printf("\n");
+ free(eg);
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_SS_Sptag_Get(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ struct gsw_ss_sptag param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "pid", sizeof(param.pid), ¶m.pid);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: pid\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = gsw_ss_sptag_get(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("fapi_GSW_SS_Sptag_Get failed with ret code: %d\n", ret);
+ else
+ {
+ printf("fapi_GSW_SS_Sptag_Get:\n");
+ printf("\t%40s:\t%d\n", "pid", param.pid);
+ printf("\t%40s:\t%d\n", "rx", param.rx);
+ printf("\t%40s:\t%d\n", "tx", param.tx);
+ printf("\t%40s:\t%d\n", "rx_pen", param.rx_pen);
+ printf("\t%40s:\t%d\n", "tx_pen", param.tx_pen);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_SS_Sptag_Set(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ struct gsw_ss_sptag param = {0};
+ int rret;
+
+ rret = scanParamArg(prmc, prmv, "pid", sizeof(param.pid), ¶m.pid);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: pid\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "mask", sizeof(param.mask), ¶m.mask);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: mask\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "rx", sizeof(param.rx), ¶m.rx);
+ scanParamArg(prmc, prmv, "tx", sizeof(param.tx), ¶m.tx);
+ scanParamArg(prmc, prmv, "rx_pen", sizeof(param.rx_pen), ¶m.rx_pen);
+ scanParamArg(prmc, prmv, "tx_pen", sizeof(param.tx_pen), ¶m.tx_pen);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = gsw_ss_sptag_set(gsw_dev, ¶m);
+ if (ret < 0)
+ printf("fapi_GSW_SS_Sptag_Set failed with ret code: %d\n", ret);
+ else
+ {
+ printf("fapi_GSW_SS_Sptag_Set done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_DSCP_DropPrecedenceCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_DSCP_DropPrecedenceCfg_t param = {0};
+ int i;
+
+ memset(¶m, 0, sizeof(GSW_QoS_DSCP_DropPrecedenceCfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_DSCP_DropPrecedenceCfgGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_WredQueueCfgGet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("GSW QOS DSCP drop precedence configuration:\n");
+ printf("\tIndex\t:\tPrecedence\n");
+ for (i = 0; i < 64; i++)
+ printf("\t%d\t:\t%d\n", i, param.nDSCP_DropPrecedence[0]);
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_DSCP_DropPrecedenceCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_DSCP_DropPrecedenceCfg_t param = {0};
+ int rret;
+ uint8_t index, Val;
+
+ memset(¶m, 0, sizeof(GSW_QoS_DSCP_DropPrecedenceCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nIndex", 1, &index);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nIndex\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nVal", 1, &Val);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVal\n");
+ return OS_ERROR;
+ }
+
+ if (index >= 64)
+ {
+ printf("Wrong nIndex value: %d, should be in range [0 : 63]\n", index);
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_DSCP_DropPrecedenceCfgGet(gsw_dev, ¶m);
+ if (ret < 0) {
+ printf("Initial fapi_GSW_QoS_WredQueueCfgGet failed with ret code: %d\n", ret);
+ return ret;
+ }
+
+ param.nDSCP_DropPrecedence[index] = Val;
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_DSCP_DropPrecedenceCfgSet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_DSCP_DropPrecedenceCfgSet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_DSCP_DropPrecedenceCfgSet done\n");
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ColorMarkingTableGet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_colorMarkingEntry_t param = {0};
+ int rret;
+ uint8_t index = 0, max_index = 0;
+ uint8_t priority = 0, color = 0;
+
+ memset(¶m, 0, sizeof(GSW_QoS_colorMarkingEntry_t));
+
+ rret = scanParamArg(prmc, prmv, "eMode", sizeof(param.eMode), ¶m.eMode);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eMode\n");
+ return OS_ERROR;
+ }
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_ColorMarkingTableGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_ColorMarkingTableGet failed with ret code: %d\n", ret);
+ else
+ {
+ switch (param.eMode)
+ {
+ case GSW_MARKING_ALL_GREEN: // 0
+ printf("All Green Color Mode.\n");
+ max_index = 0;
+ break;
+ case GSW_MARKING_INTERNAL_MARKING: // 1
+ printf("Internal Marking Mode.\n");
+ max_index = 0;
+ break;
+ case GSW_MARKING_DEI: // 2
+ printf("DEI Mode\n");
+ max_index = 0;
+ break;
+ case GSW_MARKING_PCP_8P0D:
+ case GSW_MARKING_PCP_7P1D:
+ case GSW_MARKING_PCP_6P2D:
+ case GSW_MARKING_PCP_5P3D:
+ printf("\tPCP Index : Priority : Color\n");
+ max_index = 16;
+ break;
+ case GSW_MARKING_DSCP_AF:
+ printf("\tDSCP Index : Priority : Color\n");
+ max_index = 64;
+ default:
+ printf("Not Supported Mode (%d) of Color.\n", param.eMode);
+ break;
+ }
+
+ for (index = 0; index < max_index; index++)
+ {
+ priority = param.nPriority[index];
+ color = param.nColor[index];
+ printf("\t %2d : %2d : %2d\n", index, priority, color);
+ }
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ColorMarkingTableSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+ GSW_QoS_colorMarkingEntry_t param = {0};
+ int rret;
+ uint8_t index;
+ uint8_t priority = 0, color = 0;
+
+ memset(¶m, 0, sizeof(GSW_QoS_colorMarkingEntry_t));
+
+ rret = scanParamArg(prmc, prmv, "eMode", sizeof(param.eMode), ¶m.eMode);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eMode\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nIndex", 1, &index);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nIndex\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nPriority", 1, &priority);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPriority\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nColor", 1, &color);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nColor\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_ColorMarkingTableGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ {
+ printf("Initial fapi_GSW_QoS_ColorMarkingTableGet failed with ret code: %d\n", ret);
+ return ret;
+ }
+
+ if ((param.eMode >= GSW_MARKING_PCP_8P0D) && (param.eMode <= GSW_MARKING_DSCP_AF))
+ {
+ if (param.eMode != GSW_MARKING_DSCP_AF)
+ {
+ if (index >= 16)
+ {
+ printf("nIndex (%d) is out of range (0~15)\n", index);
+ return OS_ERROR;
+ }
+ }
+ else
+ {
+ if (index >= 64)
+ {
+ printf("nIndex (%d) is out of range (0~63)\n", index);
+ return OS_ERROR;
+ }
+ }
+ priority &= 0x7;
+ color &= 0x3;
+ param.nPriority[index] = priority;
+ param.nColor[index] = color;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_ColorMarkingTableSet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_ColorMarkingTableSet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_ColorMarkingTableSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ColorReMarkingTableGet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_colorRemarkingEntry_t param = {0};
+ int rret;
+ uint8_t mode = GSW_REMARKING_NONE;
+ uint8_t dei = 0, pcp = 0;
+ uint8_t dscp = 0;
+
+ memset(¶m, 0, sizeof(GSW_QoS_colorRemarkingEntry_t));
+
+ rret = scanParamArg(prmc, prmv, "eMode", sizeof(param.eMode), ¶m.eMode);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eMode\n");
+ return OS_ERROR;
+ }
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_ColorReMarkingTableGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_ColorReMarkingTableGet failed with ret code:%d\n", ret);
+ else
+ {
+ printf("Mode of color remarking: %d\n", param.eMode);
+ switch (param.eMode)
+ {
+ case GSW_REMARKING_NONE:
+ printf("None Remarking Mode of Color.\n");
+ break;
+
+ case GSW_REMARKING_DEI:
+ printf("DEI Mode of Color Remarking.\n");
+ break;
+
+ case GSW_REMARKING_PCP_8P0D:
+ /* For mode 3 there are 16 entries corresponding to Priority + Color Bit Table Entry index from 0 to 15 */
+ case GSW_REMARKING_PCP_7P1D:
+ /* For mode 4 there are 16 entries corresponding to Priority + Color Bit Table Entry index from 16 to 31 */
+ case GSW_REMARKING_PCP_6P2D:
+ /* For mode 5 there are 16 entries corresponding to Priority + Color Bit Table Entry index from 32 to 47 */
+ case GSW_REMARKING_PCP_5P3D:
+ /* For mode 6 there are 16 entries corresponding to Priority + Color Bit Table Entry index from 48 to 63 */
+
+ printf("\tIndex : DEI : PCP\n");
+ /* Get Color Bit 0's entries from 0 t0 7, Color Bit 1's entries from 8 t0 15*/
+ for (uint8_t index = 0; index <= 15; index++)
+ {
+ if (index == 0)
+ printf("Green -----------------------\n");
+ else if (index == 8)
+ printf("Yellow-----------------------\n");
+
+ /*Get DEI in PCE_TBL_VAL (bit 0)*/
+ dei = param.nVal[index] & 0x1;
+ /*Get PCP in PCE_TBL_VAL (bit 3:1)*/
+ pcp = (param.nVal[index] & 0xE) >> 1;
+ printf("\t%2d : %d : %3d", index, dei, pcp);
+ printf(" (0x%x)", param.nVal[index]); // Only for Debug
+ printf("\n");
+ }
+
+ break;
+
+ case GSW_REMARKING_DSCP_AF:
+ /* For mode 7 there are 16 entries corresponding to Traffic Class + Color Bit Table Entry index from 64 to 79*/
+
+ printf("\tIndex : DSCP\n");
+ /*Get Color Bit 0's entries from 0 t0 7 Color Bit 1's entries from 8 t0 15*/
+ for (uint8_t index = 0; index <= 15; index++)
+ {
+ if (index == 0)
+ printf("Green -----------------------\n");
+ else if (index == 8)
+ printf("Yellow-----------------------\n");
+
+ /*Get DSCP in PCE_TBL_VAL (bit 5:0)*/
+ dscp = param.nVal[index] & 0x3F;
+ printf("\t%2d : %d", index, dscp);
+ printf(" (0x%x)", param.nVal[index]); // Only for Debug
+ printf("\n");
+ }
+
+ break;
+ default:
+ printf("Not Supported Mode (%d) of Color.\n", param.eMode);
+ break;
+ }
+ return ret;
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_DSCP2_PCPTableGet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_DSCP2PCP_map_t param = {0};
+ int rret;
+ uint8_t index;
+
+ memset(¶m, 0, sizeof(GSW_DSCP2PCP_map_t));
+
+ rret = scanParamArg(prmc, prmv, "nIndex", sizeof(param.nIndex), ¶m.nIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nIndex\n");
+ return OS_ERROR;
+ }
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_Dscp2PcpTableGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_DSCP2_PCPTableGet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("\tDSCP2PCP Mapping Table Index : %d\n", param.nIndex);
+ printf("\tDSCP2PCP index : PCP value\n");
+ for (index = 0; index < 64; index++)
+ {
+ printf("\t\t%2d : %d\n", index, param.nMap[index]);
+ }
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_DSCP2_PCPTableSet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_DSCP2PCP_map_t param = {0};
+ int rret;
+ uint8_t nDscpIndex = 0, nVal = 0;
+
+ memset(¶m, 0, sizeof(GSW_DSCP2PCP_map_t));
+
+ rret = scanParamArg(prmc, prmv, "nIndex", sizeof(param.nIndex), ¶m.nIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nIndex\n");
+ return OS_ERROR;
+ }
+ if (param.nIndex > 7)
+ {
+ printf("nIndex (%d) is out of range (0~7)\n", param.nIndex);
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nDscpIndex", 1, &nDscpIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nDscpIndex\n");
+ return OS_ERROR;
+ }
+ if (nDscpIndex > 63)
+ {
+ printf("nDscpIndex (%d) is out of range (0~64)\n", nDscpIndex);
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nVal", 1, &nVal);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVal\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_Dscp2PcpTableGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ {
+ printf("Initial GSW_QOS_Dscp2PcpTableGet failed with ret code: %d\n", ret);
+ return ret;
+ }
+ else
+ {
+ param.nMap[nDscpIndex] = nVal;
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_Dscp2PcpTableSet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("GSW_QOS_Dscp2PcpTableSet failed with ret code: %d\n", ret);
+ return ret;
+ }
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_ColorReMarkingTableSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+ GSW_QoS_colorRemarkingEntry_t param = {0};
+ int rret;
+ uint8_t dei = 0, pcp = 0;
+ uint8_t index = 0;
+ uint8_t mode = GSW_REMARKING_NONE;
+
+ memset(¶m, 0, sizeof(GSW_QoS_colorRemarkingEntry_t));
+
+ rret = scanParamArg(prmc, prmv, "eMode", sizeof(param.eMode), ¶m.eMode);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eMode\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "nIndex", 1, &index);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nIndex\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_ColorReMarkingTableGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ {
+ printf("Initial fapi_GSW_QoS_ColorReMarkingTableSet failed with ret code: %d\n", ret);
+ return ret;
+ }
+ if (param.eMode == GSW_REMARKING_DSCP_AF)
+ {
+
+ uint8_t dscp_val = 0;
+
+ rret = scanParamArg(prmc, prmv, "dscp", 1, &dscp_val);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: dscp\n");
+ return OS_ERROR;
+ }
+
+ scanParamArg(prmc, prmv, "dscp_val", 1, &dscp_val);
+ printf("Color Remarking Table Index %d DSCP value Before Changing is %d\n", index, param.nVal[index]);
+ param.nVal[index] = dscp_val;
+ printf("Color Remarking Table Index %d DSCP value Will be Changed to %d\n", index, dscp_val);
+ }
+ else
+ { // one of GSW_REMARKING_PCP_8P0D, GSW_REMARKING_PCP_7P1D, GSW_REMARKING_PCP_6P2D and GSW_REMARKING_PCP_5P3D
+
+ uint8_t dei = 0, pcp = 0;
+
+ printf("Dbg: Index %d Value read before change: 0x%x\n", index, param.nVal[index]);
+ dei = param.nVal[index] & 0x1;
+ pcp = (param.nVal[index] & 0xE) >> 1;
+ printf("Color Remarking Table Index %d \n\tDEI value Before Changing %d and PCP value Before Changing %d\n", index, dei, pcp);
+
+ rret = scanParamArg(prmc, prmv, "dei", 1, &dei);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: dei\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "pcp", 1, &pcp);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: pcp\n");
+ return OS_ERROR;
+ }
+
+ dei &= 0x1; // DEI is 1 bit value at bit 0
+ pcp &= 0x7; // PCP is 3 bits value at bit 1~3
+ printf("Color Remarking Table Index %d \n\tDEI value will be changed to %d and PCP value will be changed to %d\n", index, dei, pcp);
+ param.nVal[index] = ((pcp << 1) & 0xE) | dei;
+ printf("Dbg: Index %d Value changed before writting: 0x%x\n", index, param.nVal[index]);
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_ColorReMarkingTableSet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_ColorReMarkingTableSet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("fapi_GSW_QoS_ColorMarkingTableSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_PortReMarkingCfgGet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_portRemarkingCfg_t param;
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_portRemarkingCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_PortRemarkingCfgGet(gsw_dev, ¶m);
+
+ /* TODO check agains total number of ports including vitual ports would require gsw_data from gsw_priv.h */
+ if (param.nPortId >= 16)
+ {
+ printf("nPortId more than total number of ports\n");
+ return GSW_statusErr;
+ }
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_PortReMarkingCfgGet failed with ret code: %d\n", ret);
+ else
+ {
+ switch (param.eDSCP_IngressRemarkingEnable)
+ {
+ case GSW_DSCP_REMARK_DISABLE:
+ printf("\tDSCP_REMARK DISABLE: No DSCP Remarking is done on the egress port.\n");
+ break;
+ case GSW_DSCP_REMARK_TC6:
+ printf("\tDSCP_REMARK_TC6: TC DSCP 6-Bit Remarking.\n");
+ break;
+ case GSW_DSCP_REMARK_TC3:
+ printf("\tDSCP_REMARK_TC3: TC DSCP 3-Bit Remarking.\n");
+ break;
+ case GSW_DSCP_REMARK_DP3:
+ printf("\tDSCP_REMARK_DP3: Drop Precedence Remarking.\n");
+ break;
+ case GSW_DSCP_REMARK_DP3_TC3:
+ printf("\tDSCP_REMARK_DP3_TC3: Drop Precedence Remarking and the upper 3-Bits of the DSCP field are remarked based on the traffic class.\n");
+ break;
+ default:
+ printf("Wrong DSCP Ingress Remarking Enable Value.\n");
+ break;
+ }
+
+ if (param.bDSCP_EgressRemarkingEnable)
+ printf("\tEgress DSCP Remarking: Enabled.\n");
+ else
+ printf("\tEgress DSCP Remarking: Disabled.\n");
+
+ if (param.bPCP_IngressRemarkingEnable)
+ printf("\tIngress PCP Remarking: Enabled.\n");
+ else
+ printf("\tIngress PCP Remarking: Disabled.\n");
+
+ if (param.bPCP_EgressRemarkingEnable)
+ printf("\tEgress PCP Remarking: Enabled.\n");
+ else
+ printf("\tEgress PCP Remarking: Disabled.\n");
+
+ if (param.bSTAG_PCP_IngressRemarkingEnable)
+ printf("\tIngress STAG VLAN PCP Remarking: Enabled.\n");
+ else
+ printf("\tIngress STAG VLAN PCP Remarking: Disabled.\n");
+
+ if (param.bSTAG_DEI_IngressRemarkingEnable)
+ printf("\tIngress STAG VLAN DEI Remarking: Enabled.\n");
+ else
+ printf("\tIngress STAG VLAN DEI Remarking: Disabled.\n");
+
+ if (param.bSTAG_PCP_DEI_EgressRemarkingEnable)
+ printf("\tEgress STAG VLAN PCP & DEI Remarking: Enabled.\n");
+ else
+ printf("\tEgress STAG VLAN PCP & DEI Remarking: Disabled\n");
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_PortReMarkingCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+ GSW_QoS_portRemarkingCfg_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_QoS_portRemarkingCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortId\n");
+ return OS_ERROR;
+ }
+
+ /* TODO check agains total number of ports including vitual ports would require gsw_data from gsw_priv.h */
+ if (param.nPortId >= 16)
+ {
+ printf("nPortId more than total number of ports\n");
+ return GSW_statusErr;
+ }
+
+ rret = scanParamArg(prmc, prmv, "bDscpIngrEn", sizeof(param.eDSCP_IngressRemarkingEnable), ¶m.eDSCP_IngressRemarkingEnable);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nIndex\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "bDscpEgrEn", sizeof(param.bDSCP_EgressRemarkingEnable), ¶m.bDSCP_EgressRemarkingEnable);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: bDscpEgrEn\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "bPcpIngrEn", sizeof(param.bPCP_IngressRemarkingEnable), ¶m.bPCP_IngressRemarkingEnable);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: bPcpIngrEn\n");
+ return OS_ERROR;
+ }
+
+ param.eDSCP_IngressRemarkingEnable = param.eDSCP_IngressRemarkingEnable % 2;
+ param.bDSCP_EgressRemarkingEnable = param.bDSCP_EgressRemarkingEnable % 2;
+ param.bPCP_IngressRemarkingEnable = param.bPCP_IngressRemarkingEnable % 2;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_PortRemarkingCfgSet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("GSW_QoS_PortRemarkingCfgSet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("GSW_QoS_PortRemarkingCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_StormCfgGet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_QoS_stormCfg_t param;
+
+ memset(¶m, 0, sizeof(GSW_QoS_stormCfg_t));
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_StormCfgGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_StormCfgGet failed with ret code: %d\n", ret);
+ else
+ {
+ printf("\tStorm Control Meter ID: %d\n", param.nMeterId);
+ printf("\tStorm Control Broadcast: %s\n", param.bBroadcast ? "Enabled" : "Disabled");
+ printf("\tStorm Control Multicast: %s\n", param.bMulticast ? "Enabled" : "Disabled");
+ printf("\tStorm Control Unknowcast: %s\n", param.bUnknownUnicast ? "Enabled" : "Disabled");
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_StormCfgSet(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+ GSW_QoS_stormCfg_t param = {0};
+ int rret;
+ bool en_flg;
+ memset(¶m, 0, sizeof(GSW_QoS_stormCfg_t));
+
+ rret = scanParamArg(prmc, prmv, "bEn", 1, &en_flg);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: bEn\n");
+ return OS_ERROR;
+ }
+
+ en_flg &= 0x1;
+ param.bBroadcast = en_flg;
+ param.bMulticast = en_flg;
+ param.bUnknownUnicast = en_flg;
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QoS_StormCfgSet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("GSW_QoS_StormCfgSet failed with ret code: %d\n ", ret);
+ else
+ {
+ printf("GSW_QoS_StormCfgSet done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_PmapperTableGet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_PMAPPER_t param = {0};
+ int rret;
+ uint8_t index = 0;
+
+ memset(¶m, 0, sizeof(GSW_PMAPPER_t));
+
+ rret = scanParamArg(prmc, prmv, "nPmapperId", sizeof(param.nPmapperId), ¶m.nPmapperId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmapperId\n");
+ return OS_ERROR;
+ }
+ if (param.nPmapperId > 31)
+ {
+ printf("nPmapperId (%d) is out of range (0~31)\n", param.nPmapperId);
+ return OS_ERROR;
+ }
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_PmapperTableGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_QoS_PmapperTableGet failed with ret code. P-Mapper ID invalid\n");
+ else
+ {
+ printf("\tP-Mapper Index: %d\n", param.nPmapperId);
+ printf("\tEntryIndex : DestSubIfIdGroup\n");
+ for (index = 0; index < 73; index++)
+ {
+ printf("\t %2d : 0x%x\n", index, param.nDestSubIfIdGroup[index]);
+ }
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_QoS_PmapperTableSet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_PMAPPER_t param = {0};
+ int rret;
+ uint8_t nEntryIndex = 0, nVal = 0, index;
+
+ memset(¶m, 0, sizeof(GSW_PMAPPER_t));
+
+ rret = scanParamArg(prmc, prmv, "nPmapperId", sizeof(param.nPmapperId), ¶m.nPmapperId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPmapperId\n");
+ return OS_ERROR;
+ }
+ if (param.nPmapperId > 31)
+ {
+ printf("nPmapperId (%d) is out of range (0~31)\n", param.nPmapperId);
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nEntryIndex", 1, &nEntryIndex);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nEntryIndex\n");
+ return OS_ERROR;
+ }
+ if (nEntryIndex > 72)
+ {
+ printf("nEntryIndex (%d) is out of range (0~72)\n", nEntryIndex);
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nVal", 1, &nVal);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nVal\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_PmapperTableGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ {
+ /*P-Mapper ID are to be added consecutively.
+ If P-Mapper ID is invalid ,find a free P-Mapper table index and allocate
+ New P-Mapper configuration table index*/
+ printf("Selected nPmapperId (%d) is NOT in use, set nPmapperId to invalid to get a free one.\n", param.nPmapperId);
+ param.nPmapperId = 0xFFFF;
+ for (index = 0; index < 73; index++)
+ {
+ if (index == nEntryIndex)
+ param.nDestSubIfIdGroup[nEntryIndex] = nVal;
+ else
+ param.nDestSubIfIdGroup[nEntryIndex] = 0;
+ }
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_PmapperTableSet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("GSW_QOS_PmapperTableSet failed with ret code %d\n", ret);
+ return ret;
+ }
+ return ret;
+ }
+ else
+ {
+ param.nDestSubIfIdGroup[nEntryIndex] = nVal;
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_QOS_PmapperTableSet(gsw_dev, ¶m);
+ if (ret < 0)
+ {
+ printf("GSW_QOS_PmapperTableSet failed with ret code %d\n", ret);
+ return ret;
+ }
+ return ret;
+ }
+}
+
+GSW_return_t fapi_GSW_Pce_RuleBlockSize(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+ GSW_PCE_rule_alloc_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_PCE_rule_alloc_t));
+ rret = scanParamArg(prmc, prmv, "blockid", sizeof(param.blockid), ¶m.blockid);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: blockid\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleBlockSize(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("GSW_PceRuleBlockSize failed with ret code %d\n", ret);
+ else
+ {
+ printf("ret = %d\n", ret);
+ printf("blockid = %u\n", param.blockid);
+ printf("num_of_rules = %u\n", param.num_of_rules);
+ printf("GSW_PceRuleBlockSize done\n");
+ }
+
+ return ret;
+}
+
+GSW_return_t fapi_GSW_BridgePort_LoopRead(int prmc, char *prmv[])
+{
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret = 0;
+ GSW_BRIDGE_portLoopRead_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_BRIDGE_portLoopRead_t));
+ rret = scanParamArg(prmc, prmv, "nBridgePortId", sizeof(param.nBridgePortId), ¶m.nBridgePortId);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nBridgePortId\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_BridgePortLoopRead(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("GSW_BridgePortLoopRead failed with ret code: %d", ret);
+ else
+ {
+ printf("BridgePortId = %u\n", param.nBridgePortId);
+ printf("nLoopViolationCount = %u\n", param.nLoopViolationCount);
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_TflowCountModeGet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_TflowCmodeConf_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_TflowCmodeConf_t));
+
+ rret = scanParamArg(prmc, prmv, "eCntType", sizeof(param.eCountType), ¶m.eCountType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eCntType\n");
+ return OS_ERROR;
+ }
+ if (param.eCountType > GSW_TFLOW_COUNTER_PCE_BP_Tx)
+ {
+ printf("eCntType (%d) is out of range (0~3)\n", param.eCountType);
+ return OS_ERROR;
+ }
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_TflowCountModeGet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_TflowCountModeGet failed with ret code: %d\n", ret);
+ else
+ {
+ switch (param.eCountType)
+ {
+ case GSW_TFLOW_COUNTER_ALL:
+ case GSW_TFLOW_COUNTER_PCE_Rx:
+ // 1.PCE TFLOW Rx config.
+ // Read PCE TFLOW Rx RMON register.
+ printf("RX TFlow Counter:\n");
+ break;
+
+ case GSW_TFLOW_COUNTER_PCE_Tx:
+ // 2.PCE TFLOW Tx config
+ // Read PCE TFLOW Tx RMON register.
+ printf("TX TFlow Counter:\n");
+ break;
+
+ case GSW_TFLOW_COUNTER_PCE_BP_Tx:
+ // 3.PCE-Bypass TFLOW Tx config
+ // Write PCE-Bypass TFLOW Tx RMON register.
+ printf("TX BP TFlow Counter:\n");
+ break;
+
+ default:
+ /* Invalid input */
+ printf("Invalid eCntType %d!\n", param.eCountType);
+ return GSW_statusErr;
+ break;
+ }
+
+ printf("\teCountMode: %d\n", param.eCountMode);
+ if (param.eCountMode == GSW_TFLOW_CMODE_BRIDGE)
+ printf("\tnBrpLsb: %d\n", param.nBrpLsb);
+ else if (param.eCountMode == GSW_TFLOW_CMODE_CTP)
+ printf("\tnCtpLsb: %d\n", param.nCtpLsb);
+ else if (param.eCountMode == GSW_TFLOW_CMODE_LOGICAL)
+ printf("\tLogical Port Mode.\n");
+ else
+ printf("\tGlobal Mode.\n");
+ printf("\tnPortMsb: %d\n", param.nPortMsb);
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_TflowCountModeSet(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_TflowCmodeConf_t param = {0};
+ int rret;
+
+ memset(¶m, 0, sizeof(GSW_TflowCmodeConf_t));
+
+ rret = scanParamArg(prmc, prmv, "eCntType", sizeof(param.eCountType), ¶m.eCountType);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eCntType\n");
+ return OS_ERROR;
+ }
+ if (param.eCountType > GSW_TFLOW_COUNTER_PCE_BP_Tx)
+ {
+ printf("eCntType (%d) is out of range (0~3)\n", param.eCountType);
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "eCntMode", sizeof(param.eCountMode), ¶m.eCountMode);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: eCntMode\n");
+ return OS_ERROR;
+ }
+ if (param.eCountMode > 3)
+ {
+ printf("eCountMode (%d) is out of range (0~3)\n", param.eCountMode);
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nPortMsb", sizeof(param.nPortMsb), ¶m.nPortMsb);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nPortMsb\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nCtpLsb", sizeof(param.nCtpLsb), ¶m.nCtpLsb);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nCtpLsb\n");
+ return OS_ERROR;
+ }
+
+ rret = scanParamArg(prmc, prmv, "nBrpLsb", sizeof(param.nBrpLsb), ¶m.nBrpLsb);
+ if (rret < 1)
+ {
+ printf("Parameter not Found: nBrpLsb\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_TflowCountModeSet(gsw_dev, ¶m);
+
+ if (ret < 0)
+ {
+ printf("fapi_GSW_TflowCountModeSet Return Error: %d\n", ret);
+ return ret;
+ }
+ else
+ {
+ printf("fapi_GSW_TflowCountModeSet Success\n");
+ return ret;
+ }
+}
+
+GSW_return_t fapi_GSW_Mac_TableLoopDetect(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_MAC_tableLoopDetect_t param = {0};
+ int rret;
+ size_t index;
+
+ memset(¶m, 0, sizeof(GSW_MAC_tableLoopDetect_t));
+
+ rret = scanParamArg(prmc, prmv, "bp_map_in[0]", sizeof(param.bp_map_in[0]), &(param.bp_map_in[0]));
+ rret |= scanParamArg(prmc, prmv, "bp_map_in[1]", sizeof(param.bp_map_in[1]), &(param.bp_map_in[1]));
+ rret |= scanParamArg(prmc, prmv, "bp_map_in[2]", sizeof(param.bp_map_in[2]), &(param.bp_map_in[2]));
+ rret |= scanParamArg(prmc, prmv, "bp_map_in[3]", sizeof(param.bp_map_in[3]), &(param.bp_map_in[3]));
+
+ if (rret < 1)
+ {
+ printf("Parameter: bp_map_in[] not found or incorrect\n");
+ return OS_ERROR;
+ }
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_MAC_TableLoopDetect(gsw_dev, ¶m);
+
+ if (ret < 0)
+ printf("fapi_GSW_Mac_TableLoopDetect failed with ret code: %d\n", ret);
+ else
+ {
+ for (size_t index = 0; index < ARRAY_SIZE(param.bp_map_in); index++)
+ {
+ printf(" bp_map_in[%lu] = 0x%08x\n", index, param.bp_map_in[index]);
+ }
+ for (size_t index = 0; index < ARRAY_SIZE(param.bp_map_out); index++)
+ {
+ printf(" bp_map_out[%lu] = 0x%08x\n", index, param.bp_map_out[index]);
+ }
+ }
+ return ret;
+}
+
+GSW_return_t fapi_GSW_PCE_RuleMove(int prmc, char *prmv[])
+{
+
+ GSW_Device_t *gsw_dev;
+ GSW_return_t ret;
+ GSW_PCE_rule_move_t param = {0};
+ int rret;
+ size_t index;
+
+ memset(¶m, 0, sizeof(GSW_PCE_rule_move_t));
+
+ rret = scanParamArg(prmc, prmv, "cur.nLogicalPortId", sizeof(param.cur.logicalportid), ¶m.cur.logicalportid);
+ if (rret < 1)
+ {
+ printf("Parameter: cur.nLogicalPortId not found\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "cur.pattern.nIndex", sizeof(param.cur.nIndex), ¶m.cur.nIndex);
+ if (rret < 1)
+ {
+ printf("Parameter: cur.nIndex not found\n");
+ return OS_ERROR;
+ }
+ scanParamArg(prmc, prmv, "cur.nSubIfIdGroup", sizeof(param.cur.subifidgroup), ¶m.cur.subifidgroup);
+ scanParamArg(prmc, prmv, "cur.region", sizeof(param.cur.region), ¶m.cur.region);
+
+ rret = scanParamArg(prmc, prmv, "new.nLogicalPortId", sizeof(param.new.logicalportid), ¶m.new.logicalportid);
+ if (rret < 1)
+ {
+ printf("Parameter: new.nLogicalPortId not found\n");
+ return OS_ERROR;
+ }
+ rret = scanParamArg(prmc, prmv, "new.pattern.nIndex", sizeof(param.new.nIndex), ¶m.new.nIndex);
+ if (rret < 1)
+ {
+ printf("Parameter: new.nIndex not found\n");
+ return OS_ERROR;
+ }
+ scanParamArg(prmc, prmv, "new.nSubIfIdGroup", sizeof(param.new.subifidgroup), ¶m.new.subifidgroup);
+ scanParamArg(prmc, prmv, "new.region", sizeof(param.new.region), ¶m.new.region);
+
+ gsw_dev = gsw_get_struc(lif_id, 0);
+ ret = GSW_PceRuleMove(gsw_dev, ¶m);
+
+ if (ret < 0)
+ {
+ printf("GSW_PceRuleMove failed with ret code: %d\n", ret);
+ }
+ else
+ {
+ printf("GSW_PceRuleMove success with ret code: %d\n", ret);
+ }
+ return ret;
+}
diff --git a/feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi.h
similarity index 78%
rename from feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi.h
rename to feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi.h
index f17c90b..e7e7656 100644
--- a/feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi.h
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi.h
@@ -55,8 +55,13 @@
GSW_return_t fapi_GSW_MAC_TableEntryRead(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_QoS_QueuePortSet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_QoS_QueuePortGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_QueueCfgSet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_QueueCfgGet(int prmc, char *prmv[]);
+
GSW_return_t fapi_GSW_CPU_PortCfgGet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_CPU_PortCfgSet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_CPU_PortSet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_CPU_PortGet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_BridgePortConfigGet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_BridgePortConfigSet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_CtpPortConfigGet(int prmc, char *prmv[]);
@@ -80,6 +85,7 @@
GSW_return_t fapi_GSW_STP_BPDU_RuleGet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_RegisterMod(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_Debug_RMON_Port_Get(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_DEBUG_RMON_Port_Get_All(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_QoS_MeterCfgGet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_QoS_MeterCfgSet(int prmc, char *prmv[]);
@@ -121,6 +127,12 @@
GSW_return_t fapi_GSW_GPIO_Configure(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_Reboot(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_SysReg_Rd(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_SysReg_Wr(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_SysReg_Mod(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_Cml_Clk_Get(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_Cml_Clk_Set(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_Sfp_Get(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_Sfp_Set(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_MAC_TableCondClear(int prmc, char *prmv[]);
@@ -136,6 +148,8 @@
GSW_return_t fapi_GSW_PBB_TunnelTempate_Alloc(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_PBB_TunnelTempate_Free(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_RMON_PortGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_RMON_ModeSet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_RMON_MeterGet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_RMON_FlowGet(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_RMON_TFlowClear(int prmc, char *prmv[]);
@@ -146,11 +160,38 @@
GSW_return_t fapi_GSW_Freeze(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_UnFreeze(int prmc, char *prmv[]);
-// GSW_return_t fapi_GSW_DEBUG_RMON_Port_Get_All(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_QoS_MeterFree(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_QoS_MeterAlloc(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_PMAC_RMON_Get(int prmc, char *prmv[]);
GSW_return_t fapi_GSW_Debug_PMAC_RMON_Get_All(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_SS_Sptag_Get(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_SS_Sptag_Set(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_DSCP_DropPrecedenceCfgGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_DSCP_DropPrecedenceCfgSet(int prmc, char *prmv[]);
+
+GSW_return_t fapi_GSW_QoS_ColorMarkingTableGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_ColorMarkingTableSet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_ColorReMarkingTableGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_ColorReMarkingTableSet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_DSCP2_PCPTableGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_DSCP2_PCPTableSet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_PortReMarkingCfgGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_PortReMarkingCfgSet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_StormCfgGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_StormCfgSet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_PmapperTableGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_QoS_PmapperTableSet(int prmc, char *prmv[]);
+
+GSW_return_t fapi_GSW_Pce_RuleBlockSize(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_BridgePort_LoopRead(int prmc, char *prmv[]);
+
+GSW_return_t fapi_GSW_TflowCountModeGet(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_TflowCountModeSet(int prmc, char *prmv[]);
+
+GSW_return_t fapi_GSW_Mac_TableLoopDetect(int prmc, char *prmv[]);
+GSW_return_t fapi_GSW_PCE_RuleMove(int prmc, char *prmv[]);
+
+
#endif /* _FAPI_GSW_HOST_H_ */
diff --git a/feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi_mdio_relay.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi_mdio_relay.c
similarity index 71%
rename from feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi_mdio_relay.c
rename to feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi_mdio_relay.c
index f05727f..9eb186c 100644
--- a/feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi_mdio_relay.c
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi_mdio_relay.c
@@ -9,6 +9,8 @@
******************************************************************************/
#include <os_types.h>
+#include <os_linux.h>
+#include <os_linux.h>
#include <gsw_device.h>
#include <host_adapt.h>
#include <mdio_relay.h>
@@ -18,7 +20,6 @@
#define NUM_TC 16
#define MAX_NUM_OF_DISPLAY_PORTS 2
-
/* read internal GPHY MDIO/MMD registers */
int fapi_int_gphy_read(int prmc, char *prmv[])
{
@@ -28,33 +29,34 @@
int rret;
rret = scanParamArg(prmc, prmv, "phy", sizeof(param.phy), ¶m.phy);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: phy\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "mmd", sizeof(param.mmd), ¶m.mmd);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: mmd\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "reg", sizeof(param.reg), ¶m.reg);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: reg\n");
return OS_ERROR;
}
- gsw_dev = gsw_get_struc(lif_id,0);
+ gsw_dev = gsw_get_struc(lif_id, 0);
ret = int_gphy_read(gsw_dev, ¶m);
-
if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_int_gphy_read failed with ret code", ret);
- else
- printf("fapi_int_gphy_read:\tphy=0x%x mmd=0x%x reg=0x%x ret=0x%x\n",param.reg,param.mmd,param.reg,param.data);
- return 0;
-
+ printf("\t%40s:\t0x%x\n", "fapi_int_gphy_read failed with ret code", ret);
+ else
+ printf("fapi_int_gphy_read:\tphy=0x%x mmd=0x%x reg=0x%x ret=0x%x\n", param.reg, param.mmd, param.reg, param.data);
+ return 0;
}
/* write internal GPHY MDIO/MMD registers */
@@ -66,39 +68,41 @@
int rret;
rret = scanParamArg(prmc, prmv, "phy", sizeof(param.phy), ¶m.phy);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: phy\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "mmd", sizeof(param.mmd), ¶m.mmd);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: mmd\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "reg", sizeof(param.reg), ¶m.reg);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: reg\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "data", sizeof(param.data), ¶m.data);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: data\n");
return OS_ERROR;
}
- gsw_dev = gsw_get_struc(lif_id,0);
+ gsw_dev = gsw_get_struc(lif_id, 0);
ret = int_gphy_write(gsw_dev, ¶m);
-
if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_int_gphy_write failed with ret code", ret);
- else
- printf("fapi_int_gphy_write:\tphy=0x%x mmd=0x%x reg=0x%x data=0x%x\n",param.reg,param.mmd,param.reg,param.data);
- return 0;
-
+ printf("\t%40s:\t0x%x\n", "fapi_int_gphy_write failed with ret code", ret);
+ else
+ printf("fapi_int_gphy_write:\tphy=0x%x mmd=0x%x reg=0x%x data=0x%x\n", param.reg, param.mmd, param.reg, param.data);
+ return 0;
}
// /* modify internal GPHY MDIO/MMD registers */
@@ -110,44 +114,47 @@
int rret;
rret = scanParamArg(prmc, prmv, "phy", sizeof(param.phy), ¶m.phy);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: phy\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "mmd", sizeof(param.mmd), ¶m.mmd);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: mmd\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "reg", sizeof(param.reg), ¶m.reg);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: reg\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "data", sizeof(param.data), ¶m.data);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: data\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "mask", sizeof(param.mask), ¶m.mask);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: mask\n");
return OS_ERROR;
}
- gsw_dev = gsw_get_struc(lif_id,0);
+ gsw_dev = gsw_get_struc(lif_id, 0);
ret = int_gphy_mod(gsw_dev, ¶m);
-
if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_int_gphy_mod failed with ret code", ret);
- else
- printf("fapi_int_gphy_mod:\tphy=0x%x mmd=0x%x reg=0x%x data=0x%x mask=0x%x\n",param.reg,param.mmd,param.reg,param.data, param.mask);
- return 0;
-
+ printf("\t%40s:\t0x%x\n", "fapi_int_gphy_mod failed with ret code", ret);
+ else
+ printf("fapi_int_gphy_mod:\tphy=0x%x mmd=0x%x reg=0x%x data=0x%x mask=0x%x\n", param.reg, param.mmd, param.reg, param.data, param.mask);
+ return 0;
}
/* read external GPHY MDIO/MMD registers via MDIO bus */
@@ -159,33 +166,34 @@
int rret;
rret = scanParamArg(prmc, prmv, "phy", sizeof(param.phy), ¶m.phy);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: phy\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "mmd", sizeof(param.mmd), ¶m.mmd);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: mmd\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "reg", sizeof(param.reg), ¶m.reg);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: reg\n");
return OS_ERROR;
}
- gsw_dev = gsw_get_struc(lif_id,0);
+ gsw_dev = gsw_get_struc(lif_id, 0);
ret = ext_mdio_read(gsw_dev, ¶m);
-
if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_ext_mdio_read failed with ret code", ret);
- else
- printf("fapi_ext_mdio_read:\tphy=0x%x mmd=0x%x reg=0x%x ret=0x%x\n",param.reg,param.mmd,param.reg,param.data);
- return 0;
-
+ printf("\t%40s:\t0x%x\n", "fapi_ext_mdio_read failed with ret code", ret);
+ else
+ printf("fapi_ext_mdio_read:\tphy=0x%x mmd=0x%x reg=0x%x ret=0x%x\n", param.reg, param.mmd, param.reg, param.data);
+ return 0;
}
/* write external GPHY MDIO/MMD registers via MDIO bus */
int fapi_ext_mdio_write(int prmc, char *prmv[])
@@ -196,39 +204,41 @@
int rret;
rret = scanParamArg(prmc, prmv, "phy", sizeof(param.phy), ¶m.phy);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: phy\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "mmd", sizeof(param.mmd), ¶m.mmd);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: mmd\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "reg", sizeof(param.reg), ¶m.reg);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: reg\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "data", sizeof(param.data), ¶m.data);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: data\n");
return OS_ERROR;
}
- gsw_dev = gsw_get_struc(lif_id,0);
+ gsw_dev = gsw_get_struc(lif_id, 0);
ret = ext_mdio_write(gsw_dev, ¶m);
-
if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_ext_mdio_write failed with ret code", ret);
- else
- printf("fapi_ext_mdio_write:\tphy=0x%x mmd=0x%x reg=0x%x data=0x%x\n",param.reg,param.mmd,param.reg,param.data);
- return 0;
-
+ printf("\t%40s:\t0x%x\n", "fapi_ext_mdio_write failed with ret code", ret);
+ else
+ printf("fapi_ext_mdio_write:\tphy=0x%x mmd=0x%x reg=0x%x data=0x%x\n", param.reg, param.mmd, param.reg, param.data);
+ return 0;
}
/* modify external GPHY MDIO/MMD registers via MDIO bus */
int fapi_ext_mdio_mod(int prmc, char *prmv[])
@@ -239,42 +249,45 @@
int rret;
rret = scanParamArg(prmc, prmv, "phy", sizeof(param.phy), ¶m.phy);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: phy\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "mmd", sizeof(param.mmd), ¶m.mmd);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: mmd\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "reg", sizeof(param.reg), ¶m.reg);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: reg\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "data", sizeof(param.data), ¶m.data);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: data\n");
return OS_ERROR;
}
rret = scanParamArg(prmc, prmv, "mask", sizeof(param.mask), ¶m.mask);
- if (rret < 1){
+ if (rret < 1)
+ {
printf("parameter not Found: mask\n");
return OS_ERROR;
}
- gsw_dev = gsw_get_struc(lif_id,0);
+ gsw_dev = gsw_get_struc(lif_id, 0);
ret = ext_mdio_mod(gsw_dev, ¶m);
-
if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_ext_mdio_mod failed with ret code", ret);
- else
- printf("fapi_ext_mdio_mod:\tphy=0x%x mmd=0x%x reg=0x%x data=0x%x mask=0x%x\n",param.reg,param.mmd,param.reg,param.data, param.mask);
- return 0;
-
+ printf("\t%40s:\t0x%x\n", "fapi_ext_mdio_mod failed with ret code", ret);
+ else
+ printf("fapi_ext_mdio_mod:\tphy=0x%x mmd=0x%x reg=0x%x data=0x%x mask=0x%x\n", param.reg, param.mmd, param.reg, param.data, param.mask);
+ return 0;
}
\ No newline at end of file
diff --git a/feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi_mdio_relay.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi_mdio_relay.h
similarity index 100%
rename from feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi_mdio_relay.h
rename to feed/app/ethswbox/src/example/ethswbox_sdk/src/fapi/fapi_gsw_hostapi_mdio_relay.h
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/lif/lif_api.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/lif/lif_api.c
new file mode 100644
index 0000000..98efd6e
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/lif/lif_api.c
@@ -0,0 +1,979 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+/**
+ \file lif_api.c
+ This file implements the Ethernet MDIO Link Interface (LIF) API.
+
+ This API abstract the underlying Target Ethernet MDIO connection by selecting with the
+ Link Interface Id (lid) the corresponding MDIO library.
+
+ Note: The LIF abstraction is not implemented. The lif api is tailored for the C mdio library
+ located in PyRPIO package. The lif will be reworked once the missing block (conf,..) will be available
+ in the future.
+*/
+
+/* ========================================================================== */
+/* Includes */
+/* ========================================================================== */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "bcm2835.h"
+#include "mdio.h"
+#include "lif_api.h"
+
+/* ========================================================================== */
+/* Macro definitions */
+/* ========================================================================== */
+
+/* ========================================================================== */
+/* Types definitions */
+/* ========================================================================== */
+
+/** define the state of the mdio pins in the global pin table */
+typedef struct
+{
+ /** mdio clock pin with the following values
+ - (0) pin not valid
+ - (1) valid pin close
+ - (pin) valid open pin as clock pin */
+ uint8_t cpin;
+
+ /** mdio data pin with the following values
+ - (0) pin not valid
+ - (1) valid pin closed
+ - (pin) valid open pin as data pin */
+ uint8_t dpin;
+
+} Y_S_lif_pins;
+
+/* Global Variable handling Scan function
+ - scanned_devices: Scanned Devices
+ - PHY_MAX_VAL: Maximum PHY Value
+ - COMB_MAX_VAL: Maximum possible combination of pins
+ - MAX_LINKS: Maximum number of devices connected to RPI4
+
+*/
+
+typedef struct
+{
+ /** mdio clock pin with the following values
+ - (0) pin not valid
+ - (1) valid pin close
+ - (pin) valid open pin as clock pin */
+ char *lib;
+
+ /** mdio clock pin with the following values
+ - (0) pin not valid
+ - (1) valid pin close
+ - (pin) valid open pin as clock pin */
+ uint8_t cpin;
+
+ /** mdio data pin with the following values
+ - (0) pin not valid
+ - (1) valid pin closed
+ - (pin) valid open pin as data pin */
+ uint8_t dpin;
+
+ /** Number of Phys Found */
+ uint8_t nr_phys;
+
+ /** Phy information in structure [Address, PHYID] */
+ uint32_t phy_info[PHY_MAX_VAL][2];
+
+} device_struc;
+
+/* ========================================================================== */
+/* Local Function prototypes */
+/* ========================================================================== */
+static void tableinit_lif_pins(void);
+static int32_t update_init_lif_lib(char *lib);
+static int32_t update_deinit_lif_lib(char *lib);
+static int32_t check_valid_lif_lib(char *lib);
+static int32_t check_valid_lif_pins(uint8_t clk_pin, uint8_t data_pin);
+static int32_t update_open_lif_pins(uint8_t clk_pin, uint8_t data_pin);
+static int32_t update_close_lif_pins(uint8_t clk_pin, uint8_t data_pin);
+static int32_t check_rw_lif_pins(uint8_t clk_pin, uint8_t data_pin);
+
+/* ========================================================================== */
+/* Global variables */
+/* ========================================================================== */
+
+/* ========================================================================== */
+/* Local variables */
+/* ========================================================================== */
+
+/* Global Variable for handling the initialisation and shutdown of the
+ underlying mdio library. gLifMdioInit
+ - MAGIC_KEY_LIF_NOT_INITIALZED: not initialized
+ - MAGIC_KEY_LIF_INITIALZED: initialized
+*/
+
+#define MAGIC_KEY_LIF_NOT_INITIALZED 0xffffffff
+#define MAGIC_KEY_LIF_INITIALZED 0x12345678
+static int32_t gLifMdioInit;
+static int32_t scanned_nr_lif;
+static device_struc scanned_devices[MAX_LINKS];
+
+/* Global Table for handling or checking the validaty of the clock and data
+ pins used for the mdio connection between the RPI4 and the EVK. The valid
+ pins of the 40-pin RPI4 are the GPIO pins that will be used as unique
+ (clock, data) pins couple for the physical connection and driven thru the
+ lif API. The valid GPIO pins are 4, 5, 6, 12, 13, 22, 23, 24, 25, 26 and 27
+ meaning up to 5 mdio physical connections can be made. Each connection is
+ made of a unique clock, data pins.
+
+ Only the entries marked as "LIF_VALID_PIN" are accepted (valid) pins corresponding
+ to the pins 4, 5, 6, 12, 13, 22, 23, 24, 25, 26 and 27.
+ For a valid entry, the cpin and dpin fields of the Y_S_lif_pins structure provide
+ the status of both pins from the initialisation (LIF_VALID_PIN) to open (pin number)
+ and close (LIF_VALID_PIN).
+
+ For a Valid entry, the cpin field matches the entry number when the cpin is open,
+ dpin will contain the data pin numver associated to the clock pin.
+
+ Example with clock pin = 5, data pin = 6:
+ initialization:
+ gLifTablePins[5].cpin = LIF_VALID_PIN, gLifTablePins[5].dpin = LIF_VALID_PIN
+ gLifTablePins[6].cpin = LIF_VALID_PIN, gLifTablePins[6].dpin = LIF_VALID_PIN
+
+ open:
+ clock and data pins can only be open when both pin are free (LIF_VALID_PIN),
+ this is checkedwith the value in gLifTablePins[5].cpin for the clock pin
+ and gLifTablePins[6].dpin for the data pin.
+ When open, the table is updated as follow (see update_open_lif_pins function)
+ providing the unique pins couple:
+ gLifTablePins[5].cpin = 5, gLifTablePins[5].dpin = 6
+ gLifTablePins[6].cpin = 5, gLifTablePins[6].dpin = 6
+
+ close:
+ Only open clock and data pins couple can be closed for that
+ gLifTablePins[5].cpin = 5 for clock pin and gLifTablePins[6].dpin = 6 for data pin
+ are checked.
+ When closed, the table is updated as follow (see update_close_lif_pins function)
+ to the init values and the pins are free for a new assignment:
+ gLifTablePins[5].cpin = LIF_VALID_PIN, gLifTablePins[5].dpin = LIF_VALID_PIN
+ gLifTablePins[6].cpin = LIF_VALID_PIN, gLifTablePins[6].dpin = LIF_VALID_PIN
+*/
+#define LIF_INVALID_PIN 0
+#define LIF_VALID_PIN 1
+
+#define LIF_TABLE_PINS_ENTRIES_MAX 32
+Y_S_lif_pins gLifTablePins[LIF_TABLE_PINS_ENTRIES_MAX] =
+ {
+/* for documenting the initial pins mapping as the table
+ is initialized in "tableinit_lif_pins ()" function */
+#if 0
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 0 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 1 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 2 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 3 : not valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 4 : valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 5 : valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 6 : valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 7 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 8 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 9 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 10 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 11 : not valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 12 : valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 13 : valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 14 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 15 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 16 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 17 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 18 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 19 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 20 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 21 : not valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 22 : valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 23 : valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 24 : valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 25 : valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 26 : valid */
+ {LIF_VALID_PIN, LIF_VALID_PIN}, /* 27 : valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 28 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 29 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN}, /* 30 : not valid */
+ {LIF_INVALID_PIN, LIF_INVALID_PIN} /* 31 : not valid */
+#endif
+};
+
+#ifdef LIF_NO_SCAN
+#define LIF_CLK_PIN_ENTRY 0
+#define LIF_DATA_PIN_ENTRY 1
+
+static int32_t GPIO_PINS[RASP_AVAILABLE_PINS] = {LIF_CLK_PIN, LIF_DATA_PIN};
+#else
+/* from lif_api.h
+ TO-DO: rework of the lif scan handling */
+static int32_t GPIO_PINS[RASP_AVAILABLE_PINS] = {4, 5, 6, 12, 13, 22, 23, 24, 25, 26, 27};
+#endif
+
+/* ========================================================================== */
+/* Local Function implementation */
+/* ========================================================================== */
+
+/**
+ This function initializes the global pins table.
+
+ \param
+ none
+ \return
+ none
+*/
+static void tableinit_lif_pins(void)
+{
+ uint8_t i;
+
+ /* all cleared to invalid pin */
+ for (i = 0; i < LIF_TABLE_PINS_ENTRIES_MAX; i++)
+ {
+ gLifTablePins[i].cpin = gLifTablePins[i].dpin = LIF_INVALID_PIN;
+ }
+
+ /* set the valid pin to valid for the allowed ranges */
+
+ /* pins 4 to 6 */
+ for (i = 4; i < 7; i++)
+ {
+ gLifTablePins[i].cpin = LIF_VALID_PIN;
+ gLifTablePins[i].dpin = gLifTablePins[i].cpin;
+ }
+
+ /* pins 12 and 13 */
+ for (i = 12; i < 14; i++)
+ {
+ gLifTablePins[i].cpin = LIF_VALID_PIN;
+ gLifTablePins[i].dpin = gLifTablePins[i].cpin;
+ }
+
+ /* pins 22 to 27 */
+ for (i = 22; i < 28; i++)
+ {
+ gLifTablePins[i].cpin = LIF_VALID_PIN;
+ gLifTablePins[i].dpin = gLifTablePins[i].cpin;
+ }
+}
+
+/**
+ This function checks the validity of the library and updates
+ the global pins table accordingly at the library initialisation.
+
+ \param
+ none
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_LIB_ERROR Library error
+
+*/
+static int32_t update_init_lif_lib(char *lib)
+{
+
+ /* Ensure we select the correct mdio library for RPI4 */
+ if ((strcmp(lib, "bcm2835") != 0) || gLifMdioInit == MAGIC_KEY_LIF_INITIALZED)
+ {
+ return LIF_API_RET_LIB_ERROR;
+ }
+
+ /* library initialized, update the magic key */
+ (void)tableinit_lif_pins();
+ gLifMdioInit = MAGIC_KEY_LIF_INITIALZED;
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ This function checks the validity of the library and updates
+ the global pins table accordingly at the library deinitialisation.
+
+ \param
+ none
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_LIB_ERROR Library error
+*/
+static int32_t update_deinit_lif_lib(char *lib)
+{
+
+ /* Ensure we select the correct mdio library for RPI4 */
+ if ((strcmp(lib, "bcm2835") != 0) || gLifMdioInit != MAGIC_KEY_LIF_INITIALZED)
+ {
+ return LIF_API_RET_LIB_ERROR;
+ }
+
+ /* library deinitialzed, update the magic key */
+ gLifMdioInit = MAGIC_KEY_LIF_NOT_INITIALZED;
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ This function checks the validity of the library for open, close, read
+ and write operations.
+
+ \param
+ none
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_LIB_ERROR Library error
+*/
+static int32_t check_valid_lif_lib(char *lib)
+{
+
+ /* Ensure we select the correct mdio library for RPI4 */
+ if ((strcmp(lib, "bcm2835") != 0) || gLifMdioInit != MAGIC_KEY_LIF_INITIALZED)
+ {
+ return LIF_API_RET_LIB_ERROR;
+ }
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ This function checks the validity of the used GPIO pins on the 40-pin Header
+ on the RPI4 board for the clock and data signals of the mdio.
+
+ The valid pin numbers are: 4,5,6,12,13,22,23,24,25,26 and 27.
+
+
+ \param
+ uint8_t clk_pin, GPIO mdio clock pin number
+ uint8_t data_pin, GPIO mdio data pin number
+
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_PINS_ERROR Pins validity error
+*/
+static int32_t check_valid_lif_pins(uint8_t clk_pin, uint8_t data_pin)
+{
+ /* check the validity of the pins */
+ if ((clk_pin == data_pin) ||
+ (clk_pin > (LIF_TABLE_PINS_ENTRIES_MAX - 1)) ||
+ (data_pin > (LIF_TABLE_PINS_ENTRIES_MAX - 1)))
+ {
+ return LIF_API_RET_PINS_ERROR;
+ }
+
+ if ((gLifTablePins[clk_pin].cpin == LIF_INVALID_PIN) ||
+ (gLifTablePins[data_pin].cpin == LIF_INVALID_PIN))
+ {
+ return LIF_API_RET_PINS_ERROR;
+ }
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ This function checks the validity of the pins and updates
+ the global pins table accordingly for the open opearation.
+
+ \param
+ uint16_t clk_pin, GPIO mdio clock pin number
+ uint16_t data_pin, GPIO mdio data pin number
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_OPEN_ERROR Pins open error
+*/
+static int32_t update_open_lif_pins(uint8_t clk_pin, uint8_t data_pin)
+{
+ /* check pins validity */
+ if (check_valid_lif_pins(clk_pin, data_pin) != LIF_API_RET_SUCCESS)
+ {
+ return LIF_API_RET_PINS_ERROR;
+ }
+
+ /* check if the clock and data pin are free:
+ clock and data pins can only be open when both pin are free (LIF_VALID_PIN),
+ this is checked with the value in gLifTablePins[clk_pin].cpin for the clock pin
+ and gLifTablePins[dat_pin].dpin for the data pin.
+ (refer to the gLifTablePins description) */
+ if ((gLifTablePins[clk_pin].cpin > LIF_VALID_PIN) ||
+ (gLifTablePins[data_pin].dpin > LIF_VALID_PIN))
+ {
+
+ return LIF_API_RET_OPEN_ERROR;
+ }
+
+ /* update pin table
+ (refer to the gLifTablePins description)*/
+ gLifTablePins[clk_pin].cpin = gLifTablePins[data_pin].cpin = clk_pin;
+ gLifTablePins[clk_pin].dpin = gLifTablePins[data_pin].dpin = data_pin;
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ This function checks the validity of the pins and updates
+ the global pins table accordingly for the close opearation.
+
+ \param
+ uint16_t clk_pin, GPIO mdio clock pin number
+ uint16_t data_pin, GPIO mdio data pin number
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_CLOSE_ERROR Pins close error
+*/
+static int32_t update_close_lif_pins(uint8_t clk_pin, uint8_t data_pin)
+{
+
+ /* check pins validity */
+ if (check_valid_lif_pins(clk_pin, data_pin) != LIF_API_RET_SUCCESS)
+ {
+ return LIF_API_RET_PINS_ERROR;
+ }
+
+ /* check that both pins are open:
+ clk_pin matches cpin in clk_pin entry in global table pin.
+ data_pin matches dpin in data_pin entry in global table pin.
+ (refer to the gLifTablePins description). */
+ if ((gLifTablePins[clk_pin].cpin != clk_pin) ||
+ (gLifTablePins[data_pin].dpin != data_pin))
+ {
+ return LIF_API_RET_CLOSE_ERROR;
+ }
+
+ /* update pin table with both pins set to close (value LIF_VALID_PIN) */
+ gLifTablePins[clk_pin].cpin = LIF_VALID_PIN;
+ gLifTablePins[clk_pin].dpin = gLifTablePins[clk_pin].cpin;
+
+ gLifTablePins[data_pin].cpin = LIF_VALID_PIN;
+ gLifTablePins[data_pin].dpin = gLifTablePins[data_pin].cpin;
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ This function checks the validity of the pins according
+ to the global pin table for read and write operations.
+
+ \param
+ uint16_t clk_pin, GPIO mdio clock pin number
+ uint16_t data_pin, GPIO mdio data pin number
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_ACCESS_ERROR Pins RW Access error
+*/
+static int32_t check_rw_lif_pins(uint8_t clk_pin, uint8_t data_pin)
+{
+
+ /* check pins validity */
+ if (check_valid_lif_pins(clk_pin, data_pin) != LIF_API_RET_SUCCESS)
+ {
+ return LIF_API_RET_PINS_ERROR;
+ }
+
+ /* check that both pins are open:
+ clk_pin matches cpin in clk_pin entry in global table pin.
+ data_pin matches dpin in data_pin entry in global table pin.
+ */
+ if ((gLifTablePins[clk_pin].cpin != clk_pin) ||
+ (gLifTablePins[data_pin].dpin != data_pin))
+ {
+ return LIF_API_RET_ACCESS_ERROR;
+ }
+ return LIF_API_RET_SUCCESS;
+}
+
+/* ========================================================================== */
+/* Function implementation */
+/* ========================================================================== */
+/**
+ Implements the MDIO library (PyRPIO only) Initialization.
+
+
+ \param
+ char* lib, GPIO Interface library name
+
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_LIB_ERROR Library error
+*/
+int32_t lif_mdio_init(char *lib)
+{
+ int32_t ret;
+
+ /* Ensure we select the correct mdio library for RPI4
+ and update global vaiable */
+ ret = update_init_lif_lib(lib);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* initialize the mdio library:
+ return code: 1=success, 0=error
+ */
+ if (bcm2835_init(1) == 1)
+ {
+ return LIF_API_RET_SUCCESS;
+ }
+ else
+ {
+ /* we do not evaluate the return code */
+ (void)lif_mdio_deinit(lib);
+ return LIF_API_RET_LIB_ERROR;
+ }
+}
+
+/**
+ Implements the MDIO library (PyRPIO only) Deinitialization.
+
+
+ \param
+ char* lib, GPIO Interface library name
+
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_LIB_ERROR Library error
+*/
+int32_t lif_mdio_deinit(char *lib)
+{
+ int32_t ret;
+
+ /* Ensure we select the correct mdio library for RPI4
+ and update global vaiable */
+ ret = update_deinit_lif_lib(lib);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* shutdown the mdio library:
+ return code: always 1
+ we do not evaluate the return code
+ */
+ (void)bcm2835_close();
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ Implements the MDIO library (PyRPIO only) Open.
+ Initialize the MDIO clock and data pins for the MDIO connection.
+
+ \param
+ char* lib, GPIO Interface library name
+ uint16_t clk_pin, GPIO mdio clock pin number
+ uint16_t data_pin, GPIO mdio data pin number
+
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_LIB_ERROR Library error
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_OPEN_ERROR Pins open error
+*/
+int32_t lif_mdio_open(char *lib, uint8_t clk_pin, uint8_t data_pin)
+{
+ int32_t ret;
+
+ /* check library validity */
+ ret = check_valid_lif_lib(lib);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* check and update global pins table */
+ ret = update_open_lif_pins(clk_pin, data_pin);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* Open the mdio connection
+ return code: always 0.
+ we do not evaluate the return code
+ */
+ (void)mdio_open(clk_pin, data_pin);
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ Implements the MDIO library (PyRPIO only) Close.
+ Deinitialize the MDIO clock and data pins of the MDIO connection.
+
+ \param
+ char* lib, GPIO Interface library name
+ uint16_t clk_pin, GPIO mdio clock pin number
+ uint16_t data_pin, GPIO mdio data pin number
+
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_LIB_ERROR Library error
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_CLOSE_ERROR Pins close error
+*/
+
+int32_t lif_mdio_close(char *lib, uint8_t clk_pin, uint8_t data_pin)
+{
+ int32_t ret;
+
+ /* check library validity */
+ ret = check_valid_lif_lib(lib);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* check and update global pins table */
+ ret = update_close_lif_pins(clk_pin, data_pin);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* close the mdio connection
+ return code: always 0.
+ we do not evaluate the return code
+ */
+ (void)mdio_close(clk_pin, data_pin);
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ Implements the MDIO library (PyRPIO only) Read Register Clause 22.
+
+ \param
+ uint8_t lif_id, Link Index number
+ uint16_t pad, PHY address
+ uint16_t dad, Register Address
+
+ \return
+ >= 0 No error: Register value
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_ACCESS_ERROR Pins RW Access error
+*/
+int32_t lif_mdio_c22_read(uint8_t lif_id, uint8_t pad, uint8_t dad)
+{
+ uint16_t rret; /* return type from the underlying mdio library */
+ int32_t ret;
+
+ /* check library validity */
+ ret = check_valid_lif_lib(scanned_devices[lif_id].lib);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* check pins validity */
+ ret = check_rw_lif_pins(scanned_devices[lif_id].cpin, scanned_devices[lif_id].dpin);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* call the underlying mdio library returning
+ the uint16_t register value */
+
+ rret = mdio_c22_read(scanned_devices[lif_id].cpin, scanned_devices[lif_id].dpin, pad, dad);
+
+ /* convert from 16-bit to 32-bit unsigned */
+ return ((int32_t)rret & 0x0000FFFF);
+}
+
+/**
+ Implements the MDIO library (PyRPIO only) Write Register Clause 22.
+
+ \param
+ uint8_t lif_id, Link Index number
+ uint16_t pad, PHY address
+ uint16_t dad, Register Address
+ uint16_t val, Register value to write
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_ACCESS_ERROR Pins RW Access error
+*/
+int32_t lif_mdio_c22_write(uint8_t lif_id, uint8_t pad, uint8_t dad, uint16_t val)
+{
+ int32_t ret;
+
+ /* check library validity */
+ ret = check_valid_lif_lib(scanned_devices[lif_id].lib);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* check pins validity */
+ ret = check_rw_lif_pins(scanned_devices[lif_id].cpin, scanned_devices[lif_id].dpin);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* call the underlying mdio library returning
+ always 0. We do not evaluate the return code */
+ (void)mdio_c22_write(scanned_devices[lif_id].cpin, scanned_devices[lif_id].dpin, pad, dad, val);
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/**
+ Implements the MDIO library (PyRPIO only) Read Register Clause 45.
+
+ \param
+ uint8_t lif_id, Link Index number
+ uint16_t pad, PHY address
+ uint16_t dad, DEVICE address
+ uint16_t reg, Register Address
+
+ \return
+ >= 0 No error: Register value
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_ACCESS_ERROR Pins RW Access error
+*/
+int32_t lif_mdio_c45_read(uint8_t lif_id, uint8_t pad, uint8_t dad, uint16_t reg)
+{
+ uint16_t rret; /* return type from the underlying mdio library */
+ int32_t ret;
+
+ /* check library validity */
+ ret = check_valid_lif_lib(scanned_devices[lif_id].lib);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* check pins validity */
+ ret = check_rw_lif_pins(scanned_devices[lif_id].cpin, scanned_devices[lif_id].dpin);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* call the underlying mdio library returning
+ the uint16_t register value */
+ rret = mdio_c45_read(scanned_devices[lif_id].cpin, scanned_devices[lif_id].dpin, pad, dad, reg);
+
+ /* convert from 16-bit to 32-bit unsigned */
+ return ((int32_t)rret & 0x0000FFFF);
+}
+
+/**
+ Implements the MDIO library (PyRPIO only) Write Register Clause 45.
+
+ \param
+ uint8_t lif_id, Link Index number
+ uint16_t pad, PHY address
+ uint16_t dad, DEVICE Address
+ uint16_t val, Register value to write
+ \return
+ LIF_API_RET_SUCCESS No error
+ LIF_API_RET_PINS_ERROR Pins validity error
+ LIF_API_RET_ACCESS_ERROR Pins RW Access error
+*/
+int32_t lif_mdio_c45_write(uint8_t lif_id, uint8_t pad, uint8_t dad, uint16_t reg, uint16_t val)
+{
+
+ int32_t ret;
+
+ /* check library validity */
+ ret = check_valid_lif_lib(scanned_devices[lif_id].lib);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* check pins validity */
+ ret = check_rw_lif_pins(scanned_devices[lif_id].cpin, scanned_devices[lif_id].dpin);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ return ret;
+ }
+
+ /* call the underlying mdio library returning
+ always 0. We do not evaluate the return code */
+ (void)mdio_c45_write(scanned_devices[lif_id].cpin, scanned_devices[lif_id].dpin, pad, dad, reg, val);
+
+ return LIF_API_RET_SUCCESS;
+}
+
+/******************************************
+ Implements MDIO links scans functions.
+*******************************************/
+
+#ifdef LIF_NO_SCAN
+
+int32_t lif_scan(char *lib)
+{
+ int32_t ret;
+ int32_t nr_dev;
+ uint8_t phy;
+ uint8_t phy_index;
+
+ nr_dev = 0;
+ scanned_devices[nr_dev].lib = lib;
+ scanned_devices[nr_dev].cpin = GPIO_PINS[LIF_CLK_PIN_ENTRY];
+ scanned_devices[nr_dev].dpin = GPIO_PINS[LIF_DATA_PIN_ENTRY];
+ scanned_devices[nr_dev].nr_phys = 0;
+
+ ret = lif_mdio_open(lib, scanned_devices[nr_dev].cpin, scanned_devices[nr_dev].dpin);
+ if (ret != LIF_API_RET_SUCCESS)
+ {
+ scanned_nr_lif = 0;
+ return scanned_nr_lif;
+ }
+
+ phy_index = 0;
+ for (phy = 0; phy < PHY_MAX_VAL; phy++)
+ {
+ /* we read MDIO PHY Identifier 2 (Register 0.3) for checking
+ the presence of a PHY port (value > 0) */
+
+ ret = lif_mdio_c22_read(nr_dev, phy, 3);
+ if (ret != 0xffff)
+ {
+ /* SMDIO (SSB) there is no valid ID and is returning 0 value */
+ if (phy == 0 && ret == 0)
+ break;
+
+ scanned_devices[nr_dev].nr_phys++;
+ scanned_devices[nr_dev].phy_info[phy_index][0] = phy;
+ scanned_devices[nr_dev].phy_info[phy_index][1] = ret;
+ phy_index++;
+ }
+ }
+
+ if (phy_index == 0)
+ {
+ lif_mdio_close(lib, scanned_devices[nr_dev].cpin, scanned_devices[nr_dev].dpin);
+ }
+
+ nr_dev++;
+ scanned_nr_lif = nr_dev;
+
+ return scanned_nr_lif;
+}
+
+#else /* LIF_NO_SCAN */
+int32_t lif_scan(char *lib)
+{
+ int i, j;
+ int32_t nr_dev = 0;
+ uint8_t pins[COMB_MAX_VAL][2];
+ int count = 0;
+
+ for (i = 0; i < RASP_AVAILABLE_PINS; i++)
+ {
+ for (j = 0; j < RASP_AVAILABLE_PINS; j++)
+ {
+ if (GPIO_PINS[i] != GPIO_PINS[j])
+ {
+ pins[count][0] = GPIO_PINS[i];
+ pins[count][1] = GPIO_PINS[j];
+ count++;
+ }
+ }
+ }
+
+ for (i = 0; i < COMB_MAX_VAL; i++)
+ {
+ int32_t ret;
+
+ ret = lif_mdio_open(lib, pins[i][0], pins[i][1]);
+ if (ret == LIF_API_RET_SUCCESS)
+ {
+ uint8_t phy;
+ uint8_t phy_index = 0;
+ int flag_first = 1;
+
+ if (nr_dev >= MAX_LINKS)
+ {
+ scanned_nr_lif = 0;
+ return scanned_nr_lif;
+ }
+ scanned_devices[nr_dev].lib = lib;
+ scanned_devices[nr_dev].cpin = pins[i][0];
+ scanned_devices[nr_dev].dpin = pins[i][1];
+
+ for (phy = 0; phy < PHY_MAX_VAL; phy++)
+ {
+ /* we read MDIO PHY Identifier 2 (Register 0.3) for checking
+ the presence of a PHY port (value > 0) */
+
+ ret = lif_mdio_c22_read(nr_dev, phy, 3);
+ if (ret != 0xffff)
+ {
+ /* SMDIO (SSB) there is no valid ID and is returning 0 value */
+ if (phy == 0 && ret == 0)
+ break;
+
+ if (nr_dev >= MAX_LINKS)
+ {
+ scanned_nr_lif = 0;
+ return scanned_nr_lif;
+ }
+
+ scanned_devices[nr_dev].nr_phys++;
+ scanned_devices[nr_dev].phy_info[phy_index][0] = phy;
+ scanned_devices[nr_dev].phy_info[phy_index][1] = ret;
+ phy_index++;
+ }
+ }
+
+ if (scanned_devices[nr_dev].nr_phys > 0)
+ {
+ nr_dev++;
+ }
+
+ if (phy_index == 0)
+ {
+ lif_mdio_close(lib, pins[i][0], pins[i][1]);
+ }
+ }
+ }
+
+ if (nr_dev >= MAX_LINKS)
+ nr_dev = 0;
+ scanned_nr_lif = nr_dev;
+
+ return scanned_nr_lif;
+}
+#endif /* LIF_NO_SCAN */
+
+int32_t lif_get_cpin(uint8_t lif_id)
+{
+ return scanned_devices[lif_id].cpin;
+}
+
+int32_t lif_get_dpin(uint8_t lif_id)
+{
+ return scanned_devices[lif_id].dpin;
+}
+
+int32_t lif_get_nr_phys(uint8_t lif_id)
+{
+ return scanned_devices[lif_id].nr_phys;
+}
+
+int32_t lif_get_phy_addr(uint8_t lif_id, uint8_t phy)
+{
+ return scanned_devices[lif_id].phy_info[phy][0];
+}
+
+int32_t lif_get_phy_id(uint8_t lif_id, uint8_t phy)
+{
+ return scanned_devices[lif_id].phy_info[phy][1];
+}
+
+int32_t lif_get_nr_lif(void)
+{
+ return scanned_nr_lif;
+}
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/lif/lif_api.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/lif/lif_api.h
new file mode 100644
index 0000000..379f5f7
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/lif/lif_api.h
@@ -0,0 +1,71 @@
+/******************************************************************************
+
+ Copyright 2022 Maxlinear
+
+ SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+******************************************************************************/
+
+#ifndef LIF_API_H
+#define LIF_API_H
+
+int32_t lif_mdio_init(char *lib);
+int32_t lif_mdio_deinit(char *lib);
+int32_t lif_mdio_open(char *lib, uint8_t clk_pin, uint8_t data_pin);
+int32_t lif_mdio_close(char *lib, uint8_t clk_pin, uint8_t data_pin);
+int32_t lif_mdio_c22_read(uint8_t lif_id, uint8_t pad, uint8_t dad);
+int32_t lif_mdio_c22_write(uint8_t lif_id, uint8_t pad, uint8_t dad, uint16_t val);
+int32_t lif_mdio_c45_read(uint8_t lif_id, uint8_t pad, uint8_t dad, uint16_t reg);
+int32_t lif_mdio_c45_write(uint8_t lif_id, uint8_t pad, uint8_t dad, uint16_t reg, uint16_t val);
+int32_t lif_scan(char *lib);
+int32_t lif_get_cpin(uint8_t lif_id);
+int32_t lif_get_dpin(uint8_t lif_id);
+int32_t lif_get_nr_phys(uint8_t lif_id);
+int32_t lif_get_phy_addr(uint8_t lif_id, uint8_t phy);
+int32_t lif_get_phy_id(uint8_t lif_id, uint8_t phy);
+int32_t lif_get_nr_lif(void);
+
+/*
+return codes
+*/
+
+#define LIF_API_RET_SUCCESS 0 /* No error : Successful operation */
+#define LIF_API_RET_LIB_ERROR -1 /* Library error : Invalid library operation: wrong library selection, library not or already initialized. */
+#define LIF_API_RET_PINS_ERROR -2 /* Pins validity error : Pins not allowed or (clk , data) pins are identical */
+#define LIF_API_RET_OPEN_ERROR -3 /* Pins open error : Invalid Pins open operation: open operation already done. */
+#define LIF_API_RET_CLOSE_ERROR -4 /* Pins Close error : Invalid Pins close operation: close operation already done or open operation missing. */
+#define LIF_API_RET_ACCESS_ERROR -5 /* Pins RW Access error : Pins are not available. */
+#define LIF_API_RET_LCOMM_ERROR -6 /* Link communication Error:Mdio communication error, cannot be determined, will never occurs */
+#define LIF_API_RET_FAPI_PRM_ERROR -7 /* Parameter Error : FAPI Parameter error */
+
+/*
+RPI Information
+*/
+
+#define PHY_MAX_VAL 32
+#define COMB_MAX_VAL 110
+
+#define LIF_NO_SCAN
+#undef LIF_NO_SCAN
+
+#ifdef LIF_NO_SCAN
+#define MAX_LINKS 1
+#define RASP_AVAILABLE_PINS 2
+
+#define LIF_CLK_PIN 5
+#define LIF_DATA_PIN 6
+
+#else
+#define MAX_LINKS 5
+#define RASP_AVAILABLE_PINS 11
+#endif
+
+/* transfered to lif_api.c
+ TO-DO: rework of the lif scan handling */
+#if 0
+static int32_t GPIO_PINS[RASP_AVAILABLE_PINS] = {4, 5, 6, 12, 13, 22, 23, 24, 25, 26, 27};
+#endif
+
+#endif /* LIF_API_H */
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_linux.c b/feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_linux.c
new file mode 100644
index 0000000..4229868
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_linux.c
@@ -0,0 +1,232 @@
+/******************************************************************************
+
+ Copyright (c) 2014 Lantiq Deutschland GmbH
+ Copyright 2016, Intel Corporation.
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+
+******************************************************************************/
+/**
+ \file os_linux.c
+ This file implements the OS functions for Linux.
+ used.
+
+*/
+
+/* ============================= */
+/* Includes */
+/* ============================= */
+#include "os_linux.h"
+#include "os_types.h"
+#include "fcntl.h"
+#include "unistd.h"
+
+/* ============================= */
+/* Global function definition */
+/* ============================= */
+
+int os_open(const char *pDevName)
+{
+ if (pDevName == OS_NULL)
+ {
+ return OS_ERROR;
+ }
+ return open((const char*)pDevName, O_RDWR, 0644);
+}
+
+
+int os_close(const int devFd)
+{
+ if (devFd == -1)
+ {
+ return OS_ERROR;
+ }
+ return close(devFd);
+}
+
+int os_ioctl(const int devFd,
+ const unsigned int devCmd,
+ OS_uintptr_t param)
+{
+ if (devFd == -1)
+ {
+ return OS_ERROR;
+ }
+ return ioctl(devFd, devCmd, param);
+}
+
+
+void *os_memalloc(OS_size_t memSize_byte)
+{
+ void *pMemBlock = OS_NULL;
+
+ if(memSize_byte)
+ {
+ pMemBlock = (void*)malloc((size_t)memSize_byte);
+ }
+ return (pMemBlock);
+}
+
+
+void os_memfree(void *pMemBlock)
+{
+ if (pMemBlock)
+ {
+ free((void*)pMemBlock);
+ }
+}
+
+
+int os_fileload (char const *pName,
+ unsigned char **ppDataBuf,
+ OS_size_t *pBufSize_byte)
+{
+ int ret;
+ struct stat stats;
+ unsigned char *pDataBuf;
+ OS_size_t size, retVal;
+ FILE *fd = OS_NULL;
+
+ if (pName == OS_NULL ||
+ ppDataBuf == OS_NULL ||
+ pBufSize_byte == OS_NULL )
+ {
+ return OS_ERROR;
+ }
+
+ if (stat((char *)pName, &stats))
+ {
+ return OS_ERROR;
+ }
+
+ size = stats.st_size;
+ if (size == 0)
+ {
+ return OS_ERROR;
+ }
+
+ fd = fopen(pName, "rb");
+ if (fd == OS_NULL)
+ {
+ return OS_ERROR;
+ }
+
+ /* size + 1 - to add null termination */
+ pDataBuf = (unsigned char*)os_memalloc(size + 1);
+ if (pDataBuf == OS_NULL)
+ {
+ ret = fclose(fd);
+ return OS_ERROR;
+ }
+
+ retVal = fread(pDataBuf, 1, size, fd);
+ if (retVal != size)
+ {
+ os_memfree(pDataBuf);
+ ret = fclose(fd);
+ return OS_ERROR;
+ }
+
+ ret = fclose(fd);
+
+ pDataBuf[size] = '\0';
+ *pBufSize_byte = (unsigned int)size;
+ *ppDataBuf = pDataBuf;
+
+ return OS_SUCCESS;
+}
+
+
+int os_system (char const *pCmd)
+{
+ int ret;
+ if (pCmd == OS_NULL)
+ {
+ return OS_ERROR;
+ }
+
+ ret = system (pCmd);
+ return OS_SUCCESS;
+}
+
+
+
+
+int os_fprintf (FILE *stream,
+ const char *format, ...)
+{
+
+ va_list ap; /* points to each unnamed arg in turn */
+ int nRet = 0;
+
+ if (stream == OS_NULL || format == OS_NULL)
+ {
+ return OS_ERROR;
+ }
+
+ va_start(ap, format); /* set ap pointer to 1st unnamed arg */
+ nRet = vfprintf(stream, format, ap);
+ va_end(ap);
+
+ return nRet;
+}
+
+
+
+int target_os_snprintf (char *pStrBuf,
+ int bufSize,
+ const char *format, ...)
+{
+ va_list arg;
+ int nRet = 0;
+
+ if (pStrBuf == OS_NULL || format == OS_NULL)
+ {
+ return OS_ERROR;
+ }
+
+ va_start(arg, format);
+ nRet = vsnprintf(pStrBuf, bufSize, format, arg);
+ va_end(arg);
+
+ return nRet;
+}
+
+
+static void nano_sleep(struct timespec *pTVal)
+{
+ while (1)
+ {
+ /* Sleep for the time specified in pTVal. If interrupted by a
+ signal, place the remaining time left to sleep back into pTVal. */
+ int rval = nanosleep(pTVal, pTVal);
+ if (rval == 0)
+ {
+ /* Completed the entire sleep time; all done. */
+ return;
+ }
+ else
+ {
+ if (errno == EINTR)
+ /* Interrupted by a signal. Try again. */
+ continue;
+ else
+ /* Some other error; bail out. */
+ return;
+ }
+ }
+}
+
+
+void os_mssleep(OS_time_t sleepTime_ms)
+{
+ struct timespec tv;
+ /* Construct the timespec from the number of whole seconds... */
+ tv.tv_sec = sleepTime_ms/1000;
+ /* ... and the remainder in nanoseconds. */
+ tv.tv_nsec = (long) ((sleepTime_ms - (tv.tv_sec * 1000)) * 1000 * 1000);
+ nano_sleep(&tv);
+
+ return;
+}
diff --git a/feed/app/ethswbox/src/example/os/os_types.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_linux.h
similarity index 78%
rename from feed/app/ethswbox/src/example/os/os_types.h
rename to feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_linux.h
index 72b9e9e..6e5a706 100644
--- a/feed/app/ethswbox/src/example/os/os_types.h
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_linux.h
@@ -1,5 +1,5 @@
-#ifndef _OS_TYPES_H
-#define _OS_TYPES_H
+#ifndef _OS_LINUX_H
+#define _OS_LINUX_H
/******************************************************************************
Copyright 2022 Maxlinear
@@ -21,7 +21,23 @@
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <time.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/select.h>
+
+
+#include "os_types.h"
+
+
/** A type for handling boolean issues. */
typedef enum {
@@ -57,4 +73,4 @@
}
#endif
-#endif /* _OS_TYPES_H */
+#endif /* _OS_LINUX_H */
diff --git a/feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_types.h b/feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_types.h
new file mode 100644
index 0000000..6932090
--- /dev/null
+++ b/feed/app/ethswbox/src/example/ethswbox_sdk/src/os/os_types.h
@@ -0,0 +1,224 @@
+#ifndef _OS_TYPES_H
+#define _OS_TYPES_H
+/*******************************************************************************
+
+ Copyright (c) 2009
+ Lantiq Deutschland GmbH
+ Am Campeon 3; 85579 Neubiberg, Germany
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+
+******************************************************************************/
+
+/* Determine the target type */
+#if defined(WIN64) || defined (_WIN64) \
+ || defined(__x86_64__) \
+ || defined(__LP64__) || defined(_LP64) \
+ || defined (__amd64) \
+ || defined (powerpc64) || defined (__powerpc64__) || defined (__ppc64__) \
+ || defined (__64BIT__)
+/* X86_64 */
+# ifndef OS_64
+# define OS_64 1
+# endif /* OS_64 */
+#elif defined (__ia64__) || defined (__ia64)
+/* IA64 */
+# ifndef OS_64
+# define OS_64 1
+# endif /* OS_64 */
+#else
+/* not 64 bit system */
+#endif /* 64 bit determination */
+
+/** \defgroup OS_BASIC_TYPES Basic OS Data Types
+ This section describes the Infineon / Lantiq basic data type definitions */
+/*@{*/
+
+/** This is the character datatype. */
+typedef char OS_char_t;
+/** This is the integer datatype. */
+typedef signed int OS_int_t;
+/** This is the unsigned integer datatype. */
+typedef unsigned int OS_uint_t;
+/** This is the unsigned 8-bit datatype. */
+typedef unsigned char OS_uint8_t;
+/** This is the signed 8-bit datatype. */
+typedef signed char OS_int8_t;
+/** This is the unsigned 16-bit datatype. */
+typedef unsigned short OS_uint16_t;
+/** This is the signed 16-bit datatype. */
+typedef signed short OS_int16_t;
+/** This is the unsigned 32-bit datatype. */
+typedef unsigned int OS_uint32_t;
+/** This is the signed 32-bit datatype. */
+typedef signed int OS_int32_t;
+/** This is the float datatype. */
+typedef float OS_float_t;
+/** This is the void datatype.
+ It is only a define to be sure, the type
+ is "exactly" the same for C++ comatibility! */
+#define OS_void_t void
+
+
+#if defined(OS_64) && (OS_64 == 1)
+ /* NOTE: Most Unix systems use the I32LP64 standard
+ which defines a long as 64 bits and Win64 uses
+ the IL32LLP64 standard which defines a long as 32 bits.
+ */
+ #if defined(WIN64)
+ /** This is the unsigned 64-bit datatype. */
+ typedef unsigned long long int OS_uint64_t;
+ /** This is the signed 64-bit datatype. */
+ typedef signed long long int OS_int64_t;
+ #else /* WIN64 */
+ /** This is the unsigned 64-bit datatype. */
+ typedef unsigned long int OS_uint64_t;
+ /** This is the signed 64-bit datatype. */
+ typedef signed long int OS_int64_t;
+ #endif /* WIN64 */
+
+ /** This is the unsigned long datatype.
+ On 64 bit systems it is 8 byte wide.
+ */
+ typedef OS_uint64_t OS_ulong_t;
+ #define HAVE_OS_ULONG_T
+
+ /** This is the signed long datatype.
+ On 64 bit systems it is 8 byte wide.
+ */
+ typedef OS_int64_t OS_long_t;
+ #define HAVE_OS_LONG_T
+#else
+ /** This is the unsigned 64-bit datatype. */
+ typedef unsigned long long int OS_uint64_t;
+ /** This is the signed 64-bit datatype. */
+ typedef signed long long int OS_int64_t;
+
+ /** This is the unsigned long datatype.
+ On 32bit systems it is 4 byte wide.
+ */
+ typedef unsigned long OS_ulong_t;
+ #define HAVE_OS_ULONG_T
+
+ /** This is the signed long datatype.
+ On 32bit systems it is 4 byte wide.
+ */
+ typedef signed long OS_long_t;
+ #define HAVE_OS_LONG_T
+#endif /* 32/64 bit specific types */
+
+
+/** This is the size data type (32 or 64 bit) */
+typedef OS_ulong_t OS_size_t;
+#define HAVE_OS_SIZE_T
+
+/** This is the signed size data type (32 or 64 bit) */
+typedef OS_long_t OS_ssize_t;
+#define HAVE_OS_SSIZE_T
+
+/** This is the time data type (32 or 64 bit) */
+typedef OS_ulong_t OS_time_t;
+
+/* NOTE: (ANSI X3.159-1989)
+ While some of these architectures feature uniform pointers
+ which are the size of some integer type, maximally portable
+ code may not assume any necessary correspondence between
+ different pointer types and the integral types.
+
+ Since pointers and integers are now considered incommensurate,
+ the only integer that can be safely converted to a pointer
+ is the constant 0.
+*/
+/** Conversion pointer to unsigned values (32 or 64 bit) */
+typedef OS_ulong_t OS_uintptr_t;
+#define HAVE_OS_UINTPTR_T
+/** Conversion pointer to signed values (32 or 64 bit) */
+typedef OS_long_t OS_intptr_t;
+#define HAVE_OS_INTPTR_T
+
+/** This is the volatile unsigned 8-bit datatype. */
+typedef volatile OS_uint8_t OS_vuint8_t;
+/** This is the volatile signed 8-bit datatype. */
+typedef volatile OS_int8_t OS_vint8_t;
+/** This is the volatile unsigned 16-bit datatype. */
+typedef volatile OS_uint16_t OS_vuint16_t;
+/** This is the volatile signed 16-bit datatype. */
+typedef volatile OS_int16_t OS_vint16_t;
+/** This is the volatile unsigned 32-bit datatype. */
+typedef volatile OS_uint32_t OS_vuint32_t;
+/** This is the volatile signed 32-bit datatype. */
+typedef volatile OS_int32_t OS_vint32_t;
+/** This is the volatile unsigned 64-bit datatype. */
+typedef volatile OS_uint64_t OS_vuint64_t;
+/** This is the volatile signed 64-bit datatype. */
+typedef volatile OS_int64_t OS_vint64_t;
+/** This is the volatile float datatype. */
+typedef volatile OS_float_t OS_vfloat_t;
+
+
+
+/** A type for handling boolean issues. */
+//typedef enum {
+// /** false */
+// OS_FALSE = 0,
+// /** true */
+// OS_TRUE = 1
+//} OS_boolean_t;
+
+
+/**
+ This type is used for parameters that should enable
+ and disable a dedicated feature. */
+//typedef enum {
+// /** disable */
+// OS_DISABLE = 0,
+// /** enable */
+// OS_ENABLE = 1
+//} OS_enDis_t;
+
+/**
+ This type is used for parameters that should enable
+ and disable a dedicated feature. */
+//typedef OS_enDis_t OS_operation_t;
+
+/**
+ This type has two states, even and odd.
+*/
+typedef enum {
+ /** even */
+ OS_EVEN = 0,
+ /** odd */
+ OS_ODD = 1
+} OS_evenOdd_t;
+
+
+/**
+ This type has two states, high and low.
+*/
+typedef enum {
+ /** low */
+ OS_LOW = 0,
+ /** high */
+ OS_HIGH = 1
+} OS_highLow_t;
+
+/**
+ This type has two states, success and error
+*/
+//typedef enum {
+// /** operation failed */
+// OS_ERROR = (-1),
+// /** operation succeeded */
+// OS_SUCCESS = 0
+//} OS_return_t;
+
+/** NULL pointer */
+#ifdef __cplusplus
+#define OS_NULL 0
+#else
+#define OS_NULL ((OS_void_t *)0)
+#endif
+/*@}*/ /* OS_BASIC_TYPES */
+
+#endif /* _OS_TYPES_H */
diff --git a/feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi.c b/feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi.c
deleted file mode 100644
index f435e5a..0000000
--- a/feed/app/ethswbox/src/example/fapi/fapi_gsw_hostapi.c
+++ /dev/null
@@ -1,5825 +0,0 @@
-/******************************************************************************
-
- Copyright 2022 Maxlinear
-
- SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
-
- For licensing information, see the file 'LICENSE' in the root folder of
- this software module.
-******************************************************************************/
-
-#include <os_types.h>
-#include <gsw_device.h>
-#include <gsw_api.h>
-#include <host_adapt.h>
-#include <gsw_cli_common.h>
-
-#include <sys/socket.h>
-#include <arpa/inet.h>
-
-// #include <gsw_priv.h>
-#define lif_id 0
-#define NUM_TC 16
-#define MAX_NUM_OF_DISPLAY_PORTS 2
-
-// #############################################
-static int multicastParamRead(int argc, char *argv[], GSW_multicastTable_t *param)
-{
- int ipParamCnt1 = 0;
- int ipParamCnt2 = 0;
-
- memset(param, 0, sizeof(GSW_multicastTable_t));
-
- scanParamArg(argc, argv, "nPortId", sizeof(param->nPortId), ¶m->nPortId);
- scanParamArg(argc, argv, "nSubIfId", sizeof(param->nSubIfId), ¶m->nSubIfId);
- scanParamArg(argc, argv, "eIPVersion", sizeof(param->eIPVersion), ¶m->eIPVersion);
- scanParamArg(argc, argv, "eModeMember", sizeof(param->eModeMember), ¶m->eModeMember);
- scanParamArg(argc, argv, "nFID", sizeof(param->nFID), ¶m->nFID);
- scanParamArg(argc, argv, "bExclSrcIP", sizeof(param->bExclSrcIP), ¶m->bExclSrcIP);
-
- if (param->eIPVersion == GSW_IP_SELECT_IPV4) {
- ipParamCnt1 = scanIPv4_Arg(argc, argv, "uIP_Gda", ¶m->uIP_Gda.nIPv4);
- ipParamCnt2 = scanIPv4_Arg(argc, argv, "uIP_Gsa", ¶m->uIP_Gsa.nIPv4);
- } else {
- ipParamCnt1 = scanIPv6_Arg(argc, argv, "uIP_Gda", param->uIP_Gda.nIPv6);
- ipParamCnt2 = scanIPv6_Arg(argc, argv, "uIP_Gsa", param->uIP_Gsa.nIPv6);
- }
-
- scanParamArg(argc, argv, "nTci", sizeof(param->nTci), ¶m->nTci);
-
- if ((param->eModeMember != GSW_IGMP_MEMBER_DONT_CARE) &&
- (ipParamCnt1 == 0) && (ipParamCnt2 == 0))
- return (-2);
-
- if (ipParamCnt1 == 0)
- return (-3);
-
- return 0;
-}
-
-
-static void dump_multicast_table_entry(GSW_multicastTableRead_t *ptr)
-{
- char sipaddr[64], dipaddr[64];
-
-// #ifdef CONFIG_NETWORKING
- if (ptr->eIPVersion == GSW_IP_SELECT_IPV4) {
- uint32_t dip = htonl(ptr->uIP_Gda.nIPv4);
-
- inet_ntop(AF_INET, &dip, dipaddr, sizeof(dipaddr));
- } else {
- uint16_t dip[8], i;
-
- for (i = 0; i < ARRAY_SIZE(dip); i++)
- dip[i] = htons(ptr->uIP_Gda.nIPv6[i]);
- inet_ntop(AF_INET6, dip, dipaddr, sizeof(dipaddr));
- }
-// #endif
- printf(" %39s |", dipaddr);
-
- if (ptr->eModeMember != GSW_IGMP_MEMBER_DONT_CARE) {
-// #ifdef CONFIG_NETWORKING
- if (ptr->eIPVersion == GSW_IP_SELECT_IPV4) {
- uint32_t sip = htonl(ptr->uIP_Gsa.nIPv4);
-
- inet_ntop(AF_INET, &sip, sipaddr, sizeof(sipaddr));
- } else {
- uint16_t sip[8], i;
-
- for (i = 0; i < ARRAY_SIZE(sip); i++)
- sip[i] = htons(ptr->uIP_Gsa.nIPv6[i]);
- inet_ntop(AF_INET6, sip, sipaddr, sizeof(sipaddr));
- }
-// #endif
-
- printf(" %39s |", sipaddr);
- printf(" %11s |", (ptr->eModeMember == GSW_IGMP_MEMBER_INCLUDE) ? "INCLUDE" : "EXCLUDE");
- } else {
- printf(" %39s |", "");
- printf(" %11s |", "DON'T CARE");
- }
-
- printf(" %9d |", ptr->hitstatus);
-
- if (ptr->nTci) {
- printf(" Pri %d, CFI/Dei %d, ID %d",
- ((ptr->nTci & 0xE000) >> 13),
- ((ptr->nTci & 0x1000) >> 12),
- (ptr->nTci & 0x0FFF));
- }
- printf("\n");
-
-}
-
-
-struct _tbl_dump_ {
- char *tbl_type;
- char *tbl_name;
- u32 entries;
- u32 tbl_addr;
-};
-
-typedef struct {
- u16 num_key;
- u16 num_mask;
- u16 num_val;
-} gsw_pce_tbl_t;
-
-struct _tbl_dump_ tbl_dump_gsw33[] = {
- {"PCE", "Tflow Table", 512, 0x0F},
- {"PCE", "Parser Microcode Table", 256, 0x00},
- {"PCE", "VLANMAP Table", 1024, 0x02},
- {"PCE", "PPPoE Table", 16, 0x03},
- {"PCE", "Protocol Table", 32, 0x04},
- {"PCE", "Flags Table", 64, 0x18},
- {"PCE", "App Table", 64, 0x05},
- {"PCE", "IP MSB Table", 64, 0x06},
- {"PCE", "IP LSB Table", 64, 0x07},
- {"PCE", "IP Pktlen Table", 16, 0x08},
- {"PCE", "CTAG Pcp Table", 16, 0x09},//
- {"PCE", "Dscp Table", 64, 0x0A},
- {"PCE", "Mac Br Table", 4096, 0x0B},
- {"PCE", "Mult Sw Table", 1024, 0x0D},//
- {"PCE", "Mult Hw Table", 64, 0x0E},
- {"PCE", "Qmap Table", 576, 0x11},//
- {"PCE", "IGCTP Table", 288, 0x12},
- {"PCE", "EGCTP Table", 288, 0x13},
- {"PCE", "IGBRG Table", 128, 0x14},
- {"PCE", "EGBRG Table", 128, 0x15},
- {"PCE", "Mac Da Table", 64, 0x16},
- {"PCE", "Mac Sa Table", 64, 0x17},
- {"PCE", "BRGCFG Table", 64, 0x19},
- {"PCE", "Spcp Table", 16, 0x1A},
- {"PCE", "COLMARK Table", 128, 0x1B},
- {"PCE", "REMARK Table", 80, 0x1C},
- {"PCE", "Payload Table", 64, 0x1D},
- {"PCE", "Extended VLAN Table", 1024, 0x1E},
- {"PCE", "P-Mapping Table", 292, 0x1F},
- {"PCE", "Dscp2Pcp Table", 64, 0xC},
- {"PCE", "PBB Tunnel Table", 256, 0x10},
-};
-
-static const gsw_pce_tbl_t gsw_pce_tbl_33[] = {
- {0, 0, 4}, {2, 0, 0}, {1, 0, 1}, {1, 0, 0}, {1, 1, 0}, {1, 1, 0}, {4, 4, 0}, {4, 4, 0},
- {1, 1, 0}, {0, 0, 1}, {0, 0, 1}, {5, 0, 10}, {0, 0, 2}, {20, 0, 10}, {2, 0, 5}, {34, 0, 31},
- {0, 0, 11}, {0, 0, 1}, {0, 0, 9}, {0, 0, 7}, {0, 0, 27}, {0, 0, 14}, {3, 1, 0}, {3, 1, 0},
- {1, 1, 0}, {0, 0, 10}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {1, 1, 0}, {4, 0, 6}, {0, 0, 1}
-};
-
-// #############################################################################################################
-
-GSW_return_t fapi_GSW_RegisterMod(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_register_mod_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nRegAddr", sizeof(param.nRegAddr), ¶m.nRegAddr);
- if (rret < 1){
- printf("Parameter not Found: nRegAddr\n");
- return OS_ERROR;
- }
- rret = scanParamArg(prmc, prmv, "nData", sizeof(param.nData), ¶m.nData);
- if (rret < 1){
- printf("Parameter not Found: nData\n");
- return OS_ERROR;
- }
- rret = scanParamArg(prmc, prmv, "nMask", sizeof(param.nMask), ¶m.nMask);
- if (rret < 1){
- printf("Parameter not Found: nMask\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_RegisterMod(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_RegisterMod failed with ret code", ret);
- else{
- printf("fapi_GSW_RegisterMod done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_RegisterGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_register_t Param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nRegAddr", sizeof(Param.nRegAddr), &Param.nRegAddr);
- if (rret < 1){
- printf("Parameter not Found: nRegAddr\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_RegisterGet(gsw_dev, &Param);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_RegisterGet failed with ret code", ret);
- else
- printf("fapi_GSW_RegisterGet:\n\t reg=%x val=%x\n",Param.nRegAddr ,Param.nData);
-
- return ret;
-}
-
-
-
-GSW_return_t fapi_GSW_RegisterSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_register_t Param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nRegAddr", sizeof(Param.nRegAddr), &Param.nRegAddr);
- if (rret < 1){
- printf("Parameter not Found: nRegAddr\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nData", sizeof(Param.nData), &Param.nData);
- if (rret < 1){
- printf("Parameter not Found: nData\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_RegisterSet(gsw_dev, &Param);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_RegisterSet failed with ret code", ret);
- else
- printf("fapi_GSW_RegisterSet:\n\t reg=%x val=%x\n",Param.nRegAddr ,Param.nData);
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PortLinkCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_portLinkCfg_t Param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(Param.nPortId), &Param.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PortLinkCfgGet(gsw_dev, &Param);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PortLinkCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_PortLinkCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nPortId", Param.nPortId);
- printf("\t%40s:\t%s\n", "bDuplexForce", Param.bDuplexForce ? "true" : "false");
- printf("\t%40s:\t0x%x\n", "eDuplex", Param.eDuplex);
- printf("\t%40s:\t%s\n", "bSpeedForce", Param.bSpeedForce ? "true" : "false");
- printf("\t%40s:\t0x%x\n", "eSpeed", Param.eSpeed);
- printf("\t%40s:\t%s\n", "bLinkForce", Param.bLinkForce ? "true" : "false");
- printf("\t%40s:\t0x%x\n", "eLink", Param.eLink);
- printf("\t%40s:\t0x%x\n", "eMII_Mode", Param.eMII_Mode);
- printf("\t%40s:\t0x%x\n", "eMII_Type", Param.eMII_Type);
- printf("\t%40s:\t0x%x\n", " eClkMode", Param.eClkMode);
- printf("\t%40s:\t%s\n", "bLPI", Param.bLPI ? "true" : "false");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PortLinkCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_portLinkCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PortLinkCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_PortLinkCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "bDuplexForce", sizeof(param.bDuplexForce), ¶m.bDuplexForce);
- scanParamArg(prmc, prmv, "eDuplex", sizeof(param.eDuplex), ¶m.eDuplex);
- scanParamArg(prmc, prmv, "bSpeedForce", sizeof(param.bSpeedForce), ¶m.bSpeedForce);
- scanParamArg(prmc, prmv, "eSpeed", sizeof(param.eSpeed), ¶m.eSpeed);
- scanParamArg(prmc, prmv, "bLinkForce", sizeof(param.bLinkForce), ¶m.bLinkForce);
- scanParamArg(prmc, prmv, "eLink", sizeof(param.eLink), ¶m.eLink);
- scanParamArg(prmc, prmv, "eMII_Mode", sizeof(param.eMII_Mode), ¶m.eMII_Mode);
- scanParamArg(prmc, prmv, "eMII_Type", sizeof(param.eMII_Type), ¶m.eMII_Type);
- scanParamArg(prmc, prmv, "eClkMode", sizeof(param.eClkMode), ¶m.eClkMode);
- scanParamArg(prmc, prmv, "bLPI", sizeof(param.bLPI), ¶m.bLPI);
-
- ret = GSW_PortLinkCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PortLinkCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_PortLinkCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_RMON_Clear(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_RMON_clear_t param = {0};
-
- scanParamArg(prmc, prmv, "nRmonId", sizeof(param.nRmonId), ¶m.nRmonId);
- scanParamArg(prmc, prmv, "eRmonType", sizeof(param.eRmonType), ¶m.eRmonType);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_RMON_Clear(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_Clear failed with ret code", ret);
- else{
- printf("fapi_GSW_RMON_Clear done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MonitorPortCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_monitorPortCfg_t param={0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_monitorPortCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MonitorPortCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MonitorPortCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_MonitorPortCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MonitorPortCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_monitorPortCfg_t param;
-
- memset(¶m, 0, sizeof(GSW_monitorPortCfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MonitorPortCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MonitorPortCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_MonitorPortCfgGet done\n");
- printf("\t%40s:\t0x%x\n", "nPortId", param.nPortId);
- printf("\t%40s:\t0x%x\n", "nSubIfId", param.nSubIfId);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_QoS_PortCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_portCfg_t Param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(Param.nPortId), &Param.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_PortCfgGet(gsw_dev, &Param);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_PortCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_PortCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nPortId", Param.nPortId);
- printf("\t%40s:\t0x%x\n", "eClassMode", Param.eClassMode);
- printf("\t%40s:\t0x%x\n", "nTrafficClass", Param.nTrafficClass);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_PortCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_portCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_PortCfgGet(gsw_dev, ¶m);
- if (ret < 0) {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_PortCfgGet failed with ret code", ret);
- return ret;
- }
- else{
- printf("fapi_GSW_QoS_PortCfgSet done\n");
- }
-
- scanParamArg(prmc, prmv, "eClassMode", sizeof(param.eClassMode), ¶m.eClassMode);
- scanParamArg(prmc, prmv, "nTrafficClass", sizeof(param.nTrafficClass), ¶m.nTrafficClass);
-
- ret = GSW_QoS_PortCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_PortCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_PortCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_DSCP_ClassGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_DSCP_ClassCfg_t param = {0};
- int i;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_DSCP_ClassGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_DSCP_ClassGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_DSCP_ClassGet:\n");
- for (i = 0; i < 64; i++)
- printf("\tnTrafficClass[%d] = %d\n", i, param.nTrafficClass[i]);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_DSCP_ClassSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_DSCP_ClassCfg_t param = {0};
- int rret;
- unsigned char nTrafficClass;
- unsigned int nDSCP;
-
-
- rret = scanParamArg(prmc, prmv, "nTrafficClass", sizeof(nTrafficClass), &nTrafficClass);
- if (rret < 1){
- printf("Parameter not Found: nTrafficClass\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nDSCP", sizeof(nDSCP), &nDSCP);
- if (rret < 1){
- printf("Parameter not Found: nDSCP\n");
- return OS_ERROR;
- }
-
- if (nDSCP >= 64) {
- printf("ERROR: Given \"nDSCP\" is out of range (63)\n");
- return (-3);
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_DSCP_ClassGet(gsw_dev, ¶m);
- if (ret < 0) {
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_DSCP_ClassSet failed with ret code", ret);
- return ret;
- }
- param.nTrafficClass[nDSCP] = nTrafficClass;
-
- ret = GSW_QoS_DSCP_ClassSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_DSCP_ClassSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_DSCP_ClassSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_PCP_ClassGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_PCP_ClassCfg_t param = {0};
- int i;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_PCP_ClassGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_PCP_ClassGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_PCP_ClassGet:\n");
- for (i = 0; i < 16; i++)
- printf("\tnTrafficClass[%d] = %d\n", i, (int)param.nTrafficClass[i]);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_PCP_ClassSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_PCP_ClassCfg_t param = {0};
- int rret;
- unsigned char nTrafficClass;
- unsigned int nPCP;
-
- rret = scanParamArg(prmc, prmv, "nTrafficClass", sizeof(nTrafficClass), &nTrafficClass);
- if (rret < 1){
- printf("Parameter not Found: nTrafficClass\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nPCP", sizeof(nPCP), &nPCP);
- if (rret < 1){
- printf("Parameter not Found: nPCP\n");
- return OS_ERROR;
- }
-
- if (nPCP >= 16) {
- printf("ERROR: Given \"nPCP\" is out of range (7)\n");
- return (-3);
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_PCP_ClassGet(gsw_dev, ¶m);
- if (ret < 0) {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_PCP_ClassGet failed with ret code", ret);
- return ret;
- }
- param.nTrafficClass[nPCP] = nTrafficClass;
-
- ret = GSW_QoS_PCP_ClassSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_PCP_ClassSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_PCP_ClassSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_SVLAN_PCP_ClassGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_SVLAN_PCP_ClassCfg_t PCP_ClassCfg = {0};
- int i;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_SVLAN_PCP_ClassGet(gsw_dev, &PCP_ClassCfg);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_SVLAN_PCP_ClassGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_SVLAN_PCP_ClassGet:\n");
- for (i = 0; i < 16; i++)
- printf("\tnTrafficClass[%d] = %d\n", i, (int)PCP_ClassCfg.nTrafficClass[i]);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_SVLAN_PCP_ClassSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_SVLAN_PCP_ClassCfg_t PCP_ClassCfg = {0};
- int rret;
- unsigned char nTrafficClass;
- unsigned int nPCP;
-
- rret = scanParamArg(prmc, prmv, "nTrafficClass", sizeof(nTrafficClass), &nTrafficClass);
- if (rret < 1){
- printf("Parameter not Found: nTrafficClass\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nPCP", sizeof(nPCP), &nPCP);
- if (rret < 1){
- printf("Parameter not Found: nPCP\n");
- return OS_ERROR;
- }
-
- if (nPCP >= 16) {
- printf("ERROR: Given \"nPCP\" is out of range (7)\n");
- return (-3);
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_SVLAN_PCP_ClassGet(gsw_dev, &PCP_ClassCfg);
- if (ret < 0) {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_SVLAN_PCP_ClassGet failed with ret code", ret);
- return ret;
- }
- PCP_ClassCfg.nTrafficClass[nPCP] = nTrafficClass;
-
- ret = GSW_QoS_SVLAN_PCP_ClassSet(gsw_dev, &PCP_ClassCfg);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_SVLAN_PCP_ClassSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_SVLAN_PCP_ClassSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_ShaperCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_ShaperCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nRateShaperId", sizeof(param.nRateShaperId), ¶m.nRateShaperId);
- if (rret < 1){
- printf("Parameter not Found: nRateShaperId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_ShaperCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_ShaperCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nRateShaperId", param.nRateShaperId);
- printf("\t%40s:\t%s\n", "bEnable", (param.bEnable > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t0x%x\n", "nCbs", param.nCbs);
- printf("\t%40s:\t0x%x\n", "nRate", param.nRate);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_ShaperCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_ShaperCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nRateShaperId", sizeof(param.nRateShaperId), ¶m.nRateShaperId);
- if (rret < 1){
- printf("Parameter not Found: nRateShaperId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_ShaperCfgGet(gsw_dev, ¶m);
- if (ret < 0) {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_ShaperCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "bEnable", sizeof(param.bEnable), ¶m.bEnable);
- scanParamArg(prmc, prmv, "nCbs", sizeof(param.nCbs), ¶m.nCbs);
- scanParamArg(prmc, prmv, "nRate", sizeof(param.nRate), ¶m.nRate);
-
- ret = GSW_QoS_ShaperCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_ShaperCfgSet done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_QoS_ShaperQueueAssign(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_ShaperQueue_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nRateShaperId", sizeof(param.nRateShaperId), ¶m.nRateShaperId);
- if (rret < 1){
- printf("Parameter not Found: nRateShaperId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
- if (rret < 1){
- printf("Parameter not Found: nQueueId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_ShaperQueueAssign(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperQueueAssign failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_ShaperQueueAssign done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_ShaperQueueDeassign(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_ShaperQueue_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nRateShaperId", sizeof(param.nRateShaperId), ¶m.nRateShaperId);
- if (rret < 1){
- printf("Parameter not Found: nRateShaperId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
- if (rret < 1){
- printf("Parameter not Found: nQueueId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_ShaperQueueDeassign(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperQueueDeassign failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_ShaperQueueDeassign done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_ShaperQueueGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_ShaperQueueGet_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
- if (rret < 1){
- printf("Parameter not Found: nQueueId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_ShaperQueueGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_ShaperQueueGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_ShaperQueueGet:\n");
- printf("\t%40s:\t0x%x\n", "nQueueId", param.nQueueId);
- printf("\t%40s:\t%s\n", "bAssigned", (param.bAssigned > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%u (0x%x)\n", "nRateShaperId", param.nRateShaperId,param.nRateShaperId);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_QoS_SchedulerCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_schedulerCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_QoS_schedulerCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
- if (rret < 1){
- printf("Parameter not Found: nQueueId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_SchedulerCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_SchedulerCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_SchedulerCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nQueueId", param.nQueueId);
- printf("\t%40s:\t0x%x\n", "eType", param.eType);
- printf("\t%40s:\t%u (0x%x)\n", "nWeight", param.nWeight, param.nWeight);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_SchedulerCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_schedulerCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_QoS_schedulerCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
- if (rret < 1){
- printf("Parameter not Found: nQueueId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_SchedulerCfgGet(gsw_dev, ¶m);
- if (ret < 0) {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_SchedulerCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "eType", sizeof(param.eType), ¶m.eType);
- scanParamArg(prmc, prmv, "nWeight", sizeof(param.nWeight), ¶m.nWeight);
-
- ret = GSW_QoS_SchedulerCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_SchedulerCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_SchedulerCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_WredCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_WRED_Cfg_t param = {0};
-
- memset(¶m, 0, sizeof(GSW_QoS_WRED_Cfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_WredCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_WredCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "eProfile", param.eProfile);
- printf("\t%40s:\t0x%x\n", "eMode", param.eMode);
- printf("\t%40s:\t0x%x\n", "eThreshMode", param.eThreshMode);
- printf("\t%40s:\t0x%x\n", "nRed_Min", param.nRed_Min);
- printf("\t%40s:\t0x%x\n", "nRed_Max", param.nRed_Max);
- printf("\t%40s:\t0x%x\n", "nYellow_Min", param.nYellow_Min);
- printf("\t%40s:\t0x%x\n", "nYellow_Max", param.nYellow_Max);
- printf("\t%40s:\t0x%x\n", "nGreen_Min", param.nGreen_Min);
- printf("\t%40s:\t0x%x\n", "nGreen_Max", param.nGreen_Max);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_WredCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_WRED_Cfg_t param = {0};
-
- memset(¶m, 0, sizeof(GSW_QoS_WRED_Cfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_WredCfgGet(gsw_dev, ¶m);
- if (ret < 0) {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_WredCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "eProfile", sizeof(param.eProfile), ¶m.eProfile);
- scanParamArg(prmc, prmv, "eMode", sizeof(param.eMode), ¶m.eMode);
- scanParamArg(prmc, prmv, "eThreshMode", sizeof(param.eThreshMode), ¶m.eThreshMode);
- scanParamArg(prmc, prmv, "nRed_Min", sizeof(param.nRed_Min), ¶m.nRed_Min);
- scanParamArg(prmc, prmv, "nRed_Max", sizeof(param.nRed_Max), ¶m.nRed_Max);
- scanParamArg(prmc, prmv, "nYellow_Min", sizeof(param.nYellow_Min), ¶m.nYellow_Min);
- scanParamArg(prmc, prmv, "nYellow_Max", sizeof(param.nYellow_Max), ¶m.nYellow_Max);
- scanParamArg(prmc, prmv, "nGreen_Min", sizeof(param.nGreen_Min), ¶m.nGreen_Min);
- scanParamArg(prmc, prmv, "nGreen_Max", sizeof(param.nGreen_Max), ¶m.nGreen_Max);
-
- ret = GSW_QoS_WredCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_WredCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_WredQueueCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_WRED_QueueCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_QoS_WRED_QueueCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
- if (rret < 1){
- printf("Parameter not Found: nQueueId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_WredQueueCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredQueueCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_WredQueueCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nQueueId", param.nQueueId);
- printf("\t%40s:\t0x%x\n", "nRed_Min", param.nRed_Min);
- printf("\t%40s:\t0x%x\n", "nRed_Max", param.nRed_Max);
- printf("\t%40s:\t0x%x\n", "nYellow_Min", param.nYellow_Min);
- printf("\t%40s:\t0x%x\n", "nYellow_Max", param.nYellow_Max);
- printf("\t%40s:\t0x%x\n", "nGreen_Min", param.nGreen_Min);
- printf("\t%40s:\t0x%x\n", "nGreen_Max", param.nGreen_Max);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_WredQueueCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_WRED_QueueCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_QoS_WRED_QueueCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
- if (rret < 1){
- printf("Parameter not Found: nQueueId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_WredQueueCfgGet(gsw_dev, ¶m);
- if (ret < 0) {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_WredQueueCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "nRed_Min", sizeof(param.nRed_Min), ¶m.nRed_Min);
- scanParamArg(prmc, prmv, "nRed_Max", sizeof(param.nRed_Max), ¶m.nRed_Max);
- scanParamArg(prmc, prmv, "nYellow_Min", sizeof(param.nYellow_Min), ¶m.nYellow_Min);
- scanParamArg(prmc, prmv, "nYellow_Max", sizeof(param.nYellow_Max), ¶m.nYellow_Max);
- scanParamArg(prmc, prmv, "nGreen_Min", sizeof(param.nGreen_Min), ¶m.nGreen_Min);
- scanParamArg(prmc, prmv, "nGreen_Max", sizeof(param.nGreen_Max), ¶m.nGreen_Max);
-
- ret = GSW_QoS_WredQueueCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredQueueCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_WredQueueCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_WredPortCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_WRED_PortCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_QoS_WRED_PortCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_WredPortCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredPortCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_WredPortCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nPortId", param.nPortId);
- printf("\t%40s:\t0x%x\n", "nRed_Min", param.nRed_Min);
- printf("\t%40s:\t0x%x\n", "nRed_Max", param.nRed_Max);
- printf("\t%40s:\t0x%x\n", "nYellow_Min", param.nYellow_Min);
- printf("\t%40s:\t0x%x\n", "nYellow_Max", param.nYellow_Max);
- printf("\t%40s:\t0x%x\n", "nGreen_Min", param.nGreen_Min);
- printf("\t%40s:\t0x%x\n", "nGreen_Max", param.nGreen_Max);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_WredPortCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_WRED_PortCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_QoS_WRED_PortCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_WredPortCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_WredPortCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "nRed_Min", sizeof(param.nRed_Min), ¶m.nRed_Min);
- scanParamArg(prmc, prmv, "nRed_Max", sizeof(param.nRed_Max), ¶m.nRed_Max);
- scanParamArg(prmc, prmv, "nYellow_Min", sizeof(param.nYellow_Min), ¶m.nYellow_Min);
- scanParamArg(prmc, prmv, "nYellow_Max", sizeof(param.nYellow_Max), ¶m.nYellow_Max);
- scanParamArg(prmc, prmv, "nGreen_Min", sizeof(param.nGreen_Min), ¶m.nGreen_Min);
- scanParamArg(prmc, prmv, "nGreen_Max", sizeof(param.nGreen_Max), ¶m.nGreen_Max);
-
- ret = GSW_QoS_WredPortCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_WredPortCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_WredPortCfgSet done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_TrunkingCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_trunkingCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_trunkingCfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_TrunkingCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Trunking_CfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_Trunking_CfgGet:\n");
- printf("\t%40s:\t0x%x\n", "bIP_Src", param.bIP_Src);
- printf("\t%40s:\t0x%x\n", "bIP_Dst", param.bIP_Dst);
- printf("\t%40s:\t0x%x\n", "bMAC_Src", param.bMAC_Src);
- printf("\t%40s:\t0x%x\n", "bMAC_Dst", param.bMAC_Dst);
- printf("\t%40s:\t0x%x\n", "bSrc_Port", param.bSrc_Port);
- printf("\t%40s:\t0x%x\n", "bDst_Port", param.bDst_Port);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_TrunkingCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_trunkingCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_trunkingCfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_TrunkingCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_TrunkingCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "bIP_Src", sizeof(param.bIP_Src), ¶m.bIP_Src);
- scanParamArg(prmc, prmv, "bIP_Dst", sizeof(param.bIP_Dst), ¶m.bIP_Dst);
- scanParamArg(prmc, prmv, "bMAC_Src", sizeof(param.bMAC_Src), ¶m.bMAC_Src);
- scanParamArg(prmc, prmv, "bMAC_Dst", sizeof(param.bMAC_Dst), ¶m.bMAC_Dst);
- scanParamArg(prmc, prmv, "bSrc_Port", sizeof(param.bSrc_Port), ¶m.bSrc_Port);
- scanParamArg(prmc, prmv, "bDst_Port", sizeof(param.bDst_Port), ¶m.bDst_Port);
-
- ret = GSW_TrunkingCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Trunking_CfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_Trunking_CfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MAC_TableClear(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MAC_TableClear(gsw_dev);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_TableClear failed with ret code", ret);
- else{
- printf("fapi_GSW_MAC_TableClear done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MAC_TableCondClear(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- GSW_MAC_tableClearCond_t param = {0};
-
- scanParamArg(prmc, prmv, "eType", sizeof(param.eType), ¶m.eType);
- scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MAC_TableClearCond(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_TableCondClear failed with ret code", ret);
- else{
- printf("fapi_GSW_MAC_TableCondClear done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_CfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_cfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_cfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_CfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_CfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_CfgGet:\n");
- printf("\t%40s:\t0x%x\n", "eMAC_TableAgeTimer", param.eMAC_TableAgeTimer);
- printf("\t%40s:\t%u\n", "nAgeTimer", param.nAgeTimer);
- printf("\t%40s:\t%u\n", "nMaxPacketLen", param.nMaxPacketLen);
- printf("\t%40s:\t%d\n", "bLearningLimitAction", param.bLearningLimitAction);
- printf("\t%40s:\t%d\n", "bMAC_LockingAction", param.bMAC_LockingAction);
- printf("\t%40s:\t%d\n", "bMAC_SpoofingAction", param.bMAC_SpoofingAction);
- printf("\t%40s:\t%d\n", "bPauseMAC_ModeSrc", param.bPauseMAC_ModeSrc);
- printf("\t%40s:\t", "nPauseMAC_Src");
- printMAC_Address(param.nPauseMAC_Src);
- printf("\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_CfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_cfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_cfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_CfgGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_CfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "eMAC_TableAgeTimer", sizeof(param.eMAC_TableAgeTimer), ¶m.eMAC_TableAgeTimer);
- scanParamArg(prmc, prmv, "nAgeTimer", sizeof(param.nAgeTimer), ¶m.nAgeTimer);
- scanParamArg(prmc, prmv, "nMaxPacketLen", sizeof(param.nMaxPacketLen), ¶m.nMaxPacketLen);
- scanParamArg(prmc, prmv, "bLearningLimitAction", sizeof(param.bLearningLimitAction), ¶m.bLearningLimitAction);
- scanParamArg(prmc, prmv, "bMAC_LockingAction", sizeof(param.bLearningLimitAction), ¶m.bMAC_LockingAction);
- scanParamArg(prmc, prmv, "bMAC_SpoofingAction", sizeof(param.bLearningLimitAction), ¶m.bMAC_SpoofingAction);
- scanParamArg(prmc, prmv, "bPauseMAC_ModeSrc", sizeof(param.bPauseMAC_ModeSrc), ¶m.bPauseMAC_ModeSrc);
- scanMAC_Arg(prmc, prmv, "nPauseMAC_Src", param.nPauseMAC_Src);
-
- ret = GSW_CfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_CfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_CfgSet done\n");
-
- }
-
- return ret;
-}
-
-
-
-GSW_return_t fapi_GSW_MAC_TableEntryRemove(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_MAC_tableRemove_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_MAC_tableRemove_t));
-
- rret = scanMAC_Arg(prmc, prmv, "nMAC", param.nMAC);
- if (rret < 1){
- printf("Parameter not Found: nMAC\n");
- return OS_ERROR;
- }
-
- printMAC_Address(param.nMAC);
- scanParamArg(prmc, prmv, "nFId", sizeof(param.nFId), ¶m.nFId);
- scanParamArg(prmc, prmv, "nTci", sizeof(param.nTci), ¶m.nTci);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MAC_TableEntryRemove(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_TableEntryRemove failed with ret code", ret);
- else{
- printf("fapi_GSW_MAC_TableEntryRemove done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_MAC_TableEntryQuery(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_MAC_tableQuery_t param = {0};
- int rret,i=0;
-
- memset(¶m, 0, sizeof(GSW_MAC_tableQuery_t));
-
- rret = scanMAC_Arg(prmc, prmv, "nMAC", param.nMAC);
- if (rret < 1){
- printf("Parameter not Found: nMAC\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nFId", sizeof(param.nFId), ¶m.nFId);
- if (rret < 1){
- printf("Parameter not Found: nFId\n");
- return OS_ERROR;
- }
- scanParamArg(prmc, prmv, "nFilterFlag", sizeof(param.nFilterFlag), ¶m.nFilterFlag);
- scanParamArg(prmc, prmv, "nTci", sizeof(param.nTci), ¶m.nTci);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MAC_TableEntryQuery(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "GSW_MAC_TableEntryQuery failed with ret code", ret);
- else{
- printf("%40s:\t", "nMAC");
- printMAC_Address(param.nMAC);
- printf("\n");
- printf("%40s:\t%d\n", "nFId", param.nFId);
- printf("%40s:\t%d\n", "nFilterFlag", param.nFilterFlag);
- printf("%40s:\t%s\n", "bFound", (param.bFound > 0) ? "1" : "0");
- printf("%40s:\t%s\n", "bStaticEntry", (param.bStaticEntry > 0) ? "TRUE" : "FALSE");
- printf("%40s:\t%d\n", "nSVLAN_Id", param.nSVLAN_Id);
-
- if (param.bStaticEntry) {
- for (i = 0; i < 8; i++) {
- printf("%35s[ %d ]:\t0x%x\n", "PortMap", i, param.nPortMap[i]);
- }
-
- printf("%40s:\t%d\n", "bIgmpControlled", param.bIgmpControlled);
- printf("%40s:\t%d\n", "Hit Status", param.hitstatus);
- } else { /*Dynamic Entry*/
- printf("%40s:\t%u\n", "nPortId", param.nPortId);
- //printf("%40s:\t%d\n", "nSubIfId", param.nSubIfId); //TODO need use in along with param.nPortId?
- printf("%40s:\t%d\n", "AgeTimer", param.nAgeTimer);
- printf("%40s:\t%s\n", "bEntryChanged", (param.bEntryChanged > 0) ? "TRUE" : "FALSE");
- printf("%40s:\t%d\n", "FirstBridgePortId", param.nFirstBridgePortId);
- printf("%40s:\t", "nAssociatedMAC");
- printMAC_Address(param.nAssociatedMAC);
- printf("\n");
- }
-
- if (param.nTci) {
- printf("\t%40s:\t%d\n", "VLAN PRI", ((param.nTci & 0xE000) >> 13));
- printf("\t%40s:\t%d\n", "VLAN CFI/DEI", ((param.nTci & 0x1000) >> 12));
- printf("\t%40s:\t%d\n", "VLAN ID", (param.nTci & 0x0FFF));
- }
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_QoS_FlowctrlCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_FlowCtrlCfg_t param = {0};
-
- memset(¶m, 0, sizeof(GSW_QoS_FlowCtrlCfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_FlowctrlCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_FlowctrlCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_FlowctrlCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nFlowCtrlNonConform_Min", param.nFlowCtrlNonConform_Min);
- printf("\t%40s:\t0x%x\n", "nFlowCtrlNonConform_Max", param.nFlowCtrlNonConform_Max);
- printf("\t%40s:\t0x%x\n", "nFlowCtrlConform_Min", param.nFlowCtrlConform_Min);
- printf("\t%40s:\t0x%x\n", "nFlowCtrlConform_Max", param.nFlowCtrlConform_Max);
- printf("\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_FlowctrlCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_FlowCtrlCfg_t param = {0};
- int cnt;
-
- memset(¶m, 0, sizeof(GSW_QoS_FlowCtrlCfg_t));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_FlowctrlCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_FlowctrlCfgGet failed with ret code", ret);
- return ret;
- }
-
- cnt = scanParamArg(prmc, prmv, "nFlowCtrlNonConform_Min", sizeof(param.nFlowCtrlNonConform_Min), ¶m.nFlowCtrlNonConform_Min);
- cnt += scanParamArg(prmc, prmv, "nFlowCtrlNonConform_Max", sizeof(param.nFlowCtrlNonConform_Max), ¶m.nFlowCtrlNonConform_Max);
- cnt += scanParamArg(prmc, prmv, "nFlowCtrlConform_Min", sizeof(param.nFlowCtrlConform_Min), ¶m.nFlowCtrlConform_Min);
- cnt += scanParamArg(prmc, prmv, "nFlowCtrlConform_Max", sizeof(param.nFlowCtrlConform_Max), ¶m.nFlowCtrlConform_Max);
-
- if (cnt) {
- ret = GSW_QoS_FlowctrlCfgSet(gsw_dev, ¶m);
- }
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_FlowctrlCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_FlowctrlCfgSet done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_QoS_FlowctrlPortCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_FlowCtrlPortCfg_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_QoS_FlowCtrlPortCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_FlowctrlPortCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_FlowctrlPortCfgGet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_FlowctrlPortCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nPortId", param.nPortId);
- printf("\t%40s:\t0x%x\n", "nFlowCtrl_Min", param.nFlowCtrl_Min);
- printf("\t%40s:\t0x%x\n", "nFlowCtrl_Max", param.nFlowCtrl_Max);
- printf("\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_FlowctrlPortCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret = 0;
- GSW_QoS_FlowCtrlPortCfg_t param = {0};
- int rret,cnt;
-
- memset(¶m, 0, sizeof(GSW_QoS_FlowCtrlPortCfg_t));
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_FlowctrlPortCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_FlowctrlPortCfgGet failed with ret code", ret);
- return ret;
- }
-
- cnt = scanParamArg(prmc, prmv, "nFlowCtrl_Min", sizeof(param.nFlowCtrl_Min), ¶m.nFlowCtrl_Min);
- cnt += scanParamArg(prmc, prmv, "nFlowCtrl_Max", sizeof(param.nFlowCtrl_Max), ¶m.nFlowCtrl_Max);
- if (cnt) {
- ret = GSW_QoS_FlowctrlPortCfgSet(gsw_dev, ¶m);
- }
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_FlowctrlPortCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_FlowctrlPortCfgSet done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_MAC_TableEntryAdd(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_MAC_tableAdd_t param = {0};
-
- memset(¶m, 0, sizeof(GSW_MAC_tableAdd_t));
-
- scanParamArg(prmc, prmv, "nFId", sizeof(param.nFId), ¶m.nFId);
- scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- scanParamArg(prmc, prmv, "nAgeTimer", sizeof(param.nAgeTimer), ¶m.nAgeTimer);
- scanParamArg(prmc, prmv, "bStaticEntry", sizeof(param.bStaticEntry), ¶m.bStaticEntry);
- scanParamArg(prmc, prmv, "nTrafficClass", sizeof(param.nTrafficClass), ¶m.nTrafficClass);
- scanParamArg(prmc, prmv, "bIgmpControlled", sizeof(param.bIgmpControlled), ¶m.bIgmpControlled);
- scanParamArg(prmc, prmv, "nFilterFlag", sizeof(param.nFilterFlag), ¶m.nFilterFlag);
- scanParamArg(prmc, prmv, "nSVLAN_Id", sizeof(param.bIgmpControlled), ¶m.nSVLAN_Id);
- scanParamArg(prmc, prmv, "nSubIfId", sizeof(param.nSubIfId), ¶m.nSubIfId);
- scanMAC_Arg(prmc, prmv, "nMAC", param.nMAC);
- scanMAC_Arg(prmc, prmv, "nAssociatedMAC", param.nAssociatedMAC);
- scanParamArg(prmc, prmv, "nTci", sizeof(param.nTci), ¶m.nTci);
- scanParamArg(prmc, prmv, "nPortMapValueIndex0", sizeof(param.nPortMap[0]), ¶m.nPortMap[0]);
- scanParamArg(prmc, prmv, "nPortMapValueIndex1", sizeof(param.nPortMap[1]), ¶m.nPortMap[1]);
- scanParamArg(prmc, prmv, "nPortMapValueIndex2", sizeof(param.nPortMap[2]), ¶m.nPortMap[2]);
- scanParamArg(prmc, prmv, "nPortMapValueIndex3", sizeof(param.nPortMap[3]), ¶m.nPortMap[3]);
- scanParamArg(prmc, prmv, "nPortMapValueIndex4", sizeof(param.nPortMap[4]), ¶m.nPortMap[4]);
- scanParamArg(prmc, prmv, "nPortMapValueIndex5", sizeof(param.nPortMap[5]), ¶m.nPortMap[5]);
- scanParamArg(prmc, prmv, "nPortMapValueIndex6", sizeof(param.nPortMap[6]), ¶m.nPortMap[6]);
- scanParamArg(prmc, prmv, "nPortMapValueIndex7", sizeof(param.nPortMap[7]), ¶m.nPortMap[7]);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MAC_TableEntryAdd(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_TableEntryAdd failed with ret code", ret);
- else{
- printf("fapi_GSW_MAC_TableEntryAdd done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MAC_TableEntryRead(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int i = 0;
- GSW_MAC_tableRead_t MAC_tableRead = {0};
-
- memset(&MAC_tableRead, 0, sizeof(GSW_MAC_tableRead_t));
-
- for (i = 0; i < 71; i++)
- printf("-");
- printf("\n");
- printf("%-18s|%-5s|%-10s|%-5s|%-5s|%-5s|%-8s\n",
- "MAC Address", "Port", "Age", "SID", "FID", "Hit", "Stat/Dyn");
- for (i = 0; i < 71; i++)
- printf("-");
- printf("\n");
-
- MAC_tableRead.bInitial = 1;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- for (;;) {
- ret = GSW_MAC_TableEntryRead(gsw_dev, &MAC_tableRead);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_MAC_TableEntryRead failed with ret code", ret);
- return ret;
- }
-
- if (MAC_tableRead.bLast == 1)
- break;
-
- if (checkValidMAC_Address(MAC_tableRead.nMAC)) {
- if ((MAC_tableRead.nAgeTimer == 0) && (MAC_tableRead.bStaticEntry == 0)) {
- /* Do nothing */
- continue;
- }
- }
-
- if (MAC_tableRead.bStaticEntry) {
- unsigned int i = 0;
- printMAC_Address(MAC_tableRead.nMAC);
- if (MAC_tableRead.nPortId & 0x80000000)
- printf(" |MAP |");
- else
- printf(" |%-5d|", MAC_tableRead.nPortId);
- printf("%-10d|%-5d|%-5d|%-5d|Static\n",
- MAC_tableRead.nAgeTimer,
- MAC_tableRead.nSubIfId,
- MAC_tableRead.nFId,
- MAC_tableRead.hitstatus
- );
- printf("%-19s%-5s%-10s%-5s%-5s%-9s%-9s|%-9s: 0x%x\n",
- "", "", "", "", "", "", "",
- "nFilterFlag(key)", MAC_tableRead.nFilterFlag);
-
- for (i = 0; i < ARRAY_SIZE(MAC_tableRead.nPortMap); i++) {
- if (!MAC_tableRead.nPortMap[i])
- continue;
-
- printf("%-19s%-5s%-10s%-5s%-5s%-9s%-9s|%-8s[%d]: 0x%x\n",
- "", "", "", "", "", "", "",
- "PortMap", i, MAC_tableRead.nPortMap[i]);
- }
- } else {
- printMAC_Address(MAC_tableRead.nMAC);
- printf(" |%-5d|%-10d|%-5d|%-5d|%-5d|Dynamic\n",
- MAC_tableRead.nPortId,
- MAC_tableRead.nAgeTimer,
- MAC_tableRead.nSubIfId,
- MAC_tableRead.nFId,
- MAC_tableRead.hitstatus
- );
- }
-
- if (MAC_tableRead.nTci) {
- printf("%-19s%-5s%-10s%-5s%-55s%-9s%-9s|%-18s: %d\n",
- "", "", "", "", "", "", "",
- "VLAN PRI", ((MAC_tableRead.nTci & 0xE000) >> 13));
- printf("%-19s%-5s%-10s%-5s%-55s%-9s%-9s|%-18s: %d\n",
- "", "", "", "", "", "", "",
- "VLAN CFI/DEI", ((MAC_tableRead.nTci & 0x1000) >> 12));
- printf("%-19s%-5s%-10s%-5s%-55s%-9s%-9s|%-18s: %d\n",
- "", "", "", "", "", "", "",
- "VLAN ID", (MAC_tableRead.nTci & 0x0FFF));
- }
- memset(&MAC_tableRead, 0x00, sizeof(MAC_tableRead));
- }
-
- for (i = 0; i < 71; i++)
- printf("-");
- printf("\n");
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_QoS_QueuePortSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_queuePort_t param = {0};
- int rret;
-
- memset(¶m, 0, sizeof(GSW_QoS_queuePort_t));
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
- scanParamArg(prmc, prmv, "nTrafficClassId", sizeof(param.nTrafficClassId), ¶m.nTrafficClassId);
- scanParamArg(prmc, prmv, "bRedirectionBypass", sizeof(param.bRedirectionBypass), ¶m.bRedirectionBypass);
- scanParamArg(prmc, prmv, "bExtrationEnable", sizeof(param.bExtrationEnable), ¶m.bExtrationEnable);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_QueuePortGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_QueuePortGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv, "eQMapMode", sizeof(param.eQMapMode), ¶m.eQMapMode);
- scanParamArg(prmc, prmv, "nQueueId", sizeof(param.nQueueId), ¶m.nQueueId);
- scanParamArg(prmc, prmv, "nRedirectPortId", sizeof(param.nRedirectPortId), ¶m.nRedirectPortId);
- scanParamArg(prmc, prmv, "bEnableIngressPceBypass", sizeof(param.bEnableIngressPceBypass),¶m.bEnableIngressPceBypass);
- scanParamArg(prmc, prmv, "bReservedPortMode", sizeof(param.bReservedPortMode),¶m.bReservedPortMode);
-
- ret = GSW_QoS_QueuePortSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_QueuePortSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_QueuePortSet done\n");
- }
-
- return ret;
-
-}
-
-static int print_queues_gswip32(uint16_t port)
-{
- GSW_QoS_queuePort_t queuePortParam = {0};
- int tc;
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- queuePortParam.nPortId = port;
-
- gsw_dev = gsw_get_struc(lif_id,0);
-
- for (tc = 0; tc < NUM_TC * 4; tc++) {
- queuePortParam.nTrafficClassId = tc & GENMASK(3, 0);
- queuePortParam.bRedirectionBypass = (tc & BIT(4)) >> 4;
- queuePortParam.bExtrationEnable = (tc & BIT(5)) >> 5;
-
- if (queuePortParam.nTrafficClassId == 0) {
- printf("\n");
- printf(" Port | Traffic Class | bRedirectionBypass | bPceIngressBypass | bExtrationEnable | Egress Queue | nRedirectPortId\n");
- printf("------------------------------------------------------------------------------------------------------------------\n");
- }
-
- ret = GSW_QoS_QueuePortGet(gsw_dev, &queuePortParam);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_QueuePortGet failed with ret code", ret);
- return ret;
- }
-
- printf(" %4d | %13d | %18d ",
- queuePortParam.nPortId,
- queuePortParam.nTrafficClassId,
- queuePortParam.bRedirectionBypass);
-
- if (queuePortParam.bRedirectionBypass)
- printf("| %17s ", "n/a");
- else
- printf("| %17d ", queuePortParam.bEnableIngressPceBypass);
-
- if (queuePortParam.bRedirectionBypass
- || !queuePortParam.bEnableIngressPceBypass)
- printf("| %16d ", queuePortParam.bExtrationEnable);
- else
- printf("| %16s ", "n/a");
-
- printf("| %12d | %15d\n",
- queuePortParam.nQueueId,
- queuePortParam.nRedirectPortId);
-
- if (queuePortParam.nTrafficClassId == NUM_TC - 1)
- printf("------------------------------------------------------------------------------------------------------------------\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_QueuePortGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret = -1;
- GSW_QoS_queuePort_t queuePortParam = {0};
-
- memset(&queuePortParam, 0, sizeof(GSW_QoS_queuePort_t));
-
-
- if (scanParamArg(prmc, prmv,"nPortId", sizeof(queuePortParam.nPortId), &queuePortParam.nPortId))
- {
- if (scanParamArg(prmc, prmv, "nTrafficClassId", sizeof(queuePortParam.nTrafficClassId), &queuePortParam.nTrafficClassId)) {
- scanParamArg(prmc, prmv, "bRedirectionBypass", sizeof(queuePortParam.bRedirectionBypass), &queuePortParam.bRedirectionBypass);
-
- scanParamArg(prmc, prmv, "bExtrationEnable", sizeof(queuePortParam.bExtrationEnable), &queuePortParam.bExtrationEnable);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_QueuePortGet(gsw_dev, &queuePortParam);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_QoS_QueuePortGet failed with ret code", ret);
- return ret;
- }
-
- printf("fapi_GSW_QoS_FlowctrlPortCfgGet:\n");
- printf("\t%40s:\t0x%x\n", "nPortId", queuePortParam.nPortId);
- printf("\t%40s:\t0x%x\n", "nTrafficClassId", queuePortParam.nTrafficClassId);
- printf("\t%40s:\t0x%x\n", "bRedirectionBypass", queuePortParam.bRedirectionBypass);
- printf("\t%40s:\t0x%x\n", "bEnableIngressPceBypass", queuePortParam.bEnableIngressPceBypass);
- printf("\t%40s:\t0x%x\n", "bExtrationEnable", queuePortParam.bExtrationEnable);
-
- if (queuePortParam.eQMapMode == GSW_QOS_QMAP_SINGLE_MODE)
- printf("\t%40s:\tSingle\n", "eQMapMode");
- else
- printf("\t%40s:\tSubifid\n", "eQMapMode");
- printf("\t%40s:\t0x%x\n", "nQueueId", queuePortParam.nQueueId);
- printf("\t%40s:\t0x%x\n", "nRedirectPortId", queuePortParam.nRedirectPortId);
- return ret;
- } else {
- return print_queues_gswip32(queuePortParam.nPortId);
- }
- }
- printf("Parameter \"nPortId\" is missing.\n");
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_BridgePortConfigGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_BRIDGE_portConfig_t sVar = { 0 };
- int rret;
- unsigned int i;
-
- rret = scanParamArg(prmc, prmv, "nBridgePortId", sizeof(sVar.nBridgePortId), &sVar.nBridgePortId);
- if (rret < 1){
- printf("Parameter not Found: nBridgePortId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "eMask", sizeof(sVar.eMask), &sVar.eMask);
- if (!sVar.eMask)
- sVar.eMask = 0xFFFFFFFF;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgePortConfigGet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgePortConfigGet failed with ret code", ret);
- else{
- printf("\t%40s:\t0x%x\n", "nBridgePortId", sVar.nBridgePortId);
- printf("\t%40s:\t0x%x\n", "eMask", sVar.eMask);
- printf("\t%40s:\t0x%x\n", "nBridgeId", sVar.nBridgeId);
- printf("\t%40s:\t0x%x\n", "bIngressExtendedVlanEnable", sVar.bIngressExtendedVlanEnable);
- printf("\t%40s:\t0x%x\n", "nIngressExtendedVlanBlockId", sVar.nIngressExtendedVlanBlockId);
- printf("\t%40s:\t0x%x\n", "bEgressExtendedVlanEnable", sVar.bEgressExtendedVlanEnable);
- printf("\t%40s:\t0x%x\n", "nEgressExtendedVlanBlockId", sVar.nEgressExtendedVlanBlockId);
- printf("\t%40s:\t0x%x\n", "eIngressMarkingMode", sVar.eIngressMarkingMode);
- printf("\t%40s:\t0x%x\n", "eEgressRemarkingMode", sVar.eEgressRemarkingMode);
- printf("\t%40s:\t0x%x\n", "bIngressMeteringEnable", sVar.bIngressMeteringEnable);
- printf("\t%40s:\t0x%x\n", "nIngressTrafficMeterId", sVar.nIngressTrafficMeterId);
- printf("\t%40s:\t0x%x\n", "bEgressMeteringEnable", sVar.bEgressSubMeteringEnable[5]);
- printf("\t%40s:\t0x%x\n", "nEgressTrafficMeterId", sVar.nEgressTrafficSubMeterId[5]);
- printf("\t%40s:\t0x%x\n", "bEgressBroadcastSubMeteringEnable", sVar.bEgressSubMeteringEnable[0]);
- printf("\t%40s:\t0x%x\n", "bEgressMulticastSubMeteringEnable", sVar.bEgressSubMeteringEnable[1]);
- printf("\t%40s:\t0x%x\n", "bEgressUnknownMulticastIPSubMeteringEnable", sVar.bEgressSubMeteringEnable[2]);
- printf("\t%40s:\t0x%x\n", "bEgressUnknownMulticastNonIPSubMeteringEnable", sVar.bEgressSubMeteringEnable[3]);
- printf("\t%40s:\t0x%x\n", "bEgressUnknownUnicastSubMeteringEnable", sVar.bEgressSubMeteringEnable[4]);
- printf("\t%40s:\t0x%x\n", "nEgressBroadcastSubMeteringId", sVar.nEgressTrafficSubMeterId[0]);
- printf("\t%40s:\t0x%x\n", "nEgressMulticastSubMeteringId", sVar.nEgressTrafficSubMeterId[1]);
- printf("\t%40s:\t0x%x\n", "bEgressUnknownMulticastIPSubMeteringEnable", sVar.nEgressTrafficSubMeterId[2]);
- printf("\t%40s:\t0x%x\n", "bEgressUnknownMulticastNonIPSubMeteringEnable", sVar.nEgressTrafficSubMeterId[3]);
- printf("\t%40s:\t0x%x\n", "bEgressUnknownUnicastSubMeteringEnable", sVar.nEgressTrafficSubMeterId[4]);
- printf("\t%40s:\t0x%x\n", "nDestLogicalPortId", sVar.nDestLogicalPortId);
- printf("\t%40s:\t0x%x\n", "nDestSubIfIdGroup", sVar.nDestSubIfIdGroup);
- printf("\t%40s:\t0x%x\n", "bPmapperEnable", sVar.bPmapperEnable);
-
- if (sVar.bPmapperEnable) {
- printf("\t%40s:\t0x%x\n", "ePmapperMappingMode", sVar.ePmapperMappingMode);
- printf("\t%40s:\t0x%x\n", "nPmapperId", sVar.sPmapper.nPmapperId);
- for (i = 0; i < 73; i++)
- printf("\t%40s[%u]:\t0x%x\n", "nDestSubIfIdGroup",i,sVar.sPmapper.nDestSubIfIdGroup[i]);
- }
-
- for (i = 0; i < ARRAY_SIZE(sVar.nBridgePortMap); i++)
- printf("\t%40s[%u]:\t0x%x\n", "nBridgePortMapIndex",i,sVar.nBridgePortMap[i]);
-
- printf("\t%40s:\t0x%x\n", "bMcDestIpLookupDisable", sVar.bMcDestIpLookupDisable);
- printf("\t%40s:\t0x%x\n", "bMcSrcIpLookupEnable", sVar.bMcSrcIpLookupEnable);
- printf("\t%40s:\t0x%x\n", "bDestMacLookupDisable", sVar.bDestMacLookupDisable);
- printf("\t%40s:\t0x%x\n", "bSrcMacLearningDisable", sVar.bSrcMacLearningDisable);
- printf("\t%40s:\t0x%x\n", "bMacSpoofingDetectEnable", sVar.bMacSpoofingDetectEnable);
- printf("\t%40s:\t0x%x\n", "bPortLockEnable", sVar.bPortLockEnable);
- printf("\t%40s:\t0x%x\n", "bMacLearningLimitEnable", sVar.bMacLearningLimitEnable);
- printf("\t%40s:\t0x%x\n", "nMacLearningLimit", sVar.nMacLearningLimit);
- printf("\t%40s:\t0x%x\n", "nMacLearningCount", sVar.nMacLearningCount);
- printf("\t%40s:\t0x%x\n", "bIngressVlanFilterEnable", sVar.bIngressVlanFilterEnable);
- printf("\t%40s:\t0x%x\n", "nIngressVlanFilterBlockId", sVar.nIngressVlanFilterBlockId);
- printf("\t%40s:\t0x%x\n", "bBypassEgressVlanFilter1", sVar.bBypassEgressVlanFilter1);
- printf("\t%40s:\t0x%x\n", "bEgressVlanFilter1Enable", sVar.bEgressVlanFilter1Enable);
- printf("\t%40s:\t0x%x\n", "nEgressVlanFilter1BlockId", sVar.nEgressVlanFilter1BlockId);
- printf("\t%40s:\t0x%x\n", "bEgressVlanFilter2Enable", sVar.bEgressVlanFilter2Enable);
- printf("\t%40s:\t0x%x\n", "nEgressVlanFilter2BlockId", sVar.nEgressVlanFilter2BlockId);
- printf("\t%40s:\t0x%x\n", "bVlanTagSelection", sVar.bVlanTagSelection);
- printf("\t%40s:\t0x%x\n", "bVlanSrcMacPriorityEnable", sVar.bVlanSrcMacPriorityEnable);
- printf("\t%40s:\t0x%x\n", "bVlanSrcMacDEIEnable", sVar.bVlanSrcMacDEIEnable);
- printf("\t%40s:\t0x%x\n", "bVlanSrcMacVidEnable", sVar.bVlanSrcMacVidEnable);
- printf("\t%40s:\t0x%x\n", "bVlanDstMacPriorityEnable", sVar.bVlanDstMacPriorityEnable);
- printf("\t%40s:\t0x%x\n", "bVlanDstMacDEIEnable", sVar.bVlanDstMacDEIEnable);
- printf("\t%40s:\t0x%x\n", "bVlanDstMacVidEnable", sVar.bVlanDstMacVidEnable);
- printf("\t%40s:\t0x%x\n", "bVlanMulticastPriorityEnable", sVar.bVlanMulticastPriorityEnable);
- printf("\t%40s:\t0x%x\n", "bVlanMulticastDEIEnable", sVar.bVlanMulticastDEIEnable);
- printf("\t%40s:\t0x%x\n", "bVlanMulticastVidEnable", sVar.bVlanMulticastVidEnable);
- printf("\t%40s:\t0x%x\n", "bLoopViolationCounters", sVar.nLoopViolationCount);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_BridgePortConfigSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_BRIDGE_portConfig_t sVar;
- int rret;
- unsigned int i, bBridgePortMapEnable = 0,MapValue = 0;
- u16 Index = 0;
-
- memset(&sVar, 0x00, sizeof(sVar));
-
- rret = scanParamArg(prmc, prmv, "nBridgePortId", sizeof(sVar.nBridgePortId), &sVar.nBridgePortId);
- if (rret < 1){
- printf("Parameter not Found: nBridgePortId\n");
- return OS_ERROR;
- }
-
- sVar.eMask = 0xFFFFFFFF;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgePortConfigGet(gsw_dev, &sVar);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_BridgePortConfigGet failed with ret code", ret);
- return ret;
- }
- sVar.eMask = 0x0;
-
- scanParamArg(prmc, prmv, "nBridgeId", sizeof(sVar.eMask), &sVar.nBridgeId);
- if (findStringParam(prmc, prmv, "nBridgeId"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_BRIDGE_ID;
-
- scanParamArg(prmc, prmv, "bIngressExtendedVlanEnable", sizeof(sVar.bIngressExtendedVlanEnable), &sVar.bIngressExtendedVlanEnable);
- if (findStringParam(prmc, prmv, "bIngressExtendedVlanEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN;
-
- scanParamArg(prmc, prmv, "nIngressExtendedVlanBlockId", sizeof(sVar.nIngressExtendedVlanBlockId), &sVar.nIngressExtendedVlanBlockId);
- scanParamArg(prmc, prmv, "bEgressExtendedVlanEnable", sizeof(sVar.bEgressExtendedVlanEnable), &sVar.bEgressExtendedVlanEnable);
- if (findStringParam(prmc, prmv, "bEgressExtendedVlanEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN;
-
- scanParamArg(prmc, prmv, "nEgressExtendedVlanBlockId", sizeof(sVar.nEgressExtendedVlanBlockId), &sVar.nEgressExtendedVlanBlockId);
- scanParamArg(prmc, prmv, "eIngressMarkingMode", sizeof(sVar.eIngressMarkingMode), &sVar.eIngressMarkingMode);
- if (findStringParam(prmc, prmv, "eIngressMarkingMode"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_MARKING;
-
- scanParamArg(prmc, prmv, "eEgressRemarkingMode", sizeof(sVar.eEgressRemarkingMode), &sVar.eEgressRemarkingMode);
- if (findStringParam(prmc, prmv, "eEgressRemarkingMode"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_REMARKING;
-
- scanParamArg(prmc, prmv, "bIngressMeteringEnable", sizeof(sVar.bIngressMeteringEnable), &sVar.bIngressMeteringEnable);
- if (findStringParam(prmc, prmv, "bIngressMeteringEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_METER;
-
- scanParamArg(prmc, prmv, "nIngressTrafficMeterId", sizeof(sVar.nIngressTrafficMeterId), &sVar.nIngressTrafficMeterId);
- scanParamArg(prmc, prmv, "bEgressMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[5]), &sVar.bEgressSubMeteringEnable[5]);
- if (findStringParam(prmc, prmv, "bEgressMeteringEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
-
- scanParamArg(prmc, prmv, "nEgressTrafficMeterId", sizeof(sVar.nEgressTrafficSubMeterId[5]), &sVar.nEgressTrafficSubMeterId[5]);
- scanParamArg(prmc, prmv, "bEgressBroadcastSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[0]), &sVar.bEgressSubMeteringEnable[0]);
- if (findStringParam(prmc, prmv, "bEgressBroadcastSubMeteringEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
-
- scanParamArg(prmc, prmv, "bEgressMulticastSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[1]), &sVar.bEgressSubMeteringEnable[1]);
- if (findStringParam(prmc, prmv, "bEgressMulticastSubMeteringEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
-
- scanParamArg(prmc, prmv, "bEgressUnknownMulticastIPSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[2]), &sVar.bEgressSubMeteringEnable[2]);
- if (findStringParam(prmc, prmv, "bEgressUnknownMulticastIPSubMeteringEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
-
- scanParamArg(prmc, prmv, "bEgressUnknownMulticastNonIPSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[3]), &sVar.bEgressSubMeteringEnable[3]);
- if (findStringParam(prmc, prmv, "bEgressUnknownMulticastNonIPSubMeteringEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
-
- scanParamArg(prmc, prmv, "bEgressUnknownUnicastSubMeteringEnable", sizeof(sVar.bEgressSubMeteringEnable[4]), &sVar.bEgressSubMeteringEnable[4]);
- if (findStringParam(prmc, prmv, "bEgressUnknownUnicastSubMeteringEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER;
-
- scanParamArg(prmc, prmv, "nEgressBroadcastSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[0]), &sVar.nEgressTrafficSubMeterId[0]);
- scanParamArg(prmc, prmv, "nEgressMulticastSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[1]), &sVar.nEgressTrafficSubMeterId[1]);
- scanParamArg(prmc, prmv, "nEgressUnknownMulticastIPSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[2]), &sVar.nEgressTrafficSubMeterId[2]);
- scanParamArg(prmc, prmv, "nEgressUnknownMulticastNonIPSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[3]), &sVar.nEgressTrafficSubMeterId[3]);
- scanParamArg(prmc, prmv, "nEgressUnknownUnicastSubMeteringId", sizeof(sVar.nEgressTrafficSubMeterId[4]), &sVar.nEgressTrafficSubMeterId[4]);
-
- scanParamArg(prmc, prmv, "nDestLogicalPortId", sizeof(sVar.nDestLogicalPortId), &sVar.nDestLogicalPortId);
- if (findStringParam(prmc, prmv, "nDestLogicalPortId"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_CTP_MAPPING;
-
- scanParamArg(prmc, prmv, "nDestSubIfIdGroup", sizeof(sVar.nDestSubIfIdGroup), &sVar.nDestSubIfIdGroup);
- if (findStringParam(prmc, prmv, "nDestSubIfIdGroup"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_CTP_MAPPING;
-
- scanParamArg(prmc, prmv, "bPmapperEnable", sizeof(sVar.bPmapperEnable), &sVar.bPmapperEnable);
- if (findStringParam(prmc, prmv, "bPmapperEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_CTP_MAPPING;
-
- if (sVar.bPmapperEnable) {
- scanParamArg(prmc, prmv, "ePmapperMappingMode", sizeof(sVar.ePmapperMappingMode), &sVar.ePmapperMappingMode);
- scanPMAP_Arg(prmc, prmv, "nPmapperDestSubIfIdGroup", sVar.sPmapper.nDestSubIfIdGroup);
- printf("i. The first entry of each P-mapper index is for Non-IP and Non-VLAN tagging packets\n");
- printf("ii. The entry 8 to 1 of each P-mapper index is for PCP mapping entries\n");
- printf("iii.The entry 72 to 9 of each P-mapper index is for DSCP mapping entries\n");
- printf("User Configured nDestSubIfIdGroup list as below\n");
-
- for (i = 0; i <= 72; i++)
- printf("sVar.sPmapper.nDestSubIfIdGroup[%d] = %d\n", i, sVar.sPmapper.nDestSubIfIdGroup[i]);
- }
-
- scanParamArg(prmc, prmv, "bBridgePortMapEnable", sizeof(bBridgePortMapEnable), &bBridgePortMapEnable);
- if (findStringParam(prmc, prmv, "bBridgePortMapEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_BRIDGE_PORT_MAP;
- if (bBridgePortMapEnable) {
- scanParamArg(prmc, prmv, "Index", sizeof(Index), &Index);
- scanParamArg(prmc, prmv, "MapValue", sizeof(MapValue), &MapValue);
-
- /* refer to gsw.h - u16 nBridgePortMap[8]; max can be 16 */
- if (Index > 7)
- Index = 7;
- sVar.nBridgePortMap[Index] = MapValue;
- }
-
- scanParamArg(prmc, prmv, "bMcDestIpLookupDisable", sizeof(sVar.bMcDestIpLookupDisable), &sVar.bMcDestIpLookupDisable);
- if (findStringParam(prmc, prmv, "bMcDestIpLookupDisable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MC_DEST_IP_LOOKUP;
-
- scanParamArg(prmc, prmv, "bMcSrcIpLookupEnable", sizeof(sVar.bMcSrcIpLookupEnable), &sVar.bMcSrcIpLookupEnable);
- if (findStringParam(prmc, prmv, "bMcSrcIpLookupEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MC_SRC_IP_LOOKUP;
-
- scanParamArg(prmc, prmv, "bDestMacLookupDisable", sizeof(sVar.bDestMacLookupDisable), &sVar.bDestMacLookupDisable);
- if (findStringParam(prmc, prmv, "bDestMacLookupDisable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MC_DEST_MAC_LOOKUP;
-
- scanParamArg(prmc, prmv, "bSrcMacLearningDisable", sizeof(sVar.bSrcMacLearningDisable), &sVar.bSrcMacLearningDisable);
- if (findStringParam(prmc, prmv, "bSrcMacLearningDisable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MC_SRC_MAC_LEARNING;
-
- scanParamArg(prmc, prmv, "bMacSpoofingDetectEnable", sizeof(sVar.bMacSpoofingDetectEnable), &sVar.bMacSpoofingDetectEnable);
- if (findStringParam(prmc, prmv, "bMacSpoofingDetectEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MAC_SPOOFING;
-
- scanParamArg(prmc, prmv, "bPortLockEnable", sizeof(sVar.bPortLockEnable), &sVar.bPortLockEnable);
- if (findStringParam(prmc, prmv, "bPortLockEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_PORT_LOCK;
-
- scanParamArg(prmc, prmv, "bMacLearningLimitEnable", sizeof(sVar.bMacLearningLimitEnable), &sVar.bMacLearningLimitEnable);
- if (findStringParam(prmc, prmv, "bMacLearningLimitEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_MAC_LEARNING_LIMIT;
-
- scanParamArg(prmc, prmv, "nMacLearningLimit", sizeof(sVar.nMacLearningLimit), &sVar.nMacLearningLimit);
-
- scanParamArg(prmc, prmv, "bIngressVlanFilterEnable", sizeof(sVar.bIngressVlanFilterEnable), &sVar.bIngressVlanFilterEnable);
- if (findStringParam(prmc, prmv, "bIngressVlanFilterEnable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN_FILTER;
-
- scanParamArg(prmc, prmv, "nIngressVlanFilterBlockId", sizeof(sVar.nIngressVlanFilterBlockId), &sVar.nIngressVlanFilterBlockId);
-
- scanParamArg(prmc, prmv, "bBypassEgressVlanFilter1", sizeof(sVar.bBypassEgressVlanFilter1), &sVar.bBypassEgressVlanFilter1);
- if (findStringParam(prmc, prmv, "bBypassEgressVlanFilter1"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN_FILTER;
-
- scanParamArg(prmc, prmv, "bEgressVlanFilter1Enable", sizeof(sVar.bEgressVlanFilter1Enable), &sVar.bEgressVlanFilter1Enable);
- if (findStringParam(prmc, prmv, "bEgressVlanFilter1Enable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN_FILTER1;
-
- scanParamArg(prmc, prmv, "nEgressVlanFilter1BlockId", sizeof(sVar.nEgressVlanFilter1BlockId), &sVar.nEgressVlanFilter1BlockId);
-
- scanParamArg(prmc, prmv, "bEgressVlanFilter2Enable", sizeof(sVar.bEgressVlanFilter2Enable), &sVar.bEgressVlanFilter2Enable);
- if (findStringParam(prmc, prmv, "bEgressVlanFilter2Enable"))
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN_FILTER2;
-
- scanParamArg(prmc, prmv, "nEgressVlanFilter2BlockId", sizeof(sVar.nEgressVlanFilter2BlockId), &sVar.nEgressVlanFilter2BlockId);
-
- scanParamArg(prmc, prmv, "bVlanTagSelection", sizeof(sVar.bVlanTagSelection), &sVar.bVlanTagSelection);
- scanParamArg(prmc, prmv, "bVlanSrcMacPriorityEnable", sizeof(sVar.bVlanSrcMacPriorityEnable), &sVar.bVlanSrcMacPriorityEnable);
- scanParamArg(prmc, prmv, "bVlanSrcMacDEIEnable", sizeof(sVar.bVlanSrcMacDEIEnable), &sVar.bVlanSrcMacDEIEnable);
- scanParamArg(prmc, prmv, "bVlanSrcMacVidEnable", sizeof(sVar.bVlanSrcMacVidEnable), &sVar.bVlanSrcMacVidEnable);
- scanParamArg(prmc, prmv, "bVlanDstMacPriorityEnable", sizeof(sVar.bVlanDstMacPriorityEnable), &sVar.bVlanDstMacPriorityEnable);
- scanParamArg(prmc, prmv, "bVlanDstMacDEIEnable", sizeof(sVar.bVlanDstMacDEIEnable), &sVar.bVlanDstMacDEIEnable);
- scanParamArg(prmc, prmv, "bVlanDstMacVidEnable", sizeof(sVar.bVlanDstMacVidEnable), &sVar.bVlanDstMacVidEnable);
-
- scanParamArg(prmc, prmv, "bVlanMulticastPriorityEnable", sizeof(sVar.bVlanMulticastPriorityEnable), &sVar.bVlanMulticastPriorityEnable);
- scanParamArg(prmc, prmv, "bVlanMulticastDEIEnable", sizeof(sVar.bVlanMulticastDEIEnable), &sVar.bVlanMulticastDEIEnable);
- scanParamArg(prmc, prmv, "bVlanMulticastVidEnable", sizeof(sVar.bVlanMulticastVidEnable), &sVar.bVlanMulticastVidEnable);
-
- if (findStringParam(prmc, prmv, "nLoopViolationCount")) {
- scanParamArg(prmc, prmv, "nLoopViolationCount", sizeof(sVar.nLoopViolationCount), &sVar.nLoopViolationCount);
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_LOOP_VIOLATION_COUNTER;
- }
-
- if (findStringParam(prmc, prmv, "bForce")) {
- sVar.eMask |= GSW_BRIDGE_PORT_CONFIG_MASK_FORCE;
- }
-
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgePortConfigSet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgePortConfigSet failed with ret code", ret);
- else{
- printf("fapi_GSW_BridgePortConfigSet done\n");
- }
-
- return ret;
-}
-
-
-
-GSW_return_t fapi_GSW_CtpPortConfigGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_CTP_portConfig_t sVar = { 0 };
- int rret;
- unsigned int i;
-
- memset(&sVar, 0x00, sizeof(sVar));
-
- rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(sVar.nLogicalPortId), &sVar.nLogicalPortId);
- if (rret < 1){
- printf("Parameter not Found: nLogicalPortId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(sVar.nSubIfIdGroup), &sVar.nSubIfIdGroup);
- scanParamArg(prmc, prmv, "eMask", sizeof(sVar.eMask), &sVar.eMask);
- if (!sVar.eMask)
- sVar.eMask = 0xFFFFFFFF;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_CtpPortConfigGet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_CtpPortConfigGet failed with ret code", ret);
- else{
- printf("\t nLogicalPortId = %u", sVar.nLogicalPortId);
- printf("\n\t nSubIfIdGroup = %u", sVar.nSubIfIdGroup);
- printf("\n\t eMask = 0x%x", sVar.eMask);
- printf("\n\t nBridgePortId = %u", sVar.nBridgePortId);
- printf("\n\t bForcedTrafficClass = %u", sVar.bForcedTrafficClass);
- printf("\n\t nDefaultTrafficClass = %u", sVar.nDefaultTrafficClass);
- printf("\n\t bIngressExtendedVlanEnable = %u", sVar.bIngressExtendedVlanEnable);
- printf("\n\t nIngressExtendedVlanBlockId = %u", sVar.nIngressExtendedVlanBlockId);
- printf("\n\t bIngressExtendedVlanIgmpEnable = %u", sVar.bIngressExtendedVlanIgmpEnable);
- printf("\n\t nIngressExtendedVlanBlockIdIgmp = %u", sVar.nIngressExtendedVlanBlockIdIgmp);
- printf("\n\t bEgressExtendedVlanEnable = %u", sVar.bEgressExtendedVlanEnable);
- printf("\n\t nEgressExtendedVlanBlockId = %u", sVar.nEgressExtendedVlanBlockId);
- printf("\n\t bEgressExtendedVlanIgmpEnable = %u", sVar.bEgressExtendedVlanIgmpEnable);
- printf("\n\t nEgressExtendedVlanBlockIdIgmp = %u", sVar.nEgressExtendedVlanBlockIdIgmp);
- printf("\n\t bIngressNto1VlanEnable = %u", sVar.bIngressNto1VlanEnable);
- printf("\n\t bEgressNto1VlanEnable = %u", sVar.bEgressNto1VlanEnable);
- printf("\n\t eIngressMarkingMode = %u", sVar.eIngressMarkingMode);
- printf("\n\t eEgressMarkingMode = %u", sVar.eEgressMarkingMode);
- printf("\n\t bEgressMarkingOverrideEnable = %u", sVar.eEgressMarkingModeOverride);
- printf("\n\t eEgressRemarkingMode = %u", sVar.eEgressRemarkingMode);
- printf("\n\t bIngressMeteringEnable = %u", sVar.bIngressMeteringEnable);
- printf("\n\t nIngressTrafficMeterId = %u", sVar.nIngressTrafficMeterId);
- printf("\n\t bEgressMeteringEnable = %u", sVar.bEgressMeteringEnable);
- printf("\n\t nEgressTrafficMeterId = %u", sVar.nEgressTrafficMeterId);
- printf("\n\t bBridgingBypass = %u", sVar.bBridgingBypass);
- printf("\n\t nDestLogicalPortId = %u", sVar.nDestLogicalPortId);
- printf("\n\t nDestSubIfIdGroup = %u", sVar.nDestSubIfIdGroup);
- printf("\n\t bPmapperEnable = %u", sVar.bPmapperEnable);
- if (sVar.bPmapperEnable) {
- printf("\n\t ePmapperMappingMode = %u", sVar.ePmapperMappingMode);
- printf("\n\t nPmapperId = %u", sVar.sPmapper.nPmapperId);
-
- for (i = 0; i < 73; i++)
- printf("\n\t nDestSubIfIdGroup[%u] = %u", i, sVar.sPmapper.nDestSubIfIdGroup[i]);
- }
-
- printf("\n\t nFirstFlowEntryIndex = %u", sVar.nFirstFlowEntryIndex);
- printf("\n\t nNumberOfFlowEntries = %u", sVar.nNumberOfFlowEntries);
- printf("\n\t bIngressDaSaSwapEnable = %u", sVar.bIngressDaSaSwapEnable);
- printf("\n\t bEgressDaSaSwapEnable = %u", sVar.bEgressDaSaSwapEnable);
- printf("\n\t bIngressLoopbackEnable = %u", sVar.bIngressLoopbackEnable);
- printf("\n\t bEgressLoopbackEnable = %u", sVar.bEgressLoopbackEnable);
- printf("\n\t bIngressMirrorEnable = %u", sVar.bIngressMirrorEnable);
- printf("\n\t bEgressMirrorEnable = %u", sVar.bEgressMirrorEnable);
- printf("\n");
- }
-
- return ret;
-}
-
-
-
-GSW_return_t fapi_GSW_CtpPortConfigSet(int prmc, char *prmv[])
-{
- GSW_CTP_portConfig_t sVar = {0};
- memset(&sVar, 0x00, sizeof(sVar));
- unsigned int i;
- GSW_Device_t *dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(sVar.nLogicalPortId), &sVar.nLogicalPortId);
- if (rret < 1){
- printf("Parameter not Found: nLogicalPortId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(sVar.nSubIfIdGroup), &sVar.nSubIfIdGroup);
- sVar.eMask = 0xFFFFFFFF;
-
- dev = gsw_get_struc(lif_id,0);
- ret = GSW_CtpPortConfigGet(dev, &sVar);
- sVar.eMask = 0x0;
-
- scanParamArg(prmc, prmv, "nBridgePortId", sizeof(sVar.nBridgePortId), &sVar.nBridgePortId);
- if (findStringParam(prmc, prmv, "nBridgePortId"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_BRIDGE_PORT_ID;
-
- scanParamArg(prmc, prmv, "bForcedTrafficClass", sizeof(sVar.bForcedTrafficClass), &sVar.bForcedTrafficClass);
- if (findStringParam(prmc, prmv, "bForcedTrafficClass"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_FORCE_TRAFFIC_CLASS;
-
- scanParamArg(prmc, prmv, "nDefaultTrafficClass", sizeof(sVar.nDefaultTrafficClass), &sVar.nDefaultTrafficClass);
- if (findStringParam(prmc, prmv, "nDefaultTrafficClass"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_FORCE_TRAFFIC_CLASS;
-
- scanParamArg(prmc, prmv, "bIngressExtendedVlanEnable", sizeof(sVar.bIngressExtendedVlanEnable), &sVar.bIngressExtendedVlanEnable);
- if (findStringParam(prmc, prmv, "bIngressExtendedVlanEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_INGRESS_VLAN;
-
- scanParamArg(prmc, prmv, "nIngressExtendedVlanBlockId", sizeof(sVar.nIngressExtendedVlanBlockId), &sVar.nIngressExtendedVlanBlockId);
-
- scanParamArg(prmc, prmv, "bIngressExtendedVlanIgmpEnable", sizeof(sVar.bIngressExtendedVlanIgmpEnable), &sVar.bIngressExtendedVlanIgmpEnable);
- if (findStringParam(prmc, prmv, "bIngressExtendedVlanIgmpEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_INGRESS_VLAN_IGMP;
-
- scanParamArg(prmc, prmv, "nIngressExtendedVlanBlockIdIgmp", sizeof(sVar.nIngressExtendedVlanBlockIdIgmp), &sVar.nIngressExtendedVlanBlockIdIgmp);
-
- scanParamArg(prmc, prmv, "bEgressExtendedVlanEnable", sizeof(sVar.bEgressExtendedVlanEnable), &sVar.bEgressExtendedVlanEnable);
- if (findStringParam(prmc, prmv, "bEgressExtendedVlanEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_EGRESS_VLAN;
-
- scanParamArg(prmc, prmv, "nEgressExtendedVlanBlockId", sizeof(sVar.nEgressExtendedVlanBlockId), &sVar.nEgressExtendedVlanBlockId);
-
- scanParamArg(prmc, prmv, "bEgressExtendedVlanIgmpEnable", sizeof(sVar.bEgressExtendedVlanIgmpEnable), &sVar.bEgressExtendedVlanIgmpEnable);
- if (findStringParam(prmc, prmv, "bEgressExtendedVlanIgmpEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_EGRESS_VLAN_IGMP;
-
- scanParamArg(prmc, prmv, "nEgressExtendedVlanBlockIdIgmp", sizeof(sVar.nEgressExtendedVlanBlockIdIgmp), &sVar.nEgressExtendedVlanBlockIdIgmp);
-
- scanParamArg(prmc, prmv, "bIngressNto1VlanEnable", sizeof(sVar.bIngressNto1VlanEnable), &sVar.bIngressNto1VlanEnable);
- if (findStringParam(prmc, prmv, "bIngressNto1VlanEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_INRESS_NTO1_VLAN;
-
- scanParamArg(prmc, prmv, "bEgressNto1VlanEnable", sizeof(sVar.bEgressNto1VlanEnable), &sVar.bEgressNto1VlanEnable);
- if (findStringParam(prmc, prmv, "bEgressNto1VlanEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_EGRESS_NTO1_VLAN;
-
- scanParamArg(prmc, prmv, "eIngressMarkingMode", sizeof(sVar.eIngressMarkingMode), &sVar.eIngressMarkingMode);
- if (findStringParam(prmc, prmv, "eIngressMarkingMode"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_INGRESS_MARKING;
-
- scanParamArg(prmc, prmv, "eEgressMarkingMode", sizeof(sVar.eEgressMarkingMode), &sVar.eEgressMarkingMode);
- if (findStringParam(prmc, prmv, "eEgressMarkingMode"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_EGRESS_MARKING;
-
- scanParamArg(prmc, prmv, "bEgressMarkingOverrideEnable", sizeof(sVar.bEgressMarkingOverrideEnable), &sVar.bEgressMarkingOverrideEnable);
- if (findStringParam(prmc, prmv, "bEgressMarkingOverrideEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_EGRESS_MARKING_OVERRIDE;
-
- scanParamArg(prmc, prmv, "eEgressMarkingModeOverride", sizeof(sVar.eEgressMarkingModeOverride), &sVar.eEgressMarkingModeOverride);
-
- scanParamArg(prmc, prmv, "eEgressRemarkingMode", sizeof(sVar.eEgressRemarkingMode), &sVar.eEgressRemarkingMode);
- if (findStringParam(prmc, prmv, "eEgressRemarkingMode"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_EGRESS_REMARKING;
-
- scanParamArg(prmc, prmv, "bIngressMeteringEnable", sizeof(sVar.bIngressMeteringEnable), &sVar.bIngressMeteringEnable);
-
- if (findStringParam(prmc, prmv, "bIngressMeteringEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_INGRESS_METER;
-
- scanParamArg(prmc, prmv, "nIngressTrafficMeterId", sizeof(sVar.nIngressTrafficMeterId), &sVar.nIngressTrafficMeterId);
-
- scanParamArg(prmc, prmv, "bEgressMeteringEnable", sizeof(sVar.bEgressMeteringEnable), &sVar.bEgressMeteringEnable);
- if (findStringParam(prmc, prmv, "bEgressMeteringEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_EGRESS_METER;
-
- scanParamArg(prmc, prmv, "nEgressTrafficMeterId", sizeof(sVar.nEgressTrafficMeterId), &sVar.nEgressTrafficMeterId);
-
- scanParamArg(prmc, prmv, "bBridgingBypass", sizeof(sVar.bBridgingBypass), &sVar.bBridgingBypass);
- if (findStringParam(prmc, prmv, "bBridgingBypass"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_BRIDGING_BYPASS;
-
- scanParamArg(prmc, prmv, "nDestLogicalPortId", sizeof(sVar.nDestLogicalPortId), &sVar.nDestLogicalPortId);
- scanParamArg(prmc, prmv, "nDestSubIfIdGroup", sizeof(sVar.nDestSubIfIdGroup), &sVar.nDestSubIfIdGroup);
-
- scanParamArg(prmc, prmv, "bPmapperEnable", sizeof(sVar.bPmapperEnable), &sVar.bPmapperEnable);
- if (sVar.bPmapperEnable) {
- scanParamArg(prmc, prmv, "ePmapperMappingMode", sizeof(sVar.ePmapperMappingMode), &sVar.ePmapperMappingMode);
- scanPMAP_Arg(prmc, prmv, "nPmapperDestSubIfIdGroup", sVar.sPmapper.nDestSubIfIdGroup);
- printf("i. The first entry of each P-mapper index is for Non-IP and Non-VLAN tagging packets\n");
- printf("ii. The entry 8 to 1 of each P-mapper index is for PCP mapping entries\n");
- printf("iii.The entry 72 to 9 of each P-mapper index is for DSCP mapping entries\n");
- printf("User Configured nDestSubIfIdGroup list as below\n");
-
- for (i = 0; i <= 72; i++)
- printf("sVar.sPmapper.nDestSubIfIdGroup[%d] = %d\n", i, sVar.sPmapper.nDestSubIfIdGroup[i]);
- }
-
- scanParamArg(prmc, prmv, "nFirstFlowEntryIndex", sizeof(sVar.nFirstFlowEntryIndex), &sVar.nFirstFlowEntryIndex);
- if (findStringParam(prmc, prmv, "nFirstFlowEntryIndex"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_FLOW_ENTRY;
-
- scanParamArg(prmc, prmv, "nNumberOfFlowEntries", sizeof(sVar.nNumberOfFlowEntries), &sVar.nNumberOfFlowEntries);
-
- scanParamArg(prmc, prmv, "bIngressLoopbackEnable", sizeof(sVar.bIngressLoopbackEnable), &sVar.bIngressLoopbackEnable);
- if (findStringParam(prmc, prmv, "bIngressLoopbackEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
-
- scanParamArg(prmc, prmv, "bIngressDaSaSwapEnable", sizeof(sVar.bIngressDaSaSwapEnable), &sVar.bIngressDaSaSwapEnable);
- if (findStringParam(prmc, prmv, "bIngressDaSaSwapEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
-
- scanParamArg(prmc, prmv, "bEgressLoopbackEnable", sizeof(sVar.bEgressLoopbackEnable), &sVar.bEgressLoopbackEnable);
- if (findStringParam(prmc, prmv, "bEgressLoopbackEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
-
- scanParamArg(prmc, prmv, "bEgressDaSaSwapEnable", sizeof(sVar.bEgressDaSaSwapEnable), &sVar.bEgressDaSaSwapEnable);
- if (findStringParam(prmc, prmv, "bEgressDaSaSwapEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
-
- scanParamArg(prmc, prmv, "bIngressMirrorEnable", sizeof(sVar.bIngressMirrorEnable), &sVar.bIngressMirrorEnable);
- if (findStringParam(prmc, prmv, "bIngressMirrorEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
-
- scanParamArg(prmc, prmv, "bEgressMirrorEnable", sizeof(sVar.bEgressMirrorEnable), &sVar.bEgressMirrorEnable);
- if (findStringParam(prmc, prmv, "bEgressMirrorEnable"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_LOOPBACK_AND_MIRROR;
-
- if (findStringParam(prmc, prmv, "bForce"))
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_FORCE;
-
-
- ret = GSW_CtpPortConfigSet(dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_CtpPortConfigSet failed with ret code", ret);
- else{
- printf("fapi_GSW_CtpPortConfigSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_BridgeAlloc(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_BRIDGE_alloc_t param = {0};
-
- memset(¶m, 0x00, sizeof(param));
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgeAlloc(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgeAlloc failed with ret code", ret);
- else{
- printf("\n\t Allocated Bridge ID = %u\n", param.nBridgeId);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_BridgeFree(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_BRIDGE_alloc_t param = {0};
- int rret;
-
- memset(¶m, 0x00, sizeof(param));
-
- rret = scanParamArg(prmc, prmv, "nBridgeId", sizeof(param.nBridgeId), ¶m.nBridgeId);
- if (rret < 1){
- printf("Parameter not Found: nBridgeId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgeFree(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgeFree failed with ret code", ret);
- else{
- printf("fapi_GSW_BridgeFree done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_BridgeConfigGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_BRIDGE_config_t param = {0};
- int rret;
-
- memset(¶m, 0x00, sizeof(param));
-
- rret = scanParamArg(prmc, prmv, "nBridgeId", sizeof(param.nBridgeId), ¶m.nBridgeId);
- if (rret < 1){
- printf("Parameter not Found: nBridgeId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "eMask", sizeof(param.eMask), ¶m.eMask);
- if (!param.eMask)
- param.eMask = 0xFFFFFFFF;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgeConfigGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgeConfigGet failed with ret code", ret);
- else{
- printf("fapi_GSW_BridgeConfigGet done\n");
- printf("%40s:\t%u\n", "nBridgeId", param.nBridgeId);
- printf("%40s:\t0x%x\n", "eMask", param.eMask);
- printf("%40s:\t%u\n", "bMacLearningLimitEnable", param.bMacLearningLimitEnable);
- printf("%40s:\t%u\n", "nMacLearningLimit", param.nMacLearningLimit);
- printf("%40s:\t%u\n", "nMacLearningCount", param.nMacLearningCount);
- printf("%40s:\t%u\n", "nLearningDiscardEvent", param.nLearningDiscardEvent);
- printf("%40s:\t%u\n", "eForwardBroadcast", param.eForwardBroadcast );
- printf("%40s:\t%u\n", "eForwardUnknownMulticastIp", param.eForwardUnknownMulticastIp);
- printf("%40s:\t%u\n", "eForwardUnknownMulticastNonIp", param.eForwardUnknownMulticastNonIp);
- printf("%40s:\t%u\n", "eForwardUnknownUnicast", param.eForwardUnknownUnicast);
- printf("%40s:\t%u\n", "bBroadcastMeterEnable", param.bSubMeteringEnable[0]);
- printf("%40s:\t%u\n", "nBroadcastMeterId", param.nTrafficSubMeterId[0]);
- printf("%40s:\t%u\n", "bMulticastMeterEnable", param.bSubMeteringEnable[1]);
- printf("%40s:\t%u\n", "nMulticastMeterId", param.nTrafficSubMeterId[1]);
- printf("%40s:\t%u\n", "bUnknownMulticastIpMeterEnable", param.bSubMeteringEnable[2]);
- printf("%40s:\t%u\n", "nUnknownMulticastIpMeterId", param.nTrafficSubMeterId[2]);
- printf("%40s:\t%u\n", "bUnknownMulticastNonIpMeterEnable", param.bSubMeteringEnable[3]);
- printf("%40s:\t%u\n", "nUnknownMulticastNonIpMeterId", param.nTrafficSubMeterId[3]);
- printf("%40s:\t%u\n", "bUnknownUniCastMeterEnable", param.bSubMeteringEnable[4]);
- printf("%40s:\t%u\n", "nUnknownUniCastMeterId", param.nTrafficSubMeterId[4]);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_BridgeConfigSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_BRIDGE_config_t sVar = {0};
- memset(&sVar, 0x00, sizeof(sVar));
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nBridgeId", sizeof(sVar.nBridgeId), &sVar.nBridgeId);
- if (rret < 1){
- printf("Parameter not Found: nBridgeId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "bMacLearningLimitEnable", sizeof(sVar.bMacLearningLimitEnable), &sVar.bMacLearningLimitEnable);
- if (findStringParam(prmc, prmv, "bMacLearningLimitEnable"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_MAC_LEARNING_LIMIT;
-
- scanParamArg(prmc, prmv, "nMacLearningLimit", sizeof(sVar.nMacLearningLimit), &sVar.nMacLearningLimit);
-
- scanParamArg(prmc, prmv, "eForwardBroadcast", sizeof(sVar.eForwardBroadcast), &sVar.eForwardBroadcast);
- if (findStringParam(prmc, prmv, "eForwardBroadcast"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE;
-
- scanParamArg(prmc, prmv, "eForwardUnknownMulticastIp", sizeof(sVar.eForwardUnknownMulticastIp), &sVar.eForwardUnknownMulticastIp);
- if (findStringParam(prmc, prmv, "eForwardUnknownMulticastIp"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE;
-
- scanParamArg(prmc, prmv, "eForwardUnknownMulticastNonIp", sizeof(sVar.eForwardUnknownMulticastNonIp), &sVar.eForwardUnknownMulticastNonIp);
- if (findStringParam(prmc, prmv, "eForwardUnknownMulticastNonIp"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE;
-
- scanParamArg(prmc, prmv, "eForwardUnknownUnicast", sizeof(sVar.eForwardUnknownUnicast), &sVar.eForwardUnknownUnicast);
- if (findStringParam(prmc, prmv, "eForwardUnknownUnicast"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE;
-
- scanParamArg(prmc, prmv, "bBroadcastMeterEnable", sizeof(sVar.bSubMeteringEnable[0]), &sVar.bSubMeteringEnable[0]);
- if (findStringParam(prmc, prmv, "bBroadcastMeterEnable"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
-
- scanParamArg(prmc, prmv, "nBroadcastMeterId", sizeof(sVar.nTrafficSubMeterId[0]), &sVar.nTrafficSubMeterId[0]);
-
- scanParamArg(prmc, prmv, "bMulticastMeterEnable", sizeof(sVar.bSubMeteringEnable[1]), &sVar.bSubMeteringEnable[1]);
- if (findStringParam(prmc, prmv, "bMulticastMeterEnable"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
-
- scanParamArg(prmc, prmv, "nMulticastMeterId", sizeof(sVar.nTrafficSubMeterId[1]), &sVar.nTrafficSubMeterId[1]);
-
- scanParamArg(prmc, prmv, "bUnknownMulticastIpMeterEnable", sizeof(sVar.bSubMeteringEnable[2]), &sVar.bSubMeteringEnable[2]);
- if (findStringParam(prmc, prmv, "bUnknownMulticastIpMeterEnable"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
-
- scanParamArg(prmc, prmv, "nUnknownMulticastIpMeterId", sizeof(sVar.nTrafficSubMeterId[2]), &sVar.nTrafficSubMeterId[2]);
-
- scanParamArg(prmc, prmv, "bUnknownMulticastNonIpMeterEnable", sizeof(sVar.bSubMeteringEnable[3]), &sVar.bSubMeteringEnable[3]);
- if (findStringParam(prmc, prmv, "bUnknownMulticastNonIpMeterEnable"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
-
- scanParamArg(prmc, prmv, "nUnknownMulticastNonIpMeterId", sizeof(sVar.nTrafficSubMeterId[3]), &sVar.nTrafficSubMeterId[3]);
-
- scanParamArg(prmc, prmv, "bUnknownUniCastMeterEnable", sizeof(sVar.bSubMeteringEnable[4]), &sVar.bSubMeteringEnable[4]);
- if (findStringParam(prmc, prmv, "bUnknownUniCastMeterEnable"))
- sVar.eMask |= GSW_BRIDGE_CONFIG_MASK_SUB_METER;
-
- scanParamArg(prmc, prmv, "nUnknownUniCastMeterId", sizeof(sVar.nTrafficSubMeterId[4]), &sVar.nTrafficSubMeterId[4]);
- if (findStringParam(prmc, prmv, "bForce")) {
- sVar.eMask |= GSW_CTP_PORT_CONFIG_MASK_FORCE;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgeConfigSet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgeConfigSet failed with ret code", ret);
- else{
- printf("fapi_GSW_BridgeConfigSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_ExtendedVlanAlloc(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_EXTENDEDVLAN_alloc_t param = {0};
- int rret;
-
- memset(¶m, 0x00, sizeof(param));
-
- rret = scanParamArg(prmc, prmv, "nNumberOfEntries", sizeof(param.nNumberOfEntries), ¶m.nNumberOfEntries);
- if (rret < 1){
- printf("Parameter not Found: nNumberOfEntries\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_ExtendedVlanAlloc(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_ExtendedVlanAlloc failed with ret code", ret);
- else{
- printf("\n\tAllocated ExtendedVlanblock = %u", param.nExtendedVlanBlockId);
- printf("\n\tNumber of block entries associated with ExtendedVlanblock %d = %u\n",
- param.nExtendedVlanBlockId, param.nNumberOfEntries);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_ExtendedVlanFree(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_EXTENDEDVLAN_alloc_t param = {0};
- int rret;
-
- memset(¶m, 0x00, sizeof(param));
-
- rret = scanParamArg(prmc, prmv, "nExtendedVlanBlockId", sizeof(param.nExtendedVlanBlockId), ¶m.nExtendedVlanBlockId);
- if (rret < 1){
- printf("Parameter not Found: nExtendedVlanBlockId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_ExtendedVlanFree(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_ExtendedVlanFree failed with ret code", ret);
- else{
- printf("\n\tNumber of deleted entries associated with ExVlanblock %d = %u\n",
- param.nExtendedVlanBlockId, param.nNumberOfEntries);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_ExtendedVlanGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- unsigned char f = 0;
- GSW_EXTENDEDVLAN_config_t sVar = {0};
- int rret;
-
- memset(&sVar, 0x00, sizeof(sVar));
-
- rret = scanParamArg(prmc, prmv, "nExtendedVlanBlockId", sizeof(sVar.nExtendedVlanBlockId), &sVar.nExtendedVlanBlockId);
- if (rret < 1){
- printf("Parameter not Found: nExtendedVlanBlockId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nEntryIndex", sizeof(sVar.nEntryIndex), &sVar.nEntryIndex);
- if (rret < 1){
- printf("Parameter not Found: nEntryIndex\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_ExtendedVlanGet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_ExtendedVlanGet failed with ret code", ret);
- else{
- printf("fapi_GSW_ExtendedVlanGet done\n");
-
- printf("%40s:\t%u\n", "nExtendedVlanBlockId", sVar.nExtendedVlanBlockId);
- printf("%40s:\t%u\n", "nEntryIndex", sVar.nEntryIndex);
-
- printf("%40s:\t%u\n", "eOuterVlanFilterVlanType",sVar.sFilter.sOuterVlan.eType);
- printf("%40s:\t%u\n", "bOuterVlanFilterPriorityEnable",sVar.sFilter.sOuterVlan.bPriorityEnable);
- printf("%40s:\t%u\n", "nOuterVlanFilterPriorityVal",sVar.sFilter.sOuterVlan.nPriorityVal);
- printf("%40s:\t%u\n", "bOuterVlanFilterVidEnable",sVar.sFilter.sOuterVlan.bVidEnable);
- printf("%40s:\t%u\n", "nOuterVlanFilterVidVal",sVar.sFilter.sOuterVlan.nVidVal );
- printf("%40s:\t%u\n", "eOuterVlanFilterTpid",sVar.sFilter.sOuterVlan.eTpid);
- printf("%40s:\t%u\n", "eOuterVlanFilterDei",sVar.sFilter.sOuterVlan.eDei);
-
- printf("%40s:\t%u\n", "eInnerVlanFilterVlanType",sVar.sFilter.sInnerVlan.eType);
- printf("%40s:\t%u\n", "bInnerVlanFilterPriorityEnable",sVar.sFilter.sInnerVlan.bPriorityEnable);
- printf("%40s:\t%u\n", "nInnerVlanFilterPriorityVal",sVar.sFilter.sInnerVlan.nPriorityVal);
- printf("%40s:\t%u\n", "bInnerVlanFilterVidEnable",sVar.sFilter.sInnerVlan.bVidEnable);
- printf("%40s:\t%u\n", "nInnerVlanFilterVidVal",sVar.sFilter.sInnerVlan.nVidVal);
- printf("%40s:\t%u\n", "eInnerVlanFilterTpid",sVar.sFilter.sInnerVlan.eTpid);
- printf("%40s:\t%u\n", "eInnerVlanFilterDei",sVar.sFilter.sInnerVlan.eDei);
-
- printf("%40s:\t%u\n", "eEtherType",sVar.sFilter.eEtherType);
- printf("%40s:\t%u\n", "eRemoveTagAction",sVar.sTreatment.eRemoveTag);
-
- printf("%40s:\t%u\n", "bOuterVlanActionEnable",sVar.sTreatment.bAddOuterVlan);
-
- printf("%40s:\t%u\n", "eOuterVlanActionPriorityMode",sVar.sTreatment.sOuterVlan.ePriorityMode);
- printf("%40s:\t%u\n", "eOuterVlanActionPriorityVal",sVar.sTreatment.sOuterVlan.ePriorityVal);
- printf("%40s:\t%u\n", "eOuterVlanActionVidMode",sVar.sTreatment.sOuterVlan.eVidMode);
- printf("%40s:\t%u\n", "eOuterVlanActionVidVal",sVar.sTreatment.sOuterVlan.eVidVal);
- printf("%40s:\t%u\n", "eOuterVlanActionTpid",sVar.sTreatment.sOuterVlan.eTpid );
- printf("%40s:\t%u\n", "eOuterVlanActioneDei",sVar.sTreatment.sOuterVlan.eDei);
-
- printf("%40s:\t%u\n", "bInnerVlanActionEnable",sVar.sTreatment.bAddInnerVlan);
-
- printf("%40s:\t%u\n", "eInnerVlanActionPriorityMode",sVar.sTreatment.sInnerVlan.ePriorityMode);
- printf("%40s:\t%u\n", "eInnerVlanActionPriorityVal",sVar.sTreatment.sInnerVlan.ePriorityVal);
- printf("%40s:\t%u\n", "eInnerVlanActionVidMode",sVar.sTreatment.sInnerVlan.eVidMode);
- printf("%40s:\t%u\n", "eInnerVlanActionVidVal",sVar.sTreatment.sInnerVlan.eVidVal);
- printf("%40s:\t%u\n", "eInnerVlanActionTpid",sVar.sTreatment.sInnerVlan.eTpid);
- printf("%40s:\t%u\n", "eInnerVlanActioneDei",sVar.sTreatment.sInnerVlan.eDei );
-
- printf("%40s:\t%u\n", "bNewDscpEnable",sVar.sTreatment.bNewDscpEnable);
- printf("%40s:\t%u\n", "nNewDscp",sVar.sTreatment.nNewDscp);
- printf("%40s:\t%u\n", "bNewTrafficClassEnable",sVar.sTreatment.bNewTrafficClassEnable );
- printf("%40s:\t%u\n", "nNewTrafficClass",sVar.sTreatment.nNewTrafficClass);
- printf("%40s:\t%u\n", "bNewMeterEnable",sVar.sTreatment.bNewMeterEnable);
- printf("%40s:\t%u\n", "sNewTrafficMeterId",sVar.sTreatment.sNewTrafficMeterId);
- printf("%40s:\t%u\n", "bLoopbackEnable",sVar.sTreatment.bLoopbackEnable);
- printf("%40s:\t%u\n", "bDaSaSwapEnable",sVar.sTreatment.bDaSaSwapEnable);
- printf("%40s:\t%u\n", "bMirrorEnable",sVar.sTreatment.bMirrorEnable);
- printf("%40s:\t%u\n", "bReassignBridgePortEnable",sVar.sTreatment.bReassignBridgePort);
- printf("%40s:\t%u\n", "nNewBridgePortId",sVar.sTreatment.nNewBridgePortId );
- if (sVar.sTreatment.sOuterVlan.ePriorityMode == GSW_EXTENDEDVLAN_TREATMENT_DSCP ||
- sVar.sTreatment.sInnerVlan.ePriorityMode == GSW_EXTENDEDVLAN_TREATMENT_DSCP) {
- for (f = 0; f < 64; f++)
- printf("\n\t nDscp2PcpMap[%d] = %u", f, sVar.sTreatment.nDscp2PcpMap[f]);
- }
-
- scanParamArg(prmc, prmv, "bOriginalPacketFilterMode", sizeof(sVar.sFilter.bOriginalPacketFilterMode), &sVar.sFilter.bOriginalPacketFilterMode);
- scanParamArg(prmc, prmv, "eFilter_4_Tpid_Mode", sizeof(sVar.sFilter.eFilter_4_Tpid_Mode), &sVar.sFilter.eFilter_4_Tpid_Mode);
- scanParamArg(prmc, prmv, "eTreatment_4_Tpid_Mode", sizeof(sVar.sTreatment.eTreatment_4_Tpid_Mode), &sVar.sTreatment.eTreatment_4_Tpid_Mode);
- printf("%40s:\t%u\n", "bOriginalPacketFilterMode",sVar.sFilter.bOriginalPacketFilterMode);
- printf("%40s:\t%u\n", "eFilter_4_Tpid_Mode", sVar.sFilter.eFilter_4_Tpid_Mode);
- printf("%40s:\t%u\n", "eTreatment_4_Tpid_Mode",sVar.sTreatment.eTreatment_4_Tpid_Mode);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_ExtendedVlanSet(int prmc, char *prmv[])
-{
- unsigned char bDscp2PcpMapEnable = 0, nDscp2PcpMapValue = 0, f = 0;
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_EXTENDEDVLAN_config_t sVar = {0};
-
- memset(&sVar, 0x00, sizeof(sVar));
-
- scanParamArg(prmc, prmv, "nExtendedVlanBlockId", sizeof(sVar.nExtendedVlanBlockId), &sVar.nExtendedVlanBlockId);
- scanParamArg(prmc, prmv, "nEntryIndex", sizeof(sVar.nEntryIndex), &sVar.nEntryIndex);
-
- scanParamArg(prmc, prmv, "eOuterVlanFilterVlanType", sizeof(sVar.sFilter.sOuterVlan.eType), &sVar.sFilter.sOuterVlan.eType);
- scanParamArg(prmc, prmv, "bOuterVlanFilterPriorityEnable", sizeof(sVar.sFilter.sOuterVlan.bPriorityEnable), &sVar.sFilter.sOuterVlan.bPriorityEnable);
- scanParamArg(prmc, prmv, "nOuterVlanFilterPriorityVal", sizeof(sVar.sFilter.sOuterVlan.nPriorityVal), &sVar.sFilter.sOuterVlan.nPriorityVal);
- scanParamArg(prmc, prmv, "bOuterVlanFilterVidEnable", sizeof(sVar.sFilter.sOuterVlan.bVidEnable), &sVar.sFilter.sOuterVlan.bVidEnable);
- scanParamArg(prmc, prmv, "nOuterVlanFilterVidVal", sizeof(sVar.sFilter.sOuterVlan.nVidVal), &sVar.sFilter.sOuterVlan.nVidVal);
- scanParamArg(prmc, prmv, "eOuterVlanFilterTpid", sizeof(sVar.sFilter.sOuterVlan.eTpid), &sVar.sFilter.sOuterVlan.eTpid);
- scanParamArg(prmc, prmv, "eOuterVlanFilterDei", sizeof(sVar.sFilter.sOuterVlan.eDei), &sVar.sFilter.sOuterVlan.eDei);
-
- scanParamArg(prmc, prmv, "eInnerVlanFilterVlanType", sizeof(sVar.sFilter.sInnerVlan.eType), &sVar.sFilter.sInnerVlan.eType);
- scanParamArg(prmc, prmv, "bInnerVlanFilterPriorityEnable", sizeof(sVar.sFilter.sInnerVlan.bPriorityEnable), &sVar.sFilter.sInnerVlan.bPriorityEnable);
- scanParamArg(prmc, prmv, "nInnerVlanFilterPriorityVal", sizeof(sVar.sFilter.sInnerVlan.nPriorityVal), &sVar.sFilter.sInnerVlan.nPriorityVal);
- scanParamArg(prmc, prmv, "bInnerVlanFilterVidEnable", sizeof(sVar.sFilter.sInnerVlan.bVidEnable), &sVar.sFilter.sInnerVlan.bVidEnable);
- scanParamArg(prmc, prmv, "nInnerVlanFilterVidVal", sizeof(sVar.sFilter.sInnerVlan.nVidVal), &sVar.sFilter.sInnerVlan.nVidVal);
- scanParamArg(prmc, prmv, "eInnerVlanFilterTpid", sizeof(sVar.sFilter.sInnerVlan.eTpid), &sVar.sFilter.sInnerVlan.eTpid);
- scanParamArg(prmc, prmv, "eInnerVlanFilterDei", sizeof(sVar.sFilter.sInnerVlan.eDei), &sVar.sFilter.sInnerVlan.eDei);
-
- scanParamArg(prmc, prmv, "eEtherType", sizeof(sVar.sFilter.eEtherType), &sVar.sFilter.eEtherType);
- scanParamArg(prmc, prmv, "eRemoveTagAction", sizeof(sVar.sTreatment.eRemoveTag), &sVar.sTreatment.eRemoveTag);
-
- scanParamArg(prmc, prmv, "bOuterVlanActionEnable", sizeof(sVar.sTreatment.bAddOuterVlan), &sVar.sTreatment.bAddOuterVlan);
- scanParamArg(prmc, prmv, "eOuterVlanActionPriorityMode", sizeof(sVar.sTreatment.sOuterVlan.ePriorityMode), &sVar.sTreatment.sOuterVlan.ePriorityMode);
- scanParamArg(prmc, prmv, "eOuterVlanActionPriorityVal", sizeof(sVar.sTreatment.sOuterVlan.ePriorityVal), &sVar.sTreatment.sOuterVlan.ePriorityVal);
- scanParamArg(prmc, prmv, "eOuterVlanActionVidMode", sizeof(sVar.sTreatment.sOuterVlan.eVidMode), &sVar.sTreatment.sOuterVlan.eVidMode);
- scanParamArg(prmc, prmv, "eOuterVlanActionVidVal", sizeof(sVar.sTreatment.sOuterVlan.eVidVal), &sVar.sTreatment.sOuterVlan.eVidVal);
- scanParamArg(prmc, prmv, "eOuterVlanActionTpid", sizeof(sVar.sTreatment.sOuterVlan.eTpid), &sVar.sTreatment.sOuterVlan.eTpid);
- scanParamArg(prmc, prmv, "eOuterVlanActioneDei", sizeof(sVar.sTreatment.sOuterVlan.eDei), &sVar.sTreatment.sOuterVlan.eDei);
-
- scanParamArg(prmc, prmv, "bInnerVlanActionEnable", sizeof(sVar.sTreatment.bAddInnerVlan), &sVar.sTreatment.bAddInnerVlan);
- scanParamArg(prmc, prmv, "eInnerVlanActionPriorityMode", sizeof(sVar.sTreatment.sInnerVlan.ePriorityMode), &sVar.sTreatment.sInnerVlan.ePriorityMode);
- scanParamArg(prmc, prmv, "eInnerVlanActionPriorityVal", sizeof(sVar.sTreatment.sInnerVlan.ePriorityVal), &sVar.sTreatment.sInnerVlan.ePriorityVal);
- scanParamArg(prmc, prmv, "eInnerVlanActionVidMode", sizeof(sVar.sTreatment.sInnerVlan.eVidMode), &sVar.sTreatment.sInnerVlan.eVidMode);
- scanParamArg(prmc, prmv, "eInnerVlanActionVidVal", sizeof(sVar.sTreatment.sInnerVlan.eVidVal), &sVar.sTreatment.sInnerVlan.eVidVal);
- scanParamArg(prmc, prmv, "eInnerVlanActionTpid", sizeof(sVar.sTreatment.sInnerVlan.eTpid), &sVar.sTreatment.sInnerVlan.eTpid);
- scanParamArg(prmc, prmv, "eInnerVlanActioneDei", sizeof(sVar.sTreatment.sInnerVlan.eDei), &sVar.sTreatment.sInnerVlan.eDei);
-
- scanParamArg(prmc, prmv, "bReassignBridgePortEnable", sizeof(sVar.sTreatment.bReassignBridgePort), &sVar.sTreatment.bReassignBridgePort);
- scanParamArg(prmc, prmv, "nNewBridgePortId", sizeof(sVar.sTreatment.nNewBridgePortId), &sVar.sTreatment.nNewBridgePortId);
-
- scanParamArg(prmc, prmv, "bNewDscpEnable", sizeof(sVar.sTreatment.bNewDscpEnable), &sVar.sTreatment.bNewDscpEnable);
- scanParamArg(prmc, prmv, "nNewDscp", sizeof(sVar.sTreatment.nNewDscp), &sVar.sTreatment.nNewDscp);
-
- scanParamArg(prmc, prmv, "bNewTrafficClassEnable", sizeof(sVar.sTreatment.bNewTrafficClassEnable), &sVar.sTreatment.bNewTrafficClassEnable);
- scanParamArg(prmc, prmv, "nNewTrafficClass", sizeof(sVar.sTreatment.nNewTrafficClass), &sVar.sTreatment.nNewTrafficClass);
-
- scanParamArg(prmc, prmv, "bNewMeterEnable", sizeof(sVar.sTreatment.bNewMeterEnable), &sVar.sTreatment.bNewMeterEnable);
- scanParamArg(prmc, prmv, "sNewTrafficMeterId", sizeof(sVar.sTreatment.sNewTrafficMeterId), &sVar.sTreatment.sNewTrafficMeterId);
-
- scanParamArg(prmc, prmv, "bLoopbackEnable", sizeof(sVar.sTreatment.bLoopbackEnable), &sVar.sTreatment.bLoopbackEnable);
- scanParamArg(prmc, prmv, "bDaSaSwapEnable", sizeof(sVar.sTreatment.bDaSaSwapEnable), &sVar.sTreatment.bDaSaSwapEnable);
- scanParamArg(prmc, prmv, "bMirrorEnable", sizeof(sVar.sTreatment.bMirrorEnable), &sVar.sTreatment.bMirrorEnable);
-
- scanParamArg(prmc, prmv, "bDscp2PcpMapEnable", sizeof(bDscp2PcpMapEnable), &bDscp2PcpMapEnable);
- scanParamArg(prmc, prmv, "nDscp2PcpMapValue", sizeof(nDscp2PcpMapValue), &nDscp2PcpMapValue);
- if (bDscp2PcpMapEnable) {
- for (f = 0; f < 64; f++)
- sVar.sTreatment.nDscp2PcpMap[f] = nDscp2PcpMapValue;
- }
-
- scanParamArg(prmc, prmv, "bOriginalPacketFilterMode", sizeof(sVar.sFilter.bOriginalPacketFilterMode), &sVar.sFilter.bOriginalPacketFilterMode);
- scanParamArg(prmc, prmv, "eFilter_4_Tpid_Mode", sizeof(sVar.sFilter.eFilter_4_Tpid_Mode), &sVar.sFilter.eFilter_4_Tpid_Mode);
- scanParamArg(prmc, prmv, "eTreatment_4_Tpid_Mode", sizeof(sVar.sTreatment.eTreatment_4_Tpid_Mode), &sVar.sTreatment.eTreatment_4_Tpid_Mode);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_ExtendedVlanSet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_ExtendedVlanSet failed with ret code", ret);
- else{
- printf("fapi_GSW_ExtendedVlanSet done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_VlanFilterAlloc(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_VLANFILTER_alloc_t param = {0};
- int rret;
-
- memset(¶m, 0x00, sizeof(param));
-
- rret = scanParamArg(prmc, prmv, "nNumberOfEntries", sizeof(param.nNumberOfEntries), ¶m.nNumberOfEntries);
- if (rret < 1){
- printf("Parameter not Found: nNumberOfEntries\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "bDiscardUntagged", sizeof(param.bDiscardUntagged), ¶m.bDiscardUntagged);
- if (rret < 1){
- printf("Parameter not Found: bDiscardUntagged\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "bDiscardUnmatchedTagged", sizeof(param.bDiscardUnmatchedTagged), ¶m.bDiscardUnmatchedTagged);
- if (rret < 1){
- printf("Parameter not Found: bDiscardUnmatchedTagged\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_VlanFilterAlloc(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanFilterAlloc failed with ret code", ret);
- else{
- printf("\n\tAllocated VlanFilterblock = %u", param.nVlanFilterBlockId);
- printf("\n\t Number of block entries associated with VlanFilterblock %d = %u\n",
- param.nVlanFilterBlockId, param.nNumberOfEntries);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_VlanFilterFree(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_VLANFILTER_alloc_t param = {0};
- int rret;
-
- memset(¶m, 0x00, sizeof(param));
-
- rret = scanParamArg(prmc, prmv, "nVlanFilterBlockId", sizeof(param.nVlanFilterBlockId), ¶m.nVlanFilterBlockId);
- if (rret < 1){
- printf("Parameter not Found: nVlanFilterBlockId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_VlanFilterFree(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanFilterFree failed with ret code", ret);
- else{
- printf("\n\t Number of deleted entries associated with VlanFilterblock %d = %u\n",
- param.nVlanFilterBlockId, param.nNumberOfEntries);
- }
-
- return ret;
-}
-
-
-
-GSW_return_t fapi_GSW_VlanFilterGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- unsigned char f = 0;
-
- GSW_VLANFILTER_config_t sVar = {0};
- int rret;
-
- memset(&sVar, 0x00, sizeof(sVar));
-
- rret = scanParamArg(prmc, prmv, "nVlanFilterBlockId", sizeof(sVar.nVlanFilterBlockId), &sVar.nVlanFilterBlockId);
- if (rret < 1){
- printf("Parameter not Found: nVlanFilterBlockId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nEntryIndex", sizeof(sVar.nEntryIndex), &sVar.nEntryIndex);
- if (rret < 1){
- printf("Parameter not Found: nEntryIndex\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_VlanFilterGet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanFilterGet failed with ret code", ret);
- else{
- printf("fapi_GSW_VlanFilterGet done\n");
- printf("%40s:\t%u\n", "nVlanFilterBlockId", sVar.nVlanFilterBlockId);
- printf("%40s:\t%u\n", "nEntryIndex", sVar.nEntryIndex);
- printf("%40s:\t%u\n", "eVlanFilterMask",sVar.eVlanFilterMask);
- printf("%40s:\t%u\n", "nVal",sVar.nVal);
- printf("%40s:\t%u\n", "bDiscardMatched",sVar.bDiscardMatched);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_VlanFilterSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- unsigned char f = 0;
- GSW_VLANFILTER_config_t sVar = {0};
- int rret;
-
- memset(&sVar, 0x00, sizeof(sVar));
-
- rret = scanParamArg(prmc, prmv, "nVlanFilterBlockId", sizeof(sVar.nVlanFilterBlockId), &sVar.nVlanFilterBlockId);
- if (rret < 1){
- printf("Parameter not Found: nVlanFilterBlockId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nEntryIndex", sizeof(sVar.nEntryIndex), &sVar.nEntryIndex);
- if (rret < 1){
- printf("Parameter not Found: nEntryIndex\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "eVlanFilterMask", sizeof(sVar.eVlanFilterMask), &sVar.eVlanFilterMask);
- if (rret < 1){
- printf("Parameter not Found: eVlanFilterMask\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nVal", sizeof(sVar.nVal), &sVar.nVal);
- if (rret < 1){
- printf("Parameter not Found: nVal\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "bDiscardMatched", sizeof(sVar.bDiscardMatched), &sVar.bDiscardMatched);
- if (rret < 1){
- printf("Parameter not Found: bDiscardMatched\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_VlanFilterSet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanFilterSet failed with ret code", ret);
- else{
- printf("fapi_GSW_VlanFilterSet done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_STP_PortCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_STP_portCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_STP_PortCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_STP_PortCfgGet failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n", "nPortId", param.nPortId );
- printf("\t%40s:\t%x\n", "ePortState", param.ePortState);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_STP_PortCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_STP_portCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "ePortState", sizeof(param.ePortState), ¶m.ePortState);
- if (rret < 1){
- printf("Parameter not Found: ePortState\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_STP_PortCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_STP_PortCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_STP_PortCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_STP_BPDU_RuleGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_STP_BPDU_Rule_t param = {0};
- int rret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_STP_BPDU_RuleGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_STP_BPDU_RuleGet failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n", "eForwardPort", param.eForwardPort );
- printf("\t%40s:\t%x\n", "nForwardPortId", param.nForwardPortId);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_STP_BPDU_RuleSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_STP_BPDU_Rule_t param = {0};
- int rret;
-
- scanParamArg(prmc, prmv, "eForwardPort", sizeof(param.eForwardPort), ¶m.eForwardPort);
- scanParamArg(prmc, prmv, "nForwardPortId", sizeof(param.nForwardPortId), ¶m.nForwardPortId);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_STP_BPDU_RuleSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_STP_BPDU_RuleSet failed with ret code", ret);
- else{
- printf("fapi_GSW_STP_BPDU_RuleSet done\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_QoS_MeterCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_meterCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nMeterId", sizeof(param.nMeterId), ¶m.nMeterId);
- if (rret < 1){
- printf("Parameter not Found: nMeterId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_MeterCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_MeterCfgGet failed with ret code", ret);
- else{
- printf("Returned values:\n----------------\n");
- printf("\t%40s:\t%s\n", "bEnable", (param.bEnable > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%x\n", "nMeterId", param.nMeterId);
- printf("\t%40s:\t%x\n", "eMtrType", param.eMtrType);
- printf("\t%40s:\t%u (0x%x)\n", "nCbs", param.nCbs,param.nCbs);
- printf("\t%40s:\t%u (0x%x)\n", "nEbs", param.nEbs,param.nEbs);
- printf("\t%40s:\t%x\n", "nCbs_ls", param.nCbs_ls);
- printf("\t%40s:\t%x\n", "nEbs_ls", param.nEbs_ls);
- printf("\t%40s:\t%u (0x%x)\n", "nRate", param.nRate,param.nRate);
- printf("\t%40s:\t%u (0x%x)\n", "nPiRate", param.nPiRate,param.nPiRate);
- //printf("\t%40s:\t%x\n", "cMeterName", param.cMeterName);
- printf("\t%40s:\t%x\n", "nColourBlindMode", param.nColourBlindMode);
- printf("\t%40s:\t%x\n", "bPktMode", param.bPktMode);
- printf("\t%40s:\t%s\n", "bLocalOverhd", (param.bLocalOverhd > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%u (0x%x)\n", "nLocaloverhd", param.nLocaloverhd,param.nLocaloverhd);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_QoS_MeterCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_meterCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nMeterId", sizeof(param.nMeterId), ¶m.nMeterId);
- if (rret < 1){
- printf("Parameter not Found: nMeterId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "bEnable", sizeof(param.bEnable), ¶m.bEnable);
- scanParamArg(prmc, prmv, "eMtrType", sizeof(param.eMtrType), ¶m.eMtrType);
- scanParamArg(prmc, prmv, "nCbs", sizeof(param.nCbs), ¶m.nCbs);
- scanParamArg(prmc, prmv, "nEbs", sizeof(param.nEbs), ¶m.nEbs);
- scanParamArg(prmc, prmv, "nCbs_ls", sizeof(param.nCbs_ls), ¶m.nCbs_ls);
- scanParamArg(prmc, prmv, "nEbs_ls", sizeof(param.nEbs_ls), ¶m.nEbs_ls);
- scanParamArg(prmc, prmv, "nRate", sizeof(param.nRate), ¶m.nRate);
- scanParamArg(prmc, prmv, "nPiRate", sizeof(param.nPiRate), ¶m.nPiRate);
- scanParamArg(prmc, prmv, "cMeterName", sizeof(param.cMeterName), ¶m.cMeterName);
- scanParamArg(prmc, prmv, "nColourBlindMode", sizeof(param.nColourBlindMode), ¶m.nColourBlindMode);
- scanParamArg(prmc, prmv, "bPktMode", sizeof(param.bPktMode), ¶m.bPktMode);
- scanParamArg(prmc, prmv, "bLocalOverhd", sizeof(param.bLocalOverhd), ¶m.bLocalOverhd);
- scanParamArg(prmc, prmv, "nLocaloverhd", sizeof(param.nLocaloverhd), ¶m.nLocaloverhd);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QoS_MeterCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_MeterCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_MeterCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MAC_DefaultFilterGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_MACFILTER_default_t param = {0};
- int rret,i;
-
- rret = scanParamArg(prmc, prmv, "eType", sizeof(param.eType), ¶m.eType);
- if (rret < 1){
- printf("Parameter not Found: eType\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_DefaultMacFilterGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_DefaultFilterGet failed with ret code", ret);
- else{
- printf("Returned values:\n----------------\n");
- for (i = 0; i <= 7; i++)
- printf("\t nPortmap[%d] = 0x%x\n", i, param.nPortmap[i]);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_MAC_DefaultFilterSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_MACFILTER_default_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "eType", sizeof(param.eType), ¶m.eType);
- if (rret < 1){
- printf("Parameter not Found: eType\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_DefaultMacFilterSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MAC_DefaultFilterSet failed with ret code", ret);
- else{
- printf("fapi_GSW_MAC_DefaultFilterSet done\n");
- }
-
- return ret;
-}
-
-
-
-
-GSW_return_t fapi_GSW_CTP_PortAssignmentGet(int prmc, char *prmv[])
-{
- GSW_CTP_portAssignment_t sVar = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(sVar.nLogicalPortId), &sVar.nLogicalPortId);
- if (rret < 1){
- printf("Parameter not Found: nLogicalPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_CTP_PortAssignmentGet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_CTP_PortAssignmentGet failed with ret code", ret);
- else{
- printf("\n\t nLogicalPortId = %u", sVar.nLogicalPortId);
- printf("\n\t nFirstCtpPortId = %u", sVar.nFirstCtpPortId);
- printf("\n\t nNumberOfCtpPort = %u", sVar.nNumberOfCtpPort);
- printf("\n\t eMode = %u", sVar.eMode);
- printf("\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_CTP_PortAssignmentSet(int prmc, char *prmv[])
-{
- GSW_CTP_portAssignment_t sVar = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(sVar.nLogicalPortId), &sVar.nLogicalPortId);
- if (rret < 1){
- printf("Parameter not Found: nLogicalPortId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nFirstCtpPortId", sizeof(sVar.nFirstCtpPortId), &sVar.nFirstCtpPortId);
- scanParamArg(prmc, prmv, "nNumberOfCtpPort", sizeof(sVar.nNumberOfCtpPort), &sVar.nNumberOfCtpPort);
- scanParamArg(prmc, prmv, "eMode", sizeof(sVar.eMode), &sVar.eMode);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_CTP_PortAssignmentSet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_CTP_PortAssignmentSet failed with ret code", ret);
- else{
- printf("fapi_GSW_CTP_PortAssignmentSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PMAC_IG_CfgSet(int prmc, char *prmv[])
-{
- GSW_PMAC_Ig_Cfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nTxDmaChanId", sizeof(param.nTxDmaChanId), ¶m.nTxDmaChanId);
- scanParamArg(prmc, prmv, "bErrPktsDisc", sizeof(param.bErrPktsDisc), ¶m.bErrPktsDisc);
- scanParamArg(prmc, prmv, "bPmapDefault", sizeof(param.bPmapDefault), ¶m.bPmapDefault);
- scanParamArg(prmc, prmv, "bPmapEna", sizeof(param.bPmapEna), ¶m.bPmapEna);
- scanParamArg(prmc, prmv, "bClassDefault", sizeof(param.bClassDefault), ¶m.bClassDefault);
- scanParamArg(prmc, prmv, "bClassEna", sizeof(param.bClassEna), ¶m.bClassEna);
- scanParamArg(prmc, prmv, "eSubId", sizeof(param.eSubId), ¶m.eSubId);
- scanParamArg(prmc, prmv, "bSpIdDefault", sizeof(param.bSpIdDefault), ¶m.bSpIdDefault);
- scanParamArg(prmc, prmv, "bPmacPresent", sizeof(param.bPmacPresent), ¶m.bPmacPresent);
- scanPMAC_Arg(prmc, prmv, "defPmacHdr", param.defPmacHdr);
-
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_IG_CfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_IG_CfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_PMAC_IG_CfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PMAC_IG_CfgGet(int prmc, char *prmv[])
-{
- GSW_PMAC_Ig_Cfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nTxDmaChanId", sizeof(param.nTxDmaChanId), ¶m.nTxDmaChanId);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_IG_CfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_IG_CfgGet failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n","nPmacId ", param.nPmacId);
- printf("\t%40s:\t%x\n","nTxDmaChanId", param.nTxDmaChanId);
- printf("\t%40s:\t%x\n","bErrPktsDisc", param.bErrPktsDisc);
- printf("\t%40s:\t%x\n","bPmapDefault", param.bPmapDefault);
- printf("\t%40s:\t%x\n","bPmapEna", param.bPmapEna);
- printf("\t%40s:\t%x\n","bClassDefault", param.bClassDefault);
- printf("\t%40s:\t%x\n","bClassEna", param.bClassEna);
- printf("\t%40s:\t%x\n","eSubId ", param.eSubId);
- printf("\t%40s:\t%x\n","bSpIdDefault", param.bSpIdDefault);
- printf("\t%40s:\t%x\n","bPmacPresent", param.bPmacPresent);
- printf("\t%40s:\t","defPmacHdr");
- printf("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- param.defPmacHdr[0],
- param.defPmacHdr[1],
- param.defPmacHdr[2],
- param.defPmacHdr[3],
- param.defPmacHdr[4],
- param.defPmacHdr[5],
- param.defPmacHdr[6],
- param.defPmacHdr[7]);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PMAC_EG_CfgGet(int prmc, char *prmv[])
-{
- GSW_PMAC_Eg_Cfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nDestPortId", sizeof(param.nDestPortId), ¶m.nDestPortId);
- scanParamArg(prmc, prmv, "bProcFlagsSelect", sizeof(param.bProcFlagsSelect), ¶m.bProcFlagsSelect);
- scanParamArg(prmc, prmv, "nTrafficClass", sizeof(param.nTrafficClass), ¶m.nTrafficClass);
- scanParamArg(prmc, prmv, "nFlowIDMsb", sizeof(param.nFlowIDMsb), ¶m.nFlowIDMsb);
- scanParamArg(prmc, prmv, "bMpe1Flag", sizeof(param.bMpe1Flag), ¶m.bMpe1Flag);
- scanParamArg(prmc, prmv, "bMpe2Flag", sizeof(param.bMpe2Flag), ¶m.bMpe2Flag);
- scanParamArg(prmc, prmv, "bEncFlag", sizeof(param.bEncFlag), ¶m.bEncFlag);
- scanParamArg(prmc, prmv, "bDecFlag", sizeof(param.bDecFlag), ¶m.bDecFlag);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_EG_CfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_EG_CfgGet failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n","nPmacId ", param.nPmacId);
- printf("\t%40s:\t%x\n","nDestPortId", param.nDestPortId);
- printf("\t%40s:\t%x\n","nTrafficClass", param.nTrafficClass);
- printf("\t%40s:\t%x\n","bMpe1Flag", param.bMpe1Flag);
- printf("\t%40s:\t%x\n","bMpe2Flag", param.bMpe2Flag);
- printf("\t%40s:\t%x\n","bDecFlag", param.bDecFlag);
- printf("\t%40s:\t%x\n","bEncFlag", param.bEncFlag);
- printf("\t%40s:\t%x\n","nFlowIDMsb", param.nFlowIDMsb);
- printf("\t%40s:\t%x\n","bProcFlagsSelect", param.bProcFlagsSelect);
- printf("\t%40s:\t%x\n","nRxDmaChanId", param.nRxDmaChanId);
- printf("\t%40s:\t%x\n","bRemL2Hdr", param.bRemL2Hdr);
- printf("\t%40s:\t%x\n","numBytesRem", param.numBytesRem);
- printf("\t%40s:\t%x\n","bFcsEna ", param.bFcsEna);
- printf("\t%40s:\t%x\n","bPmacEna", param.bPmacEna);
- printf("\t%40s:\t%x\n","bRedirEnable", param.bRedirEnable);
- printf("\t%40s:\t%x\n","bBslSegmentDisable", param.bBslSegmentDisable);
- printf("\t%40s:\t%x\n","nBslTrafficClass", param.nBslTrafficClass);
- printf("\t%40s:\t%x\n","bResDW1Enable", param.bResDW1Enable);
- printf("\t%40s:\t%x\n","nResDW1", param.nResDW1);
- printf("\t%40s:\t%x\n","bRes1DW0Enable", param.bRes1DW0Enable);
- printf("\t%40s:\t%x\n","nRes1DW0", param.nRes1DW0);
- printf("\t%40s:\t%x\n","bRes2DW0Enable", param.bRes2DW0Enable);
- printf("\t%40s:\t%x\n","nRes2DW0", param.nRes2DW0);
- printf("\t%40s:\t%x\n","bTCEnable", param.bTCEnable);
- }
- return ret;
-
-}
-
-
-GSW_return_t fapi_GSW_PMAC_EG_CfgSet(int prmc, char *prmv[])
-{
- GSW_PMAC_Eg_Cfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "bRedirEnable", sizeof(param.bRedirEnable), ¶m.bRedirEnable);
- scanParamArg(prmc, prmv, "bBslSegmentDisable", sizeof(param.bBslSegmentDisable), ¶m.bBslSegmentDisable);
- scanParamArg(prmc, prmv, "nBslTrafficClass", sizeof(param.nBslTrafficClass), ¶m.nBslTrafficClass);
- scanParamArg(prmc, prmv, "bResDW1Enable", sizeof(param.bResDW1Enable), ¶m.bResDW1Enable);
- scanParamArg(prmc, prmv, "bRes2DW0Enable", sizeof(param.bRes2DW0Enable), ¶m.bRes2DW0Enable);
- scanParamArg(prmc, prmv, "bRes1DW0Enable", sizeof(param.bRes1DW0Enable), ¶m.bRes1DW0Enable);
- scanParamArg(prmc, prmv, "bTCEnable", sizeof(param.bTCEnable), ¶m.bTCEnable);
- scanParamArg(prmc, prmv, "nDestPortId", sizeof(param.nDestPortId), ¶m.nDestPortId);
- scanParamArg(prmc, prmv, "bProcFlagsSelect", sizeof(param.bProcFlagsSelect), ¶m.bProcFlagsSelect);
- scanParamArg(prmc, prmv, "nTrafficClass", sizeof(param.nTrafficClass), ¶m.nTrafficClass);
- scanParamArg(prmc, prmv, "nFlowIDMsb", sizeof(param.nFlowIDMsb), ¶m.nFlowIDMsb);
- scanParamArg(prmc, prmv, "bMpe1Flag", sizeof(param.bMpe1Flag), ¶m.bMpe1Flag);
- scanParamArg(prmc, prmv, "bMpe2Flag", sizeof(param.bMpe2Flag), ¶m.bMpe2Flag);
- scanParamArg(prmc, prmv, "bEncFlag", sizeof(param.bEncFlag), ¶m.bEncFlag);
- scanParamArg(prmc, prmv, "bDecFlag", sizeof(param.bDecFlag), ¶m.bDecFlag);
- scanParamArg(prmc, prmv, "nRxDmaChanId", sizeof(param.nRxDmaChanId), ¶m.nRxDmaChanId);
- scanParamArg(prmc, prmv, "bRemL2Hdr", sizeof(param.bRemL2Hdr), ¶m.bRemL2Hdr);
- scanParamArg(prmc, prmv, "numBytesRem", sizeof(param.numBytesRem), ¶m.numBytesRem);
- scanParamArg(prmc, prmv, "bFcsEna", sizeof(param.bFcsEna), ¶m.bFcsEna);
- scanParamArg(prmc, prmv, "bPmacEna", sizeof(param.bPmacEna), ¶m.bPmacEna);
- scanParamArg(prmc, prmv, "nResDW1", sizeof(param.nResDW1), ¶m.nResDW1);
- scanParamArg(prmc, prmv, "nRes1DW0", sizeof(param.nRes1DW0), ¶m.nRes1DW0);
- scanParamArg(prmc, prmv, "nRes2DW0", sizeof(param.nRes2DW0), ¶m.nRes2DW0);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_EG_CfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_EG_CfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_PMAC_EG_CfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PMAC_BM_CfgGet(int prmc, char *prmv[])
-{
- GSW_PMAC_BM_Cfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nTxDmaChanId", sizeof(param.nTxDmaChanId), ¶m.nTxDmaChanId);
- if (rret < 1){
- printf("Parameter not Found: nTxDmaChanId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_BM_CfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_BM_CfgGet failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n","nTxDmaChanId ", param.nTxDmaChanId);
- printf("\t%40s:\t%x\n","txQMask ", param.txQMask);
- printf("\t%40s:\t%x\n","rxPortMask ", param.rxPortMask);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PMAC_BM_CfgSet(int prmc, char *prmv[])
-{
- GSW_PMAC_BM_Cfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nTxDmaChanId", sizeof(param.nTxDmaChanId), ¶m.nTxDmaChanId);
- if (rret < 1){
- printf("Parameter not Found: nTxDmaChanId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "txQMask", sizeof(param.txQMask), ¶m.txQMask);
- scanParamArg(prmc, prmv, "rxPortMask", sizeof(param.rxPortMask), ¶m.rxPortMask);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_BM_CfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_BM_CfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_PMAC_BM_CfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PMAC_GLBL_CfgGet(int prmc, char *prmv[])
-{
- GSW_PMAC_Glbl_Cfg_t param = {0};
- unsigned int i = 0;
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_GLBL_CfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_GLBL_CfgGet failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n","nPmacId", param.nPmacId);
- printf("\t%40s:\t%x\n","bAPadEna", param.bAPadEna);
- printf("\t%40s:\t%x\n","bPadEna", param.bPadEna);
- printf("\t%40s:\t%x\n","bVPadEna", param.bVPadEna);
- printf("\t%40s:\t%x\n","bSVPadEna", param.bSVPadEna);
- printf("\t%40s:\t%x\n","bRxFCSDis", param.bRxFCSDis);
- printf("\t%40s:\t%x\n","bTxFCSDis", param.bTxFCSDis);
- printf("\t%40s:\t%x\n","bIPTransChkRegDis", param.bIPTransChkRegDis);
- printf("\t%40s:\t%x\n","bIPTransChkVerDis", param.bIPTransChkVerDis);
- printf("\t%40s:\t%x\n","bJumboEna", param.bJumboEna);
- printf("\t%40s:\t%u\n","nMaxJumboLen", param.nMaxJumboLen);
- printf("\t%40s:\t%x\n","nJumboThreshLen", param.nJumboThreshLen);
- printf("\t%40s:\t%x\n","bLongFrmChkDis", param.bLongFrmChkDis);
- printf("\t%40s:\t%x\n","eShortFrmChkType", param.eShortFrmChkType);
- printf("\t%40s:\t%x\n","bProcFlagsEgCfgEna", param.bProcFlagsEgCfgEna);
- printf("\t%40s:\t%x\n","eProcFlagsEgCfg", param.eProcFlagsEgCfg);
-
- for (i = 0; i <= 2; i++)
- printf("\t%40s[%i]:\t%u\n","nBslThreshold", i, param.nBslThreshold[i]);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PMAC_GLBL_CfgSet(int prmc, char *prmv[])
-{
- GSW_PMAC_Glbl_Cfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_GLBL_CfgGet(gsw_dev, ¶m);
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(param.nPmacId), ¶m.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "bRxFCSDis", sizeof(param.bRxFCSDis), ¶m.bRxFCSDis);
- scanParamArg(prmc, prmv, "eProcFlagsEgCfg", sizeof(param.eProcFlagsEgCfg), ¶m.eProcFlagsEgCfg);
- scanParamArg(prmc, prmv, "nBslThreshold0", sizeof(param.nBslThreshold[0]), ¶m.nBslThreshold[0]);
- scanParamArg(prmc, prmv, "nBslThreshold1", sizeof(param.nBslThreshold[1]), ¶m.nBslThreshold[1]);
- scanParamArg(prmc, prmv, "nBslThreshold2", sizeof(param.nBslThreshold[2]), ¶m.nBslThreshold[2]);
- scanParamArg(prmc, prmv, "bAPadEna", sizeof(param.bAPadEna), ¶m.bAPadEna);
- scanParamArg(prmc, prmv, "bPadEna", sizeof(param.bPadEna), ¶m.bPadEna);
- scanParamArg(prmc, prmv, "bVPadEna", sizeof(param.bVPadEna), ¶m.bVPadEna);
- scanParamArg(prmc, prmv, "bSVPadEna", sizeof(param.bSVPadEna), ¶m.bSVPadEna);
- scanParamArg(prmc, prmv, "bTxFCSDis", sizeof(param.bTxFCSDis), ¶m.bTxFCSDis);
- scanParamArg(prmc, prmv, "bIPTransChkRegDis", sizeof(param.bIPTransChkRegDis), ¶m.bIPTransChkRegDis);
- scanParamArg(prmc, prmv, "bIPTransChkVerDis", sizeof(param.bIPTransChkVerDis), ¶m.bIPTransChkVerDis);
- scanParamArg(prmc, prmv, "bJumboEna", sizeof(param.bJumboEna), ¶m.bJumboEna);
- scanParamArg(prmc, prmv, "nMaxJumboLen", sizeof(param.nMaxJumboLen), ¶m.nMaxJumboLen);
- scanParamArg(prmc, prmv, "nJumboThreshLen", sizeof(param.nJumboThreshLen), ¶m.nJumboThreshLen);
- scanParamArg(prmc, prmv, "bLongFrmChkDis", sizeof(param.bLongFrmChkDis), ¶m.bLongFrmChkDis);
- scanParamArg(prmc, prmv, "eShortFrmChkType", sizeof(param.eShortFrmChkType), ¶m.eShortFrmChkType);
- scanParamArg(prmc, prmv, "bProcFlagsEgCfgEna", sizeof(param.bProcFlagsEgCfgEna), ¶m.bProcFlagsEgCfgEna);
-
- ret = GSW_PMAC_GLBL_CfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_GLBL_CfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_PMAC_GLBL_CfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PceRuleRead(int prmc, char *prmv[])
-{
- GSW_PCE_rule_t pce_rule = {0};
- int i;
-
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.pattern.nIndex), &pce_rule.pattern.nIndex);
- if (rret < 1){
- printf("Parameter not Found: pattern.nIndex\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
- scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
- scanParamArg(prmc, prmv, "region", sizeof(pce_rule.region), &pce_rule.region);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PceRuleRead(gsw_dev, &pce_rule);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleRead failed with ret code", ret);
- else {
- printf("fapi_GSW_PceRuleRead done\n");
-
- if (pce_rule.pattern.bEnable) {
- printf("\n\tp.nIndex = %u", pce_rule.pattern.nIndex);
-
- if (pce_rule.pattern.bMAC_DstEnable) {
- printf("\n\tp.bMAC_DstEnable = %u", pce_rule.pattern.bMAC_DstEnable);
- printf("\n\tp.bDstMAC_Exclude = %u", pce_rule.pattern.bDstMAC_Exclude);
- printf("\n\tp.nMAC_Dst = ");
-
- for (i = 0; i < 6; i++) {
- printf("%2.2x", pce_rule.pattern.nMAC_Dst[i]);
- }
- printf("\n\tp.nMAC_DstMask = 0x%x", pce_rule.pattern.nMAC_DstMask);
- }
-
- if (pce_rule.pattern.bMAC_SrcEnable) {
- printf("\n\tp.bMAC_SrcEnable = %u", pce_rule.pattern.bMAC_SrcEnable);
- printf("\n\tp.bSrcMAC_Exclude = %u", pce_rule.pattern.bSrcMAC_Exclude);
- printf("\n\tp.nMAC_Src = ");
-
- for (i = 0; i < 6; i++) {
- printf("%2.2x", pce_rule.pattern.nMAC_Src[i]);
- }
- printf("\n\tp.nMAC_SrcMask = 0x%x", pce_rule.pattern.nMAC_SrcMask);
- }
-
- if (pce_rule.pattern.eDstIP_Select) {
- printf("\n\tp.eDstIP_Select = %u", pce_rule.pattern.eDstIP_Select);
- printf("\n\tp.bDstIP_Exclude = %u", pce_rule.pattern.bDstIP_Exclude);
-
- if (pce_rule.pattern.eDstIP_Select == GSW_PCE_IP_V4) {
- printf("\n\tp.nDstIP = 0x%x", pce_rule.pattern.nDstIP.nIPv4);
- printf("\n\tp.nDstIP_Mask = 0x%x", pce_rule.pattern.nDstIP_Mask);
- } else if (pce_rule.pattern.eDstIP_Select == GSW_PCE_IP_V6) {
- printf("\n\tp.nDstIP = ");
-
- for (i = 0; i < 8; i++) {
- if (i == 7)
- printf("%x", pce_rule.pattern.nDstIP.nIPv6[i]);
- else
- printf("%x:", pce_rule.pattern.nDstIP.nIPv6[i]);
- }
- printf("\n\tp.nDstIP_Mask = 0x%x", pce_rule.pattern.nDstIP_Mask);
- }
- }
-
- if (pce_rule.pattern.eInnerDstIP_Select) {
- printf("\n\tp.eInnerDstIP_Select = %u", pce_rule.pattern.eInnerDstIP_Select);
- printf("\n\tp.bInnerDstIP_Exclude = %u", pce_rule.pattern.bInnerDstIP_Exclude);
-
- if (pce_rule.pattern.eInnerDstIP_Select == GSW_PCE_IP_V4) {
- printf("\n\tp.nInnerDstIP = 0x%x", pce_rule.pattern.nInnerDstIP.nIPv4);
- printf("\n\tp.nInnerDstIP_Mask = 0x%x", pce_rule.pattern.nInnerDstIP_Mask);
- } else if (pce_rule.pattern.eInnerDstIP_Select == GSW_PCE_IP_V6) {
- printf("\n\tp.nInnerDstIP = ");
-
- for (i = 0; i < 8; i++) {
- if (i == 7)
- printf("%x", pce_rule.pattern.nInnerDstIP.nIPv6[i]);
- else
- printf("%x:", pce_rule.pattern.nInnerDstIP.nIPv6[i]);
- }
- printf("\n\tp.nInnerDstIP_Mask = 0x%x", pce_rule.pattern.nInnerDstIP_Mask);
- }
- }
-
- if (pce_rule.pattern.eSrcIP_Select) {
- printf("\n\tp.eSrcIP_Select = %u", pce_rule.pattern.eSrcIP_Select);
- printf("\n\tp.bSrcIP_Exclude = %u", pce_rule.pattern.bSrcIP_Exclude);
-
- if (pce_rule.pattern.eSrcIP_Select == GSW_PCE_IP_V4) {
- printf("\n\tp.nSrcIP = 0x%x", pce_rule.pattern.nSrcIP.nIPv4);
- printf("\n\tp.nSrcIP_Mask = 0x%x", pce_rule.pattern.nSrcIP_Mask);
- } else if (pce_rule.pattern.eSrcIP_Select == GSW_PCE_IP_V6) {
- printf("\n\tp.nSrcIP = ");
-
- for (i = 0; i < 8; i++) {
- if (i == 7)
- printf("%x", pce_rule.pattern.nSrcIP.nIPv6[i]);
- else
- printf("%x:", pce_rule.pattern.nSrcIP.nIPv6[i]);
- }
- printf("\n\tp.nSrcIP_Mask = 0x%x", pce_rule.pattern.nSrcIP_Mask);
- }
- }
-
- if (pce_rule.pattern.eInnerSrcIP_Select) {
- printf("\n\tp.eInnerSrcIP_Select = %u", pce_rule.pattern.eInnerSrcIP_Select);
- printf("\n\tp.bInnerSrcIP_Exclude = %u", pce_rule.pattern.bInnerSrcIP_Exclude);
-
- if (pce_rule.pattern.eInnerSrcIP_Select == GSW_PCE_IP_V4) {
- printf("\n\tp.nInnerSrcIP = 0x%x", pce_rule.pattern.nInnerSrcIP.nIPv4);
- printf("\n\tp.nInnerSrcIP_Mask = 0x%x", pce_rule.pattern.nInnerSrcIP_Mask);
- } else if (pce_rule.pattern.eInnerSrcIP_Select == GSW_PCE_IP_V6) {
- printf("\n\tp.nInnerSrcIP = ");
-
- for (i = 0; i < 8; i++) {
- if (i == 7)
- printf("%x", pce_rule.pattern.nInnerSrcIP.nIPv6[i]);
- else
- printf("%x:", pce_rule.pattern.nInnerSrcIP.nIPv6[i]);
- }
- printf("\n\tp.nInnerSrcIP_Mask = 0x%x", pce_rule.pattern.nInnerSrcIP_Mask);
- }
- }
-
- if (pce_rule.pattern.bVid) {
- printf("\n\tp.bVid = %u", pce_rule.pattern.bVid);
- printf("\n\tp.bVid_Exclude = %u", pce_rule.pattern.bVid_Exclude);
- printf("\n\tp.nVid = %u", pce_rule.pattern.nVid);
-
- if (pce_rule.pattern.bVidRange_Select)
- printf("\n\tp.bVidRange_Select = %u (Range Key)", pce_rule.pattern.bVidRange_Select);
- else
- printf("\n\tp.bVidRange_Select = %u (Mask Key)", pce_rule.pattern.bVidRange_Select);
-
- printf("\n\tp.nVidRange = %u", pce_rule.pattern.nVidRange);
- printf("\n\tp.bVid_Original = %u", pce_rule.pattern.bVid_Original);
- }
-
- if (pce_rule.pattern.bSLAN_Vid) {
- printf("\n\tp.bSLAN_Vid = %u", pce_rule.pattern.bSLAN_Vid);
- printf("\n\tp.bSLANVid_Exclude = %u", pce_rule.pattern.bSLANVid_Exclude);
- printf("\n\tp.nSLAN_Vid = %u", pce_rule.pattern.nSLAN_Vid);
-
- if (pce_rule.pattern.bSVidRange_Select)
- printf("\n\tp.bSVidRange_Select = %u (Range Key)", pce_rule.pattern.bSVidRange_Select);
- else
- printf("\n\tp.bSVidRange_Select = %u (Mask Key)", pce_rule.pattern.bSVidRange_Select);
-
- printf("\n\tp.nOuterVidRange = %u", pce_rule.pattern.nOuterVidRange);
- printf("\n\tp.bOuterVid_Original = %u", pce_rule.pattern.bOuterVid_Original);
- }
-
- if (pce_rule.pattern.bPortIdEnable) {
- printf("\n\tp.bPortIdEnable = %u", pce_rule.pattern.bPortIdEnable);
- printf("\n\tp.bPortId_Exclude = %u", pce_rule.pattern.bPortId_Exclude);
- printf("\n\tp.nPortId = %u", pce_rule.pattern.nPortId);
- }
-
- if (pce_rule.pattern.bSubIfIdEnable) {
- printf("\n\tp.bSubIfIdEnable = %u", pce_rule.pattern.bSubIfIdEnable);
- printf("\n\tp.bSubIfId_Exclude = %u", pce_rule.pattern.bSubIfId_Exclude);
- printf("\n\tp.eSubIfIdType = %u", pce_rule.pattern.eSubIfIdType);
- printf("\n\tp.nSubIfId = %u", pce_rule.pattern.nSubIfId);
- }
-
- if (pce_rule.pattern.bPktLngEnable) {
- printf("\n\tp.bPktLngEnable = %u", pce_rule.pattern.bPktLngEnable);
- printf("\n\tp.bPktLng_Exclude = %u", pce_rule.pattern.bPktLng_Exclude);
- printf("\n\tp.nPktLng = %u", pce_rule.pattern.nPktLng);
- printf("\n\tp.nPktLngRange = %u", pce_rule.pattern.nPktLngRange);
- }
-
- if (pce_rule.pattern.bPayload1_SrcEnable) {
- printf("\n\tp.bPayload1_Exclude = %u", pce_rule.pattern.bPayload1_Exclude);
- printf("\n\tp.nPayload1 = 0x%x", pce_rule.pattern.nPayload1);
- printf("\n\tp.bPayload1MaskRange_Select = %u", pce_rule.pattern.bPayload1MaskRange_Select);
- printf("\n\tp.nPayload1_Mask = 0x%x", pce_rule.pattern.nPayload1_Mask);
- }
-
- if (pce_rule.pattern.bPayload2_SrcEnable) {
- printf("\n\tp.bPayload2_Exclude = %u", pce_rule.pattern.bPayload2_Exclude);
- printf("\n\tp.nPayload2 = 0x%x", pce_rule.pattern.nPayload2);
- printf("\n\tp.bPayload2MaskRange_Select = %u", pce_rule.pattern.bPayload2MaskRange_Select);
- printf("\n\tp.nPayload2_Mask = 0x%x", pce_rule.pattern.nPayload2_Mask);
- }
-
- if (pce_rule.pattern.bParserFlagLSB_Enable) {
- printf("\n\tp.bParserFlagLSB_Exclude = %u", pce_rule.pattern.bParserFlagLSB_Exclude);
- printf("\n\tp.nParserFlagLSB = 0x%x", pce_rule.pattern.nParserFlagLSB);
- printf("\n\tp.nParserFlagLSB_Mask = 0x%x", pce_rule.pattern.nParserFlagLSB_Mask);
- }
-
- if (pce_rule.pattern.bParserFlagMSB_Enable) {
- printf("\n\tp.bParserFlagMSB_Exclude = %u", pce_rule.pattern.bParserFlagMSB_Exclude);
- printf("\n\tp.nParserFlagMSB = 0x%x", pce_rule.pattern.nParserFlagMSB);
- printf("\n\tp.nParserFlagMSB_Mask = 0x%x", pce_rule.pattern.nParserFlagMSB_Mask);
- }
-
- if (pce_rule.pattern.bParserFlag1LSB_Enable) {
- printf("\n\tp.bParserFlag1LSB_Exclude = %u", pce_rule.pattern.bParserFlag1LSB_Exclude);
- printf("\n\tp.nParserFlag1LSB = 0x%x", pce_rule.pattern.nParserFlag1LSB);
- printf("\n\tp.nParserFlag1LSB_Mask = 0x%x", pce_rule.pattern.nParserFlag1LSB_Mask);
- }
-
- if (pce_rule.pattern.bParserFlag1MSB_Enable) {
- printf("\n\tp.bParserFlag1MSB_Exclude = %u", pce_rule.pattern.bParserFlag1MSB_Exclude);
- printf("\n\tp.nParserFlag1MSB = 0x%x", pce_rule.pattern.nParserFlag1MSB);
- printf("\n\tp.nParserFlag1MSB_Mask = 0x%x", pce_rule.pattern.nParserFlag1MSB_Mask);
- }
-
- if (pce_rule.action.eVLAN_Action) {
- printf("\n\ta.eVLAN_Action = %u", pce_rule.action.eVLAN_Action);
- printf("\n\ta.nVLAN_Id = %u", pce_rule.action.nVLAN_Id);
- }
-
- if (pce_rule.action.eSVLAN_Action) {
- printf("\n\ta.eSVLAN_Action = %u", pce_rule.action.eSVLAN_Action);
- printf("\n\ta.nSVLAN_Id = %u", pce_rule.action.nSVLAN_Id);
- }
-
- if (pce_rule.action.eVLAN_CrossAction)
- printf("\n\ta.eVLAN_CrossAction = %u", pce_rule.action.eVLAN_CrossAction);
-
- if (pce_rule.action.bPortBitMapMuxControl)
- printf("\n\ta.bPortBitMapMuxControl = %u", pce_rule.action.bPortBitMapMuxControl);
-
- if (pce_rule.action.bCVLAN_Ignore_Control)
- printf("\n\ta.bCVLAN_Ignore_Control = %u", pce_rule.action.bCVLAN_Ignore_Control);
-
- if (pce_rule.action.eLearningAction)
- printf("\n\ta.eLearningAction = %u", pce_rule.action.eLearningAction);
-
- if (pce_rule.action.eSnoopingTypeAction)
- printf("\n\ta.eSnoopingTypeAction = %u", pce_rule.action.eSnoopingTypeAction);
-
- if (pce_rule.pattern.bEtherTypeEnable) {
- printf("\n\tp.bEtherType_Exclude = 0x%x", pce_rule.pattern.bEtherType_Exclude);
- printf("\n\tp.nEtherType = 0x%x", pce_rule.pattern.nEtherType);
- printf("\n\tp.nEtherTypeMask = 0x%x", pce_rule.pattern.nEtherTypeMask);
- }
-
- if (pce_rule.pattern.bProtocolEnable) {
- printf("\n\tp.bProtocol_Exclude = 0x%x", pce_rule.pattern.bProtocol_Exclude);
- printf("\n\tp.nProtocol = 0x%x", pce_rule.pattern.nProtocol);
- printf("\n\tp.nProtocolMask = 0x%x", pce_rule.pattern.nProtocolMask);
- }
-
- if (pce_rule.pattern.bInnerProtocolEnable) {
- printf("\n\tp.bInnerProtocol_Exclude = 0x%x", pce_rule.pattern.bInnerProtocol_Exclude);
- printf("\n\tp.nInnerProtocol = 0x%x", pce_rule.pattern.nInnerProtocol);
- printf("\n\tp.nInnerProtocolMask = 0x%x", pce_rule.pattern.nInnerProtocolMask);
- }
-
- if (pce_rule.pattern.bSessionIdEnable) {
- printf("\n\tp.bSessionIdEnable = 0x%x", pce_rule.pattern.bSessionIdEnable);
- printf("\n\tp.bSessionId_Exclude = 0x%x", pce_rule.pattern.bSessionId_Exclude);
- printf("\n\tp.nSessionId = 0x%x", pce_rule.pattern.nSessionId);
- }
-
- if (pce_rule.pattern.bPPP_ProtocolEnable) {
- printf("\n\tp.bPPP_Protocol_Exclude = 0x%x", pce_rule.pattern.bPPP_Protocol_Exclude);
- printf("\n\tp.nPPP_Protocol = 0x%x", pce_rule.pattern.nPPP_Protocol);
- printf("\n\tp.nPPP_ProtocolMask = 0x%x", pce_rule.pattern.nPPP_ProtocolMask);
- }
-
- if (pce_rule.pattern.bAppDataMSB_Enable) {
- printf("\n\tp.bAppMSB_Exclude = 0x%x", pce_rule.pattern.bAppMSB_Exclude);
- printf("\n\tp.nAppDataMSB = 0x%x", pce_rule.pattern.nAppDataMSB);
- printf("\n\tp.bAppMaskRangeMSB_Select = %u", pce_rule.pattern.bAppMaskRangeMSB_Select);
- printf("\n\tp.nAppMaskRangeMSB = 0x%x", pce_rule.pattern.nAppMaskRangeMSB);
- }
-
- if (pce_rule.pattern.bAppDataLSB_Enable) {
- printf("\n\tp.bAppLSB_Exclude = 0x%x", pce_rule.pattern.bAppLSB_Exclude);
- printf("\n\tp.nAppDataLSB = 0x%x", pce_rule.pattern.nAppDataLSB);
- printf("\n\tp.bAppMaskRangeLSB_Select = %u", pce_rule.pattern.bAppMaskRangeLSB_Select);
- printf("\n\tp.nAppMaskRangeLSB = 0x%x", pce_rule.pattern.nAppMaskRangeLSB);
- }
-
- if (pce_rule.pattern.bDSCP_Enable) {
- printf("\n\tp.bDSCP_Exclude = %u", pce_rule.pattern.bDSCP_Exclude);
- printf("\n\tp.nDSCP = %u", pce_rule.pattern.nDSCP);
- }
-
- if (pce_rule.pattern.bInner_DSCP_Enable) {
- printf("\n\tp.bInnerDSCP_Exclude = %u", pce_rule.pattern.bInnerDSCP_Exclude);
- printf("\n\tp.nInnerDSCP = %u", pce_rule.pattern.nInnerDSCP);
- }
-
- if (pce_rule.action.bRemarkAction)
- printf("\n\ta.bRemarkAction = Enabled val = %u", pce_rule.action.bRemarkAction);
-
- if (pce_rule.action.bRemarkPCP)
- printf("\n\ta.bRemarkPCP = Disabled val = %u", pce_rule.action.bRemarkPCP);
-
- if (pce_rule.action.bRemarkDSCP)
- printf("\n\ta.bRemarkDSCP = Disabled val = %u", pce_rule.action.bRemarkDSCP);
-
- if (pce_rule.action.bRemarkClass)
- printf("\n\ta.bRemarkClass = Disabled val = %u", pce_rule.action.bRemarkClass);
-
- if (pce_rule.action.bRemarkSTAG_PCP)
- printf("\n\ta.bRemarkSTAG_PCP = Disabled val = %u", pce_rule.action.bRemarkSTAG_PCP);
-
- if (pce_rule.action.bRemarkSTAG_DEI)
- printf("\n\ta.bRemarkSTAG_DEI = Disabled val = %u", pce_rule.action.bRemarkSTAG_DEI);
-
- if ((pce_rule.action.bRMON_Action) || (pce_rule.action.bFlowID_Action)) {
- printf("\n\ta.nFlowID/nRmon_ID = %u", pce_rule.action.nFlowID);
- }
-
- if (pce_rule.pattern.bPCP_Enable) {
- printf("\n\tp.bPCP_Enable = %u", pce_rule.pattern.bPCP_Enable);
- printf("\n\tp.bCTAG_PCP_DEI_Exclude = %u", pce_rule.pattern.bCTAG_PCP_DEI_Exclude);
- printf("\n\tp.nPCP = %u", pce_rule.pattern.nPCP);
- }
-
- if (pce_rule.pattern.bSTAG_PCP_DEI_Enable) {
- printf("\n\tp.bSTAG_PCP_DEI_Enable = %u", pce_rule.pattern.bSTAG_PCP_DEI_Enable);
- printf("\n\tp.bSTAG_PCP_DEI_Exclude = %u", pce_rule.pattern.bSTAG_PCP_DEI_Exclude);
- printf("\n\tp.nSTAG_PCP_DEI = %u", pce_rule.pattern.nSTAG_PCP_DEI);
- }
-
- if (pce_rule.action.ePortMapAction) {
- printf("\n\ta.ePortMapAction = 0x%x", pce_rule.action.ePortMapAction);
-
- for (i = 0; i < 8; i++) {
- if (pce_rule.action.nForwardPortMap[i])
- printf("\n\ta.nForwardPortMap[%d] = 0x%x", i, pce_rule.action.nForwardPortMap[i]);
- }
- }
-
- if (pce_rule.action.eTrafficClassAction) {
- printf("\n\ta.eTrafficClassAction = %u", pce_rule.action.eTrafficClassAction);
- printf("\n\ta.nTrafficClassAlternate = %u", pce_rule.action.nTrafficClassAlternate);
- }
-
- if (pce_rule.action.bPortTrunkAction) {
- printf("\n\ta.bPortTrunkAction = Enabled");
- printf("\n\ta.bPortLinkSelection = %u", pce_rule.action.bPortLinkSelection);
- }
-
- if (pce_rule.action.bExtendedVlanEnable) {
- printf("\n\ta.bExtendedVlanEnable = Enabled");
- printf("\n\ta.nExtendedVlanBlockId = %u", pce_rule.action.nExtendedVlanBlockId);
- }
-
- if (pce_rule.action.ePortFilterType_Action) {
- printf("\n\ta.ePortFilterType_Action = %u", pce_rule.action.ePortFilterType_Action);
-
- for (i = 0; i < 8; i++) {
- if (pce_rule.action.nForwardPortMap[i])
- printf("\n\ta.nForwardPortMap[%d] = 0x%x", i, pce_rule.action.nForwardPortMap[i]);
- }
- }
-
- if (pce_rule.action.eProcessPath_Action)
- printf("\n\ta.eProcessPath_Action = %u", pce_rule.action.eProcessPath_Action);
-
- if (pce_rule.action.bOamEnable)
- printf("\n\ta.bOamEnable = %u", pce_rule.action.bOamEnable);
-
- if (pce_rule.action.bExtractEnable)
- printf("\n\ta.bExtractEnable = %u", pce_rule.action.bExtractEnable);
-
- if (pce_rule.action.bOamEnable || pce_rule.action.bExtractEnable)
- printf("\n\ta.nRecordId = %u", pce_rule.action.nRecordId);
-
- if (pce_rule.action.eColorFrameAction != GSW_PCE_ACTION_COLOR_FRAME_DISABLE)
- printf("\n\ta.eColorFrameAction = %u", pce_rule.action.eColorFrameAction);
-
- if (pce_rule.action.eMeterAction) {
- printf("\n\ta.eMeterAction = %u", pce_rule.action.eMeterAction);
- printf("\n\ta.nMeterId = %u", pce_rule.action.nMeterId);
- }
-
- if (pce_rule.action.bFidEnable)
- printf("\n\ta.nFId = %u", pce_rule.action.nFId);
-
- if (pce_rule.pattern.bInsertionFlag_Enable)
- printf("\n\tp.nInsertionFlag = %u", pce_rule.pattern.nInsertionFlag);
-
- if (pce_rule.action.eCrossStateAction == GSW_PCE_ACTION_CROSS_STATE_CROSS)
- printf("\n\tp.eCrossStateAction = GSW_PCE_ACTION_CROSS_STATE_CROSS");
- else if (pce_rule.action.eCrossStateAction == GSW_PCE_ACTION_CROSS_STATE_REGULAR)
- printf("\n\tp.eCrossStateAction = GSW_PCE_ACTION_CROSS_STATE_REGULAR");
- else
- printf("\n\tp.eCrossStateAction = GSW_PCE_ACTION_CROSS_STATE_DISABLE");
-
- /*Applicable only for GSWIP 3.2*/
- if (pce_rule.pattern.bFlexibleField4Enable) {
- printf("\n\tp.bFlexibleField4_ExcludeEnable = %u", pce_rule.pattern.bFlexibleField4_ExcludeEnable);
- printf("\n\tp.bFlexibleField4_RangeEnable = %u", pce_rule.pattern.bFlexibleField4_RangeEnable);
- printf("\n\tp.nFlexibleField4_ParserIndex = %u", pce_rule.pattern.nFlexibleField4_ParserIndex);
- printf("\n\tp.nFlexibleField4_Value = %u", pce_rule.pattern.nFlexibleField4_Value);
- printf("\n\tp.nFlexibleField4_MaskOrRange = %u", pce_rule.pattern.nFlexibleField4_MaskOrRange);
- }
-
- if (pce_rule.pattern.bFlexibleField3Enable) {
- printf("\n\tp.bFlexibleField3_ExcludeEnable = %u", pce_rule.pattern.bFlexibleField3_ExcludeEnable);
- printf("\n\tp.bFlexibleField3_RangeEnable = %u", pce_rule.pattern.bFlexibleField3_RangeEnable);
- printf("\n\tp.nFlexibleField3_ParserIndex = %u", pce_rule.pattern.nFlexibleField3_ParserIndex);
- printf("\n\tp.nFlexibleField3_Value = %u", pce_rule.pattern.nFlexibleField3_Value);
- printf("\n\tp.nFlexibleField3_MaskOrRange = %u", pce_rule.pattern.nFlexibleField3_MaskOrRange);
- }
-
- if (pce_rule.pattern.bFlexibleField2Enable) {
- printf("\n\tp.bFlexibleField2_ExcludeEnable = %u", pce_rule.pattern.bFlexibleField2_ExcludeEnable);
- printf("\n\tp.bFlexibleField2_RangeEnable = %u", pce_rule.pattern.bFlexibleField2_RangeEnable);
- printf("\n\tp.nFlexibleField2_ParserIndex = %u", pce_rule.pattern.nFlexibleField2_ParserIndex);
- printf("\n\tp.nFlexibleField2_Value = %u", pce_rule.pattern.nFlexibleField2_Value);
- printf("\n\tp.nFlexibleField2_MaskOrRange = %u", pce_rule.pattern.nFlexibleField2_MaskOrRange);
- }
-
- if (pce_rule.pattern.bFlexibleField1Enable) {
- printf("\n\tp.bFlexibleField1_ExcludeEnable = %u", pce_rule.pattern.bFlexibleField1_ExcludeEnable);
- printf("\n\tp.bFlexibleField1_RangeEnable = %u", pce_rule.pattern.bFlexibleField1_RangeEnable);
- printf("\n\tp.nFlexibleField1_ParserIndex = %u", pce_rule.pattern.nFlexibleField1_ParserIndex);
- printf("\n\tp.nFlexibleField1_Value = %u", pce_rule.pattern.nFlexibleField1_Value);
- printf("\n\tp.nFlexibleField1_MaskOrRange = %u", pce_rule.pattern.nFlexibleField1_MaskOrRange);
- }
-
- if (pce_rule.action.sPBB_Action.bIheaderActionEnable) {
- printf("\n\ta.sPBB_Action.bIheaderActionEnable = %u", pce_rule.action.sPBB_Action.bIheaderActionEnable);
-
- switch (pce_rule.action.sPBB_Action.eIheaderOpMode) {
- case GSW_PCE_I_HEADER_OPERATION_INSERT :
- printf("\n\ta.sPBB_Action.eIheaderOpMode = GSW_PCE_I_HEADER_OPERATION_INSERT");
- printf("\n\ta.sPBB_Action.nTunnelIdKnownTraffic = %u", pce_rule.action.sPBB_Action.nTunnelIdKnownTraffic);
- printf("\n\ta.sPBB_Action.nTunnelIdUnKnownTraffic = %u", pce_rule.action.sPBB_Action.nTunnelIdUnKnownTraffic);
- printf("\n\ta.sPBB_Action.bB_DstMac_FromMacTableEnable = %u", pce_rule.action.sPBB_Action.bB_DstMac_FromMacTableEnable);
- break;
-
- case GSW_PCE_I_HEADER_OPERATION_REPLACE :
- printf("\n\ta.sPBB_Action.eIheaderOpMode = GSW_PCE_I_HEADER_OPERATION_REPLACE");
- printf("\n\ta.sPBB_Action.nTunnelIdKnownTraffic = %u", pce_rule.action.sPBB_Action.nTunnelIdKnownTraffic);
- printf("\n\ta.sPBB_Action.nTunnelIdUnKnownTraffic = %u", pce_rule.action.sPBB_Action.nTunnelIdUnKnownTraffic);
- printf("\n\ta.sPBB_Action.bReplace_B_SrcMacEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_SrcMacEnable);
- printf("\n\ta.sPBB_Action.bReplace_B_DstMacEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_DstMacEnable);
- printf("\n\ta.sPBB_Action.bReplace_I_TAG_ResEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_ResEnable);
- printf("\n\ta.sPBB_Action.bReplace_I_TAG_UacEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_UacEnable);
- printf("\n\ta.sPBB_Action.bReplace_I_TAG_DeiEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_DeiEnable);
- printf("\n\ta.sPBB_Action.bReplace_I_TAG_PcpEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_PcpEnable);
- printf("\n\ta.sPBB_Action.bReplace_I_TAG_SidEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_SidEnable);
- printf("\n\ta.sPBB_Action.bReplace_I_TAG_TpidEnable = %u", pce_rule.action.sPBB_Action.bReplace_I_TAG_TpidEnable);
- break;
-
- case GSW_PCE_I_HEADER_OPERATION_REMOVE :
- printf("\n\ta.sPBB_Action.eIheaderOpMode = GSW_PCE_I_HEADER_OPERATION_REMOVE");
- break;
-
- case GSW_PCE_I_HEADER_OPERATION_NOCHANGE :
- printf("\n\ta.sPBB_Action.eIheaderOpMode = GSW_PCE_I_HEADER_OPERATION_NOCHANGE");
- break;
-
- default:
- break;
- }
- }
-
- /*Applicable only for GSWIP 3.2*/
- if (pce_rule.action.sPBB_Action.bBtagActionEnable) {
- printf("\n\ta.sPBB_Action.bBtagActionEnable = %u", pce_rule.action.sPBB_Action.bBtagActionEnable);
-
- switch (pce_rule.action.sPBB_Action.eBtagOpMode) {
- case GSW_PCE_B_TAG_OPERATION_INSERT :
- printf("\n\ta.sPBB_Action.eBtagOpMode = GSW_PCE_B_TAG_OPERATION_INSERT");
- printf("\n\ta.sPBB_Action.nProcessIdKnownTraffic = %u", pce_rule.action.sPBB_Action.nProcessIdKnownTraffic);
- printf("\n\ta.sPBB_Action.nProcessIdUnKnownTraffic = %u", pce_rule.action.sPBB_Action.nProcessIdUnKnownTraffic);
- break;
-
- case GSW_PCE_B_TAG_OPERATION_REPLACE :
- printf("\n\ta.sPBB_Action.eBtagOpMode = GSW_PCE_B_TAG_OPERATION_REPLACE");
- printf("\n\ta.sPBB_Action.nProcessIdKnownTraffic = %u", pce_rule.action.sPBB_Action.nProcessIdKnownTraffic);
- printf("\n\ta.sPBB_Action.nProcessIdUnKnownTraffic = %u", pce_rule.action.sPBB_Action.nProcessIdUnKnownTraffic);
- printf("\n\ta.sPBB_Action.bReplace_B_TAG_DeiEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_TAG_DeiEnable);
- printf("\n\ta.sPBB_Action.bReplace_B_TAG_PcpEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_TAG_PcpEnable);
- printf("\n\ta.sPBB_Action.bReplace_B_TAG_VidEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_TAG_VidEnable);
- printf("\n\ta.sPBB_Action.bReplace_B_TAG_TpidEnable = %u", pce_rule.action.sPBB_Action.bReplace_B_TAG_TpidEnable);
- break;
-
- case GSW_PCE_B_TAG_OPERATION_REMOVE :
- printf("\n\ta.sPBB_Action.eBtagOpMode = GSW_PCE_B_TAG_OPERATION_REMOVE");
- break;
-
- case GSW_PCE_B_TAG_OPERATION_NOCHANGE :
- printf("\n\ta.sPBB_Action.eBtagOpMode = GSW_PCE_B_TAG_OPERATION_NOCHANGE");
- break;
-
- default:
- break;
- }
- }
-
- /*Applicable only for GSWIP 3.2*/
- if (pce_rule.action.sPBB_Action.bMacTableMacinMacActionEnable) {
- printf("\n\ta.sPBB_Action.bMacTableMacinMacActionEnable = %u", pce_rule.action.sPBB_Action.bMacTableMacinMacActionEnable);
-
- switch (pce_rule.action.sPBB_Action.eMacTableMacinMacSelect) {
- case GSW_PCE_OUTER_MAC_SELECTED :
- printf("\n\ta.sPBB_Action.eMacTableMacinMacSelect = GSW_PCE_OUTER_MAC_SELECTED");
- break;
-
- case GSW_PCE_INNER_MAC_SELECTED :
- printf("\n\ta.sPBB_Action.eMacTableMacinMacSelect = GSW_PCE_INNER_MAC_SELECTED");
- break;
-
- default:
- break;
- }
- }
-
- if (pce_rule.action.bDestSubIf_Action_Enable) {
- printf("\n\ta.sDestSubIF_Action.bDestSubIFIDActionEnable = %u", pce_rule.action.sDestSubIF_Action.bDestSubIFIDActionEnable);
- printf("\n\ta.sDestSubIF_Action.bDestSubIFIDAssignmentEnable = %u", pce_rule.action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable);
- printf("\n\ta.sDestSubIF_Action.nDestSubIFGrp_Field = %u", pce_rule.action.sDestSubIF_Action.nDestSubIFGrp_Field);
- }
- } else {
- printf("\n\tp.nIndex rule not set at = %u", pce_rule.pattern.nIndex);
- }
- printf("\n");
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_PceRuleWrite(int prmc, char *prmv[])
-{
- GSW_PCE_rule_t pce_rule = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
- scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
- scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.pattern.nIndex), &pce_rule.pattern.nIndex);
- scanParamArg(prmc, prmv, "pattern.bEnable", sizeof(pce_rule.pattern.bEnable), &pce_rule.pattern.bEnable);
- scanParamArg(prmc, prmv, "pattern.bPortIdEnable", sizeof(pce_rule.pattern.bPortIdEnable), &pce_rule.pattern.bPortIdEnable);
- scanParamArg(prmc, prmv, "pattern.nPortId", sizeof(pce_rule.pattern.nPortId), &pce_rule.pattern.nPortId);
- scanParamArg(prmc, prmv, "pattern.bPortId_Exclude", sizeof(pce_rule.pattern.bPortId_Exclude), &pce_rule.pattern.bPortId_Exclude);
- scanParamArg(prmc, prmv, "pattern.bSubIfIdEnable", sizeof(pce_rule.pattern.bSubIfIdEnable), &pce_rule.pattern.bSubIfIdEnable);
- scanParamArg(prmc, prmv, "pattern.nSubIfId", sizeof(pce_rule.pattern.nSubIfId), &pce_rule.pattern.nSubIfId);
- scanParamArg(prmc, prmv, "pattern.eSubIfIdType", sizeof(pce_rule.pattern.eSubIfIdType), &pce_rule.pattern.eSubIfIdType);
- scanParamArg(prmc, prmv, "pattern.bSubIfId_Exclude", sizeof(pce_rule.pattern.bSubIfId_Exclude), &pce_rule.pattern.bSubIfId_Exclude);
- scanParamArg(prmc, prmv, "pattern.bInsertionFlag_Enable", sizeof(pce_rule.pattern.bInsertionFlag_Enable), &pce_rule.pattern.bInsertionFlag_Enable);
- scanParamArg(prmc, prmv, "pattern.nInsertionFlag", sizeof(pce_rule.pattern.nInsertionFlag), &pce_rule.pattern.nInsertionFlag);
- scanParamArg(prmc, prmv, "pattern.bDSCP_Enable", sizeof(pce_rule.pattern.bDSCP_Enable), &pce_rule.pattern.bDSCP_Enable);
- scanParamArg(prmc, prmv, "pattern.nDSCP", sizeof(pce_rule.pattern.nDSCP), &pce_rule.pattern.nDSCP);
- scanParamArg(prmc, prmv, "pattern.bDSCP_Exclude", sizeof(pce_rule.pattern.bDSCP_Exclude), &pce_rule.pattern.bDSCP_Exclude);
- scanParamArg(prmc, prmv, "pattern.bInner_DSCP_Enable", sizeof(pce_rule.pattern.bInner_DSCP_Enable), &pce_rule.pattern.bInner_DSCP_Enable);
- scanParamArg(prmc, prmv, "pattern.nInnerDSCP", sizeof(pce_rule.pattern.nInnerDSCP), &pce_rule.pattern.nInnerDSCP);
- scanParamArg(prmc, prmv, "pattern.bInnerDSCP_Exclude", sizeof(pce_rule.pattern.bInnerDSCP_Exclude), &pce_rule.pattern.bInnerDSCP_Exclude);
- scanParamArg(prmc, prmv, "pattern.bPCP_Enable", sizeof(pce_rule.pattern.bPCP_Enable), &pce_rule.pattern.bPCP_Enable);
- scanParamArg(prmc, prmv, "pattern.nPCP", sizeof(pce_rule.pattern.nPCP), &pce_rule.pattern.nPCP);
- scanParamArg(prmc, prmv, "pattern.bCTAG_PCP_DEI_Exclude", sizeof(pce_rule.pattern.bCTAG_PCP_DEI_Exclude), &pce_rule.pattern.bCTAG_PCP_DEI_Exclude);
- scanParamArg(prmc, prmv, "pattern.bSTAG_PCP_DEI_Enable", sizeof(pce_rule.pattern.bSTAG_PCP_DEI_Enable), &pce_rule.pattern.bSTAG_PCP_DEI_Enable);
- scanParamArg(prmc, prmv, "pattern.nSTAG_PCP_DEI", sizeof(pce_rule.pattern.nSTAG_PCP_DEI), &pce_rule.pattern.nSTAG_PCP_DEI);
- scanParamArg(prmc, prmv, "pattern.bSTAG_PCP_DEI_Exclude", sizeof(pce_rule.pattern.bSTAG_PCP_DEI_Exclude), &pce_rule.pattern.bSTAG_PCP_DEI_Exclude);
- scanParamArg(prmc, prmv, "pattern.bPktLngEnable", sizeof(pce_rule.pattern.bPktLngEnable), &pce_rule.pattern.bPktLngEnable);
- scanParamArg(prmc, prmv, "pattern.nPktLng", sizeof(pce_rule.pattern.nPktLng), &pce_rule.pattern.nPktLng);
- scanParamArg(prmc, prmv, "pattern.nPktLngRange", sizeof(pce_rule.pattern.nPktLngRange), &pce_rule.pattern.nPktLngRange);
- scanParamArg(prmc, prmv, "pattern.bPktLng_Exclude", sizeof(pce_rule.pattern.bPktLng_Exclude), &pce_rule.pattern.bPktLng_Exclude);
- scanParamArg(prmc, prmv, "pattern.bMAC_DstEnable", sizeof(pce_rule.pattern.bMAC_DstEnable), &pce_rule.pattern.bMAC_DstEnable);
- scanMAC_Arg(prmc, prmv, "pattern.nMAC_Dst", pce_rule.pattern.nMAC_Dst);
- scanParamArg(prmc, prmv, "pattern.nMAC_DstMask", sizeof(pce_rule.pattern.nMAC_DstMask), &pce_rule.pattern.nMAC_DstMask);
- scanParamArg(prmc, prmv, "pattern.bDstMAC_Exclude", sizeof(pce_rule.pattern.bDstMAC_Exclude), &pce_rule.pattern.bDstMAC_Exclude);
- scanParamArg(prmc, prmv, "pattern.bMAC_SrcEnable", sizeof(pce_rule.pattern.bMAC_SrcEnable), &pce_rule.pattern.bMAC_SrcEnable);
- scanMAC_Arg(prmc, prmv, "pattern.nMAC_Src", pce_rule.pattern.nMAC_Src);
- scanParamArg(prmc, prmv, "pattern.nMAC_SrcMask", sizeof(pce_rule.pattern.nMAC_SrcMask), &pce_rule.pattern.nMAC_SrcMask);
- scanParamArg(prmc, prmv, "pattern.bSrcMAC_Exclude", sizeof(pce_rule.pattern.bSrcMAC_Exclude), &pce_rule.pattern.bSrcMAC_Exclude);
- scanParamArg(prmc, prmv, "pattern.bAppDataMSB_Enable", sizeof(pce_rule.pattern.bAppDataMSB_Enable), &pce_rule.pattern.bAppDataMSB_Enable);
- scanParamArg(prmc, prmv, "pattern.nAppDataMSB", sizeof(pce_rule.pattern.nAppDataMSB), &pce_rule.pattern.nAppDataMSB);
- scanParamArg(prmc, prmv, "pattern.bAppMaskRangeMSB_Select", sizeof(pce_rule.pattern.bAppMaskRangeMSB_Select), &pce_rule.pattern.bAppMaskRangeMSB_Select);
- scanParamArg(prmc, prmv, "pattern.nAppMaskRangeMSB", sizeof(pce_rule.pattern.nAppMaskRangeMSB), &pce_rule.pattern.nAppMaskRangeMSB);
- scanParamArg(prmc, prmv, "pattern.bAppMSB_Exclude", sizeof(pce_rule.pattern.bAppMSB_Exclude), &pce_rule.pattern.bAppMSB_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bAppDataLSB_Enable", sizeof(pce_rule.pattern.bAppDataLSB_Enable), &pce_rule.pattern.bAppDataLSB_Enable);
- scanParamArg(prmc, prmv, "pattern.nAppDataLSB", sizeof(pce_rule.pattern.nAppDataLSB), &pce_rule.pattern.nAppDataLSB);
- scanParamArg(prmc, prmv, "pattern.bAppMaskRangeLSB_Select", sizeof(pce_rule.pattern.bAppMaskRangeLSB_Select), &pce_rule.pattern.bAppMaskRangeLSB_Select);
- scanParamArg(prmc, prmv, "pattern.nAppMaskRangeLSB", sizeof(pce_rule.pattern.nAppMaskRangeLSB), &pce_rule.pattern.nAppMaskRangeLSB);
- scanParamArg(prmc, prmv, "pattern.bAppLSB_Exclude", sizeof(pce_rule.pattern.bAppLSB_Exclude), &pce_rule.pattern.bAppLSB_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.eDstIP_Select", sizeof(pce_rule.pattern.eDstIP_Select), &pce_rule.pattern.eDstIP_Select);
- if (pce_rule.pattern.eDstIP_Select == GSW_PCE_IP_V4)
- scanIPv4_Arg(prmc, prmv, "pattern.nDstIP", &pce_rule.pattern.nDstIP.nIPv4);
- else if (pce_rule.pattern.eDstIP_Select == GSW_PCE_IP_V6)
- scanIPv6_Arg(prmc, prmv, "pattern.nDstIP", pce_rule.pattern.nDstIP.nIPv6);
-
- scanParamArg(prmc, prmv, "pattern.nDstIP_Mask", sizeof(pce_rule.pattern.nDstIP_Mask), &pce_rule.pattern.nDstIP_Mask);
- scanParamArg(prmc, prmv, "pattern.bDstIP_Exclude", sizeof(pce_rule.pattern.bDstIP_Exclude), &pce_rule.pattern.bDstIP_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.eInnerDstIP_Select", sizeof(pce_rule.pattern.eInnerDstIP_Select), &pce_rule.pattern.eInnerDstIP_Select);
- if (pce_rule.pattern.eInnerDstIP_Select == GSW_PCE_IP_V4)
- scanIPv4_Arg(prmc, prmv, "pattern.nInnerDstIP", &pce_rule.pattern.nInnerDstIP.nIPv4);
- else if (pce_rule.pattern.eInnerDstIP_Select == GSW_PCE_IP_V6)
- scanIPv6_Arg(prmc, prmv, "pattern.nInnerDstIP", pce_rule.pattern.nInnerDstIP.nIPv6);
-
- scanParamArg(prmc, prmv, "pattern.nInnerDstIP_Mask", sizeof(pce_rule.pattern.nInnerDstIP_Mask), &pce_rule.pattern.nInnerDstIP_Mask);
- scanParamArg(prmc, prmv, "pattern.bInnerDstIP_Exclude", sizeof(pce_rule.pattern.bInnerDstIP_Exclude), &pce_rule.pattern.bInnerDstIP_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.eSrcIP_Select", sizeof(pce_rule.pattern.eSrcIP_Select), &pce_rule.pattern.eSrcIP_Select);
- if (pce_rule.pattern.eSrcIP_Select == GSW_PCE_IP_V4)
- scanIPv4_Arg(prmc, prmv, "pattern.nSrcIP", &pce_rule.pattern.nSrcIP.nIPv4);
- else if (pce_rule.pattern.eSrcIP_Select == GSW_PCE_IP_V6)
- scanIPv6_Arg(prmc, prmv, "pattern.nSrcIP", pce_rule.pattern.nSrcIP.nIPv6);
-
- scanParamArg(prmc, prmv, "pattern.nSrcIP_Mask", sizeof(pce_rule.pattern.nSrcIP_Mask), &pce_rule.pattern.nSrcIP_Mask);
- scanParamArg(prmc, prmv, "pattern.bSrcIP_Exclude", sizeof(pce_rule.pattern.bSrcIP_Exclude), &pce_rule.pattern.bSrcIP_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.eInnerSrcIP_Select", sizeof(pce_rule.pattern.eInnerSrcIP_Select), &pce_rule.pattern.eInnerSrcIP_Select);
- if (pce_rule.pattern.eInnerSrcIP_Select == GSW_PCE_IP_V4)
- scanIPv4_Arg(prmc, prmv, "pattern.nInnerSrcIP", &pce_rule.pattern.nInnerSrcIP.nIPv4);
- else if (pce_rule.pattern.eInnerSrcIP_Select == GSW_PCE_IP_V6)
- scanIPv6_Arg(prmc, prmv, "pattern.nInnerSrcIP", pce_rule.pattern.nInnerSrcIP.nIPv6);
-
- scanParamArg(prmc, prmv, "pattern.nInnerSrcIP_Mask", sizeof(pce_rule.pattern.nInnerSrcIP_Mask), &pce_rule.pattern.nInnerSrcIP_Mask);
- scanParamArg(prmc, prmv, "pattern.bInnerSrcIP_Exclude", sizeof(pce_rule.pattern.bInnerSrcIP_Exclude), &pce_rule.pattern.bInnerSrcIP_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bEtherTypeEnable", sizeof(pce_rule.pattern.bEtherTypeEnable), &pce_rule.pattern.bEtherTypeEnable);
- scanParamArg(prmc, prmv, "pattern.nEtherType", sizeof(pce_rule.pattern.nEtherType), &pce_rule.pattern.nEtherType);
- scanParamArg(prmc, prmv, "pattern.nEtherTypeMask", sizeof(pce_rule.pattern.nEtherTypeMask), &pce_rule.pattern.nEtherTypeMask);
- scanParamArg(prmc, prmv, "pattern.bEtherType_Exclude", sizeof(pce_rule.pattern.bEtherType_Exclude), &pce_rule.pattern.bEtherType_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bProtocolEnable", sizeof(pce_rule.pattern.bProtocolEnable), &pce_rule.pattern.bProtocolEnable);
- scanParamArg(prmc, prmv, "pattern.nProtocol", sizeof(pce_rule.pattern.nProtocol), &pce_rule.pattern.nProtocol);
- scanParamArg(prmc, prmv, "pattern.nProtocolMask", sizeof(pce_rule.pattern.nProtocolMask), &pce_rule.pattern.nProtocolMask);
- scanParamArg(prmc, prmv, "pattern.bProtocol_Exclude", sizeof(pce_rule.pattern.bProtocol_Exclude), &pce_rule.pattern.bProtocol_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bInnerProtocolEnable", sizeof(pce_rule.pattern.bInnerProtocolEnable), &pce_rule.pattern.bInnerProtocolEnable);
- scanParamArg(prmc, prmv, "pattern.nInnerProtocol", sizeof(pce_rule.pattern.nInnerProtocol), &pce_rule.pattern.nInnerProtocol);
- scanParamArg(prmc, prmv, "pattern.nInnerProtocolMask", sizeof(pce_rule.pattern.nInnerProtocolMask), &pce_rule.pattern.nInnerProtocolMask);
- scanParamArg(prmc, prmv, "pattern.bInnerProtocol_Exclude", sizeof(pce_rule.pattern.bInnerProtocol_Exclude), &pce_rule.pattern.bInnerProtocol_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bSessionIdEnable", sizeof(pce_rule.pattern.bSessionIdEnable), &pce_rule.pattern.bSessionIdEnable);
- scanParamArg(prmc, prmv, "pattern.nSessionId", sizeof(pce_rule.pattern.nSessionId), &pce_rule.pattern.nSessionId);
- scanParamArg(prmc, prmv, "pattern.bSessionId_Exclude", sizeof(pce_rule.pattern.bSessionId_Exclude), &pce_rule.pattern.bSessionId_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bPPP_ProtocolEnable", sizeof(pce_rule.pattern.bPPP_ProtocolEnable), &pce_rule.pattern.bPPP_ProtocolEnable);
- scanParamArg(prmc, prmv, "pattern.nPPP_Protocol", sizeof(pce_rule.pattern.nPPP_Protocol), &pce_rule.pattern.nPPP_Protocol);
- scanParamArg(prmc, prmv, "pattern.nPPP_ProtocolMask", sizeof(pce_rule.pattern.nPPP_ProtocolMask), &pce_rule.pattern.nPPP_ProtocolMask);
- scanParamArg(prmc, prmv, "pattern.bPPP_Protocol_Exclude", sizeof(pce_rule.pattern.bPPP_Protocol_Exclude), &pce_rule.pattern.bPPP_Protocol_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bVid", sizeof(pce_rule.pattern.bVid), &pce_rule.pattern.bVid);
- scanParamArg(prmc, prmv, "pattern.nVid", sizeof(pce_rule.pattern.nVid), &pce_rule.pattern.nVid);
- scanParamArg(prmc, prmv, "pattern.bVidRange_Select", sizeof(pce_rule.pattern.bVidRange_Select), &pce_rule.pattern.bVidRange_Select);
- scanParamArg(prmc, prmv, "pattern.nVidRange", sizeof(pce_rule.pattern.nVidRange), &pce_rule.pattern.nVidRange);
- scanParamArg(prmc, prmv, "pattern.bVid_Exclude", sizeof(pce_rule.pattern.bVid_Exclude), &pce_rule.pattern.bVid_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bSLAN_Vid", sizeof(pce_rule.pattern.bSLAN_Vid), &pce_rule.pattern.bSLAN_Vid);
- scanParamArg(prmc, prmv, "pattern.nSLAN_Vid", sizeof(pce_rule.pattern.nSLAN_Vid), &pce_rule.pattern.nSLAN_Vid);
- scanParamArg(prmc, prmv, "pattern.bSLANVid_Exclude", sizeof(pce_rule.pattern.bSLANVid_Exclude), &pce_rule.pattern.bSLANVid_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bPayload1_SrcEnable", sizeof(pce_rule.pattern.bPayload1_SrcEnable), &pce_rule.pattern.bPayload1_SrcEnable);
- scanParamArg(prmc, prmv, "pattern.nPayload1", sizeof(pce_rule.pattern.nPayload1), &pce_rule.pattern.nPayload1);
- scanParamArg(prmc, prmv, "pattern.bPayload1MaskRange_Select", sizeof(pce_rule.pattern.bPayload1MaskRange_Select), &pce_rule.pattern.bPayload1MaskRange_Select);
- scanParamArg(prmc, prmv, "pattern.nPayload1_Mask", sizeof(pce_rule.pattern.nPayload1_Mask), &pce_rule.pattern.nPayload1_Mask);
- scanParamArg(prmc, prmv, "pattern.bPayload1_Exclude", sizeof(pce_rule.pattern.bPayload1_Exclude), &pce_rule.pattern.bPayload1_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bPayload2_SrcEnable", sizeof(pce_rule.pattern.bPayload2_SrcEnable), &pce_rule.pattern.bPayload2_SrcEnable);
- scanParamArg(prmc, prmv, "pattern.nPayload2", sizeof(pce_rule.pattern.nPayload2), &pce_rule.pattern.nPayload2);
- scanParamArg(prmc, prmv, "pattern.bPayload2MaskRange_Select", sizeof(pce_rule.pattern.bPayload2MaskRange_Select), &pce_rule.pattern.bPayload2MaskRange_Select);
- scanParamArg(prmc, prmv, "pattern.nPayload2_Mask", sizeof(pce_rule.pattern.nPayload2_Mask), &pce_rule.pattern.nPayload2_Mask);
- scanParamArg(prmc, prmv, "pattern.bPayload2_Exclude", sizeof(pce_rule.pattern.bPayload2_Exclude), &pce_rule.pattern.bPayload2_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bParserFlagLSB_Enable", sizeof(pce_rule.pattern.bParserFlagLSB_Enable), &pce_rule.pattern.bParserFlagLSB_Enable);
- scanParamArg(prmc, prmv, "pattern.nParserFlagLSB", sizeof(pce_rule.pattern.nParserFlagLSB), &pce_rule.pattern.nParserFlagLSB);
- scanParamArg(prmc, prmv, "pattern.nParserFlagLSB_Mask", sizeof(pce_rule.pattern.nParserFlagLSB_Mask), &pce_rule.pattern.nParserFlagLSB_Mask);
- scanParamArg(prmc, prmv, "pattern.bParserFlagLSB_Exclude", sizeof(pce_rule.pattern.bParserFlagLSB_Exclude), &pce_rule.pattern.bParserFlagLSB_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bParserFlagMSB_Enable", sizeof(pce_rule.pattern.bParserFlagMSB_Enable), &pce_rule.pattern.bParserFlagMSB_Enable);
- scanParamArg(prmc, prmv, "pattern.nParserFlagMSB", sizeof(pce_rule.pattern.nParserFlagMSB), &pce_rule.pattern.nParserFlagMSB);
- scanParamArg(prmc, prmv, "pattern.nParserFlagMSB_Mask", sizeof(pce_rule.pattern.nParserFlagMSB_Mask), &pce_rule.pattern.nParserFlagMSB_Mask);
- scanParamArg(prmc, prmv, "pattern.bParserFlagMSB_Exclude", sizeof(pce_rule.pattern.bParserFlagMSB_Exclude), &pce_rule.pattern.bParserFlagMSB_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bParserFlag1LSB_Enable", sizeof(pce_rule.pattern.bParserFlag1LSB_Enable), &pce_rule.pattern.bParserFlag1LSB_Enable);
- scanParamArg(prmc, prmv, "pattern.nParserFlag1LSB", sizeof(pce_rule.pattern.nParserFlag1LSB), &pce_rule.pattern.nParserFlag1LSB);
- scanParamArg(prmc, prmv, "pattern.nParserFlag1LSB_Mask", sizeof(pce_rule.pattern.nParserFlag1LSB_Mask), &pce_rule.pattern.nParserFlag1LSB_Mask);
- scanParamArg(prmc, prmv, "pattern.bParserFlag1LSB_Exclude", sizeof(pce_rule.pattern.bParserFlag1LSB_Exclude), &pce_rule.pattern.bParserFlag1LSB_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bParserFlag1MSB_Enable", sizeof(pce_rule.pattern.bParserFlag1MSB_Enable), &pce_rule.pattern.bParserFlag1MSB_Enable);
- scanParamArg(prmc, prmv, "pattern.nParserFlag1MSB", sizeof(pce_rule.pattern.nParserFlag1MSB), &pce_rule.pattern.nParserFlag1MSB);
- scanParamArg(prmc, prmv, "pattern.nParserFlag1MSB_Mask", sizeof(pce_rule.pattern.nParserFlag1MSB_Mask), &pce_rule.pattern.nParserFlag1MSB_Mask);
- scanParamArg(prmc, prmv, "pattern.bParserFlag1MSB_Exclude", sizeof(pce_rule.pattern.bParserFlag1MSB_Exclude), &pce_rule.pattern.bParserFlag1MSB_Exclude);
-
- scanParamArg(prmc, prmv, "pattern.bVid_Original", sizeof(pce_rule.pattern.bVid_Original), &pce_rule.pattern.bVid_Original);
- scanParamArg(prmc, prmv, "pattern.nOuterVidRange", sizeof(pce_rule.pattern.nOuterVidRange), &pce_rule.pattern.nOuterVidRange);
- scanParamArg(prmc, prmv, "pattern.bSVidRange_Select", sizeof(pce_rule.pattern.bSVidRange_Select), &pce_rule.pattern.bSVidRange_Select);
- scanParamArg(prmc, prmv, "pattern.bOuterVid_Original", sizeof(pce_rule.pattern.bOuterVid_Original), &pce_rule.pattern.bOuterVid_Original);
-
- scanParamArg(prmc, prmv, "action.eTrafficClassAction", sizeof(pce_rule.action.eTrafficClassAction), &pce_rule.action.eTrafficClassAction);
- scanParamArg(prmc, prmv, "action.nTrafficClassAlternate", sizeof(pce_rule.action.nTrafficClassAlternate), &pce_rule.action.nTrafficClassAlternate);
- scanParamArg(prmc, prmv, "action.eSnoopingTypeAction", sizeof(pce_rule.action.eSnoopingTypeAction), &pce_rule.action.eSnoopingTypeAction);
- scanParamArg(prmc, prmv, "action.eLearningAction", sizeof(pce_rule.action.eLearningAction), &pce_rule.action.eLearningAction);
- scanParamArg(prmc, prmv, "action.eIrqAction", sizeof(pce_rule.action.eIrqAction), &pce_rule.action.eIrqAction);
- scanParamArg(prmc, prmv, "action.eCrossStateAction", sizeof(pce_rule.action.eCrossStateAction), &pce_rule.action.eCrossStateAction);
- scanParamArg(prmc, prmv, "action.eCritFrameAction", sizeof(pce_rule.action.eCritFrameAction), &pce_rule.action.eCritFrameAction);
- scanParamArg(prmc, prmv, "action.eTimestampAction", sizeof(pce_rule.action.eTimestampAction), &pce_rule.action.eTimestampAction);
- scanParamArg(prmc, prmv, "action.ePortMapAction", sizeof(pce_rule.action.ePortMapAction), &pce_rule.action.ePortMapAction);
- scanParamArg(prmc, prmv, "action.nForwardPortMap", sizeof(pce_rule.action.nForwardPortMap[0]), &pce_rule.action.nForwardPortMap[0]);
- scanParamArg(prmc, prmv, "action.nForwardPortMap[1]", sizeof(pce_rule.action.nForwardPortMap[1]), &pce_rule.action.nForwardPortMap[1]);
- scanParamArg(prmc, prmv, "action.nForwardPortMap[2]", sizeof(pce_rule.action.nForwardPortMap[2]), &pce_rule.action.nForwardPortMap[2]);
- scanParamArg(prmc, prmv, "action.nForwardPortMap[3]", sizeof(pce_rule.action.nForwardPortMap[3]), &pce_rule.action.nForwardPortMap[3]);
- scanParamArg(prmc, prmv, "action.nForwardPortMap[4]", sizeof(pce_rule.action.nForwardPortMap[4]), &pce_rule.action.nForwardPortMap[4]);
- scanParamArg(prmc, prmv, "action.nForwardPortMap[5]", sizeof(pce_rule.action.nForwardPortMap[5]), &pce_rule.action.nForwardPortMap[5]);
- scanParamArg(prmc, prmv, "action.nForwardPortMap[6]", sizeof(pce_rule.action.nForwardPortMap[6]), &pce_rule.action.nForwardPortMap[6]);
- scanParamArg(prmc, prmv, "action.nForwardPortMap[7]", sizeof(pce_rule.action.nForwardPortMap[7]), &pce_rule.action.nForwardPortMap[7]);
- scanParamArg(prmc, prmv, "action.bRemarkAction", sizeof(pce_rule.action.bRemarkAction), &pce_rule.action.bRemarkAction);
- scanParamArg(prmc, prmv, "action.bRemarkPCP", sizeof(pce_rule.action.bRemarkAction), &pce_rule.action.bRemarkPCP);
- scanParamArg(prmc, prmv, "action.bRemarkSTAG_PCP", sizeof(pce_rule.action.bRemarkSTAG_PCP), &pce_rule.action.bRemarkSTAG_PCP);
- scanParamArg(prmc, prmv, "action.bRemarkSTAG_DEI", sizeof(pce_rule.action.bRemarkSTAG_DEI), &pce_rule.action.bRemarkSTAG_DEI);
- scanParamArg(prmc, prmv, "action.bRemarkDSCP", sizeof(pce_rule.action.bRemarkDSCP), &pce_rule.action.bRemarkDSCP);
- scanParamArg(prmc, prmv, "action.bRemarkClass", sizeof(pce_rule.action.bRemarkClass), &pce_rule.action.bRemarkClass);
- scanParamArg(prmc, prmv, "action.eMeterAction", sizeof(pce_rule.action.eMeterAction), &pce_rule.action.eMeterAction);
- scanParamArg(prmc, prmv, "action.nMeterId", sizeof(pce_rule.action.nMeterId), &pce_rule.action.nMeterId);
- scanParamArg(prmc, prmv, "action.bRMON_Action", sizeof(pce_rule.action.bRMON_Action), &pce_rule.action.bRMON_Action);
- scanParamArg(prmc, prmv, "action.nRMON_Id", sizeof(pce_rule.action.nRMON_Id), &pce_rule.action.nRMON_Id);
- scanParamArg(prmc, prmv, "action.eVLAN_Action", sizeof(pce_rule.action.eVLAN_Action), &pce_rule.action.eVLAN_Action);
- scanParamArg(prmc, prmv, "action.nVLAN_Id", sizeof(pce_rule.action.nVLAN_Id), &pce_rule.action.nVLAN_Id);
- scanParamArg(prmc, prmv, "action.nFId", sizeof(pce_rule.action.nFId), &pce_rule.action.nFId);
- scanParamArg(prmc, prmv, "action.bFidEnable", sizeof(pce_rule.action.bFidEnable), &pce_rule.action.bFidEnable);
-
- scanParamArg(prmc, prmv, "action.eSVLAN_Action", sizeof(pce_rule.action.eSVLAN_Action), &pce_rule.action.eSVLAN_Action);
- scanParamArg(prmc, prmv, "action.nSVLAN_Id", sizeof(pce_rule.action.nSVLAN_Id), &pce_rule.action.nSVLAN_Id);
- scanParamArg(prmc, prmv, "action.eVLAN_CrossAction", sizeof(pce_rule.action.eVLAN_CrossAction), &pce_rule.action.eVLAN_CrossAction);
- scanParamArg(prmc, prmv, "action.bPortBitMapMuxControl", sizeof(pce_rule.action.bPortBitMapMuxControl), &pce_rule.action.bPortBitMapMuxControl);
- scanParamArg(prmc, prmv, "action.bCVLAN_Ignore_Control", sizeof(pce_rule.action.bCVLAN_Ignore_Control), &pce_rule.action.bCVLAN_Ignore_Control);
- scanParamArg(prmc, prmv, "action.bPortLinkSelection", sizeof(pce_rule.action.bPortLinkSelection), &pce_rule.action.bPortLinkSelection);
- scanParamArg(prmc, prmv, "action.bPortTrunkAction", sizeof(pce_rule.action.bPortTrunkAction), &pce_rule.action.bPortTrunkAction);
-
- scanParamArg(prmc, prmv, "action.bFlowID_Action", sizeof(pce_rule.action.bFlowID_Action), &pce_rule.action.bFlowID_Action);
- scanParamArg(prmc, prmv, "action.nFlowID", sizeof(pce_rule.action.nFlowID), &pce_rule.action.nFlowID);
-
- scanParamArg(prmc, prmv, "action.bRoutExtId_Action", sizeof(pce_rule.action.bRoutExtId_Action), &pce_rule.action.bRoutExtId_Action);
- scanParamArg(prmc, prmv, "action.nRoutExtId", sizeof(pce_rule.action.nRoutExtId), &pce_rule.action.nRoutExtId);
-
- scanParamArg(prmc, prmv, "action.bRtDstPortMaskCmp_Action", sizeof(pce_rule.action.bRtDstPortMaskCmp_Action), &pce_rule.action.bRtDstPortMaskCmp_Action);
- scanParamArg(prmc, prmv, "action.bRtSrcPortMaskCmp_Action", sizeof(pce_rule.action.bRtSrcPortMaskCmp_Action), &pce_rule.action.bRtSrcPortMaskCmp_Action);
- scanParamArg(prmc, prmv, "action.bRtDstIpMaskCmp_Action", sizeof(pce_rule.action.bRtDstIpMaskCmp_Action), &pce_rule.action.bRtDstIpMaskCmp_Action);
- scanParamArg(prmc, prmv, "action.bRtSrcIpMaskCmp_Action", sizeof(pce_rule.action.bRtSrcIpMaskCmp_Action), &pce_rule.action.bRtSrcIpMaskCmp_Action);
- scanParamArg(prmc, prmv, "action.bRtInnerIPasKey_Action", sizeof(pce_rule.action.bRtInnerIPasKey_Action), &pce_rule.action.bRtInnerIPasKey_Action);
-
- scanParamArg(prmc, prmv, "action.bRtAccelEna_Action", sizeof(pce_rule.action.bRtAccelEna_Action), &pce_rule.action.bRtAccelEna_Action);
- scanParamArg(prmc, prmv, "action.bRtCtrlEna_Action", sizeof(pce_rule.action.bRtCtrlEna_Action), &pce_rule.action.bRtCtrlEna_Action);
- scanParamArg(prmc, prmv, "action.eProcessPath_Action", sizeof(pce_rule.action.eProcessPath_Action), &pce_rule.action.eProcessPath_Action);
- scanParamArg(prmc, prmv, "action.ePortFilterType_Action", sizeof(pce_rule.action.ePortFilterType_Action), &pce_rule.action.ePortFilterType_Action);
-
- scanParamArg(prmc, prmv, "action.bOamEnable", sizeof(pce_rule.action.bOamEnable), &pce_rule.action.bOamEnable);
- scanParamArg(prmc, prmv, "action.nRecordId", sizeof(pce_rule.action.nRecordId), &pce_rule.action.nRecordId);
- scanParamArg(prmc, prmv, "action.bExtractEnable", sizeof(pce_rule.action.bExtractEnable), &pce_rule.action.bExtractEnable);
- scanParamArg(prmc, prmv, "action.eColorFrameAction", sizeof(pce_rule.action.eColorFrameAction), &pce_rule.action.eColorFrameAction);
- scanParamArg(prmc, prmv, "action.bExtendedVlanEnable", sizeof(pce_rule.action.bExtendedVlanEnable), &pce_rule.action.bExtendedVlanEnable);
- scanParamArg(prmc, prmv, "action.nExtendedVlanBlockId", sizeof(pce_rule.action.nExtendedVlanBlockId), &pce_rule.action.nExtendedVlanBlockId);
-
- /*Aplicable for GSWIP 3.2*/
- scanParamArg(prmc, prmv, "pattern.bFlexibleField4Enable",
- sizeof(pce_rule.pattern.bFlexibleField4Enable), &pce_rule.pattern.bFlexibleField4Enable);
- scanParamArg(prmc, prmv, "pattern.bFlexibleField4_ExcludeEnable",
- sizeof(pce_rule.pattern.bFlexibleField4_ExcludeEnable), &pce_rule.pattern.bFlexibleField4_ExcludeEnable);
- scanParamArg(prmc, prmv, "pattern.bFlexibleField4_RangeEnable",
- sizeof(pce_rule.pattern.bFlexibleField4_RangeEnable), &pce_rule.pattern.bFlexibleField4_RangeEnable);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField4_ParserIndex",
- sizeof(pce_rule.pattern.nFlexibleField4_ParserIndex), &pce_rule.pattern.nFlexibleField4_ParserIndex);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField4_Value",
- sizeof(pce_rule.pattern.nFlexibleField4_Value), &pce_rule.pattern.nFlexibleField4_Value);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField4_MaskOrRange",
- sizeof(pce_rule.pattern.nFlexibleField4_MaskOrRange), &pce_rule.pattern.nFlexibleField4_MaskOrRange);
-
- scanParamArg(prmc, prmv, "pattern.bFlexibleField3Enable",
- sizeof(pce_rule.pattern.bFlexibleField3Enable), &pce_rule.pattern.bFlexibleField3Enable);
- scanParamArg(prmc, prmv, "pattern.bFlexibleField3_ExcludeEnable",
- sizeof(pce_rule.pattern.bFlexibleField3_ExcludeEnable), &pce_rule.pattern.bFlexibleField3_ExcludeEnable);
- scanParamArg(prmc, prmv, "pattern.bFlexibleField3_RangeEnable",
- sizeof(pce_rule.pattern.bFlexibleField3_RangeEnable), &pce_rule.pattern.bFlexibleField3_RangeEnable);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField3_ParserIndex",
- sizeof(pce_rule.pattern.nFlexibleField3_ParserIndex), &pce_rule.pattern.nFlexibleField3_ParserIndex);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField3_Value",
- sizeof(pce_rule.pattern.nFlexibleField3_Value), &pce_rule.pattern.nFlexibleField3_Value);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField3_MaskOrRange",
- sizeof(pce_rule.pattern.nFlexibleField3_MaskOrRange), &pce_rule.pattern.nFlexibleField3_MaskOrRange);
-
- scanParamArg(prmc, prmv, "pattern.bFlexibleField2Enable",
- sizeof(pce_rule.pattern.bFlexibleField2Enable), &pce_rule.pattern.bFlexibleField2Enable);
- scanParamArg(prmc, prmv, "pattern.bFlexibleField2_ExcludeEnable",
- sizeof(pce_rule.pattern.bFlexibleField2_ExcludeEnable), &pce_rule.pattern.bFlexibleField2_ExcludeEnable);
- scanParamArg(prmc, prmv, "pattern.bFlexibleField2_RangeEnable",
- sizeof(pce_rule.pattern.bFlexibleField2_RangeEnable), &pce_rule.pattern.bFlexibleField2_RangeEnable);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField2_ParserIndex",
- sizeof(pce_rule.pattern.nFlexibleField2_ParserIndex), &pce_rule.pattern.nFlexibleField2_ParserIndex);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField2_Value",
- sizeof(pce_rule.pattern.nFlexibleField2_Value), &pce_rule.pattern.nFlexibleField2_Value);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField2_MaskOrRange",
- sizeof(pce_rule.pattern.nFlexibleField2_MaskOrRange), &pce_rule.pattern.nFlexibleField2_MaskOrRange);
-
- scanParamArg(prmc, prmv, "pattern.bFlexibleField1Enable",
- sizeof(pce_rule.pattern.bFlexibleField1Enable), &pce_rule.pattern.bFlexibleField1Enable);
- scanParamArg(prmc, prmv, "pattern.bFlexibleField1_ExcludeEnable",
- sizeof(pce_rule.pattern.bFlexibleField1_ExcludeEnable), &pce_rule.pattern.bFlexibleField1_ExcludeEnable);
- scanParamArg(prmc, prmv, "pattern.bFlexibleField1_RangeEnable",
- sizeof(pce_rule.pattern.bFlexibleField1_RangeEnable), &pce_rule.pattern.bFlexibleField1_RangeEnable);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField1_ParserIndex",
- sizeof(pce_rule.pattern.nFlexibleField1_ParserIndex), &pce_rule.pattern.nFlexibleField1_ParserIndex);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField1_Value",
- sizeof(pce_rule.pattern.nFlexibleField1_Value), &pce_rule.pattern.nFlexibleField1_Value);
- scanParamArg(prmc, prmv, "pattern.nFlexibleField1_MaskOrRange",
- sizeof(pce_rule.pattern.nFlexibleField1_MaskOrRange), &pce_rule.pattern.nFlexibleField1_MaskOrRange);
-
- scanParamArg(prmc, prmv, "action.bPBB_Action_Enable", sizeof(pce_rule.action.bPBB_Action_Enable), &pce_rule.action.bPBB_Action_Enable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bIheaderActionEnable",
- sizeof(pce_rule.action.sPBB_Action.bIheaderActionEnable), &pce_rule.action.sPBB_Action.bIheaderActionEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.eIheaderOpMode",
- sizeof(pce_rule.action.sPBB_Action.eIheaderOpMode), &pce_rule.action.sPBB_Action.eIheaderOpMode);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bTunnelIdKnownTrafficEnable",
- sizeof(pce_rule.action.sPBB_Action.bTunnelIdKnownTrafficEnable), &pce_rule.action.sPBB_Action.bTunnelIdKnownTrafficEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.nTunnelIdKnownTraffic",
- sizeof(pce_rule.action.sPBB_Action.nTunnelIdKnownTraffic), &pce_rule.action.sPBB_Action.nTunnelIdKnownTraffic);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bTunnelIdUnKnownTrafficEnable",
- sizeof(pce_rule.action.sPBB_Action.bTunnelIdUnKnownTrafficEnable), &pce_rule.action.sPBB_Action.bTunnelIdUnKnownTrafficEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.nTunnelIdUnKnownTraffic",
- sizeof(pce_rule.action.sPBB_Action.nTunnelIdUnKnownTraffic), &pce_rule.action.sPBB_Action.nTunnelIdUnKnownTraffic);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bB_DstMac_FromMacTableEnable",
- sizeof(pce_rule.action.sPBB_Action.bB_DstMac_FromMacTableEnable), &pce_rule.action.sPBB_Action.bB_DstMac_FromMacTableEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_SrcMacEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_B_SrcMacEnable), &pce_rule.action.sPBB_Action.bReplace_B_SrcMacEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_DstMacEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_B_DstMacEnable), &pce_rule.action.sPBB_Action.bReplace_B_DstMacEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_ResEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_ResEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_ResEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_UacEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_UacEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_UacEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_DeiEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_DeiEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_DeiEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_PcpEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_PcpEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_PcpEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_SidEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_SidEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_SidEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_I_TAG_TpidEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_I_TAG_TpidEnable), &pce_rule.action.sPBB_Action.bReplace_I_TAG_TpidEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bBtagActionEnable",
- sizeof(pce_rule.action.sPBB_Action.bBtagActionEnable), &pce_rule.action.sPBB_Action.bBtagActionEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.eBtagOpMode",
- sizeof(pce_rule.action.sPBB_Action.eBtagOpMode), &pce_rule.action.sPBB_Action.eBtagOpMode);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bProcessIdKnownTrafficEnable",
- sizeof(pce_rule.action.sPBB_Action.bProcessIdKnownTrafficEnable), &pce_rule.action.sPBB_Action.bProcessIdKnownTrafficEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.nProcessIdKnownTraffic",
- sizeof(pce_rule.action.sPBB_Action.nProcessIdKnownTraffic), &pce_rule.action.sPBB_Action.nProcessIdKnownTraffic);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bProcessIdUnKnownTrafficEnable",
- sizeof(pce_rule.action.sPBB_Action.bProcessIdUnKnownTrafficEnable), &pce_rule.action.sPBB_Action.bProcessIdUnKnownTrafficEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.nProcessIdUnKnownTraffic",
- sizeof(pce_rule.action.sPBB_Action.nProcessIdUnKnownTraffic), &pce_rule.action.sPBB_Action.nProcessIdUnKnownTraffic);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_TAG_DeiEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_B_TAG_DeiEnable), &pce_rule.action.sPBB_Action.bReplace_B_TAG_DeiEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_TAG_PcpEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_B_TAG_PcpEnable), &pce_rule.action.sPBB_Action.bReplace_B_TAG_PcpEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_TAG_VidEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_B_TAG_VidEnable), &pce_rule.action.sPBB_Action.bReplace_B_TAG_VidEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.bReplace_B_TAG_TpidEnable",
- sizeof(pce_rule.action.sPBB_Action.bReplace_B_TAG_TpidEnable), &pce_rule.action.sPBB_Action.bReplace_B_TAG_TpidEnable);
-
- scanParamArg(prmc, prmv, "action.sPBB_Action.bMacTableMacinMacActionEnable",
- sizeof(pce_rule.action.sPBB_Action.bMacTableMacinMacActionEnable), &pce_rule.action.sPBB_Action.bMacTableMacinMacActionEnable);
- scanParamArg(prmc, prmv, "action.sPBB_Action.eMacTableMacinMacSelect",
- sizeof(pce_rule.action.sPBB_Action.eMacTableMacinMacSelect), &pce_rule.action.sPBB_Action.eMacTableMacinMacSelect);
-
- scanParamArg(prmc, prmv, "action.bDestSubIf_Action_Enable",
- sizeof(pce_rule.action.bDestSubIf_Action_Enable), &pce_rule.action.bDestSubIf_Action_Enable);
- scanParamArg(prmc, prmv, "action.sDestSubIF_Action.bDestSubIFIDActionEnable",
- sizeof(pce_rule.action.sDestSubIF_Action.bDestSubIFIDActionEnable), &pce_rule.action.sDestSubIF_Action.bDestSubIFIDActionEnable);
- scanParamArg(prmc, prmv, "action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable",
- sizeof(pce_rule.action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable), &pce_rule.action.sDestSubIF_Action.bDestSubIFIDAssignmentEnable);
- scanParamArg(prmc, prmv, "action.sDestSubIF_Action.nDestSubIFGrp_Field",
- sizeof(pce_rule.action.sDestSubIF_Action.nDestSubIFGrp_Field), &pce_rule.action.sDestSubIF_Action.nDestSubIFGrp_Field);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PceRuleWrite(gsw_dev, &pce_rule);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleWrite failed with ret code", ret);
- else{
- printf("fapi_GSW_PceRuleWrite done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PceRuleDelete(int prmc, char *prmv[])
-{
- GSW_PCE_ruleEntry_t pce_rule;
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- memset(&pce_rule, 0, sizeof(GSW_PCE_ruleEntry_t));
-
- scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.nIndex), &pce_rule.nIndex);
- scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
- scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PceRuleDelete(gsw_dev, &pce_rule);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleDelete failed with ret code", ret);
- else{
- printf("fapi_GSW_PceRuleDelete done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PceRuleAlloc(int prmc, char *prmv[])
-{
- GSW_PCE_rule_alloc_t alloc = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "num_of_rules", sizeof(alloc.num_of_rules), &alloc.num_of_rules);
- if (rret < 1){
- printf("Parameter not Found: num_of_rules\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PceRuleAlloc(gsw_dev, &alloc);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleAlloc failed with ret code", ret);
- else{
- printf("\n\tret = %d", ret);
- printf("\n\tblockid = %u", alloc.blockid);
- printf("\n\tnum_of_rules = %u", alloc.num_of_rules);
- printf("\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PceRuleFree(int prmc, char *prmv[])
-{
- GSW_PCE_rule_alloc_t alloc = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "blockid", sizeof(alloc.num_of_rules), &alloc.blockid);
- if (rret < 1){
- printf("Parameter not Found: blockid\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PceRuleFree(gsw_dev, &alloc);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleFree failed with ret code", ret);
- else{
- printf("\n\tret = %d", ret);
- printf("\n\tblockid = %u", alloc.blockid);
- printf("\n\tnum_of_rules = %u", alloc.num_of_rules);
- printf("\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PceRuleEnable(int prmc, char *prmv[])
-{
- GSW_PCE_ruleEntry_t pce_rule = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
- scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
- scanParamArg(prmc, prmv, "region", sizeof(pce_rule.subifidgroup), &pce_rule.region);
- scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.nIndex), &pce_rule.nIndex);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PceRuleEnable(gsw_dev, &pce_rule);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleEnable failed with ret code", ret);
- else{
- printf("\n\tret = %d", ret);
- printf("\n\tregion = %u", pce_rule.region);
- printf("\n\tpattern.nIndex = %u", pce_rule.nIndex);
- printf("\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PceRuleDisable(int prmc, char *prmv[])
-{
- GSW_PCE_ruleEntry_t pce_rule = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- scanParamArg(prmc, prmv, "nLogicalPortId", sizeof(pce_rule.logicalportid), &pce_rule.logicalportid);
- scanParamArg(prmc, prmv, "nSubIfIdGroup", sizeof(pce_rule.subifidgroup), &pce_rule.subifidgroup);
- scanParamArg(prmc, prmv, "region", sizeof(pce_rule.subifidgroup), &pce_rule.region);
- scanParamArg(prmc, prmv, "pattern.nIndex", sizeof(pce_rule.nIndex), &pce_rule.nIndex);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PceRuleDisable(gsw_dev, &pce_rule);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PceRuleDisable failed with ret code", ret);
- else{
- printf("\n\tret = %d", ret);
- printf("\n\tregion = %u", pce_rule.region);
- printf("\n\tpattern.nIndex = %u", pce_rule.nIndex);
- printf("\n");
- }
-
- return ret;
-}
-
-// int gsw_dump_pce_mem(int prmc, char *prmv[])
-// {
-// GSW_table_t sVar = {0};
-// GSW_register_t reg = {0};
-// unsigned int i = 0, j = 0, k = 0, m = 0;
-// int num_of_elem;
-// GSW_Device_t *gsw_dev;
-// GSW_return_t ret;
-// int rret;
-// gsw_dev = gsw_get_struc(lif_id,0);
-
-// num_of_elem = (sizeof(tbl_dump_gsw33) / sizeof(struct _tbl_dump_));
-
-// for (i = 0; i < num_of_elem; i++) {
-// printf("===========================================\n");
-// printf("Table Name: %s\n", tbl_dump_gsw33[i].tbl_name);
-// printf("===========================================\n");
-
-// for (j = 0; j < tbl_dump_gsw33[i].entries; j++) {
-// memset(&sVar, 0, sizeof(sVar));
-
-// printf("Table Idx: %02d\n", j);
-// sVar.tbl_entry = j;
-// sVar.tbl_addr = tbl_dump_gsw33[i].tbl_addr;
-// sVar.tbl_id = 1;
-// gsw_cli_ops->gsw_debug_ops.DumpMem(gsw_dev, &sVar);
-
-
-// for (k = 0; k < gsw_pce_tbl_33[sVar.tbl_addr].num_key; k++)
-// printf("\tKey %d: %04x\n", k, sVar.ptdata.key[k]);
-
-// for (k = 0; k < gsw_pce_tbl_33[sVar.tbl_addr].num_mask; k++)
-// printf("\tMask %d: %04x\n", k, sVar.ptdata.mask[k]);
-
-// for (k = 0; k < gsw_pce_tbl_33[sVar.tbl_addr].num_val; k++)
-// printf("\tVal %d: %04x\n", k, sVar.ptdata.val[k]);
-
-// printf("\tValid: %x\n", sVar.ptdata.valid);
-// printf("\tType: %x\n", sVar.ptdata.type);
-// printf("\n");
-
-// for (m = 0; m < 500000; m++);
-// }
-// }
-// printf("===========================================\n");
-// for (i = 0; i < 0xEFF; i++) {
-
-// reg.nData = 0;
-// reg.nRegAddr = i;
-// GSW_RegisterGet(gsw_dev, ®);
-// printf("%08x: %08x\n", (0xC0D52000 + (i * 0x4)), reg.nData);
-// }
-
-// return ret;
-// }
-
-GSW_return_t fapi_GSW_MulticastRouterPortAdd(int prmc, char *prmv[])
-{
- GSW_multicastRouter_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MulticastRouterPortAdd(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastRouterPortAdd failed with ret code", ret);
- else{
- printf("fapi_GSW_MulticastRouterPortAdd done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MulticastRouterPortRemove(int prmc, char *prmv[])
-{
- GSW_multicastRouter_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MulticastRouterPortRemove(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastRouterPortRemove failed with ret code", ret);
- else{
- printf("fapi_GSW_MulticastRouterPortRemove done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MulticastSnoopCfgGet(int prmc, char *prmv[])
-{
- GSW_multicastSnoopCfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MulticastSnoopCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastSnoopCfgGet failed with ret code", ret);
- else{
- printf("Returned values:\n----------------\n");
- printf("\t%40s:\t0x%x\n", "eIGMP_Mode", param.eIGMP_Mode);
- printf("\t%40s:\t%s\n", "bCrossVLAN", (param.bCrossVLAN > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t0x%x\n", "eForwardPort", param.eForwardPort);
- printf("\t%40s:\t0x%x\n", "nForwardPortId", param.nForwardPortId);
- printf("\t%40s:\t0x%x\n", "nClassOfService", param.nClassOfService);
-
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MulticastSnoopCfgSet(int prmc, char *prmv[])
-{
- GSW_multicastSnoopCfg_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MulticastSnoopCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_MulticastSnoopCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc,prmv, "eIGMP_Mode", sizeof(param.eIGMP_Mode), ¶m.eIGMP_Mode);
- scanParamArg(prmc,prmv, "bCrossVLAN", sizeof(param.bCrossVLAN), ¶m.bCrossVLAN);
- scanParamArg(prmc,prmv, "eForwardPort", sizeof(param.eForwardPort), ¶m.eForwardPort);
- scanParamArg(prmc,prmv, "nForwardPortId", sizeof(param.nForwardPortId), ¶m.nForwardPortId);
- scanParamArg(prmc,prmv, "nClassOfService", sizeof(param.nClassOfService), ¶m.nClassOfService);
-
- ret = GSW_MulticastSnoopCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastSnoopCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_MulticastSnoopCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MulticastRouterPortRead(int prmc, char *prmv[])
-{
- GSW_multicastRouterRead_t multicastRouterRead = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- multicastRouterRead.bInitial = 1;
- gsw_dev = gsw_get_struc(lif_id,0);
-
- for (;;) {
- ret = GSW_MulticastRouterPortRead(gsw_dev, &multicastRouterRead);
- if (ret < 0){
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastRouterPortRead failed with ret code", ret);
- return ret;
- }
-
- if (multicastRouterRead.bLast == 1)
- break;
-
- printf("\t%40s:\t%d\n", "Router Port", multicastRouterRead.nPortId);
- memset(&multicastRouterRead, 0x00, sizeof(multicastRouterRead));
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MulticastTableEntryAdd(int prmc, char *prmv[])
-{
- GSW_multicastTable_t param;
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int retval;
-
- retval = multicastParamRead(prmc,prmv, ¶m);
- if (retval != 0)
- return retval;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MulticastTableEntryAdd(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastTableEntryAdd failed with ret code", ret);
- else{
- printf("fapi_GSW_MulticastTableEntryAdd done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MulticastTableEntryRead(int prmc, char *prmv[])
-{
- GSW_multicastTableRead_t multicastTableRead;
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int k = 0, valid = 0;
- u8 mcasthitsts_en = 0;
- GSW_register_t param = {0};
-
- memset(¶m, 0, sizeof(GSW_register_t));
- param.nRegAddr = 0x456;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_RegisterGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_RegisterGet failed with ret code", ret);
- return ret;
- }
-
- if (param.nData & 0x2000)
- mcasthitsts_en = 1;
- else
- mcasthitsts_en = 0;
-
- printf("-----------------------------------------------------------------------------------------------------------------------------------------------\n");
- printf("| %4s | %6s | %3s | %39s | %39s | %11s | %9s | %9s\n", "Port", "Sub Id", "FID", "GDA", "GSA", "Member Mode", "HitStatus", "VLAN Info");
- printf("-----------------------------------------------------------------------------------------------------------------------------------------------\n");
-
- memset(&multicastTableRead, 0x00, sizeof(multicastTableRead));
- multicastTableRead.bInitial = 1;
-
- for (;;) {
- ret = GSW_MulticastTableEntryRead(gsw_dev, &multicastTableRead);
- if (ret < 0)
- break;
-
- if (multicastTableRead.bLast == 1)
- break;
-
- if ((multicastTableRead.nPortId == 0) && (multicastTableRead.nSubIfId == 0) && (multicastTableRead.nFID == 0)) {
- valid = 0;
-
- for (k = 0; k < 8; k++) {
- if (multicastTableRead.uIP_Gsa.nIPv6[k] != 0)
- valid = 1;
- }
-
- for (k = 0; k < 8; k++) {
- if (multicastTableRead.uIP_Gda.nIPv6[k] != 0)
- valid = 1;
- }
-
- for (k = 0; k < ARRAY_SIZE(multicastTableRead.nPortMap); k++) {
- if (multicastTableRead.nPortMap[k] != 0)
- valid = 1;
- }
-
- if (valid == 0)
- continue;
- }
-
- if (multicastTableRead.nPortId & GSW_PORTMAP_FLAG_GET(GSW_multicastTableRead_t)) {
-
- unsigned int i = 0, j = 0, mask = 1;
-
- for (j = 0; j < ARRAY_SIZE(multicastTableRead.nPortMap); j++) {
- i = 0;
- mask = 1;
-
- if (!multicastTableRead.nPortMap[j])
- continue;
-
- while (mask <= (1 << 16)) {
- if (mask & multicastTableRead.nPortMap[j]) {
- if (mcasthitsts_en && (j == 7) && (mask == (1 << 15))) {
- break;
- }
-
- printf("| %4d |", (j * 16) + i);
- printf(" %6d |", multicastTableRead.nSubIfId);
- printf(" %3d |", multicastTableRead.nFID);
- dump_multicast_table_entry(&multicastTableRead);
- }
-
- i++;
- mask = 1 << i;
- }
- }
- } else {
- printf("| %4d |", multicastTableRead.nPortId);
- printf(" %6d |", multicastTableRead.nSubIfId);
- printf(" %3d |", multicastTableRead.nFID);
- dump_multicast_table_entry(&multicastTableRead);
- }
-
- memset(&multicastTableRead, 0x00, sizeof(multicastTableRead));
- }
-
- printf("-----------------------------------------------------------------------------------------------------------------------------------------------\n");
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_MulticastTableEntryRemove(int prmc, char *prmv[])
-{
- GSW_multicastTable_t param;
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int retval;
-
- retval = multicastParamRead(prmc,prmv, ¶m);
- if (retval != 0)
- return retval;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_MulticastTableEntryRemove(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_MulticastTableEntryRemove failed with ret code", ret);
- else{
- printf("fapi_GSW_MulticastTableEntryRemove done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_FW_Update(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = sys_misc_fw_update(gsw_dev);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_FW_Update failed with ret code", ret);
- else{
- printf("fapi_GSW_FW_Update done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_FW_Version(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- struct sys_fw_image_version sys_img_ver = {0};
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = sys_misc_fw_version(gsw_dev,&sys_img_ver);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_FW_Version failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n", "Major", sys_img_ver.major);
- printf("\t%40s:\t%x\n", "Minor", sys_img_ver.minor);
- printf("\t%40s:\t%u\n", "Revision", sys_img_ver.revision);
- printf("\t%40s:\t%u\n", "APP Revision", sys_img_ver.app_revision);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PVT_Meas(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- struct sys_sensor_value sensor_value_temp = {0};
- struct sys_sensor_value sensor_value_volt = {0};
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = sys_misc_pvt_temp(gsw_dev,&sensor_value_temp);
- ret = sys_misc_pvt_voltage(gsw_dev,&sensor_value_volt);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PVT_Temp failed with ret code", ret);
- else{
- printf("\t%40s:\t%d.%d\n", "Temp", sensor_value_temp.val1,sensor_value_temp.val2);
- printf("\t%40s:\t%d.%d\n", "Voltage", sensor_value_volt.val1,sensor_value_volt.val2);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_Delay(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
- struct sys_delay param = {0};
-
- rret = scanParamArg(prmc, prmv, "nMsec", sizeof(param.m_sec), ¶m.m_sec);
- if (rret < 1){
- printf("Parameter not Found: nMsec\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = sys_misc_delay(gsw_dev,¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Delay failed with ret code", ret);
- else{
- printf("fapi_GSW_Delay done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_GPIO_Configure(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
- struct sys_gpio_config param = {0};
-
- scanParamArg(prmc, prmv, "nEnableMaskIndex0", sizeof(param.enable_mask[0]), ¶m.enable_mask[0]);
- scanParamArg(prmc, prmv, "nEnableMaskIndex1", sizeof(param.enable_mask[1]), ¶m.enable_mask[1]);
- scanParamArg(prmc, prmv, "nEnableMaskIndex2", sizeof(param.enable_mask[2]), ¶m.enable_mask[2]);
- scanParamArg(prmc, prmv, "nAltSel0Index0", sizeof(param.alt_sel_0[0]), ¶m.alt_sel_0[0]);
- scanParamArg(prmc, prmv, "nAltSel0Index1", sizeof(param.alt_sel_0[1]), ¶m.alt_sel_0[1]);
- scanParamArg(prmc, prmv, "nAltSel0Index2", sizeof(param.alt_sel_0[2]), ¶m.alt_sel_0[2]);
- scanParamArg(prmc, prmv, "nAltSel1Index0", sizeof(param.alt_sel_1[0]), ¶m.alt_sel_1[0]);
- scanParamArg(prmc, prmv, "nAltSel1Index1", sizeof(param.alt_sel_1[1]), ¶m.alt_sel_1[1]);
- scanParamArg(prmc, prmv, "nAltSel1Index2", sizeof(param.alt_sel_1[2]), ¶m.alt_sel_1[2]);
- scanParamArg(prmc, prmv, "nDirIndex0", sizeof(param.dir[0]), ¶m.dir[0]);
- scanParamArg(prmc, prmv, "nDirIndex1", sizeof(param.dir[1]), ¶m.dir[1]);
- scanParamArg(prmc, prmv, "nDirIndex2", sizeof(param.dir[2]), ¶m.dir[2]);
- scanParamArg(prmc, prmv, "nOutValueIndex0", sizeof(param.out_val[0]), ¶m.out_val[0]);
- scanParamArg(prmc, prmv, "nOutValueIndex1", sizeof(param.out_val[1]), ¶m.out_val[1]);
- scanParamArg(prmc, prmv, "nOutValueIndex2", sizeof(param.out_val[2]), ¶m.out_val[2]);
- scanParamArg(prmc, prmv, "nTimeoutValue", sizeof(param.timeout_val), ¶m.timeout_val);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = sys_misc_gpio_configure(gsw_dev,¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_GPIO_Configure failed with ret code", ret);
- else{
- printf("fapi_GSW_GPIO_Configure done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_Reboot(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = sys_misc_reboot(gsw_dev);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Reboot failed with ret code", ret);
- else{
- printf("fapi_GSW_Reboot done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_SysReg_Rd(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
- struct sys_reg_rd sys_reg = {0};
-
- rret = scanParamArg(prmc, prmv, "addr", sizeof(sys_reg.addr), &sys_reg.addr);
- if (rret < 1){
- printf("Parameter not Found: addr\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = sys_misc_reg_rd(gsw_dev,&sys_reg);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_SysReg_Rd failed with ret code", ret);
- else
- printf("fapi_GSW_SysReg_Rd:\n\t addr=%x val=%x\n",sys_reg.addr ,sys_reg.val);
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_Debug_RMON_Port_Get(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_Debug_RMON_Port_cnt_t sVar;
- memset(&sVar, 0, sizeof(GSW_Debug_RMON_Port_cnt_t));
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(sVar.nPortId), &sVar.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "ePortType", sizeof(sVar.ePortType), &sVar.ePortType);
- if (rret < 1){
- printf("Parameter not Found: ePortType\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_Debug_RMON_Port_Get(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Debug_RMON_Port_Get failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n", "nPortId", sVar.nPortId);
- printf("\t%40s:\t%x\n", "ePortType", sVar.ePortType);
- printf("\t%40s:\t%s\n", "RMON Counter BitMode","64");
- printf("\n\n");
- printf("\t%40s:\t%u\n","nRxGoodPkts",sVar.nRxGoodPkts);
- printf("\t%40s:\t%u\n","nRxUnicastPkts",sVar.nRxUnicastPkts);
- printf("\t%40s:\t%u\n","nRxBroadcastPkts",sVar.nRxBroadcastPkts);
- printf("\t%40s:\t%u\n","nRxMulticastPkts",sVar.nRxMulticastPkts);
- printf("\t%40s:\t%u\n","nRxFCSErrorPkts",sVar.nRxFCSErrorPkts);
- printf("\t%40s:\t%u\n","nRxUnderSizeGoodPkts",sVar.nRxUnderSizeGoodPkts);
- printf("\t%40s:\t%u\n","nRxOversizeGoodPkts",sVar.nRxOversizeGoodPkts);
- printf("\t%40s:\t%u\n","nRxUnderSizeErrorPkts",sVar.nRxUnderSizeErrorPkts);
- printf("\t%40s:\t%u\n","nRxOversizeErrorPkts",sVar.nRxOversizeErrorPkts);
- printf("\t%40s:\t%u\n","nRxFilteredPkts",sVar.nRxFilteredPkts);
- printf("\t%40s:\t%u\n","nRx64BytePkts",sVar.nRx64BytePkts);
- printf("\t%40s:\t%u\n","nRx127BytePkts",sVar.nRx127BytePkts);
- printf("\t%40s:\t%u\n","nRx255BytePkts",sVar.nRx255BytePkts);
- printf("\t%40s:\t%u\n","nRx511BytePkts",sVar.nRx511BytePkts);
- printf("\t%40s:\t%u\n","nRx1023BytePkts",sVar.nRx1023BytePkts);
- printf("\t%40s:\t%u\n","nRxMaxBytePkts",sVar.nRxMaxBytePkts);
- printf("\t%40s:\t%u\n","nRxDroppedPkts",sVar.nRxDroppedPkts);
- printf("\t%40s:\t%u\n","nRxExtendedVlanDiscardPkts",sVar.nRxExtendedVlanDiscardPkts);
- printf("\t%40s:\t%u\n","nMtuExceedDiscardPkts",sVar.nMtuExceedDiscardPkts);
- printf("\t%40s:\t%llu 0x%llx\n","nRxGoodBytes",(unsigned long long)sVar.nRxGoodBytes,(unsigned long long)sVar.nRxGoodBytes);
- printf("\t%40s:\t%llu 0x%llx\n","nRxBadBytes",(unsigned long long)sVar.nRxBadBytes,(unsigned long long)sVar.nRxBadBytes);
-
- /*Valid only for GSWIP3.2*/
- printf("\t%40s:\t%u\n","nRxUnicastPktsYellowRed",sVar.nRxUnicastPktsYellowRed);
- printf("\t%40s:\t%u\n","nRxBroadcastPktsYellowRed",sVar.nRxBroadcastPktsYellowRed);
- printf("\t%40s:\t%u\n","nRxMulticastPktsYellowRed",sVar.nRxMulticastPktsYellowRed);
- printf("\t%40s:\t%u\n","nRxGoodPktsYellowRed",sVar.nRxGoodPktsYellowRed);
- printf("\t%40s:\t%llu 0x%llx\n","nRxGoodBytesYellowRed",(unsigned long long)sVar.nRxGoodBytesYellowRed,(unsigned long long)sVar.nRxGoodBytesYellowRed);
-
- printf("\n\n");
- printf("\t%40s:\t%u\n","nTxGoodPkts",sVar.nTxGoodPkts);
- printf("\t%40s:\t%u\n","nTxUnicastPkts",sVar.nTxUnicastPkts);
- printf("\t%40s:\t%u\n","nTxBroadcastPkts",sVar.nTxBroadcastPkts);
- printf("\t%40s:\t%u\n","nTxMulticastPkts",sVar.nTxMulticastPkts);
- printf("\t%40s:\t%u\n","nTx64BytePkts",sVar.nTx64BytePkts);
- printf("\t%40s:\t%u\n","nTx127BytePkts",sVar.nTx127BytePkts);
- printf("\t%40s:\t%u\n","nTx255BytePkts",sVar.nTx255BytePkts);
- printf("\t%40s:\t%u\n","nTx511BytePkts",sVar.nTx511BytePkts);
- printf("\t%40s:\t%u\n","nTx1023BytePkts",sVar.nTx1023BytePkts);
- printf("\t%40s:\t%u\n","nTxMaxBytePkts",sVar.nTxMaxBytePkts);
- printf("\t%40s:\t%u\n","nTxDroppedPkts",sVar.nTxDroppedPkts);
- printf("\t%40s:\t%u\n","nTxOversizeGoodPkts",sVar.nTxOversizeGoodPkts);
- printf("\t%40s:\t%u\n","nTxUnderSizeGoodPkts",sVar.nTxUnderSizeGoodPkts);
- printf("\t%40s:\t%u\n","nTxAcmDroppedPkts",sVar.nTxAcmDroppedPkts);
- printf("\t%40s:\t%llu 0x%llx\n","nTxGoodBytes",(unsigned long long)sVar.nTxGoodBytes,(unsigned long long)sVar.nTxGoodBytes);
-
- printf("\t%40s:\t%u\n","nTxUnicastPktsYellowRed",sVar.nTxUnicastPktsYellowRed);
- printf("\t%40s:\t%u\n","nTxBroadcastPktsYellowRed",sVar.nTxBroadcastPktsYellowRed);
- printf("\t%40s:\t%u\n","nTxMulticastPktsYellowRed",sVar.nTxMulticastPktsYellowRed);
- printf("\t%40s:\t%u\n","nTxGoodPktsYellowRed",sVar.nTxGoodPktsYellowRed);
- printf("\t%40s:\t%llu 0x%llx\n","nTxGoodBytesYellowRed",(unsigned long long)sVar.nTxGoodBytesYellowRed,(unsigned long long)sVar.nTxGoodBytesYellowRed);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_CPU_PortCfgGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_CPU_PortCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_CPU_PortCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PortCfgGet failed with ret code", ret);
- else{
- printf("\t%40s:\t%s\n", "bCPU_PortValid", (param.bCPU_PortValid > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%s\n", "bSpecialTagIngress", (param.bSpecialTagIngress > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%s\n", "bSpecialTagEgress", (param.bSpecialTagEgress > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%s\n", "bFcsCheck", (param.bFcsCheck > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%s\n", "bFcsGenerate", (param.bFcsGenerate > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%d\n", "bSpecialTagEthType", param.bSpecialTagEthType);
- printf("\t%40s:\t%s\n", "bTsPtp", (param.bTsPtp > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%s\n", "bTsNonptp", (param.bTsNonptp > 0) ? "TRUE" : "FALSE");
- printf("\t%40s:\t%d\n", "eNoMPEParserCfg", param.eNoMPEParserCfg);
- printf("\t%40s:\t%d\n", "eMPE1ParserCfg", param.eMPE1ParserCfg);
- printf("\t%40s:\t%d\n", "eMPE2ParserCfg", param.eMPE2ParserCfg);
- printf("\t%40s:\t%d\n", "eMPE1MPE2ParserCfg", param.eMPE1MPE2ParserCfg);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_CPU_PortCfgSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_CPU_PortCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPortId", sizeof(param.nPortId), ¶m.nPortId);
- if (rret < 1){
- printf("Parameter not Found: nPortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_CPU_PortCfgGet(gsw_dev, ¶m);
- if (ret < 0)
- {
- printf("\t%40s:\t0x%x\n", "GSW_CPU_PortCfgGet failed with ret code", ret);
- return ret;
- }
-
- scanParamArg(prmc, prmv,"bCPU_PortValid", sizeof(param.bCPU_PortValid), ¶m.bCPU_PortValid);
- scanParamArg(prmc, prmv,"bSpecialTagIngress", sizeof(param.bSpecialTagIngress), ¶m.bSpecialTagIngress);
- scanParamArg(prmc, prmv,"bSpecialTagEgress", sizeof(param.bSpecialTagEgress), ¶m.bSpecialTagEgress);
- scanParamArg(prmc, prmv,"bFcsCheck", sizeof(param.bFcsCheck), ¶m.bFcsCheck);
- scanParamArg(prmc, prmv,"bFcsGenerate", sizeof(param.bFcsGenerate), ¶m.bFcsGenerate);
- scanParamArg(prmc, prmv,"bSpecialTagEthType", sizeof(param.bSpecialTagEthType), ¶m.bSpecialTagEthType);
- scanParamArg(prmc, prmv,"bTsPtp", sizeof(param.bTsPtp), ¶m.bTsPtp);
- scanParamArg(prmc, prmv,"bTsNonptp", sizeof(param.bTsNonptp), ¶m.bTsNonptp);
-
- scanParamArg(prmc, prmv,"eNoMPEParserCfg", sizeof(param.eNoMPEParserCfg), ¶m.eNoMPEParserCfg);
- scanParamArg(prmc, prmv,"eMPE1ParserCfg", sizeof(param.eMPE1ParserCfg), ¶m.eMPE1ParserCfg);
- scanParamArg(prmc, prmv,"eMPE2ParserCfg", sizeof(param.eMPE2ParserCfg), ¶m.eMPE2ParserCfg);
- scanParamArg(prmc, prmv,"eMPE1MPE2ParserCfg", sizeof(param.eMPE1MPE2ParserCfg), ¶m.eMPE1MPE2ParserCfg);
-
- ret = GSW_CPU_PortCfgSet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_CPU_PortCfgSet failed with ret code", ret);
- else{
- printf("fapi_GSW_CPU_PortCfgSet done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_VlanCounterMapSet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_VlanCounterMapping_config_t sVar = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nCounterIndex", sizeof(sVar.nCounterIndex), &sVar.nCounterIndex);
- if (rret < 1){
- printf("Parameter not Found: nCounterIndex\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nCtpPortId", sizeof(sVar.nCtpPortId), &sVar.nCtpPortId);
- scanParamArg(prmc, prmv, "bPriorityEnable", sizeof(sVar.bPriorityEnable), &sVar.bPriorityEnable);
- scanParamArg(prmc, prmv, "nPriorityVal", sizeof(sVar.nPriorityVal), &sVar.nPriorityVal);
- scanParamArg(prmc, prmv, "bVidEnable", sizeof(sVar.bVidEnable), &sVar.bVidEnable);
- scanParamArg(prmc, prmv, "nVidVal", sizeof(sVar.nVidVal), &sVar.nVidVal);
- scanParamArg(prmc, prmv, "bVlanTagSelectionEnable", sizeof(sVar.bVlanTagSelectionEnable), &sVar.bVlanTagSelectionEnable);
- scanParamArg(prmc, prmv, "eVlanCounterMappingType", sizeof(sVar.eVlanCounterMappingType), &sVar.eVlanCounterMappingType);
- scanParamArg(prmc, prmv, "eVlanCounterMappingFilterType", sizeof(sVar.eVlanCounterMappingFilterType), &sVar.eVlanCounterMappingFilterType);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_VlanCounterMapSet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanCounterMapSet failed with ret code", ret);
- else{
-
- printf("fapi_GSW_VlanCounterMapSet done\n");
- }
- return ret;
-}
-
-GSW_return_t fapi_GSW_VlanCounterMapGet(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_VlanCounterMapping_config_t sVar = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nCounterIndex", sizeof(sVar.nCounterIndex), &sVar.nCounterIndex);
- if (rret < 1){
- printf("Parameter not Found: nCounterIndex\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "eVlanCounterMappingType", sizeof(sVar.eVlanCounterMappingType), &sVar.eVlanCounterMappingType);
- if (rret < 1){
- printf("Parameter not Found: nCounterIndex\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_VlanCounterMapGet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_VlanCounterMapGet failed with ret code", ret);
- else{
- printf("\n\t nCounterIndex = %u", sVar.nCounterIndex);
- printf("\n\t nCtpPortId = %u", sVar.nCtpPortId);
- printf("\n\t bPriorityEnable = %u", sVar.bPriorityEnable);
- printf("\n\t nPriorityVal = %u", sVar.nPriorityVal);
- printf("\n\t bVidEnable = %u", sVar.bVidEnable);
- printf("\n\t nVidVal = %u", sVar.nVidVal);
- printf("\n\t bVlanTagSelectionEnable = %u", sVar.bVlanTagSelectionEnable);
- printf("\n\t eVlanCounterMappingType = %u", sVar.eVlanCounterMappingType);
- printf("\n\t eVlanCounterMappingFilterType = %u", sVar.eVlanCounterMappingFilterType);
- printf("\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_Vlan_RMON_Get(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_VLAN_RMON_cnt_t sVar = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nVlanCounterIndex", sizeof(sVar.nVlanCounterIndex), &sVar.nVlanCounterIndex);
- if (rret < 1){
- printf("Parameter not Found: nVlanCounterIndex\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "eVlanRmonType", sizeof(sVar.eVlanRmonType), &sVar.eVlanRmonType);
- if (rret < 1){
- printf("Parameter not Found: eVlanRmonType\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_Vlan_RMON_Get(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Vlan_RMON_Get failed with ret code", ret);
- else{
- printf("\t%40s:\t%u\n", "nByteCountHigh", (sVar.nByteCountHigh ) );
- printf("\t%40s:\t%u\n", "nByteCountLow", (sVar.nByteCountLow ) );
- printf("\t%40s:\t%u\n", "nTotalPktCount", (sVar.nTotalPktCount ) );
- printf("\t%40s:\t%u\n", "nMulticastPktCount", (sVar.nMulticastPktCount) );
- printf("\t%40s:\t%u\n", "nDropPktCount", (sVar.nDropPktCount ) );
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_Vlan_RMON_Clear(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_VLAN_RMON_cnt_t sVar = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nVlanCounterIndex", sizeof(sVar.nVlanCounterIndex), &sVar.nVlanCounterIndex);
- if (rret < 1){
- printf("Parameter not Found: nVlanCounterIndex\n");
- return OS_ERROR;
- }
-
- rret = scanParamArg(prmc, prmv, "eVlanRmonType", sizeof(sVar.eVlanRmonType), &sVar.eVlanRmonType);
- if (rret < 1){
- printf("Parameter not Found: eVlanRmonType\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "eClearAll", sizeof(sVar.eVlanRmonType), &sVar.clear_all);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_Vlan_RMON_Clear(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Vlan_RMON_Clear failed with ret code", ret);
- else{
- printf("fapi_GSW_Vlan_RMON_Clear done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_Vlan_RMONControl_Set(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_VLAN_RMON_control_t sVar = {0};
-
- scanParamArg(prmc, prmv, "bVlanRmonEnable", sizeof(sVar.bVlanRmonEnable), &sVar.bVlanRmonEnable);
- scanParamArg(prmc, prmv, "bIncludeBroadCastPktCounting", sizeof(sVar.bIncludeBroadCastPktCounting), &sVar.bIncludeBroadCastPktCounting);
- scanParamArg(prmc, prmv, "nVlanLastEntry", sizeof(sVar.nVlanLastEntry), &sVar.nVlanLastEntry);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_Vlan_RMONControl_Set(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Vlan_RMONControl_Set failed with ret code", ret);
- else{
- printf("fapi_GSW_Vlan_RMONControl_Set done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_Vlan_RMONControl_Get(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_VLAN_RMON_control_t sVar = {0};
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_Vlan_RMONControl_Get(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Vlan_RMONControl_Get failed with ret code", ret);
- else{
- printf("\n\t bVlanRmonEnable = %u", sVar.bVlanRmonEnable);
- printf("\n\t bIncludeBroadCastPktCounting = %u", sVar.bIncludeBroadCastPktCounting);
- printf("\n\t nVlanLastEntry = %u\n", sVar.nVlanLastEntry);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PBB_TunnelTempate_Config_Set(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_PBB_Tunnel_Template_Config_t sVar = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nTunnelTemplateId", sizeof(sVar.nTunnelTemplateId), &sVar.nTunnelTemplateId);
- if (rret < 1){
- printf("Parameter not Found: nTunnelTemplateId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "bIheaderDstMACEnable", sizeof(sVar.bIheaderDstMACEnable), &sVar.bIheaderDstMACEnable);
- scanMAC_Arg(prmc, prmv, "nIheaderDstMAC", sVar.nIheaderDstMAC);
- scanParamArg(prmc, prmv, "bIheaderSrcMACEnable", sizeof(sVar.bIheaderSrcMACEnable), &sVar.bIheaderSrcMACEnable);
- scanMAC_Arg(prmc, prmv, "nIheaderSrcMAC", sVar.nIheaderSrcMAC);
-
- scanParamArg(prmc, prmv, "bItagEnable", sizeof(sVar.bItagEnable), &sVar.bItagEnable);
- scanParamArg(prmc, prmv, "bItagTpidEnable", sizeof(sVar.sItag.bTpidEnable), &sVar.sItag.bTpidEnable);
- scanParamArg(prmc, prmv, "nItagTpid", sizeof(sVar.sItag.nTpid), &sVar.sItag.nTpid);
- scanParamArg(prmc, prmv, "bItagPcpEnable", sizeof(sVar.sItag.bPcpEnable), &sVar.sItag.bPcpEnable);
- scanParamArg(prmc, prmv, "nItagPcp", sizeof(sVar.sItag.nPcp), &sVar.sItag.nPcp);
- scanParamArg(prmc, prmv, "bItagDeiEnable", sizeof(sVar.sItag.bDeiEnable), &sVar.sItag.bDeiEnable);
- scanParamArg(prmc, prmv, "nItagDei", sizeof(sVar.sItag.nDei), &sVar.sItag.nDei);
- scanParamArg(prmc, prmv, "bItagUacEnable", sizeof(sVar.sItag.bUacEnable), &sVar.sItag.bUacEnable);
- scanParamArg(prmc, prmv, "nItagUac", sizeof(sVar.sItag.nUac), &sVar.sItag.nUac);
- scanParamArg(prmc, prmv, "bItagResEnable", sizeof(sVar.sItag.bResEnable), &sVar.sItag.bResEnable);
- scanParamArg(prmc, prmv, "nItagRes", sizeof(sVar.sItag.nRes), &sVar.sItag.nRes);
- scanParamArg(prmc, prmv, "bItagSidEnable", sizeof(sVar.sItag.bSidEnable), &sVar.sItag.bSidEnable);
- scanParamArg(prmc, prmv, "nItagSid", sizeof(sVar.sItag.nSid), &sVar.sItag.nSid);
-
- scanParamArg(prmc, prmv, "bBtagEnable", sizeof(sVar.bBtagEnable), &sVar.bBtagEnable);
- scanParamArg(prmc, prmv, "bBtagTpidEnable", sizeof(sVar.sBtag.bTpidEnable), &sVar.sBtag.bTpidEnable);
- scanParamArg(prmc, prmv, "nBtagTpid", sizeof(sVar.sBtag.nTpid), &sVar.sBtag.nTpid);
- scanParamArg(prmc, prmv, "bBtagPcpEnable", sizeof(sVar.sBtag.bPcpEnable), &sVar.sBtag.bPcpEnable);
- scanParamArg(prmc, prmv, "nBtagPcp", sizeof(sVar.sBtag.nPcp), &sVar.sBtag.nPcp);
- scanParamArg(prmc, prmv, "bBtagDeiEnable", sizeof(sVar.sBtag.bDeiEnable), &sVar.sBtag.bDeiEnable);
- scanParamArg(prmc, prmv, "nBtagDei", sizeof(sVar.sBtag.nDei), &sVar.sBtag.nDei);
- scanParamArg(prmc, prmv, "bBtagVidEnable", sizeof(sVar.sBtag.bVidEnable), &sVar.sBtag.bVidEnable);
- scanParamArg(prmc, prmv, "nBtagVid", sizeof(sVar.sBtag.nVid), &sVar.sBtag.nVid);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PBB_TunnelTempate_Config_Set(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PBB_TunnelTempate_Config_Set failed with ret code", ret);
- else{
- printf("fapi_GSW_PBB_TunnelTempate_Config_Set done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PBB_TunnelTempate_Config_Get(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_PBB_Tunnel_Template_Config_t sVar = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nTunnelTemplateId", sizeof(sVar.nTunnelTemplateId), &sVar.nTunnelTemplateId);
- if (rret < 1){
- printf("Parameter not Found: nTunnelTemplateId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PBB_TunnelTempate_Config_Get(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PBB_TunnelTempate_Config_Get failed with ret code", ret);
- else{
- printf("\t%40s:\t%u\n", "nTunnelTemplateId", sVar.nTunnelTemplateId);
- printf("\n\t nTunnelTemplateId = %u", sVar.nTunnelTemplateId);
- printf("\n\t nIheaderDstMAC =");
- printMAC_Address(sVar.nIheaderDstMAC);
- printf("\n\t nIheaderSrcMAC =");
- printMAC_Address(sVar.nIheaderSrcMAC);
- printf("\n");
- printf("\t%40s:\t%x\n", "nItagTpid", sVar.sItag.nTpid);
- printf("\t%40s:\t%u\n", "nItagPcp", sVar.sItag.nPcp);
- printf("\t%40s:\t%u\n", "nItagDei", sVar.sItag.nDei);
- printf("\t%40s:\t%u\n", "nItagUac", sVar.sItag.nUac);
- printf("\t%40s:\t%u\n", "nItagRes",sVar.sItag.nRes);
- printf("\t%40s:\t%u\n", "nItagSid", sVar.sItag.nSid);
- printf("\t%40s:\t%x\n", "nBtagTpid", sVar.sBtag.nTpid);
- printf("\t%40s:\t%u\n", "nBtagPcp", sVar.sBtag.nPcp);
- printf("\t%40s:\t%u\n", "nBtagDei", sVar.sBtag.nDei);
- printf("\t%40s:\t%u\n", "nBtagVid", sVar.sBtag.nVid);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PBB_TunnelTempate_Free(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_PBB_Tunnel_Template_Config_t sVar = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nTunnelTemplateId", sizeof(sVar.nTunnelTemplateId), &sVar.nTunnelTemplateId);
- if (rret < 1){
- printf("Parameter not Found: nTunnelTemplateId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PBB_TunnelTempate_Free(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PBB_TunnelTempate_Free failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n", "Freed nTunnelTemplateId", sVar.nTunnelTemplateId);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PBB_TunnelTempate_Alloc(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_PBB_Tunnel_Template_Config_t sVar = {0};
- int rret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PBB_TunnelTempate_Alloc(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PBB_TunnelTempate_Alloc failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n", "Allocated nTunnelTemplateId", sVar.nTunnelTemplateId);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_RMON_FlowGet(int prmc, char *prmv[])
-{
- GSW_RMON_flowGet_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- scanParamArg(prmc, prmv,"bIndex", sizeof(param.bIndex), ¶m.bIndex);
- scanParamArg(prmc, prmv,"nIndex", sizeof(param.nIndex), ¶m.nIndex);
- scanParamArg(prmc, prmv,"nPortId", sizeof(param.nPortId), ¶m.nPortId);
- scanParamArg(prmc, prmv,"nFlowId", sizeof(param.nFlowId), ¶m.nFlowId);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_RMON_FlowGet(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_FlowGet failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n", "nIndex", param.nIndex);
- printf("\t%40s:\t%x\n", "nRxPkts", param.nRxPkts);
- printf("\t%40s:\t%x\n", "nTxPkts", param.nTxPkts);
- printf("\t%40s:\t%x\n", "nTxPceBypassPkts", param.nTxPceBypassPkts);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_RMON_MeterGet(int prmc, char *prmv[])
-{
- GSW_RMON_Meter_cnt_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- scanParamArg(prmc, prmv,"nMeterId", sizeof(param.nMeterId), ¶m.nMeterId);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_RMON_Meter_Get(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_Meter_Get failed with ret code", ret);
- else{
- printf("\t%40s:\t%x\n", "nMeterId", param.nMeterId);
- printf("\t%40s:\t%x\n", "nGreenCount", param.nGreenCount);
- printf("\t%40s:\t%x\n", "nYellowCount", param.nYellowCount);
- printf("\t%40s:\t%x\n", "nRedCount", param.nRedCount);
- printf("\t%40s:\t%x\n", "nResCount", param.nResCount);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_RMON_TFlowClear(int prmc, char *prmv[])
-{
- GSW_RMON_flowGet_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- scanParamArg(prmc, prmv,"bIndex", sizeof(param.bIndex), ¶m.bIndex);
- scanParamArg(prmc, prmv,"nIndex", sizeof(param.nIndex), ¶m.nIndex);
- scanParamArg(prmc, prmv,"nPortId", sizeof(param.nPortId), ¶m.nPortId);
- scanParamArg(prmc, prmv,"nFlowId", sizeof(param.nFlowId), ¶m.nFlowId);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_RmonTflowClear(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_RMON_TFlowClear failed with ret code", ret);
- else{
- printf("\t%40s\n","fapi_GSW_RMON_TFlowClear done");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_BridgePortFree(int prmc, char *prmv[])
-{
- GSW_BRIDGE_portAlloc_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- int rret;
-
- rret = scanParamArg(prmc, prmv,"nBridgePortId", sizeof(param.nBridgePortId), ¶m.nBridgePortId);
- if (rret < 1){
- printf("Parameter not Found: nBridgePortId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgePortFree(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgePortFree failed with ret code", ret);
- else{
- printf("\t%40s\n","fapi_GSW_BridgePortFree done");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_BridgePortAlloc(int prmc, char *prmv[])
-{
- GSW_BRIDGE_portAlloc_t param = {0};
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_BridgePortAlloc(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_BridgePortAlloc failed with ret code", ret);
- else{
- printf("\n\tAllocated nBridgePortId = %u\n", param.nBridgePortId);
- }
-
- return ret;
-}
-
-
-GSW_return_t fapi_GSW_Freeze(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_Freeze(gsw_dev);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_Freeze failed with ret code", ret);
- else{
- printf("\t%40s\n","fapi_GSW_Freeze done");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_UnFreeze(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_UnFreeze(gsw_dev);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_UnFreeze failed with ret code", ret);
- else{
- printf("\t%40s\n","fapi_GSW_UnFreeze done");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_MeterAlloc(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_meterCfg_t param = {0};
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QOS_MeterAlloc(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_MeterAlloc failed with ret code", ret);
- else{
- printf("\n\tAllocated nMeterId = %u\n", param.nMeterId);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_QoS_MeterFree(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_QoS_meterCfg_t param = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nMeterId", sizeof(param.nMeterId), ¶m.nMeterId);
- if (rret < 1){
- printf("Parameter not Found: nMeterId\n");
- return OS_ERROR;
- }
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_QOS_MeterFree(gsw_dev, ¶m);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_QoS_MeterFree failed with ret code", ret);
- else{
- printf("fapi_GSW_QoS_MeterFree done\n");
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_PMAC_RMON_Get(int prmc, char *prmv[])
-{
- GSW_Device_t *gsw_dev;
- GSW_return_t ret;
- GSW_PMAC_Cnt_t sVar = {0};
- int rret;
-
- rret = scanParamArg(prmc, prmv, "nPmacId", sizeof(sVar.nPmacId), &sVar.nPmacId);
- if (rret < 1){
- printf("Parameter not Found: nPmacId\n");
- return OS_ERROR;
- }
-
- scanParamArg(prmc, prmv, "nPortId", sizeof(sVar.nTxDmaChanId), &sVar.nTxDmaChanId);
- scanParamArg(prmc, prmv, "b64BitMode", sizeof(sVar.b64BitMode), &sVar.b64BitMode);
-
- gsw_dev = gsw_get_struc(lif_id,0);
- ret = GSW_PMAC_CountGet(gsw_dev, &sVar);
- if (ret < 0)
- printf("\t%40s:\t0x%x\n", "fapi_GSW_PMAC_RMON_Get failed with ret code", ret);
- else{
- printf("\t nPmacId = %u\n\n", sVar.nPmacId);
- printf("\t nPortId = %u\n", sVar.nTxDmaChanId);
- printf("\t Egress Total Packet Count = %u\n", sVar.nEgressPktsCount);
- printf("\t Egress Total Byte Count = %u\n", sVar.nEgressBytesCount);
- printf("\t Egress Checksum Error Packet Count = %u\n", sVar.nChkSumErrPktsCount);
- printf("\t Egress Checksum Error Byte Count = %u\n", sVar.nChkSumErrBytesCount);
- printf("\t Egress Header Packet Count = %u\n", sVar.nEgressHdrPktsCount);
- printf("\t Egress Header Byte Count = %u\n", sVar.nEgressHdrBytesCount);
- printf("\t Egress Header Discard Packet Count = %u\n", sVar.nEgressHdrDiscPktsCount);
- printf("\t Egress Header Discard Byte Count = %u\n\n", sVar.nEgressHdrDiscBytesCount);
- printf("\t DMA TxCh = %u\n", sVar.nTxDmaChanId);
- printf("\t Ingress Total Packet Count = %u\n", sVar.nIngressPktsCount);
- printf("\t Ingress Total Byte Count = %u\n", sVar.nIngressBytesCount);
- printf("\t Ingress Discard Packet Count = %u\n", sVar.nDiscPktsCount);
- printf("\t Ingress Discard Byte Count = %u\n", sVar.nDiscBytesCount);
- printf("\t Ingress Header Packet Count = %u\n", sVar.nIngressHdrPktsCount);
- printf("\t Ingress Header Byte Count = %u\n", sVar.nIngressHdrBytesCount);
- }
-
- return ret;
-}
-
-GSW_return_t fapi_GSW_Debug_PMAC_RMON_Get_All(int prmc, char *prmv[])
-{
- GSW_PMAC_Cnt_t *eg, *ig;
- u32 i = 0;
- u32 start = 0, end = 16;
- u32 max_read = 0;
- u8 pmacId = 0;
- GSW_Device_t *gsw_dev;
- GSW_return_t ret = 0;
-
- scanParamArg(prmc, prmv, "nPmacId", sizeof(pmacId), &pmacId);
- scanParamArg(prmc, prmv, "Start", sizeof(start), &start);
- scanParamArg(prmc, prmv, "End", sizeof(end), &end);
-
- max_read = end - start;
- if (max_read > 16 || end > 16) {
- printf("Display only 16 ports, please check start and end\n");
- return -1;
- }
-
- eg = malloc(sizeof(*eg)*max_read);
- if (!eg) {
- printf("\n\tERROR: failed in buffer allocation\n");
- return -ENOMEM;
- }
-
- ig = eg;
-
- printf("\n");
- printf("Reading PmacId %d: %s\n", pmacId, "Egress");
- printf("Reading PmacId %d: %s\n", pmacId, "Ingress");
- gsw_dev = gsw_get_struc(lif_id,0);
-
- for (i = 0; i < max_read; i++) {
- eg[i].nPmacId = pmacId;
- eg[i].nTxDmaChanId = start + i;
-
- ret = GSW_PMAC_CountGet(gsw_dev, &eg[i]);
- if (ret < 0)
- {
- free (eg);
- printf("\t%40s:\t0x%x\n", "GSW_PMAC_CountGet failed with ret code", ret);
- return ret;
- }
- }
-
- printf("\n");
- printf("Rx Logical Port : ");
- for (i = start; i < end; i++)
- printf("%11u", i);
-
- printf("\n");
- printf("\n");
- printf("Egress Checksum Error Packet Count : ");
-
- for (i = 0; i < max_read; i++)
- printf("%11u", eg[i].nChkSumErrPktsCount);
-
- printf("\n");
- printf("Egress Checksum Error Byte Count : ");
-
- for (i = 0; i < max_read; i++)
- printf("%11u", eg[i].nChkSumErrBytesCount);
-
- printf("\n");
- printf("Egress Total Packet Count : ");
-
- for (i = 0; i < max_read; i++)
- printf("%11u", eg[i].nEgressPktsCount);
-
- printf("\n");
- printf("Egress Total Byte Count : ");
-
- for (i = 0; i < max_read; i++)
- printf("%11u", eg[i].nEgressBytesCount);
-
- printf("\n");
- printf("\n");
- printf("\n");
-
- printf("DMA TxCh : ");
- for (i = start; i < end; i++)
- printf("%11u", i);
-
- printf("\n");
- printf("\n");
-
- printf("Ingress Discard Packet Count : ");
-
- for (i = 0; i < max_read; i++)
- printf("%11u", ig[i].nDiscPktsCount);
-
- printf("\n");
- printf("Ingress Discard Byte Count : ");
-
- for (i = 0; i < max_read; i++)
- printf("%11u", ig[i].nDiscBytesCount);
-
- printf("\n");
- printf("Ingress Total Packet Count : ");
-
- for (i = 0; i < max_read; i++)
- printf("%11u", ig[i].nIngressPktsCount);
-
- printf("\n");
- printf("Ingress Total Byte Count : ");
-
- for (i = 0; i < max_read; i++)
- printf("%11u", ig[i].nIngressBytesCount);
- printf("\n");
- free(eg);
-
- return ret;
-}
diff --git a/feed/app/ethswbox/src/switch_hostapi/doc/GPY_GSW_APIs.pdf b/feed/app/ethswbox/src/switch_hostapi/doc/GPY_GSW_APIs.pdf
deleted file mode 100644
index 3fb9bcf..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/doc/GPY_GSW_APIs.pdf
+++ /dev/null
Binary files differ
diff --git a/feed/app/ethswbox/src/switch_hostapi/doc/MaxLinear-logo.png b/feed/app/ethswbox/src/switch_hostapi/doc/MaxLinear-logo.png
deleted file mode 100644
index 3f543a4..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/doc/MaxLinear-logo.png
+++ /dev/null
Binary files differ
diff --git a/feed/app/ethswbox/src/switch_hostapi/doc/doxygen.cfg b/feed/app/ethswbox/src/switch_hostapi/doc/doxygen.cfg
deleted file mode 100644
index c6119d7..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/doc/doxygen.cfg
+++ /dev/null
@@ -1,353 +0,0 @@
-# Doxyfile 1.8.13
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-DOXYFILE_ENCODING = UTF-8
-PROJECT_NAME = "MxL862xx Switch Host API"
-PROJECT_NUMBER =
-PROJECT_BRIEF =
-PROJECT_LOGO = MaxLinear-logo.png
-OUTPUT_DIRECTORY =
-CREATE_SUBDIRS = NO
-ALLOW_UNICODE_NAMES = NO
-OUTPUT_LANGUAGE = English
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF = "The $name class" \
- "The $name widget" \
- "The $name file" \
- is \
- provides \
- specifies \
- contains \
- represents \
- a \
- an \
- the
-ALWAYS_DETAILED_SEC = YES
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-STRIP_FROM_INC_PATH =
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = NO
-QT_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-INHERIT_DOCS = YES
-SEPARATE_MEMBER_PAGES = NO
-TAB_SIZE = 4
-ALIASES =
-TCL_SUBST =
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-OPTIMIZE_FOR_FORTRAN = NO
-OPTIMIZE_OUTPUT_VHDL = NO
-EXTENSION_MAPPING =
-MARKDOWN_SUPPORT = YES
-TOC_INCLUDE_HEADINGS = 0
-AUTOLINK_SUPPORT = YES
-BUILTIN_STL_SUPPORT = NO
-CPP_CLI_SUPPORT = NO
-SIP_SUPPORT = NO
-IDL_PROPERTY_SUPPORT = YES
-DISTRIBUTE_GROUP_DOC = NO
-GROUP_NESTED_COMPOUNDS = NO
-SUBGROUPING = YES
-INLINE_GROUPED_CLASSES = NO
-INLINE_SIMPLE_STRUCTS = NO
-TYPEDEF_HIDES_STRUCT = NO
-LOOKUP_CACHE_SIZE = 0
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_PACKAGE = NO
-EXTRACT_STATIC = NO
-EXTRACT_LOCAL_CLASSES = YES
-EXTRACT_LOCAL_METHODS = NO
-EXTRACT_ANON_NSPACES = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = YES
-HIDE_SCOPE_NAMES = NO
-HIDE_COMPOUND_REFERENCE= NO
-SHOW_INCLUDE_FILES = YES
-SHOW_GROUPED_MEMB_INC = NO
-FORCE_LOCAL_INCLUDES = NO
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = NO
-SORT_MEMBERS_CTORS_1ST = NO
-SORT_GROUP_NAMES = NO
-SORT_BY_SCOPE_NAME = NO
-STRICT_PROTO_MATCHING = NO
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = YES
-SHOW_FILES = YES
-SHOW_NAMESPACES = YES
-FILE_VERSION_FILTER =
-LAYOUT_FILE =
-CITE_BIB_FILES =
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = NO
-WARN_AS_ERROR = NO
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ../include/gswip/gsw.h \
- ../include/gswip/gsw_api.h \
- ../include/gswip/gsw_ctp.h \
- ../include/gswip/gsw_flow.h \
- ../include/gswip/gsw_pmac.h \
- ../include/gswip/gsw_rmon.h \
- ../include/gswip/gsw_types.h \
- ../include/gswip/mdio_relay.h
-
-INPUT_ENCODING = UTF-8
-FILE_PATTERNS = *.c \
- *.cc \
- *.cxx \
- *.cpp \
- *.c++ \
- *.ii \
- *.ixx \
- *.ipp \
- *.i++ \
- *.inl \
- *.h \
- *.hh \
- *.hxx \
- *.hpp \
- *.h++
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXCLUDE_SYMBOLS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS = *
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_PATTERNS =
-FILTER_SOURCE_FILES = NO
-FILTER_SOURCE_PATTERNS =
-USE_MDFILE_AS_MAINPAGE =
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = YES
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = NO
-REFERENCES_RELATION = NO
-REFERENCES_LINK_SOURCE = YES
-SOURCE_TOOLTIPS = YES
-USE_HTAGS = NO
-VERBATIM_HEADERS = YES
-CLANG_ASSISTED_PARSING = NO
-CLANG_OPTIONS =
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = YES
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_EXTRA_STYLESHEET =
-HTML_EXTRA_FILES =
-HTML_COLORSTYLE_HUE = 220
-HTML_COLORSTYLE_SAT = 100
-HTML_COLORSTYLE_GAMMA = 80
-HTML_TIMESTAMP = NO
-HTML_DYNAMIC_SECTIONS = NO
-HTML_INDEX_NUM_ENTRIES = 100
-GENERATE_DOCSET = NO
-DOCSET_FEEDNAME = "Doxygen generated docs"
-DOCSET_BUNDLE_ID = com.maxlinear.mxl862xx.switch_host_api
-DOCSET_PUBLISHER_ID = com.maxlinear
-DOCSET_PUBLISHER_NAME = MaxLinear
-GENERATE_HTMLHELP = YES
-CHM_FILE = switch_api.chm
-HHC_LOCATION =
-GENERATE_CHI = NO
-CHM_INDEX_ENCODING =
-BINARY_TOC = NO
-TOC_EXPAND = NO
-GENERATE_QHP = NO
-QCH_FILE =
-QHP_NAMESPACE = org.doxygen.Project
-QHP_VIRTUAL_FOLDER = doc
-QHP_CUST_FILTER_NAME =
-QHP_CUST_FILTER_ATTRS =
-QHP_SECT_FILTER_ATTRS =
-QHG_LOCATION =
-GENERATE_ECLIPSEHELP = NO
-ECLIPSE_DOC_ID = org.doxygen.Project
-DISABLE_INDEX = NO
-GENERATE_TREEVIEW = NO
-ENUM_VALUES_PER_LINE = 4
-TREEVIEW_WIDTH = 250
-EXT_LINKS_IN_WINDOW = NO
-FORMULA_FONTSIZE = 10
-FORMULA_TRANSPARENT = YES
-USE_MATHJAX = NO
-MATHJAX_FORMAT = HTML-CSS
-MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
-MATHJAX_EXTENSIONS =
-MATHJAX_CODEFILE =
-SEARCHENGINE = YES
-SERVER_BASED_SEARCH = NO
-EXTERNAL_SEARCH = NO
-SEARCHENGINE_URL =
-SEARCHDATA_FILE = searchdata.xml
-EXTERNAL_SEARCH_ID =
-EXTRA_SEARCH_MAPPINGS =
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4
-EXTRA_PACKAGES =
-LATEX_HEADER =
-LATEX_FOOTER =
-LATEX_EXTRA_STYLESHEET =
-LATEX_EXTRA_FILES =
-PDF_HYPERLINKS = YES
-USE_PDFLATEX = YES
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-LATEX_SOURCE_CODE = NO
-LATEX_BIB_STYLE = plain
-LATEX_TIMESTAMP = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-RTF_SOURCE_CODE = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_SUBDIR =
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-XML_OUTPUT = xml
-XML_PROGRAMLISTING = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-GENERATE_DOCBOOK = NO
-DOCBOOK_OUTPUT = docbook
-DOCBOOK_PROGRAMLISTING = NO
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-EXTERNAL_PAGES = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-MSCGEN_PATH =
-DIA_PATH =
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = YES
-DOT_NUM_THREADS = 0
-DOT_FONTNAME = Helvetica
-DOT_FONTSIZE = 10
-DOT_FONTPATH =
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-GROUP_GRAPHS = YES
-UML_LOOK = NO
-UML_LIMIT_NUM_FIELDS = 10
-TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-CALLER_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DIRECTORY_GRAPH = YES
-DOT_IMAGE_FORMAT = png
-INTERACTIVE_SVG = NO
-DOT_PATH =
-DOTFILE_DIRS =
-MSCFILE_DIRS =
-DIAFILE_DIRS =
-PLANTUML_JAR_PATH =
-PLANTUML_CFG_FILE =
-PLANTUML_INCLUDE_PATH =
-DOT_GRAPH_MAX_NODES = 50
-MAX_DOT_GRAPH_DEPTH = 0
-DOT_TRANSPARENT = NO
-DOT_MULTI_TARGETS = NO
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
diff --git a/feed/app/ethswbox/src/switch_hostapi/doc/footer.html b/feed/app/ethswbox/src/switch_hostapi/doc/footer.html
deleted file mode 100644
index a24bf2b..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/doc/footer.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!-- HTML footer for doxygen 1.8.13-->
-<!-- start footer part -->
-<!--BEGIN GENERATE_TREEVIEW-->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- $navpath
- <li class="footer">$generatedby
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
- </ul>
-</div>
-<!--END GENERATE_TREEVIEW-->
-<!--BEGIN !GENERATE_TREEVIEW-->
-<hr class="footer"/><address class="footer"><small>
-$generatedby  <a href="http://www.doxygen.org/index.html">
-<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
-</a> $doxygenversion
-</small></address>
-<!--END !GENERATE_TREEVIEW-->
-</body>
-</html>
diff --git a/feed/app/ethswbox/src/switch_hostapi/doc/header.html b/feed/app/ethswbox/src/switch_hostapi/doc/header.html
deleted file mode 100644
index 13af98a..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/doc/header.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!-- HTML header for doxygen 1.8.13-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen $doxygenversion"/>
-<meta name="viewport" content="width=device-width, initial-scale=1"/>
-<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
-<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
-<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="$relpath^jquery.js"></script>
-<script type="text/javascript" src="$relpath^dynsections.js"></script>
-$treeview
-$search
-$mathjax
-<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
-$extrastylesheet
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-
-<!--BEGIN TITLEAREA-->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <!--BEGIN PROJECT_LOGO-->
- <td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
- <!--END PROJECT_LOGO-->
- <!--BEGIN PROJECT_NAME-->
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">$projectname
- <!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">$projectnumber</span><!--END PROJECT_NUMBER-->
- </div>
- <!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
- </td>
- <!--END PROJECT_NAME-->
- <!--BEGIN !PROJECT_NAME-->
- <!--BEGIN PROJECT_BRIEF-->
- <td style="padding-left: 0.5em;">
- <div id="projectbrief">$projectbrief</div>
- </td>
- <!--END PROJECT_BRIEF-->
- <!--END !PROJECT_NAME-->
- <!--BEGIN DISABLE_INDEX-->
- <!--BEGIN SEARCHENGINE-->
- <td>$searchbox</td>
- <!--END SEARCHENGINE-->
- <!--END DISABLE_INDEX-->
- </tr>
- </tbody>
-</table>
-</div>
-<!--END TITLEAREA-->
-<!-- end header part -->
diff --git a/feed/app/ethswbox/src/switch_hostapi/doc/stylesheet.css b/feed/app/ethswbox/src/switch_hostapi/doc/stylesheet.css
deleted file mode 100644
index 4f1ab91..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/doc/stylesheet.css
+++ /dev/null
@@ -1,1596 +0,0 @@
-/* The standard CSS for doxygen 1.8.13 */
-
-body, table, div, p, dl {
- font: 400 14px/22px Roboto,sans-serif;
-}
-
-p.reference, p.definition {
- font: 400 14px/22px Roboto,sans-serif;
-}
-
-/* @group Heading Levels */
-
-h1.groupheader {
- font-size: 150%;
-}
-
-.title {
- font: 400 14px/28px Roboto,sans-serif;
- font-size: 150%;
- font-weight: bold;
- margin: 10px 2px;
-}
-
-h2.groupheader {
- border-bottom: 1px solid #879ECB;
- color: #354C7B;
- font-size: 150%;
- font-weight: normal;
- margin-top: 1.75em;
- padding-top: 8px;
- padding-bottom: 4px;
- width: 100%;
-}
-
-h3.groupheader {
- font-size: 100%;
-}
-
-h1, h2, h3, h4, h5, h6 {
- -webkit-transition: text-shadow 0.5s linear;
- -moz-transition: text-shadow 0.5s linear;
- -ms-transition: text-shadow 0.5s linear;
- -o-transition: text-shadow 0.5s linear;
- transition: text-shadow 0.5s linear;
- margin-right: 15px;
-}
-
-h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow {
- text-shadow: 0 0 15px cyan;
-}
-
-dt {
- font-weight: bold;
-}
-
-div.multicol {
- -moz-column-gap: 1em;
- -webkit-column-gap: 1em;
- -moz-column-count: 3;
- -webkit-column-count: 3;
-}
-
-p.startli, p.startdd {
- margin-top: 2px;
-}
-
-p.starttd {
- margin-top: 0px;
-}
-
-p.endli {
- margin-bottom: 0px;
-}
-
-p.enddd {
- margin-bottom: 4px;
-}
-
-p.endtd {
- margin-bottom: 2px;
-}
-
-/* @end */
-
-caption {
- font-weight: bold;
-}
-
-span.legend {
- font-size: 70%;
- text-align: center;
-}
-
-h3.version {
- font-size: 90%;
- text-align: center;
-}
-
-div.qindex, div.navtab{
- background-color: #EBEFF6;
- border: 1px solid #A3B4D7;
- text-align: center;
-}
-
-div.qindex, div.navpath {
- width: 100%;
- line-height: 140%;
-}
-
-div.navtab {
- margin-right: 15px;
-}
-
-/* @group Link Styling */
-
-a {
- color: #3D578C;
- font-weight: normal;
- text-decoration: none;
-}
-
-.contents a:visited {
- color: #4665A2;
-}
-
-a:hover {
- text-decoration: underline;
-}
-
-a.qindex {
- font-weight: bold;
-}
-
-a.qindexHL {
- font-weight: bold;
- background-color: #9CAFD4;
- color: #ffffff;
- border: 1px double #869DCA;
-}
-
-.contents a.qindexHL:visited {
- color: #ffffff;
-}
-
-a.el {
- font-weight: bold;
-}
-
-a.elRef {
-}
-
-a.code, a.code:visited, a.line, a.line:visited {
- color: #4665A2;
-}
-
-a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited {
- color: #4665A2;
-}
-
-/* @end */
-
-dl.el {
- margin-left: -1cm;
-}
-
-pre.fragment {
- border: 1px solid #C4CFE5;
- background-color: #FBFCFD;
- padding: 4px 6px;
- margin: 4px 8px 4px 2px;
- overflow: auto;
- word-wrap: break-word;
- font-size: 9pt;
- line-height: 125%;
- font-family: monospace, fixed;
- font-size: 105%;
-}
-
-div.fragment {
- padding: 0px;
- margin: 4px 8px 4px 2px;
- background-color: #FBFCFD;
- border: 1px solid #C4CFE5;
-}
-
-div.line {
- font-family: monospace, fixed;
- font-size: 13px;
- min-height: 13px;
- line-height: 1.0;
- text-wrap: unrestricted;
- white-space: -moz-pre-wrap; /* Moz */
- white-space: -pre-wrap; /* Opera 4-6 */
- white-space: -o-pre-wrap; /* Opera 7 */
- white-space: pre-wrap; /* CSS3 */
- word-wrap: break-word; /* IE 5.5+ */
- text-indent: -53px;
- padding-left: 53px;
- padding-bottom: 0px;
- margin: 0px;
- -webkit-transition-property: background-color, box-shadow;
- -webkit-transition-duration: 0.5s;
- -moz-transition-property: background-color, box-shadow;
- -moz-transition-duration: 0.5s;
- -ms-transition-property: background-color, box-shadow;
- -ms-transition-duration: 0.5s;
- -o-transition-property: background-color, box-shadow;
- -o-transition-duration: 0.5s;
- transition-property: background-color, box-shadow;
- transition-duration: 0.5s;
-}
-
-div.line:after {
- content:"\000A";
- white-space: pre;
-}
-
-div.line.glow {
- background-color: cyan;
- box-shadow: 0 0 10px cyan;
-}
-
-
-span.lineno {
- padding-right: 4px;
- text-align: right;
- border-right: 2px solid #0F0;
- background-color: #E8E8E8;
- white-space: pre;
-}
-span.lineno a {
- background-color: #D8D8D8;
-}
-
-span.lineno a:hover {
- background-color: #C8C8C8;
-}
-
-.lineno {
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-div.ah, span.ah {
- background-color: black;
- font-weight: bold;
- color: #ffffff;
- margin-bottom: 3px;
- margin-top: 3px;
- padding: 0.2em;
- border: solid thin #333;
- border-radius: 0.5em;
- -webkit-border-radius: .5em;
- -moz-border-radius: .5em;
- box-shadow: 2px 2px 3px #999;
- -webkit-box-shadow: 2px 2px 3px #999;
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
- background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%);
-}
-
-div.classindex ul {
- list-style: none;
- padding-left: 0;
-}
-
-div.classindex span.ai {
- display: inline-block;
-}
-
-div.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- font-weight: bold;
-}
-
-div.groupText {
- margin-left: 16px;
- font-style: italic;
-}
-
-body {
- background-color: white;
- color: black;
- margin: 0;
-}
-
-div.contents {
- margin-top: 10px;
- margin-left: 12px;
- margin-right: 8px;
-}
-
-td.indexkey {
- background-color: #EBEFF6;
- font-weight: bold;
- border: 1px solid #C4CFE5;
- margin: 2px 0px 2px 0;
- padding: 2px 10px;
- white-space: nowrap;
- vertical-align: top;
-}
-
-td.indexvalue {
- background-color: #EBEFF6;
- border: 1px solid #C4CFE5;
- padding: 2px 10px;
- margin: 2px 0px;
-}
-
-tr.memlist {
- background-color: #EEF1F7;
-}
-
-p.formulaDsp {
- text-align: center;
-}
-
-img.formulaDsp {
-
-}
-
-img.formulaInl {
- vertical-align: middle;
-}
-
-div.center {
- text-align: center;
- margin-top: 0px;
- margin-bottom: 0px;
- padding: 0px;
-}
-
-div.center img {
- border: 0px;
-}
-
-address.footer {
- text-align: right;
- padding-right: 12px;
-}
-
-img.footer {
- border: 0px;
- vertical-align: middle;
-}
-
-/* @group Code Colorization */
-
-span.keyword {
- color: #008000
-}
-
-span.keywordtype {
- color: #604020
-}
-
-span.keywordflow {
- color: #e08000
-}
-
-span.comment {
- color: #800000
-}
-
-span.preprocessor {
- color: #806020
-}
-
-span.stringliteral {
- color: #002080
-}
-
-span.charliteral {
- color: #008080
-}
-
-span.vhdldigit {
- color: #ff00ff
-}
-
-span.vhdlchar {
- color: #000000
-}
-
-span.vhdlkeyword {
- color: #700070
-}
-
-span.vhdllogic {
- color: #ff0000
-}
-
-blockquote {
- background-color: #F7F8FB;
- border-left: 2px solid #9CAFD4;
- margin: 0 24px 0 4px;
- padding: 0 12px 0 16px;
-}
-
-/* @end */
-
-/*
-.search {
- color: #003399;
- font-weight: bold;
-}
-
-form.search {
- margin-bottom: 0px;
- margin-top: 0px;
-}
-
-input.search {
- font-size: 75%;
- color: #000080;
- font-weight: normal;
- background-color: #e8eef2;
-}
-*/
-
-td.tiny {
- font-size: 75%;
-}
-
-.dirtab {
- padding: 4px;
- border-collapse: collapse;
- border: 1px solid #A3B4D7;
-}
-
-th.dirtab {
- background: #EBEFF6;
- font-weight: bold;
-}
-
-hr {
- height: 0px;
- border: none;
- border-top: 1px solid #4A6AAA;
-}
-
-hr.footer {
- height: 1px;
-}
-
-/* @group Member Descriptions */
-
-table.memberdecls {
- border-spacing: 0px;
- padding: 0px;
-}
-
-.memberdecls td, .fieldtable tr {
- -webkit-transition-property: background-color, box-shadow;
- -webkit-transition-duration: 0.5s;
- -moz-transition-property: background-color, box-shadow;
- -moz-transition-duration: 0.5s;
- -ms-transition-property: background-color, box-shadow;
- -ms-transition-duration: 0.5s;
- -o-transition-property: background-color, box-shadow;
- -o-transition-duration: 0.5s;
- transition-property: background-color, box-shadow;
- transition-duration: 0.5s;
-}
-
-.memberdecls td.glow, .fieldtable tr.glow {
- background-color: cyan;
- box-shadow: 0 0 15px cyan;
-}
-
-.mdescLeft, .mdescRight,
-.memItemLeft, .memItemRight,
-.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
- background-color: #F9FAFC;
- border: none;
- margin: 4px;
- padding: 1px 0 0 8px;
-}
-
-.mdescLeft, .mdescRight {
- padding: 0px 8px 4px 8px;
- color: #555;
-}
-
-.memSeparator {
- border-bottom: 1px solid #DEE4F0;
- line-height: 1px;
- margin: 0px;
- padding: 0px;
-}
-
-.memItemLeft, .memTemplItemLeft {
- white-space: nowrap;
-}
-
-.memItemRight {
- width: 100%;
-}
-
-.memTemplParams {
- color: #4665A2;
- white-space: nowrap;
- font-size: 80%;
-}
-
-/* @end */
-
-/* @group Member Details */
-
-/* Styles for detailed member documentation */
-
-.memtitle {
- padding: 8px;
- border-top: 1px solid #A8B8D9;
- border-left: 1px solid #A8B8D9;
- border-right: 1px solid #A8B8D9;
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- margin-bottom: -1px;
- background-image: url('nav_f.png');
- background-repeat: repeat-x;
- background-color: #E2E8F2;
- line-height: 1.25;
- font-weight: 300;
- float:left;
-}
-
-.permalink
-{
- font-size: 65%;
- display: inline-block;
- vertical-align: middle;
-}
-
-.memtemplate {
- font-size: 80%;
- color: #4665A2;
- font-weight: normal;
- margin-left: 9px;
-}
-
-.memnav {
- background-color: #EBEFF6;
- border: 1px solid #A3B4D7;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
-}
-
-.mempage {
- width: 100%;
-}
-
-.memitem {
- padding: 0;
- margin-bottom: 10px;
- margin-right: 5px;
- -webkit-transition: box-shadow 0.5s linear;
- -moz-transition: box-shadow 0.5s linear;
- -ms-transition: box-shadow 0.5s linear;
- -o-transition: box-shadow 0.5s linear;
- transition: box-shadow 0.5s linear;
- display: table !important;
- width: 100%;
-}
-
-.memitem.glow {
- box-shadow: 0 0 15px cyan;
-}
-
-.memname {
- font-weight: 400;
- margin-left: 6px;
-}
-
-.memname td {
- vertical-align: bottom;
-}
-
-.memproto, dl.reflist dt {
- border-top: 1px solid #A8B8D9;
- border-left: 1px solid #A8B8D9;
- border-right: 1px solid #A8B8D9;
- padding: 6px 0px 6px 0px;
- color: #253555;
- font-weight: bold;
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
- background-color: #DFE5F1;
- /* opera specific markup */
- box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- border-top-right-radius: 4px;
- /* firefox specific markup */
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
- -moz-border-radius-topright: 4px;
- /* webkit specific markup */
- -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- -webkit-border-top-right-radius: 4px;
-
-}
-
-.overload {
- font-family: "courier new",courier,monospace;
- font-size: 65%;
-}
-
-.memdoc, dl.reflist dd {
- border-bottom: 1px solid #A8B8D9;
- border-left: 1px solid #A8B8D9;
- border-right: 1px solid #A8B8D9;
- padding: 6px 10px 2px 10px;
- background-color: #FBFCFD;
- border-top-width: 0;
- background-image:url('nav_g.png');
- background-repeat:repeat-x;
- background-color: #FFFFFF;
- /* opera specific markup */
- border-bottom-left-radius: 4px;
- border-bottom-right-radius: 4px;
- box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- /* firefox specific markup */
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-bottomright: 4px;
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
- /* webkit specific markup */
- -webkit-border-bottom-left-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-}
-
-dl.reflist dt {
- padding: 5px;
-}
-
-dl.reflist dd {
- margin: 0px 0px 10px 0px;
- padding: 5px;
-}
-
-.paramkey {
- text-align: right;
-}
-
-.paramtype {
- white-space: nowrap;
-}
-
-.paramname {
- color: #602020;
- white-space: nowrap;
-}
-.paramname em {
- font-style: normal;
-}
-.paramname code {
- line-height: 14px;
-}
-
-.params, .retval, .exception, .tparams {
- margin-left: 0px;
- padding-left: 0px;
-}
-
-.params .paramname, .retval .paramname {
- font-weight: bold;
- vertical-align: top;
-}
-
-.params .paramtype {
- font-style: italic;
- vertical-align: top;
-}
-
-.params .paramdir {
- font-family: "courier new",courier,monospace;
- vertical-align: top;
-}
-
-table.mlabels {
- border-spacing: 0px;
-}
-
-td.mlabels-left {
- width: 100%;
- padding: 0px;
-}
-
-td.mlabels-right {
- vertical-align: bottom;
- padding: 0px;
- white-space: nowrap;
-}
-
-span.mlabels {
- margin-left: 8px;
-}
-
-span.mlabel {
- background-color: #728DC1;
- border-top:1px solid #5373B4;
- border-left:1px solid #5373B4;
- border-right:1px solid #C4CFE5;
- border-bottom:1px solid #C4CFE5;
- text-shadow: none;
- color: white;
- margin-right: 4px;
- padding: 2px 3px;
- border-radius: 3px;
- font-size: 7pt;
- white-space: nowrap;
- vertical-align: middle;
-}
-
-
-
-/* @end */
-
-/* these are for tree view inside a (index) page */
-
-div.directory {
- margin: 10px 0px;
- border-top: 1px solid #9CAFD4;
- border-bottom: 1px solid #9CAFD4;
- width: 100%;
-}
-
-.directory table {
- border-collapse:collapse;
-}
-
-.directory td {
- margin: 0px;
- padding: 0px;
- vertical-align: top;
-}
-
-.directory td.entry {
- white-space: nowrap;
- padding-right: 6px;
- padding-top: 3px;
-}
-
-.directory td.entry a {
- outline:none;
-}
-
-.directory td.entry a img {
- border: none;
-}
-
-.directory td.desc {
- width: 100%;
- padding-left: 6px;
- padding-right: 6px;
- padding-top: 3px;
- border-left: 1px solid rgba(0,0,0,0.05);
-}
-
-.directory tr.even {
- padding-left: 6px;
- background-color: #F7F8FB;
-}
-
-.directory img {
- vertical-align: -30%;
-}
-
-.directory .levels {
- white-space: nowrap;
- width: 100%;
- text-align: right;
- font-size: 9pt;
-}
-
-.directory .levels span {
- cursor: pointer;
- padding-left: 2px;
- padding-right: 2px;
- color: #3D578C;
-}
-
-.arrow {
- color: #9CAFD4;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- cursor: pointer;
- font-size: 80%;
- display: inline-block;
- width: 16px;
- height: 22px;
-}
-
-.icon {
- font-family: Arial, Helvetica;
- font-weight: bold;
- font-size: 12px;
- height: 14px;
- width: 16px;
- display: inline-block;
- background-color: #728DC1;
- color: white;
- text-align: center;
- border-radius: 4px;
- margin-left: 2px;
- margin-right: 2px;
-}
-
-.icona {
- width: 24px;
- height: 22px;
- display: inline-block;
-}
-
-.iconfopen {
- width: 24px;
- height: 18px;
- margin-bottom: 4px;
- background-image:url('folderopen.png');
- background-position: 0px -4px;
- background-repeat: repeat-y;
- vertical-align:top;
- display: inline-block;
-}
-
-.iconfclosed {
- width: 24px;
- height: 18px;
- margin-bottom: 4px;
- background-image:url('folderclosed.png');
- background-position: 0px -4px;
- background-repeat: repeat-y;
- vertical-align:top;
- display: inline-block;
-}
-
-.icondoc {
- width: 24px;
- height: 18px;
- margin-bottom: 4px;
- background-image:url('doc.png');
- background-position: 0px -4px;
- background-repeat: repeat-y;
- vertical-align:top;
- display: inline-block;
-}
-
-table.directory {
- font: 400 14px Roboto,sans-serif;
-}
-
-/* @end */
-
-div.dynheader {
- margin-top: 8px;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-address {
- font-style: normal;
- color: #2A3D61;
-}
-
-table.doxtable caption {
- caption-side: top;
-}
-
-table.doxtable {
- border-collapse:collapse;
- margin-top: 4px;
- margin-bottom: 4px;
-}
-
-table.doxtable td, table.doxtable th {
- border: 1px solid #2D4068;
- padding: 3px 7px 2px;
-}
-
-table.doxtable th {
- background-color: #374F7F;
- color: #FFFFFF;
- font-size: 110%;
- padding-bottom: 4px;
- padding-top: 5px;
-}
-
-table.fieldtable {
- /*width: 100%;*/
- margin-bottom: 10px;
- border: 1px solid #A8B8D9;
- border-spacing: 0px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
- -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
- box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
-}
-
-.fieldtable td, .fieldtable th {
- padding: 3px 7px 2px;
-}
-
-.fieldtable td.fieldtype, .fieldtable td.fieldname {
- white-space: nowrap;
- border-right: 1px solid #A8B8D9;
- border-bottom: 1px solid #A8B8D9;
- vertical-align: top;
-}
-
-.fieldtable td.fieldname {
- padding-top: 3px;
-}
-
-.fieldtable td.fielddoc {
- border-bottom: 1px solid #A8B8D9;
- /*width: 100%;*/
-}
-
-.fieldtable td.fielddoc p:first-child {
- margin-top: 0px;
-}
-
-.fieldtable td.fielddoc p:last-child {
- margin-bottom: 2px;
-}
-
-.fieldtable tr:last-child td {
- border-bottom: none;
-}
-
-.fieldtable th {
- background-image:url('nav_f.png');
- background-repeat:repeat-x;
- background-color: #E2E8F2;
- font-size: 90%;
- color: #253555;
- padding-bottom: 4px;
- padding-top: 5px;
- text-align:left;
- font-weight: 400;
- -moz-border-radius-topleft: 4px;
- -moz-border-radius-topright: 4px;
- -webkit-border-top-left-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-bottom: 1px solid #A8B8D9;
-}
-
-
-.tabsearch {
- top: 0px;
- left: 10px;
- height: 36px;
- background-image: url('tab_b.png');
- z-index: 101;
- overflow: hidden;
- font-size: 13px;
-}
-
-.navpath ul
-{
- font-size: 11px;
- background-image:url('tab_b.png');
- background-repeat:repeat-x;
- background-position: 0 -5px;
- height:30px;
- line-height:30px;
- color:#8AA0CC;
- border:solid 1px #C2CDE4;
- overflow:hidden;
- margin:0px;
- padding:0px;
-}
-
-.navpath li
-{
- list-style-type:none;
- float:left;
- padding-left:10px;
- padding-right:15px;
- background-image:url('bc_s.png');
- background-repeat:no-repeat;
- background-position:right;
- color:#364D7C;
-}
-
-.navpath li.navelem a
-{
- height:32px;
- display:block;
- text-decoration: none;
- outline: none;
- color: #283A5D;
- font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
- text-decoration: none;
-}
-
-.navpath li.navelem a:hover
-{
- color:#6884BD;
-}
-
-.navpath li.footer
-{
- list-style-type:none;
- float:right;
- padding-left:10px;
- padding-right:15px;
- background-image:none;
- background-repeat:no-repeat;
- background-position:right;
- color:#364D7C;
- font-size: 8pt;
-}
-
-
-div.summary
-{
- float: right;
- font-size: 8pt;
- padding-right: 5px;
- width: 50%;
- text-align: right;
-}
-
-div.summary a
-{
- white-space: nowrap;
-}
-
-table.classindex
-{
- margin: 10px;
- white-space: nowrap;
- margin-left: 3%;
- margin-right: 3%;
- width: 94%;
- border: 0;
- border-spacing: 0;
- padding: 0;
-}
-
-div.ingroups
-{
- font-size: 8pt;
- width: 50%;
- text-align: left;
-}
-
-div.ingroups a
-{
- white-space: nowrap;
-}
-
-div.header
-{
- background-image:url('nav_h.png');
- background-repeat:repeat-x;
- background-color: #F9FAFC;
- margin: 0px;
- border-bottom: 1px solid #C4CFE5;
-}
-
-div.headertitle
-{
- padding: 5px 5px 5px 10px;
-}
-
-dl
-{
- padding: 0 0 0 10px;
-}
-
-/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
-dl.section
-{
- margin-left: 0px;
- padding-left: 0px;
-}
-
-dl.note
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #D0C000;
-}
-
-dl.warning, dl.attention
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #FF0000;
-}
-
-dl.pre, dl.post, dl.invariant
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #00D000;
-}
-
-dl.deprecated
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #505050;
-}
-
-dl.todo
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #00C0E0;
-}
-
-dl.test
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #3030E0;
-}
-
-dl.bug
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #C08050;
-}
-
-dl.section dd {
- margin-bottom: 6px;
-}
-
-
-#projectlogo
-{
- text-align: center;
- vertical-align: bottom;
- border-collapse: separate;
-}
-
-#projectlogo img
-{
- border: 0px none;
-}
-
-#projectalign
-{
- vertical-align: middle;
-}
-
-#projectname
-{
- font: 300% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 2px 0px;
-}
-
-#projectbrief
-{
- font: 120% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 0px;
-}
-
-#projectnumber
-{
- font: 50% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 0px;
-}
-
-#titlearea
-{
- padding: 0px;
- margin: 0px;
- width: 100%;
- border-bottom: 1px solid #5373B4;
-}
-
-.image
-{
- text-align: center;
-}
-
-.dotgraph
-{
- text-align: center;
-}
-
-.mscgraph
-{
- text-align: center;
-}
-
-.plantumlgraph
-{
- text-align: center;
-}
-
-.diagraph
-{
- text-align: center;
-}
-
-.caption
-{
- font-weight: bold;
-}
-
-div.zoom
-{
- border: 1px solid #90A5CE;
-}
-
-dl.citelist {
- margin-bottom:50px;
-}
-
-dl.citelist dt {
- color:#334975;
- float:left;
- font-weight:bold;
- margin-right:10px;
- padding:5px;
-}
-
-dl.citelist dd {
- margin:2px 0;
- padding:5px 0;
-}
-
-div.toc {
- padding: 14px 25px;
- background-color: #F4F6FA;
- border: 1px solid #D8DFEE;
- border-radius: 7px 7px 7px 7px;
- float: right;
- height: auto;
- margin: 0 8px 10px 10px;
- width: 200px;
-}
-
-div.toc li {
- background: url("bdwn.png") no-repeat scroll 0 5px transparent;
- font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
- margin-top: 5px;
- padding-left: 10px;
- padding-top: 2px;
-}
-
-div.toc h3 {
- font: bold 12px/1.2 Arial,FreeSans,sans-serif;
- color: #4665A2;
- border-bottom: 0 none;
- margin: 0;
-}
-
-div.toc ul {
- list-style: none outside none;
- border: medium none;
- padding: 0px;
-}
-
-div.toc li.level1 {
- margin-left: 0px;
-}
-
-div.toc li.level2 {
- margin-left: 15px;
-}
-
-div.toc li.level3 {
- margin-left: 30px;
-}
-
-div.toc li.level4 {
- margin-left: 45px;
-}
-
-.inherit_header {
- font-weight: bold;
- color: gray;
- cursor: pointer;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.inherit_header td {
- padding: 6px 0px 2px 5px;
-}
-
-.inherit {
- display: none;
-}
-
-tr.heading h2 {
- margin-top: 12px;
- margin-bottom: 4px;
-}
-
-/* tooltip related style info */
-
-.ttc {
- position: absolute;
- display: none;
-}
-
-#powerTip {
- cursor: default;
- white-space: nowrap;
- background-color: white;
- border: 1px solid gray;
- border-radius: 4px 4px 4px 4px;
- box-shadow: 1px 1px 7px gray;
- display: none;
- font-size: smaller;
- max-width: 80%;
- opacity: 0.9;
- padding: 1ex 1em 1em;
- position: absolute;
- z-index: 2147483647;
-}
-
-#powerTip div.ttdoc {
- color: grey;
- font-style: italic;
-}
-
-#powerTip div.ttname a {
- font-weight: bold;
-}
-
-#powerTip div.ttname {
- font-weight: bold;
-}
-
-#powerTip div.ttdeci {
- color: #006318;
-}
-
-#powerTip div {
- margin: 0px;
- padding: 0px;
- font: 12px/16px Roboto,sans-serif;
-}
-
-#powerTip:before, #powerTip:after {
- content: "";
- position: absolute;
- margin: 0px;
-}
-
-#powerTip.n:after, #powerTip.n:before,
-#powerTip.s:after, #powerTip.s:before,
-#powerTip.w:after, #powerTip.w:before,
-#powerTip.e:after, #powerTip.e:before,
-#powerTip.ne:after, #powerTip.ne:before,
-#powerTip.se:after, #powerTip.se:before,
-#powerTip.nw:after, #powerTip.nw:before,
-#powerTip.sw:after, #powerTip.sw:before {
- border: solid transparent;
- content: " ";
- height: 0;
- width: 0;
- position: absolute;
-}
-
-#powerTip.n:after, #powerTip.s:after,
-#powerTip.w:after, #powerTip.e:after,
-#powerTip.nw:after, #powerTip.ne:after,
-#powerTip.sw:after, #powerTip.se:after {
- border-color: rgba(255, 255, 255, 0);
-}
-
-#powerTip.n:before, #powerTip.s:before,
-#powerTip.w:before, #powerTip.e:before,
-#powerTip.nw:before, #powerTip.ne:before,
-#powerTip.sw:before, #powerTip.se:before {
- border-color: rgba(128, 128, 128, 0);
-}
-
-#powerTip.n:after, #powerTip.n:before,
-#powerTip.ne:after, #powerTip.ne:before,
-#powerTip.nw:after, #powerTip.nw:before {
- top: 100%;
-}
-
-#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after {
- border-top-color: #ffffff;
- border-width: 10px;
- margin: 0px -10px;
-}
-#powerTip.n:before {
- border-top-color: #808080;
- border-width: 11px;
- margin: 0px -11px;
-}
-#powerTip.n:after, #powerTip.n:before {
- left: 50%;
-}
-
-#powerTip.nw:after, #powerTip.nw:before {
- right: 14px;
-}
-
-#powerTip.ne:after, #powerTip.ne:before {
- left: 14px;
-}
-
-#powerTip.s:after, #powerTip.s:before,
-#powerTip.se:after, #powerTip.se:before,
-#powerTip.sw:after, #powerTip.sw:before {
- bottom: 100%;
-}
-
-#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after {
- border-bottom-color: #ffffff;
- border-width: 10px;
- margin: 0px -10px;
-}
-
-#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before {
- border-bottom-color: #808080;
- border-width: 11px;
- margin: 0px -11px;
-}
-
-#powerTip.s:after, #powerTip.s:before {
- left: 50%;
-}
-
-#powerTip.sw:after, #powerTip.sw:before {
- right: 14px;
-}
-
-#powerTip.se:after, #powerTip.se:before {
- left: 14px;
-}
-
-#powerTip.e:after, #powerTip.e:before {
- left: 100%;
-}
-#powerTip.e:after {
- border-left-color: #ffffff;
- border-width: 10px;
- top: 50%;
- margin-top: -10px;
-}
-#powerTip.e:before {
- border-left-color: #808080;
- border-width: 11px;
- top: 50%;
- margin-top: -11px;
-}
-
-#powerTip.w:after, #powerTip.w:before {
- right: 100%;
-}
-#powerTip.w:after {
- border-right-color: #ffffff;
- border-width: 10px;
- top: 50%;
- margin-top: -10px;
-}
-#powerTip.w:before {
- border-right-color: #808080;
- border-width: 11px;
- top: 50%;
- margin-top: -11px;
-}
-
-@media print
-{
- #top { display: none; }
- #side-nav { display: none; }
- #nav-path { display: none; }
- body { overflow:visible; }
- h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
- .summary { display: none; }
- .memitem { page-break-inside: avoid; }
- #doc-content
- {
- margin-left:0 !important;
- height:auto !important;
- width:auto !important;
- overflow:inherit;
- display:inline;
- }
-}
-
-/* @group Markdown */
-
-/*
-table.markdownTable {
- border-collapse:collapse;
- margin-top: 4px;
- margin-bottom: 4px;
-}
-
-table.markdownTable td, table.markdownTable th {
- border: 1px solid #2D4068;
- padding: 3px 7px 2px;
-}
-
-table.markdownTableHead tr {
-}
-
-table.markdownTableBodyLeft td, table.markdownTable th {
- border: 1px solid #2D4068;
- padding: 3px 7px 2px;
-}
-
-th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone {
- background-color: #374F7F;
- color: #FFFFFF;
- font-size: 110%;
- padding-bottom: 4px;
- padding-top: 5px;
-}
-
-th.markdownTableHeadLeft {
- text-align: left
-}
-
-th.markdownTableHeadRight {
- text-align: right
-}
-
-th.markdownTableHeadCenter {
- text-align: center
-}
-*/
-
-table.markdownTable {
- border-collapse:collapse;
- margin-top: 4px;
- margin-bottom: 4px;
-}
-
-table.markdownTable td, table.markdownTable th {
- border: 1px solid #2D4068;
- padding: 3px 7px 2px;
-}
-
-table.markdownTable tr {
-}
-
-th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone {
- background-color: #374F7F;
- color: #FFFFFF;
- font-size: 110%;
- padding-bottom: 4px;
- padding-top: 5px;
-}
-
-th.markdownTableHeadLeft, td.markdownTableBodyLeft {
- text-align: left
-}
-
-th.markdownTableHeadRight, td.markdownTableBodyRight {
- text-align: right
-}
-
-th.markdownTableHeadCenter, td.markdownTableBodyCenter {
- text-align: center
-}
-
-
-/* @end */
diff --git a/feed/app/ethswbox/src/switch_hostapi/doc/switch_api.chm b/feed/app/ethswbox/src/switch_hostapi/doc/switch_api.chm
deleted file mode 100644
index 9c82c12..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/doc/switch_api.chm
+++ /dev/null
Binary files differ
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gpy/gpy2xx.h b/feed/app/ethswbox/src/switch_hostapi/include/gpy/gpy2xx.h
index 11132ca..b90bdd8 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gpy/gpy2xx.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gpy/gpy2xx.h
@@ -11,6 +11,7 @@
#define _GPY2XX_H_
#include <errno.h>
+#include <gsw_types.h>
#ifndef IS_ENABLED
#define IS_ENABLED(x) 0
@@ -19,23 +20,33 @@
#pragma pack(push, 1)
#pragma scalar_storage_order little-endian
+typedef i64 time64_t;
+
+struct timespec64 {
+ time64_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+
+
/** \mainpage GPY APIs
\section intro_sec Introduction
- The Intel Ethernet Network Connection GPY API device is a
+ The Maxlinear Ethernet Network Connection GPY API device is a
multi-mode Gigabit Ethernet (GbE) transceiver integrated circuit,
supporting speeds of 10, 100, 1000 and 2500 Mbps. It supports 10BASE-Te,
100BASE-TX, 1000BASE-T and 2.5GBASE-T standards and is characterized by
- low power consumption. Power savings at the system level are introduced using
- the Wake-on-LAN feature.
+ low power consumption. Power savings at the system level are introduced
+ using the Wake-on-LAN feature.
- Ethernet PHYs are controlled over the MDIO interface and the base functionality is
- usually provided by the network stack and the MDIO driver of the operating system.
+ Ethernet PHYs are controlled over the MDIO interface and the base
+ functionality is usually provided by the network stack and the MDIO driver
+ of the operating system.
- The GPY API allows to make use of additional functionality, which is not provided
- by the operating system, to speed up integration of the GPY device and to to ensure
- correct configuration of features. The GPY API is intended to be used in user space,
- but can be used also in kernel space with minor adaptations and based on customer requirements.
+ The GPY API allows to make use of additional functionality, which is not
+ provided by the operating system, to speed up integration of the GPY device
+ and to to ensure correct configuration of features. The GPY API is intended
+ to be used in user space, but can be used also in kernel space with minor
+ adaptations and based on customer requirements.
*/
/** \defgroup GPY2XX_API GPY2xx APIs
@@ -70,16 +81,16 @@
*/
/** \defgroup GPY2XX_LINK_SPEED Link Speed
- \brief Group of macros for link speed configuration via \ref gpy2xx_link in APIs \ref gpy2xx_setup_forced,
- \ref gpy2xx_config_aneg and \ref gpy2xx_sgmii_config_aneg.
+ \brief Group of macros for link speed configuration via \ref gpy2xx_link in APIs \ref gpy2xx_setup_forced
+ and \ref gpy2xx_config_aneg.
@cond SUBGROUPING
@ingroup GPY2XX_LINK_API
@endcond
*/
/** \defgroup GPY2XX_LINK_DUPLEX Duplex
- \brief Group of macros for duplex mode configuration via \ref gpy2xx_link in APIs \ref gpy2xx_setup_forced,
- \ref gpy2xx_config_aneg and \ref gpy2xx_sgmii_config_aneg.
+ \brief Group of macros for duplex mode configuration via \ref gpy2xx_link in APIs \ref gpy2xx_setup_forced
+ and \ref gpy2xx_config_aneg.
@cond SUBGROUPING
@ingroup GPY2XX_LINK_API
@endcond
@@ -97,14 +108,11 @@
\brief Group of functional APIs for diagnosis and test.
*/
+/** @cond DOC_ENABLE_SYNCE */
/** \defgroup GPY2XX_SYNCE Synchronous Ethernet (SyncE) Config APIs.
\brief Group of functional APIs for Synchronous Ethernet (SyncE) configuration.
- Note: Not supported on GPHY flavours (i.e part numbers): GPY212, GPY2XX.
*/
-
-/** \defgroup GPY2XX_SGMII SGMII Interface Config APIs
- \brief Group of functional APIs for SGMII interface configuration.
-*/
+/** @endcond DOC_ENABLE_SYNCE */
/** \defgroup GPY2XX_WOL_FLAG Wake-on-LAN Flags
\brief Group of Wake-on-LAN flags.
@@ -114,22 +122,17 @@
\brief Group of functional APIs for miscellaneous features.
*/
-/** \defgroup GPY2XX_FW Firmware Download APIs
- \brief Group of functional APIs to download firmware into flash memory.
-*/
-
-/** \defgroup GPY2XX_GPY2XX_USXGMII USXGMII_REACH APIs
- \brief Group of functional APIs for USXGMII Reach configuration.
- Note: USXGMII is not supported for models without USXGMII capability.
+/** \defgroup GPY2XX_GPY2XX_USXGMII XPCS/SERDES APIs
+ \brief Group of functional APIs for XPCS/SERDES (USXGMII) configuration.
*/
/**@}*/ /* GPY2XX_API */
-/** \addtogroup GPY211_MDIO */
+/** \addtogroup GPY2XX_MDIO */
/**@{*/
/** \brief Flag to enable 21-bit IEEE 802.3ae Clause 45 addressing mode */
#define MII_ADDR_C45 (1<<30)
-/**@}*/ /* GPY211_MDIO */
+/**@}*/ /* GPY2XX_MDIO */
/** @cond INTERNAL */
/** \brief Slave MDIO's Target Base Address Register's Address */
@@ -460,7 +463,9 @@
EXTIN_PHY_WOL = (1 << 15),
};
/** \cond INTERNAL */
+/** \brief Minimum external interrupt mask. */
#define EXTIN_PHY_EVENT_MIN ((EXTIN_PHY_LSTC << 1) - 1)
+/** \brief Maximum external interrupt mask. */
#define EXTIN_PHY_EVENT_MAX ((EXTIN_PHY_WOL << 1) - 1)
/** \endcond */
@@ -475,7 +480,9 @@
EXTIN_IM2_IE_MACSEC = (1 << 4),
};
/** \cond INTERNAL */
+/** \brief Minimum external interrupt mask (interrupt module 2). */
#define EXTIN_IM2_EVENT_MIN EXTIN_IM2_IE_LPI
+/** \brief Maximum external interrupt mask (interrupt module 2). */
#define EXTIN_IM2_EVENT_MAX ((EXTIN_IM2_IE_MACSEC << 1) - 1)
/** \endcond */
/**@}*/ /* GPY2XX_INT */
@@ -658,6 +665,7 @@
};
/**@}*/ /* GPY2XX_DIAG */
+/** @cond DOC_ENABLE_SYNCE */
/** \addtogroup GPY2XX_SYNCE */
/**@{*/
/** \brief Macros used by \b synce_refclk in \ref gpy2xx_synce */
@@ -702,7 +710,7 @@
SYNCE_2G5 = 1,
};
-/** \brief Macros used by \b gpc_sel in \ref gpy2xx_synce and \ref gpy2xx_pps_ctrl */
+/** \brief Macros used by \b gpc_sel in \ref gpy2xx_synce */
/** \brief Time Stamp Capture Input Signal Selection.
This is to specify the input signal selected for time stamp capture. */
enum gpy2xx_gpc_sel {
@@ -716,41 +724,7 @@
SYNCE_GPC2 = 3,
};
/**@}*/ /* GPY2XX_SYNCE */
-
-/** \addtogroup GPY2XX_SGMII */
-/**@{*/
-/** \brief Macros used by \b linkcfg_dir in \ref gpy2xx_sgmii */
-/** \brief SGMII link configuration direction */
-enum gpy2xx_sgmii_linkcfg_dir {
- /** \brief SGMII configuration is taken from twisted pair link status */
- SGMII_LINKCFG_TPI = 0,
- /** \brief SGMII configuration is taken from SGMII registers */
- SGMII_LINKCFG_SGMII = 1,
-};
-
-/** \brief Macros used by \b aneg_mode in \ref gpy2xx_sgmii */
-/** \brief SGMII auto-negotiation mode */
-enum gpy2xx_sgmii_aneg_mode {
- /** \brief 1000-Bx ANEG mode */
- SGMII_ANEG_1000BX = 1,
- /** \brief SGMII ANEG mode with GPY2xx acting as a PHY */
- SGMII_ANEG_CISCO_PHY = 2,
- /** \brief SGMII ANEG mode with GPY2xx acting as a MAC */
- SGMII_ANEG_CISCO_MAC = 3,
-};
-
-/** \brief SGMII operation mode */
-enum gpy2xx_sgmii_operation {
- /** \brief Normal operation */
- SGMII_OP_NORMAL = 0,
- /** \brief Power down */
- SGMII_OP_DOWN = 1,
- /** \brief Loopback data coming in from analog interface back to itself */
- SGMII_OP_LOOPBACK = 2,
- /** \brief Reset SGMII block */
- SGMII_OP_RESET = 3
-};
-/**@}*/ /* GPY2XX_SGMII */
+/** @endcond DOC_ENABLE_SYNCE */
/** \addtogroup GPY2XX_WOL_FLAG */
/**@{*/
@@ -776,12 +750,6 @@
/** \endcond */
/**@}*/ /* GPY2XX_WOL_FLAG */
-/** \addtogroup GPY2XX_FW */
-/**@{*/
-/** \brief Default timeout (in milliseconds) for field firmware upgrade APIs */
-#define FW_FWR_DEF_TIMEOUT 5000
-/**@}*/ /* GPY2XX_FW */
-
/** \addtogroup GPY2XX_GPY2XX_USXGMII */
/**@{*/
/** \brief Max number of slices */
@@ -794,7 +762,7 @@
/** \addtogroup GPY2XX_LINK_API */
/**@{*/
-/** \brief Member used by \b link in \ref gpy2xx_device and \ref gpy2xx_sgmii */
+/** \brief Member used by \b link in \ref gpy2xx_device */
/** \brief Data structure representing GPHY link configuration and status */
struct gpy2xx_link {
/** \brief Link speed (forced) or partner link speed (auto-negotiation)
@@ -832,6 +800,18 @@
/** \addtogroup GPY2XX_LED */
/**@{*/
+/** \brief Data structure for LED brightness level configuration */
+struct gpy2xx_led_brlvl_cfg {
+ /** \brief Brightness Mode: fixed as CONSTANT regardless of input. */
+ uint8_t mode;
+ /** \brief Maximum brightness level.
+ Applicable only when mode is CONSTANT.
+ Level 0 will turn the LED off. */
+ uint8_t lvl_max;
+ /** \brief Minimum brightness level. Fixed to 0 regardless of input */
+ uint8_t lvl_min;
+};
+
/** \brief (Macros used by \b id in \ref gpy2xx_led_cfg) */
/** \brief LED ID 0 */
#define LED_ID_0 0
@@ -996,6 +976,524 @@
struct gpy2xx_cdiag_pair pair[4];
};
+/** \brief Member used by \b CDIAG_CTRL in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test control */
+//------------------------------------------------------------
+// RegisterX.0: CDIAG_CTRL
+//------------------------------------------------------------
+typedef struct {
+ /** \brief Reserved */
+ uint16_t RES : 7 ;
+ /** \brief csmart link partner detect: 1= smart LP, 0 = non smart LP */
+ uint16_t LPDET : 1 ;
+ /** \brief Category 5e Channel detect: 1 = cat 5e, 0 = non cat 5e */
+ uint16_t C5DET : 1 ;
+ /** \brief Category 6a Channel detect: 1 = cat 6a, 0 = non cat 6a */
+ uint16_t C6DET : 1 ;
+ /** \brief Cable Length unit: 1 = meters, 0 = centimeters */
+ uint16_t CLU : 1 ;
+ /** \brief Cable diagnostics status: 1 = in progress, 0 = complete */
+ uint16_t CDIAG_STATUS : 1 ;
+ /** \brief Break link: 1 = break link (self clearing), 0 = do not break link (link will go down during mgig cable diags) */
+ uint16_t BREAK_LINK : 1 ;
+ /** \brief Disable inter-pair short check: 1 = disable inter-pair short check, 0 = enable inter-pair short check */
+ uint16_t DIS_IPAIR_CHECK : 1 ;
+ /** \brief Run at each auto-negotiation cycle: 1 = run at auto-negotiation, 0 = do not run at each auto-negotiation cycle. */
+ uint16_t RA : 1 ;
+ /** \brief Run immediate: 1 = run now (self clearing), 0 = no action */
+ uint16_t RI : 1 ;
+} sCDIAG_CTRL_t;
+/** \brief This is an union for CDIAG_CTRL */
+typedef union {
+ /** \brief struct sCDIAG_CTRL_t */
+ sCDIAG_CTRL_t S;
+ /** \brief value of register CDIAG_CTRL */
+ uint16_t V;
+} uCDIAG_CTRL_t;
+
+//------------------------------------------------------------
+// RegisterX.1: CDIAG_RESULT
+//------------------------------------------------------------
+/** \brief Cable Diagnostic test pair result 0 means INVALID */
+#define PAIRCDIAGCODE_INVALID 0
+/** \brief Cable Diagnostic test pair result 1 means PAIROK */
+#define PAIRCDIAGCODE_PAIROK 1
+/** \brief Cable Diagnostic test pair result 2 means PAIROPEN */
+#define PAIRCDIAGCODE_PAIROPEN 2
+/** \brief Cable Diagnostic test pair result 3 means INTRAPAIRSHORT */
+#define PAIRCDIAGCODE_INTRAPAIRSHORT 3
+/** \brief Cable Diagnostic test pair result 4 means INTERPAIRSHORT */
+#define PAIRCDIAGCODE_INTERPAIRSHORT 4
+/** \brief Cable Diagnostic test pair result 9 means PAIRBUSY */
+#define PAIRCDIAGCODE_PAIRBUSY 9
+
+/** \brief Member used by \b CDIAG_RESULT in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test result */
+typedef struct {
+ /** \brief Pair D cable diagnostic code */
+ uint16_t PAIRD_CDIAG_CODE : 4 ;
+ /** \brief Pair C cable diagnostic code */
+ uint16_t PAIRC_CDIAG_CODE : 4 ;
+ /** \brief Pair B cable diagnostic code */
+ uint16_t PAIRB_CDIAG_CODE : 4 ;
+ /** \brief Pair A cable diagnostic code */
+ uint16_t PAIRA_CDIAG_CODE : 4 ;
+} sCDIAG_RESULT_t;
+/** \brief This is an union for CDIAG_RESULT */
+typedef union {
+ /** \brief struct sCDIAG_RESULT_t */
+ sCDIAG_RESULT_t S;
+ /** \brief value of register CDIAG_RESULT */
+ uint16_t V;
+} uCDIAG_RESULT_t;
+
+/** \brief Member used by \b CDIAG_PAIR12LEN in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair12 length */
+//------------------------------------------------------------
+// RegisterX.2: CDIAG_PAIR12LEN
+//------------------------------------------------------------
+typedef struct {
+ /** \brief Length indication is cable length on a properly terminated pair (85 ≤ Rt ≤ 115), or length to first fault on a fault detected pair. Also, a value of 0x FFFF indicates length not estimated due to pair busy or cable diagnostic routine did not complete successfully */
+ uint16_t LENGTH : 16 ;
+} sCDIAG_PAIR12LEN_t;
+/** \brief This is an union for CDIAG_PAIR12LEN */
+typedef union {
+ /** \brief struct sCDIAG_PAIR12LEN_t */
+ sCDIAG_PAIR12LEN_t S;
+ /** \brief value of register CDIAG_PAIR12LEN */
+ uint16_t V;
+} uCDIAG_PAIR12LEN_t;
+
+/** \brief Member used by \b CDIAG_PAIR36LEN in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair36 length */
+//------------------------------------------------------------
+// RegisterX.3: CDIAG_PAIR36LEN
+//------------------------------------------------------------
+typedef struct {
+ /** \brief Length indication is cable length on a properly terminated pair (85 ≤ Rt ≤ 115), or length to first fault on a fault detected pair. Also, a value of 0x FFFF indicates length not estimated due to pair busy or cable diagnostic routine did not complete successfully */
+ uint16_t LENGTH : 16 ;
+} sCDIAG_PAIR36LEN_t;
+/** \brief This is an union for CDIAG_PAIR36LEN */
+typedef union {
+ /** \brief struct sCDIAG_PAIR36LEN_t */
+ sCDIAG_PAIR36LEN_t S;
+ /** \brief value of register CDIAG_PAIR36LEN */
+ uint16_t V;
+} uCDIAG_PAIR36LEN_t;
+
+/** \brief Member used by \b CDIAG_PAIR45LEN in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair45 length */
+//------------------------------------------------------------
+// RegisterX.4: CDIAG_PAIR45LEN
+//------------------------------------------------------------
+typedef struct {
+/** \brief Length indication is cable length on a properly terminated pair (85 ≤ Rt ≤ 115), or length to first fault on a fault detected pair. Also, a value of 0x FFFF indicates length not estimated due to pair busy or cable diagnostic routine did not complete successfully */
+ uint16_t LENGTH : 16 ;
+} sCDIAG_PAIR45LEN_t;
+/** \brief This is an union for CDIAG_PAIR45LEN */
+typedef union {
+ /** \brief struct sCDIAG_PAIR45LEN_t */
+ sCDIAG_PAIR45LEN_t S;
+ /** \brief value of register CDIAG_PAIR45LEN */
+ uint16_t V;
+} uCDIAG_PAIR45LEN_t;
+
+/** \brief Member used by \b CDIAG_PAIR78LEN in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair78 length */
+//------------------------------------------------------------
+// RegisterX.5: CDIAG_PAIR78LEN
+//------------------------------------------------------------
+typedef struct {
+/** \brief Length indication is cable length on a properly terminated pair (85 ≤ Rt ≤ 115), or length to first fault on a fault detected pair. Also, a value of 0x FFFF indicates length not estimated due to pair busy or cable diagnostic routine did not complete successfully */
+ uint16_t LENGTH : 16 ;
+} sCDIAG_PAIR78LEN_t;
+/** \brief This is an union for CDIAG_PAIR78LEN */
+typedef union {
+ /** \brief struct sCDIAG_PAIR78LEN_t */
+ sCDIAG_PAIR78LEN_t S;
+ /** \brief value of register CDIAG_PAIR78LEN */
+ uint16_t V;
+} uCDIAG_PAIR78LEN_t;
+
+/** \brief Member used by \b CDIAG_INSERTLOSSPAIR12 in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair12 insert loss */
+//------------------------------------------------------------
+// RegisterX.6: CDIAG_INSERTLOSSPAIR12 Phy Cable Diagnostics Pair 1,2 Insertion Loss 2.5G,5G,10G
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_INSERTLOSSPAIR12_t;
+/** \brief This is an union for CDIAG_INSERTLOSSPAIR12 */
+typedef union {
+ /** \brief struct sCDIAG_INSERTLOSSPAIR12_t */
+ sCDIAG_INSERTLOSSPAIR12_t S;
+ /** \brief value of register CDIAG_INSERTLOSSPAIR12 */
+ uint16_t V;
+} uCDIAG_INSERTLOSSPAIR12_t;
+
+/** \brief Member used by \b CDIAG_INSERTLOSSPAIR36 in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair36 insert loss */
+//------------------------------------------------------------
+// RegisterX.7: CDIAG_INSERTLOSSPAIR36 Phy Cable Diagnostics Pair 3,6 Insertion Loss 2.5G,5G,10G
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_INSERTLOSSPAIR36_t;
+/** \brief This is an union for CDIAG_INSERTLOSSPAIR36 */
+typedef union {
+ /** \brief struct sCDIAG_INSERTLOSSPAIR36_t */
+ sCDIAG_INSERTLOSSPAIR36_t S;
+ /** \brief value of register CDIAG_INSERTLOSSPAIR36 */
+ uint16_t V;
+} uCDIAG_INSERTLOSSPAIR36_t;
+
+/** \brief Member used by \b CDIAG_INSERTLOSSPAIR45 in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair45 insert loss */
+//------------------------------------------------------------
+// RegisterX.8: CDIAG_INSERTLOSSPAIR45 Phy Cable Diagnostics Pair 4,5 Insertion Loss 2.5G,5G,10G
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_INSERTLOSSPAIR45_t;
+/** \brief This is an union for CDIAG_INSERTLOSSPAIR45 */
+typedef union {
+ /** \brief struct sCDIAG_INSERTLOSSPAIR45_t */
+ sCDIAG_INSERTLOSSPAIR45_t S;
+ /** \brief value of register CDIAG_INSERTLOSSPAIR45 */
+ uint16_t V;
+} uCDIAG_INSERTLOSSPAIR45_t;
+
+/** \brief Member used by \b CDIAG_INSERTLOSSPAIR78 in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair78 insert loss */
+//------------------------------------------------------------
+// RegisterX.9: CDIAG_INSERTLOSSPAIR78 Phy Cable Diagnostics Pair 7,8 Insertion Loss 2.5G,5G,10G
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_INSERTLOSSPAIR78_t;
+/** \brief This is an union for CDIAG_INSERTLOSSPAIR78 */
+typedef union {
+ /** \brief struct sCDIAG_INSERTLOSSPAIR78_t */
+ sCDIAG_INSERTLOSSPAIR78_t S;
+ /** \brief value of register CDIAG_INSERTLOSSPAIR78 */
+ uint16_t V;
+} uCDIAG_INSERTLOSSPAIR78_t;
+
+/** \brief Member used by \b CDIAG_RETURNLOSSPAIR12 in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair12 return loss */
+//------------------------------------------------------------
+// RegisterX.10: CDIAG_RETURNLOSSPAIR12 Phy Cable Diagnostics Pair 1,2 Return Loss
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_RETURNLOSSPAIR12_t;
+/** \brief This is an union for CDIAG_RETURNLOSSPAIR12 */
+typedef union {
+ /** \brief struct sCDIAG_RETURNLOSSPAIR12_t */
+ sCDIAG_RETURNLOSSPAIR12_t S;
+ /** \brief value of register CDIAG_RETURNLOSSPAIR12 */
+ uint16_t V;
+} uCDIAG_RETURNLOSSPAIR12_t;
+
+/** \brief Member used by \b CDIAG_RETURNLOSSPAIR36 in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair36 return loss */
+//------------------------------------------------------------
+// RegisterX.11: CDIAG_RETURNLOSSPAIR36 Phy Cable Diagnostics Pair 3,6 Return Loss
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_RETURNLOSSPAIR36_t;
+/** \brief This is an union for CDIAG_RETURNLOSSPAIR36 */
+typedef union {
+ /** \brief struct sCDIAG_RETURNLOSSPAIR36_t */
+ sCDIAG_RETURNLOSSPAIR36_t S;
+ /** \brief value of register CDIAG_RETURNLOSSPAIR36 */
+ uint16_t V;
+} uCDIAG_RETURNLOSSPAIR36_t;
+
+/** \brief Member used by \b CDIAG_RETURNLOSSPAIR45 in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair45 return loss */
+//------------------------------------------------------------
+// RegisterX.12: CDIAG_RETURNLOSSPAIR45 Phy Cable Diagnostics Pair 4,5 Return Loss
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_RETURNLOSSPAIR45_t;
+/** \brief This is an union for CDIAG_RETURNLOSSPAIR45 */
+typedef union {
+ /** \brief struct sCDIAG_RETURNLOSSPAIR45_t */
+ sCDIAG_RETURNLOSSPAIR45_t S;
+ /** \brief value of register CDIAG_RETURNLOSSPAIR45 */
+ uint16_t V;
+} uCDIAG_RETURNLOSSPAIR45_t;
+
+/** \brief Member used by \b CDIAG_RETURNLOSSPAIR78 in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test pair78 return loss */
+//------------------------------------------------------------
+// RegisterX.13: CDIAG_RETURNLOSSPAIR78 Phy Cable Diagnostics Pair 7,8 Return Loss
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_RETURNLOSSPAIR78_t;
+/** \brief This is an union for CDIAG_RETURNLOSSPAIR78 */
+typedef union {
+ /** \brief struct sCDIAG_RETURNLOSSPAIR78_t */
+ sCDIAG_RETURNLOSSPAIR78_t S;
+ /** \brief value of register CDIAG_RETURNLOSSPAIR78 */
+ uint16_t V;
+} uCDIAG_RETURNLOSSPAIR78_t;
+
+/** \brief Member used by \b CDIAG_NEXTAB in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test Near End Crosstalk Pair A-B */
+//------------------------------------------------------------
+// RegisterX.14: CDIAG_NEXTAB Phy Cable Diagnostics A-B NEXT
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_NEXTAB_t;
+/** \brief This is an union for CDIAG_NEXTAB */
+typedef union {
+ /** \brief struct sCDIAG_NEXTAB_t */
+ sCDIAG_NEXTAB_t S;
+ /** \brief value of register CDIAG_NEXTAB */
+ uint16_t V;
+} uCDIAG_NEXTAB_t;
+
+/** \brief Member used by \b CDIAG_NEXTAC in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test Near End Crosstalk Pair A-C */
+//------------------------------------------------------------
+// RegisterX.15: CDIAG_NEXTAC Phy Cable Diagnostics A-C NEXT
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_NEXTAC_t;
+/** \brief This is an union for CDIAG_NEXTAC */
+typedef union {
+ /** \brief struct sCDIAG_NEXTAC_t */
+ sCDIAG_NEXTAC_t S;
+ /** \brief value of register CDIAG_NEXTAC */
+ uint16_t V;
+} uCDIAG_NEXTAC_t;
+
+/** \brief Member used by \b CDIAG_NEXTAD in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test Near End Crosstalk Pair A-D */
+//------------------------------------------------------------
+// RegisterX.16: CDIAG_NEXTAD Phy Cable Diagnostics A-D NEXT
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_NEXTAD_t;
+/** \brief This is an union for CDIAG_NEXTAD */
+typedef union {
+ /** \brief struct sCDIAG_NEXTAD_t */
+ sCDIAG_NEXTAD_t S;
+ /** \brief value of register CDIAG_NEXTAD */
+ uint16_t V;
+} uCDIAG_NEXTAD_t;
+
+/** \brief Member used by \b CDIAG_NEXTBC in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test Near End Crosstalk Pair B-C */
+//------------------------------------------------------------
+// RegisterX.17: CDIAG_NEXTBC Phy Cable Diagnostics B-C NEXT
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_NEXTBC_t;
+/** \brief This is an union for CDIAG_NEXTBC */
+typedef union {
+ /** \brief struct sCDIAG_NEXTBC_t */
+ sCDIAG_NEXTBC_t S;
+ /** \brief value of register CDIAG_NEXTBC */
+ uint16_t V;
+} uCDIAG_NEXTBC_t;
+
+/** \brief Member used by \b CDIAG_NEXTBD in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test Near End Crosstalk Pair B-D */
+//------------------------------------------------------------
+// RegisterX.18: CDIAG_NEXTBD Phy Cable Diagnostics B-D NEXT
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_NEXTBD_t;
+/** \brief This is an union for CDIAG_NEXTBD */
+typedef union {
+ /** \brief struct sCDIAG_NEXTBD_t */
+ sCDIAG_NEXTBD_t S;
+ /** \brief value of register CDIAG_NEXTBD */
+ uint16_t V;
+} uCDIAG_NEXTBD_t;
+
+/** \brief Member used by \b CDIAG_NEXTCD in \ref gpy2xx_sck_cdiag_report */
+/** \brief Cable Diagnostic test Near End Crosstalk Pair C-D */
+//------------------------------------------------------------
+// RegisterX.19: CDIAG_NEXTCD Phy Cable Diagnostics C-D NEXT
+//------------------------------------------------------------
+typedef struct {
+ /** \brief 0xdB indication at frequency 400MHz */
+ uint16_t LOSS400MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 200MHz */
+ uint16_t LOSS200MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 100MHz */
+ uint16_t LOSS100MHZ : 4 ;
+ /** \brief 0xdB indication at frequency 50Mhz */
+ uint16_t LOSS50MHZ : 4 ;
+} sCDIAG_NEXTCD_t;
+/** \brief This is an union for CDIAG_NEXTCD */
+typedef union {
+ /** \brief struct sCDIAG_NEXTCD_t */
+ sCDIAG_NEXTCD_t S;
+ /** \brief value of register CDIAG_NEXTCD */
+ uint16_t V;
+} uCDIAG_NEXTCD_t;
+
+/** \brief Cable diagnostic report */
+struct gpy2xx_sck_cdiag_report {
+ /** \brief Number of valid results in results */
+ uint16_t register_number;
+ /** \brief Up to 20 registers */
+ /** \brief RegisterX.0: CDIAG_CTRL */
+ volatile uCDIAG_CTRL_t CDIAG_CTRL;
+ /** \brief RegisterX.1: CDIAG_RESULT */
+ volatile uCDIAG_RESULT_t CDIAG_RESULT;
+ /** \brief RegisterX.2: CDIAG_PAIR12LEN */
+ volatile uCDIAG_PAIR12LEN_t CDIAG_PAIR12LEN;
+ /** \brief RegisterX.3: CDIAG_PAIR36LEN */
+ volatile uCDIAG_PAIR36LEN_t CDIAG_PAIR36LEN;
+ /** \brief RegisterX.4: CDIAG_PAIR45LEN */
+ volatile uCDIAG_PAIR45LEN_t CDIAG_PAIR45LEN;
+ /** \brief RegisterX.5: CDIAG_PAIR78LEN */
+ volatile uCDIAG_PAIR78LEN_t CDIAG_PAIR78LEN;
+ /** \brief RegisterX.6: CDIAG_INSERTLOSSPAIR12 Phy Cable Diagnostics Pair 1,2 Insertion Loss 2.5G,5G,10G */
+ volatile uCDIAG_INSERTLOSSPAIR12_t CDIAG_INSERTLOSSPAIR12;
+ /** \brief RegisterX.7: CDIAG_INSERTLOSSPAIR36 Phy Cable Diagnostics Pair 3,6 Insertion Loss 2.5G,5G,10G */
+ volatile uCDIAG_INSERTLOSSPAIR36_t CDIAG_INSERTLOSSPAIR36;
+ /** \brief RegisterX.8: CDIAG_INSERTLOSSPAIR45 Phy Cable Diagnostics Pair 4,5 Insertion Loss 2.5G,5G,10G */
+ volatile uCDIAG_INSERTLOSSPAIR45_t CDIAG_INSERTLOSSPAIR45;
+ /** \brief RegisterX.9: CDIAG_INSERTLOSSPAIR78 Phy Cable Diagnostics Pair 7,8 Insertion Loss 2.5G,5G,10G */
+ volatile uCDIAG_INSERTLOSSPAIR78_t CDIAG_INSERTLOSSPAIR78;
+ /** \brief RegisterX.10: CDIAG_RETURNLOSSPAIR12 Phy Cable Diagnostics Pair 1,2 Return Loss */
+ volatile uCDIAG_RETURNLOSSPAIR12_t CDIAG_RETURNLOSSPAIR12;
+ /** \brief RegisterX.11: CDIAG_RETURNLOSSPAIR36 Phy Cable Diagnostics Pair 3,6 Return Loss */
+ volatile uCDIAG_RETURNLOSSPAIR36_t CDIAG_RETURNLOSSPAIR36;
+ /** \brief RegisterX.12: CDIAG_RETURNLOSSPAIR45 Phy Cable Diagnostics Pair 4,5 Return Loss */
+ volatile uCDIAG_RETURNLOSSPAIR45_t CDIAG_RETURNLOSSPAIR45;
+ /** \brief RegisterX.13: CDIAG_RETURNLOSSPAIR78 Phy Cable Diagnostics Pair 7,8 Return Loss */
+ volatile uCDIAG_RETURNLOSSPAIR78_t CDIAG_RETURNLOSSPAIR78;
+ /** \brief RegisterX.14: CDIAG_NEXTAB Phy Cable Diagnostics A-B NEXT */
+ volatile uCDIAG_NEXTAB_t CDIAG_NEXTAB;
+ /** \brief RegisterX.15: CDIAG_NEXTAC Phy Cable Diagnostics A-C NEXT */
+ volatile uCDIAG_NEXTAC_t CDIAG_NEXTAC;
+ /** \brief RegisterX.16: CDIAG_NEXTAD Phy Cable Diagnostics A-D NEXT */
+ volatile uCDIAG_NEXTAD_t CDIAG_NEXTAD;
+ /** \brief RegisterX.17: CDIAG_NEXTBC Phy Cable Diagnostics B-C NEXT */
+ volatile uCDIAG_NEXTBC_t CDIAG_NEXTBC;
+ /** \brief RegisterX.18: CDIAG_NEXTBD Phy Cable Diagnostics B-D NEXT */
+ volatile uCDIAG_NEXTBD_t CDIAG_NEXTBD;
+ /** \brief RegisterX.19: CDIAG_NEXTCD Phy Cable Diagnostics C-D NEXT */
+ volatile uCDIAG_NEXTCD_t CDIAG_NEXTCD;
+};
+
+/** \brief Analog built-in self-test parameter */
+struct gpy2xx_abist_param {
+ /** \brief Set 1 to restart test */
+ uint8_t restart;
+ /** \brief Set 1 to enable detail report on debug UART output */
+ uint8_t uart_report;
+ /** \brief Test item defined in \ref gpy2xx_abist_test enum */
+ enum gpy2xx_abist_test test;
+};
+
/** \brief Member used by \b pair in \ref gpy2xx_abist_report */
/** \brief Analog built-in self-test report of one pair */
struct gpy2xx_abist_pair {
@@ -1076,6 +1574,7 @@
};
/**@}*/ /* GPY2XX_DIAG */
+/** @cond DOC_ENABLE_SYNCE */
/** \addtogroup GPY2XX_SYNCE */
/**@{*/
/** \brief SyncE configuration */
@@ -1096,6 +1595,7 @@
enum gpy2xx_gpc_sel gpc_sel;
};
/**@}*/ /* GPY2XX_SYNCE */
+/** @endcond DOC_ENABLE_SYNCE */
/** \addtogroup GPY2XX_MISC */
/**@{*/
@@ -1242,22 +1742,31 @@
/** \addtogroup GPY2XX_GPY2XX_USXGMII */
/**@{*/
+/** \brief eye scope select option */
enum gpy2xx_eye_scope_sel {
+ /** \brief 0 means SCOPE_SEL_ATT */
SCOPE_SEL_ATT = 0,
+ /** \brief 1 means SCOPE_SEL_DFE */
SCOPE_SEL_DFE = 1,
+ /** \brief SCOPE_SEL_MAX is how many eye scope select option */
SCOPE_SEL_MAX
};
+/** \brief eye debug option */
enum gpy2xx_eye_dbg_opt {
+ /** \brief 0 means SCOPE_EYE_DBG_DISABLED */
SCOPE_EYE_DBG_DISABLED = 0,
+ /** \brief 1 means SCOPE_EYE_DBG_ALL_MSG_OUT */
SCOPE_EYE_DBG_ALL_MSG_OUT = 1,
+ /** \brief 2 means SCOPE_EYE_DBG_CORR_DATA_ONLY */
SCOPE_EYE_DBG_CORR_DATA_ONLY = 2,
+ /** \brief SCOPE_EYE_DBG_MAX is how many eye scope debug option */
SCOPE_EYE_DBG_MAX
};
/** \brief USXGMII 4-point eye test parameter.
* Used by \ref gpy2xx_usxgmii_4peye_start and
- * \ref gpy2xx_usxgmii_4peye_cfg_get.and
+ * \ref gpy2xx_usxgmii_4peye_cfg_get and
* \ref gpy2xx_usxgmii_fsweep_start and
* \ref gpy2xx_usxgmii_fsweep_cfg_get
*/
@@ -1267,7 +1776,7 @@
* 4~12 is supported in current implementation.
*/
uint16_t ber;
- /** \brief number of error bits index,
+ /** \brief number of error bits index,
* the indexed max error counter value will be different for the different BER target
* only 1, 2, 3 are supported
*/
@@ -1304,7 +1813,9 @@
* 1: DFE scope eye
*/
uint8_t scope_sel;
+ /** \brief reserved. */
uint8_t rsv1;
+ /** \brief reserved. */
uint8_t rsv2;
};
@@ -1342,7 +1853,7 @@
/** \brief USXGMII full sweep or scope sweep test state and data buffer info structure.
* Used by \ref gpy2xx_usxgmii_fsweep_result.
- * and \ref gpy2xx_usxgmii_scope_result.
+ * and \ref gpy2xx_usxgmii_scope_eye_result.
* for full sweep and scope eye sweep, the result only for the running state and buffer info, the sweep data is NOT included
*/
struct gpy2xx_sweep_sts_buff_info {
@@ -1370,18 +1881,541 @@
/** \brief USXGMII eye test result common structure.
* Used by \ref gpy2xx_usxgmii_4peye_result
- * and \ref gpy2xx_usxgmii_fsweep_result.
- * and \ref gpy2xx_usxgmii_scope_result.
+ * and \ref gpy2xx_usxgmii_fsweep_result
+ * and \ref gpy2xx_usxgmii_scope_eye_result
*/
union gpy2xx_eye_result {
+ /** \brief gpy2xx_4peye_result */
struct gpy2xx_4peye_result fpeye_result;
+ /** \brief gpy2xx_sweep_sts_buff_info */
struct gpy2xx_sweep_sts_buff_info fsweep_result;
+ /** \brief gpy2xx_sweep_sts_buff_info */
struct gpy2xx_sweep_sts_buff_info scope_result;
};
/**@}*/ /* GPY2XX_GPY2XX_USXGMII */
+
+/** \addtogroup gpy2xx_PTP */
+/**@{*/
+/** \brief Macros used by \b tx_ptp_tpt in \ref gpy2xx_ptp_ctrl */
+/** \brief Transmit PTP transport protocol type.
+Indicates the type of transport protocol over which PTP messages are sent */
+enum gpy2xx_ptp_tx_ptoto {
+ /** \brief PTP over Ethernet */
+ PTP_TRANSPORT_OVER_ETH = 1,
+ /** \brief PTP over UDP/IPv4 */
+ PTP_TRANSPORT_OVER_IPv4 = 2,
+ /** \brief PTP over UDP/IPv6 */
+ PTP_TRANSPORT_OVER_IPv6 = 3,
+};
+
+/** \cond INTERNAL */
+/** \brief TS Control - low */
+struct gpy2xx_tsc_low {
+ union {
+ struct {
+ /** \brief Enable timestamp */
+ u16 ts_en: 1;
+ /** \brief Fine or coarse timestamp update */
+ u16 foc_updt: 1;
+ /** \brief Initialize timestamp */
+ u16 ts_init: 1;
+ /** \brief Update timestamp */
+ u16 ts_updt: 1;
+ /** \brief Reserved */
+ u16 reserved: 1;
+ /** \brief Update addend register */
+ u16 addend_updt: 1;
+ /** \brief Reserved */
+ u16 reserved2: 2;
+ /** \brief Enable timestamp for all packets */
+ u16 en_all_pkts: 1;
+ /** \brief Timestamp digital or binary rollover control */
+ u16 dob_ro_ctrl: 1;
+ /** \brief Enable PTP packet processing for version 2 format */
+ u16 ts_ver2_en: 1;
+ /** \brief Enable processing of PTP over Ethernet Packets */
+ u16 ts_eth_en: 1;
+ /** \brief Enable processing of PTP packets sent over IPv6-UDP */
+ u16 ts_ipv6_en: 1;
+ /** \brief Enable processing of PTP packets sent over IPv4-UDP */
+ u16 ts_ipv4_en: 1;
+ /** \brief Enable timestamp snapshot for event messages */
+ u16 ts_evtmsg_en: 1;
+ /** \brief Enable snapshot for messages relevant to master */
+ u16 ts_master_en: 1;
+ };
+ /** Timestamp control low word - raw */
+ u16 raw_ts_ctrl_low;
+ };
+};
+
+/** \brief TS control - high */
+struct gpy2xx_tsc_high {
+ union {
+ struct {
+ /** \brief Select PTP packets for taking snapshots */
+ u16 snap_type: 2;
+ /** \brief Enable MAC Address for PTP packet filtering */
+ u16 ts_mac_en: 1;
+ /** \brief Enable checksum correction during One Step Timestamp (OST) for PTP over UDP/IPv4 packets */
+ u16 ts_csc_en: 1;
+ /** \brief Reserved */
+ u16 reserved: 4;
+ /** \brief Transmit timestamp status mode: If set, the PHY overwrites the earlier transmit timestamp
+ status even if it is not read by the software */
+ u16 ts_stat_mode: 1;
+ /** \brief Reserved */
+ u16 reserved2: 3;
+ /** \brief AV 802.1AS mode enable */
+ u16 av8021_as_en: 1;
+ /** \brief Reserved */
+ u16 reserved3: 3;
+ };
+ /** Timestamp control high word - raw */
+ u16 raw_ts_ctrl_high;
+ };
+};
+/** \endcond */
+
+/** \brief Timestamp control */
+struct gpy2xx_ts_ctrl {
+ /** \brief Enable timestamp snapshot for event messages */
+ u16 ts_evtmsg_en: 1;
+ /** \brief Enable snapshot for messages relevant to master */
+ u16 ts_master_en: 1;
+ /** \brief Select PTP packets for taking snapshots */
+ u16 snap_type: 2;
+};
+
+/** \cond INTERNAL */
+/** \brief PPS control - low */
+struct gpy2xx_pps_low {
+ union {
+ struct {
+ /** \brief 'Output Frequency' or 'Flexible PPS Output' control */
+ u16 ofc_or_cmd: 4;
+ /** \brief Flexible PPS output mode enable */
+ u16 pps_mode: 1;
+ /** \brief Target time register mode for PPS0 output.
+ This indicates how the target time registers are programmed, for example, only for generating the interrupt event,
+ generating the interrupt event and starting or stopping, only for starting or stopping PPS signal. */
+ u16 ttr_mode: 2;
+ /** \brief Reserved */
+ u16 reserved: 9;
+ };
+ /** PPS Control low word - raw */
+ u16 raw_pps_ctrl_low;
+ };
+};
+/** \endcond */
+
+/** \brief PPS Control */
+struct gpy2xx_pps_ctrl {
+ /** PPS control low word - bit field */
+ struct gpy2xx_pps_low ppsctrl_low;
+ /** Init target time - nanoseconds */
+ u32 nsec_tgttime;
+ /** Init target time - seconds */
+ u32 sec_tgttime;
+ /** PPS0 interval in nanoseconds */
+ u32 pps0_interal;
+ /** PPS0 width in nanoseconds */
+ u32 pps0_width;
+ /** \brief GPC pin to be used as in \ref gpy2xx_gpc_sel */
+ enum gpy2xx_gpc_sel gpc_sel;
+};
+
+/** \cond INTERNAL */
+/** \brief PTO control - low */
+struct gpy2xx_pto_low {
+ union {
+ struct {
+ /** \brief PTP offload enable */
+ u16 pto_en: 1;
+ /** \brief Automatic PTP SYNC message enable */
+ u16 auto_sync_en: 1;
+ /** \brief Automatic PTP Pdelay_Req message enable */
+ u16 auto_pdreq_en: 1;
+ /** \brief Reserved */
+ u16 reserved: 1;
+ /** \brief Automatic PTP SYNC message trigger */
+ u16 auto_sync_trig: 1;
+ /** \brief Automatic PTP Pdelay_Req message trigger */
+ u16 auto_pdreq_trig: 1;
+ /** \brief Disable PTO delay request/response generation */
+ u16 delay_rrresp_dis: 1;
+ /** \brief Disable peer delay response generation */
+ u16 peer_delayrr_dis: 1;
+ /** \brief Domain number */
+ u16 dom_num: 8;
+ };
+ /** PTO control low word - raw */
+ u16 raw_pto_ctrl_low;
+ };
+};
+/** \endcond */
+
+/** \brief Log message interval */
+struct gpy2xx_logm_level {
+ union {
+ struct {
+ /** \brief Log sync interval. Allowed values are -15 to 15.
+ This field indicates the periodicity of the automatically generated SYNC message when
+ the PTP node is master.*/
+ i16 log_sync_interval: 8;
+ /** \brief Delay_Req to SYNC ratio.
+ In slave mode, it is used to control the frequency of Delay_Req messages transmitted.*/
+ u16 dr_to_sync_ratio: 3;
+ /** \brief Reserved */
+ u16 reserved: 5;
+ };
+ /** Log message interval - low - raw */
+ u16 raw_logm_lvl_low;
+ };
+ union {
+ struct {
+ /** \brief Reserved */
+ u16 reserved2: 8;
+ /** \brief Log Min Pdelay_Req interval. Allowed values are -15 to 15.
+ This field indicates logMinPdelayReqInterval of PTP node. This is used to schedule the periodic
+ Pdelay request packet transmission.*/
+ i16 log_min_pdr_interval: 8;
+ };
+ /** Log message interval - high - raw */
+ u16 raw_logm_lvl_hi;
+ };
+};
+
+/** \brief PTP offload control */
+struct gpy2xx_pto_ctrl {
+ /** PTO Control low word - bit field */
+ struct gpy2xx_pto_low ptoctrl_low;
+ /** Source port identity */
+ u8 sport_id[10]; //PTP_SPORT_ID_LEN_BYTE
+ /** \brief Log message interval */
+ struct gpy2xx_logm_level logmsg_lvl;
+};
+
+/** \brief IEEE 1588 PTP control */
+struct gpy2xx_ptp_ctrl {
+ /** \brief Enable/disable TX timestamp capture at PHY level */
+ u16 tx_ts_phy: 1;
+ /** \brief Enable/disable RX timestamp capture at PHY level */
+ u16 rx_ts_phy: 1;
+ /** \brief Transmit PTP offset */
+ u16 tx_ptp_off: 14;
+ /** \brief Transmit PTP transport protocol type.
+ Valid values are defined in \ref gpy2xx_ptp_tx_ptoto enum */
+ u16 tx_ptp_tpt: 2;
+ /** \brief Enable 1-step vs 2-step timestamp method */
+ u16 ts_ostc_en: 1;
+ /** Timestamp required for one-step time correction */
+ time64_t tx_ost_corr;
+ /** brief auxiliary snapshot trigger port */
+ u16 aux_trig_port;
+};
+
+/** \cond INTERNAL */
+/** \brief IEEE 1588 timestamp logic - bit fields */
+struct gpy2xx_pmts_cfg {
+ union {
+ struct {
+ /** \brief GMAC-Full PTP reference clock reset */
+ u16 ts_refclk_rst: 1;
+ /** \brief Transmit one-step time correction enable */
+ u16 ts_ostc_en: 1;
+ /** \brief GMAC-Lite PTP reference clock reset */
+ u16 tsl_refclk_rst: 1;
+ /** \brief Reserved */
+ u16 reserved: 1;
+ /** \brief TX timestamp FIFO enable */
+ u16 tx_fifo_en: 1;
+ /** \brief RX timestamp FIFO enable */
+ u16 rx_fifo_en: 1;
+ /** \brief TX timestamp FIFO reset */
+ u16 tx_fifo_rst: 1;
+ /** \brief RX timestamp FIFO reset */
+ u16 rx_fifo_rst: 1;
+ /** \brief PHY TX timestamp enable */
+ u16 tx_ts_phy: 1;
+ /** \brief PHY RX timestamp enable*/
+ u16 rx_ts_phy: 1;
+ /** \brief Reserved */
+ u16 reserved2: 6;
+ };
+ /** IEEE 1588 timestamp logic - raw */
+ u16 raw_ts_cfg;
+ };
+ union {
+ struct {
+ /** \brief Transmit PTP offset */
+ u16 tx_ptp_off: 14;
+ /** \brief Transmit PTP transport protocol type.
+ Valid values are defined in \ref gpy2xx_ptp_tx_ptoto enum */
+ u16 tx_ptp_tpt: 2;
+ };
+ /** PM configuration of PTP - raw */
+ u16 raw_ptp_cfg;
+ };
+};
+/** \endcond */
+
+/** \brief Configured PTP information */
+struct gpy2xx_ptp_cfg {
+ /** \brief IEEE 1588 PTP control */
+ struct gpy2xx_ptp_ctrl ptp_ctrl;
+ /** \brief Timestamp control */
+ struct gpy2xx_ts_ctrl ts_ctrl;
+ /** \brief PPS control */
+ struct gpy2xx_pps_ctrl pps_ctrl;
+ /** \brief PTP offload control */
+ struct gpy2xx_pto_ctrl pto_ctrl;
+};
+
+/** \brief Status of timestamp FIFO */
+struct gpy2xx_ts_fifo_stat {
+ union {
+ struct {
+ /** \brief TX FIFO fill level */
+ u16 tx_fill_lvl: 5;
+ /** \brief Reserved */
+ u16 reserved: 1;
+ /** \brief TX FIFO overflow */
+ u16 tx_ovfl: 1;
+ /** \brief TX FIFO underflow */
+ u16 tx_udfl: 1;
+ /** \brief RX FIFO fill level */
+ u16 rx_fill_lvl: 5;
+ /** \brief Reserved */
+ u16 reserved2: 1;
+ /** \brief RX FIFO overflow */
+ u16 rx_ovfl: 1;
+ /** \brief RX FIFO underflow */
+ u16 rx_udfl: 1;
+ };
+ /** IEEE 1588 timestamp logic */
+ u16 raw_fifo_stat;
+ };
+};
+
+/** \brief Member used by \b tss_low in \ref gpy2xx_ts_stat */
+/** \brief Status of Timestamp Status low word */
+struct gpy2xx_ts_stat_low {
+ union {
+ struct {
+ /** \brief Seconds overflow */
+ u16 sec_ovfl: 1;
+ /** \brief Target time reached for PPS0 */
+ u16 tt_rchd_pps0: 1;
+ /** \brief Auxiliary trigger snapshot */
+ u16 trig_snapshot: 1;
+ /** \brief Target time error for PPS0 */
+ u16 tt_err_pps0: 1;
+ /** \brief Reserved */
+ u16 reserved0: 11;
+ /** \brief Tx timestamp status interrupt status */
+ u16 txts_int_stat: 1;
+ };
+ /** Status of timestamp status low word - raw */
+ u16 raw_ts_stat_low;
+ };
+};
+
+/** \brief Member used by \b tss_high in \ref gpy2xx_ts_stat */
+/** \brief Status of timestamp status high word */
+struct gpy2xx_ts_stat_high {
+ union {
+ struct {
+ /** \brief Auxiliary timestamp snapshot trigger identifier */
+ u16 auxts_st_id: 4;
+ /** \brief Reserved */
+ u16 reserved: 4;
+ /** \brief Auxiliary timestamp snapshot trigger missed */
+ u16 auxts_st_mis: 1;
+ /** \brief Number of auxiliary timestamp snapshots */
+ u16 auxts_nums: 5;
+ /** \brief Reserved */
+ u16 reserved2: 2;
+ };
+ /** Status of timestamp status low word - raw */
+ u16 raw_ts_stat_hi;
+ };
+};
+
+/** \brief Member used by \b txts_stat in \ref gpy2xx_ts_stat */
+/** \brief Status of Tx timestamp TS status */
+struct gpy2xx_tx_ts_stat {
+ /** \brief Transmit timestamp status missed */
+ u8 txtss_mis;
+ /** \brief Transmit timestamp status - nanoseconds */
+ u32 txtss_nsec;
+ /** \brief Transmit timestamp status - seconds */
+ u32 txtss_sec;
+};
+
+/** \brief Status of timestamp status */
+struct gpy2xx_ts_stat {
+ /** \brief Status of timestamp status low word */
+ struct gpy2xx_ts_stat_low tss_low;
+ /** \brief Status of timestamp status high word */
+ struct gpy2xx_ts_stat_high tss_high;
+ /** \brief Status of Tx timestamp status */
+ struct gpy2xx_tx_ts_stat txts_stat;
+};
+
+/** \brief Provides the timestamp of the frame transmitted by the MAC */
+struct gpy2xx_tx_ts {
+ /** Transmit frame timestamping - in nanoseconds */
+ time64_t tx_ts_stat;
+ /** Transmit frame CRC used as ID to match */
+ u32 tx_crc_stat;
+};
+
+/** \brief Provides the timestamp of the frame received by the MAC */
+struct gpy2xx_rx_ts {
+ /** Receive frame timestamping - in nanoseconds */
+ time64_t rx_ts_stat;
+ /** Receive frame CRC used as ID to match */
+ u32 rx_crc_stat;
+};
+
+/** \brief auxiliary FIFO status */
+struct gpy2xx_aux_fifo_stat {
+ /** \brief FIFO overflow */
+ u16 ovfl;
+ /** \brief FIFO fill level */
+ u16 fill_lvl;
+};
+
+/** \brief auxiliary configuration */
+struct gpy2xx_aux_cfg {
+ /** \brief enable - 1; disable -0 */
+ u16 aux_enable;
+ /** \brief OUT_TIMER - 0, GPC0 - 1, GPC1 - 2, GPC2 - 3 */
+ u16 aux_trigger_port;
+};
+/**@}*/ /* gpy2xx_PTP */
+
+/** \addtogroup GPY211_BM */
+/**@{*/
+/** \cond INTERNAL */
+/** \brief PM shared buffer configuration */
+struct bm_cfg {
+ /** \brief SB 0 Start location */
+ u16 sb0_start;
+ /** \brief SB 0 End location */
+ u16 sb0_end;
+ /** \brief SB 0 Packet threshold to start the dequeue */
+ u16 sb0_pkt_thresh;
+ /** \brief SB 1 Start location */
+ u16 sb1_start;
+ /** \brief SB 1 End location */
+ u16 sb1_end;
+ /** \brief SB 1 Packet threshold to start the dequeue */
+ u16 sb1_pkt_thresh;
+};
+
+/** \brief Shared buffer status */
+struct pm_bm_status {
+ /** \brief SB 0 overflow indicator */
+ u8 sb0_ov;
+ /** \brief SB 0 Tx register overflow indicator */
+ u8 sb0_tx_reg_ov;
+ /** \brief SB 0 Rx register overflow indicator */
+ u8 sb0_rx_reg_ov;
+ /** \brief SB 1 overflow indicator */
+ u8 sb1_ov;
+ /** \brief SB 1 Tx register overflow indicator */
+ u8 sb1_tx_reg_ov;
+ /** \brief SB 1 Rx register overflow indicator */
+ u8 sb1_rx_reg_ov;
+ /** \brief SB 0 retry indicator */
+ u8 sb0_retry;
+ /** \brief SB 0 Sent indicator */
+ u8 sb0_sent;
+ /** \brief SB 1 retry indicator */
+ u8 sb1_retry;
+ /** \brief SB 1 sent indicator */
+ u8 sb1_sent;
+ /** \brief SB 0 complete indicator */
+ u8 sb0_complete;
+ /** \brief SB 1 complete indicator */
+ u8 sb1_complete;
+};
+/** \endcond */
+
+/** \brief Macros used by \b pause_low_thresh in \ref pause_cfg */
+/** \brief Pause low threshold in time slots */
+enum pause_low_thresh {
+ /** \brief PT-4 slot times */
+ PLT_PT_4ST = 0,
+ /** \brief PT-28 slot times */
+ PLT_PT_28ST = 1,
+ /** \brief PT-36 slot times */
+ PLT_PT_36ST = 2,
+ /** \brief PT-144 slot times */
+ PLT_PT_144ST = 3,
+ /** \brief PT-256 slot times */
+ PLT_PT_256ST = 4,
+ /** \brief PT-512 slot times */
+ PLT_PT_512ST = 5,
+};
+
+/** \brief GMAC-Lite Tx flow control configuration */
+struct pause_cfg {
+ /** \brief Flow control busy or backpressure activate */
+ u8 flow_ctrl_busy;
+ /** \brief PM GMAC flow control enable */
+ u8 pm_gmacl_fc;
+ /** \brief Tx flow control enable */
+ u8 tx_flow_ctrl;
+ /** \brief Disable zero-quanta pause */
+ u8 dis_zquanta_pause;
+ /** \brief Pause time */
+ u16 pause_time;
+ /** \brief Pause frame Src MAC to send with */
+ u8 tx_fc_mac[6];
+ /** \brief Pause low threshold.
+ Valid values are defined in \ref pause_low_thresh enum */
+ enum pause_low_thresh pause_low_thresh;
+ /** \brief Pause is triggered when available buf size is
+ (wptr - rptr) < PAUSE_THRES */
+ u16 pause_assert_thresh;
+ /** \brief To create a hysteresis to avoid too frequent PAUSE/UN-PAUSE */
+ u16 pause_deassert_thresh;
+};
+
+/** \brief Macros used by \b ppm in \ref tune_freq */
+/** \brief PHY's dummy MAC freuency to tune */
+enum mac_freq_tune {
+ /** \brief Standard USXMII Compliance Test condition.
+ MACs operate at frequency corresponding to line rate. This is the
+ recommended setting when it is accepted to have marginal packet drop at
+ maximum data rate testing above 99.9% of maximum rate. */
+ FREQ_PPM_000 = 0,
+ /** \brief Default working condition.
+ MACs operate at frequency+100ppm corresponding to line rate. This is the
+ default settings for 100% of maximum rate traffic condition with high
+ quality XTALs that generate clocks within +/-50ppm deviation. */
+ FREQ_PPM_100 = 1,
+ /** \brief Long Duration 100% Traffic Stress Test condition.
+ MACs operate at frequency+300ppm corresponding to line rate. This test
+ mode is to compensate all the worst case frequency deviations. */
+ FREQ_PPM_300 = 2,
+};
+
+/** \brief Tune the frequency of MACs within GPY in USXGMII Mode */
+struct tune_freq {
+ /** \brief Pause low threshold.
+ Valid values are defined in \ref pause_low_thresh enum */
+ enum mac_freq_tune ppm;
+};
+/**@}*/ /* GPY211_BM */
+
+
/** \addtogroup GPY2XX_INIT */
/**@{*/
@@ -1509,6 +2543,21 @@
/** \brief Flags for supported Wake-on-LAN modes.
Values (\ref GPY2XX_WOL_FLAG) can be combined with "or" */
uint32_t wol_supported;
+ /** \brief Max MACSec SAs supported */
+ u8 nr_of_sas;
+ /** \brief GMAC module information used in GMAC APIs */
+ void *gmac_data;
+ /** \brief MACsec module information used in MACsec APIs */
+ void *macsec_data;
+ /** \brief PTP clock (in Hz) */
+ u32 ptp_clock;
+ /** \brief GMAC-Full base address */
+ u32 gmacf_base_addr;
+ /** \brief GMAC-Lite base address */
+ u32 gmacl_base_addr;
+ /** \brief Packet Manager base address */
+ u32 pm_base_addr;
+
/** \brief SyncE capable (value 1) or not capable (value 0) */
unsigned int synce_supported : 1;
/** \brief MACsec capable (value 1) or not capable (value 0) */
@@ -1530,9 +2579,9 @@
/**********************
APIs
**********************/
+/** @cond INTERNAL */
/** \addtogroup GPY2XX_MDIO */
/**@{*/
-/** @cond INTERNAL */
/**
\brief API for Slave MDIO read operation.
\details The user application uses this API to read the internal registers
@@ -1749,64 +2798,8 @@
*/
int gpy2xx_mbox_write32(struct gpy2xx_device *phy, uint32_t regaddr,
uint32_t data);
-/** @endcond */
-
-/**
- \brief Debug API to read XPCS register.
-
- \param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param regaddr XPCS register address (byte address).
- \param data Pointer to store read data.
-
- \return
- - =0: successful
- - <0: error code
-*/
-int gpy2xx_xpcs_read(struct gpy2xx_device *phy, uint32_t regaddr,
- uint16_t *data);
-
-/**
- \brief Debug API to write XPCS register.
-
- \param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param regaddr XPCS register address (byte address).
- \param data Data to be written to given 'regaddr' address.
-
- \return
- - =0: successful
- - <0: error code
-*/
-int gpy2xx_xpcs_write(struct gpy2xx_device *phy, uint32_t regaddr,
- uint16_t data);
-
-/**
- \brief Debug API to read SERDES register via XPCS CR access.
-
- \param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param regaddr SERDES register address (byte address).
- \param data Pointer to store read data.
-
- \return
- - =0: successful
- - <0: error code
-*/
-int gpy2xx_serdes_read(struct gpy2xx_device *phy, uint32_t addr,
- uint16_t *data);
-
-/**
- \brief Debug API to write SERDES register via XPCS CR access.
-
- \param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param regaddr SERDES register address (byte address).
- \param data Data to be written to given 'regaddr' address.
-
- \return
- - =0: successful
- - <0: error code
-*/
-int gpy2xx_serdes_write(struct gpy2xx_device *phy, uint32_t addr,
- uint16_t data);
/**@}*/ /* GPY2XX_MDIO */
+/** @endcond */
/** \addtogroup GPY2XX_INIT */
/**@{*/
@@ -1997,6 +2990,39 @@
/**@}*/ /* GPY2XX_LINK */
/** \addtogroup GPY2XX_LED */
+/**@{*/
+
+/**
+ \brief Controls LED brightness level config.
+ \details Use this API to configure LED's max brightness level.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param brightness Pointer to LED brightness config (\ref gpy2xx_led_brlvl_cfg).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_led_br_cfg(struct gpy2xx_device *phy,
+ struct gpy2xx_led_brlvl_cfg *cfg);
+
+/**
+ \brief Gets LED brightness level config.
+ \details Use this API to get LED's brightness config that was using \ref
+ gpy2xx_led_br_cfg, like max brightness level.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param brightness Pointer to LED brightness config (\ref gpy2xx_led_brlvl_cfg).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_led_br_get(struct gpy2xx_device *phy,
+ struct gpy2xx_led_brlvl_cfg *cfg);
+
/**
\brief Configures the given LED specific function.
\details Use this API to assign an LED configuration to specific PHY
@@ -2087,6 +3113,73 @@
- =0: successful
- <0: error code
*/
+int gpy2xx_sck_cdiag_start(struct gpy2xx_device *phy);
+
+/**
+ \brief read cable diagnostics test result.
+ \details Use this API to test cable diagnostics, such as cable open/short detection
+ and cable length estimation.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param regno read register number.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_sck_cdiag_result_read(struct gpy2xx_device *phy, int regno);
+
+/**
+ \brief poll cable diagnostics test status.
+ \details Use this API to test cable diagnostics, such as cable open/short detection
+ and cable length estimation.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_sck_cdiag_api_poll(struct gpy2xx_device *phy);
+
+/**
+ \brief Exit cable diagnostics test.
+ \details Use this API to test cable diagnostics, such as cable open/short detection
+ and cable length estimation.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_sck_cdiag_api_exit(struct gpy2xx_device *phy);
+
+/**
+ \brief Request cable diagnostics test available registers.
+ \details Use this API to test cable diagnostics, such as cable open/short detection
+ and cable length estimation.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_sck_cdiag_api_result_no(struct gpy2xx_device *phy);
+
+/**
+ \brief Starts cable diagnostics test.
+ \details Use this API to test cable diagnostics, such as cable open/short detection
+ and cable length estimation.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
int gpy2xx_cdiag_start(struct gpy2xx_device *phy);
/**
@@ -2125,7 +3218,7 @@
\param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param param Pointer to ABIST paramters (\ref gpy2xx_abist_param).
+ \param test Pointer to ABIST paramters (\ref gpy2xx_abist_test).
\return
- =0: successful
@@ -2217,9 +3310,346 @@
struct gpy2xx_pcs_status *status);
/**@}*/ /* GPY2XX_DIAG */
-/** \addtogroup GPY2XX_SYNCE */
+/** \addtogroup GPY211_PTP */
/**@{*/
/**
+ \brief Adjusts the frequency of the hardware clock.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param ppb Relative frequency offset from nominal frequency in parts per
+ billion.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_adjfreq(struct gpy2xx_device *phy, s32 ppb);
+
+/**
+ \brief Sets the shift time of the hardware clock.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param delta Desired change time in nanoseconds.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_adjtime(struct gpy2xx_device *phy, i64 delta);
+
+/**
+ \brief Sets the system time of the PHY.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param ts Desired init time (\b timespec64).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_settime(struct gpy2xx_device *phy, struct timespec64 *ts);
+
+/**
+ \brief Reads the current system time of the PHY.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param ts Holds the current time (\b timespec64).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_gettime(struct gpy2xx_device *phy, struct timespec64 *ts);
+
+/**
+ \brief Enables and configures the PTP (1588) function.
+ \details Enables the PTP (1588) TS configuration and initializes it to default settings.
+ It configures the user application given inputs, such as enable/disable Tx/Rx Timestamp capture
+ at PHY level, Tx PTP offset of starting byte location of the PTP message, the type of transport
+ protocol over which PTP messages are sent. It chooses One Step Timestamp (OST) vs Two Step Timestamp (TST),
+ enables/disables OST correction and configures its OST correction time.
+
+ For example, for PTP message sent over UDP/IPv4 via untagged Ethernet packet, the Tx PTP offset
+ should be 42 decimal.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param ptp_cfg PTP configurations (\ref gpy2xx_ptp_ctrl).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_enable(struct gpy2xx_device *phy,
+ struct gpy2xx_ptp_ctrl *ptp_cfg);
+
+/**
+ \brief Disable PTP (1588) function.
+ \details Disables the PTP (1588) TS configuration to default settings and removes
+ all other configurations that were set using APIs \ref gpy2xx_ptp_enable,
+ \ref gpy2xx_ptp_set_tsctrl, \ref gpy2xx_ptp_set_ppsctrl, or \ref gpy2xx_ptp_set_ptoctrl.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_disable(struct gpy2xx_device *phy);
+
+/**
+ \brief Gets the PTP (1588) TS configuration.
+ \details Gets the PTP (1588) TS configuration that was set using APIs \ref gpy2xx_ptp_enable,
+ \ref gpy2xx_ptp_set_tsctrl, \ref gpy2xx_ptp_set_ppsctrl, and \ref gpy2xx_ptp_set_ptoctrl.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param ptp_cfg PTP configurations (\ref gpy2xx_ptp_cfg).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_getcfg(struct gpy2xx_device *phy,
+ struct gpy2xx_ptp_cfg *ptp_cfg);
+
+/**
+ \brief Gets timestamp FIFO status.
+ \details The FIFO status gives the Rx/Tx FIFO's fill level, overflow and undeflow indication.
+ To facilitate the SoC device's retrieval of the captured timestamps, a FIFO of depth 16 entries is
+ provided to store the captured timestamp per Rx/Tx direction. Each entry is of width 96 bits:
+ - 64 bits of packet timestamp
+ - 32 bits of CRC as packet identifier
+
+ The user application must read this API to check the Rx FIFO fill level is not empty before doing a
+ read access, otherwise an underflow error flag will be set.
+
+ The hardware pushes values into the FIFO and a software read access to a fixed location pops the oldest content.
+ If the FIFO is full and a push is triggered, the data will be dropped and the FIFO content not overwritten,
+ an overflow error flag will be set.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param status Holds timestamp FIFO status (\ref gpy2xx_ts_fifo_stat).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_fifostat(struct gpy2xx_device *phy,
+ struct gpy2xx_ts_fifo_stat *status);
+
+/**
+ \brief Resets the FIFO status.
+ \details The user application can use this API to clear the FIFO status \ref gpy2xx_ts_fifo_stat,
+ which shows the Rx/Tx FIFO's fill level, overflow and undeflow indication.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_resetfifo(struct gpy2xx_device *phy);
+
+/**
+ \brief Gets transmit timestamp details and status.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param ts_status Holds timestamp FIFO status (\ref gpy2xx_ts_stat).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_txtsstat(struct gpy2xx_device *phy,
+ struct gpy2xx_ts_stat *ts_status);
+
+/**
+ \brief Configures IEEE 1588 Timestamp (TS) control settings.
+ \details Use this API to configure TS control to TS functions, such as enable/disable
+ TS snapshot for all packets, event messages, messages relevant to master, selected PTP packets,
+ program sub-second/sub-nanosecond increment resolution values to the system TS and TS correction
+ and default Addend (drift in frequency) value.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param ts_cfg PTP configurations (\ref gpy2xx_ts_ctrl).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_set_tsctrl(struct gpy2xx_device *phy,
+ struct gpy2xx_ts_ctrl *ts_cfg);
+
+/**
+ \brief Configures IEEE 1588 Pulse Per Second (PPS) function settings.
+ \details The flexible PPS output option provides features such as programming the start or stop
+ time in terms of system time, width between the rising edge and corresponding falling edge,
+ the interval between the rising edges of the PPS signal. The width and interval are configured in
+ terms of number of units of sub-second increment value.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param pps_ctrl Pointer to PPS config (\ref gpy2xx_pps_ctrl).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_set_ppsctrl(struct gpy2xx_device *phy,
+ struct gpy2xx_pps_ctrl *pps_ctrl);
+/**
+ \brief Gets IEEE 1588 Pulse Per Second (PPS) function settings.
+ \details The flexible PPS output option provides features such as programming the start or stop
+ time in terms of system time, width between the rising edge and corresponding falling edge,
+ the interval between the rising edges of the PPS signal. The width and interval are configured in
+ terms of number of units of sub-second increment value.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param pps_ctrl Pointer to PPS config (\ref gpy2xx_pps_ctrl).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_get_ppsctrl(struct gpy2xx_device *phy,
+ struct gpy2xx_pps_ctrl *pps_ctrl);
+
+/**
+ \brief Configures IEEE 1588 PTP Timestamp Offload function settings.
+ \details PTP Timestamp Offload Function is an optional feature that can parse the
+ incoming PTP packets on the receiver, and enables the automatic generation of required
+ PTP packets periodically or when triggered by the host software.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param pto_ctrl PTO configurations (\ref gpy2xx_pto_ctrl)..
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_set_ptoctrl(struct gpy2xx_device *phy,
+ struct gpy2xx_pto_ctrl *pto_ctrl);
+
+/**
+ \brief Gets Rx packet timestamp snapshot from FIFO.
+ \details Gets one entry of the captured IEEE1588 timestamp (TS) of the received packet from FIFO.
+ The CRC is used as an identifier for the packet so that the host can correlate the packet with the timestamp.
+ The FIFO is capable of storing 16 entries per Tx, Rx direction. The user application must read
+ \ref gpy2xx_ptp_fifostat to check that the Rx FIFO fill level is not empty before doing a read access,
+ otherwise an underflow error flag will be set.
+
+ Hardware pushes values into the FIFO and a software read access to a fixed location pops the oldest content.
+ If the FIFO is full and a push is triggered, the data will be dropped and the FIFO content not overwritten,
+ an overflow error flag will be set.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param rx_ts Holds timestamp and CRC (\ref gpy2xx_rx_ts)..
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_getrxts(struct gpy2xx_device *phy,
+ struct gpy2xx_rx_ts *rx_ts);
+
+/**
+ \brief Gets Tx packet timestamp snapshot from FIFO.
+ \details Gets one entry of the captured IEEE1588 timestamp (TS) of the transmitted packet from FIFO.
+ The CRC is used as an identifier for the packet so that the host can correlate the packet with the timestamp.
+ The FIFO is capable of storing 16 entries per Tx, Rx direction. The user application must read
+ \ref gpy2xx_ptp_fifostat to check that the Tx FIFO fill level is not empty before doing a read access,
+ otherwise an underflow error flag will be set.
+
+ Hardware pushes values into the FIFO and a software read access to a fixed location pops the oldest content.
+ If the FIFO is full and a push is triggered, the data will be dropped and the FIFO content not overwritten,
+ an overflow error flag will be set.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param tx_ts Holds timestamp status and CRC (\ref gpy2xx_tx_ts).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_gettxts(struct gpy2xx_device *phy,
+ struct gpy2xx_tx_ts *tx_ts);
+
+/**
+ \brief Configure auxiliary timestamp function.
+ \details Configures Auxiiliary timestamp feature Enable/Discable, and the snapshot trigger source/event.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param aux_cfg passes the configuration (\ref gpy2xx_aux_cfg).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_aux_cfg(struct gpy2xx_device *phy, struct gpy2xx_aux_cfg *aux_cfg);
+
+/**
+ \brief Gets auxiliary timestamp snapshot from FIFO.
+ \details Gets one entry of the captured IEEE1588 timestamp (TS) based on an external event from FIFO.
+ The timestamp status register will indicate auxiliary event.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param ts Holds timestamp.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_getauxts(struct gpy2xx_device *phy, struct timespec64 *ts);
+
+/**
+ \brief Gets filling level and overflow states.
+ \details Gets filling level and overflow status of auxiliary timestamp FIFO.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param fifo_status Holds states (\ref gpy2xx_aux_fifo_stat).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_auxfifostat(struct gpy2xx_device *phy, struct gpy2xx_aux_fifo_stat *fifo_status);
+
+/**
+ \brief Reset timestamp FIFO.
+ \details clear timestamp FIFO.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_ptp_resetauxfifo(struct gpy2xx_device *phy);
+
+/**@}*/ /* GPY211_PTP */
+
+
+
+
+/** @cond DOC_ENABLE_SYNCE */
+/** \addtogroup GPY2XX_SYNCE */
+/**@{*/
+/**
\brief Configures SyncE function.
\details Synchronous Ethernet interface to support transportation of a source-referable
clock from the server to the end-points. Essentially, it consist of a reference clock input
@@ -2246,6 +3676,7 @@
*/
int gpy2xx_synce_cfg(struct gpy2xx_device *phy, struct gpy2xx_synce *cfg);
/**@}*/ /* GPY2XX_SYNCE */
+/** @endcond DOC_ENABLE_SYNCE */
/** \addtogroup GPY2XX_MISC */
/**@{*/
@@ -2321,6 +3752,62 @@
/** \addtogroup GPY2XX_GPY2XX_USXGMII */
/**@{*/
/**
+ \brief Debug API to read XPCS register.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+ \param regaddr XPCS register address (byte address).
+ \param data Pointer to store read data.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_xpcs_read(struct gpy2xx_device *phy, uint32_t regaddr,
+ uint16_t *data);
+
+/**
+ \brief Debug API to write XPCS register.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+ \param regaddr XPCS register address (byte address).
+ \param data Data to be written to given 'regaddr' address.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_xpcs_write(struct gpy2xx_device *phy, uint32_t regaddr,
+ uint16_t data);
+
+/**
+ \brief Debug API to read SERDES register via XPCS CR access.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+ \param regaddr SERDES register address (byte address).
+ \param data Pointer to store read data.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_serdes_read(struct gpy2xx_device *phy, uint32_t regaddr,
+ uint16_t *data);
+
+/**
+ \brief Debug API to write SERDES register via XPCS CR access.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+ \param regaddr SERDES register address (byte address).
+ \param data Data to be written to given 'regaddr' address.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_serdes_write(struct gpy2xx_device *phy, uint32_t regaddr,
+ uint16_t data);
+
+/**
\brief Enter or exit USXGMII debug mode.
\details This is only applied to models supporting USXGMII EQ tuning
function. When entering debug mode, GPY2xx device prepares environment
@@ -2439,7 +3926,7 @@
\param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param pcfg Refer to \ref gpy2xx_fsweep_cfg for parameter details.
+ \param pcfg Refer to \ref gpy2xx_4peye_cfg for parameter details.
\return
- =0: successful
@@ -2489,7 +3976,7 @@
\param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param presult Refer to \ref gpy2xx_weep_result for test result.
+ \param presult Refer to \ref gpy2xx_eye_result for test result.
_______________________________________<---- Buffer Addr, Buffer Size include this 16 bytes
| 16 bytes buff info |
@@ -2536,7 +4023,7 @@
\param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param pcfg Refer to \ref gpy2xx_fsweep_cfg for parameter details.
+ \param pcfg Refer to \ref gpy2xx_4peye_cfg for parameter details.
\return
- =0: successful
@@ -2553,7 +4040,7 @@
\param phy Pointer to GPHY data (\ref gpy2xx_device).
- \param presult Refer to \ref gpy2xx_weep_result for test result.
+ \param presult Refer to \ref gpy2xx_eye_result for test result.
_______________________________________<---- Buffer Addr, Buffer Size include this 16 bytes
| 16 bytes buff info |
@@ -2573,7 +4060,7 @@
/**
\brief fetch scope eye test data on USXGMII interface.
- \details Before call this function, need to call gpy2xx_usxgmii_scope_result function
+ \details Before call this function, need to call gpy2xx_usxgmii_scope_eye_result function
to get the buffer infomation.
This API is used to retrieve scope eye test data in the buffer.
@@ -2581,7 +4068,7 @@
To fetch all the data in the buffer, need to continusly call this function to fetch all the data.
How many time need to fetch the data depends on buffer size
- which is get by the gpy2xx_usxgmii_scope_result function.
+ which is get by the gpy2xx_usxgmii_scope_eye_result function.
The buffer size value in the result is byte unit, this fetch funciton will return one DWORD (four bytes),
the fetch time need to be calculated according this formula: fetch time = (buff_size - 16)/4
The scope eye buffer size is fixed 0xA800+16, so the fetch time is 10752
@@ -2595,6 +4082,23 @@
*/
int gpy2xx_usxgmii_fetch_scope_eye_data(struct gpy2xx_device *phy);
+/**
+ \brief Start scope eye test on USXGMII interface.
+ \details This is only applied to models supporting USXGMII EQ tuning
+ function. Start to run full sweep test on USXGMII with given
+ parameters.
+ Use \ref gpy2xx_usxgmii_scope_eye_result to retrieve the test result.
+
+ \param phy Pointer to GPHY data (\ref gpy2xx_device).
+
+ \param pcfg Refer to \ref gpy2xx_scope_cfg for parameter details.
+
+ \return
+ - =0: successful
+ - <0: error code
+*/
+int gpy2xx_usxgmii_scope_start(struct gpy2xx_device *phy, const struct gpy2xx_scope_cfg *pcfg);
+
/**@}*/ /* GPY2XX_GPY2XX_USXGMII */
#pragma scalar_storage_order default
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw.h
index 3942e53..bed0a5b 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw.h
@@ -16,28 +16,135 @@
#pragma pack(push, 1)
#pragma scalar_storage_order little-endian
-/** \brief Spanning Tree Protocol port states.
- Used by \ref GSW_STP_portCfg_t. */
+/** \mainpage GSW APIs
+ \section intro_sec Introduction
+
+ This document describes the entire interface for accessing and configuring the different services of the Ethernet
+ Switch module. The prefix GSW (Gigabit Switch) is used for all data structures and APIs pertaining to GSWIP
+ Subsystem.
+
+ Main focus of GSW APIs are as follows:
+
+ * - Ethernet Bridging Functions
+ * - VLAN Functions
+ * - Multicast Functions
+ * - Operation, Administration, and Management Functions
+ * - Quality of Service Functions
+ - Traffic Class Classification Functions
+ - Metering Functions
+ - Shaping Functions
+ - Weighted Fair Queuing
+ - Color Marking/Remarking
+ * - Pseudo-MAC Functions
+ * - Debug Statistics Functions
+ * - Classification Engine (PCE) Functions
+*/
+
+/** @{*/
+/** \defgroup GSW_API GSWIP Functional APIs
+ \brief This chapter describes the entire interface for accessing and configuring the different services of the Ethernet Switch module.
+*/
+/**@}*/
+
+/** \addtogroup GSW_API
+ * @{
+ */
+
+/** \defgroup GSW_ETHERNET_BRIDGING Ethernet bridging Functions
+ \brief Group of functional APIs for Ethernet bridging (or switching) is the basic task of the device. It provides individual configurations per port and standard global switch features.
+*/
+
+/** \defgroup GSW_VLAN VLAN Functions
+ \brief Group of functional APIs for VLAN bridging functionality. This includes support for Customer VLAN Tags (C-VLAN) and also Service VLAN Tags (S-VLAN).
+*/
+
+/** \defgroup GSW_MULTICAST Multicast Functions
+ \brief Group of functional APIs for IGMP/MLD snooping configuration and support for IGMPv1/v2/v3 and MLDv1/v2.
+*/
+
+/** \defgroup GSW_OAM Operation, Administration, and Management Functions
+ \brief Group of functions that are provided to perform OAM functions on Switch.
+*/
+
+/** \defgroup GSW_QoS_SVC Quality of Service Functions
+ \brief Group of macros for Quality of Service (QoS) components.
+*/
+
+/** \defgroup GSW_RMON RMON Counters Functions
+ \brief Group of macros for Remote-Monitoring (RMON) counters.
+*/
+
+/** \defgroup GSW_PMAC PMAC Operational Functions
+ \brief Group of functions for PMAC Operations.
+*/
+
+/** \defgroup GSW_PCE PCE Rule Operational Functions
+ \brief Group of functions for GSW PCE (Packet Classification Engine) Rule Operations.
+*/
+
+/** \defgroup GSW_8021X_GROUP 802.1x PORT Operational Functions
+ \brief Group of functions for GSW STP 802.1x Port Operation.
+*/
+
+/** \defgroup GSW_DEBUG Debug Functions
+ \brief Group of functions for GSW Debug Interfaces/Operations.
+*/
+
+/** @cond DOC_ENABLE_PBB */
+/** \defgroup GSW_PBB Mac-in-Mac (PBB) Configuration Functions
+ \brief Group of functions for GSW Mac-in-Mac (PBB) Operation.
+*/
+/** @endcond DOC_ENABLE_PBB */
+
+/**@}*/ /* GSW_API */
+
+
+/** \ingroup GSW_ETHERNET_BRIDGING
+ * \brief GSWIP specific error code base
+ */
+#define GSW_ERROR_BASE 1024
+
+/** \ingroup GSW_ETHERNET_BRIDGING
+ * \brief Enumeration for function status return. The upper four bits are reserved for error classification
+ */
typedef enum {
- /** Forwarding state. The port is allowed to transmit and receive
- all packets. Address Learning is allowed. */
- GSW_STP_PORT_STATE_FORWARD = 0,
- /** Disabled/Discarding state. The port entity will not transmit
- and receive any packets. Learning is disabled in this state. */
- GSW_STP_PORT_STATE_DISABLE = 1,
- /** Learning state. The port entity will only transmit and receive
- Spanning Tree Protocol packets (BPDU). All other packets are discarded.
- MAC table address learning is enabled for all good frames. */
- GSW_STP_PORT_STATE_LEARNING = 2,
- /** Blocking/Listening. Only the Spanning Tree Protocol packets will
- be received and transmitted. All other packets are discarded by
- the port entity. MAC table address learning is disabled in this
- state. */
- GSW_STP_PORT_STATE_BLOCKING = 3
-} GSW_STP_PortState_t;
+ /** Correct or Expected Status */
+ GSW_statusOk = 0,
+ /** Generic or unknown error occurred */
+ GSW_statusErr = -1,
+ /** Invalid function parameter */
+ GSW_statusParam = -(GSW_ERROR_BASE + 2),
+ /** No space left in VLAN table */
+ GSW_statusVLAN_Space = -(GSW_ERROR_BASE + 3),
+ /** Requested VLAN ID not found in table */
+ GSW_statusVLAN_ID = -(GSW_ERROR_BASE + 4),
+ /** Invalid ioctl */
+ GSW_statusInvalIoctl = -(GSW_ERROR_BASE + 5),
+ /** Operation not supported by hardware */
+ GSW_statusNoSupport = -(GSW_ERROR_BASE + 6),
+ /** Timeout */
+ GSW_statusTimeout = -(GSW_ERROR_BASE + 7),
+ /** At least one value is out of range */
+ GSW_statusValueRange = -(GSW_ERROR_BASE + 8),
+ /** The PortId/QueueId/MeterId/etc. is not available in this hardware or the
+ selected feature is not available on this port */
+ GSW_statusPortInvalid = -(GSW_ERROR_BASE + 9),
+ /** The interrupt is not available in this hardware */
+ GSW_statusIRQ_Invalid = -(GSW_ERROR_BASE + 10),
+ /** The MAC table is full, an entry could not be added */
+ GSW_statusMAC_TableFull = -(GSW_ERROR_BASE + 11),
+ /** Locking failed - SWAPI is busy */
+ GSW_statusLock_Failed = -(GSW_ERROR_BASE + 12),
+ /** Multicast Forwarding table entry not found */
+ GSW_statusEntryNotFound = -(GSW_ERROR_BASE + 13),
+} GSW_return_t;
+
-/** \brief Describes the 802.1x port state.
- Used by \ref GSW_8021X_portCfg_t. */
+/** \addtogroup GSW_8021X_GROUP
+ * @{
+ */
+
+/** \brief Describes the 802.1x port state. */
typedef enum {
/** Receive and transmit direction are authorized. The port is allowed to
transmit and receive all packets and the address learning process is
@@ -57,1831 +164,2002 @@
GSW_8021X_PORT_STATE_TX_AUTHORIZED = 3
} GSW_8021X_portState_t;
-/* SSB Arbitration memory mode */
-typedef enum {
- /* GSWIP will be 10 ports mode */
- GSW_10_PORT_MODE = 0,
- /* GSWIP will be 16 ports mode */
- GSW_16_PORT_MODE = 1,
-} GSW_SSB_Arb_Mode_t;
-
-/** \brief Bridge Port Allocation.
- Used by \ref GSW_BRIDGE_PORT_ALLOC and \ref GSW_BRIDGE_PORT_FREE. */
-typedef struct {
- /** If \ref GSW_BRIDGE_PORT_ALLOC is successful, a valid ID will be returned
- in this field. Otherwise, \ref INVALID_HANDLE is returned in this field.
- For \ref GSW_BRIDGE_PORT_FREE, this field should be valid ID returned by
- \ref GSW_BRIDGE_PORT_ALLOC. ID 0 is special for CPU port in PRX300
- by mapping to CTP 0 (Logical Port 0 with Sub-interface ID 0), and
- pre-alloced during initialization. */
- u16 nBridgePortId;
-} GSW_BRIDGE_portAlloc_t;
-
-typedef struct {
- u16 IngressExVlanBlkId;
- u16 EgressExVlanBlkId;
- u16 IngressTrafficMeterId;
- u16 EgressTrafficMeterId;
- u16 BroadcastMeteringId;
- u16 MulticastMeteringId;
- u16 UnknownUniCastMeteringId;
- u16 UnknownMultiIpMeteringId;
- u16 UnknownMultiNonIpMeteringId;
- u16 PmappperIdx;
- u16 IngressVlanFilterBlkId;
- u16 EgressVlanFilter1BlkId;
- u16 EgressVlanFilter2BlkId;
- u16 LearningLimit;
- u16 IndexInUsageCnt;
- u16 IndexInUse : 1;
- u16 BrdgIdAssigned : 1;
- u16 IngressExVlanBlkAssigned : 1;
- u16 EgressExVlanBlkAssigned : 1;
- u16 IngressMeteringAssigned : 1;
- u16 EgressMeteringAssigned : 1;
- u16 BroadcastMeteringAssigned : 1;
- u16 MulticastMeteringAssigned : 1;
- u16 UnknownUniCastMeteringAssigned : 1;
- u16 UnknownMultiIpMeteringAssigned : 1;
- u16 UnknownMultiNonIpMeteringAssigned : 1;
- u16 PmapperAssigned : 1;
- u16 IngressVlanFilterAssigned : 1;
- u16 EgressVlanFilter1Assigned : 1;
- u16 EgressVlanFilter2Assigned : 1;
- u8 BrdgId;
- GSW_STP_PortState_t StpState;
- GSW_8021X_portState_t P8021xState;
-} gsw_brdgportconfig_t;
+/** @}*/ /* GSW_8021X_GROUP */
-/** \brief Color Remarking Mode
- Used by \ref GSW_CTP_portConfig_t. */
-typedef enum {
- /** values from last process stage */
- GSW_REMARKING_NONE = 0,
- /** DEI mark mode */
- GSW_REMARKING_DEI = 2,
- /** PCP 8P0D mark mode */
- GSW_REMARKING_PCP_8P0D = 3,
- /** PCP 7P1D mark mode */
- GSW_REMARKING_PCP_7P1D = 4,
- /** PCP 6P2D mark mode */
- GSW_REMARKING_PCP_6P2D = 5,
- /** PCP 5P3D mark mode */
- GSW_REMARKING_PCP_5P3D = 6,
- /** DSCP AF class */
- GSW_REMARKING_DSCP_AF = 7
-} GSW_ColorRemarkingMode_t;
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
-/** \brief Meters for various egress traffic type.
- Used by \ref GSW_BRIDGE_portConfig_t. */
-typedef enum {
- /** Index of broadcast traffic meter */
- GSW_BRIDGE_PORT_EGRESS_METER_BROADCAST = 0,
- /** Index of known multicast traffic meter */
- GSW_BRIDGE_PORT_EGRESS_METER_MULTICAST = 1,
- /** Index of unknown multicast IP traffic meter */
- GSW_BRIDGE_PORT_EGRESS_METER_UNKNOWN_MC_IP = 2,
- /** Index of unknown multicast non-IP traffic meter */
- GSW_BRIDGE_PORT_EGRESS_METER_UNKNOWN_MC_NON_IP = 3,
- /** Index of unknown unicast traffic meter */
- GSW_BRIDGE_PORT_EGRESS_METER_UNKNOWN_UC = 4,
- /** Index of traffic meter for other types */
- GSW_BRIDGE_PORT_EGRESS_METER_OTHERS = 5,
- /** Number of index */
- GSW_BRIDGE_PORT_EGRESS_METER_MAX = 6
-} GSW_BridgePortEgressMeter_t;
+/** \brief Invalid Value.
+ Used mainly during resource allocation to indicate that resource is not
+ allocated. */
+#define INVALID_HANDLE (~0)
-/** \brief P-mapper Mapping Mode
- Used by \ref GSW_CTP_portConfig_t. */
-typedef enum {
- /** Use PCP for VLAN tagged packets to derive sub interface ID group.
+/** \brief MAC Table Entry to be read.
+ Used by \ref GSW_MAC_TableEntryRead. */
+typedef struct {
+ /** Restart the get operation from the beginning of the table. Otherwise
+ return the next table entry (next to the entry that was returned
+ during the previous get operation). This boolean parameter is set by the
+ calling application. */
+ gsw_bool_t bInitial;
+ /** Indicates that the read operation got all last valid entries of the
+ table. This boolean parameter is set by the switch API
+ when the Switch API is called after the last valid one was returned already. */
+ gsw_bool_t bLast;
+ /** Get the MAC table entry belonging to the given Filtering Identifier
+ (not supported by all switches). */
+ u16 nFId;
+ /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
+ GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
+ dependent.
\remarks
- P-mapper table entry 1-8. */
- GSW_PMAPPER_MAPPING_PCP = 0,
- /** Use LAG Index for Pmapper access (regardless of IP and VLAN packet)to
- derive sub interface ID group.
+ In GSWIP-2.1/2.2/3.0, this field is used as portmap field, when the MSB
+ bit is set. In portmap mode, every value bit represents an Ethernet port.
+ LSB represents Port 0 with incrementing counting.
+ The (MSB - 1) bit represent the last port.
+ The macro \ref GSW_PORTMAP_FLAG_SET allows to set the MSB bit,
+ marking it as portmap variable.
+ Checking the portmap flag can be done by
+ using the \ref GSW_PORTMAP_FLAG_GET macro.
+ From GSWIP3.1, if MSB is set, other bits in this field are ignored.
+ array \ref GSW_MAC_tableRead_t::nPortMap is used for bit map. */
+ u32 nPortId;
+ /** Bridge Port Map - to support GSWIP-3.1, following field is added
+ for port map in static entry. It's valid only when MSB of
+ \ref GSW_MAC_tableRead_t::nPortId is set. Each bit stands for 1 bridge
+ port. */
+ u16 nPortMap[8]; /* max can be 16 */
+ /** Aging Time, given in multiples of 1 second in a range from 1 s to 1,000,000 s.
+ The value read back in a GET command might differ slightly from the value
+ given in the SET command due to limited hardware timing resolution.
+ Filled out by the switch API implementation. */
+ int nAgeTimer;
+ /** STAG VLAN Id. Only applicable in case SVLAN support is enabled on the device. */
+ u16 nSVLAN_Id;
+ /** Static Entry (value will be aged out after 'nAgeTimer' if the entry
+ is not set to static). */
+ gsw_bool_t bStaticEntry;
+ /** Sub-Interface Identifier Destination (supported in GSWIP-3.0/3.1 only). */
+ u16 nSubIfId;
+ /** MAC Address. Filled out by the switch API implementation. */
+ u8 nMAC[GSW_MAC_ADDR_LEN];
+ /** Source/Destination MAC address filtering flag (GSWIP-3.1 only)
+ Value 0 - not filter, 1 - source address filter,
+ 2 - destination address filter, 3 - both source and destination filter.
\remarks
- P-mapper table entry 9-72. */
- GSW_PMAPPER_MAPPING_LAG = 1,
- /** Use DSCP for VLAN tagged IP packets to derive sub interface ID group.
+ Please refer to "GSWIP Hardware Architecture Spec" chapter 3.4.4.6
+ "Source MAC Address Filtering and Destination MAC Address Filtering"
+ for more detail. */
+ u8 nFilterFlag;
+ /** Packet is marked as IGMP controlled if destination MAC address matches
+ MAC in this entry. (GSWIP-3.1 only) */
+ gsw_bool_t bIgmpControlled;
- \remarks
- P-mapper table entry 9-72. */
- GSW_PMAPPER_MAPPING_DSCP = 2,
-} GSW_PmapperMappingMode_t;
+ /** Changed
+ 0: the entry is not changed
+ 1: the entry is changed and not accessed yet */
-/** \brief P-mapper Configuration
- Used by \ref GSW_CTP_portConfig_t, GSW_BRIDGE_portConfig_t.
- In case of LAG, it is user's responsibility to provide the mapped entries
- in given P-mapper table. In other modes the entries are auto mapped from
- input packet. */
-typedef struct {
- /** Index of P-mapper <0-31>. */
- u16 nPmapperId;
+ gsw_bool_t bEntryChanged;
- /** Sub interface ID group.
+ /** Associated Mac address -(GSWIP-3.2)*/
+ u8 nAssociatedMAC[GSW_MAC_ADDR_LEN];
+ /** MAC Table Hit Status Update */
+ gsw_bool_t hitstatus;
+ /** TCI for (GSWIP-3.2) B-Step
+ Bit [0:11] - VLAN ID
+ Bit [12] - VLAN CFI/DEI
+ Bit [13:15] - VLAN PRI */
+ u16 nTci;
+ /** From which port, this MAC address is first time learned.
+ * This is used for loop detection. */
+ u16 nFirstBridgePortId;
+} GSW_MAC_tableRead_t;
- \remarks
- Entry 0 is for non-IP and non-VLAN tagged packets. Entries 1-8 are PCP
- mapping entries for VLAN tagged packets with \ref GSW_PMAPPER_MAPPING_PCP
- selected. Entries 9-72 are DSCP or LAG mapping entries for IP packets without
- VLAN tag or VLAN tagged packets with \ref GSW_PMAPPER_MAPPING_DSCP or
- GSW_PMAPPER_MAPPING_LAG selected. When LAG is selected this 8bit field is
- decoded as Destination sub-interface ID group field bits 3:0, Destination
- logical port ID field bits 7:4 */
- u8 nDestSubIfIdGroup[73];
-} GSW_PMAPPER_t;
+/** \brief Search for a MAC address entry in the address table.
+ Used by \ref GSW_MAC_TableEntryQuery. */
+typedef struct {
+ /** MAC Address. This parameter needs to be provided for the search operation.
+ This is an input parameter. */
+ u8 nMAC[GSW_MAC_ADDR_LEN];
+ /** Get the MAC table entry belonging to the given Filtering Identifier
+ (not supported by all switches).
+ This is an input parameter. */
+ u16 nFId;
+ /** MAC Address Found. Switch API sets this boolean variable in case
+ the requested MAC address 'nMAC' is found inside the address table,
+ otherwise it is set to FALSE.
+ This is an output parameter. */
+ gsw_bool_t bFound;
+ /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
+ GSWIP-3.1, this field is Bridge port ID. The valid range is hardware
+ dependent.
-/** \brief Bridge Port configuration mask.
- Used by \ref GSW_BRIDGE_portConfig_t. */
-typedef enum {
- /** Mask for \ref GSW_BRIDGE_portConfig_t::nBridgeId */
- GSW_BRIDGE_PORT_CONFIG_MASK_BRIDGE_ID = 0x00000001,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bIngressExtendedVlanEnable and
- \ref GSW_BRIDGE_portConfig_t::nIngressExtendedVlanBlockId */
- GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN = 0x00000002,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bEgressExtendedVlanEnable and
- \ref GSW_BRIDGE_portConfig_t::nEgressExtendedVlanBlockId */
- GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN = 0x00000004,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::eIngressMarkingMode */
- GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_MARKING = 0x00000008,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::eEgressRemarkingMode */
- GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_REMARKING = 0x00000010,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bIngressMeteringEnable and
- \ref GSW_BRIDGE_portConfig_t::nIngressTrafficMeterId */
- GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_METER = 0x00000020,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bEgressSubMeteringEnable and
- \ref GSW_BRIDGE_portConfig_t::nEgressTrafficSubMeterId */
- GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER = 0x00000040,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::nDestLogicalPortId,
- \ref GSW_BRIDGE_portConfig_t::bPmapperEnable,
- \ref GSW_BRIDGE_portConfig_t::nDestSubIfIdGroup,
- \ref GSW_BRIDGE_portConfig_t::ePmapperMappingMode,
- \ref GSW_BRIDGE_portConfig_t::bPmapperIdValid and
- \ref GSW_BRIDGE_portConfig_t::sPmapper. */
- GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_CTP_MAPPING = 0x00000080,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::nBridgePortMap */
- GSW_BRIDGE_PORT_CONFIG_MASK_BRIDGE_PORT_MAP = 0x00000100,
-
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bMcDestIpLookupEnable. */
- GSW_BRIDGE_PORT_CONFIG_MASK_MC_DEST_IP_LOOKUP = 0x00000200,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bMcSrcIpLookupEnable. */
- GSW_BRIDGE_PORT_CONFIG_MASK_MC_SRC_IP_LOOKUP = 0x00000400,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bDestMacLookupEnable. */
- GSW_BRIDGE_PORT_CONFIG_MASK_MC_DEST_MAC_LOOKUP = 0x00000800,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bSrcMacLearningEnable. */
- GSW_BRIDGE_PORT_CONFIG_MASK_MC_SRC_MAC_LEARNING = 0x00001000,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bMacSpoofingDetectEnable. */
- GSW_BRIDGE_PORT_CONFIG_MASK_MAC_SPOOFING = 0x00002000,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bPortLockEnable. */
- GSW_BRIDGE_PORT_CONFIG_MASK_PORT_LOCK = 0x00004000,
+ \remarks
+ In GSWIP-2.1/2.2/3.0, this field is used as portmap field, when the MSB
+ bit is set. In portmap mode, every value bit represents an Ethernet port.
+ LSB represents Port 0 with incrementing counting.
+ The (MSB - 1) bit represent the last port.
+ The macro \ref GSW_PORTMAP_FLAG_SET allows to set the MSB bit,
+ marking it as portmap variable.
+ Checking the portmap flag can be done by
+ using the \ref GSW_PORTMAP_FLAG_GET macro.
+ From GSWIP3.1, if MSB is set, other bits in this field are ignored.
+ array \ref GSW_MAC_tableRead_t::nPortMap is used for bit map. */
+ u32 nPortId;
+ /** Bridge Port Map - to support GSWIP-3.1, following field is added
+ for port map in static entry. It's valid only when MSB of
+ \ref GSW_MAC_tableRead_t::nPortId is set. Each bit stands for 1 bridge
+ port. */
+ u16 nPortMap[8]; /* max can be 16 */
+ /** Sub-Interface Identifier Destination (supported in GSWIP-3.0/3.1 only). */
+ u16 nSubIfId;
+ /** Aging Time, given in multiples of 1 second in a range from 1 s to 1,000,000 s.
+ The value read back in a GET command might differ slightly from the value
+ given in the SET command due to limited hardware timing resolution.
+ Filled out by the switch API implementation.
+ This is an output parameter. */
+ int nAgeTimer;
+ /** STAG VLAN Id. Only applicable in case SVLAN support is enabled on the device. */
+ u16 nSVLAN_Id;
+ /** Static Entry (value will be aged out after 'nAgeTimer' if the entry
+ is not set to static).
+ This is an output parameter. */
+ gsw_bool_t bStaticEntry;
+ /** Source/Destination MAC address filtering flag (GSWIP-3.1 only)
+ Value 0 - not filter, 1 - source address filter,
+ 2 - destination address filter, 3 - both source and destination filter.
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bMacLearningLimitEnable and
- \ref GSW_BRIDGE_portConfig_t::nMacLearningLimit. */
- GSW_BRIDGE_PORT_CONFIG_MASK_MAC_LEARNING_LIMIT = 0x00008000,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::nMacLearningCount */
- GSW_BRIDGE_PORT_CONFIG_MASK_MAC_LEARNED_COUNT = 0x00010000,
+ \remarks
+ Please refer to "GSWIP Hardware Architecture Spec" chapter 3.4.4.6
+ "Source MAC Address Filtering and Destination MAC Address Filtering"
+ for more detail. */
+ u8 nFilterFlag;
+ /** Packet is marked as IGMP controlled if destination MAC address matches
+ MAC in this entry. (GSWIP-3.1 only) */
+ gsw_bool_t bIgmpControlled;
+ /** Changed
+ 0: the entry is not changed
+ 1: the entry is changed and not accessed yet */
+ gsw_bool_t bEntryChanged;
+ /** Associated Mac address -(GSWIP-3.2)*/
+ u8 nAssociatedMAC[GSW_MAC_ADDR_LEN];
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bIngressVlanFilterEnable and
- \ref GSW_BRIDGE_portConfig_t::nIngressVlanFilterBlockId. */
- GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN_FILTER = 0x00020000,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bBypassEgressVlanFilter1,
- \ref GSW_BRIDGE_portConfig_t::bEgressVlanFilter1Enable
- and \ref GSW_BRIDGE_portConfig_t::nEgressVlanFilter1BlockId. */
- GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN_FILTER1 = 0x00040000,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bEgressVlanFilter2Enable and
- \ref GSW_BRIDGE_portConfig_t::nEgressVlanFilter2BlockId. */
- GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN_FILTER2 = 0x00080000,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bVlanTagSelection,
- \ref GSW_BRIDGE_portConfig_t::bVlanSrcMacPriorityEnable,
- \ref GSW_BRIDGE_portConfig_t::bVlanSrcMacDEIEnable,
- \ref GSW_BRIDGE_portConfig_t::bVlanSrcMacVidEnable,
- \ref GSW_BRIDGE_portConfig_t::bVlanDstMacPriorityEnable,
- \ref GSW_BRIDGE_portConfig_t::bVlanDstMacDEIEnable,
- \ref GSW_BRIDGE_portConfig_t::bVlanDstMacVidEnable */
- GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING = 0x00100000,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::bVlanMulticastPriorityEnable,
- \ref GSW_BRIDGE_portConfig_t::bVlanMulticastDEIEnable,
- \ref GSW_BRIDGE_portConfig_t::bVlanMulticastVidEnable */
- GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MULTICAST_LOOKUP = 0x00200000,
- /** Mask for \ref GSW_BRIDGE_portConfig_t::nLoopViolationCount */
- GSW_BRIDGE_PORT_CONFIG_MASK_LOOP_VIOLATION_COUNTER = 0x00400000,
- /** Enable all */
- GSW_BRIDGE_PORT_CONFIG_MASK_ALL = 0x7FFFFFFF,
- /** Bypass any check for debug purpose */
- GSW_BRIDGE_PORT_CONFIG_MASK_FORCE = 0x80000000
-} GSW_BridgePortConfigMask_t;
+ /** MAC Table Hit Status Update */
+ gsw_bool_t hitstatus;
+ /** TCI for (GSWIP-3.2) B-Step
+ Bit [0:11] - VLAN ID
+ Bit [12] - VLAN CFI/DEI
+ Bit [13:15] - VLAN PRI */
+ u16 nTci;
+ /** first bridge port ID (supported in GSWIP-3.3only) */
+ u16 nFirstBridgePortId;
+} GSW_MAC_tableQuery_t;
-/** \brief Color Marking Mode
- Used by \ref GSW_CTP_portConfig_t. */
-typedef enum {
- /** mark packets (except critical) to green */
- GSW_MARKING_ALL_GREEN = 0,
- /** do not change color and priority */
- GSW_MARKING_INTERNAL_MARKING = 1,
- /** DEI mark mode */
- GSW_MARKING_DEI = 2,
- /** PCP 8P0D mark mode */
- GSW_MARKING_PCP_8P0D = 3,
- /** PCP 7P1D mark mode */
- GSW_MARKING_PCP_7P1D = 4,
- /** PCP 6P2D mark mode */
- GSW_MARKING_PCP_6P2D = 5,
- /** PCP 5P3D mark mode */
- GSW_MARKING_PCP_5P3D = 6,
- /** DSCP AF class */
- GSW_MARKING_DSCP_AF = 7
-} GSW_ColorMarkingMode_t;
+/** \brief MAC Table Entry to be added.
+ Used by \ref GSW_MAC_TableEntryAdd. */
+typedef struct {
+ /** Filtering Identifier (FID) (not supported by all switches) */
+ u16 nFId;
+ /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
+ GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
+ dependent.
+ \remarks
+ In GSWIP-2.1/2.2/3.0, this field is used as portmap field, when the MSB
+ bit is set. In portmap mode, every value bit represents an Ethernet port.
+ LSB represents Port 0 with incrementing counting.
+ The (MSB - 1) bit represent the last port.
+ The macro \ref GSW_PORTMAP_FLAG_SET allows to set the MSB bit,
+ marking it as portmap variable.
+ Checking the portmap flag can be done by
+ using the \ref GSW_PORTMAP_FLAG_GET macro.
+ From GSWIP3.1, if MSB is set, other bits in this field are ignored.
+ array \ref GSW_MAC_tableRead_t::nPortMap is used for bit map. */
+ u32 nPortId;
+ /** Bridge Port Map - to support GSWIP-3.1, following field is added
+ for port map in static entry. It's valid only when MSB of
+ \ref GSW_MAC_tableRead_t::nPortId is set. Each bit stands for 1 bridge
+ port. */
+ u16 nPortMap[8]; /* max can be 16 */
+ /** Sub-Interface Identifier Destination (supported in GSWIP-3.0/3.1 only).
-/** \brief Bridge configuration mask.
- Used by \ref GSW_BRIDGE_config_t. */
-typedef enum {
- /** Mask for \ref GSW_BRIDGE_config_t::bMacLearningLimitEnable
- and \ref GSW_BRIDGE_config_t::nMacLearningLimit. */
- GSW_BRIDGE_CONFIG_MASK_MAC_LEARNING_LIMIT = 0x00000001,
- /** Mask for \ref GSW_BRIDGE_config_t::nMacLearningCount */
- GSW_BRIDGE_CONFIG_MASK_MAC_LEARNED_COUNT = 0x00000002,
- /** Mask for \ref GSW_BRIDGE_config_t::nLearningDiscardEvent */
- GSW_BRIDGE_CONFIG_MASK_MAC_DISCARD_COUNT = 0x00000004,
- /** Mask for \ref GSW_BRIDGE_config_t::bSubMeteringEnable and
- \ref GSW_BRIDGE_config_t::nTrafficSubMeterId */
- GSW_BRIDGE_CONFIG_MASK_SUB_METER = 0x00000008,
- /** Mask for \ref GSW_BRIDGE_config_t::eForwardBroadcast,
- \ref GSW_BRIDGE_config_t::eForwardUnknownMulticastIp,
- \ref GSW_BRIDGE_config_t::eForwardUnknownMulticastNonIp,
- and \ref GSW_BRIDGE_config_t::eForwardUnknownUnicast. */
- GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE = 0x00000010,
+ \remarks
+ In GSWIP-3.1, this field is sub interface ID for WLAN logical port. For
+ Other types, either outer VLAN ID if Nto1Vlan enabled or 0. */
+ u16 nSubIfId;
+ /** Aging Time, given in multiples of 1 second in a range
+ from 1 s to 1,000,000 s.
+ The configured value might be rounded that it fits to the given hardware platform. */
+ int nAgeTimer;
+ /** STAG VLAN Id. Only applicable in case SVLAN support is enabled on the device. */
+ u16 nSVLAN_Id;
+ /** Static Entry (value will be aged out if the entry is not set to static). The
+ switch API implementation uses the maximum age timer in case the entry
+ is not static. */
+ gsw_bool_t bStaticEntry;
+ /** Egress queue traffic class.
+ The queue index starts counting from zero. */
+ u8 nTrafficClass;
+ /** MAC Address to add to the table. */
+ u8 nMAC[GSW_MAC_ADDR_LEN];
+ /** Source/Destination MAC address filtering flag (GSWIP-3.1 only)
+ Value 0 - not filter, 1 - source address filter,
+ 2 - destination address filter, 3 - both source and destination filter.
- /** Enable all */
- GSW_BRIDGE_CONFIG_MASK_ALL = 0x7FFFFFFF,
- /** Bypass any check for debug purpose */
- GSW_BRIDGE_CONFIG_MASK_FORCE = 0x80000000
-} GSW_BridgeConfigMask_t;
+ \remarks
+ Please refer to "GSWIP Hardware Architecture Spec" chapter 3.4.4.6
+ "Source MAC Address Filtering and Destination MAC Address Filtering"
+ for more detail. */
+ u8 nFilterFlag;
+ /** Packet is marked as IGMP controlled if destination MAC address matches
+ MAC in this entry. (GSWIP-3.1 only) */
+ gsw_bool_t bIgmpControlled;
-/** \brief Bridge forwarding type of packet.
- Used by \ref GSW_BRIDGE_portConfig_t. */
-typedef enum {
- /** Packet is flooded to port members of ingress bridge port */
- GSW_BRIDGE_FORWARD_FLOOD = 0,
- /** Packet is dscarded */
- GSW_BRIDGE_FORWARD_DISCARD = 1,
- /** Packet is forwarded to logical port 0 CTP port 0 bridge port 0 */
- GSW_BRIDGE_FORWARD_CPU = 2
-} GSW_BridgeForwardMode_t;
+ /** Associated Mac address -(GSWIP-3.2)*/
+ u8 nAssociatedMAC[GSW_MAC_ADDR_LEN];
+ /** TCI for (GSWIP-3.2) B-Step
+ Bit [0:11] - VLAN ID
+ Bit [12] - VLAN CFI/DEI
+ Bit [13:15] - VLAN PRI */
+ u16 nTci;
+} GSW_MAC_tableAdd_t;
-/** \brief Bridge Port Configuration.
- Used by \ref GSW_BRIDGE_PORT_CONFIG_SET and \ref GSW_BRIDGE_PORT_CONFIG_GET. */
+/** \brief MAC Table Entry to be removed.
+ Used by \ref GSW_MAC_TableEntryRemove. */
typedef struct {
- /** Bridge Port ID allocated by \ref GSW_BRIDGE_PORT_ALLOC.
+ /** Filtering Identifier (FID) (not supported by all switches) */
+ u16 nFId;
+ /** MAC Address to be removed from the table. */
+ u8 nMAC[GSW_MAC_ADDR_LEN];
+ /** Source/Destination MAC address filtering flag (GSWIP-3.1 only)
+ Value 0 - not filter, 1 - source address filter,
+ 2 - destination address filter, 3 - both source and destination filter.
\remarks
- If \ref GSW_BRIDGE_portConfig_t::eMask has
- \ref GSW_BridgePortConfigMask_t::GSW_BRIDGE_PORT_CONFIG_MASK_FORCE, this
- field is absolute index of Bridge Port in hardware for debug purpose,
- bypassing any check. */
- u16 nBridgePortId;
-
- /** Mask for updating/retrieving fields. */
- GSW_BridgePortConfigMask_t eMask;
-
- /** Bridge ID (FID) to which this bridge port is associated. A default
- bridge (ID 0) should be always available. */
- u16 nBridgeId;
+ Please refer to "GSWIP Hardware Architecture Spec" chapter 3.4.4.6
+ "Source MAC Address Filtering and Destination MAC Address Filtering"
+ for more detail. */
+ u8 nFilterFlag;
+ /** TCI for (GSWIP-3.2) B-Step
+ Bit [0:11] - VLAN ID
+ Bit [12] - VLAN CFI/DEI
+ Bit [13:15] - VLAN PRI */
+ u16 nTci;
+} GSW_MAC_tableRemove_t;
- /** Enable extended VLAN processing for ingress non-IGMP traffic. */
- gsw_bool_t bIngressExtendedVlanEnable;
- /** Extended VLAN block allocated for ingress non-IGMP traffic. It defines
- extended VLAN process for ingress non-IGMP traffic. Valid when
- bIngressExtendedVlanEnable is TRUE. */
- u16 nIngressExtendedVlanBlockId;
- /** Extended VLAN block size for ingress non-IGMP traffic. This is optional.
- If it is 0, the block size of nIngressExtendedVlanBlockId will be used.
- Otherwise, this field will be used. */
- u16 nIngressExtendedVlanBlockSize;
+/** \brief MAC Table Clear Type
+ Used by \ref GSW_MAC_tableClearCond_t */
+typedef enum {
+ /** Clear dynamic entries based on Physical Port */
+ GSW_MAC_CLEAR_PHY_PORT = 0,
+ /** Clear all dynamic entries */
+ GSW_MAC_CLEAR_DYNAMIC = 1,
+} GSW_MacClearType_t;
- /** Enable extended VLAN processing enabled for egress non-IGMP traffic. */
- gsw_bool_t bEgressExtendedVlanEnable;
- /** Extended VLAN block allocated for egress non-IGMP traffic. It defines
- extended VLAN process for egress non-IGMP traffic. Valid when
- bEgressExtendedVlanEnable is TRUE. */
- u16 nEgressExtendedVlanBlockId;
- /** Extended VLAN block size for egress non-IGMP traffic. This is optional.
- If it is 0, the block size of nEgressExtendedVlanBlockId will be used.
- Otherwise, this field will be used. */
- u16 nEgressExtendedVlanBlockSize;
+/** \brief MAC Table Clear based on given condition.
+ Used by \ref GSW_MAC_TableClearCond. */
+typedef struct {
+ /** MAC table clear type \ref GSW_MacClearType_t */
+ u8 eType;
+ union {
+ /** Physical port id (0~16) if \ref eType is
+ ref GSW_MAC_CLEAR_PHY_PORT. */
+ u8 nPortId;
+ };
+} GSW_MAC_tableClearCond_t;
- /** Ingress color marking mode for ingress traffic. */
- GSW_ColorMarkingMode_t eIngressMarkingMode;
+/** \brief MAC Address Filter Type.
+ Used by \ref GSW_MACFILTER_default_t */
+typedef enum {
+ /** Source MAC Address Filter */
+ GSW_MACFILTERTYPE_SRC = 0,
+ /** Destination MAC Address Filter */
+ GSW_MACFILTERTYPE_DEST = 1
+} GSW_MacFilterType_t;
- /** Color remarking for egress traffic. */
- GSW_ColorRemarkingMode_t eEgressRemarkingMode;
+/** \brief Default MAC Address Filter.
+ Used by \ref GSW_DefaultMacFilterSet and \ref GSW_DefaultMacFilterGet */
+typedef struct {
+ /** MAC Filter Type */
+ GSW_MacFilterType_t eType;
- /** Traffic metering on ingress traffic applies. */
- gsw_bool_t bIngressMeteringEnable;
- /** Meter for ingress Bridge Port process.
+ /** Destination bridge port map. For GSWIP-3.1 only.
\remarks
- Meter should be allocated with \ref GSW_QOS_METER_ALLOC before Bridge
- port configuration. If this Bridge port is re-set, the last used meter
- should be released. */
- u16 nIngressTrafficMeterId;
+ Each bit stands for 1 bridge port. For PRX300 (GSWIP-3.1 integrated),
+ only index 0-7 is valid. */
+ u16 nPortmap[8]; /* max can be 16 */
+} GSW_MACFILTER_default_t;
- /** Traffic metering on various types of egress traffic (such as broadcast,
- multicast, unknown unicast, etc) applies. */
- gsw_bool_t bEgressSubMeteringEnable[GSW_BRIDGE_PORT_EGRESS_METER_MAX];
- /** Meter for egress Bridge Port process with specific type (such as
- broadcast, multicast, unknown unicast, etc). Need pre-allocated for each
- type. */
- u16 nEgressTrafficSubMeterId[GSW_BRIDGE_PORT_EGRESS_METER_MAX];
+/** \brief Detect MAC violation for input map of bridge ports.
+ * Used by \ref GSW_MAC_TableLoopDetect
+ */
+typedef struct {
+ /** Input bridge port map to check MAC violation */
+ u32 bp_map_in[128 / 32];
+ /** Output bridge port map where the MAC violation is found */
+ u32 bp_map_out[128 / 32];
+} GSW_MAC_tableLoopDetect_t;
- /** This field defines destination logical port. */
- u8 nDestLogicalPortId;
- /** This field indicates whether to enable P-mapper. */
- gsw_bool_t bPmapperEnable;
- /** When bPmapperEnable is FALSE, this field defines destination sub
- interface ID group. */
- u16 nDestSubIfIdGroup;
- /** When bPmapperEnable is TRUE, this field selects either DSCP or PCP to
- derive sub interface ID. */
- GSW_PmapperMappingMode_t ePmapperMappingMode;
- /** When bPmapperEnable is TRUE, P-mapper is used. This field determines
- whether sPmapper.nPmapperId is valid. If this field is TRUE, the
- P-mapper is re-used and no allocation of new P-mapper or value
- change in the P-mapper. If this field is FALSE, allocation is
- taken care in the API implementation. */
- gsw_bool_t bPmapperIdValid;
- /** When bPmapperEnable is TRUE, P-mapper is used. if bPmapperIdValid is
- FALSE, API implementation need take care of P-mapper allocation,
- and maintain the reference counter of P-mapper used multiple times.
- If bPmapperIdValid is TRUE, only sPmapper.nPmapperId is used to
- associate the P-mapper, and there is no allocation of new P-mapper
- or value change in the P-mapper. */
- GSW_PMAPPER_t sPmapper;
+/** \brief Packet forwarding.
+ Used by \ref GSW_STP_BPDU_Rule_t and \ref GSW_multicastSnoopCfg_t. */
+typedef enum {
+ /** Default; portmap is determined by the forwarding classification. */
+ GSW_PORT_FORWARD_DEFAULT = 0,
+ /** Discard; discard packets. */
+ GSW_PORT_FORWARD_DISCARD = 1,
+ /** Forward to the CPU port. This requires that the CPU port is previously
+ set by calling \ref GSW_CPU_PortCfgSet. */
+ GSW_PORT_FORWARD_CPU = 2,
+ /** Forward to a port, selected by the parameter 'nForwardPortId'.
+ Please note that this feature is not supported by all
+ hardware platforms. */
+ GSW_PORT_FORWARD_PORT = 3
+} GSW_portForward_t;
- /** Port map define broadcast domain.
+/** \brief Spanning Tree Protocol port states.
+ Used by \ref GSW_STP_portCfg_t. */
+typedef enum {
+ /** Forwarding state. The port is allowed to transmit and receive
+ all packets. Address Learning is allowed. */
+ GSW_STP_PORT_STATE_FORWARD = 0,
+ /** Disabled/Discarding state. The port entity will not transmit
+ and receive any packets. Learning is disabled in this state. */
+ GSW_STP_PORT_STATE_DISABLE = 1,
+ /** Learning state. The port entity will only transmit and receive
+ Spanning Tree Protocol packets (BPDU). All other packets are discarded.
+ MAC table address learning is enabled for all good frames. */
+ GSW_STP_PORT_STATE_LEARNING = 2,
+ /** Blocking/Listening. Only the Spanning Tree Protocol packets will
+ be received and transmitted. All other packets are discarded by
+ the port entity. MAC table address learning is disabled in this
+ state. */
+ GSW_STP_PORT_STATE_BLOCKING = 3
+} GSW_STP_PortState_t;
- \remarks
- Each bit is one bridge port. Bridge port ID is index * 16 + bit offset.
- For example, bit 1 of nBridgePortMap[1] is bridge port ID 17. */
- u16 nBridgePortMap[8]; /* max can be 16 */
+/** \brief Configures the Spanning Tree Protocol state of an Ethernet port.
+ Used by \ref GSW_STP_PortCfgSet
+ and \ref GSW_STP_PortCfgGet. */
+typedef struct {
+ /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
+ GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
+ dependent. An error code is delivered if the selected port is not
+ available. */
+ u16 nPortId;
+ /** Filtering Identifier (FID) (not supported by all switches).
+ The FID allows to keep multiple STP states per physical Ethernet port.
+ Multiple CTAG VLAN groups could be a assigned to one FID and therefore
+ share the same STP port state. Switch API ignores the FID value
+ in case the switch device does not support it or switch CTAG VLAN
+ awareness is disabled. */
+ u16 nFId;
+ /** Spanning Tree Protocol state of the port. */
+ GSW_STP_PortState_t ePortState;
+} GSW_STP_portCfg_t;
- /** Multicast IP table is searched if this field is FALSE and traffic is IP
- multicast. */
- gsw_bool_t bMcDestIpLookupDisable;
- /** Multicast IP table is searched if this field is TRUE and traffic is IP
- multicast. */
- gsw_bool_t bMcSrcIpLookupEnable;
+/** \brief Spanning tree packet detection and forwarding.
+ Used by \ref GSW_STP_BPDU_RuleSet
+ and \ref GSW_STP_BPDU_RuleGet. */
+typedef struct {
+ /** Filter spanning tree packets and forward them, discard them or
+ disable the filter. */
+ GSW_portForward_t eForwardPort;
+ /** Target (bridge) port for forwarded packets; only used if selected by
+ 'eForwardPort'. Forwarding is done
+ if 'eForwardPort = GSW_PORT_FORWARD_PORT'. */
+ u8 nForwardPortId;
+} GSW_STP_BPDU_Rule_t;
- /** Default is FALSE. Packet is treated as "unknown" if it's not
- broadcast/multicast packet. */
- gsw_bool_t bDestMacLookupDisable;
+/** \brief SSB Arbitration memory mode */
+typedef enum {
+ /* GSWIP will be 10 ports mode */
+ GSW_10_PORT_MODE = 0,
+ /* GSWIP will be 16 ports mode */
+ GSW_16_PORT_MODE = 1,
+} GSW_SSB_Arb_Mode_t;
- /** Default is FALSE. Source MAC address is learned. */
- gsw_bool_t bSrcMacLearningDisable;
+/** \brief Bridge Port Allocation.
+ Used by \ref GSW_BridgePortAlloc and \ref GSW_BridgePortFree. */
+typedef struct {
+ /** If \ref GSW_BridgePortAlloc is successful, a valid ID will be returned
+ in this field. Otherwise, \ref INVALID_HANDLE is returned in this field.
+ For \ref GSW_BridgePortFree, this field should be valid ID returned by
+ \ref GSW_BridgePortAlloc. ID 0 is special for CPU port in PRX300
+ by mapping to CTP 0 (Logical Port 0 with Sub-interface ID 0), and
+ pre-alloced during initialization. */
+ u16 nBridgePortId;
+} GSW_BRIDGE_portAlloc_t;
- /** If this field is TRUE and MAC address which is already learned in another
- bridge port appears on this bridge port, port locking violation is
- detected. */
- gsw_bool_t bMacSpoofingDetectEnable;
+/** \brief Color Remarking Mode
+ Used by \ref GSW_CTP_portConfig_t. */
+typedef enum {
+ /** values from last process stage */
+ GSW_REMARKING_NONE = 0,
+ /** DEI mark mode */
+ GSW_REMARKING_DEI = 2,
+ /** PCP 8P0D mark mode */
+ GSW_REMARKING_PCP_8P0D = 3,
+ /** PCP 7P1D mark mode */
+ GSW_REMARKING_PCP_7P1D = 4,
+ /** PCP 6P2D mark mode */
+ GSW_REMARKING_PCP_6P2D = 5,
+ /** PCP 5P3D mark mode */
+ GSW_REMARKING_PCP_5P3D = 6,
+ /** DSCP AF class */
+ GSW_REMARKING_DSCP_AF = 7
+} GSW_ColorRemarkingMode_t;
- /** If this field is TRUE and MAC address which is already learned in this
- bridge port appears on another bridge port, port locking violation is
- detected. */
- gsw_bool_t bPortLockEnable;
+/** \brief Meters for various egress traffic type.
+ Used by \ref GSW_BRIDGE_portConfig_t. */
+typedef enum {
+ /** Index of broadcast traffic meter */
+ GSW_BRIDGE_PORT_EGRESS_METER_BROADCAST = 0,
+ /** Index of known multicast traffic meter */
+ GSW_BRIDGE_PORT_EGRESS_METER_MULTICAST = 1,
+ /** Index of unknown multicast IP traffic meter */
+ GSW_BRIDGE_PORT_EGRESS_METER_UNKNOWN_MC_IP = 2,
+ /** Index of unknown multicast non-IP traffic meter */
+ GSW_BRIDGE_PORT_EGRESS_METER_UNKNOWN_MC_NON_IP = 3,
+ /** Index of unknown unicast traffic meter */
+ GSW_BRIDGE_PORT_EGRESS_METER_UNKNOWN_UC = 4,
+ /** Index of traffic meter for other types */
+ GSW_BRIDGE_PORT_EGRESS_METER_OTHERS = 5,
+ /** Number of index */
+ GSW_BRIDGE_PORT_EGRESS_METER_MAX = 6
+} GSW_BridgePortEgressMeter_t;
- /** Enable MAC learning limitation. */
- gsw_bool_t bMacLearningLimitEnable;
- /** Max number of MAC can be learned from this bridge port. */
- u16 nMacLearningLimit;
+/** \brief P-mapper Mapping Mode
+ Used by \ref GSW_CTP_portConfig_t. */
+typedef enum {
+ /** Use PCP for VLAN tagged packets to derive sub interface ID group.
- /** Get number of Loop violation counter from this bridge port. */
- u16 nLoopViolationCount;
+ \remarks
+ P-mapper table entry 1-8. */
+ GSW_PMAPPER_MAPPING_PCP = 0,
+ /** Use LAG Index for Pmapper access (regardless of IP and VLAN packet)to
+ derive sub interface ID group.
- /** Get number of MAC address learned from this bridge port. */
- u16 nMacLearningCount;
+ \remarks
+ P-mapper table entry 9-72. */
+ GSW_PMAPPER_MAPPING_LAG = 1,
+ /** Use DSCP for VLAN tagged IP packets to derive sub interface ID group.
- /** Enable ingress VLAN filter */
- gsw_bool_t bIngressVlanFilterEnable;
- /** VLAN filter block of ingress traffic if
- \ref GSW_BRIDGE_portConfig_t::bIngressVlanFilterEnable is TRUE. */
- u16 nIngressVlanFilterBlockId;
- /** VLAN filter block size. This is optional.
- If it is 0, the block size of nIngressVlanFilterBlockId will be used.
- Otherwise, this field will be used. */
- u16 nIngressVlanFilterBlockSize;
- /** For ingress traffic, bypass VLAN filter 1 at egress bridge port
- processing. */
- gsw_bool_t bBypassEgressVlanFilter1;
- /** Enable egress VLAN filter 1 */
- gsw_bool_t bEgressVlanFilter1Enable;
- /** VLAN filter block 1 of egress traffic if
- \ref GSW_BRIDGE_portConfig_t::bEgressVlanFilter1Enable is TRUE. */
- u16 nEgressVlanFilter1BlockId;
- /** VLAN filter block 1 size. This is optional.
- If it is 0, the block size of nEgressVlanFilter1BlockId will be used.
- Otherwise, this field will be used. */
- u16 nEgressVlanFilter1BlockSize;
- /** Enable egress VLAN filter 2 */
- gsw_bool_t bEgressVlanFilter2Enable;
- /** VLAN filter block 2 of egress traffic if
- \ref GSW_BRIDGE_portConfig_t::bEgressVlanFilter2Enable is TRUE. */
- u16 nEgressVlanFilter2BlockId;
- /** VLAN filter block 2 size. This is optional.
- If it is 0, the block size of nEgressVlanFilter2BlockId will be used.
- Otherwise, this field will be used. */
- u16 nEgressVlanFilter2BlockSize;
- /** 0 - Intermediate outer VLAN
- tag is used for MAC address/multicast
- learning, lookup and filtering.
- 1 - Original outer VLAN tag is used
- for MAC address/multicast learning, lookup
- and filtering. */
- gsw_bool_t bVlanTagSelection;
- /** 0 - Disable, VLAN Priority field is not used
- and value 0 is used for source MAC address
- learning and filtering.
- 1 - Enable, VLAN Priority field is used for
- source MAC address learning and filtering. */
- gsw_bool_t bVlanSrcMacPriorityEnable;
- /** 0 - Disable, VLAN DEI/CFI field is not used
- and value 0 is used for source MAC address
- learning and filtering.
- 1 - Enable, VLAN DEI/CFI field is used for
- source MAC address learning and filtering */
- gsw_bool_t bVlanSrcMacDEIEnable;
- /** 0 - Disable, VLAN ID field is not used and
- value 0 is used for source MAC address
- learning and filtering
- 1 - Enable, VLAN ID field is used for source
- MAC address learning and filtering. */
- gsw_bool_t bVlanSrcMacVidEnable;
- /** 0 - Disable, VLAN Priority field is not used
- and value 0 is used for destination MAC
- address look up and filtering.
- 1 - Enable, VLAN Priority field is used for
- destination MAC address look up and
- filtering */
- gsw_bool_t bVlanDstMacPriorityEnable;
- /** 0 - Disable, VLAN CFI/DEI field is not used
- and value 0 is used for destination MAC
- address lookup and filtering.
- 1 - Enable, VLAN CFI/DEI field is used for
- destination MAC address look up and
- filtering. */
- gsw_bool_t bVlanDstMacDEIEnable;
- /** 0 - Disable, VLAN ID field is not used and
- value 0 is used for destination MAC address
- look up and filtering.
- 1 - Enable, VLAN ID field is destination for
- destination MAC address look up and
- filtering. */
- gsw_bool_t bVlanDstMacVidEnable;
-
- /** 0 - Disable, VLAN Priority field is not used
- and value 0 is used for IP multicast lookup.
- 1 - Enable, VLAN Priority field is used for IP
- multicast lookup. */
- gsw_bool_t bVlanMulticastPriorityEnable;
- /** 0 - Disable, VLAN CFI/DEI field is not used
- and value 0 is used for IP multicast lookup.
- 1 - Enable, VLAN CFI/DEI field is used for IP
- multicast lookup. */
- gsw_bool_t bVlanMulticastDEIEnable;
- /** 0 - Disable, VLAN ID field is not used and
- value 0 is used for IP multicast lookup.
- 1 - Enable, VLAN ID field is destination for IP
- multicast lookup. */
- gsw_bool_t bVlanMulticastVidEnable;
-} GSW_BRIDGE_portConfig_t;
-
-
-/** \brief VLAN Filter TCI Mask.
- Used by \ref GSW_VLANFILTER_config_t */
-typedef enum {
- GSW_VLAN_FILTER_TCI_MASK_VID = 0,
- GSW_VLAN_FILTER_TCI_MASK_PCP = 1,
- GSW_VLAN_FILTER_TCI_MASK_TCI = 2
-} GSW_VlanFilterTciMask_t;
-
-typedef struct {
- u16 IndexInUsageCnt : 15;
- u8 IndexInUse : 1;
-} gsw_pmapper_t;
-
+ \remarks
+ P-mapper table entry 9-72. */
+ GSW_PMAPPER_MAPPING_DSCP = 2,
+} GSW_PmapperMappingMode_t;
-/** \brief Bridge Allocation.
- Used by \ref GSW_BRIDGE_ALLOC and \ref GSW_BRIDGE_FREE. */
+/** \brief P-mapper Configuration
+ Used by \ref GSW_CTP_portConfig_t, GSW_BRIDGE_portConfig_t.
+ In case of LAG, it is user's responsibility to provide the mapped entries
+ in given P-mapper table. In other modes the entries are auto mapped from
+ input packet. */
typedef struct {
- /** If \ref GSW_BRIDGE_ALLOC is successful, a valid ID will be returned
- in this field. Otherwise, \ref INVALID_HANDLE is returned in this field.
- For \ref GSW_BRIDGE_FREE, this field should be valid ID returned by
- \ref GSW_BRIDGE_ALLOC. ID 0 is special Bridge created during
- initialization. */
- u16 nBridgeId;
-} GSW_BRIDGE_alloc_t;
+ /** Index of P-mapper <0-31>. */
+ u16 nPmapperId;
-/** \brief Bridge Configuration.
- Used by \ref GSW_BRIDGE_CONFIG_SET and \ref GSW_BRIDGE_CONFIG_GET. */
-typedef struct {
- /** Bridge ID (FID) allocated by \ref GSW_BRIDGE_ALLOC.
+ /** Sub interface ID group.
\remarks
- If \ref GSW_BRIDGE_config_t::eMask has
- \ref GSW_BridgeConfigMask_t::GSW_BRIDGE_CONFIG_MASK_FORCE, this field is
- absolute index of Bridge (FID) in hardware for debug purpose, bypassing
- any check. */
- u16 nBridgeId;
-
- /** Mask for updating/retrieving fields. */
- GSW_BridgeConfigMask_t eMask;
-
- /** Enable MAC learning limitation. */
- gsw_bool_t bMacLearningLimitEnable;
- /** Max number of MAC can be learned in this bridge (all bridge ports). */
- u16 nMacLearningLimit;
-
- /** Get number of MAC address learned from this bridge port. */
- u16 nMacLearningCount;
+ Entry 0 is for non-IP and non-VLAN tagged packets. Entries 1-8 are PCP
+ mapping entries for VLAN tagged packets with \ref GSW_PMAPPER_MAPPING_PCP
+ selected. Entries 9-72 are DSCP or LAG mapping entries for IP packets without
+ VLAN tag or VLAN tagged packets with \ref GSW_PMAPPER_MAPPING_DSCP or
+ GSW_PMAPPER_MAPPING_LAG selected. When LAG is selected this 8bit field is
+ decoded as Destination sub-interface ID group field bits 3:0, Destination
+ logical port ID field bits 7:4 */
+ u8 nDestSubIfIdGroup[73];
+} GSW_PMAPPER_t;
- /** Number of learning discard event due to hardware resource not available.
+/** \brief Bridge Port configuration mask.
+ Used by \ref GSW_BRIDGE_portConfig_t. */
+typedef enum {
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::nBridgeId */
+ GSW_BRIDGE_PORT_CONFIG_MASK_BRIDGE_ID = 0x00000001,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bIngressExtendedVlanEnable and
+ \ref GSW_BRIDGE_portConfig_t::nIngressExtendedVlanBlockId */
+ GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN = 0x00000002,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bEgressExtendedVlanEnable and
+ \ref GSW_BRIDGE_portConfig_t::nEgressExtendedVlanBlockId */
+ GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN = 0x00000004,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::eIngressMarkingMode */
+ GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_MARKING = 0x00000008,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::eEgressRemarkingMode */
+ GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_REMARKING = 0x00000010,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bIngressMeteringEnable and
+ \ref GSW_BRIDGE_portConfig_t::nIngressTrafficMeterId */
+ GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_METER = 0x00000020,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bEgressSubMeteringEnable and
+ \ref GSW_BRIDGE_portConfig_t::nEgressTrafficSubMeterId */
+ GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_SUB_METER = 0x00000040,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::nDestLogicalPortId,
+ \ref GSW_BRIDGE_portConfig_t::bPmapperEnable,
+ \ref GSW_BRIDGE_portConfig_t::nDestSubIfIdGroup,
+ \ref GSW_BRIDGE_portConfig_t::ePmapperMappingMode,
+ \ref GSW_BRIDGE_portConfig_t::bPmapperIdValid and
+ \ref GSW_BRIDGE_portConfig_t::sPmapper. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_CTP_MAPPING = 0x00000080,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::nBridgePortMap */
+ GSW_BRIDGE_PORT_CONFIG_MASK_BRIDGE_PORT_MAP = 0x00000100,
- \remarks
- This is discard event due to either MAC table full or Hash collision.
- Discard due to nMacLearningCount reached is not counted in this field. */
- u32 nLearningDiscardEvent;
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bMcDestIpLookupDisable. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_MC_DEST_IP_LOOKUP = 0x00000200,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bMcSrcIpLookupEnable. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_MC_SRC_IP_LOOKUP = 0x00000400,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bDestMacLookupDisable. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_MC_DEST_MAC_LOOKUP = 0x00000800,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bSrcMacLearningDisable. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_MC_SRC_MAC_LEARNING = 0x00001000,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bMacSpoofingDetectEnable. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_MAC_SPOOFING = 0x00002000,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bPortLockEnable. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_PORT_LOCK = 0x00004000,
- /** Traffic metering on type of traffic (such as broadcast, multicast,
- unknown unicast, etc) applies. */
- gsw_bool_t bSubMeteringEnable[GSW_BRIDGE_PORT_EGRESS_METER_MAX];
- /** Meter for bridge process with specific type (such as broadcast,
- multicast, unknown unicast, etc). Need pre-allocated for each type. */
- u16 nTrafficSubMeterId[GSW_BRIDGE_PORT_EGRESS_METER_MAX];
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bMacLearningLimitEnable and
+ \ref GSW_BRIDGE_portConfig_t::nMacLearningLimit. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_MAC_LEARNING_LIMIT = 0x00008000,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::nMacLearningCount */
+ GSW_BRIDGE_PORT_CONFIG_MASK_MAC_LEARNED_COUNT = 0x00010000,
- /** Forwarding mode of broadcast traffic. */
- GSW_BridgeForwardMode_t eForwardBroadcast;
- /** Forwarding mode of unknown multicast IP traffic. */
- GSW_BridgeForwardMode_t eForwardUnknownMulticastIp;
- /** Forwarding mode of unknown multicast non-IP traffic. */
- GSW_BridgeForwardMode_t eForwardUnknownMulticastNonIp;
- /** Forwarding mode of unknown unicast traffic. */
- GSW_BridgeForwardMode_t eForwardUnknownUnicast;
-} GSW_BRIDGE_config_t;
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bIngressVlanFilterEnable and
+ \ref GSW_BRIDGE_portConfig_t::nIngressVlanFilterBlockId. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_INGRESS_VLAN_FILTER = 0x00020000,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bBypassEgressVlanFilter1,
+ \ref GSW_BRIDGE_portConfig_t::bEgressVlanFilter1Enable
+ and \ref GSW_BRIDGE_portConfig_t::nEgressVlanFilter1BlockId. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN_FILTER1 = 0x00040000,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bEgressVlanFilter2Enable and
+ \ref GSW_BRIDGE_portConfig_t::nEgressVlanFilter2BlockId. */
+ GSW_BRIDGE_PORT_CONFIG_MASK_EGRESS_VLAN_FILTER2 = 0x00080000,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bVlanTagSelection,
+ \ref GSW_BRIDGE_portConfig_t::bVlanSrcMacPriorityEnable,
+ \ref GSW_BRIDGE_portConfig_t::bVlanSrcMacDEIEnable,
+ \ref GSW_BRIDGE_portConfig_t::bVlanSrcMacVidEnable,
+ \ref GSW_BRIDGE_portConfig_t::bVlanDstMacPriorityEnable,
+ \ref GSW_BRIDGE_portConfig_t::bVlanDstMacDEIEnable,
+ \ref GSW_BRIDGE_portConfig_t::bVlanDstMacVidEnable */
+ GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MAC_LEARNING = 0x00100000,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::bVlanMulticastPriorityEnable,
+ \ref GSW_BRIDGE_portConfig_t::bVlanMulticastDEIEnable,
+ \ref GSW_BRIDGE_portConfig_t::bVlanMulticastVidEnable */
+ GSW_BRIDGE_PORT_CONFIG_MASK_VLAN_BASED_MULTICAST_LOOKUP = 0x00200000,
+ /** Mask for \ref GSW_BRIDGE_portConfig_t::nLoopViolationCount */
+ GSW_BRIDGE_PORT_CONFIG_MASK_LOOP_VIOLATION_COUNTER = 0x00400000,
+ /** Enable all */
+ GSW_BRIDGE_PORT_CONFIG_MASK_ALL = 0x7FFFFFFF,
+ /** Bypass any check for debug purpose */
+ GSW_BRIDGE_PORT_CONFIG_MASK_FORCE = 0x80000000
+} GSW_BridgePortConfigMask_t;
-/** \brief Ethernet port speed mode.
- For certain generations of GSWIP, a port might support only a subset of the possible settings.
- Used by \ref GSW_portLinkCfg_t. */
+/** \brief Color Marking Mode
+ Used by \ref GSW_CTP_portConfig_t. */
typedef enum {
- /** 10 Mbit/s */
- GSW_PORT_SPEED_10,
- /** 100 Mbit/s */
- GSW_PORT_SPEED_100,
- /** 200 Mbit/s */
- GSW_PORT_SPEED_200,
- /** 1000 Mbit/s */
- GSW_PORT_SPEED_1000,
- /** 2.5 Gbit/s */
- GSW_PORT_SPEED_2500,
- /** 5 Gbit/s */
- GSW_PORT_SPEED_5000,
- /** 10 Gbit/s */
- GSW_PORT_SPEED_10000,
- /** Auto speed for XGMAC */
- GSW_PORT_SPEED_AUTO,
-} GSW_portSpeed_t;
-
-/** \brief Ethernet port duplex status.
- Used by \ref GSW_portLinkCfg_t. */
-typedef enum {
- /** Port operates in full-duplex mode */
- GSW_DUPLEX_FULL = 0,
- /** Port operates in half-duplex mode */
- GSW_DUPLEX_HALF = 1,
- /** Port operates in Auto mode */
- GSW_DUPLEX_AUTO = 2,
-} GSW_portDuplex_t;
-
-/** \brief Force the MAC and PHY link modus.
- Used by \ref GSW_portLinkCfg_t. */
-typedef enum {
- /** Link up. Any connected LED
- still behaves based on the real PHY status. */
- GSW_PORT_LINK_UP = 0,
- /** Link down. */
- GSW_PORT_LINK_DOWN = 1,
- /** Link Auto. */
- GSW_PORT_LINK_AUTO = 2,
-} GSW_portLink_t;
+ /** mark packets (except critical) to green */
+ GSW_MARKING_ALL_GREEN = 0,
+ /** do not change color and priority */
+ GSW_MARKING_INTERNAL_MARKING = 1,
+ /** DEI mark mode */
+ GSW_MARKING_DEI = 2,
+ /** PCP 8P0D mark mode */
+ GSW_MARKING_PCP_8P0D = 3,
+ /** PCP 7P1D mark mode */
+ GSW_MARKING_PCP_7P1D = 4,
+ /** PCP 6P2D mark mode */
+ GSW_MARKING_PCP_6P2D = 5,
+ /** PCP 5P3D mark mode */
+ GSW_MARKING_PCP_5P3D = 6,
+ /** DSCP AF class */
+ GSW_MARKING_DSCP_AF = 7
+} GSW_ColorMarkingMode_t;
-/** \brief Ethernet port interface mode.
- A port might support only a subset of the possible settings.
- Used by \ref GSW_portLinkCfg_t. */
+/** \brief Bridge configuration mask.
+ Used by \ref GSW_BRIDGE_config_t. */
typedef enum {
- /** Normal PHY interface (twisted pair), use the internal MII Interface. */
- GSW_PORT_HW_MII = 0,
- /** Reduced MII interface in normal mode. */
- GSW_PORT_HW_RMII = 1,
- /** GMII or MII, depending upon the speed. */
- GSW_PORT_HW_GMII = 2,
- /** RGMII mode. */
- GSW_PORT_HW_RGMII = 3,
- /** XGMII mode. */
- GSW_PORT_HW_XGMII = 4,
-} GSW_MII_Mode_t;
+ /** Mask for \ref GSW_BRIDGE_config_t::bMacLearningLimitEnable
+ and \ref GSW_BRIDGE_config_t::nMacLearningLimit. */
+ GSW_BRIDGE_CONFIG_MASK_MAC_LEARNING_LIMIT = 0x00000001,
+ /** Mask for \ref GSW_BRIDGE_config_t::nMacLearningCount */
+ GSW_BRIDGE_CONFIG_MASK_MAC_LEARNED_COUNT = 0x00000002,
+ /** Mask for \ref GSW_BRIDGE_config_t::nLearningDiscardEvent */
+ GSW_BRIDGE_CONFIG_MASK_MAC_DISCARD_COUNT = 0x00000004,
+ /** Mask for \ref GSW_BRIDGE_config_t::bSubMeteringEnable and
+ \ref GSW_BRIDGE_config_t::nTrafficSubMeterId */
+ GSW_BRIDGE_CONFIG_MASK_SUB_METER = 0x00000008,
+ /** Mask for \ref GSW_BRIDGE_config_t::eForwardBroadcast,
+ \ref GSW_BRIDGE_config_t::eForwardUnknownMulticastIp,
+ \ref GSW_BRIDGE_config_t::eForwardUnknownMulticastNonIp,
+ and \ref GSW_BRIDGE_config_t::eForwardUnknownUnicast. */
+ GSW_BRIDGE_CONFIG_MASK_FORWARDING_MODE = 0x00000010,
-/** \brief Ethernet port configuration for PHY or MAC mode.
- Used by \ref GSW_portLinkCfg_t. */
-typedef enum {
- /** MAC Mode. The Ethernet port is configured to work in MAC mode. */
- GSW_PORT_MAC = 0,
- /** PHY Mode. The Ethernet port is configured to work in PHY mode. */
- GSW_PORT_PHY = 1
-} GSW_MII_Type_t;
+ /** Enable all */
+ GSW_BRIDGE_CONFIG_MASK_ALL = 0x7FFFFFFF,
+ /** Bypass any check for debug purpose */
+ GSW_BRIDGE_CONFIG_MASK_FORCE = 0x80000000
+} GSW_BridgeConfigMask_t;
-/** \brief Ethernet port clock source configuration.
- Used by \ref GSW_portLinkCfg_t. */
+/** \brief Bridge forwarding type of packet.
+ Used by \ref GSW_BRIDGE_portConfig_t. */
typedef enum {
- /** Clock Mode not applicable. */
- GSW_PORT_CLK_NA = 0,
- /** Clock Master Mode. The port is configured to provide the clock as output signal. */
- GSW_PORT_CLK_MASTER = 1,
- /** Clock Slave Mode. The port is configured to use the input clock signal. */
- GSW_PORT_CLK_SLAVE = 2
-} GSW_clkMode_t;
+ /** Packet is flooded to port members of ingress bridge port */
+ GSW_BRIDGE_FORWARD_FLOOD = 0,
+ /** Packet is dscarded */
+ GSW_BRIDGE_FORWARD_DISCARD = 1,
+ /** Packet is forwarded to logical port 0 CTP port 0 bridge port 0 */
+ GSW_BRIDGE_FORWARD_CPU = 2
+} GSW_BridgeForwardMode_t;
-/** \brief Ethernet port link, speed status and flow control status.
- Used by \ref GSW_PORT_LINK_CFG_GET and \ref GSW_PORT_LINK_CFG_SET. */
+/** \brief Bridge Port Configuration.
+ Used by \ref GSW_BridgePortConfigSet and \ref GSW_BridgePortConfigGet. */
typedef struct {
- /** Ethernet Port number (zero-based counting). The valid range is hardware
- dependent. An error code is delivered if the selected port is not
- available. */
- u16 nPortId;
- /** Force Port Duplex Mode.
+ /** Bridge Port ID allocated by \ref GSW_BridgePortAlloc.
- - 0: Negotiate Duplex Mode. Auto-negotiation mode. Negotiated
- duplex mode given in 'eDuplex'
- during GSW_PORT_LINK_CFG_GET calls.
- - 1: Force Duplex Mode. Force duplex mode in 'eDuplex'.
- */
- gsw_bool_t bDuplexForce;
- /** Port Duplex Status. */
- GSW_portDuplex_t eDuplex;
- /** Force Link Speed.
+ \remarks
+ If \ref GSW_BRIDGE_portConfig_t::eMask has
+ \ref GSW_BridgePortConfigMask_t::GSW_BRIDGE_PORT_CONFIG_MASK_FORCE, this
+ field is absolute index of Bridge Port in hardware for debug purpose,
+ bypassing any check. */
+ u16 nBridgePortId;
- - 0: Negotiate Link Speed. Negotiated speed given in
- 'eSpeed' during GSW_PORT_LINK_CFG_GET calls.
- - 1: Force Link Speed. Forced speed mode in 'eSpeed'.
- */
- gsw_bool_t bSpeedForce;
- /** Ethernet port link up/down and speed status. */
- GSW_portSpeed_t eSpeed;
- /** Force Link.
+ /** Mask for updating/retrieving fields. */
+ GSW_BridgePortConfigMask_t eMask;
- - 0: Auto-negotiate Link. Current link status is given in
- 'eLink' during GSW_PORT_LINK_CFG_GET calls.
- - 1: Force Duplex Mode. Force duplex mode in 'eLink'.
- */
- gsw_bool_t bLinkForce;
- /** Link Status. Read out the current link status.
- Note that the link could be forced by setting 'bLinkForce'. */
- GSW_portLink_t eLink;
- /** Selected interface mode (MII/RMII/RGMII/GMII/XGMII). */
- GSW_MII_Mode_t eMII_Mode;
- /** Select MAC or PHY mode (PHY = Reverse xMII). */
- GSW_MII_Type_t eMII_Type;
- /** Interface Clock mode (used for RMII mode). */
- GSW_clkMode_t eClkMode;
- /** 'Low Power Idle' Support for 'Energy Efficient Ethernet'.
- Only enable this feature in case the attached PHY also supports it. */
- gsw_bool_t bLPI;
-} GSW_portLinkCfg_t;
+ /** Bridge ID (FID) to which this bridge port is associated. A default
+ bridge (ID 0) should be always available. */
+ u16 nBridgeId;
-/** \brief Port Enable Type Selection.
- Used by \ref GSW_portCfg_t. */
-typedef enum {
- /** The port is disabled in both directions. */
- GSW_PORT_DISABLE = 0,
- /** The port is enabled in both directions (ingress and egress). */
- GSW_PORT_ENABLE_RXTX = 1,
- /** The port is enabled in the receive (ingress) direction only. */
- GSW_PORT_ENABLE_RX = 2,
- /** The port is enabled in the transmit (egress) direction only. */
- GSW_PORT_ENABLE_TX = 3
-} GSW_portEnable_t;
+ /** Enable extended VLAN processing for ingress traffic. */
+ gsw_bool_t bIngressExtendedVlanEnable;
+ /** Extended VLAN block allocated for ingress traffic. It defines
+ extended VLAN process for ingress traffic. Valid when
+ bIngressExtendedVlanEnable is TRUE. */
+ u16 nIngressExtendedVlanBlockId;
+ /** Extended VLAN block size for ingress traffic. This is optional.
+ If it is 0, the block size of nIngressExtendedVlanBlockId will be used.
+ Otherwise, this field will be used. */
+ u16 nIngressExtendedVlanBlockSize;
-/** \brief Ethernet flow control status.
- Used by \ref GSW_portCfg_t. */
-typedef enum {
- /** Automatic flow control mode selection through auto-negotiation. */
- GSW_FLOW_AUTO = 0,
- /** Receive flow control only */
- GSW_FLOW_RX = 1,
- /** Transmit flow control only */
- GSW_FLOW_TX = 2,
- /** Receive and Transmit flow control */
- GSW_FLOW_RXTX = 3,
- /** No flow control */
- GSW_FLOW_OFF = 4
-} GSW_portFlow_t;
+ /** Enable extended VLAN processing enabled for egress traffic. */
+ gsw_bool_t bEgressExtendedVlanEnable;
+ /** Extended VLAN block allocated for egress traffic. It defines
+ extended VLAN process for egress traffic. Valid when
+ bEgressExtendedVlanEnable is TRUE. */
+ u16 nEgressExtendedVlanBlockId;
+ /** Extended VLAN block size for egress traffic. This is optional.
+ If it is 0, the block size of nEgressExtendedVlanBlockId will be used.
+ Otherwise, this field will be used. */
+ u16 nEgressExtendedVlanBlockSize;
+ /** Ingress color marking mode for ingress traffic. */
+ GSW_ColorMarkingMode_t eIngressMarkingMode;
-/** \brief Port Mirror Options.
- Used by \ref GSW_portCfg_t. */
-typedef enum {
- /** Mirror Feature is disabled. Normal port usage. */
- GSW_PORT_MONITOR_NONE = 0,
- /** Port Ingress packets are mirrored to the monitor port. */
- GSW_PORT_MONITOR_RX = 1,
- /** Port Egress packets are mirrored to the monitor port. */
- GSW_PORT_MONITOR_TX = 2,
- /** Port Ingress and Egress packets are mirrored to the monitor port. */
- GSW_PORT_MONITOR_RXTX = 3,
- /** Packet mirroring of 'unknown VLAN violation' frames. */
- GSW_PORT_MONITOR_VLAN_UNKNOWN = 4,
- /** Packet mirroring of 'VLAN ingress or egress membership violation' frames. */
- GSW_PORT_MONITOR_VLAN_MEMBERSHIP = 16,
- /** Packet mirroring of 'port state violation' frames. */
- GSW_PORT_MONITOR_PORT_STATE = 32,
- /** Packet mirroring of 'MAC learning limit violation' frames. */
- GSW_PORT_MONITOR_LEARNING_LIMIT = 64,
- /** Packet mirroring of 'port lock violation' frames. */
- GSW_PORT_MONITOR_PORT_LOCK = 128
-} GSW_portMonitor_t;
+ /** Color remarking for egress traffic. */
+ GSW_ColorRemarkingMode_t eEgressRemarkingMode;
-/** \brief Interface RMON Counter Mode - (FID, SUBID or FLOWID) Config - GSWIP-3.0 only.
- Used by \ref GSW_portCfg_t. */
-typedef enum {
- /** FID based Interface RMON counters Usage */
- GSW_IF_RMON_FID = 0,
- /** Sub-Interface Id based Interface RMON counters Usage */
- GSW_IF_RMON_SUBID = 1,
- /** Flow Id (LSB bits 3 to 0) based Interface RMON counters Usage */
- GSW_IF_RMON_FLOWID_LSB = 2,
- /** Flow Id (MSB bits 7 to 4) based Interface RMON counters Usage */
- GSW_IF_RMON_FLOWID_MSB = 3
-} GSW_If_RMON_Mode_t;
+ /** Traffic metering on ingress traffic applies. */
+ gsw_bool_t bIngressMeteringEnable;
+ /** Meter for ingress Bridge Port process.
-/** \brief Port Configuration Parameters.
- Used by \ref GSW_PORT_CFG_GET and \ref GSW_PORT_CFG_SET. */
-typedef struct {
- /** Port Type. This gives information which type of port is configured.
- nPortId should be based on this field. */
- GSW_portType_t ePortType;
+ \remarks
+ Meter should be allocated with \ref GSW_QOS_MeterAlloc before Bridge
+ port configuration. If this Bridge port is re-set, the last used meter
+ should be released. */
+ u16 nIngressTrafficMeterId;
- /** Ethernet Port number (zero-based counting). The valid range is hardware
- dependent. An error code is delivered if the selected port is not
- available. */
- u16 nPortId;
- /** Enable Port (ingress only, egress only, both directions, or disabled).
- This parameter is used for Spanning Tree Protocol and 802.1X applications. */
- GSW_portEnable_t eEnable;
- /** Drop unknown unicast packets.
- Do not send out unknown unicast packets on this port,
- if the boolean parameter is enabled. By default packets of this type
- are forwarded to this port. */
- gsw_bool_t bUnicastUnknownDrop;
- /** Drop unknown multicast packets.
- Do not send out unknown multicast packets on this port,
- if boolean parameter is enabled. By default packets of this type
- are forwarded to this port.
- Some platforms also drop broadcast packets. */
- gsw_bool_t bMulticastUnknownDrop;
- /** Drop reserved packet types
- (destination address from '01 80 C2 00 00 00' to
- '01 80 C2 00 00 2F') received on this port. */
- gsw_bool_t bReservedPacketDrop;
- /** Drop Broadcast packets received on this port. By default packets of this
- type are forwarded to this port. */
- gsw_bool_t bBroadcastDrop;
- /** Enables MAC address table aging.
- The MAC table entries learned on this port are removed after the
- aging time has expired.
- The aging time is a global parameter, common to all ports. */
- gsw_bool_t bAging;
- /** MAC address table learning on the port specified by 'nPortId'.
- By default this parameter is always enabled. */
- gsw_bool_t bLearning;
- /** Automatic MAC address table learning locking on the port specified
- by 'nPortId'.
- This parameter is only taken into account when 'bLearning' is enabled. */
- gsw_bool_t bLearningMAC_PortLock;
- /** Automatic MAC address table learning limitation on this port.
- The learning functionality is disabled when the limit value is zero.
- The value 0xFFFF to allow unlimited learned address.
- This parameter is only taken into account when 'bLearning' is enabled. */
- u16 nLearningLimit;
- /** MAC spoofing detection. Identifies ingress packets that carry
- a MAC source address which was previously learned on a different ingress
- port (learned by MAC bridging table). This also applies to static added
- entries. Those violated packets could be accepted or discarded,
- depending on the global switch configuration 'bMAC_SpoofingAction'.
- This parameter is only taken into account when 'bLearning' is enabled. */
- gsw_bool_t bMAC_SpoofingDetection;
- /** Port Flow Control Status. Enables the flow control function. */
- GSW_portFlow_t eFlowCtrl;
- /** Port monitor feature. Allows forwarding of egress and/or ingress
- packets to the monitor port. If enabled, the monitor port gets
- a copy of the selected packet type. */
- GSW_portMonitor_t ePortMonitor;
- /** Assign Interface RMON Counters for this Port - GSWIP-3.0 */
- gsw_bool_t bIfCounters;
- /** Interface RMON Counters Start Index - GSWIP-3.0.
- Value of (-1) denotes unassigned Interface Counters.
- Valid range : 0-255 available to be shared amongst ports in desired way*/
- int nIfCountStartIdx;
- /** Interface RMON Counters Mode - GSWIP-3.0 */
- GSW_If_RMON_Mode_t eIfRMONmode;
-} GSW_portCfg_t;
-
-#define GSW_ERROR_BASE 1024
-/** \brief Enumeration for function status return. The upper four bits are reserved for error classification */
-typedef enum {
- /** Correct or Expected Status */
- GSW_statusOk = 0,
- /** Generic or unknown error occurred */
- GSW_statusErr = -1,
- /** Invalid function parameter */
- GSW_statusParam = -(GSW_ERROR_BASE + 2),
- /** No space left in VLAN table */
- GSW_statusVLAN_Space = -(GSW_ERROR_BASE + 3),
- /** Requested VLAN ID not found in table */
- GSW_statusVLAN_ID = -(GSW_ERROR_BASE + 4),
- /** Invalid ioctl */
- GSW_statusInvalIoctl = -(GSW_ERROR_BASE + 5),
- /** Operation not supported by hardware */
- GSW_statusNoSupport = -(GSW_ERROR_BASE + 6),
- /** Timeout */
- GSW_statusTimeout = -(GSW_ERROR_BASE + 7),
- /** At least one value is out of range */
- GSW_statusValueRange = -(GSW_ERROR_BASE + 8),
- /** The PortId/QueueId/MeterId/etc. is not available in this hardware or the
- selected feature is not available on this port */
- GSW_statusPortInvalid = -(GSW_ERROR_BASE + 9),
- /** The interrupt is not available in this hardware */
- GSW_statusIRQ_Invalid = -(GSW_ERROR_BASE + 10),
- /** The MAC table is full, an entry could not be added */
- GSW_statusMAC_TableFull = -(GSW_ERROR_BASE + 11),
- /** Locking failed - SWAPI is busy */
- GSW_statusLock_Failed = -(GSW_ERROR_BASE + 12),
- /** Multicast Forwarding table entry not found */
- GSW_statusEntryNotFound = -(GSW_ERROR_BASE + 13),
-} GSW_return_t;
-
-/** \brief Meter Type - srTCM or trTCM. Defines the Metering algorithm Type.
- Used by \ref GSW_QoS_meterCfg_t. */
-typedef enum {
- /** srTCM Meter Type */
- GSW_QOS_Meter_srTCM = 0,
- /** trTCM Meter Type - GSWIP-3.0 only */
- GSW_QOS_Meter_trTCM = 1,
-} GSW_QoS_Meter_Type;
-
-/** \brief Specifies the direction for ingress and egress.
- Used by \ref GSW_QoS_meterPort_t and \ref GSW_QoS_meterPortGet_t. */
-typedef enum {
- /** No direction. */
- GSW_DIRECTION_NONE = 0,
- /** Ingress direction. */
- GSW_DIRECTION_INGRESS = 1,
- /** Egress direction. */
- GSW_DIRECTION_EGRESS = 2,
- /** Ingress and egress direction. */
- GSW_DIRECTION_BOTH = 3
-} GSW_direction_t;
+ /** Traffic metering on various types of egress traffic (such as broadcast,
+ multicast, unknown unicast, etc) applies. */
+ gsw_bool_t bEgressSubMeteringEnable[GSW_BRIDGE_PORT_EGRESS_METER_MAX];
+ /** Meter for egress Bridge Port process with specific type (such as
+ broadcast, multicast, unknown unicast, etc). Need pre-allocated for each
+ type. */
+ u16 nEgressTrafficSubMeterId[GSW_BRIDGE_PORT_EGRESS_METER_MAX];
-/** \brief DSCP Drop Precedence to color code assignment.
- Used by \ref GSW_QoS_DSCP_DropPrecedenceCfg_t. */
-typedef enum {
- /** Critical Packet. Metering never changes the drop precedence of these packets. */
- GSW_DROP_PRECEDENCE_CRITICAL = 0,
- /** Green Drop Precedence Packet. Packet is marked with a 'low' drop precedence. */
- GSW_DROP_PRECEDENCE_GREEN = 1,
- /** Yellow Drop Precedence Packet. Packet is marked with a 'middle' drop precedence. */
- GSW_DROP_PRECEDENCE_YELLOW = 2,
- /** Red Drop Precedence Packet. Packet is marked with a 'high' drop precedence. */
- GSW_DROP_PRECEDENCE_RED = 3
-} GSW_QoS_DropPrecedence_t;
+ /** This field defines destination logical port. */
+ u8 nDestLogicalPortId;
+ /** This field indicates whether to enable P-mapper. */
+ gsw_bool_t bPmapperEnable;
+ /** When bPmapperEnable is FALSE, this field defines destination sub
+ interface ID group. */
+ u16 nDestSubIfIdGroup;
+ /** When bPmapperEnable is TRUE, this field selects either DSCP or PCP to
+ derive sub interface ID. */
+ GSW_PmapperMappingMode_t ePmapperMappingMode;
+ /** When bPmapperEnable is TRUE, P-mapper is used. This field determines
+ whether sPmapper.nPmapperId is valid. If this field is TRUE, the
+ P-mapper is re-used and no allocation of new P-mapper or value
+ change in the P-mapper. If this field is FALSE, allocation is
+ taken care in the API implementation. */
+ gsw_bool_t bPmapperIdValid;
+ /** When bPmapperEnable is TRUE, P-mapper is used. if bPmapperIdValid is
+ FALSE, API implementation need take care of P-mapper allocation,
+ and maintain the reference counter of P-mapper used multiple times.
+ If bPmapperIdValid is TRUE, only sPmapper.nPmapperId is used to
+ associate the P-mapper, and there is no allocation of new P-mapper
+ or value change in the P-mapper. */
+ GSW_PMAPPER_t sPmapper;
+ /** Port map define broadcast domain.
-/** \brief Selection of the traffic class field.
- Used by \ref GSW_QoS_portCfg_t.
- The port default traffic class is assigned in case non of the
- configured protocol code points given by the packet. */
-typedef enum {
- /** No traffic class assignment based on DSCP or PCP */
- GSW_QOS_CLASS_SELECT_NO = 0,
- /** Traffic class assignment based on DSCP. PCP information is ignored.
- The Port Class is used in case DSCP is not available in the packet. */
- GSW_QOS_CLASS_SELECT_DSCP = 1,
- /** Traffic class assignment based on PCP. DSCP information is ignored.
- The Port Class is used in case PCP is not available in the packet. */
- GSW_QOS_CLASS_SELECT_PCP = 2,
- /** Traffic class assignment based on DSCP. Make the assignment based on
- PCP in case the DSCP information is not available in the packet header.
- The Port Class is used in case both are not available in the packet. */
- GSW_QOS_CLASS_SELECT_DSCP_PCP = 3,
- /** CTAG VLAN PCP, IP DSCP. Traffic class assignment based
- on CTAG VLAN PCP, alternative use DSCP based assignment. */
- GSW_QOS_CLASS_SELECT_PCP_DSCP = 4,
- /** STAG VLAN PCP. Traffic class assignment based
- on STAG VLAN PCP. */
- GSW_QOS_CLASS_SELECT_SPCP = 5,
- /** STAG VLAN PCP, IP DSCP. Traffic class assignment based
- on STAG VLAN PCP, alternative use DSCP based assignment. */
- GSW_QOS_CLASS_SELECT_SPCP_DSCP = 6,
- /** IP DSCP, STAG VLAN PCP. Traffic class assignment based
- on DSCP, alternative use STAG VLAN PCP based assignment. */
- GSW_QOS_CLASS_SELECT_DSCP_SPCP = 7,
- /** STAG VLAN PCP, CTAG VLAN PCP. Traffic class assignment based
- on STAG VLAN PCP, alternative use CTAG VLAN PCP based assignment. */
- GSW_QOS_CLASS_SELECT_SPCP_PCP = 8,
- /** STAG VLAN PCP, CTAG VLAN PCP, IP DSCP. Traffic class assignment
- based on STAG VLAN PCP, alternative use CTAG VLAN PCP based
- assignment, alternative use DSCP based assignment. */
- GSW_QOS_CLASS_SELECT_SPCP_PCP_DSCP = 9,
- /** IP DSCP, STAG VLAN PCP, CTAG VLAN PCP. Traffic class assignment
- based on DSCP, alternative use STAG VLAN PCP based
- assignment, alternative use CTAG VLAN PCP based assignment. */
- GSW_QOS_CLASS_SELECT_DSCP_SPCP_PCP = 10
-} GSW_QoS_ClassSelect_t;
+ \remarks
+ Each bit is one bridge port. Bridge port ID is index * 16 + bit offset.
+ For example, bit 1 of nBridgePortMap[1] is bridge port ID 17. */
+ u16 nBridgePortMap[8]; /* max can be 16 */
+ /** Multicast IP table is searched if this field is FALSE and traffic is IP
+ multicast. */
+ gsw_bool_t bMcDestIpLookupDisable;
+ /** Multicast IP table is searched if this field is TRUE and traffic is IP
+ multicast. */
+ gsw_bool_t bMcSrcIpLookupEnable;
-/** \brief Configures the parameters of a rate meter instance.
- Used by \ref GSW_QOS_METER_ALLOC, \ref GSW_QOS_METER_FREE,
- \ref GSW_QOS_METER_CFG_SET and \ref GSW_QOS_METER_CFG_GET. */
-typedef struct {
- /** Enable/Disable the meter shaper. */
- gsw_bool_t bEnable;
- /** Meter index (zero-based counting).
+ /** Default is FALSE. Packet is treated as "unknown" if it's not
+ broadcast/multicast packet. */
+ gsw_bool_t bDestMacLookupDisable;
- \remarks
- For \ref GSW_QOS_METER_FREE, this is the only input and other fields are
- ignored. For \ref GSW_QOS_METER_ALLOC, this is output when allocation
- is successful. For \ref GSW_QOS_METER_CFG_SET and
- \ref GSW_QOS_METER_CFG_GET, this is input to indicate meter to
- configure/get-configuration. */
- u16 nMeterId;
- /** Meter Name string for easy reference (Id to Name Mapping) - TBD*/
- char cMeterName[32];
- /** Meter Algorithm Type */
- GSW_QoS_Meter_Type eMtrType;
- /** Committed Burst Size (CBS [Bytes]). */
- u32 nCbs;
- /** Committed Burst Size Exponent (CBS [Bytes]). */
- u32 nCbs_ls;
- /** Excess Burst Size (EBS [Bytes]). */
- u32 nEbs;
- /** Excess Burst Size Exponent (EBS [Bytes]). */
- u32 nEbs_ls;
- /** Committed Information Rate (CIR)
+ /** Default is FALSE. Source MAC address is learned. */
+ gsw_bool_t bSrcMacLearningDisable;
- \remarks
- CIR in [kbit/s] if \ref GSW_QoS_meterCfg_t::bPktMode is FALSE,
- or in [packet/s] if \ref GSW_QoS_meterCfg_t::bPktMode is TRUE. */
- u32 nRate;
- /** Peak Information Rate (PIR) - applicable for trTCM only
+ /** If this field is TRUE and MAC address which is already learned in another
+ bridge port appears on this bridge port, port locking violation is
+ detected. */
+ gsw_bool_t bMacSpoofingDetectEnable;
- \remarks
- PIR in [kbit/s] if \ref GSW_QoS_meterCfg_t::bPktMode is FALSE,
- or in [packet/s] if \ref GSW_QoS_meterCfg_t::bPktMode is TRUE. */
- u32 nPiRate;
- /** Peak Burst Size (PBS [Bytes]) - applicable for trTCM only */
-// u32 nPbs;
- /** Meter colour mode **/
- u8 nColourBlindMode;
- /** Enable/Disable Packet Mode. 0- Byte, 1 - Pkt */
- u8 bPktMode;
- /** Enable/Disable local overhead for metering rate calculation. */
- gsw_bool_t bLocalOverhd;
- /** Local overhead for metering rate calculation when
- \ref GSW_QoS_meterCfg_t::bLocalOverhd is TRUE. */
- u16 nLocaloverhd;
-} GSW_QoS_meterCfg_t;
+ /** If this field is TRUE and MAC address which is already learned in this
+ bridge port appears on another bridge port, port locking violation is
+ detected. */
+ gsw_bool_t bPortLockEnable;
+ /** Enable MAC learning limitation. */
+ gsw_bool_t bMacLearningLimitEnable;
+ /** Max number of MAC can be learned from this bridge port. */
+ u16 nMacLearningLimit;
-/** \brief DSCP mapping table.
- Used by \ref GSW_QOS_DSCP_CLASS_SET
- and \ref GSW_QOS_DSCP_CLASS_GET. */
-typedef struct {
- /** Traffic class associated with a particular DSCP value.
- DSCP is the index to an array of resulting traffic class values.
- The index starts counting from zero. */
- u8 nTrafficClass[64];
-} GSW_QoS_DSCP_ClassCfg_t;
+ /** Get number of Loop violation counter from this bridge port. */
+ u16 nLoopViolationCount;
+ /** Get number of MAC address learned from this bridge port. */
+ u16 nMacLearningCount;
-/** \brief DSCP to Drop Precedence assignment table configuration.
- Used by \ref GSW_QOS_DSCP_DROP_PRECEDENCE_CFG_SET
- and \ref GSW_QOS_DSCP_DROP_PRECEDENCE_CFG_GET. */
-typedef struct {
- /** DSCP to drop precedence assignment. Every array entry represents the
- drop precedence for one of the 64 existing DSCP values.
- DSCP is the index to an array of resulting drop precedence values.
- The index starts counting from zero.
- Value refers to \ref GSW_QoS_DropPrecedence_t. */
- u8 nDSCP_DropPrecedence[64];
-} GSW_QoS_DSCP_DropPrecedenceCfg_t;
+ /** Enable ingress VLAN filter */
+ gsw_bool_t bIngressVlanFilterEnable;
+ /** VLAN filter block of ingress traffic if
+ \ref GSW_BRIDGE_portConfig_t::bIngressVlanFilterEnable is TRUE. */
+ u16 nIngressVlanFilterBlockId;
+ /** VLAN filter block size. This is optional.
+ If it is 0, the block size of nIngressVlanFilterBlockId will be used.
+ Otherwise, this field will be used. */
+ u16 nIngressVlanFilterBlockSize;
+ /** For ingress traffic, bypass VLAN filter 1 at egress bridge port
+ processing. */
+ gsw_bool_t bBypassEgressVlanFilter1;
+ /** Enable egress VLAN filter 1 */
+ gsw_bool_t bEgressVlanFilter1Enable;
+ /** VLAN filter block 1 of egress traffic if
+ \ref GSW_BRIDGE_portConfig_t::bEgressVlanFilter1Enable is TRUE. */
+ u16 nEgressVlanFilter1BlockId;
+ /** VLAN filter block 1 size. This is optional.
+ If it is 0, the block size of nEgressVlanFilter1BlockId will be used.
+ Otherwise, this field will be used. */
+ u16 nEgressVlanFilter1BlockSize;
+ /** Enable egress VLAN filter 2 */
+ gsw_bool_t bEgressVlanFilter2Enable;
+ /** VLAN filter block 2 of egress traffic if
+ \ref GSW_BRIDGE_portConfig_t::bEgressVlanFilter2Enable is TRUE. */
+ u16 nEgressVlanFilter2BlockId;
+ /** VLAN filter block 2 size. This is optional.
+ If it is 0, the block size of nEgressVlanFilter2BlockId will be used.
+ Otherwise, this field will be used. */
+ u16 nEgressVlanFilter2BlockSize;
-/** \brief Ingress DSCP remarking attribute. This attribute defines on the
- ingress port packets how these will be remarked on the egress port.
- A packet is only remarked in case its ingress and its egress port
- have remarking enabled.
- Used by \ref GSW_QoS_portRemarkingCfg_t. */
-typedef enum {
- /** No DSCP Remarking. No remarking is done on the egress port. */
- GSW_DSCP_REMARK_DISABLE = 0,
- /** TC DSCP 6-Bit Remarking. The complete DSCP remarking is done based
- on the traffic class. The traffic class to DSCP value mapping is
- given in a device global table. */
- GSW_DSCP_REMARK_TC6 = 1,
- /** TC DSCP 3-Bit Remarking. The upper 3-Bits of the DSCP field are
- remarked based on the traffic class. The traffic class to DSCP value
- mapping is given in a device global table. */
- GSW_DSCP_REMARK_TC3 = 2,
- /** Drop Precedence Remarking. The Drop Precedence is remarked on the
- egress side. */
- GSW_DSCP_REMARK_DP3 = 3,
- /** TC Drop Precedence Remarking. The Drop Precedence is remarked on the
- egress side and the upper 3-Bits of the DSCP field are
- remarked based on the traffic class. The traffic class to DSCP value
- mapping is given in a device global table. */
- GSW_DSCP_REMARK_DP3_TC3 = 4
-} GSW_Qos_ingressRemarking_t;
+ /** 0 - Intermediate outer VLAN
+ tag is used for MAC address/multicast
+ learning, lookup and filtering.
+ 1 - Original outer VLAN tag is used
+ for MAC address/multicast learning, lookup
+ and filtering. */
+ gsw_bool_t bVlanTagSelection;
+ /** 0 - Disable, VLAN Priority field is not used
+ and value 0 is used for source MAC address
+ learning and filtering.
+ 1 - Enable, VLAN Priority field is used for
+ source MAC address learning and filtering. */
+ gsw_bool_t bVlanSrcMacPriorityEnable;
+ /** 0 - Disable, VLAN DEI/CFI field is not used
+ and value 0 is used for source MAC address
+ learning and filtering.
+ 1 - Enable, VLAN DEI/CFI field is used for
+ source MAC address learning and filtering */
+ gsw_bool_t bVlanSrcMacDEIEnable;
+ /** 0 - Disable, VLAN ID field is not used and
+ value 0 is used for source MAC address
+ learning and filtering
+ 1 - Enable, VLAN ID field is used for source
+ MAC address learning and filtering. */
+ gsw_bool_t bVlanSrcMacVidEnable;
+ /** 0 - Disable, VLAN Priority field is not used
+ and value 0 is used for destination MAC
+ address look up and filtering.
+ 1 - Enable, VLAN Priority field is used for
+ destination MAC address look up and
+ filtering */
+ gsw_bool_t bVlanDstMacPriorityEnable;
+ /** 0 - Disable, VLAN CFI/DEI field is not used
+ and value 0 is used for destination MAC
+ address lookup and filtering.
+ 1 - Enable, VLAN CFI/DEI field is used for
+ destination MAC address look up and
+ filtering. */
+ gsw_bool_t bVlanDstMacDEIEnable;
+ /** 0 - Disable, VLAN ID field is not used and
+ value 0 is used for destination MAC address
+ look up and filtering.
+ 1 - Enable, VLAN ID field is destination for
+ destination MAC address look up and
+ filtering. */
+ gsw_bool_t bVlanDstMacVidEnable;
-/** \brief Port Remarking Configuration. Ingress and Egress remarking options for
- dedicated packet fields DSCP, CTAG VLAN PCP, STAG VLAN PCP
- and STAG VLAN DEI.
- Remarking is done either on the used traffic class or the
- drop precedence.
- Packet field specific remarking only applies on a packet if
- enabled on ingress and egress port.
- Used by \ref GSW_QOS_PORT_REMARKING_CFG_SET
- and \ref GSW_QOS_PORT_REMARKING_CFG_GET. */
-typedef struct {
- /** Ethernet Port number (zero-based counting). The valid range is hardware
- dependent. An error code is delivered if the selected port is not
- available. */
- u16 nPortId;
- /** Ingress DSCP Remarking. Specifies on ingress side how a packet should
- be remarked. This DSCP remarking only works in case remarking is
- enabled on the egress port.
- This configuration requires that remarking is also enabled on the
- egress port. DSCP remarking enable on either ingress or egress port
- side does not perform any remark operation. */
- GSW_Qos_ingressRemarking_t eDSCP_IngressRemarkingEnable;
- /** Egress DSCP Remarking. Applies remarking on egress packets in a
- fashion as specified on the ingress port. This ingress port remarking
- is configured by the parameter 'eDSCP_IngressRemarking'.
- This configuration requires that remarking is also enabled on the
- ingress port. DSCP remarking enable on either ingress or egress port
- side does not perform any remark operation. */
- gsw_bool_t bDSCP_EgressRemarkingEnable;
- /** Ingress PCP Remarking. Applies remarking to all port ingress packets.
- This configuration requires that remarking is also enabled on the
- egress port. PCP remarking enable on either ingress or egress port
- side does not perform any remark operation. */
- gsw_bool_t bPCP_IngressRemarkingEnable;
- /** Egress PCP Remarking. Applies remarking for all port egress packets.
- This configuration requires that remarking is also enabled on the
- ingress port. PCP remarking enable on either ingress or egress port
- side does not perform any remark operation. */
- gsw_bool_t bPCP_EgressRemarkingEnable;
- /** Ingress STAG VLAN PCP Remarking */
- gsw_bool_t bSTAG_PCP_IngressRemarkingEnable;
- /** Ingress STAG VLAN DEI Remarking */
- gsw_bool_t bSTAG_DEI_IngressRemarkingEnable;
- /** Egress STAG VLAN PCP & DEI Remarking */
- gsw_bool_t bSTAG_PCP_DEI_EgressRemarkingEnable;
-} GSW_QoS_portRemarkingCfg_t;
+ /** 0 - Disable, VLAN Priority field is not used
+ and value 0 is used for IP multicast lookup.
+ 1 - Enable, VLAN Priority field is used for IP
+ multicast lookup. */
+ gsw_bool_t bVlanMulticastPriorityEnable;
+ /** 0 - Disable, VLAN CFI/DEI field is not used
+ and value 0 is used for IP multicast lookup.
+ 1 - Enable, VLAN CFI/DEI field is used for IP
+ multicast lookup. */
+ gsw_bool_t bVlanMulticastDEIEnable;
+ /** 0 - Disable, VLAN ID field is not used and
+ value 0 is used for IP multicast lookup.
+ 1 - Enable, VLAN ID field is destination for IP
+ multicast lookup. */
+ gsw_bool_t bVlanMulticastVidEnable;
+} GSW_BRIDGE_portConfig_t;
-/** \brief Describes which priority information of ingress packets is used
- (taken into account) to identify the packet priority and the related egress
- priority queue. For DSCP, the priority to queue assignment is done
- using \ref GSW_QOS_DSCP_CLASS_SET. For VLAN, the priority to queue
- assignment is done using \ref GSW_QOS_PCP_CLASS_SET.
- Used by \ref GSW_QOS_PORT_CFG_SET and \ref GSW_QOS_PORT_CFG_GET. */
+/** \brief Bridge Port Loop Violation Counter Read and Clear.
+ Used by \ref GSW_BridgePortLoopRead. */
typedef struct {
- /** Ethernet Port number (zero-based counting). The valid range is hardware
- dependent. An error code is delivered if the selected port is not
- available. */
- u16 nPortId;
- /** Select the packet header field on which to base the traffic class assignment. */
- GSW_QoS_ClassSelect_t eClassMode;
- /** Default port priority in case no other priority
- (such as VLAN-based PCP or IP-based DSCP) is used. */
- u8 nTrafficClass;
-} GSW_QoS_portCfg_t;
+ /** Bridge Port ID allocated by \ref GSW_BridgePortAlloc. */
+ u16 nBridgePortId;
-/** \brief Traffic class associated with a particular 802.1P (PCP) priority mapping value.
- This table is global for the entire switch device. Priority map entry structure.
- Used by \ref GSW_QOS_CLASS_PCP_SET
- and \ref GSW_QOS_CLASS_PCP_GET. */
-typedef struct {
- /** Configures the traffic class to PCP (3-bit) mapping.
- The queue index starts counting from zero. */
- u8 nPCP[16];
-} GSW_QoS_ClassPCP_Cfg_t;
+ /** Loop violation counter saturated at 255 */
+ u16 nLoopViolationCount;
+} GSW_BRIDGE_portLoopRead_t;
+/** \brief Read Hit Status.
+ Used to read Multicast/Mac hit stats. */
+typedef struct {
+ /** Mac/multicast Table Id */
+ u8 table_id;
+ /** Table Index to read */
+ u16 nIndex;
+ /** Hit status */
+ u8 hitStatus;
+ /** Entry Validity, if 1 entry is valid */
+ u8 nValid;
+} GSW_HitStatusRead_t;
-/** \brief Traffic class associated with a particular 802.1P (PCP) priority mapping value.
- This table is global for the entire switch device. Priority map entry structure.
- Used by \ref GSW_QOS_PCP_CLASS_SET
- and \ref GSW_QOS_PCP_CLASS_GET. */
+/** \brief Miscellaneous configuration of logical port
+ * Used by \ref GSW_MiscPortCfgGet to get or \ref GSW_MiscPortCfgSet to
+ * configure miscellaneous configurations such as 4-TPID support
+ * on logical port (0~15).
+ */
typedef struct {
- /** Configures the PCP to traffic class mapping.
- The queue index starts counting from zero. */
- u8 nTrafficClass[16];
-} GSW_QoS_PCP_ClassCfg_t;
+ /** reserved for future extension */
+ u32 mask;
+ /** logical port id
+ * value 0~15 is logical port
+ * value 255 is special value to apply configuration on all
+ * logical ports and only used by \ref GSW_MiscPortCfgSet
+ */
+ u8 port;
+ /** flag to indicate enable of 4-TPID mode
+ * 1 - 4-TPID mode (metering function in Extended VLAN is disabled)
+ * 0 - 2-TPID mode
+ * in \ref GSW_MiscPortCfgGet, this field is output
+ * in \ref GSW_MiscPortCfgSet,
+ * if port == 255, this is input only
+ * otherwise, this is input as well as output
+ * the original value before modification is returned
+ */
+ unsigned char TPID4: 1;
+} GSW_MiscPortCfg_t;
-/** \brief Describes the QoS Queue Mapping Mode. GSWIP-3.1 only.
- Used by \ref GSW_QoS_queuePort_t. */
+/** \brief VLAN Filter TCI Mask.
+ Used by \ref GSW_VLANFILTER_config_t */
typedef enum {
- /** This is default mode where the QID is fixed at
- \ref GSW_QOS_QUEUE_PORT_SET. */
- GSW_QOS_QMAP_SINGLE_MODE = 0,
- /** This is new mode in GSWIP-3.1. The QID given in
- \ref GSW_QOS_QUEUE_PORT_SET is base, and bit 0~3 of sub-interface ID
- is offset. The final QID is base + SubIfId[0:3]. */
- GSW_QOS_QMAP_SUBIFID_MODE = 1
-} GSW_QoS_qMapMode_t;
+ GSW_VLAN_FILTER_TCI_MASK_VID = 0,
+ GSW_VLAN_FILTER_TCI_MASK_PCP = 1,
+ GSW_VLAN_FILTER_TCI_MASK_TCI = 2
+} GSW_VlanFilterTciMask_t;
-/** \brief Sets the Queue ID for one traffic class of one port.
- Used by \ref GSW_QOS_QUEUE_PORT_SET and \ref GSW_QOS_QUEUE_PORT_GET. */
+/** \brief Bridge Allocation.
+ Used by \ref GSW_BridgeAlloc and \ref GSW_BridgeFree. */
typedef struct {
- /** Ethernet Port number (zero-based counting). The valid range is hardware
- dependent. An error code is delivered if the selected port is not
- available.
- This is an input parameter for \ref GSW_QOS_QUEUE_PORT_GET. */
- u16 nPortId;
- /** Forward CPU (extraction) before external QoS queueing (DownMEP).
- GSWIP-3.1 only. */
- gsw_bool_t bExtrationEnable;
- /** When \ref GSW_QoS_queuePort_t::bExtrationEnable is FALSE, this field
- defines Queue Mapping Mode. GSWIP-3.1 only. */
- GSW_QoS_qMapMode_t eQMapMode;
- /** Traffic Class index (zero-based counting).
- This is an input parameter for \ref GSW_QOS_QUEUE_PORT_GET. */
- u8 nTrafficClassId;
- /** QoS queue index (zero-based counting).
- This is an output parameter for \ref GSW_QOS_QUEUE_PORT_GET. */
- u8 nQueueId;
- /** Queue Redirection bypass Option.
- If enabled, all packets destined to 'nQueueId' are redirected from the
- 'nPortId' to 'nRedirectPortId'. This is used for 2nd stage of FULL QoS
- Path, where the packet has completed QoS process at CBM/CQEM and been
- injected into GSWIP again. */
- gsw_bool_t bRedirectionBypass;
- /** Redirected traffic forward port.
- All egress packets to 'nPortId' are redirected to "nRedirectPortId".
- If there is no redirection required, it should be same as "nPortId".
- GSWIP-3.0/3.1 only. */
- u8 nRedirectPortId;
-
- /** To enable Ingress PCE Bypass. Applicable for GSWIP 3.2 and above.
- For \ref GSW_QoS_QueuePortGet, set TRUE as input to check whether
- Ingress PCE Bypass is enabled, and this field is updated as output.
- For \ref GSW_QoS_QueuePortSet, set FALSE to configure normal
- path first, then set TRUE to configure Ingress PCE Bypass path
- (only if application requires). */
- gsw_bool_t bEnableIngressPceBypass;
- /** Internal purpose only - user not allowed to use it.
- Applicable for GSWIP 3.2 and above. */
- gsw_bool_t bReservedPortMode;
-} GSW_QoS_queuePort_t;
+ /** If \ref GSW_BridgeAlloc is successful, a valid ID will be returned
+ in this field. Otherwise, \ref INVALID_HANDLE is returned in this field.
+ For \ref GSW_BridgeFree, this field should be valid ID returned by
+ \ref GSW_BridgeAlloc. ID 0 is special Bridge created during
+ initialization. */
+ u16 nBridgeId;
+} GSW_BRIDGE_alloc_t;
+/** \brief Bridge Configuration.
+ Used by \ref GSW_BridgeConfigSet and \ref GSW_BridgeConfigGet. */
+typedef struct {
+ /** Bridge ID (FID) allocated by \ref GSW_BridgeAlloc.
-/** \brief Select the type of the Egress Queue Scheduler.
- Used by \ref GSW_QoS_schedulerCfg_t. */
-typedef enum {
- /** Strict Priority Scheduler. */
- GSW_QOS_SCHEDULER_STRICT = 0,
- /** Weighted Fair Queuing Shceduler. */
- GSW_QOS_SCHEDULER_WFQ = 1
-} GSW_QoS_Scheduler_t;
+ \remarks
+ If \ref GSW_BRIDGE_config_t::eMask has
+ \ref GSW_BridgeConfigMask_t::GSW_BRIDGE_CONFIG_MASK_FORCE, this field is
+ absolute index of Bridge (FID) in hardware for debug purpose, bypassing
+ any check. */
+ u16 nBridgeId;
-/** \brief Configures the egress queues attached to a single port, and that
- are scheduled to transmit the queued Ethernet packets.
- Used by \ref GSW_QOS_SCHEDULER_CFG_SET and \ref GSW_QOS_SCHEDULER_CFG_GET. */
-typedef struct {
- /** QoS queue index (zero-based counting). */
- u8 nQueueId;
- /** Scheduler Type (Strict Priority/Weighted Fair Queuing).
- Refers to \ref GSW_QoS_Scheduler_t for detail values. */
- u8 eType;
- /** Weight in Token. Parameter used for WFQ configuration.
- Sets the weight in token in relation to all remaining
- queues on this egress port having WFQ configuration.
- This parameter is only used when 'eType=GSW_QOS_SCHEDULER_WFQ'. */
- u16 nWeight;
-} GSW_QoS_schedulerCfg_t;
+ /** Mask for updating/retrieving fields. */
+ GSW_BridgeConfigMask_t eMask;
-/** \brief Configures a rate shaper instance with the rate and the burst size.
- Used by \ref GSW_QOS_SHAPER_CFG_SET and \ref GSW_QOS_SHAPER_CFG_GET. */
-typedef struct {
- /** Rate shaper index (zero-based counting). */
- u8 nRateShaperId;
- /** Enable/Disable the rate shaper. */
- gsw_bool_t bEnable;
- /** 802.1Qav credit based shaper mode. This specific shaper
- algorithm mode is used by the audio/video bridging (AVB)
- network (according to 802.1Qav). By default, an token
- based shaper algorithm is used. */
- gsw_bool_t bAVB;
- /** Committed Burst Size (CBS [bytes]) */
- u32 nCbs;
- /** Rate [kbit/s] */
- u32 nRate;
-} GSW_QoS_ShaperCfg_t;
+ /** Enable MAC learning limitation. */
+ gsw_bool_t bMacLearningLimitEnable;
+ /** Max number of MAC can be learned in this bridge (all bridge ports). */
+ u16 nMacLearningLimit;
-/** \brief Assign one rate shaper instance to a QoS queue.
- Used by \ref GSW_QOS_SHAPER_QUEUE_ASSIGN and \ref GSW_QOS_SHAPER_QUEUE_DEASSIGN. */
-typedef struct {
- /** Rate shaper index (zero-based counting). */
- u8 nRateShaperId;
- /** QoS queue index (zero-based counting). */
- u8 nQueueId;
-} GSW_QoS_ShaperQueue_t;
+ /** Get number of MAC address learned from this bridge port. */
+ u16 nMacLearningCount;
-/** \brief Retrieve if a rate shaper instance is assigned to a QoS egress queue.
- Used by \ref GSW_QOS_SHAPER_QUEUE_GET. */
-typedef struct {
- /** QoS queue index (zero-based counting).
- This parameter is the input parameter for the GET function. */
- u8 nQueueId;
- /** Rate shaper instance assigned.
- If 1, a rate shaper instance is assigned to the queue. Otherwise no shaper instance is assigned. */
- gsw_bool_t bAssigned;
- /** Rate shaper index (zero-based counting). Only a valid instance is returned in case 'bAssigned == 1'. */
- u8 nRateShaperId;
-} GSW_QoS_ShaperQueueGet_t;
+ /** Number of learning discard event due to hardware resource not available.
-/** \brief Assigns one meter instances for storm control.
- Used by \ref GSW_QOS_STORM_CFG_SET and \ref GSW_QOS_STORM_CFG_GET.
- Not applicable to GSWIP-3.1. */
-typedef struct {
- /** Meter index 0 (zero-based counting). */
- u16 nMeterId;
- /** Meter instances used for broadcast traffic. */
- gsw_bool_t bBroadcast;
- /** Meter instances used for multicast traffic. */
- gsw_bool_t bMulticast;
- /** Meter instances used for unknown unicast traffic. */
- gsw_bool_t bUnknownUnicast;
-} GSW_QoS_stormCfg_t;
+ \remarks
+ This is discard event due to either MAC table full or Hash collision.
+ Discard due to nMacLearningCount reached is not counted in this field. */
+ u32 nLearningDiscardEvent;
-/** \brief Egress Queue Congestion Notification Watermark.
- Used by \ref GSW_QoS_WRED_Cfg_t. */
+ /** Traffic metering on type of traffic (such as broadcast, multicast,
+ unknown unicast, etc) applies. */
+ gsw_bool_t bSubMeteringEnable[GSW_BRIDGE_PORT_EGRESS_METER_MAX];
+ /** Meter for bridge process with specific type (such as broadcast,
+ multicast, unknown unicast, etc). Need pre-allocated for each type. */
+ u16 nTrafficSubMeterId[GSW_BRIDGE_PORT_EGRESS_METER_MAX];
+
+ /** Forwarding mode of broadcast traffic. */
+ GSW_BridgeForwardMode_t eForwardBroadcast;
+ /** Forwarding mode of unknown multicast IP traffic. */
+ GSW_BridgeForwardMode_t eForwardUnknownMulticastIp;
+ /** Forwarding mode of unknown multicast non-IP traffic. */
+ GSW_BridgeForwardMode_t eForwardUnknownMulticastNonIp;
+ /** Forwarding mode of unknown unicast traffic. */
+ GSW_BridgeForwardMode_t eForwardUnknownUnicast;
+} GSW_BRIDGE_config_t;
+
+/** \brief Ethernet port speed mode.
+ For certain generations of GSWIP, a port might support only a subset of the possible settings.
+ Used by \ref GSW_portLinkCfg_t. */
typedef enum {
- /**
- >= 1/4 of green max water mark assert
- <= 1/4 of green max water mark de assert*/
- GSW_QOS_WRED_WATERMARK_1_4 = 0,
- /**
- >= 1/8 of green max water mark assert
- <= 1/8 of green max water mark de assert*/
- GSW_QOS_WRED_WATERMARK_1_8 = 1,
- /**
- >= 1/12 of green max water mark assert
- <= 1/12 of green max water mark de assert*/
- GSW_QOS_WRED_WATERMARK_1_12 = 2,
- /**
- >= 1/16 of green max water mark assert
- <= 1/16 of green max water mark de assert*/
- GSW_QOS_WRED_WATERMARK_1_16 = 3
-} GSW_QoS_WRED_WATERMARK_t;
+ /** 10 Mbit/s */
+ GSW_PORT_SPEED_10,
+ /** 100 Mbit/s */
+ GSW_PORT_SPEED_100,
+ /** 200 Mbit/s */
+ GSW_PORT_SPEED_200,
+ /** 1000 Mbit/s */
+ GSW_PORT_SPEED_1000,
+ /** 2.5 Gbit/s */
+ GSW_PORT_SPEED_2500,
+ /** 5 Gbit/s */
+ GSW_PORT_SPEED_5000,
+ /** 10 Gbit/s */
+ GSW_PORT_SPEED_10000,
+ /** Auto speed for XGMAC */
+ GSW_PORT_SPEED_AUTO,
+} GSW_portSpeed_t;
-/** \brief Drop Probability Profile. Defines the drop probability profile.
- Used by \ref GSW_QoS_WRED_Cfg_t. */
+/** \brief Ethernet port duplex status.
+ Used by \ref GSW_portLinkCfg_t. */
typedef enum {
- /** Pmin = 25%, Pmax = 75% (default) */
- GSW_QOS_WRED_PROFILE_P0 = 0,
- /** Pmin = 25%, Pmax = 50% */
- GSW_QOS_WRED_PROFILE_P1 = 1,
- /** Pmin = 50%, Pmax = 50% */
- GSW_QOS_WRED_PROFILE_P2 = 2,
- /** Pmin = 50%, Pmax = 75% */
- GSW_QOS_WRED_PROFILE_P3 = 3
-} GSW_QoS_WRED_Profile_t;
+ /** Port operates in full-duplex mode */
+ GSW_DUPLEX_FULL = 0,
+ /** Port operates in half-duplex mode */
+ GSW_DUPLEX_HALF = 1,
+ /** Port operates in Auto mode */
+ GSW_DUPLEX_AUTO = 2,
+} GSW_portDuplex_t;
-/** \brief WRED Cfg Type - Automatic (Adaptive) or Manual.
- Used by \ref GSW_QoS_WRED_Cfg_t. */
+/** \brief Force the MAC and PHY link modus.
+ Used by \ref GSW_portLinkCfg_t. */
typedef enum {
- /** Automatic - Adaptive Watermark Type - GSWIP-3.0/3.1 only*/
- GSW_QOS_WRED_Adaptive = 0,
- /** Manual Threshold Levels Type */
- GSW_QOS_WRED_Manual = 1
-} GSW_QoS_WRED_Mode_t;
+ /** Link up. Any connected LED
+ still behaves based on the real PHY status. */
+ GSW_PORT_LINK_UP = 0,
+ /** Link down. */
+ GSW_PORT_LINK_DOWN = 1,
+ /** Link Auto. */
+ GSW_PORT_LINK_AUTO = 2,
+} GSW_portLink_t;
-/** \brief WRED Thresholds Mode Type. - GSWIP-3.0/3.1 only
- Used by \ref GSW_QoS_WRED_Cfg_t. */
+/** \brief Ethernet port interface mode.
+ A port might support only a subset of the possible settings.
+ Used by \ref GSW_portLinkCfg_t. */
typedef enum {
- /** Local Thresholds Mode */
- GSW_QOS_WRED_Local_Thresh = 0,
- /** Global Thresholds Mode */
- GSW_QOS_WRED_Global_Thresh = 1,
- /** Port queue and Port WRED Thresholds */
- GSW_QOS_WRED_Port_Thresh = 2,
+ /** Normal PHY interface (twisted pair), use the internal MII Interface. */
+ GSW_PORT_HW_MII = 0,
+ /** Reduced MII interface in normal mode. */
+ GSW_PORT_HW_RMII = 1,
+ /** GMII or MII, depending upon the speed. */
+ GSW_PORT_HW_GMII = 2,
+ /** RGMII mode. */
+ GSW_PORT_HW_RGMII = 3,
+ /** XGMII mode. */
+ GSW_PORT_HW_XGMII = 4,
+} GSW_MII_Mode_t;
-} GSW_QoS_WRED_ThreshMode_t;
+/** \brief Ethernet port configuration for PHY or MAC mode.
+ Used by \ref GSW_portLinkCfg_t. */
+typedef enum {
+ /** MAC Mode. The Ethernet port is configured to work in MAC mode. */
+ GSW_PORT_MAC = 0,
+ /** PHY Mode. The Ethernet port is configured to work in PHY mode. */
+ GSW_PORT_PHY = 1
+} GSW_MII_Type_t;
-/** \brief Configures the global probability profile of the device.
- The min. and max. threshold values are given in number of packet
- buffer segments and required only in case of Manual Mode. The GSWIP-3.0/3.1 supports Auto mode and the threshold values are dynamically computed internally by GSWIP. The size of a segment can be retrieved using \ref GSW_CAP_GET.
- Used by \ref GSW_QOS_WRED_CFG_SET and \ref GSW_QOS_WRED_CFG_GET. */
-typedef struct {
- /** Egress Queue Congestion Notification Watermark
- only applicable for GSWIP 3.1*/
- GSW_QoS_WRED_WATERMARK_t eCongestionWatermark;
- /** Drop Probability Profile. */
- GSW_QoS_WRED_Profile_t eProfile;
- /** Automatic or Manual Mode of Thresholds Config */
- GSW_QoS_WRED_Mode_t eMode;
- /** WRED Threshold Mode Config */
- GSW_QoS_WRED_ThreshMode_t eThreshMode;
- /** WRED Red Threshold Min [number of segments] - Valid for Manual Mode only. */
- u16 nRed_Min;
- /** WRED Red Threshold Max [number of segments] - Valid for Manual Mode only */
- u16 nRed_Max;
- /** WRED Yellow Threshold Min [number of segments] - Valid for Manual Mode only */
- u16 nYellow_Min;
- /** WRED Yellow Threshold Max [number of segments] - Valid for Manual Mode only */
- u16 nYellow_Max;
- /** WRED Green Threshold Min [number of segments] - Valid for Manual Mode only */
- u16 nGreen_Min;
- /** WRED Green Threshold Max [number of segments] - Valid for Manual Mode only */
- u16 nGreen_Max;
-} GSW_QoS_WRED_Cfg_t;
+/** \brief Ethernet port clock source configuration.
+ Used by \ref GSW_portLinkCfg_t. */
+typedef enum {
+ /** Clock Mode not applicable. */
+ GSW_PORT_CLK_NA = 0,
+ /** Clock Master Mode. The port is configured to provide the clock as output signal. */
+ GSW_PORT_CLK_MASTER = 1,
+ /** Clock Slave Mode. The port is configured to use the input clock signal. */
+ GSW_PORT_CLK_SLAVE = 2
+} GSW_clkMode_t;
-/** \brief Configures the WRED threshold level values.
- The min. and max. values are given in number of packet
- buffer segments. The size of a segment can be
- retrieved using \ref GSW_CAP_GET.
- Used by \ref GSW_QOS_WRED_QUEUE_CFG_SET and \ref GSW_QOS_WRED_QUEUE_CFG_GET. */
-typedef struct {
- /** QoS queue index (zero-based counting). */
- u16 nQueueId;
- /** WRED Red Threshold Min [number of segments]. */
- u16 nRed_Min;
- /** WRED Red Threshold Max [number of segments]. */
- u16 nRed_Max;
- /** WRED Yellow Threshold Min [number of segments]. */
- u16 nYellow_Min;
- /** WRED Yellow Threshold Max [number of segments]. */
- u16 nYellow_Max;
- /** WRED Green Threshold Min [number of segments]. */
- u16 nGreen_Min;
- /** WRED Green Threshold Max [number of segments]. */
- u16 nGreen_Max;
- /** Reserved Buffer Threshold */
- u16 nReserveThreshold;
-} GSW_QoS_WRED_QueueCfg_t;
-/** \brief Configures the WRED threshold parameter per port.
- The configured thresholds apply to fill level sum
- of all egress queues which are assigned to the egress port.
- The min. and max. values are given in number of packet
- buffer segments. The size of a segment can be
- retrieved using \ref GSW_CAP_GET.
- Used by \ref GSW_QOS_WRED_PORT_CFG_SET and \ref GSW_QOS_WRED_PORT_CFG_GET. */
-typedef struct {
- /** Ethernet Port number (zero-based counting).
- The valid range is hardware dependent. */
- u16 nPortId;
- /** WRED Red Threshold Min [number of segments]. */
- u16 nRed_Min;
- /** WRED Red Threshold Max [number of segments]. */
- u16 nRed_Max;
- /** WRED Yellow Threshold Min [number of segments]. */
- u16 nYellow_Min;
- /** WRED Yellow Threshold Max [number of segments]. */
- u16 nYellow_Max;
- /** WRED Green Threshold Min [number of segments]. */
- u16 nGreen_Min;
- /** WRED Green Threshold Max [number of segments]. */
- u16 nGreen_Max;
-} GSW_QoS_WRED_PortCfg_t;
-
-/** \brief Configures the global buffer flow control threshold for
- conforming and non-conforming packets.
- The min. and max. values are given in number of packet
- buffer segments. The size of a segment can be
- retrieved using \ref GSW_CAP_GET.
- Used by \ref GSW_QOS_FLOWCTRL_CFG_SET and \ref GSW_QOS_FLOWCTRL_CFG_GET. */
-typedef struct {
- /** Global Buffer Non Conforming Flow Control Threshold Minimum [number of segments]. */
- u16 nFlowCtrlNonConform_Min;
- /** Global Buffer Non Conforming Flow Control Threshold Maximum [number of segments]. */
- u16 nFlowCtrlNonConform_Max;
- /** Global Buffer Conforming Flow Control Threshold Minimum [number of segments]. */
- u16 nFlowCtrlConform_Min;
- /** Global Buffer Conforming Flow Control Threshold Maximum [number of segments]. */
- u16 nFlowCtrlConform_Max;
-} GSW_QoS_FlowCtrlCfg_t;
-
-/** \brief Configures the ingress port flow control threshold for
- used packet segments.
- The min. and max. values are given in number of packet
- buffer segments. The size of a segment can be
- retrieved using \ref GSW_CAP_GET.
- Used by \ref GSW_QOS_FLOWCTRL_PORT_CFG_SET and \ref GSW_QOS_FLOWCTRL_PORT_CFG_GET. */
+/** \brief Ethernet port link, speed status and flow control status.
+ Used by \ref GSW_PortLinkCfgGet and \ref GSW_PortLinkCfgSet. */
typedef struct {
- /** Ethernet Port number (zero-based counting).
- The valid range is hardware dependent. */
+ /** Ethernet Port number (zero-based counting). The valid range is hardware
+ dependent. An error code is delivered if the selected port is not
+ available. */
u16 nPortId;
- /** Ingress Port occupied Buffer Flow Control Threshold Minimum [number of segments]. */
- u16 nFlowCtrl_Min;
- /** Ingress Port occupied Buffer Flow Control Threshold Maximum [number of segments]. */
- u16 nFlowCtrl_Max;
-} GSW_QoS_FlowCtrlPortCfg_t;
-
-/** \brief Reserved egress queue buffer segments.
- Used by \ref GSW_QOS_QUEUE_BUFFER_RESERVE_CFG_SET and \ref GSW_QOS_QUEUE_BUFFER_RESERVE_CFG_GET. */
-typedef struct {
- /** QoS queue index (zero-based counting).
- This is an input parameter for \ref GSW_QOS_QUEUE_BUFFER_RESERVE_CFG_GET. */
- u16 nQueueId;
- /** Reserved Buffer Segment Threshold [number of segments].
- This is an output parameter for \ref GSW_QOS_QUEUE_BUFFER_RESERVE_CFG_GET. */
- u16 nBufferReserved;
-} GSW_QoS_QueueBufferReserveCfg_t;
-
-/** \brief Color Marking Table.
- There are standards to define the marking table. User should use
- \ref GSW_QOS_COLOR_MARKING_TABLE_SET to initialize the table before color
- marking happens. \ref GSW_QOS_COLOR_MARKING_TABLE_GET is used to get
- the marking table, mainly for debug purpose. */
-typedef struct {
- /** Mode of color marking. */
- GSW_ColorMarkingMode_t eMode;
-
- /** If eMode is GSW_REMARKING_DSCP_AF, index stands for 6-bit DSCP value.
- If eMode is one of GSW_REMARKING_PCP_8P0D, GSW_REMARKING_PCP_7P1D,
- GSW_REMARKING_PCP_6P2D and GSW_REMARKING_PCP_5P3D, index 0-7 is
- 3-bit PCP value with DEI is 0, and index 8-15 is 3-bit PCP value with
- DEI is 1. Ignored in other modes. */
- u8 nPriority[64];
- /** If eMode is GSW_REMARKING_DSCP_AF, index stands for 6-bit DSCP value.
- If eMode is one of GSW_REMARKING_PCP_8P0D, GSW_REMARKING_PCP_7P1D,
- GSW_REMARKING_PCP_6P2D and GSW_REMARKING_PCP_5P3D, index 0-7 is 3-bit
- PCP value with DEI is 0, and index 8-15 is 3-bit PCP value with DEI is 1.
- Ignored in other modes.
- Value refers to \ref GSW_QoS_DropPrecedence_t. */
- u8 nColor[64];
-} GSW_QoS_colorMarkingEntry_t;
-
-/** \brief Color Remarking Table.
- There are standards to define the remarking table. User should use
- \ref GSW_QOS_COLOR_REMARKING_TABLE_SET to initialize the table before color
- remarking happens. \ref GSW_QOS_COLOR_REMARKING_TABLE_GET is used to get
- the remarking table, mainly for debug purpose. */
-typedef struct {
- /** Mode of color remarking. */
- GSW_ColorRemarkingMode_t eMode;
+ /** Force Port Duplex Mode.
- /** Index stands for color and priority. Index 0-7 is green color with
- priority (traffic class) 0-7. Index 8-15 is yellow color with priority
- (traffic class) 0-7. Value is DSCP if eMode is GSW_REMARKING_DSCP_AF.
- Value bit 0 is DEI and bit 1-3 is PCP if eMode is one of
- GSW_REMARKING_PCP_8P0D, GSW_REMARKING_PCP_7P1D, GSW_REMARKING_PCP_6P2D
- and GSW_REMARKING_PCP_5P3D. Value is ignored for other mode. */
- u8 nVal[16];
-} GSW_QoS_colorRemarkingEntry_t;
+ - 0: Negotiate Duplex Mode. Auto-negotiation mode. Negotiated
+ duplex mode given in 'eDuplex'
+ during GSW_PortLinkCfgGet calls.
+ - 1: Force Duplex Mode. Force duplex mode in 'eDuplex'.
+ */
+ gsw_bool_t bDuplexForce;
+ /** Port Duplex Status. */
+ GSW_portDuplex_t eDuplex;
+ /** Force Link Speed.
+ - 0: Negotiate Link Speed. Negotiated speed given in
+ 'eSpeed' during GSW_PortLinkCfgGet calls.
+ - 1: Force Link Speed. Forced speed mode in 'eSpeed'.
+ */
+ gsw_bool_t bSpeedForce;
+ /** Ethernet port link up/down and speed status. */
+ GSW_portSpeed_t eSpeed;
+ /** Force Link.
-/** \brief DSCP to PCP Mapping.
- Used by \ref GSW_DSCP2PCP_MAP_GET. */
-typedef struct {
- /** Index of entry in mapping table. */
- u16 nIndex;
+ - 0: Auto-negotiate Link. Current link status is given in
+ 'eLink' during GSW_PortLinkCfgGet calls.
+ - 1: Force Duplex Mode. Force duplex mode in 'eLink'.
+ */
+ gsw_bool_t bLinkForce;
+ /** Link Status. Read out the current link status.
+ Note that the link could be forced by setting 'bLinkForce'. */
+ GSW_portLink_t eLink;
+ /** Selected interface mode (MII/RMII/RGMII/GMII/XGMII). */
+ GSW_MII_Mode_t eMII_Mode;
+ /** Select MAC or PHY mode (PHY = Reverse xMII). */
+ GSW_MII_Type_t eMII_Type;
+ /** Interface Clock mode (used for RMII mode). */
+ GSW_clkMode_t eClkMode;
+ /** 'Low Power Idle' Support for 'Energy Efficient Ethernet'.
+ Only enable this feature in case the attached PHY also supports it. */
+ gsw_bool_t bLPI;
+} GSW_portLinkCfg_t;
- /** The index of array stands for DSCP value. Each byte of the array is 3-bit
- PCP value. */
- u8 nMap[64];
-} GSW_DSCP2PCP_map_t;
+/** \brief Port Enable Type Selection.
+ Used by \ref GSW_portCfg_t. */
+typedef enum {
+ /** The port is disabled in both directions. */
+ GSW_PORT_DISABLE = 0,
+ /** The port is enabled in both directions (ingress and egress). */
+ GSW_PORT_ENABLE_RXTX = 1,
+ /** The port is enabled in the receive (ingress) direction only. */
+ GSW_PORT_ENABLE_RX = 2,
+ /** The port is enabled in the transmit (egress) direction only. */
+ GSW_PORT_ENABLE_TX = 3
+} GSW_portEnable_t;
-/** \brief Traffic class associated with a particular STAG VLAN 802.1P (PCP) priority and Drop Eligible Indicator (DEI) mapping value.
- This table is global for the entire switch device. Priority map entry structure.
- The table index value is calculated by 'index=PCP + 8*DEI'
- Used by \ref GSW_QOS_SVLAN_PCP_CLASS_SET and \ref GSW_QOS_SVLAN_PCP_CLASS_GET. */
-typedef struct {
- /** Configures the PCP and DEI to traffic class mapping.
- The queue index starts counting from zero. */
- u8 nTrafficClass[16];
- /** Configures the PCP traffic color.
- Not applicable to GSWIP-3.1. */
- u8 nTrafficColor[16];
- /** PCP Remark disable control.
- Not applicable to GSWIP-3.1. */
- u8 nPCP_Remark_Enable[16];
- /** DEI Remark disable control.
- Not applicable to GSWIP-3.1. */
- u8 nDEI_Remark_Enable[16];
+/** \brief Ethernet flow control status.
+ Used by \ref GSW_portCfg_t. */
+typedef enum {
+ /** Automatic flow control mode selection through auto-negotiation. */
+ GSW_FLOW_AUTO = 0,
+ /** Receive flow control only */
+ GSW_FLOW_RX = 1,
+ /** Transmit flow control only */
+ GSW_FLOW_TX = 2,
+ /** Receive and Transmit flow control */
+ GSW_FLOW_RXTX = 3,
+ /** No flow control */
+ GSW_FLOW_OFF = 4
+} GSW_portFlow_t;
-} GSW_QoS_SVLAN_PCP_ClassCfg_t;
-/** \brief MAC Table Clear Type
- Used by \ref GSW_MAC_tableClearCond_t */
+/** \brief Port Mirror Options.
+ Used by \ref GSW_portCfg_t. */
typedef enum {
- /** Clear dynamic entries based on Physical Port */
- GSW_MAC_CLEAR_PHY_PORT = 0,
- /** Clear all dynamic entries */
- GSW_MAC_CLEAR_DYNAMIC = 1,
-} GSW_MacClearType_t;
+ /** Mirror Feature is disabled. Normal port usage. */
+ GSW_PORT_MONITOR_NONE = 0,
+ /** Port Ingress packets are mirrored to the monitor port. */
+ GSW_PORT_MONITOR_RX = 1,
+ /** Port Egress packets are mirrored to the monitor port. */
+ GSW_PORT_MONITOR_TX = 2,
+ /** Port Ingress and Egress packets are mirrored to the monitor port. */
+ GSW_PORT_MONITOR_RXTX = 3,
+ /** Packet mirroring of 'unknown VLAN violation' frames. */
+ GSW_PORT_MONITOR_VLAN_UNKNOWN = 4,
+ /** Packet mirroring of 'VLAN ingress or egress membership violation' frames. */
+ GSW_PORT_MONITOR_VLAN_MEMBERSHIP = 16,
+ /** Packet mirroring of 'port state violation' frames. */
+ GSW_PORT_MONITOR_PORT_STATE = 32,
+ /** Packet mirroring of 'MAC learning limit violation' frames. */
+ GSW_PORT_MONITOR_LEARNING_LIMIT = 64,
+ /** Packet mirroring of 'port lock violation' frames. */
+ GSW_PORT_MONITOR_PORT_LOCK = 128
+} GSW_portMonitor_t;
-/** \brief MAC Table Clear based on given condition.
- Used by \ref GSW_MAC_TABLE_CLEAR_COND. */
-typedef struct {
- /** MAC table clear type \ref GSW_MacClearType_t */
- u8 eType;
- union {
- /** Physical port id (0~16) if \ref eType is
- ref GSW_MAC_CLEAR_PHY_PORT. */
- u8 nPortId;
- };
-} GSW_MAC_tableClearCond_t;
+/** \brief Interface RMON Counter Mode - (FID, SUBID or FLOWID) Config - GSWIP-3.0 only.
+ Used by \ref GSW_portCfg_t. */
+typedef enum {
+ /** FID based Interface RMON counters Usage */
+ GSW_IF_RMON_FID = 0,
+ /** Sub-Interface Id based Interface RMON counters Usage */
+ GSW_IF_RMON_SUBID = 1,
+ /** Flow Id (LSB bits 3 to 0) based Interface RMON counters Usage */
+ GSW_IF_RMON_FLOWID_LSB = 2,
+ /** Flow Id (MSB bits 7 to 4) based Interface RMON counters Usage */
+ GSW_IF_RMON_FLOWID_MSB = 3
+} GSW_If_RMON_Mode_t;
-/** \brief MAC Table Entry to be added.
- Used by \ref GSW_MAC_TABLE_ENTRY_ADD. */
+/** \brief Port Configuration Parameters.
+ Used by \ref GSW_PortCfgGet and \ref GSW_PortCfgSet. */
typedef struct {
- /** Filtering Identifier (FID) (not supported by all switches) */
- u16 nFId;
- /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
- GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
- dependent.
+ /** Port Type. This gives information which type of port is configured.
+ nPortId should be based on this field. */
+ GSW_portType_t ePortType;
- \remarks
- In GSWIP-2.1/2.2/3.0, this field is used as portmap field, when the MSB
- bit is set. In portmap mode, every value bit represents an Ethernet port.
- LSB represents Port 0 with incrementing counting.
- The (MSB - 1) bit represent the last port.
- The macro \ref GSW_PORTMAP_FLAG_SET allows to set the MSB bit,
- marking it as portmap variable.
- Checking the portmap flag can be done by
- using the \ref GSW_PORTMAP_FLAG_GET macro.
- From GSWIP3.1, if MSB is set, other bits in this field are ignored.
- array \ref GSW_MAC_tableRead_t::nPortMap is used for bit map. */
- u32 nPortId;
- /** Bridge Port Map - to support GSWIP-3.1, following field is added
- for port map in static entry. It's valid only when MSB of
- \ref GSW_MAC_tableRead_t::nPortId is set. Each bit stands for 1 bridge
- port. */
- u16 nPortMap[8]; /* max can be 16 */
- /** Sub-Interface Identifier Destination (supported in GSWIP-3.0/3.1 only).
+ /** Ethernet Port number (zero-based counting). The valid range is hardware
+ dependent. An error code is delivered if the selected port is not
+ available. */
+ u16 nPortId;
+ /** Enable Port (ingress only, egress only, both directions, or disabled).
+ This parameter is used for Spanning Tree Protocol and 802.1X applications. */
+ GSW_portEnable_t eEnable;
+ /** Drop unknown unicast packets.
+ Do not send out unknown unicast packets on this port,
+ if the boolean parameter is enabled. By default packets of this type
+ are forwarded to this port. */
+ gsw_bool_t bUnicastUnknownDrop;
+ /** Drop unknown multicast packets.
+ Do not send out unknown multicast packets on this port,
+ if boolean parameter is enabled. By default packets of this type
+ are forwarded to this port.
+ Some platforms also drop broadcast packets. */
+ gsw_bool_t bMulticastUnknownDrop;
+ /** Drop reserved packet types
+ (destination address from '01 80 C2 00 00 00' to
+ '01 80 C2 00 00 2F') received on this port. */
+ gsw_bool_t bReservedPacketDrop;
+ /** Drop Broadcast packets received on this port. By default packets of this
+ type are forwarded to this port. */
+ gsw_bool_t bBroadcastDrop;
+ /** Enables MAC address table aging.
+ The MAC table entries learned on this port are removed after the
+ aging time has expired.
+ The aging time is a global parameter, common to all ports. */
+ gsw_bool_t bAging;
+ /** MAC address table learning on the port specified by 'nPortId'.
+ By default this parameter is always enabled. */
+ gsw_bool_t bLearning;
+ /** Automatic MAC address table learning locking on the port specified
+ by 'nPortId'.
+ This parameter is only taken into account when 'bLearning' is enabled. */
+ gsw_bool_t bLearningMAC_PortLock;
+ /** Automatic MAC address table learning limitation on this port.
+ The learning functionality is disabled when the limit value is zero.
+ The value 0xFFFF to allow unlimited learned address.
+ This parameter is only taken into account when 'bLearning' is enabled. */
+ u16 nLearningLimit;
+ /** MAC spoofing detection. Identifies ingress packets that carry
+ a MAC source address which was previously learned on a different ingress
+ port (learned by MAC bridging table). This also applies to static added
+ entries. Those violated packets could be accepted or discarded,
+ depending on the global switch configuration 'bMAC_SpoofingAction'.
+ This parameter is only taken into account when 'bLearning' is enabled. */
+ gsw_bool_t bMAC_SpoofingDetection;
+ /** Port Flow Control Status. Enables the flow control function. */
+ GSW_portFlow_t eFlowCtrl;
+ /** Port monitor feature. Allows forwarding of egress and/or ingress
+ packets to the monitor port. If enabled, the monitor port gets
+ a copy of the selected packet type. */
+ GSW_portMonitor_t ePortMonitor;
+ /** Assign Interface RMON Counters for this Port - GSWIP-3.0 */
+ gsw_bool_t bIfCounters;
+ /** Interface RMON Counters Start Index - GSWIP-3.0.
+ Value of (-1) denotes unassigned Interface Counters.
+ Valid range : 0-255 available to be shared amongst ports in desired way*/
+ int nIfCountStartIdx;
+ /** Interface RMON Counters Mode - GSWIP-3.0 */
+ GSW_If_RMON_Mode_t eIfRMONmode;
+} GSW_portCfg_t;
- \remarks
- In GSWIP-3.1, this field is sub interface ID for WLAN logical port. For
- Other types, either outer VLAN ID if Nto1Vlan enabled or 0. */
- u16 nSubIfId;
- /** Aging Time, given in multiples of 1 second in a range
- from 1 s to 1,000,000 s.
- The configured value might be rounded that it fits to the given hardware platform. */
- int nAgeTimer;
- /** STAG VLAN Id. Only applicable in case SVLAN support is enabled on the device. */
- u16 nSVLAN_Id;
- /** Static Entry (value will be aged out if the entry is not set to static). The
- switch API implementation uses the maximum age timer in case the entry
- is not static. */
- gsw_bool_t bStaticEntry;
- /** Egress queue traffic class.
- The queue index starts counting from zero. */
- u8 nTrafficClass;
- /** MAC Address to add to the table. */
- u8 nMAC[GSW_MAC_ADDR_LEN];
- /** Source/Destination MAC address filtering flag (GSWIP-3.1 only)
- Value 0 - not filter, 1 - source address filter,
- 2 - destination address filter, 3 - both source and destination filter.
+/** @}*/ /* GSW_ETHERNET_BRIDGING */
- \remarks
- Please refer to "GSWIP Hardware Architecture Spec" chapter 3.4.4.6
- "Source MAC Address Filtering and Destination MAC Address Filtering"
- for more detail. */
- u8 nFilterFlag;
- /** Packet is marked as IGMP controlled if destination MAC address matches
- MAC in this entry. (GSWIP-3.1 only) */
- gsw_bool_t bIgmpControlled;
+/** \addtogroup GSW_QoS_SVC
+ * @{
+ */
- /** Associated Mac address -(GSWIP-3.2)*/
- u8 nAssociatedMAC[GSW_MAC_ADDR_LEN];
+/** \brief Meter Type - srTCM or trTCM. Defines the Metering algorithm Type.
+ Used by \ref GSW_QoS_meterCfg_t. */
+typedef enum {
+ /** srTCM Meter Type - single rate 3 color mode */
+ GSW_QOS_Meter_srTCM = 0,
+ /** trTCM Meter Type - 2 rate 3 color mode */
+ GSW_QOS_Meter_trTCM = 1,
+} GSW_QoS_Meter_Type;
- /** TCI for (GSWIP-3.2) B-Step
- Bit [0:11] - VLAN ID
- Bit [12] - VLAN CFI/DEI
- Bit [13:15] - VLAN PRI */
- u16 nTci;
-} GSW_MAC_tableAdd_t;
+/** \brief DSCP Drop Precedence to color code assignment.
+ Used by \ref GSW_QoS_DSCP_DropPrecedenceCfg_t. */
+typedef enum {
+ /** Critical Packet. Metering never changes the drop precedence of these packets. */
+ GSW_DROP_PRECEDENCE_CRITICAL = 0,
+ /** Green Drop Precedence Packet. Packet is marked with a 'low' drop precedence. */
+ GSW_DROP_PRECEDENCE_GREEN = 1,
+ /** Yellow Drop Precedence Packet. Packet is marked with a 'middle' drop precedence. */
+ GSW_DROP_PRECEDENCE_YELLOW = 2,
+ /** Red Drop Precedence Packet. Packet is marked with a 'high' drop precedence. */
+ GSW_DROP_PRECEDENCE_RED = 3
+} GSW_QoS_DropPrecedence_t;
-/** \brief MAC Table Entry to be read.
- Used by \ref GSW_MAC_TABLE_ENTRY_READ. */
+
+/** \brief Selection of the traffic class field.
+ Used by \ref GSW_QoS_portCfg_t.
+ The port default traffic class is assigned in case non of the
+ configured protocol code points given by the packet. */
+typedef enum {
+ /** No traffic class assignment based on DSCP or PCP */
+ GSW_QOS_CLASS_SELECT_NO = 0,
+ /** Traffic class assignment based on DSCP. PCP information is ignored.
+ The Port Class is used in case DSCP is not available in the packet. */
+ GSW_QOS_CLASS_SELECT_DSCP = 1,
+ /** Traffic class assignment based on PCP. DSCP information is ignored.
+ The Port Class is used in case PCP is not available in the packet. */
+ GSW_QOS_CLASS_SELECT_PCP = 2,
+ /** Traffic class assignment based on DSCP. Make the assignment based on
+ PCP in case the DSCP information is not available in the packet header.
+ The Port Class is used in case both are not available in the packet. */
+ GSW_QOS_CLASS_SELECT_DSCP_PCP = 3,
+ /** CTAG VLAN PCP, IP DSCP. Traffic class assignment based
+ on CTAG VLAN PCP, alternative use DSCP based assignment. */
+ GSW_QOS_CLASS_SELECT_PCP_DSCP = 4,
+ /** STAG VLAN PCP. Traffic class assignment based
+ on STAG VLAN PCP. */
+ GSW_QOS_CLASS_SELECT_SPCP = 5,
+ /** STAG VLAN PCP, IP DSCP. Traffic class assignment based
+ on STAG VLAN PCP, alternative use DSCP based assignment. */
+ GSW_QOS_CLASS_SELECT_SPCP_DSCP = 6,
+ /** IP DSCP, STAG VLAN PCP. Traffic class assignment based
+ on DSCP, alternative use STAG VLAN PCP based assignment. */
+ GSW_QOS_CLASS_SELECT_DSCP_SPCP = 7,
+ /** STAG VLAN PCP, CTAG VLAN PCP. Traffic class assignment based
+ on STAG VLAN PCP, alternative use CTAG VLAN PCP based assignment. */
+ GSW_QOS_CLASS_SELECT_SPCP_PCP = 8,
+ /** STAG VLAN PCP, CTAG VLAN PCP, IP DSCP. Traffic class assignment
+ based on STAG VLAN PCP, alternative use CTAG VLAN PCP based
+ assignment, alternative use DSCP based assignment. */
+ GSW_QOS_CLASS_SELECT_SPCP_PCP_DSCP = 9,
+ /** IP DSCP, STAG VLAN PCP, CTAG VLAN PCP. Traffic class assignment
+ based on DSCP, alternative use STAG VLAN PCP based
+ assignment, alternative use CTAG VLAN PCP based assignment. */
+ GSW_QOS_CLASS_SELECT_DSCP_SPCP_PCP = 10
+} GSW_QoS_ClassSelect_t;
+
+
+/** \brief Configures the parameters of a rate meter instance.
+ Used by \ref GSW_QOS_MeterAlloc, \ref GSW_QOS_MeterFree,
+ \ref GSW_QoS_MeterCfgSet and \ref GSW_QoS_MeterCfgGet. */
typedef struct {
- /** Restart the get operation from the beginning of the table. Otherwise
- return the next table entry (next to the entry that was returned
- during the previous get operation). This boolean parameter is set by the
- calling application. */
- gsw_bool_t bInitial;
- /** Indicates that the read operation got all last valid entries of the
- table. This boolean parameter is set by the switch API
- when the Switch API is called after the last valid one was returned already. */
- gsw_bool_t bLast;
- /** Get the MAC table entry belonging to the given Filtering Identifier
- (not supported by all switches). */
- u16 nFId;
- /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
- GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
- dependent.
+ /** Enable/Disable the meter shaper. */
+ gsw_bool_t bEnable;
+ /** Meter index (zero-based counting).
\remarks
- In GSWIP-2.1/2.2/3.0, this field is used as portmap field, when the MSB
- bit is set. In portmap mode, every value bit represents an Ethernet port.
- LSB represents Port 0 with incrementing counting.
- The (MSB - 1) bit represent the last port.
- The macro \ref GSW_PORTMAP_FLAG_SET allows to set the MSB bit,
- marking it as portmap variable.
- Checking the portmap flag can be done by
- using the \ref GSW_PORTMAP_FLAG_GET macro.
- From GSWIP3.1, if MSB is set, other bits in this field are ignored.
- array \ref GSW_MAC_tableRead_t::nPortMap is used for bit map. */
- u32 nPortId;
- /** Bridge Port Map - to support GSWIP-3.1, following field is added
- for port map in static entry. It's valid only when MSB of
- \ref GSW_MAC_tableRead_t::nPortId is set. Each bit stands for 1 bridge
- port. */
- u16 nPortMap[8]; /* max can be 16 */
- /** Aging Time, given in multiples of 1 second in a range from 1 s to 1,000,000 s.
- The value read back in a GET command might differ slightly from the value
- given in the SET command due to limited hardware timing resolution.
- Filled out by the switch API implementation. */
- int nAgeTimer;
- /** STAG VLAN Id. Only applicable in case SVLAN support is enabled on the device. */
- u16 nSVLAN_Id;
- /** Static Entry (value will be aged out after 'nAgeTimer' if the entry
- is not set to static). */
- gsw_bool_t bStaticEntry;
- /** Sub-Interface Identifier Destination (supported in GSWIP-3.0/3.1 only). */
- u16 nSubIfId;
- /** MAC Address. Filled out by the switch API implementation. */
- u8 nMAC[GSW_MAC_ADDR_LEN];
- /** Source/Destination MAC address filtering flag (GSWIP-3.1 only)
- Value 0 - not filter, 1 - source address filter,
- 2 - destination address filter, 3 - both source and destination filter.
+ For \ref GSW_QOS_MeterFree, this is the only input and other fields are
+ ignored. For \ref GSW_QOS_MeterAlloc, this is output when allocation
+ is successful. For \ref GSW_QoS_MeterCfgSet and
+ \ref GSW_QoS_MeterCfgGet, this is input to indicate meter to
+ configure/get-configuration. */
+ u16 nMeterId;
+ /** Meter Name string for easy reference (Id to Name Mapping) - TBD*/
+ char cMeterName[32];
+ /** Meter Algorithm Type */
+ GSW_QoS_Meter_Type eMtrType;
+ /** Committed Burst Size (CBS [Bytes])
\remarks
- Please refer to "GSWIP Hardware Architecture Spec" chapter 3.4.4.6
- "Source MAC Address Filtering and Destination MAC Address Filtering"
- for more detail. */
- u8 nFilterFlag;
- /** Packet is marked as IGMP controlled if destination MAC address matches
- MAC in this entry. (GSWIP-3.1 only) */
- gsw_bool_t bIgmpControlled;
-
- /** Changed
- 0: the entry is not changed
- 1: the entry is changed and not accessed yet */
+ Range 64B~4GB. Only most 10 significant bits are effective.
+ Value is rounded up to HW boundary.
+ If value is less than 64, default value 32KB is used. */
+ u32 nCbs;
+ /** reserve for backward compatibility */
+ u32 res1;
+ /** Excess Burst Size (EBS [Bytes]).
- gsw_bool_t bEntryChanged;
+ \remarks
+ Range 64B~4GB. Only most 10 significant bits are effective.
+ Value is rounded up to HW boundary.
+ If value is less than 64, default value 32KB is used. */
+ u32 nEbs;
+ /** reserve for backward compatibility */
+ u32 res2;
+ /** Committed Information Rate (CIR)
- /** Associated Mac address -(GSWIP-3.2)*/
- u8 nAssociatedMAC[GSW_MAC_ADDR_LEN];
- /* MAC Table Hit Status Update (Supported in GSWip-3.1/3.2) */
- gsw_bool_t hitstatus;
- /** TCI for (GSWIP-3.2) B-Step
- Bit [0:11] - VLAN ID
- Bit [12] - VLAN CFI/DEI
- Bit [13:15] - VLAN PRI */
- u16 nTci;
- u16 nFirstBridgePortId;
-} GSW_MAC_tableRead_t;
+ \remarks
+ CIR in [kbit/s] if \ref GSW_QoS_meterCfg_t::bPktMode is FALSE,
+ or in [packet/s] if \ref GSW_QoS_meterCfg_t::bPktMode is TRUE. */
+ u32 nRate;
+ /** Peak Information Rate (PIR) - applicable for trTCM only
-/** \brief Search for a MAC address entry in the address table.
- Used by \ref GSW_MAC_TABLE_ENTRY_QUERY. */
-typedef struct {
- /** MAC Address. This parameter needs to be provided for the search operation.
- This is an input parameter. */
- u8 nMAC[GSW_MAC_ADDR_LEN];
- /** Get the MAC table entry belonging to the given Filtering Identifier
- (not supported by all switches).
- This is an input parameter. */
- u16 nFId;
- /** MAC Address Found. Switch API sets this boolean variable in case
- the requested MAC address 'nMAC' is found inside the address table,
- otherwise it is set to FALSE.
- This is an output parameter. */
- gsw_bool_t bFound;
- /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
- GSWIP-3.1, this field is Bridge port ID. The valid range is hardware
- dependent.
+ \remarks
+ PIR in [kbit/s] if \ref GSW_QoS_meterCfg_t::bPktMode is FALSE,
+ or in [packet/s] if \ref GSW_QoS_meterCfg_t::bPktMode is TRUE. */
+ u32 nPiRate;
+ /** Peak Burst Size (PBS [Bytes]) - applicable for trTCM only */
+ /* u32 nPbs; */
+ /** Meter colour mode **/
+ u8 nColourBlindMode;
+ /** Enable/Disable Packet Mode. 0- Byte, 1 - Pkt */
+ u8 bPktMode;
+ /** Enable/Disable local overhead for metering rate calculation. */
+ gsw_bool_t bLocalOverhd;
+ /** Local overhead for metering rate calculation when
+ \ref GSW_QoS_meterCfg_t::bLocalOverhd is TRUE. */
+ u16 nLocaloverhd;
+} GSW_QoS_meterCfg_t;
+
+/** \brief DSCP mapping table.
+ Used by \ref GSW_QoS_DSCP_ClassSet
+ and \ref GSW_QoS_DSCP_ClassGet. */
+typedef struct {
+ /** Traffic class associated with a particular DSCP value.
+ DSCP is the index to an array of resulting traffic class values.
+ The index starts counting from zero. */
+ u8 nTrafficClass[64];
+} GSW_QoS_DSCP_ClassCfg_t;
+
+/** \brief DSCP to Drop Precedence assignment table configuration.
+ Used by \ref GSW_QoS_DSCP_DropPrecedenceCfgSet
+ and \ref GSW_QoS_DSCP_DropPrecedenceCfgGet. */
+typedef struct {
+ /** DSCP to drop precedence assignment. Every array entry represents the
+ drop precedence for one of the 64 existing DSCP values.
+ DSCP is the index to an array of resulting drop precedence values.
+ The index starts counting from zero.
+ Value refers to \ref GSW_QoS_DropPrecedence_t. */
+ u8 nDSCP_DropPrecedence[64];
+} GSW_QoS_DSCP_DropPrecedenceCfg_t;
+
+/** \brief Ingress DSCP remarking attribute. This attribute defines on the
+ ingress port packets how these will be remarked on the egress port.
+ A packet is only remarked in case its ingress and its egress port
+ have remarking enabled.
+ Used by \ref GSW_QoS_portRemarkingCfg_t. */
+typedef enum {
+ /** No DSCP Remarking. No remarking is done on the egress port. */
+ GSW_DSCP_REMARK_DISABLE = 0,
+ /** TC DSCP 6-Bit Remarking. The complete DSCP remarking is done based
+ on the traffic class. The traffic class to DSCP value mapping is
+ given in a device global table. */
+ GSW_DSCP_REMARK_TC6 = 1,
+ /** TC DSCP 3-Bit Remarking. The upper 3-Bits of the DSCP field are
+ remarked based on the traffic class. The traffic class to DSCP value
+ mapping is given in a device global table. */
+ GSW_DSCP_REMARK_TC3 = 2,
+ /** Drop Precedence Remarking. The Drop Precedence is remarked on the
+ egress side. */
+ GSW_DSCP_REMARK_DP3 = 3,
+ /** TC Drop Precedence Remarking. The Drop Precedence is remarked on the
+ egress side and the upper 3-Bits of the DSCP field are
+ remarked based on the traffic class. The traffic class to DSCP value
+ mapping is given in a device global table. */
+ GSW_DSCP_REMARK_DP3_TC3 = 4
+} GSW_Qos_ingressRemarking_t;
+
+/** \brief Port Remarking Configuration. Ingress and Egress remarking options for
+ dedicated packet fields DSCP, CTAG VLAN PCP, STAG VLAN PCP
+ and STAG VLAN DEI.
+ Remarking is done either on the used traffic class or the
+ drop precedence.
+ Packet field specific remarking only applies on a packet if
+ enabled on ingress and egress port.
+ Used by \ref GSW_QoS_PortRemarkingCfgSet
+ and \ref GSW_QoS_PortRemarkingCfgGet. */
+typedef struct {
+ /** Ethernet Port number (zero-based counting). The valid range is hardware
+ dependent. An error code is delivered if the selected port is not
+ available. */
+ u16 nPortId;
+ /** Ingress DSCP Remarking. Specifies on ingress side how a packet should
+ be remarked. This DSCP remarking only works in case remarking is
+ enabled on the egress port.
+ This configuration requires that remarking is also enabled on the
+ egress port. DSCP remarking enable on either ingress or egress port
+ side does not perform any remark operation. */
+ GSW_Qos_ingressRemarking_t eDSCP_IngressRemarkingEnable;
+ /** Egress DSCP Remarking. Applies remarking on egress packets in a
+ fashion as specified on the ingress port. This ingress port remarking
+ is configured by the parameter 'eDSCP_IngressRemarking'.
+ This configuration requires that remarking is also enabled on the
+ ingress port. DSCP remarking enable on either ingress or egress port
+ side does not perform any remark operation. */
+ gsw_bool_t bDSCP_EgressRemarkingEnable;
+ /** Ingress PCP Remarking. Applies remarking to all port ingress packets.
+ This configuration requires that remarking is also enabled on the
+ egress port. PCP remarking enable on either ingress or egress port
+ side does not perform any remark operation. */
+ gsw_bool_t bPCP_IngressRemarkingEnable;
+ /** Egress PCP Remarking. Applies remarking for all port egress packets.
+ This configuration requires that remarking is also enabled on the
+ ingress port. PCP remarking enable on either ingress or egress port
+ side does not perform any remark operation. */
+ gsw_bool_t bPCP_EgressRemarkingEnable;
+ /** Ingress STAG VLAN PCP Remarking */
+ gsw_bool_t bSTAG_PCP_IngressRemarkingEnable;
+ /** Ingress STAG VLAN DEI Remarking */
+ gsw_bool_t bSTAG_DEI_IngressRemarkingEnable;
+ /** Egress STAG VLAN PCP & DEI Remarking */
+ gsw_bool_t bSTAG_PCP_DEI_EgressRemarkingEnable;
+} GSW_QoS_portRemarkingCfg_t;
+
+/** \brief Describes which priority information of ingress packets is used
+ (taken into account) to identify the packet priority and the related egress
+ priority queue. For DSCP, the priority to queue assignment is done
+ using \ref GSW_QoS_DSCP_ClassSet. For VLAN, the priority to queue
+ assignment is done using \ref GSW_QoS_PCP_ClassSet.
+ Used by \ref GSW_QoS_PortCfgSet and \ref GSW_QoS_PortCfgGet. */
+typedef struct {
+ /** Ethernet Port number (zero-based counting). The valid range is hardware
+ dependent. An error code is delivered if the selected port is not
+ available. */
+ u16 nPortId;
+ /** Select the packet header field on which to base the traffic class assignment. */
+ GSW_QoS_ClassSelect_t eClassMode;
+ /** Default port priority in case no other priority
+ (such as VLAN-based PCP or IP-based DSCP) is used. */
+ u8 nTrafficClass;
+} GSW_QoS_portCfg_t;
+
+/** \brief Traffic class associated with a particular 802.1P (PCP) priority mapping value.
+ This table is global for the entire switch device. Priority map entry structure.
+ Used by \ref GSW_QoS_PCP_ClassSet
+ and \ref GSW_QoS_PCP_ClassGet. */
+typedef struct {
+ /** Configures the traffic class to PCP (3-bit) mapping.
+ The queue index starts counting from zero. */
+ u8 nPCP[16];
+} GSW_QoS_ClassPCP_Cfg_t;
+
+
+/** \brief Traffic class associated with a particular 802.1P (PCP) priority mapping value.
+ This table is global for the entire switch device. Priority map entry structure.
+ Used by \ref GSW_QoS_PCP_ClassSet
+ and \ref GSW_QoS_PCP_ClassGet. */
+typedef struct {
+ /** Configures the PCP to traffic class mapping.
+ The queue index starts counting from zero. */
+ u8 nTrafficClass[16];
+} GSW_QoS_PCP_ClassCfg_t;
+
+/** \brief Configure queue specific parameter.
+ Used by \ref GSW_QoS_QueueCfgSet and \ref GSW_QoS_QueueCfgGet. */
+typedef struct {
+ /** QoS queue index (zero-based counting). */
+ u8 nQueueId;
+ /** Enable/disable this queue. */
+ gsw_bool_t bEnable;
+ /** Redirect traffic forward port. */
+ u8 nPortId;
+} GSW_QoS_queueCfg_t;
+
+/** \brief Describes the QoS Queue Mapping Mode. GSWIP-3.1 only.
+ Used by \ref GSW_QoS_queuePort_t. */
+typedef enum {
+ /** This is default mode where the QID is fixed at
+ \ref GSW_QoS_QueuePortSet. */
+ GSW_QOS_QMAP_SINGLE_MODE = 0,
+ /** This is new mode in GSWIP-3.1. The QID given in
+ \ref GSW_QoS_QueuePortSet is base, and bit 0~3 of sub-interface ID
+ is offset. The final QID is base + SubIfId[0:3]. */
+ GSW_QOS_QMAP_SUBIFID_MODE = 1
+} GSW_QoS_qMapMode_t;
+
+/** \brief Sets the Queue ID for one traffic class of one port.
+ Used by \ref GSW_QoS_QueuePortSet and \ref GSW_QoS_QueuePortGet. */
+typedef struct {
+ /** Ethernet Port number (zero-based counting). The valid range is hardware
+ dependent. An error code is delivered if the selected port is not
+ available.
+ This is an input parameter for \ref GSW_QoS_QueuePortGet. */
+ u16 nPortId;
+ /** Forward CPU (extraction) before external QoS queueing (DownMEP).
+ GSWIP-3.1 only. */
+ gsw_bool_t bExtrationEnable;
+ /** When \ref GSW_QoS_queuePort_t::bExtrationEnable is FALSE, this field
+ defines Queue Mapping Mode. GSWIP-3.1 only. */
+ GSW_QoS_qMapMode_t eQMapMode;
+ /** Traffic Class index (zero-based counting).
+ This is an input parameter for \ref GSW_QoS_QueuePortGet. */
+ u8 nTrafficClassId;
+ /** QoS queue index (zero-based counting).
+ This is an output parameter for \ref GSW_QoS_QueuePortGet. */
+ u8 nQueueId;
+ /** Queue Redirection bypass Option.
+ If enabled, all packets destined to 'nQueueId' are redirected from the
+ 'nPortId' to 'nRedirectPortId'. This is used for 2nd stage of FULL QoS
+ Path, where the packet has completed QoS process at CBM/CQEM and been
+ injected into GSWIP again. */
+ gsw_bool_t bRedirectionBypass;
+ /** Redirected traffic forward port.
+ All egress packets to 'nPortId' are redirected to "nRedirectPortId".
+ If there is no redirection required, it should be same as "nPortId". */
+ u8 nRedirectPortId;
+
+ /** To enable Ingress PCE Bypass. Applicable for GSWIP 3.2 and above.
+ For \ref GSW_QoS_QueuePortGet, set TRUE as input to check whether
+ Ingress PCE Bypass is enabled, and this field is updated as output.
+ For \ref GSW_QoS_QueuePortSet, set FALSE to configure normal
+ path first, then set TRUE to configure Ingress PCE Bypass path
+ (only if application requires). */
+ gsw_bool_t bEnableIngressPceBypass;
+ /** Internal purpose only - user not allowed to use it.
+ Applicable for GSWIP 3.2 and above. */
+ gsw_bool_t bReservedPortMode;
+} GSW_QoS_queuePort_t;
+
+/** \brief Select the type of the Egress Queue Scheduler.
+ Used by \ref GSW_QoS_schedulerCfg_t. */
+typedef enum {
+ /** Strict Priority Scheduler (strict high). */
+ GSW_QOS_SCHEDULER_STRICT = 0,
+ /** Strict Priority Scheduler (strict high).
+ Same as \ref GSW_QOS_SCHEDULER_STRICT. */
+ GSW_QOS_SCHEDULER_STRICT_HIGH = GSW_QOS_SCHEDULER_STRICT,
+ /** Weighted Fair Queuing Shceduler. */
+ GSW_QOS_SCHEDULER_WFQ = 1,
+ /** Strict Priority Scheduler (strict low). */
+ GSW_QOS_SCHEDULER_STRICT_LOW = 2,
+} GSW_QoS_Scheduler_t;
+
+/** \brief Configures the egress queues attached to a single port, and that
+ are scheduled to transmit the queued Ethernet packets.
+ Used by \ref GSW_QoS_SchedulerCfgSet and \ref GSW_QoS_SchedulerCfgGet. */
+typedef struct {
+ /** QoS queue index (zero-based counting). */
+ u8 nQueueId;
+ /** Scheduler Type (Strict Priority/Weighted Fair Queuing).
+ Refers to \ref GSW_QoS_Scheduler_t for detail values. */
+ u8 eType;
+ /** Weight in Token. Parameter used for WFQ configuration.
+ Sets the weight in token in relation to all remaining
+ queues on this egress port having WFQ configuration.
+ This parameter is only used when 'eType=GSW_QOS_SCHEDULER_WFQ'. */
+ u16 nWeight;
+} GSW_QoS_schedulerCfg_t;
+
+/** \brief Configures a rate shaper instance with the rate and the burst size.
+ Used by \ref GSW_QoS_ShaperCfgSet and \ref GSW_QoS_ShaperCfgGet. */
+typedef struct {
+ /** Rate shaper index (zero-based counting). */
+ u8 nRateShaperId;
+ /** Enable/Disable the rate shaper. */
+ gsw_bool_t bEnable;
+ /** 802.1Qav credit based shaper mode. This specific shaper
+ algorithm mode is used by the audio/video bridging (AVB)
+ network (according to 802.1Qav). By default, an token
+ based shaper algorithm is used. */
+ gsw_bool_t bAVB;
+ /** Committed Burst Size (CBS [bytes])
\remarks
- In GSWIP-2.1/2.2/3.0, this field is used as portmap field, when the MSB
- bit is set. In portmap mode, every value bit represents an Ethernet port.
- LSB represents Port 0 with incrementing counting.
- The (MSB - 1) bit represent the last port.
- The macro \ref GSW_PORTMAP_FLAG_SET allows to set the MSB bit,
- marking it as portmap variable.
- Checking the portmap flag can be done by
- using the \ref GSW_PORTMAP_FLAG_GET macro.
- From GSWIP3.1, if MSB is set, other bits in this field are ignored.
- array \ref GSW_MAC_tableRead_t::nPortMap is used for bit map. */
- u32 nPortId;
- /** Bridge Port Map - to support GSWIP-3.1, following field is added
- for port map in static entry. It's valid only when MSB of
- \ref GSW_MAC_tableRead_t::nPortId is set. Each bit stands for 1 bridge
- port. */
- u16 nPortMap[8]; /* max can be 16 */
- /** Sub-Interface Identifier Destination (supported in GSWIP-3.0/3.1 only). */
- u16 nSubIfId;
- /** Aging Time, given in multiples of 1 second in a range from 1 s to 1,000,000 s.
- The value read back in a GET command might differ slightly from the value
- given in the SET command due to limited hardware timing resolution.
- Filled out by the switch API implementation.
- This is an output parameter. */
- int nAgeTimer;
- /** STAG VLAN Id. Only applicable in case SVLAN support is enabled on the device. */
- u16 nSVLAN_Id;
- /** Static Entry (value will be aged out after 'nAgeTimer' if the entry
- is not set to static).
- This is an output parameter. */
- gsw_bool_t bStaticEntry;
- /** Source/Destination MAC address filtering flag (GSWIP-3.1 only)
- Value 0 - not filter, 1 - source address filter,
- 2 - destination address filter, 3 - both source and destination filter.
+ Range 64B~4GB. Only most 10 significant bits are effective.
+ Value is rounded up to HW boundary.
+ If value is less than 64, default value 32KB is used. */
+ u32 nCbs;
+ /** Rate [kbit/s] */
+ u32 nRate;
+} GSW_QoS_ShaperCfg_t;
+
+/** \brief Assign one rate shaper instance to a QoS queue.
+ Used by \ref GSW_QoS_ShaperQueueAssign and \ref GSW_QoS_ShaperQueueDeassign. */
+typedef struct {
+ /** Rate shaper index (zero-based counting). */
+ u8 nRateShaperId;
+ /** QoS queue index (zero-based counting). */
+ u8 nQueueId;
+} GSW_QoS_ShaperQueue_t;
+
+/** \brief Retrieve if a rate shaper instance is assigned to a QoS egress queue.
+ Used by \ref GSW_QoS_ShaperQueueGet. */
+typedef struct {
+ /** QoS queue index (zero-based counting).
+ This parameter is the input parameter for the GET function. */
+ u8 nQueueId;
+ /** Shaper instances (max 2) associated with queue. */
+ struct {
+ /** Rate shaper instance assigned.
+ If 1, a rate shaper instance is assigned to the queue. Otherwise no shaper instance is assigned. */
+ gsw_bool_t bAssigned;
+ /** Rate shaper index (zero-based counting). Only a valid instance is returned in case 'bAssigned == 1'. */
+ u8 nRateShaperId;
+ } sShaper[2];
+} GSW_QoS_ShaperQueueGet_t;
+
+/** \brief Assigns one meter instances for storm control.
+ Used by \ref GSW_QoS_StormCfgSet and \ref GSW_QoS_StormCfgGet.
+ Not applicable to GSWIP-3.1. */
+typedef struct {
+ /** Meter index 0 (zero-based counting). */
+ u16 nMeterId;
+ /** Meter instances used for broadcast traffic. */
+ gsw_bool_t bBroadcast;
+ /** Meter instances used for multicast traffic. */
+ gsw_bool_t bMulticast;
+ /** Meter instances used for unknown unicast traffic. */
+ gsw_bool_t bUnknownUnicast;
+} GSW_QoS_stormCfg_t;
+
+/** \brief Egress Queue Congestion Notification Watermark.
+ Used by \ref GSW_QoS_WRED_Cfg_t. */
+typedef enum {
+ /**
+ >= 1/4 of green max water mark assert
+ <= 1/4 of green max water mark de assert*/
+ GSW_QOS_WRED_WATERMARK_1_4 = 0,
+ /**
+ >= 1/8 of green max water mark assert
+ <= 1/8 of green max water mark de assert*/
+ GSW_QOS_WRED_WATERMARK_1_8 = 1,
+ /**
+ >= 1/12 of green max water mark assert
+ <= 1/12 of green max water mark de assert*/
+ GSW_QOS_WRED_WATERMARK_1_12 = 2,
+ /**
+ >= 1/16 of green max water mark assert
+ <= 1/16 of green max water mark de assert*/
+ GSW_QOS_WRED_WATERMARK_1_16 = 3
+} GSW_QoS_WRED_WATERMARK_t;
+
+/** \brief Drop Probability Profile. Defines the drop probability profile.
+ Used by \ref GSW_QoS_WRED_Cfg_t. */
+typedef enum {
+ /** Pmin = 25%, Pmax = 75% (default) */
+ GSW_QOS_WRED_PROFILE_P0 = 0,
+ /** Pmin = 25%, Pmax = 50% */
+ GSW_QOS_WRED_PROFILE_P1 = 1,
+ /** Pmin = 50%, Pmax = 50% */
+ GSW_QOS_WRED_PROFILE_P2 = 2,
+ /** Pmin = 50%, Pmax = 75% */
+ GSW_QOS_WRED_PROFILE_P3 = 3
+} GSW_QoS_WRED_Profile_t;
+
+/** \brief WRED Cfg Type - Automatic (Adaptive) or Manual.
+ Used by \ref GSW_QoS_WRED_Cfg_t. */
+typedef enum {
+ /** Automatic - Adaptive Watermark Type - GSWIP-3.0/3.1 only*/
+ GSW_QOS_WRED_Adaptive = 0,
+ /** Manual Threshold Levels Type */
+ GSW_QOS_WRED_Manual = 1
+} GSW_QoS_WRED_Mode_t;
+
+/** \brief WRED Thresholds Mode Type. - GSWIP-3.0/3.1 only
+ Used by \ref GSW_QoS_WRED_Cfg_t. */
+typedef enum {
+ /** Local Thresholds Mode */
+ GSW_QOS_WRED_Local_Thresh = 0,
+ /** Global Thresholds Mode */
+ GSW_QOS_WRED_Global_Thresh = 1,
+ /** Port queue and Port WRED Thresholds */
+ GSW_QOS_WRED_Port_Thresh = 2,
+
+} GSW_QoS_WRED_ThreshMode_t;
+
+/** \brief Configures the global probability profile of the device.
+ The min. and max. threshold values are given in number of packet
+ buffer segments and required only in case of Manual Mode.
+ The GSWIP-3.0/3.1 supports Auto mode and the threshold values are
+ dynamically computed internally by GSWIP.
+ The size of a segment can be retrieved using \ref GSW_CapGet.
+ Used by \ref GSW_QoS_WredCfgSet and \ref GSW_QoS_WredCfgGet. */
+typedef struct {
+ /** Egress Queue Congestion Notification Watermark
+ only applicable for GSWIP 3.1*/
+ GSW_QoS_WRED_WATERMARK_t eCongestionWatermark;
+ /** Drop Probability Profile. */
+ GSW_QoS_WRED_Profile_t eProfile;
+ /** Automatic or Manual Mode of Thresholds Config */
+ GSW_QoS_WRED_Mode_t eMode;
+ /** WRED Threshold Mode Config */
+ GSW_QoS_WRED_ThreshMode_t eThreshMode;
+ /** WRED Red Threshold Min [number of segments] - Valid for Manual Mode only. */
+ u16 nRed_Min;
+ /** WRED Red Threshold Max [number of segments] - Valid for Manual Mode only */
+ u16 nRed_Max;
+ /** WRED Yellow Threshold Min [number of segments] - Valid for Manual Mode only */
+ u16 nYellow_Min;
+ /** WRED Yellow Threshold Max [number of segments] - Valid for Manual Mode only */
+ u16 nYellow_Max;
+ /** WRED Green Threshold Min [number of segments] - Valid for Manual Mode only */
+ u16 nGreen_Min;
+ /** WRED Green Threshold Max [number of segments] - Valid for Manual Mode only */
+ u16 nGreen_Max;
+} GSW_QoS_WRED_Cfg_t;
+
+/** \brief Configures the WRED threshold level values.
+ The min. and max. values are given in number of packet
+ buffer segments. The size of a segment can be retrieved using \ref GSW_CapGet.
+ Used by \ref GSW_QoS_WredQueueCfgSet and \ref GSW_QoS_WredQueueCfgGet. */
+typedef struct {
+ /** QoS queue index (zero-based counting). */
+ u16 nQueueId;
+ /** WRED Red Threshold Min [number of segments]. */
+ u16 nRed_Min;
+ /** WRED Red Threshold Max [number of segments]. */
+ u16 nRed_Max;
+ /** WRED Yellow Threshold Min [number of segments]. */
+ u16 nYellow_Min;
+ /** WRED Yellow Threshold Max [number of segments]. */
+ u16 nYellow_Max;
+ /** WRED Green Threshold Min [number of segments]. */
+ u16 nGreen_Min;
+ /** WRED Green Threshold Max [number of segments]. */
+ u16 nGreen_Max;
+ /** Reserved Buffer Threshold */
+ u16 nReserveThreshold;
+} GSW_QoS_WRED_QueueCfg_t;
+
+/** \brief Configures the WRED threshold parameter per port.
+ The configured thresholds apply to fill level sum
+ of all egress queues which are assigned to the egress port.
+ The min. and max. values are given in number of packet
+ buffer segments. The size of a segment can be retrieved using \ref GSW_CapGet.
+ Used by \ref GSW_QoS_WredPortCfgSet and \ref GSW_QoS_WredPortCfgGet. */
+typedef struct {
+ /** Ethernet Port number (zero-based counting).
+ The valid range is hardware dependent. */
+ u16 nPortId;
+ /** WRED Red Threshold Min [number of segments]. */
+ u16 nRed_Min;
+ /** WRED Red Threshold Max [number of segments]. */
+ u16 nRed_Max;
+ /** WRED Yellow Threshold Min [number of segments]. */
+ u16 nYellow_Min;
+ /** WRED Yellow Threshold Max [number of segments]. */
+ u16 nYellow_Max;
+ /** WRED Green Threshold Min [number of segments]. */
+ u16 nGreen_Min;
+ /** WRED Green Threshold Max [number of segments]. */
+ u16 nGreen_Max;
+} GSW_QoS_WRED_PortCfg_t;
+
+/** \brief Configures the global buffer flow control threshold for
+ conforming and non-conforming packets.
+ The min. and max. values are given in number of packet
+ buffer segments. The size of a segment can be retrieved using \ref GSW_CapGet.
+ Used by \ref GSW_QoS_FlowctrlCfgSet and \ref GSW_QoS_FlowctrlCfgGet. */
+typedef struct {
+ /** Global Buffer Non Conforming Flow Control Threshold Minimum [number of segments]. */
+ u16 nFlowCtrlNonConform_Min;
+ /** Global Buffer Non Conforming Flow Control Threshold Maximum [number of segments]. */
+ u16 nFlowCtrlNonConform_Max;
+ /** Global Buffer Conforming Flow Control Threshold Minimum [number of segments]. */
+ u16 nFlowCtrlConform_Min;
+ /** Global Buffer Conforming Flow Control Threshold Maximum [number of segments]. */
+ u16 nFlowCtrlConform_Max;
+} GSW_QoS_FlowCtrlCfg_t;
+
+/** \brief Configures the ingress port flow control threshold for
+ used packet segments.
+ The min. and max. values are given in number of packet
+ buffer segments. The size of a segment can be retrieved using \ref GSW_CapGet.
+ Used by \ref GSW_QoS_FlowctrlPortCfgSet and \ref GSW_QoS_FlowctrlPortCfgGet. */
+typedef struct {
+ /** Ethernet Port number (zero-based counting).
+ The valid range is hardware dependent. */
+ u16 nPortId;
+ /** Ingress Port occupied Buffer Flow Control Threshold Minimum [number of segments]. */
+ u16 nFlowCtrl_Min;
+ /** Ingress Port occupied Buffer Flow Control Threshold Maximum [number of segments]. */
+ u16 nFlowCtrl_Max;
+} GSW_QoS_FlowCtrlPortCfg_t;
- \remarks
- Please refer to "GSWIP Hardware Architecture Spec" chapter 3.4.4.6
- "Source MAC Address Filtering and Destination MAC Address Filtering"
- for more detail. */
- u8 nFilterFlag;
- /** Packet is marked as IGMP controlled if destination MAC address matches
- MAC in this entry. (GSWIP-3.1 only) */
- gsw_bool_t bIgmpControlled;
- /** Changed
- 0: the entry is not changed
- 1: the entry is changed and not accessed yet */
- gsw_bool_t bEntryChanged;
- /** Associated Mac address -(GSWIP-3.2)*/
- u8 nAssociatedMAC[GSW_MAC_ADDR_LEN];
+/** \brief Reserved egress queue buffer segments.
+ Used by \ref GSW_QoS_QueueBufferReserveCfgSet and \ref GSW_QoS_QueueBufferReserveCfgGet. */
+typedef struct {
+ /** QoS queue index (zero-based counting).
+ This is an input parameter for \ref GSW_QoS_QueueBufferReserveCfgGet. */
+ u16 nQueueId;
+ /** Reserved Buffer Segment Threshold [number of segments].
+ This is an output parameter for \ref GSW_QoS_QueueBufferReserveCfgGet. */
+ u16 nBufferReserved;
+} GSW_QoS_QueueBufferReserveCfg_t;
- /* MAC Table Hit Status Update (Supported in GSWip-3.1/3.2) */
- gsw_bool_t hitstatus;
- /** TCI for (GSWIP-3.2) B-Step
- Bit [0:11] - VLAN ID
- Bit [12] - VLAN CFI/DEI
- Bit [13:15] - VLAN PRI */
- u16 nTci;
- /** first bridge port ID (supported in GSWIP-3.3only) */
- u16 nFirstBridgePortId;
-} GSW_MAC_tableQuery_t;
+/** \brief Color Marking Table.
+ There are standards to define the marking table. User should use
+ \ref GSW_QOS_ColorMarkingTableSet to initialize the table before color
+ marking happens. \ref GSW_QOS_ColorMarkingTableGet is used to get
+ the marking table, mainly for debug purpose. */
+typedef struct {
+ /** Mode of color marking. */
+ GSW_ColorMarkingMode_t eMode;
-/** \brief MAC Table Entry to be removed.
- Used by \ref GSW_MAC_TABLE_ENTRY_REMOVE. */
+ /** If eMode is GSW_REMARKING_DSCP_AF, index stands for 6-bit DSCP value.
+ If eMode is one of GSW_REMARKING_PCP_8P0D, GSW_REMARKING_PCP_7P1D,
+ GSW_REMARKING_PCP_6P2D and GSW_REMARKING_PCP_5P3D, index 0-7 is
+ 3-bit PCP value with DEI is 0, and index 8-15 is 3-bit PCP value with
+ DEI is 1. Ignored in other modes. */
+ u8 nPriority[64];
+ /** If eMode is GSW_REMARKING_DSCP_AF, index stands for 6-bit DSCP value.
+ If eMode is one of GSW_REMARKING_PCP_8P0D, GSW_REMARKING_PCP_7P1D,
+ GSW_REMARKING_PCP_6P2D and GSW_REMARKING_PCP_5P3D, index 0-7 is 3-bit
+ PCP value with DEI is 0, and index 8-15 is 3-bit PCP value with DEI is 1.
+ Ignored in other modes.
+ Value refers to \ref GSW_QoS_DropPrecedence_t. */
+ u8 nColor[64];
+} GSW_QoS_colorMarkingEntry_t;
+
+/** \brief Color Remarking Table.
+ There are standards to define the remarking table. User should use
+ \ref GSW_QOS_ColorReMarkingTableSet to initialize the table before color
+ remarking happens. \ref GSW_QOS_ColorReMarkingTableGet is used to get
+ the remarking table, mainly for debug purpose. */
typedef struct {
- /** Filtering Identifier (FID) (not supported by all switches) */
- u16 nFId;
- /** MAC Address to be removed from the table. */
- u8 nMAC[GSW_MAC_ADDR_LEN];
- /** Source/Destination MAC address filtering flag (GSWIP-3.1 only)
- Value 0 - not filter, 1 - source address filter,
- 2 - destination address filter, 3 - both source and destination filter.
+ /** Mode of color remarking. */
+ GSW_ColorRemarkingMode_t eMode;
- \remarks
- Please refer to "GSWIP Hardware Architecture Spec" chapter 3.4.4.6
- "Source MAC Address Filtering and Destination MAC Address Filtering"
- for more detail. */
- u8 nFilterFlag;
- /** TCI for (GSWIP-3.2) B-Step
- Bit [0:11] - VLAN ID
- Bit [12] - VLAN CFI/DEI
- Bit [13:15] - VLAN PRI */
- u16 nTci;
-} GSW_MAC_tableRemove_t;
+ /** Index stands for color and priority. Index 0-7 is green color with
+ priority (traffic class) 0-7. Index 8-15 is yellow color with priority
+ (traffic class) 0-7. Value is DSCP if eMode is GSW_REMARKING_DSCP_AF.
+ Value bit 0 is DEI and bit 1-3 is PCP if eMode is one of
+ GSW_REMARKING_PCP_8P0D, GSW_REMARKING_PCP_7P1D, GSW_REMARKING_PCP_6P2D
+ and GSW_REMARKING_PCP_5P3D. Value is ignored for other mode. */
+ u8 nVal[16];
+} GSW_QoS_colorRemarkingEntry_t;
-/** \brief MAC Address Filter Type.
- Used by \ref GSW_MACFILTER_default_t */
-typedef enum {
- /** Source MAC Address Filter */
- GSW_MACFILTERTYPE_SRC = 0,
- /** Destination MAC Address Filter */
- GSW_MACFILTERTYPE_DEST = 1
-} GSW_MacFilterType_t;
+/** \brief DSCP to PCP Mapping.
+ Used by \ref GSW_QOS_Dscp2PcpTableGet. */
+typedef struct {
+ /** Index of entry in mapping table. */
+ u16 nIndex;
-/** \brief Default MAC Address Filter.
- Used by \ref GSW_DEFAUL_MAC_FILTER_SET and \ref GSW_DEFAUL_MAC_FILTER_GET */
+ /** The index of array stands for DSCP value. Each byte of the array is 3-bit
+ PCP value. */
+ u8 nMap[64];
+} GSW_DSCP2PCP_map_t;
+
+/** \brief Traffic class associated with a particular STAG VLAN 802.1P (PCP) priority and Drop Eligible Indicator (DEI) mapping value.
+ This table is global for the entire switch device. Priority map entry structure.
+ The table index value is calculated by 'index=PCP + 8*DEI'
+ Used by \ref GSW_QoS_SVLAN_PCP_ClassSet and \ref GSW_QoS_SVLAN_PCP_ClassGet. */
typedef struct {
- /** MAC Filter Type */
- GSW_MacFilterType_t eType;
+ /** Configures the PCP and DEI to traffic class mapping.
+ The queue index starts counting from zero. */
+ u8 nTrafficClass[16];
+ /** Configures the PCP traffic color.
+ Not applicable to GSWIP-3.1. */
+ u8 nTrafficColor[16];
+ /** PCP Remark disable control.
+ Not applicable to GSWIP-3.1. */
+ u8 nPCP_Remark_Enable[16];
+ /** DEI Remark disable control.
+ Not applicable to GSWIP-3.1. */
+ u8 nDEI_Remark_Enable[16];
- /** Destination bridge port map. For GSWIP-3.1 only.
+} GSW_QoS_SVLAN_PCP_ClassCfg_t;
- \remarks
- Each bit stands for 1 bridge port. For PRX300 (GSWIP-3.1 integrated),
- only index 0-7 is valid. */
- u16 nPortmap[8]; /* max can be 16 */
-} GSW_MACFILTER_default_t;
+/** @}*/ /* GSW_QoS_SVC */
+
+
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
+
+/** \brief Enumeration used for Switch capability types. GSWIP-3.0 only capabilities are explicitly indicated.
+ Used by \ref GSW_cap_t. */
+typedef enum {
+ /** Number of physical Ethernet ports. */
+ GSW_CAP_TYPE_PORT = 0,
+ /** Number of virtual Ethernet ports. */
+ GSW_CAP_TYPE_VIRTUAL_PORT = 1,
+ /** Size of internal packet memory [in Bytes]. */
+ GSW_CAP_TYPE_BUFFER_SIZE = 2,
+ /** Buffer segment size.
+ Byte size of a segment, used to store received packet data. */
+ GSW_CAP_TYPE_SEGMENT_SIZE = 3,
+ /** Number of priority queues per device. */
+ GSW_CAP_TYPE_PRIORITY_QUEUE = 4,
+ /** Number of meter instances. */
+ GSW_CAP_TYPE_METER = 5,
+ /** Number of rate shaper instances. */
+ GSW_CAP_TYPE_RATE_SHAPER = 6,
+ /** Number of CTAG VLAN groups that can be configured on the switch hardware. */
+ GSW_CAP_TYPE_VLAN_GROUP = 7,
+ /** Number of Filtering Identifiers (FIDs) */
+ GSW_CAP_TYPE_FID = 8,
+ /** Number of MAC Bridging table entries */
+ GSW_CAP_TYPE_MAC_TABLE_SIZE = 9,
+ /** Number of multicast level 3 hardware table entries */
+ GSW_CAP_TYPE_MULTICAST_TABLE_SIZE = 10,
+ /** Number of supported PPPoE sessions. */
+ GSW_CAP_TYPE_PPPOE_SESSION = 11,
+ /** Number of STAG VLAN groups that can be configured on the switch hardware. */
+ GSW_CAP_TYPE_SVLAN_GROUP = 12,
+ /** Number of PMAC Supported in Switch Macro - for GSWIP-3.0 only. */
+ GSW_CAP_TYPE_PMAC = 13,
+ /** Number of entries in Payload Table size - for GSWIP-3.0 only. */
+ GSW_CAP_TYPE_PAYLOAD = 14,
+ /** Number of RMON Counters Supported - for GSWIP-3.0 only. */
+ GSW_CAP_TYPE_IF_RMON = 15,
+ /** Number of Egress VLAN Treatment Entries - for GSWIP-3.0 only. */
+ GSW_CAP_TYPE_EGRESS_VLAN = 16,
+ /** Number of Routing Source-MAC Entries - for GSWIP-R-3.0 only. */
+ GSW_CAP_TYPE_RT_SMAC = 17,
+ /** Number of Routing Destination-MAC Entries - for GSWIP-R-3.0 only. */
+ GSW_CAP_TYPE_RT_DMAC = 18,
+ /** Number of Routing-PPPoE Entries - for GSWIP-R-3.0 only. */
+ GSW_CAP_TYPE_RT_PPPoE = 19,
+ /** Number of Routing-NAT Entries - for GSWIP-R-3.0 only. */
+ GSW_CAP_TYPE_RT_NAT = 20,
+ /** Number of MTU Entries - for GSWIP-R-3.0 only. */
+ GSW_CAP_TYPE_RT_MTU = 21,
+ /** Number of Tunnel Entries - for GSWIP-R-3.0 only. */
+ GSW_CAP_TYPE_RT_TUNNEL = 22,
+ /** Number of RTP Entries - for GSWIP-R-3.0 only. */
+ GSW_CAP_TYPE_RT_RTP = 23,
+ /** Number of CTP ports - for GSWIP-3.1 only. */
+ GSW_CAP_TYPE_CTP = 24,
+ /** Number of bridge ports - for GSWIP-3.1 only. */
+ GSW_CAP_TYPE_BRIDGE_PORT = 25,
+ /** Number of COMMON PCE Rules. */
+ GSW_CAP_TYPE_COMMON_PCE_RULES = 26,
+ /** 3.2 Revision (A0 or B0) */
+ GSW_CAP_TYPE_32_VERSION = 27,
+ /** Last Capability Index */
+ GSW_CAP_TYPE_LAST = 28
+} GSW_capType_t;
+
+/** \brief Maximum String Length for the Capability String. */
+#define GSW_CAP_STRING_LEN 128
+
+/** \brief Capability structure.
+ Used by \ref GSW_CapGet. */
+typedef struct {
+ /** Defines the capability type, see \ref GSW_capType_t.*/
+ GSW_capType_t nCapType;
+ /** Description of the capability. */
+ char cDesc[GSW_CAP_STRING_LEN];
+ /** Defines if, what or how many are available. The definition of cap
+ depends on the type, see captype. */
+ u32 nCap;
+} GSW_cap_t;
/** \brief Aging Timer Value.
Used by \ref GSW_cfg_t. */
@@ -1900,11 +2178,23 @@
GSW_AGETIMER_CUSTOM = 6
} GSW_ageTimer_t;
+/** @}*/ /* GSW_ETHERNET_BRIDGING */
+
+
-// #ifdef CONFIG_GSWIP_EVLAN
+/** \addtogroup GSW_VLAN
+ * @{
+ */
+
+/** \brief Extended 4 TPID selection.
+ Used by \ref GSW_EXTENDEDVLAN_filter_t. */
typedef enum {
+ /** TPID is FDMA_VTETYPE (0x88A8 by default) */
GSW_EXTENDEDVLAN_TPID_VTETYPE_1 = 0,
+ /** TPID is 0x8100 */
GSW_EXTENDEDVLAN_TPID_VTETYPE_2 = 1,
+ /** TPID is FDMA_VTETYPE2 (0x9100 by default) */
GSW_EXTENDEDVLAN_TPID_VTETYPE_3 = 2,
+ /** TPID is FDMA_VTETYPE3 (0x9200 by default) */
GSW_EXTENDEDVLAN_TPID_VTETYPE_4 = 3
} GSW_ExtendedVlan_4_Tpid_Mode_t;
@@ -2025,8 +2315,10 @@
GSW_EXTENDEDVLAN_TREATMENT_REMOVE_1_TAG = 1,
/** Remove 2 VLAN tag following DA/SA. */
GSW_EXTENDEDVLAN_TREATMENT_REMOVE_2_TAG = 2,
+ /** Discard traffic. */
+ GSW_EXTENDEDVLAN_TREATMENT_DISCARD = 3,
/** Discard upstream traffic. */
- GSW_EXTENDEDVLAN_TREATMENT_DISCARD_UPSTREAM = 3,
+ GSW_EXTENDEDVLAN_TREATMENT_DISCARD_UPSTREAM = GSW_EXTENDEDVLAN_TREATMENT_DISCARD,
} GSW_ExtendedVlanTreatmentRemoveTag_t;
/** \brief Extended VLAN Filter VLAN Tag.
@@ -2075,6 +2367,7 @@
typedef struct {
/** Filter on Original Packet. */
gsw_bool_t bOriginalPacketFilterMode;
+ /** 4 TPID support. */
GSW_ExtendedVlan_4_Tpid_Mode_t eFilter_4_Tpid_Mode;
/** Filter for outer VLAN tag. */
GSW_EXTENDEDVLAN_filterVLAN_t sOuterVlan;
@@ -2086,17 +2379,17 @@
/** \brief Extended VLAN Allocation.
- Used by \ref GSW_EXTENDEDVLAN_ALLOC and \ref GSW_EXTENDEDVLAN_FREE. */
+ Used by \ref GSW_ExtendedVlanAlloc and \ref GSW_ExtendedVlanFree. */
typedef struct {
/** Total number of extended VLAN entries are requested. Proper value should
- be given for \ref GSW_EXTENDEDVLAN_ALLOC. This field is ignored for
- \ref GSW_EXTENDEDVLAN_FREE. */
+ be given for \ref GSW_ExtendedVlanAlloc. This field is ignored for
+ \ref GSW_ExtendedVlanFree. */
u16 nNumberOfEntries;
- /** If \ref GSW_EXTENDEDVLAN_ALLOC is successful, a valid ID will be returned
+ /** If \ref GSW_ExtendedVlanAlloc is successful, a valid ID will be returned
in this field. Otherwise, \ref INVALID_HANDLE is returned in this field.
- For \ref GSW_EXTENDEDVLAN_FREE, this field should be valid ID returned by
- \ref GSW_EXTENDEDVLAN_ALLOC. */
+ For \ref GSW_ExtendedVlanFree, this field should be valid ID returned by
+ \ref GSW_ExtendedVlanAlloc. */
u16 nExtendedVlanBlockId;
} GSW_EXTENDEDVLAN_alloc_t;
@@ -2106,6 +2399,7 @@
/** Number of VLAN tag(s) to remove. */
GSW_ExtendedVlanTreatmentRemoveTag_t eRemoveTag;
+ /** 4 TPID support */
GSW_ExtendedVlan_4_Tpid_Mode_t eTreatment_4_Tpid_Mode;
/** Enable outer VLAN tag add/modification. */
@@ -2138,15 +2432,15 @@
/** New meter ID.
\remarks
- Meter should be allocated with \ref GSW_QOS_METER_ALLOC before extended
+ Meter should be allocated with \ref GSW_QOS_MeterAlloc before extended
VLAN treatment is added. If this extended VLAN treatment is deleted,
- this meter should be released with \ref GSW_QOS_METER_FREE. */
+ this meter should be released with \ref GSW_QOS_MeterFree. */
u16 sNewTrafficMeterId;
/** DSCP to PCP mapping, if
\ref GSW_EXTENDEDVLAN_treatmentVlan_t::ePriorityMode in
- \ref GSW_EXTENDEDVLAN_treatment_t::sOuterVlan.ePriorityMode or
- \ref GSW_EXTENDEDVLAN_treatment_t::sInnerVlan.ePriorityMode is
+ \ref GSW_EXTENDEDVLAN_treatment_t::sOuterVlan or
+ \ref GSW_EXTENDEDVLAN_treatment_t::sInnerVlan is
\ref GSW_EXTENDEDVLAN_TREATMENT_DSCP.
\remarks
@@ -2155,7 +2449,7 @@
a resource management mechanism should be implemented. Allocation happens
when extended VLAN treatment added, and release happens when the
treatment is deleted. For debug, the DSCP2PCP table can be dumped with
- \ref GSW_DSCP2PCP_MAP_GET. */
+ \ref GSW_QOS_Dscp2PcpTableGet. */
u8 nDscp2PcpMap[64];
/** Enable loopback. */
@@ -2167,9 +2461,9 @@
} GSW_EXTENDEDVLAN_treatment_t;
/** \brief Extended VLAN Configuration.
- Used by \ref GSW_EXTENDEDVLAN_SET and \ref GSW_EXTENDEDVLAN_GET. */
+ Used by \ref GSW_ExtendedVlanSet and \ref GSW_ExtendedVlanGet. */
typedef struct {
- /** This should be valid ID returned by \ref GSW_EXTENDEDVLAN_ALLOC.
+ /** This should be valid ID returned by \ref GSW_ExtendedVlanAlloc.
If it is \ref INVALID_HANDLE, \ref GSW_EXTENDEDVLAN_config_t::nEntryIndex
is absolute index of Extended VLAN entry in hardware for debug purpose,
bypassing any check. */
@@ -2177,7 +2471,7 @@
/** Index of entry, ranges between 0 and
\ref GSW_EXTENDEDVLAN_alloc_t::nNumberOfEntries - 1, to
- set (\ref GSW_EXTENDEDVLAN_SET) or get (\ref GSW_EXTENDEDVLAN_GET)
+ set (\ref GSW_ExtendedVlanSet) or get (\ref GSW_ExtendedVlanGet)
Extended VLAN Configuration entry. For debug purpose, this field could be
absolute index of Entended VLAN entry in hardware, when
\ref GSW_EXTENDEDVLAN_config_t::nExtendedVlanBlockId is
@@ -2191,17 +2485,17 @@
} GSW_EXTENDEDVLAN_config_t;
/** \brief VLAN Filter Allocation.
- Used by \ref GSW_VLANFILTER_ALLOC and \ref GSW_VLANFILTER_FREE. */
+ Used by \ref GSW_VlanFilterAlloc and \ref GSW_VlanFilterFree. */
typedef struct {
/** Total number of VLAN Filter entries are requested. Proper value should
- be given for \ref GSW_VLANFILTER_ALLOC. This field is ignored for
- \ref GSW_VLANFILTER_FREE. */
+ be given for \ref GSW_VlanFilterAlloc. This field is ignored for
+ \ref GSW_VlanFilterFree. */
u16 nNumberOfEntries;
- /** If \ref GSW_VLANFILTER_ALLOC is successful, a valid ID will be returned
+ /** If \ref GSW_VlanFilterAlloc is successful, a valid ID will be returned
in this field. Otherwise, \ref INVALID_HANDLE is returned in this field.
- For \ref GSW_EXTENDEDVLAN_FREE, this field should be valid ID returned by
- \ref GSW_VLANFILTER_ALLOC. */
+ For \ref GSW_ExtendedVlanFree, this field should be valid ID returned by
+ \ref GSW_VlanFilterAlloc. */
u16 nVlanFilterBlockId;
/** Discard packet without VLAN tag. */
@@ -2216,9 +2510,9 @@
} GSW_VLANFILTER_alloc_t;
/** \brief VLAN Filter.
- Used by \ref GSW_VLANFILTER_SET and \ref GSW_VLANFILTER_GET */
+ Used by \ref GSW_VlanFilterSet and \ref GSW_VlanFilterGet */
typedef struct {
- /** This should be valid ID return by \ref GSW_VLANFILTER_ALLOC.
+ /** This should be valid ID return by \ref GSW_VlanFilterAlloc.
If it is \ref INVALID_HANDLE, \ref GSW_VLANFILTER_config_t::nEntryIndex
is absolute index of VLAN Filter entry in hardware for debug purpose,
bypassing any check. */
@@ -2226,7 +2520,7 @@
/** Index of entry. ranges between 0 and
\ref GSW_VLANFILTER_alloc_t::nNumberOfEntries - 1, to
- set (\ref GSW_VLANFILTER_SET) or get (\ref GSW_VLANFILTER_GET)
+ set (\ref GSW_VlanFilterSet) or get (\ref GSW_VlanFilterGet)
VLAN FIlter entry. For debug purpose, this field could be absolute index
of VLAN Filter entry in hardware, when
\ref GSW_VLANFILTER_config_t::nVlanFilterBlockId is
@@ -2250,40 +2544,54 @@
gsw_bool_t bDiscardMatched;
} GSW_VLANFILTER_config_t;
-/* VLAN Rmon Counters */
+/** VLAN Rmon Counters */
typedef enum {
+ /** VLAN Rx Counters */
GSW_VLAN_RMON_RX = 0,
+ /** VLAN Tx Counters */
GSW_VLAN_RMON_TX = 1,
- GSW_VLAN_RMON__PCE_BYPASS = 2,
+ /** VLAN Tx Counters on PCE Bypass Path */
+ GSW_VLAN_RMON_PCE_BYPASS = 2,
} GSW_VlanRMON_Type_t;
/**
\brief RMON Counters structure for VLAN. */
typedef struct {
- u16 nVlanCounterIndex;
+ /** VLAN counter index */
+ u16 nVlanCounterIndex;
+ /** VLAN counter type (Rx, Tx, Tx PCE Bypass) */
GSW_VlanRMON_Type_t eVlanRmonType;
- u32 nByteCountHigh;
- u32 nByteCountLow;
- u32 nTotalPktCount;
- u32 nMulticastPktCount;
- u32 nDropPktCount;
+ /** VLAN byte counter */
+ u64 nByteCount;
+ /** VLAN total packet counter */
+ u32 nTotalPktCount;
+ /** VLAN mutlicast packet counter */
+ u32 nMulticastPktCount;
+ /** VLAN drop packet counter */
+ u32 nDropPktCount;
+ /** Clear all VLAN counters.
+ * Used by \ref GSW_Vlan_RMON_Clear.
+ */
u32 clear_all;
} GSW_VLAN_RMON_cnt_t;
/**
\brief RMON Counters control structure for VLAN. */
typedef struct {
- gsw_bool_t bVlanRmonEnable;
- gsw_bool_t bIncludeBroadCastPktCounting;
- u32 nVlanLastEntry;
+ /** enable VLAN counters */
+ gsw_bool_t bVlanRmonEnable;
+ /** count broadcast packet in VLAN multicast packet counter */
+ gsw_bool_t bIncludeBroadCastPktCounting;
+ /** index of the last valid entry in VLAN mapping table */
+ u32 nVlanLastEntry;
} GSW_VLAN_RMON_control_t;
/** \brief VLAN Counter Mapping. */
typedef enum {
/** VLAN Mapping for Ingress */
- GSW_VLAN_MAPPING_INGRESS = 0,
+ GSW_VLAN_MAPPING_INGRESS = 0,
/** VLAN Mapping for Egress */
- GSW_VLAN_MAPPING_EGRESS = 1,
+ GSW_VLAN_MAPPING_EGRESS = 1,
/** VLAN Mapping for Ingress and Egress */
GSW_VLAN_MAPPING_INGRESS_AND_EGRESS = 2
} GSW_VlanCounterMappingType_t;
@@ -2323,10 +2631,16 @@
/** VLAN Counter Mapping Filter Type */
GSW_VlanCounterMapFilterType_t eVlanCounterMappingFilterType;
} GSW_VlanCounterMapping_config_t;
-// #endif
+
+/** @}*/ /* GSW_VLAN */
+
+
+/** \addtogroup GSW_MULTICAST
+ * @{
+ */
/** \brief Add an Ethernet port as router port to the switch hardware multicast table.
- Used by \ref GSW_MULTICAST_ROUTER_PORT_ADD and \ref GSW_MULTICAST_ROUTER_PORT_REMOVE. */
+ Used by \ref GSW_MulticastRouterPortAdd and \ref GSW_MulticastRouterPortRemove. */
typedef struct {
/** Bridge Port ID. The valid range is hardware dependent.
An error code is delivered if the selected port is not available.
@@ -2344,7 +2658,7 @@
} GSW_multicastRouter_t;
/** \brief Check if a port has been selected as a router port.
- Used by \ref GSW_MULTICAST_ROUTER_PORT_READ. Not applicable to GSWIP-3.1. */
+ Used by \ref GSW_MulticastRouterPortRead. Not applicable to GSWIP-3.1. */
typedef struct {
/** Restart the get operation from the start of the table. Otherwise
return the next table entry (next to the entry that was returned
@@ -2379,98 +2693,174 @@
GSW_MULTICAST_SNOOP_MODE_FORWARD = 2
} GSW_multicastSnoopMode_t;
-/** \brief Packet forwarding.
- Used by \ref GSW_STP_BPDU_Rule_t and \ref GSW_multicastSnoopCfg_t
- and \ref GSW_8021X_EAPOL_Rule_t. */
+/** \brief Configure the IGMP report suppression mode.
+ Used by \ref GSW_multicastSnoopCfg_t. */
typedef enum {
- /** Default; portmap is determined by the forwarding classification. */
- GSW_PORT_FORWARD_DEFAULT = 0,
- /** Discard; discard packets. */
- GSW_PORT_FORWARD_DISCARD = 1,
- /** Forward to the CPU port. This requires that the CPU port is previously
- set by calling \ref GSW_CPU_PORT_CFG_SET. */
- GSW_PORT_FORWARD_CPU = 2,
- /** Forward to a port, selected by the parameter 'nForwardPortId'.
- Please note that this feature is not supported by all
- hardware platforms. */
- GSW_PORT_FORWARD_PORT = 3
-} GSW_portForward_t;
+ /** Report Suppression and Join Aggregation. */
+ GSW_MULTICAST_REPORT_JOIN = 0,
+ /** Report Suppression. No Join Aggregation. */
+ GSW_MULTICAST_REPORT = 1,
+ /** Transparent Mode. No Report Suppression and no Join Aggregation. */
+ GSW_MULTICAST_TRANSPARENT = 2
+} GSW_multicastReportSuppression_t;
-/** \brief Configures the Spanning Tree Protocol state of an Ethernet port.
- Used by \ref GSW_STP_PORT_CFG_SET
- and \ref GSW_STP_PORT_CFG_GET. */
+/** \brief Configure the switch multicast configuration.
+ Used by \ref GSW_MulticastSnoopCfgSet and \ref GSW_MulticastSnoopCfgGet. */
+typedef struct {
+ /** Enables and configures the IGMP/MLD snooping feature.
+ Select autolearning or management packet forwarding mode.
+ Packet forwarding is done to the port selected in 'eForwardPort'. */
+ GSW_multicastSnoopMode_t eIGMP_Mode;
+ /** Enables snooped IGMP control packets treated as cross-CTAG VLAN packets. This
+ parameter is used for hardware auto-learning and snooping packets
+ forwarded to a dedicated port. This dedicated port can be selected
+ over 'eForwardPort'. */
+ gsw_bool_t bCrossVLAN;
+ /** Forward snooped packet, only used if forwarded mode
+ is selected by
+ 'eIGMP_Mode = GSW_MULTICAST_SNOOP_MODE_SNOOPFORWARD'. */
+ GSW_portForward_t eForwardPort;
+ /** Target Bridge Port ID for forwarded packets, only used if selected
+ by 'eForwardPort = GSW_PORT_FORWARD_PORT'. */
+ u8 nForwardPortId;
+ /** Snooping control class of service.
+ Snooping control packet can be forwarded to the 'nForwardPortId' when
+ selected in 'eIGMP_Mode'. The class of service of this port can be
+ selected for the snooped control packets, starting from zero.
+ The maximum possible service class depends
+ on the hardware platform used. The value
+ GSW_TRAFFIC_CLASS_DISABLE disables overwriting the given
+ class assignment. */
+ u8 nClassOfService;
+} GSW_multicastSnoopCfg_t;
+
+/** \brief Defines the multicast group member mode.
+ Used by \ref GSW_multicastTable_t and \ref GSW_multicastTableRead_t. */
+typedef enum {
+ /** Include source IP address membership mode.
+ Only supported for IGMPv3. */
+ GSW_IGMP_MEMBER_INCLUDE = 0,
+ /** Exclude source IP address membership mode.
+ Only supported for IGMPv2. */
+ GSW_IGMP_MEMBER_EXCLUDE = 1,
+ /** Group source IP address is 'don't care'. This means all source IP
+ addresses (*) are included for the multicast group membership.
+ This is the default mode for IGMPv1 and IGMPv2. */
+ GSW_IGMP_MEMBER_DONT_CARE = 2,
+
+ GSW_IGMP_MEMBER_INVALID,
+} GSW_IGMP_MemberMode_t;
+
+/** \brief Add a host as a member to a multicast group.
+ Used by \ref GSW_MulticastTableEntryAdd and \ref GSW_MulticastTableEntryRemove. */
typedef struct {
/** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
dependent. An error code is delivered if the selected port is not
available. */
- u16 nPortId;
- /** Filtering Identifier (FID) (not supported by all switches).
- The FID allows to keep multiple STP states per physical Ethernet port.
- Multiple CTAG VLAN groups could be a assigned to one FID and therefore
- share the same STP port state. Switch API ignores the FID value
- in case the switch device does not support it or switch CTAG VLAN
- awareness is disabled. */
- u16 nFId;
- /** Spanning Tree Protocol state of the port. */
- GSW_STP_PortState_t ePortState;
-} GSW_STP_portCfg_t;
-
-/** \brief Spanning tree packet detection and forwarding.
- Used by \ref GSW_STP_BPDU_RULE_SET
- and \ref GSW_STP_BPDU_RULE_GET. */
-typedef struct {
- /** Filter spanning tree packets and forward them, discard them or
- disable the filter. */
- GSW_portForward_t eForwardPort;
- /** Target (bridge) port for forwarded packets; only used if selected by
- 'eForwardPort'. Forwarding is done
- if 'eForwardPort = GSW_PORT_FORWARD_PORT'. */
- u8 nForwardPortId;
-} GSW_STP_BPDU_Rule_t;
+ u32 nPortId;
+ /** Sub-Interface Id - valid for GSWIP 3.0/3.1 only */
+ u16 nSubIfId;
+ /** Select the IP version of the 'uIP_Gda' and 'uIP_Gsa' fields.
+ Both fields support either IPv4 or IPv6. */
+ GSW_IP_Select_t eIPVersion;
+ /** Group Destination IP address (GDA). */
+ GSW_IP_t uIP_Gda;
+ /** Group Source IP address. Only used in case IGMPv3 support is enabled
+ and 'eModeMember != GSW_IGMP_MEMBER_DONT_CARE'. */
+ GSW_IP_t uIP_Gsa;
+ /** FID - valid for GSWIP 3.0 only subject to Global FID for MC is enabled.
+ always valid in GSWIP-3.1. */
+ u8 nFID;
+ /** Exclude Mode - valid for GSWIP 3.0 only - Includes or Excludes Source IP - uIP_Gsa */
+ gsw_bool_t bExclSrcIP;
+ /** Group member filter mode.
+ This is valid for GSWIP-3.0/3.1 to replaces bExclSrcIP.
+ This parameter is ignored when deleting a multicast membership table entry.
+ The configurations 'GSW_IGMP_MEMBER_EXCLUDE'
+ and 'GSW_IGMP_MEMBER_INCLUDE' are only supported
+ if IGMPv3 is used. */
+ GSW_IGMP_MemberMode_t eModeMember;
+ /** TCI for (GSWIP-3.2) B-Step
+ Bit [0:11] - VLAN ID
+ Bit [12] - VLAN CFI/DEI
+ Bit [13:15] - VLAN PRI */
+ u16 nTci;
+ /** Dynamic or Static entry, bStatic=1, Static Entry else default Dynamic */
+ gsw_bool_t bStatic;
+ /** In the case of Multicast Table Search need the Index of HW table returned */
+ u16 nIndex;
+} GSW_multicastTable_t;
-/** \brief Configure the IGMP report suppression mode.
- Used by \ref GSW_multicastSnoopCfg_t. */
-typedef enum {
- /** Report Suppression and Join Aggregation. */
- GSW_MULTICAST_REPORT_JOIN = 0,
- /** Report Suppression. No Join Aggregation. */
- GSW_MULTICAST_REPORT = 1,
- /** Transparent Mode. No Report Suppression and no Join Aggregation. */
- GSW_MULTICAST_TRANSPARENT = 2
-} GSW_multicastReportSuppression_t;
-/** \brief Configure the switch multicast configuration.
- Used by \ref GSW_MULTICAST_SNOOP_CFG_SET and \ref GSW_MULTICAST_SNOOP_CFG_GET. */
+/** \brief Read out the multicast membership table.
+ Used by \ref GSW_MulticastTableEntryRead. */
typedef struct {
- /** Enables and configures the IGMP/MLD snooping feature.
- Select autolearning or management packet forwarding mode.
- Packet forwarding is done to the port selected in 'eForwardPort'. */
- GSW_multicastSnoopMode_t eIGMP_Mode;
- /** Enables snooped IGMP control packets treated as cross-CTAG VLAN packets. This
- parameter is used for hardware auto-learning and snooping packets
- forwarded to a dedicated port. This dedicated port can be selected
- over 'eForwardPort'. */
- gsw_bool_t bCrossVLAN;
- /** Forward snooped packet, only used if forwarded mode
- is selected by
- 'eIGMP_Mode = GSW_MULTICAST_SNOOP_MODE_SNOOPFORWARD'. */
- GSW_portForward_t eForwardPort;
- /** Target Bridge Port ID for forwarded packets, only used if selected
- by 'eForwardPort = GSW_PORT_FORWARD_PORT'. */
- u8 nForwardPortId;
- /** Snooping control class of service.
- Snooping control packet can be forwarded to the 'nForwardPortId' when
- selected in 'eIGMP_Mode'. The class of service of this port can be
- selected for the snooped control packets, starting from zero.
- The maximum possible service class depends
- on the hardware platform used. The value
- GSW_TRAFFIC_CLASS_DISABLE disables overwriting the given
- class assignment. */
- u8 nClassOfService;
-} GSW_multicastSnoopCfg_t;
+ /** Restart the get operation from the beginning of the table. Otherwise
+ return the next table entry (next to the entry that was returned
+ during the previous get operation). This parameter is always reset
+ during the read operation. This boolean parameter is set by the
+ calling application. */
+ gsw_bool_t bInitial;
+ /** Indicates that the read operation got all last valid entries of the
+ table. This boolean parameter is set by the switch API
+ when the Switch API is called after the last valid one was returned already. */
+ gsw_bool_t bLast;
+ /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
+ GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
+ dependent. An error code is delivered if the selected port is not
+ available.
+
+ \remarks
+ This field is used as portmap field, when the MSB bit is set.
+ In portmap mode, every value bit represents an Ethernet port.
+ LSB represents Port 0 with incrementing counting.
+ The (MSB - 1) bit represent the last port.
+ The macro \ref GSW_PORTMAP_FLAG_SET allows to set the MSB bit,
+ marking it as portmap variable.
+ Checking the portmap flag can be done by
+ using the \ref GSW_PORTMAP_FLAG_GET macro. */
+ u32 nPortId;
+ /** Read Index for the Multicast Table Entry, In case need to read based on Index */
+ uint16_t nIndex;
+ /** Ethernet Port Map - to support GSWIP-3.1, following field is added
+ for port map in static entry. It's valid only when MSB of nPortId is set.
+ Each bit stands for 1 bridge port. */
+ u16 nPortMap[8]; /* max can be 16 */
+ /** Sub-Interface Id - valid for GSWIP 3.0 only */
+ u16 nSubIfId;
+ /** Select the IP version of the 'uIP_Gda' and 'uIP_Gsa' fields.
+ Both fields support either IPv4 or IPv6. */
+ GSW_IP_Select_t eIPVersion;
+ /** Group Destination IP address (GDA). */
+ GSW_IP_t uIP_Gda;
+ /** Group Source IP address. Only used in case IGMPv3 support is enabled. */
+ GSW_IP_t uIP_Gsa;
+ /** FID - valid for GSWIP 3.0 only subject to Global FID for MC is enabled */
+ u8 nFID;
+ /** Exclude Mode - valid for GSWIP 3.0 only - Includes or Excludes Source IP - uIP_Gsa */
+ gsw_bool_t bExclSrcIP;
+ /** Group member filter mode.
+ This parameter is ignored when deleting a multicast membership table entry.
+ The configurations 'GSW_IGMP_MEMBER_EXCLUDE'
+ and 'GSW_IGMP_MEMBER_INCLUDE' are only supported
+ if IGMPv3 is used. */
+ GSW_IGMP_MemberMode_t eModeMember;
+ /** MULTICAST Table Hit Status Update */
+ gsw_bool_t hitstatus;
+ /** TCI for (GSWIP-3.2) B-Step
+ Bit [0:11] - VLAN ID
+ Bit [12] - VLAN CFI/DEI
+ Bit [13:15] - VLAN PRI */
+ u16 nTci;
+ /** Dynamic or Static entry, bStatic=1, Static Entry else default Dynamic */
+ gsw_bool_t bStatic;
+} GSW_multicastTableRead_t;
+/** @}*/ /* GSW_MULTICAST */
+
+/** @cond INTERNAL */
/** \brief For debugging Purpose only.
Used for GSWIP 3.3. */
typedef struct {
@@ -2491,9 +2881,15 @@
/** Pmac debugging purpose*/
u8 nDestPort;
} GSW_debug_t;
+/** @endcond */
+
+
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
/** \brief Global Switch configuration Attributes.
- Used by \ref GSW_CFG_SET and \ref GSW_CFG_GET. */
+ Used by \ref GSW_CfgSet and \ref GSW_CfgGet. */
typedef struct {
/** MAC table aging timer. After this timer expires the MAC table
entry is aged out. */
@@ -2569,7 +2965,7 @@
} GSW_CPU_ParserHeaderCfg_t;
/** \brief FCS and Pad Insertion operations for GSWIP 3.1
- Used by \ref GSW_CPU_PortCfgSet/Get. */
+ Used by \ref GSW_CPU_PortCfgSet and \ref GSW_CPU_PortCfgGet. */
typedef enum {
/** CRC Pad Insertion Enable */
GSW_CRC_PAD_INS_EN = 0,
@@ -2579,8 +2975,23 @@
GSW_CRC_PAD_INS_DIS = 2
} GSW_FCS_TxOps_t;
+/** \brief Defines one port that is directly connected to CPU.
+ * Used by \ref GSW_CPU_PortSet and \ref GSW_CPU_PortGet.
+ * This API does not configure port settings but update global PCE rules
+ * using CPU port.
+ */
+typedef struct {
+ /** CTP set to CPU Port.
+ * In current design, first 17 CTP are 1-to-1 mapped to physical ports.
+ * CTP 0 is native CPU (WSP ARC).
+ * CTP 1~15 is allowed to be external CPU port.
+ * CTP 16 is not allowed to be CPU port.
+ */
+ u8 nPortId;
+} GSW_CPU_Port_t;
+
/** \brief Defines one port that is directly connected to the CPU and its applicable settings.
- Used by \ref GSW_CPU_PORT_CFG_SET and \ref GSW_CPU_PORT_CFG_GET. */
+ Used by \ref GSW_CPU_PortCfgSet and \ref GSW_CPU_PortCfgGet. */
typedef struct {
/** Ethernet Port number (zero-based counting) set to CPU Port. The valid number is hardware
dependent. (E.g. Port number 0 for GSWIP-3.0 or 6 for GSWIP-2.x). An error code is delivered if the selected port is not
@@ -2630,125 +3041,9 @@
gsw_bool_t bTsNonptp;
} GSW_CPU_PortCfg_t;
-/** \brief Defines the multicast group member mode.
- Used by \ref GSW_multicastTable_t and \ref GSW_multicastTableRead_t. */
-typedef enum {
- /** Include source IP address membership mode.
- Only supported for IGMPv3. */
- GSW_IGMP_MEMBER_INCLUDE = 0,
- /** Exclude source IP address membership mode.
- Only supported for IGMPv2. */
- GSW_IGMP_MEMBER_EXCLUDE = 1,
- /** Group source IP address is 'don't care'. This means all source IP
- addresses (*) are included for the multicast group membership.
- This is the default mode for IGMPv1 and IGMPv2. */
- GSW_IGMP_MEMBER_DONT_CARE = 2,
-
- GSW_IGMP_MEMBER_INVALID,
-} GSW_IGMP_MemberMode_t;
-
-/** \brief Add a host as a member to a multicast group.
- Used by \ref GSW_MULTICAST_TABLE_ENTRY_ADD and \ref GSW_MULTICAST_TABLE_ENTRY_REMOVE. */
-typedef struct {
- /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
- GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
- dependent. An error code is delivered if the selected port is not
- available. */
- u32 nPortId;
- /** Sub-Interface Id - valid for GSWIP 3.0/3.1 only */
- u16 nSubIfId;
- /** Select the IP version of the 'uIP_Gda' and 'uIP_Gsa' fields.
- Both fields support either IPv4 or IPv6. */
- GSW_IP_Select_t eIPVersion;
- /** Group Destination IP address (GDA). */
- GSW_IP_t uIP_Gda;
- /** Group Source IP address. Only used in case IGMPv3 support is enabled
- and 'eModeMember != GSW_IGMP_MEMBER_DONT_CARE'. */
- GSW_IP_t uIP_Gsa;
- /** FID - valid for GSWIP 3.0 only subject to Global FID for MC is enabled.
- always valid in GSWIP-3.1. */
- u8 nFID;
- /** Exclude Mode - valid for GSWIP 3.0 only - Includes or Excludes Source IP - uIP_Gsa */
- gsw_bool_t bExclSrcIP;
- /** Group member filter mode.
- This is valid for GSWIP-3.0/3.1 to replaces bExclSrcIP.
- This parameter is ignored when deleting a multicast membership table entry.
- The configurations 'GSW_IGMP_MEMBER_EXCLUDE'
- and 'GSW_IGMP_MEMBER_INCLUDE' are only supported
- if IGMPv3 is used. */
- GSW_IGMP_MemberMode_t eModeMember;
- /** TCI for (GSWIP-3.2) B-Step
- Bit [0:11] - VLAN ID
- Bit [12] - VLAN CFI/DEI
- Bit [13:15] - VLAN PRI */
- u16 nTci;
-} GSW_multicastTable_t;
-
-
-/** \brief Read out the multicast membership table.
- Used by \ref GSW_MULTICAST_TABLE_ENTRY_READ. */
-typedef struct {
- /** Restart the get operation from the beginning of the table. Otherwise
- return the next table entry (next to the entry that was returned
- during the previous get operation). This parameter is always reset
- during the read operation. This boolean parameter is set by the
- calling application. */
- gsw_bool_t bInitial;
- /** Indicates that the read operation got all last valid entries of the
- table. This boolean parameter is set by the switch API
- when the Switch API is called after the last valid one was returned already. */
- gsw_bool_t bLast;
- /** Ethernet Port number (zero-based counting) in GSWIP-2.1/2.2/3.0. From
- GSWIP-3.1, this field is Bridge Port ID. The valid range is hardware
- dependent. An error code is delivered if the selected port is not
- available.
-
- \remarks
- This field is used as portmap field, when the MSB bit is set.
- In portmap mode, every value bit represents an Ethernet port.
- LSB represents Port 0 with incrementing counting.
- The (MSB - 1) bit represent the last port.
- The macro \ref GSW_PORTMAP_FLAG_SET allows to set the MSB bit,
- marking it as portmap variable.
- Checking the portmap flag can be done by
- using the \ref GSW_PORTMAP_FLAG_GET macro. */
- u32 nPortId;
- /** Ethernet Port Map - to support GSWIP-3.1, following field is added
- for port map in static entry. It's valid only when MSB of nPortId is set.
- Each bit stands for 1 bridge port. */
- u16 nPortMap[8]; /* max can be 16 */
- /** Sub-Interface Id - valid for GSWIP 3.0 only */
- u16 nSubIfId;
- /** Select the IP version of the 'uIP_Gda' and 'uIP_Gsa' fields.
- Both fields support either IPv4 or IPv6. */
- GSW_IP_Select_t eIPVersion;
- /** Group Destination IP address (GDA). */
- GSW_IP_t uIP_Gda;
- /** Group Source IP address. Only used in case IGMPv3 support is enabled. */
- GSW_IP_t uIP_Gsa;
- /** FID - valid for GSWIP 3.0 only subject to Global FID for MC is enabled */
- u8 nFID;
- /** Exclude Mode - valid for GSWIP 3.0 only - Includes or Excludes Source IP - uIP_Gsa */
- gsw_bool_t bExclSrcIP;
- /** Group member filter mode.
- This parameter is ignored when deleting a multicast membership table entry.
- The configurations 'GSW_IGMP_MEMBER_EXCLUDE'
- and 'GSW_IGMP_MEMBER_INCLUDE' are only supported
- if IGMPv3 is used. */
- GSW_IGMP_MemberMode_t eModeMember;
- /* MULTICAST Table Hit Status Update (Supported in GSWip-3.1/3.2) */
- gsw_bool_t hitstatus;
- /** TCI for (GSWIP-3.2) B-Step
- Bit [0:11] - VLAN ID
- Bit [12] - VLAN CFI/DEI
- Bit [13:15] - VLAN PRI */
- u16 nTci;
-} GSW_multicastTableRead_t;
-
-
/** \brief Global Ethernet trunking configuration.
- Used by \ref GSW_TRUNKING_CFG_GET
- and \ref GSW_TRUNKING_CFG_SET. */
+ Used by \ref GSW_TrunkingCfgGet
+ and \ref GSW_TrunkingCfgSet. */
typedef struct {
/** IP source address is used by the
hash algorithm to calculate the egress trunking port index. */
@@ -2770,51 +3065,69 @@
gsw_bool_t bDst_Port;
} GSW_trunkingCfg_t;
+/** @}*/ /* GSW_ETHERNET_BRIDGING */
+
+
+/** @cond DOC_ENABLE_PBB */
+/** \addtogroup GSW_PBB
+ * @{
+ */
+
/** \brief I-TAG header defintion .GSWIP-3.2 only
Used by \ref GSW_PBB_Tunnel_Template_Config_t*/
typedef struct {
- /**I-TAG TPID -2 bytes field*/
+ /**I-TAG TPID -2 bytes field enable*/
gsw_bool_t bTpidEnable;
+ /**I-TAG TPID -2 bytes field*/
u16 nTpid;
- /**I-TAG PCP -3 Bit field*/
+ /**I-TAG PCP -3 Bit field enable*/
gsw_bool_t bPcpEnable;
+ /**I-TAG PCP -3 Bit field*/
u8 nPcp;
- /**I-TAG DEI -1 Bit field*/
+ /**I-TAG DEI -1 Bit field enable*/
gsw_bool_t bDeiEnable;
+ /**I-TAG DEI -1 Bit field*/
u8 nDei;
- /**I-TAG UAC -1 Bit field*/
+ /**I-TAG UAC -1 Bit field enable*/
gsw_bool_t bUacEnable;
+ /**I-TAG UAC -1 Bit field*/
u8 nUac;
- /**I-TAG RES -3 Bit field*/
+ /**I-TAG RES -3 Bit field enable*/
gsw_bool_t bResEnable;
+ /**I-TAG RES -3 Bit field*/
u8 nRes;
- /**I-TAG SID -24 Bit field*/
+ /**I-TAG SID -24 Bit field enable*/
gsw_bool_t bSidEnable;
+ /**I-TAG SID -24 Bit field*/
u32 nSid;
} GSW_I_TAG_Config_t;
/** \brief B-TAG header defintion .GSWIP-3.2 only
Used by \ref GSW_PBB_Tunnel_Template_Config_t*/
typedef struct {
- /**B-TAG TPID -2 bytes field*/
+ /** B-TAG TPID -2 bytes field enable*/
gsw_bool_t bTpidEnable;
+ /** B-TAG TPID -2 bytes field*/
u16 nTpid;
- /**B-TAG PCP -3 Bit field*/
+ /**B-TAG PCP -3 Bit field enable*/
gsw_bool_t bPcpEnable;
+ /**B-TAG PCP -3 Bit field*/
u8 nPcp;
- /**B-TAG DEI -1 Bit field*/
+ /**B-TAG DEI -1 Bit field enable*/
gsw_bool_t bDeiEnable;
+ /**B-TAG DEI -1 Bit field*/
u8 nDei;
- /**B-TAG VID -12 Bit field*/
+ /**B-TAG VID -12 Bit field enable*/
gsw_bool_t bVidEnable;
+ /**B-TAG VID -12 Bit field*/
u16 nVid;
} GSW_B_TAG_Config_t;
@@ -2823,38 +3136,58 @@
For \ref GSW_PBB_TunnelTempate_Free, this field should be valid ID returned by
\ref GSW_PBB_TunnelTempate_Alloc.*/
typedef struct {
+ /** Mac-in-Mac (PBB) template index. */
u16 nTunnelTemplateId;
- /** I-Header Destination Address*/
+ /** I-Header Destination Address enable*/
gsw_bool_t bIheaderDstMACEnable;
+ /** I-Header Destination Address*/
u8 nIheaderDstMAC[GSW_MAC_ADDR_LEN];
- /** I-Header source Address*/
+ /** I-Header source Address enable*/
gsw_bool_t bIheaderSrcMACEnable;
+ /** I-Header source Address*/
u8 nIheaderSrcMAC[GSW_MAC_ADDR_LEN];
- /** I-Tag*/
+ /** I-Tag enable*/
gsw_bool_t bItagEnable;
+ /** I-Tag*/
GSW_I_TAG_Config_t sItag;
- /** B-Tag*/
+ /** B-Tag enable*/
gsw_bool_t bBtagEnable;
+ /** B-Tag*/
GSW_B_TAG_Config_t sBtag;
} GSW_PBB_Tunnel_Template_Config_t;
+/** @}*/ /* GSW_PBB */
+/** @endcond DOC_ENABLE_PBB */
+
+
+/** \addtogroup GSW_OAM
+ * @{
+ */
+
/** \brief Port monitor configuration.
- Used by \ref GSW_MONITOR_PORT_CFG_GET and \ref GSW_MONITOR_PORT_CFG_SET. */
+ Used by \ref GSW_MonitorPortCfgGet and \ref GSW_MonitorPortCfgSet. */
typedef struct {
/** Ethernet Port number (zero-based counting). The valid range is hardware
dependent. An error code is delivered if the selected port is not
available. */
u8 nPortId;
- /* Monitoring Sub-IF id */
+ /** Monitoring Sub-IF id */
u16 nSubIfId;
- /* Out of use. */
+ /** Reserved. */
gsw_bool_t bMonitorPort;
} GSW_monitorPortCfg_t;
+/** @}*/ /* GSW_OAM */
+
+
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
+
/** \brief Sets the portmap flag of a PortID variable.
Some Switch API commands allow to use a port index as portmap variable.
This requires that the MSB bit is set to indicate that this variable
@@ -2873,6 +3206,9 @@
The (MSB - 1) bit represent the last port. */
#define GSW_PORTMAP_FLAG_GET(varType) (1 << ( sizeof(((varType *)0)->nPortId) * 8 - 1))
+/** @}*/ /* GSW_ETHERNET_BRIDGING */
+
+
#pragma scalar_storage_order default
#pragma pack(pop)
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_api.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_api.h
index e0bf30a..7b27778 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_api.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_api.h
@@ -12,227 +12,2778 @@
#include "gsw.h"
-GSW_return_t GSW_RegisterGet(const GSW_Device_t *dev, GSW_register_t *);
-GSW_return_t GSW_RegisterSet(const GSW_Device_t *dev, GSW_register_t *);
-GSW_return_t GSW_RegisterMod(const GSW_Device_t *dev, GSW_register_mod_t *);
-GSW_return_t GSW_CPU_PortCfgSet(const GSW_Device_t *dev, GSW_CPU_PortCfg_t *);
-GSW_return_t GSW_CPU_PortCfgGet(const GSW_Device_t *dev, GSW_CPU_PortCfg_t *);
-GSW_return_t GSW_PortLinkCfgSet(const GSW_Device_t *dev, GSW_portLinkCfg_t *);
-GSW_return_t GSW_PortLinkCfgGet(const GSW_Device_t *dev, GSW_portLinkCfg_t *);
-GSW_return_t GSW_PortCfgSet(const GSW_Device_t *dev, GSW_portCfg_t *);
-GSW_return_t GSW_PortCfgGet(const GSW_Device_t *dev, GSW_portCfg_t *);
-GSW_return_t GSW_CfgSet(const GSW_Device_t *dev, GSW_cfg_t *);
-GSW_return_t GSW_CfgGet(const GSW_Device_t *dev, GSW_cfg_t *);
-GSW_return_t GSW_MonitorPortCfgGet(const GSW_Device_t *dev, GSW_monitorPortCfg_t *);
-GSW_return_t GSW_MonitorPortCfgSet(const GSW_Device_t *dev, GSW_monitorPortCfg_t *);
+/* General */
+
+/** \addtogroup GSW_DEBUG
+ * @{
+ */
+
+/**
+ \brief Read an internal register. The register offset defines which register to access.
+ This routine only accesses the ETHSW_PDI of the switch.
+ Note that the switch API implementation checks whether the given address is
+ inside the valid address range. It returns with an error in case an invalid
+ address is given.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_register_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RegisterGet(const GSW_Device_t *dev, GSW_register_t *parm);
+
+/**
+ \brief Write to an internal register. The register offset defines which register to access.
+ This routine only accesses the ETHSW_PDI of the switch.
+ Note that the switch API implementation checks whether the given address is
+ inside the valid address range. It returns with an error in case an invalid
+ address is given.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_register_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RegisterSet(const GSW_Device_t *dev, GSW_register_t *parm);
+
+/**
+ \brief Modify an internal register. The register offset defines which register to access.
+ This routine only accesses the ETHSW_PDI of the switch.
+ Note that the switch API implementation checks whether the given address is
+ inside the valid address range. It returns with an error in case an invalid
+ address is given.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_register_mod_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RegisterMod(const GSW_Device_t *dev, GSW_register_mod_t *parm);
+
+/** @}*/ /* GSW_DEBUG */
+
+
+/** \addtogroup GSW_OAM
+ * @{
+ */
+
+/**
+ \brief Defines one port that is directly connected to the software running on a CPU.
+ This allows for the redirecting of protocol-specific packets to the CPU port.
+ If the CPU port cannot be set, the function returns an error code.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_CPU_Port_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CPU_PortSet(const GSW_Device_t *dev, GSW_CPU_Port_t *parm);
+
+/**
+ \brief Get the port that is directly connected to the software running on a CPU and defined as
+ CPU port. This port assignment can be set using \ref GSW_CPU_PortSet
+ if it is not fixed and defined by the switch device architecture.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_CPU_Port_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CPU_PortGet(const GSW_Device_t *dev, GSW_CPU_Port_t *parm);
+
+/**
+ \brief Defines one port that is directly connected to the software running on a CPU.
+ This allows for the redirecting of protocol-specific packets to the CPU port and
+ special packet treatment when sent by the CPU.
+ If the CPU port cannot be set, the function returns an error code.
+ This is deprecated and replaced by \ref GSW_CPU_PortSet if only change
+ the CPU port without port settings.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_CPU_PortCfg_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CPU_PortCfgSet(const GSW_Device_t *dev, GSW_CPU_PortCfg_t *parm);
+
+/**
+ \brief Get the port that is directly connected to the software running on a CPU and defined as
+ CPU port. This port assignment can be set using \ref GSW_CPU_PortCfgSet
+ if it is not fixed and defined by the switch device architecture.
+ This is deprecated and replaced by \ref GSW_CPU_PortGet if not to load the
+ port settings.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_CPU_PortCfg_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CPU_PortCfgGet(const GSW_Device_t *dev, GSW_CPU_PortCfg_t *parm);
+
+/**
+ \brief Set the Ethernet port link, speed status and flow control status.
+ The configuration applies to a single port 'nPortId'.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_portLinkCfg_t structure to set the port configuration.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PortLinkCfgSet(const GSW_Device_t *dev, GSW_portLinkCfg_t *parm);
+
+/**
+ \brief Read out the Ethernet port's speed, link status, and flow control status.
+ The information for one single port 'nPortId' is returned.
+ An error code is returned if the selected port does not exist.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_portLinkCfg_t structure to read out the port status.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PortLinkCfgGet(const GSW_Device_t *dev, GSW_portLinkCfg_t *parm);
+
+/**
+ \brief Set the Ethernet port configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_portCfg_t structure
+ to configure the switch port hardware.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PortCfgSet(const GSW_Device_t *dev, GSW_portCfg_t *parm);
+
+/**
+ \brief Read out the current Ethernet port configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a port configuration \ref GSW_portCfg_t structure to fill out by the driver.
+ The parameter 'nPortId' tells the driver which port parameter is requested.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PortCfgGet(const GSW_Device_t *dev, GSW_portCfg_t *parm);
+
+/** \brief This returns the capability referenced by the provided index
+ (zero-based counting index value). The Switch API uses the index to return
+ the capability parameter from an internal list. For instance,
+ the capability list contains information about the amount of supported
+ features like number of supported VLAN groups or MAC table entries.
+ The command returns zero-length strings ('') in case the
+ requested index number is out of range.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to pre-allocated capability list structure \ref GSW_cap_t.
+ The switch API implementation fills out the structure with the supported
+ features, based on the provided 'nCapType' parameter.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CapGet(const GSW_Device_t *dev, GSW_cap_t *parm);
+
+/**
+ \brief Modify the switch configuration.
+ The configuration can be read using \ref GSW_CfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_cfg_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CfgSet(const GSW_Device_t *dev, GSW_cfg_t *parm);
+
+/**
+ \brief Read the global switch configuration.
+ This configuration can be set using \ref GSW_CfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to an \ref GSW_cfg_t structure.
+ The structure is filled out by the switch implementation.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CfgGet(const GSW_Device_t *dev, GSW_cfg_t *parm);
+
+/** @}*/ /* GSW_OAM */
+
+
+/** \addtogroup GSW_OAM
+ * @{
+ */
+
+/**
+ \brief Reads out the current monitor options for a
+ dedicated Ethernet port. This configuration can be set
+ using \ref GSW_MonitorPortCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer
+ to \ref GSW_monitorPortCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MonitorPortCfgGet(const GSW_Device_t *dev, GSW_monitorPortCfg_t *parm);
+
+/**
+ \brief Configures the monitor options for a
+ dedicated Ethernet port. This current configuration can be read back
+ using \ref GSW_MonitorPortCfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_monitorPortCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MonitorPortCfgSet(const GSW_Device_t *dev, GSW_monitorPortCfg_t *parm);
+
+/**
+ \brief Freeze switch hardware with traffic stall.
+ It is used to configure switch with traffic blocked.
+ This is required for configuration sensitive to ongoing traffic,
+ such as clear counters, change queue configuration, etc.
+
+ \param dev Pointer to switch device.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
GSW_return_t GSW_Freeze(const GSW_Device_t *dev);
+
+/**
+ \brief Unfreeze switch hardward.
+ It is used to re-enable switch after configuration is done.
+
+ \param dev Pointer to switch device.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
GSW_return_t GSW_UnFreeze(const GSW_Device_t *dev);
+/**
+ * \brief Get Hit Status from MAC or Multicast table.
+ * It is used to get hit status of MAC table entry or Multicast table entry
+ * and clear it.
+ *
+ * \param dev Pointer to switch device.
+ * \param parm Pointer to \ref GSW_HitStatusRead_t.
+ *
+ * \remarks The function returns an error code in case an error occurs.
+ * The error code is described in \ref GSW_return_t.
+ *
+ * \return Return value as follows:
+ * - GSW_statusOk: if successful
+ * - An error code in case an error occurs
+ */
+GSW_return_t GSW_GetHitSts(const GSW_Device_t *dev, GSW_HitStatusRead_t *parm);
+
-/* TFLOW */
+/**
+ * \brief Get miscellaneous configurations such as 4-TPID support
+ * on logical port (0~15).
+ *
+ * \param dev Pointer to switch device.
+ * \param parm Pointer to \ref GSW_MiscPortCfg_t.
+ *
+ * \remarks The function returns an error code in case an error occurs.
+ * The error code is described in \ref GSW_return_t.
+ *
+ * \return Return value as follows:
+ * - GSW_statusOk: if successful
+ * - An error code in case an error occurs
+ */
+GSW_return_t GSW_MiscPortCfgGet(const GSW_Device_t *dev, GSW_MiscPortCfg_t *parm);
+
+/**
+ * \brief Configure miscellaneous configurations such as 4-TPID support
+ * on logical port (0~15).
+ *
+ * \param dev Pointer to switch device.
+ * \param parm Pointer to \ref GSW_MiscPortCfg_t.
+ *
+ * \remarks The function returns an error code in case an error occurs.
+ * The error code is described in \ref GSW_return_t.
+ *
+ * \return Return value as follows:
+ * - GSW_statusOk: if successful
+ * - An error code in case an error occurs
+ */
+GSW_return_t GSW_MiscPortCfgSet(const GSW_Device_t *dev, GSW_MiscPortCfg_t *parm);
+
+/** @}*/ /* GSW_OAM */
+
+
+/* TFLOW (PCE Rule) */
+
+/** \addtogroup GSW_PCE
+ * @{
+ */
+
+/**
+ \brief Allocate PCE Rule block.
+ It allocates consecutive PCE Rule entries and return the block ID
+ for further operations: \ref GSW_PceRuleFree.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PCE_rule_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+ */
GSW_return_t GSW_PceRuleAlloc(const GSW_Device_t *dev, GSW_PCE_rule_alloc_t *parm);
+
+/**
+ \brief Release PCE Rule block.
+ It is used to release PCE Rule block allocated by \ref GSW_PceRuleAlloc.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PCE_rule_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+ */
GSW_return_t GSW_PceRuleFree(const GSW_Device_t *dev, GSW_PCE_rule_alloc_t *parm);
+
+/**
+ \brief Get size of PCE Rule block.
+ It is used to get number of entries in the PCE Rule block allocated
+ by \ref GSW_PceRuleAlloc.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PCE_rule_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+ */
+GSW_return_t GSW_PceRuleBlockSize(const GSW_Device_t *dev, GSW_PCE_rule_alloc_t *parm);
+
+/**
+ \brief Enable PCE Rule.
+ It is used to Enable PCE Rule written by
+ \ref GSW_PceRuleWrite.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PCE_rule_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+ */
GSW_return_t GSW_PceRuleEnable(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *parm);
+
+/**
+ \brief Disable PCE Rule.
+ It is used to Disable PCE Rule written by
+ \ref GSW_PceRuleWrite.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PCE_rule_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+ */
GSW_return_t GSW_PceRuleDisable(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *parm);
-GSW_return_t GSW_PceRuleRead(const GSW_Device_t *dev, GSW_PCE_rule_t *);
-GSW_return_t GSW_PceRuleWrite(const GSW_Device_t *dev, GSW_PCE_rule_t *);
-GSW_return_t GSW_PceRuleDelete(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *);
-GSW_return_t GSW_PceRuleAlloc(const GSW_Device_t *dev, GSW_PCE_rule_alloc_t *);
-GSW_return_t GSW_PceRuleFree(const GSW_Device_t *dev, GSW_PCE_rule_alloc_t *);
-GSW_return_t GSW_PceRuleEnable(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *);
-GSW_return_t GSW_PceRuleDisable(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *);
-GSW_return_t GSW_DumpTable(const GSW_Device_t *dev, GSW_table_t *);
+
+/**
+ \brief This command allows the reading out of a rule pattern and action of the
+ packet classification engine.
+ A rule can be written using the command \ref GSW_PceRuleWrite.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PCE_rule_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PceRuleRead(const GSW_Device_t *dev, GSW_PCE_rule_t *parm);
+
+/**
+ \brief This command writes a rule pattern and action to the table of the packet
+ classification engine. The pattern part describes the parameter to identify an
+ incoming packet to which the dedicated actions should be applied.
+ A rule can be read using the command \ref GSW_PceRuleWrite.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PCE_rule_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PceRuleWrite(const GSW_Device_t *dev, GSW_PCE_rule_t *parm);
+
+/**
+ \brief This command deletes a complete rule from the packet classification engine.
+ A delete operation is done on the rule of a dedicated index 'nIndex'.
+ A rule can be written over using the command \ref GSW_PceRuleWrite.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PCE_ruleEntry_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PceRuleDelete(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *parm);
-/* BM Table */
+GSW_return_t GSW_PceRuleMove(const GSW_Device_t *dev, GSW_PCE_rule_move_t *parm);
+
+/** @cond INTERNAL */
+GSW_return_t GSW_DumpTable(const GSW_Device_t *dev, GSW_table_t *parm);
+/** @endcond */
+
+/** @}*/ /* GSW_PCE */
/* Bridge */
-GSW_return_t GSW_BridgeAlloc(const GSW_Device_t *dev, GSW_BRIDGE_alloc_t *);
-GSW_return_t GSW_BridgeFree(const GSW_Device_t *dev, GSW_BRIDGE_alloc_t *);
-GSW_return_t GSW_BridgeConfigSet(const GSW_Device_t *dev, GSW_BRIDGE_config_t *);
-GSW_return_t GSW_BridgeConfigGet(const GSW_Device_t *dev, GSW_BRIDGE_config_t *);
+
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
+
+/**
+ \brief Allocate Bridge. Valid for GSWIP-3.1.
+ It is used to allocate a bridge. Bridge 0 is always available as default
+ bridge.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgeAlloc(const GSW_Device_t *dev, GSW_BRIDGE_alloc_t *parm);
+
+/**
+ \brief Delete Bridge. Valid for GSWIP-3.1.
+ It is used to release bridge allocated with \ref GSW_BridgeAlloc.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgeFree(const GSW_Device_t *dev, GSW_BRIDGE_alloc_t *parm);
+
+/**
+ \brief Config Bridge. Valid for GSWIP-3.1.
+ It is used to configure bridge. If \ref GSW_BRIDGE_config_t::eMask has
+ \ref GSW_BridgeConfigMask_t::GSW_BRIDGE_CONFIG_MASK_FORCE,
+ \ref GSW_BRIDGE_config_t::nBridgeId is absolute index of Bridge (FID) in
+ hardware for debug purpose, bypassing any check.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_config_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgeConfigSet(const GSW_Device_t *dev, GSW_BRIDGE_config_t *parm);
+
+/**
+ \brief get configuration of Bridge. Valid for GSWIP-3.1.
+ It is used to retrieve bridge configuration.
+ If \ref GSW_BRIDGE_config_t::eMask has
+ \ref GSW_BridgeConfigMask_t::GSW_BRIDGE_CONFIG_MASK_FORCE,
+ \ref GSW_BRIDGE_config_t::nBridgeId is absolute index of Bridge (FID) in
+ hardware for debug purpose, bypassing any check.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_config_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgeConfigGet(const GSW_Device_t *dev, GSW_BRIDGE_config_t *parm);
+
-/*Bridge Port*/
-GSW_return_t GSW_BridgePortAlloc(const GSW_Device_t *dev, GSW_BRIDGE_portAlloc_t *);
-GSW_return_t GSW_BridgePortConfigSet(const GSW_Device_t *dev, GSW_BRIDGE_portConfig_t *);
-GSW_return_t GSW_BridgePortConfigGet(const GSW_Device_t *dev, GSW_BRIDGE_portConfig_t *);
-GSW_return_t GSW_BridgePortFree(const GSW_Device_t *dev, GSW_BRIDGE_portAlloc_t *);
+/* Bridge Port*/
+/**
+ \brief Allocate Bridge Port. Valid for GSWIP-3.1.
+ It is used to allocate a bridge port.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_portAlloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgePortAlloc(const GSW_Device_t *dev, GSW_BRIDGE_portAlloc_t *parm);
+
+/**
+ \brief Config Bridge Port. Valid for GSWIP-3.1.
+ It is used to configure bridge port. If \ref GSW_BRIDGE_portConfig_t::eMask
+ has \ref GSW_BridgePortConfigMask_t::GSW_BRIDGE_PORT_CONFIG_MASK_FORCE,
+ \ref GSW_BRIDGE_portConfig_t::nBridgePortId is absolute index of Bridge Port
+ in hardware for debug purpose, bypassing any check.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_portConfig_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgePortConfigSet(const GSW_Device_t *dev, GSW_BRIDGE_portConfig_t *parm);
+
+/**
+ \brief get configuration of Bridge Port. Valid for GSWIP-3.1.
+ It is used to retrieve bridge port configuration.
+ If \ref GSW_BRIDGE_portConfig_t::eMask has
+ \ref GSW_BridgePortConfigMask_t::GSW_BRIDGE_PORT_CONFIG_MASK_FORCE,
+ \ref GSW_BRIDGE_portConfig_t::nBridgePortId is absolute index of Bridge Port
+ in hardware for debug purpose, bypassing any check
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_portConfig_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgePortConfigGet(const GSW_Device_t *dev, GSW_BRIDGE_portConfig_t *parm);
+
+/**
+ \brief Delete Bridge Port. Valid for GSWIP-3.1.
+ It is used to release bridge port allocated with
+ \ref GSW_BridgePortConfigSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_portAlloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgePortFree(const GSW_Device_t *dev, GSW_BRIDGE_portAlloc_t *parm);
+
+/**
+ \brief Read and clear loop violation counter.
+ It is used for loop detection implementation.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_BRIDGE_portLoopRead_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_BridgePortLoopRead(const GSW_Device_t *dev, GSW_BRIDGE_portLoopRead_t *parm);
+
+/** @}*/ /* GSW_ETHERNET_BRIDGING */
+
/* CTP Port */
-GSW_return_t GSW_CTP_PortAssignmentAlloc(const GSW_Device_t *, GSW_CTP_portAssignment_t *);
-GSW_return_t GSW_CTP_PortAssignmentFree(const GSW_Device_t *, GSW_CTP_portAssignment_t *);
-GSW_return_t GSW_CTP_PortAssignmentSet(const GSW_Device_t *, GSW_CTP_portAssignment_t *);
-GSW_return_t GSW_CTP_PortAssignmentGet(const GSW_Device_t *, GSW_CTP_portAssignment_t *);
-GSW_return_t GSW_CtpPortConfigSet(const GSW_Device_t *, GSW_CTP_portConfig_t *);
-GSW_return_t GSW_CtpPortConfigGet(const GSW_Device_t *, GSW_CTP_portConfig_t *);
-GSW_return_t GSW_CtpPortConfigReset(const GSW_Device_t *, GSW_CTP_portConfig_t *);
+
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
+
+/**
+ \brief Assign CTP to Logical Port. Valid for GSWIP-3.1.
+ It is used to allocate a range of CTP and associate them to Logical Port.
+ Apart from setting proper mode, it will do basic mapping between CTP and
+ Bridge Port, then enable SDMA to allow ingress traffic from this port.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_CTP_portAssignment_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CTP_PortAssignmentAlloc(const GSW_Device_t *dev, GSW_CTP_portAssignment_t *parm);
+
+/**
+ \brief Free CTP from Logical Port. Valid for GSWIP-3.1.
+ It is used to stop association between CTP and Logical port. And it will stop
+ SDMA so that the ingress traffic from this port is stopped.
+*/
+GSW_return_t GSW_CTP_PortAssignmentFree(const GSW_Device_t *dev, GSW_CTP_portAssignment_t *parm);
+
+/**
+ \brief Assign CTP Ports to logical port. Valid for GSWIP-3.1.
+ It is used to associate a range of CTP ports to logical port and set proper
+ mode.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_CTP_portAssignment_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CTP_PortAssignmentSet(const GSW_Device_t *dev, GSW_CTP_portAssignment_t *parm);
+
+/**
+ \brief Get CTP Ports assignment from logical port. Valid for GSWIP-3.1.
+ It is used to retrieve CTP ports range of logical port and the mode of port.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_CTP_portAssignment_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CTP_PortAssignmentGet(const GSW_Device_t *dev, GSW_CTP_portAssignment_t *parm);
+
+/**
+ \brief Config CTP Port. Valid for GSWIP-3.1.
+ It is used to setup CTP port.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_CTP_portConfig_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CtpPortConfigSet(const GSW_Device_t *dev, GSW_CTP_portConfig_t *parm);
+
+/**
+ \brief get configuration of CTP Port. Valid for GSWIP-3.1.
+ It is used to retrieve CTP port configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_CTP_portConfig_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CtpPortConfigGet(const GSW_Device_t *dev, GSW_CTP_portConfig_t *parm);
+
+/**
+ \brief Reset configuration of CTP (Connectivity Termination Point). Valid for GSWIP-3.1.
+ It is used to reset CTP configuration and, if necessary, release resources
+ such as Extended VLAN, Meter, etc. Bridge Port ID will not be changed.
+ If \ref GSW_CTP_portConfig_t::eMask has
+ \ref GSW_CtpPortConfigMask_t::GSW_CTP_PORT_CONFIG_MASK_FORCE,
+ \ref GSW_CTP_portConfig_t::nLogicalPortId is ignored and
+ \ref GSW_CTP_portConfig_t::nSubIfIdGroup is absolute index of CTP in hardware
+ for debug purpose, bypassing any check.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_CTP_portConfig_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_CtpPortConfigReset(const GSW_Device_t *dev, GSW_CTP_portConfig_t *parm);
+
+/** @}*/ /* GSW_ETHERNET_BRIDGING */
+
/* QoS */
-GSW_return_t GSW_QoS_MeterCfgSet(const GSW_Device_t *, GSW_QoS_meterCfg_t *);
-GSW_return_t GSW_QoS_MeterCfgGet(const GSW_Device_t *, GSW_QoS_meterCfg_t *);
-GSW_return_t GSW_QoS_DSCP_ClassGet(const GSW_Device_t *, GSW_QoS_DSCP_ClassCfg_t *);
-GSW_return_t GSW_QoS_DSCP_ClassSet(const GSW_Device_t *, GSW_QoS_DSCP_ClassCfg_t *);
-GSW_return_t GSW_QoS_DSCP_DropPrecedenceCfgSet(const GSW_Device_t *,
- GSW_QoS_DSCP_DropPrecedenceCfg_t *);
-GSW_return_t GSW_QoS_DSCP_DropPrecedenceCfgGet(const GSW_Device_t *,
- GSW_QoS_DSCP_DropPrecedenceCfg_t *);
-GSW_return_t GSW_QoS_PortRemarkingCfgSet(const GSW_Device_t *,
- GSW_QoS_portRemarkingCfg_t *);
-GSW_return_t GSW_QoS_PortRemarkingCfgGet(const GSW_Device_t *,
- GSW_QoS_portRemarkingCfg_t *);
-GSW_return_t GSW_QoS_PCP_ClassGet(const GSW_Device_t *,
- GSW_QoS_PCP_ClassCfg_t *);
-GSW_return_t GSW_QoS_PCP_ClassSet(const GSW_Device_t *,
- GSW_QoS_PCP_ClassCfg_t *);
-GSW_return_t GSW_QoS_PortCfgGet(const GSW_Device_t *, GSW_QoS_portCfg_t *);
-GSW_return_t GSW_QoS_PortCfgSet(const GSW_Device_t *, GSW_QoS_portCfg_t *);
-GSW_return_t GSW_QoS_SchedulerCfgSet(const GSW_Device_t *,
- GSW_QoS_schedulerCfg_t *);
-GSW_return_t GSW_QoS_SchedulerCfgGet(const GSW_Device_t *,
- GSW_QoS_schedulerCfg_t *);
-GSW_return_t GSW_QoS_ShaperCfgSet(const GSW_Device_t *,
- GSW_QoS_ShaperCfg_t *);
-GSW_return_t GSW_QoS_ShaperCfgGet(const GSW_Device_t *,
- GSW_QoS_ShaperCfg_t *);
-GSW_return_t GSW_QoS_ShaperQueueAssign(const GSW_Device_t *,
- GSW_QoS_ShaperQueue_t *);
-GSW_return_t GSW_QoS_ShaperQueueDeassign(const GSW_Device_t *,
- GSW_QoS_ShaperQueue_t *);
-GSW_return_t GSW_QoS_ShaperQueueGet(const GSW_Device_t *,
- GSW_QoS_ShaperQueueGet_t *);
-GSW_return_t GSW_QoS_StormCfgSet(const GSW_Device_t *,
- GSW_QoS_stormCfg_t *);
-GSW_return_t GSW_QoS_StormCfgGet(const GSW_Device_t *,
- GSW_QoS_stormCfg_t *);
-GSW_return_t GSW_QoS_WredCfgSet(const GSW_Device_t *,
- GSW_QoS_WRED_Cfg_t *);
-GSW_return_t GSW_QoS_WredCfgGet(const GSW_Device_t *,
- GSW_QoS_WRED_Cfg_t *);
-GSW_return_t GSW_QoS_WredQueueCfgSet(const GSW_Device_t *,
- GSW_QoS_WRED_QueueCfg_t *);
-GSW_return_t GSW_QoS_WredQueueCfgGet(const GSW_Device_t *,
- GSW_QoS_WRED_QueueCfg_t *);
-GSW_return_t GSW_QoS_WredPortCfgSet(const GSW_Device_t *,
- GSW_QoS_WRED_PortCfg_t *);
-GSW_return_t GSW_QoS_WredPortCfgGet(const GSW_Device_t *,
- GSW_QoS_WRED_PortCfg_t *);
-GSW_return_t GSW_QoS_FlowctrlCfgSet(const GSW_Device_t *,
- GSW_QoS_FlowCtrlCfg_t *);
-GSW_return_t GSW_QoS_FlowctrlCfgGet(const GSW_Device_t *,
- GSW_QoS_FlowCtrlCfg_t *);
+/** \addtogroup GSW_QoS_SVC
+ * @{
+ */
-GSW_return_t GSW_QoS_FlowctrlPortCfgSet(const GSW_Device_t *,
- GSW_QoS_FlowCtrlPortCfg_t *);
-GSW_return_t GSW_QoS_FlowctrlPortCfgGet(const GSW_Device_t *,
- GSW_QoS_FlowCtrlPortCfg_t *);
-GSW_return_t GSW_QoS_QueueBufferReserveCfgSet(const GSW_Device_t *,
- GSW_QoS_QueueBufferReserveCfg_t *);
-GSW_return_t GSW_QoS_QueueBufferReserveCfgGet(const GSW_Device_t *,
- GSW_QoS_QueueBufferReserveCfg_t *);
-GSW_return_t GSW_QOS_ColorMarkingTableSet(const GSW_Device_t *, GSW_QoS_colorMarkingEntry_t *);
-GSW_return_t GSW_QOS_ColorMarkingTableGet(const GSW_Device_t *, GSW_QoS_colorMarkingEntry_t *);
-GSW_return_t GSW_QOS_ColorReMarkingTableSet(const GSW_Device_t *, GSW_QoS_colorRemarkingEntry_t *);
-GSW_return_t GSW_QOS_ColorReMarkingTableGet(const GSW_Device_t *, GSW_QoS_colorRemarkingEntry_t *);
-GSW_return_t GSW_QOS_MeterAlloc(const GSW_Device_t *, GSW_QoS_meterCfg_t *);
-GSW_return_t GSW_QOS_MeterFree(const GSW_Device_t *, GSW_QoS_meterCfg_t *);
-GSW_return_t GSW_QOS_Dscp2PcpTableSet(const GSW_Device_t *, GSW_DSCP2PCP_map_t *);
-GSW_return_t GSW_QOS_Dscp2PcpTableGet(const GSW_Device_t *, GSW_DSCP2PCP_map_t *);
-GSW_return_t GSW_QOS_PmapperTableSet(const GSW_Device_t *, GSW_PMAPPER_t *);
-GSW_return_t GSW_QOS_PmapperTableGet(const GSW_Device_t *, GSW_PMAPPER_t *);
-GSW_return_t GSW_QoS_SVLAN_PCP_ClassGet(const GSW_Device_t *,
- GSW_QoS_SVLAN_PCP_ClassCfg_t *);
-GSW_return_t GSW_QoS_SVLAN_PCP_ClassSet(const GSW_Device_t *,
- GSW_QoS_SVLAN_PCP_ClassCfg_t *);
-GSW_return_t GSW_QOS_PmapperTableSet(const GSW_Device_t *, GSW_PMAPPER_t *);
-GSW_return_t GSW_QOS_PmapperTableGet(const GSW_Device_t *, GSW_PMAPPER_t *);
-GSW_return_t GSW_QoS_QueuePortSet(const GSW_Device_t *, GSW_QoS_queuePort_t *);
-GSW_return_t GSW_QoS_QueuePortGet(const GSW_Device_t *, GSW_QoS_queuePort_t *);
+/** \brief This command configures the parameters of a rate meter instance.
+ This instance can be assigned to an ingress/egress port by
+ using \ref GSW_BridgePortConfigSet and \ref GSW_CtpPortConfigSet.
+ It can also be used by the flow classification engine.
+ The total number of available rate meters can be retrieved by the
+ capability list using \ref GSW_CapGet.
+ The current configuration of a meter instance can be retrieved
+ using \ref GSW_QoS_MeterCfgGet.
-/* RMON */
-GSW_return_t GSW_RMON_Port_Get(const GSW_Device_t *, GSW_RMON_Port_cnt_t *);
-GSW_return_t GSW_RMON_Mode_Set(const GSW_Device_t *, GSW_RMON_mode_t *);
-GSW_return_t GSW_RMON_Meter_Get(const GSW_Device_t *, GSW_RMON_Meter_cnt_t *);
-GSW_return_t GSW_RMON_Clear(const GSW_Device_t *, GSW_RMON_clear_t *);
-GSW_return_t GSW_RmonTflowClear(const GSW_Device_t *, GSW_RMON_flowGet_t *);
-GSW_return_t GSW_RMON_FlowGet(const GSW_Device_t *, GSW_RMON_flowGet_t *);
-GSW_return_t GSW_RmonTflowClear(const GSW_Device_t *, GSW_RMON_flowGet_t *);
-GSW_return_t GSW_TflowCountModeSet(const GSW_Device_t *, GSW_TflowCmodeConf_t *);
-GSW_return_t GSW_TflowCountModeGet(const GSW_Device_t *, GSW_TflowCmodeConf_t *);
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_meterCfg_t.
-/*Debug */
-GSW_return_t GSW_Debug_RMON_Port_Get(const GSW_Device_t *, GSW_Debug_RMON_Port_cnt_t *);
-GSW_return_t GSW_Debug_MeterTableStatus(const GSW_Device_t *, GSW_debug_t *);
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_MeterCfgSet(const GSW_Device_t *dev, GSW_QoS_meterCfg_t *parm);
-/*PMAC */
-GSW_return_t GSW_PMAC_CountGet(const GSW_Device_t *, GSW_PMAC_Cnt_t *);
-GSW_return_t GSW_PMAC_GLBL_CfgSet(const GSW_Device_t *, GSW_PMAC_Glbl_Cfg_t *);
-GSW_return_t GSW_PMAC_GLBL_CfgGet(const GSW_Device_t *, GSW_PMAC_Glbl_Cfg_t *);
-GSW_return_t GSW_PMAC_BM_CfgSet(const GSW_Device_t *, GSW_PMAC_BM_Cfg_t *);
-GSW_return_t GSW_PMAC_BM_CfgGet(const GSW_Device_t *, GSW_PMAC_BM_Cfg_t *);
-GSW_return_t GSW_PMAC_IG_CfgSet(const GSW_Device_t *, GSW_PMAC_Ig_Cfg_t *);
-GSW_return_t GSW_PMAC_IG_CfgGet(const GSW_Device_t *, GSW_PMAC_Ig_Cfg_t *);
-GSW_return_t GSW_PMAC_EG_CfgSet(const GSW_Device_t *, GSW_PMAC_Eg_Cfg_t *);
-GSW_return_t GSW_PMAC_EG_CfgGet(const GSW_Device_t *, GSW_PMAC_Eg_Cfg_t *);
+/** \brief Configure the parameters of a rate meter instance.
+ This instance can be assigned to an ingress/egress port
+ using \ref GSW_BridgePortConfigSet and \ref GSW_CtpPortConfigSet.
+ It can also be used by the flow classification engine.
+ The total number of available rate meters can be retrieved by the
+ capability list using \ref GSW_CapGet.
+ The current configuration of a meter instance can be retrieved
+ using \ref GSW_QoS_MeterCfgGet.
-// #ifdef CONFIG_GSWIP_MAC
-GSW_return_t GSW_MAC_TableClear(const GSW_Device_t *);
-GSW_return_t GSW_MAC_TableClearCond(const GSW_Device_t *dev,
- GSW_MAC_tableClearCond_t *parm);
-GSW_return_t GSW_MAC_TableEntryAdd(const GSW_Device_t *,
- GSW_MAC_tableAdd_t *);
-GSW_return_t GSW_MAC_TableEntryQuery(const GSW_Device_t *,
- GSW_MAC_tableQuery_t *);
-GSW_return_t GSW_MAC_TableEntryRead(const GSW_Device_t *,
- GSW_MAC_tableRead_t *);
-GSW_return_t GSW_MAC_TableEntryRemove(const GSW_Device_t *,
- GSW_MAC_tableRemove_t *);
-GSW_return_t GSW_DefaultMacFilterSet(const GSW_Device_t *, GSW_MACFILTER_default_t *);
-GSW_return_t GSW_DefaultMacFilterGet(const GSW_Device_t *, GSW_MACFILTER_default_t *);
-// #endif
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_meterCfg_t.
-// #ifdef CONFIG_GSWIP_EVLAN
-GSW_return_t GSW_ExtendedVlanAlloc(const GSW_Device_t *, GSW_EXTENDEDVLAN_alloc_t *);
-GSW_return_t GSW_ExtendedVlanSet(const GSW_Device_t *, GSW_EXTENDEDVLAN_config_t *);
-GSW_return_t GSW_ExtendedVlanGet(const GSW_Device_t *, GSW_EXTENDEDVLAN_config_t *);
-GSW_return_t GSW_ExtendedVlanFree(const GSW_Device_t *, GSW_EXTENDEDVLAN_alloc_t *);
-GSW_return_t GSW_Debug_ExvlanTableStatus(const GSW_Device_t *, GSW_debug_t *);
-GSW_return_t GSW_Debug_VlanFilterTableStatus(const GSW_Device_t *, GSW_debug_t *);
-GSW_return_t GSW_VlanFilterAlloc(const GSW_Device_t *, GSW_VLANFILTER_alloc_t *);
-GSW_return_t GSW_VlanFilterSet(const GSW_Device_t *, GSW_VLANFILTER_config_t *);
-GSW_return_t GSW_VlanFilterGet(const GSW_Device_t *, GSW_VLANFILTER_config_t *);
-GSW_return_t GSW_VlanFilterFree(const GSW_Device_t *, GSW_VLANFILTER_alloc_t *);
-GSW_return_t GSW_Vlan_RMONControl_Set(const GSW_Device_t *, GSW_VLAN_RMON_control_t *);
-GSW_return_t GSW_Vlan_RMONControl_Get(const GSW_Device_t *, GSW_VLAN_RMON_control_t *);
-GSW_return_t GSW_Vlan_RMON_Get(const GSW_Device_t *, GSW_VLAN_RMON_cnt_t *);
-GSW_return_t GSW_Vlan_RMON_Clear(const GSW_Device_t *, GSW_VLAN_RMON_cnt_t *);
-GSW_return_t GSW_VlanCounterMapSet(const GSW_Device_t *, GSW_VlanCounterMapping_config_t *);
-GSW_return_t GSW_VlanCounterMapGet(const GSW_Device_t *, GSW_VlanCounterMapping_config_t *);
-// #endif
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_MeterCfgGet(const GSW_Device_t *dev, GSW_QoS_meterCfg_t *parm);
-// #ifdef CONFIG_GSWIP_MCAST
-GSW_return_t GSW_MulticastRouterPortAdd(const GSW_Device_t *, GSW_multicastRouter_t *);
-GSW_return_t GSW_MulticastRouterPortRead(const GSW_Device_t *, GSW_multicastRouterRead_t *);
-GSW_return_t GSW_MulticastRouterPortRemove(const GSW_Device_t *, GSW_multicastRouter_t *);
-GSW_return_t GSW_MulticastSnoopCfgGet(const GSW_Device_t *, GSW_multicastSnoopCfg_t *);
-GSW_return_t GSW_MulticastSnoopCfgSet(const GSW_Device_t *, GSW_multicastSnoopCfg_t *);
-GSW_return_t GSW_MulticastTableEntryAdd(const GSW_Device_t *, GSW_multicastTable_t *);
-GSW_return_t GSW_MulticastTableEntryRead(const GSW_Device_t *, GSW_multicastTableRead_t *);
-GSW_return_t GSW_MulticastTableEntryRemove(const GSW_Device_t *, GSW_multicastTable_t *);
-// #endif
+/**
+ \brief Read out the QoS 64 DSCP mapping to the switch priority queues.
+ The table configuration can be set using \ref GSW_QoS_DSCP_ClassSet.
-// #ifdef CONFIG_GSWIP_STP
-GSW_return_t GSW_STP_PortCfgGet(const GSW_Device_t *cdev, GSW_STP_portCfg_t *parm);
-GSW_return_t GSW_STP_PortCfgSet(const GSW_Device_t *cdev, GSW_STP_portCfg_t *parm);
-GSW_return_t GSW_STP_BPDU_RuleGet(const GSW_Device_t *cdev, GSW_STP_BPDU_Rule_t *parm);
-GSW_return_t GSW_STP_BPDU_RuleSet(const GSW_Device_t *cdev, GSW_STP_BPDU_Rule_t *parm);
-// #endif
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS filter parameters
+ \ref GSW_QoS_DSCP_ClassCfg_t.
-GSW_return_t GSW_TrunkingCfgSet(const GSW_Device_t *, GSW_trunkingCfg_t *);
-GSW_return_t GSW_TrunkingCfgGet(const GSW_Device_t *, GSW_trunkingCfg_t *);
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
-GSW_return_t GSW_PBB_TunnelTempate_Alloc(const GSW_Device_t *, GSW_PBB_Tunnel_Template_Config_t *);
-GSW_return_t GSW_PBB_TunnelTempate_Free(const GSW_Device_t *, GSW_PBB_Tunnel_Template_Config_t *);
-GSW_return_t GSW_PBB_TunnelTempate_Config_Set(const GSW_Device_t *, GSW_PBB_Tunnel_Template_Config_t *);
-GSW_return_t GSW_PBB_TunnelTempate_Config_Get(const GSW_Device_t *, GSW_PBB_Tunnel_Template_Config_t *);
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_DSCP_ClassGet(const GSW_Device_t *dev, GSW_QoS_DSCP_ClassCfg_t *parm);
-#endif /* MXL_GSW_API_H_ */
+/**
+ \brief Initialize the QoS 64 DSCP mapping to the switch priority queues.
+ This configuration applies for the whole switch device. The table
+ configuration can be read using \ref GSW_QoS_DSCP_ClassGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS filter parameters
+ \ref GSW_QoS_DSCP_ClassCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_DSCP_ClassSet(const GSW_Device_t *dev, GSW_QoS_DSCP_ClassCfg_t *parm);
+
+/**
+ \brief Configures the DSCP to Drop Precedence assignment mapping table.
+ This mapping table is used to identify the switch internally used drop
+ precedence based on the DSCP value of the incoming packet.
+ The current mapping table configuration can be read
+ using \ref GSW_QoS_DSCP_DropPrecedenceCfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS
+ DSCP drop precedence parameters
+ \ref GSW_QoS_DSCP_DropPrecedenceCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_DSCP_DropPrecedenceCfgSet(const GSW_Device_t *dev, GSW_QoS_DSCP_DropPrecedenceCfg_t *parm);
+
+/**
+ \brief Read out the current DSCP to Drop Precedence assignment mapping table.
+ The table can be configured
+ using \ref GSW_QoS_DSCP_DropPrecedenceCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS
+ DSCP drop precedence parameters
+ \ref GSW_QoS_DSCP_DropPrecedenceCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_DSCP_DropPrecedenceCfgGet(const GSW_Device_t *dev, GSW_QoS_DSCP_DropPrecedenceCfg_t *parm);
+
+/**
+ \brief Port Remarking Configuration. Ingress and Egress remarking options for
+ DSCP and PCP. Remarking is done either on the used traffic class or
+ the drop precedence.
+ The current configuration can be read
+ using \ref GSW_QoS_PortRemarkingCfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the remarking configuration
+ \ref GSW_QoS_portRemarkingCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_PortRemarkingCfgSet(const GSW_Device_t *dev, GSW_QoS_portRemarkingCfg_t *parm);
+
+/**
+ \brief Read out the Port Remarking Configuration. Ingress and Egress remarking options for
+ DSCP and PCP. Remarking is done either on the used traffic class or
+ the drop precedence.
+ The current configuration can be set
+ using \ref GSW_QoS_PortRemarkingCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS filter parameters
+ \ref GSW_QoS_portRemarkingCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_PortRemarkingCfgGet(const GSW_Device_t *dev, GSW_QoS_portRemarkingCfg_t *parm);
+
+/**
+ \brief Read out the incoming PCP to traffic class mapping table.
+ The table configuration can be set using \ref GSW_QoS_PCP_ClassSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS filter parameters
+ \ref GSW_QoS_PCP_ClassCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_PCP_ClassGet(const GSW_Device_t *dev, GSW_QoS_PCP_ClassCfg_t *parm);
+
+/**
+ \brief Configure the incoming PCP to traffic class mapping table.
+ This configuration applies to the entire switch device.
+ The table configuration can be read using \ref GSW_QoS_PCP_ClassGet.
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS filter parameters
+ \ref GSW_QoS_PCP_ClassCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_PCP_ClassSet(const GSW_Device_t *dev, GSW_QoS_PCP_ClassCfg_t *parm);
+
+/**
+ \brief Read out the current Ethernet port traffic class of ingress packets.
+ It is used to identify the packet priority and the related egress
+ priority queue. The port configuration can be set
+ using \ref GSW_QoS_PortCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ QOS port priority control configuration \ref GSW_QoS_portCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_PortCfgGet(const GSW_Device_t *dev, GSW_QoS_portCfg_t *parm);
+
+/**
+ \brief Configures the Ethernet port based traffic class assignment of ingress packets.
+ It is used to identify the packet priority and the related egress
+ priority queue. For DSCP, the priority to queue assignment is done
+ using \ref GSW_QoS_DSCP_ClassSet.
+ For VLAN, the priority to queue assignment is done
+ using \ref GSW_QoS_PCP_ClassSet. The current port configuration can be
+ read using \ref GSW_QoS_PortCfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ QOS port priority control configuration \ref GSW_QoS_portCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_PortCfgSet(const GSW_Device_t *dev, GSW_QoS_portCfg_t *parm);
+
+/** \brief This configuration decides how the egress queues, attached to a single port,
+ are scheduled to transmit the queued Ethernet packets.
+ The configuration differentiates between 'Strict Priority' and
+ 'weighted fair queuing'. This applies when multiple egress queues are
+ assigned to an Ethernet port.
+ Using the WFQ feature on a port requires the configuration of weights on all
+ given queues that are assigned to that port.
+ Strict Priority means that no dedicated weight is configured and the
+ queue can transmit following its priority status.
+ The given configuration can be read out
+ using \ref GSW_QoS_SchedulerCfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_schedulerCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_SchedulerCfgSet(const GSW_Device_t *dev, GSW_QoS_schedulerCfg_t *parm);
+
+/** \brief Read out the current scheduler configuration of a given egress port. This
+ configuration can be modified
+ using \ref GSW_QoS_SchedulerCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_schedulerCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_SchedulerCfgGet(const GSW_Device_t *dev, GSW_QoS_schedulerCfg_t *parm);
+
+/** \brief This command configures a rate shaper instance with the rate and the
+ burst size. This instance can be assigned to QoS queues by
+ using \ref GSW_QoS_ShaperQueueAssign.
+ The total number of available rate shapers can be retrieved by the
+ capability list using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_ShaperCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_ShaperCfgSet(const GSW_Device_t *dev, GSW_QoS_ShaperCfg_t *parm);
+
+/** \brief This command retrieves the rate and the burst size configuration of a
+ rate shaper instance. A configuration can be modified
+ using \ref GSW_QoS_ShaperCfgSet.
+ The total number of available rate shapers can be retrieved by the
+ capability list using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_ShaperCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_ShaperCfgGet(const GSW_Device_t *dev, GSW_QoS_ShaperCfg_t *parm);
+
+/** \brief Assign one rate shaper instance to a QoS queue. The function returns with an
+ error in case there already are too many shaper instances assigned to a queue.
+ The queue instance can be enabled and configured
+ using \ref GSW_QoS_ShaperCfgSet.
+ To remove a rate shaper instance from a QoS queue,
+ please use \ref GSW_QoS_ShaperQueueDeassign.
+ The total number of available rate shaper instances can be retrieved by the
+ capability list using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_ShaperQueue_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_ShaperQueueAssign(const GSW_Device_t *dev, GSW_QoS_ShaperQueue_t *parm);
+
+/** \brief De-assign or Unassign one rate shaper instance from a QoS queue. The function returns
+ with an error in case the requested instance is not currently assigned
+ to the queue.
+ The queue instance can be enabled and configured by
+ using \ref GSW_QoS_ShaperCfgSet.
+ To assign a rate shaper instance to a QoS queue,
+ please use \ref GSW_QoS_ShaperQueueAssign.
+ The total number of available rate shapers can be retrieved by the
+ capability list using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_ShaperQueue_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_ShaperQueueDeassign(const GSW_Device_t *dev, GSW_QoS_ShaperQueue_t *parm);
+
+/** \brief Check whether a rate shaper instance is assigned to the egress queue.
+ The egress queue index is the function input parameter.
+ The switch API sets the boolean parameter 'bAssigned == 1' in case a
+ rate shaper is assigned and then sets 'nRateShaperId' to describe the rater
+ shaper instance.
+ The parameter 'bAssigned == 0' in case no rate shaper instance
+ is currently assigned to the queue instance.
+ The commands \ref GSW_QoS_ShaperQueueAssign allow a
+ rate shaper instance to be assigned, and \ref GSW_QoS_ShaperCfgSet allows
+ for configuration of a shaper instance.
+ The total number of available rate shapers can be retrieved by the
+ capability list using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_ShaperQueueGet_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_ShaperQueueGet(const GSW_Device_t *dev, GSW_QoS_ShaperQueueGet_t *parm);
+
+/** \brief This command configures one meter instances for storm control.
+ These instances can be used for ingress broadcast-, multicast- and
+ unknown unicast- packets. Some platforms support addition of additional meter
+ instances for this type of packet.
+ Repeated calls of \ref GSW_QoS_StormCfgSet allow addition of
+ additional meter instances.
+ An assignment can be retrieved using \ref GSW_QoS_StormCfgGet.
+ Setting the broadcast, multicast and unknown unicast packets boolean switch to zero
+ deletes all metering instance assignments.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_stormCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_StormCfgSet(const GSW_Device_t *dev, GSW_QoS_stormCfg_t *parm);
+
+/** \brief Reads out the current meter instance assignment for storm control. This
+ configuration can be modified using \ref GSW_QoS_StormCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_stormCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_StormCfgGet(const GSW_Device_t *dev, GSW_QoS_stormCfg_t *parm);
+
+/** \brief Configures the global WRED drop probability profile and thresholds of the device.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_WRED_Cfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_WredCfgSet(const GSW_Device_t *dev, GSW_QoS_WRED_Cfg_t *parm);
+
+/** \brief Read out the global WRED drop probability profile and thresholds of the device.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_WRED_Cfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_WredCfgGet(const GSW_Device_t *dev, GSW_QoS_WRED_Cfg_t *parm);
+
+/** \brief Configures the WRED drop thresholds for a dedicated egress queue.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+ The command \ref GSW_QoS_WredQueueCfgGet retrieves the current
+ configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_WRED_QueueCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_WredQueueCfgSet(const GSW_Device_t *dev, GSW_QoS_WRED_QueueCfg_t *parm);
+
+/** \brief Read out the WRED drop thresholds for a dedicated egress queue.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+ The configuration can be changed by
+ using \ref GSW_QoS_WredQueueCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_WRED_QueueCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_WredQueueCfgGet(const GSW_Device_t *dev, GSW_QoS_WRED_QueueCfg_t *parm);
+
+/** \brief Configures the WRED drop thresholds for a dedicated egress port.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+ The command \ref GSW_QoS_WredPortCfgGet retrieves the current
+ configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_WRED_PortCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_WredPortCfgSet(const GSW_Device_t *dev, GSW_QoS_WRED_PortCfg_t *parm);
+
+/** \brief Read out the WRED drop thresholds for a dedicated egress port.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+ The configuration can be changed by
+ using \ref GSW_QoS_WredPortCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_WRED_PortCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_WredPortCfgGet(const GSW_Device_t *dev, GSW_QoS_WRED_PortCfg_t *parm);
+
+/** \brief Configures the global flow control thresholds for conforming and non-conforming packets.
+ The configured thresholds apply to the global switch segment buffer.
+ The current configuration can be retrieved by \ref GSW_QoS_FlowctrlCfgGet.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_FlowCtrlCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_FlowctrlCfgSet(const GSW_Device_t *dev, GSW_QoS_FlowCtrlCfg_t *parm);
+
+/** \brief Read out the global flow control thresholds for conforming and non-conforming packets.
+ The configured thresholds apply to the global switch segment buffer.
+ The configuration can be changed by \ref GSW_QoS_FlowctrlCfgSet.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_FlowCtrlCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_FlowctrlCfgGet(const GSW_Device_t *dev, GSW_QoS_FlowCtrlCfg_t *parm);
+
+/** \brief Configures the ingress port flow control thresholds for occupied buffer segments.
+ The current configuration can be retrieved by \ref GSW_QoS_FlowctrlPortCfgGet.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_FlowCtrlPortCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_FlowctrlPortCfgSet(const GSW_Device_t *dev, GSW_QoS_FlowCtrlPortCfg_t *parm);
+
+/** \brief Read out the ingress port flow control thresholds for occupied buffer segments.
+ The configuration can be changed by \ref GSW_QoS_FlowctrlPortCfgSet.
+ Given parameters are rounded to the segment size of the HW platform.
+ The supported segment size is given by the capability list by
+ using \ref GSW_CapGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_FlowCtrlPortCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_FlowctrlPortCfgGet(const GSW_Device_t *dev, GSW_QoS_FlowCtrlPortCfg_t *parm);
+
+/** \brief Configure the egress queue buffer reservation.
+ WRED GREEN packets are never dropped by any WRED algorithm (queue,
+ port or global buffer level) in case they are below this reservation threshold.
+ The amount of reserved segments cannot be occupied by other queues of the switch.
+ The egress queue related configuration can be retrieved by
+ calling \ref GSW_QoS_QueueBufferReserveCfgGet.
+
+ \remarks
+ The command \ref GSW_QoS_QueuePortSet allows to assign egress queue to ports with related traffic classes.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_QueueBufferReserveCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_QueueBufferReserveCfgSet(const GSW_Device_t *dev, GSW_QoS_QueueBufferReserveCfg_t *parm);
+
+/** \brief Read out the egress queue specific buffer reservation.
+ Configuration can be read by \ref GSW_QoS_QueueBufferReserveCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_QueueBufferReserveCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_QueueBufferReserveCfgGet(const GSW_Device_t *dev, GSW_QoS_QueueBufferReserveCfg_t *parm);
+
+/**
+ \brief Update Color Marking Table.
+ Should be used to setup color marking table at early stage.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_QoS_colorMarkingEntry_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_ColorMarkingTableSet(const GSW_Device_t *dev, GSW_QoS_colorMarkingEntry_t *parm);
+
+/**
+ \brief Get Color Marking Table.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_QoS_colorMarkingEntry_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_ColorMarkingTableGet(const GSW_Device_t *dev, GSW_QoS_colorMarkingEntry_t *parm);
+
+/**
+ \brief Update Color Remarking Table.
+ Should be used to setup color remarking table at early stage.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_QoS_colorRemarkingEntry_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_ColorReMarkingTableSet(const GSW_Device_t *dev, GSW_QoS_colorRemarkingEntry_t *parm);
+
+/**
+ \brief Get Color Remarking Table.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_QoS_colorRemarkingEntry_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_ColorReMarkingTableGet(const GSW_Device_t *dev, GSW_QoS_colorRemarkingEntry_t *parm);
+
+/**
+ \brief Allocate Meter.
+ This is a part of APIs to manage meters. This API works in 2 modes. If
+ \ref GSW_QoS_meterCfg_t::nMeterId is \ref INVALID_HANDLE, this API will
+ allocate a free meter, config it with all parameters in
+ \ref GSW_QoS_meterCfg_t, and return the meter ID in
+ \ref GSW_QoS_meterCfg_t::nMeterId. Otherwise,
+ \ref GSW_QoS_meterCfg_t::nMeterId should be a valid meter ID, and this API
+ increase the reference counter of this meter. Other fields are ignored.
+ This API is wrapper of \ref GSW_QoS_MeterCfgSet with meter resource
+ management.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_QoS_meterCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_MeterAlloc(const GSW_Device_t *dev, GSW_QoS_meterCfg_t *parm);
+
+/**
+ \brief Free Meter.
+ Decrease reference counter of the meter. If reference counter is 0, disable
+ the meter then free it.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_QoS_meterCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_MeterFree(const GSW_Device_t *dev, GSW_QoS_meterCfg_t *parm);
+
+/**
+ \brief Set DSCP to PCP Mapping Table.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_DSCP2PCP_map_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_Dscp2PcpTableSet(const GSW_Device_t *dev, GSW_DSCP2PCP_map_t *parm);
+
+/**
+ \brief Get DSCP to PCP Mapping Table.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_DSCP2PCP_map_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_Dscp2PcpTableGet(const GSW_Device_t *dev, GSW_DSCP2PCP_map_t *parm);
+
+/**
+ \brief Set P-mapper Configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PMAPPER_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_PmapperTableSet(const GSW_Device_t *dev, GSW_PMAPPER_t *parm);
+
+/**
+ \brief Get P-mapper Configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_PMAPPER_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QOS_PmapperTableGet(const GSW_Device_t *dev, GSW_PMAPPER_t *parm);
+
+/**
+ \brief Read out the PCP to traffic class mapping table.
+ The table configuration can be set using \ref GSW_QoS_SVLAN_PCP_ClassSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS filter parameters
+ \ref GSW_QoS_SVLAN_PCP_ClassCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_SVLAN_PCP_ClassGet(const GSW_Device_t *dev, GSW_QoS_SVLAN_PCP_ClassCfg_t *parm);
+
+/**
+ \brief Configure the PCP to traffic class mapping table.
+ This configuration applies to the entire switch device.
+ The table configuration can be read using \ref GSW_QoS_SVLAN_PCP_ClassGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the QoS filter parameters
+ \ref GSW_QoS_SVLAN_PCP_ClassCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_SVLAN_PCP_ClassSet(const GSW_Device_t *dev, GSW_QoS_SVLAN_PCP_ClassCfg_t *parm);
+
+/** \brief Sets queue specific configuration.
+ Recommend to modify (read, change write) instead of overwrite.
+ Call \ref GSW_QoS_QueueCfgGet to retrieve current config, modify it, then
+ use this API to set.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters structure \ref GSW_QoS_queueCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_QueueCfgSet(const GSW_Device_t *dev, GSW_QoS_queueCfg_t *parm);
+
+/** \brief Read out queue specific configuration.
+ Please note that the device comes along with a default configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters structure \ref GSW_QoS_queueCfg_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_QueueCfgGet(const GSW_Device_t *dev, GSW_QoS_queueCfg_t *parm);
+
+/** \brief Sets the Queue ID for one traffic class of one port.
+ The total amount of supported ports, queues and traffic classes can be
+ retrieved from the capability list using \ref GSW_CapGet.
+ Please note that the device comes along with a
+ default configuration and assignment.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_queuePort_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_QueuePortSet(const GSW_Device_t *dev, GSW_QoS_queuePort_t *parm);
+
+/** \brief Read out the traffic class and port assignment done
+ using \ref GSW_QoS_QueuePortSet.
+ Please note that the device comes along with a
+ default configuration and assignment.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the parameters
+ structure \ref GSW_QoS_queuePort_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_QoS_QueuePortGet(const GSW_Device_t *dev, GSW_QoS_queuePort_t *parm);
+
+/** @}*/ /* GSW_QoS_SVC */
+
+
+/* RMON */
+
+/** \addtogroup GSW_RMON
+ * @{
+ */
+
+/**
+ \brief Read out the Ethernet port statistic counter (RMON counter).
+ The zero-based 'nPortId' structure element describes the physical switch
+ port for the requested statistic information.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to pre-allocated
+ \ref GSW_RMON_Port_cnt_t structure. The structure element 'nPortId' is
+ an input parameter that describes from which port to read the RMON counter.
+ All remaining structure elements are filled with the counter values.
+
+ \remarks The function returns an error in case the given 'nPortId' is
+ out of range.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RMON_Port_Get(const GSW_Device_t *dev, GSW_RMON_Port_cnt_t *parm);
+
+/**
+ \brief Configures a Traffic Statistic Counter (RMON counter).
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a pre-allocated
+ \ref GSW_RMON_mode_t structure. The structure elements 'eRmonType' and 'eRmonMode' are input parameters to set RMON counting mode to bytes or Packet based.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RMON_Mode_Set(const GSW_Device_t *dev, GSW_RMON_mode_t *parm);
+
+/**
+ \brief Read out the Meter Instance statistic counter (RMON counter).
+ The zero-based 'nMeterId' structure element describes the Meter Identifier
+ instance for the requested statistic information.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to pre-allocated stats placeholder
+ \ref GSW_RMON_Meter_cnt_t structure. The structure element 'nMeterId' is
+ an input parameter that describes from which Meter to read the RMON counter.
+ All remaining structure elements are filled with the counter values.
+
+ \remarks The function returns an error in case the given 'nMeterId' is
+ out of range.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RMON_Meter_Get(const GSW_Device_t *dev, GSW_RMON_Meter_cnt_t *parm);
+
+/**
+ \brief Clears all or specific identifier (e.g. Port Id or Meter Id) Statistic counter (RMON counter).
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a pre-allocated
+ \ref GSW_RMON_clear_t structure. The structure element 'nRmonId' is
+ an input parameter stating on which identifier to clear RMON counters.
+
+ \remarks The function returns an error in case the given 'nRmonId' is
+ out of range for given 'nRmonType'
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RMON_Clear(const GSW_Device_t *dev, GSW_RMON_clear_t *parm);
+
+/**
+ \brief Clears all or specific identifier (e.g. Port Id or Meter Id) Statistic counter (RMON counter).
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a pre-allocated
+ \ref GSW_RMON_clear_t structure. The structure element 'nRmonId' is
+ an input parameter stating on which identifier to clear RMON counters.
+
+ \remarks The function returns an error in case the given 'nRmonId' is
+ out of range for given 'nRmonType'
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RmonTflowClear(const GSW_Device_t *dev, GSW_RMON_flowGet_t *parm);
+
+/**
+ \brief Read out additional traffic flow (RMON) counters. GSWIP-3.1 only.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a pre-allocated
+ \ref GSW_RMON_flowGet_t structure.
+
+ \remarks The function returns an error in case the given 'nIndex' is
+ out of range.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RMON_FlowGet(const GSW_Device_t *dev, GSW_RMON_flowGet_t *parm);
+
+/**
+ \brief Clears all or specific identifier (e.g. Port Id or Meter Id) Statistic counter (RMON counter).
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a pre-allocated
+ \ref GSW_RMON_clear_t structure. The structure element 'nRmonId' is
+ an input parameter stating on which identifier to clear RMON counters.
+
+ \remarks The function returns an error in case the given 'nRmonId' is
+ out of range for given 'nRmonType'
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_RmonTflowClear(const GSW_Device_t *dev, GSW_RMON_flowGet_t *parm);
+
+/** @}*/ /* GSW_RMON */
+
+
+/** \addtogroup GSW_RMON
+ * @{
+ */
+
+/**
+ \brief Sets TFLOW counter mode type.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a pre-allocated
+ \ref GSW_RMON_clear_t structure.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_TflowCountModeSet(const GSW_Device_t *dev, GSW_TflowCmodeConf_t *parm);
+
+/**
+ \brief Sets TFLOW counter mode type.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a pre-allocated
+ \ref GSW_RMON_clear_t structure.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_TflowCountModeGet(const GSW_Device_t *dev, GSW_TflowCmodeConf_t *parm);
+
+/** @}*/ /* GSW_RMON */
+
+
+/* Debug */
+
+/**
+ \brief Get per port RMON counters
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a counter structure \ref GSW_Debug_RMON_Port_cnt_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_Debug_RMON_Port_Get(const GSW_Device_t *dev, GSW_Debug_RMON_Port_cnt_t *parm);
+
+/** @cond INTERNAL */
+GSW_return_t GSW_Debug_MeterTableStatus(const GSW_Device_t *dev, GSW_debug_t *parm);
+/** @endcond */
+
+/* PMAC */
+
+/** \addtogroup GSW_PMAC
+ * @{
+ */
+
+/**
+ \brief Reads the Counters for given DMA Channel Identifier associated to PMAC.
+ It is used to read ingress statistics counters providing discarded packets and bytes on given PMAC port.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ Statistics Counters of DMA channel associated to PMAC \ref GSW_PMAC_Cnt_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_CountGet(const GSW_Device_t *dev, GSW_PMAC_Cnt_t *parm);
+
+/**
+ \brief Writes the global PMAC settings applicable to GSWIP-3.0 PMAC ports.
+ It is used to configure the global settings such as Padding, Checksum, Length and Egress PMAC Selector fields.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ global config of PMAC \ref GSW_PMAC_Glbl_Cfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_GLBL_CfgSet(const GSW_Device_t *dev, GSW_PMAC_Glbl_Cfg_t *parm);
+
+/**
+ \brief Reads the global PMAC settings currently configured to GSWIP-3.0 PMAC ports.
+ It is used to configure the global stetinsg such as PAdding, Checksum, Length and Egress PMAC Selector fields.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ current global config of PMAC \ref GSW_PMAC_Glbl_Cfg_t (returned).
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_GLBL_CfgGet(const GSW_Device_t *dev, GSW_PMAC_Glbl_Cfg_t *parm);
+
+/**
+ \brief Configures the Backpressure Mapping Table for PMAC.
+ It is used to configure backpressure mapping table between Tx Queues for Egress and Rx Ports for Ingress congestion on given DMA channel.
+ The Backpressure mapping can also be read using \ref GSW_PMAC_BM_CfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ Backpressure mapping configuration \ref GSW_PMAC_BM_Cfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_BM_CfgSet(const GSW_Device_t *dev, GSW_PMAC_BM_Cfg_t *parm);
+
+/**
+ \brief Queries the Backpressure Mapping Table for PMAC.
+ It is used to read backpressure mapping table between Tx Queues for Egress and Rx Ports for Ingress congestion on given DMA channel.
+ The mapping config can be written using \ref GSW_PMAC_BM_CfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ Backpressure mapping configuration \ref GSW_PMAC_BM_Cfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_BM_CfgGet(const GSW_Device_t *dev, GSW_PMAC_BM_Cfg_t *parm);
+
+/**
+ \brief Configures the Ingress PMAC Attributes Config for Receive DMA Channel.
+ It is used to configure ingress attributes on given Receive DMA channel.
+ The PMAC Ingress config can also be read using \ref GSW_PMAC_IG_CfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ Ingress PMAC Attributes configuration \ref GSW_PMAC_Ig_Cfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_IG_CfgSet(const GSW_Device_t *dev, GSW_PMAC_Ig_Cfg_t *parm);
+
+/**
+ \brief Queries the Ingress PMAC Attributes Config for given receive DMA channel.
+ It is used to read ingress PMAC attributes config on given DMA Rx channel.
+ The PMAC Ingress config can also be set using \ref GSW_PMAC_IG_CfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ Ingress PMAC Attributes configuration \ref GSW_PMAC_Ig_Cfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_IG_CfgGet(const GSW_Device_t *dev, GSW_PMAC_Ig_Cfg_t *parm);
+
+/**
+ \brief Configures the Egress Attributes Config for a given PMAC port.
+ It is used to configure egress attributes on given PMAC port.
+ The PMAC Egress config can also be read using \ref GSW_PMAC_EG_CfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ Egress PMAC Attributes configuration \ref GSW_PMAC_Eg_Cfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_EG_CfgSet(const GSW_Device_t *dev, GSW_PMAC_Eg_Cfg_t *parm);
+
+/**
+ \brief Queries the Egress Attributes Config for given PMAC port.
+ It is used to read egress attributes config on given PMAC port.
+ The PMAC Egress config can also be set using \ref GSW_PMAC_EG_CfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ Egress PMAC Attributes configuration \ref GSW_PMAC_Eg_Cfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PMAC_EG_CfgGet(const GSW_Device_t *dev, GSW_PMAC_Eg_Cfg_t *parm);
+
+/**@}*/ /* GSW_PMAC */
+
+
+/* MAC Table */
+#ifdef CONFIG_GSWIP_MAC
+
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
+
+/**
+ \brief Remove all MAC entries from the MAC table.
+
+ \param dev Pointer to switch device.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MAC_TableClear(const GSW_Device_t *dev);
+
+/**
+ \brief Remove MAC entries meeting criteria from the MAC table.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to condition structure
+ \ref GSW_MAC_tableClearCond_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MAC_TableClearCond(const GSW_Device_t *dev, GSW_MAC_tableClearCond_t *parm);
+
+/**
+ \brief Add a MAC table entry. If an entry already exists for the given MAC Address
+ in Filtering Database, this entry is overwritten. If not,
+ a new entry is added.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a MAC table entry
+ \ref GSW_MAC_tableAdd_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MAC_TableEntryAdd(const GSW_Device_t *dev, GSW_MAC_tableAdd_t *parm);
+
+/**
+ \brief Search the MAC Address table for a specific address entry.
+ A MAC address is provided by the application and Switch API
+ performs a search operation on the hardware's MAC address table.
+ Many hardware platforms provide an optimized and fast address search algorithm.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a MAC table entry
+ \ref GSW_MAC_tableQuery_t structure that is filled out by the switch
+ implementation.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MAC_TableEntryQuery(const GSW_Device_t *dev, GSW_MAC_tableQuery_t *parm);
+
+/**
+ \brief Read an entry of the MAC table.
+ If the parameter 'bInitial=TRUE', the GET operation starts at the beginning
+ of the table. Otherwise it continues the GET operation at the entry that
+ follows the previous access.
+ The function sets all fields to zero in case the end of the table is reached.
+ In order to read out the complete table, this function can be called in a loop.
+ The Switch API sets 'bLast=1' when the last entry is read out.
+ This 'bLast' parameter could be the loop exit criteria.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a MAC table entry
+ \ref GSW_MAC_tableRead_t structure that is filled out by the switch driver.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MAC_TableEntryRead(const GSW_Device_t *dev, GSW_MAC_tableRead_t *parm);
+
+/**
+ \brief Remove a single MAC entry from the MAC table.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a MAC table entry
+ \ref GSW_MAC_tableRemove_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MAC_TableEntryRemove(const GSW_Device_t *dev, GSW_MAC_tableRemove_t *parm);
+
+/**
+ \brief Set default MAC address filter
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a MAC address and filter type
+ \ref GSW_MACFILTER_default_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_DefaultMacFilterSet(const GSW_Device_t *dev, GSW_MACFILTER_default_t *parm);
+
+/**
+ \brief Get default MAC address filter
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a MAC address and filter type
+ \ref GSW_MACFILTER_default_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_DefaultMacFilterGet(const GSW_Device_t *dev, GSW_MACFILTER_default_t *parm);
+
+/**
+ \brief Detect MAC violation for input map of bridge ports
+ Detect MAC violation for bridge ports in input bitmap and output a bitmap
+ from which ports the MAC violation is found. This API is time consuming
+ at millisecond level.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_MAC_tableLoopDetect_t structure.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MAC_TableLoopDetect(const GSW_Device_t *dev, GSW_MAC_tableLoopDetect_t *parm);
+/**@}*/ /* GSW_ETHERNET_BRIDGING */
+
+#endif
+
+/* VLAN */
+
+/** \addtogroup GSW_VLAN
+ * @{
+ */
+
+#ifdef CONFIG_GSWIP_EVLAN
+/**
+ \brief Allocate Extended VLAN Configuration block. Valid for GSWIP-3.1.
+ It allocates consecutive VLAN configuration entries and return the block ID
+ for further operations: \ref GSW_ExtendedVlanFree, \ref GSW_ExtendedVlanSet
+ and \ref GSW_ExtendedVlanGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_EXTENDEDVLAN_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_ExtendedVlanAlloc(const GSW_Device_t *dev, GSW_EXTENDEDVLAN_alloc_t *parm);
+
+/**
+ \brief Set Extended VLAN Configuration entry. Valid for GSWIP-3.1.
+ It is used to set Extended VLAN Configuration entry with index
+ \ref GSW_EXTENDEDVLAN_config_t::nEntryIndex, ranging between 0 and
+ \ref GSW_EXTENDEDVLAN_alloc_t::nNumberOfEntries - 1, with valid
+ \ref GSW_EXTENDEDVLAN_config_t::nExtendedVlanBlockId returned by
+ \ref GSW_ExtendedVlanAlloc.
+ If \ref GSW_EXTENDEDVLAN_config_t::nExtendedVlanBlockId is
+ \ref INVALID_HANDLE, this is absolute index of Extended VLAN Configuration
+ entry in hardware, used for debugging purpose.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_EXTENDEDVLAN_config_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_ExtendedVlanSet(const GSW_Device_t *dev, GSW_EXTENDEDVLAN_config_t *parm);
+
+/**
+ \brief Get Extended VLAN Configuration entry. Valid for GSWIP-3.1.
+ It is used to get Extended VLAN Configuration entry with index
+ \ref GSW_EXTENDEDVLAN_config_t::nEntryIndex, ranging between 0 and
+ \ref GSW_EXTENDEDVLAN_alloc_t::nNumberOfEntries - 1, with valid
+ \ref GSW_EXTENDEDVLAN_config_t::nExtendedVlanBlockId returned by
+ \ref GSW_ExtendedVlanAlloc.
+ If \ref GSW_EXTENDEDVLAN_config_t::nExtendedVlanBlockId is
+ \ref INVALID_HANDLE, this is absolute index of Extended VLAN Configuration
+ entry in hardware, used for debugging purpose.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_EXTENDEDVLAN_config_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_ExtendedVlanGet(const GSW_Device_t *dev, GSW_EXTENDEDVLAN_config_t *parm);
+
+/**
+ \brief Release Extended VLAN Configuration block. Valid for GSWIP-3.1.
+ It is used to release Extended VLAN Configuration block allocated by
+ \ref GSW_ExtendedVlanAlloc.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_EXTENDEDVLAN_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_ExtendedVlanFree(const GSW_Device_t *dev, GSW_EXTENDEDVLAN_alloc_t *parm);
+
+/** @cond INTERNAL */
+GSW_return_t GSW_Debug_ExvlanTableStatus(const GSW_Device_t *dev, GSW_debug_t *parm);
+
+GSW_return_t GSW_Debug_VlanFilterTableStatus(const GSW_Device_t *dev, GSW_debug_t *parm);
+/** @endcond */
+
+/**
+ \brief Allocate VLAN Filter block. Valid for GSWIP-3.1.
+ It allocates consecutive VLAN Filter entries and return the block ID
+ for further operations: \ref GSW_VlanFilterFree, \ref GSW_VlanFilterSet
+ and \ref GSW_VlanFilterGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VLANFILTER_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_VlanFilterAlloc(const GSW_Device_t *dev, GSW_VLANFILTER_alloc_t *parm);
+
+/**
+ \brief Set VLAN Filter entry. Valid for GSWIP-3.1.
+ It is used to set VLAN Filter entry with index
+ \ref GSW_VLANFILTER_config_t::nEntryIndex, ranging between 0 and
+ \ref GSW_VLANFILTER_alloc_t::nNumberOfEntries - 1, with valid
+ \ref GSW_VLANFILTER_config_t::nVlanFilterBlockId returned by
+ \ref GSW_VlanFilterAlloc.
+ If \ref GSW_VLANFILTER_config_t::nVlanFilterBlockId is \ref INVALID_HANDLE,
+ this is absolute index of VLAN Filter entry in hardware, used for debugging
+ purpose.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VLANFILTER_config_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_VlanFilterSet(const GSW_Device_t *dev, GSW_VLANFILTER_config_t *parm);
+
+/**
+ \brief Get VLAN Filter Entry. Valid for GSWIP-3.1.
+ It is used to get VLAN filter entry with index
+ \ref GSW_VLANFILTER_config_t::nEntryIndex, ranging between 0 and
+ \ref GSW_VLANFILTER_alloc_t::nNumberOfEntries - 1, with valid
+ \ref GSW_VLANFILTER_config_t::nVlanFilterBlockId returned by
+ \ref GSW_VlanFilterAlloc.
+ If \ref GSW_VLANFILTER_config_t::nVlanFilterBlockId is \ref INVALID_HANDLE,
+ this is absolute index of VLAN Filter entry in hardware, used for debugging
+ purpose.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VLANFILTER_config_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_VlanFilterGet(const GSW_Device_t *dev, GSW_VLANFILTER_config_t *parm);
+
+/**
+ \brief Delete VLAN Filter Block. Valid for GSWIP-3.1.
+ It is used to release VLAN Filter block allocated by
+ \ref GSW_VlanFilterAlloc.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VLANFILTER_alloc_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_VlanFilterFree(const GSW_Device_t *dev, GSW_VLANFILTER_alloc_t *parm);
+
+/**
+ \brief Configure VLAN RMON Counters.
+ It is used to enable/disable VLAN RMON counters, configure whether to count
+ broadcast packets, max number of VLAN entries to count.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VLAN_RMON_control_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_Vlan_RMONControl_Set(const GSW_Device_t *dev, GSW_VLAN_RMON_control_t *parm);
+
+/**
+ \brief Read VLAN RMON Counters Configuration.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VLAN_RMON_control_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_Vlan_RMONControl_Get(const GSW_Device_t *dev, GSW_VLAN_RMON_control_t *parm);
+
+/**
+ \brief Read VLAN RMON Counters of Specific Entry.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VLAN_RMON_cnt_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_Vlan_RMON_Get(const GSW_Device_t *dev, GSW_VLAN_RMON_cnt_t *parm);
+
+/**
+ \brief Clear VLAN RMON Counters of Specific Entry or All Entries.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VLAN_RMON_cnt_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_Vlan_RMON_Clear(const GSW_Device_t *dev, GSW_VLAN_RMON_cnt_t *parm);
+
+/**
+ \brief Map VLAN Counter to CTP.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VlanCounterMapping_config_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_VlanCounterMapSet(const GSW_Device_t *dev, GSW_VlanCounterMapping_config_t *parm);
+
+/**
+ \brief Get Mapping between VLAN Counter and CTP.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_VlanCounterMapping_config_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_VlanCounterMapGet(const GSW_Device_t *dev, GSW_VlanCounterMapping_config_t *parm);
+
+#endif
+/**@}*/ /* GSW_VLAN */
+
+
+/* Multicast */
+
+/** \addtogroup GSW_MULTICAST
+ * @{
+ */
+
+#ifdef CONFIG_GSWIP_MCAST
+/**
+ \brief Add static router port to the switch hardware multicast table.
+ These added router ports will not be removed by the router port learning aging process.
+ The router port learning is enabled over the parameter 'bLearningRouter'
+ over the \ref GSW_MulticastSnoopCfgGet command.
+ Router port learning and static added entries can both be used together.
+ In case of a software IGMP stack/daemon environment, the router port learning does
+ not have to be configured on the switch hardware. Instead the router port
+ management is handled by the IGMP stack/daemon.
+ A port can be removed using \ref GSW_MulticastRouterPortRemove.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_multicastRouter_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MulticastRouterPortAdd(const GSW_Device_t *dev, GSW_multicastRouter_t *parm);
+
+/**
+ \brief Check if a port has been selected as a router port, either by automatic learning or by manual setting.
+ A port can be added using \ref GSW_MulticastRouterPortAdd.
+ A port can be removed again using \ref GSW_MulticastRouterPortRemove.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_multicastRouterRead_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs (e.g. Ethernet port parameter out of range)
+*/
+GSW_return_t GSW_MulticastRouterPortRead(const GSW_Device_t *dev, GSW_multicastRouterRead_t *parm);
+
+/**
+ \brief Remove an Ethernet router port from the switch hardware multicast table.
+ A port can be added using \ref GSW_MulticastRouterPortAdd.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_multicastRouter_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs (e.g. Ethernet port parameter out of range)
+*/
+GSW_return_t GSW_MulticastRouterPortRemove(const GSW_Device_t *dev, GSW_multicastRouter_t *parm);
+
+/**
+ \brief Read out the current switch multicast configuration.
+ The configuration can be set using \ref GSW_MulticastSnoopCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the
+ multicast configuration \ref GSW_multicastSnoopCfg_t.
+
+ \remarks IGMP/MLD snooping is disabled when
+ 'eIGMP_Mode = GSW_MULTICAST_SNOOP_MODE_SNOOPFORWARD'.
+ Then all other structure parameters are unused.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MulticastSnoopCfgGet(const GSW_Device_t *dev, GSW_multicastSnoopCfg_t *parm);
+
+/**
+ \brief Configure the switch multicast configuration. The currently used
+ configuration can be read using \ref GSW_MulticastSnoopCfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to the
+ multicast configuration \ref GSW_multicastSnoopCfg_t.
+
+ \remarks IGMP/MLD snooping is disabled when
+ 'eIGMP_Mode = GSW_MULTICAST_SNOOP_MODE_SNOOPFORWARD'.
+ Then all other structure parameters are unused.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MulticastSnoopCfgSet(const GSW_Device_t *dev, GSW_multicastSnoopCfg_t *parm);
+
+/**
+ \brief Adds a multicast group configuration to the multicast table.
+ No new entry is added in case this multicast group already
+ exists in the table. This commands adds a host member to
+ the multicast group.
+ A member can be removed again using \ref GSW_MulticastTableEntryRemove.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer
+ to \ref GSW_multicastTable_t.
+
+ \remarks The Source IP parameter is ignored in case IGMPv3 support is
+ not enabled in the hardware.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MulticastTableEntryAdd(const GSW_Device_t *dev, GSW_multicastTable_t *parm);
+
+/**
+ \brief Read out the multicast membership table that is located inside the switch
+ hardware. The 'bInitial' parameter restarts the read operation at the beginning of
+ the table. Every following \ref GSW_MulticastTableEntryRead call reads out
+ the next found entry. The 'bLast' parameter is set by the switch API in case
+ the last entry of the table is reached.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_multicastTableRead_t.
+
+ \remarks The 'bInitial' parameter is reset during the read operation.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MulticastTableEntryRead(const GSW_Device_t *dev, GSW_multicastTableRead_t *parm);
+
+/**
+ \brief Read specific multicast entry inside the switch hardware.
+ \ref GSW_MulticastTableEntryRead iterates all valid entries in switch hardware,
+ and this API reads single entry with specified index.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_multicastTableRead_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MulticastTableEntryIdxRead(const GSW_Device_t *dev, GSW_multicastTableRead_t *parm);
+
+/**
+ \brief Remove an host member from a multicast group. The multicast group entry
+ is completely removed from the multicast table in case it has no
+ host member port left.
+ Group members can be added using \ref GSW_MulticastTableEntryAdd.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer
+ to \ref GSW_multicastTable_t.
+
+ \remarks The Source IP parameter is ignored in case IGMPv3 support is
+ not enabled in the hardware.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_MulticastTableEntryRemove(const GSW_Device_t *dev, GSW_multicastTable_t *parm);
+
+/**
+ \brief Search the Multicast HW Table and return whether Entry is Found or Not
+ if Found, Hardware Entry Index also returned.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer
+ to \ref GSW_multicastTable_t.
+
+ \remarks The Source IP parameter is ignored in case IGMPv3 support is
+ not enabled in the hardware.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if Entry is Found
+ - An error code GSW_statusEntryNotFound in case entry not found
+*/
+GSW_return_t GSW_MulticastTableEntrySearch(const GSW_Device_t *dev, GSW_multicastTable_t *parm);
+
+#endif
+
+/** @}*/ /* GSW_MULTICAST */
+
+
+/* STP */
+#ifdef CONFIG_GSWIP_STP
+
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
+
+/**
+ \brief Read out the current Spanning Tree Protocol state of an Ethernet port.
+ This configuration can be set using \ref GSW_STP_PortCfgSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_STP_portCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_STP_PortCfgGet(const GSW_Device_t *dev, GSW_STP_portCfg_t *parm);
+
+/**
+ \brief Configure the Spanning Tree Protocol state of an Ethernet port.
+ The switch supports four Spanning Tree Port states (Disable/Discarding,
+ Blocking/Listening, Learning and Forwarding state) for every port, to enable
+ the Spanning Tree Protocol function when co-operating with software on
+ the CPU port.
+ Identified Spanning Tree Protocol packets can be redirected to the CPU port.
+ Depending on the hardware implementation, the CPU port assignment is fixed
+ or can be configured using \ref GSW_CPU_PortCfgSet.
+ The current port state can be read back
+ using \ref GSW_STP_PortCfgGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_STP_portCfg_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_STP_PortCfgSet(const GSW_Device_t *dev, GSW_STP_portCfg_t *parm);
+
+/**
+ \brief Read the Spanning Tree configuration.
+ The configuration can be modified using \ref GSW_STP_BPDU_RuleSet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_STP_BPDU_Rule_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_STP_BPDU_RuleGet(const GSW_Device_t *dev, GSW_STP_BPDU_Rule_t *parm);
+
+/**
+ \brief Set the Spanning Tree configuration. This configuration includes the
+ filtering of detected spanning tree packets. These packets could be
+ redirected to one dedicated port (e.g. CPU port) or they could be discarded.
+ The current configuration can be read using \ref GSW_STP_BPDU_RuleGet.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to \ref GSW_STP_BPDU_Rule_t.
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_STP_BPDU_RuleSet(const GSW_Device_t *dev, GSW_STP_BPDU_Rule_t *parm);
+
+/** @}*/ /* GSW_ETHERNET_BRIDGING */
+
+#endif
+
+/* Port Trunk (LAG) */
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
+
+/**
+ \brief Configure the current port trunking algorithm that is used to retrieved if
+ a packet is sent on the lower or higher trunking port index number. The algorithm
+ performs an hash calculation over the MAC- and IP- addresses using the
+ source- and destination- fields. This command retrieve which of the
+ mentioned fields is used by the hash algorithm.
+ The usage of any field could be configured over
+ the \ref GSW_TrunkingCfgSet command.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ configuration \ref GSW_trunkingCfg_t
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_TrunkingCfgSet(const GSW_Device_t *dev, GSW_trunkingCfg_t *parm);
+
+/**
+ \brief Read out the current port trunking algorithm that is used to retrieved if
+ a packet is sent on the lower or higher trunking port index number. The algorithm
+ performs an hash calculation over the MAC- and IP- addresses using the
+ source- and destination- fields. This command retrieve which of the
+ mentioned fields is used by the hash algorithm.
+ The usage of any field could be configured over
+ the \ref GSW_TrunkingCfgSet command.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ configuration \ref GSW_trunkingCfg_t
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_TrunkingCfgGet(const GSW_Device_t *dev, GSW_trunkingCfg_t *parm);
+
+/**@}*/ /* GSW_ETHERNET_BRIDGING */
+
+
+/* PBB */
+
+/** @cond DOC_ENABLE_PBB */
+/** \addtogroup GSW_PBB
+ * @{
+ */
+
+/**
+ \brief Allocate PBB Tunnel Template.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ configuration \ref GSW_PBB_Tunnel_Template_Config_t
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PBB_TunnelTempate_Alloc(const GSW_Device_t *dev, GSW_PBB_Tunnel_Template_Config_t *parm);
+
+/**
+ \brief Free PBB Tunnel Template allocated by \ref GSW_PBB_TunnelTempate_Alloc.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ configuration \ref GSW_PBB_Tunnel_Template_Config_t
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PBB_TunnelTempate_Free(const GSW_Device_t *dev, GSW_PBB_Tunnel_Template_Config_t *parm);
+
+/**
+ \brief Configure PBB Tunnel Template.
+ A valid template should have been allocated by
+ \ref GSW_PBB_TunnelTempate_Alloc.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ configuration \ref GSW_PBB_Tunnel_Template_Config_t
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PBB_TunnelTempate_Config_Set(const GSW_Device_t *dev, GSW_PBB_Tunnel_Template_Config_t *parm);
+
+/**
+ \brief Get configuration of PBB Tunnel.
+
+ \param dev Pointer to switch device.
+ \param parm Pointer to a
+ configuration \ref GSW_PBB_Tunnel_Template_Config_t
+
+ \remarks The function returns an error code in case an error occurs.
+ The error code is described in \ref GSW_return_t.
+
+ \return Return value as follows:
+ - GSW_statusOk: if successful
+ - An error code in case an error occurs
+*/
+GSW_return_t GSW_PBB_TunnelTempate_Config_Get(const GSW_Device_t *dev, GSW_PBB_Tunnel_Template_Config_t *parm);
+
+/**@}*/ /* GSW_PBB */
+/** @endcond DOC_ENABLE_PBB */
+
+
+#endif /* MXL_GSW_API_H_ */
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_cli_common.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_cli_common.h
index 19d3981..eba0366 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_cli_common.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_cli_common.h
@@ -10,6 +10,8 @@
#ifndef _MXL_MAC_CLI_LIB_H_
#define _MXL_MAC_CLI_LIB_H_
+char *findArgParam(int argc, char *argv[], char *name);
+int scanStrParamArg(int argc, char *argv[], char *name, size_t size, char *param);
int scanParamArg(int argc, char *argv[], char *name, size_t size, void *param);
void printHex32Value(char *name, unsigned int value, unsigned int bitmapIndicator);
int scanMAC_Arg(int argc, char *argv[], char *name, unsigned char *param);
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_ctp.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_ctp.h
index f2ef9e3..1490167 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_ctp.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_ctp.h
@@ -15,22 +15,9 @@
#pragma pack(push, 1)
#pragma scalar_storage_order little-endian
-/** \brief Logical port mode.
- Used by \ref GSW_CTP_portAssignment_t. */
-typedef enum {
- /** WLAN with 8-bit station ID */
- GSW_LOGICAL_PORT_8BIT_WLAN = 0,
- /** WLAN with 9-bit station ID */
- GSW_LOGICAL_PORT_9BIT_WLAN = 1,
- /** GPON OMCI context */
- GSW_LOGICAL_PORT_GPON = 2,
- /** EPON context */
- GSW_LOGICAL_PORT_EPON = 3,
- /** G.INT context */
- GSW_LOGICAL_PORT_GINT = 4,
- /** Others (sub interface ID is 0 by default) */
- GSW_LOGICAL_PORT_OTHER = 0xFF,
-} GSW_LogicalPortMode_t;
+/** \addtogroup GSW_ETHERNET_BRIDGING
+ * @{
+ */
/** \brief CTP Port configuration mask.
Used by \ref GSW_CTP_portConfig_t. */
@@ -96,38 +83,8 @@
GSW_CTP_PORT_CONFIG_MASK_FORCE = 0x80000000
} GSW_CtpPortConfigMask_t;
-/** \brief CTP Port Assignment/association with logical port.
- Used by \ref GSW_CTP_PORT_ASSIGNMENT_ALLOC, \ref GSW_CTP_PORT_ASSIGNMENT_SET
- and \ref GSW_CTP_PORT_ASSIGNMENT_GET. */
-typedef struct {
- /** Logical Port Id. The valid range is hardware dependent. */
- u8 nLogicalPortId;
-
- /** First CTP Port ID mapped to above logical port ID.
-
- \remarks
- For \ref GSW_CTP_PORT_ASSIGNMENT_ALLOC, this is output when CTP
- allocation is successful. For other APIs, this is input. */
- u16 nFirstCtpPortId;
- /** Total number of CTP Ports mapped above logical port ID. */
- u16 nNumberOfCtpPort;
-
- /** Logical port mode to define sub interface ID format. */
- GSW_LogicalPortMode_t eMode;
-
- /** Bridge ID (FID)
-
- \remarks
- For \ref GSW_CTP_PORT_ASSIGNMENT_ALLOC, this is input. Each CTP allocated
- is mapped to Bridge Port given by this field. The Bridge Port will be
- configured to use first CTP
- (\ref GSW_CTP_portAssignment_t::nFirstCtpPortId) as egress CTP.
- For other APIs, this is ignored. */
- u16 nBridgePortId;
-} GSW_CTP_portAssignment_t;
-
/** \brief CTP Port Configuration.
- Used by \ref GSW_CTP_PORT_CONFIG_SET and \ref GSW_CTP_PORT_CONFIG_GET. */
+ Used by \ref GSW_CtpPortConfigSet and \ref GSW_CtpPortConfigGet. */
typedef struct {
/** Logical Port Id. The valid range is hardware dependent.
If \ref GSW_CTP_portConfig_t::eMask has
@@ -235,7 +192,7 @@
/** Meter for ingress CTP process.
\remarks
- Meter should be allocated with \ref GSW_QOS_METER_ALLOC before CTP
+ Meter should be allocated with \ref GSW_QOS_MeterAlloc before CTP
port configuration. If this CTP port is re-set, the last used meter
should be released. */
u16 nIngressTrafficMeterId;
@@ -244,7 +201,7 @@
/** Meter for egress CTP process.
\remarks
- Meter should be allocated with \ref GSW_QOS_METER_ALLOC before CTP
+ Meter should be allocated with \ref GSW_QOS_MeterAlloc before CTP
port configuration. If this CTP port is re-set, the last used meter
should be released. */
u16 nEgressTrafficMeterId;
@@ -320,6 +277,55 @@
gsw_bool_t bEgressMirrorEnable;
} GSW_CTP_portConfig_t;
+/** \brief Logical port mode.
+ Used by \ref GSW_CTP_portAssignment_t. */
+typedef enum {
+ /** WLAN with 8-bit station ID */
+ GSW_LOGICAL_PORT_8BIT_WLAN = 0,
+ /** WLAN with 9-bit station ID */
+ GSW_LOGICAL_PORT_9BIT_WLAN = 1,
+ /** GPON OMCI context */
+ GSW_LOGICAL_PORT_GPON = 2,
+ /** EPON context */
+ GSW_LOGICAL_PORT_EPON = 3,
+ /** G.INT context */
+ GSW_LOGICAL_PORT_GINT = 4,
+ /** Others (sub interface ID is 0 by default) */
+ GSW_LOGICAL_PORT_OTHER = 0xFF,
+} GSW_LogicalPortMode_t;
+
+/** \brief CTP Port Assignment/association with logical port.
+ Used by \ref GSW_CTP_PortAssignmentAlloc, \ref GSW_CTP_PortAssignmentSet
+ and \ref GSW_CTP_PortAssignmentGet. */
+typedef struct {
+ /** Logical Port Id. The valid range is hardware dependent. */
+ u8 nLogicalPortId;
+
+ /** First CTP Port ID mapped to above logical port ID.
+
+ \remarks
+ For \ref GSW_CTP_PortAssignmentAlloc, this is output when CTP
+ allocation is successful. For other APIs, this is input. */
+ u16 nFirstCtpPortId;
+ /** Total number of CTP Ports mapped above logical port ID. */
+ u16 nNumberOfCtpPort;
+
+ /** Logical port mode to define sub interface ID format. */
+ GSW_LogicalPortMode_t eMode;
+
+ /** Bridge ID (FID)
+
+ \remarks
+ For \ref GSW_CTP_PortAssignmentAlloc, this is input. Each CTP allocated
+ is mapped to Bridge Port given by this field. The Bridge Port will be
+ configured to use first CTP
+ (\ref GSW_CTP_portAssignment_t::nFirstCtpPortId) as egress CTP.
+ For other APIs, this is ignored. */
+ u16 nBridgePortId;
+} GSW_CTP_portAssignment_t;
+
+/** @}*/ /* GSW_ETHERNET_BRIDGING */
+
#pragma scalar_storage_order default
#pragma pack(pop)
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_device.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_device.h
index 59a2681..d1baeaf 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_device.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_device.h
@@ -9,7 +9,10 @@
#ifndef _GSW_DEVICE_H_
#define _GSW_DEVICE_H_
+/** \file gsw_device.h GSW Device Type */
+/** \brief GSW Device Prototype.
+ Used by all GSW APIs. */
typedef struct {
void (*usleep)(unsigned long usec);
@@ -24,6 +27,7 @@
void *mdiobus_data;
uint8_t phy_addr;
+ uint8_t smdio_phy_addr;
} GSW_Device_t;
#endif /* _GSW_DEVICE_H_ */
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_flow.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_flow.h
index 8a4b603..25407ab 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_flow.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_flow.h
@@ -16,9 +16,13 @@
#pragma pack(push, 1)
#pragma scalar_storage_order little-endian
+/** \addtogroup GSW_DEBUG
+ * @{
+ */
+
/** \brief Register access parameter to directly read or write switch
internal registers.
- Used by \ref GSW_REGISTER_SET and \ref GSW_REGISTER_GET. */
+ Used by \ref GSW_RegisterSet and \ref GSW_RegisterGet. */
typedef struct {
/** Register Address Offset for read or write access. */
u16 nRegAddr;
@@ -27,7 +31,7 @@
} GSW_register_t;
/** \brief Register access parameter to directly modify internal registers.
- Used by \ref GSW_REGISTER_MOD. */
+ Used by \ref GSW_RegisterMod. */
typedef struct {
/** Register Address Offset for modifiation. */
u16 nRegAddr;
@@ -37,256 +41,24 @@
u16 nMask;
} GSW_register_mod_t;
-/** \brief Traffic Class Action Selector.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disabled. Traffic class action is disabled. */
- GSW_PCE_ACTION_TRAFFIC_CLASS_DISABLE = 0,
- /** Regular Class. Traffic class action is enabled and the CoS
- classification traffic class is used. */
- GSW_PCE_ACTION_TRAFFIC_CLASS_REGULAR = 1,
- /** Alternative Class. Traffic class action is enabled and the
- class of the 'nTrafficClassAlter' field is used. */
- GSW_PCE_ACTION_TRAFFIC_CLASS_ALTERNATIVE = 2,
-} GSW_PCE_ActionTrafficClass_t;
-
-/** \brief IGMP Snooping Control.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disabled. IGMP Snooping is disabled. */
- GSW_PCE_ACTION_IGMP_SNOOP_DISABLE = 0,
- /** Default. Regular Packet. No IGMP Snooping action required. */
- GSW_PCE_ACTION_IGMP_SNOOP_REGULAR = 1,
- /** IGMP Report/Join Message. */
- GSW_PCE_ACTION_IGMP_SNOOP_REPORT = 2,
- /** IGMP Leave Message. */
- GSW_PCE_ACTION_IGMP_SNOOP_LEAVE = 3,
- /** Router Solicitation/Advertisement message. */
- GSW_PCE_ACTION_IGMP_SNOOP_AD = 4,
- /** IGMP Query Message. */
- GSW_PCE_ACTION_IGMP_SNOOP_QUERY = 5,
- /** IGMP Group Specific Query Message. */
- GSW_PCE_ACTION_IGMP_SNOOP_QUERY_GROUP = 6,
- /** IGMP General Query message without Router Solicitation. */
- GSW_PCE_ACTION_IGMP_SNOOP_QUERY_NO_ROUTER = 7
-} GSW_PCE_ActionIGMP_Snoop_t;
-
-/** \brief MAC Address Learning control.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Learning is based on the forwarding decision. If the packet is discarded,
- the address is not learned. If the packet is forwarded to any egress port,
- the address is learned. */
- GSW_PCE_ACTION_LEARNING_DISABLE = 0,
- /** Reserved */
- GSW_PCE_ACTION_LEARNING_REGULAR = 1,
- /** Force No Learning. The address is not learned; forwarding decision
- ignored. */
- GSW_PCE_ACTION_LEARNING_FORCE_NOT = 2,
- /** Force Learning. The address is learned, the forwarding decision ignored.
- Note: The MAC Learning Control signals delivered to Port-Map filtering
- and combined with Final Forwarding Decision. The result is used as a
- feedback for MAC Address learning in the Bridging Table. */
- GSW_PCE_ACTION_LEARNING_FORCE = 3
-} GSW_PCE_ActionLearning_t;
-
-/** \brief Interrupt Control Action Selector.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disabled. Interrupt Control Action is disabled for this rule. */
- GSW_PCE_ACTION_IRQ_DISABLE = 0,
- /** Regular Packet. The Interrupt Control Action is enabled, the packet is
- treated as a regular packet and no interrupt event is generated. */
- GSW_PCE_ACTION_IRQ_REGULAR = 1,
- /** Interrupt Event. The Interrupt Control Action is enabled and an
- interrupt event is generated. */
- GSW_PCE_ACTION_IRQ_EVENT = 2
-} GSW_PCE_ActionIrq_t;
-
-
-/** \brief Cross State Action Selector.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disable. The Cross State Action is disabled. */
- GSW_PCE_ACTION_CROSS_STATE_DISABLE = 0,
- /** Regular Packet. The Cross State Action is enabled and the packet is
- treated as a non-Cross-State packet (regular packet). Therefore it does
- not ignore Port-State filtering rules. */
- GSW_PCE_ACTION_CROSS_STATE_REGULAR = 1,
- /** Cross-State packet. The Cross State Action is enabled and the packet is
- treated as a Cross-State packet. It ignores the Port-State
- filtering rules. */
- GSW_PCE_ACTION_CROSS_STATE_CROSS = 2
-} GSW_PCE_ActionCrossState_t;
-
-/** \brief Critical Frame Action Selector.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disable. The Critical Frame Action is disabled. */
- GSW_PCE_ACTION_CRITICAL_FRAME_DISABLE = 0,
- /** Regular Packet. The Critical Frame Action is enabled and the packet is
- treated as a non-Critical Frame. */
- GSW_PCE_ACTION_CRITICAL_FRAME_REGULAR = 1,
- /** Critical Packet. The Critical Frame Action is enabled and the packet is
- treated as a Critical Frame. */
- GSW_PCE_ACTION_CRITICAL_FRAME_CRITICAL = 2
-} GSW_PCE_ActionCriticalFrame_t;
-
-/** \brief Color Frame Action Selector.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disable. No color frame action. */
- GSW_PCE_ACTION_COLOR_FRAME_DISABLE = 0,
- /** Do not change color. */
- GSW_PCE_ACTION_COLOR_FRAME_NO_CHANGE = 1,
- /** Idendity packet as critical which bypass active congestion
- management (ACM). */
- GSW_PCE_ACTION_COLOR_FRAME_CRITICAL = 2,
- /** Change to green color. */
- GSW_PCE_ACTION_COLOR_FRAME_GREEN = 3,
- /** Change to yellow color. */
- GSW_PCE_ACTION_COLOR_FRAME_YELLOW = 4,
- /** Change to red color. */
- GSW_PCE_ACTION_COLOR_FRAME_RED = 5
-} GSW_PCE_ActionColorFrame_t;
-
-
-/** \brief Timestamp Action Selector.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disable. Timestamp Action is disabled for this rule. */
- GSW_PCE_ACTION_TIMESTAMP_DISABLE = 0,
- /** Regular Packet. The Timestamp Action is enabled for this rule.
- The packet is treated as a regular packet and no timing information
- is stored. */
- GSW_PCE_ACTION_TIMESTAMP_REGULAR = 1,
- /** Receive/Transmit Timing packet. Ingress and Egress Timestamps for
- this packet should be stored. */
- GSW_PCE_ACTION_TIMESTAMP_STORED = 2
-} GSW_PCE_ActionTimestamp_t;
-
-/** \brief Forwarding Group Action Selector.
- This flow table action and the 'bFlowID_Action' action
- can be used exclusively.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disable. Forwarding Group Action is disabled. */
- GSW_PCE_ACTION_PORTMAP_DISABLE = 0,
- /** Regular Packet. Forwarding Action enabled. Select Default
- Port-Map (result of Default Forwarding Classification). */
- GSW_PCE_ACTION_PORTMAP_REGULAR = 1,
- /** Discard. Discard the packets. */
- GSW_PCE_ACTION_PORTMAP_DISCARD = 2,
- /** Forward to the CPU port. This requires that the CPU port is previously
- set by calling \ref GSW_CPU_PORT_CFG_SET. */
- GSW_PCE_ACTION_PORTMAP_CPU = 3,
- /** Forward to a portmap, selected by the parameter 'nForwardPortMap'.
- Please note that this feature is not supported by all
- hardware platforms. */
- GSW_PCE_ACTION_PORTMAP_ALTERNATIVE = 4,
- /** The packet is treated as Multicast Router
- Solicitation/Advertisement or Query packet. */
- GSW_PCE_ACTION_PORTMAP_MULTICAST_ROUTER = 5,
- /** The packet is interpreted as Multicast packet and learned in the
- multicast group table. */
- GSW_PCE_ACTION_PORTMAP_MULTICAST_HW_TABLE = 6,
- /** The CTAG VLAN portmap classification result is replaced by the
- portmap parameter 'nForwardPortMap'. All other classification
- results stay unchanged and will be combined together with
- the overwritten portmap. */
- GSW_PCE_ACTION_PORTMAP_ALTERNATIVE_VLAN = 7,
- /** Add STAG VLAN portmap 'nForwardPortMap' to the overall portmap
- classification result (AND'ed with the portmap). */
- GSW_PCE_ACTION_PORTMAP_ALTERNATIVE_STAG_VLAN = 8
-} GSW_PCE_ActionPortmap_t;
-
-/** \brief Flow Meter Assignment control.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Action Disable. */
- GSW_PCE_ACTION_METER_DISABLE = 0,
- /** Action Enable.
- The action is enabled but no dedicated metering instance is assigned by the rule. */
- GSW_PCE_ACTION_METER_REGULAR = 1,
- /** Action Enable. Assign one meter instance as given in parameter "nMeterId". */
- GSW_PCE_ACTION_METER_1 = 2,
- /** Action Enable. Assign pair of meter instances.
- These instances are "nMeterId" and the next following meter instance index. */
- GSW_PCE_ACTION_METER_1_2 = 3
-} GSW_PCE_ActionMeter_t;
-
-/** \brief VLAN Group Action Selector.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disabled. The VLAN Action is disabled. */
- GSW_PCE_ACTION_VLAN_DISABLE = 0,
- /** Regular VLAN. VLAN Action enabled. Select Default VLAN ID. */
- GSW_PCE_ACTION_VLAN_REGULAR = 1,
- /** Alternative VLAN. VLAN Action enabled.
- Select Alternative VLAN as configured in 'nVLAN_Id'
- or 'nSVLAN_Id'. For CTAG VLAN it requires that this VLAN ID
- is configured by calling
- \ref GSW_VLAN_ID_CREATE in advance.
- This additional call is not required for STAG VLAN. */
- GSW_PCE_ACTION_VLAN_ALTERNATIVE = 2
-} GSW_PCE_ActionVLAN_t;
-
+/** @}*/ /* GSW_DEBUG */
-/** \brief Cross VLAN Action Selector.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Disabled. The Cross VLAN Action is disabled. */
- GSW_PCE_ACTION_CROSS_VLAN_DISABLE = 0,
- /** Regular VLAN Packet. Do not ignore VLAN filtering rules. */
- GSW_PCE_ACTION_CROSS_VLAN_REGULAR = 1,
- /** Cross-VLAN packet. Ignore VLAN filtering rules.*/
- GSW_PCE_ACTION_CROSS_VLAN_CROSS = 2
-} GSW_PCE_ActionCrossVLAN_t;
-/** \brief MPE Processing Path Assignment Selector - used for GSWIP-3.0 only.
- Used by \ref GSW_PCE_action_t. */
-typedef enum {
- /** Processing Path is not enabled. */
- GSW_PCE_PROCESSING_PATH_UNUSED = 0,
- /** Processing Path-1 is used for MPE-1. */
- GSW_PCE_PROCESSING_PATH_1 = 1,
- /** Processing Path-2 is used for MPE-2. */
- GSW_PCE_PROCESSING_PATH_2 = 2,
- /** Processing Path-1 and -2 are used for MPE-1 & MPE-2. */
- GSW_PCE_PROCESSING_PATH_BOTH = 3,
-} GSW_PCE_ProcessingPathAction_t;
+/** \addtogroup GSW_PCE
+ * @{
+ */
-/** \brief Port Filter Action-1/2/3/4/5/6 Selector - used for GSWIP-3.0 only.
- This can be used only along with PortMember config.
- Used by \ref GSW_PCE_action_t. */
+/** \brief Traffic Flow Table Mangaement.
+ * Used by \ref GSW_PCE_rule_t.
+ */
typedef enum {
- /** Port Filter Action is Unused. */
- GSW_PCE_PORT_FILTER_ACTION_UNUSED = 0,
- /** Port Filter Action Type-1 is used. */
- GSW_PCE_PORT_FILTER_ACTION_1 = 1,
- /** Port Filter Action Type-2 is used. */
- GSW_PCE_PORT_FILTER_ACTION_2 = 2,
- /** Port Filter Action Type-3 is used. */
- GSW_PCE_PORT_FILTER_ACTION_3 = 3,
- /** Port Filter Action Type-4 is used. */
- GSW_PCE_PORT_FILTER_ACTION_4 = 4,
- /** Port Filter Action Type-5 (Unknown Unicast) is used. */
- GSW_PCE_PORT_FILTER_ACTION_5 = 5,
- /** Port Filter Action Type-6 (Unknown Multicast) is used. */
- GSW_PCE_PORT_FILTER_ACTION_6 = 6
-} GSW_PCE_PortFilterAction_t;
-
-
-
-typedef struct {
- /** Destination Sub IF ID Group Field Action Enable*/
- gsw_bool_t bDestSubIFIDActionEnable;
- /** Destination Sub IF ID Group Field Assignment Enable*/
- gsw_bool_t bDestSubIFIDAssignmentEnable;
- /** Destination Sub IF ID Group Field or LAG Index for truncking action*/
- u16 nDestSubIFGrp_Field;
-
-} GSW_PCE_ActionDestSubIF_t;
+ /** PCE Rule Region common for all CTP */
+ GSW_PCE_RULE_COMMMON = 0,
+ /** PCE Rule Region for specific CTP */
+ GSW_PCE_RULE_CTP = 1,
+ /** PCE Rule Debug (HW direct mapping) */
+ GSW_PCE_RULE_DEBUG = 2
+} GSW_PCE_RuleRegion_t;
/** \brief Select Mode of Sub-Interface ID Field.
Used by \ref GSW_PCE_pattern_t. */
@@ -308,321 +80,6 @@
GSW_PCE_IP_V6 = 2
} GSW_PCE_IP_t;
-typedef enum {
- /** No change in packet. */
- GSW_PCE_I_HEADER_OPERATION_NOCHANGE = 0,
- /** Insert I-Header for Non-PBB packet */
- GSW_PCE_I_HEADER_OPERATION_INSERT = 1,
- /** Remove I-Header for PBB packet
- (Removes both I-Header and B-Tag)*/
- GSW_PCE_I_HEADER_OPERATION_REMOVE = 2,
- /** Replace the I-Header Fields for PBB packet */
- GSW_PCE_I_HEADER_OPERATION_REPLACE = 3,
-} GSW_PCE_IheaderOperationMode;
-
-typedef enum {
- /** No change in B-TAG for PBB packet. */
- GSW_PCE_B_TAG_OPERATION_NOCHANGE = 0,
- /** Insert B-TAG for PBB packet */
- GSW_PCE_B_TAG_OPERATION_INSERT = 1,
- /** Remove B-TAG for PBB packet */
- GSW_PCE_B_TAG_OPERATION_REMOVE = 2,
- /** Replace B-TAG fields for PBB packet */
- GSW_PCE_B_TAG_OPERATION_REPLACE = 3,
-} GSW_PCE_BtagOperationMode;
-
-typedef enum {
- /** Outer Mac address is selected for learning
- non-PBB packet or PBB encapsulation*/
- GSW_PCE_OUTER_MAC_SELECTED = 0,
- /** inner Mac address is selected for learning
- PBB decapsulation*/
- GSW_PCE_INNER_MAC_SELECTED = 1,
-} GSW_PCE_MacTableMacinMacSelect;
-
-typedef struct {
- /** Tunnel Template Index for I-Header Known traffic
- this field should be valid ID returned by
- \ref GSW_PBB_TunnelTempate_Alloc and
- Configured Using GSW_PBB_TunnelTempate_Config_Set*/
- u8 nTunnelIdKnownTraffic;
- /** Tunnel Template Index for I-Header UnKnown traffic
- this field should be valid ID returned by
- \ref GSW_PBB_TunnelTempate_Alloc and
- Configured Using GSW_PBB_TunnelTempate_Config_Set*/
- u8 nTunnelIdUnKnownTraffic;
- /** Tunnel Template Index for B-TAG Known traffic
- this field should be valid ID returned by
- \ref GSW_PBB_TunnelTempate_Alloc and
- Configured Using GSW_PBB_TunnelTempate_Config_Set*/
- u8 nProcessIdKnownTraffic;
- /** Tunnel Template Index for B-TAG UnKnown traffic
- this field should be valid ID returned by
- \ref GSW_PBB_TunnelTempate_Alloc and
- Configured Using GSW_PBB_TunnelTempate_Config_Set*/
- u8 nProcessIdUnKnownTraffic;
- /** I-Header Operation Mode*/
- GSW_PCE_IheaderOperationMode eIheaderOpMode;
- /** B-Tag Operation Mode*/
- GSW_PCE_BtagOperationMode eBtagOpMode;
- /** Action enable I-Header*/
- /**Select Mac Table MacinMac Action */
- GSW_PCE_MacTableMacinMacSelect eMacTableMacinMacSelect;
- gsw_bool_t bIheaderActionEnable;
- /** Enable Tunnel Id for I-Header Known traffic*/
- gsw_bool_t bTunnelIdKnownTrafficEnable;
- /** Enable Tunnel Id for I-Header UnKnown traffic*/
- gsw_bool_t bTunnelIdUnKnownTrafficEnable;
- /** Incase of I-Header operation mode is Insertion
- and bB_DstMac_FromMacTableEnable is enabled,
- the B-DA is from Mac table instead of tunnel template*/
- gsw_bool_t bB_DstMac_FromMacTableEnable;
- /** Replace B-SA from tunnel template*/
- gsw_bool_t bReplace_B_SrcMacEnable;
- /** Replace B-DA from tunnel template*/
- gsw_bool_t bReplace_B_DstMacEnable;
- /** Replace I-Tag Res from tunnel template*/
- gsw_bool_t bReplace_I_TAG_ResEnable;
- /** Replace I-Tag UAC from tunnel template*/
- gsw_bool_t bReplace_I_TAG_UacEnable;
- /** Replace I-Tag DEI from tunnel template*/
- gsw_bool_t bReplace_I_TAG_DeiEnable;
- /** Replace I-Tag PCP from tunnel template*/
- gsw_bool_t bReplace_I_TAG_PcpEnable;
- /** Replace I-Tag SID from tunnel template*/
- gsw_bool_t bReplace_I_TAG_SidEnable;
- /** Replace I-Tag TPID from tunnel template*/
- gsw_bool_t bReplace_I_TAG_TpidEnable;
- /** Action enable B-TAG*/
- gsw_bool_t bBtagActionEnable;
- /** Enable Process Id for B-TAG Known traffic*/
- gsw_bool_t bProcessIdKnownTrafficEnable;
- /** Enable Process Id for B-TAG UnKnown traffic*/
- gsw_bool_t bProcessIdUnKnownTrafficEnable;
- /** Replace B-Tag DEI from tunnel template*/
- gsw_bool_t bReplace_B_TAG_DeiEnable;
- /** Replace B-Tag PCP from tunnel template*/
- gsw_bool_t bReplace_B_TAG_PcpEnable;
- /** Replace B-Tag SID from tunnel template*/
- gsw_bool_t bReplace_B_TAG_VidEnable;
- /** Replace B-Tag TPID from tunnel template*/
- gsw_bool_t bReplace_B_TAG_TpidEnable;
- /**Action enable Mac Table MacinMac*/
- gsw_bool_t bMacTableMacinMacActionEnable;
-} GSW_PCE_ActionPBB_t;
-
-typedef struct {
- /** Signed time compensation value for OAM delay measurement.
- * The valid values are -4,294,967,295 ~ 4,294,967,295.
- */
- long long nTimeComp;
- /** Extended VLAN block allocated for traffic match this flow entry. Valid
- when bExtendedVlanEnable is TRUE. Only FIRST VLAN operation in this block
- is used for flow process. */
- u16 nExtendedVlanBlockId;
- /** Insertion/Extraction Point */
- u8 nInsExtPoint;
- /** PTP Sequence ID for PTP application */
- u8 nPtpSeqId;
- /** Target portmap for forwarded packets, only used if selected by
- 'ePortMapAction'. Forwarding is done
- if 'ePortMapAction = GSW_PCE_ACTION_PORTMAP_ALTERNATIVE'.
- Every bit in the portmap represents one port (port 0 = LSB bit). */
- /** If both bNoPktUpdate and bAppendToPkt are false, this is byte offset (2~255) to insert counter or timestamp. */
- u16 nPktUpdateOffset;
- /** Traffic flow counter ID used for counter insertion in OAM loss measurement.
- * This is least significant bits of traffic flow counter ID.
- * The most significant bits depends on traffic flow counter mode.
- * For example, if it's global mode, this is full traffic flow counter ID.
- * If it's logical port mode, MSB is ingress logical port ID and LSB is 5 bits of this parameter.
- * If it's CTP or BP (bridge port) mode, it depends on configuration.
- */
- u16 nOamFlowId;
- /** Record ID is information used by extraction (bExtractEnable is set)
- * and/or OAM process (bOamEnable is set). For GSWIP-3.1 and above.
- * Refer to GSWIP-3.1 Hardware Architecture Spec (HAS) for more detail.
- * This is deperated and should be set to ZERO.
- **/
- u16 nRecordId;
-
- u16 nForwardPortMap[8]; /* max can be 16 */
- /** Counter ID (The index starts counting from zero). */
- u16 nRMON_Id;
- /** Alternative STAG VLAN Id */
- u16 nSVLAN_Id;
- /** Flow ID */
- u16 nFlowID;
- /** Routing Extension Id Value - for GSWIP-3.0 only. (8-bits range) */
- u16 nRoutExtId;
- /** Alternative Traffic class - used when eTrafficClassAction is set to 2. */
- u8 nTrafficClassAlternate;
- /** Meter ID */
- u8 nMeterId;
- /** Alternative CTAG VLAN Id */
- u8 nVLAN_Id;
- /** Alternative FID. Valid when bFidEnable is TRUE. */
- u8 nFId;
- /** Action "Traffic Class" Group.
- Traffic class action enable */
- GSW_PCE_ActionTrafficClass_t eTrafficClassAction;
-
- /** Action "IGMP Snooping" Group.
- IGMP Snooping control and enable. Please note that the 'nPortMapAction'
- configuration is ignored in case the IGMP snooping is enabled.
- Here, on read operations,
- 'nPortMapAction = GSW_PCE_ACTION_PORTMAP_DISABLE' is returned. */
- GSW_PCE_ActionIGMP_Snoop_t eSnoopingTypeAction;
-
- /** Action "Learning" Group.
- Learning action control and enable */
- GSW_PCE_ActionLearning_t eLearningAction;
-
- /** Action "Interrupt" Group.
- Interrupt action generate and enable */
- GSW_PCE_ActionIrq_t eIrqAction;
-
- /** Action "Cross State" Group.
- Cross state action control and enable */
- GSW_PCE_ActionCrossState_t eCrossStateAction;
-
- /** Action "Critical Frames" Group.
- Critical Frame action control and enable */
- GSW_PCE_ActionCriticalFrame_t eCritFrameAction;
-
- /** Action "Color Frames" Group.
- This is replacement of eCritFrameAction in GSWIP-3.1. */
- GSW_PCE_ActionColorFrame_t eColorFrameAction;
-
- /** Action "Timestamp" Group. Time stamp action control and enable */
- GSW_PCE_ActionTimestamp_t eTimestampAction;
-
- /** Action "Forwarding" Group.
- Port map action enable. This port forwarding configuration is ignored
- in case the action "IGMP Snooping" is enabled via the
- parameter 'nSnoopingTypeAction'. */
- GSW_PCE_ActionPortmap_t ePortMapAction;
- /** Action "Meter" Group. Meter action control and enable.
- If metering action enabled, specified metering instance number
- overrules any other metering assignment.
- Up to two metering instances can be applied to a single packet. */
- GSW_PCE_ActionMeter_t eMeterAction;
- /** Action "CTAG VLAN" Group. VLAN action enable */
- GSW_PCE_ActionVLAN_t eVLAN_Action;
- /** Action "STAG VLAN" Group. VLAN action enable */
- GSW_PCE_ActionVLAN_t eSVLAN_Action;
- /** Action "Cross VLAN" Group. Cross VLAN action enable */
- GSW_PCE_ActionCrossVLAN_t eVLAN_CrossAction;
- /** Assignment of flow to MPE Processing Path-1 or -2 or both - for GSWIP-3.0 only. */
- GSW_PCE_ProcessingPathAction_t eProcessPath_Action;
- /** Port Filter Action Config for this flow - for GSWIP-3.0 only. */
- GSW_PCE_PortFilterAction_t ePortFilterType_Action;
- GSW_PCE_ActionPBB_t sPBB_Action;
- GSW_PCE_ActionDestSubIF_t sDestSubIF_Action;
- /** Action "Remarking" Group. Remarking action enable. Reserved in
- GSWIP-3.1. */
- gsw_bool_t bRemarkAction;
- /** CTAG VLAN PCP remarking enable. Reserved in GSWIP-3.1.
- Remarking enabling means that remarking is possible in case
- the port configuration or metering enables remarking on that
- packet. Disabling remarking means that it is forced to
- not remarking this packet, independent of any port remarking of
- metering configuration. */
- gsw_bool_t bRemarkPCP;
- /** STAG VLAN PCP remarking enable. Reserved in GSWIP-3.1.
- Remarking enabling means that remarking is possible in case
- the port configuration or metering enables remarking on that
- packet. Disabling remarking means that it is forced to
- not remarking this packet, independent of any port remarking of
- metering configuration. */
- gsw_bool_t bRemarkSTAG_PCP;
- /** STAG VLAN DEI remarking enable. Reserved in GSWIP-3.1.
- Remarking enabling means that remarking is possible in case
- the port configuration or metering enables remarking on that
- packet. Disabling remarking means that it is forced to
- not remarking this packet, independent of any port remarking of
- metering configuration. */
- gsw_bool_t bRemarkSTAG_DEI;
- /** DSCP remarking enable. Reserved in GSWIP-3.1.
- Remarking enabling means that remarking is possible in case
- the port configuration or metering enables remarking on that
- packet. Disabling remarking means that it is forced to
- not remarking this packet, independent of any port remarking of
- metering configuration. */
- gsw_bool_t bRemarkDSCP;
- /** Class remarking enable. Reserved in GSWIP-3.1.
- Remarking enabling means that remarking is possible in case
- the port configuration or metering enables remarking on that
- packet. Disabling remarking means that it is forced to
- not remarking this packet, independent of any port remarking of
- metering configuration. */
- gsw_bool_t bRemarkClass;
-
- /** Action "RMON" Group. RMON action enable. Reserved in GSWIP-3.1. */
- gsw_bool_t bRMON_Action;
- /** Enable alternative FID */
- gsw_bool_t bFidEnable;
- /** Enable extended VLAN operation for traffic match this flow entry. */
- gsw_bool_t bExtendedVlanEnable;
- /** CVLAN Ignore control */
- gsw_bool_t bCVLAN_Ignore_Control;
- /** Port BitMap Mux control */
- gsw_bool_t bPortBitMapMuxControl;
- /** Trunking action enable */
- gsw_bool_t bPortTrunkAction;
- /** Port Link Selection control */
- gsw_bool_t bPortLinkSelection; //NA for F48X. Can remove?
- /** Action "Flow ID".
- The Switch supports enhancing the egress packets by a device specific
- special tag header. This header contains detailed switch classification
- results. One header file is a 'Flow ID', which can be explicitly set as
- flow table action when hitting a table rule.
- If selected, the Flow ID is given by the parameter 'nFlowID'. */
- gsw_bool_t bFlowID_Action;
- /** Routing Extension Id Action Selector - for GSWIP-3.0 only.
- When enabled, it expects a valid nRoutExtId value to be supplied. */
- gsw_bool_t bRoutExtId_Action;
- /** Routing Destination Port Mask Comparison - for GSWIP-3.0 only. If not enabled this field is not considered for routing session pattern lookup.*/
- gsw_bool_t bRtDstPortMaskCmp_Action;
- /** Routing Source Port Mask Comparison - for GSWIP-3.0 only. If not enabled, this field is not considered for routing session pattern lookup.*/
- gsw_bool_t bRtSrcPortMaskCmp_Action;
- /** Routing Destination IP Address Mask Comparison - for GSWIP-3.0 only. If not enabled, this field is not considered for routing session pattern lookup.*/
- gsw_bool_t bRtDstIpMaskCmp_Action;
- /** Routing Source IP Address Mask Comparison - for GSWIP-3.0 only. If not enabled, this field is not considered for routing session pattern lookup.*/
- gsw_bool_t bRtSrcIpMaskCmp_Action;
- /** Selector of IP in Tunneled IP header (Outer or Inner) - for GSWIP-3.0 only. */
- gsw_bool_t bRtInnerIPasKey_Action;
- /** Routing Acceleration Enable Action - for GSWIP-3.0 only. This variable decides whether to accelerate the Routing session or not */
- gsw_bool_t bRtAccelEna_Action;
- /** Routing Control Enable Action - for GSWIP-3.0 only. This variable is selector of Routing Accelerate action*/
- gsw_bool_t bRtCtrlEna_Action;
- /** Enable Extraction. For GSWIP-3.1 only.
- Packet is identified to be extracted at extraction point defined by
- nRecordId. */
- gsw_bool_t bExtractEnable;
- /** Enable OAM. For GSWIP-3.1 only.
- Packet is identified for OAM process. */
- gsw_bool_t bOamEnable;
- /** Update packet after QoS queue (in PCE Bypass path). */
- gsw_bool_t bPceBypassPath;
- /** This is Tx flow counter, otherwise Rx flow counter is used in OAM loss measurement. */
- gsw_bool_t bTxFlowCnt;
- /** Timestamp format. */
- enum {
- GSW_PCE_DIGITAL_10B = 0,
- GSW_PCE_BINARY_10B = 1,
- GSW_PCE_DIGITAL_8B = 2,
- GSW_PCE_BINARY_8B = 3
- } eTimeFormat;
- /** Do not update packet */
- gsw_bool_t bNoPktUpdate;
- /** If bNoPktUpdate is false, this flag indicates to append counter or timestamp to end of packet. */
- gsw_bool_t bAppendToPkt;
- /** Configure PBB action. For GSWIP-3.2 only*/
- gsw_bool_t bPBB_Action_Enable;
- /** For Enabling Dest SubIF ID Group field in TFLOW.Valid only For GSWIP-3.2 only*/
- gsw_bool_t bDestSubIf_Action_Enable;
-} GSW_PCE_action_t;
-
/** \brief Packet Classification Engine Pattern Configuration.
GSWIP-3.0 has additional patterns such as Inner IP, Inner DSCP, Inner Protocol, Exclude Mode etc.
Used by \ref GSW_PCE_rule_t. */
@@ -820,14 +277,10 @@
gsw_bool_t bInnerDSCP_Exclude;
/** CTAG VLAN PCP n DEI value used */
gsw_bool_t bPCP_Enable;
- /* Exclude CTAG value used for GSWIP-3.0 only */
-// gsw_bool_t bCTAG_Exclude;
/** Exclude CTAG PCP & DEI value used for GSWIP-3.0 only */
gsw_bool_t bCTAG_PCP_DEI_Exclude;
/** STAG VLAN PCP/DEI value used */
gsw_bool_t bSTAG_PCP_DEI_Enable;
- /* Exclude STAG value used for GSWIP-3.0 only */
-// gsw_bool_t bSTAG_Exclude;
/** Exclude STAG PCP & DEI value used for GSWIP-3.0 only */
gsw_bool_t bSTAG_PCP_DEI_Exclude;
/** Packet length used for classification */
@@ -848,6 +301,7 @@
If set to LTQ_TRUE, the field 'nAppMaskRangeMSB' is used as a
range parameter, otherwise it is used as a nibble mask field. */
gsw_bool_t bAppMaskRangeMSB_Select;
+ /** MSB Application exclude mode */
gsw_bool_t bAppMSB_Exclude;
/** LSB Application used */
gsw_bool_t bAppDataLSB_Enable;
@@ -965,59 +419,621 @@
gsw_bool_t bParserFlag1MSB_Exclude;
/** nInsertionFlag is used. For GSWIP-3.1 only */
gsw_bool_t bInsertionFlag_Enable;
- /*The below flexible field are Applicable for GSWIP 3.2 only*/
+ /** Flexible Field 4: 1 enable and 0 disable */
gsw_bool_t bFlexibleField4Enable;
- /** Flexible Field 4 exclude mode 1 enable and 0 disable**/
+ /** Flexible Field 4 exclude mode 1 enable and 0 disable */
gsw_bool_t bFlexibleField4_ExcludeEnable;
- /** Flexible Field 4 parser mask or range selction - 0 mask/1 range**/
+ /** Flexible Field 4 parser mask or range selction - 0 mask/1 range */
gsw_bool_t bFlexibleField4_RangeEnable;
+ /** Flexible Field 3: 1 enable and 0 disable */
gsw_bool_t bFlexibleField3Enable;
- /** Flexible Field 3 exclude mode 1 enable and 0 disable**/
+ /** Flexible Field 3 exclude mode 1 enable and 0 disable */
gsw_bool_t bFlexibleField3_ExcludeEnable;
- /** Flexible Field 3 parser mask or range selction - 0 mask/1 range**/
+ /** Flexible Field 3 parser mask or range selction - 0 mask/1 range */
gsw_bool_t bFlexibleField3_RangeEnable;
+ /** Flexible Field 2: 1 enable and 0 disable */
gsw_bool_t bFlexibleField2Enable;
- /** Flexible Field 2 exclude mode 1 enable and 0 disable**/
+ /** Flexible Field 2 exclude mode 1 enable and 0 disable */
gsw_bool_t bFlexibleField2_ExcludeEnable;
- /** Flexible Field 2 parser mask or range selction - 0 mask/1 range**/
+ /** Flexible Field 2 parser mask or range selction - 0 mask/1 range */
gsw_bool_t bFlexibleField2_RangeEnable;
+ /** Flexible Field 1: 1 enable and 0 disable */
gsw_bool_t bFlexibleField1Enable;
- /** Flexible Field 1 exclude mode 1 enable and 0 disable**/
+ /** Flexible Field 1 exclude mode 1 enable and 0 disable */
gsw_bool_t bFlexibleField1_ExcludeEnable;
- /** Flexible Field 1 parser mask or range selction - 0 mask/1 range**/
+ /** Flexible Field 1 parser mask or range selction - 0 mask/1 range */
gsw_bool_t bFlexibleField1_RangeEnable;
} GSW_PCE_pattern_t;
+/** \brief Traffic Class Action Selector.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disabled. Traffic class action is disabled. */
+ GSW_PCE_ACTION_TRAFFIC_CLASS_DISABLE = 0,
+ /** Regular Class. Traffic class action is enabled and the CoS
+ classification traffic class is used. */
+ GSW_PCE_ACTION_TRAFFIC_CLASS_REGULAR = 1,
+ /** Alternative Class. Traffic class action is enabled and the
+ class of the 'nTrafficClassAlter' field is used. */
+ GSW_PCE_ACTION_TRAFFIC_CLASS_ALTERNATIVE = 2,
+} GSW_PCE_ActionTrafficClass_t;
+
+/** \brief IGMP Snooping Control.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disabled. IGMP Snooping is disabled. */
+ GSW_PCE_ACTION_IGMP_SNOOP_DISABLE = 0,
+ /** Default. Regular Packet. No IGMP Snooping action required. */
+ GSW_PCE_ACTION_IGMP_SNOOP_REGULAR = 1,
+ /** IGMP Report/Join Message. */
+ GSW_PCE_ACTION_IGMP_SNOOP_REPORT = 2,
+ /** IGMP Leave Message. */
+ GSW_PCE_ACTION_IGMP_SNOOP_LEAVE = 3,
+ /** Router Solicitation/Advertisement message. */
+ GSW_PCE_ACTION_IGMP_SNOOP_AD = 4,
+ /** IGMP Query Message. */
+ GSW_PCE_ACTION_IGMP_SNOOP_QUERY = 5,
+ /** IGMP Group Specific Query Message. */
+ GSW_PCE_ACTION_IGMP_SNOOP_QUERY_GROUP = 6,
+ /** IGMP General Query message without Router Solicitation. */
+ GSW_PCE_ACTION_IGMP_SNOOP_QUERY_NO_ROUTER = 7
+} GSW_PCE_ActionIGMP_Snoop_t;
+
+/** \brief MAC Address Learning control.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Learning is based on the forwarding decision. If the packet is discarded,
+ the address is not learned. If the packet is forwarded to any egress port,
+ the address is learned. */
+ GSW_PCE_ACTION_LEARNING_DISABLE = 0,
+ /** Reserved */
+ GSW_PCE_ACTION_LEARNING_REGULAR = 1,
+ /** Force No Learning. The address is not learned; forwarding decision
+ ignored. */
+ GSW_PCE_ACTION_LEARNING_FORCE_NOT = 2,
+ /** Force Learning. The address is learned, the forwarding decision ignored.
+ Note: The MAC Learning Control signals delivered to Port-Map filtering
+ and combined with Final Forwarding Decision. The result is used as a
+ feedback for MAC Address learning in the Bridging Table. */
+ GSW_PCE_ACTION_LEARNING_FORCE = 3
+} GSW_PCE_ActionLearning_t;
+
+/** \brief Interrupt Control Action Selector.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disabled. Interrupt Control Action is disabled for this rule. */
+ GSW_PCE_ACTION_IRQ_DISABLE = 0,
+ /** Regular Packet. The Interrupt Control Action is enabled, the packet is
+ treated as a regular packet and no interrupt event is generated. */
+ GSW_PCE_ACTION_IRQ_REGULAR = 1,
+ /** Interrupt Event. The Interrupt Control Action is enabled and an
+ interrupt event is generated. */
+ GSW_PCE_ACTION_IRQ_EVENT = 2
+} GSW_PCE_ActionIrq_t;
+
+/** \brief Cross State Action Selector.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disable. The Cross State Action is disabled. */
+ GSW_PCE_ACTION_CROSS_STATE_DISABLE = 0,
+ /** Regular Packet. The Cross State Action is enabled and the packet is
+ treated as a non-Cross-State packet (regular packet). Therefore it does
+ not ignore Port-State filtering rules. */
+ GSW_PCE_ACTION_CROSS_STATE_REGULAR = 1,
+ /** Cross-State packet. The Cross State Action is enabled and the packet is
+ treated as a Cross-State packet. It ignores the Port-State
+ filtering rules. */
+ GSW_PCE_ACTION_CROSS_STATE_CROSS = 2
+} GSW_PCE_ActionCrossState_t;
+
-/** \brief Traffic Flow Table Mangaement.
- * Used by \ref GSW_PCE_rule_t.
- */
+/** \brief Critical Frame Action Selector.
+ Used by \ref GSW_PCE_action_t. */
typedef enum {
- /** PCE Rule Region common for all CTP */
- GSW_PCE_RULE_COMMMON = 0,
- /** PCE Rule Region for specific CTP */
- GSW_PCE_RULE_CTP = 1,
- /** PCE Rule Debug (HW direct mapping) */
- GSW_PCE_RULE_DEBUG = 2
-} GSW_PCE_RuleRegion_t;
+ /** Disable. The Critical Frame Action is disabled. */
+ GSW_PCE_ACTION_CRITICAL_FRAME_DISABLE = 0,
+ /** Regular Packet. The Critical Frame Action is enabled and the packet is
+ treated as a non-Critical Frame. */
+ GSW_PCE_ACTION_CRITICAL_FRAME_REGULAR = 1,
+ /** Critical Packet. The Critical Frame Action is enabled and the packet is
+ treated as a Critical Frame. */
+ GSW_PCE_ACTION_CRITICAL_FRAME_CRITICAL = 2
+} GSW_PCE_ActionCriticalFrame_t;
+
+/** \brief Color Frame Action Selector.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disable. No color frame action. */
+ GSW_PCE_ACTION_COLOR_FRAME_DISABLE = 0,
+ /** Do not change color. */
+ GSW_PCE_ACTION_COLOR_FRAME_NO_CHANGE = 1,
+ /** Idendity packet as critical which bypass active congestion
+ management (ACM). */
+ GSW_PCE_ACTION_COLOR_FRAME_CRITICAL = 2,
+ /** Change to green color. */
+ GSW_PCE_ACTION_COLOR_FRAME_GREEN = 3,
+ /** Change to yellow color. */
+ GSW_PCE_ACTION_COLOR_FRAME_YELLOW = 4,
+ /** Change to red color. */
+ GSW_PCE_ACTION_COLOR_FRAME_RED = 5
+} GSW_PCE_ActionColorFrame_t;
+
+/** \brief Timestamp Action Selector.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disable. Timestamp Action is disabled for this rule. */
+ GSW_PCE_ACTION_TIMESTAMP_DISABLE = 0,
+ /** Regular Packet. The Timestamp Action is enabled for this rule.
+ The packet is treated as a regular packet and no timing information
+ is stored. */
+ GSW_PCE_ACTION_TIMESTAMP_REGULAR = 1,
+ /** Receive/Transmit Timing packet. Ingress and Egress Timestamps for
+ this packet should be stored. */
+ GSW_PCE_ACTION_TIMESTAMP_STORED = 2
+} GSW_PCE_ActionTimestamp_t;
+
+/** \brief Forwarding Group Action Selector.
+ This flow table action and the 'bFlowID_Action' action
+ can be used exclusively.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disable. Forwarding Group Action is disabled. */
+ GSW_PCE_ACTION_PORTMAP_DISABLE = 0,
+ /** Regular Packet. Forwarding Action enabled. Select Default
+ Port-Map (result of Default Forwarding Classification). */
+ GSW_PCE_ACTION_PORTMAP_REGULAR = 1,
+ /** Discard. Discard the packets. */
+ GSW_PCE_ACTION_PORTMAP_DISCARD = 2,
+ /** Forward to the CPU port. This requires that the CPU port is previously
+ set by calling \ref GSW_CPU_PortCfgSet. */
+ GSW_PCE_ACTION_PORTMAP_CPU = 3,
+ /** Forward to a portmap, selected by the parameter 'nForwardPortMap'.
+ Please note that this feature is not supported by all
+ hardware platforms. */
+ GSW_PCE_ACTION_PORTMAP_ALTERNATIVE = 4,
+ /** The packet is treated as Multicast Router
+ Solicitation/Advertisement or Query packet. */
+ GSW_PCE_ACTION_PORTMAP_MULTICAST_ROUTER = 5,
+ /** The packet is interpreted as Multicast packet and learned in the
+ multicast group table. */
+ GSW_PCE_ACTION_PORTMAP_MULTICAST_HW_TABLE = 6,
+ /** The CTAG VLAN portmap classification result is replaced by the
+ portmap parameter 'nForwardPortMap'. All other classification
+ results stay unchanged and will be combined together with
+ the overwritten portmap. */
+ GSW_PCE_ACTION_PORTMAP_ALTERNATIVE_VLAN = 7,
+ /** Add STAG VLAN portmap 'nForwardPortMap' to the overall portmap
+ classification result (AND'ed with the portmap). */
+ GSW_PCE_ACTION_PORTMAP_ALTERNATIVE_STAG_VLAN = 8
+} GSW_PCE_ActionPortmap_t;
+
+/** \brief Flow Meter Assignment control.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Action Disable. */
+ GSW_PCE_ACTION_METER_DISABLE = 0,
+ /** Action Enable.
+ The action is enabled but no dedicated metering instance is assigned by the rule. */
+ GSW_PCE_ACTION_METER_REGULAR = 1,
+ /** Action Enable. Assign one meter instance as given in parameter "nMeterId". */
+ GSW_PCE_ACTION_METER_1 = 2,
+ /** Action Enable. Assign pair of meter instances.
+ These instances are "nMeterId" and the next following meter instance index. */
+ GSW_PCE_ACTION_METER_1_2 = 3
+} GSW_PCE_ActionMeter_t;
+
+/** \brief VLAN Group Action Selector.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disabled. The VLAN Action is disabled. */
+ GSW_PCE_ACTION_VLAN_DISABLE = 0,
+ /** Regular VLAN. VLAN Action enabled. Select Default VLAN ID. */
+ GSW_PCE_ACTION_VLAN_REGULAR = 1,
+ /** Alternative VLAN. VLAN Action enabled. Reserved. */
+ GSW_PCE_ACTION_VLAN_ALTERNATIVE = 2
+} GSW_PCE_ActionVLAN_t;
+
+/** \brief Cross VLAN Action Selector.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Disabled. The Cross VLAN Action is disabled. */
+ GSW_PCE_ACTION_CROSS_VLAN_DISABLE = 0,
+ /** Regular VLAN Packet. Do not ignore VLAN filtering rules. */
+ GSW_PCE_ACTION_CROSS_VLAN_REGULAR = 1,
+ /** Cross-VLAN packet. Ignore VLAN filtering rules.*/
+ GSW_PCE_ACTION_CROSS_VLAN_CROSS = 2
+} GSW_PCE_ActionCrossVLAN_t;
+
+/** \brief MPE Processing Path Assignment Selector - used for GSWIP-3.0 only.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Processing Path is not enabled. */
+ GSW_PCE_PROCESSING_PATH_UNUSED = 0,
+ /** Processing Path-1 is used for MPE-1. */
+ GSW_PCE_PROCESSING_PATH_1 = 1,
+ /** Processing Path-2 is used for MPE-2. */
+ GSW_PCE_PROCESSING_PATH_2 = 2,
+ /** Processing Path-1 and -2 are used for MPE-1 & MPE-2. */
+ GSW_PCE_PROCESSING_PATH_BOTH = 3,
+} GSW_PCE_ProcessingPathAction_t;
+
+/** \brief Port Filter Action-1/2/3/4/5/6 Selector - used for GSWIP-3.0 only.
+ This can be used only along with PortMember config.
+ Used by \ref GSW_PCE_action_t. */
+typedef enum {
+ /** Port Filter Action is Unused. */
+ GSW_PCE_PORT_FILTER_ACTION_UNUSED = 0,
+ /** Port Filter Action Type-1 is used. */
+ GSW_PCE_PORT_FILTER_ACTION_1 = 1,
+ /** Port Filter Action Type-2 is used. */
+ GSW_PCE_PORT_FILTER_ACTION_2 = 2,
+ /** Port Filter Action Type-3 is used. */
+ GSW_PCE_PORT_FILTER_ACTION_3 = 3,
+ /** Port Filter Action Type-4 is used. */
+ GSW_PCE_PORT_FILTER_ACTION_4 = 4,
+ /** Port Filter Action Type-5 (Unknown Unicast) is used. */
+ GSW_PCE_PORT_FILTER_ACTION_5 = 5,
+ /** Port Filter Action Type-6 (Unknown Multicast) is used. */
+ GSW_PCE_PORT_FILTER_ACTION_6 = 6
+} GSW_PCE_PortFilterAction_t;
+
+/** \brief Mac-in-Mac (PBB) I-Header operation mode.
+ Used by \ref GSW_PCE_ActionPBB_t. */
+typedef enum {
+ /** No change in packet. */
+ GSW_PCE_I_HEADER_OPERATION_NOCHANGE = 0,
+ /** Insert I-Header for Non-PBB packet */
+ GSW_PCE_I_HEADER_OPERATION_INSERT = 1,
+ /** Remove I-Header for PBB packet
+ (Removes both I-Header and B-Tag)*/
+ GSW_PCE_I_HEADER_OPERATION_REMOVE = 2,
+ /** Replace the I-Header Fields for PBB packet */
+ GSW_PCE_I_HEADER_OPERATION_REPLACE = 3,
+} GSW_PCE_IheaderOperationMode;
+
+/** \brief Mac-in-Mac (PBB) B-tag operation mode.
+ Used by \ref GSW_PCE_ActionPBB_t. */
+typedef enum {
+ /** No change in B-TAG for PBB packet. */
+ GSW_PCE_B_TAG_OPERATION_NOCHANGE = 0,
+ /** Insert B-TAG for PBB packet */
+ GSW_PCE_B_TAG_OPERATION_INSERT = 1,
+ /** Remove B-TAG for PBB packet */
+ GSW_PCE_B_TAG_OPERATION_REMOVE = 2,
+ /** Replace B-TAG fields for PBB packet */
+ GSW_PCE_B_TAG_OPERATION_REPLACE = 3,
+} GSW_PCE_BtagOperationMode;
+
+/** \brief Mac-in-Mac (PBB) MAC selection.
+ Used by \ref GSW_PCE_ActionPBB_t. */
+typedef enum {
+ /** Outer Mac address is selected for learning
+ non-PBB packet or PBB encapsulation*/
+ GSW_PCE_OUTER_MAC_SELECTED = 0,
+ /** inner Mac address is selected for learning
+ PBB decapsulation*/
+ GSW_PCE_INNER_MAC_SELECTED = 1,
+} GSW_PCE_MacTableMacinMacSelect;
+
+/** \brief PBB Action.
+ Used by \ref GSW_PCE_action_t. */
+typedef struct {
+ /** Tunnel Template Index for I-Header Known traffic.
+ \if DOC_ENABLE_PBB
+ This field should be valid ID returned by
+ \ref GSW_PBB_TunnelTempate_Alloc and c
+ onfigured Using GSW_PBB_TunnelTempate_Config_Set
+ \endif
+ */
+ u8 nTunnelIdKnownTraffic;
+ /** Tunnel Template Index for I-Header UnKnown traffic.
+ \if DOC_ENABLE_PBB
+ This field should be valid ID returned by
+ \ref GSW_PBB_TunnelTempate_Alloc and
+ configured Using GSW_PBB_TunnelTempate_Config_Set
+ \endif
+ */
+ u8 nTunnelIdUnKnownTraffic;
+ /** Tunnel Template Index for B-TAG Known traffic.
+ \if DOC_ENABLE_PBB
+ This field should be valid ID returned by
+ \ref GSW_PBB_TunnelTempate_Alloc and
+ configured Using GSW_PBB_TunnelTempate_Config_Set
+ \endif
+ */
+ u8 nProcessIdKnownTraffic;
+ /** Tunnel Template Index for B-TAG UnKnown traffic.
+ \if DOC_ENABLE_PBB
+ This field should be valid ID returned by
+ \ref GSW_PBB_TunnelTempate_Alloc and
+ Configured Using GSW_PBB_TunnelTempate_Config_Set
+ \endif
+ */
+ u8 nProcessIdUnKnownTraffic;
+ /** I-Header Operation Mode*/
+ GSW_PCE_IheaderOperationMode eIheaderOpMode;
+ /** B-Tag Operation Mode*/
+ GSW_PCE_BtagOperationMode eBtagOpMode;
+ /** Action enable I-Header*/
+ /**Select Mac Table MacinMac Action */
+ GSW_PCE_MacTableMacinMacSelect eMacTableMacinMacSelect;
+ /** Enable Mac-in-Mac (PBB) I-Header action */
+ gsw_bool_t bIheaderActionEnable;
+ /** Enable Tunnel Id for I-Header Known traffic*/
+ gsw_bool_t bTunnelIdKnownTrafficEnable;
+ /** Enable Tunnel Id for I-Header UnKnown traffic*/
+ gsw_bool_t bTunnelIdUnKnownTrafficEnable;
+ /** Incase of I-Header operation mode is Insertion
+ and bB_DstMac_FromMacTableEnable is enabled,
+ the B-DA is from Mac table instead of tunnel template*/
+ gsw_bool_t bB_DstMac_FromMacTableEnable;
+ /** Replace B-SA from tunnel template*/
+ gsw_bool_t bReplace_B_SrcMacEnable;
+ /** Replace B-DA from tunnel template*/
+ gsw_bool_t bReplace_B_DstMacEnable;
+ /** Replace I-Tag Res from tunnel template*/
+ gsw_bool_t bReplace_I_TAG_ResEnable;
+ /** Replace I-Tag UAC from tunnel template*/
+ gsw_bool_t bReplace_I_TAG_UacEnable;
+ /** Replace I-Tag DEI from tunnel template*/
+ gsw_bool_t bReplace_I_TAG_DeiEnable;
+ /** Replace I-Tag PCP from tunnel template*/
+ gsw_bool_t bReplace_I_TAG_PcpEnable;
+ /** Replace I-Tag SID from tunnel template*/
+ gsw_bool_t bReplace_I_TAG_SidEnable;
+ /** Replace I-Tag TPID from tunnel template*/
+ gsw_bool_t bReplace_I_TAG_TpidEnable;
+ /** Action enable B-TAG*/
+ gsw_bool_t bBtagActionEnable;
+ /** Enable Process Id for B-TAG Known traffic*/
+ gsw_bool_t bProcessIdKnownTrafficEnable;
+ /** Enable Process Id for B-TAG UnKnown traffic*/
+ gsw_bool_t bProcessIdUnKnownTrafficEnable;
+ /** Replace B-Tag DEI from tunnel template*/
+ gsw_bool_t bReplace_B_TAG_DeiEnable;
+ /** Replace B-Tag PCP from tunnel template*/
+ gsw_bool_t bReplace_B_TAG_PcpEnable;
+ /** Replace B-Tag SID from tunnel template*/
+ gsw_bool_t bReplace_B_TAG_VidEnable;
+ /** Replace B-Tag TPID from tunnel template*/
+ gsw_bool_t bReplace_B_TAG_TpidEnable;
+ /**Action enable Mac Table MacinMac*/
+ gsw_bool_t bMacTableMacinMacActionEnable;
+} GSW_PCE_ActionPBB_t;
-/** \brief Parameter to delete a rule from the packet classification engine.
- Used by \ref GSW_PCE_RULE_DELETE. */
+/** \brief Sub-interface ID Action.
+ Used by \ref GSW_PCE_action_t. */
typedef struct {
- /** Logical Port Id. The valid range is hardware dependent. */
- u8 logicalportid;
- /** Sub interface ID group,
- *The valid range is hardware/protocol dependent.
- */
- u16 subifidgroup;
- /** PCE TABLE Region */
- GSW_PCE_RuleRegion_t region;
+ /** Destination Sub IF ID Group Field Action Enable*/
+ gsw_bool_t bDestSubIFIDActionEnable;
+ /** Destination Sub IF ID Group Field Assignment Enable*/
+ gsw_bool_t bDestSubIFIDAssignmentEnable;
+ /** Destination Sub IF ID Group Field or LAG Index for truncking action*/
+ u16 nDestSubIFGrp_Field;
+} GSW_PCE_ActionDestSubIF_t;
- /** Rule Index in the PCE Table. */
- u16 nIndex;
-} GSW_PCE_ruleEntry_t;
+/** \brief Packet Classification Engine Action Configuration.
+ GSWIP-3.0 extension actions are explicitly indicated.
+ Used by \ref GSW_PCE_rule_t. */
+typedef struct {
+ /** Signed time compensation value for OAM delay measurement.
+ * The valid values are -4,294,967,295 ~ 4,294,967,295.
+ */
+ long long nTimeComp;
+ /** Extended VLAN block allocated for traffic match this flow entry. Valid
+ when bExtendedVlanEnable is TRUE. Only FIRST VLAN operation in this block
+ is used for flow process. */
+ u16 nExtendedVlanBlockId;
+ /** Insertion/Extraction Point */
+ u8 nInsExtPoint;
+ /** PTP Sequence ID for PTP application */
+ u8 nPtpSeqId;
+ /** Target portmap for forwarded packets, only used if selected by
+ 'ePortMapAction'. Forwarding is done
+ if 'ePortMapAction = GSW_PCE_ACTION_PORTMAP_ALTERNATIVE'.
+ Every bit in the portmap represents one port (port 0 = LSB bit). */
+ /** If both bNoPktUpdate and bAppendToPkt are false, this is byte offset (2~255) to insert counter or timestamp. */
+ u16 nPktUpdateOffset;
+ /** Traffic flow counter ID used for counter insertion in OAM loss measurement.
+ * This is least significant bits of traffic flow counter ID.
+ * The most significant bits depends on traffic flow counter mode.
+ * For example, if it's global mode, this is full traffic flow counter ID.
+ * If it's logical port mode, MSB is ingress logical port ID and LSB is 5 bits of this parameter.
+ * If it's CTP or BP (bridge port) mode, it depends on configuration.
+ */
+ u16 nOamFlowId;
+ /** Record ID is information used by extraction (bExtractEnable is set)
+ * and/or OAM process (bOamEnable is set). For GSWIP-3.1 and above.
+ * Refer to GSWIP-3.1 Hardware Architecture Spec (HAS) for more detail.
+ * This is deperated and should be set to ZERO.
+ **/
+ u16 nRecordId;
+
+ /** Target portmap for forwarded packets, only used if selected by
+ 'ePortMapAction'. Forwarding is done
+ if 'ePortMapAction = GSW_PCE_ACTION_PORTMAP_ALTERNATIVE'.
+ Every bit in the portmap represents one bridge port (port 0 = LSB bit). */
+ u16 nForwardPortMap[8]; /* max can be 16 */
+ /** Counter ID (The index starts counting from zero). */
+ u16 nRMON_Id;
+ /** Alternative STAG VLAN Id */
+ u16 nSVLAN_Id;
+ /** Flow ID */
+ u16 nFlowID;
+ /** Routing Extension Id Value - for GSWIP-3.0 only. (8-bits range) */
+ u16 nRoutExtId;
+ /** Alternative Traffic class - used when eTrafficClassAction is set to 2. */
+ u8 nTrafficClassAlternate;
+ /** Meter ID */
+ u8 nMeterId;
+ /** Alternative CTAG VLAN Id */
+ u8 nVLAN_Id;
+ /** Alternative FID. Valid when bFidEnable is TRUE. */
+ u8 nFId;
+ /** Action "Traffic Class" Group.
+ Traffic class action enable */
+ GSW_PCE_ActionTrafficClass_t eTrafficClassAction;
+
+ /** Action "IGMP Snooping" Group.
+ IGMP Snooping control and enable. Please note that the 'nPortMapAction'
+ configuration is ignored in case the IGMP snooping is enabled.
+ Here, on read operations,
+ 'nPortMapAction = GSW_PCE_ACTION_PORTMAP_DISABLE' is returned. */
+ GSW_PCE_ActionIGMP_Snoop_t eSnoopingTypeAction;
+
+ /** Action "Learning" Group.
+ Learning action control and enable */
+ GSW_PCE_ActionLearning_t eLearningAction;
+
+ /** Action "Interrupt" Group.
+ Interrupt action generate and enable */
+ GSW_PCE_ActionIrq_t eIrqAction;
+
+ /** Action "Cross State" Group.
+ Cross state action control and enable */
+ GSW_PCE_ActionCrossState_t eCrossStateAction;
+
+ /** Action "Critical Frames" Group.
+ Critical Frame action control and enable */
+ GSW_PCE_ActionCriticalFrame_t eCritFrameAction;
+
+ /** Action "Color Frames" Group.
+ This is replacement of eCritFrameAction in GSWIP-3.1. */
+ GSW_PCE_ActionColorFrame_t eColorFrameAction;
+
+ /** Action "Timestamp" Group. Time stamp action control and enable */
+ GSW_PCE_ActionTimestamp_t eTimestampAction;
+
+ /** Action "Forwarding" Group.
+ Port map action enable. This port forwarding configuration is ignored
+ in case the action "IGMP Snooping" is enabled via the
+ parameter 'nSnoopingTypeAction'. */
+ GSW_PCE_ActionPortmap_t ePortMapAction;
+ /** Action "Meter" Group. Meter action control and enable.
+ If metering action enabled, specified metering instance number
+ overrules any other metering assignment.
+ Up to two metering instances can be applied to a single packet. */
+ GSW_PCE_ActionMeter_t eMeterAction;
+ /** Action "CTAG VLAN" Group. VLAN action enable */
+ GSW_PCE_ActionVLAN_t eVLAN_Action;
+ /** Action "STAG VLAN" Group. VLAN action enable */
+ GSW_PCE_ActionVLAN_t eSVLAN_Action;
+ /** Action "Cross VLAN" Group. Cross VLAN action enable */
+ GSW_PCE_ActionCrossVLAN_t eVLAN_CrossAction;
+ /** Assignment of flow to MPE Processing Path-1 or -2 or both - for GSWIP-3.0 only. */
+ GSW_PCE_ProcessingPathAction_t eProcessPath_Action;
+ /** Port Filter Action Config for this flow - for GSWIP-3.0 only. */
+ GSW_PCE_PortFilterAction_t ePortFilterType_Action;
+ /** Mac-in-Mac (PBB) Action Config */
+ GSW_PCE_ActionPBB_t sPBB_Action;
+ /** Sub-interface-ID Assignment Action */
+ GSW_PCE_ActionDestSubIF_t sDestSubIF_Action;
+ /** Action "Remarking" Group. Remarking action enable. Reserved in
+ GSWIP-3.1. */
+ gsw_bool_t bRemarkAction;
+ /** CTAG VLAN PCP remarking enable. Reserved in GSWIP-3.1.
+ Remarking enabling means that remarking is possible in case
+ the port configuration or metering enables remarking on that
+ packet. Disabling remarking means that it is forced to
+ not remarking this packet, independent of any port remarking of
+ metering configuration. */
+ gsw_bool_t bRemarkPCP;
+ /** STAG VLAN PCP remarking enable. Reserved in GSWIP-3.1.
+ Remarking enabling means that remarking is possible in case
+ the port configuration or metering enables remarking on that
+ packet. Disabling remarking means that it is forced to
+ not remarking this packet, independent of any port remarking of
+ metering configuration. */
+ gsw_bool_t bRemarkSTAG_PCP;
+ /** STAG VLAN DEI remarking enable. Reserved in GSWIP-3.1.
+ Remarking enabling means that remarking is possible in case
+ the port configuration or metering enables remarking on that
+ packet. Disabling remarking means that it is forced to
+ not remarking this packet, independent of any port remarking of
+ metering configuration. */
+ gsw_bool_t bRemarkSTAG_DEI;
+ /** DSCP remarking enable. Reserved in GSWIP-3.1.
+ Remarking enabling means that remarking is possible in case
+ the port configuration or metering enables remarking on that
+ packet. Disabling remarking means that it is forced to
+ not remarking this packet, independent of any port remarking of
+ metering configuration. */
+ gsw_bool_t bRemarkDSCP;
+ /** Class remarking enable. Reserved in GSWIP-3.1.
+ Remarking enabling means that remarking is possible in case
+ the port configuration or metering enables remarking on that
+ packet. Disabling remarking means that it is forced to
+ not remarking this packet, independent of any port remarking of
+ metering configuration. */
+ gsw_bool_t bRemarkClass;
+
+ /** Action "RMON" Group. RMON action enable. Reserved in GSWIP-3.1. */
+ gsw_bool_t bRMON_Action;
+ /** Enable alternative FID */
+ gsw_bool_t bFidEnable;
+ /** Enable extended VLAN operation for traffic match this flow entry. */
+ gsw_bool_t bExtendedVlanEnable;
+ /** CVLAN Ignore control */
+ gsw_bool_t bCVLAN_Ignore_Control;
+ /** Port BitMap Mux control */
+ gsw_bool_t bPortBitMapMuxControl;
+ /** Trunking action enable */
+ gsw_bool_t bPortTrunkAction;
+ /** Port Link Selection control */
+ gsw_bool_t bPortLinkSelection; //NA for F48X. Can remove?
+ /** Action "Flow ID".
+ The Switch supports enhancing the egress packets by a device specific
+ special tag header. This header contains detailed switch classification
+ results. One header file is a 'Flow ID', which can be explicitly set as
+ flow table action when hitting a table rule.
+ If selected, the Flow ID is given by the parameter 'nFlowID'. */
+ gsw_bool_t bFlowID_Action;
+ /** Routing Extension Id Action Selector - for GSWIP-3.0 only.
+ When enabled, it expects a valid nRoutExtId value to be supplied. */
+ gsw_bool_t bRoutExtId_Action;
+ /** Routing Destination Port Mask Comparison - for GSWIP-3.0 only. If not enabled this field is not considered for routing session pattern lookup.*/
+ gsw_bool_t bRtDstPortMaskCmp_Action;
+ /** Routing Source Port Mask Comparison - for GSWIP-3.0 only. If not enabled, this field is not considered for routing session pattern lookup.*/
+ gsw_bool_t bRtSrcPortMaskCmp_Action;
+ /** Routing Destination IP Address Mask Comparison - for GSWIP-3.0 only. If not enabled, this field is not considered for routing session pattern lookup.*/
+ gsw_bool_t bRtDstIpMaskCmp_Action;
+ /** Routing Source IP Address Mask Comparison - for GSWIP-3.0 only. If not enabled, this field is not considered for routing session pattern lookup.*/
+ gsw_bool_t bRtSrcIpMaskCmp_Action;
+ /** Selector of IP in Tunneled IP header (Outer or Inner) - for GSWIP-3.0 only. */
+ gsw_bool_t bRtInnerIPasKey_Action;
+ /** Routing Acceleration Enable Action - for GSWIP-3.0 only. This variable decides whether to accelerate the Routing session or not */
+ gsw_bool_t bRtAccelEna_Action;
+ /** Routing Control Enable Action - for GSWIP-3.0 only. This variable is selector of Routing Accelerate action*/
+ gsw_bool_t bRtCtrlEna_Action;
+ /** Enable Extraction. For GSWIP-3.1 only.
+ Packet is identified to be extracted at extraction point defined by
+ nRecordId. */
+ gsw_bool_t bExtractEnable;
+ /** Enable OAM. For GSWIP-3.1 only.
+ Packet is identified for OAM process. */
+ gsw_bool_t bOamEnable;
+ /** Update packet after QoS queue (in PCE Bypass path). */
+ gsw_bool_t bPceBypassPath;
+ /** This is Tx flow counter, otherwise Rx flow counter is used in OAM loss measurement. */
+ gsw_bool_t bTxFlowCnt;
+ /** Timestamp format. */
+ enum {
+ GSW_PCE_DIGITAL_10B = 0,
+ GSW_PCE_BINARY_10B = 1,
+ GSW_PCE_DIGITAL_8B = 2,
+ GSW_PCE_BINARY_8B = 3
+ } eTimeFormat;
+ /** Do not update packet */
+ gsw_bool_t bNoPktUpdate;
+ /** If bNoPktUpdate is false, this flag indicates to append counter or timestamp to end of packet. */
+ gsw_bool_t bAppendToPkt;
+ /** Configure PBB action. For GSWIP-3.2 only*/
+ gsw_bool_t bPBB_Action_Enable;
+ /** For Enabling Dest SubIF ID Group field in TFLOW.Valid only For GSWIP-3.2 only*/
+ gsw_bool_t bDestSubIf_Action_Enable;
+} GSW_PCE_action_t;
/** \brief Parameter to add/read a rule to/from the packet classification engine.
- Used by \ref GSW_PCE_RULE_WRITE and \ref GSW_PCE_RULE_READ. */
+ Used by \ref GSW_PceRuleWrite and \ref GSW_PceRuleRead. */
typedef struct {
/** Logical Port Id. The valid range is hardware dependent. */
u8 logicalportid;
@@ -1035,7 +1051,8 @@
} GSW_PCE_rule_t;
/** \brief TRAFFIC FLOW TABLE Allocation.
- * Used by \ref GSW_PCE_RULE_ALLOC and \ref GSW_PCE_RULE_FREE.
+ * Used by \ref GSW_PceRuleAlloc, \ref GSW_PceRuleFree and
+ * \ref GSW_PceRuleBlockSize.
*/
typedef struct {
/** Number of traffic flow table entries are
@@ -1043,19 +1060,48 @@
* port will go through PCE rules search ending at
* (nFirstFlowEntryIndex+nNumberOfFlowEntries)-1. Should
* be times of 4. Proper value should be given
- * for \ref GSW_PCE_RULE_ALLOC.
- * This field is ignored for \ref GSW_PCE_RULE_FREE.
+ * for \ref GSW_PceRuleAlloc.
+ * This field is output for \ref GSW_PceRuleFree and
+ * \ref GSW_PceRuleBlockSize.
*/
u16 num_of_rules;
- /** If \ref GSW_PCE_RULE_ALLOC is successful, a valid ID will be returned
+ /** If \ref GSW_PceRuleAlloc is successful, a valid ID will be returned
* in this field. Otherwise, \ref INVALID_HANDLE is
* returned in this field.
- * For \ref GSW_PCE_RULE_FREE, this field should be valid ID returned by
- * \ref GSW_PCE_RULE_ALLOC.
+ * For \ref GSW_PceRuleFree, this field should be valid ID returned by
+ * \ref GSW_PceRuleAlloc.
*/
u16 blockid;
} GSW_PCE_rule_alloc_t;
+/** \brief Parameter to delete a rule from the packet classification engine.
+ Used by \ref GSW_PceRuleDelete. */
+typedef struct {
+ /** Logical Port Id. The valid range is hardware dependent. */
+ u8 logicalportid;
+ /** Sub interface ID group,
+ *The valid range is hardware/protocol dependent.
+ */
+ u16 subifidgroup;
+ /** PCE TABLE Region */
+ GSW_PCE_RuleRegion_t region;
+
+ /** Rule Index in the PCE Table. */
+ u16 nIndex;
+} GSW_PCE_ruleEntry_t;
+
+/** \brief Parameter to move PCE rule to new entry.
+ * It copy the PCE rule from current entry to new entry and then delete it
+ * from current entry. Ths is used by \ref GSW_PceRuleMove. */
+typedef struct {
+ /** current PCE rule entry. */
+ GSW_PCE_ruleEntry_t cur;
+ /** new PCE rule entry */
+ GSW_PCE_ruleEntry_t new;
+} GSW_PCE_rule_move_t;
+
+/** @}*/ /* GSW_PCE */
+
#pragma scalar_storage_order default
#pragma pack(pop)
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_flow_index.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_flow_index.h
index ad17c7c..2a24c3f 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_flow_index.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_flow_index.h
@@ -17,8 +17,14 @@
#define BPDU_PCE_RULE_INDEX 9
#define PFC_PCE_RULE_INDEX 10
#define DSA_EXT_PCE_RULE_INDEX 11
+#define LLDP_PCE_RULE_INDEX 12
+#define OAM_8023AH_PCE_RULE_INDEX 13
+#define LACP_PCE_RULE_INDEX OAM_8023AH_PCE_RULE_INDEX
+#define PTP_PCE_RULE_INDEX 14
+#define MAX_PREDEFINED_GLOBAL_PCE_RULE 15
/* Per CTP Rules */
#define FC_PCE_RULE_INDEX 0
+#define MAX_PREDEFINED_PER_CTP_PCE_RULE 1
#endif /* #ifndef MXL_GSW_FLOW_INDEX_H_ */
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_pmac.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_pmac.h
index 6c9c58a..93fd369 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_pmac.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_pmac.h
@@ -15,6 +15,23 @@
#pragma pack(push, 1)
#pragma scalar_storage_order little-endian
+/** \addtogroup GSW_PMAC
+ * @{
+ */
+
+/** \brief Configure the Backpressure mapping for egress Queues Congestion or ingress (receiving) ports to DMA channel.
+ Used by \ref GSW_PMAC_BM_CfgSet and \ref GSW_PMAC_BM_CfgGet. */
+typedef struct {
+ /** PMAC Interface ID */
+ u8 nPmacId;
+ /** Tx DMA Channel Identifier which receives sideband backpressure signal (0..15) */
+ u8 nTxDmaChanId;
+ /** Transmit Queues Selection Mask which will generate backpressure - (Configurable upto 32 Egress Queues) */
+ u32 txQMask;
+ /** Receive (Ingress) ports selection congestion Mask which will generate backpressure - (Configurable upto 16 ports) */
+ u32 rxPortMask;
+} GSW_PMAC_BM_Cfg_t;
+
/** \brief Short Length Received Frame Check Type for PMAC.
Used by PMAC structure \ref GSW_PMAC_Glbl_Cfg_t. */
typedef enum {
@@ -28,7 +45,6 @@
GSW_PMAC_SHORT_LEN_RESERVED = 3
} GSW_PMAC_Short_Frame_Chk_t;
-
/** \brief Egress PMAC Config Table Selector */
typedef enum {
/** Use value of \ref GSW_PMAC_Glbl_Cfg_t::bProcFlagsEgCfgEna */
@@ -42,61 +58,9 @@
GSW_PMAC_PROC_FLAGS_MIX = 3
} GSW_PMAC_Proc_Flags_Eg_Cfg_t;
-
-/** \brief PMAC Ingress Configuration Source
- Source of the corresponding field. */
-typedef enum {
- /** Field is from DMA descriptor */
- GSW_PMAC_IG_CFG_SRC_DMA_DESC = 0,
- /** Field is from default PMAC header */
- GSW_PMAC_IG_CFG_SRC_DEF_PMAC = 1,
- /** Field is from PMAC header of packet */
- GSW_PMAC_IG_CFG_SRC_PMAC = 2,
-} GSW_PMAC_Ig_Cfg_Src_t;
-
-
-/** \brief PMAC Counters available for specified DMA Channel.
- Used by \ref GSW_PMAC_COUNT_GET. */
-typedef struct {
- /** PMAC Interface ID Applicable only for GSWIP 3.1 */
- u8 nPmacId;
- /*Applicable only for GSWIP 3.1*/
- gsw_bool_t b64BitMode;
- /** Transmit DMA Channel Identifier (0..15) for GSWIP3.0 (0..16) for GSWIP3.1 Source PortId for Egress Counters (0..15) for GSWIP3.1 - Index */
- u8 nTxDmaChanId;
- /** Ingress Total discarded packets counter (32-bits) */
- u32 nDiscPktsCount;
- /** Ingress Total discarded bytes counter (32-bits) */
- u32 nDiscBytesCount;
- /** Egress Total TCP/UDP/IP checksum error-ed packets counter (32-bits) */
- u32 nChkSumErrPktsCount;
- /** Egress Total TCP/UDP/IP checksum error-ed bytes counter (32-bits) */
- u32 nChkSumErrBytesCount;
- /** Total Ingress Packet Count in Applicable only for GSWIP 3.1 (32-bits) */
- u32 nIngressPktsCount;
- /** Total Ingress Bytes Count in Applicable only for GSWIP 3.1 (32-bits) */
- u32 nIngressBytesCount;
- /** Total Engress Packet Count in Applicable only for GSWIP 3.1 (32-bits) */
- u32 nEgressPktsCount;
- /** Total Engress Bytes Count in Applicable only for GSWIP 3.1 (32-bits) */
- u32 nEgressBytesCount;
- /** Ingress header Packet Count Applicable only for GSWIP 3.2 (32-bits) */
- u32 nIngressHdrPktsCount;
- /** Ingress header Byte Count Applicable only for GSWIP 3.2 (32-bits) */
- u32 nIngressHdrBytesCount;
- /** Egress header Packet Count Applicable only for GSWIP 3.2 (32-bits) */
- u32 nEgressHdrPktsCount;
- /** Egress header Byte Count Applicable only for GSWIP 3.2 (32-bits) */
- u32 nEgressHdrBytesCount;
- /** Egress header Discard Packet Count Applicable only for GSWIP 3.2 (32-bits) */
- u32 nEgressHdrDiscPktsCount;
- /** Egress header Discard Byte Count Applicable only for GSWIP 3.2 (32-bits) */
- u32 nEgressHdrDiscBytesCount;
-} GSW_PMAC_Cnt_t;
-
/** \brief Configure the global settings of PMAC for GSWIP-3.x. This includes settings such as Jumbo frame, Checksum handling,
Padding and Engress PMAC Selector Config.
- Used by \ref GSW_PMAC_GLBL_CFG_SET and \ref GSW_PMAC_GLBL_CFG_GET. */
+ Used by \ref GSW_PMAC_GLBL_CfgSet and \ref GSW_PMAC_GLBL_CfgGet. */
typedef struct {
/** PMAC Interface Id */
u8 nPmacId;
@@ -138,24 +102,20 @@
u32 nBslThreshold[3];
} GSW_PMAC_Glbl_Cfg_t;
-/** \brief Configure the Backpressure mapping for egress Queues Congestion or ingress (receiving) ports to DMA channel.
- Used by \ref GSW_PMAC_BM_CFG_SET and \ref GSW_PMAC_BM_CFG_GET. */
-typedef struct {
- /** PMAC Interface ID */
- u8 nPmacId;
- /** Tx DMA Channel Identifier which receives sideband backpressure signal (0..15) */
- u8 nTxDmaChanId;
- /** Transmit Queues Selection Mask which will generate backpressure - (Configurable upto 32 Egress Queues) */
- u32 txQMask;
- /** Receive (Ingress) ports selection congestion Mask which will generate backpressure - (Configurable upto 16 ports) */
- u32 rxPortMask;
-} GSW_PMAC_BM_Cfg_t;
-
-
+/** \brief PMAC Ingress Configuration Source
+ Source of the corresponding field. */
+typedef enum {
+ /** Field is from DMA descriptor */
+ GSW_PMAC_IG_CFG_SRC_DMA_DESC = 0,
+ /** Field is from default PMAC header */
+ GSW_PMAC_IG_CFG_SRC_DEF_PMAC = 1,
+ /** Field is from PMAC header of packet */
+ GSW_PMAC_IG_CFG_SRC_PMAC = 2,
+} GSW_PMAC_Ig_Cfg_Src_t;
/** \brief Configure the PMAC Ingress Configuration on a given Tx DMA channel to PMAC. (Upto 16 entries).
This Ingress PMAC table is addressed through Trasnmit DMA Channel Identifier.
- Used by \ref GSW_PMAC_IG_CFG_SET and \ref GSW_PMAC_IG_CFG_GET. */
+ Used by \ref GSW_PMAC_IG_CfgSet and \ref GSW_PMAC_IG_CfgGet. */
typedef struct {
/** PMAC Interface Id */
u8 nPmacId;
@@ -188,7 +148,7 @@
nDestPortId (Bits 0-3) + Combination of [bMpe1Flag (Bit 4) + bMpe2Flag (Bit 5) + bEncFlag (Bit 6) + bDecFlag (Bit 7) ] or TrafficClass Value (Bits 4-7) + nFlowIdMSB (Bits 8-9).
The bits 4-7 of index option is either based upon TC (default) or combination of Processing flags is decided through bProcFlagsEgPMACEna.
It is expected to pass the correct value in bProcFlagsSelect same as global bProcFlagsEgPMACEna;
- Used by \ref GSW_PMAC_EG_CFG_SET and \ref GSW_PMAC_EG_CFG_GET. */
+ Used by \ref GSW_PMAC_EG_CfgSet and \ref GSW_PMAC_EG_CfgGet. */
typedef struct {
/** PMAC Interface ID */
u8 nPmacId;
@@ -252,6 +212,45 @@
gsw_bool_t bTCEnable;
} GSW_PMAC_Eg_Cfg_t;
+/** \brief PMAC Counters available for specified DMA Channel.
+ Used by \ref GSW_PMAC_CountGet. */
+typedef struct {
+ /** PMAC Interface ID Applicable only for GSWIP 3.1 */
+ u8 nPmacId;
+ /** Transmit DMA Channel Identifier (0..15) for GSWIP3.0 (0..16) for GSWIP3.1 Source PortId for Egress Counters (0..15) for GSWIP3.1 - Index */
+ u8 nTxDmaChanId;
+ /** Ingress Total discarded packets counter (32-bits) */
+ u32 nDiscPktsCount;
+ /** Ingress Total discarded bytes counter (32-bits) */
+ u32 nDiscBytesCount;
+ /** Egress Total TCP/UDP/IP checksum error-ed packets counter (32-bits) */
+ u32 nChkSumErrPktsCount;
+ /** Egress Total TCP/UDP/IP checksum error-ed bytes counter (32-bits) */
+ u32 nChkSumErrBytesCount;
+ /** Total Ingress Packet Count in Applicable only for GSWIP 3.1 (32-bits) */
+ u32 nIngressPktsCount;
+ /** Total Ingress Bytes Count in Applicable only for GSWIP 3.1 (32-bits) */
+ u32 nIngressBytesCount;
+ /** Total Engress Packet Count in Applicable only for GSWIP 3.1 (32-bits) */
+ u32 nEgressPktsCount;
+ /** Total Engress Bytes Count in Applicable only for GSWIP 3.1 (32-bits) */
+ u32 nEgressBytesCount;
+ /** Ingress header Packet Count Applicable only for GSWIP 3.2 (32-bits) */
+ u32 nIngressHdrPktsCount;
+ /** Ingress header Byte Count Applicable only for GSWIP 3.2 (32-bits) */
+ u32 nIngressHdrBytesCount;
+ /** Egress header Packet Count Applicable only for GSWIP 3.2 (32-bits) */
+ u32 nEgressHdrPktsCount;
+ /** Egress header Byte Count Applicable only for GSWIP 3.2 (32-bits) */
+ u32 nEgressHdrBytesCount;
+ /** Egress header Discard Packet Count Applicable only for GSWIP 3.2 (32-bits) */
+ u32 nEgressHdrDiscPktsCount;
+ /** Egress header Discard Byte Count Applicable only for GSWIP 3.2 (32-bits) */
+ u32 nEgressHdrDiscBytesCount;
+} GSW_PMAC_Cnt_t;
+
+/** @}*/ /* GSW_PMAC */
+
#pragma scalar_storage_order default
#pragma pack(pop)
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_rmon.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_rmon.h
index 76fb79e..7b0f716 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_rmon.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_rmon.h
@@ -15,8 +15,9 @@
#pragma pack(push, 1)
#pragma scalar_storage_order little-endian
-/** \brief Port Type - GSWIP-3.1 only.
- Used by \ref GSW_portCfg_t. */
+/** \ingroup GSW_ETHERNET_BRIDGING
+ * \brief Port Type.
+ * Used by \ref GSW_portCfg_t. */
typedef enum {
/** Logical Port */
GSW_LOGICAL_PORT = 0,
@@ -31,37 +32,10 @@
GSW_BRIDGE_PORT = 3
} GSW_portType_t;
-/**Defined as per RMON counter table structure
- Applicable only for GSWIP 3.1*/
-typedef enum {
- GSW_RMON_CTP_PORT_RX = 0,
- GSW_RMON_CTP_PORT_TX = 1,
- GSW_RMON_BRIDGE_PORT_RX = 2,
- GSW_RMON_BRIDGE_PORT_TX = 3,
- GSW_RMON_CTP_PORT_PCE_BYPASS = 4,
- GSW_RMON_TFLOW_RX = 5,
- GSW_RMON_TFLOW_TX = 6,
- GSW_RMON_QMAP = 0x0E,
- GSW_RMON_METER = 0x19,
- GSW_RMON_PMAC = 0x1C,
-} GSW_RMON_portType_t;
-
-/** Defined as per RMON counter table structure
- * Applicable only for GSWIP 3.0
+/** \addtogroup GSW_RMON
+ * @{
*/
-typedef enum {
- GSW_RMON_REDIRECTION = 0X18,
- GSW_RMON_IF = 0x1A,
- GSW_RMON_ROUTE = 0x1B,
- GSW_RMON_PMACIG = 0x1C,
-} GSW_RMON_Port_t;
-typedef enum {
- /** Parser microcode table */
- PMAC_BPMAP_INDEX = 0x00,
- PMAC_IGCFG_INDEX = 0x01,
- PMAC_EGCFG_INDEX = 0x02,
-} pm_tbl_cmds_t;
/** \brief RMON Counters Type enumeration.
Used by \ref GSW_RMON_clear_t and \ref GSW_RMON_mode_t. */
typedef enum {
@@ -85,84 +59,92 @@
GSW_RMON_CTP_TYPE = 8,
} GSW_RMON_type_t;
+/** \brief RMON Counters Data Structure for clearance of values.
+ Used by \ref GSW_RMON_Clear. */
+typedef struct {
+ /** RMON Counters Type */
+ GSW_RMON_type_t eRmonType;
+ /** RMON Counters Identifier - Meter, Port, If, Route, etc. */
+ u8 nRmonId;
+} GSW_RMON_clear_t;
-/** \brief RMON Counters Mode Enumeration.
- This enumeration defines Counters mode - Packets based or Bytes based counting.
- Metering and Routing Sessions RMON counting support either Byte based or packets based only. */
+/**Defined as per RMON counter table structure
+ Applicable only for GSWIP 3.1*/
typedef enum {
- /** Packet based RMON Counters */
- GSW_RMON_COUNT_PKTS = 0,
- /** Bytes based RMON Counters */
- GSW_RMON_COUNT_BYTES = 1,
- /** number of dropped frames, supported only for interface cunters */
- GSW_RMON_DROP_COUNT = 2,
-} GSW_RMON_CountMode_t;
+ GSW_RMON_CTP_PORT_RX = 0,
+ GSW_RMON_CTP_PORT_TX = 1,
+ GSW_RMON_BRIDGE_PORT_RX = 2,
+ GSW_RMON_BRIDGE_PORT_TX = 3,
+ GSW_RMON_CTP_PORT_PCE_BYPASS = 4,
+ GSW_RMON_TFLOW_RX = 5,
+ GSW_RMON_TFLOW_TX = 6,
+ GSW_RMON_QMAP = 0x0E,
+ GSW_RMON_METER = 0x19,
+ GSW_RMON_PMAC = 0x1C,
+} GSW_RMON_portType_t;
-/** \brief Used for getting metering RMON counters.
- Used by \ref GSW_RMON_METER_GET */
+/** TFLOW counter mode type */
typedef enum {
- /* Resereved */
- GSW_RMON_METER_COLOR_RES = 0,
- /* Green color */
- GSW_RMON_METER_COLOR_GREEN = 1,
- /* Yellow color */
- GSW_RMON_METER_COLOR_YELLOW = 2,
- /* Red color */
- GSW_RMON_METER_COLOR_RED = 3,
-} GSW_RmonMeterColor_t;
+ /** Global mode */
+ GSW_TFLOW_CMODE_GLOBAL = 0,
+ /** Logical port mode */
+ GSW_TFLOW_CMODE_LOGICAL = 1,
+ /** CTP port mode */
+ GSW_TFLOW_CMODE_CTP = 2,
+ /** Bridge port mode */
+ GSW_TFLOW_CMODE_BRIDGE = 3,
+} GSW_TflowCmodeType_t;
-/* TFLOW counter type */
+/** TFLOW counter type */
typedef enum {
- /* Set all Rx/Tx/PCE-Bp-Tx registers to same value */
+ /** Set all Rx/Tx/PCE-Bp-Tx registers to same value */
GSW_TFLOW_COUNTER_ALL = 0, //Default for 'set' function.
- /* SEt PCE Rx register config only */
+ /** SEt PCE Rx register config only */
GSW_TFLOW_COUNTER_PCE_Rx = 1, //Default for 'get' function.
- /* SEt PCE Tx register config only */
+ /** SEt PCE Tx register config only */
GSW_TFLOW_COUNTER_PCE_Tx = 2,
- /* SEt PCE-Bypass Tx register config only */
+ /** SEt PCE-Bypass Tx register config only */
GSW_TFLOW_COUNTER_PCE_BP_Tx = 3,
} GSW_TflowCountConfType_t;
-
-/* TFLOW counter mode type */
-typedef enum {
- /* Global mode */
- GSW_TFLOW_CMODE_GLOBAL = 0,
- /* Logical mode */
- GSW_TFLOW_CMODE_LOGICAL = 1,
- /* CTP port mode */
- GSW_TFLOW_CMODE_CTP = 2,
- /* Bridge port mode */
- GSW_TFLOW_CMODE_BRIDGE = 3,
-} GSW_TflowCmodeType_t;
-
-/* TFLOW CTP counter LSB bits */
+/** TFLOW CTP counter LSB bits */
typedef enum {
/* Num of valid bits */
+ /** 0 valid bits */
GSW_TCM_CTP_VAL_BITS_0 = 0,
+ /** 1 valid bits */
GSW_TCM_CTP_VAL_BITS_1 = 1,
+ /** 2 valid bits */
GSW_TCM_CTP_VAL_BITS_2 = 2,
+ /** 3 valid bits */
GSW_TCM_CTP_VAL_BITS_3 = 3,
+ /** 4 valid bits */
GSW_TCM_CTP_VAL_BITS_4 = 4,
+ /** 5 valid bits */
GSW_TCM_CTP_VAL_BITS_5 = 5,
+ /** 6 valid bits */
GSW_TCM_CTP_VAL_BITS_6 = 6,
} GSW_TflowCtpValBits_t;
-
-/* TFLOW bridge port counter LSB bits */
+/** TFLOW bridge port counter LSB bits */
typedef enum {
/* Num of valid bits */
+ /** 2 valid bits */
GSW_TCM_BRP_VAL_BITS_2 = 2,
+ /** 3 valid bits */
GSW_TCM_BRP_VAL_BITS_3 = 3,
+ /** 4 valid bits */
GSW_TCM_BRP_VAL_BITS_4 = 4,
+ /** 5 valid bits */
GSW_TCM_BRP_VAL_BITS_5 = 5,
+ /** 6 valid bits */
GSW_TCM_BRP_VAL_BITS_6 = 6,
} GSW_TflowBrpValBits_t;
/**
\brief RMON Counters for individual Port.
This structure contains the RMON counters of an Ethernet Switch Port.
- Used by \ref GSW_RMON_PORT_GET. */
+ Used by \ref GSW_RMON_Port_Get. */
typedef struct {
/** Port Type. This gives information which type of port to get RMON.
nPortId should be based on this field.
@@ -173,7 +155,7 @@
dependent. An error code is delivered if the selected port is not
available. This parameter specifies for which MAC port the RMON
counter is read. It has to be set by the application before
- calling \ref GSW_RMON_PORT_GET. */
+ calling \ref GSW_RMON_Port_Get. */
u16 nPortId;
/** Sub interface ID group. The valid range is hardware/protocol dependent.
@@ -281,6 +263,18 @@
u64 nTxGoodBytes;
} GSW_RMON_Port_cnt_t;
+/** \brief RMON Counters Mode Enumeration.
+ This enumeration defines Counters mode - Packets based or Bytes based counting.
+ Metering and Routing Sessions RMON counting support either Byte based or packets based only. */
+typedef enum {
+ /** Packet based RMON Counters */
+ GSW_RMON_COUNT_PKTS = 0,
+ /** Bytes based RMON Counters */
+ GSW_RMON_COUNT_BYTES = 1,
+ /** number of dropped frames, supported only for interface cunters */
+ GSW_RMON_DROP_COUNT = 2,
+} GSW_RMON_CountMode_t;
+
/** \brief RMON Counters Mode for different Elements.
This structure takes RMON Counter Element Name and mode config */
typedef struct {
@@ -293,13 +287,13 @@
/**
\brief RMON Counters for Meter - Type (GSWIP-3.0 only).
This structure contains the RMON counters of one Meter Instance.
- Used by \ref GSW_RMON_METER_GET. */
+ Used by \ref GSW_RMON_Meter_Get. */
typedef struct {
/** Meter Instance number (zero-based counting). The valid range is hardware
dependent. An error code is delivered if the selected meter is not
available. This parameter specifies for which Meter Id the RMON-1
counter is read. It has to be set by the application before
- calling \ref GSW_RMON_METER_GET. */
+ calling \ref GSW_RMON_Meter_Get. */
u8 nMeterId;
/** Metered Green colored packets or bytes (depending upon mode) count. */
u32 nGreenCount;
@@ -311,189 +305,178 @@
u32 nResCount;
} GSW_RMON_Meter_cnt_t;
-/** \brief RMON Counters Data Structure for clearance of values.
- Used by \ref GSW_RMON_CLEAR. */
-typedef struct {
- /** RMON Counters Type */
- GSW_RMON_type_t eRmonType;
- /** RMON Counters Identifier - Meter, Port, If, Route, etc. */
- u8 nRmonId;
-} GSW_RMON_clear_t;
-
-/**
- \brief Hardware platform TFLOW counter mode.
- Supported modes include, Global (default), Logical, CTP, Bridge port mode.
- The number of counters that can be assigned varies based these mode type.
- Used by \ref GSW_TFLOW_COUNT_MODE_SET and GSW_TFLOW_COUNT_MODE_GET. */
-typedef struct {
- //Counter type. PCE Rx/Tx/Bp-Tx.
- GSW_TflowCountConfType_t eCountType;
- //Counter mode. Global/Logical/CTP/BrP.
- GSW_TflowCmodeType_t eCountMode;
- //The below params are valid only for CTP/BrP types.
- //A group of ports matching MS (9-n) bits. n is nCtpLsb or nBrpLsb.
- u16 nPortMsb;
- //Number of valid bits in CTP port counter mode.
- GSW_TflowCtpValBits_t nCtpLsb;
- //Number of valid bits in bridge port counter mode.
- GSW_TflowBrpValBits_t nBrpLsb;
-} GSW_TflowCmodeConf_t;
-
-
-/**
- \brief Hardware platform extended RMON Counters. GSWIP-3.1 only.
- This structure contains additional RMON counters. These counters can be
- used by the packet classification engine and can be freely assigned to
- dedicated packet rules and flows.
- Used by \ref GSW_RMON_FLOW_GET. */
-typedef struct {
- /** If TRUE, use \ref GSW_RMON_flowGet_t::nIndex to access the Flow Counter,
- otherwise, use \ref GSW_TFLOW_COUNT_MODE_GET to determine mode and use
- \ref GSW_RMON_flowGet_t::nPortId and \ref GSW_RMON_flowGet_t::nFlowId
- to calculate index of the Flow Counter. */
- gsw_bool_t bIndex;
- /** Absolute index of Flow Counter. */
- u16 nIndex;
- /** Port ID. This could be Logical Port, CTP or Bridge Port. It depends
- on the mode set by \ref GSW_TFLOW_COUNT_MODE_SET. */
- u16 nPortId;
- /** \ref GSW_PCE_action_t::nFlowID. The range depends on the mode set
- by \ref GSW_TFLOW_COUNT_MODE_SET. */
- u16 nFlowId;
-
- /** Rx Packet Counter */
- u32 nRxPkts;
- /** Tx Packet Counter (non-PCE-Bypass) */
- u32 nTxPkts;
- /** Tx Packet Counter (PCE-Bypass) */
- u32 nTxPceBypassPkts;
-} GSW_RMON_flowGet_t;
-
/** \brief For debugging Purpose only.
Used for GSWIP 3.1. */
-
typedef struct {
/** Ethernet Port number (zero-based counting). The valid range is hardware
dependent. An error code is delivered if the selected port is not
available. This parameter specifies for which MAC port the RMON
counter is read. It has to be set by the application before
- calling \ref GSW_RMON_PORT_GET. */
- u16 nPortId;
+ calling \ref GSW_RMON_Port_Get. */
+ u16 nPortId;
/**Table address selection based on port type
- Applicable only for GSWIP 3.1
\ref GSW_RMON_portType_t**/
GSW_RMON_portType_t ePortType;
- /*Applicable only for GSWIP 3.1*/
- u32 nRxExtendedVlanDiscardPkts;
- /*Applicable only for GSWIP 3.1*/
- u32 nMtuExceedDiscardPkts;
- /*Applicable only for GSWIP 3.1*/
+ /** Extended VLAN Discard Packet Count.*/
+ u32 nRxExtendedVlanDiscardPkts;
+ /** Oversize Discard Packet Count. */
+ u32 nMtuExceedDiscardPkts;
+ /** Underisze Good Packet Count. */
u32 nTxUnderSizeGoodPkts;
- /*Applicable only for GSWIP 3.1*/
+ /** Oversize Good Packet Count */
u32 nTxOversizeGoodPkts;
/** Receive Packet Count (only packets that are accepted and not discarded). */
- u32 nRxGoodPkts;
+ u32 nRxGoodPkts;
/** Receive Unicast Packet Count. */
- u32 nRxUnicastPkts;
+ u32 nRxUnicastPkts;
/** Receive Broadcast Packet Count. */
- u32 nRxBroadcastPkts;
+ u32 nRxBroadcastPkts;
/** Receive Multicast Packet Count. */
- u32 nRxMulticastPkts;
+ u32 nRxMulticastPkts;
/** Receive FCS Error Packet Count. */
- u32 nRxFCSErrorPkts;
+ u32 nRxFCSErrorPkts;
/** Receive Undersize Good Packet Count. */
- u32 nRxUnderSizeGoodPkts;
+ u32 nRxUnderSizeGoodPkts;
/** Receive Oversize Good Packet Count. */
- u32 nRxOversizeGoodPkts;
+ u32 nRxOversizeGoodPkts;
/** Receive Undersize Error Packet Count. */
- u32 nRxUnderSizeErrorPkts;
+ u32 nRxUnderSizeErrorPkts;
/** Receive Good Pause Packet Count. */
- u32 nRxGoodPausePkts;
+ u32 nRxGoodPausePkts;
/** Receive Oversize Error Packet Count. */
- u32 nRxOversizeErrorPkts;
+ u32 nRxOversizeErrorPkts;
/** Receive Align Error Packet Count. */
- u32 nRxAlignErrorPkts;
- /** Filtered Packet Count. */
- u32 nRxFilteredPkts;
+ u32 nRxAlignErrorPkts;
+ /** Filtered Packet Count (destination portmap is 0). */
+ u32 nRxFilteredPkts;
/** Receive Size 64 Bytes Packet Count. */
- u32 nRx64BytePkts;
+ u32 nRx64BytePkts;
/** Receive Size 65-127 Bytes Packet Count. */
- u32 nRx127BytePkts;
+ u32 nRx127BytePkts;
/** Receive Size 128-255 Bytes Packet Count. */
- u32 nRx255BytePkts;
+ u32 nRx255BytePkts;
/** Receive Size 256-511 Bytes Packet Count. */
- u32 nRx511BytePkts;
+ u32 nRx511BytePkts;
/** Receive Size 512-1023 Bytes Packet Count. */
- u32 nRx1023BytePkts;
+ u32 nRx1023BytePkts;
/** Receive Size 1024-1522 Bytes (or more, if configured) Packet Count. */
- u32 nRxMaxBytePkts;
+ u32 nRxMaxBytePkts;
/** Overall Transmit Good Packets Count. */
- u32 nTxGoodPkts;
+ u32 nTxGoodPkts;
/** Transmit Unicast Packet Count. */
- u32 nTxUnicastPkts;
+ u32 nTxUnicastPkts;
/** Transmit Broadcast Packet Count. */
- u32 nTxBroadcastPkts;
+ u32 nTxBroadcastPkts;
/** Transmit Multicast Packet Count. */
- u32 nTxMulticastPkts;
+ u32 nTxMulticastPkts;
/** Transmit Single Collision Count. */
- u32 nTxSingleCollCount;
+ u32 nTxSingleCollCount;
/** Transmit Multiple Collision Count. */
- u32 nTxMultCollCount;
+ u32 nTxMultCollCount;
/** Transmit Late Collision Count. */
- u32 nTxLateCollCount;
+ u32 nTxLateCollCount;
/** Transmit Excessive Collision Count. */
- u32 nTxExcessCollCount;
+ u32 nTxExcessCollCount;
/** Transmit Collision Count. */
- u32 nTxCollCount;
+ u32 nTxCollCount;
/** Transmit Pause Packet Count. */
- u32 nTxPauseCount;
+ u32 nTxPauseCount;
/** Transmit Size 64 Bytes Packet Count. */
- u32 nTx64BytePkts;
+ u32 nTx64BytePkts;
/** Transmit Size 65-127 Bytes Packet Count. */
- u32 nTx127BytePkts;
+ u32 nTx127BytePkts;
/** Transmit Size 128-255 Bytes Packet Count. */
- u32 nTx255BytePkts;
+ u32 nTx255BytePkts;
/** Transmit Size 256-511 Bytes Packet Count. */
- u32 nTx511BytePkts;
+ u32 nTx511BytePkts;
/** Transmit Size 512-1023 Bytes Packet Count. */
- u32 nTx1023BytePkts;
+ u32 nTx1023BytePkts;
/** Transmit Size 1024-1522 Bytes (or more, if configured) Packet Count. */
- u32 nTxMaxBytePkts;
+ u32 nTxMaxBytePkts;
/** Transmit Drop Packet Count. */
- u32 nTxDroppedPkts;
+ u32 nTxDroppedPkts;
/** Transmit Dropped Packet Count, based on Congestion Management. */
- u32 nTxAcmDroppedPkts;
+ u32 nTxAcmDroppedPkts;
/** Receive Dropped Packet Count. */
- u32 nRxDroppedPkts;
+ u32 nRxDroppedPkts;
/** Receive Good Byte Count (64 bit). */
- u64 nRxGoodBytes;
+ u64 nRxGoodBytes;
/** Receive Bad Byte Count (64 bit). */
- u64 nRxBadBytes;
+ u64 nRxBadBytes;
/** Transmit Good Byte Count (64 bit). */
- u64 nTxGoodBytes;
- /**For GSWIP V32 only **/
+ u64 nTxGoodBytes;
/** Receive Unicast Packet Count for Yellow & Red packet. */
- u32 nRxUnicastPktsYellowRed;
+ u32 nRxUnicastPktsYellowRed;
/** Receive Broadcast Packet Count for Yellow & Red packet. */
- u32 nRxBroadcastPktsYellowRed;
+ u32 nRxBroadcastPktsYellowRed;
/** Receive Multicast Packet Count for Yellow & Red packet. */
- u32 nRxMulticastPktsYellowRed;
+ u32 nRxMulticastPktsYellowRed;
/** Receive Good Byte Count (64 bit) for Yellow & Red packet. */
u64 nRxGoodBytesYellowRed;
/** Receive Packet Count for Yellow & Red packet. */
u32 nRxGoodPktsYellowRed;
/** Transmit Unicast Packet Count for Yellow & Red packet. */
- u32 nTxUnicastPktsYellowRed;
+ u32 nTxUnicastPktsYellowRed;
/** Transmit Broadcast Packet Count for Yellow & Red packet. */
- u32 nTxBroadcastPktsYellowRed;
+ u32 nTxBroadcastPktsYellowRed;
/** Transmit Multicast Packet Count for Yellow & Red packet. */
- u32 nTxMulticastPktsYellowRed;
+ u32 nTxMulticastPktsYellowRed;
/** Transmit Good Byte Count (64 bit) for Yellow & Red packet. */
u64 nTxGoodBytesYellowRed;
/** Transmit Packet Count for Yellow & Red packet. */
u32 nTxGoodPktsYellowRed;
} GSW_Debug_RMON_Port_cnt_t;
+/**
+ \brief Hardware platform TFLOW counter mode.
+ Supported modes include, Global (default), Logical, CTP, Bridge port mode.
+ The number of counters that can be assigned varies based these mode type.
+ Used by \ref GSW_TflowCountModeSet and GSW_TflowCountModeGet. */
+typedef struct {
+ /** Counter type. PCE Rx/Tx/Bp-Tx. */
+ GSW_TflowCountConfType_t eCountType;
+ /** Counter mode. Global/Logical/CTP/BrP. */
+ GSW_TflowCmodeType_t eCountMode;
+ /** The below params are valid only for CTP/BrP types.
+ A group of ports matching MS (9-n) bits. n is nCtpLsb or nBrpLsb. */
+ u16 nPortMsb;
+ /** Number of valid bits in CTP port counter mode. */
+ GSW_TflowCtpValBits_t nCtpLsb;
+ /** Number of valid bits in bridge port counter mode. */
+ GSW_TflowBrpValBits_t nBrpLsb;
+} GSW_TflowCmodeConf_t;
+
+/**
+ \brief Hardware platform extended RMON Counters. GSWIP-3.1 only.
+ This structure contains additional RMON counters. These counters can be
+ used by the packet classification engine and can be freely assigned to
+ dedicated packet rules and flows.
+ Used by \ref GSW_RMON_FlowGet. */
+typedef struct {
+ /** If TRUE, use \ref GSW_RMON_flowGet_t::nIndex to access the Flow Counter,
+ otherwise, use \ref GSW_TflowCountModeGet to determine mode and use
+ \ref GSW_RMON_flowGet_t::nPortId and \ref GSW_RMON_flowGet_t::nFlowId
+ to calculate index of the Flow Counter. */
+ gsw_bool_t bIndex;
+ /** Absolute index of Flow Counter. */
+ u16 nIndex;
+ /** Port ID. This could be Logical Port, CTP or Bridge Port. It depends
+ on the mode set by \ref GSW_TflowCountModeSet. */
+ u16 nPortId;
+ /** \ref GSW_PCE_action_t::nFlowID. The range depends on the mode set
+ by \ref GSW_TflowCountModeSet. */
+ u16 nFlowId;
+
+ /** Rx Packet Counter */
+ u32 nRxPkts;
+ /** Tx Packet Counter (non-PCE-Bypass) */
+ u32 nTxPkts;
+ /** Tx Packet Counter (PCE-Bypass) */
+ u32 nTxPceBypassPkts;
+} GSW_RMON_flowGet_t;
+
+/** @}*/ /* GSW_RMON */
+
#pragma scalar_storage_order default
#pragma pack(pop)
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_ss.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_ss.h
new file mode 100644
index 0000000..3c4b55a
--- /dev/null
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_ss.h
@@ -0,0 +1,62 @@
+/******************************************************************************
+
+ Copyright 2023 MaxLinear, Inc.
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+
+******************************************************************************/
+
+#ifndef _GSW_SS_H_
+#define _GSW_SS_H_
+
+#pragma pack(push, 1)
+#pragma scalar_storage_order little-endian
+
+struct gsw_ss_sptag {
+ /* port ID (1~16) */
+ uint8_t pid;
+ /* bit value 1 to indicate valid field
+ * bit 0 - rx
+ * 1 - tx
+ * 2 - rx_pen
+ * 3 - tx_pen
+ */
+ uint8_t mask;
+ /* RX special tag mode
+ * value 0 - packet does NOT have special tag and special tag is
+ * NOT inserted
+ * 1 - packet does NOT have special tag and special tag is
+ * inserted
+ * 2 - packet has special tag and special tag is NOT inserted
+ */
+ uint8_t rx;
+ /* TX special tag mode
+ * value 0 - packet does NOT have special tag and special tag is
+ * NOT removed
+ * 1 - packet has special tag and special tag is replaced
+ * 2 - packet has special tag and special tag is NOT removed
+ * 3 - packet has special tag and special tag is removed
+ */
+ uint8_t tx;
+ /* RX special tag info over preamble
+ * value 0 - special tag info inserted from byte 2 to 7 are all 0
+ * 1 - special tag byte 5 is 16, other bytes from 2 to 7 are 0
+ * 2 - special tag byte 5 is from preamble field, others are 0
+ * 3 - special tag byte 2 to 7 are from preabmle field
+ */
+ uint8_t rx_pen;
+ /* TX special tag info over preamble
+ * value 0 - disabled
+ * 1 - enabled
+ */
+ uint8_t tx_pen;
+};
+
+#pragma scalar_storage_order default
+#pragma pack(pop)
+
+int gsw_ss_sptag_get(const GSW_Device_t *dummy, struct gsw_ss_sptag *pdata);
+int gsw_ss_sptag_set(const GSW_Device_t *dummy, struct gsw_ss_sptag *pdata);
+
+#endif /* _GSW_SS_H_ */
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_tbl_rw.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_tbl_rw.h
index eea10a6..c32374b 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_tbl_rw.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_tbl_rw.h
@@ -15,7 +15,7 @@
#pragma pack(push, 1)
#pragma scalar_storage_order little-endian
-/* GSWIP PCE Table Programming structure */
+/** \brief GSWIP PCE Table Programming structure */
typedef struct {
u16 key[34];
u16 mask[4];
@@ -30,7 +30,7 @@
u16 group: 4;
} pctbl_prog_t;
-/* GSWIP Table structure to access all tables */
+/** \brief GSWIP Table structure to access all tables */
typedef struct {
u32 tbl_entry;
/** Start offset mem dump purpose */
@@ -42,7 +42,7 @@
//pmtbl_prog_t pmactable;
} GSW_table_t;
-/* GSWIP BM Table ID to access different tables */
+/** \brief GSWIP BM Table ID to access different tables */
typedef enum {
CTP_PORT_RX_RMON = 0x00,
CTP_PORT_TX_RMON = 0x01,
@@ -63,7 +63,7 @@
PMAC_RMON_COUNTER = 0x1C,
} BM_Table_ID;
-/* GSWIP BM Table Address */
+/** \brief GSWIP BM Table Address */
typedef union {
u16 raw;
struct {
@@ -102,7 +102,7 @@
} pmacRmon;
} BM_Table_Address;
-/* GSWIP BM Table programming structure */
+/** \brief GSWIP BM Table programming structure */
typedef struct {
BM_Table_ID tableID;
BM_Table_Address adr;
@@ -111,7 +111,7 @@
u8 numValues;
} bmtbl_prog_t;
-/* GSWIP PMAC Table programming structure */
+/** \brief GSWIP PMAC Table programming structure */
typedef struct {
u16 val[8];
u16 ptaddr;
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_types.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_types.h
index a8b4de1..5aec9c2 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_types.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/gsw_types.h
@@ -9,6 +9,7 @@
#ifndef _GSW_TYPES_H_
#define _GSW_TYPES_H_
+/** \file gsw_types.h GSW Base Types */
#include <stdint.h>
@@ -48,7 +49,7 @@
/** \brief This is the boolean datatype. */
typedef uint8_t gsw_bool_t;
-/** \brief This is a union to describe the IPv4 and IPv6 Address in numeric representation. Used by multiple Structures and APIs. The member selection would be based upon \ref GSW_IP_Select_t */
+/** \brief This is a union to describe the IPv4 and IPv6 Address in numeric representation. Used by multiple Structures and APIs. */
typedef union {
/** Describe the IPv4 address.
Only used if the IPv4 address should be read or configured.
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/loop_detect_cfg.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/loop_detect_cfg.h
new file mode 100644
index 0000000..7c2ce0b
--- /dev/null
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/loop_detect_cfg.h
@@ -0,0 +1,84 @@
+/******************************************************************************
+
+ Copyright 2023-2024 MaxLinear, Inc.
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+
+******************************************************************************/
+
+#ifndef _LOOP_DETECT_CFG_H_
+#define _LOOP_DETECT_CFG_H_
+
+#pragma pack(push, 1)
+#pragma scalar_storage_order little-endian
+
+struct loop_detect_passive_cfg {
+ /* port is in loop state if MAC violation counter between interval
+ * is equal to or larger than this threshold
+ * range 1~255
+ * 0 to maintain current value
+ */
+ uint8_t threshold;
+ /* polling interval in 100 milliseconds
+ * range 1~100 (0.1s ~ 10s)
+ * 0 to maintain current value
+ */
+ uint8_t interval;
+};
+
+struct loop_detect_active_cfg {
+ /* port is not in loop state if test packet is not received within
+ * this number of transmission cycles
+ * range 1~100
+ * 0 to maintain current value
+ */
+ uint8_t refresh;
+ /* interval in 100 milliseconds to send test packet
+ * range 1~100 (0.1s ~ 10s)
+ * 0 to maintain current value
+ */
+ uint8_t interval;
+};
+
+struct loop_prevention_cfg {
+ uint8_t res;
+};
+
+#pragma scalar_storage_order default
+#pragma pack(pop)
+
+/* start passive loop detection
+ * default setting is applied if pcfg is NULL
+ * this should be called in thread context only
+ */
+int loop_detect_passive_start(const GSW_Device_t *dummy,
+ struct loop_detect_passive_cfg *pcfg);
+/* stop passive loop detection
+ * this should be called in thread context only
+ */
+int loop_detect_passive_stop(const GSW_Device_t *dummy);
+
+/* start active loop detection
+ * default setting is applied if pcfg is NULL
+ * this should be called in thread context only
+ */
+int loop_detect_active_start(const GSW_Device_t *dummy,
+ struct loop_detect_active_cfg *pcfg);
+/* stop active loop detection
+ * this should be called in thread context only
+ */
+int loop_detect_active_stop(const GSW_Device_t *dummy);
+
+/* start loop prevention
+ * default setting is applied if pcfg is NULL
+ * this should be called in thread context only
+ */
+int loop_prevention_start(const GSW_Device_t *dummy,
+ struct loop_prevention_cfg *pcfg);
+/* stop loop prevention
+ * this should be called in thread context only
+ */
+int loop_prevention_stop(const GSW_Device_t *dummy);
+
+#endif /* _LOOP_DETECT_CFG_H_ */
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/mmd_apis.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/mmd_apis.h
index 592938c..a7a486e 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/mmd_apis.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/mmd_apis.h
@@ -11,10 +11,13 @@
#define _MXL_MMD_APIS_H_
#include "gsw_api.h"
+#include "gsw_ss.h"
#include "mdio_relay.h"
+#include "sys_led.h"
#include "sys_misc.h"
+#include "loop_detect_cfg.h"
-#define GSW_MMD_SMDIO_DEV 0
+#define GSW_MMD_SMDIO_DEV 0
#define GSW_MMD_DEV 30
#define GSW_MMD_REG_CTRL 0
#define GSW_MMD_REG_LEN_RET 1
@@ -27,6 +30,7 @@
uint16_t data[GSW_MMD_REG_DATA_MAX_SIZE * 3]; //Maximum data size is GSW_PCE_rule_t (508)
GSW_register_t GSW_register_t_data;
GSW_register_mod_t GSW_register_mod_t_data;
+ GSW_CPU_Port_t GSW_CPU_Port_t_data;
GSW_CPU_PortCfg_t GSW_CPU_PortCfg_t_data;
GSW_portLinkCfg_t GSW_portLinkCfg_t_data;
GSW_portCfg_t GSW_portCfg_t_data;
@@ -34,10 +38,15 @@
GSW_monitorPortCfg_t GSW_monitorPortCfg_t_data;
GSW_PCE_rule_t GSW_PCE_rule_t_data;
GSW_PCE_ruleEntry_t GSW_PCE_ruleEntry_t_data;
+ GSW_PCE_rule_alloc_t GSW_PCE_rule_alloc_t_data;
+ GSW_PCE_rule_move_t GSW_PCE_rule_move_t_data;
GSW_BRIDGE_config_t GSW_BRIDGE_config_t_data;
GSW_BRIDGE_alloc_t GSW_BRIDGE_alloc_t_data;
GSW_BRIDGE_portAlloc_t GSW_BRIDGE_portAlloc_t_data;
GSW_BRIDGE_portConfig_t GSW_BRIDGE_portConfig_t_data;
+ GSW_BRIDGE_portLoopRead_t GSW_BRIDGE_portLoopRead_t_data;
+ GSW_HitStatusRead_t GSW_HitStatusRead_t_data;
+ GSW_MiscPortCfg_t GSW_MiscPortCfg_t_data;
GSW_CTP_portAssignment_t GSW_CTP_portAssignment_t_data;
GSW_CTP_portConfig_t GSW_CTP_portConfig_t_data;
GSW_QoS_DSCP_ClassCfg_t GSW_QoS_DSCP_ClassCfg_t_data;
@@ -83,7 +92,7 @@
GSW_MAC_tableQuery_t GSW_MAC_tableQuery_t_data;
GSW_MAC_tableRemove_t GSW_MAC_tableRemove_t_data;
GSW_MACFILTER_default_t GSW_MACFILTER_default_t_data;
-// #ifdef CONFIG_GSWIP_EVLAN
+ GSW_MAC_tableLoopDetect_t GSW_MAC_tableLoopDetect_t_data;
GSW_EXTENDEDVLAN_config_t GSW_EXTENDEDVLAN_config_t_data;
GSW_EXTENDEDVLAN_alloc_t GSW_EXTENDEDVLAN_alloc_t_data;
GSW_VLANFILTER_config_t GSW_VLANFILTER_config_t_data;
@@ -91,7 +100,6 @@
GSW_VLAN_RMON_control_t GSW_VLAN_RMON_control_t_data;
GSW_VLAN_RMON_cnt_t GSW_VLAN_RMON_cnt_t_data;
GSW_VlanCounterMapping_config_t GSW_VlanCounterMapping_config_t_data;
-// #endif
GSW_multicastRouterRead_t GSW_multicastRouterRead_t_data;
GSW_multicastRouter_t GSW_multicastRouter_t_data;
GSW_multicastSnoopCfg_t GSW_multicastSnoopCfg_t_data;
@@ -102,32 +110,46 @@
GSW_STP_BPDU_Rule_t GSW_STP_BPDU_Rule_t_data;
GSW_PBB_Tunnel_Template_Config_t GSW_PBB_Tunnel_Template_Config_t_data;
+ struct gsw_ss_sptag gsw_ss_sptag_data;
+
struct mdio_relay_data mdio_relay_data;
struct mdio_relay_mod_data mdio_relay_mod_data;
struct sys_fw_image_version img_ver_data;
-// #ifdef CONFIG_SENSOR_MXL
struct sys_sensor_value pvt_sensor_data;
-// #endif
+ struct sys_delay delay_data;
+ struct sys_gpio_config gpio_config_data;
+ struct sys_reg_rw reg_rw_data;
+ struct sys_reg_mod reg_mod_data;
+ struct sys_cml_clk cml_clk_data;
+ struct sys_sfp_cfg sfp_cfg_data;
+ struct loop_detect_passive_cfg loop_detect_passive_cfg_data;
+ struct loop_detect_active_cfg loop_detect_active_cfg_data;
+ struct loop_prevention_cfg loop_prevention_cfg_data;
+ struct mxl_led_sys_cfg mxl_led_sys_cfg_data;
} mmd_api_data_t;
-#define GSW_COMMON_MAGIC 0x100
-#define GSW_TFLOW_MAGIC 0x200
-#define GSW_BRDG_MAGIC 0x300
-#define GSW_BRDGPORT_MAGIC 0x400
-#define GSW_CTP_MAGIC 0x500
-#define GSW_QOS_MAGIC 0x600
-#define GSW_RMON_MAGIC 0x700
-#define GSW_DEBUG_MAGIC 0x800
-#define GSW_PMAC_MAGIC 0x900
-#define GSW_SWMAC_MAGIC 0xA00
-#define GSW_EXTVLAN_MAGIC 0xB00
-#define GSW_VLANFILTER_MAGIC 0xC00
-#define GSW_MULTICAST_MAGIC 0xD00
-#define GSW_TRUNKING_MAGIC 0xE00
-#define GSW_STP_MAGIC 0xF00
+#define GSW_COMMON_MAGIC 0x0100
+#define GSW_TFLOW_MAGIC 0x0200
+#define GSW_BRDG_MAGIC 0x0300
+#define GSW_BRDGPORT_MAGIC 0x0400
+#define GSW_CTP_MAGIC 0x0500
+#define GSW_QOS_MAGIC 0x0600
+#define GSW_RMON_MAGIC 0x0700
+#define GSW_DEBUG_MAGIC 0x0800
+#define GSW_PMAC_MAGIC 0x0900
+#define GSW_SWMAC_MAGIC 0x0A00
+#define GSW_EXTVLAN_MAGIC 0x0B00
+#define GSW_VLANFILTER_MAGIC 0x0C00
+#define GSW_MULTICAST_MAGIC 0x0D00
+#define GSW_TRUNKING_MAGIC 0x0E00
+#define GSW_STP_MAGIC 0x0F00
#define GSW_PBB_MAGIC 0x1000
#define GSW_VLAN_RMON_MAGIC 0x1100
+#define GSW_SS_MAGIC 0x1600
+
+#define GSW_MAC_MAGIC 0x1700
+
#define GPY_GPY2XX_MAGIC 0x1800
#define SYS_MISC_MAGIC 0x1900
@@ -158,6 +180,11 @@
#define GSW_COMMON_FREEZE (GSW_COMMON_MAGIC + 0xF)
#define GSW_COMMON_UNFREEZE (GSW_COMMON_MAGIC + 0x10)
#define GSW_COMMON_REGISTERMOD (GSW_COMMON_MAGIC + 0x11)
+#define GSW_COMMON_GETHITSTS (GSW_COMMON_MAGIC + 0x12)
+#define GSW_COMMON_MISCPORTCFGGET (GSW_COMMON_MAGIC + 0x13)
+#define GSW_COMMON_MISCPORTCFGSET (GSW_COMMON_MAGIC + 0x14)
+#define GSW_COMMON_CPU_PORTGET (GSW_COMMON_MAGIC + 0x15)
+#define GSW_COMMON_CPU_PORTSET (GSW_COMMON_MAGIC + 0x16)
#define GSW_TFLOW_PCERULEREAD (GSW_TFLOW_MAGIC + 0x1)
#define GSW_TFLOW_PCERULEWRITE (GSW_TFLOW_MAGIC + 0x2)
@@ -166,6 +193,8 @@
#define GSW_TFLOW_PCERULEFREE (GSW_TFLOW_MAGIC + 0x5)
#define GSW_TFLOW_PCERULEENABLE (GSW_TFLOW_MAGIC + 0x6)
#define GSW_TFLOW_PCERULEDISABLE (GSW_TFLOW_MAGIC + 0x7)
+#define GSW_TFLOW_PCERULEBLOCKSIZE (GSW_TFLOW_MAGIC + 0x8)
+#define GSW_TFLOW_PCERULEMOVE (GSW_TFLOW_MAGIC + 0x9)
#define GSW_BRIDGE_ALLOC (GSW_BRDG_MAGIC + 0x1)
#define GSW_BRIDGE_CONFIGSET (GSW_BRDG_MAGIC + 0x2)
@@ -176,6 +205,7 @@
#define GSW_BRIDGEPORT_CONFIGSET (GSW_BRDGPORT_MAGIC + 0x2)
#define GSW_BRIDGEPORT_CONFIGGET (GSW_BRDGPORT_MAGIC + 0x3)
#define GSW_BRIDGEPORT_FREE (GSW_BRDGPORT_MAGIC + 0x4)
+#define GSW_BRIDGEPORT_LOOPREAD (GSW_BRDGPORT_MAGIC + 0x5)
#define GSW_CTP_PORTASSIGNMENTALLOC (GSW_CTP_MAGIC + 0x1)
#define GSW_CTP_PORTASSIGNMENTFREE (GSW_CTP_MAGIC + 0x2)
@@ -232,6 +262,8 @@
#define GSW_QOS_PMAPPERTABLEGET (GSW_QOS_MAGIC + 0x2F)
#define GSW_QOS_SVLAN_PCP_CLASSGET (GSW_QOS_MAGIC + 0x30)
#define GSW_QOS_SVLAN_PCP_CLASSSET (GSW_QOS_MAGIC + 0x31)
+#define GSW_QOS_QUEUECFGGET (GSW_QOS_MAGIC + 0x32)
+#define GSW_QOS_QUEUECFGSET (GSW_QOS_MAGIC + 0x33)
#define GSW_RMON_PORT_GET (GSW_RMON_MAGIC + 0x1)
#define GSW_RMON_MODE_SET (GSW_RMON_MAGIC + 0x2)
@@ -262,6 +294,7 @@
#define GSW_MAC_DEFAULTFILTERSET (GSW_SWMAC_MAGIC + 0x6)
#define GSW_MAC_DEFAULTFILTERGET (GSW_SWMAC_MAGIC + 0x7)
#define GSW_MAC_TABLECLEARCOND (GSW_SWMAC_MAGIC + 0x8)
+#define GSW_MAC_TABLE_LOOP_DETECT (GSW_SWMAC_MAGIC + 0x9)
#define GSW_EXTENDEDVLAN_ALLOC (GSW_EXTVLAN_MAGIC + 0x1)
#define GSW_EXTENDEDVLAN_SET (GSW_EXTVLAN_MAGIC + 0x2)
@@ -304,6 +337,9 @@
#define GSW_PBB_TEMPLATESET (GSW_PBB_MAGIC + 0x3)
#define GSW_PBB_TEMPLATEGET (GSW_PBB_MAGIC + 0x4)
+#define GSW_SS_SPTAG_GET (GSW_SS_MAGIC + 0x01)
+#define GSW_SS_SPTAG_SET (GSW_SS_MAGIC + 0x02)
+
#define INT_GPHY_READ (GPY_GPY2XX_MAGIC + 0x01)
#define INT_GPHY_WRITE (GPY_GPY2XX_MAGIC + 0x02)
#define INT_GPHY_MOD (GPY_GPY2XX_MAGIC + 0x03)
@@ -314,11 +350,24 @@
#define SYS_MISC_FW_UPDATE (SYS_MISC_MAGIC + 0x01)
#define SYS_MISC_FW_VERSION (SYS_MISC_MAGIC + 0x02)
#define SYS_MISC_PVT_TEMP (SYS_MISC_MAGIC + 0x03)
-#define SYS_MISC_PVT_VOLTAGE (SYS_MISC_MAGIC + 0x04)
+#define SYS_MISC_PVT_VOLTAGE (SYS_MISC_MAGIC + 0x04)
#define SYS_MISC_DELAY (SYS_MISC_MAGIC + 0x05)
-#define SYS_MISC_GPIO_CONFIGURE (SYS_MISC_MAGIC + 0x06)
+#define SYS_MISC_GPIO_CONFIGURE (SYS_MISC_MAGIC + 0x06)
#define SYS_MISC_REBOOT (SYS_MISC_MAGIC + 0x07)
#define SYS_MISC_REG_RD (SYS_MISC_MAGIC + 0x08)
+#define SYS_MISC_REG_WR (SYS_MISC_MAGIC + 0x09)
+#define SYS_MISC_REG_MOD (SYS_MISC_MAGIC + 0x0A)
+#define SYS_MISC_CML_CLK_GET (SYS_MISC_MAGIC + 0x0B)
+#define SYS_MISC_CML_CLK_SET (SYS_MISC_MAGIC + 0x0C)
+#define SYS_MISC_SFP_GET (SYS_MISC_MAGIC + 0x0D)
+#define SYS_MISC_SFP_SET (SYS_MISC_MAGIC + 0x0E)
+#define SYS_MISC_LOOP_PASSIVE_START (SYS_MISC_MAGIC + 0x13)
+#define SYS_MISC_LOOP_PASSIVE_STOP (SYS_MISC_MAGIC + 0x14)
+#define SYS_MISC_LOOP_ACTIVE_START (SYS_MISC_MAGIC + 0x15)
+#define SYS_MISC_LOOP_ACTIVE_STOP (SYS_MISC_MAGIC + 0x16)
+#define SYS_MISC_LOOP_PREVENTION_START (SYS_MISC_MAGIC + 0x17)
+#define SYS_MISC_LOOP_PREVENTION_STOP (SYS_MISC_MAGIC + 0x18)
+#define SYS_MISC_SYS_LED_CFG (SYS_MISC_MAGIC + 0x19)
#define MMD_API_MAXIMUM_ID 0x7FFF
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/sys_led.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/sys_led.h
new file mode 100644
index 0000000..6ac4ee8
--- /dev/null
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/sys_led.h
@@ -0,0 +1,78 @@
+/******************************************************************************
+
+ Copyright 2023-2024 MaxLinear, Inc.
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+
+******************************************************************************/
+
+#ifndef _SYS_LED_H_
+#define _SYS_LED_H_
+
+#pragma pack(push, 1)
+#pragma scalar_storage_order little-endian
+
+struct mxl_led_sys_cfg {
+ /* 1 to enable System LED (config and drive GPIO pin to toggle LED)
+ * 0 to disable System LED (free GPIO pin with current state)
+ */
+ uint8_t enable: 1;
+
+ /* GPIO pin number used to drive System LED
+ * range 0~47
+ */
+ uint8_t gpio : 6;
+
+ /* GPIO pin is active low (output low to turn on LED) */
+ uint8_t active_low: 1;
+
+ /* LED On time during system start.
+ * Unit is 10 milliseconds.
+ * If it's value 0 and start_delay_off is non-zero,
+ * System LED is constant off.
+ */
+ uint8_t start_delay_on;
+
+ /* LED Off time during system start.
+ * Unit is 10 milliseconds.
+ * If it's value 0 and start_delay_on is non-zero,
+ * System LED is constant on.
+ */
+ uint8_t start_delay_off;
+
+ /* LED On time when system is stable up.
+ * Unit is 10 milliseconds.
+ * If it's value 0 and stable_delay_off is non-zero,
+ * System LED is constant off.
+ */
+ uint8_t stable_delay_on;
+
+ /* LED Off time when system is stable up.
+ * Unit is 10 milliseconds.
+ * If it's value 0 and stable_delay_on is non-zero,
+ * System LED is constant on.
+ */
+ uint8_t stable_delay_off;
+
+ /* LED On time when system is in error state (such as loop detected)
+ * Unit is 10 milliseconds.
+ * If it's value 0 and error_delay_off is non-zero,
+ * System LED is constant off.
+ */
+ uint8_t error_delay_on;
+
+ /* LED Off time when system is in error state (such as loop detected)
+ * Unit is 10 milliseconds.
+ * If it's value 0 and error_delay_on is non-zero,
+ * System LED is constant on.
+ */
+ uint8_t error_delay_off;
+};
+
+#pragma scalar_storage_order default
+#pragma pack(pop)
+
+int mxl_led_sys_cfg(const GSW_Device_t *dummy, struct mxl_led_sys_cfg *parm);
+
+#endif /* _SYS_LED_H_ */
diff --git a/feed/app/ethswbox/src/switch_hostapi/include/gswip/sys_misc.h b/feed/app/ethswbox/src/switch_hostapi/include/gswip/sys_misc.h
index 178bafc..e7d86b6 100644
--- a/feed/app/ethswbox/src/switch_hostapi/include/gswip/sys_misc.h
+++ b/feed/app/ethswbox/src/switch_hostapi/include/gswip/sys_misc.h
@@ -66,15 +66,99 @@
};
/**
- * @brief Register read data structure
+ * @brief Register read/write data structure
*/
-struct sys_reg_rd {
+struct sys_reg_rw {
/** 32-bit register address */
uint32_t addr;
/** register value */
uint32_t val;
};
+/**
+ * @brief Register read/write data structure
+ */
+struct sys_reg_mod {
+ /** 32-bit register address */
+ uint32_t addr;
+ /** register value to write */
+ uint32_t val;
+ /** register value mask, bit value 1 to write, 0 to ignore */
+ uint32_t mask;
+};
+
+enum {
+ SYS_CML_CLK_50MHZ = 0,
+ SYS_CML_CLK_156P25MHz = 1,
+ SYS_CML_CLK_XO = 2,
+ SYS_CML_CLK_SRC_MAX
+};
+
+/**
+ * @brief Enable/Disable/Config CML Clock Output
+ */
+struct sys_cml_clk {
+ /** select CML Clock Output (0 or 1) */
+ uint32_t clk: 1;
+ /** value 1 to enable or disable CML Clock Output */
+ uint32_t en_val: 1;
+ /** value 1 to enable CML Clock Output when en_val is 1 */
+ uint32_t en: 1;
+ /** value 1 to change clock source selection */
+ uint32_t src_val: 1;
+ /** select clock source when src_val is 1
+ * 0 - select LJPLL FOUT0 (50MHz)
+ * 1 - select LJPLL FOUT1 (156.25MHz)
+ * 2 - select XO (25MHz)
+ */
+ uint32_t src_sel: 2;
+};
+
+/**
+ * @brief Config SFP
+ */
+struct sys_sfp_cfg {
+ /** Port id (0 or 1) */
+ uint8_t port_id: 4;
+ /** config options
+ * 0 - SFP mode/speed/link-status
+ * 1 - flow control
+ */
+ uint8_t option: 4;
+ union {
+ struct {
+ /** select SFP mode
+ * 0 - auto
+ * 1 - fix
+ * 2 - disable
+ */
+ uint8_t mode;
+ /** select speed when mode is 1
+ * 0 - 10G Quad USXGMII
+ * 1 - 1000BaseX ANeg
+ * 2 - 10G XFI
+ * 3 - 10G Single USXGMII
+ * 4 - 2.5G SGMII
+ * 5 - 2500 Single USXGMI
+ * 6 - 2500BaseX NonANeg
+ * 7 - 1000BaseX NonANeg
+ * 8 - 1G SGMI
+ */
+ uint8_t speed;
+ /* link status
+ * 0 - link down
+ * 1 - link up
+ */
+ uint8_t link;
+ };
+ /* flow control
+ * 0 - disable
+ * 1 - enable
+ */
+ uint8_t fc_en;
+ };
+};
+
#pragma scalar_storage_order default
#pragma pack(pop)
@@ -85,5 +169,12 @@
int sys_misc_delay(const GSW_Device_t *dummy, struct sys_delay *pdelay);
int sys_misc_gpio_configure(const GSW_Device_t *dummy, struct sys_gpio_config *sys_gpio_conf);
int sys_misc_reboot(const GSW_Device_t *dummy);
-int sys_misc_reg_rd(const GSW_Device_t *dummy, struct sys_reg_rd *sys_reg);
-#endif
\ No newline at end of file
+int sys_misc_reg_rd(const GSW_Device_t *dummy, struct sys_reg_rw *sys_reg);
+int sys_misc_reg_wr(const GSW_Device_t *dummy, struct sys_reg_rw *sys_reg);
+int sys_misc_reg_mod(const GSW_Device_t *dummy, struct sys_reg_mod *sys_reg);
+int sys_misc_cml_clk_get(const GSW_Device_t *dummy, struct sys_cml_clk *clk);
+int sys_misc_cml_clk_set(const GSW_Device_t *dummy, struct sys_cml_clk *clk);
+int sys_misc_sfp_get(const GSW_Device_t *dummy, struct sys_sfp_cfg *cfg);
+int sys_misc_sfp_set(const GSW_Device_t *dummy, struct sys_sfp_cfg *cfg);
+
+#endif
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/gsw_api.c b/feed/app/ethswbox/src/switch_hostapi/src/gsw_api.c
index 4b29d28..98fe3fd 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/gsw_api.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/gsw_api.c
@@ -41,6 +41,26 @@
0);
}
+GSW_return_t GSW_CPU_PortGet(const GSW_Device_t *dev, GSW_CPU_Port_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_COMMON_CPU_PORTGET,
+ parm,
+ sizeof(*parm),
+ 0,
+ sizeof(*parm));
+}
+
+GSW_return_t GSW_CPU_PortSet(const GSW_Device_t *dev, GSW_CPU_Port_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_COMMON_CPU_PORTSET,
+ parm,
+ sizeof(*parm),
+ GSW_COMMON_CPU_PORTGET,
+ 0);
+}
+
GSW_return_t GSW_CPU_PortCfgGet(const GSW_Device_t *dev, GSW_CPU_PortCfg_t *parm)
{
return gsw_api_wrap(dev,
@@ -161,37 +181,38 @@
0);
}
-GSW_return_t GSW_PceRuleRead(const GSW_Device_t *dev, GSW_PCE_rule_t *parm)
+GSW_return_t GSW_GetHitSts(const GSW_Device_t *dev, GSW_HitStatusRead_t *parm)
{
return gsw_api_wrap(dev,
- GSW_TFLOW_PCERULEREAD,
+ GSW_COMMON_GETHITSTS,
parm,
sizeof(*parm),
0,
sizeof(*parm));
}
-GSW_return_t GSW_PceRuleWrite(const GSW_Device_t *dev, GSW_PCE_rule_t *parm)
+GSW_return_t GSW_GetMiscPortCfgGet(const GSW_Device_t *dev, GSW_MiscPortCfg_t *parm)
{
return gsw_api_wrap(dev,
- GSW_TFLOW_PCERULEWRITE,
+ GSW_COMMON_MISCPORTCFGGET,
parm,
sizeof(*parm),
0,
sizeof(*parm));
}
-GSW_return_t GSW_PceRuleDelete(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *parm)
+GSW_return_t GSW_GetMiscPortCfgSet(const GSW_Device_t *dev, GSW_MiscPortCfg_t *parm)
{
return gsw_api_wrap(dev,
- GSW_TFLOW_PCERULEDELETE,
+ GSW_COMMON_MISCPORTCFGSET,
parm,
sizeof(*parm),
- 0,
+ GSW_COMMON_MISCPORTCFGGET,
sizeof(*parm));
}
-GSW_return_t GSW_PceRuleAlloc(const GSW_Device_t *dev, GSW_PCE_rule_alloc_t *parm)
+GSW_return_t GSW_PceRuleAlloc(const GSW_Device_t *dev,
+ GSW_PCE_rule_alloc_t *parm)
{
return gsw_api_wrap(dev,
GSW_TFLOW_PCERULEALLOC,
@@ -201,7 +222,8 @@
sizeof(*parm));
}
-GSW_return_t GSW_PceRuleFree(const GSW_Device_t *dev, GSW_PCE_rule_alloc_t *parm)
+GSW_return_t GSW_PceRuleFree(const GSW_Device_t *dev,
+ GSW_PCE_rule_alloc_t *parm)
{
return gsw_api_wrap(dev,
GSW_TFLOW_PCERULEFREE,
@@ -211,26 +233,79 @@
sizeof(*parm));
}
-GSW_return_t GSW_PceRuleEnable(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *parm)
+GSW_return_t GSW_PceRuleBlockSize(const GSW_Device_t *dev,
+ GSW_PCE_rule_alloc_t *parm)
{
return gsw_api_wrap(dev,
- GSW_TFLOW_PCERULEENABLE,
+ GSW_TFLOW_PCERULEBLOCKSIZE,
parm,
sizeof(*parm),
0,
sizeof(*parm));
}
+GSW_return_t GSW_PceRuleEnable(const GSW_Device_t *dev,
+ GSW_PCE_ruleEntry_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_TFLOW_PCERULEENABLE,
+ parm,
+ sizeof(*parm),
+ 0,
+ 0);
+}
+
-GSW_return_t GSW_PceRuleDisable(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *parm)
+GSW_return_t GSW_PceRuleDisable(const GSW_Device_t *dev,
+ GSW_PCE_ruleEntry_t *parm)
{
return gsw_api_wrap(dev,
GSW_TFLOW_PCERULEDISABLE,
parm,
sizeof(*parm),
0,
+ 0);
+}
+
+GSW_return_t GSW_PceRuleRead(const GSW_Device_t *dev, GSW_PCE_rule_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_TFLOW_PCERULEREAD,
+ parm,
+ sizeof(*parm),
+ 0,
+ sizeof(*parm));
+}
+
+GSW_return_t GSW_PceRuleWrite(const GSW_Device_t *dev, GSW_PCE_rule_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_TFLOW_PCERULEWRITE,
+ parm,
+ sizeof(*parm),
+ 0,
sizeof(*parm));
}
+GSW_return_t GSW_PceRuleDelete(const GSW_Device_t *dev, GSW_PCE_ruleEntry_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_TFLOW_PCERULEDELETE,
+ parm,
+ sizeof(*parm),
+ 0,
+ sizeof(*parm));
+}
+
+GSW_return_t GSW_PceRuleMove(const GSW_Device_t *dev, GSW_PCE_rule_move_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_TFLOW_PCERULEMOVE,
+ parm,
+ sizeof(*parm),
+ 0,
+ 0);
+}
+
GSW_return_t GSW_BridgeAlloc(const GSW_Device_t *dev, GSW_BRIDGE_alloc_t *parm)
{
return gsw_api_wrap(dev,
@@ -311,6 +386,16 @@
0);
}
+GSW_return_t GSW_BridgePortLoopRead(const GSW_Device_t *dev, GSW_BRIDGE_portLoopRead_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_BRIDGEPORT_LOOPREAD,
+ parm,
+ sizeof(*parm),
+ 0,
+ sizeof(*parm));
+}
+
GSW_return_t GSW_CTP_PortAssignmentAlloc(const GSW_Device_t *dev, GSW_CTP_portAssignment_t *parm)
{
return gsw_api_wrap(dev,
@@ -501,6 +586,26 @@
0);
}
+GSW_return_t GSW_QoS_QueueCfgGet(const GSW_Device_t *dev, GSW_QoS_queueCfg_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_QOS_QUEUECFGGET,
+ parm,
+ sizeof(*parm),
+ 0,
+ sizeof(*parm));
+}
+
+GSW_return_t GSW_QoS_QueueCfgSet(const GSW_Device_t *dev, GSW_QoS_queueCfg_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_QOS_QUEUECFGSET,
+ parm,
+ sizeof(*parm),
+ GSW_QOS_QUEUECFGGET,
+ 0);
+}
+
GSW_return_t GSW_QoS_QueuePortGet(const GSW_Device_t *dev, GSW_QoS_queuePort_t *parm)
{
return gsw_api_wrap(dev,
@@ -1041,14 +1146,15 @@
0);
}
-GSW_return_t GSW_MAC_TableClearCond(const GSW_Device_t *dev, GSW_MAC_tableClearCond_t *parm)
+GSW_return_t GSW_MAC_TableClearCond(const GSW_Device_t *dev,
+ GSW_MAC_tableClearCond_t *parm)
{
return gsw_api_wrap(dev,
GSW_MAC_TABLECLEARCOND,
parm,
sizeof(*parm),
0,
- sizeof(*parm));
+ 0);
}
GSW_return_t GSW_MAC_TableEntryAdd(const GSW_Device_t *dev, GSW_MAC_tableAdd_t *parm)
@@ -1111,7 +1217,17 @@
sizeof(*parm));
}
-// #ifdef CONFIG_GSWIP_EVLAN
+GSW_return_t GSW_MAC_TableLoopDetect(const GSW_Device_t *dev, GSW_MAC_tableLoopDetect_t *parm)
+{
+ return gsw_api_wrap(dev,
+ GSW_MAC_TABLE_LOOP_DETECT,
+ parm,
+ sizeof(*parm),
+ 0,
+ sizeof(*parm));
+}
+
+#ifdef CONFIG_GSWIP_EVLAN
GSW_return_t GSW_ExtendedVlanAlloc(const GSW_Device_t *dev, GSW_EXTENDEDVLAN_alloc_t *parm)
{
return gsw_api_wrap(dev,
@@ -1251,7 +1367,7 @@
0,
sizeof(*parm));
}
-// #endif /* CONFIG_GSWIP_EVLAN */
+#endif /* CONFIG_GSWIP_EVLAN */
GSW_return_t GSW_MulticastRouterPortAdd(const GSW_Device_t *dev, GSW_multicastRouter_t *parm)
{
@@ -1432,3 +1548,4 @@
0,
sizeof(*parm));
}
+
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/gsw_cli_common.c b/feed/app/ethswbox/src/switch_hostapi/src/gsw_cli_common.c
index f7aef23..d03dd3a 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/gsw_cli_common.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/gsw_cli_common.c
@@ -98,7 +98,7 @@
return 1;
}
-static char *findArgParam(int argc, char *argv[], char *name)
+char *findArgParam(int argc, char *argv[], char *name)
{
int i;
size_t len;
@@ -118,6 +118,20 @@
return NULL;
}
+int scanStrParamArg(int argc, char *argv[], char *name, size_t size, char *param)
+{
+ char *ptr = findArgParam(argc, argv, name);
+
+ if (ptr == NULL)
+ return 0;
+
+ // Copy the string value to the provided buffer
+ strncpy(param, ptr, size - 1);
+ param[size - 1] = '\0'; // Ensure null-terminated
+
+ return 1;
+}
+
int scanParamArg(int argc, char *argv[], char *name, size_t size, void *param)
{
uint64_t tmp = 0;
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/gsw_ss.c b/feed/app/ethswbox/src/switch_hostapi/src/gsw_ss.c
new file mode 100644
index 0000000..2571251
--- /dev/null
+++ b/feed/app/ethswbox/src/switch_hostapi/src/gsw_ss.c
@@ -0,0 +1,31 @@
+/******************************************************************************
+
+ Copyright 2023 MaxLinear, Inc.
+
+ For licensing information, see the file 'LICENSE' in the root folder of
+ this software module.
+
+******************************************************************************/
+
+#include "host_adapt.h"
+#include "host_api_impl.h"
+
+int gsw_ss_sptag_get(const GSW_Device_t *dev, struct gsw_ss_sptag *pdata)
+{
+ return gsw_api_wrap(dev,
+ GSW_SS_SPTAG_GET,
+ pdata,
+ sizeof(*pdata),
+ 0,
+ sizeof(*pdata));
+}
+
+int gsw_ss_sptag_set(const GSW_Device_t *dev, struct gsw_ss_sptag *pdata)
+{
+ return gsw_api_wrap(dev,
+ GSW_SS_SPTAG_SET,
+ pdata,
+ sizeof(*pdata),
+ GSW_SS_SPTAG_GET,
+ 0);
+}
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_rpi4evk.c b/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_rpi4evk.c
index 77faa20..d0c941d 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_rpi4evk.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_rpi4evk.c
@@ -71,25 +71,33 @@
static int mdiobus_read(void *mdiobus_data, uint8_t phyaddr, uint8_t mmd,
uint16_t reg)
{
- const struct device *dev = mdiobus_data;
int ret;
- if (phyaddr > 31 ||
- mmd != GSW_MMD_DEV || reg > GSW_MMD_REG_DATA_LAST)
+ if (phyaddr > 31 || reg > GSW_MMD_REG_DATA_LAST)
return -EINVAL;
- ret = lif_mdio_c45_read(phyif.lif_id, phyaddr, mmd, reg);
+
+ if (mmd == GSW_MMD_DEV)
+ ret = lif_mdio_c45_read(phyif.lif_id, phyaddr, mmd, reg);
+ else if (mmd == GSW_MMD_SMDIO_DEV)
+ ret = lif_mdio_c22_read(phyif.lif_id, phyaddr, reg);
+ else
+ return -EINVAL;
+
return ret;
}
static int mdiobus_write(void *mdiobus_data, uint8_t phyaddr, uint8_t mmd,
uint16_t reg, uint16_t val)
{
- const struct device *dev = mdiobus_data;
+ if (phyaddr > 31 || reg > GSW_MMD_REG_DATA_LAST)
+ return -EINVAL;
- if ( phyaddr > 31 ||
- mmd != GSW_MMD_DEV || reg > GSW_MMD_REG_DATA_LAST)
+ if (mmd == GSW_MMD_DEV)
+ return lif_mdio_c45_write(phyif.lif_id, phyaddr, mmd, reg, val);
+ else if (mmd == GSW_MMD_SMDIO_DEV)
+ return lif_mdio_c22_write(phyif.lif_id, phyaddr, reg, val);
+ else
return -EINVAL;
- return lif_mdio_c45_write(phyif.lif_id, phyaddr, mmd, reg, val);
}
@@ -108,8 +116,11 @@
gsw_dev.mdiobus_read = mdiobus_read;
gsw_dev.mdiobus_write = mdiobus_write;
gsw_dev.mdiobus_data = NULL;
+
gsw_dev.phy_addr = (uint8_t)gsw_get_phy_addr(lif_id, phy_id);
- return &gsw_dev;
+ gsw_dev.smdio_phy_addr = gsw_dev.phy_addr;
+
+ return &gsw_dev;
}
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_rpi4evk.h b/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_rpi4evk.h
index 0339617..79f8d03 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_rpi4evk.h
+++ b/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_rpi4evk.h
@@ -100,16 +100,6 @@
#define sys_cpu_to_be64(val) (val)
#endif
-/* Clause 45 MDIO read and write functions to customize */
-#ifndef CL45_MDIO_READ
-#define CL45_MDIO_READ(...) 0
-#endif
-
-#ifndef CL45_MDIO_WRITE
-#define CL45_MDIO_WRITE(...) 0
-#endif
-
-
/*prototype global functions */
int gsw_read(const GSW_Device_t *dev, uint32_t regaddr);
int gsw_write(const GSW_Device_t *dev, uint32_t regaddr, uint16_t data);
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_user.c b/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_user.c
index ceb90a0..f08ffb4 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_user.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_user.c
@@ -35,23 +35,32 @@
{
uint16_t val=0;
int ret;
-
- if (phyaddr > 31 ||
- mmd != GSW_MMD_DEV || reg > GSW_MMD_REG_DATA_LAST)
+
+ if (phyaddr > 31 || reg > GSW_MMD_REG_DATA_LAST)
+ return -EINVAL;
+
+ if (mmd == GSW_MMD_DEV)
+ ret = sys_cl45_mdio_read(phyaddr, mmd, reg, &val);
+ else if (mmd == GSW_MMD_SMDIO_DEV)
+ ret = sys_cl22_mdio_read(phyaddr, reg, &val);
+ else
return -EINVAL;
- ret = sys_cl45_mdio_read(phyaddr, mmd, reg, &val);
return ret < 0 ? ret : (int)val;
}
static int mdiobus_write(void *mdiobus_data, uint8_t phyaddr, uint8_t mmd,
uint16_t reg, uint16_t val)
{
- if ( phyaddr > 31 ||
- mmd != GSW_MMD_DEV || reg > GSW_MMD_REG_DATA_LAST)
+ if (phyaddr > 31 || reg > GSW_MMD_REG_DATA_LAST)
return -EINVAL;
- return sys_cl45_mdio_write(phyaddr, mmd, reg, val);
+ if (mmd == GSW_MMD_DEV)
+ return sys_cl45_mdio_write(phyaddr, mmd, reg, val);
+ else if (mmd == GSW_MMD_SMDIO_DEV)
+ return sys_cl22_mdio_write(phyaddr, reg, val);
+ else
+ return -EINVAL;
}
static GSW_Device_t gsw_dev = {0};
@@ -68,11 +77,12 @@
gsw_dev.mdiobus_read = mdiobus_read;
gsw_dev.mdiobus_write = mdiobus_write;
-
gsw_dev.mdiobus_data = NULL;
+
gsw_dev.phy_addr = SMDIO_ADDR;
+ gsw_dev.smdio_phy_addr = SMDIO_ADDR;
- return 0;
+ return 0;
}
int32_t api_gsw_get_links(char* lib)
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_user.h b/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_user.h
index fa1cb65..f65462b 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_user.h
+++ b/feed/app/ethswbox/src/switch_hostapi/src/host_adapt_user.h
@@ -100,6 +100,15 @@
#define sys_cpu_to_be64(val) (val)
#endif
+/* Clause 22 MDIO read and write functions to customize */
+#ifndef CL22_MDIO_READ
+#define CL22_MDIO_READ(...) 0
+#endif
+
+#ifndef CL22_MDIO_WRITE
+#define CL22_MDIO_WRITE(...) 0
+#endif
+
/* Clause 45 MDIO read and write functions to customize */
#ifndef CL45_MDIO_READ
#define CL45_MDIO_READ(...) 0
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_api_impl.c b/feed/app/ethswbox/src/switch_hostapi/src/host_api_impl.c
index 84a9bf5..db1243e 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_api_impl.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/host_api_impl.c
@@ -101,7 +101,7 @@
cmd = words / GSW_MMD_REG_DATA_MAX_SIZE;
assert(cmd > 0 && cmd < 3);
- cmd += MMD_API_SET_DATA_0;
+ cmd += MMD_API_GET_DATA_0;
ret = gsw_write(dev, GSW_MMD_REG_CTRL,
cmd | CTRL_BUSY_MASK);
if (ret < 0)
@@ -132,7 +132,7 @@
if (ret < 0)
return ret;
- *presult = (int16_t)ret;
+ *presult = ret;
return 0;
}
@@ -370,7 +370,7 @@
EXIT:
#if defined(ENABLE_GETSET_OPT) && ENABLE_GETSET_OPT
shadow.ctrl = cmd;
- shadow.ret = (int16_t)ret;
+ shadow.ret = ret;
#endif
dev->unlock(dev->lock_data);
return ret;
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb.h b/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb.h
deleted file mode 120000
index f278af1..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb.h
+++ /dev/null
@@ -1 +0,0 @@
-host_smdio_ssb_user.h
\ No newline at end of file
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_rpi4evk.h b/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb.h
similarity index 84%
rename from feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_rpi4evk.h
rename to feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb.h
index 5022ba4..c962a3d 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_rpi4evk.h
+++ b/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb.h
@@ -44,14 +44,4 @@
*/
int check_registers();
-
-/* Clause 22 MDIO read and write functions to customize */
-#ifndef CL22_MDIO_READ
-#define CL22_MDIO_READ(...) 0
-#endif
-
-#ifndef CL22_MDIO_WRITE
-#define CL22_MDIO_WRITE(...) 0
-#endif
-
#endif
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_rpi4evk.c b/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_rpi4evk.c
index cb937af..423aeeb 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_rpi4evk.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_rpi4evk.c
@@ -48,17 +48,17 @@
static int gsw_smdio_read(const GSW_Device_t *pdev, uint16_t phy_reg)
{
- return smdio_read(lif_id, ((GSW_Device_t *)(pdev))->phy_addr, phy_reg);
+ return smdio_read(lif_id, ((GSW_Device_t *)(pdev))->smdio_phy_addr, phy_reg);
}
static int gsw_smdio_write(const GSW_Device_t *pdev, uint16_t phy_reg, uint16_t phy_reg_data)
{
- return smdio_write(lif_id, ((GSW_Device_t *)(pdev))->phy_addr, phy_reg, phy_reg_data);
+ return smdio_write(lif_id, ((GSW_Device_t *)(pdev))->smdio_phy_addr, phy_reg, phy_reg_data);
}
static int gsw_smdio_cont_write(const GSW_Device_t *pdev, uint16_t phy_reg, uint16_t phy_reg_data[8], uint8_t num)
{
- return smdio_cont_write(lif_id, ((GSW_Device_t *)(pdev))->phy_addr, phy_reg, phy_reg_data, num);
+ return smdio_cont_write(lif_id, ((GSW_Device_t *)(pdev))->smdio_phy_addr, phy_reg, phy_reg_data, num);
}
@@ -82,8 +82,6 @@
*/
void host_smdio_ssb_ops_uninit()
{
- smdio_deinit();
-
host_smdio_ops.pdev = NULL;
host_smdio_ops.smdio_read = NULL;
host_smdio_ops.smdio_write = NULL;
@@ -163,11 +161,11 @@
smdio_ssb_pdi_reset();
//Wait for target to be ready for download
- if (smdio_ssb_wait_pdi_stat_is_expected(FW_DL_MDIO_RDY_MAGIC, timeout_ms)) {
+ if (smdio_ssb_wait_pdi_stat_is_expected(FW_DL_MDIO_RDY_MAGIC, 3000)) {
printf("Target is ready for downloading.\n");
} else {
//if timeout, here we can not return timeout code, for compatibility, we still continue
- ((GSW_Device_t *)(host_smdio_ops.pdev))->phy_addr = 0x1F;
+ ((GSW_Device_t *)(host_smdio_ops.pdev))->smdio_phy_addr = 0x1F;
}
//Send START signal to target which is rescue mode
@@ -227,7 +225,7 @@
idx += 2;
data_size += 2;
} else if (idx < full_image_size) { // last byte of data, padding high 8bits with 0s
- fdata |= pdata[idx];
+ fdata |= (uint16_t)pdata[idx];
idx++;
data_size++;
} else { // no more data
@@ -306,6 +304,12 @@
rewind(fwin);
pDataBuf = (uint8_t*)malloc(filesize);
+ if (pDataBuf == NULL) {
+ printf("malloc: Unable to allocate memory.\n");
+ ret = fclose(fwin);
+ return -errno;
+ }
+
ret = fread(pDataBuf, 1, filesize, fwin);
if (ret != filesize)
{
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_user.c b/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_user.c
index 6650fc3..35e1d54 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_user.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_user.c
@@ -34,6 +34,7 @@
#define SMDIO_PHY_NR 8
#define M_SLEEP(x) usleep((x)*1000)
+
struct host_smdio_ssb_ops {
const GSW_Device_t *pdev;
@@ -45,15 +46,15 @@
static struct host_smdio_ssb_ops host_smdio_ops;
static GSW_Device_t gsw_dev = {0};
+
static int gsw_smdio_read(const GSW_Device_t *pdev, uint16_t phy_reg)
{
uint16_t val=0;
int ret;
- ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->phy_addr, SMIDO_SB_PHY_ADDR_REG, phy_reg);
-
+ ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->smdio_phy_addr, SMIDO_SB_PHY_ADDR_REG, phy_reg);
if (ret == 0) {
- ret = sys_cl22_mdio_read(((GSW_Device_t *)pdev)->phy_addr, SMIDO_SB_PHY_DATA_REG, &val);
+ ret = sys_cl22_mdio_read(((GSW_Device_t *)pdev)->smdio_phy_addr, SMIDO_SB_PHY_DATA_REG, &val);
}
return ret < 0 ? ret : (int)val;
@@ -63,9 +64,9 @@
{
int ret = 0;
- ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->phy_addr, SMIDO_SB_PHY_ADDR_REG, phy_reg);
+ ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->smdio_phy_addr, SMIDO_SB_PHY_ADDR_REG, phy_reg);
if (ret == 0) {
- ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->phy_addr, SMIDO_SB_PHY_DATA_REG, phy_reg_data);
+ ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->smdio_phy_addr, SMIDO_SB_PHY_DATA_REG, phy_reg_data);
}
return ret;
@@ -75,16 +76,17 @@
{
int ret = 0;
- ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->phy_addr, SMIDO_SB_PHY_ADDR_REG, phy_reg);
+ ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->smdio_phy_addr, SMIDO_SB_PHY_ADDR_REG, phy_reg);
if (ret == 0) {
for (uint8_t i = 0; i < (num & 0xF); i++) {
- ret |= sys_cl22_mdio_write(((GSW_Device_t *)pdev)->phy_addr, SMIDO_SB_PHY_DATA_REG, phy_reg_data[i]);
+ ret = sys_cl22_mdio_write(((GSW_Device_t *)pdev)->smdio_phy_addr, SMIDO_SB_PHY_DATA_REG, phy_reg_data[i]);
}
}
return ret;
}
+
/**
* Initialize smdio_ssb_ops operation
*/
@@ -185,11 +187,11 @@
smdio_ssb_pdi_reset();
//Wait for target to be ready for download
- if (smdio_ssb_wait_pdi_stat_is_expected(FW_DL_MDIO_RDY_MAGIC, timeout_ms)) {
+ if (smdio_ssb_wait_pdi_stat_is_expected(FW_DL_MDIO_RDY_MAGIC, 3000)) {
printf("Target is ready for downloading.\n");
} else {
//if timeout, here we can not return timeout code, for compatibility, we still continue
- ((GSW_Device_t *)(host_smdio_ops.pdev))->phy_addr = 0x1F;
+ ((GSW_Device_t *)(host_smdio_ops.pdev))->smdio_phy_addr = 0x1F;
}
//Send START signal to target which is rescue mode
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_user.h b/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_user.h
deleted file mode 100644
index 5022ba4..0000000
--- a/feed/app/ethswbox/src/switch_hostapi/src/host_smdio_ssb_user.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/******************************************************************************
-
- Copyright 2023-2024 MaxLinear, Inc.
-
- For licensing information, see the file 'LICENSE' in the root folder of
- this software module.
-
-******************************************************************************/
-
-#ifndef __HOST_SMDIO_SSB_H__
-#define __HOST_SMDIO_SSB_H__
-#include <stdint.h>
-
-/**
- * Initialize host_smdio_ssb_ops operation
- */
-void host_smdio_ssb_ops_init(const void *pdev);
-
-/**
- * Uninitialize host_smdio_ssb_ops operation
- */
-void host_smdio_ssb_ops_uninit();
-
-/**
- * Write image data to target which in rescue mode
- * Image start with 4 bytes of image type
- * followed by 4 bytes of image size and 4 bytes
- * of checksum
- *
- * pdata - data pointer to be writen to SB
- *
- * return size of data writen to target if successful
- */
-int host_smdio_ssb_rescue_download(uint8_t *pdata, uint32_t timeout_ms);
-
-/**
- * Read FW file
- */
-int ssb_load(char* fw_path);
-
-
-/**
- * Check Register Status
- */
-int check_registers();
-
-
-/* Clause 22 MDIO read and write functions to customize */
-#ifndef CL22_MDIO_READ
-#define CL22_MDIO_READ(...) 0
-#endif
-
-#ifndef CL22_MDIO_WRITE
-#define CL22_MDIO_WRITE(...) 0
-#endif
-
-#endif
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/mdio_relay.c b/feed/app/ethswbox/src/switch_hostapi/src/mdio_relay.c
index 65c71b6..ec11bc1 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/mdio_relay.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/mdio_relay.c
@@ -70,3 +70,4 @@
0,
0);
}
+
diff --git a/feed/app/ethswbox/src/switch_hostapi/src/sys_misc.c b/feed/app/ethswbox/src/switch_hostapi/src/sys_misc.c
index 3c62022..06e56f8 100644
--- a/feed/app/ethswbox/src/switch_hostapi/src/sys_misc.c
+++ b/feed/app/ethswbox/src/switch_hostapi/src/sys_misc.c
@@ -80,7 +80,7 @@
0);
}
-int sys_misc_reg_rd(const GSW_Device_t *dev, struct sys_reg_rd *sys_reg)
+int sys_misc_reg_rd(const GSW_Device_t *dev, struct sys_reg_rw *sys_reg)
{
return gsw_api_wrap(dev,
SYS_MISC_REG_RD,
@@ -89,3 +89,137 @@
0,
sizeof(*sys_reg));
}
+
+int sys_misc_reg_wr(const GSW_Device_t *dev, struct sys_reg_rw *sys_reg)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_REG_WR,
+ sys_reg,
+ sizeof(*sys_reg),
+ 0,
+ 0);
+}
+
+int sys_misc_reg_mod(const GSW_Device_t *dev, struct sys_reg_mod *sys_reg)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_REG_MOD,
+ sys_reg,
+ sizeof(*sys_reg),
+ 0,
+ 0);
+}
+
+int sys_misc_cml_clk_get(const GSW_Device_t *dev, struct sys_cml_clk *clk)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_CML_CLK_GET,
+ clk,
+ sizeof(*clk),
+ 0,
+ sizeof(*clk));
+}
+
+int sys_misc_cml_clk_set(const GSW_Device_t *dev, struct sys_cml_clk *clk)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_CML_CLK_SET,
+ clk,
+ sizeof(*clk),
+ 0,
+ 0);
+}
+
+int sys_misc_sfp_get(const GSW_Device_t *dev, struct sys_sfp_cfg *cfg)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_SFP_GET,
+ cfg,
+ sizeof(*cfg),
+ 0,
+ sizeof(*cfg));
+}
+
+int sys_misc_sfp_set(const GSW_Device_t *dev, struct sys_sfp_cfg *cfg)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_SFP_SET,
+ cfg,
+ sizeof(*cfg),
+ 0,
+ sizeof(*cfg));
+}
+
+int loop_detect_passive_start(const GSW_Device_t *dev,
+ struct loop_detect_passive_cfg *cfg)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_LOOP_PASSIVE_START,
+ cfg,
+ sizeof(*cfg),
+ 0,
+ 0);
+}
+
+int loop_detect_passive_stop(const GSW_Device_t *dev)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_LOOP_PASSIVE_STOP,
+ NULL,
+ 0,
+ 0,
+ 0);
+}
+
+int loop_detect_active_start(const GSW_Device_t *dev,
+ struct loop_detect_active_cfg *cfg)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_LOOP_ACTIVE_START,
+ cfg,
+ sizeof(*cfg),
+ 0,
+ 0);
+}
+
+int loop_detect_active_stop(const GSW_Device_t *dev)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_LOOP_ACTIVE_STOP,
+ NULL,
+ 0,
+ 0,
+ 0);
+}
+
+int loop_prevention_start(const GSW_Device_t *dev,
+ struct loop_prevention_cfg *cfg)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_LOOP_PREVENTION_START,
+ cfg,
+ sizeof(*cfg),
+ 0,
+ 0);
+}
+
+int loop_prevention_stop(const GSW_Device_t *dev)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_LOOP_PREVENTION_STOP,
+ NULL,
+ 0,
+ 0,
+ 0);
+}
+
+
+int mxl_led_sys_cfg(const GSW_Device_t *dev, struct mxl_led_sys_cfg *cfg)
+{
+ return gsw_api_wrap(dev,
+ SYS_MISC_SYS_LED_CFG,
+ cfg,
+ sizeof(*cfg),
+ 0,
+ 0);
+}