+function wifidev.hwmodes(self)
+ local l = self.iwinfo.hwmodelist
+ if l and next(l) then
+ return l
+ else
+ return { b = true, g = true }
+ end
+end
+
+function wifidev.get_i18n(self)
+ local t = "Generic"
+ if self.iwinfo.type == "wl" then
+ t = "Broadcom"
+ elseif self.iwinfo.type == "madwifi" then
+ t = "Atheros"
+ end
+
+ local m = ""
+ local l = self:hwmodes()
+ if l.a then m = m .. "a" end
+ if l.b then m = m .. "b" end
+ if l.g then m = m .. "g" end
+ if l.n then m = m .. "n" end
+
+ return "%s 802.11%s Wireless Controller (%s)" %{ t, m, self:name() }
+end
+