add some additional error checks

This commit is contained in:
Stefan Lankes 2011-07-30 17:40:09 +02:00
parent f76f4ac70d
commit 8c9504a87f

View file

@ -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();