Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Apr 2005 22:45:59 +0400
From:      Vladimir Grebenschikov <vova@fbsd.ru>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        current@freebsd.org
Subject:   Re: devd + driver load by plugged device class how to ?
Message-ID:  <1113763560.1005.9.camel@localhost>
In-Reply-To: <20050417.111015.77928634.imp@bsdimp.com>
References:  <1113740156.1018.6.camel@localhost> <20050417.111015.77928634.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
=F7 =D7=D3, 17/04/2005 =D7 11:10 -0600, M. Warner Losh =D0=C9=DB=C5=D4:
> In message: <1113740156.1018.6.camel@localhost>
>             Vladimir Grebenschikov <vova@fbsd.ru> writes:
> : Is there way to configure devd (or other daemon) to load appropriate
> : driver by class, when device detected on bus, like:
>=20
> Yes.  That's what nomatch events are for.  The default devd.conf
> momatch entries in it.
>=20
> : load ukbd.ko when USB keyboard plugged (same for other USB ums, ulpt,
> : umass, etc)
>=20
> usb doesn't support reprobing correctly yet, so this isn't possible
> until it does.
>=20
> : load atacard.ko, when ATA disk inserted into PCMCI slot
>=20
> nomatch 10 {
> 	match "bus" "pccard[0-9]+];
> 	match "function_type" "4";
> 	action "kldload atacard";
> }
>=20
> : load if_wi.ko when WLan card inserted into PCMCI slot=20
>=20
> This device supports a large number of devices, so the list is rather
> long...

Oops, looks like there is some bugs here:

# cat /etc/devd/atacard.conf
nomatch 10 {
        match "bus" "pccard[0-9]+";
        match "function_type" "4";
        action "kldload atacard";
};
# cat /etc/devd/wi0.conf
nomatch 10 {
        match "bus" "pccard[0-9]+";
        match "manufacturer" "0x0156";=20
        action "kldload if_wi";
};
# grep -C1 \$pnpinfo /etc/devd.conf
nomatch 0 {
        action "logger Unknown device: pnp=3D$pnpinfo loc=3D$location bus=
=3D$bus manufacturer=3D$manufacturer product=3D$product";
};
# devd -dD
Parsing /etc/devd.conf
ethernet-nic-regex=3D(an|ar|ath|aue|awi|axe|bfe|bge|cm|cnw|cs|cue|dc|de|ed|=
el|em|ep|ex|fe|fxp|gem|hme|ie|kue|lge|lnc|my|nge|pcn|ray|re|rl|rue|sf|sis|s=
k|sn|snc|ste|ti|tl|tx|txp|udav|vge|vr|vx|wb|wi|xe|xl)[0-9]+
scsi-controller-regex=3D(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|cis=
s|ct|dpt|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)[0-9]+
Parsing files in /etc/devd
Parsing /etc/devd/wi0.conf
Parsing /etc/devd/iwi.conf
Parsing /etc/devd/acpi_power.conf
Parsing /etc/devd/atacard.conf
Parsing files in /usr/local/etc/devd
// PCMCI CDROM inserted here=20
Processing event '? at function=3D0 manufacturer=3D0xffffffff product=3D0xf=
fffffff cisvendor=3D"Shining" cisproduct=3D"PMIDE-ASC" function_type=3D4 on=
 pccard0'
Pushing table
Processing nomatch event
Testing bus=3D against ^pccard[0-9]+
Testing bus=3D against ^pccard[0-9]+
Executing 'logger Unknown device: pnp=3D loc=3D bus=3D manufacturer=3D prod=
uct=3D'
Popping table
// WaveLan inserted here
Processing event '? at function=3D0 manufacturer=3D0x0156 product=3D0x0002 =
cisvendor=3D"Lucent Technologies" cisproduct=3D"WaveLAN/IEEE" function_type=
=3D6 on pccard0'
Pushing table
Processing nomatch event
Testing bus=3D against ^pccard[0-9]+
Testing bus=3D against ^pccard[0-9]+
Executing 'logger Unknown device: pnp=3D loc=3D bus=3D manufacturer=3D prod=
uct=3D'
Popping table
//

Looks like:

- bus name does not substituted, see "Testing bus=3D against
^pccard[0-9]+" messages, kernel reports valid messages:
pccard0: <unknown card> (manufacturer=3D0xffffffff, product=3D0xffffffff) a=
t function 0
pccard0:    CIS info: Shining, PMIDE-ASC, Rev 1.04
pccard0: <unknown card> (manufacturer=3D0x0156, product=3D0x0002) at functi=
on 0
pccard0:    CIS info: Lucent Technologies, WaveLAN/IEEE, Version 01.01

- variables does not interpreted, see "nomatch 0" entry above, I've
extend it with "manufacturer=3D$manufacturer product=3D$product", but
default devd.conf does not works also.


> Warner
--=20
Vladimir B. Grebenchikov
vova@fbsd.ru



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1113763560.1005.9.camel>