summaryrefslogtreecommitdiffstats
path: root/src/usr/dhcpmgmt.c
diff options
context:
space:
mode:
authorMichael Brown2013-11-01 18:38:45 +0100
committerMichael Brown2013-11-05 18:15:24 +0100
commit16d37102cae2cad9842462cca473d8a3962629fb (patch)
tree29d7a92917218755c432eb58b76190d1fef40576 /src/usr/dhcpmgmt.c
parent[autoboot] Fix shell banner timeout (diff)
downloadipxe-16d37102cae2cad9842462cca473d8a3962629fb.tar.gz
ipxe-16d37102cae2cad9842462cca473d8a3962629fb.tar.xz
ipxe-16d37102cae2cad9842462cca473d8a3962629fb.zip
[ifmgmt] Rewrite iflinkwait() to use monojob_wait()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr/dhcpmgmt.c')
-rw-r--r--src/usr/dhcpmgmt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/usr/dhcpmgmt.c b/src/usr/dhcpmgmt.c
index 7b8e5370..9309671e 100644
--- a/src/usr/dhcpmgmt.c
+++ b/src/usr/dhcpmgmt.c
@@ -25,11 +25,12 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/netdevice.h>
#include <ipxe/dhcp.h>
#include <ipxe/monojob.h>
-#include <ipxe/process.h>
+#include <ipxe/timer.h>
#include <usr/ifmgmt.h>
#include <usr/dhcpmgmt.h>
-#define LINK_WAIT_MS 15000
+/** Default time to wait for link-up */
+#define LINK_WAIT_TIMEOUT ( 15 * TICKS_PER_SEC )
/** @file
*
@@ -45,7 +46,7 @@ int dhcp ( struct net_device *netdev ) {
return rc;
/* Wait for link-up */
- if ( ( rc = iflinkwait ( netdev, LINK_WAIT_MS ) ) != 0 )
+ if ( ( rc = iflinkwait ( netdev, LINK_WAIT_TIMEOUT ) ) != 0 )
return rc;
/* Perform DHCP */