summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-04-24 13:36:08 +0200
committerWolfgang Denk <wd@denx.de>2009-04-24 13:36:08 +0200
commit4277f4de065b4daea4dc27420fc1bc131701291d (patch)
tree3b5e0b3b464b4772f93070e96a642ff0741bf1a4
parentfaa5a0c6fc5609acb4037a5eae79f7a47de4c6ee (diff)
parent3c172c4fdbbb5858fae38478d6399be4a16be3fc (diff)
Merge branch 'master' of git://git.denx.de/u-boot-net
-rw-r--r--include/netdev.h2
-rw-r--r--net/net.c63
2 files changed, 5 insertions, 60 deletions
diff --git a/include/netdev.h b/include/netdev.h
index 2794ddd578..63cf730a30 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -108,7 +108,7 @@ static inline int pci_eth_init(bd_t *bis)
#if defined(CONFIG_RTL8169)
num += rtl8169_initialize(bis);
#endif
-#if defined(CONFIG_ULI526)
+#if defined(CONFIG_ULI526X)
num += uli526x_initialize(bis);
#endif
diff --git a/net/net.c b/net/net.c
index a89f6a00e2..b8648bd95a 100644
--- a/net/net.c
+++ b/net/net.c
@@ -285,68 +285,16 @@ NetInitLoop(proto_t protocol)
int env_id = get_env_id ();
/* update only when the environment has changed */
- if (env_changed_id == env_id)
- return 0;
-
- switch (protocol) {
-#if defined(CONFIG_CMD_NFS)
- case NFS:
-#endif
-#if defined(CONFIG_CMD_PING)
- case PING:
-#endif
-#if defined(CONFIG_CMD_SNTP)
- case SNTP:
-#endif
- case NETCONS:
- case TFTP:
+ if (env_changed_id != env_id) {
NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
NetOurGatewayIP = getenv_IPaddr ("gatewayip");
NetOurSubnetMask= getenv_IPaddr ("netmask");
- NetOurVLAN = getenv_VLAN("vlan");
- NetOurNativeVLAN = getenv_VLAN("nvlan");
-
- switch (protocol) {
-#if defined(CONFIG_CMD_NFS)
- case NFS:
-#endif
- case NETCONS:
- case TFTP:
- NetServerIP = getenv_IPaddr ("serverip");
- break;
-#if defined(CONFIG_CMD_PING)
- case PING:
- /* nothing */
- break;
-#endif
-#if defined(CONFIG_CMD_SNTP)
- case SNTP:
- /* nothing */
- break;
-#endif
- default:
- break;
- }
-
- break;
- case BOOTP:
- case RARP:
- /*
- * initialize our IP addr to 0 in order to accept ANY
- * IP addr assigned to us by the BOOTP / RARP server
- */
- NetOurIP = 0;
NetServerIP = getenv_IPaddr ("serverip");
- NetOurVLAN = getenv_VLAN("vlan"); /* VLANs must be read */
- NetOurNativeVLAN = getenv_VLAN("nvlan");
- case CDP:
- NetOurVLAN = getenv_VLAN("vlan"); /* VLANs must be read */
NetOurNativeVLAN = getenv_VLAN("nvlan");
- break;
- default:
- break;
+ NetOurVLAN = getenv_VLAN("vlan");
+ env_changed_id = env_id;
}
- env_changed_id = env_id;
+
return 0;
}
@@ -440,10 +388,7 @@ restart:
#if defined(CONFIG_CMD_DHCP)
case DHCP:
- /* Start with a clean slate... */
BootpTry = 0;
- NetOurIP = 0;
- NetServerIP = getenv_IPaddr ("serverip");
DhcpRequest(); /* Basically same as BOOTP */
break;
#endif