Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4 LT |
2 | /* |
3 | * Device tables which are exported to userspace via | |
fb120da6 | 4 | * scripts/mod/file2alias.c. You must keep that file in sync with this |
1da177e4 LT |
5 | * header. |
6 | */ | |
7 | ||
8 | #ifndef LINUX_MOD_DEVICETABLE_H | |
9 | #define LINUX_MOD_DEVICETABLE_H | |
10 | ||
11 | #ifdef __KERNEL__ | |
1fb1ea0d | 12 | #include <linux/mei.h> |
1da177e4 | 13 | #include <linux/types.h> |
e5354107 | 14 | #include <linux/uuid.h> |
1da177e4 LT |
15 | typedef unsigned long kernel_ulong_t; |
16 | #endif | |
17 | ||
18 | #define PCI_ANY_ID (~0) | |
cc6711b0 MG |
19 | |
20 | enum { | |
21 | PCI_ID_F_VFIO_DRIVER_OVERRIDE = 1, | |
22 | }; | |
1da177e4 | 23 | |
229b4e07 CD |
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. | |
343b7258 | 42 | * @override_only: Match only when dev->driver_override is this driver. |
229b4e07 | 43 | */ |
1da177e4 LT |
44 | struct 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 */ | |
343b7258 | 49 | __u32 override_only; |
1da177e4 LT |
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 | ||
58 | struct ieee1394_device_id { | |
59 | __u32 match_flags; | |
60 | __u32 vendor_id; | |
61 | __u32 model_id; | |
62 | __u32 specifier_id; | |
63 | __u32 version; | |
6543becf | 64 | kernel_ulong_t driver_data; |
1da177e4 LT |
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 | |
32357605 SD |
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. | |
1da177e4 LT |
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 | |
de869917 | 99 | * the interfaces on a device. |
1da177e4 LT |
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. | |
81df2d59 BM |
108 | * @bInterfaceNumber: Number of interface; composite devices may use |
109 | * fixed interface numbers to differentiate between vendor-specific | |
110 | * interfaces. | |
1da177e4 LT |
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 | */ | |
128 | struct 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 | ||
81df2d59 BM |
148 | /* Used for vendor-specific interface matches */ |
149 | __u8 bInterfaceNumber; | |
150 | ||
1da177e4 | 151 | /* not matched against */ |
fec1868e GKH |
152 | kernel_ulong_t driver_info |
153 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | |
1da177e4 LT |
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 | |
81df2d59 | 167 | #define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400 |
1da177e4 | 168 | |
e8c84f9a | 169 | #define HID_ANY_ID (~0) |
7431fb76 | 170 | #define HID_BUS_ANY 0xffff |
4d53b801 | 171 | #define HID_GROUP_ANY 0x0000 |
e8c84f9a JS |
172 | |
173 | struct hid_device_id { | |
174 | __u16 bus; | |
4d53b801 | 175 | __u16 group; |
e8c84f9a JS |
176 | __u32 vendor; |
177 | __u32 product; | |
6543becf | 178 | kernel_ulong_t driver_data; |
e8c84f9a JS |
179 | }; |
180 | ||
1da177e4 LT |
181 | /* s390 CCW devices */ |
182 | struct 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 | ||
1534c382 MS |
198 | /* s390 AP bus devices */ |
199 | struct ap_device_id { | |
200 | __u16 match_flags; /* which fields to match against */ | |
201 | __u8 dev_type; /* device type */ | |
1534c382 MS |
202 | kernel_ulong_t driver_info; |
203 | }; | |
204 | ||
e28d2af4 IT |
205 | #define AP_DEVICE_ID_MATCH_CARD_TYPE 0x01 |
206 | #define AP_DEVICE_ID_MATCH_QUEUE_TYPE 0x02 | |
1534c382 | 207 | |
7e9db9ea CH |
208 | /* s390 css bus devices (subchannels) */ |
209 | struct css_device_id { | |
f08adc00 | 210 | __u8 match_flags; |
7e9db9ea | 211 | __u8 type; /* subchannel type */ |
7e9db9ea CH |
212 | kernel_ulong_t driver_data; |
213 | }; | |
214 | ||
d273845e | 215 | #define ACPI_ID_LEN 16 |
29b71a1c TR |
216 | |
217 | struct acpi_device_id { | |
218 | __u8 id[ACPI_ID_LEN]; | |
219 | kernel_ulong_t driver_data; | |
26095a01 SS |
220 | __u32 cls; |
221 | __u32 cls_msk; | |
29b71a1c | 222 | }; |
1da177e4 LT |
223 | |
224 | #define PNP_ID_LEN 8 | |
225 | #define PNP_MAX_DEVICES 8 | |
226 | ||
227 | struct pnp_device_id { | |
228 | __u8 id[PNP_ID_LEN]; | |
229 | kernel_ulong_t driver_data; | |
230 | }; | |
231 | ||
232 | struct pnp_card_device_id { | |
233 | __u8 id[PNP_ID_LEN]; | |
234 | kernel_ulong_t driver_data; | |
235 | struct { | |
236 | __u8 id[PNP_ID_LEN]; | |
237 | } devs[PNP_MAX_DEVICES]; | |
238 | }; | |
239 | ||
240 | ||
241 | #define SERIO_ANY 0xff | |
242 | ||
243 | struct serio_device_id { | |
244 | __u8 type; | |
245 | __u8 extra; | |
246 | __u8 id; | |
247 | __u8 proto; | |
248 | }; | |
249 | ||
da23ac1e SP |
250 | struct hda_device_id { |
251 | __u32 vendor_id; | |
252 | __u32 rev_id; | |
253 | __u8 api_version; | |
254 | const char *name; | |
255 | unsigned long driver_data; | |
256 | }; | |
257 | ||
9251345d VK |
258 | struct sdw_device_id { |
259 | __u16 mfg_id; | |
260 | __u16 part_id; | |
b5924268 PLB |
261 | __u8 sdw_version; |
262 | __u8 class_id; | |
9251345d VK |
263 | kernel_ulong_t driver_data; |
264 | }; | |
265 | ||
5e655772 JM |
266 | /* |
267 | * Struct used for matching a device | |
268 | */ | |
851c63e3 | 269 | struct of_device_id { |
5e655772 JM |
270 | char name[32]; |
271 | char type[32]; | |
272 | char compatible[128]; | |
d7c9a53f | 273 | const void *data; |
5e655772 JM |
274 | }; |
275 | ||
fb120da6 SR |
276 | /* VIO */ |
277 | struct vio_device_id { | |
278 | char type[32]; | |
279 | char compat[32]; | |
280 | }; | |
1da177e4 | 281 | |
1ad275e3 DB |
282 | /* PCMCIA */ |
283 | ||
284 | struct pcmcia_device_id { | |
285 | __u16 match_flags; | |
286 | ||
287 | __u16 manf_id; | |
229b4e07 | 288 | __u16 card_id; |
1ad275e3 | 289 | |
229b4e07 | 290 | __u8 func_id; |
1ad275e3 DB |
291 | |
292 | /* for real multi-function devices */ | |
229b4e07 | 293 | __u8 function; |
1ad275e3 | 294 | |
4fb7edce | 295 | /* for pseudo multi-function devices */ |
229b4e07 | 296 | __u8 device_no; |
1ad275e3 | 297 | |
229b4e07 | 298 | __u32 prod_id_hash[4]; |
1ad275e3 | 299 | |
99d49e3a | 300 | /* not matched against in kernelspace */ |
aecab27a | 301 | const char * prod_id[4]; |
aecab27a | 302 | |
1ad275e3 DB |
303 | /* not matched against */ |
304 | kernel_ulong_t driver_info; | |
ea7b3882 | 305 | char * cisfile; |
1ad275e3 DB |
306 | }; |
307 | ||
308 | #define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001 | |
309 | #define PCMCIA_DEV_ID_MATCH_CARD_ID 0x0002 | |
310 | #define PCMCIA_DEV_ID_MATCH_FUNC_ID 0x0004 | |
311 | #define PCMCIA_DEV_ID_MATCH_FUNCTION 0x0008 | |
312 | #define PCMCIA_DEV_ID_MATCH_PROD_ID1 0x0010 | |
313 | #define PCMCIA_DEV_ID_MATCH_PROD_ID2 0x0020 | |
314 | #define PCMCIA_DEV_ID_MATCH_PROD_ID3 0x0040 | |
315 | #define PCMCIA_DEV_ID_MATCH_PROD_ID4 0x0080 | |
316 | #define PCMCIA_DEV_ID_MATCH_DEVICE_NO 0x0100 | |
ea7b3882 | 317 | #define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 |
f602ff7e | 318 | #define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 |
1ad275e3 | 319 | |
ddc5d341 DT |
320 | /* Input */ |
321 | #define INPUT_DEVICE_ID_EV_MAX 0x1f | |
dc24f0e7 | 322 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 |
03bac96f | 323 | #define INPUT_DEVICE_ID_KEY_MAX 0x2ff |
ddc5d341 | 324 | #define INPUT_DEVICE_ID_REL_MAX 0x0f |
b04c99e3 | 325 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f |
ddc5d341 DT |
326 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 |
327 | #define INPUT_DEVICE_ID_LED_MAX 0x0f | |
328 | #define INPUT_DEVICE_ID_SND_MAX 0x07 | |
329 | #define INPUT_DEVICE_ID_FF_MAX 0x7f | |
c463bb2a | 330 | #define INPUT_DEVICE_ID_SW_MAX 0x10 |
8724ecb0 | 331 | #define INPUT_DEVICE_ID_PROP_MAX 0x1f |
ddc5d341 DT |
332 | |
333 | #define INPUT_DEVICE_ID_MATCH_BUS 1 | |
334 | #define INPUT_DEVICE_ID_MATCH_VENDOR 2 | |
335 | #define INPUT_DEVICE_ID_MATCH_PRODUCT 4 | |
336 | #define INPUT_DEVICE_ID_MATCH_VERSION 8 | |
337 | ||
338 | #define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010 | |
339 | #define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020 | |
340 | #define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040 | |
341 | #define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080 | |
342 | #define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100 | |
343 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200 | |
344 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400 | |
345 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800 | |
346 | #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 | |
8724ecb0 | 347 | #define INPUT_DEVICE_ID_MATCH_PROPBIT 0x2000 |
ddc5d341 DT |
348 | |
349 | struct input_device_id { | |
350 | ||
351 | kernel_ulong_t flags; | |
352 | ||
353 | __u16 bustype; | |
354 | __u16 vendor; | |
355 | __u16 product; | |
356 | __u16 version; | |
357 | ||
358 | kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1]; | |
359 | kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1]; | |
360 | kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1]; | |
361 | kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1]; | |
362 | kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1]; | |
363 | kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1]; | |
364 | kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1]; | |
365 | kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1]; | |
366 | kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1]; | |
8724ecb0 | 367 | kernel_ulong_t propbit[INPUT_DEVICE_ID_PROP_MAX / BITS_PER_LONG + 1]; |
ddc5d341 DT |
368 | |
369 | kernel_ulong_t driver_info; | |
370 | }; | |
371 | ||
07563c71 MT |
372 | /* EISA */ |
373 | ||
374 | #define EISA_SIG_LEN 8 | |
375 | ||
376 | /* The EISA signature, in ASCII form, null terminated */ | |
377 | struct eisa_device_id { | |
378 | char sig[EISA_SIG_LEN]; | |
379 | kernel_ulong_t driver_data; | |
380 | }; | |
381 | ||
382 | #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s" | |
383 | ||
f2439b26 KM |
384 | struct parisc_device_id { |
385 | __u8 hw_type; /* 5 bits used */ | |
386 | __u8 hversion_rev; /* 4 bits */ | |
387 | __u16 hversion; /* 12 bits */ | |
388 | __u32 sversion; /* 20 bits */ | |
389 | }; | |
390 | ||
f354ef8a KM |
391 | #define PA_HWTYPE_ANY_ID 0xff |
392 | #define PA_HVERSION_REV_ANY_ID 0xff | |
393 | #define PA_HVERSION_ANY_ID 0xffff | |
394 | #define PA_SVERSION_ANY_ID 0xffffffff | |
f2439b26 | 395 | |
3b38bea0 PO |
396 | /* SDIO */ |
397 | ||
398 | #define SDIO_ANY_ID (~0) | |
399 | ||
400 | struct sdio_device_id { | |
401 | __u8 class; /* Standard interface or SDIO_ANY_ID */ | |
402 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ | |
403 | __u16 device; /* Device ID or SDIO_ANY_ID */ | |
6543becf | 404 | kernel_ulong_t driver_data; /* Data private to the driver */ |
3b38bea0 PO |
405 | }; |
406 | ||
61e115a5 MB |
407 | /* SSB core, see drivers/ssb/ */ |
408 | struct ssb_device_id { | |
409 | __u16 vendor; | |
410 | __u16 coreid; | |
411 | __u8 revision; | |
b01a60be AB |
412 | __u8 __pad; |
413 | } __attribute__((packed, aligned(2))); | |
61e115a5 MB |
414 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ |
415 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } | |
61e115a5 MB |
416 | |
417 | #define SSB_ANY_VENDOR 0xFFFF | |
418 | #define SSB_ANY_ID 0xFFFF | |
419 | #define SSB_ANY_REV 0xFF | |
420 | ||
8369ae33 RM |
421 | /* Broadcom's specific AMBA core, see drivers/bcma/ */ |
422 | struct bcma_device_id { | |
423 | __u16 manuf; | |
424 | __u16 id; | |
425 | __u8 rev; | |
426 | __u8 class; | |
b01a60be | 427 | } __attribute__((packed,aligned(2))); |
8369ae33 RM |
428 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ |
429 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } | |
8369ae33 RM |
430 | |
431 | #define BCMA_ANY_MANUF 0xFFFF | |
432 | #define BCMA_ANY_ID 0xFFFF | |
433 | #define BCMA_ANY_REV 0xFF | |
434 | #define BCMA_ANY_CLASS 0xFF | |
435 | ||
ec3d41c4 RR |
436 | struct virtio_device_id { |
437 | __u32 device; | |
438 | __u32 vendor; | |
439 | }; | |
440 | #define VIRTIO_DEV_ANY_ID 0xffffffff | |
441 | ||
17be18c2 S |
442 | /* |
443 | * For Hyper-V devices we use the device guid as the id. | |
444 | */ | |
445 | struct hv_vmbus_device_id { | |
b7d18c57 | 446 | guid_t guid; |
6543becf | 447 | kernel_ulong_t driver_data; /* Data private to the driver */ |
17be18c2 S |
448 | }; |
449 | ||
bcabbcca OBC |
450 | /* rpmsg */ |
451 | ||
452 | #define RPMSG_NAME_SIZE 32 | |
453 | #define RPMSG_DEVICE_MODALIAS_FMT "rpmsg:%s" | |
454 | ||
455 | struct rpmsg_device_id { | |
456 | char name[RPMSG_NAME_SIZE]; | |
60302ce4 | 457 | kernel_ulong_t driver_data; |
bcabbcca OBC |
458 | }; |
459 | ||
d2653e92 JD |
460 | /* i2c */ |
461 | ||
462 | #define I2C_NAME_SIZE 20 | |
463 | #define I2C_MODULE_PREFIX "i2c:" | |
464 | ||
465 | struct i2c_device_id { | |
466 | char name[I2C_NAME_SIZE]; | |
6543becf | 467 | kernel_ulong_t driver_data; /* Data private to the driver */ |
d2653e92 JD |
468 | }; |
469 | ||
5e8cb403 KVA |
470 | /* pci_epf */ |
471 | ||
472 | #define PCI_EPF_NAME_SIZE 20 | |
473 | #define PCI_EPF_MODULE_PREFIX "pci_epf:" | |
474 | ||
475 | struct pci_epf_device_id { | |
476 | char name[PCI_EPF_NAME_SIZE]; | |
477 | kernel_ulong_t driver_data; | |
478 | }; | |
479 | ||
3a379bbc BB |
480 | /* i3c */ |
481 | ||
482 | #define I3C_MATCH_DCR 0x1 | |
483 | #define I3C_MATCH_MANUF 0x2 | |
484 | #define I3C_MATCH_PART 0x4 | |
485 | #define I3C_MATCH_EXTRA_INFO 0x8 | |
486 | ||
487 | struct i3c_device_id { | |
488 | __u8 match_flags; | |
489 | __u8 dcr; | |
490 | __u16 manuf_id; | |
491 | __u16 part_id; | |
492 | __u16 extra_info; | |
493 | ||
494 | const void *data; | |
495 | }; | |
496 | ||
75368bf6 AV |
497 | /* spi */ |
498 | ||
499 | #define SPI_NAME_SIZE 32 | |
e0626e38 | 500 | #define SPI_MODULE_PREFIX "spi:" |
75368bf6 AV |
501 | |
502 | struct spi_device_id { | |
503 | char name[SPI_NAME_SIZE]; | |
6543becf | 504 | kernel_ulong_t driver_data; /* Data private to the driver */ |
75368bf6 AV |
505 | }; |
506 | ||
3648e78e SD |
507 | /* SLIMbus */ |
508 | ||
509 | #define SLIMBUS_NAME_SIZE 32 | |
510 | #define SLIMBUS_MODULE_PREFIX "slim:" | |
511 | ||
512 | struct slim_device_id { | |
513 | __u16 manf_id, prod_code; | |
514 | __u16 dev_index, instance; | |
515 | ||
516 | /* Data private to the driver */ | |
517 | kernel_ulong_t driver_data; | |
518 | }; | |
519 | ||
6adba21e SK |
520 | #define APR_NAME_SIZE 32 |
521 | #define APR_MODULE_PREFIX "apr:" | |
522 | ||
523 | struct apr_device_id { | |
524 | char name[APR_NAME_SIZE]; | |
525 | __u32 domain_id; | |
526 | __u32 svc_id; | |
527 | __u32 svc_version; | |
528 | kernel_ulong_t driver_data; /* Data private to the driver */ | |
529 | }; | |
530 | ||
5a86bf34 KH |
531 | #define SPMI_NAME_SIZE 32 |
532 | #define SPMI_MODULE_PREFIX "spmi:" | |
533 | ||
534 | struct spmi_device_id { | |
535 | char name[SPMI_NAME_SIZE]; | |
536 | kernel_ulong_t driver_data; /* Data private to the driver */ | |
537 | }; | |
538 | ||
d945b697 DW |
539 | /* dmi */ |
540 | enum dmi_field { | |
541 | DMI_NONE, | |
542 | DMI_BIOS_VENDOR, | |
543 | DMI_BIOS_VERSION, | |
544 | DMI_BIOS_DATE, | |
f5152f4d EV |
545 | DMI_BIOS_RELEASE, |
546 | DMI_EC_FIRMWARE_RELEASE, | |
d945b697 DW |
547 | DMI_SYS_VENDOR, |
548 | DMI_PRODUCT_NAME, | |
549 | DMI_PRODUCT_VERSION, | |
550 | DMI_PRODUCT_SERIAL, | |
551 | DMI_PRODUCT_UUID, | |
b23908d3 | 552 | DMI_PRODUCT_SKU, |
c61872c9 | 553 | DMI_PRODUCT_FAMILY, |
d945b697 DW |
554 | DMI_BOARD_VENDOR, |
555 | DMI_BOARD_NAME, | |
556 | DMI_BOARD_VERSION, | |
557 | DMI_BOARD_SERIAL, | |
558 | DMI_BOARD_ASSET_TAG, | |
559 | DMI_CHASSIS_VENDOR, | |
560 | DMI_CHASSIS_TYPE, | |
561 | DMI_CHASSIS_VERSION, | |
562 | DMI_CHASSIS_SERIAL, | |
563 | DMI_CHASSIS_ASSET_TAG, | |
564 | DMI_STRING_MAX, | |
de40614d | 565 | DMI_OEM_STRING, /* special case - will not be in dmi_ident */ |
d945b697 DW |
566 | }; |
567 | ||
568 | struct dmi_strmatch { | |
5017b285 JN |
569 | unsigned char slot:7; |
570 | unsigned char exact_match:1; | |
d945b697 DW |
571 | char substr[79]; |
572 | }; | |
573 | ||
d945b697 DW |
574 | struct dmi_system_id { |
575 | int (*callback)(const struct dmi_system_id *); | |
576 | const char *ident; | |
577 | struct dmi_strmatch matches[4]; | |
578 | void *driver_data; | |
579 | }; | |
40413dcb AD |
580 | /* |
581 | * struct dmi_device_id appears during expansion of | |
582 | * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it | |
583 | * but this is enough for gcc 3.4.6 to error out: | |
584 | * error: storage size of '__mod_dmi_device_table' isn't known | |
585 | */ | |
586 | #define dmi_device_id dmi_system_id | |
d945b697 | 587 | |
5017b285 JN |
588 | #define DMI_MATCH(a, b) { .slot = a, .substr = b } |
589 | #define DMI_EXACT_MATCH(a, b) { .slot = a, .substr = b, .exact_match = 1 } | |
d2653e92 | 590 | |
57fee4a5 EM |
591 | #define PLATFORM_NAME_SIZE 20 |
592 | #define PLATFORM_MODULE_PREFIX "platform:" | |
593 | ||
594 | struct platform_device_id { | |
595 | char name[PLATFORM_NAME_SIZE]; | |
6543becf | 596 | kernel_ulong_t driver_data; |
57fee4a5 EM |
597 | }; |
598 | ||
648ea013 | 599 | #define MDIO_NAME_SIZE 32 |
8626d3b4 DW |
600 | #define MDIO_MODULE_PREFIX "mdio:" |
601 | ||
d2ed49cf | 602 | #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" |
8626d3b4 | 603 | #define MDIO_ID_ARGS(_id) \ |
d2ed49cf | 604 | ((_id)>>31) & 1, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1, \ |
8626d3b4 DW |
605 | ((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \ |
606 | ((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \ | |
607 | ((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \ | |
608 | ((_id)>>15) & 1, ((_id)>>14) & 1, ((_id)>>13) & 1, ((_id)>>12) & 1, \ | |
609 | ((_id)>>11) & 1, ((_id)>>10) & 1, ((_id)>>9) & 1, ((_id)>>8) & 1, \ | |
610 | ((_id)>>7) & 1, ((_id)>>6) & 1, ((_id)>>5) & 1, ((_id)>>4) & 1, \ | |
611 | ((_id)>>3) & 1, ((_id)>>2) & 1, ((_id)>>1) & 1, (_id) & 1 | |
612 | ||
613 | /** | |
614 | * struct mdio_device_id - identifies PHY devices on an MDIO/MII bus | |
615 | * @phy_id: The result of | |
15c6d8e5 | 616 | * (mdio_read(&MII_PHYSID1) << 16 | mdio_read(&MII_PHYSID2)) & @phy_id_mask |
8626d3b4 DW |
617 | * for this PHY type |
618 | * @phy_id_mask: Defines the significant bits of @phy_id. A value of 0 | |
619 | * is used to terminate an array of struct mdio_device_id. | |
620 | */ | |
621 | struct mdio_device_id { | |
622 | __u32 phy_id; | |
623 | __u32 phy_id_mask; | |
624 | }; | |
625 | ||
bf54a2b3 GU |
626 | struct zorro_device_id { |
627 | __u32 id; /* Device ID or ZORRO_WILDCARD */ | |
628 | kernel_ulong_t driver_data; /* Data private to the driver */ | |
629 | }; | |
630 | ||
631 | #define ZORRO_WILDCARD (0xffffffff) /* not official */ | |
632 | ||
633 | #define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X" | |
634 | ||
90def62d RR |
635 | #define ISAPNP_ANY_ID 0xffff |
636 | struct isapnp_device_id { | |
637 | unsigned short card_vendor, card_device; | |
638 | unsigned short vendor, function; | |
639 | kernel_ulong_t driver_data; /* data private to the driver */ | |
640 | }; | |
641 | ||
1e5f9a23 DM |
642 | /** |
643 | * struct amba_id - identifies a device on an AMBA bus | |
644 | * @id: The significant bits if the hardware device ID | |
645 | * @mask: Bitmask specifying which bits of the id field are significant when | |
646 | * matching. A driver binds to a device when ((hardware device ID) & mask) | |
647 | * == id. | |
648 | * @data: Private data used by the driver. | |
649 | */ | |
650 | struct amba_id { | |
651 | unsigned int id; | |
652 | unsigned int mask; | |
1e5f9a23 | 653 | void *data; |
1e5f9a23 DM |
654 | }; |
655 | ||
8286ae03 JH |
656 | /** |
657 | * struct mips_cdmm_device_id - identifies devices in MIPS CDMM bus | |
658 | * @type: Device type identifier. | |
659 | */ | |
660 | struct mips_cdmm_device_id { | |
661 | __u8 type; | |
662 | }; | |
663 | ||
644e9cbb AK |
664 | /* |
665 | * Match x86 CPUs for CPU specific drivers. | |
666 | * See documentation of "x86_match_cpu" for details. | |
667 | */ | |
668 | ||
c4586256 BW |
669 | /* |
670 | * MODULE_DEVICE_TABLE expects this struct to be called x86cpu_device_id. | |
671 | * Although gcc seems to ignore this error, clang fails without this define. | |
672 | */ | |
673 | #define x86cpu_device_id x86_cpu_id | |
644e9cbb AK |
674 | struct x86_cpu_id { |
675 | __u16 vendor; | |
676 | __u16 family; | |
677 | __u16 model; | |
e9d71445 | 678 | __u16 steppings; |
644e9cbb AK |
679 | __u16 feature; /* bit index */ |
680 | kernel_ulong_t driver_data; | |
681 | }; | |
682 | ||
ba5bade4 | 683 | /* Wild cards for x86_cpu_id::vendor, family, model and feature */ |
644e9cbb AK |
684 | #define X86_VENDOR_ANY 0xffff |
685 | #define X86_FAMILY_ANY 0 | |
686 | #define X86_MODEL_ANY 0 | |
e9d71445 | 687 | #define X86_STEPPING_ANY 0 |
644e9cbb AK |
688 | #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ |
689 | ||
67bad2fd AB |
690 | /* |
691 | * Generic table type for matching CPU features. | |
692 | * @feature: the bit number of the feature (0 - 65535) | |
693 | */ | |
694 | ||
695 | struct cpu_feature { | |
696 | __u16 feature; | |
697 | }; | |
698 | ||
5948ae27 | 699 | #define IPACK_ANY_FORMAT 0xff |
849e0ad2 JT |
700 | #define IPACK_ANY_ID (~0) |
701 | struct ipack_device_id { | |
702 | __u8 format; /* Format version or IPACK_ANY_ID */ | |
703 | __u32 vendor; /* Vendor ID or IPACK_ANY_ID */ | |
704 | __u32 device; /* Device ID or IPACK_ANY_ID */ | |
705 | }; | |
706 | ||
e5354107 SO |
707 | #define MEI_CL_MODULE_PREFIX "mei:" |
708 | #define MEI_CL_NAME_SIZE 32 | |
b26864ca | 709 | #define MEI_CL_VERSION_ANY 0xff |
e5354107 | 710 | |
c93b76b3 TW |
711 | /** |
712 | * struct mei_cl_device_id - MEI client device identifier | |
713 | * @name: helper name | |
714 | * @uuid: client uuid | |
b26864ca | 715 | * @version: client protocol version |
c93b76b3 TW |
716 | * @driver_info: information used by the driver. |
717 | * | |
718 | * identifies mei client device by uuid and name | |
719 | */ | |
e5354107 SO |
720 | struct mei_cl_device_id { |
721 | char name[MEI_CL_NAME_SIZE]; | |
b144ce2d | 722 | uuid_le uuid; |
b26864ca | 723 | __u8 version; |
e5354107 SO |
724 | kernel_ulong_t driver_info; |
725 | }; | |
726 | ||
3bdbb62f AB |
727 | /* RapidIO */ |
728 | ||
729 | #define RIO_ANY_ID 0xffff | |
730 | ||
731 | /** | |
732 | * struct rio_device_id - RIO device identifier | |
733 | * @did: RapidIO device ID | |
734 | * @vid: RapidIO vendor ID | |
735 | * @asm_did: RapidIO assembly device ID | |
736 | * @asm_vid: RapidIO assembly vendor ID | |
737 | * | |
738 | * Identifies a RapidIO device based on both the device/vendor IDs and | |
739 | * the assembly device/vendor IDs. | |
740 | */ | |
741 | struct rio_device_id { | |
742 | __u16 did, vid; | |
743 | __u16 asm_did, asm_vid; | |
744 | }; | |
745 | ||
3764e82e JT |
746 | struct mcb_device_id { |
747 | __u16 device; | |
748 | kernel_ulong_t driver_data; | |
749 | }; | |
750 | ||
289fcff4 HK |
751 | struct ulpi_device_id { |
752 | __u16 vendor; | |
753 | __u16 product; | |
754 | kernel_ulong_t driver_data; | |
755 | }; | |
756 | ||
0afef456 SY |
757 | /** |
758 | * struct fsl_mc_device_id - MC object device identifier | |
759 | * @vendor: vendor ID | |
760 | * @obj_type: MC object type | |
0afef456 SY |
761 | * |
762 | * Type of entries in the "device Id" table for MC object devices supported by | |
763 | * a MC object device driver. The last entry of the table has vendor set to 0x0 | |
764 | */ | |
765 | struct fsl_mc_device_id { | |
766 | __u16 vendor; | |
767 | const char obj_type[16]; | |
768 | }; | |
769 | ||
d1ff7024 MW |
770 | /** |
771 | * struct tb_service_id - Thunderbolt service identifiers | |
772 | * @match_flags: Flags used to match the structure | |
773 | * @protocol_key: Protocol key the service supports | |
774 | * @protocol_id: Protocol id the service supports | |
775 | * @protocol_version: Version of the protocol | |
776 | * @protocol_revision: Revision of the protocol software | |
777 | * @driver_data: Driver specific data | |
778 | * | |
779 | * Thunderbolt XDomain services are exposed as devices where each device | |
780 | * carries the protocol information the service supports. Thunderbolt | |
781 | * XDomain service drivers match against that information. | |
782 | */ | |
783 | struct tb_service_id { | |
784 | __u32 match_flags; | |
785 | char protocol_key[8 + 1]; | |
786 | __u32 protocol_id; | |
787 | __u32 protocol_version; | |
788 | __u32 protocol_revision; | |
789 | kernel_ulong_t driver_data; | |
790 | }; | |
791 | ||
792 | #define TBSVC_MATCH_PROTOCOL_KEY 0x0001 | |
793 | #define TBSVC_MATCH_PROTOCOL_ID 0x0002 | |
794 | #define TBSVC_MATCH_PROTOCOL_VERSION 0x0004 | |
795 | #define TBSVC_MATCH_PROTOCOL_REVISION 0x0008 | |
0afef456 | 796 | |
8a37d87d HK |
797 | /* USB Type-C Alternate Modes */ |
798 | ||
799 | #define TYPEC_ANY_MODE 0x7 | |
800 | ||
801 | /** | |
802 | * struct typec_device_id - USB Type-C alternate mode identifiers | |
803 | * @svid: Standard or Vendor ID | |
804 | * @mode: Mode index | |
d23df2dc | 805 | * @driver_data: Driver specific data |
8a37d87d HK |
806 | */ |
807 | struct typec_device_id { | |
808 | __u16 svid; | |
809 | __u8 mode; | |
810 | kernel_ulong_t driver_data; | |
811 | }; | |
812 | ||
0fc1db9d SG |
813 | /** |
814 | * struct tee_client_device_id - tee based device identifier | |
815 | * @uuid: For TEE based client devices we use the device uuid as | |
816 | * the identifier. | |
817 | */ | |
818 | struct tee_client_device_id { | |
819 | uuid_t uuid; | |
820 | }; | |
821 | ||
eacc95ea MJ |
822 | /* WMI */ |
823 | ||
824 | #define WMI_MODULE_PREFIX "wmi:" | |
825 | ||
826 | /** | |
827 | * struct wmi_device_id - WMI device identifier | |
828 | * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba | |
8732d85a | 829 | * @context: pointer to driver specific data |
eacc95ea MJ |
830 | */ |
831 | struct wmi_device_id { | |
832 | const char guid_string[UUID_STRING_LEN+1]; | |
a48e2338 | 833 | const void *context; |
eacc95ea MJ |
834 | }; |
835 | ||
e6b0de46 | 836 | #define MHI_DEVICE_MODALIAS_FMT "mhi:%s" |
0cbf2608 MS |
837 | #define MHI_NAME_SIZE 32 |
838 | ||
c268c0a8 MS |
839 | #define MHI_EP_DEVICE_MODALIAS_FMT "mhi_ep:%s" |
840 | ||
0cbf2608 MS |
841 | /** |
842 | * struct mhi_device_id - MHI device identification | |
843 | * @chan: MHI channel name | |
844 | * @driver_data: driver data; | |
845 | */ | |
846 | struct mhi_device_id { | |
847 | const char chan[MHI_NAME_SIZE]; | |
848 | kernel_ulong_t driver_data; | |
849 | }; | |
850 | ||
7de3697e DE |
851 | #define AUXILIARY_NAME_SIZE 32 |
852 | #define AUXILIARY_MODULE_PREFIX "auxiliary:" | |
853 | ||
854 | struct auxiliary_device_id { | |
855 | char name[AUXILIARY_NAME_SIZE]; | |
856 | kernel_ulong_t driver_data; | |
857 | }; | |
858 | ||
eb0e90a8 ML |
859 | /* Surface System Aggregator Module */ |
860 | ||
861 | #define SSAM_MATCH_TARGET 0x1 | |
862 | #define SSAM_MATCH_INSTANCE 0x2 | |
863 | #define SSAM_MATCH_FUNCTION 0x4 | |
864 | ||
865 | struct ssam_device_id { | |
866 | __u8 match_flags; | |
867 | ||
868 | __u8 domain; | |
869 | __u8 category; | |
870 | __u8 target; | |
871 | __u8 instance; | |
872 | __u8 function; | |
873 | ||
874 | kernel_ulong_t driver_data; | |
875 | }; | |
876 | ||
9326eecd XY |
877 | /* |
878 | * DFL (Device Feature List) | |
879 | * | |
880 | * DFL defines a linked list of feature headers within the device MMIO space to | |
881 | * provide an extensible way of adding features. Software can walk through these | |
882 | * predefined data structures to enumerate features. It is now used in the FPGA. | |
883 | * See Documentation/fpga/dfl.rst for more information. | |
884 | * | |
885 | * The dfl bus type is introduced to match the individual feature devices (dfl | |
886 | * devices) for specific dfl drivers. | |
887 | */ | |
888 | ||
889 | /** | |
890 | * struct dfl_device_id - dfl device identifier | |
891 | * @type: DFL FIU type of the device. See enum dfl_id_type. | |
892 | * @feature_id: feature identifier local to its DFL FIU type. | |
893 | * @driver_data: driver specific data. | |
894 | */ | |
895 | struct dfl_device_id { | |
896 | __u16 type; | |
897 | __u16 feature_id; | |
898 | kernel_ulong_t driver_data; | |
899 | }; | |
900 | ||
fa443bc3 TW |
901 | /* ISHTP (Integrated Sensor Hub Transport Protocol) */ |
902 | ||
903 | #define ISHTP_MODULE_PREFIX "ishtp:" | |
904 | ||
905 | /** | |
906 | * struct ishtp_device_id - ISHTP device identifier | |
64355db3 | 907 | * @guid: GUID of the device. |
bf9167a8 | 908 | * @driver_data: pointer to driver specific data |
fa443bc3 TW |
909 | */ |
910 | struct ishtp_device_id { | |
911 | guid_t guid; | |
bf9167a8 | 912 | kernel_ulong_t driver_data; |
fa443bc3 TW |
913 | }; |
914 | ||
2959ab24 NG |
915 | /** |
916 | * struct cdx_device_id - CDX device identifier | |
917 | * @vendor: Vendor ID | |
918 | * @device: Device ID | |
919 | * @override_only: Match only when dev->driver_override is this driver. | |
920 | * | |
921 | * Type of entries in the "device Id" table for CDX devices supported by | |
922 | * a CDX device driver. | |
923 | */ | |
924 | struct cdx_device_id { | |
925 | __u16 vendor; | |
926 | __u16 device; | |
927 | __u32 override_only; | |
928 | }; | |
929 | ||
1da177e4 | 930 | #endif /* LINUX_MOD_DEVICETABLE_H */ |