From: Philip Homburg Date: Wed, 2 May 2007 11:39:10 +0000 (+0000) Subject: Use ds_retrieve_u32 to get the endpoint of inet. X-Git-Tag: v3.1.4~384 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doxygen.log?a=commitdiff_plain;h=2d49b4ecb5cd458e4625febe0136383c047a6b79;p=minix.git Use ds_retrieve_u32 to get the endpoint of inet. --- diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 860fda82c..437e39ce4 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -59,6 +59,7 @@ #include #include #include +#include #include @@ -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;