]> git.sur5r.net Git - u-boot/blobdiff - net/tftp.c
versatile: specify the board type on the prompt
[u-boot] / net / tftp.c
index f7cc1116e2111291614769cafd1794879be2fe59..b0f1cca0b6baebf184bfc3b3597a2ae44a3102c5 100644 (file)
@@ -79,7 +79,7 @@ static char default_filename[DEFAULT_NAME_LEN];
 
 static char tftp_filename[MAX_LEN];
 
-#ifdef CFG_DIRECT_FLASH_TFTP
+#ifdef CONFIG_SYS_DIRECT_FLASH_TFTP
 extern flash_info_t flash_info[];
 #endif
 
@@ -121,10 +121,10 @@ store_block (unsigned block, uchar * src, unsigned len)
 {
        ulong offset = block * TftpBlkSize + TftpBlockWrapOffset;
        ulong newsize = offset + len;
-#ifdef CFG_DIRECT_FLASH_TFTP
+#ifdef CONFIG_SYS_DIRECT_FLASH_TFTP
        int i, rc = 0;
 
-       for (i=0; i<CFG_MAX_FLASH_BANKS; i++) {
+       for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; i++) {
                /* start address in flash? */
                if (flash_info[i].flash_id == FLASH_UNKNOWN)
                        continue;
@@ -143,7 +143,7 @@ store_block (unsigned block, uchar * src, unsigned len)
                }
        }
        else
-#endif /* CFG_DIRECT_FLASH_TFTP */
+#endif /* CONFIG_SYS_DIRECT_FLASH_TFTP */
        {
                (void)memcpy((void *)(load_addr + offset), src, len);
        }
@@ -499,9 +499,8 @@ TftpStart (void)
                        strncpy(tftp_filename, BootFile, MAX_LEN);
                        tftp_filename[MAX_LEN-1] = 0;
                } else {
-                       *p++ = '\0';
                        TftpServerIP = string_to_ip (BootFile);
-                       strncpy(tftp_filename, p, MAX_LEN);
+                       strncpy(tftp_filename, p + 1, MAX_LEN);
                        tftp_filename[MAX_LEN-1] = 0;
                }
        }
@@ -509,18 +508,16 @@ TftpStart (void)
 #if defined(CONFIG_NET_MULTI)
        printf ("Using %s device\n", eth_get_name());
 #endif
-       puts ("TFTP from server ");     print_IPaddr (TftpServerIP);
-       puts ("; our IP address is ");  print_IPaddr (NetOurIP);
+       printf("TFTP from server %pI4"
+               "; our IP address is %pI4", &TftpServerIP, &NetOurIP);
 
        /* Check if we need to send across this subnet */
        if (NetOurGatewayIP && NetOurSubnetMask) {
            IPaddr_t OurNet     = NetOurIP    & NetOurSubnetMask;
            IPaddr_t ServerNet  = TftpServerIP & NetOurSubnetMask;
 
-           if (OurNet != ServerNet) {
-               puts ("; sending through gateway ");
-               print_IPaddr (NetOurGatewayIP) ;
-           }
+           if (OurNet != ServerNet)
+               printf("; sending through gateway %pI4", &NetOurGatewayIP);
        }
        putc ('\n');