📄 dot11lib.h
字号:
/* dot11Lib.h - Contains the main definitions for the 802.11 Framework. *//* * Copyright (c) 2004-2006 Wind River Systems, Inc. * * The right to copy, distribute, modify or otherwise make use * of this software may be licensed only pursuant to the terms * of an applicable Wind River license agreement. *//* Modification History--------------------04h,15mar06,rb Fix to SPR 118966 - ACL does not work with WPA/RSN04g,28Feb06,rb Merge of SPR branch04f,26jan06,rb Fix to SPR 117213 - WPAv2 should alllow AES04e,16jan06,rb Fix to SPR 116783 - Max AID is larger that largest value allowed by 802.11 specification04d,15dec05,rb Added per-station duplicate detection04c,13dec05,rb Fix to SPR 115265 - Variables reset on AP reset04b,27zeb06,rb Code inspection changes04a,17feb06,rb Code cleanup03z,16feb06,rb Added 802.1Q macro definitions03y,14feb06,rb Added 802.1Q ethertype03x,14feb06,rb Added VLAN support03w,09feb06,rb Implemented WIOCDOT1XINT03v,11nov05,rb Added mSSID feature03u,09sep05,rb Added countryCode as boot parameter03t,25aug05,rb Added 11d info to channel structure03t,30aug05,rb Removed EIOCSUNICASTKEYNUM and related03s,19aug05,rb Added Turbo support03r,19aug05,rb Increased timeout time for Windows stations03q,04aug04,rb Moved DOT11_CHANNEL_LIST to dot11UsrLib.h03p,04aug05,rb Increase default passive scan time to be greater than default beacon interval03o,03aug05,rb Implemented user authentication callback03n,28jul05,rb Added hdd->calTime03m,28jul05,rb Added hdd->calTimer03l,25jul05,rb Removed pAp->pmCount03k,20jul05,rb Fix #warning03j,14jul05,rb Implemented KSL memory pool, moved lastSeq into pDot1103i,14jul05,rb Move pmState to SME_OBJ to alllow DOT11_MODE_NONE config03h,10jun05,rb Added RSN passphrase caching and 4way timer03g,18may05,rb Fix for bug B0367 - TSN does not work on Sta03f,28apr05,rb Added _BIT definition to dot11UsrLib.h; Moved encryption types to usrLib03e,25apr05,rb Moved definitions needed for IOCTLs from dot11Lib.h to dot11UsrLib.h03d,22apr05,rb Added authentication callback wrapper03c,15apr05,rb Corrected 4-way retry time to value specified by standard03b,14apr05,rb Added support fr Transmit Power Scaling (WIOCSTXPOWERSCALE)03a,06apr05,rb Fix for SPR 107235: data path does not handle non-ethernet packets correctly02z,09mar05,rb Change prototype of pDot11->sme->ksl.show02y,09mar05,rb Added hdd->hwVersionGet02x,08mar05,rb Added dtimPacketFlush() to HDD_OBJ02w,03mar05,rb Security code review changes02v,01mar05,rb Modified definition of WIOCSDOT1XPORTSTATUS and WIOCSAUTHCALLBACK02u,16feb05,rb Renumbered IOCTLs to work with RTP management02t,11feb05,rb Increased timeout02s,11feb05,rb Adjusted EAPOL-timeout02r,04feb05,rb Added B/G compatibility mode02q,02feb05,rb Resolved vxWorks 6.0 compatability issue (cioTimer.h)02p,26jan05,rb Implemented SKA02o,25jan05,rb Made security components optionally buildable02n,21jan05,rb Added hdd->countryCodeChange() and hdd->macAddrChange()02m,21jan05,rb Removed some dead IOCTLs02l,20jan05,rb Added new security stats, MIC ctrmsrs02k,17jan05,rb Revised DOT11_SCAN_REQ structure02j,06jan05,rb Added decrypt & MIC error counters, MIC countermeasures02i,05jan05,rb Fix for SPR 103854 - Need to update reference in TXD to use MBlks02h,04jan05,rb Added gtkRecalc member to RSN_OBJ02g,23dec04,rb Memory footprint reduction02f,21dec04,rb Added WPA2/802.11i support02e,01nov04,rb Added security policy parameters02d,27oct04,rb Added WEP Key Mapping Support02c,03oct04,rb Changes from dot11SmeApLib.c and dot11SmeIbssLib.c code review02b,26aug04,rb Fix for SPR 101351 : Supplicant does not work on LE architectures.02a,25aug04,rb Wind River Wireless Ethernet Driver 2.0 FCS*/#ifndef __INCdot11Libh#define __INCdot11Libh#ifdef __cplusplusextern "C" {#endif /* __cplusplus */#include <vxWorks.h>#include <end.h>#include <muxLib.h>#include <wdLib.h>#include <logLib.h>#include <taskLib.h>#include <msgQLib.h>#include "dot11UsrLib.h"/************************************************************************* USER MODIFIABLE PARAMETERS************************************************************************//* Memory initialization constants */#define DOT11_NUMCL 256#define DOT11_NUMCLBLK DOT11_NUMCL#define DOT11_NUMMBLK DOT11_NUMCL * 2/** DOT11_FOURWAY_MSG_TIMEOUT - specified the amount of time the RSN libraries* will wait for a response to an EAPOL-KEY message before assuming the * message is lost and retrying*/#define DOT11_FOURWAY_MSG_TIMEOUT (sysClkRateGet() / 2) /* 500 ms *//** DOT11_FOURWAY_GLOBAL_TIMEOUT - specified the amount of time the RSN libraries* will wait for the fourway handshake to complete before resetting the* connection.*/#define DOT11_FOURWAY_GLOBAL_TIMEOUT (sysClkRateGet() * 3 / 2) /* 1500 ms *//** DOT11_FOURWAY_8021X_TIMEOUT - specified the amount of time the RSN libraries* will wait for the 802.1X auth to finish and the fourway handshake to * commence before resetting the connection.*/#define DOT11_FOURWAY_8021X_TIMEOUT (sysClkRateGet() * 20) /* 20 sec *//** DOT11_FOURWAY_TIMEOUT_MAX - Maximum number of times that the RSN libraries* will resent an EAPOL-KEY message before assuming that there is an* error and giving up.*/#define DOT11_FOURWAY_TIMEOUT_MAX 5/** DOT11_FRAGMENT_TIMEOUT_TICKS - The maximum delay between fragments, in* ticks of the kernel clock. Since the kernel clock is really* coarse, pretty much any value is reasonable - fragments should not* be delayed by much time at all.*/#define DOT11_FRAGMENT_TIMEOUT_TICKS 10/** DOT11_KSL_POOL_SIZE - The number of entries in the KSL pool. This represents* an upper limit on the number of stations or APs that the device can* keep track of. This number should be increased for a device that* will be operated in an extremely busy environment */#define DOT11_KSL_POOL_SIZE 64/** DOT11_KSL_CLEANUP_TIME - The time between cleanups of the KSL. Every * DOT11_KSL_CLEANUP_TIME seconds, the KSL cleanup task runs, to check* for any stale/inactive KSL entries and return them to the free pool. */#define DOT11_KSL_CLEANUP_TIME (sysClkRateGet() * 60 * 2) /* 2 min *//** DOT11_KSL_MAX_AGE - This is the amount of time a station can be inactive for* before the KSL considers it to be "inactive". Entries with an * inactivity time older than this value are eligible for deletion next* time the KSL cleanup task runs.*/#define DOT11_KSL_MAX_AGE (sysClkRateGet() * 60 * 5) /* 5 min *//** DOT11_BSS_MAX - Maximum number of virtual wireless networks. This* controls the number of virtual networks that the * AP can use. It it currently set to 4, but may be* expanded if memory is available.*/#define DOT11_BSS_MAX 4/************************************************************************* CONSTANT PARAMETERS - Do not change anything below this point************************************************************************//* Forward declaration of DOT11_FW so the objects below can use it */typedef struct dot11Framework DOT11_FW;/* Include the slave header files */#include "drv/wlan/dot11SmeIbssLib.h"#include "drv/wlan/dot11SmeEssLib.h"#include "drv/wlan/dot11SmeApLib.h"#include "drv/wlan/dot11Bsp.h"typedef unsigned long long int DOT11_UINT64;/* This is a really handy macro that we're going to need. We'll define it ifit's not already defined */#ifndef _BIT#define _BIT(x) (1<<(x))#endif#define DOT11_MAC_ADDR_STR "%02x:%02x:%02x:%02x:%02x:%02x"#define DOT11_MAC_ADDR(x) (x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5]#define DOT11_IS_MCAST(x) (((x)[0] & 0x01) == 0x01)/* The Universal / Local bit, located in byte zero of the mac address */#define DOT11_MAC_LOCAL 0x02/* These macros convert between native byte oder and the oder used by the PCI bus, Little Endian */#if (_BYTE_ORDER == _BIG_ENDIAN) #define DOT11_LE_TO_CPU_16(x) (((x) >> 8) | (((x) & 0xff) << 8))#define DOT11_CPU_TO_LE_16(x) (((x) >> 8) | (((x) & 0xff) << 8))#define DOT11_LE_TO_CPU_32(x) LONGSWAP(x)#define DOT11_CPU_TO_LE_32(x) LONGSWAP(x)#define DOT11_BCOPY_LE_TO_CPU(src, dst, len) dot11BcopySwap(src,dst,len)#else#define DOT11_LE_TO_CPU_16(x) (x)#define DOT11_CPU_TO_LE_16(x) (x)#define DOT11_LE_TO_CPU_32(x) (x)#define DOT11_CPU_TO_LE_32(x) (x)#define DOT11_BCOPY_LE_TO_CPU(src, dst, len) bcopy(src,dst,len)#endif#define DOT11_ADDR_COPY(src,dst ) { \ *((UINT16 *)(dst)) = *((UINT16 *)(src)); \ *((UINT16 *)(dst) + 1) = *((UINT16 *)(src) + 1); \ *((UINT16 *)(dst) + 2) = *((UINT16 *)(src) + 2); }/**************************************************************************Debugging macros that control the debug levels**************************************************************************//* *** undefine this to get rid of all debugging in the driver. This mightbe desirable for production builds */#define DOT11_DEBUG_GLOBAL#ifdef DOT11_DEBUG_GLOBAL/* Debug level definitions */#define DOT11_DEBUG_ALL 0 /* Always log message */#define DOT11_DEBUG_FATAL 1 /* Non-recoverable error */#define DOT11_DEBUG_ERROR 2 /* Recoverable error */#define DOT11_DEBUG_INFO 3 /* Information message */#define DOT11_DEBUG_FLOOD 4 /* Packet traces, info in a loop */#define DOT11_DEBUG_NONE 99 /* Do not print any debug info *//* Debug area definitions */#define DOT11_AREA_ALL 0 /* Don't use for macro */#define DOT11_AREA_INIT 1#define DOT11_AREA_SME 2#define DOT11_AREA_DPE 3#define DOT11_AREA_HDD 4#define DOT11_AREA_INT 5#define DOT11_AREA_RSN 6#define DOT11_MAX_DEBUG_AREAS 7IMPORT INT32 dot11DebugArray[DOT11_MAX_DEBUG_AREAS]; #define DOT11_LOG(level, area, message) \ if ((level) <= dot11DebugArray[(area)]) logMsg message/* DOT11_LOG_FLUSH is used after passing a string parameter to cause logLibto execute immediately. This should not be used on the critical path */#define DOT11_LOG_FLUSH taskDelay(0)/* DOT11_ASSERT() is no longer supported, but it is necessary to keep it infor a while for backwards compatability */#define DOT11_ASSERT(x) #else /* ! DOT11_DEBUG_GLOBAL */#define DOT11_LOG(level, area, message)#define DOT11_LOG_FLUSH#define DOT11_ASSERT(x)#endif /* DOT11_DEBUG_GLOBAL *//* Channel flags */#define DOT11_RADIO_UNKNOWN -1/* These modes are not currently implemented */#define DOT11_RADIO_MAX 0x20/* The total number of the above modes that we support. It is used in ar52SuppRateGet() */#define DOT11_RADIO_SUPP_MODES 3#define DOT11_CHANNEL_INVALID 0IMPORT const char * dot11ModeStr[];IMPORT const char * dot11ModeNames[];IMPORT char * dot11BcastMAC;IMPORT char * dot11NullMAC;IMPORT const char * dot11EncryptNames[];IMPORT const char * dot114wayStateNames[];IMPORT const char * dot11SecPolNames[];IMPORT const char * dot11AuthPolNames[];IMPORT const char * dot11AuthTypeStr[];/* Values for hdd.pmState */ #define DOT11_PMMODE_ACTIVE 1#define DOT11_PMMODE_POWERSAVE 2#define DOT11_SNAP_HEADER_LEN 8typedef struct { UINT16 snap; UINT16 control; /* first byte contain actual control field */ UINT16 orgCode; UINT16 protocol;} _WRS_PACK_ALIGN(1) DOT11_LLC_HEADER;#define DOT11_LLC_RFC1024 0x00F8#define DOT11_LLC_8021H 0x0000#define DOT11_ETHER_HEADER_LEN 14#define DOT11_FCS_SIZE 4 /* Size of Frame Checksum field */#define DOT11_MTU 2304#define DOT11_MAX_PACKET 2346#define DOT11_ETHERMTU 1500#define DOT11_MAXRATE 54#define DOT11_8021Q_TAG_LEN 4/* Fix for SPR 101351 - preswap DOT1X_ETHERTYPE, then swap it back for BE archs */#define DOT1X_ETHERTYPE DOT11_CPU_TO_LE_16(0x8e88)#define DOT11_ETHERTYPE_8021Q 0x8100/* VLAN macros */#define DOT11_NO_VLAN 0#define DOT11_VLANID_MAX 4095 /* maximum VLAN as per 802.1Q *//* Masks out the vlanId from the rest of the 802.1Q tag */#define DOT11_8021Q_VLAN_MASK 0xfff/* Callback called due to association*/#define DOT1X_CALLBACK_ASSOC (1) /* Callback called due to disassociation*/#define DOT1X_CALLBACK_DISASSOC (2)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -