Lines Matching +full:- +full:- +full:match
1 // SPDX-License-Identifier: GPL-2.0+
18 "{ [help] | [clear] } - show an l2 switch port's statistics"
29 "- enable/disable/show learning configuration on a port"
40 "- Add/delete a mac entry in FDB; use show to see FDB entries; " \
52 "- set/show PVID (ingress and egress VLAN tagging) for a port"
63 "- add a VLAN to a port (VLAN members)"
74 " - set egress tagging mode for a port"
85 "- Configure VID source for egress tag. " \
97 "- make VLAN learning shared or private"
108 "- enable/disable VLAN ingress filtering on port"
119 "- get/set LAG group for a port"
163 .cmd_func_offset = -1,
187 .cmd_func_offset = -1,
195 .cmd_func_offset = -1,
229 .cmd_func_offset = -1,
237 .cmd_func_offset = -1,
282 .cmd_func_offset = -1,
290 .cmd_func_offset = -1,
315 .cmd_func_offset = -1,
323 .cmd_func_offset = -1,
359 .cmd_func_offset = -1,
367 .cmd_func_offset = -1,
411 .cmd_func_offset = -1,
420 .cmd_func_offset = -1,
458 .cmd_func_offset = -1,
467 .cmd_func_offset = -1,
505 .cmd_func_offset = -1,
514 .cmd_func_offset = -1,
551 .cmd_func_offset = -1,
559 .cmd_func_offset = -1,
633 int (*match)(enum ethsw_keyword_id key_id, int argc, char *const argv[], member
638 .match = &keyword_match_gen,
641 .match = &keyword_match_gen,
644 .match = &keyword_match_port
647 .match = &keyword_match_gen,
650 .match = &keyword_match_gen,
653 .match = &keyword_match_gen,
656 .match = &keyword_match_gen,
659 .match = &keyword_match_gen,
662 .match = &keyword_match_gen,
665 .match = &keyword_match_vlan,
668 .match = &keyword_match_gen,
671 .match = &keyword_match_mac_addr,
674 .match = &keyword_match_mac_addr,
677 .match = &keyword_match_gen,
680 .match = &keyword_match_pvid,
683 .match = &keyword_match_gen,
686 .match = &keyword_match_gen,
689 .match = &keyword_match_gen,
692 .match = &keyword_match_gen,
695 .match = &keyword_match_gen,
698 .match = &keyword_match_gen,
701 .match = &keyword_match_gen,
704 .match = &keyword_match_gen,
707 .match = &keyword_match_gen,
710 .match = &keyword_match_gen,
713 .match = &keyword_match_aggr,
727 if (!cmd_func->ethsw_name) in ethsw_define_functions()
728 return -EINVAL; in ethsw_define_functions()
730 ethsw_name = cmd_func->ethsw_name; in ethsw_define_functions()
749 /* Generic function used to match a keyword only by a string */
755 parsed_cmd->cmd_to_keywords[*argc_nr] = key_id; in keyword_match_gen()
762 /* Function used to match the command's port */
775 if (strict_strtoul(argv[*argc_nr + 1], 10, &val) != -EINVAL) { in keyword_match_port()
776 parsed_cmd->port = val; in keyword_match_port()
778 parsed_cmd->cmd_to_keywords[*argc_nr] = ethsw_id_port_no; in keyword_match_port()
785 /* Function used to match the command's vlan */
799 if (strict_strtoul(argv[*argc_nr + 1], 10, &val) != -EINVAL) { in keyword_match_vlan()
800 parsed_cmd->vid = val; in keyword_match_vlan()
802 parsed_cmd->cmd_to_keywords[*argc_nr] = ethsw_id_vlan_no; in keyword_match_vlan()
809 parsed_cmd->cmd_to_keywords[*argc_nr + 1] = ethsw_id_add; in keyword_match_vlan()
811 parsed_cmd->cmd_to_keywords[*argc_nr + 1] = ethsw_id_del; in keyword_match_vlan()
818 if (strict_strtoul(argv[*argc_nr + 2], 10, &val) != -EINVAL) { in keyword_match_vlan()
819 parsed_cmd->vid = val; in keyword_match_vlan()
821 parsed_cmd->cmd_to_keywords[*argc_nr] = ethsw_id_add_del_no; in keyword_match_vlan()
828 /* Function used to match the command's pvid */
841 if (strict_strtoul(argv[*argc_nr + 1], 10, &val) != -EINVAL) { in keyword_match_pvid()
842 parsed_cmd->vid = val; in keyword_match_pvid()
844 parsed_cmd->cmd_to_keywords[*argc_nr] = ethsw_id_pvid_no; in keyword_match_pvid()
850 /* Function used to match the command's MAC address */
859 !is_broadcast_ethaddr(parsed_cmd->ethaddr)) in keyword_match_mac_addr()
867 eth_parse_enetaddr(argv[*argc_nr + 1], parsed_cmd->ethaddr); in keyword_match_mac_addr()
869 if (is_broadcast_ethaddr(parsed_cmd->ethaddr)) { in keyword_match_mac_addr()
870 memset(parsed_cmd->ethaddr, 0xFF, sizeof(parsed_cmd->ethaddr)); in keyword_match_mac_addr()
874 parsed_cmd->cmd_to_keywords[*argc_nr + 1] = ethsw_id_add_del_mac; in keyword_match_mac_addr()
879 /* Function used to match the command's aggregation number */
892 if (strict_strtoul(argv[*argc_nr + 1], 10, &val) != -EINVAL) { in keyword_match_aggr()
893 parsed_cmd->aggr_grp = val; in keyword_match_aggr()
895 parsed_cmd->cmd_to_keywords[*argc_nr] = ethsw_id_aggr_no; in keyword_match_aggr()
911 /* remember the best match */ in cmd_keywords_opt_check()
915 * check if our command's optional keywords match the optional in cmd_keywords_opt_check()
920 cmd_keyw_p = &parsed_cmd->cmd_to_keywords[keyw_opt_matched]; in cmd_keywords_opt_check()
928 parsed_cmd->cmd_keywords_nr && in cmd_keywords_opt_check()
937 * if all our optional command's keywords perfectly match an in cmd_keywords_opt_check()
943 parsed_cmd->cmd_keywords_nr && in cmd_keywords_opt_check()
965 * check if our command's keywords match the in cmd_keywords_check()
970 cmd_keyw_p = &parsed_cmd->cmd_to_keywords[keyw_matched]; in cmd_keywords_check()
977 while (keyw_matched + *argc_val < parsed_cmd->cmd_keywords_nr && in cmd_keywords_check()
986 * if all our command's keywords perfectly match an in cmd_keywords_check()
991 parsed_cmd->cmd_keywords_nr && in cmd_keywords_check()
994 parsed_cmd->cmd_function = in cmd_keywords_check()
1012 if (keyword[j].match(j, argc, argv, &i, parsed_cmd)) in keywords_find()
1017 /* if there is no keyword match for a word, the command is invalid */ in keywords_find()
1019 if (parsed_cmd->cmd_to_keywords[i] == ethsw_id_key_end) in keywords_find()
1022 parsed_cmd->cmd_keywords_nr = argc; in keywords_find()
1028 if (argc_val == parsed_cmd->cmd_keywords_nr) in keywords_find()
1032 * check the keywords and if a match is found, in keywords_find()
1038 if (argc_val == parsed_cmd->cmd_keywords_nr) { in keywords_find()
1039 if (!parsed_cmd->cmd_function) { in keywords_find()
1055 parsed_cmd->cmd_to_keywords[i] = ethsw_id_key_end; in command_def_init()
1057 parsed_cmd->port = ETHSW_CMD_PORT_ALL; in command_def_init()
1058 parsed_cmd->vid = ETHSW_CMD_VLAN_ALL; in command_def_init()
1059 parsed_cmd->aggr_grp = ETHSW_CMD_AGGR_GRP_NONE; in command_def_init()
1060 parsed_cmd->cmd_function = NULL; in command_def_init()
1063 memset(parsed_cmd->ethaddr, 0xff, sizeof(parsed_cmd->ethaddr)); in command_def_init()
1086 "- enable/disable a port; show a port's configuration"