[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pcmcia and buses
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: pcmcia and buses
- From: Jim Rees <rees_(_at_)_umich_(_dot_)_edu>
- Date: Thu, 11 Dec 1997 11:25:33 -0500
I'm trying to get pcmcia to work and need some architectural advice. I
really don't understand how buses work.
The problem is that if you turn off a device, then try to turn it back on,
the machine either panics (ep) or refuses to use the device (pccom). This
is because pcmcia_configure calls the bus probe routine at power on
(actually at probe time), but the device has already been probed once. The
ep driver sees that the bus space has already been mapped and panics in the
attach routine. The pccom device just refuses to proceed (I don't know why
pcmcia_unconfigure never actually detaches the device. There is a comment
in the code that says this is too hard given the complexity of the network
code. But then it goes ahead and tries to re-attach it anyway.
I see two ways of attacking this. The "architecturally pure" way would be
to make detach work. But as a lazy programmer (and by the way laziness is a
virtue in programmers) I'm tempted to never detach, and avoid the attach
when turning on a device that has already been attached once.
Is there any reason to prefer one or the other of these methods? I only
care about ep and pccom, but in general do probe and attach routines do any
kind of essential initialization that the open routine wouldn't? Is it
offensive to leave devices "attached" that aren't even plugged in?
Actually the best thing would be to import J.T. Kohl's latest code, but I'm
way too lazy for that.
Visit your host, monkey.org