+/*
+<:copyright-gpl
+ Copyright 2004 Broadcom Corp. All Rights Reserved.
+
+ This program is free software; you can distribute it and/or modify it
+ under the terms of the GNU General Public License (Version 2) as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+:>
+*/
+
/*****************************************************************************
//
-// Copyright (c) 2000-2002 Broadcom Corporation
-// All Rights Reserved
-// No portions of this material may be reproduced in any form without the
-// written permission of:
-// Broadcom Corporation
-// 16215 Alton Parkway
-// Irvine, California 92619
-// All information contained in this document is Broadcom Corporation
-// company private, proprietary, and trade secret.
//
******************************************************************************
//
/********************** Global Constants ************************************/
+#define WL_NUM_SSID 2
#define WL_SIZE_2_MAX 2
#define WL_SIZE_4_MAX 4
#define WL_SIZE_8_MAX 8
+#define WL_SIZE_132_MAX 132
#define WL_SM_SIZE_MAX 16
#define WL_MID_SIZE_MAX 32
#define WL_SSID_SIZE_MAX 48
+#define WL_MIN_PSK_LEN 8
+#define WL_MAX_PSK_LEN 64
#define WL_WPA_PSK_SIZE_MAX 72 // max 64 hex or 63 char
#define WL_RADIUS_KEY_SIZE_MAX 88 // max is 80, limited by nas_wksp.h. IAS allow up to 128 char
#define WL_LG_SIZE_MAX 1024
#define WL_KEY64_SIZE_CHAR 5
#define WL_KEY128_SIZE_HEX 26
#define WL_KEY128_SIZE_CHAR 13
+#define WL_KEY64_SIZE_ASCII 5
+#define WL_MAX_ASSOC_STA 128
-#define WL_FLT_MAC_OFF "disabled" //macfilter disabled
+#define WL_FLT_MAC_OFF "disabled"
#define WL_FLT_MAC_ALLOW "allow"
#define WL_FLT_MAC_DENY "deny"
#define WL_BRIDGE_RESTRICT_ENABLE 0
-#define WL_BRIDGE_RESTRICT_ENABLE_SCAN 1
-#define WL_BRIDGE_RESTRICT_DISABLE 2
+#define WL_BRIDGE_RESTRICT_DISABLE 1
+#define WL_BRIDGE_RESTRICT_ENABLE_SCAN 2
/* authentication mode */
#define WL_AUTH_OPEN "open"
-#define WL_AUTH_SHARED "shared" //equals to wep, set wep key
-#define WL_AUTH_RADIUS "radius" //must have wep enabled
+#define WL_AUTH_SHARED "shared"
+#define WL_AUTH_RADIUS "radius"
#define WL_AUTH_WPA "wpa"
#define WL_AUTH_WPA_PSK "psk"
#define WL_AUTH_WPA2 "wpa2"
#define WL_AUTH_WPA2_PSK "psk2"
#define WL_AUTH_WPA2_MIX "wpa2mix"
#define WL_AUTH_WPA2_PSK_MIX "psk2mix"
-#ifndef BCMWPA2
-#define WL_WPA_AUTH_DISABLED 0x00ff /* Legacy (i.e., non-WPA) */
-#define WL_WPA_AUTH_NONE 0x0000 /* none (IBSS) */
-#define WL_WPA_AUTH_UNSPECIFIED 0x0001 /* over 802.1x */
-#define WL_WPA_AUTH_PSK 0x0002 /* Pre-shared key */
-#define WPA_AUTH_8021X 0x0020 /* 802.1x, reserved */
-#define WL_WPA2_AUTH_UNSPECIFIED WL_WPA_AUTH_UNSPECIFIED /* over 802.1x */
-#define WL_WPA2_AUTH_PSK WL_WPA_AUTH_PSK /* Pre-shared key */
-#else
#define WL_WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */
#define WL_WPA_AUTH_NONE 0x0001 /* none (IBSS) */
#define WL_WPA_AUTH_UNSPECIFIED 0x0002 /* over 802.1x */
#define WL_WPA_AUTH_8021X 0x0020 /* 802.1x, reserved */
#define WL_WPA2_AUTH_UNSPECIFIED 0x0040 /* over 802.1x */
#define WL_WPA2_AUTH_PSK 0x0080 /* Pre-shared key */
-#endif
/* wireless security bitvec */
#define WEP_ENABLED 1
#define AES_ENABLED 4
#define WSEC_SWFLAG 8
-#define WL_BIT_KEY_128 1
-#define WL_BIT_KEY_64 0
+#define TKIP_ONLY "tkip"
+#define AES_ONLY "aes"
+#define TKIP_AND_AES "tkip+aes"
+
+
+#define WPA_CAP_WPA2_PREAUTH 1
+
+#define WL_BIT_KEY_128 0
+#define WL_BIT_KEY_64 1
#define WL_PHY_TYPE_A "a"
#define WL_PHY_TYPE_B "b"
#define WL_PHY_TYPE_G "g"
+#define WL_PHY_TYPE_N "n"
#define WL_BASIC_RATE_DEFAULT "default"
#define WL_BASIC_RATE_ALL "all"
#define WL_BASIC_RATE_1_2 "12"
+#define WL_BASIC_RATE_WIFI_2 "wifi2"
-#define WL_MODE_G_AUTO 0 //1 auto
-#define WL_MODE_G_PERFORMANCE 1 //4 performance
-#define WL_MODE_G_LRS 2 //5 lrs
-#define WL_MODE_B_ONLY 3 //0 802.11b
+#if 0 //swda remove,05/03/2005
+#define WL_MODE_G_AUTO 1
+#define WL_MODE_G_PERFORMANCE 4
+#define WL_MODE_G_LRS 5
+#define WL_MODE_B_ONLY 0
+#else //swda add,05/03/2005
+#define WL_MODE_G_AUTO 0
+#define WL_MODE_G_PERFORMANCE 1
+#define WL_MODE_G_LRS 2
+#define WL_MODE_G_GONLY 3
+#define WL_MODE_B_ONLY 4
+#endif
#define WL_AUTO "auto"
#define WL_OFF "off"
#define BAND_A 1
#define BAND_B 2
+#define WL_CHANSPEC_2G 2
+#define WL_CHANSPEC_5G 5
+
#define WIRELESS_APPID "WirelessCfg"
#define WL_VARS_ID 1
-#define WL_FLT_MAC_NUM_ID 2
-#define WL_FLT_MAC_TBL_ID 3
-#define WL_WDS_MAC_NUM_ID 4
-#define WL_WDS_MAC_TBL_ID 5
-#define WL_SCAN_WDS_MAC_NUM_ID 6
-#define WL_SCAN_WDS_MAC_TBL_ID 7
-#define WL_RADIUS_USER_NUM_ID 8
-#define WL_RADIUS_USER_TBL_ID 9
-//#define WL_SCAN_WDS_NUM_ID 6
-//#define WL_SCAN_WDS_TBL_ID 7
-
-
-#define WL_SCAN_WDS_MAX 10
+#define WL_MSSID_VARS_NUM_ID 2
+#define WL_MSSID_VARS_TBL_ID 3
+#define WL_FLT_MAC_NUM_ID 4
+#define WL_FLT_MAC_TBL_ID 5
+#define WL_WDS_MAC_NUM_ID 6
+#define WL_WDS_MAC_TBL_ID 7
+#define WL_SCAN_WDS_MAC_NUM_ID 8
+#define WL_SCAN_WDS_MAC_TBL_ID 9
+
+#define RESET_WLAN "/var/reset.wlan"
+#define RELOAD_VARS_WLAN "/var/reloadvars.wlan"
+
+#define MAIN_BSS_IDX 0
+
+#define MAP_FROM_NVRAM 0
+#define MAP_TO_NVRAM 1
+#define WL_SES_ENTRY 99
+#define MAX_NVPARSE 100
+#define SES_WDS_MODE_DISABLED 0 /* disabled */
+#define SES_WDS_MODE_AUTO 1 /* dynamic cf/cl selection */
+#define SES_WDS_MODE_ENABLED_ALWAYS 2 /* enabled always */
+#define SES_WDS_MODE_ENABLED_EXCL 3 /* WDS-only i.e no regular STAs */
+#define SES_WDS_MODE_CLIENT 4 /* always wds client mode */
+#define REG_MODE_OFF 0 /* disabled 11h/d mode */
+#define REG_MODE_H 1 /* use 11h mode */
+#define REG_MODE_D 2 /* use 11d mode */
+
+#define WL_OPMODE_AP "ap"
+#define WL_OPMODE_WDS "wds"
+#define WL_PREAMBLE_LONG "long"
+#define WL_PREAMBLE_SHORT "short"
+
+// TR69 overrides
+#define WL_TR69_BEACONTYPE_NONE 0
+#define WL_TR69_BEACONTYPE_BASIC 1
+#define WL_TR69_BEACONTYPE_WPA 2
+#define WL_TR69_BEACONTYPE_11I 3
+#define WL_TR69_BEACONTYPE_BASIC_AND_WPA 4
+#define WL_TR69_BEACONTYPE_BASIC_AND_11I 5
+#define WL_TR69_BEACONTYPE_WPA_AND_11I 6
+#define WL_TR69_BEACONTYPE_BASIC_AND_WPA_AND_11I 7
+
+#define WL_TR69_BASIC_ENCRYPTIONMODE_NONE 0
+#define WL_TR69_BASIC_ENCRYPTIONMODE_WEP 1
+
+#define WL_TR69_BASIC_AUTHENTICATION_NONE 0
+#define WL_TR69_BASIC_AUTHENTICATION_EAP 1
+
+#define WL_TR69_WPA_ENCRYPTION_MODES_WEP 0
+#define WL_TR69_WPA_ENCRYPTION_MODES_TKIP 1
+#define WL_TR69_WPA_ENCRYPTION_MODES_WEP_AND_TKIP 2
+#define WL_TR69_WPA_ENCRYPTION_MODES_AES 3
+#define WL_TR69_WPA_ENCRYPTION_MODES_WEP_AND_AES 4
+#define WL_TR69_WPA_ENCRYPTION_MODES_TKIP_AND_AES 5
+#define WL_TR69_WPA_ENCRYPTION_MODES_WEP_AND_TKIP_AES 6
+
+#define WL_TR69_WPA_AUTHENTICATION_MODE_PSK 0
+#define WL_TR69_WPA_AUTHENTICATION_MODE_EAP 1
+
+#define WL_TR69_IEEE11I_ENCRYPTION_MODES_WEP 0
+#define WL_TR69_IEEE11I_ENCRYPTION_MODES_TKIP 1
+#define WL_TR69_IEEE11I_ENCRYPTION_MODES_WEP_AND_TKIP 2
+#define WL_TR69_IEEE11I_ENCRYPTION_MODES_AES 3
+#define WL_TR69_IEEE11I_ENCRYPTION_MODES_WEP_AND_AES 4
+#define WL_TR69_IEEE11I_ENCRYPTION_MODES_TKIP_AND_AES 5
+#define WL_TR69_IEEE11I_ENCRYPTION_MODES_WEP_AND_TKIP_AES 6
+
+#define WL_TR69_IEEE11I_AUTHENTICATION_MODE_PSK 0
+#define WL_TR69_IEEE11I_AUTHENTICATION_MODE_EAP 1
+
+/* mimo */
+#define WL_CTL_SB_LOWER -1
+#define WL_CTL_SB_NONE 0
+#define WL_CTL_SB_UPPER 1
+/* defines used by the nrate iovar */
+#define NRATE_STF_MASK 0x0000ff00 /* stf mode mask: siso, cdd, stbc, sdm */
+#define NRATE_STF_SHIFT 8 /* stf mode shift */
+#define NRATE_MCS_INUSE 0x00000080 /* MSC in use,indicates b0-6 holds an mcs */
+#define NRATE_RATE_MASK 0x0000007f /* rate/mcs value */
+/* notify the average dma xfer rate (in kbps) to the driver */
+#define AVG_DMA_XFER_RATE 100000
+
+/* A chanspec holds the channel number, band, bandwidth and control sideband */
+typedef int chanspec_t;
+#define WL_CHANSPEC_CHAN_MASK 0x00ff
+
+#define WL_CHANSPEC_CTL_SB_MASK 0x0300
+#define WL_CHANSPEC_CTL_SB_SHIFT 8
+#define WL_CHANSPEC_CTL_SB_LOWER 0x0100
+#define WL_CHANSPEC_CTL_SB_UPPER 0x0200
+#define WL_CHANSPEC_CTL_SB_NONE 0x0300
+
+#define WL_CHANSPEC_BW_MASK 0x0C00
+#define WL_CHANSPEC_BW_SHIFT 10
+#define WL_CHANSPEC_BW_10 0x0400
+#define WL_CHANSPEC_BW_20 0x0800
+#define WL_CHANSPEC_BW_40 0x0C00
+
+#define WL_CHANSPEC_BAND_MASK 0xf000
+#define WL_CHANSPEC_BAND_SHIFT 12
+#define WL_CHANSPEC_BAND_5G 0x1000
+#define WL_CHANSPEC_BAND_2G 0x2000
+#define INVCHANSPEC 255
+
+//swda add,06/06/2006
+#define WL_KEY_ASCII 0
+#define WL_KEY_HEX 1
+//swda add end
/********************** Global Structs ****************************************/
typedef enum {
WL_SETUP_SECURITY,
WL_SETUP_MAC_FILTER,
WL_SETUP_WDS,
- WL_SETUP_ADVANCED
+ WL_SETUP_ADVANCED,
+ WL_SETUP_SES /*SUPPORT_SES*/
} WL_SETUP_TYPE;
typedef struct {
- char wlSsid[WL_SSID_SIZE_MAX];
- char wlCountry[WL_SM_SIZE_MAX];
- char wlKeys128[WL_KEY_NUM][WL_MID_SIZE_MAX];
- char wlKeys64[WL_KEY_NUM][WL_SM_SIZE_MAX];
- char wlPreambleType[WL_SM_SIZE_MAX];
- char wlWpaPsk[WL_WPA_PSK_SIZE_MAX];
- char mix_wlWpaPsk[WL_WPA_PSK_SIZE_MAX];
- char wlRadiusKey[WL_RADIUS_KEY_SIZE_MAX];
- char wlWep[WL_SM_SIZE_MAX];
- char wlWpa[WL_SM_SIZE_MAX];
- char wlWds[WL_WDS_NUM][WL_MID_SIZE_MAX];
+ int wlSsidIdx;
char wlMode[WL_SM_SIZE_MAX];
+ char wlCountry[WL_SM_SIZE_MAX];
char wlFltMacMode[WL_SM_SIZE_MAX];
char wlPhyType[WL_SIZE_2_MAX];
char wlBasicRate[WL_SIZE_8_MAX];
char wlProtection[WL_SIZE_8_MAX];
+ char wlPreambleType[WL_SM_SIZE_MAX];
char wlAfterBurnerEn[WL_SIZE_8_MAX];
char wlFrameBurst[WL_SIZE_4_MAX];
char wlWlanIfName[WL_SIZE_4_MAX];
- char wlAuthMode[WL_SIZE_8_MAX];
- struct in_addr wlRadiusServerIP;
+ char wlWds[WL_WDS_NUM][WL_MID_SIZE_MAX];
int wlCoreRev;
- int wlWpaGTKRekey;
- int wlRadiusPort;
- int wlAuth;
int wlHide;
int wlEnbl;
- int wlKeyMode ; // 0: ASCII ; 1: HEX
- int wlKeyIndex128;
- int wlKeyIndex64;
int wlChannel;
int wlFrgThrshld;
int wlRtsThrshld;
int wlDtmIntvl;
int wlBcnIntvl;
- int wlKeyBit;
long wlRate;
int wlgMode;
int wlLazyWds;
int wlMCastRate;
int ezc_version;
int ezc_enable;
- int is_default;
- int is_modified;
int wlInfra;
int wlAntDiv;
int wlWme;
int wlWmeNoAck;
+ int wlTxPwrPcnt;
+ int wlRegMode;
+ int wlDfsPreIsm;
+ int wlDfsPostIsm;
+ int wlTpcDb;
+ int wlCsScanTimer;
+ int wlMaxAssoc;
+#ifdef SUPPORT_SES
+ int wlSesEnable;
+ int wlSesEvent;
+ char wlSesStates[WL_SIZE_8_MAX];
+ char wlSesSsid[WL_SSID_SIZE_MAX];
+ char wlSesWpaPsk[WL_WPA_PSK_SIZE_MAX];
+ int wlSesHide;
+ int wlSesAuth;
+ char wlSesAuthMode[WL_SIZE_8_MAX];
+ char wlSesWep[WL_SM_SIZE_MAX];
+ char wlSesWpa[WL_SM_SIZE_MAX];
+ int wlSesWdsMode;
+ int wlSesClEnable;
+ int wlSesClEvent;
+ char wlWdsWsec[WL_SIZE_132_MAX];
+#endif
+#ifdef SUPPORT_MIMO
+ int wlNBw;
+ int wlNCtrlsb;
+ int wlNBand;
+ int wlNMcsidx;
+ char wlNProtection[WL_SIZE_8_MAX];
+ char wlRifs[WL_SIZE_8_MAX];
+ char wlAmpdu[WL_SIZE_8_MAX];
+ char wlAmsdu[WL_SIZE_8_MAX];
+ char wlNmode[WL_SIZE_8_MAX];
+ int wlNReqd;
+#endif
+} WIRELESS_VAR, *PWIRELESS_VAR;
+
+typedef struct {
+ char wlSsid[WL_SSID_SIZE_MAX];
+ //swda add,05/03/2005
+ int wlHide;
+ int wlKeyType;// 0:ASCII 1:Hex
+ char wlKeys128_ascii[WL_KEY_NUM][15];//ASCII
+ char wlKeys64_ascii[WL_KEY_NUM][7];//ASCII
+ //swda add end
+ char wlKeys128[WL_KEY_NUM][WL_MID_SIZE_MAX];
+ char wlKeys64[WL_KEY_NUM][WL_SM_SIZE_MAX];
+ char wlWpaPsk[WL_WPA_PSK_SIZE_MAX];
+ char wlRadiusKey[WL_RADIUS_KEY_SIZE_MAX];
+ char wlWep[WL_SM_SIZE_MAX];
+ char wlWpa[WL_SM_SIZE_MAX];
+ struct in_addr wlRadiusServerIP;
+ char wlAuthMode[WL_SIZE_8_MAX];
+ int wlWpaGTKRekey;
+ int wlRadiusPort;
+ int wlAuth;
+ int wlEnblSsid;
+ int wlKeyIndex128;
+ int wlKeyIndex64;
+ int wlKeyBit;
+ int is_default;
+ int is_modified;
int wlPreauth;
int wlNetReauth;
+ int wlNasWillrun; /*runtime*/
+#ifdef SUPPORT_TR69C
+ int tr69cBeaconType;
+ int tr69cBasicEncryptionModes;
+ int tr69cBasicAuthenticationMode;
+ int tr69cWPAEncryptionModes;
+ int tr69cWPAAuthenticationMode;
+ int tr69cIEEE11iEncryptionModes;
+ int tr69cIEEE11iAuthenticationMode;
+#endif
+} WIRELESS_MSSID_VAR, *PWIRELESS_MSSID_VAR;
- int wlRepeaterEnbl ; // add by eric
- char mix_wlRadiusKey[WL_RADIUS_KEY_SIZE_MAX] ;
- struct in_addr mix_wlRadiusServerIP ;
- int mix_wlRadiusPort;
- int wlEnblRadius ;
- int wlEnblInternal ;
- int wlIdleTimeout ;
- int wlAuthRenewIntvl ;
- int wlAuthBlockoutIntvl ;
- char wlNASId[WL_MID_SIZE_MAX] ;
- char mix_wlNASId[WL_MID_SIZE_MAX];
- int wlBasicSpeed;
- int wlTxPwr ;
-} WIRELESS_VAR, *PWIRELESS_VAR;
typedef struct {
char *varName;
} WIRELESS_ITEM, *PWIRELESS_ITEM;
typedef struct {
- char macAddress[16];
- char pcName[32] ;
- int isActive;
- int index ;
+ char macAddress[WL_MID_SIZE_MAX];
+ char ssid[WL_SSID_SIZE_MAX];
+ char aptxmode;//swda add,05/03/2005
+ int channel;//swda add,05/03/2005
} WL_FLT_MAC_ENTRY, *PWL_FLT_MAC_ENTRY;
typedef struct { // don't want store ssid
char authorized;
} WL_STATION_LIST_ENTRY, *PWL_STATION_LIST_ENTRY;
-/* add by eric */
+// PSI Data
typedef struct {
- char wdsMac[WL_MID_SIZE_MAX];
- char wdsSsid[WL_SSID_SIZE_MAX];
- char wdsType[WL_SM_SIZE_MAX];
- int wdsRssi ;
- int wdsChannel ;
- int wdsSelected;
-} WL_WDS_MAC_ENTRY, *PWL_WDS_MAC_ENTRY;
-/* add by eric end */
+ WIRELESS_VAR wlVar;
+ WIRELESS_MSSID_VAR wlMssidVar[WL_NUM_SSID];
+} WIRELESS_PSI_VARS;
#endif