aboutsummaryrefslogtreecommitdiff
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-02-26 14:04:42 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-28 00:43:32 -0800
commite1d5bdabb94da89bdb3c3f2ee105cf61fca88ec8 (patch)
treebc5b86b19bc49ace2df10ed9e7ba7d1ca2b74d33 /include/linux/pci.h
parentb55ac1b22690d2e5b02a61cf6d69c2d66969c79d (diff)
pci: Add VPD information field helper functions
This patch adds a preprocessor constant to describe the PCI VPD information field header size and an inline function to extract the size of the information field itself. 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/pci.h')
-rw-r--r--include/linux/pci.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index e30ceea7345..cfff32fc6e3 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1373,6 +1373,8 @@ void pci_request_acs(void);
#define PCI_VPD_LRDT_TAG_SIZE 3
#define PCI_VPD_SRDT_TAG_SIZE 1
+#define PCI_VPD_INFO_FLD_HDR_SIZE 3
+
/**
* pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
* @lrdt: Pointer to the beginning of the Large Resource Data Type tag
@@ -1396,6 +1398,17 @@ static inline u8 pci_vpd_srdt_size(const u8 *srdt)
}
/**
+ * pci_vpd_info_field_size - Extracts the information field length
+ * @lrdt: Pointer to the beginning of an information field header
+ *
+ * Returns the extracted information field length.
+ */
+static inline u8 pci_vpd_info_field_size(const u8 *info_field)
+{
+ return info_field[2];
+}
+
+/**
* pci_vpd_find_tag - Locates the Resource Data Type tag provided
* @buf: Pointer to buffered vpd data
* @off: The offset into the buffer at which to begin the search