Skip to content

Commit e22f5a6

Browse files
authored
Merge pull request #233 from kpandu987/rdkbaccl-1008
RDKBACCL-1004 : Need to add logic of wifi constant mac for EM builds
2 parents b5bc61a + dc5cd15 commit e22f5a6

File tree

5 files changed

+19
-41
lines changed

5 files changed

+19
-41
lines changed

meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ctrl.sh

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,11 @@ iw phy phy0 interface add wifi1 type __ap
66
iw phy phy0 interface add wifi1.1 type __ap
77
iw phy phy0 interface add wifi2 type __ap
88

9-
#Obtain the wifi0 mac address
10-
wifi0_mac="$(cat /sys/class/ieee80211/phy0/macaddress)"
11-
#Strip the : and increment mac by 1 to get wifi1 macaddress
12-
mac=$(echo $wifi0_mac | tr -d ':')
13-
mac_incr=$((0x$mac + 2))
14-
wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
15-
mac_incr=$(($mac_incr + 2))
16-
wifi1_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
17-
#Increment again by 1 to get wifi2 address
18-
mac_incr=$(($mac_incr + 2))
19-
wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
20-
mac_incr=$(($mac_incr + 2))
21-
wifi2_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
22-
#print the mac address
23-
echo $wifi0_mac
24-
echo $wifi1_mac
25-
echo $wifi2_mac
9+
#Obtain the wifi mac address
10+
wifi0_mac=`cat /nvram/mac_addresses.txt | grep -a wifi0 | cut -d " " -f 2`
11+
wifi1_mac=`cat /nvram/mac_addresses.txt | grep -a wifi1 | cut -d " " -f 2 | head -n1`
12+
wifi2_mac=`cat /nvram/mac_addresses.txt | grep -a wifi2 | cut -d " " -f 2`
13+
wifi1_1_mac=`cat /nvram/mac_addresses.txt | grep -a wifi1.1 | cut -d " " -f 2`
2614

2715
#Update the mac address using ip link command
2816
ifconfig wifi0 down

meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start_em_ext.sh

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,12 @@ iw phy phy0 interface add wifi1 type __ap
77
iw phy phy0 interface add wifi2 type __ap
88
iw phy phy0 interface add wifi1.1 type __ap
99

10-
#Obtain the wifi0 mac address
11-
wifi_mac="$(cat /sys/class/ieee80211/phy0/macaddress)"
12-
#Strip the : and increment mac by 1 to get wifi1 macaddress
13-
mac=$(echo $wifi_mac | tr -d ':')
14-
mac_incr=$((0x$mac + 8))
15-
wifi0_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
16-
#Increment again by 1 to get wifi2 address
17-
mac_incr=$(($mac_incr + 1))
18-
wifi0_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
19-
#Increment again by 1 to get wifi2 address
20-
mac_incr=$(($mac_incr + 1))
21-
wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
22-
mac_incr=$(($mac_incr + 1))
23-
wifi1_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
24-
mac_incr=$(($mac_incr + 1))
25-
wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
26-
#print the mac address
27-
echo $wifi0_mac
28-
echo $wifi1_mac
29-
echo $wifi2_mac
10+
#Obtain the wifi mac address
11+
wifi0_mac=`cat /nvram/mac_addresses.txt | grep -a wifi0 | cut -d " " -f 2 | head -n1`
12+
wifi1_mac=`cat /nvram/mac_addresses.txt | grep -a wifi1 | cut -d " " -f 2 | head -n1`
13+
wifi2_mac=`cat /nvram/mac_addresses.txt | grep -a wifi2 | cut -d " " -f 2`
14+
wifi0_1_mac=`cat /nvram/mac_addresses.txt | grep -a wifi0.1 | cut -d " " -f 2`
15+
wifi1_1_mac=`cat /nvram/mac_addresses.txt | grep -a wifi1.1 | cut -d " " -f 2`
3016

3117
#Update the mac address using ip link command
3218
ifconfig wifi0 down
@@ -40,6 +26,7 @@ ip link set dev wifi1 address $wifi1_mac
4026
ip link set dev wifi1.1 address $wifi1_1_mac
4127
ip link set dev wifi2 address $wifi2_mac
4228
ifconfig wifi0 up
29+
ifconfig wifi0.1 up
4330
ifconfig wifi1 up
4431
ifconfig wifi1.1 up
4532
ifconfig wifi2 up

meta-rdk-mtk-bpir4/recipes-core/packagegroups/packagegroup-ap-extender.bbappend

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ RDEPENDS_packagegroup-ap-extender = "\
1212
ccsp-psm-ccsp \
1313
unified-wifi-mesh \
1414
ieee1905-em \
15+
bpi-macaddress \
16+
bpi-serialnumber \
1517
"
1618
DEPENDS += " ccsp-common-library"

meta-rdk-mtk-bpir4/recipes-extended/macaddress/bpi-macaddress.bb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=175792518e4ac015ab6696d16c4f607e"
55

66
inherit autotools ${@bb.utils.contains("DISTRO_FEATURES", "kirkstone", "python3native", "pythonnative", d)} systemd
77

8-
SRC_URI = "${CMF_GITHUB_ROOT}/broadband-utils;protocol=https;nobranch=1"
8+
SRC_URI = "${CMF_GITHUB_ROOT}/broadband-utils;protocol=https;branch=develop"
99

1010
S = "${WORKDIR}/git"
1111
PV = "1.0.0"
12-
SRCREV = "10bae35768d234e969723aa51e9016f116f0870e"
12+
SRCREV = "d7510271e6860402dd6ecc30e50ebe530d7969bf"
1313

1414
CXXFLAGS_append = " -DAARCH64_BUILD"
15+
CXXFLAGS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'EasyMesh', bb.utils.contains('DISTRO_FEATURES', 'em_extender', ' -D_EM_EXT_BUILD_ -D_EM_BUILD_ ',' -D_EM_BUILD_ ', d), ' ', d)}"
1516

1617

1718
do_compile() {

meta-rdk-mtk-bpir4/recipes-extended/serialnumber/bpi-serialnumber.bb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=175792518e4ac015ab6696d16c4f607e"
55

66
inherit autotools ${@bb.utils.contains("DISTRO_FEATURES", "kirkstone", "python3native", "pythonnative", d)} systemd
77

8-
SRC_URI = "${CMF_GITHUB_ROOT}/broadband-utils;protocol=https;nobranch=1"
8+
SRC_URI = "${CMF_GITHUB_ROOT}/broadband-utils;protocol=https;branch=develop"
99

1010
S = "${WORKDIR}/git"
1111
PV = "1.0.0"
12-
SRCREV = "10bae35768d234e969723aa51e9016f116f0870e"
12+
SRCREV = "d7510271e6860402dd6ecc30e50ebe530d7969bf"
1313

1414
CFLAGS_append += " -DAARCH64_BUILD"
1515

0 commit comments

Comments
 (0)