grey- and blacklisting drivers [Was: Re: Using the "best available" driver]

Greg KH greg at kroah.com
Wed Dec 7 20:23:32 EST 2005


On Wed, Dec 07, 2005 at 10:37:21PM +0100, Dominik Brodowski wrote:
> Hi,
> 
> For various reasons, it might be necessary to switch to a better driver for
> a device -- Jean can tell of many examples, if needed. Currently, that's
> possible using modprobe's blacklisting capability (in
> module-init-tools-3.2.1, at least) -- but that's for monolithic kernels
> only. While a blacklisting feature might also come useful in the kernel 
> driver core level, udev may offer the chance to fix some broken "bindings"
> if there's need to. We'd need a simple shell script like
> 
> #/bin/bash
> #
> # needs 4 arguments: devpath bus wrong_driver right_driver
> #
> $drivername = basename $(readlink /sys/$1/driver)
> $device = basename $1
> $bus = $2
> $wrong_driver = $3
> $right_driver = $4
> 
> if [ $drivername == $wrong_driver ]; then
> 	echo -n "$device" > /sys/$devpath/driver/unbind
> 	echo -n "$device" > /sys/bus/$2/$right_driver/driver/bind
> fi;
> 
> 
> Then adding udev rules like
> 
> ACTION=="add", BUS=="pci", RUN+="/bin/sh -c /sbin/check_blacklist $devpath $bus hostap_pci orinoco_pci'"
> 
> is very easy, and such rules could even be generated by yet another tool
> which then echos into all relevant "uevent" files to run this script..
> 
> 
> Or is all this already implemented? But differently? Should it be done at
> the kernel driver core level?

So what is the main problem you are trying to fix here?  Drivers binding
to devices that they should not bind to?  Why are they binding to these
devices in the first place?  Would something like the libusual code in
-mm work better for this instead?

thanks,

greg k-h



More information about the linux-pcmcia mailing list