History

mod_devicetable.h: Split into per subsystem headers

<linux/mod_devicetable.h> is included transitively in nearly every driver in an x86_64 allmodconfig build of v7.1: $ find drivers -name \*.o -not -name \*.mod.o | wc -l 21330 $ find drivers -name \*.o.cmd -not -name \*.mod.o.cmd | xargs grep -l mod_devicetable.h | wc -l 17038 The result is that even when touching an obscure device id struct most of the kernel needs to be recompiled. Given that each driver typically only needs one or two of these structures, splitting into per subsystem headers and only including what is really needed reduces the amount of needed recompilation. Implement the first step and define each device id struct in a separate header (together with its associated #defines). <linux/mod_devicetable.h> is modified to include all the new headers to continue to provide the same symbols. Several headers currently include <linux/mod_devicetable.h>, those that are most lukrative to include only their subsystem headers only are: $ git -C source grep -l mod_devicetable.h include/linux | while read h; do echo -n "$h:"; find drivers -name \*.o.cmd -not -name \*.mod.o.cmd | xargs grep -l $h | wc -l; done | sort -t: -k2 -n -r | head include/linux/of.h:10897 include/linux/pci.h:7920 include/linux/acpi.h:7097 include/linux/i2c.h:5402 include/linux/spi/spi.h:1897 include/linux/dmi.h:1643 include/linux/usb.h:1222 include/linux/input.h:1205 include/linux/mdio.h:835 include/linux/phy.h:733 struct cpu_feature isn't really a device_id struct. That is kept in <linux/mod_devicetable.h> for now.

Uwe Kleine-König (The Capable Hub) committed 4 months ago

Commit ad428f51 parent dc59e4f57 files · +1521 −958Browse files

Showing the changes to include/linux (57 of 57 files). Show all

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t