X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=net%2Ftftp.c;h=f3a547148386171fe510c930b52e564a348ec89a;hb=5c5d3242935cf3543af01142627494434834cf98;hp=a7c246a7de5a2e817826987c35a2de3fa5b5303f;hpb=ecb0ccd9c260701183bc8d35966e65e6a2feb2f6;p=u-boot diff --git a/net/tftp.c b/net/tftp.c index a7c246a7de..f3a5471483 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -58,7 +58,7 @@ static char default_filename[DEFAULT_NAME_LEN]; static char *tftp_filename; #ifdef CFG_DIRECT_FLASH_TFTP -extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; +extern flash_info_t flash_info[]; #endif static __inline__ void @@ -78,7 +78,7 @@ store_block (unsigned block, uchar * src, unsigned len) } if (rc) { /* Flash is destination for this packet */ - rc = flash_write ((uchar *)src, (ulong)(load_addr+offset), len); + rc = flash_write ((char *)src, (ulong)(load_addr+offset), len); if (rc) { flash_perror (rc); NetState = NETLOOP_FAIL; @@ -225,7 +225,7 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len) if (TftpBlock == 0) { TftpBlockWrap++; TftpBlockWrapOffset += TFTP_BLOCK_SIZE * TFTP_SEQUENCE_SIZE; - printf ("\n\t %lu MB reveived\n\t ", TftpBlockWrapOffset>>20); + printf ("\n\t %lu MB received\n\t ", TftpBlockWrapOffset>>20); } else { if (((TftpBlock - 1) % 10) == 0) { putc ('#'); @@ -371,7 +371,10 @@ TftpStart (void) /* Use a pseudo-random port unless a specific port is set */ TftpOurPort = 1024 + (get_timer(0) % 3072); #ifdef CONFIG_TFTP_PORT - if ((ep = getenv("tftpport")) != NULL) { + if ((ep = getenv("tftpdstp")) != NULL) { + TftpServerPort = simple_strtol(ep, NULL, 10); + } + if ((ep = getenv("tftpsrcp")) != NULL) { TftpOurPort= simple_strtol(ep, NULL, 10); } #endif