Merge branch 'Toastman-NRT' into Toastman-RT-AC
[tomato.git] / release / src / router / www / advanced-wireless.asp
blob49b9498588ab4d042e62f8353f1d1317702e8a3b
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 <meta name="viewport" content="width=device-width">
15 <title>[<% ident(); %>] Advanced: Wireless</title>
16 <link rel='stylesheet' type='text/css' href='tomato.css'>
17 <% css(); %>
18 <script type='text/javascript' src='tomato.js'></script>
20 <!-- / / / -->
22 <script type='text/javascript' src='debug.js'></script>
24 <script type='text/javascript' src='wireless.jsx?_http_id=<% nv(http_id); %>'></script>
25 <script type='text/javascript'>
27 // <% 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_wmf_bss_enable"); %>
28 // <% wlcountries(); %>
30 hp = features('hpamp');
31 nphy = features('11n');
33 function verifyFields(focused, quiet)
35 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
36 // if(wl_ifaces[uidx][0].indexOf('.') < 0) {
37 if (wl_sunit(uidx)<0) {
38 var u = wl_unit(uidx);
40 if (!v_range('_f_wl'+u+'_distance', quiet, 0, 99999)) return 0;
41 if (!v_range('_wl'+u+'_maxassoc', quiet, 0, 255)) return 0;
42 if (!v_range('_wl'+u+'_bcn', quiet, 1, 65535)) return 0;
43 if (!v_range('_wl'+u+'_dtim', quiet, 1, 255)) return 0;
44 if (!v_range('_wl'+u+'_frag', quiet, 256, 2346)) return 0;
45 if (!v_range('_wl'+u+'_rts', quiet, 0, 2347)) return 0;
46 if (!v_range(E('_wl'+u+'_txpwr'), quiet, hp ? 1 : 0, hp ? 251 : 400)) return 0;
48 var b = E('_wl'+u+'_wme').value == 'off';
49 E('_wl'+u+'_wme_no_ack').disabled = b;
50 E('_wl'+u+'_wme_apsd').disabled = b;
54 return 1;
57 function save()
59 var fom;
60 var n;
62 if (!verifyFields(null, false)) return;
64 fom = E('_fom');
66 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
67 if (wl_sunit(uidx)<0) {
68 var u = wl_unit(uidx);
70 n = E('_f_wl'+u+'_distance').value * 1;
71 E('_wl'+u+'_distance').value = n ? n : '';
73 E('_wl'+u+'_country').value = E('_wl'+u+'_country_code').value;
74 E('_wl'+u+'_nmode_protection').value = E('_wl'+u+'_gmode_protection').value;
78 if (hp) {
79 if ((E('_wlx_hpamp').value != nvram.wlx_hpamp) || (E('_wlx_hperx').value != nvram.wlx_hperx)) {
80 fom._service.disabled = 1;
81 fom._reboot.value = 1;
82 form.submit(fom, 0);
83 return;
86 else {
87 E('_wlx_hpamp').disabled = 1;
88 E('_wlx_hperx').disabled = 1;
91 form.submit(fom, 1);
93 </script>
95 </head>
96 <body>
97 <form id='_fom' method='post' action='tomato.cgi'>
98 <table id='container' cellspacing=0>
99 <tr><td colspan=2 id='header'>
100 <div class='title'>Tomato</div>
101 <div class='version'>Version <% version(); %></div>
102 </td></tr>
103 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
104 <td id='content'>
105 <div id='ident'><% ident(); %></div>
107 <!-- / / / -->
109 <input type='hidden' name='_nextpage' value='advanced-wireless.asp'>
110 <input type='hidden' name='_nextwait' value='10'>
111 <input type='hidden' name='_service' value='*'>
112 <input type='hidden' name='_reboot' value='0'>
114 <script type='text/javascript'>
116 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
117 if (wl_sunit(uidx)<0) {
118 var u = wl_unit(uidx);
120 W('<input type=\'hidden\' id=\'_wl'+u+'_distance\' name=\'wl'+u+'_distance\'>');
121 W('<input type=\'hidden\' id=\'_wl'+u+'_country\' name=\'wl'+u+'_country\'>');
122 W('<input type=\'hidden\' id=\'_wl'+u+'_nmode_protection\' name=\'wl'+u+'_nmode_protection\'>');
124 W('<div class=\'section-title\'>Wireless Settings ');
125 //if (wl_ifaces.length > 1)
126 W('(' + wl_display_ifname(uidx) + ') ');
127 //W('');
128 W('</div><div class=\'section\'>');
130 at = ((nvram['wl'+u+'_security_mode'] != "wep") && (nvram['wl'+u+'_security_mode'] != "radius") && (nvram['wl'+u+'_security_mode'] != "disabled"));
131 createFieldTable('', [
132 { title: 'Afterburner', name: 'wl'+u+'_afterburner', type: 'select', options: [['auto','Auto'],['on','Enable'],['off','Disable *']],
133 value: nvram['wl'+u+'_afterburner'] },
134 { title: 'AP Isolation', name: 'wl'+u+'_ap_isolate', type: 'select', options: [['0','Disable *'],['1','Enable']],
135 value: nvram['wl'+u+'_ap_isolate'] },
136 { title: 'Authentication Type', name: 'wl'+u+'_auth', type: 'select',
137 options: [['0','Auto *'],['1','Shared Key']], attrib: at ? 'disabled' : '',
138 value: at ? 0 : nvram['wl'+u+'_auth'] },
139 { title: 'Basic Rate', name: 'wl'+u+'_rateset', type: 'select', options: [['default','Default *'],['12','1-2 Mbps'],['all','All']],
140 value: nvram['wl'+u+'_rateset'] },
141 { title: 'Beacon Interval', name: 'wl'+u+'_bcn', type: 'text', maxlen: 5, size: 7,
142 suffix: ' <small>(range: 1 - 65535; default: 100)</small>', value: nvram['wl'+u+'_bcn'] },
143 { title: 'CTS Protection Mode', name: 'wl'+u+'_gmode_protection', type: 'select', options: [['off','Disable *'],['auto','Auto']],
144 value: nvram['wl'+u+'_gmode_protection'] },
145 { title: 'Regulatory Mode', name: 'wl'+u+'_reg_mode', type: 'select',
146 options: [['off', 'Off *'],['d', '802.11d'],['h', '802.11h']],
147 value: nvram['wl'+u+'_reg_mode'] },
148 { title: 'Country / Region', name: 'wl'+u+'_country_code', type: 'select',
149 options: wl_countries, value: nvram['wl'+u+'_country_code'] },
150 { title: 'Bluetooth Coexistence', name: 'wl'+u+'_btc_mode', type: 'select',
151 options: [['0', 'Disable *'],['1', 'Enable'],['2', 'Preemption']],
152 value: nvram['wl'+u+'_btc_mode'] },
153 { title: 'Distance / ACK Timing', name: 'f_wl'+u+'_distance', type: 'text', maxlen: 5, size: 7,
154 suffix: ' <small>meters</small>&nbsp;&nbsp;<small>(range: 0 - 99999; 0 = use default)</small>',
155 value: (nvram['wl'+u+'_distance'] == '') ? '0' : nvram['wl'+u+'_distance'] },
156 { title: 'DTIM Interval', name: 'wl'+u+'_dtim', type: 'text', maxlen: 3, size: 5,
157 suffix: ' <small>(range: 1 - 255; default: 1)</small>', value: nvram['wl'+u+'_dtim'] },
158 { title: 'Fragmentation Threshold', name: 'wl'+u+'_frag', type: 'text', maxlen: 4, size: 6,
159 suffix: ' <small>(range: 256 - 2346; default: 2346)</small>', value: nvram['wl'+u+'_frag'] },
160 { title: 'Frame Burst', name: 'wl'+u+'_frameburst', type: 'select', options: [['off','Disable *'],['on','Enable']],
161 value: nvram['wl'+u+'_frameburst'] },
162 { title: 'HP', hidden: !hp || (uidx > 0) },
163 { title: 'Amplifier', indent: 2, name: 'wlx_hpamp' + (uidx > 0 ? uidx + '' : ''), type: 'select', options: [['0','Disable'],['1','Enable *']],
164 value: nvram.wlx_hpamp != '0', hidden: !hp || (uidx > 0) },
165 { title: 'Enhanced RX Sensitivity', indent: 2, name: 'wlx_hperx' + (uidx > 0 ? uidx + '' : ''), type: 'select', options: [['0','Disable *'],['1','Enable']],
166 value: nvram.wlx_hperx != '0', hidden: !hp || (uidx > 0) },
167 { title: 'Maximum Clients', name: 'wl'+u+'_maxassoc', type: 'text', maxlen: 3, size: 5,
168 suffix: ' <small>(range: 1 - 255; default: 128)</small>', value: nvram['wl'+u+'_maxassoc'] },
169 { title: 'Multicast Rate', name: 'wl'+u+'_mrate', type: 'select',
170 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']],
171 value: nvram['wl'+u+'_mrate'] },
172 { title: 'Preamble', name: 'wl'+u+'_plcphdr', type: 'select', options: [['long','Long *'],['short','Short']],
173 value: nvram['wl'+u+'_plcphdr'] },
174 { title: '802.11n Preamble', name: 'wl'+u+'_mimo_preamble', type: 'select', options: [['auto','Auto'],['mm','Mixed Mode *'],['gf','Green Field'],['gfbcm','GF-BRCM']],
175 value: nvram['wl'+u+'_mimo_preamble'], hidden: !nphy },
176 { title: 'Overlapping BSS Coexistence', name: 'wl'+u+'_obss_coex', type: 'select', options: [['0','Off *'],['1','On']],
177 value: nvram['wl'+u+'_obss_coex'], hidden: !nphy },
178 { title: 'RTS Threshold', name: 'wl'+u+'_rts', type: 'text', maxlen: 4, size: 6,
179 suffix: ' <small>(range: 0 - 2347; default: 2347)</small>', value: nvram['wl'+u+'_rts'] },
180 { title: 'Receive Antenna', name: 'wl'+u+'_antdiv', type: 'select', options: [['3','Auto *'],['1','A'],['0','B']],
181 value: nvram['wl'+u+'_antdiv'] },
182 { title: 'Transmit Antenna', name: 'wl'+u+'_txant', type: 'select', options: [['3','Auto *'],['1','A'],['0','B']],
183 value: nvram['wl'+u+'_txant'] },
184 { title: 'Transmit Power', name: 'wl'+u+'_txpwr', type: 'text', maxlen: 3, size: 5,
185 suffix: hp ?
186 ' <small>mW (before amplification)</small>&nbsp;&nbsp;<small>(range: 1 - 251; default: 10)</small>' :
187 ' <small>mW</small>&nbsp;&nbsp;<small>(range: 0 - 400, actual max depends on Country selected; use 0 for hardware default)</small>',
188 value: nvram['wl'+u+'_txpwr'] },
189 { title: 'Transmission Rate', name: 'wl'+u+'_rate', type: 'select',
190 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']],
191 value: nvram['wl'+u+'_rate'] },
192 { title: 'Interference Mitigation', name: 'wl'+u+'_mitigation', type: 'select',
193 options: [['0','None *'],['1','Non-WLAN'],['2','WLAN Manual'],['3','WLAN Auto'],['4','WLAN Auto with Noise Reduction']],
194 value: nvram['wl'+u+'_mitigation'] },
195 { title: 'WMM', name: 'wl'+u+'_wme', type: 'select', options: [['auto','Auto *'],['off','Disable'],['on','Enable']], value: nvram['wl'+u+'_wme'] },
196 { title: 'No ACK', name: 'wl'+u+'_wme_no_ack', indent: 2, type: 'select', options: [['off','Disable *'],['on','Enable']],
197 value: nvram['wl'+u+'_wme_no_ack'] },
198 { title: 'APSD Mode', name: 'wl'+u+'_wme_apsd', indent: 2, type: 'select', options: [['off','Disable'],['on','Enable *']],
199 value: nvram['wl'+u+'_wme_apsd'] },
200 { title: 'Wireless Multicast Forwarding', name: 'wl'+u+'_wmf_bss_enable', type: 'select', options: [['0','Disable *'],['1','Enable']],
201 value: nvram['wl'+u+'_wmf_bss_enable'] }
203 W('</div>');
206 </script>
208 <small>The default settings are indicated with an asterisk <b style='font-size: 1.5em'>*</b> symbol.</small>
210 <!-- / / / -->
212 </td></tr>
213 <tr><td id='footer' colspan=2>
214 <span id='footer-msg'></span>
215 <input type='button' value='Save' id='save-button' onclick='save()'>
216 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'>
217 </td></tr>
218 </table>
219 </form>
220 <script type='text/javascript'>verifyFields(null, 1);</script>
221 </body>
222 </html>