summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-02-26 15:04:39 +0100
committerDavid S. Miller <davem@davemloft.net>2010-02-28 09:43:30 +0100
commita2ce766238f72ff7337606c0bc96803c30c9e05c (patch)
tree5968e585402263556481075a49599dc697aeab49 /include
parentixgbe: move TC_PRIO_CONTROL check into ixgbe_select_queue() (diff)
downloadlinux-a2ce766238f72ff7337606c0bc96803c30c9e05c.tar.xz
linux-a2ce766238f72ff7337606c0bc96803c30c9e05c.zip
pci: Add PCI LRDT tag size and section size
This patch adds a preprocessor constant to describe the PCI VPD large resource data type tag size and an inline function to extract the large resource section size from the large resource data type tag. 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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index e2575f86133a..6f62a499023f 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1349,5 +1349,19 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
void pci_request_acs(void);
+
+#define PCI_VPD_LRDT_TAG_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
+ *
+ * Returns the extracted Large Resource Data Type length.
+ */
+static inline u16 pci_vpd_lrdt_size(const u8 *lrdt)
+{
+ return (u16)lrdt[1] + ((u16)lrdt[2] << 8);
+}
+
#endif /* __KERNEL__ */
#endif /* LINUX_PCI_H */