1<!--
2$Copyright Open Broadcom Corporation$
3
4$Id:
5-->
6
7<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8<html lang="en">
9<head>
10<title>Broadcom Home Gateway Reference Design: WPS</title>
11<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
12<link rel="stylesheet" type="text/css" href="style.css" media="screen">
13<script language="JavaScript" type="text/javascript" src="overlib.js"></script>
14<script language="JavaScript" type="text/javascript">
15<!--
16
17/*	
18#ifdef BCMWFI
19*/
20var staListWl0 = "<% wl_invite_list(); %>".split('\t');
21
22var interval = 30;
23var nvinterval = "<% nvram_get("wfi_refresh_interval"); %>" ;
24var wfi = "<% nvram_match("wl_wfi_enable", "1", "1"); %>";
25
26if(nvinterval)
27{
28	interval = parseInt(nvinterval);
29}
30
31function printTable()
32{
33	if(wfi == 1){
34		for(var i=0; i<staListWl0.length; i++){
35			if(staListWl0[i].length < 17){
36				continue;
37			}
38		
39			document.writeln("<tr align=\"center\" id=\"trRow" + i + "\">");
40	    		document.writeln("<td class=\"label\">");
41	 
42	    		document.writeln("<input type=\"submit\" style=\"height: 25px; width: 100px\" name=\"action\" value=\"Invite\" OnClick=\"invite(" + i + ");\">");
43	   		
44	   		document.writeln("</td>");
45	   		document.writeln("<td class=\"label\">");
46	   	
47	   		if(staListWl0[i].length > 17){
48	   			document.writeln(staListWl0[i].substring(17,(staListWl0[i].length)));
49	   		}
50	   		else{
51	   			document.writeln ("&nbsp");
52	   		}
53	   		document.writeln("</td>");
54	   		document.writeln("<td class=\"label\">");
55	   		document.writeln(staListWl0[i].substring(0,17));
56	   		document.writeln("</td>");
57	   		document.writeln("</tr>");
58 		}
59 	}
60	return;
61}
62
63function invite(index)
64{
65	
66	if(staListWl0[index].length > 17){
67		document.forms[0].invite_name.value = staListWl0[index].substring(17,(staListWl0[index].length));
68	}
69	else{
70		document.forms[0].invite_name.value = "";
71	}
72	
73	document.forms[0].invite_mac.value = staListWl0[index].substring(0,17);
74
75}
76
77function wfi_enable_change()
78{
79	if(document.forms[0].wl_wfi_enable.value == 1){
80		//document.forms[0].wl_unit.disabled = 0;
81		document.forms[0].wl_wfi_pinmode.disabled = 0;
82		document.forms[0].refresh_button.disabled = 0;
83	}
84	else{
85		//gray out
86		//document.forms[0].wl_unit.disabled = 1;
87		document.forms[0].wl_wfi_pinmode.disabled = 1;
88		document.forms[0].refresh_button.disabled = 1;
89	}
90}
91
92function autoRefresh()
93{
94	if(wfi == 1){
95		setTimeout("doRefresh()", interval * 1000 );
96	}
97}
98
99function doRefresh()
100{
101
102	document.forms[0].action.value = "Select";
103	document.forms[0].submit();
104}
105function writeStrRefres()
106{
107	if(wfi == 1){
108		document.writeln("Auto refreshing every 30 seconds");
109	}
110}
111/*	
112#endif
113*/
114
115function wps_config_change()
116{
117<% wps_config_change_display(); %>
118}
119
120function wps_current_psk_window() 
121{
122<% wps_current_psk_window_display(); %>
123}
124
125function wps_psk_window() 
126{
127<% wps_psk_window_display(); %>
128}
129
130function wps_akm_change()
131{
132	var akm = document.forms[0].wps_akm[document.forms[0].wps_akm.selectedIndex].value;
133	var action = document.forms[0].wps_action.value;
134	
135	if (action == "ConfigAP" || action == "AddEnrollee") {
136		if (akm == 0) {
137			document.forms[0].wps_crypto.disabled = 1;
138			document.forms[0].wps_crypto.value = "0";
139			document.forms[0].wps_psk.disabled = 1;
140		}
141		else {
142			document.forms[0].wps_crypto.disabled = 0;
143			document.forms[0].wps_psk.disabled = 0;
144		}
145	}
146}
147
148function wps_get_ap_config_submit()
149{
150	<% wps_get_ap_config_submit_display(); %>
151}
152
153function pre_submit()
154{
155	var action = document.forms[0].wps_action.value;
156	var akm = document.forms[0].wps_akm[document.forms[0].wps_akm.selectedIndex].value;
157
158	if (action == "ConfigAP" || action == "AddEnrollee") {
159		/* Check WPS in OPEN security */
160		if (akm == "0")
161			return confirm("Are you sure to configure WPS in Open security?");
162	}
163	if (action == "GetAPConfig")
164		return wps_get_ap_config_submit();
165	return true;
166}
167
168function wps_onLoad()
169{
170/*	
171#ifdef BCMWFI
172*/
173	wfi_enable_change();
174	autoRefresh();
175/*	
176#endif
177*/
178	wps_akm_change();
179}
180
181//-->
182</script>
183</head>
184
185<body onload="wps_onLoad();">
186<div id="overDiv" style="position: absolute; visibility: hidden; z-index: 1000;"></div>
187
188<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#cc0000">
189  <% asp_list(); %>
190</table>
191
192<table width="100%" border="0" cellpadding="0" cellspacing="0">
193  <tbody><tr>
194    <td colspan="2" class="edge"><img src="blur_new.jpg" alt="" border="0"></td>
195  </tr>
196  <tr>
197    <td><img src="logo_new.gif" alt="" border="0"></td>
198    <td valign="top" width="100%">
199	<br>
200	<span class="title">WPS</span><br>
201	<span class="subtitle">This page allows you to configure WPS.</span>
202    </td>
203  </tr>
204</tbody></table>
205
206<form method="post" action="wps.asp">
207<input name="page" value="wps.asp" type="hidden">
208<input name="invite_name" value="0" type="hidden">
209<input name="invite_mac" value="0" type="hidden">
210<p>
211<table border="0" cellpadding="0" cellspacing="0">
212  <tr>
213    <th width="310"
214	onMouseOver="return overlib('Selects which wireless interface to configure.', LEFT);"
215	onMouseOut="return nd();">
216	Wireless Interface:&nbsp;&nbsp;
217    </th>
218    <td>&nbsp;&nbsp;</td>
219    <td>
220	<select name="wl_unit" onChange="submit();">
221	  <% wl_list("INCLUDE_SSID" , "INCLUDE_VIFS"); %>
222	</select>
223    </td>
224    <td>
225	<button type="submit" name="action" value="Select">Select</button>
226    </td>
227  </tr>
228</table>
229
230<p>
231<% wps_display(); %>
232
233<!--
234#ifdef BCMWFI
235-->
236<p>
237<table border="0" cellpadding="0" cellspacing="0">
238  <tr>
239    <th width="310"
240	onMouseOver="return overlib('Enables or disable Wifi-Invite feature.', LEFT);"
241	onMouseOut="return nd();">
242	Wifi-Invite:&nbsp;&nbsp;
243    </th>
244    <td>&nbsp;&nbsp;</td>
245    <td>
246	<select name="wl_wfi_enable" onchange="wfi_enable_change();">
247	  <option value="1" <% nvram_match("wl_wfi_enable", "1", "selected"); %>>Enabled</option>
248	  <option value="0" <% nvram_invmatch("wl_wfi_enable", "1", "selected"); %>>Disabled</option>
249	</select>
250    </td>
251  </tr>
252    <tr>
253    <th width="310"
254	onMouseOver="return overlib('Set the Wifi-Invite PIN Mode to auto or manual.', LEFT);"
255	onMouseOut="return nd();">
256	Wifi-Invite PIN Mode:&nbsp;&nbsp;
257    </th>
258    <td>&nbsp;&nbsp;</td>
259    <td>
260	<select name="wl_wfi_pinmode">
261	  <option value="0" <% nvram_match("wl_wfi_pinmode", "0", "selected"); %>>Auto</option>
262	  <option value="1" <% nvram_match("wl_wfi_pinmode", "1", "selected"); %>>Manual</option>
263	</select>
264    </td>
265  </tr>
266</table>
267<!--
268#endif
269-->
270<p>
271<table border="0" cellpadding="0" cellspacing="0">
272    <tr>
273      <td width="310"></td>
274      <td>&nbsp;&nbsp;</td>
275      <td>
276	  <input type="submit" name="action" value="Apply" onclick="wps_config_change()";>
277	  <input type="reset" name="action" value="Cancel">
278      </td>
279    </tr>
280</table>
281
282<!--
283#ifdef BCMWFI
284-->
285<p>
286<table border="0" cellpadding="0" cellspacing="0">
287  <tr>
288    <th width="310"
289	onMouseOver="return overlib('Scan to find Wifi-Invite enabled STAs.', LEFT);"
290	onMouseOut="return nd();">
291	List Wifi-Invite enabled STAs:&nbsp;&nbsp;
292    </th>
293    <td>&nbsp;&nbsp;</td>
294    <td>
295	<input type="button" name="refresh_button" value="Refresh" style="height: 25px; width: 100px" onClick="doRefresh()">
296    </td>
297        <td>&nbsp;&nbsp;</td>
298    <td>
299	<SCRIPT LANGUAGE="JavaScript">
300		writeStrRefres();
301	</SCRIPT>
302    </td>
303  </tr>
304</table>
305
306<p>
307<table border="0" cellpadding="0" cellspacing="0">
308  <tr>
309    <th width="310" valign="top"
310	onMouseOver="return overlib('The list of Wifi-Invite enabled STAs.', LEFT);"
311	onMouseOut="return nd();">
312	Wifi-Invite enabled STAs:&nbsp;&nbsp;
313    </th>
314    <td>&nbsp;&nbsp;</td>
315    <td>
316	<table border="1" cellpadding="2" cellspacing="0">
317	  <tr align="center" HEIGHT=35>
318	    <td class="label" WIDTH=100 HEIGHT=35 align="center">Action</td>
319	    <td class="label" WIDTH=100 align="center">Friendly Name</td>
320	    <td class="label" WIDTH=100 align="center">MAC Address</td>
321	    <!-- <td class="label" WIDTH=100 align="center">Status</td> -->
322	  </tr>
323	  <script language="JavaScript" type="text/javascript">
324		printTable();
325	  </script>
326	</table>
327    </td>
328  </tr>
329</table>
330<!--
331#endif
332-->
333
334<p>
335
336<p class="label">&#169;2001-2012 Broadcom Corporation. All rights
337reserved. 54g and XPress are trademarks of Broadcom Corporation.</p>
338
339</form></body></html>
340