diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2021-08-20 15:32:42 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-08-20 15:48:47 -0500 |
commit | 6107e5cb907cffc5576cc1297847f9fc69a8d5d9 (patch) | |
tree | 298f8f2585311874a1b60faa149fc009d1cbb5b0 /include/linux/pci.h | |
parent | 9e515c9f6c0b6f0ace6f5cf2202b527d745b494d (diff) | |
download | linux-stable-6107e5cb907cffc5576cc1297847f9fc69a8d5d9.tar.gz linux-stable-6107e5cb907cffc5576cc1297847f9fc69a8d5d9.tar.bz2 linux-stable-6107e5cb907cffc5576cc1297847f9fc69a8d5d9.zip |
PCI/VPD: Add pci_vpd_check_csum()
VPD checksum information and checksum calculation are specified by PCIe
r5.0, sec 6.28.2.2. Therefore checksum handling can and should be moved
into the PCI VPD core.
Add pci_vpd_check_csum() to validate the VPD checksum.
[bhelgaas: split to separate patch]
Link: https://lore.kernel.org/r/1643bd7a-088e-1028-c9b0-9d112cf48d63@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 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 9e3b60963a52..827b7eefd550 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2376,6 +2376,15 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, int pci_vpd_find_ro_info_keyword(const void *buf, unsigned int len, const char *kw, unsigned int *size); +/** + * pci_vpd_check_csum - Check VPD checksum + * @buf: Pointer to buffered VPD data + * @len: VPD size + * + * Returns 1 if VPD has no checksum, otherwise 0 or an errno + */ +int pci_vpd_check_csum(const void *buf, unsigned int len); + /* PCI <-> OF binding helpers */ #ifdef CONFIG_OF struct device_node; |