[RFC 1/2] export pcmcia info to hotplug

Dominik Brodowski linux at dominikbrodowski.net
Wed Feb 16 14:38:47 EST 2005


On Wed, Feb 16, 2005 at 10:04:56AM -0800, Jean Tourrilhes wrote:
> Dominik Brodowski wrote :
> > 
> > Why not the prod_id strings themselves?
> > a) They may contain all sorts of strange and difficult to handle characters, 
> >    like " ".
> > b) It's impossible to pass multiple strings to userspace.
> 
> 	Hi Dominik,
> 
> 	Unfortunately, those devices strings are quite essential. I
> hope that the first thing the hotplug script will do is to extract
> those strings in some way.
> 	Please consider :
> -------------------------------------------------
> card "Lucent Technologies Wavelan/IEEE"
>   version "Lucent Technologies", "WaveLAN/IEEE"
>   manfid 0x0156,0x0002
>   bind "orinoco_cs"
> 
> card "Intersil PRISM2 Reference Design 11Mb/s WLAN Card"
>   version "INTERSIL", "HFA384x/IEEE"
>   manfid 0x0156,0x0002
>   bind "hostap_cs"
> -------------------------------------------------
> 
> 	Note that the way we workaround this in the present Pcmcia is
> that most conf files are carefully hand crafted and don't declare the
> manfid, so that we force the Pcmcia subsystem to only match by
> strings.

That's why a hash of these strings is exported to userspace. The userspace
matching tool (hotplug or hotplug-ng) then matches it to the hash stored in
the yet-to-be-added device_id structs, and if it matches, it modprobes it.
In kernelspace it is matched by the actual strings then

for orinoco_cs:
+       PCMCIA_DEVICE_PROD_ID12("Lucent Technologies", "WaveLAN/IEEE", 0x23eb9949, 0xc562e72a),

means the hashes 0x23eb99 and 0xc562e72a are matched against the hashes
reported to hotplug. If they match, orinoco_cs is modprobed, and then 
pcmcia_devmatch() [ see patch 2/2 of those submitted ] checks the strings.

Thanks,
	Dominik

PS: If a script needs to grab the strings nonetheless, it can cat the
device's sysfs attribute named prod_id[1-4]



More information about the linux-pcmcia mailing list