bind and unbind from userspace

Dominik Brodowski linux at dominikbrodowski.net
Sat Sep 17 05:10:03 EDT 2005


Hi,

On Sat, Sep 17, 2005 at 01:49:00AM -0400, Pavel Roskin wrote:
> Suppose there are two drivers capable of supporting the same device
> (real life example: orinoco_cs and hostap_cs).  Suppose they are linked
> into the kernel, which assumes that the generic pcmcia code is linked
> too.  Suppose we have a user who wants to chose between two drivers.
> 
> I believe the right way to switch the driver would be:
> 
> echo 1 > /sys/bus/pcmcia/devices/0.0/driver/unbind
> echo 1 > /sys/bus/pcmcia/drivers/hostap_cs/bind

Actually, the interface is a bit different: to switch the driver for the
PCMCIA device "0.0" you need to do

echo -n "0.0" > /sys/bus/pcmcia/devices/0.0/driver/unbind
echo -n "0.0" > /sys/bus/pcmcia/drivers/hostap_cs/bind

as you need to tell which device to unbind from and which device to bind to.

> The first command (unbind) is not working right now.  There are no error
> messages in the kernel log.  sysfs still indicated that orinoco_cs is
> bound.  Before I start debugging the kernel, I'd like to know if this
> behavior is intentional by any chance.
> 
> I'm using up-to-date kernel from git.

Just tested the behaviour with the PCMCIA changes in -mm (and with only one
driver, as I only have one working PCMCIA card, which is a pcnet_cs one...),
and it seems to work just fine. If this is also working correctly with
Linus' latest, I do not know, though.

	Dominik



More information about the linux-pcmcia mailing list