Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wmgr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  *
20  * File: wmgr.h
21  *
22  * Purpose:
23  *
24  * Author: lyndon chen
25  *
26  * Date: Jan 2, 2003
27  *
28  * Functions:
29  *
30  * Revision History:
31  *
32  */
33 
34 #ifndef __WMGR_H__
35 #define __WMGR_H__
36 
37 #include "ttype.h"
38 #include "80211mgr.h"
39 #include "80211hdr.h"
40 #include "wcmd.h"
41 #include "bssdb.h"
42 #include "wpa2.h"
43 #include "card.h"
44 
45 /*--------------------- Export Definitions -------------------------*/
46 
47 
48 
49 // Scan time
50 #define PROBE_DELAY 100 // (us)
51 #define SWITCH_CHANNEL_DELAY 200 // (us)
52 #define WLAN_SCAN_MINITIME 25 // (ms)
53 #define WLAN_SCAN_MAXTIME 100 // (ms)
54 #define TRIVIAL_SYNC_DIFFERENCE 0 // (us)
55 #define DEFAULT_IBSS_BI 100 // (ms)
56 
57 #define WCMD_ACTIVE_SCAN_TIME 20 //(ms)
58 #define WCMD_PASSIVE_SCAN_TIME 100 //(ms)
59 
60 
61 #define DEFAULT_MSDU_LIFETIME 512 // ms
62 #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us
63 
64 #define DEFAULT_MGN_LIFETIME 8 // ms
65 #define DEFAULT_MGN_LIFETIME_RES_64us 125 // 64us
66 
67 #define MAKE_BEACON_RESERVED 10 //(us)
68 
69 
70 #define TIM_MULTICAST_MASK 0x01
71 #define TIM_BITMAPOFFSET_MASK 0xFE
72 #define DEFAULT_DTIM_PERIOD 1
73 
74 #define AP_LONG_RETRY_LIMIT 4
75 
76 #define DEFAULT_IBSS_CHANNEL 6 //2.4G
77 
78 
79 /*--------------------- Export Classes ----------------------------*/
80 
81 /*--------------------- Export Variables --------------------------*/
82 
83 /*--------------------- Export Types ------------------------------*/
84 //mike define: make timer to expire after desired times
85 #define timer_expire(timer, next_tick) mod_timer(&timer, RUN_AT(next_tick))
86 
87 typedef void (*TimerFunction)(unsigned long);
88 
89 
90 //+++ NDIS related
91 
92 typedef unsigned char NDIS_802_11_MAC_ADDRESS[ETH_ALEN];
93 typedef struct _NDIS_802_11_AI_REQFI
94 {
95  unsigned short Capabilities;
96  unsigned short ListenInterval;
99 
100 typedef struct _NDIS_802_11_AI_RESFI
101 {
102  unsigned short Capabilities;
103  unsigned short StatusCode;
104  unsigned short AssociationId;
106 
108 {
109  unsigned long Length;
110  unsigned short AvailableRequestFixedIEs;
112  unsigned long RequestIELength;
113  unsigned long OffsetRequestIEs;
114  unsigned short AvailableResponseFixedIEs;
116  unsigned long ResponseIELength;
117  unsigned long OffsetResponseIEs;
119 
120 
121 
122 typedef struct tagSAssocInfo {
125  // store ReqIEs set by OID_802_11_ASSOCIATION_INFORMATION
126  unsigned long RequestIELength;
129 //---
130 
131 
132 
134 
143  WMAC_AUTH_MAX // Not a real mode, defined as upper bound
145 
146 
147 
148 // Pre-configured Mode (from XP)
149 
150 typedef enum tagWMAC_CONFIG_MODE {
155 
157 
158 
159 typedef enum tagWMAC_SCAN_TYPE {
160 
164 
166 
167 
168 typedef enum tagWMAC_SCAN_STATE {
169 
173 
175 
176 
177 
178 // Notes:
179 // Basic Service Set state explained as following:
180 // WMAC_STATE_IDLE : no BSS is selected (Adhoc or Infra)
181 // WMAC_STATE_STARTED : no BSS is selected, start own IBSS (Adhoc only)
182 // WMAC_STATE_JOINTED : BSS is selected and synchronized (Adhoc or Infra)
183 // WMAC_STATE_AUTHPENDING : Authentication pending (Infra)
184 // WMAC_STATE_AUTH : Authenticated (Infra)
185 // WMAC_STATE_ASSOCPENDING : Association pending (Infra)
186 // WMAC_STATE_ASSOC : Associated (Infra)
187 
188 typedef enum tagWMAC_BSS_STATE {
189 
197 
199 
200 // WMAC selected running mode
201 typedef enum tagWMAC_CURRENT_MODE {
202 
207 
209 
210 
211 typedef enum tagWMAC_POWER_MODE {
212 
216 
218 
219 
220 
221 // Tx Management Packet descriptor
222 typedef struct tagSTxMgmtPacket {
223 
225  unsigned int cbMPDULen;
226  unsigned int cbPayloadLen;
227 
229 
230 
231 // Rx Management Packet descriptor
232 typedef struct tagSRxMgmtPacket {
233 
236  unsigned int cbMPDULen;
237  unsigned int cbPayloadLen;
238  unsigned int uRSSI;
242 
244 
245 
246 
247 typedef struct tagSMgmtObject
248 {
249  void *pAdapter;
250  // MAC address
252 
253  // Configuration Mode
254  WMAC_CONFIG_MODE eConfigMode; // MAC pre-configed mode
255 
257 
258 
259  // Operation state variables
260  WMAC_CURRENT_MODE eCurrMode; // MAC current connection mode
261  WMAC_BSS_STATE eCurrState; // MAC current BSS state
262  WMAC_BSS_STATE eLastState; // MAC last BSS state
263 
267 
268 // BYTE abyNewSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN];
269 // BYTE abyNewExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN];
271 
272  // Current state vars
273  unsigned int uCurrChannel;
280  unsigned int uRSSITrigger;
285 
287  unsigned int uScanChannel;
288 
289  // Desire joinning BSS vars
292 
293 //restore BSS info for Ad-Hoc mode
295 
296  // Adhoc or AP configuration vars
299  unsigned int uIBSSChannel;
304 
305  unsigned int uAssocCount;
307 
308  // Scan state vars
311  unsigned int uScanStartCh;
312  unsigned int uScanEndCh;
314  unsigned int uScanBSSType;
315  // Desire scannig vars
318 
319  // Privacy
324 
325  // Received beacon state vars
330 
331  // Power saving state vars
340 
341  // management command related
342  unsigned int uCmdBusy;
343  unsigned int uCmdHostAPBusy;
344 
345  // management packet pool
348 
349 
350  // One second callback timer
352 
353  // Temporarily Rx Mgmt Packet Descriptor
355 
356  // link list of known bss's (scan results)
357  KnownBSS sBSSList[MAX_BSS_NUM];
358  /* link list of same bss's */
359  KnownBSS pSameBSS[6] ;
362 
363  // table list of known node
364  // sNodeDBList[0] is reserved for AP under Infra mode
365  // sNodeDBList[0] is reserved for Multicast under adhoc/AP mode
367 
368 
369 
370  // WPA2 PMKID Cache
373 
374  // rate fall back vars
375 
376 
377 
378  // associate info
380 
381 
382  // for 802.11h
387  unsigned int uLengthOfRepEIDs;
393 
394  struct sk_buff skb;
395 
397 
398 /*--------------------- Export Macros ------------------------------*/
399 
400 /*--------------------- Export Functions --------------------------*/
401 
402 void vMgrObjectInit(void *hDeviceContext);
403 
404 void vMgrAssocBeginSta(void *hDeviceContext,
405  PSMgmtObject pMgmt,
406  PCMD_STATUS pStatus);
407 
408 void vMgrReAssocBeginSta(void *hDeviceContext,
409  PSMgmtObject pMgmt,
410  PCMD_STATUS pStatus);
411 
412 void vMgrDisassocBeginSta(void *hDeviceContext,
413  PSMgmtObject pMgmt,
414  PBYTE abyDestAddress,
415  WORD wReason,
416  PCMD_STATUS pStatus);
417 
418 void vMgrAuthenBeginSta(void *hDeviceContext,
419  PSMgmtObject pMgmt,
420  PCMD_STATUS pStatus);
421 
422 void vMgrCreateOwnIBSS(void *hDeviceContext,
423  PCMD_STATUS pStatus);
424 
425 void vMgrJoinBSSBegin(void *hDeviceContext,
426  PCMD_STATUS pStatus);
427 
428 void vMgrRxManagePacket(void *hDeviceContext,
429  PSMgmtObject pMgmt,
430  PSRxMgmtPacket pRxPacket);
431 
432 /*
433 void
434 vMgrScanBegin(
435  void *hDeviceContext,
436  PCMD_STATUS pStatus
437  );
438 */
439 
440 void vMgrDeAuthenBeginSta(void *hDeviceContext,
441  PSMgmtObject pMgmt,
442  PBYTE abyDestAddress,
443  WORD wReason,
444  PCMD_STATUS pStatus);
445 
446 BOOL bMgrPrepareBeaconToSend(void *hDeviceContext,
447  PSMgmtObject pMgmt);
448 
449 BOOL bAdd_PMKID_Candidate(void *hDeviceContext,
450  PBYTE pbyBSSID,
451  PSRSNCapObject psRSNCapObj);
452 
453 void vFlush_PMKID_Candidate(void *hDeviceContext);
454 
455 #endif /* __WMGR_H__ */