]> Git Repo - J-u-boot.git/blobdiff - net/net.c
Merge patch series "dwc3: gadget: properly fix cache operations"
[J-u-boot.git] / net / net.c
index 23b5d3356afa1937ad8ef532026dde281d57c779..f47e9fbe33a7c61cf5d877cb6b1ae42bb110df1b 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -80,7 +80,6 @@
  *     Next step:      none
  */
 
-
 #include <bootstage.h>
 #include <command.h>
 #include <console.h>
@@ -88,6 +87,7 @@
 #include <env_internal.h>
 #include <errno.h>
 #include <image.h>
+#include <led.h>
 #include <log.h>
 #include <net.h>
 #include <net6.h>
@@ -306,7 +306,7 @@ U_BOOT_ENV_CALLBACK(dnsip, on_dnsip);
  */
 void net_auto_load(void)
 {
-#if defined(CONFIG_CMD_NFS) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_CMD_NFS) && !defined(CONFIG_XPL_BUILD)
        const char *s = env_get("autoload");
 
        if (s != NULL && strcmp(s, "NFS") == 0) {
@@ -335,17 +335,22 @@ void net_auto_load(void)
                net_set_state(NETLOOP_SUCCESS);
                return;
        }
-       if (net_check_prereq(TFTPGET)) {
-/* We aren't expecting to get a serverip, so just accept the assigned IP */
-               if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) {
-                       net_set_state(NETLOOP_SUCCESS);
-               } else {
-                       printf("Cannot autoload with TFTPGET\n");
-                       net_set_state(NETLOOP_FAIL);
+       if (IS_ENABLED(CONFIG_CMD_TFTPBOOT)) {
+               if (net_check_prereq(TFTPGET)) {
+                       /*
+                        * We aren't expecting to get a serverip, so just
+                        * accept the assigned IP
+                        */
+                       if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) {
+                               net_set_state(NETLOOP_SUCCESS);
+                       } else {
+                               printf("Cannot autoload with TFTPGET\n");
+                               net_set_state(NETLOOP_FAIL);
+                       }
+                       return;
                }
-               return;
+               tftp_start(TFTPGET);
        }
-       tftp_start(TFTPGET);
 }
 
 static int net_init_loop(void)
@@ -555,7 +560,7 @@ restart:
                        ping6_start();
                        break;
 #endif
-#if defined(CONFIG_CMD_NFS) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_CMD_NFS) && !defined(CONFIG_XPL_BUILD)
                case NFS:
                        nfs_start();
                        break;
@@ -570,7 +575,7 @@ restart:
                        cdp_start();
                        break;
 #endif
-#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_XPL_BUILD)
                case NETCONS:
                        nc_start();
                        break;
@@ -660,6 +665,9 @@ restart:
                        /* Invalidate the last protocol */
                        eth_set_last_protocol(BOOTP);
 
+                       /* Turn off activity LED if triggered */
+                       led_activity_off();
+
                        puts("\nAbort\n");
                        /* include a debug print as well incase the debug
                           messages are directed to stderr */
@@ -1435,7 +1443,7 @@ void net_process_received_packet(uchar *in_packet, int len)
                        }
                }
 
-#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_XPL_BUILD)
                nc_input_packet((uchar *)ip + IP_UDP_HDR_SIZE,
                                src_ip,
                                ntohs(ip->udp_dst),
@@ -1685,18 +1693,6 @@ void net_set_udp_header(uchar *pkt, struct in_addr dest, int dport, int sport,
        ip->udp_xsum = 0;
 }
 
-void copy_filename(char *dst, const char *src, int size)
-{
-       if (src && *src && (*src == '"')) {
-               ++src;
-               --size;
-       }
-
-       while ((--size > 0) && src && *src && (*src != '"'))
-               *dst++ = *src++;
-       *dst = '\0';
-}
-
 int is_serverip_in_cmd(void)
 {
        return !!strchr(net_boot_file_name, ':');
This page took 0.027022 seconds and 4 git commands to generate.