Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] detaching devices in kernel

252 views
Skip to first unread message

andrey mirtchovski

unread,
Oct 4, 2002, 11:54:58 AM10/4/02
to
hi,

a 9p file server can be detached by clunk-ing the connection,
however there doesn't seem to be a way one can detach a kernel-
level driver?

there's devattach, devopen, devclose, etc, but the only thing
reminiscent of 'devdetach' is 'devremove', which of course is
different...

there is detach code in the bitsy kernel for the wavelan ethernet,
but nothing in /sys/src/9/pc...

do i assume that once bound a device cannot be 'unbound'? if
devremove the answer?

andrey

Russ Cox

unread,
Oct 4, 2002, 12:09:24 PM10/4/02
to
you can remove a device from your namespace
using unmount, but in most (all?) cases, that doesn't
make the device stop talking to the underlying hardware or
whatever it does.

the devices typically are initialized before you
bind them into the namespace, so it makes a little sense
that they don't get torn down just because you don't
have them in your namespace anymore.

pres...@plan9.bell-labs.com

unread,
Oct 4, 2002, 2:34:30 PM10/4/02
to
Once the device is notices, it's there forever. The exception is
the bitsy were we've started putting in stuff to take out pccards.
We need to move that work everywhere, just haven't gotten around
to it.

Ronald G Minnich

unread,
Oct 4, 2002, 2:39:19 PM10/4/02
to

thanks for the clarification.

What would be the process by which a device is removed. A new function in
the interface (detach?) or some sequence of existing functions?

ron

pres...@plan9.bell-labs.com

unread,
Oct 4, 2002, 2:48:31 PM10/4/02
to
It would be a control message to the appropriate device that in turn
calls the devtab[whatever]->config routine. The first argument is
0 or 1, meaning unconfigure or configure. Look at etherconfig in
bitsy/devether.c. Its already in devtab, but noone uses it except
bitsy/devpcmcia.c. I was going to make it a bit more universal but
it was just at the time pb was doing the pccard interface for the
pc and I got deflected. I'ld like the pcmcia/pccard interface on the
pc's to work the same way as the one in the bitsy. Maybe in my next
lifetime or maybe someone out there will decide its a good idea and
find the time.
0 new messages