www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / bcmdrivers / broadcom / net / wl / impl2 / shared / defaults.c
1 /*
2  * Router default NVRAM values
3  *
4  * Copyright 2006, Broadcom Corporation
5  * All Rights Reserved.
6  * 
7  * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8  * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9  * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10  * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11  *
12  * $Id$
13  */
14
15 #include <epivers.h>
16 #include <typedefs.h>
17 #include <string.h>
18 #include <bcmnvram.h>
19 #include <wlioctl.h>
20 #include <stdio.h>
21 #include <ezc.h>
22 #include <bcmconfig.h>
23
24 #define XSTR(s) STR(s)
25 #define STR(s) #s
26
27 struct nvram_tuple router_defaults[] = {
28         /* OS parameters */
29         { "os_name", "", 0 },                   /* OS name string */
30         { "os_version", EPI_VERSION_STR, 0 },   /* OS revision */
31         { "os_date", __DATE__, 0 },             /* OS date */
32
33         /* Miscellaneous parameters */
34         { "timer_interval", "3600", 0 },        /* Timer interval in seconds */
35         { "ntp_server", "192.5.41.40 192.5.41.41 133.100.9.2", 0 },             /* NTP server */
36         { "time_zone", "PST8PDT", 0 },          /* Time zone (GNU TZ format) */
37         { "log_level", "0", 0 },                /* Bitmask 0:off 1:denied 2:accepted */
38         { "upnp_enable", "0", 0 },              /* Start UPnP */
39         { "ezc_enable", "1", 0 },               /* Enable EZConfig updates */
40         { "ezc_version", EZC_VERSION_STR, 0 },  /* EZConfig version */
41         { "is_default", "1", 0 },               /* is it default setting: 1:yes 0:no */
42         { "os_server", "", 0 },                 /* URL for getting upgrades */
43         { "stats_server", "", 0 },              /* URL for posting stats */
44         { "console_loglevel", "1", 0 },         /* Kernel panics only */
45
46         /* Big switches */
47         { "router_disable", "0", 0 },           /* lan_proto=static lan_stp=0 wan_proto=disabled */
48         { "ure_disable", "1", 0 },              /* sets APSTA for radio and puts wirelesss
49                                                  * interfaces in correct lan
50                                                  */
51         { "fw_disable", "0", 0 },               /* Disable firewall (allow new connections from the
52                                                  * WAN)
53                                                  */
54
55         { "log_ipaddr", "", 0 },                /* syslog recipient */
56
57         /* LAN H/W parameters */
58         { "lan_ifname", "", 0 },                /* LAN interface name */
59         { "lan_ifnames", "", 0 },               /* Enslaved LAN interfaces */
60         { "lan_hwnames", "", 0 },               /* LAN driver names (e.g. et0) */
61         { "lan_hwaddr", "", 0 },                /* LAN interface MAC address */
62
63         /* LAN TCP/IP parameters */
64         { "lan_dhcp", "0", 0 },                 /* DHCP client [static|dhcp] */
65         { "lan_ipaddr", "192.168.1.1", 0 },     /* LAN IP address */
66         { "lan_netmask", "255.255.255.0", 0 },  /* LAN netmask */
67         { "lan_gateway", "192.168.1.1", 0 },    /* LAN gateway */
68         { "lan_proto", "dhcp", 0 },             /* DHCP server [static|dhcp] */
69         { "lan_wins", "", 0 },                  /* x.x.x.x x.x.x.x ... */
70         { "lan_domain", "", 0 },                /* LAN domain name */
71         { "lan_lease", "86400", 0 },            /* LAN lease time in seconds */
72         { "lan_stp", "1", 0 },                  /* LAN spanning tree protocol */
73         { "lan_route", "", 0 },                 /* Static routes
74                                                  * (ipaddr:netmask:gateway:metric:ifname ...)
75                                                  */
76
77 #ifdef __CONFIG_NAT__
78         /* WAN H/W parameters */
79         { "wan_ifname", "", 0 },                /* WAN interface name */
80         { "wan_ifnames", "", 0 },               /* WAN interface names */
81         { "wan_hwname", "", 0 },                /* WAN driver name (e.g. et1) */
82         { "wan_hwaddr", "", 0 },                /* WAN interface MAC address */
83
84         /* WAN TCP/IP parameters */
85         { "wan_proto", "dhcp", 0 },             /* [static|dhcp|pppoe|disabled] */
86         { "wan_ipaddr", "0.0.0.0", 0 },         /* WAN IP address */
87         { "wan_netmask", "0.0.0.0", 0 },        /* WAN netmask */
88         { "wan_gateway", "0.0.0.0", 0 },        /* WAN gateway */
89         { "wan_dns", "", 0 },                   /* x.x.x.x x.x.x.x ... */
90         { "wan_wins", "", 0 },                  /* x.x.x.x x.x.x.x ... */
91         { "wan_hostname", "", 0 },              /* WAN hostname */
92         { "wan_domain", "", 0 },                /* WAN domain name */
93         { "wan_lease", "86400", 0 },            /* WAN lease time in seconds */
94
95         /* PPPoE parameters */
96         { "wan_pppoe_ifname", "", 0 },          /* PPPoE enslaved interface */
97         { "wan_pppoe_username", "", 0 },        /* PPP username */
98         { "wan_pppoe_passwd", "", 0 },          /* PPP password */
99         { "wan_pppoe_idletime", "60", 0 },      /* Dial on demand max idle time (seconds) */
100         { "wan_pppoe_keepalive", "0", 0 },      /* Restore link automatically */
101         { "wan_pppoe_demand", "0", 0 },         /* Dial on demand */
102         { "wan_pppoe_mru", "1492", 0 },         /* Negotiate MRU to this value */
103         { "wan_pppoe_mtu", "1492", 0 },         /* Negotiate MTU to the smaller of this value or
104                                                  * the peer MRU
105                                                  */
106         { "wan_pppoe_service", "", 0 },         /* PPPoE service name */
107         { "wan_pppoe_ac", "", 0 },              /* PPPoE access concentrator name */
108
109         /* Misc WAN parameters */
110         { "wan_desc", "", 0 },                  /* WAN connection description */
111         { "wan_route", "", 0 },                 /* Static routes
112                                                  * (ipaddr:netmask:gateway:metric:ifname ...)
113                                                  */
114         { "wan_primary", "0", 0 },              /* Primary wan connection */
115
116         { "wan_unit", "0", 0 },                 /* Last configured connection */
117
118         /* Filters */
119         { "filter_maclist", "", 0 },            /* xx:xx:xx:xx:xx:xx ... */
120         { "filter_macmode", "deny", 0 },        /* "allow" only, "deny" only, or "disabled"
121                                                  * (allow all)
122                                                  */
123         { "filter_client0", "", 0 },            /* [lan_ipaddr0-lan_ipaddr1|*]:lan_port0-lan_port1,
124                                                  * proto,enable,day_start-day_end,sec_start-sec_end,
125                                                  * desc
126                                                  */
127
128         /* Port forwards */
129         { "dmz_ipaddr", "", 0 },                /* x.x.x.x (equivalent to 0-60999>dmz_ipaddr:
130                                                  * 0-60999)
131                                                  */
132         { "forward_port0", "", 0 },             /* wan_port0-wan_port1>lan_ipaddr:
133                                                  * lan_port0-lan_port1[:,]proto[:,]enable[:,]desc
134                                                  */
135         { "autofw_port0", "", 0 },              /* out_proto:out_port,in_proto:in_port0-in_port1>
136                                                  * to_port0-to_port1,enable,desc
137                                                  */
138
139         /* DHCP server parameters */
140         { "dhcp_start", "192.168.1.100", 0 },   /* First assignable DHCP address */
141         { "dhcp_end", "192.168.1.150", 0 },     /* Last assignable DHCP address */
142         { "dhcp_domain", "wan", 0 },            /* Use WAN domain name first if available (wan|lan)
143                                                  */
144         { "dhcp_wins", "wan", 0 },              /* Use WAN WINS first if available (wan|lan) */
145 #endif  /* __CONFIG_NAT__ */
146
147         /* Web server parameters */
148         { "http_username", "", 0 },             /* Username */
149         { "http_passwd", "admin", 0 },          /* Password */
150         { "http_wanport", "", 0 },              /* WAN port to listen on */
151         { "http_lanport", "80", 0 },            /* LAN port to listen on */
152
153         /* Wireless parameters */
154         { "wl_ifname", "", 0 },                 /* Interface name */
155         { "wl_hwaddr", "", 0 },                 /* MAC address */
156         { "wl_phytype", "b", 0 },               /* Current wireless band ("a" (5 GHz),
157                                                  * "b" (2.4 GHz), or "g" (2.4 GHz))
158                                                  */
159         { "wl_corerev", "", 0 },                /* Current core revision */
160         { "wl_phytypes", "", 0 },               /* List of supported wireless bands (e.g. "ga") */
161         { "wl_radioids", "", 0 },               /* List of radio IDs */
162         { "wl_ssid", "USR9113", 0 },            /* Service set ID (network name) */
163         { "wl_country_code", "", 0 },           /* Country Code (default obtained from driver) */
164         { "wl_radio", "1", 0 },                 /* Enable (1) or disable (0) radio */
165         { "wl_closed", "0", 0 },                /* Closed (hidden) network */
166         { "wl_ap_isolate", "0", 0 },            /* AP isolate mode */
167         { "wl_mode", "ap", 0 },                 /* AP mode (ap|sta|wds) */
168         { "wl_lazywds", "0", 0 },               /* Enable "lazy" WDS mode (0|1) */
169         { "wl_wds", "", 0 },                    /* xx:xx:xx:xx:xx:xx ... */
170         { "wl_wds_timeout", "1", 0 },           /* WDS link detection interval defualt 1 sec */
171         { "wl_wep", "disabled", 0 },            /* WEP data encryption (enabled|disabled) */
172         { "wl_auth", "0", 0 },                  /* Shared key authentication optional (0) or
173                                                  * required (1)
174                                                  */
175         { "wl_key", "1", 0 },                   /* Current WEP key */
176         { "wl_key1", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
177         { "wl_key2", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
178         { "wl_key3", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
179         { "wl_key4", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
180         { "wl_maclist", "", 0 },                /* xx:xx:xx:xx:xx:xx ... */
181         { "wl_macmode", "disabled", 0 },        /* "allow" only, "deny" only, or "disabled"
182                                                  * (allow all)
183                                                  */
184         { "wl_channel", "11", 0 },              /* Channel number */
185         { "wl_reg_mode", "off", 0 },            /* Regulatory: 802.11H(h)/802.11D(d)/off(off) */
186         { "wl_dfs_preism", "60", 0 },           /* 802.11H pre network CAC time */
187         { "wl_dfs_postism", "60", 0 },          /* 802.11H In Service Monitoring CAC time */
188         { "wl_rate", "0", 0 },                  /* Rate (bps, 0 for auto) */
189         { "wl_mrate", "0", 0 },                 /* Mcast Rate (bps, 0 for auto) */
190         { "wl_rateset", "default", 0 },         /* "default" or "all" or "12" */
191         { "wl_frag", "2346", 0 },               /* Fragmentation threshold */
192         { "wl_rts", "2347", 0 },                /* RTS threshold */
193         { "wl_dtim", "3", 0 },                  /* DTIM period */
194         { "wl_bcn", "100", 0 },                 /* Beacon interval */
195         { "wl_plcphdr", "long", 0 },            /* 802.11b PLCP preamble type */
196         { "wl_gmode", XSTR(GMODE_AUTO), 0 },    /* 54g mode */
197         { "wl_gmode_protection", "auto", 0 },   /* 802.11g RTS/CTS protection (off|auto) */
198         { "wl_afterburner", "off", 0 },         /* AfterBurner */
199         { "wl_frameburst", "off", 0 },          /* BRCM Frambursting mode (off|on) */
200         { "wl_wme", "auto", 0 },                /* WME mode (off|on|auto) */
201         { "wl_antdiv", "-1", 0 },               /* Antenna Diversity (-1|0|1|3) */
202         { "wl_infra", "1", 0 },                 /* Network Type (BSS/IBSS) */
203         { "wl_nbw_cap", "2", 0},                /* BW Cap; def 20inB and 40inA */
204         { "wl_nctrlsb", "none", 0},             /* N-CTRL SB */
205         { "wl_nband", "2", 0},                  /* N-BAND */
206         { "wl_nmcsidx", "-1", 0},               /* MCS Index for N - rate */
207         { "wl_nmode", "-1", 0},                 /* N-mode */
208         { "wl_nreqd", "0", 0},                  /* Require 802.11n support */
209         { "wl_vlan_prio_mode", "off", 0},       /* VLAN Priority support */
210         { "wl_leddc", "0x640000", 0},           /* 100% duty cycle for LED on router */
211
212         /* WPA parameters */
213         { "wl_auth_mode", "none", 0 },          /* Network authentication mode (radius|none) */
214         { "wl_wpa_psk", "", 0 },                /* WPA pre-shared key */
215         { "wl_wpa_gtk_rekey", "0", 0 },         /* GTK rotation interval */
216         { "wl_radius_ipaddr", "", 0 },          /* RADIUS server IP address */
217         { "wl_radius_key", "", 0 },             /* RADIUS shared secret */
218         { "wl_radius_port", "1812", 0 },        /* RADIUS server UDP port */
219         { "wl_crypto", "tkip", 0 },             /* WPA data encryption */
220         { "wl_net_reauth", "36000", 0 },        /* Network Re-auth/PMK caching duration */
221         { "wl_akm", "", 0 },                    /* WPA akm list */
222
223         /* SES parameters */
224         { "ses_enable", "1", 0 },               /* enable ses */
225         { "ses_event", "2", 0 },                /* initial ses event */
226         { "ses_wds_mode", "1", 0 },             /* enabled if ses cfgd */
227
228         /* SES client parameters */
229         { "ses_cl_enable", "1", 0 },            /* enable ses */
230         { "ses_cl_event", "0", 0 },             /* initial ses event */
231
232         /* WME parameters (cwmin cwmax aifsn txop_b txop_ag adm_control oldest_first) */
233         /* EDCA parameters for STA */
234         { "wl_wme_sta_be", "15 1023 3 0 0 off off", 0 },        /* WME STA AC_BE parameters */
235         { "wl_wme_sta_bk", "15 1023 7 0 0 off off", 0 },        /* WME STA AC_BK parameters */
236         { "wl_wme_sta_vi", "7 15 2 6016 3008 off off", 0 },     /* WME STA AC_VI parameters */
237         { "wl_wme_sta_vo", "3 7 2 3264 1504 off off", 0 },      /* WME STA AC_VO parameters */
238
239         /* EDCA parameters for AP */
240         { "wl_wme_ap_be", "15 63 3 0 0 off off", 0 },           /* WME AP AC_BE parameters */
241         { "wl_wme_ap_bk", "15 1023 7 0 0 off off", 0 },         /* WME AP AC_BK parameters */
242         { "wl_wme_ap_vi", "7 15 1 6016 3008 off off", 0 },      /* WME AP AC_VI parameters */
243         { "wl_wme_ap_vo", "3 7 1 3264 1504 off off", 0 },       /* WME AP AC_VO parameters */
244
245         { "wl_wme_no_ack", "off", 0},           /* WME No-Acknowledgment mode */
246         { "wl_wme_apsd", "on", 0},              /* WME APSD mode */
247
248         { "wl_maxassoc", "128", 0},             /* Max associations driver could support */
249
250         { "wl_unit", "0", 0 },                  /* Last configured interface */
251         { "wl_sta_retry_time", "5", 0 }, /* Seconds between association attempts */
252
253         /* Restore defaults */
254         { "restore_defaults", "0", 0 },         /* Set to 0 to not restore defaults on boot */
255
256         { 0, 0, 0 }
257 };