aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPiotr Kwapulinski <piotr.kwapulinski@intel.com>2024-12-18 14:12:37 +0100
committerTony Nguyen <anthony.l.nguyen@intel.com>2024-12-20 10:14:04 -0800
commit208fff3f567e2a3c3e7e4788845e90245c3891b4 (patch)
tree6028bf94a69e507921a4e9212e0dfd584dcd59eb
parentixgbe: Enable link management in E610 device (diff)
downloadwireguard-linux-208fff3f567e2a3c3e7e4788845e90245c3891b4.tar.xz
wireguard-linux-208fff3f567e2a3c3e7e4788845e90245c3891b4.zip
PCI: Add PCI_VDEVICE_SUB helper macro
PCI_VDEVICE_SUB generates the pci_device_id struct layout for the specific PCI device/subdevice. Private data may follow the output. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Rafal Romanowski <rafal.romanowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
-rw-r--r--include/linux/pci.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index db9b47ce3eef..414ee5fff66b 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1047,6 +1047,20 @@ struct pci_driver {
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0
/**
+ * PCI_VDEVICE_SUB - describe a specific PCI device/subdevice in a short form
+ * @vend: the vendor name
+ * @dev: the 16 bit PCI Device ID
+ * @subvend: the 16 bit PCI Subvendor ID
+ * @subdev: the 16 bit PCI Subdevice ID
+ *
+ * Generate the pci_device_id struct layout for the specific PCI
+ * device/subdevice. Private data may follow the output.
+ */
+#define PCI_VDEVICE_SUB(vend, dev, subvend, subdev) \
+ .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \
+ .subvendor = (subvend), .subdevice = (subdev), 0, 0
+
+/**
* PCI_DEVICE_DATA - macro used to describe a specific PCI device in very short form
* @vend: the vendor name (without PCI_VENDOR_ID_ prefix)
* @dev: the device name (without PCI_DEVICE_ID_<vend>_ prefix)