Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#ifndef __WINBOND_LOCALPARA_H
2#define __WINBOND_LOCALPARA_H
3
4/*
5 * =============================================================
6 * LocalPara.h -
7 * =============================================================
8 */
9
10#include "mac_structures.h"
11
12/* Define the local ability */
13
14#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
23
24#define LOCAL_DEFAULT_24_CHANNEL_NUM 13 /* channel 1..13 */
25#define LOCAL_DEFAULT_5_CHANNEL_NUM 8 /* channel 36..64 */
26
27#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 */
35
36#define psLOCAL (&(adapter->sLocalPara))
37
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
43#define MODE_AUTO 255
44
45#define BAND_TYPE_DSSS 0
46#define BAND_TYPE_OFDM_24 1
47#define BAND_TYPE_OFDM_5 2
48
49/* refer Bitmap2RateValue table */
50
51/* 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,
62 * 24, 36, 48, 54
63 */
64#define LOCAL_11A_BASIC_RATE_BITMAP 0x01001040 /* 6, 12, 24 */
65#define LOCAL_11A_OPERATION_RATE_BITMAP 0x120c0200 /* 9, 18, 36,
66 * 48, 54
67 */
68
69
70#define PWR_ACTIVE 0
71#define PWR_SAVE 1
72#define PWR_TX_IDLE_CYCLE 6
73
74/* bPreambleMode and bSlotTimeMode */
75#define AUTO_MODE 0
76#define LONG_MODE 1
77
78/* Region definition */
79#define REGION_AUTO 0xff
80#define REGION_UNKNOWN 0
81#define REGION_EUROPE 1 /* ETSI */
82#define REGION_JAPAN 2 /* MKK */
83#define REGION_USA 3 /* FCC */
84#define REGION_FRANCE 4 /* FRANCE */
85#define REGION_SPAIN 5 /* SPAIN */
86#define REGION_ISRAEL 6 /* ISRAEL */
87
88#define MAX_BSS_DESCRIPT_ELEMENT 32
89#define MAX_PMKID_CandidateList 16
90
91/*
92 * High byte : Event number, low byte : reason
93 * Event definition
94 * -- SME/MLME event
95 */
96#define EVENT_RCV_DEAUTH 0x0100
97#define EVENT_JOIN_FAIL 0x0200
98#define EVENT_AUTH_FAIL 0x0300
99#define EVENT_ASSOC_FAIL 0x0400
100#define EVENT_LOST_SIGNAL 0x0500
101#define EVENT_BSS_DESCRIPT_LACK 0x0600
102#define EVENT_COUNTERMEASURE 0x0700
103#define EVENT_JOIN_FILTER 0x0800
104/* -- TX/RX event */
105#define EVENT_RX_BUFF_UNAVAILABLE 0x4100
106
107#define EVENT_CONNECT 0x8100
108#define EVENT_DISCONNECT 0x8200
109#define EVENT_SCAN_REQ 0x8300
110
111/* Reason of Event */
112#define EVENT_REASON_FILTER_BASIC_RATE 0x0001
113#define EVENT_REASON_FILTER_PRIVACY 0x0002
114#define EVENT_REASON_FILTER_AUTH_MODE 0x0003
115#define EVENT_REASON_TIMEOUT 0x00ff
116
117/* Due to[E id][Length][OUI][Data] may be 257 bytes */
118#define MAX_IE_APPEND_SIZE (256 + 4)
119
120struct chan_info {
121 u8 band;
122 u8 ChanNo;
123};
124
125struct radio_off {
126 u8 boHwRadioOff;
127 u8 boSwRadioOff;
128};
129
130struct wb_local_para {
131 /* read from EPROM, manufacture set for each NetCard */
132 u8 PermanentAddress[MAC_ADDR_LENGTH + 2];
133 /* the driver will use this one actually. */
134 u8 ThisMacAddress[MAC_ADDR_LENGTH + 2];
135 u32 MTUsize; /* Ind to Uplayer, Max transmission unit size */
136 u8 region_INF; /* region setting from INF */
137 u8 region; /* real region setting of the device */
138 u8 Reserved_1[2];
139
140 /* power-save variables */
141 u8 iPowerSaveMode; /* 0 indicates on, 1 indicates off */
142 u8 ATIMmode;
143 u8 ExcludeUnencrypted;
144 /* Unit time count for the decision to enter PS mode */
145 u16 CheckCountForPS;
146 u8 boHasTxActivity;/* tx activity has occurred */
147 u8 boMacPsValid; /* Power save mode obtained
148 * from H/W is valid or not
149 */
150
151 /* Rate */
152 u8 TxRateMode; /*
153 * Initial, input from Registry,
154 * may be updated by GUI
155 * Tx Rate Mode: auto(DTO on), max, 1M, 2M, ..
156 */
157 u8 CurrentTxRate; /* The current Tx rate */
158 u8 CurrentTxRateForMng; /*
159 * The current Tx rate for management
160 * frames. It will be decided before
161 * connection succeeds.
162 */
163 u8 CurrentTxFallbackRate;
164
165 /* for Rate handler */
166 u8 BRateSet[32]; /* basic rate set */
167 u8 SRateSet[32]; /* support rate set */
168
169 u8 NumOfBRate;
170 u8 NumOfSRate;
171 u8 NumOfDsssRateInSRate; /* number of DSSS rates in
172 * supported rate set
173 */
174 u8 reserved1;
175
176 u32 dwBasicRateBitmap; /* bit map of basic rates */
177
178 u32 dwSupportRateBitmap; /* bit map of all support rates
179 * including basic and operational
180 * rates
181 */
182
183
184 /* For SME/MLME handler */
185
186 u16 wOldSTAindex; /* valid when boHandover=TRUE,
187 * store old connected STA index
188 */
189 u16 wConnectedSTAindex; /* Index of peerly connected AP or
190 * IBSS in the descriptionset.
191 */
192 u16 Association_ID; /* The Association ID in the
193 * (Re)Association Response frame.
194 */
195 u16 ListenInterval; /* The listen interval when SME invoking
196 * MLME_ (Re)Associate_Request().
197 */
198
199 struct radio_off RadioOffStatus;
200 u8 Reserved0[2];
201 u8 boMsRadioOff; /* Ndis demands to be true when set
202 * Disassoc. OID and be false when
203 * set SSID OID.
204 */
205 u8 bAntennaNo; /* which antenna */
206 u8 bConnectFlag; /* the connect status flag for
207 * roaming task
208 */
209
210 u8 RoamStatus;
211 u8 reserved7[3];
212
213 struct chan_info CurrentChan; /* Current channel no. and channel band.
214 * It may be changed by scanning.
215 */
216 u8 boHandover; /* Roaming, Handover to other AP. */
217 u8 boCCAbusy;
218
219 u16 CWMax; /* It may not be the real value
220 * that H/W used
221 */
222 u8 CWMin; /* 255: set according to 802.11 spec. */
223 u8 reserved2;
224
225 /* 11G: */
226 u8 bMacOperationMode; /* operation in 802.11b or 802.11g */
227 u8 bSlotTimeMode; /* AUTO, s32 */
228 u8 bPreambleMode; /* AUTO, s32 */
229 u8 boNonERPpresent;
230
231 u8 boProtectMechanism; /* H/W will take the necessary action
232 * based on this variable
233 */
234 u8 boShortPreamble; /* Same here */
235 u8 boShortSlotTime; /* Same here */
236 u8 reserved_3;
237
238 u32 RSN_IE_Bitmap;
239 u32 RSN_OUI_Type;
240
241 /* For the BSSID */
242 u8 HwBssid[MAC_ADDR_LENGTH + 2];
243 u32 HwBssidValid;
244
245 /* For scan list */
246 u8 BssListCount; /* Total count of valid
247 * descriptor indexes
248 */
249 u8 boReceiveUncorrectInfo; /* important settings in beacon/probe
250 * resp. have been changed
251 */
252 u8 NoOfJoinerInIbss;
253 u8 reserved_4;
254
255 /* Store the valid descriptor indexes obtained from scannings */
256 u8 BssListIndex[(MAX_BSS_DESCRIPT_ELEMENT + 3) & ~0x03];
257 /*
258 * Save the BssDescriptor index in this IBSS.
259 * The index 0 is local descriptor (psLOCAL->wConnectedSTAindex).
260 * If CONNECTED : NoOfJoinerInIbss >= 2
261 * else : NoOfJoinerInIbss <= 1
262 */
263 u8 JoinerInIbss[(MAX_BSS_DESCRIPT_ELEMENT + 3) & ~0x03];
264
265 /* General Statistics, count at Rx_handler or
266 * Tx_callback interrupt handler
267 */
268 u64 GS_XMIT_OK; /* Good Frames Transmitted */
269 u64 GS_RCV_OK; /* Good Frames Received */
270 u32 GS_RCV_ERROR; /* Frames received with crc error */
271 u32 GS_XMIT_ERROR; /* Bad Frames Transmitted */
272 u32 GS_RCV_NO_BUFFER; /* Receive Buffer underrun */
273 u32 GS_XMIT_ONE_COLLISION; /* one collision */
274 u32 GS_XMIT_MORE_COLLISIONS;/* more collisions */
275
276 /*
277 * ================================================================
278 * Statistics (no matter whether it had done successfully) -wkchen
279 * ================================================================
280 */
281 u32 _NumRxMSDU;
282 u32 _NumTxMSDU;
283 u32 _dot11WEPExcludedCount;
284 u32 _dot11WEPUndecryptableCount;
285 u32 _dot11FrameDuplicateCount;
286
287 struct chan_info IbssChanSetting; /* 2B. Start IBSS Channel
288 * setting by registry or
289 * WWU.
290 */
291 u8 reserved_5[2]; /* It may not be used after
292 * considering RF type, region
293 * and modulation type.
294 */
295
296 u8 reserved_6[2]; /* two variables are for wep
297 * key error detection
298 */
299 u32 bWepKeyError;
300 u32 bToSelfPacketReceived;
301 u32 WepKeyDetectTimerCount;
302
303 u16 SignalLostTh;
304 u16 SignalRoamTh;
305
306 u8 IE_Append_data[MAX_IE_APPEND_SIZE];
307 u16 IE_Append_size;
308 u16 reserved_7;
309};
310
311#endif