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