]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - net/bootp.c
rockchip: video: rk_hdmi: migrate to livetree
[people/ms/u-boot.git] / net / bootp.c
index 579515687b7567e0e2069ff316ac60129f0da846..efa959971c279fe4e74d04ec0007d0cb1ef52e34 100644 (file)
@@ -14,7 +14,6 @@
 #include <net.h>
 #include <net/tftp.h>
 #include "bootp.h"
-#include "nfs.h"
 #ifdef CONFIG_LED_STATUS
 #include <status_led.h>
 #endif
@@ -387,12 +386,19 @@ static void bootp_timeout_handler(void)
 
        if (time_taken >= time_taken_max) {
 #ifdef CONFIG_BOOTP_MAY_FAIL
-               puts("\nRetry time exceeded\n");
-               net_set_state(NETLOOP_FAIL);
-#else
-               puts("\nRetry time exceeded; starting again\n");
-               net_start_again();
+               char *ethrotate;
+
+               ethrotate = env_get("ethrotate");
+               if ((ethrotate && strcmp(ethrotate, "no") == 0) ||
+                   net_restart_wrap) {
+                       puts("\nRetry time exceeded\n");
+                       net_set_state(NETLOOP_FAIL);
+               } else
 #endif
+               {
+                       puts("\nRetry time exceeded; starting again\n");
+                       net_start_again();
+               }
        } else {
                bootp_timeout *= 2;
                if (bootp_timeout > 2000)
@@ -414,7 +420,7 @@ static void bootp_timeout_handler(void)
 static u8 *add_vci(u8 *e)
 {
        char *vci = NULL;
-       char *env_vci = getenv("bootp_vci");
+       char *env_vci = env_get("bootp_vci");
 
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_NET_VCI_STRING)
        vci = CONFIG_SPL_NET_VCI_STRING;
@@ -488,7 +494,7 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
                *e++ = tmp & 0xff;
        }
 #if defined(CONFIG_BOOTP_SEND_HOSTNAME)
-       hostname = getenv("hostname");
+       hostname = env_get("hostname");
        if (hostname) {
                int hostnamelen = strlen(hostname);
 
@@ -503,8 +509,8 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
        clientarch = CONFIG_BOOTP_PXE_CLIENTARCH;
 #endif
 
-       if (getenv("bootp_arch"))
-               clientarch = getenv_ulong("bootp_arch", 16, clientarch);
+       if (env_get("bootp_arch"))
+               clientarch = env_get_ulong("bootp_arch", 16, clientarch);
 
        if (clientarch > 0) {
                *e++ = 93;      /* Client System Architecture */
@@ -520,7 +526,7 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
        *e++ = 0;       /* minor revision */
 
 #ifdef CONFIG_LIB_UUID
-       uuid = getenv("pxeuuid");
+       uuid = env_get("pxeuuid");
 
        if (uuid) {
                if (uuid_str_valid(uuid)) {
@@ -713,7 +719,7 @@ void bootp_request(void)
        dhcp_state = INIT;
 #endif
 
-       ep = getenv("bootpretryperiod");
+       ep = env_get("bootpretryperiod");
        if (ep != NULL)
                time_taken_max = simple_strtoul(ep, NULL, 10);
        else