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

Dominik Brodowski linux at dominikbrodowski.net
Wed Dec 7 16:37:21 EST 2005


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?

Thanks,
	Dominik



More information about the linux-pcmcia mailing list