From 557269a77d1ad0680eb36c7b51229279ae6715e9 Mon Sep 17 00:00:00 2001 From: hanwckf Date: Wed, 31 Jan 2024 23:43:12 +0800 Subject: [PATCH] mediatek: fix ruijie rg-x60 wifi mac --- .../dts/mediatek/mt7986a-ruijie-rg-x60-pro.dtsi | 2 +- .../mt7986/base-files/etc/board.d/02_network | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-ruijie-rg-x60-pro.dtsi b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-ruijie-rg-x60-pro.dtsi index 692a1b113c..07b844ebbb 100644 --- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-ruijie-rg-x60-pro.dtsi +++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-ruijie-rg-x60-pro.dtsi @@ -170,7 +170,7 @@ &spi0 { pinctrl-names = "default"; pinctrl-0 = <&spi_flash_pins>; - cs-gpios = <0>, <0>; + cs-gpios = <0>, <0>; status = "okay"; spi_nand: spi_nand@1 { diff --git a/target/linux/mediatek/mt7986/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7986/base-files/etc/board.d/02_network index 365b68f9bf..3cf94920a5 100755 --- a/target/linux/mediatek/mt7986/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7986/base-files/etc/board.d/02_network @@ -71,10 +71,16 @@ mediatek_setup_macs() label_mac=$(mtd_get_mac_ascii product_info ethaddr) wan_mac=$label_mac lan_mac=$(macaddr_add "$label_mac" 1) - local wifi_n_ax_mac="$(macaddr_add $label_mac 2)" - echo "MacAddress=$wifi_n_ax_mac" >> /etc/wireless/mediatek/mt7986-ax6000.dbdc.b0.dat - local wifi_ac_ax_mac="$(macaddr_add $label_mac 3)" - echo "MacAddress=$wifi_ac_ax_mac" >> /etc/wireless/mediatek/mt7986-ax6000.dbdc.b1.dat + local b0dat="$(l1dat if2dat ra0)" + local b1dat="$(l1dat if2dat rax0)" + if [ -f ${b0dat} ] && ! grep -q "MacAddress=" ${b0dat}; then + local b0mac="$(macaddr_add $label_mac 2)" + echo "MacAddress=$b0mac" >> ${b0dat} + fi + if [ -f ${b1dat} ] && ! grep -q "MacAddress=" ${b1dat}; then + local b1mac="$(macaddr_add $label_mac 3)" + echo "MacAddress=$b1mac" >> ${b1dat} + fi ;; jdcloud,re-cp-03) wan_mac=$(mmc_get_mac_binary factory 0x2a)