def express_cap_version()

in pci_lib/pci_lib.py [0:0]


    def express_cap_version(self):
        """
        Version number of the Express capability register.

        None if not a PCIe device.
        """
        with closing(PCIConfigSpace.get(self.device_name)) as config:
            express = find_capability(config, PCI_CAP_EXPRESS)
            if express is None:
                return None
            flags = read_u16(config, express + PCI_CAP_FLAGS)
            version = flags & 0xf
            return version