aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-02-26 09:04:43 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-28 03:43:33 -0500
commit4067a8541d397e9d6b443dd2ce0ecb78bfd991db (patch)
tree49690419b218020b8a0e9381db2f9cc90b658cd0 /include/linux
parente1d5bdabb94da89bdb3c3f2ee105cf61fca88ec8 (diff)
pci: Add helper to search for VPD keywords
This patch adds the pci_vpd_find_info_keyword() helper function to find information field keywords within read-only and read-write large resource data type sections. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index cfff32fc6e35..1f4a52131c99 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1375,6 +1375,10 @@ void pci_request_acs(void);
1375 1375
1376#define PCI_VPD_INFO_FLD_HDR_SIZE 3 1376#define PCI_VPD_INFO_FLD_HDR_SIZE 3
1377 1377
1378#define PCI_VPD_RO_KEYWORD_PARTNO "PN"
1379#define PCI_VPD_RO_KEYWORD_MFR_ID "MN"
1380#define PCI_VPD_RO_KEYWORD_VENDOR0 "V0"
1381
1378/** 1382/**
1379 * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length 1383 * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
1380 * @lrdt: Pointer to the beginning of the Large Resource Data Type tag 1384 * @lrdt: Pointer to the beginning of the Large Resource Data Type tag
@@ -1420,5 +1424,18 @@ static inline u8 pci_vpd_info_field_size(const u8 *info_field)
1420 */ 1424 */
1421int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt); 1425int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
1422 1426
1427/**
1428 * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD
1429 * @buf: Pointer to buffered vpd data
1430 * @off: The offset into the buffer at which to begin the search
1431 * @len: The length of the buffer area, relative to off, in which to search
1432 * @kw: The keyword to search for
1433 *
1434 * Returns the index where the information field keyword was found or
1435 * -ENOENT otherwise.
1436 */
1437int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1438 unsigned int len, const char *kw);
1439
1423#endif /* __KERNEL__ */ 1440#endif /* __KERNEL__ */
1424#endif /* LINUX_PCI_H */ 1441#endif /* LINUX_PCI_H */