Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / www / advanced-wireless.asp
blob4db17a0cf2ec1c400f0152ec22b2f5809aa40667
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
9 -->
10 <html>
11 <head>
12 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
13 <meta name='robots' content='noindex,nofollow'>
14 <title>[<% ident(); %>] Advanced: Wireless</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'>
16 <% css(); %>
17 <script type='text/javascript' src='tomato.js'></script>
19 <!-- / / / -->
21 <script type='text/javascript' src='debug.js'></script>
23 <script type='text/javascript' src='wireless.jsx?_http_id=<% nv(http_id); %>'></script>
24 <script type='text/javascript'>
26 // <% nvram("wl_security_mode,wl_afterburner,wl_antdiv,wl_ap_isolate,wl_auth,wl_bcn,wl_dtim,wl_frag,wl_frameburst,wl_gmode_protection,wl_plcphdr,wl_rate,wl_rateset,wl_rts,wl_txant,wl_wme,wl_wme_no_ack,wl_wme_apsd,wl_txpwr,wl_mrate,t_features,wl_distance,wl_maxassoc,wlx_hpamp,wlx_hperx,wl_reg_mode,wl_country_code,wl_country,wl_btc_mode,wl_mimo_preamble,wl_obss_coex,wl_mitigation,wl_interference_override,wl_wmf_bss_enable"); %>
27 // <% wlcountries(); %>
29 hp = features('hpamp');
30 nphy = features('11n');
32 function verifyFields(focused, quiet)
34 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
35 // if(wl_ifaces[uidx][0].indexOf('.') < 0) {
36 if (wl_sunit(uidx)<0) {
37 var u = wl_unit(uidx);
39 if (!v_range('_f_wl'+u+'_distance', quiet, 0, 99999)) return 0;
40 if (!v_range('_wl'+u+'_maxassoc', quiet, 0, 255)) return 0;
41 if (!v_range('_wl'+u+'_bcn', quiet, 1, 65535)) return 0;
42 if (!v_range('_wl'+u+'_dtim', quiet, 1, 255)) return 0;
43 if (!v_range('_wl'+u+'_frag', quiet, 256, 2346)) return 0;
44 if (!v_range('_wl'+u+'_rts', quiet, 0, 2347)) return 0;
45 if (!v_range(E('_wl'+u+'_txpwr'), quiet, hp ? 1 : 0, hp ? 251 : 400)) return 0;
47 var b = E('_wl'+u+'_wme').value == 'off';
48 E('_wl'+u+'_wme_no_ack').disabled = b;
49 E('_wl'+u+'_wme_apsd').disabled = b;
53 return 1;
56 function save()
58 var fom;
59 var n;
61 if (!verifyFields(null, false)) return;
63 fom = E('_fom');
65 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
66 if (wl_sunit(uidx)<0) {
67 var u = wl_unit(uidx);
69 n = E('_f_wl'+u+'_distance').value * 1;
70 E('_wl'+u+'_distance').value = n ? n : '';
72 E('_wl'+u+'_country').value = E('_wl'+u+'_country_code').value;
73 E('_wl'+u+'_nmode_protection').value = E('_wl'+u+'_gmode_protection').value;
77 if (hp) {
78 if ((E('_wlx_hpamp').value != nvram.wlx_hpamp) || (E('_wlx_hperx').value != nvram.wlx_hperx)) {
79 fom._service.disabled = 1;
80 fom._reboot.value = 1;
81 form.submit(fom, 0);
82 return;
85 else {
86 E('_wlx_hpamp').disabled = 1;
87 E('_wlx_hperx').disabled = 1;
90 form.submit(fom, 1);
92 </script>
94 </head>
95 <body>
96 <form id='_fom' method='post' action='tomato.cgi'>
97 <table id='container' cellspacing=0>
98 <tr><td colspan=2 id='header'>
99 <div class='title'>Tomato</div>
100 <div class='version'>Version <% version(); %></div>
101 </td></tr>
102 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
103 <td id='content'>
104 <div id='ident'><% ident(); %></div>
106 <!-- / / / -->
108 <input type='hidden' name='_nextpage' value='advanced-wireless.asp'>
109 <input type='hidden' name='_nextwait' value='10'>
110 <input type='hidden' name='_service' value='*'>
111 <input type='hidden' name='_reboot' value='0'>
113 <script type='text/javascript'>
115 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
116 if (wl_sunit(uidx)<0) {
117 var u = wl_unit(uidx);
119 W('<input type=\'hidden\' id=\'_wl'+u+'_distance\' name=\'wl'+u+'_distance\'>');
120 W('<input type=\'hidden\' id=\'_wl'+u+'_country\' name=\'wl'+u+'_country\'>');
121 W('<input type=\'hidden\' id=\'_wl'+u+'_nmode_protection\' name=\'wl'+u+'_nmode_protection\'>');
123 W('<div class=\'section-title\'>Wireless Settings ');
124 //if (wl_ifaces.length > 1)
125 W('(' + wl_display_ifname(uidx) + ') ');
126 //W('');
127 W('</div><div class=\'section\'>');
129 at = ((nvram['wl'+u+'_security_mode'] != "wep") && (nvram['wl'+u+'_security_mode'] != "radius") && (nvram['wl'+u+'_security_mode'] != "disabled"));
130 createFieldTable('', [
131 { title: 'Afterburner', name: 'wl'+u+'_afterburner', type: 'select', options: [['auto','Auto'],['on','Enable'],['off','Disable *']],
132 value: nvram['wl'+u+'_afterburner'] },
133 { title: 'AP Isolation', name: 'wl'+u+'_ap_isolate', type: 'select', options: [['0','Disable *'],['1','Enable']],
134 value: nvram['wl'+u+'_ap_isolate'] },
135 { title: 'Authentication Type', name: 'wl'+u+'_auth', type: 'select',
136 options: [['0','Auto *'],['1','Shared Key']], attrib: at ? 'disabled' : '',
137 value: at ? 0 : nvram['wl'+u+'_auth'] },
138 { title: 'Basic Rate', name: 'wl'+u+'_rateset', type: 'select', options: [['default','Default *'],['12','1-2 Mbps'],['all','All']],
139 value: nvram['wl'+u+'_rateset'] },
140 { title: 'Beacon Interval', name: 'wl'+u+'_bcn', type: 'text', maxlen: 5, size: 7,
141 suffix: ' <small>(range: 1 - 65535; default: 100)</small>', value: nvram['wl'+u+'_bcn'] },
142 { title: 'CTS Protection Mode', name: 'wl'+u+'_gmode_protection', type: 'select', options: [['off','Disable *'],['auto','Auto']],
143 value: nvram['wl'+u+'_gmode_protection'] },
144 { title: 'Regulatory Mode', name: 'wl'+u+'_reg_mode', type: 'select',
145 options: [['off', 'Off *'],['d', '802.11d'],['h', '802.11h']],
146 value: nvram['wl'+u+'_reg_mode'] },
147 { title: 'Country / Region', name: 'wl'+u+'_country_code', type: 'select',
148 options: wl_countries, value: nvram['wl'+u+'_country_code'] },
149 { title: 'Bluetooth Coexistence', name: 'wl'+u+'_btc_mode', type: 'select',
150 options: [['0', 'Disable *'],['1', 'Enable'],['2', 'Preemption']],
151 value: nvram['wl'+u+'_btc_mode'] },
152 { title: 'Distance / ACK Timing', name: 'f_wl'+u+'_distance', type: 'text', maxlen: 5, size: 7,
153 suffix: ' <small>meters</small>&nbsp;&nbsp;<small>(range: 0 - 99999; 0 = use default)</small>',
154 value: (nvram['wl'+u+'_distance'] == '') ? '0' : nvram['wl'+u+'_distance'] },
155 { title: 'DTIM Interval', name: 'wl'+u+'_dtim', type: 'text', maxlen: 3, size: 5,
156 suffix: ' <small>(range: 1 - 255; default: 1)</small>', value: nvram['wl'+u+'_dtim'] },
157 { title: 'Fragmentation Threshold', name: 'wl'+u+'_frag', type: 'text', maxlen: 4, size: 6,
158 suffix: ' <small>(range: 256 - 2346; default: 2346)</small>', value: nvram['wl'+u+'_frag'] },
159 { title: 'Frame Burst', name: 'wl'+u+'_frameburst', type: 'select', options: [['off','Disable *'],['on','Enable']],
160 value: nvram['wl'+u+'_frameburst'] },
161 { title: 'HP', hidden: !hp || (uidx > 0) },
162 { title: 'Amplifier', indent: 2, name: 'wlx_hpamp' + (uidx > 0 ? uidx + '' : ''), type: 'select', options: [['0','Disable'],['1','Enable *']],
163 value: nvram.wlx_hpamp != '0', hidden: !hp || (uidx > 0) },
164 { title: 'Enhanced RX Sensitivity', indent: 2, name: 'wlx_hperx' + (uidx > 0 ? uidx + '' : ''), type: 'select', options: [['0','Disable *'],['1','Enable']],
165 value: nvram.wlx_hperx != '0', hidden: !hp || (uidx > 0) },
166 { title: 'Maximum Clients', name: 'wl'+u+'_maxassoc', type: 'text', maxlen: 3, size: 5,
167 suffix: ' <small>(range: 1 - 255; default: 128)</small>', value: nvram['wl'+u+'_maxassoc'] },
168 { title: 'Multicast Rate', name: 'wl'+u+'_mrate', type: 'select',
169 options: [['0','Auto *'],['1000000','1 Mbps'],['2000000','2 Mbps'],['5500000','5.5 Mbps'],['6000000','6 Mbps'],['9000000','9 Mbps'],['11000000','11 Mbps'],['12000000','12 Mbps'],['18000000','18 Mbps'],['24000000','24 Mbps'],['36000000','36 Mbps'],['48000000','48 Mbps'],['54000000','54 Mbps']],
170 value: nvram['wl'+u+'_mrate'] },
171 { title: 'Preamble', name: 'wl'+u+'_plcphdr', type: 'select', options: [['long','Long *'],['short','Short']],
172 value: nvram['wl'+u+'_plcphdr'] },
173 { title: '802.11n Preamble', name: 'wl'+u+'_mimo_preamble', type: 'select', options: [['auto','Auto'],['mm','Mixed Mode *'],['gf','Green Field'],['gfbcm','GF-BRCM']],
174 value: nvram['wl'+u+'_mimo_preamble'], hidden: !nphy },
175 { title: 'Overlapping BSS Coexistence', name: 'wl'+u+'_obss_coex', type: 'select', options: [['0','Off *'],['1','On']],
176 value: nvram['wl'+u+'_obss_coex'], hidden: !nphy },
177 { title: 'RTS Threshold', name: 'wl'+u+'_rts', type: 'text', maxlen: 4, size: 6,
178 suffix: ' <small>(range: 0 - 2347; default: 2347)</small>', value: nvram['wl'+u+'_rts'] },
179 { title: 'Receive Antenna', name: 'wl'+u+'_antdiv', type: 'select', options: [['3','Auto *'],['1','A'],['0','B']],
180 value: nvram['wl'+u+'_antdiv'] },
181 { title: 'Transmit Antenna', name: 'wl'+u+'_txant', type: 'select', options: [['3','Auto *'],['1','A'],['0','B']],
182 value: nvram['wl'+u+'_txant'] },
183 { title: 'Transmit Power', name: 'wl'+u+'_txpwr', type: 'text', maxlen: 3, size: 5,
184 suffix: hp ?
185 ' <small>mW (before amplification)</small>&nbsp;&nbsp;<small>(range: 1 - 251; default: 10)</small>' :
186 ' <small>mW</small>&nbsp;&nbsp;<small>(range: 0 - 400, actual max depends on Country selected; use 0 for hardware default)</small>',
187 value: nvram['wl'+u+'_txpwr'] },
188 { title: 'Transmission Rate', name: 'wl'+u+'_rate', type: 'select',
189 options: [['0','Auto *'],['1000000','1 Mbps'],['2000000','2 Mbps'],['5500000','5.5 Mbps'],['6000000','6 Mbps'],['9000000','9 Mbps'],['11000000','11 Mbps'],['12000000','12 Mbps'],['18000000','18 Mbps'],['24000000','24 Mbps'],['36000000','36 Mbps'],['48000000','48 Mbps'],['54000000','54 Mbps']],
190 value: nvram['wl'+u+'_rate'] },
191 { title: 'Interference Mitigation', name: 'wl'+u+'_mitigation', type: 'select',
192 options: [['0','None *'],['1','Non-WLAN'],['2','WLAN Manual'],['3','WLAN Auto'],['4','WLAN Auto with Noise Reduction']],
193 value: nvram['wl'+u+'_mitigation'] },
194 { title: 'WMM', name: 'wl'+u+'_wme', type: 'select', options: [['auto','Auto'],['off','Disable'],['on','Enable *']], value: nvram['wl'+u+'_wme'] },
195 { title: 'No ACK', name: 'wl'+u+'_wme_no_ack', indent: 2, type: 'select', options: [['off','Disable *'],['on','Enable']],
196 value: nvram['wl'+u+'_wme_no_ack'] },
197 { title: 'APSD Mode', name: 'wl'+u+'_wme_apsd', indent: 2, type: 'select', options: [['off','Disable *'],['on','Enable']],
198 value: nvram['wl'+u+'_wme_apsd'] },
199 { title: 'Wireless Multicast Forwarding', name: 'wl'+u+'_wmf_bss_enable', type: 'select', options: [['0','Disable *'],['1','Enable']],
200 value: nvram['wl'+u+'_wmf_bss_enable'] }
202 W('</div>');
205 </script>
207 <small>The default settings are indicated with an asterisk <b style='font-size: 1.5em'>*</b> symbol.</small>
209 <!-- / / / -->
211 </td></tr>
212 <tr><td id='footer' colspan=2>
213 <span id='footer-msg'></span>
214 <input type='button' value='Save' id='save-button' onclick='save()'>
215 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'>
216 </td></tr>
217 </table>
218 </form>
219 <script type='text/javascript'>verifyFields(null, 1);</script>
220 </body>
221 </html>