mod_devicetable.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Device tables which are exported to userspace via
  4. * scripts/mod/file2alias.c. You must keep that file in sync with this
  5. * header.
  6. */
  7. #ifndef LINUX_MOD_DEVICETABLE_H
  8. #define LINUX_MOD_DEVICETABLE_H
  9. #ifdef __KERNEL__
  10. #include <linux/types.h>
  11. #include <linux/uuid.h>
  12. typedef unsigned long kernel_ulong_t;
  13. #endif
  14. #define PCI_ANY_ID (~0)
  15. struct pci_device_id {
  16. __u32 vendor, device; /* Vendor and device ID or PCI_ANY_ID*/
  17. __u32 subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
  18. __u32 class, class_mask; /* (class,subclass,prog-if) triplet */
  19. kernel_ulong_t driver_data; /* Data private to the driver */
  20. };
  21. #define IEEE1394_MATCH_VENDOR_ID 0x0001
  22. #define IEEE1394_MATCH_MODEL_ID 0x0002
  23. #define IEEE1394_MATCH_SPECIFIER_ID 0x0004
  24. #define IEEE1394_MATCH_VERSION 0x0008
  25. struct ieee1394_device_id {
  26. __u32 match_flags;
  27. __u32 vendor_id;
  28. __u32 model_id;
  29. __u32 specifier_id;
  30. __u32 version;
  31. kernel_ulong_t driver_data;
  32. };
  33. /*
  34. * Device table entry for "new style" table-driven USB drivers.
  35. * User mode code can read these tables to choose which modules to load.
  36. * Declare the table as a MODULE_DEVICE_TABLE.
  37. *
  38. * A probe() parameter will point to a matching entry from this table.
  39. * Use the driver_info field for each match to hold information tied
  40. * to that match: device quirks, etc.
  41. *
  42. * Terminate the driver's table with an all-zeroes entry.
  43. * Use the flag values to control which fields are compared.
  44. */
  45. /**
  46. * struct usb_device_id - identifies USB devices for probing and hotplugging
  47. * @match_flags: Bit mask controlling which of the other fields are used to
  48. * match against new devices. Any field except for driver_info may be
  49. * used, although some only make sense in conjunction with other fields.
  50. * This is usually set by a USB_DEVICE_*() macro, which sets all
  51. * other fields in this structure except for driver_info.
  52. * @idVendor: USB vendor ID for a device; numbers are assigned
  53. * by the USB forum to its members.
  54. * @idProduct: Vendor-assigned product ID.
  55. * @bcdDevice_lo: Low end of range of vendor-assigned product version numbers.
  56. * This is also used to identify individual product versions, for
  57. * a range consisting of a single device.
  58. * @bcdDevice_hi: High end of version number range. The range of product
  59. * versions is inclusive.
  60. * @bDeviceClass: Class of device; numbers are assigned
  61. * by the USB forum. Products may choose to implement classes,
  62. * or be vendor-specific. Device classes specify behavior of all
  63. * the interfaces on a device.
  64. * @bDeviceSubClass: Subclass of device; associated with bDeviceClass.
  65. * @bDeviceProtocol: Protocol of device; associated with bDeviceClass.
  66. * @bInterfaceClass: Class of interface; numbers are assigned
  67. * by the USB forum. Products may choose to implement classes,
  68. * or be vendor-specific. Interface classes specify behavior only
  69. * of a given interface; other interfaces may support other classes.
  70. * @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass.
  71. * @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass.
  72. * @bInterfaceNumber: Number of interface; composite devices may use
  73. * fixed interface numbers to differentiate between vendor-specific
  74. * interfaces.
  75. * @driver_info: Holds information used by the driver. Usually it holds
  76. * a pointer to a descriptor understood by the driver, or perhaps
  77. * device flags.
  78. *
  79. * In most cases, drivers will create a table of device IDs by using
  80. * USB_DEVICE(), or similar macros designed for that purpose.
  81. * They will then export it to userspace using MODULE_DEVICE_TABLE(),
  82. * and provide it to the USB core through their usb_driver structure.
  83. *
  84. * See the usb_match_id() function for information about how matches are
  85. * performed. Briefly, you will normally use one of several macros to help
  86. * construct these entries. Each entry you provide will either identify
  87. * one or more specific products, or will identify a class of products
  88. * which have agreed to behave the same. You should put the more specific
  89. * matches towards the beginning of your table, so that driver_info can
  90. * record quirks of specific products.
  91. */
  92. struct usb_device_id {
  93. /* which fields to match against? */
  94. __u16 match_flags;
  95. /* Used for product specific matches; range is inclusive */
  96. __u16 idVendor;
  97. __u16 idProduct;
  98. __u16 bcdDevice_lo;
  99. __u16 bcdDevice_hi;
  100. /* Used for device class matches */
  101. __u8 bDeviceClass;
  102. __u8 bDeviceSubClass;
  103. __u8 bDeviceProtocol;
  104. /* Used for interface class matches */
  105. __u8 bInterfaceClass;
  106. __u8 bInterfaceSubClass;
  107. __u8 bInterfaceProtocol;
  108. /* Used for vendor-specific interface matches */
  109. __u8 bInterfaceNumber;
  110. /* not matched against */
  111. kernel_ulong_t driver_info
  112. __attribute__((aligned(sizeof(kernel_ulong_t))));
  113. };
  114. /* Some useful macros to use to create struct usb_device_id */
  115. #define USB_DEVICE_ID_MATCH_VENDOR 0x0001
  116. #define USB_DEVICE_ID_MATCH_PRODUCT 0x0002
  117. #define USB_DEVICE_ID_MATCH_DEV_LO 0x0004
  118. #define USB_DEVICE_ID_MATCH_DEV_HI 0x0008
  119. #define USB_DEVICE_ID_MATCH_DEV_CLASS 0x0010
  120. #define USB_DEVICE_ID_MATCH_DEV_SUBCLASS 0x0020
  121. #define USB_DEVICE_ID_MATCH_DEV_PROTOCOL 0x0040
  122. #define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080
  123. #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
  124. #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
  125. #define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400
  126. #define HID_ANY_ID (~0)
  127. #define HID_BUS_ANY 0xffff
  128. #define HID_GROUP_ANY 0x0000
  129. struct hid_device_id {
  130. __u16 bus;
  131. __u16 group;
  132. __u32 vendor;
  133. __u32 product;
  134. kernel_ulong_t driver_data;
  135. };
  136. /* s390 CCW devices */
  137. struct ccw_device_id {
  138. __u16 match_flags; /* which fields to match against */
  139. __u16 cu_type; /* control unit type */
  140. __u16 dev_type; /* device type */
  141. __u8 cu_model; /* control unit model */
  142. __u8 dev_model; /* device model */
  143. kernel_ulong_t driver_info;
  144. };
  145. #define CCW_DEVICE_ID_MATCH_CU_TYPE 0x01
  146. #define CCW_DEVICE_ID_MATCH_CU_MODEL 0x02
  147. #define CCW_DEVICE_ID_MATCH_DEVICE_TYPE 0x04
  148. #define CCW_DEVICE_ID_MATCH_DEVICE_MODEL 0x08
  149. /* s390 AP bus devices */
  150. struct ap_device_id {
  151. __u16 match_flags; /* which fields to match against */
  152. __u8 dev_type; /* device type */
  153. kernel_ulong_t driver_info;
  154. };
  155. #define AP_DEVICE_ID_MATCH_CARD_TYPE 0x01
  156. #define AP_DEVICE_ID_MATCH_QUEUE_TYPE 0x02
  157. /* s390 css bus devices (subchannels) */
  158. struct css_device_id {
  159. __u8 match_flags;
  160. __u8 type; /* subchannel type */
  161. kernel_ulong_t driver_data;
  162. };
  163. #define ACPI_ID_LEN 9
  164. struct acpi_device_id {
  165. __u8 id[ACPI_ID_LEN];
  166. kernel_ulong_t driver_data;
  167. __u32 cls;
  168. __u32 cls_msk;
  169. };
  170. #define PNP_ID_LEN 8
  171. #define PNP_MAX_DEVICES 8
  172. struct pnp_device_id {
  173. __u8 id[PNP_ID_LEN];
  174. kernel_ulong_t driver_data;
  175. };
  176. struct pnp_card_device_id {
  177. __u8 id[PNP_ID_LEN];
  178. kernel_ulong_t driver_data;
  179. struct {
  180. __u8 id[PNP_ID_LEN];
  181. } devs[PNP_MAX_DEVICES];
  182. };
  183. #define SERIO_ANY 0xff
  184. struct serio_device_id {
  185. __u8 type;
  186. __u8 extra;
  187. __u8 id;
  188. __u8 proto;
  189. };
  190. struct hda_device_id {
  191. __u32 vendor_id;
  192. __u32 rev_id;
  193. __u8 api_version;
  194. const char *name;
  195. unsigned long driver_data;
  196. };
  197. struct sdw_device_id {
  198. __u16 mfg_id;
  199. __u16 part_id;
  200. kernel_ulong_t driver_data;
  201. };
  202. /*
  203. * Struct used for matching a device
  204. */
  205. struct of_device_id {
  206. char name[32];
  207. char type[32];
  208. char compatible[128];
  209. const void *data;
  210. };
  211. /* VIO */
  212. struct vio_device_id {
  213. char type[32];
  214. char compat[32];
  215. };
  216. /* PCMCIA */
  217. struct pcmcia_device_id {
  218. __u16 match_flags;
  219. __u16 manf_id;
  220. __u16 card_id;
  221. __u8 func_id;
  222. /* for real multi-function devices */
  223. __u8 function;
  224. /* for pseudo multi-function devices */
  225. __u8 device_no;
  226. __u32 prod_id_hash[4];
  227. /* not matched against in kernelspace */
  228. const char * prod_id[4];
  229. /* not matched against */
  230. kernel_ulong_t driver_info;
  231. char * cisfile;
  232. };
  233. #define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001
  234. #define PCMCIA_DEV_ID_MATCH_CARD_ID 0x0002
  235. #define PCMCIA_DEV_ID_MATCH_FUNC_ID 0x0004
  236. #define PCMCIA_DEV_ID_MATCH_FUNCTION 0x0008
  237. #define PCMCIA_DEV_ID_MATCH_PROD_ID1 0x0010
  238. #define PCMCIA_DEV_ID_MATCH_PROD_ID2 0x0020
  239. #define PCMCIA_DEV_ID_MATCH_PROD_ID3 0x0040
  240. #define PCMCIA_DEV_ID_MATCH_PROD_ID4 0x0080
  241. #define PCMCIA_DEV_ID_MATCH_DEVICE_NO 0x0100
  242. #define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200
  243. #define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400
  244. /* Input */
  245. #define INPUT_DEVICE_ID_EV_MAX 0x1f
  246. #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71
  247. #define INPUT_DEVICE_ID_KEY_MAX 0x2ff
  248. #define INPUT_DEVICE_ID_REL_MAX 0x0f
  249. #define INPUT_DEVICE_ID_ABS_MAX 0x3f
  250. #define INPUT_DEVICE_ID_MSC_MAX 0x07
  251. #define INPUT_DEVICE_ID_LED_MAX 0x0f
  252. #define INPUT_DEVICE_ID_SND_MAX 0x07
  253. #define INPUT_DEVICE_ID_FF_MAX 0x7f
  254. #define INPUT_DEVICE_ID_SW_MAX 0x0f
  255. #define INPUT_DEVICE_ID_PROP_MAX 0x1f
  256. #define INPUT_DEVICE_ID_MATCH_BUS 1
  257. #define INPUT_DEVICE_ID_MATCH_VENDOR 2
  258. #define INPUT_DEVICE_ID_MATCH_PRODUCT 4
  259. #define INPUT_DEVICE_ID_MATCH_VERSION 8
  260. #define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010
  261. #define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020
  262. #define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040
  263. #define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080
  264. #define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100
  265. #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200
  266. #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400
  267. #define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800
  268. #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
  269. #define INPUT_DEVICE_ID_MATCH_PROPBIT 0x2000
  270. struct input_device_id {
  271. kernel_ulong_t flags;
  272. __u16 bustype;
  273. __u16 vendor;
  274. __u16 product;
  275. __u16 version;
  276. kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
  277. kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
  278. kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
  279. kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
  280. kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
  281. kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
  282. kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
  283. kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
  284. kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
  285. kernel_ulong_t propbit[INPUT_DEVICE_ID_PROP_MAX / BITS_PER_LONG + 1];
  286. kernel_ulong_t driver_info;
  287. };
  288. /* EISA */
  289. #define EISA_SIG_LEN 8
  290. /* The EISA signature, in ASCII form, null terminated */
  291. struct eisa_device_id {
  292. char sig[EISA_SIG_LEN];
  293. kernel_ulong_t driver_data;
  294. };
  295. #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s"
  296. struct parisc_device_id {
  297. __u8 hw_type; /* 5 bits used */
  298. __u8 hversion_rev; /* 4 bits */
  299. __u16 hversion; /* 12 bits */
  300. __u32 sversion; /* 20 bits */
  301. };
  302. #define PA_HWTYPE_ANY_ID 0xff
  303. #define PA_HVERSION_REV_ANY_ID 0xff
  304. #define PA_HVERSION_ANY_ID 0xffff
  305. #define PA_SVERSION_ANY_ID 0xffffffff
  306. /* SDIO */
  307. #define SDIO_ANY_ID (~0)
  308. struct sdio_device_id {
  309. __u8 class; /* Standard interface or SDIO_ANY_ID */
  310. __u16 vendor; /* Vendor or SDIO_ANY_ID */
  311. __u16 device; /* Device ID or SDIO_ANY_ID */
  312. kernel_ulong_t driver_data; /* Data private to the driver */
  313. };
  314. /* SSB core, see drivers/ssb/ */
  315. struct ssb_device_id {
  316. __u16 vendor;
  317. __u16 coreid;
  318. __u8 revision;
  319. __u8 __pad;
  320. } __attribute__((packed, aligned(2)));
  321. #define SSB_DEVICE(_vendor, _coreid, _revision) \
  322. { .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
  323. #define SSB_ANY_VENDOR 0xFFFF
  324. #define SSB_ANY_ID 0xFFFF
  325. #define SSB_ANY_REV 0xFF
  326. /* Broadcom's specific AMBA core, see drivers/bcma/ */
  327. struct bcma_device_id {
  328. __u16 manuf;
  329. __u16 id;
  330. __u8 rev;
  331. __u8 class;
  332. } __attribute__((packed,aligned(2)));
  333. #define BCMA_CORE(_manuf, _id, _rev, _class) \
  334. { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, }
  335. #define BCMA_ANY_MANUF 0xFFFF
  336. #define BCMA_ANY_ID 0xFFFF
  337. #define BCMA_ANY_REV 0xFF
  338. #define BCMA_ANY_CLASS 0xFF
  339. struct virtio_device_id {
  340. __u32 device;
  341. __u32 vendor;
  342. };
  343. #define VIRTIO_DEV_ANY_ID 0xffffffff
  344. /*
  345. * For Hyper-V devices we use the device guid as the id.
  346. */
  347. struct hv_vmbus_device_id {
  348. uuid_le guid;
  349. kernel_ulong_t driver_data; /* Data private to the driver */
  350. };
  351. /* rpmsg */
  352. #define RPMSG_NAME_SIZE 32
  353. #define RPMSG_DEVICE_MODALIAS_FMT "rpmsg:%s"
  354. struct rpmsg_device_id {
  355. char name[RPMSG_NAME_SIZE];
  356. };
  357. /* i2c */
  358. #define I2C_NAME_SIZE 20
  359. #define I2C_MODULE_PREFIX "i2c:"
  360. struct i2c_device_id {
  361. char name[I2C_NAME_SIZE];
  362. kernel_ulong_t driver_data; /* Data private to the driver */
  363. };
  364. /* pci_epf */
  365. #define PCI_EPF_NAME_SIZE 20
  366. #define PCI_EPF_MODULE_PREFIX "pci_epf:"
  367. struct pci_epf_device_id {
  368. char name[PCI_EPF_NAME_SIZE];
  369. kernel_ulong_t driver_data;
  370. };
  371. /* spi */
  372. #define SPI_NAME_SIZE 32
  373. #define SPI_MODULE_PREFIX "spi:"
  374. struct spi_device_id {
  375. char name[SPI_NAME_SIZE];
  376. kernel_ulong_t driver_data; /* Data private to the driver */
  377. };
  378. /* SLIMbus */
  379. #define SLIMBUS_NAME_SIZE 32
  380. #define SLIMBUS_MODULE_PREFIX "slim:"
  381. struct slim_device_id {
  382. __u16 manf_id, prod_code;
  383. __u16 dev_index, instance;
  384. /* Data private to the driver */
  385. kernel_ulong_t driver_data;
  386. };
  387. #define APR_NAME_SIZE 32
  388. #define APR_MODULE_PREFIX "apr:"
  389. struct apr_device_id {
  390. char name[APR_NAME_SIZE];
  391. __u32 domain_id;
  392. __u32 svc_id;
  393. __u32 svc_version;
  394. kernel_ulong_t driver_data; /* Data private to the driver */
  395. };
  396. #define SPMI_NAME_SIZE 32
  397. #define SPMI_MODULE_PREFIX "spmi:"
  398. struct spmi_device_id {
  399. char name[SPMI_NAME_SIZE];
  400. kernel_ulong_t driver_data; /* Data private to the driver */
  401. };
  402. /* dmi */
  403. enum dmi_field {
  404. DMI_NONE,
  405. DMI_BIOS_VENDOR,
  406. DMI_BIOS_VERSION,
  407. DMI_BIOS_DATE,
  408. DMI_SYS_VENDOR,
  409. DMI_PRODUCT_NAME,
  410. DMI_PRODUCT_VERSION,
  411. DMI_PRODUCT_SERIAL,
  412. DMI_PRODUCT_UUID,
  413. DMI_PRODUCT_FAMILY,
  414. DMI_BOARD_VENDOR,
  415. DMI_BOARD_NAME,
  416. DMI_BOARD_VERSION,
  417. DMI_BOARD_SERIAL,
  418. DMI_BOARD_ASSET_TAG,
  419. DMI_CHASSIS_VENDOR,
  420. DMI_CHASSIS_TYPE,
  421. DMI_CHASSIS_VERSION,
  422. DMI_CHASSIS_SERIAL,
  423. DMI_CHASSIS_ASSET_TAG,
  424. DMI_STRING_MAX,
  425. DMI_OEM_STRING, /* special case - will not be in dmi_ident */
  426. };
  427. struct dmi_strmatch {
  428. unsigned char slot:7;
  429. unsigned char exact_match:1;
  430. char substr[79];
  431. };
  432. struct dmi_system_id {
  433. int (*callback)(const struct dmi_system_id *);
  434. const char *ident;
  435. struct dmi_strmatch matches[4];
  436. void *driver_data;
  437. };
  438. /*
  439. * struct dmi_device_id appears during expansion of
  440. * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it
  441. * but this is enough for gcc 3.4.6 to error out:
  442. * error: storage size of '__mod_dmi_device_table' isn't known
  443. */
  444. #define dmi_device_id dmi_system_id
  445. #define DMI_MATCH(a, b) { .slot = a, .substr = b }
  446. #define DMI_EXACT_MATCH(a, b) { .slot = a, .substr = b, .exact_match = 1 }
  447. #define PLATFORM_NAME_SIZE 20
  448. #define PLATFORM_MODULE_PREFIX "platform:"
  449. struct platform_device_id {
  450. char name[PLATFORM_NAME_SIZE];
  451. kernel_ulong_t driver_data;
  452. };
  453. #define MDIO_NAME_SIZE 32
  454. #define MDIO_MODULE_PREFIX "mdio:"
  455. #define MDIO_ID_FMT "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d"
  456. #define MDIO_ID_ARGS(_id) \
  457. (_id)>>31, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1, \
  458. ((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \
  459. ((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \
  460. ((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \
  461. ((_id)>>15) & 1, ((_id)>>14) & 1, ((_id)>>13) & 1, ((_id)>>12) & 1, \
  462. ((_id)>>11) & 1, ((_id)>>10) & 1, ((_id)>>9) & 1, ((_id)>>8) & 1, \
  463. ((_id)>>7) & 1, ((_id)>>6) & 1, ((_id)>>5) & 1, ((_id)>>4) & 1, \
  464. ((_id)>>3) & 1, ((_id)>>2) & 1, ((_id)>>1) & 1, (_id) & 1
  465. /**
  466. * struct mdio_device_id - identifies PHY devices on an MDIO/MII bus
  467. * @phy_id: The result of
  468. * (mdio_read(&MII_PHYSID1) << 16 | mdio_read(&PHYSID2)) & @phy_id_mask
  469. * for this PHY type
  470. * @phy_id_mask: Defines the significant bits of @phy_id. A value of 0
  471. * is used to terminate an array of struct mdio_device_id.
  472. */
  473. struct mdio_device_id {
  474. __u32 phy_id;
  475. __u32 phy_id_mask;
  476. };
  477. struct zorro_device_id {
  478. __u32 id; /* Device ID or ZORRO_WILDCARD */
  479. kernel_ulong_t driver_data; /* Data private to the driver */
  480. };
  481. #define ZORRO_WILDCARD (0xffffffff) /* not official */
  482. #define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X"
  483. #define ISAPNP_ANY_ID 0xffff
  484. struct isapnp_device_id {
  485. unsigned short card_vendor, card_device;
  486. unsigned short vendor, function;
  487. kernel_ulong_t driver_data; /* data private to the driver */
  488. };
  489. /**
  490. * struct amba_id - identifies a device on an AMBA bus
  491. * @id: The significant bits if the hardware device ID
  492. * @mask: Bitmask specifying which bits of the id field are significant when
  493. * matching. A driver binds to a device when ((hardware device ID) & mask)
  494. * == id.
  495. * @data: Private data used by the driver.
  496. */
  497. struct amba_id {
  498. unsigned int id;
  499. unsigned int mask;
  500. void *data;
  501. };
  502. /**
  503. * struct mips_cdmm_device_id - identifies devices in MIPS CDMM bus
  504. * @type: Device type identifier.
  505. */
  506. struct mips_cdmm_device_id {
  507. __u8 type;
  508. };
  509. /*
  510. * Match x86 CPUs for CPU specific drivers.
  511. * See documentation of "x86_match_cpu" for details.
  512. */
  513. /*
  514. * MODULE_DEVICE_TABLE expects this struct to be called x86cpu_device_id.
  515. * Although gcc seems to ignore this error, clang fails without this define.
  516. */
  517. #define x86cpu_device_id x86_cpu_id
  518. struct x86_cpu_id {
  519. __u16 vendor;
  520. __u16 family;
  521. __u16 model;
  522. __u16 feature; /* bit index */
  523. kernel_ulong_t driver_data;
  524. };
  525. #define X86_FEATURE_MATCH(x) \
  526. { X86_VENDOR_ANY, X86_FAMILY_ANY, X86_MODEL_ANY, x }
  527. #define X86_VENDOR_ANY 0xffff
  528. #define X86_FAMILY_ANY 0
  529. #define X86_MODEL_ANY 0
  530. #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */
  531. /*
  532. * Generic table type for matching CPU features.
  533. * @feature: the bit number of the feature (0 - 65535)
  534. */
  535. struct cpu_feature {
  536. __u16 feature;
  537. };
  538. #define IPACK_ANY_FORMAT 0xff
  539. #define IPACK_ANY_ID (~0)
  540. struct ipack_device_id {
  541. __u8 format; /* Format version or IPACK_ANY_ID */
  542. __u32 vendor; /* Vendor ID or IPACK_ANY_ID */
  543. __u32 device; /* Device ID or IPACK_ANY_ID */
  544. };
  545. #define MEI_CL_MODULE_PREFIX "mei:"
  546. #define MEI_CL_NAME_SIZE 32
  547. #define MEI_CL_VERSION_ANY 0xff
  548. /**
  549. * struct mei_cl_device_id - MEI client device identifier
  550. * @name: helper name
  551. * @uuid: client uuid
  552. * @version: client protocol version
  553. * @driver_info: information used by the driver.
  554. *
  555. * identifies mei client device by uuid and name
  556. */
  557. struct mei_cl_device_id {
  558. char name[MEI_CL_NAME_SIZE];
  559. uuid_le uuid;
  560. __u8 version;
  561. kernel_ulong_t driver_info;
  562. };
  563. /* RapidIO */
  564. #define RIO_ANY_ID 0xffff
  565. /**
  566. * struct rio_device_id - RIO device identifier
  567. * @did: RapidIO device ID
  568. * @vid: RapidIO vendor ID
  569. * @asm_did: RapidIO assembly device ID
  570. * @asm_vid: RapidIO assembly vendor ID
  571. *
  572. * Identifies a RapidIO device based on both the device/vendor IDs and
  573. * the assembly device/vendor IDs.
  574. */
  575. struct rio_device_id {
  576. __u16 did, vid;
  577. __u16 asm_did, asm_vid;
  578. };
  579. struct mcb_device_id {
  580. __u16 device;
  581. kernel_ulong_t driver_data;
  582. };
  583. struct ulpi_device_id {
  584. __u16 vendor;
  585. __u16 product;
  586. kernel_ulong_t driver_data;
  587. };
  588. /**
  589. * struct fsl_mc_device_id - MC object device identifier
  590. * @vendor: vendor ID
  591. * @obj_type: MC object type
  592. *
  593. * Type of entries in the "device Id" table for MC object devices supported by
  594. * a MC object device driver. The last entry of the table has vendor set to 0x0
  595. */
  596. struct fsl_mc_device_id {
  597. __u16 vendor;
  598. const char obj_type[16];
  599. };
  600. /**
  601. * struct tb_service_id - Thunderbolt service identifiers
  602. * @match_flags: Flags used to match the structure
  603. * @protocol_key: Protocol key the service supports
  604. * @protocol_id: Protocol id the service supports
  605. * @protocol_version: Version of the protocol
  606. * @protocol_revision: Revision of the protocol software
  607. * @driver_data: Driver specific data
  608. *
  609. * Thunderbolt XDomain services are exposed as devices where each device
  610. * carries the protocol information the service supports. Thunderbolt
  611. * XDomain service drivers match against that information.
  612. */
  613. struct tb_service_id {
  614. __u32 match_flags;
  615. char protocol_key[8 + 1];
  616. __u32 protocol_id;
  617. __u32 protocol_version;
  618. __u32 protocol_revision;
  619. kernel_ulong_t driver_data;
  620. };
  621. #define TBSVC_MATCH_PROTOCOL_KEY 0x0001
  622. #define TBSVC_MATCH_PROTOCOL_ID 0x0002
  623. #define TBSVC_MATCH_PROTOCOL_VERSION 0x0004
  624. #define TBSVC_MATCH_PROTOCOL_REVISION 0x0008
  625. #endif /* LINUX_MOD_DEVICETABLE_H */