Skip to content

Commit 58a88e5

Browse files
shuaijiedeepin-bot[bot]
authored andcommitted
feat: 适配某机型CPU内集成网卡
适配某机型CPU内集成网卡 Log: 适配某机型CPU内集成网卡 Task: https://pms.uniontech.com/task-view-359985.html
1 parent 067f8df commit 58a88e5

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

deepin-devicemanager/src/DeviceManager/DeviceNetwork.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ void DeviceNetwork::setInfoFromLshw(const QMap<QString, QString> &mapInfo)
102102
if (driverIsKernelIn(m_DriverModules) || driverIsKernelIn(m_Driver)) {
103103
m_CanUninstall = false;
104104
}
105+
if (m_Vendor.isEmpty() && !m_Name.isEmpty()) {
106+
if (m_Name.contains("ARM", Qt::CaseInsensitive))
107+
m_Vendor = "ARM Ltd";
108+
else
109+
m_Vendor = m_Name;
110+
}
105111

106112
// 加载其他信息
107113
getOtherMapInfo(mapInfo);
@@ -151,6 +157,7 @@ bool DeviceNetwork::setInfoFromHwinfo(const QMap<QString, QString> &mapInfo)
151157
m_CanUninstall = !driverIsKernelIn(m_Driver);
152158
return true;
153159
}
160+
setAttribute(mapInfo, "Device", m_Name);
154161
setAttribute(mapInfo, "Device File", m_LogicalName);
155162
setAttribute(mapInfo, "HW Address", m_MACAddress);
156163
setAttribute(mapInfo, "Permanent HW Address", m_UniqueID);

deepin-devicemanager/src/GenerateDevice/CmdTool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ void CmdTool::getMulHwinfoInfo(const QString &info)
580580
addMapInfo("hwinfo_sound", mapInfo);
581581
} else if (mapInfo["Hardware Class"].contains("network")) {
582582
//if (mapInfo.find("SysFS Device Link") != mapInfo.end() && mapInfo["SysFS Device Link"].contains("/devices/platform"))
583-
bool hasAddress = mapInfo.find("HW Address") != mapInfo.end() && mapInfo.find("Permanent HW Address") != mapInfo.end();
583+
bool hasAddress = mapInfo.find("HW Address") != mapInfo.end() || mapInfo.find("Permanent HW Address") != mapInfo.end();
584584
bool hasPath = mapInfo.find("path") != mapInfo.end();
585585
if (hasPath || hasAddress) {
586586
addMapInfo("hwinfo_network", mapInfo);

deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void DeviceGenerator::generatorNetworkDevice()
254254

255255
// 先判断是否是有效网卡信息
256256
// 符合两种情况中的一种 1. "HW Address" 和 "Permanent HW Address" 都必须有 2. 有 "unique_id"
257-
if (((*it).find("HW Address") == (*it).end() || (*it).find("Permanent HW Address") == (*it).end()) && ((*it).find("unique_id") == (*it).end())) {
257+
if (((*it).find("HW Address") == (*it).end() && (*it).find("Permanent HW Address") == (*it).end()) && ((*it).find("unique_id") == (*it).end())) {
258258
continue;
259259
}
260260

0 commit comments

Comments
 (0)