18c2ecf20Sopenharmony_ci============ 28c2ecf20Sopenharmony_ciDevice table 38c2ecf20Sopenharmony_ci============ 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciMatching of PCMCIA devices to drivers is done using one or more of the 68c2ecf20Sopenharmony_cifollowing criteria: 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci- manufactor ID 98c2ecf20Sopenharmony_ci- card ID 108c2ecf20Sopenharmony_ci- product ID strings _and_ hashes of these strings 118c2ecf20Sopenharmony_ci- function ID 128c2ecf20Sopenharmony_ci- device function (actual and pseudo) 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ciYou should use the helpers in include/pcmcia/device_id.h for generating the 158c2ecf20Sopenharmony_cistruct pcmcia_device_id[] entries which match devices to drivers. 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciIf you want to match product ID strings, you also need to pass the crc32 188c2ecf20Sopenharmony_cihashes of the string to the macro, e.g. if you want to match the product ID 198c2ecf20Sopenharmony_cistring 1, you need to use 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciPCMCIA_DEVICE_PROD_ID1("some_string", 0x(hash_of_some_string)), 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciIf the hash is incorrect, the kernel will inform you about this in "dmesg" 248c2ecf20Sopenharmony_ciupon module initialization, and tell you of the correct hash. 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciYou can determine the hash of the product ID strings by catting the file 278c2ecf20Sopenharmony_ci"modalias" in the sysfs directory of the PCMCIA device. It generates a string 288c2ecf20Sopenharmony_ciin the following form: 298c2ecf20Sopenharmony_cipcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciThe hex value after "pa" is the hash of product ID string 1, after "pb" for 328c2ecf20Sopenharmony_cistring 2 and so on. 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciAlternatively, you can use crc32hash (see tools/pcmcia/crc32hash.c) 358c2ecf20Sopenharmony_cito determine the crc32 hash. Simply pass the string you want to evaluate 368c2ecf20Sopenharmony_cias argument to this program, e.g.: 378c2ecf20Sopenharmony_ci$ tools/pcmcia/crc32hash "Dual Speed" 38