summaryrefslogtreecommitdiffstats
path: root/net/net.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-11-20 22:46:47 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-12-14 14:29:42 +0100
commitab84733e570b889324f2594685f7f5d33b3c39be (patch)
tree0a75d7c782667cefb892b8a86772875f62a879c9 /net/net.c
parent946bc95a4de8247ea884a3932470344e59618c3a (diff)
downloadbarebox-ab84733e570b889324f2594685f7f5d33b3c39be.tar.gz
barebox-ab84733e570b889324f2594685f7f5d33b3c39be.tar.xz
net: dhcp: Allow to specify network device
Instead of allowing to DHCP only on the "current" network device, allow to specify the desired network device. This is a first step to get rid of the concept of a "current" network device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/net/net.c b/net/net.c
index 6cdffa4b8d..33d6e2c5b0 100644
--- a/net/net.c
+++ b/net/net.c
@@ -261,24 +261,18 @@ void net_set_serverip_empty(IPaddr_t ip)
net_set_serverip(ip);
}
-void net_set_ip(IPaddr_t ip)
+void net_set_ip(struct eth_device *edev, IPaddr_t ip)
{
- struct eth_device *edev = eth_get_current();
-
edev->ipaddr = ip;
}
-IPaddr_t net_get_ip(void)
+IPaddr_t net_get_ip(struct eth_device *edev)
{
- struct eth_device *edev = eth_get_current();
-
return edev->ipaddr;
}
-void net_set_netmask(IPaddr_t nm)
+void net_set_netmask(struct eth_device *edev, IPaddr_t nm)
{
- struct eth_device *edev = eth_get_current();
-
edev->netmask = nm;
}