How to program the WiFi MAC address on Edge2?

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu22

Which version of system do you use? Please provide the version of the system here:

selfbuild

Please describe your issue below:

help 

How to program the WiFi MAC address on Edge2 ?

Hello @Lexus

你需要修改Wi-Fi 驱动,打上如下patch:

diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile
index d69d589d039a9..175df90b50a41 100755
--- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile
+++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/Makefile
@@ -416,7 +416,8 @@ endif
        DHDCFLAGS += -DCUSTOMER_HW -DDHD_OF_SUPPORT
        DHDCFLAGS += -DCUSTOMER_HW_ROCKCHIP
        DHDCFLAGS += -DBCM_USE_PLATFORM_STRLCPY
-#      DHDCFLAGS += -DGET_CUSTOM_MAC_ENABLE
+       DHDCFLAGS += -DGET_CUSTOM_MAC_ENABLE
+       DHDCFLAGS += -DGET_CUSTOM_MAC_FROM_CONFIG
 endif

 ifneq ($(CONFIG_BCMDHD_PCIE),)
diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c
index bae7d2495b2b8..3927231bb7523 100755
--- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c
+++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c
@@ -4642,6 +4642,7 @@ dhd_conf_read_others(dhd_pub_t *dhd, char *full_param, uint len_param)
 #ifdef GET_CUSTOM_MAC_FROM_CONFIG
        struct ether_addr ea_addr;
        char macpad[56];
+       int i;
 #endif

        if (!strncmp("dhd_poll=", full_param, len_param)) {

重编内核或者固件,系统起来后在配置文件/lib/firmware/brcm/config_bcm43752a2_pcie_ag.txt中添加MAC地址mac=xx:xx:xx:xx:xx:xx例如:

root@Khadas:~# cat /lib/firmware/brcm/config_bcm43752a2_pcie_ag.txt
wl_preinit=pm2_sleep_ret=2000
mac=d4:9c:dd:f6:42:66

保存文件重启,Wi-Fi将会使用配置文件里面定义的MAC地址。

root@Khadas:~# ifconfig wlan0 | grep ether
        ether d4:9c:dd:f6:42:66  txqueuelen 1000  (Ethernet)
1 Like

Thank you! very very much :smiling_face_with_three_hearts:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.