pci-pf-stub.c 1.2 KB

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