Fall back to using a phy-wide iwinfo handle if the vif query yields no result.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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