MCPcopy Create free account
hub / github.com/actuallyaridan/linux-devmgmt / scanSystemDevices

Function scanSystemDevices

src/scanner/SysfsScanner.cpp:1829–1852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1827}
1828
1829QVector<Device> scanSystemDevices() {
1830 QVector<Device> out;
1831 QDir base("/sys/bus/pci/devices");
1832 for (const QString &entry : base.entryList(
1833 QDir::Dirs | QDir::NoDotAndDotDot)) {
1834 QString path = base.absoluteFilePath(entry);
1835 QString cls = readHexId(path + "/class");
1836 QString prefix2 = cls.left(2);
1837 if (prefix2 == "01" || prefix2 == "02" || prefix2 == "03"
1838 || prefix2 == "04" || cls.startsWith("0c03"))
1839 continue;
1840
1841 Device d = makePciDevice(path);
1842
1843 if (d.name.contains("Dummy", Qt::CaseInsensitive))
1844 continue;
1845 if (d.name.contains("Placeholder", Qt::CaseInsensitive))
1846 continue;
1847
1848 d.rawLocation = entry;
1849 out.append(d);
1850 }
1851 return out;
1852}
1853
1854QVector<Device> scanBlacklistedMissing(
1855 const QVector<DeviceCategory> &found) {

Callers 1

scanDevicesFunction · 0.85

Calls 2

readHexIdFunction · 0.85
makePciDeviceFunction · 0.85

Tested by

no test coverage detected