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