ARM: dts: rk3399-evb: usb3.0 host support
[oweals/u-boot.git] / net / tftp.c
index 02401898c5566c089c8d35158c848c7e8e3275e3..180140e495b15482f9ac2c0fef87a0b87f6cf8da 100644 (file)
@@ -11,6 +11,8 @@
 #include <efi_loader.h>
 #include <env.h>
 #include <image.h>
+#include <lmb.h>
+#include <log.h>
 #include <mapmem.h>
 #include <net.h>
 #include <net/tftp.h>
@@ -133,14 +135,9 @@ static char tftp_filename[MAX_LEN];
  * almost-MTU block sizes.  At least try... fall back to 512 if need be.
  * (but those using CONFIG_IP_DEFRAG may want to set a larger block in cfg file)
  */
-#ifdef CONFIG_TFTP_BLOCKSIZE
-#define TFTP_MTU_BLOCKSIZE CONFIG_TFTP_BLOCKSIZE
-#else
-#define TFTP_MTU_BLOCKSIZE 1468
-#endif
 
 static unsigned short tftp_block_size = TFTP_BLOCK_SIZE;
-static unsigned short tftp_block_size_option = TFTP_MTU_BLOCKSIZE;
+static unsigned short tftp_block_size_option = CONFIG_TFTP_BLOCKSIZE;
 
 static inline int store_block(int block, uchar *src, unsigned int len)
 {
@@ -223,7 +220,7 @@ static int load_block(unsigned block, uchar *dst, unsigned len)
 
        tosend = min(net_boot_file_size - offset, tosend);
        (void)memcpy(dst, (void *)(image_save_addr + offset), tosend);
-       debug("%s: block=%d, offset=%ld, len=%d, tosend=%ld\n", __func__,
+       debug("%s: block=%u, offset=%lu, len=%u, tosend=%lu\n", __func__,
              block, offset, len, tosend);
        return tosend;
 }