From: Ben Gras Date: Fri, 21 Oct 2005 18:20:44 +0000 (+0000) Subject: Make lance driver notify inet on startup, and respond to getname X-Git-Tag: v3.1.2a~556 X-Git-Url: http://zhaoyanbai.com/repos/rndc.conf.html?a=commitdiff_plain;h=d0806fd1af30062aad99fe1f8c24575d643662cf;p=minix.git Make lance driver notify inet on startup, and respond to getname --- diff --git a/drivers/lance/lance.c b/drivers/lance/lance.c index ec483f6e1..da174fe08 100644 --- a/drivers/lance/lance.c +++ b/drivers/lance/lance.c @@ -166,6 +166,7 @@ _PROTOTYPE( static void put_userdata, vir_bytes user_addr, vir_bytes count, void *loc_addr) ); _PROTOTYPE( static void do_stop, (message *mp) ); +_PROTOTYPE( static void do_getname, (message *mp) ); _PROTOTYPE( static void lance_dump, (void) ); _PROTOTYPE( static void lance_stop, (void) ); @@ -296,6 +297,7 @@ static int rx_slot_nr = 0; /* Rx-slot number */ static int tx_slot_nr = 0; /* Tx-slot number */ static int cur_tx_slot_nr = 0; /* Tx-slot number */ static char isstored[TX_RING_SIZE]; /* Tx-slot in-use */ +static char *progname; /*===========================================================================* @@ -304,10 +306,11 @@ static char isstored[TX_RING_SIZE]; /* Tx-slot in-use */ void main( int argc, char **argv ) { message m; - int i,irq,r; + int i,irq,r, tasknr; ether_card_t *ec; long v; int fkeys, sfkeys; + (progname=strrchr(argv[0],'/')) ? progname++ : (progname=argv[0]); env_setargs( argc, argv ); @@ -323,6 +326,11 @@ void main( int argc, char **argv ) (void) env_parse("ETH_IGN_PROTO", "x", 0, &v, 0x0000L, 0xFFFFL); eth_ign_proto= htons((u16_t) v); + /* Try to notify inet that we are present (again) */ + r = findproc("inet", &tasknr); + if (r == OK) + notify(tasknr); + while (TRUE) { for (i=0;iDL_NAME, progname, sizeof(mp->DL_NAME)); + mp->DL_NAME[sizeof(mp->DL_NAME)-1]= '\0'; + mp->m_type= DL_NAME_REPLY; + r= send(mp->m_source, mp); + if (r != OK) + panic("LANCE", "do_getname: send failed", r); +} /*===========================================================================* * lance_init_card *