13bdab16cSMauro Carvalho Chehab============
23bdab16cSMauro Carvalho ChehabDevice table
33bdab16cSMauro Carvalho Chehab============
43bdab16cSMauro Carvalho Chehab
53bdab16cSMauro Carvalho ChehabMatching of PCMCIA devices to drivers is done using one or more of the
63bdab16cSMauro Carvalho Chehabfollowing criteria:
73bdab16cSMauro Carvalho Chehab
83bdab16cSMauro Carvalho Chehab- manufactor ID
93bdab16cSMauro Carvalho Chehab- card ID
103bdab16cSMauro Carvalho Chehab- product ID strings _and_ hashes of these strings
113bdab16cSMauro Carvalho Chehab- function ID
123bdab16cSMauro Carvalho Chehab- device function (actual and pseudo)
133bdab16cSMauro Carvalho Chehab
143bdab16cSMauro Carvalho ChehabYou should use the helpers in include/pcmcia/device_id.h for generating the
153bdab16cSMauro Carvalho Chehabstruct pcmcia_device_id[] entries which match devices to drivers.
163bdab16cSMauro Carvalho Chehab
173bdab16cSMauro Carvalho ChehabIf you want to match product ID strings, you also need to pass the crc32
183bdab16cSMauro Carvalho Chehabhashes of the string to the macro, e.g. if you want to match the product ID
193bdab16cSMauro Carvalho Chehabstring 1, you need to use
203bdab16cSMauro Carvalho Chehab
213bdab16cSMauro Carvalho ChehabPCMCIA_DEVICE_PROD_ID1("some_string", 0x(hash_of_some_string)),
223bdab16cSMauro Carvalho Chehab
233bdab16cSMauro Carvalho ChehabIf the hash is incorrect, the kernel will inform you about this in "dmesg"
243bdab16cSMauro Carvalho Chehabupon module initialization, and tell you of the correct hash.
253bdab16cSMauro Carvalho Chehab
263bdab16cSMauro Carvalho ChehabYou can determine the hash of the product ID strings by catting the file
273bdab16cSMauro Carvalho Chehab"modalias" in the sysfs directory of the PCMCIA device. It generates a string
283bdab16cSMauro Carvalho Chehabin the following form:
293bdab16cSMauro Carvalho Chehabpcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000
303bdab16cSMauro Carvalho Chehab
313bdab16cSMauro Carvalho ChehabThe hex value after "pa" is the hash of product ID string 1, after "pb" for
323bdab16cSMauro Carvalho Chehabstring 2 and so on.
333bdab16cSMauro Carvalho Chehab
343bdab16cSMauro Carvalho ChehabAlternatively, you can use crc32hash (see tools/pcmcia/crc32hash.c)
353bdab16cSMauro Carvalho Chehabto determine the crc32 hash.  Simply pass the string you want to evaluate
363bdab16cSMauro Carvalho Chehabas argument to this program, e.g.:
373bdab16cSMauro Carvalho Chehab$ tools/pcmcia/crc32hash "Dual Speed"
38