1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun /* pci-pf-stub - simple stub driver for PCI SR-IOV PF device
3*4882a593Smuzhiyun *
4*4882a593Smuzhiyun * This driver is meant to act as a "whitelist" for devices that provide
5*4882a593Smuzhiyun * SR-IOV functionality while at the same time not actually needing a
6*4882a593Smuzhiyun * driver of their own.
7*4882a593Smuzhiyun */
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun #include <linux/module.h>
10*4882a593Smuzhiyun #include <linux/pci.h>
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun /*
13*4882a593Smuzhiyun * pci_pf_stub_whitelist - White list of devices to bind pci-pf-stub onto
14*4882a593Smuzhiyun *
15*4882a593Smuzhiyun * This table provides the list of IDs this driver is supposed to bind
16*4882a593Smuzhiyun * onto. You could think of this as a list of "quirked" devices where we
17*4882a593Smuzhiyun * are adding support for SR-IOV here since there are no other drivers
18*4882a593Smuzhiyun * that they would be running under.
19*4882a593Smuzhiyun */
20*4882a593Smuzhiyun static const struct pci_device_id pci_pf_stub_whitelist[] = {
21*4882a593Smuzhiyun { PCI_VDEVICE(AMAZON, 0x0053) },
22*4882a593Smuzhiyun /* required last entry */
23*4882a593Smuzhiyun { 0 }
24*4882a593Smuzhiyun };
25*4882a593Smuzhiyun MODULE_DEVICE_TABLE(pci, pci_pf_stub_whitelist);
26*4882a593Smuzhiyun
pci_pf_stub_probe(struct pci_dev * dev,const struct pci_device_id * id)27*4882a593Smuzhiyun static int pci_pf_stub_probe(struct pci_dev *dev,
28*4882a593Smuzhiyun const struct pci_device_id *id)
29*4882a593Smuzhiyun {
30*4882a593Smuzhiyun pci_info(dev, "claimed by pci-pf-stub\n");
31*4882a593Smuzhiyun return 0;
32*4882a593Smuzhiyun }
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun static struct pci_driver pf_stub_driver = {
35*4882a593Smuzhiyun .name = "pci-pf-stub",
36*4882a593Smuzhiyun .id_table = pci_pf_stub_whitelist,
37*4882a593Smuzhiyun .probe = pci_pf_stub_probe,
38*4882a593Smuzhiyun .sriov_configure = pci_sriov_configure_simple,
39*4882a593Smuzhiyun };
40*4882a593Smuzhiyun module_pci_driver(pf_stub_driver);
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun MODULE_LICENSE("GPL");
43