Skip to content

Commit c98a782

Browse files
shuaijiedeepin-bot[bot]
authored andcommitted
fix: 部分UFS设备接口信息显示为UFS
部分UFS设备接口信息显示为UFS Log: 部分UFS设备接口信息显示为UFS Bug: https://pms.uniontech.com/bug-view-251373.html
1 parent b541937 commit c98a782

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,20 @@ bool DeviceStorage::setHwinfoInfo(const QMap<QString, QString> &mapInfo)
131131

132132
setAttribute(mapInfo, "SysFS BusID", m_KeyToLshw);
133133
setAttribute(mapInfo, "Device File", m_DeviceFile);
134+
135+
// 专有文件
136+
QString Path = "/sys/block" + m_DeviceFile.replace("/dev", "") + "/device/spec_version";
137+
QFile file(Path);
138+
if (file.open(QIODevice::ReadOnly)) {
139+
QString output2 = file.readAll();
140+
if (output2.contains("310", Qt::CaseInsensitive)) {
141+
m_Interface = "UFS 3.1";
142+
} else if (output2.contains("300", Qt::CaseInsensitive)) {
143+
m_Interface = "UFS 3.0";
144+
}
145+
file.close();
146+
}
147+
134148
if (m_KeyToLshw.contains("nvme", Qt::CaseInsensitive))
135149
setAttribute(mapInfo, "SysFS Device Link", m_NvmeKey);
136150

0 commit comments

Comments
 (0)