add some additional error checks
This commit is contained in:
parent
f76f4ac70d
commit
8c9504a87f
1 changed files with 8 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue