Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /* pci-pf-stub - simple stub driver for PCI SR-IOV PF device
0003  *
0004  * This driver is meant to act as a "whitelist" for devices that provide
0005  * SR-IOV functionality while at the same time not actually needing a
0006  * driver of their own.
0007  */
0008 
0009 #include <linux/module.h>
0010 #include <linux/pci.h>
0011 
0012 /*
0013  * pci_pf_stub_whitelist - White list of devices to bind pci-pf-stub onto
0014  *
0015  * This table provides the list of IDs this driver is supposed to bind
0016  * onto.  You could think of this as a list of "quirked" devices where we
0017  * are adding support for SR-IOV here since there are no other drivers
0018  * that they would be running under.
0019  */
0020 static const struct pci_device_id pci_pf_stub_whitelist[] = {
0021     { PCI_VDEVICE(AMAZON, 0x0053) },
0022     /* required last entry */
0023     { 0 }
0024 };
0025 MODULE_DEVICE_TABLE(pci, pci_pf_stub_whitelist);
0026 
0027 static int pci_pf_stub_probe(struct pci_dev *dev,
0028                  const struct pci_device_id *id)
0029 {
0030     pci_info(dev, "claimed by pci-pf-stub\n");
0031     return 0;
0032 }
0033 
0034 static struct pci_driver pf_stub_driver = {
0035     .name           = "pci-pf-stub",
0036     .id_table       = pci_pf_stub_whitelist,
0037     .probe          = pci_pf_stub_probe,
0038     .sriov_configure    = pci_sriov_configure_simple,
0039 };
0040 module_pci_driver(pf_stub_driver);
0041 
0042 MODULE_LICENSE("GPL");