]> git.sur5r.net Git - u-boot/blobdiff - net/tftp.c
mpc83xx: minor fixups for 8313rdb introduction
[u-boot] / net / tftp.c
index a7c246a7de5a2e817826987c35a2de3fa5b5303f..f3a547148386171fe510c930b52e564a348ec89a 100644 (file)
@@ -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