Merge luci.sys.wifi.channels to iwinfo
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_network / wifi.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
15 local wa = require "luci.tools.webadmin"
16 local nw = require "luci.model.network"
17 local ww = require "luci.model.wireless"
18 local fs = require "nixio.fs"
19
20 arg[1] = arg[1] or ""
21 arg[2] = arg[2] or ""
22
23 m = Map("wireless", "",
24 translate("The <em>Device Configuration</em> section covers physical settings of the radio " ..
25 "hardware such as channel, transmit power or antenna selection which is shared among all " ..
26 "defined wireless networks (if the radio hardware is multi-SSID capable). Per network settings " ..
27 "like encryption or operation mode are grouped in the <em>Interface Configuration</em>."))
28
29 m:chain("network")
30
31 local ifsection
32
33 function m.on_commit(map)
34 nw.init(map.uci)
35 ww.init(map.uci)
36
37 local wnet = ww:get_network(arg[2])
38 if ifsection and wnet then
39 ifsection.section = wnet.sid
40 end
41 end
42
43 nw.init(m.uci)
44 ww.init(m.uci)
45
46 local wnet = ww:get_network(arg[2])
47
48 if wnet then
49 m.title = wnet and ww:get_i18n(wnet)
50 end
51
52
53 local iw = nil
54 local tx_powers = nil
55
56 m.uci:foreach("wireless", "wifi-iface",
57 function(s)
58 if s.device == arg[1] and not iw then
59 iw = luci.sys.wifi.getiwinfo(s.ifname or s.device)
60 tx_powers = iw.txpwrlist or { }
61 end
62 end)
63
64 s = m:section(NamedSection, arg[1], "wifi-device", translate("Device Configuration"))
65 s.addremove = false
66
67 s:tab("general", translate("General Setup"))
68 s:tab("macfilter", translate("MAC-Filter"))
69 s:tab("advanced", translate("Advanced Settings"))
70
71 --[[
72 back = s:option(DummyValue, "_overview", translate("Overview"))
73 back.value = ""
74 back.titleref = luci.dispatcher.build_url("admin", "network", "wireless")
75 ]]
76
77 en = s:taboption("general", Flag, "disabled", translate("enable"))
78 en.enabled = "0"
79 en.disabled = "1"
80 en.rmempty = false
81
82 function en.cfgvalue(self, section)
83 return Flag.cfgvalue(self, section) or "0"
84 end
85
86 s:taboption("general", DummyValue, "type", translate("Type"))
87
88 local hwtype = m:get(arg[1], "type")
89 -- NanoFoo
90 local nsantenna = m:get(arg[1], "antenna")
91
92 ch = s:taboption("general", Value, "channel", translate("Channel"))
93 ch:value("auto", translate("auto"))
94 for _, f in ipairs(luci.sys.wifi.channels()) do
95 ch:value(f.channel, "%i (%.3f GHz)" %{ f.channel, f.mhz })
96 end
97
98
99 ------------------- MAC80211 Device ------------------
100
101 if hwtype == "mac80211" then
102 tp = s:taboption("general",
103 (tx_powers and #tx_powers > 0) and ListValue or Value,
104 "txpower", translate("Transmit Power"), "dBm")
105
106 tp.rmempty = true
107 for _, p in ipairs(iw and iw.txpwrlist or {}) do
108 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
109 end
110 end
111
112
113 ------------------- Madwifi Device ------------------
114
115 if hwtype == "atheros" then
116 tp = s:taboption("general",
117 (#tx_powers > 0) and ListValue or Value,
118 "txpower", translate("Transmit Power"), "dBm")
119
120 tp.rmempty = true
121 for _, p in ipairs(iw.txpwrlist) do
122 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
123 end
124
125 mode = s:taboption("advanced", ListValue, "hwmode", translate("Mode"))
126 mode:value("", translate("auto"))
127 mode:value("11b", "802.11b")
128 mode:value("11g", "802.11g")
129 mode:value("11a", "802.11a")
130 mode:value("11bg", "802.11b+g")
131 mode:value("11gst", "802.11g + Turbo")
132 mode:value("11ast", "802.11a + Turbo")
133 mode:value("fh", translate("Frequency Hopping"))
134
135 s:taboption("advanced", Flag, "diversity", translate("Diversity")).rmempty = false
136
137 if not nsantenna then
138 ant1 = s:taboption("advanced", ListValue, "txantenna", translate("Transmitter Antenna"))
139 ant1.widget = "radio"
140 ant1.orientation = "horizontal"
141 ant1:depends("diversity", "")
142 ant1:value("0", translate("auto"))
143 ant1:value("1", translate("Antenna 1"))
144 ant1:value("2", translate("Antenna 2"))
145
146 ant2 = s:taboption("advanced", ListValue, "rxantenna", translate("Receiver Antenna"))
147 ant2.widget = "radio"
148 ant2.orientation = "horizontal"
149 ant2:depends("diversity", "")
150 ant2:value("0", translate("auto"))
151 ant2:value("1", translate("Antenna 1"))
152 ant2:value("2", translate("Antenna 2"))
153
154 else -- NanoFoo
155 local ant = s:taboption("advanced", ListValue, "antenna", translate("Transmitter Antenna"))
156 ant:value("auto")
157 ant:value("vertical")
158 ant:value("horizontal")
159 ant:value("external")
160 end
161
162 s:taboption("advanced", Value, "distance", translate("Distance Optimization"),
163 translate("Distance to farthest network member in meters."))
164 s:taboption("advanced", Value, "regdomain", translate("Regulatory Domain"))
165 s:taboption("advanced", Value, "country", translate("Country Code"))
166 s:taboption("advanced", Flag, "outdoor", translate("Outdoor Channels"))
167
168 --s:option(Flag, "nosbeacon", translate("Disable HW-Beacon timer"))
169 end
170
171
172
173 ------------------- Broadcom Device ------------------
174
175 if hwtype == "broadcom" then
176 tp = s:taboption("general",
177 (#tx_powers > 0) and ListValue or Value,
178 "txpower", translate("Transmit Power"), "dBm")
179
180 tp.rmempty = true
181 for _, p in ipairs(iw.txpwrlist) do
182 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
183 end
184
185 mp = s:taboption("macfilter", ListValue, "macfilter", translate("MAC-Address Filter"))
186 mp:value("", translate("disable"))
187 mp:value("allow", translate("Allow listed only"))
188 mp:value("deny", translate("Allow all except listed"))
189 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
190 ml:depends({macfilter="allow"})
191 ml:depends({macfilter="deny"})
192
193 ant1 = s:taboption("advanced", ListValue, "txantenna", translate("Transmitter Antenna"))
194 ant1.widget = "radio"
195 ant1:depends("diversity", "")
196 ant1:value("3", translate("auto"))
197 ant1:value("0", translate("Antenna 1"))
198 ant1:value("1", translate("Antenna 2"))
199
200 ant2 = s:taboption("advanced", ListValue, "rxantenna", translate("Receiver Antenna"))
201 ant2.widget = "radio"
202 ant2:depends("diversity", "")
203 ant2:value("3", translate("auto"))
204 ant2:value("0", translate("Antenna 1"))
205 ant2:value("1", translate("Antenna 2"))
206
207 s:taboption("advanced", Flag, "frameburst", translate("Frame Bursting"))
208
209 s:taboption("advanced", Value, "distance", translate("Distance Optimization"))
210 --s:option(Value, "slottime", translate("Slot time"))
211
212 s:taboption("advanced", Value, "country", translate("Country Code"))
213 s:taboption("advanced", Value, "maxassoc", translate("Connection Limit"))
214 end
215
216
217 --------------------- HostAP Device ---------------------
218
219 if hwtype == "prism2" then
220 s:taboption("advanced", Value, "txpower", translate("Transmit Power"), "att units").rmempty = true
221
222 s:taboption("advanced", Flag, "diversity", translate("Diversity")).rmempty = false
223
224 s:taboption("advanced", Value, "txantenna", translate("Transmitter Antenna"))
225 s:taboption("advanced", Value, "rxantenna", translate("Receiver Antenna"))
226 end
227
228
229 ----------------------- Interface -----------------------
230
231 local wnet = ww:get_network(arg[2])
232
233 if wnet then
234 s = m:section(NamedSection, wnet.sid, "wifi-iface", translate("Interface Configuration"))
235 ifsection = s
236 s.addremove = false
237 s.anonymous = true
238 s.defaults.device = arg[1]
239
240 s:tab("general", translate("General Setup"))
241 s:tab("encryption", translate("Wireless Security"))
242 s:tab("macfilter", translate("MAC-Filter"))
243 s:tab("advanced", translate("Advanced Settings"))
244
245 s:taboption("general", Value, "ssid", translate("<abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
246
247 mode = s:taboption("general", ListValue, "mode", translate("Mode"))
248 mode.override_values = true
249 mode:value("ap", translate("Access Point"))
250 mode:value("sta", translate("Client"))
251 mode:value("adhoc", translate("Ad-Hoc"))
252
253 bssid = s:taboption("general", Value, "bssid", translate("<abbr title=\"Basic Service Set Identifier\">BSSID</abbr>"))
254
255 network = s:taboption("general", Value, "network", translate("Network"),
256 translate("Choose the network you want to attach to this wireless interface. " ..
257 "Select <em>unspecified</em> to not attach any network or fill out the " ..
258 "<em>create</em> field to define a new network."))
259
260 network.rmempty = true
261 network.template = "cbi/network_netlist"
262 network.widget = "radio"
263
264 function network.write(self, section, value)
265 local i = nw:get_interface(section)
266 if i then
267 if value == '-' then
268 value = m:formvalue(self:cbid(section) .. ".newnet")
269 if value and #value > 0 then
270 local n = nw:add_network(value, {type="bridge", proto="none"})
271 if n then n:add_interface(i) end
272 else
273 local n = i:get_network()
274 if n then n:del_interface(i) end
275 end
276 else
277 local n = nw:get_network(value)
278 if n then
279 n:type("bridge")
280 n:add_interface(i)
281 end
282 end
283 end
284 end
285
286 -------------------- MAC80211 Interface ----------------------
287
288 if hwtype == "mac80211" then
289 if fs.access("/usr/sbin/iw") then
290 mode:value("mesh", "802.11s")
291 end
292
293 mode:value("ahdemo", translate("Pseudo Ad-Hoc (ahdemo)"))
294 mode:value("monitor", translate("Monitor"))
295 bssid:depends({mode="adhoc"})
296
297 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
298 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
299 end
300
301
302
303 -------------------- Madwifi Interface ----------------------
304
305 if hwtype == "atheros" then
306 mode:value("ahdemo", translate("Pseudo Ad-Hoc (ahdemo)"))
307 mode:value("monitor", translate("Monitor"))
308 mode:value("ap-wds", "%s (%s)" % {translate("Access Point"), translate("WDS")})
309 mode:value("sta-wds", "%s (%s)" % {translate("Client"), translate("WDS")})
310 mode:value("wds", translate("Static WDS"))
311
312 function mode.write(self, section, value)
313 if value == "ap-wds" then
314 ListValue.write(self, section, "ap")
315 m.uci:set("wireless", section, "wds", 1)
316 elseif value == "sta-wds" then
317 ListValue.write(self, section, "sta")
318 m.uci:set("wireless", section, "wds", 1)
319 else
320 ListValue.write(self, section, value)
321 m.uci:delete("wireless", section, "wds")
322 end
323 end
324
325 function mode.cfgvalue(self, section)
326 local mode = ListValue.cfgvalue(self, section)
327 local wds = m.uci:get("wireless", section, "wds") == "1"
328
329 if mode == "ap" and wds then
330 return "ap-wds"
331 elseif mode == "sta" and wds then
332 return "sta-wds"
333 else
334 return mode
335 end
336 end
337
338 bssid:depends({mode="adhoc"})
339 bssid:depends({mode="ahdemo"})
340 bssid:depends({mode="wds"})
341
342 wdssep = s:taboption("advanced", Flag, "wdssep", translate("Separate WDS"))
343 wdssep:depends({mode="ap-wds"})
344
345 s:taboption("advanced", Flag, "doth", "802.11h")
346 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
347 hidden:depends({mode="ap"})
348 hidden:depends({mode="adhoc"})
349 hidden:depends({mode="ap-wds"})
350 hidden:depends({mode="sta-wds"})
351 isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
352 translate("Prevents client-to-client communication"))
353 isolate:depends({mode="ap"})
354 s:taboption("advanced", Flag, "bgscan", translate("Background Scan"))
355
356 mp = s:taboption("macfilter", ListValue, "macpolicy", translate("MAC-Address Filter"))
357 mp:value("", translate("disable"))
358 mp:value("deny", translate("Allow listed only"))
359 mp:value("allow", translate("Allow all except listed"))
360 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
361 ml:depends({macpolicy="allow"})
362 ml:depends({macpolicy="deny"})
363
364 s:taboption("advanced", Value, "rate", translate("Transmission Rate"))
365 s:taboption("advanced", Value, "mcast_rate", translate("Multicast Rate"))
366 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
367 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
368 s:taboption("advanced", Value, "minrate", translate("Minimum Rate"))
369 s:taboption("advanced", Value, "maxrate", translate("Maximum Rate"))
370 s:taboption("advanced", Flag, "compression", translate("Compression"))
371
372 s:taboption("advanced", Flag, "bursting", translate("Frame Bursting"))
373 s:taboption("advanced", Flag, "turbo", translate("Turbo Mode"))
374 s:taboption("advanced", Flag, "ff", translate("Fast Frames"))
375
376 s:taboption("advanced", Flag, "wmm", translate("WMM Mode"))
377 s:taboption("advanced", Flag, "xr", translate("XR Support"))
378 s:taboption("advanced", Flag, "ar", translate("AR Support"))
379
380 local swm = s:taboption("advanced", Flag, "sw_merge", translate("Disable HW-Beacon timer"))
381 swm:depends({mode="adhoc"})
382
383 local nos = s:taboption("advanced", Flag, "nosbeacon", translate("Disable HW-Beacon timer"))
384 nos:depends({mode="sta"})
385 nos:depends({mode="sta-wds"})
386
387 local probereq = s:taboption("advanced", Flag, "probereq", translate("Do not send probe responses"))
388 probereq.enabled = "0"
389 probereq.disabled = "1"
390 end
391
392
393 -------------------- Broadcom Interface ----------------------
394
395 if hwtype == "broadcom" then
396 mode:value("wds", translate("WDS"))
397 mode:value("monitor", translate("Monitor"))
398
399 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
400 hidden:depends({mode="ap"})
401 hidden:depends({mode="adhoc"})
402 hidden:depends({mode="wds"})
403
404 isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
405 translate("Prevents client-to-client communication"))
406 isolate:depends({mode="ap"})
407
408 s:taboption("advanced", Flag, "doth", "802.11h")
409 s:taboption("advanced", Flag, "wmm", translate("WMM Mode"))
410
411 bssid:depends({mode="wds"})
412 bssid:depends({mode="adhoc"})
413 end
414
415
416 ----------------------- HostAP Interface ---------------------
417
418 if hwtype == "prism2" then
419 mode:value("wds", translate("WDS"))
420 mode:value("monitor", translate("Monitor"))
421
422 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
423 hidden:depends({mode="ap"})
424 hidden:depends({mode="adhoc"})
425 hidden:depends({mode="wds"})
426
427 bssid:depends({mode="sta"})
428
429 mp = s:taboption("macfilter", ListValue, "macpolicy", translate("MAC-Address Filter"))
430 mp:value("", translate("disable"))
431 mp:value("deny", translate("Allow listed only"))
432 mp:value("allow", translate("Allow all except listed"))
433 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
434 ml:depends({macpolicy="allow"})
435 ml:depends({macpolicy="deny"})
436
437 s:taboption("advanced", Value, "rate", translate("Transmission Rate"))
438 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
439 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
440 end
441
442
443 ------------------- WiFI-Encryption -------------------
444
445 encr = s:taboption("encryption", ListValue, "encryption", translate("Encryption"))
446 encr.override_values = true
447 encr.override_depends = true
448 encr:depends({mode="ap"})
449 encr:depends({mode="sta"})
450 encr:depends({mode="adhoc"})
451 encr:depends({mode="ahdemo"})
452 encr:depends({mode="ap-wds"})
453 encr:depends({mode="sta-wds"})
454 encr:depends({mode="mesh"})
455
456 encr:value("none", "No Encryption")
457 encr:value("wep", "WEP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
458
459 if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
460 local supplicant = fs.access("/usr/sbin/wpa_supplicant")
461 local hostapd = fs.access("/usr/sbin/hostapd")
462
463 if hostapd and supplicant then
464 encr:value("psk", "WPA-PSK")
465 encr:value("psk2", "WPA2-PSK")
466 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode")
467 encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
468 encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="sta"})
469 elseif hostapd and not supplicant then
470 encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
471 encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
472 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
473 encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="ap-wds"})
474 encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="ap-wds"})
475 encr.description = translate(
476 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
477 "and ad-hoc mode) to be installed."
478 )
479 elseif not hostapd and supplicant then
480 encr:value("psk", "WPA-PSK", {mode="sta"}, {mode="sta-wds"})
481 encr:value("psk2", "WPA2-PSK", {mode="sta"}, {mode="sta-wds"})
482 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"}, {mode="sta-wds"})
483 encr:value("wpa", "WPA-EAP", {mode="sta"}, {mode="sta-wds"})
484 encr:value("wpa2", "WPA2-EAP", {mode="sta"}, {mode="sta-wds"})
485 encr.description = translate(
486 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
487 "and ad-hoc mode) to be installed."
488 )
489 else
490 encr.description = translate(
491 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
492 "and ad-hoc mode) to be installed."
493 )
494 end
495 elseif hwtype == "broadcom" then
496 encr:value("psk", "WPA-PSK")
497 encr:value("psk2", "WPA2-PSK")
498 encr:value("psk+psk2", "WPA-PSK/WPA2-PSK Mixed Mode")
499 end
500
501 encr:depends("mode", "ap")
502 encr:depends("mode", "sta")
503 encr:depends("mode", "ap-wds")
504 encr:depends("mode", "sta-wds")
505 encr:depends("mode", "wds")
506
507 server = s:taboption("encryption", Value, "server", translate("Radius-Server"))
508 server:depends({mode="ap", encryption="wpa"})
509 server:depends({mode="ap", encryption="wpa2"})
510 server.rmempty = true
511
512 port = s:taboption("encryption", Value, "port", translate("Radius-Port"))
513 port:depends({mode="ap", encryption="wpa"})
514 port:depends({mode="ap", encryption="wpa2"})
515 port.rmempty = true
516
517 key = s:taboption("encryption", Value, "key", translate("Key"))
518 key:depends("encryption", "wep")
519 key:depends("encryption", "psk")
520 key:depends("encryption", "psk2")
521 key:depends("encryption", "psk+psk2")
522 key:depends("encryption", "psk-mixed")
523 key:depends({mode="ap", encryption="wpa"})
524 key:depends({mode="ap", encryption="wpa2"})
525 key.rmempty = true
526 key.password = true
527
528 if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
529 nasid = s:taboption("encryption", Value, "nasid", translate("NAS ID"))
530 nasid:depends({mode="ap", encryption="wpa"})
531 nasid:depends({mode="ap", encryption="wpa2"})
532 nasid.rmempty = true
533
534 eaptype = s:taboption("encryption", ListValue, "eap_type", translate("EAP-Method"))
535 eaptype:value("TLS")
536 eaptype:value("TTLS")
537 eaptype:value("PEAP")
538 eaptype:depends({mode="sta", encryption="wpa"})
539 eaptype:depends({mode="sta", encryption="wpa2"})
540
541 cacert = s:taboption("encryption", FileUpload, "ca_cert", translate("Path to CA-Certificate"))
542 cacert:depends({mode="sta", encryption="wpa"})
543 cacert:depends({mode="sta", encryption="wpa2"})
544
545 privkey = s:taboption("encryption", FileUpload, "priv_key", translate("Path to Private Key"))
546 privkey:depends({mode="sta", eap_type="TLS", encryption="wpa2"})
547 privkey:depends({mode="sta", eap_type="TLS", encryption="wpa"})
548
549 privkeypwd = s:taboption("encryption", Value, "priv_key_pwd", translate("Password of Private Key"))
550 privkeypwd:depends({mode="sta", eap_type="TLS", encryption="wpa2"})
551 privkeypwd:depends({mode="sta", eap_type="TLS", encryption="wpa"})
552
553
554 auth = s:taboption("encryption", Value, "auth", translate("Authentication"))
555 auth:value("PAP")
556 auth:value("CHAP")
557 auth:value("MSCHAP")
558 auth:value("MSCHAPV2")
559 auth:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
560 auth:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
561 auth:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
562 auth:depends({mode="sta", eap_type="TTLS", encryption="wpa"})
563
564
565 identity = s:taboption("encryption", Value, "identity", translate("Identity"))
566 identity:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
567 identity:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
568 identity:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
569 identity:depends({mode="sta", eap_type="TTLS", encryption="wpa"})
570
571 password = s:taboption("encryption", Value, "password", translate("Password"))
572 password:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
573 password:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
574 password:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
575 password:depends({mode="sta", eap_type="TTLS", encryption="wpa"})
576 end
577 end
578
579 return m