1 /*****************************************************************************
3 // Copyright (c) 2000-2002 Broadcom Corporation
5 // No portions of this material may be reproduced in any form without the
6 // written permission of:
7 // Broadcom Corporation
9 // Irvine, California 92619
10 // All information contained in this document is Broadcom Corporation
11 // company private, proprietary, and trade secret.
13 ******************************************************************************
16 // Author: Peter T. Tran
17 // Creation Date: 10/17/02
19 ******************************************************************************
21 // Define the WlDefs functions.
23 *****************************************************************************/
28 /********************** Include Files ***************************************/
31 #include <netinet/in.h>
33 /********************** Global Constants ************************************/
36 #define WL_SIZE_2_MAX 2
37 #define WL_SIZE_4_MAX 4
38 #define WL_SIZE_8_MAX 8
39 #define WL_SIZE_132_MAX 132
40 #define WL_SM_SIZE_MAX 16
41 #define WL_MID_SIZE_MAX 32
42 #define WL_SSID_SIZE_MAX 48
43 #define WL_MIN_PSK_LEN 8
44 #define WL_MAX_PSK_LEN 64
45 #define WL_WPA_PSK_SIZE_MAX 72 // max 64 hex or 63 char
46 #define WL_RADIUS_KEY_SIZE_MAX 88 // max is 80, limited by nas_wksp.h. IAS allow up to 128 char
47 #define WL_LG_SIZE_MAX 1024
48 #define WL_MAC_ADDR_SIZE_MAX 18 // USR9108
51 #define WL_MIN_FRAGMENTATION_THRESHOLD 256
52 #define WL_MAX_FRAGMENTATION_THRESHOLD 2346
53 #define WL_MIN_RTS_THRESHOLD 0
54 #define WL_MAX_RTS_THRESHOLD 2347
56 #define WL_MAX_DTIM 255
57 #define WL_MIN_BEACON_INTERVAL 1
58 #define WL_MAX_BEACON_INTERVAL 65535
59 #define WL_KEY64_SIZE_HEX 10
60 #define WL_KEY64_SIZE_CHAR 5
61 #define WL_KEY128_SIZE_HEX 26
62 #define WL_KEY128_SIZE_CHAR 13
64 #define WL_FLT_MAC_OFF "disabled"
65 #define WL_FLT_MAC_ALLOW "allow"
66 #define WL_FLT_MAC_DENY "deny"
68 #define WL_BRIDGE_RESTRICT_ENABLE 0
69 #define WL_BRIDGE_RESTRICT_DISABLE 1
70 #define WL_BRIDGE_RESTRICT_ENABLE_SCAN 2
72 /* authentication mode */
73 #define WL_AUTH_OPEN "open"
74 #define WL_AUTH_SHARED "shared"
75 #define WL_AUTH_RADIUS "radius"
76 #define WL_AUTH_WPA "wpa"
77 #define WL_AUTH_WPA_PSK "psk"
78 #define WL_AUTH_WPA2 "wpa2"
79 #define WL_AUTH_WPA2_PSK "psk2"
80 #define WL_AUTH_WPA2_MIX "wpa2mix"
81 #define WL_AUTH_WPA2_PSK_MIX "psk2mix"
82 #define WL_WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */
83 #define WL_WPA_AUTH_NONE 0x0001 /* none (IBSS) */
84 #define WL_WPA_AUTH_UNSPECIFIED 0x0002 /* over 802.1x */
85 #define WL_WPA_AUTH_PSK 0x0004 /* Pre-shared key */
86 #define WL_WPA_AUTH_8021X 0x0020 /* 802.1x, reserved */
87 #define WL_WPA2_AUTH_UNSPECIFIED 0x0040 /* over 802.1x */
88 #define WL_WPA2_AUTH_PSK 0x0080 /* Pre-shared key */
90 /* wireless security bitvec */
92 #define TKIP_ENABLED 2
96 #define WPA_CAP_WPA2_PREAUTH 1
98 #define WL_BIT_KEY_128 0
99 #define WL_BIT_KEY_64 1
101 #define WL_PHY_TYPE_A "a"
102 #define WL_PHY_TYPE_B "b"
103 #define WL_PHY_TYPE_G "g"
105 #define WL_BASIC_RATE_DEFAULT "default"
106 #define WL_BASIC_RATE_ALL "all"
107 #define WL_BASIC_RATE_1_2 "12"
108 #define WL_BASIC_RATE_WIFI_2 "wifi2"
110 #define WL_MODE_G_AUTO 1
111 #define WL_MODE_G_PERFORMANCE 4
112 #define WL_MODE_G_LRS 5
113 #define WL_MODE_B_ONLY 0
115 #define WL_AUTO "auto"
118 #define WL_DISABLED "disabled"
119 #define WL_ENABLED "enabled"
124 #define WL_PREAUTH_ON 1
125 #define WL_PREAUTH_OFF 0
130 #define WIRELESS_APPID "WirelessCfg"
132 #define WL_MSSID_VARS_NUM_ID 2
133 #define WL_MSSID_VARS_TBL_ID 3
134 #define WL_FLT_MAC_NUM_ID 4
135 #define WL_FLT_MAC_TBL_ID 5
136 #define WL_WDS_MAC_NUM_ID 6
137 #define WL_WDS_MAC_TBL_ID 7
138 #define WL_SCAN_WDS_MAC_NUM_ID 8
139 #define WL_SCAN_WDS_MAC_TBL_ID 9
141 #define RESET_WLAN "/var/reset.wlan"
144 #define MAP_FROM_NVRAM 0
145 #define MAP_TO_NVRAM 1
146 #define WL_SES_ENTRY 99
147 #define MAX_NVPARSE 100
148 #define SES_WDS_MODE_DISABLED 0 /* disabled */
149 #define SES_WDS_MODE_AUTO 1 /* dynamic cf/cl selection */
150 #define SES_WDS_MODE_ENABLED_ALWAYS 2 /* enabled always */
151 #define SES_WDS_MODE_ENABLED_EXCL 3 /* WDS-only i.e no regular STAs */
152 #define SES_WDS_MODE_CLIENT 4 /* always wds client mode */
153 #define REG_MODE_OFF 0 /* disabled 11h/d mode */
154 #define REG_MODE_H 1 /* use 11h mode */
155 #define REG_MODE_D 2 /* use 11d mode */
156 /********************** Global Structs ****************************************/
162 WL_STS_ERR_OBJECT_NOT_FOUND
172 WL_SETUP_SES /*SUPPORT_SES*/
177 char wlMode[WL_SM_SIZE_MAX];
178 char wlCountry[WL_SM_SIZE_MAX];
179 char wlFltMacMode[WL_SM_SIZE_MAX];
180 char wlPhyType[WL_SIZE_2_MAX];
181 char wlBasicRate[WL_SIZE_8_MAX];
182 char wlProtection[WL_SIZE_8_MAX];
183 char wlPreambleType[WL_SM_SIZE_MAX];
184 char wlAfterBurnerEn[WL_SIZE_8_MAX];
185 char wlFrameBurst[WL_SIZE_4_MAX];
186 char wlWlanIfName[WL_SIZE_4_MAX];
187 char wlWds[WL_WDS_NUM][WL_MID_SIZE_MAX];
211 char wlSesStates[WL_SIZE_8_MAX];
212 char wlSesSsid[WL_SSID_SIZE_MAX];
213 char wlSesWpaPsk[WL_WPA_PSK_SIZE_MAX];
216 char wlSesAuthMode[WL_SIZE_8_MAX];
217 char wlSesWep[WL_SM_SIZE_MAX];
218 char wlSesWpa[WL_SM_SIZE_MAX];
222 char wlWdsWsec[WL_SIZE_132_MAX];
229 } WIRELESS_VAR, *PWIRELESS_VAR;
232 char wlSsid[WL_SSID_SIZE_MAX];
233 char wlKeys128[WL_KEY_NUM][WL_MID_SIZE_MAX];
234 char wlKeys64[WL_KEY_NUM][WL_SM_SIZE_MAX];
235 char wlWpaPsk[WL_WPA_PSK_SIZE_MAX];
236 char wlRadiusKey[WL_RADIUS_KEY_SIZE_MAX];
237 char wlWep[WL_SM_SIZE_MAX];
238 char wlWpa[WL_SM_SIZE_MAX];
239 struct in_addr wlRadiusServerIP;
240 char wlAuthMode[WL_SIZE_8_MAX];
252 int wlNasWillrun; /*runtime*/
253 char wlSecurity[WL_SSID_SIZE_MAX]; // USR9108 Quick setup security.
254 } WIRELESS_MSSID_VAR, *PWIRELESS_MSSID_VAR;
260 } WIRELESS_ITEM, *PWIRELESS_ITEM;
263 char macAddress[WL_MID_SIZE_MAX];
264 char ssid[WL_SSID_SIZE_MAX];
265 } WL_FLT_MAC_ENTRY, *PWL_FLT_MAC_ENTRY;
267 typedef struct { // don't want store ssid
268 char macAddress[WL_MID_SIZE_MAX];
269 } WL_FLT_MAC_STORE_ENTRY, *PWL_FLT_MAC_STORE_ENTRY;
272 char macAddress[WL_MID_SIZE_MAX];
275 } WL_STATION_LIST_ENTRY, *PWL_STATION_LIST_ENTRY;