map-agent: 6.3.2: mapagent config changes

This commit is contained in:
Jakob Olsson 2021-12-13 16:00:35 +01:00
parent 1d2d9b7b97
commit 09ad1ffa91
4 changed files with 61 additions and 25 deletions

View file

@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent PKG_NAME:=map-agent
PKG_VERSION:=6.3.1 PKG_VERSION:=6.3.2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=691c3b2c2d823e33a5b460653a5bb6b72d759866 PKG_SOURCE_VERSION:=dd5d55882cb204890dc7db51c697887e84def85b
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu> PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=PROPRIETARY IOPSYS PKG_LICENSE:=PROPRIETARY IOPSYS

View file

@ -4,7 +4,7 @@ config agent 'agent'
option profile '2' option profile '2'
option al_bridge 'br-lan' option al_bridge 'br-lan'
#config fh-iface #config ap
# option ifname 'wl0' # option ifname 'wl0'
# option steer 'rssi bssload' # option steer 'rssi bssload'
# list exclude '00:11:22:33:44:55' # list exclude '00:11:22:33:44:55'
@ -18,7 +18,7 @@ config agent 'agent'
# option assoc_ctrl_secs '30' # option assoc_ctrl_secs '30'
# option band '2' # option band '2'
#config fh-iface #config ap
# option ifname 'wl1' # option ifname 'wl1'
# option steer 'rssi bssload' # option steer 'rssi bssload'
# list exclude '00:11:22:33:44:55' # list exclude '00:11:22:33:44:55'

View file

@ -36,10 +36,10 @@ if [ "$LINK" = "up" ]; then
config_load "mapagent" config_load "mapagent"
bridge=$(uci get mapagent.agent.al_bridge | cut -d '-' -f2) bridge=$(uci get mapagent.agent.al_bridge | cut -d '-' -f2)
config_foreach remove_from_bridge bk-iface $bridge config_foreach remove_from_bridge bsta $bridge
config_foreach update_bstas bk-iface down config_foreach update_bstas bsta down
else else
rm -f /tmp/map.agent.bsta_global_disable rm -f /tmp/map.agent.bsta_global_disable
config_load "mapagent" config_load "mapagent"
config_foreach update_bstas bk-iface up config_foreach update_bstas bsta up
fi fi

View file

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