From owner-freebsd-current@FreeBSD.ORG Sun Apr 17 18:49:05 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7687E16A4CE; Sun, 17 Apr 2005 18:49:05 +0000 (GMT) Received: from vbook.fbsd.ru (swsoft-mipt-nat.sw.ru [195.214.233.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D8E243D46; Sun, 17 Apr 2005 18:49:04 +0000 (GMT) (envelope-from vova@vbook.fbsd.ru) Received: from vova by vbook.fbsd.ru with local (Exim 4.50 (FreeBSD)) id 1DNEmO-0000Nu-CL; Sun, 17 Apr 2005 22:46:00 +0400 From: Vladimir Grebenschikov To: "M. Warner Losh" In-Reply-To: <20050417.111015.77928634.imp@bsdimp.com> References: <1113740156.1018.6.camel@localhost> <20050417.111015.77928634.imp@bsdimp.com> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Organization: SWsoft Date: Sun, 17 Apr 2005 22:45:59 +0400 Message-Id: <1113763560.1005.9.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov cc: mobile@freebsd.org cc: current@freebsd.org Subject: Re: devd + driver load by plugged device class how to ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: vova@fbsd.ru List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2005 18:49:05 -0000 =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 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: (manufacturer=3D0xffffffff, product=3D0xffffffff) a= t function 0 pccard0: CIS info: Shining, PMIDE-ASC, Rev 1.04 pccard0: (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