x86: quark: Implement mrc cache
[platform/kernel/u-boot.git] / common / cmd_ethsw.c
index 1fa93ef..8e452e9 100644 (file)
@@ -92,6 +92,28 @@ static int ethsw_egr_tag_help_key_func(struct ethsw_command_def *parsed_cmd)
        return CMD_RET_SUCCESS;
 }
 
+#define ETHSW_VLAN_FDB_HELP "ethsw vlan fdb " \
+"{ [help] | show | shared | private } " \
+"- make VLAN learning shared or private"
+
+static int ethsw_vlan_learn_help_key_func(struct ethsw_command_def *parsed_cmd)
+{
+       printf(ETHSW_VLAN_FDB_HELP"\n");
+
+       return CMD_RET_SUCCESS;
+}
+
+#define ETHSW_PORT_INGR_FLTR_HELP "ethsw [port <port_no>] ingress filtering" \
+" { [help] | show | enable | disable } " \
+"- enable/disable VLAN ingress filtering on port"
+
+static int ethsw_ingr_fltr_help_key_func(struct ethsw_command_def *parsed_cmd)
+{
+       printf(ETHSW_PORT_INGR_FLTR_HELP"\n");
+
+       return CMD_RET_SUCCESS;
+}
+
 static struct keywords_to_function {
        enum ethsw_keyword_id cmd_keyword[ETHSW_MAX_CMD_PARAMS];
        int cmd_func_offset;
@@ -416,6 +438,100 @@ static struct keywords_to_function {
                        .cmd_func_offset = offsetof(struct ethsw_command_func,
                                                    port_egr_vlan_set),
                        .keyword_function = NULL,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_vlan,
+                                       ethsw_id_fdb,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = -1,
+                       .keyword_function = &ethsw_vlan_learn_help_key_func,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_vlan,
+                                       ethsw_id_fdb,
+                                       ethsw_id_help,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = -1,
+                       .keyword_function = &ethsw_vlan_learn_help_key_func,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_vlan,
+                                       ethsw_id_fdb,
+                                       ethsw_id_show,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = offsetof(struct ethsw_command_func,
+                                                   vlan_learn_show),
+                       .keyword_function = NULL,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_vlan,
+                                       ethsw_id_fdb,
+                                       ethsw_id_shared,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = offsetof(struct ethsw_command_func,
+                                                   vlan_learn_set),
+                       .keyword_function = NULL,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_vlan,
+                                       ethsw_id_fdb,
+                                       ethsw_id_private,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = offsetof(struct ethsw_command_func,
+                                                   vlan_learn_set),
+                       .keyword_function = NULL,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_ingress,
+                                       ethsw_id_filtering,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = -1,
+                       .keyword_function = &ethsw_ingr_fltr_help_key_func,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_ingress,
+                                       ethsw_id_filtering,
+                                       ethsw_id_help,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = -1,
+                       .keyword_function = &ethsw_ingr_fltr_help_key_func,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_ingress,
+                                       ethsw_id_filtering,
+                                       ethsw_id_show,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = offsetof(struct ethsw_command_func,
+                                                   port_ingr_filt_show),
+                       .keyword_function = NULL,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_ingress,
+                                       ethsw_id_filtering,
+                                       ethsw_id_enable,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = offsetof(struct ethsw_command_func,
+                                                   port_ingr_filt_set),
+                       .keyword_function = NULL,
+               }, {
+                       .cmd_keyword = {
+                                       ethsw_id_ingress,
+                                       ethsw_id_filtering,
+                                       ethsw_id_disable,
+                                       ethsw_id_key_end,
+                       },
+                       .cmd_func_offset = offsetof(struct ethsw_command_func,
+                                                   port_ingr_filt_set),
+                       .keyword_function = NULL,
                },
 };
 
@@ -533,6 +649,18 @@ struct keyword_def {
                }, {
                                .keyword_name = "classified",
                                .match = &keyword_match_gen,
+               }, {
+                               .keyword_name = "shared",
+                               .match = &keyword_match_gen,
+               }, {
+                               .keyword_name = "private",
+                               .match = &keyword_match_gen,
+               }, {
+                               .keyword_name = "ingress",
+                               .match = &keyword_match_gen,
+               }, {
+                               .keyword_name = "filtering",
+                               .match = &keyword_match_gen,
                },
 };
 
@@ -894,4 +1022,6 @@ U_BOOT_CMD(ethsw, ETHSW_MAX_CMD_PARAMS, 0, do_ethsw,
           ETHSW_VLAN_HELP"\n"
           ETHSW_PORT_UNTAG_HELP"\n"
           ETHSW_EGR_VLAN_TAG_HELP"\n"
+          ETHSW_VLAN_FDB_HELP"\n"
+          ETHSW_PORT_INGR_FLTR_HELP"\n"
 );