diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2021-08-26 20:55:43 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-08-31 16:08:15 -0500 |
commit | acfbb1b8a494d7bfd316dfb363a820e6df637e8d (patch) | |
tree | 3e0cadbca3067d42af92ecb1f6f012a3a2d5b60f /include/linux/pci.h | |
parent | 46a347835cc50b04da0996a070939ed8927d69bd (diff) | |
download | lwn-acfbb1b8a494d7bfd316dfb363a820e6df637e8d.tar.gz lwn-acfbb1b8a494d7bfd316dfb363a820e6df637e8d.zip |
PCI/VPD: Add pci_vpd_find_id_string()
Add a pci_vpd_find_id_string() API function to retrieve the ID string from
VPD.
This way callers don't need pci_vpd_lrdt_size() any longer, and it can be
made private to the VPD core.
Link: https://lore.kernel.org/r/c5225bf6-8d29-970d-e271-0d7b52252630@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 196cbf4c76a1..ea330ca0501a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2340,6 +2340,16 @@ static inline u8 pci_vpd_info_field_size(const u8 *info_field) void *pci_vpd_alloc(struct pci_dev *dev, unsigned int *size); /** + * pci_vpd_find_id_string - Locate id string in VPD + * @buf: Pointer to buffered VPD data + * @len: The length of the buffer area in which to search + * @size: Pointer to field where length of id string is returned + * + * Returns the index of the id string or -ENOENT if not found. + */ +int pci_vpd_find_id_string(const u8 *buf, unsigned int len, unsigned int *size); + +/** * pci_vpd_find_ro_info_keyword - Locate info field keyword in VPD RO section * @buf: Pointer to buffered VPD data * @len: The length of the buffer area in which to search |