|
|
|
|
@@ -25,12 +25,41 @@ EOF
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type_to_multi_ap () {
|
|
|
|
|
type="$1"
|
|
|
|
|
|
|
|
|
|
if [ "$type" = "backhaul" ]; then
|
|
|
|
|
echo "1"
|
|
|
|
|
return
|
|
|
|
|
elif [ "$type" = "fronthaul" ]; then
|
|
|
|
|
echo "2"
|
|
|
|
|
return
|
|
|
|
|
elif [ "$type" = "combined" ]; then
|
|
|
|
|
echo "3"
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "0"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get_type_by_section() {
|
|
|
|
|
section="$1"
|
|
|
|
|
|
|
|
|
|
config_get type $section type "0"
|
|
|
|
|
|
|
|
|
|
echo "$(type_to_multi_ap $type)"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
brcm_sync_credentials() {
|
|
|
|
|
bands=""
|
|
|
|
|
mapagent_process_fh() {
|
|
|
|
|
local section=$1
|
|
|
|
|
local dev=$2
|
|
|
|
|
|
|
|
|
|
multi_ap=$(get_type_by_section $section)
|
|
|
|
|
[ "$multi_ap" == "0" ] && return
|
|
|
|
|
|
|
|
|
|
config_get device $section device
|
|
|
|
|
|
|
|
|
|
[ "$dev" != "$device" ] && return
|
|
|
|
|
@@ -64,7 +93,7 @@ brcm_sync_credentials() {
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_process_fh fh-iface $device
|
|
|
|
|
config_foreach mapagent_process_fh ap $device
|
|
|
|
|
bands="$bands $band"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -78,7 +107,7 @@ brcm_sync_credentials() {
|
|
|
|
|
config_foreach ieee1905_del_ap ap
|
|
|
|
|
|
|
|
|
|
config_load mapagent
|
|
|
|
|
config_foreach mapagent_process_radio wifi-radio
|
|
|
|
|
config_foreach mapagent_process_radio radio
|
|
|
|
|
|
|
|
|
|
uci commit ieee1905
|
|
|
|
|
}
|
|
|
|
|
@@ -116,8 +145,10 @@ brcm_write_credentials() {
|
|
|
|
|
local bk_ssid="$3"
|
|
|
|
|
local bk_key="$4"
|
|
|
|
|
|
|
|
|
|
multi_ap=$(get_type_by_section $section)
|
|
|
|
|
[ "$multi_ap" == "0" ] && return
|
|
|
|
|
|
|
|
|
|
config_get device $section device
|
|
|
|
|
config_get multi_ap $section multi_ap "0"
|
|
|
|
|
|
|
|
|
|
#echo found dev=$dev device=$device map=$multi_ap
|
|
|
|
|
|
|
|
|
|
@@ -136,8 +167,10 @@ brcm_write_credentials() {
|
|
|
|
|
local section=$1
|
|
|
|
|
local dev=$2
|
|
|
|
|
|
|
|
|
|
multi_ap=$(get_type_by_section $section)
|
|
|
|
|
[ "$multi_ap" == "0" ] && return
|
|
|
|
|
|
|
|
|
|
config_get device $section device
|
|
|
|
|
config_get multi_ap $section multi_ap "0"
|
|
|
|
|
config_get enabled $section enabled "1"
|
|
|
|
|
|
|
|
|
|
#echo found dev=$dev device=$device map=$multi_ap
|
|
|
|
|
@@ -151,7 +184,7 @@ brcm_write_credentials() {
|
|
|
|
|
|
|
|
|
|
#echo found ssid="$ssid" key="$key"
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_find_fbss fh-iface $dev "$ssid" "$key"
|
|
|
|
|
config_foreach mapagent_find_fbss ap $dev "$ssid" "$key"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mapagent_process_radio() {
|
|
|
|
|
@@ -161,11 +194,11 @@ brcm_write_credentials() {
|
|
|
|
|
|
|
|
|
|
#echo found dev=$dev
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_find_bbss fh-iface $device
|
|
|
|
|
config_foreach mapagent_find_bbss ap $device
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_process_radio wifi-radio
|
|
|
|
|
config_foreach mapagent_process_radio radio
|
|
|
|
|
|
|
|
|
|
uci commit wireless
|
|
|
|
|
}
|
|
|
|
|
@@ -237,7 +270,7 @@ write_bsta_config() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_process_bk bk-iface $ifname
|
|
|
|
|
config_foreach mapagent_process_bk bsta $ifname
|
|
|
|
|
|
|
|
|
|
#echo result diff = $diff > /dev/console
|
|
|
|
|
[ "$diff" == "1" ] && {
|
|
|
|
|
@@ -277,6 +310,9 @@ brcm_teardown_iface() {
|
|
|
|
|
local section=$1
|
|
|
|
|
local iface=$2
|
|
|
|
|
|
|
|
|
|
multi_ap=$(get_type_by_section $section)
|
|
|
|
|
[ "$multi_ap" == "0" ] && return
|
|
|
|
|
|
|
|
|
|
config_get ifname $section ifname
|
|
|
|
|
|
|
|
|
|
[ "$iface" != "$ifname" ] && return
|
|
|
|
|
@@ -291,7 +327,7 @@ brcm_teardown_iface() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_teardown_bss fh-iface $iface
|
|
|
|
|
config_foreach mapagent_teardown_bss ap $iface
|
|
|
|
|
|
|
|
|
|
uci commit wireless
|
|
|
|
|
uci commit mapagent
|
|
|
|
|
@@ -316,7 +352,7 @@ brcm_bsta_to_wireless() {
|
|
|
|
|
local sec=""
|
|
|
|
|
local prio="-1"
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_process_bk bk-iface
|
|
|
|
|
config_foreach mapagent_process_bk bsta
|
|
|
|
|
echo $sec
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -389,7 +425,7 @@ brcm_bsta_to_wireless() {
|
|
|
|
|
config_get enabled $1 enabled "0"
|
|
|
|
|
|
|
|
|
|
if [ "$onboarded" = "0" ]; then
|
|
|
|
|
config_foreach mapagent_find_other_creds bk-iface $ifname $band $enabled
|
|
|
|
|
config_foreach mapagent_find_other_creds bsta $ifname $band $enabled
|
|
|
|
|
else
|
|
|
|
|
config_get ssid $1 ssid
|
|
|
|
|
config_get key $1 key
|
|
|
|
|
@@ -408,11 +444,11 @@ brcm_bsta_to_wireless() {
|
|
|
|
|
# sec=""
|
|
|
|
|
# prio=""
|
|
|
|
|
#
|
|
|
|
|
# config_foreach mapagent_enable_best bk-iface $best
|
|
|
|
|
# config_foreach mapagent_enable_best bsta $best
|
|
|
|
|
# uci commit mapagent
|
|
|
|
|
config_load mapagent
|
|
|
|
|
|
|
|
|
|
diff=$(config_foreach mapagent_bsta_to_wireless bk-iface)
|
|
|
|
|
diff=$(config_foreach mapagent_bsta_to_wireless bsta)
|
|
|
|
|
|
|
|
|
|
# [ "$diff" != "" ] && {
|
|
|
|
|
ubus call uci commit '{"config":"wireless"}'
|
|
|
|
|
@@ -524,7 +560,7 @@ bsta_scan_on_enabled() {
|
|
|
|
|
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_enable_bk bk-iface
|
|
|
|
|
config_foreach mapagent_enable_bk bsta
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bsta_enable_all() {
|
|
|
|
|
@@ -535,7 +571,7 @@ bsta_enable_all() {
|
|
|
|
|
|
|
|
|
|
config_load mapagent
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_enable_bk bk-iface
|
|
|
|
|
config_foreach mapagent_enable_bk bsta
|
|
|
|
|
uci commit mapagent
|
|
|
|
|
bsta_scan_on_enabled
|
|
|
|
|
}
|
|
|
|
|
@@ -594,10 +630,10 @@ bsta_disable_lower_priority() {
|
|
|
|
|
|
|
|
|
|
local bsta=$1
|
|
|
|
|
|
|
|
|
|
prio=$(config_foreach mapagent_get_priority bk-iface $bsta)
|
|
|
|
|
prio=$(config_foreach mapagent_get_priority bsta $bsta)
|
|
|
|
|
#echo bsta $bsta has prio $prio > /dev/console
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_disable_lower_bk bk-iface $bsta $prio
|
|
|
|
|
config_foreach mapagent_disable_lower_bk bsta $bsta $prio
|
|
|
|
|
uci commit mapagent
|
|
|
|
|
|
|
|
|
|
# ubus call uci commit '{"config":"wireless"}'
|
|
|
|
|
@@ -622,7 +658,7 @@ bsta_use_link() {
|
|
|
|
|
|
|
|
|
|
local bsta=$1
|
|
|
|
|
|
|
|
|
|
config_foreach mapagent_disable_bk bk-iface $bsta
|
|
|
|
|
config_foreach mapagent_disable_bk bsta $bsta
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bsta_swap_to_link() {
|
|
|
|
|
|