Bug #113250

【BSP】【EVT2】【WIFI】【5/5】【Userdebug】wifi/BT的MAC读取和系统显示不一致

Added by CDTS_TEST 刘勇 over 2 years ago. Updated over 2 years ago.

Status:CLOSEDStart date:2022-10-28
Priority:NormalDue date:
Assignee:CDTS_TEST 刘勇% Done:

50%

Category:BSP
Target version:VX1_MCE_FSE_V3.0_update_20221115
Need_Info:-- Found Version:FlatBuild_HH_VX1_MCE_FSE.M.D.user.01.00.X101.202210280435
Resolution:-- Degrated:--
Severity:Normal Verified Version:
Reproducibility:Every time Fixed Version:
Test Type:IT Root cause:

Description

【前提条件】
1.烧录版本后,上电开机
【操作步骤】
1.使用命令读取wifi、BT、Ethernet的MAC地址
adb shell getprop ro.boot.wifimac
adb shell getprop ro.boot.btmac
adb shell getprop ro.boot.eth0mac
2.查看设备 --Setting-关于平板电脑 蓝牙mac/Wlanmac

【实际结果】
命令读取和 设备中的蓝牙地址、wifi地址显示不一致

【期望结果】
命令读取和设备中的蓝牙MAC/WIFIMAC一致

8aaace89-8e31-4e4c-86f9-a208649a91d0.jpeg (162 KB) CDTS_TEST 刘勇, 2022-10-28 14:01

8aaace89-8e31-4e4c-86f9-a208649a91d0

History

#1 Updated by CD BSP-杜磊 over 2 years ago

添加如下代码到wifi驱动里面,获取mac地址
+static int __init get_wifi_mac(char *str)

+{

+ pr_err("%s: str: %s\n", func, str);

+ return 1;

+}

+__setup("androidboot.wifimac=", get_wifi_mac);

#2 Updated by CD LC 陶洪普 over 2 years ago

  • Status changed from New to ASSIGNED

patch修改中,今日提交.

#4 Updated by CD LC 陶洪普 over 2 years ago

----wlan Log----
10-21 01:15:19.584 1932 1932 D wpa_supplicant: nl80211: Own MAC address on ifindex 17 (wlan0) changed from 72:b2:05:f2:73:35 to 00:03:7f:12:ae:e0
10-21 01:15:19.607 1428 1468 D LOWI-9.0.0.87.a: [LOWIWifiDriverUtils] getWiFiIdentityFromIoctl: ioctl(GET_MAC_ADDR) return: 0, Mac = 00:03:7f:12:ae:e0
10-21 01:15:19.633 1442 1859 I WifiClientModeImpl[wlan0]: Connecting with 00:03:7f:12:ae:e0 as the mac address

#5 Updated by CD LC 陶洪普 over 2 years ago

  • Target version changed from VC1_FSE_展车SW_20221030 to VX1_MCE_FSE_V3.0_update_20221115

WLAN MAC settings has some problems.
As the 1030 has expired, change to 1115.
Will complete with high priority.

#6 Updated by CD LC 陶洪普 over 2 years ago

1044 static void nl80211_refresh_mac(struct wpa_driver_nl80211_data *drv,
1045 int ifindex, int notify)
1046 {
1047 struct i802_bss *bss;
1048 u8 addr[ETH_ALEN];
1049
1050 bss = get_bss_ifindex(drv, ifindex);
1051 if (bss &&
1052 linux_get_ifhwaddr(drv->global->ioctl_sock,
1053 bss->ifname, addr) < 0) {
1054 wpa_printf(MSG_DEBUG,
1055 "nl80211: s: failed to re-read MAC address",
1056 bss->ifname);
1057 } else if (bss &x%x
os_memcmp(addr, bss->addr, ETH_ALEN) != 0) {
1058 wpa_printf(MSG_DEBUG,
1059 "nl80211: Own MAC address on ifindex %d (%s) changed from "
1060 MACSTR " to " MACSTR,
1061 ifindex, bss->ifname,
1062 MAC2STR, MAC2STR);
1063 os_memcpy(bss->addr, addr, ETH_ALEN);

#9 Updated by CD LC 陶洪普 over 2 years ago

  • % Done changed from 0 to 30

#10 Updated by CDTS_TEST 刘勇 over 2 years ago

  • Subject changed from 【BSP】【EVT2】【WIFI】【必现】【Userdebug】wifi/BT的MAC读取和系统显示不一致 to 【BSP】【EVT2】【WIFI】【5/5】【Userdebug】wifi/BT的MAC读取和系统显示不一致

#11 Updated by CD LC 陶洪普 over 2 years ago

版本已经编译出来了,今天自验证.

#12 Updated by CD LC 陶洪普 over 2 years ago

通过property保存的MAC地址没有冒号分隔符号,导致解析出错.更新了patch.
在重新编译中
http://10.0.76.24:8080/job/VerifyBuild_for_IOT_6490/2287/

#13 Updated by CD LC 陶洪普 over 2 years ago

本地已验证通过
http://10.0.76.24:8080/job/VerifyBuild_for_IOT_6490/2325/
下一步:review&入库。

#14 Updated by 移动测试一组_CDTS 刘强 over 2 years ago

测试版本:FlatBuild_HH_VX1_MCE_FSE.M.D.userdebug.01.00.X101.202211141239
命令获取MAC:
C:\Users\liuqiang0703>adb shell getprop ro.boot.wifimac
F074E43A1921

C:\Users\liuqiang0703>adb shell getprop ro.boot.eth0mac
F074E43A19C1

C:\Users\liuqiang0703>adb shell getprop ro.boot.btmac
F074E43A1881

ifconfig 获取mac地址:
1|figure:/ # ifconfig wlan0 (网络随机分配mac模式)
wlan0 Link encap:Ethernet HWaddr 42:ad:b2:d8:07:4c Driver cnss_pci
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:2872 errors:0 dropped:0 overruns:0 frame:0
TX packets:2929 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:986331 TX bytes:888494
1|figure:/ # ifconfig wlan0 (使用设备mac模式)
wlan0 Link encap:Ethernet HWaddr a2:9a:3f:20:9e:c2 Driver cnss_pci
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:2872 errors:0 dropped:0 overruns:0 frame:0
TX packets:2929 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:986331 TX bytes:888494

figure:/ # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:80:0f:74:31:00 Driver lan743x
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0

设备about phone中mac地址
WIFI:F074E43A19C1
BTmac:F074E43A1881
------------------------------------------------
综上:
getprop ro.boot.wifimac:F074E43A19C1
getprop ro.boot.eth0mac:F074E43A1921
getprop ro.boot.btmac: F074E43A1881
与系统设置界面中的WIFI/BTmac地址显示一致,
WIFI:F074E43A19C1
BTmac: F074E43A1881

但是与ifconfig读取的mac地址不一致
WIFI:42:ad:b2:d8:07:4c/a2:9a:3f:20:9e:c2
Eth:00:80:0f:74:31:00

#15 Updated by 移动测试一组_CDTS 刘强 over 2 years ago

Update
根据RD备注:wifi的MAC如果之前已经启动,需要恢复出厂设置生效
即如果写入mac地址之后,后续修改需要生效,必须恢复一次出厂设置,或者烧机前勾选earse userdata;(一次即可)

恢复出厂设置后,后续再进行刷机(不擦除userdata)同样wlan0可以正常同步显示

figure:/ # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:80:0f:74:31:00 Driver lan743x
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0

figure:/ # ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 02:52:a4:aa:2e:44 Driver cnss_pci
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:0 TX bytes:0

figure:/ # service call bluetooth_manager 12
Result: Parcel(
0x00000000: 00000000 00000011 00300046 0037003a '........F.0.:.7.'
0x00000010: 003a0034 00340045 0033003a 003a0041 '4.:.E.4.:.3.A.:.'
0x00000020: 00380031 0038003a 00000031 '1.8.:.8.1... ')

C:\Users\liuqiang0703>adb shell getprop ro.boot.btmac
F074E43A1881

C:\Users\liuqiang0703>adb shell getprop ro.boot.eth0mac
F074E43A19C1

C:\Users\liuqiang0703>adb shell getprop ro.boot.wifimac
F074E43A1921

系统界面显示:
btmac
F074E43A1881
wifimac
F074E43A1921

#16 Updated by CD LC 陶洪普 over 2 years ago

BT:
https://dev.thundercomm.com/gerrit/c/general/LINUX/android/vendor/qcom/proprietary/+/159133

wifi patch
http://dev.thundercomm.com/gerrit/c/general/platform/packages/modules/Wifi/+/160638
已入库,请使用11.15测试.

Eth0的MAC地址,与唐金泽确认,不是使用的这个property.

#17 Updated by CD LC 陶洪普 over 2 years ago

  • Status changed from ASSIGNED to RESOLVED
  • Assignee changed from CD LC 陶洪普 to CDTS_TEST 王成
  • % Done changed from 30 to 50

#18 Updated by CDTS_TEST 王成 over 2 years ago

  • Assignee changed from CDTS_TEST 王成 to CDTS_TEST 刘勇

#19 Updated by CDTS_TEST 刘勇 over 2 years ago

  • Status changed from RESOLVED to VERIFIED

【HW】EVT2-VC1
【SW】FlatBuild_HH_VX1_MCE_FSE.M.D.userdebug.01.00.X101.202211190313
【前提条件】
1.烧录版本后,上电开机
【操作步骤】
1.使用命令读取wifi、BT、Ethernet的MAC地址
adb shell getprop ro.boot.wifimac
adb shell getprop ro.boot.btmac
adb shell getprop ro.boot.eth0mac
2.使用命令修改WIFI\BT的MAC地址
adb shell rw_reservepartition w wifimac c8d9d206dbbb
adb shell rw_reservepartition w btmac c8d9d206daaa
3.查看设备-Setting-关于平板电脑 蓝牙mac/WIFI MAC 与修改后获取地址一致

【实际结果】
3.命令读取设备中的蓝牙MAC/WIFIMAC和写入的MAC一致

【测试次数】2次
【测试结果】PASS,验证通过
【Comment】修改eth0mac 后命令读取与修改一致,但Setting-关于平板-IP地址下的MAC不一致。

#20 Updated by CDTS_TEST 刘勇 over 2 years ago

  • Status changed from VERIFIED to CLOSED

#21 Updated by CD FW-王伟 over 2 years ago

  • Sticky changed from 1 to 0
Gerrit Merge Information
ID Project Branch Uploader
159133 general/LINUX/android/vendor/qcom/proprietary Pre_figure_turbox-c2130c-la1.1-vendor-dev
BT: Set BT mac via "ro.boot.btmac"
SInce the MAC has been customized to be written into "ro.boot.btmac",
so use this property instead of "ro.vendor.bt.boot.macaddr".
TC-RID: 1201-0400104
IssueID: TS-R-BUG-113250
Change-Id: Ifc4a296da07da5551405686e56b726076c7e7366

#22 Updated by CD FW-王伟 over 2 years ago

Gerrit Merge Information
ID Project Branch Uploader
160638 general/platform/packages/modules/Wifi Pre_figure_turbox-c2130c-la1.1-qssi12-dev
WLAN: Get fractory wifi mac from property
Get fractory wifi mac from property "ro.boot.wifimac".
TC-RID: 1201-0400203
IssueID: TS-R-BUG-113250
Change-Id: Ia09fe95aeb4d8847e4aa7597030e4b3bbecf6026

#23 Updated by CD FW-王伟 over 2 years ago

Gerrit Merge Information
ID Project Branch Uploader
162760 general/platform/packages/modules/Wifi Pre_figure_turbox-c2130c-la1.1-qssi12-dev
WLAN: Add the checking of mac address
Add the checking of the mac address given from "ro.boot.wifimac".
TC-RID: 1201-0400203
IssueID: TS-R-BUG-113250
Change-Id: I9e476a5e9683ef5c3143f809b91d418962144740

Also available in: Atom PDF