]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - net/net.c
net: drop !NET_MULTI code
[people/ms/u-boot.git] / net / net.c
index 7a93542122cb14be38c276e3d4a23d8cc1d8b91a..5e67886b6806d98b7fc000ae8c996d6dfe2003cd 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -169,14 +169,12 @@ uchar             NetCDPAddr[6] = { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
 #endif
 /* Network loop state */
 int            NetState;
-#ifdef CONFIG_NET_MULTI
 /* Tried all network devices */
 int            NetRestartWrap;
 /* Network loop restarted */
 static int     NetRestarted;
 /* At least one device configured */
 static int     NetDevExists;
-#endif
 
 /* XXX in both little & big endian machines 0xFFFF == ntohs(-1) */
 /* default is without VLAN */
@@ -321,7 +319,8 @@ NetInitLoop(proto_t protocol)
 
        /* update only when the environment has changed */
        if (env_changed_id != env_id) {
-               NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
+               NetOurIP = getenv_IPaddr("ipaddr");
+               NetCopyIP(&bd->bi_ip_addr, &NetOurIP);
                NetOurGatewayIP = getenv_IPaddr("gatewayip");
                NetOurSubnetMask = getenv_IPaddr("netmask");
                NetServerIP = getenv_IPaddr("serverip");
@@ -346,10 +345,8 @@ NetLoop(proto_t protocol)
 {
        bd_t *bd = gd->bd;
 
-#ifdef CONFIG_NET_MULTI
        NetRestarted = 0;
        NetDevExists = 0;
-#endif
 
        /* XXX problem with bss workaround */
        NetArpWaitPacketMAC = NULL;
@@ -378,20 +375,14 @@ NetLoop(proto_t protocol)
        }
 
        eth_halt();
-#ifdef CONFIG_NET_MULTI
        eth_set_current();
-#endif
        if (eth_init(bd) < 0) {
                eth_halt();
                return -1;
        }
 
 restart:
-#ifdef CONFIG_NET_MULTI
        memcpy(NetOurEther, eth_get_dev()->enetaddr, 6);
-#else
-       eth_getenv_enetaddr("ethaddr", NetOurEther);
-#endif
 
        NetState = NETLOOP_CONTINUE;
 
@@ -408,16 +399,12 @@ restart:
                eth_halt();
                return -1;
 
-#ifdef CONFIG_NET_MULTI
        case 2:
                /* network device not configured */
                break;
-#endif /* CONFIG_NET_MULTI */
 
        case 0:
-#ifdef CONFIG_NET_MULTI
                NetDevExists = 1;
-#endif
                switch (protocol) {
                case TFTP:
                        /* always use ARP to get server ethernet address */
@@ -561,9 +548,7 @@ restart:
                switch (NetState) {
 
                case NETLOOP_RESTART:
-#ifdef CONFIG_NET_MULTI
                        NetRestarted = 1;
-#endif
                        goto restart;
 
                case NETLOOP_SUCCESS:
@@ -629,10 +614,6 @@ void NetStartAgain(void)
 
        NetTryCount++;
 
-#ifndef CONFIG_NET_MULTI
-       NetSetTimeout(10000UL, startAgainTimeout);
-       NetSetHandler(startAgainHandler);
-#else  /* !CONFIG_NET_MULTI*/
        eth_halt();
 #if !defined(CONFIG_NET_DO_NOT_TRY_ANOTHER)
        eth_try_another(!NetRestarted);
@@ -649,7 +630,6 @@ void NetStartAgain(void)
        } else {
                NetState = NETLOOP_RESTART;
        }
-#endif /* CONFIG_NET_MULTI */
 }
 
 /**********************************************************************/
@@ -815,9 +795,7 @@ PingHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
 
 static void PingStart(void)
 {
-#if defined(CONFIG_NET_MULTI)
        printf("Using %s device\n", eth_get_name());
-#endif /* CONFIG_NET_MULTI */
        NetSetTimeout(10000UL, PingTimeout);
        NetSetHandler(PingHandler);
 
@@ -1167,9 +1145,7 @@ CDPHandler(const uchar *pkt, unsigned len)
 
 static void CDPStart(void)
 {
-#if defined(CONFIG_NET_MULTI)
        printf("Using %s device\n", eth_get_name());
-#endif
        CDPSeq = 0;
        CDPOK = 0;
 
@@ -1809,7 +1785,6 @@ common:
        case CDP:
        case DHCP:
                if (memcmp(NetOurEther, "\0\0\0\0\0\0", 6) == 0) {
-#ifdef CONFIG_NET_MULTI
                        extern int eth_get_dev_index(void);
                        int num = eth_get_dev_index();
 
@@ -1828,10 +1803,6 @@ common:
 
                        NetStartAgain();
                        return 2;
-#else
-                       puts("*** ERROR: `ethaddr' not set\n");
-                       return 1;
-#endif
                }
                /* Fall through */
        default: