diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-05-27 11:37:46 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-06-17 08:28:16 +0200 |
commit | 994f95c073caf4df62d1271aef4112ce8aaa8add (patch) | |
tree | c0167dbdedb5c3ebc68f374c3f3df7d0b0b8bfdb /commands | |
parent | c21a7fb9f15ee1fb213e22c0e7a9d0f53b274cb2 (diff) | |
download | barebox-994f95c073caf4df62d1271aef4112ce8aaa8add.tar.gz barebox-994f95c073caf4df62d1271aef4112ce8aaa8add.tar.xz |
net: remove need for eth_halt/eth_open
We used to eth_open/eth_halt the network devices during NetLoopInit
which is called whenever the user enters a network command.
Change this behaviour so that the current network device gets opened
when making it the current one.
With this change it's always possible to send packages and we are able
to implement a new network stack in the next step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/net.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/commands/net.c b/commands/net.c index 815a566a2b..949963ffdc 100644 --- a/commands/net.c +++ b/commands/net.c @@ -39,12 +39,16 @@ void netboot_update_env(void) { struct eth_device *eth_current = eth_get_current(); char tmp[22]; + IPaddr_t net_gateway_ip = NetOurGatewayIP; + IPaddr_t net_ip = NetOurIP; + IPaddr_t net_server_ip = NetServerIP; + IPaddr_t netmask = NetOurSubnetMask; - if (NetOurGatewayIP) - dev_set_param_ip(ð_current->dev, "gateway", NetOurGatewayIP); + if (net_gateway_ip) + dev_set_param_ip(ð_current->dev, "gateway", net_gateway_ip); - if (NetOurSubnetMask) - dev_set_param_ip(ð_current->dev, "netmask", NetOurSubnetMask); + if (netmask) + dev_set_param_ip(ð_current->dev, "netmask", netmask); if (NetOurHostName[0]) @@ -53,11 +57,11 @@ void netboot_update_env(void) if (NetOurRootPath[0]) setenv ("rootpath", NetOurRootPath); - if (NetOurIP) - dev_set_param_ip(ð_current->dev, "ipaddr", NetOurIP); + if (net_ip) + dev_set_param_ip(ð_current->dev, "ipaddr", net_ip); - if (NetServerIP) - dev_set_param_ip(ð_current->dev, "serverip", NetServerIP); + if (net_server_ip) + dev_set_param_ip(ð_current->dev, "serverip", net_server_ip); if (NetOurDNSIP) { ip_to_string (NetOurDNSIP, tmp); |