#include <log.h>
#include <mapmem.h>
#include <net.h>
+#include <asm/global_data.h>
#include <net/tftp.h>
#include "bootp.h"
#ifdef CONFIG_SYS_DIRECT_FLASH_TFTP
time_start * 1000, "/s");
}
puts("\ndone\n");
+ if (IS_ENABLED(CONFIG_CMD_BOOTEFI)) {
+ if (!tftp_put_active)
+ efi_set_bootdev("Net", "", tftp_filename,
+ map_sysmem(tftp_load_addr, 0),
+ net_boot_file_size);
+ }
net_set_state(NETLOOP_SUCCESS);
}
tftp_cur_block++;
tftp_cur_block %= TFTP_SEQUENCE_SIZE;
- if (tftp_state == STATE_SEND_RRQ)
+ if (tftp_state == STATE_SEND_RRQ) {
debug("Server did not acknowledge any options!\n");
+ tftp_next_ack = tftp_windowsize;
+ }
if (tftp_state == STATE_SEND_RRQ || tftp_state == STATE_OACK ||
tftp_state == STATE_RECV_WRQ) {
break;
}
+ if (len < tftp_block_size) {
+ tftp_send();
+ tftp_complete();
+ break;
+ }
+
/*
* Acknowledge the block just received, which will prompt
* the remote for the next one.
tftp_send();
tftp_next_ack += tftp_windowsize;
}
-
- if (len < tftp_block_size) {
- tftp_send();
- tftp_complete();
- }
break;
case TFTP_ERROR:
printf("Load address: 0x%lx\n", tftp_load_addr);
puts("Loading: *\b");
tftp_state = STATE_SEND_RRQ;
-#ifdef CONFIG_CMD_BOOTEFI
- efi_set_bootdev("Net", "", tftp_filename);
-#endif
}
time_start = get_timer(0);