[rdkb][common][app][Remove unused radio interface]
[Description]
Remove unused radio interface. Change ap mac offset.
[Release-log]
N/A
Change-Id: I0ac5c5f1b207d1de9885c4f60ee119785bc88561
diff --git a/recipes-wifi/hostapd/files/hostapd-init.sh b/recipes-wifi/hostapd/files/hostapd-init.sh
index 7bb37d3..5f0ca0c 100644
--- a/recipes-wifi/hostapd/files/hostapd-init.sh
+++ b/recipes-wifi/hostapd/files/hostapd-init.sh
@@ -13,8 +13,8 @@
band="$(uci get wireless.radio${phyidx}.band)"
channel="$(uci get wireless.radio${phyidx}.channel)"
- MAC="$(cat /sys/class/net/wlan${phyidx}/address)"
- NEW_MAC=$(echo 0x$MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+2, $2, $3, $4 ,$5, $6}')
+ MAC="$(cat /sys/class/ieee80211/phy${phyidx}/macaddress)"
+# NEW_MAC=$(echo 0x$MAC| awk -F: '{printf "%02x:%s:%s:%s:%s:%s", strtonum($1)+2, $2, $3, $4 ,$5, $6}')
chip="$(cat /sys/class/ieee80211/"$dev"/device/device)"
if [ $chip == "0x7915" ]; then
@@ -28,6 +28,7 @@
fi
old_path=$path
fi
+ iw wlan$phyidx del
if [ "$(uci get wireless.radio${phyidx}.disabled)" == "1" ]; then
phyidx=$(($phyidx + 1))
continue
@@ -73,7 +74,7 @@
fi
sed -i "/^interface=.*/c\interface=wifi$devidx" /nvram/hostapd"$devidx".conf
- sed -i "/^bssid=/c\bssid=$NEW_MAC" /nvram/hostapd"$devidx".conf
+ sed -i "/^bssid=/c\bssid=$MAC" /nvram/hostapd"$devidx".conf
echo "wpa_psk_file=/nvram/hostapd$devidx.psk" >> /nvram/hostapd"$devidx".conf
iw phy phy$phyidx interface add wifi$devidx type __ap
touch /nvram/hostapd-acl$devidx
diff --git a/recipes-wifi/wifi-test-tool/files/src/wifi-test-tool.c b/recipes-wifi/wifi-test-tool/files/src/wifi-test-tool.c
index b24b97b..f1e4c1f 100644
--- a/recipes-wifi/wifi-test-tool/files/src/wifi-test-tool.c
+++ b/recipes-wifi/wifi-test-tool/files/src/wifi-test-tool.c
@@ -245,7 +245,7 @@
char mac_file[64] = {0};
char mac_address[20] = {0};
- sprintf(mac_file, "/sys/class/net/wlan%d/address", phy_index);
+ sprintf(mac_file, "/sys/class/ieee80211/phy%d/macaddress", phy_index);
f = fopen(mac_file, "r");
if (f == NULL)
return -1;
@@ -536,6 +536,7 @@
if (strcmp(op->e.name, "device") == 0){
set_radionum(&intf_param, op->v.string);
}else if (strcmp(op->e.name, "mode") == 0){
+ intf_param.mac_offset = staCount[intf_param.radio_index] + apCount[intf_param.radio_index];
if (strncmp(op->v.string, "sta", 3) == 0) {
intf_param.sta_mode = TRUE;
intf_param.sta_index = intf_param.radio_index + staCount[intf_param.radio_index]*max_radio_num;
@@ -547,7 +548,6 @@
apCount[intf_param.radio_index] ++ ;
fprintf(stderr, "\n----- Start parsing ap %d config. -----\n", intf_param.ap_index);
}
- intf_param.mac_offset = staCount[intf_param.radio_index] + apCount[intf_param.radio_index];
}else if (strcmp(op->e.name, "ssid") == 0){
set_ssid(&intf_param, op->v.string);
}else if (strcmp(op->e.name, "encryption") == 0){