aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-02-26 14:04:43 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-28 00:43:33 -0800
commit4067a8541d397e9d6b443dd2ce0ecb78bfd991db (patch)
tree49690419b218020b8a0e9381db2f9cc90b658cd0 /include
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')
-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 cfff32fc6e3..1f4a52131c9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1375,6 +1375,10 @@ void pci_request_acs(void);
#define PCI_VPD_INFO_FLD_HDR_SIZE 3
+#define PCI_VPD_RO_KEYWORD_PARTNO "PN"
+#define PCI_VPD_RO_KEYWORD_MFR_ID "MN"
+#define PCI_VPD_RO_KEYWORD_VENDOR0 "V0"
+
/**
* pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
* @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)
*/
int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
+/**
+ * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD
+ * @buf: Pointer to buffered vpd data
+ * @off: The offset into the buffer at which to begin the search
+ * @len: The length of the buffer area, relative to off, in which to search
+ * @kw: The keyword to search for
+ *
+ * Returns the index where the information field keyword was found or
+ * -ENOENT otherwise.
+ */
+int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
+ unsigned int len, const char *kw);
+
#endif /* __KERNEL__ */
#endif /* LINUX_PCI_H */