Use linker functions for NIC and medium pre-init
[akaros.git] / kern / src / net / dhcp.c
index 639e51b..c8402cd 100644 (file)
@@ -230,7 +230,7 @@ rcvbootp(void *a)
                        if(dhcpmsgtype < dhcp){
                                dhcpmsgtype=dhcp;
                                recv = 1;
-                               wakeup(&bootpr);
+                               rendez_wakeup(&bootpr);
                                if(dhcp==0 || dhcp ==5 || dhcp == 6 )
                                        break;
                        }
@@ -289,7 +289,7 @@ rbootp(Ipifc *ifc)
 /* DHCPDISCOVER*/
                done = 0;
                recv = 0;
-               kproc("rcvbootp", rcvbootp, (void*)dfd, KPDUPFDG);
+               ktask("rcvbootp", rcvbootp, (void *)dfd);
                /* Prepare DHCPDISCOVER */      
                memset(&req, 0, sizeof(req));
                ipmove(req.raddr, IPv4bcast);
@@ -315,7 +315,7 @@ rbootp(Ipifc *ifc)
                        if(kwrite(dfd, &req, sizeof(req))<0)    /* SEND DHCPDISCOVER */
                                print("DHCPDISCOVER: %r");
                
-                       tsleep(&bootpr, return0, 0, 1000);      /* wait DHCPOFFER */
+                       udelay_sched(1000 * 1000);      /* wait DHCPOFFER */
                        if(debug)
                                print("[DHCP] DISCOVER: msgtype = %d\n", dhcpmsgtype);
 
@@ -360,7 +360,7 @@ rbootp(Ipifc *ifc)
                        print("DHCPREQUEST: %r");
                        continue;
                }
-               tsleep(&bootpr, return0, 0, 2000);
+               udelay_sched(2000 * 1000);
                if(dhcpmsgtype==5)              /* wait for DHCPACK */
                        break;
                else
@@ -420,7 +420,7 @@ rbootpread(char *bp, ulong offset, int len)
        n += snprint(buf + n, READSTR-n, "ipmask %15V\n", a);
        hnputl(a, ipaddr);
        n += snprint(buf + n, READSTR-n, "ipaddr %15V\n", a);
-       n += snprint(buf+n, READSTR-n, "expired %lud\n", iplease);
+       n += snprint(buf+n, READSTR-n, "expired %lu\n", iplease);
 
        n += snprint(buf + n, READSTR-n, "dns");
        if(dns2ip){