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