8000 RDKBACCL-423: OneWifi changes by amarnathhullur · Pull Request #58 · rdkcentral/meta-cmf-bananapi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RDKBACCL-423: OneWifi changes #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
#!/bin/sh

iw phy phy0 interface add wifi0 type __ap
iw phy phy1 interface add wifi1 type __ap
iw phy phy0 interface add wifi1 type __ap
iw phy phy0 interface add wifi2 type __ap

#Obtain the wifi0 mac address
wifi0_mac="$(cat /sys/class/ieee80211/phy0/macaddress)"
#Strip the : and increment mac by 1 to get wifi1 macaddress
mac=$(echo $wifi0_mac | tr -d ':')
mac_incr=$((0x$mac + 1))
wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
#Increment again by 1 to get wifi2 address
mac_incr=$(($mac_incr + 1))
wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
#print the mac address
echo $wifi0_mac
echo $wifi1_mac
echo $wifi2_mac

#Update the mac address using ip link command
ifconfig wifi0 down
ifconfig wifi1 down
ifconfig wifi2 down
ip link set dev wifi0 address $wifi0_mac
ip link set dev wifi1 address $wifi1_mac
ip link set dev wifi2 address $wifi2_mac
ifconfig wifi0 up
ifconfig wifi1 up
ifconfig wifi2 up

exit 0
48 changes: 48 additions & 0 deletions meta-rdk-mtk-bpir4/recipes-ccsp/hal/files/InterfaceMap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"PhyList": [
{
"Index": 0,
"RadioList": [
{
"Index": 2,
"RadioName": "wifi2",
"InterfaceList": [
{
"InterfaceName": "wifi2",
"Bridge": "brlan0",
"vlanId": 0,
"vapIndex": 2,
"vapName": "private_ssid_6g"
}
]
},
{
"Index": 1,
"RadioName": "wifi1",
"InterfaceList": [
{
"InterfaceName": "wifi1",
"Bridge": "brlan0",
"vlanId": 0,
"vapIndex": 1,
"vapName": "private_ssid_5g"
}
]
},
{
"Index": 0,
"RadioName": "wifi0",
"InterfaceList": [
{
"InterfaceName": "wifi0",
"Bridge": "brlan0",
"vlanId": 0,
"vapIndex": 0,
"vapName": "private_ssid_2g"
}
]
}
]
}
]
}
18 changes: 17 additions & 1 deletion meta-rdk-mtk-bpir4/recipes-ccsp/hal/rdk-wifi-hal.bbappend
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
CFLAGS_append = " -D_PLATFORM_BANANAPI_R4_ -DBANANA_PI_PORT "
CFLAGS_append = " -D_PLATFORM_BANANAPI_R4_ -DBANANA_PI_PORT -Wno-return-type -Wno-error=missing-field-initializers -Wno-error=unused-variable -Wno-error=sizeof-pointer-div -Wno-error=sizeof-pointer-memaccess -Wno-unused-function"
CFLAGS_append_kirkstone = " -fcommon"
EXTRA_OECONF_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'OneWifi', ' ONE_WIFIBUILD=true ', '', d)}"
EXTRA_OECONF_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'OneWifi', ' BANANA_PI_PORT=true ', '', d)}"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += " \
  file://InterfaceMap.json \
"

# Install InterfaceMap.json in /nvram
do_install_append() {
install -d ${D}/nvram
install -m 0644 ${WORKDIR}/InterfaceMap.json ${D}/nvram/InterfaceMap.json
}

FILES_${PN} += " \
  /nvram/InterfaceMap.json \
"
0