]> Zhao Yanbai Git Server - minix.git/commitdiff
Use ds_retrieve_u32 to get the endpoint of inet.
authorPhilip Homburg <philip@cs.vu.nl>
Wed, 2 May 2007 11:39:10 +0000 (11:39 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Wed, 2 May 2007 11:39:10 +0000 (11:39 +0000)
drivers/fxp/fxp.c

index 860fda82cea228e185a45dc33d590ed5216d2a49..437e39ce4654f400caf818b18019134cba8c5a42 100644 (file)
@@ -59,6 +59,7 @@
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
 #include <ibm/pci.h>
+#include <minix/ds.h>
 
 #include <timers.h>
 
@@ -211,7 +212,6 @@ fxp_t;
 
 static fxp_t fxp_table[FXP_PORT_NR];
 
-static int fxp_tasknr= ANY;
 static u16_t eth_ign_proto;
 static tmra_ut fxp_watchdog;
 static char *progname;
@@ -274,13 +274,11 @@ _PROTOTYPE( static void do_outl, (port_t port, u32_t v)                   );
 int main(int argc, char *argv[])
 {
        message m;
-       int i, r, tasknr;
+       int i, r;
+       u32_t tasknr;
        fxp_t *fp;
        long v;
 
-       if ((fxp_tasknr= getprocnr())<0)
-               panic("FXP", "couldn't get proc nr", errno);
-
        if (argc < 1)
                panic("FXP", "A head which at this time has no name", NO_NUM);
        (progname=strrchr(argv[0],'/')) ? progname++ : (progname=argv[0]);
@@ -298,9 +296,12 @@ int main(int argc, char *argv[])
 #endif
 
        /* Try to notify inet that we are present (again) */
-       r = _pm_findproc("inet", &tasknr);
+       r= ds_retrieve_u32("inet", &tasknr);
        if (r == OK)
                notify(tasknr);
+       else if (r != ESRCH)
+               printf("fxp: ds_retrieve_u32 failed for 'inet': %d\n", r);
+
 
        while (TRUE)
        {
@@ -329,7 +330,10 @@ int main(int argc, char *argv[])
 
                                r= sys_irqenable(&fp->fxp_hook);
                                if (r != OK)
-                                       panic("FXP","unable enable interrupts", r);
+                               {
+                                       panic("FXP",
+                                               "unable enable interrupts", r);
+                               }
 
                                if (!fp->fxp_got_int)
                                        continue;