From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262181AbTK1MOT (ORCPT ); Fri, 28 Nov 2003 07:14:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262186AbTK1MOT (ORCPT ); Fri, 28 Nov 2003 07:14:19 -0500 Received: from ns.suse.de ([195.135.220.2]:27553 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S262181AbTK1MOQ (ORCPT ); Fri, 28 Nov 2003 07:14:16 -0500 Date: Fri, 28 Nov 2003 13:11:18 +0100 Message-ID: From: Takashi Iwai To: Andrey Borzenkov Cc: rusty@rustcorp.com.au, ambx1@neo.rr.com, linux-kernel@vger.kernel.org Subject: Re: file2alias for pnp (Re: modules.pnpmap output support) In-Reply-To: <200311272159.00184.arvidjaar@mail.ru> References: <200311272159.00184.arvidjaar@mail.ru> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 13) (Rational FORTRAN) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Thu, 27 Nov 2003 21:58:58 +0300, Andrey Borzenkov wrote: > > On Thursday 27 November 2003 17:41, Takashi Iwai wrote: > > Hi, > > > > the attached is the patch to add pnp entries to file2alias.c. > > i moved the definitions of pnp_device_id and pnp_card_device_id into > > mod_devicetable.h as other devices do. if you don't like it, i'll try > > to revert them and put definitions inside file2alias.c to keep the > > changes minimum. > > > > the format of pnp alias is: > > pnp:dXXXYYYY > > or > > pnp:cXXXYYYYdXXXYYYY[dXXXYYYY...] > > where XXXYYYY is the pnp id with 7 letters (e.g. CTL0031), c shows the > > card id, and d means the device id. multiple device ids will be > > listed depending on the driver. > > > > for example, > > > > alias pnp:dYMH0021* opl3sa2 > > alias pnp:cALS0001d@@@0001d@X@0001d@H@0001* snd_als100 > > > > Andrey, would it be feasible for hotplug stuff? > > > > Will then every d be passed as separate parameter to hotplug? It means agent > has to deal with unknown number of parameters or are there always fixed > number of devs? apparently not as max is 8 and in your example only 3 are > defined. yes. the number of probed devices is variable. note that, as seen above, there are two cases: with a card id and without a card id. in the latter case, the card id is not checked but only the given device id is checked, while the former case will need checks all ids. > > If number is variable I guess better would be > > alias pnp:cXXXXXXdYYYYYYY[:YYYYYY...] > > i.e. put all devs IDs in one field; actually may be even separator is > redundant as IDs have strict format to my knowledge. it looks fine to me. > Then hotplug agent gets two parameters - PNPID and PNPDEVS - and it is quite > easy to build alias. > > can you give example how entries in sysfs look like (I do not have any ISA > card). Is it possible to list them in the same order as in pnp_card_device_id > table? Otherwise coldplugging becomes quite complicated. coldplugging script > has to build the same string as hotplug invocation gets. % ls -RF /sys/bus/pnp/ /sys/bus/pnp/: devices/ drivers/ /sys/bus/pnp/devices: 00:01.00@ 00:01.01@ 00:01.02@ 00:01.03@ 00:01.04@ 00:01.05@ ... % ls -RF /sys/devices/pnp0/ /sys/devices/pnp0/: 00:01/ detach_state power/ /sys/devices/pnp0/00:01: 00:01.00/ 00:01.02/ 00:01.04/ detach_state 00:01.01/ 00:01.03/ 00:01.05/ power/ /sys/devices/pnp0/00:01/00:01.00: detach_state id options power/ resources ... ...hmm, i don't see the card id on sysfs. i think it's not implemented yet! Adam, any plan to give the card id to sysfs ? > Oh, BTW, what are those `@' in your example? If they mean single char > wildcard, you should build them using `?' because modprobe is using normal > fnmatch to match module name against aliases. @ is a valid latter as the ISA pnp id string. it's not a wildcard. (that's one of the reasons i showed it :) the id consists of three letters [A-Z@] and four hex numbers [0-9a-f]. one exception is 'XXXX' used as numbers, which means that any numbers match. for example, CTLXXXX matches CTL0305, CTLa12f, etc. ciao, Takashi