[patch 14/38] pcmcia: id_table for wavelan_cs

Dominik Brodowski linux at dominikbrodowski.net
Mon Mar 7 18:23:39 EST 2005


On Mon, Mar 07, 2005 at 03:09:57PM -0800, Andrew Morton wrote:
> Dominik Brodowski <linux at dominikbrodowski.net> wrote:
> >
> > > 	Also, what's up with the magic numbers ?
> > 
> > They're crc32 hashes of the strings. they're needed to export useful values
> > to userspace for driver <-> device matching, as the strings themselves
> > cannot be passed to userspace in an HOTPLUG call.
> 
> How on earth is a poor device driver developer supposed to know how to do
> this?

I'll add a big fat comment to include/pcmcia/device_id.h and
include/linux/mod_devicetable.h

> Why can't we just calculate hash at runtime, from the string?

runtime isn't the problem, MODULE_DEVICE_TABLE generation time is. I once
_tried_ to do this in scripts/file2alias.c, but that got really ugly and
even seemed to be impossible...  Device driver developers are
	a) encouraged to use MANF_ID / CARD_ID matches instead,
	b) do have an easy way to generate the hashes (pcmcia-modalias), and
	c) will see an explanatory warning in "dmesg" once they load the
	   module (not only when the device is probed).

Hope that's enough,
	Dominik



More information about the linux-pcmcia mailing list