mod_devicetable.h 24 KB

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