device_id.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. /*
  2. * device_id.h -- PCMCIA driver matching helpers
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * (C) 2003 - 2004 David Woodhouse
  9. * (C) 2003 - 2004 Dominik Brodowski
  10. */
  11. #ifndef _LINUX_PCMCIA_DEVICE_ID_H
  12. #define _LINUX_PCMCIA_DEVICE_ID_H
  13. #ifdef __KERNEL__
  14. #define PCMCIA_DEVICE_MANF_CARD(manf, card) { \
  15. .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
  16. PCMCIA_DEV_ID_MATCH_CARD_ID, \
  17. .manf_id = (manf), \
  18. .card_id = (card), }
  19. #define PCMCIA_DEVICE_FUNC_ID(func) { \
  20. .match_flags = PCMCIA_DEV_ID_MATCH_FUNC_ID, \
  21. .func_id = (func), }
  22. #define PCMCIA_DEVICE_PROD_ID1(v1, vh1) { \
  23. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1, \
  24. .prod_id = { (v1), NULL, NULL, NULL }, \
  25. .prod_id_hash = { (vh1), 0, 0, 0 }, }
  26. #define PCMCIA_DEVICE_PROD_ID2(v2, vh2) { \
  27. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2, \
  28. .prod_id = { NULL, (v2), NULL, NULL }, \
  29. .prod_id_hash = { 0, (vh2), 0, 0 }, }
  30. #define PCMCIA_DEVICE_PROD_ID3(v3, vh3) { \
  31. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID3, \
  32. .prod_id = { NULL, NULL, (v3), NULL }, \
  33. .prod_id_hash = { 0, 0, (vh3), 0 }, }
  34. #define PCMCIA_DEVICE_PROD_ID12(v1, v2, vh1, vh2) { \
  35. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  36. PCMCIA_DEV_ID_MATCH_PROD_ID2, \
  37. .prod_id = { (v1), (v2), NULL, NULL }, \
  38. .prod_id_hash = { (vh1), (vh2), 0, 0 }, }
  39. #define PCMCIA_DEVICE_PROD_ID13(v1, v3, vh1, vh3) { \
  40. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  41. PCMCIA_DEV_ID_MATCH_PROD_ID3, \
  42. .prod_id = { (v1), NULL, (v3), NULL }, \
  43. .prod_id_hash = { (vh1), 0, (vh3), 0 }, }
  44. #define PCMCIA_DEVICE_PROD_ID14(v1, v4, vh1, vh4) { \
  45. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  46. PCMCIA_DEV_ID_MATCH_PROD_ID4, \
  47. .prod_id = { (v1), NULL, NULL, (v4) }, \
  48. .prod_id_hash = { (vh1), 0, 0, (vh4) }, }
  49. #define PCMCIA_DEVICE_PROD_ID123(v1, v2, v3, vh1, vh2, vh3) { \
  50. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  51. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  52. PCMCIA_DEV_ID_MATCH_PROD_ID3, \
  53. .prod_id = { (v1), (v2), (v3), NULL },\
  54. .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, }
  55. #define PCMCIA_DEVICE_PROD_ID124(v1, v2, v4, vh1, vh2, vh4) { \
  56. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  57. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  58. PCMCIA_DEV_ID_MATCH_PROD_ID4, \
  59. .prod_id = { (v1), (v2), NULL, (v4) }, \
  60. .prod_id_hash = { (vh1), (vh2), 0, (vh4) }, }
  61. #define PCMCIA_DEVICE_PROD_ID134(v1, v3, v4, vh1, vh3, vh4) { \
  62. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  63. PCMCIA_DEV_ID_MATCH_PROD_ID3| \
  64. PCMCIA_DEV_ID_MATCH_PROD_ID4, \
  65. .prod_id = { (v1), NULL, (v3), (v4) }, \
  66. .prod_id_hash = { (vh1), 0, (vh3), (vh4) }, }
  67. #define PCMCIA_DEVICE_PROD_ID1234(v1, v2, v3, v4, vh1, vh2, vh3, vh4) { \
  68. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  69. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  70. PCMCIA_DEV_ID_MATCH_PROD_ID3| \
  71. PCMCIA_DEV_ID_MATCH_PROD_ID4, \
  72. .prod_id = { (v1), (v2), (v3), (v4) }, \
  73. .prod_id_hash = { (vh1), (vh2), (vh3), (vh4) }, }
  74. #define PCMCIA_DEVICE_MANF_CARD_PROD_ID1(manf, card, v1, vh1) { \
  75. .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
  76. PCMCIA_DEV_ID_MATCH_CARD_ID| \
  77. PCMCIA_DEV_ID_MATCH_PROD_ID1, \
  78. .manf_id = (manf), \
  79. .card_id = (card), \
  80. .prod_id = { (v1), NULL, NULL, NULL }, \
  81. .prod_id_hash = { (vh1), 0, 0, 0 }, }
  82. #define PCMCIA_DEVICE_MANF_CARD_PROD_ID3(manf, card, v3, vh3) { \
  83. .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
  84. PCMCIA_DEV_ID_MATCH_CARD_ID| \
  85. PCMCIA_DEV_ID_MATCH_PROD_ID3, \
  86. .manf_id = (manf), \
  87. .card_id = (card), \
  88. .prod_id = { NULL, NULL, (v3), NULL }, \
  89. .prod_id_hash = { 0, 0, (vh3), 0 }, }
  90. /* multi-function devices */
  91. #define PCMCIA_MFC_DEVICE_MANF_CARD(mfc, manf, card) { \
  92. .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
  93. PCMCIA_DEV_ID_MATCH_CARD_ID| \
  94. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  95. .manf_id = (manf), \
  96. .card_id = (card), \
  97. .function = (mfc), }
  98. #define PCMCIA_MFC_DEVICE_PROD_ID1(mfc, v1, vh1) { \
  99. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  100. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  101. .prod_id = { (v1), NULL, NULL, NULL }, \
  102. .prod_id_hash = { (vh1), 0, 0, 0 }, \
  103. .function = (mfc), }
  104. #define PCMCIA_MFC_DEVICE_PROD_ID2(mfc, v2, vh2) { \
  105. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  106. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  107. .prod_id = { NULL, (v2), NULL, NULL }, \
  108. .prod_id_hash = { 0, (vh2), 0, 0 }, \
  109. .function = (mfc), }
  110. #define PCMCIA_MFC_DEVICE_PROD_ID12(mfc, v1, v2, vh1, vh2) { \
  111. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  112. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  113. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  114. .prod_id = { (v1), (v2), NULL, NULL }, \
  115. .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
  116. .function = (mfc), }
  117. #define PCMCIA_MFC_DEVICE_PROD_ID13(mfc, v1, v3, vh1, vh3) { \
  118. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  119. PCMCIA_DEV_ID_MATCH_PROD_ID3| \
  120. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  121. .prod_id = { (v1), NULL, (v3), NULL }, \
  122. .prod_id_hash = { (vh1), 0, (vh3), 0 }, \
  123. .function = (mfc), }
  124. #define PCMCIA_MFC_DEVICE_PROD_ID123(mfc, v1, v2, v3, vh1, vh2, vh3) { \
  125. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  126. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  127. PCMCIA_DEV_ID_MATCH_PROD_ID3| \
  128. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  129. .prod_id = { (v1), (v2), (v3), NULL },\
  130. .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
  131. .function = (mfc), }
  132. /* pseudo multi-function devices */
  133. #define PCMCIA_PFC_DEVICE_MANF_CARD(mfc, manf, card) { \
  134. .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
  135. PCMCIA_DEV_ID_MATCH_CARD_ID| \
  136. PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
  137. .manf_id = (manf), \
  138. .card_id = (card), \
  139. .device_no = (mfc), }
  140. #define PCMCIA_PFC_DEVICE_PROD_ID1(mfc, v1, vh1) { \
  141. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  142. PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
  143. .prod_id = { (v1), NULL, NULL, NULL }, \
  144. .prod_id_hash = { (vh1), 0, 0, 0 }, \
  145. .device_no = (mfc), }
  146. #define PCMCIA_PFC_DEVICE_PROD_ID2(mfc, v2, vh2) { \
  147. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  148. PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
  149. .prod_id = { NULL, (v2), NULL, NULL }, \
  150. .prod_id_hash = { 0, (vh2), 0, 0 }, \
  151. .device_no = (mfc), }
  152. #define PCMCIA_PFC_DEVICE_PROD_ID12(mfc, v1, v2, vh1, vh2) { \
  153. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  154. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  155. PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
  156. .prod_id = { (v1), (v2), NULL, NULL }, \
  157. .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
  158. .device_no = (mfc), }
  159. #define PCMCIA_PFC_DEVICE_PROD_ID13(mfc, v1, v3, vh1, vh3) { \
  160. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  161. PCMCIA_DEV_ID_MATCH_PROD_ID3| \
  162. PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
  163. .prod_id = { (v1), NULL, (v3), NULL }, \
  164. .prod_id_hash = { (vh1), 0, (vh3), 0 }, \
  165. .device_no = (mfc), }
  166. #define PCMCIA_PFC_DEVICE_PROD_ID123(mfc, v1, v2, v3, vh1, vh2, vh3) { \
  167. .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  168. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  169. PCMCIA_DEV_ID_MATCH_PROD_ID3| \
  170. PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
  171. .prod_id = { (v1), (v2), (v3), NULL },\
  172. .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
  173. .device_no = (mfc), }
  174. /* cards needing a CIS override */
  175. #define PCMCIA_DEVICE_CIS_MANF_CARD(manf, card, _cisfile) { \
  176. .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
  177. PCMCIA_DEV_ID_MATCH_MANF_ID| \
  178. PCMCIA_DEV_ID_MATCH_CARD_ID, \
  179. .manf_id = (manf), \
  180. .card_id = (card), \
  181. .cisfile = (_cisfile)}
  182. #define PCMCIA_DEVICE_CIS_PROD_ID12(v1, v2, vh1, vh2, _cisfile) { \
  183. .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
  184. PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  185. PCMCIA_DEV_ID_MATCH_PROD_ID2, \
  186. .prod_id = { (v1), (v2), NULL, NULL }, \
  187. .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
  188. .cisfile = (_cisfile)}
  189. #define PCMCIA_DEVICE_CIS_PROD_ID123(v1, v2, v3, vh1, vh2, vh3, _cisfile) { \
  190. .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
  191. PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  192. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  193. PCMCIA_DEV_ID_MATCH_PROD_ID3, \
  194. .prod_id = { (v1), (v2), (v3), NULL },\
  195. .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
  196. .cisfile = (_cisfile)}
  197. #define PCMCIA_DEVICE_CIS_PROD_ID2(v2, vh2, _cisfile) { \
  198. .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
  199. PCMCIA_DEV_ID_MATCH_PROD_ID2, \
  200. .prod_id = { NULL, (v2), NULL, NULL }, \
  201. .prod_id_hash = { 0, (vh2), 0, 0 }, \
  202. .cisfile = (_cisfile)}
  203. #define PCMCIA_PFC_DEVICE_CIS_PROD_ID12(mfc, v1, v2, vh1, vh2, _cisfile) { \
  204. .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
  205. PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  206. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  207. PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
  208. .prod_id = { (v1), (v2), NULL, NULL }, \
  209. .prod_id_hash = { (vh1), (vh2), 0, 0 },\
  210. .device_no = (mfc), \
  211. .cisfile = (_cisfile)}
  212. #define PCMCIA_MFC_DEVICE_CIS_MANF_CARD(mfc, manf, card, _cisfile) { \
  213. .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
  214. PCMCIA_DEV_ID_MATCH_MANF_ID| \
  215. PCMCIA_DEV_ID_MATCH_CARD_ID| \
  216. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  217. .manf_id = (manf), \
  218. .card_id = (card), \
  219. .function = (mfc), \
  220. .cisfile = (_cisfile)}
  221. #define PCMCIA_MFC_DEVICE_CIS_PROD_ID12(mfc, v1, v2, vh1, vh2, _cisfile) { \
  222. .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
  223. PCMCIA_DEV_ID_MATCH_PROD_ID1| \
  224. PCMCIA_DEV_ID_MATCH_PROD_ID2| \
  225. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  226. .prod_id = { (v1), (v2), NULL, NULL }, \
  227. .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
  228. .function = (mfc), \
  229. .cisfile = (_cisfile)}
  230. #define PCMCIA_MFC_DEVICE_CIS_PROD_ID4(mfc, v4, vh4, _cisfile) { \
  231. .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
  232. PCMCIA_DEV_ID_MATCH_PROD_ID4| \
  233. PCMCIA_DEV_ID_MATCH_FUNCTION, \
  234. .prod_id = { NULL, NULL, NULL, (v4) }, \
  235. .prod_id_hash = { 0, 0, 0, (vh4) }, \
  236. .function = (mfc), \
  237. .cisfile = (_cisfile)}
  238. #define PCMCIA_DEVICE_NULL { .match_flags = 0, }
  239. #endif /* __KERNEL__ */
  240. #endif /* _LINUX_PCMCIA_DEVICE_ID_H */