| * Purpose: Provide PCI VPD support |
| * Copyright (C) 2010 Broadcom Corporation. |
| #include <linux/export.h> |
| int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt) |
| for (i = off; i < len; ) { |
| if (val & PCI_VPD_LRDT) { |
| /* Don't return success of the tag isn't complete */ |
| if (i + PCI_VPD_LRDT_TAG_SIZE > len) |
| i += PCI_VPD_LRDT_TAG_SIZE + |
| pci_vpd_lrdt_size(&buf[i]); |
| u8 tag = val & ~PCI_VPD_SRDT_LEN_MASK; |
| if (tag == PCI_VPD_SRDT_END) |
| i += PCI_VPD_SRDT_TAG_SIZE + |
| pci_vpd_srdt_size(&buf[i]); |
| EXPORT_SYMBOL_GPL(pci_vpd_find_tag); |
| int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, |
| unsigned int len, const char *kw) |
| for (i = off; i + PCI_VPD_INFO_FLD_HDR_SIZE <= off + len;) { |
| if (buf[i + 0] == kw[0] && |
| i += PCI_VPD_INFO_FLD_HDR_SIZE + |
| pci_vpd_info_field_size(&buf[i]); |
| EXPORT_SYMBOL_GPL(pci_vpd_find_info_keyword); |