]> git.sur5r.net Git - u-boot/blobdiff - net/tftp.c
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot
[u-boot] / net / tftp.c
index f2889fe4c9bda3ab1338b9b0f68aa822947f7c4a..a5ed8c5d0a3507b5f8dc270aae53194db4c0deb7 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <efi_loader.h>
 #include <mapmem.h>
 #include <net.h>
 #include <net/tftp.h>
@@ -705,11 +706,11 @@ void tftp_start(enum proto_t protocol)
         * TFTP protocol has a minimal timeout of 1 second.
         */
 
-       ep = getenv("tftpblocksize");
+       ep = env_get("tftpblocksize");
        if (ep != NULL)
                tftp_block_size_option = simple_strtol(ep, NULL, 10);
 
-       ep = getenv("tftptimeout");
+       ep = env_get("tftptimeout");
        if (ep != NULL)
                timeout_ms = simple_strtol(ep, NULL, 10);
 
@@ -719,7 +720,7 @@ void tftp_start(enum proto_t protocol)
                timeout_ms = 1000;
        }
 
-       ep = getenv("tftptimeoutcountmax");
+       ep = env_get("tftptimeoutcountmax");
        if (ep != NULL)
                tftp_timeout_count_max = simple_strtol(ep, NULL, 10);
 
@@ -741,8 +742,8 @@ void tftp_start(enum proto_t protocol)
                        (net_ip.s_addr >> 16) & 0xFF,
                        (net_ip.s_addr >> 24) & 0xFF);
 
-               strncpy(tftp_filename, default_filename, MAX_LEN);
-               tftp_filename[MAX_LEN - 1] = 0;
+               strncpy(tftp_filename, default_filename, DEFAULT_NAME_LEN);
+               tftp_filename[DEFAULT_NAME_LEN - 1] = 0;
 
                printf("*** Warning: no boot file name; using '%s'\n",
                       tftp_filename);
@@ -804,6 +805,7 @@ void tftp_start(enum proto_t protocol)
                printf("Load address: 0x%lx\n", load_addr);
                puts("Loading: *\b");
                tftp_state = STATE_SEND_RRQ;
+               efi_set_bootdev("Net", "", tftp_filename);
        }
 
        time_start = get_timer(0);
@@ -820,10 +822,10 @@ void tftp_start(enum proto_t protocol)
        tftp_our_port = 1024 + (get_timer(0) % 3072);
 
 #ifdef CONFIG_TFTP_PORT
-       ep = getenv("tftpdstp");
+       ep = env_get("tftpdstp");
        if (ep != NULL)
                tftp_remote_port = simple_strtol(ep, NULL, 10);
-       ep = getenv("tftpsrcp");
+       ep = env_get("tftpsrcp");
        if (ep != NULL)
                tftp_our_port = simple_strtol(ep, NULL, 10);
 #endif