mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-23 02:24:16 +08:00
Compare commits
2 Commits
sysmngr_me
...
jo-devel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4cc650afd | ||
|
|
00560b6e1e |
45
map-agent/files/etc/hotplug.d/ieee80211/30-generate-map-config
Executable file
45
map-agent/files/etc/hotplug.d/ieee80211/30-generate-map-config
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
is_airoha() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
strings /proc/device-tree/compatible | grep -qE '^(econet,|airoha,)'; return
|
||||
}
|
||||
|
||||
is_broadcom() {
|
||||
[ -e /dev/bcm ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
is_qualcomm() {
|
||||
[ -d /sys/module/ath12k ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
if is_airoha; then
|
||||
/lib/wifi/multiap conf
|
||||
elif is_broadcom; then
|
||||
phy_to_radio() {
|
||||
section="$1"
|
||||
dev="$2"
|
||||
|
||||
config_get phy $section phy
|
||||
|
||||
[ "$dev" = "$phy" ] && {
|
||||
echo "$section"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
|
||||
dev=$DEVICENAME
|
||||
radio="$(config_foreach phy_to_radio wifi-device $dev)"
|
||||
/lib/wifi/multiap conf $radio
|
||||
elif is_qualcomm; then
|
||||
:
|
||||
else
|
||||
return
|
||||
fi
|
||||
@@ -28,9 +28,12 @@ generate_multiap_config() {
|
||||
|
||||
generate_config() {
|
||||
dev="$1"
|
||||
phy="$2"
|
||||
|
||||
[ -n "$dev" ] || continue
|
||||
|
||||
[ -n "$phy" -a "$phy" != "$dev" ] && continue
|
||||
|
||||
config_get band $dev band
|
||||
|
||||
mode_band=""
|
||||
@@ -147,16 +150,46 @@ generate_multiap_config() {
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
config_foreach generate_config wifi-device
|
||||
config_foreach generate_config wifi-device $@
|
||||
}
|
||||
|
||||
map_genconf () {
|
||||
if [ -f /etc/config/mapagent -a -z "$(uci -q get mapagent.@radio[0].band)" ]; then
|
||||
find_radio() {
|
||||
section="$1"
|
||||
phy="$2"
|
||||
|
||||
config_get device $section device
|
||||
|
||||
[ "$device" = "$phy" ] && {
|
||||
echo 1
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
find_sta() {
|
||||
section="$1"
|
||||
radio="$2"
|
||||
|
||||
config_get mode $section mode
|
||||
config_get device $section device
|
||||
|
||||
[ "$device" = "$radio" -a "$mode" = "sta" ] && {
|
||||
echo 1
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
phy=$1
|
||||
|
||||
config_load mapagent
|
||||
radio="$(config_foreach find_radio radio $phy)"
|
||||
if [ "$radio" = "" -a "$phy" != "" -o -z "$(uci -q get mapagent.@radio[0].band)" ]; then
|
||||
generate_mapagent_config=1
|
||||
fi
|
||||
|
||||
if [ "$network_mode" == "extender" ]; then
|
||||
if ! uci show wireless | grep -q "mode=.*sta"; then
|
||||
if [ "$network_mode" = "extender" ]; then
|
||||
config_load wireless
|
||||
if [ -z $(config_foreach find_sta wifi-iface $radio) ]; then
|
||||
generate_wireless_sta_config=1
|
||||
|
||||
if is_broadcom; then
|
||||
@@ -171,7 +204,7 @@ map_genconf () {
|
||||
fi
|
||||
fi
|
||||
|
||||
generate_multiap_config
|
||||
generate_multiap_config $phy
|
||||
|
||||
if [ $generate_mapagent_config -eq 1 ]; then
|
||||
uci set mapagent.agent.enabled="1"
|
||||
|
||||
Reference in New Issue
Block a user