xref: /linux/include/linux/device-id/pci.h (revision d2c9a99135da931377240942d44f3dea104cedb8)
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>
7 typedef unsigned long kernel_ulong_t;
8 #endif
9 
10 #define PCI_ANY_ID (~0)
11 
12 enum {
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  */
36 struct 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 
49 struct 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 */
55