]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/pci.h
pci: Add PCI LRDT tag size and section size
[net-next-2.6.git] / include / linux / pci.h
index e2575f86133afb5d9a4c9328c5998ff04ba0b1ec..6f62a499023f5473874bd462e78ce0c1b8f5d900 100644 (file)
@@ -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 */