Developing lightweight computation at the DSG edge

Commit 7c75474e authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[qmp-system] Additional information source for qmp_get_wifi_devices()

Still with #481, for some devices, qmp_get_wifi_devices() reports less
devices than actually present. Add an additional source of devices and
some verbosity.

Continues cb7fd04423ce05fa64b96efb6667421b33bf100c,
6c5212f1 and
b45499e1

.
Signed-off-by: default avatarRoger Pueyo Centelles <roger.pueyo@guifi.net>
parent 507d2adb
......@@ -162,7 +162,18 @@ qmp_debug() {
# Returns the names of the wifi devices from the system
qmp_get_wifi_devices() {
awk 'NR>2 { gsub(/:$/,"",$1); print $1 }' /proc/net/wireless | grep -v -e "wlan[0-9]-[0-9]" | sort -u
proc_net_wireless=$(awk 'NR>2 { gsub(/:$/,"",$1); print $1 }' /proc/net/wireless | grep -v -e "wlan[0-9]-[0-9]" | sort -u)
sys_class_net=""
for i in $(ls /sys/class/net/); do
[ -e /sys/class/net/${i}/phy80211 ] && sys_class_net="${sys_class_net} ${i}"
done
echo $proc_net_wireless
for i in $sys_class_net; do
! qmp_is_in $i $proc_net_wireless && echo $i
done
}
# Returns the MAC address of the wifi devices
......
......@@ -114,7 +114,7 @@ qmp_get_virtual_iface() {
for l in $(qmp_get_devices lan); do
if [ "$l" == "$device" ]; then
viface="lan"
if [ ! -e "/sys/class/net/$device/phy80211" ]; then
if [ ! -e "/sys/class/net/$device/phy80211" ] && ! qmp_is_in "$device" $(qmp_get_wifi_devices); then
qmp_log "LOG: 5"
qmp_log "Viface: $viface"
qmp_log $device $viface
......
......@@ -307,10 +307,12 @@ qmp_configure_lan() {
local device
for device in $(qmp_get_devices lan) ; do
echo " -> LAN device $device"
qmp_log "Current wifi devices:"
qmp_log "Current wifi devices (with qmp_get_wifi_devices()):"
for ldev in $(qmp_get_wifi_devices); do
qmp_log ${ldev}
done
qmp_log "Current network devices (with ls /sys/class/net):"
qmp_log $(ls /sys/class/net)
if qmp_is_in "$device" $(qmp_get_wifi_devices) || [ -e "/sys/class/net/$device/phy80211" ] ; then
# Do not attach to br-lan wireless devices, they do it themselves
# somewhere else via /etc/config/wireless
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment