blob: 84effc47d79d168e890c613bf2b179614c314ee6 [file] [log] [blame]
Pekka Enberg80aba532008-10-30 13:04:29 +02001#ifndef __WINBOND_LOCALPARA_H
2#define __WINBOND_LOCALPARA_H
3
Lars Lindley9bf10922010-05-08 14:53:54 +02004/*
5 * =============================================================
6 * LocalPara.h -
7 * =============================================================
8 */
Pekka Enberg80aba532008-10-30 13:04:29 +02009
10#include "mac_structures.h"
11
Lars Lindley9bf10922010-05-08 14:53:54 +020012/* Define the local ability */
Pavel Machek66101de2008-10-01 14:36:56 +020013
Lars Lindley9bf10922010-05-08 14:53:54 +020014#define LOCAL_DEFAULT_BEACON_PERIOD 100 /* ms */
15#define LOCAL_DEFAULT_ATIM_WINDOW 0
16#define LOCAL_DEFAULT_ERP_CAPABILITY 0x0431 /*
17 * 0x0001: ESS
18 * 0x0010: Privacy
19 * 0x0020: short preamble
20 * 0x0400: short slot time
21 */
22#define LOCAL_DEFAULT_LISTEN_INTERVAL 5
Pavel Machek66101de2008-10-01 14:36:56 +020023
Lars Lindley9bf10922010-05-08 14:53:54 +020024#define LOCAL_DEFAULT_24_CHANNEL_NUM 13 /* channel 1..13 */
25#define LOCAL_DEFAULT_5_CHANNEL_NUM 8 /* channel 36..64 */
Pavel Machek66101de2008-10-01 14:36:56 +020026
Lars Lindley9bf10922010-05-08 14:53:54 +020027#define LOCAL_USA_24_CHANNEL_NUM 11
28#define LOCAL_USA_5_CHANNEL_NUM 12
29#define LOCAL_EUROPE_24_CHANNEL_NUM 13
30#define LOCAL_EUROPE_5_CHANNEL_NUM 19
31#define LOCAL_JAPAN_24_CHANNEL_NUM 14
32#define LOCAL_JAPAN_5_CHANNEL_NUM 11
33#define LOCAL_UNKNOWN_24_CHANNEL_NUM 14
34#define LOCAL_UNKNOWN_5_CHANNEL_NUM 34 /* not include 165 */
Pavel Machek66101de2008-10-01 14:36:56 +020035
Lars Lindley9bf10922010-05-08 14:53:54 +020036#define psLOCAL (&(adapter->sLocalPara))
Pavel Machek66101de2008-10-01 14:36:56 +020037
38#define MODE_802_11_BG 0
39#define MODE_802_11_A 1
40#define MODE_802_11_ABG 2
41#define MODE_802_11_BG_IBSS 3
42#define MODE_802_11_B 4
Lars Lindley9bf10922010-05-08 14:53:54 +020043#define MODE_AUTO 255
Pavel Machek66101de2008-10-01 14:36:56 +020044
45#define BAND_TYPE_DSSS 0
46#define BAND_TYPE_OFDM_24 1
47#define BAND_TYPE_OFDM_5 2
48
Lars Lindley9bf10922010-05-08 14:53:54 +020049/* refer Bitmap2RateValue table */
Pavel Machek66101de2008-10-01 14:36:56 +020050
Lars Lindley9bf10922010-05-08 14:53:54 +020051/* the bitmap value of all the H/W supported rates: */
52/* 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 */
53#define LOCAL_ALL_SUPPORTED_RATES_BITMAP 0x130c1a66
54/* the bitmap value of all the H/W supported rates except to non-OFDM rates: */
55/* 6, 9, 12, 18, 24, 36, 48, 54 */
56#define LOCAL_OFDM_SUPPORTED_RATES_BITMAP 0x130c1240
57#define LOCAL_11B_SUPPORTED_RATE_BITMAP 0x826
58#define LOCAL_11B_BASIC_RATE_BITMAP 0x826
59#define LOCAL_11B_OPERATION_RATE_BITMAP 0x826
60#define LOCAL_11G_BASIC_RATE_BITMAP 0x826 /* 1, 2, 5.5, 11 */
61#define LOCAL_11G_OPERATION_RATE_BITMAP 0x130c1240 /* 6, 9, 12, 18, 24, 36, 48, 54 */
62#define LOCAL_11A_BASIC_RATE_BITMAP 0x01001040 /* 6, 12, 24 */
63#define LOCAL_11A_OPERATION_RATE_BITMAP 0x120c0200 /* 9, 18, 36, 48, 54 */
Pavel Machek66101de2008-10-01 14:36:56 +020064
65
Lars Lindley9bf10922010-05-08 14:53:54 +020066#define PWR_ACTIVE 0
67#define PWR_SAVE 1
Pavel Machek66101de2008-10-01 14:36:56 +020068#define PWR_TX_IDLE_CYCLE 6
69
Lars Lindley9bf10922010-05-08 14:53:54 +020070/* bPreambleMode and bSlotTimeMode */
71#define AUTO_MODE 0
72#define LONG_MODE 1
Pavel Machek66101de2008-10-01 14:36:56 +020073
Lars Lindley9bf10922010-05-08 14:53:54 +020074/* Region definition */
75#define REGION_AUTO 0xff
76#define REGION_UNKNOWN 0
77#define REGION_EUROPE 1 /* ETSI */
78#define REGION_JAPAN 2 /* MKK */
79#define REGION_USA 3 /* FCC */
80#define REGION_FRANCE 4 /* FRANCE */
81#define REGION_SPAIN 5 /* SPAIN */
82#define REGION_ISRAEL 6 /* ISRAEL */
Pavel Machek66101de2008-10-01 14:36:56 +020083
84#define MAX_BSS_DESCRIPT_ELEMENT 32
Lars Lindley9bf10922010-05-08 14:53:54 +020085#define MAX_PMKID_CandidateList 16
Pavel Machek66101de2008-10-01 14:36:56 +020086
Lars Lindley9bf10922010-05-08 14:53:54 +020087/*
88 * High byte : Event number, low byte : reason
89 * Event definition
90 * -- SME/MLME event
91 */
92#define EVENT_RCV_DEAUTH 0x0100
93#define EVENT_JOIN_FAIL 0x0200
94#define EVENT_AUTH_FAIL 0x0300
95#define EVENT_ASSOC_FAIL 0x0400
96#define EVENT_LOST_SIGNAL 0x0500
97#define EVENT_BSS_DESCRIPT_LACK 0x0600
98#define EVENT_COUNTERMEASURE 0x0700
99#define EVENT_JOIN_FILTER 0x0800
100/* -- TX/RX event */
101#define EVENT_RX_BUFF_UNAVAILABLE 0x4100
Pavel Machek66101de2008-10-01 14:36:56 +0200102
Lars Lindley9bf10922010-05-08 14:53:54 +0200103#define EVENT_CONNECT 0x8100
104#define EVENT_DISCONNECT 0x8200
105#define EVENT_SCAN_REQ 0x8300
Pavel Machek66101de2008-10-01 14:36:56 +0200106
Lars Lindley9bf10922010-05-08 14:53:54 +0200107/* Reason of Event */
Pavel Machek66101de2008-10-01 14:36:56 +0200108#define EVENT_REASON_FILTER_BASIC_RATE 0x0001
Lars Lindley9bf10922010-05-08 14:53:54 +0200109#define EVENT_REASON_FILTER_PRIVACY 0x0002
Pavel Machek66101de2008-10-01 14:36:56 +0200110#define EVENT_REASON_FILTER_AUTH_MODE 0x0003
Lars Lindley9bf10922010-05-08 14:53:54 +0200111#define EVENT_REASON_TIMEOUT 0x00ff
Pavel Machek66101de2008-10-01 14:36:56 +0200112
Lars Lindley9bf10922010-05-08 14:53:54 +0200113/* Due to[E id][Length][OUI][Data] may be 257 bytes */
114#define MAX_IE_APPEND_SIZE (256 + 4)
Pavel Machek66101de2008-10-01 14:36:56 +0200115
Lars Lindley9bf10922010-05-08 14:53:54 +0200116struct chan_info {
117 u8 band;
118 u8 ChanNo;
Pekka Enberg440a2332009-12-18 23:08:18 +0200119};
Pavel Machek66101de2008-10-01 14:36:56 +0200120
Lars Lindley9bf10922010-05-08 14:53:54 +0200121struct radio_off {
122 u8 boHwRadioOff;
123 u8 boSwRadioOff;
Pekka Enberg92ce4702009-12-18 23:08:16 +0200124};
Pavel Machek66101de2008-10-01 14:36:56 +0200125
Lars Lindley9bf10922010-05-08 14:53:54 +0200126struct wb_local_para {
127 /* read from EPROM, manufacture set for each NetCard */
128 u8 PermanentAddress[MAC_ADDR_LENGTH + 2];
129 /* the driver will use this one actually. */
130 u8 ThisMacAddress[MAC_ADDR_LENGTH + 2];
131 u32 MTUsize; /* Ind to Uplayer, Max transmission unit size */
132 u8 region_INF; /* region setting from INF */
133 u8 region; /* real region setting of the device */
134 u8 Reserved_1[2];
Pavel Machek66101de2008-10-01 14:36:56 +0200135
Lars Lindley9bf10922010-05-08 14:53:54 +0200136 /* power-save variables */
137 u8 iPowerSaveMode; /* 0 indicates on, 1 indicates off */
138 u8 ATIMmode;
139 u8 ExcludeUnencrypted;
Justin P. Mattocka31f7f52012-09-03 08:06:02 -0700140 /* Unit time count for the decision to enter PS mode */
Lars Lindley9bf10922010-05-08 14:53:54 +0200141 u16 CheckCountForPS;
142 u8 boHasTxActivity;/* tx activity has occurred */
143 u8 boMacPsValid; /* Power save mode obtained from H/W is valid or not */
Pavel Machek66101de2008-10-01 14:36:56 +0200144
Lars Lindley9bf10922010-05-08 14:53:54 +0200145 /* Rate */
146 u8 TxRateMode; /*
147 * Initial, input from Registry,
148 * may be updated by GUI
149 * Tx Rate Mode: auto(DTO on), max, 1M, 2M, ..
150 */
151 u8 CurrentTxRate; /* The current Tx rate */
152 u8 CurrentTxRateForMng; /*
153 * The current Tx rate for management
154 * frames. It will be decided before
155 * connection succeeds.
156 */
157 u8 CurrentTxFallbackRate;
Pavel Machek66101de2008-10-01 14:36:56 +0200158
Lars Lindley9bf10922010-05-08 14:53:54 +0200159 /* for Rate handler */
160 u8 BRateSet[32]; /* basic rate set */
161 u8 SRateSet[32]; /* support rate set */
Pavel Machek66101de2008-10-01 14:36:56 +0200162
Lars Lindley9bf10922010-05-08 14:53:54 +0200163 u8 NumOfBRate;
164 u8 NumOfSRate;
165 u8 NumOfDsssRateInSRate; /* number of DSSS rates in supported rate set */
166 u8 reserved1;
Pavel Machek66101de2008-10-01 14:36:56 +0200167
Lars Lindley9bf10922010-05-08 14:53:54 +0200168 u32 dwBasicRateBitmap; /* bit map of basic rates */
Pavel Machek66101de2008-10-01 14:36:56 +0200169
Lars Lindley9bf10922010-05-08 14:53:54 +0200170 u32 dwSupportRateBitmap; /* bit map of all support rates including basic and operational rates */
Pavel Machek66101de2008-10-01 14:36:56 +0200171
Pavel Machek66101de2008-10-01 14:36:56 +0200172
Lars Lindley9bf10922010-05-08 14:53:54 +0200173 /* For SME/MLME handler */
Pavel Machek66101de2008-10-01 14:36:56 +0200174
Lars Lindley9bf10922010-05-08 14:53:54 +0200175 u16 wOldSTAindex; /* valid when boHandover=TRUE, store old connected STA index */
176 u16 wConnectedSTAindex; /* Index of peerly connected AP or IBSS in the descriptionset. */
177 u16 Association_ID; /* The Association ID in the (Re)Association Response frame. */
178 u16 ListenInterval; /* The listen interval when SME invoking MLME_ (Re)Associate_Request(). */
Pavel Machek66101de2008-10-01 14:36:56 +0200179
Lars Lindley9bf10922010-05-08 14:53:54 +0200180 struct radio_off RadioOffStatus;
181 u8 Reserved0[2];
182 u8 boMsRadioOff; /* Ndis demands to be true when set Disassoc. OID and be false when set SSID OID. */
183 u8 bAntennaNo; /* which antenna */
184 u8 bConnectFlag; /* the connect status flag for roaming task */
Pavel Machek66101de2008-10-01 14:36:56 +0200185
Lars Lindley9bf10922010-05-08 14:53:54 +0200186 u8 RoamStatus;
187 u8 reserved7[3];
Pavel Machek66101de2008-10-01 14:36:56 +0200188
Lars Lindley9bf10922010-05-08 14:53:54 +0200189 struct chan_info CurrentChan; /* Current channel no. and channel band. It may be changed by scanning. */
Justin P. Mattocka31f7f52012-09-03 08:06:02 -0700190 u8 boHandover; /* Roaming, Handover to other AP. */
Lars Lindley9bf10922010-05-08 14:53:54 +0200191 u8 boCCAbusy;
Pavel Machek66101de2008-10-01 14:36:56 +0200192
Lars Lindley9bf10922010-05-08 14:53:54 +0200193 u16 CWMax; /* It may not be the real value that H/W used */
194 u8 CWMin; /* 255: set according to 802.11 spec. */
195 u8 reserved2;
Pavel Machek66101de2008-10-01 14:36:56 +0200196
Lars Lindley9bf10922010-05-08 14:53:54 +0200197 /* 11G: */
198 u8 bMacOperationMode; /* operation in 802.11b or 802.11g */
199 u8 bSlotTimeMode; /* AUTO, s32 */
200 u8 bPreambleMode; /* AUTO, s32 */
201 u8 boNonERPpresent;
Pavel Machek66101de2008-10-01 14:36:56 +0200202
Lars Lindley9bf10922010-05-08 14:53:54 +0200203 u8 boProtectMechanism; /* H/W will take the necessary action based on this variable */
204 u8 boShortPreamble; /* Same here */
205 u8 boShortSlotTime; /* Same here */
206 u8 reserved_3;
Pavel Machek66101de2008-10-01 14:36:56 +0200207
Lars Lindley9bf10922010-05-08 14:53:54 +0200208 u32 RSN_IE_Bitmap;
209 u32 RSN_OUI_Type;
Pavel Machek66101de2008-10-01 14:36:56 +0200210
Lars Lindley9bf10922010-05-08 14:53:54 +0200211 /* For the BSSID */
212 u8 HwBssid[MAC_ADDR_LENGTH + 2];
213 u32 HwBssidValid;
Pavel Machek66101de2008-10-01 14:36:56 +0200214
Lars Lindley9bf10922010-05-08 14:53:54 +0200215 /* For scan list */
216 u8 BssListCount; /* Total count of valid descriptor indexes */
217 u8 boReceiveUncorrectInfo; /* important settings in beacon/probe resp. have been changed */
218 u8 NoOfJoinerInIbss;
219 u8 reserved_4;
Pavel Machek66101de2008-10-01 14:36:56 +0200220
Lars Lindley9bf10922010-05-08 14:53:54 +0200221 /* Store the valid descriptor indexes obtained from scannings */
222 u8 BssListIndex[(MAX_BSS_DESCRIPT_ELEMENT + 3) & ~0x03];
223 /*
224 * Save the BssDescriptor index in this IBSS.
225 * The index 0 is local descriptor (psLOCAL->wConnectedSTAindex).
226 * If CONNECTED : NoOfJoinerInIbss >= 2
227 * else : NoOfJoinerInIbss <= 1
228 */
229 u8 JoinerInIbss[(MAX_BSS_DESCRIPT_ELEMENT + 3) & ~0x03];
Pavel Machek66101de2008-10-01 14:36:56 +0200230
Lars Lindley9bf10922010-05-08 14:53:54 +0200231 /* General Statistics, count at Rx_handler or Tx_callback interrupt handler */
232 u64 GS_XMIT_OK; /* Good Frames Transmitted */
233 u64 GS_RCV_OK; /* Good Frames Received */
234 u32 GS_RCV_ERROR; /* Frames received with crc error */
235 u32 GS_XMIT_ERROR; /* Bad Frames Transmitted */
236 u32 GS_RCV_NO_BUFFER; /* Receive Buffer underrun */
237 u32 GS_XMIT_ONE_COLLISION; /* one collision */
238 u32 GS_XMIT_MORE_COLLISIONS;/* more collisions */
Pavel Machek66101de2008-10-01 14:36:56 +0200239
Lars Lindley9bf10922010-05-08 14:53:54 +0200240 /*
241 * ================================================================
242 * Statistics (no matter whether it had done successfully) -wkchen
243 * ================================================================
244 */
245 u32 _NumRxMSDU;
246 u32 _NumTxMSDU;
247 u32 _dot11WEPExcludedCount;
248 u32 _dot11WEPUndecryptableCount;
249 u32 _dot11FrameDuplicateCount;
Pavel Machek66101de2008-10-01 14:36:56 +0200250
Lars Lindley9bf10922010-05-08 14:53:54 +0200251 struct chan_info IbssChanSetting; /* 2B. Start IBSS Channel setting by registry or WWU. */
252 u8 reserved_5[2]; /* It may not be used after considering RF type, region and modulation type. */
Pavel Machek66101de2008-10-01 14:36:56 +0200253
Lars Lindley9bf10922010-05-08 14:53:54 +0200254 u8 reserved_6[2]; /* two variables are for wep key error detection */
255 u32 bWepKeyError;
256 u32 bToSelfPacketReceived;
257 u32 WepKeyDetectTimerCount;
Pavel Machek66101de2008-10-01 14:36:56 +0200258
Lars Lindley9bf10922010-05-08 14:53:54 +0200259 u16 SignalLostTh;
260 u16 SignalRoamTh;
Pavel Machek66101de2008-10-01 14:36:56 +0200261
Pavel Machek66101de2008-10-01 14:36:56 +0200262 u8 IE_Append_data[MAX_IE_APPEND_SIZE];
263 u16 IE_Append_size;
264 u16 reserved_7;
Pekka Enberg1bc5e652009-12-18 23:08:15 +0200265};
Pavel Machek66101de2008-10-01 14:36:56 +0200266
Pekka Enberg80aba532008-10-30 13:04:29 +0200267#endif