Using the "best available" driver

Pavel Roskin proski at gnu.org
Tue Dec 6 22:30:19 EST 2005


Quoting Jar <jar at pcuf.fi>:

>
> >> echo -n "0.0" > /sys/bus/pcmcia/devices/0.0/driver/unbind
> >> echo -n "0.0" > /sys/bus/pcmcia/drivers/hostap_cs/bind
> >
> > Now that I see those commands even I remember using them in the past.
> > Sorry, I should have remembered that.
>
> Same happens to me also.
>
> >> The same (unbind, bind) is possible for PCI devices.
>
> But can someone explain what this means, does unbind temporarily unloading
> the
> loaded (not wanted) module, that it doesn't show with lsmod? And the bind
> causes a
> new (wanted) module to be laoded?

If I understand correctly, this interface has nothing to do with modules. 
Essentially, the driver is told to shut down that particular device.  This
would work with drivers compiled into the kernel if hotplug support is enabled
in the kernel.

> But can this be done so that only wanted module is loaded once, not first
> unloading
> unwanted one and then loading the correct one?

No.  Moreover, you cannot unbind a driver that has not been bound.  In other
words, the wrong driver must have probed the device before it can be unbound.

> Is the correct syntax for pci as below:
>
> echo -n "0000:02:0a.0" > /sys/bus/pci/devices/0000:02:0a.0/driver unbind
>
> and the load the wanted one
>
> echo -n "0000:02:0a.0" > /sys/bus/pci/drivers/prism2_pci/bind
>
> What would be good place to put these commands (pcmcia/pci)? Is it better to
> run
> them in very eraly or in the last during the boot process?

I actually tend to think that another mechanism is needed to prevent drivers
from probing the devices.  Maybe there should be a kernel option to specify
which devices should or should not be bound to certain drivers.

--
Regards,
Pavel Roskin



More information about the linux-pcmcia mailing list