]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - net/tftp.c
mpc83xx: tqm8349 - remove pci & flash window conflict
[karo-tx-uboot.git] / net / tftp.c
index 3dac3d8531b0580156fc6ec938f8c4eae9257e1f..fb98a346ea6e55fe2fdbcf6d5c0992cc1c56d13b 100644 (file)
@@ -10,8 +10,6 @@
 #include "tftp.h"
 #include "bootp.h"
 
-#undef ET_DEBUG
-
 #if defined(CONFIG_CMD_NET)
 
 #define WELL_KNOWN_PORT        69              /* Well known TFTP port #               */
@@ -196,9 +194,7 @@ TftpSend (void)
                strcpy ((char *)pkt, "timeout");
                pkt += 7 /*strlen("timeout")*/ + 1;
                sprintf((char *)pkt, "%lu", TIMEOUT / 1000);
-#ifdef ET_DEBUG
-               printf("send option \"timeout %s\"\n", (char *)pkt);
-#endif
+               debug("send option \"timeout %s\"\n", (char *)pkt);
                pkt += strlen((char *)pkt) + 1;
                /* try for more effic. blk size */
                pkt += sprintf((char *)pkt,"blksize%c%d%c",
@@ -295,9 +291,9 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
                break;
 
        case TFTP_OACK:
-#ifdef ET_DEBUG
-               printf("Got OACK: %s %s\n", pkt, pkt+strlen(pkt)+1);
-#endif
+               debug("Got OACK: %s %s\n",
+                       pkt,
+                       pkt + strlen((char *)pkt) + 1);
                TftpState = STATE_OACK;
                TftpServerPort = src;
                /*
@@ -309,10 +305,8 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
                        if (strcmp ((char*)pkt+i,"blksize") == 0) {
                                TftpBlkSize = (unsigned short)
                                        simple_strtoul((char*)pkt+i+8,NULL,10);
-#ifdef ET_DEBUG
-                               printf ("Blocksize ack: %s, %d\n",
+                               debug("Blocksize ack: %s, %d\n",
                                        (char*)pkt+i+8,TftpBlkSize);
-#endif
                                break;
                        }
                }
@@ -348,11 +342,8 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
                        }
                }
 
-#ifdef ET_DEBUG
-               if (TftpState == STATE_RRQ) {
-                       puts ("Server did not acknowledge timeout option!\n");
-               }
-#endif
+               if (TftpState == STATE_RRQ)
+                       debug("Server did not acknowledge timeout option!\n");
 
                if (TftpState == STATE_RRQ || TftpState == STATE_OACK) {
                        /* first block received */
@@ -508,18 +499,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');