www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / pvccfg.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--
3         (c) 2005 U.S. Robotics Corporation
4 -->
5 <html>
6    <head>
7         <title>ATM PVC Configuration</title>
8
9         <link href="usr_layout.css" type="text/css" rel="stylesheet" /><script src="usr_layout.js" type="text/javascript"></script>
10         <link href="usr_menus_dropdown.css" rel="stylesheet" type="text/css"><script src="usr_menus_dropdown.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
11         <link href="usr_device.css" type="text/css" rel="stylesheet" /><script src="usr_device.js" type="text/javascript"></script><link href="usr_91xx.css" type="text/css" rel="stylesheet" /><script src="usr_91xx.js" type="text/javascript"></script><script src="usr_resources.js" type="text/javascript"></script>
12
13         <meta http-equiv="Pragma" content="no-cache">
14
15
16         <script type="text/javascript" src="util.js"></script>
17         <script type="text/javascript">
18 <!-- hide
19
20
21 var upRate = parseInt('<%ejGetOther(lineRate, 0, 0)%>');
22 var pcrMax = 255000;   // Assuming nitro: 255000 * 49 * 8 = 100Mbps  // SASHA: VDSL
23 // var pcrMax = 1887;   // 1887 * 53 * 8 = 800000
24 var serviceCat = '<%ejGetJS(atmServiceCategory)%>';
25 var qos = '<%ejGetJS(enblQos)%>';
26 var hideQos = false;
27 var serviceId = '<%ejGetJS(serviceId)%>';
28 var numQueue = parseInt('<%ejGetOther(memInfo, queueNum)%>');
29 var numQueueMax = 8;
30
31 var enetWan = parseInt('<%ejGetJS(enblEnetWan)%>');
32 var vpi = '<%ejGetJS(atmVpi)%>';
33 var vci = '<%ejGetJS(atmVci)%>';
34
35 if ( isNaN(upRate) == false )
36    pcrMax = Math.ceil((upRate * 1000) / (49 * 8));  // SASHA new value for VDSL
37 //    pcrMax = Math.ceil((upRate * 1000) / (53 * 8));
38
39 var numPvcMax = 8;
40 var chipId = <%ejGetOther(sysInfo, chipId)%>;
41
42 if (( chipId == 0x6348 ) || ( chipId == 0x6358 ))
43    numPvcMax = 16;
44
45 var numEnet = parseInt('<%ejGetJS(numEnet)%>');
46 var numPvc = parseInt('<%ejGetJS(numPvc)%>');
47    
48 function disableQos() {
49    with ( document.forms[0] ) {
50       enblQos.checked = false;
51       enblQos.disabled = 1;
52    }
53 }
54
55 function enableQos() {
56    with ( document.forms[0] ) {
57       if ( qos == '1' )
58          enblQos.checked = true;
59       else
60          enblQos.checked = false;
61       enblQos.disabled = 0;
62    }
63 }
64
65 function hideQosInfo(hide) {
66    var status = 'visible';
67
68    if ( hide == 1 ) {
69       status = 'hidden';
70       disableQos();
71    } else
72       enableQos();
73
74    if (document.getElementById)  // DOM3 = IE5, NS6
75       document.getElementById('qosInfo').style.visibility = status;
76    else {
77       if (document.layers == false) // IE4
78          document.all.qosInfo.style.visibility = status;
79    }
80 }
81
82 function hideInfo(hide) {
83
84    with (document.forms[0]) {
85       if (hide == 3)    // hide all 3
86       {
87          if (document.getElementById) { // DOM3 = IE5, NS6
88             document.getElementById('first1').style.visibility = 'hidden';
89             document.getElementById('2and3').style.visibility = 'hidden';
90          }
91          else { // add more
92          }
93       }
94       else if (hide == 2)  // hide 2 and 3
95       {
96          if (document.getElementById) { // DOM3 = IE5, NS6
97             document.getElementById('2and3').style.visibility = 'hidden';
98             document.getElementById('first1').style.visibility = 'visible';
99          }
100          else {// add more
101          }
102       }
103       else if (hide == 0) // hide none
104       {
105          if (document.getElementById) { // DOM3 = IE5, NS6
106             document.getElementById('first1').style.visibility = 'visible';
107             document.getElementById('2and3').style.visibility = 'visible';
108          }
109          else { // add more
110          }
111       }
112    }
113 }
114
115 function shouldQosBeHidden() {
116    var ret = false;
117    
118    // only allow QoS enabled for ubr, ubrwpcr, ntr_vbr
119    if ( serviceCat == 'UBR' ||
120              serviceCat == 'UBRwPCR' ||
121              serviceCat == 'NRT_VBR' ) {
122       // if PVC is not QoS enabled
123       if ( qos == '0' ) {
124          // if add new PVC
125          if ( serviceId == '0' ) {
126             if ( numQueue > 5 )   // 5 = 8 - 3
127                ret = true;
128          } else {   // if edit existed PVC
129             if ( numQueue > 6 )   // 6 = 8 - 3 + 1
130                ret = true;
131          }
132       }
133    } else
134       ret = true;
135       
136    return ret;
137 }
138
139 function hideVccInfo(hide) {
140    var status = 'visible';
141
142    if ( hide == 1 ) {
143       status = 'hidden';
144       hideInfo(3);
145       hideQosInfo(1);
146    } else {
147       hideQosInfo(0);
148       hideInfo(3);
149    }
150    if (document.getElementById) {  // DOM3 = IE5, NS6
151       document.getElementById('vccInfo').style.visibility = status;
152    } else {
153       if (document.layers) { // Netscape 4
154          with ( document.forms[0] ) {
155             if ( hide == 1 ) {
156                atmVpi.value = '';
157                atmVci.value = '';
158             } else {
159                atmVpi.value = vpi;
160                atmVci.value = vci;
161             }
162          }
163       } else  // IE 4
164          document.all.vccInfo.style.visibility = status;
165    }
166 }
167
168 function ethWanCfgCbClick(cb) {
169    if ( cb.checked == true )
170       hideVccInfo(1);
171    else
172       hideVccInfo(0);
173 }
174
175 function frmLoad() {
176
177    hideQos = shouldQosBeHidden();
178
179    if ( enetWan == 1 ) {
180       hideVccInfo(1);
181    } else if ( hideQos == true )
182       hideQosInfo(1);
183    else
184       hideQosInfo(0);
185    
186    with ( document.forms[0] ) {
187       atmVpi.value = '<%ejGetJS(atmVpi)%>';
188       atmVci.value = '<%ejGetJS(atmVci)%>';
189       peakCell.value  = '<%ejGetJS(atmPeakCellRate)%>';
190       sustainableCell.value = '<%ejGetJS(atmSustainedCellRate)%>';
191       maximumBurst.value = '<%ejGetJS(atmMaxBurstSize)%>'
192    }
193    
194    if (serviceCat == 'UBR') {
195       document.forms[0].serviceCategory[0].selected = true;
196       hideInfo(3);
197    }
198    else if (serviceCat == 'UBRwPCR') {
199       document.forms[0].serviceCategory[1].selected = true;
200       hideInfo(2);
201    }
202    else if (serviceCat == 'CBR') {
203      document.forms[0].serviceCategory[2].selected = true;
204       hideInfo(2);
205    }
206    else if (serviceCat == 'NRT_VBR') {
207       document.forms[0].serviceCategory[3].selected = true;
208       hideInfo(0);
209    }
210    else if (serviceCat == 'RT_VBR') {
211       document.forms[0].serviceCategory[4].selected = true;
212       hideInfo(0);
213    }
214
215    // if add new PVC
216    if ( serviceId == '0' ) {
217       // if it is 6348 or 6358 chip
218       if (( chipId == 0x6348 ) || ( chipId == 0x6358 )) {
219          // if PVC is available but queue is not then
220          // only allow to add UBR PVC
221          if ( numPvc < numPvcMax && numQueue >= numQueueMax ) {
222             for ( i = 4; i > 0; i-- )
223                document.forms[0].serviceCategory.options[i] = null;
224             hideInfo(3);
225          }
226       }
227    }
228 }
229
230 function btnBack() {
231    var code = 'location="' + 'wancfg.cmd'+ '"';
232    eval(code);
233 }
234
235
236 function btnNext() {
237    var loc = 'ntwkprtcl.cgi?';
238
239    with ( document.forms[0] ) {
240       if ( isNaN(parseInt(atmVpi.value)) == true ) {
241          alert('VPI "' + atmVpi.value + '" is invalid.');
242          return;
243       }
244       if ( isNaN(parseInt(atmVci.value)) == true ) {
245          alert('VCI "' + atmVci.value + '" is invalid.');
246          return;
247       }
248       vpi = parseInt(atmVpi.value);
249       if ( vpi < 0 || vpi > 255 ) {
250          alert('VPI "' + atmVpi.value + '" is out of range [0-255].');
251          return;
252       }
253       vci = parseInt(atmVci.value);
254       if ( vci < 32 || vci > 65535 ) {
255          alert('VCI "' + atmVci.value + '" is out of range [32-65535].');
256          return;
257       }
258       loc += 'atmVpi=' + atmVpi.value;
259       loc += '&atmVci=' + atmVci.value;
260       loc += '&atmServiceCategory=' + serviceCategory.value;
261       if (serviceCategory.value != 'UBR') {
262          if ( isNaN(parseInt(peakCell.value)) == true) {
263             alert('Peak Cell Rate "' + peakCell.value + '" is invalid.');
264             return;
265          }
266          peak = parseInt(peakCell.value);
267          if ( peak <= 0 || peak > pcrMax ) {
268             alert('Peak Cell Rate "' + peakCell.value + '" is out of range [1-' + pcrMax + '].');
269             return;
270          }
271          loc += '&atmPeakCellRate=' + peakCell.value;
272       } else
273          loc += '&atmPeakCellRate=0';
274       if (serviceCategory.value == 'NRT_VBR' || serviceCategory.value == 'RT_VBR') {
275          if ( isNaN(parseInt(sustainableCell.value)) == true) {
276             alert('Sustainable Cell Rate "' + sustainableCell.value + '" is invalid.');
277             return;
278          }
279          sustainable = parseInt(sustainableCell.value);
280          if ( sustainable <= 0 || sustainable > pcrMax ) {
281             alert('Sustainable Cell Rate "' + sustainableCell.value + '" is out of range [1-' + pcrMax + '].');
282             return;
283          }
284          if ( sustainable >= peak) {
285             alert('Sustainable Cell Rate "' + sustainableCell.value + '" has to be smaller than Peak Cell Rate');
286             return;
287          }
288          if ( isNaN(parseInt(maximumBurst.value)) == true) {
289             alert('Maximum Burst Size "' + maximumBurst.value + '" is invalid.');
290             return;
291          }
292          maximum = parseInt(maximumBurst.value);
293          if ( maximum <= 0 || maximum > 1000000 ) {
294             alert('Maximum Burst Size "' + maximumBurst.value + '" is out of range [1-1000000].');
295             return;
296          }
297          loc += '&atmSustainedCellRate=' + sustainableCell.value;
298          loc += '&atmMaxBurstSize=' + maximumBurst.value;
299       } else {
300          loc += '&atmSustainedCellRate=0';
301          loc += '&atmMaxBurstSize=0';
302       }
303       if ( enblQos.checked == true )
304          loc += '&enblQos=on';
305       else
306          loc += '&enblQos=0';
307    }
308    loc += '&quickSetup=' + 0;
309
310    var code = 'location="' + loc + '"';
311    eval(code);
312 }
313
314
315 function cbClick(obj) {
316    var idx = obj.selectedIndex;
317    var val = obj.options[idx].value;
318    if ( val == "UBR" )
319       hideInfo(3);
320    else if (val == "UBRwPCR" || val == "CBR")
321       hideInfo(2);
322    else
323       hideInfo(0);   
324    if (val == 'CBR' || val == 'RT_VBR')
325       hideQosInfo(1);     
326    else {
327       if ( hideQos == false )
328          hideQosInfo(0);    
329    }
330 }
331
332 // done hiding -->
333 </script>
334    </head>
335    <body onload="initMenu(); frmLoad();">
336
337 <script type="text/javascript">
338         writeHeader("ATM PVC Configuration");
339 </script>
340
341 <form ID="Form1">
342    <div id='vccInfo'>
343    <table cellSpacing="4" cellPadding="0" border="0">
344       <tr>
345          <td><label for="atmVpi">VPI:</label></td>
346          <td><input type="text" size="4" name="atmVpi" id="atmVpi"> (0-255)</td>
347       </tr>
348       <tr>
349          <td><label for="atmVci">VCI:</label></td>
350          <td><input type="text" size="4" name="atmVci" id="atmVci"> (32-65535)</td>
351       </tr>
352    </table>
353    <br>
354    <table border="0" cellpadding="0" cellspacing="0">
355       <tr>
356          <td><label for="">Service category:</label></td>
357          <td><select name="serviceCategory" id="serviceCategory" onchange='cbClick(this)'>
358                <option value="UBR" selected>
359                UBR Without PCR
360                <option value="UBRwPCR">
361                UBR With PCR
362                <option value="CBR">
363                CBR
364                <option value="NRT_VBR">
365                Non Realtime VBR
366                <option value="RT_VBR">
367                   Realtime VBR</option>
368             </select></td>
369       </tr>
370    </table>
371
372         <div id='first1'>
373                 <table border="0" cellpadding="0" cellspacing="0">
374                         <tr>
375                                 <td><label for="peakCell">Peak cell rate:</label></td>
376                                 <td><input type="text" size="6" name="peakCell" id="peakCell"> (cells/s)</td>
377                         </tr>
378                 </table>
379         </div>
380                 
381         <div id='2and3'>
382                 <table border="0" cellpadding="0" cellspacing="0">
383                         <tr>
384                                 <td><label for="sustainableCell">Sustainable cell rate:</label></td>
385                                 <td><input type="text" size="6" name="sustainableCell" id="sustainableCell"> (cells/s)</td>
386                         </tr>
387                         <tr>
388                                 <td><label for="maximumBurst">Maximum burst size:</label></td>
389                                 <td><input type="text" size="6" name="maximumBurst" id="maximumBurst"> (cells)</td>
390                         </tr>
391                 </table>
392         </div>
393     <div id='qosInfo'>
394        <h3>Quality Of Service</h3>
395        <p>
396        Enabling packet level QoS for a PVC improves performance for selected classes 
397        of applications.&nbsp;&nbsp;QoS cannot be set for&nbsp;CBR and Realtime VBR. 
398        &nbsp;QoS consumes system resources; therefore the number of PVCs 
399        will be reduced. Use <b>LAN/Quality of Service</b> to 
400        assign priorities for the applications.<br>
401        </p>
402                 <p><input type='checkbox' name='enblQos' id=enblQos> <label for="enblQos">Quality of service</label></p>
403     </div>
404 </div>
405         <p><input type='button' onClick='btnBack()' value='Back'> <input type='button' onClick='btnNext()' value='Next'></p>
406 </form>
407
408 <script type="text/javascript">
409         writeFooter();
410 </script>
411
412 </body>
413 </html>