self-diagnostics: update wifi data collection

This commit is contained in:
Filip Matusiak 2025-08-20 15:12:51 +00:00 committed by Jakob Olsson
parent f4fa5821e5
commit ee13ac5774
4 changed files with 66 additions and 10 deletions

View file

@ -1,11 +1,30 @@
interfaces=$(uci show wireless | grep "ifname=" | awk -F'[.,=]' '{print$2}') . /lib/functions.sh
for int in $interfaces; do
mode=$(uci get "wireless.${int}.mode") handle_interface() {
local config="${1}"
local prefix="${2}"
config_get ifname "${config}" ifname
config_get mode ${config} mode
if [ "$mode" = "ap" ] ; then if [ "$mode" = "ap" ] ; then
ap_int=$(uci get "wireless.${int}.ifname") echo "Get assoc list for ${ifname}"
echo "Get assoc list for ${ap_int}" ubus call "${prefix}.${ifname}" assoclist
ubus call "wifi.ap.${ap_int}" assoclist echo "Get station info for ${ifname}"
echo "Get station info for ${ap_int}" ubus call "${prefix}.${ifname}" stations
ubus call "wifi.ap.${ap_int}" stations
fi fi
done }
handle_wifi_interface() {
handle_interface "$1" "wifi.ap"
}
handle_mld_interface() {
handle_interface "$1" "wifi.apmld"
}
config_load wireless
echo "Get associated stations information for non-MLD interfaces"
config_foreach handle_wifi_interface wifi-iface
echo "Get associated stations information for MLD interfaces"
config_foreach handle_mld_interface wifi-mld

View file

View file

@ -0,0 +1,36 @@
. /lib/functions.sh
handle_interface() {
local config="${1}"
local prefix="${2}"
config_get ifname "${config}" ifname
config_get mode ${config} mode
if [ "$mode" = "ap" ] ; then
echo "Get status for ${ifname}"
ubus call "${prefix}.${ifname}" status
elif [ "$mode" = "sta" ] ; then
echo "Get status for bSTA ${ifname}"
ubus call "wifi.bsta.${ifname}" status
fi
}
handle_wifi_interface() {
handle_interface "$1" "wifi.ap"
}
handle_mld_interface() {
handle_interface "$1" "wifi.apmld"
}
config_load wireless
echo "Get wifi status"
ubus call wifi status
echo "Get wifi status for ap & bsta interfaces"
config_foreach handle_wifi_interface wifi-iface
echo "Get wifi status for apmld interfaces"
config_foreach handle_mld_interface wifi-mld

View file

@ -13,7 +13,8 @@
}, },
{ {
"description": "WiFi Status", "description": "WiFi Status",
"cmd": "ubus call wifi status" "cmd": "sh /usr/share/self-diagnostics/helper/wifi_status.sh",
"timeout": 10
}, },
{ {
"description": "WiFi Radio Status", "description": "WiFi Radio Status",