Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Device tables which are exported to userspace via
0004  * scripts/mod/file2alias.c.  You must keep that file in sync with this
0005  * header.
0006  */
0007 
0008 #ifndef LINUX_MOD_DEVICETABLE_H
0009 #define LINUX_MOD_DEVICETABLE_H
0010 
0011 #ifdef __KERNEL__
0012 #include <linux/types.h>
0013 #include <linux/uuid.h>
0014 typedef unsigned long kernel_ulong_t;
0015 #endif
0016 
0017 #define PCI_ANY_ID (~0)
0018 
0019 enum {
0020     PCI_ID_F_VFIO_DRIVER_OVERRIDE = 1,
0021 };
0022 
0023 /**
0024  * struct pci_device_id - PCI device ID structure
0025  * @vendor:     Vendor ID to match (or PCI_ANY_ID)
0026  * @device:     Device ID to match (or PCI_ANY_ID)
0027  * @subvendor:      Subsystem vendor ID to match (or PCI_ANY_ID)
0028  * @subdevice:      Subsystem device ID to match (or PCI_ANY_ID)
0029  * @class:      Device class, subclass, and "interface" to match.
0030  *          See Appendix D of the PCI Local Bus Spec or
0031  *          include/linux/pci_ids.h for a full list of classes.
0032  *          Most drivers do not need to specify class/class_mask
0033  *          as vendor/device is normally sufficient.
0034  * @class_mask:     Limit which sub-fields of the class field are compared.
0035  *          See drivers/scsi/sym53c8xx_2/ for example of usage.
0036  * @driver_data:    Data private to the driver.
0037  *          Most drivers don't need to use driver_data field.
0038  *          Best practice is to use driver_data as an index
0039  *          into a static list of equivalent device types,
0040  *          instead of using it as a pointer.
0041  * @override_only:  Match only when dev->driver_override is this driver.
0042  */
0043 struct pci_device_id {
0044     __u32 vendor, device;       /* Vendor and device ID or PCI_ANY_ID*/
0045     __u32 subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
0046     __u32 class, class_mask;    /* (class,subclass,prog-if) triplet */
0047     kernel_ulong_t driver_data; /* Data private to the driver */
0048     __u32 override_only;
0049 };
0050 
0051 
0052 #define IEEE1394_MATCH_VENDOR_ID    0x0001
0053 #define IEEE1394_MATCH_MODEL_ID     0x0002
0054 #define IEEE1394_MATCH_SPECIFIER_ID 0x0004
0055 #define IEEE1394_MATCH_VERSION      0x0008
0056 
0057 struct ieee1394_device_id {
0058     __u32 match_flags;
0059     __u32 vendor_id;
0060     __u32 model_id;
0061     __u32 specifier_id;
0062     __u32 version;
0063     kernel_ulong_t driver_data;
0064 };
0065 
0066 
0067 /*
0068  * Device table entry for "new style" table-driven USB drivers.
0069  * User mode code can read these tables to choose which modules to load.
0070  * Declare the table as a MODULE_DEVICE_TABLE.
0071  *
0072  * A probe() parameter will point to a matching entry from this table.
0073  * Use the driver_info field for each match to hold information tied
0074  * to that match:  device quirks, etc.
0075  *
0076  * Terminate the driver's table with an all-zeroes entry.
0077  * Use the flag values to control which fields are compared.
0078  */
0079 
0080 /**
0081  * struct usb_device_id - identifies USB devices for probing and hotplugging
0082  * @match_flags: Bit mask controlling which of the other fields are used to
0083  *  match against new devices. Any field except for driver_info may be
0084  *  used, although some only make sense in conjunction with other fields.
0085  *  This is usually set by a USB_DEVICE_*() macro, which sets all
0086  *  other fields in this structure except for driver_info.
0087  * @idVendor: USB vendor ID for a device; numbers are assigned
0088  *  by the USB forum to its members.
0089  * @idProduct: Vendor-assigned product ID.
0090  * @bcdDevice_lo: Low end of range of vendor-assigned product version numbers.
0091  *  This is also used to identify individual product versions, for
0092  *  a range consisting of a single device.
0093  * @bcdDevice_hi: High end of version number range.  The range of product
0094  *  versions is inclusive.
0095  * @bDeviceClass: Class of device; numbers are assigned
0096  *  by the USB forum.  Products may choose to implement classes,
0097  *  or be vendor-specific.  Device classes specify behavior of all
0098  *  the interfaces on a device.
0099  * @bDeviceSubClass: Subclass of device; associated with bDeviceClass.
0100  * @bDeviceProtocol: Protocol of device; associated with bDeviceClass.
0101  * @bInterfaceClass: Class of interface; numbers are assigned
0102  *  by the USB forum.  Products may choose to implement classes,
0103  *  or be vendor-specific.  Interface classes specify behavior only
0104  *  of a given interface; other interfaces may support other classes.
0105  * @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass.
0106  * @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass.
0107  * @bInterfaceNumber: Number of interface; composite devices may use
0108  *  fixed interface numbers to differentiate between vendor-specific
0109  *  interfaces.
0110  * @driver_info: Holds information used by the driver.  Usually it holds
0111  *  a pointer to a descriptor understood by the driver, or perhaps
0112  *  device flags.
0113  *
0114  * In most cases, drivers will create a table of device IDs by using
0115  * USB_DEVICE(), or similar macros designed for that purpose.
0116  * They will then export it to userspace using MODULE_DEVICE_TABLE(),
0117  * and provide it to the USB core through their usb_driver structure.
0118  *
0119  * See the usb_match_id() function for information about how matches are
0120  * performed.  Briefly, you will normally use one of several macros to help
0121  * construct these entries.  Each entry you provide will either identify
0122  * one or more specific products, or will identify a class of products
0123  * which have agreed to behave the same.  You should put the more specific
0124  * matches towards the beginning of your table, so that driver_info can
0125  * record quirks of specific products.
0126  */
0127 struct usb_device_id {
0128     /* which fields to match against? */
0129     __u16       match_flags;
0130 
0131     /* Used for product specific matches; range is inclusive */
0132     __u16       idVendor;
0133     __u16       idProduct;
0134     __u16       bcdDevice_lo;
0135     __u16       bcdDevice_hi;
0136 
0137     /* Used for device class matches */
0138     __u8        bDeviceClass;
0139     __u8        bDeviceSubClass;
0140     __u8        bDeviceProtocol;
0141 
0142     /* Used for interface class matches */
0143     __u8        bInterfaceClass;
0144     __u8        bInterfaceSubClass;
0145     __u8        bInterfaceProtocol;
0146 
0147     /* Used for vendor-specific interface matches */
0148     __u8        bInterfaceNumber;
0149 
0150     /* not matched against */
0151     kernel_ulong_t  driver_info
0152         __attribute__((aligned(sizeof(kernel_ulong_t))));
0153 };
0154 
0155 /* Some useful macros to use to create struct usb_device_id */
0156 #define USB_DEVICE_ID_MATCH_VENDOR      0x0001
0157 #define USB_DEVICE_ID_MATCH_PRODUCT     0x0002
0158 #define USB_DEVICE_ID_MATCH_DEV_LO      0x0004
0159 #define USB_DEVICE_ID_MATCH_DEV_HI      0x0008
0160 #define USB_DEVICE_ID_MATCH_DEV_CLASS       0x0010
0161 #define USB_DEVICE_ID_MATCH_DEV_SUBCLASS    0x0020
0162 #define USB_DEVICE_ID_MATCH_DEV_PROTOCOL    0x0040
0163 #define USB_DEVICE_ID_MATCH_INT_CLASS       0x0080
0164 #define USB_DEVICE_ID_MATCH_INT_SUBCLASS    0x0100
0165 #define USB_DEVICE_ID_MATCH_INT_PROTOCOL    0x0200
0166 #define USB_DEVICE_ID_MATCH_INT_NUMBER      0x0400
0167 
0168 #define HID_ANY_ID              (~0)
0169 #define HID_BUS_ANY             0xffff
0170 #define HID_GROUP_ANY               0x0000
0171 
0172 struct hid_device_id {
0173     __u16 bus;
0174     __u16 group;
0175     __u32 vendor;
0176     __u32 product;
0177     kernel_ulong_t driver_data;
0178 };
0179 
0180 /* s390 CCW devices */
0181 struct ccw_device_id {
0182     __u16   match_flags;    /* which fields to match against */
0183 
0184     __u16   cu_type;    /* control unit type     */
0185     __u16   dev_type;   /* device type           */
0186     __u8    cu_model;   /* control unit model    */
0187     __u8    dev_model;  /* device model          */
0188 
0189     kernel_ulong_t driver_info;
0190 };
0191 
0192 #define CCW_DEVICE_ID_MATCH_CU_TYPE     0x01
0193 #define CCW_DEVICE_ID_MATCH_CU_MODEL        0x02
0194 #define CCW_DEVICE_ID_MATCH_DEVICE_TYPE     0x04
0195 #define CCW_DEVICE_ID_MATCH_DEVICE_MODEL    0x08
0196 
0197 /* s390 AP bus devices */
0198 struct ap_device_id {
0199     __u16 match_flags;  /* which fields to match against */
0200     __u8 dev_type;      /* device type */
0201     kernel_ulong_t driver_info;
0202 };
0203 
0204 #define AP_DEVICE_ID_MATCH_CARD_TYPE        0x01
0205 #define AP_DEVICE_ID_MATCH_QUEUE_TYPE       0x02
0206 
0207 /* s390 css bus devices (subchannels) */
0208 struct css_device_id {
0209     __u8 match_flags;
0210     __u8 type; /* subchannel type */
0211     kernel_ulong_t driver_data;
0212 };
0213 
0214 #define ACPI_ID_LEN 16
0215 
0216 struct acpi_device_id {
0217     __u8 id[ACPI_ID_LEN];
0218     kernel_ulong_t driver_data;
0219     __u32 cls;
0220     __u32 cls_msk;
0221 };
0222 
0223 #define PNP_ID_LEN  8
0224 #define PNP_MAX_DEVICES 8
0225 
0226 struct pnp_device_id {
0227     __u8 id[PNP_ID_LEN];
0228     kernel_ulong_t driver_data;
0229 };
0230 
0231 struct pnp_card_device_id {
0232     __u8 id[PNP_ID_LEN];
0233     kernel_ulong_t driver_data;
0234     struct {
0235         __u8 id[PNP_ID_LEN];
0236     } devs[PNP_MAX_DEVICES];
0237 };
0238 
0239 
0240 #define SERIO_ANY   0xff
0241 
0242 struct serio_device_id {
0243     __u8 type;
0244     __u8 extra;
0245     __u8 id;
0246     __u8 proto;
0247 };
0248 
0249 struct hda_device_id {
0250     __u32 vendor_id;
0251     __u32 rev_id;
0252     __u8 api_version;
0253     const char *name;
0254     unsigned long driver_data;
0255 };
0256 
0257 struct sdw_device_id {
0258     __u16 mfg_id;
0259     __u16 part_id;
0260     __u8  sdw_version;
0261     __u8  class_id;
0262     kernel_ulong_t driver_data;
0263 };
0264 
0265 /*
0266  * Struct used for matching a device
0267  */
0268 struct of_device_id {
0269     char    name[32];
0270     char    type[32];
0271     char    compatible[128];
0272     const void *data;
0273 };
0274 
0275 /* VIO */
0276 struct vio_device_id {
0277     char type[32];
0278     char compat[32];
0279 };
0280 
0281 /* PCMCIA */
0282 
0283 struct pcmcia_device_id {
0284     __u16       match_flags;
0285 
0286     __u16       manf_id;
0287     __u16       card_id;
0288 
0289     __u8        func_id;
0290 
0291     /* for real multi-function devices */
0292     __u8        function;
0293 
0294     /* for pseudo multi-function devices */
0295     __u8        device_no;
0296 
0297     __u32       prod_id_hash[4];
0298 
0299     /* not matched against in kernelspace */
0300     const char *    prod_id[4];
0301 
0302     /* not matched against */
0303     kernel_ulong_t  driver_info;
0304     char *      cisfile;
0305 };
0306 
0307 #define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001
0308 #define PCMCIA_DEV_ID_MATCH_CARD_ID 0x0002
0309 #define PCMCIA_DEV_ID_MATCH_FUNC_ID 0x0004
0310 #define PCMCIA_DEV_ID_MATCH_FUNCTION    0x0008
0311 #define PCMCIA_DEV_ID_MATCH_PROD_ID1    0x0010
0312 #define PCMCIA_DEV_ID_MATCH_PROD_ID2    0x0020
0313 #define PCMCIA_DEV_ID_MATCH_PROD_ID3    0x0040
0314 #define PCMCIA_DEV_ID_MATCH_PROD_ID4    0x0080
0315 #define PCMCIA_DEV_ID_MATCH_DEVICE_NO   0x0100
0316 #define PCMCIA_DEV_ID_MATCH_FAKE_CIS    0x0200
0317 #define PCMCIA_DEV_ID_MATCH_ANONYMOUS   0x0400
0318 
0319 /* Input */
0320 #define INPUT_DEVICE_ID_EV_MAX      0x1f
0321 #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71
0322 #define INPUT_DEVICE_ID_KEY_MAX     0x2ff
0323 #define INPUT_DEVICE_ID_REL_MAX     0x0f
0324 #define INPUT_DEVICE_ID_ABS_MAX     0x3f
0325 #define INPUT_DEVICE_ID_MSC_MAX     0x07
0326 #define INPUT_DEVICE_ID_LED_MAX     0x0f
0327 #define INPUT_DEVICE_ID_SND_MAX     0x07
0328 #define INPUT_DEVICE_ID_FF_MAX      0x7f
0329 #define INPUT_DEVICE_ID_SW_MAX      0x10
0330 #define INPUT_DEVICE_ID_PROP_MAX    0x1f
0331 
0332 #define INPUT_DEVICE_ID_MATCH_BUS   1
0333 #define INPUT_DEVICE_ID_MATCH_VENDOR    2
0334 #define INPUT_DEVICE_ID_MATCH_PRODUCT   4
0335 #define INPUT_DEVICE_ID_MATCH_VERSION   8
0336 
0337 #define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010
0338 #define INPUT_DEVICE_ID_MATCH_KEYBIT    0x0020
0339 #define INPUT_DEVICE_ID_MATCH_RELBIT    0x0040
0340 #define INPUT_DEVICE_ID_MATCH_ABSBIT    0x0080
0341 #define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100
0342 #define INPUT_DEVICE_ID_MATCH_LEDBIT    0x0200
0343 #define INPUT_DEVICE_ID_MATCH_SNDBIT    0x0400
0344 #define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800
0345 #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
0346 #define INPUT_DEVICE_ID_MATCH_PROPBIT   0x2000
0347 
0348 struct input_device_id {
0349 
0350     kernel_ulong_t flags;
0351 
0352     __u16 bustype;
0353     __u16 vendor;
0354     __u16 product;
0355     __u16 version;
0356 
0357     kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
0358     kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
0359     kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
0360     kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
0361     kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
0362     kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
0363     kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
0364     kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
0365     kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
0366     kernel_ulong_t propbit[INPUT_DEVICE_ID_PROP_MAX / BITS_PER_LONG + 1];
0367 
0368     kernel_ulong_t driver_info;
0369 };
0370 
0371 /* EISA */
0372 
0373 #define EISA_SIG_LEN   8
0374 
0375 /* The EISA signature, in ASCII form, null terminated */
0376 struct eisa_device_id {
0377     char          sig[EISA_SIG_LEN];
0378     kernel_ulong_t driver_data;
0379 };
0380 
0381 #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s"
0382 
0383 struct parisc_device_id {
0384     __u8    hw_type;    /* 5 bits used */
0385     __u8    hversion_rev;   /* 4 bits */
0386     __u16   hversion;   /* 12 bits */
0387     __u32   sversion;   /* 20 bits */
0388 };
0389 
0390 #define PA_HWTYPE_ANY_ID    0xff
0391 #define PA_HVERSION_REV_ANY_ID  0xff
0392 #define PA_HVERSION_ANY_ID  0xffff
0393 #define PA_SVERSION_ANY_ID  0xffffffff
0394 
0395 /* SDIO */
0396 
0397 #define SDIO_ANY_ID (~0)
0398 
0399 struct sdio_device_id {
0400     __u8    class;          /* Standard interface or SDIO_ANY_ID */
0401     __u16   vendor;         /* Vendor or SDIO_ANY_ID */
0402     __u16   device;         /* Device ID or SDIO_ANY_ID */
0403     kernel_ulong_t driver_data; /* Data private to the driver */
0404 };
0405 
0406 /* SSB core, see drivers/ssb/ */
0407 struct ssb_device_id {
0408     __u16   vendor;
0409     __u16   coreid;
0410     __u8    revision;
0411     __u8    __pad;
0412 } __attribute__((packed, aligned(2)));
0413 #define SSB_DEVICE(_vendor, _coreid, _revision)  \
0414     { .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
0415 
0416 #define SSB_ANY_VENDOR      0xFFFF
0417 #define SSB_ANY_ID      0xFFFF
0418 #define SSB_ANY_REV     0xFF
0419 
0420 /* Broadcom's specific AMBA core, see drivers/bcma/ */
0421 struct bcma_device_id {
0422     __u16   manuf;
0423     __u16   id;
0424     __u8    rev;
0425     __u8    class;
0426 } __attribute__((packed,aligned(2)));
0427 #define BCMA_CORE(_manuf, _id, _rev, _class)  \
0428     { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, }
0429 
0430 #define BCMA_ANY_MANUF      0xFFFF
0431 #define BCMA_ANY_ID     0xFFFF
0432 #define BCMA_ANY_REV        0xFF
0433 #define BCMA_ANY_CLASS      0xFF
0434 
0435 struct virtio_device_id {
0436     __u32 device;
0437     __u32 vendor;
0438 };
0439 #define VIRTIO_DEV_ANY_ID   0xffffffff
0440 
0441 /*
0442  * For Hyper-V devices we use the device guid as the id.
0443  */
0444 struct hv_vmbus_device_id {
0445     guid_t guid;
0446     kernel_ulong_t driver_data; /* Data private to the driver */
0447 };
0448 
0449 /* rpmsg */
0450 
0451 #define RPMSG_NAME_SIZE         32
0452 #define RPMSG_DEVICE_MODALIAS_FMT   "rpmsg:%s"
0453 
0454 struct rpmsg_device_id {
0455     char name[RPMSG_NAME_SIZE];
0456     kernel_ulong_t driver_data;
0457 };
0458 
0459 /* i2c */
0460 
0461 #define I2C_NAME_SIZE   20
0462 #define I2C_MODULE_PREFIX "i2c:"
0463 
0464 struct i2c_device_id {
0465     char name[I2C_NAME_SIZE];
0466     kernel_ulong_t driver_data; /* Data private to the driver */
0467 };
0468 
0469 /* pci_epf */
0470 
0471 #define PCI_EPF_NAME_SIZE   20
0472 #define PCI_EPF_MODULE_PREFIX   "pci_epf:"
0473 
0474 struct pci_epf_device_id {
0475     char name[PCI_EPF_NAME_SIZE];
0476     kernel_ulong_t driver_data;
0477 };
0478 
0479 /* i3c */
0480 
0481 #define I3C_MATCH_DCR           0x1
0482 #define I3C_MATCH_MANUF         0x2
0483 #define I3C_MATCH_PART          0x4
0484 #define I3C_MATCH_EXTRA_INFO        0x8
0485 
0486 struct i3c_device_id {
0487     __u8 match_flags;
0488     __u8 dcr;
0489     __u16 manuf_id;
0490     __u16 part_id;
0491     __u16 extra_info;
0492 
0493     const void *data;
0494 };
0495 
0496 /* spi */
0497 
0498 #define SPI_NAME_SIZE   32
0499 #define SPI_MODULE_PREFIX "spi:"
0500 
0501 struct spi_device_id {
0502     char name[SPI_NAME_SIZE];
0503     kernel_ulong_t driver_data; /* Data private to the driver */
0504 };
0505 
0506 /* SLIMbus */
0507 
0508 #define SLIMBUS_NAME_SIZE   32
0509 #define SLIMBUS_MODULE_PREFIX   "slim:"
0510 
0511 struct slim_device_id {
0512     __u16 manf_id, prod_code;
0513     __u16 dev_index, instance;
0514 
0515     /* Data private to the driver */
0516     kernel_ulong_t driver_data;
0517 };
0518 
0519 #define APR_NAME_SIZE   32
0520 #define APR_MODULE_PREFIX "apr:"
0521 
0522 struct apr_device_id {
0523     char name[APR_NAME_SIZE];
0524     __u32 domain_id;
0525     __u32 svc_id;
0526     __u32 svc_version;
0527     kernel_ulong_t driver_data; /* Data private to the driver */
0528 };
0529 
0530 #define SPMI_NAME_SIZE  32
0531 #define SPMI_MODULE_PREFIX "spmi:"
0532 
0533 struct spmi_device_id {
0534     char name[SPMI_NAME_SIZE];
0535     kernel_ulong_t driver_data; /* Data private to the driver */
0536 };
0537 
0538 /* dmi */
0539 enum dmi_field {
0540     DMI_NONE,
0541     DMI_BIOS_VENDOR,
0542     DMI_BIOS_VERSION,
0543     DMI_BIOS_DATE,
0544     DMI_BIOS_RELEASE,
0545     DMI_EC_FIRMWARE_RELEASE,
0546     DMI_SYS_VENDOR,
0547     DMI_PRODUCT_NAME,
0548     DMI_PRODUCT_VERSION,
0549     DMI_PRODUCT_SERIAL,
0550     DMI_PRODUCT_UUID,
0551     DMI_PRODUCT_SKU,
0552     DMI_PRODUCT_FAMILY,
0553     DMI_BOARD_VENDOR,
0554     DMI_BOARD_NAME,
0555     DMI_BOARD_VERSION,
0556     DMI_BOARD_SERIAL,
0557     DMI_BOARD_ASSET_TAG,
0558     DMI_CHASSIS_VENDOR,
0559     DMI_CHASSIS_TYPE,
0560     DMI_CHASSIS_VERSION,
0561     DMI_CHASSIS_SERIAL,
0562     DMI_CHASSIS_ASSET_TAG,
0563     DMI_STRING_MAX,
0564     DMI_OEM_STRING, /* special case - will not be in dmi_ident */
0565 };
0566 
0567 struct dmi_strmatch {
0568     unsigned char slot:7;
0569     unsigned char exact_match:1;
0570     char substr[79];
0571 };
0572 
0573 struct dmi_system_id {
0574     int (*callback)(const struct dmi_system_id *);
0575     const char *ident;
0576     struct dmi_strmatch matches[4];
0577     void *driver_data;
0578 };
0579 /*
0580  * struct dmi_device_id appears during expansion of
0581  * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it
0582  * but this is enough for gcc 3.4.6 to error out:
0583  *  error: storage size of '__mod_dmi_device_table' isn't known
0584  */
0585 #define dmi_device_id dmi_system_id
0586 
0587 #define DMI_MATCH(a, b) { .slot = a, .substr = b }
0588 #define DMI_EXACT_MATCH(a, b)   { .slot = a, .substr = b, .exact_match = 1 }
0589 
0590 #define PLATFORM_NAME_SIZE  20
0591 #define PLATFORM_MODULE_PREFIX  "platform:"
0592 
0593 struct platform_device_id {
0594     char name[PLATFORM_NAME_SIZE];
0595     kernel_ulong_t driver_data;
0596 };
0597 
0598 #define MDIO_NAME_SIZE      32
0599 #define MDIO_MODULE_PREFIX  "mdio:"
0600 
0601 #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"
0602 #define MDIO_ID_ARGS(_id) \
0603     ((_id)>>31) & 1, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1, \
0604     ((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \
0605     ((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \
0606     ((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \
0607     ((_id)>>15) & 1, ((_id)>>14) & 1, ((_id)>>13) & 1, ((_id)>>12) & 1, \
0608     ((_id)>>11) & 1, ((_id)>>10) & 1, ((_id)>>9) & 1, ((_id)>>8) & 1, \
0609     ((_id)>>7) & 1, ((_id)>>6) & 1, ((_id)>>5) & 1, ((_id)>>4) & 1, \
0610     ((_id)>>3) & 1, ((_id)>>2) & 1, ((_id)>>1) & 1, (_id) & 1
0611 
0612 /**
0613  * struct mdio_device_id - identifies PHY devices on an MDIO/MII bus
0614  * @phy_id: The result of
0615  *     (mdio_read(&MII_PHYSID1) << 16 | mdio_read(&MII_PHYSID2)) & @phy_id_mask
0616  *     for this PHY type
0617  * @phy_id_mask: Defines the significant bits of @phy_id.  A value of 0
0618  *     is used to terminate an array of struct mdio_device_id.
0619  */
0620 struct mdio_device_id {
0621     __u32 phy_id;
0622     __u32 phy_id_mask;
0623 };
0624 
0625 struct zorro_device_id {
0626     __u32 id;           /* Device ID or ZORRO_WILDCARD */
0627     kernel_ulong_t driver_data; /* Data private to the driver */
0628 };
0629 
0630 #define ZORRO_WILDCARD          (0xffffffff)    /* not official */
0631 
0632 #define ZORRO_DEVICE_MODALIAS_FMT   "zorro:i%08X"
0633 
0634 #define ISAPNP_ANY_ID       0xffff
0635 struct isapnp_device_id {
0636     unsigned short card_vendor, card_device;
0637     unsigned short vendor, function;
0638     kernel_ulong_t driver_data; /* data private to the driver */
0639 };
0640 
0641 /**
0642  * struct amba_id - identifies a device on an AMBA bus
0643  * @id: The significant bits if the hardware device ID
0644  * @mask: Bitmask specifying which bits of the id field are significant when
0645  *  matching.  A driver binds to a device when ((hardware device ID) & mask)
0646  *  == id.
0647  * @data: Private data used by the driver.
0648  */
0649 struct amba_id {
0650     unsigned int        id;
0651     unsigned int        mask;
0652     void            *data;
0653 };
0654 
0655 /**
0656  * struct mips_cdmm_device_id - identifies devices in MIPS CDMM bus
0657  * @type:   Device type identifier.
0658  */
0659 struct mips_cdmm_device_id {
0660     __u8    type;
0661 };
0662 
0663 /*
0664  * Match x86 CPUs for CPU specific drivers.
0665  * See documentation of "x86_match_cpu" for details.
0666  */
0667 
0668 /*
0669  * MODULE_DEVICE_TABLE expects this struct to be called x86cpu_device_id.
0670  * Although gcc seems to ignore this error, clang fails without this define.
0671  */
0672 #define x86cpu_device_id x86_cpu_id
0673 struct x86_cpu_id {
0674     __u16 vendor;
0675     __u16 family;
0676     __u16 model;
0677     __u16 steppings;
0678     __u16 feature;  /* bit index */
0679     kernel_ulong_t driver_data;
0680 };
0681 
0682 /* Wild cards for x86_cpu_id::vendor, family, model and feature */
0683 #define X86_VENDOR_ANY 0xffff
0684 #define X86_FAMILY_ANY 0
0685 #define X86_MODEL_ANY  0
0686 #define X86_STEPPING_ANY 0
0687 #define X86_FEATURE_ANY 0   /* Same as FPU, you can't test for that */
0688 
0689 /*
0690  * Generic table type for matching CPU features.
0691  * @feature:    the bit number of the feature (0 - 65535)
0692  */
0693 
0694 struct cpu_feature {
0695     __u16   feature;
0696 };
0697 
0698 #define IPACK_ANY_FORMAT 0xff
0699 #define IPACK_ANY_ID (~0)
0700 struct ipack_device_id {
0701     __u8  format;           /* Format version or IPACK_ANY_ID */
0702     __u32 vendor;           /* Vendor ID or IPACK_ANY_ID */
0703     __u32 device;           /* Device ID or IPACK_ANY_ID */
0704 };
0705 
0706 #define MEI_CL_MODULE_PREFIX "mei:"
0707 #define MEI_CL_NAME_SIZE 32
0708 #define MEI_CL_VERSION_ANY 0xff
0709 
0710 /**
0711  * struct mei_cl_device_id - MEI client device identifier
0712  * @name: helper name
0713  * @uuid: client uuid
0714  * @version: client protocol version
0715  * @driver_info: information used by the driver.
0716  *
0717  * identifies mei client device by uuid and name
0718  */
0719 struct mei_cl_device_id {
0720     char name[MEI_CL_NAME_SIZE];
0721     uuid_le uuid;
0722     __u8    version;
0723     kernel_ulong_t driver_info;
0724 };
0725 
0726 /* RapidIO */
0727 
0728 #define RIO_ANY_ID  0xffff
0729 
0730 /**
0731  * struct rio_device_id - RIO device identifier
0732  * @did: RapidIO device ID
0733  * @vid: RapidIO vendor ID
0734  * @asm_did: RapidIO assembly device ID
0735  * @asm_vid: RapidIO assembly vendor ID
0736  *
0737  * Identifies a RapidIO device based on both the device/vendor IDs and
0738  * the assembly device/vendor IDs.
0739  */
0740 struct rio_device_id {
0741     __u16 did, vid;
0742     __u16 asm_did, asm_vid;
0743 };
0744 
0745 struct mcb_device_id {
0746     __u16 device;
0747     kernel_ulong_t driver_data;
0748 };
0749 
0750 struct ulpi_device_id {
0751     __u16 vendor;
0752     __u16 product;
0753     kernel_ulong_t driver_data;
0754 };
0755 
0756 /**
0757  * struct fsl_mc_device_id - MC object device identifier
0758  * @vendor: vendor ID
0759  * @obj_type: MC object type
0760  *
0761  * Type of entries in the "device Id" table for MC object devices supported by
0762  * a MC object device driver. The last entry of the table has vendor set to 0x0
0763  */
0764 struct fsl_mc_device_id {
0765     __u16 vendor;
0766     const char obj_type[16];
0767 };
0768 
0769 /**
0770  * struct tb_service_id - Thunderbolt service identifiers
0771  * @match_flags: Flags used to match the structure
0772  * @protocol_key: Protocol key the service supports
0773  * @protocol_id: Protocol id the service supports
0774  * @protocol_version: Version of the protocol
0775  * @protocol_revision: Revision of the protocol software
0776  * @driver_data: Driver specific data
0777  *
0778  * Thunderbolt XDomain services are exposed as devices where each device
0779  * carries the protocol information the service supports. Thunderbolt
0780  * XDomain service drivers match against that information.
0781  */
0782 struct tb_service_id {
0783     __u32 match_flags;
0784     char protocol_key[8 + 1];
0785     __u32 protocol_id;
0786     __u32 protocol_version;
0787     __u32 protocol_revision;
0788     kernel_ulong_t driver_data;
0789 };
0790 
0791 #define TBSVC_MATCH_PROTOCOL_KEY    0x0001
0792 #define TBSVC_MATCH_PROTOCOL_ID     0x0002
0793 #define TBSVC_MATCH_PROTOCOL_VERSION    0x0004
0794 #define TBSVC_MATCH_PROTOCOL_REVISION   0x0008
0795 
0796 /* USB Type-C Alternate Modes */
0797 
0798 #define TYPEC_ANY_MODE  0x7
0799 
0800 /**
0801  * struct typec_device_id - USB Type-C alternate mode identifiers
0802  * @svid: Standard or Vendor ID
0803  * @mode: Mode index
0804  * @driver_data: Driver specific data
0805  */
0806 struct typec_device_id {
0807     __u16 svid;
0808     __u8 mode;
0809     kernel_ulong_t driver_data;
0810 };
0811 
0812 /**
0813  * struct tee_client_device_id - tee based device identifier
0814  * @uuid: For TEE based client devices we use the device uuid as
0815  *        the identifier.
0816  */
0817 struct tee_client_device_id {
0818     uuid_t uuid;
0819 };
0820 
0821 /* WMI */
0822 
0823 #define WMI_MODULE_PREFIX   "wmi:"
0824 
0825 /**
0826  * struct wmi_device_id - WMI device identifier
0827  * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
0828  * @context: pointer to driver specific data
0829  */
0830 struct wmi_device_id {
0831     const char guid_string[UUID_STRING_LEN+1];
0832     const void *context;
0833 };
0834 
0835 #define MHI_DEVICE_MODALIAS_FMT "mhi:%s"
0836 #define MHI_NAME_SIZE 32
0837 
0838 #define MHI_EP_DEVICE_MODALIAS_FMT "mhi_ep:%s"
0839 
0840 /**
0841  * struct mhi_device_id - MHI device identification
0842  * @chan: MHI channel name
0843  * @driver_data: driver data;
0844  */
0845 struct mhi_device_id {
0846     const char chan[MHI_NAME_SIZE];
0847     kernel_ulong_t driver_data;
0848 };
0849 
0850 #define AUXILIARY_NAME_SIZE 32
0851 #define AUXILIARY_MODULE_PREFIX "auxiliary:"
0852 
0853 struct auxiliary_device_id {
0854     char name[AUXILIARY_NAME_SIZE];
0855     kernel_ulong_t driver_data;
0856 };
0857 
0858 /* Surface System Aggregator Module */
0859 
0860 #define SSAM_MATCH_TARGET   0x1
0861 #define SSAM_MATCH_INSTANCE 0x2
0862 #define SSAM_MATCH_FUNCTION 0x4
0863 
0864 struct ssam_device_id {
0865     __u8 match_flags;
0866 
0867     __u8 domain;
0868     __u8 category;
0869     __u8 target;
0870     __u8 instance;
0871     __u8 function;
0872 
0873     kernel_ulong_t driver_data;
0874 };
0875 
0876 /*
0877  * DFL (Device Feature List)
0878  *
0879  * DFL defines a linked list of feature headers within the device MMIO space to
0880  * provide an extensible way of adding features. Software can walk through these
0881  * predefined data structures to enumerate features. It is now used in the FPGA.
0882  * See Documentation/fpga/dfl.rst for more information.
0883  *
0884  * The dfl bus type is introduced to match the individual feature devices (dfl
0885  * devices) for specific dfl drivers.
0886  */
0887 
0888 /**
0889  * struct dfl_device_id -  dfl device identifier
0890  * @type: DFL FIU type of the device. See enum dfl_id_type.
0891  * @feature_id: feature identifier local to its DFL FIU type.
0892  * @driver_data: driver specific data.
0893  */
0894 struct dfl_device_id {
0895     __u16 type;
0896     __u16 feature_id;
0897     kernel_ulong_t driver_data;
0898 };
0899 
0900 /* ISHTP (Integrated Sensor Hub Transport Protocol) */
0901 
0902 #define ISHTP_MODULE_PREFIX "ishtp:"
0903 
0904 /**
0905  * struct ishtp_device_id - ISHTP device identifier
0906  * @guid: GUID of the device.
0907  * @driver_data: pointer to driver specific data
0908  */
0909 struct ishtp_device_id {
0910     guid_t guid;
0911     kernel_ulong_t driver_data;
0912 };
0913 
0914 #endif /* LINUX_MOD_DEVICETABLE_H */