mod_devicetable.h 22 KB

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