Moved luci.sys.exec, luci.sys.execl and luci.sys.bigendian to luci.util
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_wifi / devices.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 m = Map("wireless", translate("devices"), translate("a_w_devices1",
15 "An dieser Stelle können eingebaute WLAN-Geräte konfiguriert werden."))
16
17 s = m:section(TypedSection, "wifi-device", "")
18 --s.addremove = true
19
20 en = s:option(Flag, "disabled", translate("enable"))
21 en.enabled = "0"
22 en.disabled = "1"
23
24 function en.cfgvalue(self, section)
25 return Flag.cfgvalue(self, section) or "0"
26 end
27
28 t = s:option(ListValue, "type", translate("type"))
29 t:value("broadcom")
30 t:value("atheros")
31 t:value("mac80211")
32 t:value("prism2")
33 --[[
34 require("luci.sys")
35 local c = ". /etc/functions.sh;for i in /lib/wifi/*;do . $i;done;echo $DRIVERS"
36 for driver in luci.util.execl(c)[1]:gmatch("[^ ]+") do
37 t:value(driver)
38 end
39 ]]--
40
41 mode = s:option(ListValue, "mode", translate("mode"))
42 mode:value("", "standard")
43 mode:value("11b", "802.11b")
44 mode:value("11g", "802.11g")
45 mode:value("11a", "802.11a")
46 mode:value("11bg", "802.11b+g")
47 mode.rmempty = true
48
49 s:option(Value, "channel", translate("a_w_channel"))
50
51 s:option(Value, "txantenna", translate("a_w_txantenna")).rmempty = true
52
53 s:option(Value, "rxantenna", translate("a_w_rxantenna")).rmempty = true
54
55 s:option(Value, "distance", translate("distance"),
56 translate("a_w_distance1")).rmempty = true
57
58 s:option(Value, "diversity", translate("a_w_diversity")):depends("type", "atheros")
59
60 country = s:option(Value, "country", translate("a_w_countrycode"))
61 country.optional = true
62 country:depends("type", "broadcom")
63
64 maxassoc = s:option(Value, "maxassoc", translate("a_w_connlimit"))
65 maxassoc:depends("type", "broadcom")
66 maxassoc.optional = true
67
68 return m