Lines Matching refs:parsed_cmd

20 static int ethsw_port_stats_help_key_func(struct ethsw_command_def *parsed_cmd)  in ethsw_port_stats_help_key_func()  argument
31 static int ethsw_learn_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_learn_help_key_func() argument
43 static int ethsw_fdb_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_fdb_help_key_func() argument
54 static int ethsw_pvid_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_pvid_help_key_func() argument
65 static int ethsw_vlan_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_vlan_help_key_func() argument
76 static int ethsw_port_untag_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_port_untag_help_key_func() argument
88 static int ethsw_egr_tag_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_egr_tag_help_key_func() argument
99 static int ethsw_vlan_learn_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_vlan_learn_help_key_func() argument
110 static int ethsw_ingr_fltr_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_ingr_fltr_help_key_func() argument
121 static int ethsw_port_aggr_help_key_func(struct ethsw_command_def *parsed_cmd) in ethsw_port_aggr_help_key_func() argument
131 int (*keyword_function)(struct ethsw_command_def *parsed_cmd);
610 struct ethsw_command_def *parsed_cmd);
613 struct ethsw_command_def *parsed_cmd);
616 struct ethsw_command_def *parsed_cmd);
619 struct ethsw_command_def *parsed_cmd);
622 struct ethsw_command_def *parsed_cmd);
625 struct ethsw_command_def *parsed_cmd);
634 int *argc_nr, struct ethsw_command_def *parsed_cmd);
752 struct ethsw_command_def *parsed_cmd) in keyword_match_gen() argument
755 parsed_cmd->cmd_to_keywords[*argc_nr] = key_id; in keyword_match_gen()
765 struct ethsw_command_def *parsed_cmd) in keyword_match_port() argument
769 if (!keyword_match_gen(key_id, argc, argv, argc_nr, parsed_cmd)) 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()
788 struct ethsw_command_def *parsed_cmd) in keyword_match_vlan() argument
793 if (!keyword_match_gen(key_id, argc, argv, argc_nr, parsed_cmd)) 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()
808 if (keyword_match_gen(ethsw_id_add, argc, argv, &aux, parsed_cmd)) in keyword_match_vlan()
809 parsed_cmd->cmd_to_keywords[*argc_nr + 1] = ethsw_id_add; in keyword_match_vlan()
810 else if (keyword_match_gen(ethsw_id_del, argc, argv, &aux, parsed_cmd)) in keyword_match_vlan()
811 parsed_cmd->cmd_to_keywords[*argc_nr + 1] = ethsw_id_del; 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()
831 struct ethsw_command_def *parsed_cmd) in keyword_match_pvid() argument
835 if (!keyword_match_gen(key_id, argc, argv, argc_nr, parsed_cmd)) 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()
853 struct ethsw_command_def *parsed_cmd) in keyword_match_mac_addr() argument
855 if (!keyword_match_gen(key_id, argc, argv, argc_nr, parsed_cmd)) in keyword_match_mac_addr()
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()
882 struct ethsw_command_def *parsed_cmd) in keyword_match_aggr() argument
886 if (!keyword_match_gen(key_id, argc, argv, argc_nr, parsed_cmd)) 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()
902 static void cmd_keywords_opt_check(const struct ethsw_command_def *parsed_cmd, in cmd_keywords_opt_check() argument
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()
943 parsed_cmd->cmd_keywords_nr && in cmd_keywords_opt_check()
956 static void cmd_keywords_check(struct ethsw_command_def *parsed_cmd, in cmd_keywords_check() argument
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()
991 parsed_cmd->cmd_keywords_nr && in cmd_keywords_check()
994 parsed_cmd->cmd_function = in cmd_keywords_check()
1003 struct ethsw_command_def *parsed_cmd) in keywords_find() argument
1012 if (keyword[j].match(j, argc, argv, &i, parsed_cmd)) 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()
1026 cmd_keywords_opt_check(parsed_cmd, &argc_val); in keywords_find()
1028 if (argc_val == parsed_cmd->cmd_keywords_nr) in keywords_find()
1035 cmd_keywords_check(parsed_cmd, &argc_val); in keywords_find()
1038 if (argc_val == parsed_cmd->cmd_keywords_nr) { in keywords_find()
1039 if (!parsed_cmd->cmd_function) { in keywords_find()
1050 static void command_def_init(struct ethsw_command_def *parsed_cmd) in command_def_init() argument
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()
1069 struct ethsw_command_def parsed_cmd; in do_ethsw() local
1075 command_def_init(&parsed_cmd); in do_ethsw()
1077 rc = keywords_find(argc, argv, &parsed_cmd); in do_ethsw()
1080 rc = parsed_cmd.cmd_function(&parsed_cmd); in do_ethsw()