Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 1 | //============================================================= |
| 2 | // LocalPara.h - |
| 3 | //============================================================= |
| 4 | //Define the local ability |
| 5 | |
| 6 | #define LOCAL_DEFAULT_BEACON_PERIOD 100 //ms |
| 7 | #define LOCAL_DEFAULT_ATIM_WINDOW 0 |
| 8 | #define LOCAL_DEFAULT_ERP_CAPABILITY 0x0431 //0x0001: ESS |
| 9 | //0x0010: Privacy |
| 10 | //0x0020: short preamble |
| 11 | //0x0400: short slot time |
| 12 | #define LOCAL_DEFAULT_LISTEN_INTERVAL 5 |
| 13 | |
| 14 | //#define LOCAL_DEFAULT_24_CHANNEL_NUM 11 // channel 1..11 |
| 15 | #define LOCAL_DEFAULT_24_CHANNEL_NUM 13 // channel 1..13 |
| 16 | #define LOCAL_DEFAULT_5_CHANNEL_NUM 8 // channel 36..64 |
| 17 | |
| 18 | #define LOCAL_USA_24_CHANNEL_NUM 11 |
| 19 | #define LOCAL_USA_5_CHANNEL_NUM 12 |
| 20 | #define LOCAL_EUROPE_24_CHANNEL_NUM 13 |
| 21 | #define LOCAL_EUROPE_5_CHANNEL_NUM 19 |
| 22 | #define LOCAL_JAPAN_24_CHANNEL_NUM 14 |
| 23 | #define LOCAL_JAPAN_5_CHANNEL_NUM 11 |
| 24 | #define LOCAL_UNKNOWN_24_CHANNEL_NUM 14 |
| 25 | #define LOCAL_UNKNOWN_5_CHANNEL_NUM 34 //not include 165 |
| 26 | |
| 27 | |
| 28 | #define psLOCAL (&(Adapter->sLocalPara)) |
| 29 | |
| 30 | #define MODE_802_11_BG 0 |
| 31 | #define MODE_802_11_A 1 |
| 32 | #define MODE_802_11_ABG 2 |
| 33 | #define MODE_802_11_BG_IBSS 3 |
| 34 | #define MODE_802_11_B 4 |
| 35 | #define MODE_AUTO 255 |
| 36 | |
| 37 | #define BAND_TYPE_DSSS 0 |
| 38 | #define BAND_TYPE_OFDM_24 1 |
| 39 | #define BAND_TYPE_OFDM_5 2 |
| 40 | |
| 41 | //refer Bitmap2RateValue table |
| 42 | #define LOCAL_ALL_SUPPORTED_RATES_BITMAP 0x130c1a66 //the bitmap value of all the H/W supported rates |
| 43 | //1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 |
| 44 | #define LOCAL_OFDM_SUPPORTED_RATES_BITMAP 0x130c1240 //the bitmap value of all the H/W supported rates |
| 45 | //except to non-OFDM rates |
| 46 | //6, 9, 12, 18, 24, 36, 48, 54 |
| 47 | |
| 48 | #define LOCAL_11B_SUPPORTED_RATE_BITMAP 0x826 |
| 49 | #define LOCAL_11B_BASIC_RATE_BITMAP 0x826 |
| 50 | #define LOCAL_11B_OPERATION_RATE_BITMAP 0x826 |
| 51 | #define LOCAL_11G_BASIC_RATE_BITMAP 0x826 //1, 2, 5.5, 11 |
| 52 | #define LOCAL_11G_OPERATION_RATE_BITMAP 0x130c1240 //6, 9, 12, 18, 24, 36, 48, 54 |
| 53 | #define LOCAL_11A_BASIC_RATE_BITMAP 0x01001040 //6, 12, 24 |
| 54 | #define LOCAL_11A_OPERATION_RATE_BITMAP 0x120c0200 //9, 18, 36, 48, 54 |
| 55 | |
| 56 | |
| 57 | |
| 58 | #define PWR_ACTIVE 0 |
| 59 | #define PWR_SAVE 1 |
| 60 | #define PWR_TX_IDLE_CYCLE 6 |
| 61 | |
| 62 | //bPreambleMode and bSlotTimeMode |
| 63 | #define AUTO_MODE 0 |
| 64 | #define LONG_MODE 1 |
| 65 | |
| 66 | //Region definition |
| 67 | #define REGION_AUTO 0xff |
| 68 | #define REGION_UNKNOWN 0 |
| 69 | #define REGION_EUROPE 1 //ETSI |
| 70 | #define REGION_JAPAN 2 //MKK |
| 71 | #define REGION_USA 3 //FCC |
| 72 | #define REGION_FRANCE 4 //FRANCE |
| 73 | #define REGION_SPAIN 5 //SPAIN |
| 74 | #define REGION_ISRAEL 6 //ISRAEL |
| 75 | //#define REGION_CANADA 7 //IC |
| 76 | |
| 77 | #define MAX_BSS_DESCRIPT_ELEMENT 32 |
| 78 | #define MAX_PMKID_CandidateList 16 |
| 79 | |
| 80 | //High byte : Event number, low byte : reason |
| 81 | //Event definition |
| 82 | //-- SME/MLME event |
| 83 | #define EVENT_RCV_DEAUTH 0x0100 |
| 84 | #define EVENT_JOIN_FAIL 0x0200 |
| 85 | #define EVENT_AUTH_FAIL 0x0300 |
| 86 | #define EVENT_ASSOC_FAIL 0x0400 |
| 87 | #define EVENT_LOST_SIGNAL 0x0500 |
| 88 | #define EVENT_BSS_DESCRIPT_LACK 0x0600 |
| 89 | #define EVENT_COUNTERMEASURE 0x0700 |
| 90 | #define EVENT_JOIN_FILTER 0x0800 |
| 91 | //-- TX/RX event |
| 92 | #define EVENT_RX_BUFF_UNAVAILABLE 0x4100 |
| 93 | |
| 94 | #define EVENT_CONNECT 0x8100 |
| 95 | #define EVENT_DISCONNECT 0x8200 |
| 96 | #define EVENT_SCAN_REQ 0x8300 |
| 97 | |
| 98 | //Reason of Event |
| 99 | #define EVENT_REASON_FILTER_BASIC_RATE 0x0001 |
| 100 | #define EVENT_REASON_FILTER_PRIVACY 0x0002 |
| 101 | #define EVENT_REASON_FILTER_AUTH_MODE 0x0003 |
| 102 | #define EVENT_REASON_TIMEOUT 0x00ff |
| 103 | |
| 104 | // 20061108 WPS IE buffer |
| 105 | #define MAX_IE_APPEND_SIZE 256 + 4 // Due to [E id][Length][OUI][Data] may 257 bytes |
| 106 | |
| 107 | typedef struct _EVENTLOG |
| 108 | { |
| 109 | u16 Count; //Total count from start |
| 110 | u16 index; //Buffer index, 0 ~ 63 |
| 111 | u32 EventValue[64]; //BYTE 3~2 : count, BYTE 1 : Event, BYTE 0 : reason |
| 112 | } Event_Log, *pEvent_Log; |
| 113 | |
| 114 | typedef struct _ChanInfo |
| 115 | { |
| 116 | u8 band; |
| 117 | u8 ChanNo; |
| 118 | } ChanInfo, *pChanInfo; |
| 119 | |
| 120 | typedef struct _CHAN_LIST |
| 121 | { |
| 122 | u16 Count; |
| 123 | ChanInfo Channel[50]; // 100B |
| 124 | } CHAN_LIST, *psCHAN_LIST; |
| 125 | |
| 126 | typedef struct _RadioOff |
| 127 | { |
| 128 | u8 boHwRadioOff; |
| 129 | u8 boSwRadioOff; |
| 130 | } RadioOff, *psRadioOff; |
| 131 | |
| 132 | //=========================================================================== |
| 133 | typedef struct LOCAL_PARA |
| 134 | { |
| 135 | u8 PermanentAddress[ MAC_ADDR_LENGTH + 2 ]; // read from EPROM, manufacture set for each NetCard |
| 136 | u8 ThisMacAddress[ MAC_ADDR_LENGTH + 2 ]; // the driver will use actually. |
| 137 | |
| 138 | u32 MTUsize; // Ind to Uplayer, Max transmission unit size |
| 139 | |
| 140 | u8 region_INF; //region setting from INF |
| 141 | u8 region; //real region setting of the device |
| 142 | u8 Reserved_1[2]; |
| 143 | |
| 144 | //// power-save variables |
| 145 | u8 iPowerSaveMode; // 0 indicates it is on, 1 indicates it is off |
| 146 | u8 ShutDowned; |
| 147 | u8 ATIMmode; |
| 148 | u8 ExcludeUnencrypted; |
| 149 | |
| 150 | u16 CheckCountForPS; //Unit ime count for the decision to enter PS mode |
| 151 | u8 boHasTxActivity; //tx activity has occurred |
| 152 | u8 boMacPsValid; //Power save mode obtained from H/W is valid or not |
| 153 | |
| 154 | //// Rate |
| 155 | u8 TxRateMode; // Initial, input from Registry, may be updated by GUI |
| 156 | //Tx Rate Mode: auto(DTO on), max, 1M, 2M, .. |
| 157 | u8 CurrentTxRate; // The current Tx rate |
| 158 | u8 CurrentTxRateForMng; // The current Tx rate for management frames |
| 159 | // It will be decided before connection succeeds. |
| 160 | u8 CurrentTxFallbackRate; |
| 161 | |
| 162 | //for Rate handler |
| 163 | u8 BRateSet[32]; //basic rate set |
| 164 | u8 SRateSet[32]; //support rate set |
| 165 | |
| 166 | u8 NumOfBRate; |
| 167 | u8 NumOfSRate; |
| 168 | u8 NumOfDsssRateInSRate; //number of DSSS rates in supported rate set |
| 169 | u8 reserved1; |
| 170 | |
| 171 | u32 dwBasicRateBitmap; //bit map of basic rates |
| 172 | u32 dwSupportRateBitmap; //bit map of all support rates including |
| 173 | //basic and operational rates |
| 174 | |
| 175 | ////For SME/MLME handler |
| 176 | u16 wOldSTAindex; // valid when boHandover=TRUE, store old connected STA index |
| 177 | u16 wConnectedSTAindex; // Index of peerly connected AP or IBSS in |
| 178 | // the descriptionset. |
| 179 | u16 Association_ID; // The Association ID in the (Re)Association |
| 180 | // Response frame. |
| 181 | u16 ListenInterval; // The listen interval when SME invoking MLME_ |
| 182 | // (Re)Associate_Request(). |
| 183 | |
| 184 | RadioOff RadioOffStatus; |
| 185 | u8 Reserved0[2]; |
| 186 | |
| 187 | u8 boMsRadioOff; // Ndis demands to be true when set Disassoc. OID and be false when set SSID OID. |
| 188 | u8 boAntennaDiversity; //TRUE/ON or FALSE/OFF |
| 189 | u8 bAntennaNo; //which antenna |
| 190 | u8 bConnectFlag; //the connect status flag for roaming task |
| 191 | |
| 192 | u8 RoamStatus; |
| 193 | u8 reserved7[3]; |
| 194 | |
| 195 | ChanInfo CurrentChan; //Current channel no. and channel band. It may be changed by scanning. |
| 196 | u8 boHandover; // Roaming, Hnadover to other AP. |
| 197 | u8 boCCAbusy; |
| 198 | |
| 199 | u16 CWMax; // It may not be the real value that H/W used |
| 200 | u8 CWMin; // 255: set according to 802.11 spec. |
| 201 | u8 reserved2; |
| 202 | |
| 203 | //11G: |
| 204 | u8 bMacOperationMode; // operation in 802.11b or 802.11g |
| 205 | u8 bSlotTimeMode; //AUTO, s32 |
| 206 | u8 bPreambleMode; //AUTO, s32 |
| 207 | u8 boNonERPpresent; |
| 208 | |
| 209 | u8 boProtectMechanism; // H/W will take the necessary action based on this variable |
| 210 | u8 boShortPreamble; // H/W will take the necessary action based on this variable |
| 211 | u8 boShortSlotTime; // H/W will take the necessary action based on this variable |
| 212 | u8 reserved_3; |
| 213 | |
| 214 | u32 RSN_IE_Bitmap; //added by WS |
| 215 | u32 RSN_OUI_Type; //added by WS |
| 216 | |
| 217 | //For the BSSID |
| 218 | u8 HwBssid[MAC_ADDR_LENGTH + 2]; |
| 219 | u32 HwBssidValid; |
| 220 | |
| 221 | //For scan list |
| 222 | u8 BssListCount; //Total count of valid descriptor indexes |
| 223 | u8 boReceiveUncorrectInfo; //important settings in beacon/probe resp. have been changed |
| 224 | u8 NoOfJoinerInIbss; |
| 225 | u8 reserved_4; |
| 226 | |
| 227 | u8 BssListIndex[ (MAX_BSS_DESCRIPT_ELEMENT+3) & ~0x03 ]; //Store the valid descriptor indexes obtained from scannings |
| 228 | u8 JoinerInIbss[ (MAX_BSS_DESCRIPT_ELEMENT+3) & ~0x03 ]; //save the BssDescriptor index in this |
| 229 | //IBSS. The index 0 is local descriptor |
| 230 | //(psLOCAL->wConnectedSTAindex). |
| 231 | //If CONNECTED : NoOfJoinerInIbss >=2 |
| 232 | // else : NoOfJoinerInIbss <=1 |
| 233 | |
| 234 | //// General Statistics, count at Rx_handler or Tx_callback interrupt handler |
| 235 | u64 GS_XMIT_OK; // Good Frames Transmitted |
| 236 | u64 GS_RCV_OK; // Good Frames Received |
| 237 | u32 GS_RCV_ERROR; // Frames received with crc error |
| 238 | u32 GS_XMIT_ERROR; // Bad Frames Transmitted |
| 239 | u32 GS_RCV_NO_BUFFER; // Receive Buffer underrun |
| 240 | u32 GS_XMIT_ONE_COLLISION; // one collision |
| 241 | u32 GS_XMIT_MORE_COLLISIONS;// more collisions |
| 242 | |
| 243 | //================================================================ |
| 244 | // Statistics (no matter whether it had done successfully) -wkchen |
| 245 | //================================================================ |
| 246 | u32 _NumRxMSDU; |
| 247 | u32 _NumTxMSDU; |
| 248 | u32 _dot11WEPExcludedCount; |
| 249 | u32 _dot11WEPUndecryptableCount; |
| 250 | u32 _dot11FrameDuplicateCount; |
| 251 | |
| 252 | ChanInfo IbssChanSetting; // 2B. Start IBSS Channel setting by registry or WWU. |
| 253 | u8 reserved_5[2]; //It may not be used after considering RF type, |
| 254 | //region and modulation type. |
| 255 | |
| 256 | CHAN_LIST sSupportChanList; // 86B. It will be obtained according to RF type and region |
| 257 | u8 reserved_6[2]; //two variables are for wep key error detection added by ws 02/02/04 |
| 258 | |
| 259 | u32 bWepKeyError; |
| 260 | u32 bToSelfPacketReceived; |
| 261 | u32 WepKeyDetectTimerCount; |
| 262 | |
| 263 | Event_Log EventLog; |
| 264 | |
| 265 | u16 SignalLostTh; |
| 266 | u16 SignalRoamTh; |
| 267 | |
| 268 | // 20061108 WPS IE Append |
| 269 | u8 IE_Append_data[MAX_IE_APPEND_SIZE]; |
| 270 | u16 IE_Append_size; |
| 271 | u16 reserved_7; |
| 272 | |
| 273 | } WB_LOCALDESCRIPT, *PWB_LOCALDESCRIPT; |
| 274 | |
| 275 | |