summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--modules/luci-base/luasrc/sys.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/luci-base/luasrc/sys.lua b/modules/luci-base/luasrc/sys.lua
index 3fcfd4def7..84c747f2bd 100644
--- a/modules/luci-base/luasrc/sys.lua
+++ b/modules/luci-base/luasrc/sys.lua
@@ -453,8 +453,18 @@ wifi = {}
function wifi.getiwinfo(ifname)
ntm.init()
- local wnet = ntm.wifinet(ifname)
- return wnet.iwinfo or { ifname = ifname }
+
+ local wnet = ntm:get_wifinet(ifname)
+ if wnet and wnet.iwinfo then
+ return wnet.iwinfo
+ end
+
+ local wdev = ntm:get_wifidev(ifname)
+ if wdev and wdev.iwinfo then
+ return wdev.iwinfo
+ end
+
+ return { ifname = ifname }
end