diff --git a/meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ctrl.sh b/meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ctrl.sh index 2fef123b..6aee4ea9 100644 --- a/meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ctrl.sh +++ b/meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ctrl.sh @@ -12,6 +12,7 @@ iw phy phy0 interface add wifi2 type __ap iw phy phy0 interface add wifi2.1 type __ap iw phy phy0 interface add wifi2.2 type __ap iw phy phy0 interface add mld0 type __ap radios all +iw phy phy0 interface add mld1 type __ap radios all #Obtain the wifi mac address wifi0_mac=`cat /nvram/mac_addresses.txt | grep -a wifi0 | cut -d " " -f 2 | head -n1` @@ -60,13 +61,23 @@ ifconfig wifi2.1 up ifconfig wifi2.2 up # Set MLD interface address as wifi2 MAC address + 1 -prefix="${wifi2_mac%:*}" -last_byte="${wifi2_mac##*:}" +prefix_mld0="${wifi2_mac%:*}" +last_byte_mld0="${wifi2_mac##*:}" -new_byte=$(printf "%02X" $(( (0x$last_byte + 1) & 0xFF ))) -new_mac="$prefix:$new_byte" +new_byte_mld0=$(printf "%02X" $(( (0x$last_byte_mld0 + 1) & 0xFF ))) +new_mac_mld0="$prefix_mld0:$new_byte_mld0" ip link set dev "mld0" down -ip link set dev "mld0" address "$new_mac" +ip link set dev "mld0" address "$new_mac_mld0" + +# Set MLD interface address as mld0 MAC address + 1 +prefix_mld1="${new_mac_mld0%:*}" +last_byte_mld1="${new_mac_mld0##*:}" + +new_byte_mld1=$(printf "%02X" $(( (0x$last_byte_mld1 + 1) & 0xFF ))) +new_mac_mld1="$prefix_mld1:$new_byte_mld1" + +ip link set dev "mld1" down +ip link set dev "mld1" address "$new_mac_mld1" exit 0 diff --git a/meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ext.sh b/meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ext.sh index 1de05b3a..a6436b9a 100644 --- a/meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ext.sh +++ b/meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ext.sh @@ -12,6 +12,7 @@ iw phy phy0 interface add wifi2 type __ap iw phy phy0 interface add wifi2.1 type __ap iw phy phy0 interface add wifi2.2 type __ap iw phy phy0 interface add mld0 type __ap radios all +iw phy phy0 interface add mld1 type __ap radios all #Obtain the wifi mac address wifi0_mac=`cat /nvram/mac_addresses.txt | grep -a wifi0 | cut -d " " -f 2 | head -n1` @@ -60,14 +61,24 @@ ifconfig wifi2.1 up ifconfig wifi2.2 up # Set MLD interface address as wifi2 MAC address + 1 -prefix="${wifi2_mac%:*}" -last_byte="${wifi2_mac##*:}" +prefix_mld0="${wifi2_mac%:*}" +last_byte_mld0="${wifi2_mac##*:}" -new_byte=$(printf "%02X" $(( (0x$last_byte + 1) & 0xFF ))) -new_mac="$prefix:$new_byte" +new_byte_mld0=$(printf "%02X" $(( (0x$last_byte_mld0 + 1) & 0xFF ))) +new_mac_mld0="$prefix_mld0:$new_byte_mld0" ip link set dev "mld0" down -ip link set dev "mld0" address "$new_mac" +ip link set dev "mld0" address "$new_mac_mld0" + +# Set MLD interface address as mld0 MAC address + 1 +prefix_mld1="${new_mac_mld0%:*}" +last_byte_mld1="${new_mac_mld0##*:}" + +new_byte_mld1=$(printf "%02X" $(( (0x$last_byte_mld1 + 1) & 0xFF ))) +new_mac_mld1="$prefix_mld1:$new_byte_mld1" + +ip link set dev "mld1" down +ip link set dev "mld1" address "$new_mac_mld1" #To update al_mac addr in EasymesgCfg.json al_mac_addr=`cat /nvram/EasymeshCfg.json | grep AL_MAC_ADDR | cut -d '"' -f4` diff --git a/meta-rdk-mtk-bpir4/recipes-ccsp/hal/files/InterfaceMap_em.json b/meta-rdk-mtk-bpir4/recipes-ccsp/hal/files/InterfaceMap_em.json index 5fe9e119..e896c121 100644 --- a/meta-rdk-mtk-bpir4/recipes-ccsp/hal/files/InterfaceMap_em.json +++ b/meta-rdk-mtk-bpir4/recipes-ccsp/hal/files/InterfaceMap_em.json @@ -16,6 +16,7 @@ }, { "InterfaceName": "wifi2.1", + "MldName": "mld1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 22, @@ -51,6 +52,7 @@ }, { "InterfaceName": "wifi1.1", + "MldName": "mld1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 13, @@ -80,6 +82,7 @@ }, { "InterfaceName": "wifi0.1", + "MldName": "mld1", "Bridge": "brlan0", "vlanId": 0, "vapIndex": 12,