diff --git a/kernel/init.c b/kernel/init.c index 97cab706..d9824ef8 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -99,12 +99,18 @@ int STDCALL network_task(void* arg) if (!netif_add(&netif, &ipaddr, &netmask, &gw, NULL, rtl8139if_init, ethernet_input)) { #endif kputs("Unable to add network interface\n"); - return -ENXIO; + return -ENODEV; } netif_set_default(&netif); netif_set_up(&netif); + /* test if interface is really up */ + if (!netif_is_up(&netif)) { + kputs("network interface is not up\n"); + return -ENODEV; + } + #ifndef CONFIG_ROCKCREEK kprintf("Starting DHCPCD...\n"); dhcp_start(&netif); @@ -112,7 +118,7 @@ int STDCALL network_task(void* arg) /* wait for ip address */ while(!netif.ip_addr.addr) { rtl8139if_wait(&netif, 1); - udelay(500000); + reschedule(); } #else mmnif_open();