diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-11-20 22:46:47 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-12-14 14:29:42 +0100 |
commit | ab84733e570b889324f2594685f7f5d33b3c39be (patch) | |
tree | 0a75d7c782667cefb892b8a86772875f62a879c9 /arch/arm/mach-omap/xload.c | |
parent | 946bc95a4de8247ea884a3932470344e59618c3a (diff) | |
download | barebox-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 'arch/arm/mach-omap/xload.c')
-rw-r--r-- | arch/arm/mach-omap/xload.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c index 822389c38c..e83784ba4d 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -235,12 +235,20 @@ static void *am33xx_net_boot(void) IPaddr_t ip; char *file; char ip4_str[sizeof("255.255.255.255")]; + struct eth_device *edev; am33xx_register_ethaddr(0, 0); memset(&dhcp_param, 0, sizeof(struct dhcp_req_param)); dhcp_param.vendor_id = "am335x barebox-mlo"; - err = dhcp(20, &dhcp_param); + + edev = eth_get_byname("eth0"); + if (!edev) { + printf("eth0 not found\n"); + return NULL; + } + + err = dhcp(edev, 20, &dhcp_param); if (err) { printf("dhcp failed\n"); return NULL; |