xilinx: Move bootmode detection to separate function
[oweals/u-boot.git] / cmd / ethsw.c
index 491cb8eac385ed8ecf44ab6a2f46ab6bf57a59f9..8d271ce1f3cd49efeb0e1d51466b063ea5a66af1 100644 (file)
@@ -1,13 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2015 Freescale Semiconductor, Inc.
  *
- * SPDX-License-Identifier:      GPL-2.0+
- *
  * Ethernet Switch commands
  */
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <errno.h>
 #include <env_flags.h>
 #include <ethsw.h>
@@ -864,7 +864,7 @@ static int keyword_match_mac_addr(enum ethsw_keyword_id key_id, int argc,
                return 0;
        }
 
-       eth_parse_enetaddr(argv[*argc_nr + 1], parsed_cmd->ethaddr);
+       string_to_enetaddr(argv[*argc_nr + 1], parsed_cmd->ethaddr);
 
        if (is_broadcast_ethaddr(parsed_cmd->ethaddr)) {
                memset(parsed_cmd->ethaddr, 0xFF, sizeof(parsed_cmd->ethaddr));
@@ -915,7 +915,7 @@ static void cmd_keywords_opt_check(const struct ethsw_command_def *parsed_cmd,
         * check if our command's optional keywords match the optional
         * keywords of an available command
         */
-       for (i = 0; i < ARRAY_SIZE(ethsw_cmd_def); i++) {
+       for (i = 0; i < ARRAY_SIZE(cmd_opt_def); i++) {
                keyw_opt_matched = 0;
                cmd_keyw_p = &parsed_cmd->cmd_to_keywords[keyw_opt_matched];
                cmd_keyw_opt_p = &cmd_opt_def[i].cmd_keyword[keyw_opt_matched];