X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fbase%2Fluasrc%2Fmodel%2Fnetwork.lua;h=6119abd73c76fb8d473217d5b98ffa6aa3963dc7;hp=a409621f8e817eaf52952649a50449b6251c07e2;hb=ecb0c2f11b861e5035b0397d2396ee4b5e9b3c3e;hpb=7043c30e0e55bbbfacdddf97619b6bae96d20ddb diff --git a/modules/base/luasrc/model/network.lua b/modules/base/luasrc/model/network.lua index a409621f8..6119abd73 100644 --- a/modules/base/luasrc/model/network.lua +++ b/modules/base/luasrc/model/network.lua @@ -135,13 +135,25 @@ function _wifi_iface(x) end function _wifi_state(key, val, field) + local radio, radiostate, ifc, ifcstate + if not next(_ubuswificache) then _ubuswificache = _ubus:call("network.wireless", "status", {}) or {} + + -- workaround extended section format + for radio, radiostate in pairs(_ubuswificache) do + for ifc, ifcstate in pairs(radiostate.interfaces) do + if ifcstate.section and ifcstate.section:sub(1, 1) == '@' then + local s = _uci_real:get_all('wireless.%s' % ifcstate.section) + if s then + ifcstate.section = s['.name'] + end + end + end + end end - local radio, radiostate for radio, radiostate in pairs(_ubuswificache) do - local ifc, ifcstate for ifc, ifcstate in pairs(radiostate.interfaces) do if ifcstate[key] == val then return ifcstate[field] @@ -1274,6 +1286,7 @@ function wifidev.get_i18n(self) if l.b then m = m .. "b" end if l.g then m = m .. "g" end if l.n then m = m .. "n" end + if l.ac then m = "ac" end return "%s 802.11%s Wireless Controller (%s)" %{ t, m, self:name() } end