Skip to content

Commit 0e92e51

Browse files
authored
fix: UFS接口适配 (#72)
Description: UFS接口适配: KLVV --->KelvinV 3.1 KLVU--->KelvinU 3.0 or 3.1 PGUV--->PanguV 3.0 PGUW-->PanuW 和主线一致 Log: 判断是否为华为适配,并通过设备型号填写接口类型
1 parent 5a14413 commit 0e92e51

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

service/diskoperation/DeviceStorage.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,14 +536,24 @@ void DeviceStorage::getDiskInfoInterface(const QString &devicePath, QString &int
536536
QString bootDevicePath("/proc/bootdevice/product_name");
537537
QFile file(bootDevicePath);
538538

539-
if (file.open(QIODevice::ReadOnly) || true) {
540-
if (model == file.readLine().simplified() || true) {
541-
QString output1 = Utils::readContent("/sys/devices/platform/f8200000.ufs/host0/scsi_host/host0/wb_en").trimmed();
542-
QString output2 = Utils::readContent("/sys/block/sdd/device/spec_version").trimmed();
543-
if (output1 == "true" && output2 == "310") {
539+
if (file.open(QIODevice::ReadOnly)) {
540+
if (model == file.readLine().simplified()) {
541+
QString output, err;
542+
Utils::executeCmdWithArtList("dmidecode", QStringList() << "-s" << "system-product-name", output, err);
543+
if (output.contains("KLVU")) {
544+
QString output1 = Utils::readContent("/sys/devices/platform/f8200000.ufs/host0/scsi_host/host0/wb_en").trimmed();
545+
QString output2 = Utils::readContent("/sys/block/sdd/device/spec_version").trimmed();
546+
if (output1 == "true" && output2 == "310") {
547+
interface = "UFS 3.1";
548+
} else {
549+
interface = "UFS 3.0";
550+
}
551+
} else if (output.contains("KLVV")) {
544552
interface = "UFS 3.1";
545-
} else {
553+
} else if (output.contains("PGUV")) {
546554
interface = "UFS 3.0";
555+
} else {
556+
interface = "";
547557
}
548558
}
549559
file.close();

0 commit comments

Comments
 (0)