summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPiotr Kwapulinski <piotr.kwapulinski@intel.com>2025-10-20 21:10:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-23 17:16:42 +0300
commit6d45973518184c47a5b836596dcf953d69c32ea9 (patch)
tree0d16de6fe3b9d8d1d83eaa5b13e0d1df2ca5ac66 /include/linux
parent247d1fff85e0e456d0299cbb83c47be829880bdd (diff)
downloadlinux-6d45973518184c47a5b836596dcf953d69c32ea9.tar.xz
PCI: Add PCI_VDEVICE_SUB helper macro
[ Upstream commit 208fff3f567e2a3c3e7e4788845e90245c3891b4 ] 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> Stable-dep-of: a7075f501bd3 ("ixgbevf: fix mailbox API compatibility by negotiating supported features") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-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 0511f6f9a4e6..e4338237a054 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1035,6 +1035,20 @@ static inline struct pci_driver *to_pci_driver(struct device_driver *drv)
.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)