1 /**************************************************************************** 2 **+-----------------------------------------------------------------------+** 3 **| |** 4 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |** 5 **| All rights reserved. |** 6 **| |** 7 **| Redistribution and use in source and binary forms, with or without |** 8 **| modification, are permitted provided that the following conditions |** 9 **| are met: |** 10 **| |** 11 **| * Redistributions of source code must retain the above copyright |** 12 **| notice, this list of conditions and the following disclaimer. |** 13 **| * Redistributions in binary form must reproduce the above copyright |** 14 **| notice, this list of conditions and the following disclaimer in |** 15 **| the documentation and/or other materials provided with the |** 16 **| distribution. |** 17 **| * Neither the name Texas Instruments nor the names of its |** 18 **| contributors may be used to endorse or promote products derived |** 19 **| from this software without specific prior written permission. |** 20 **| |** 21 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |** 22 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |** 23 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |** 24 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |** 25 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |** 26 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |** 27 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |** 28 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |** 29 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |** 30 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |** 31 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |** 32 **| |** 33 **+-----------------------------------------------------------------------+** 34 ****************************************************************************/ 35 36 #ifndef __TIWLNIF_H__ 37 #define __TIWLNIF_H__ 38 39 #include "osDot11.h" 40 #ifndef TIWLNAPI_EXPORTS 41 #include "osTIType.h" 42 #endif 43 44 #define REGDOMAIN_TABLE_SIZE 16 45 46 #define MAX_NUM_OF_TX_QUEUES 4 47 48 49 typedef enum _tiwlnOSVersion 50 { 51 tiwlnIsWin95 = 1, 52 tiwlnIsWin98 = 2, 53 tiwlnIsWinNT = 3, 54 tiwlnIsWin98SE = 4, 55 tiwlnIsWinME = 5, 56 tiwlnIsWin2K = 6, 57 tiwlnIsWinXP = 7 58 } TIWLN_OS_VERSION; 59 60 typedef enum _TIWLN_PRIVACY_MODE 61 { 62 TIWLN_PRIVACY_NONE = 0, 63 TIWLN_PRIVACY_WEP, 64 TIWLN_PRIVACY_ZCU, 65 TIWLN_PRIVACY_EXC 66 }TIWLN_PRIVACY_MODE; 67 68 PACKED_STRUCT( _dbgBufferHdr , 69 70 tiCHAR* pBuff; 71 tiUINT32* puIndex; 72 tiUINT32 uSize; 73 ); 74 typedef _dbgBufferHdr DBG_BUFFER_HDR; 75 76 PACKED_STRUCT( _TIWLN_REG_RW , 77 78 tiUINT32 regSize; 79 tiUINT32 regAddr; 80 tiUINT32 regValue; 81 ); 82 typedef _TIWLN_REG_RW TIWLN_REG_RW; 83 84 PACKED_STRUCT( _ACX_VERSION_DEF , 85 86 tiUINT8 major; 87 tiUINT8 minor; 88 tiUINT8 bugfix; 89 tiUINT8 subld; 90 tiUINT8 build; 91 ); 92 typedef _ACX_VERSION_DEF acxVersionDef, *pacxVersionDef; 93 94 PACKED_STRUCT( _TIWLN_VERSION , 95 96 acxVersionDef AppVersion; 97 acxVersionDef DrvVersion; 98 acxVersionDef FWVersion; 99 acxVersionDef HWVersion; 100 tiUINT32 osNdisVersion; /* for OS Windows - Ndis, for Linux - WirelessExt ver.*/ 101 ); 102 typedef _TIWLN_VERSION TIWLN_VERSION, *PTIWLN_VERSION; 103 104 PACKED_STRUCT( _TIWLN_VERSION_EX , 105 106 acxVersionDef AppVersion; 107 acxVersionDef DrvVersion; 108 acxVersionDef FWVersion; 109 acxVersionDef HWVersion; 110 tiUINT32 osNdisVersion; /* for OS Windows - Ndis, for Linux - WirelessExt ver.*/ 111 tiUINT32 extVerSign; /* Extended version signature*/ 112 acxVersionDef NVVersion; 113 ); 114 typedef _TIWLN_VERSION_EX TIWLN_VERSION_EX, *PTIWLN_VERSION_EX; 115 116 typedef enum _TIWLN_RATES 117 { 118 TIWLN_RATE_1 = 0x0A, 119 TIWLN_RATE_2 = 0x14, 120 TIWLN_RATE_5_5 = 0x37, 121 TIWLN_RATE_5_5_PBCC = 0xB7, 122 TIWLN_RATE_11 = 0x6E, 123 TIWLN_RATE_11_PBCC = 0xEE, 124 TIWLN_RATE_22_PBCC = 0xDC 125 } TIWLN_RATES; 126 127 typedef enum _TIWLN_DOT11_STATUS 128 { 129 eDot11Idle = 0, 130 eDot11Scaning = 1, 131 eDot11Connecting = 2, 132 eDot11Associated = 3, 133 eDot11Disassociated = 4, 134 eDot11RadioDisabled = 5, 135 eDot11Error = 1000, 136 } TIWLN_DOT11_STATUS; 137 138 typedef enum _TIWLN_SECURITY_STATE /* Values are compatible with 802.1x'S IMSTATE*/ 139 { 140 eSecurityStateHalted = 0, /* Security state machine halted*/ 141 eSecurityStateStarting, /* state machine is starting*/ 142 eSecurityStateInitializing, /* state machine is initializing*/ 143 eSecurityStateDisabled, /* state machine is disabled*/ 144 eSecurityStateNotAuthenticated, /* Not authenticated state*/ 145 eSecurityStateAuthenticating, /* Authentication request is sent*/ 146 eSecurityStateAuthenticated /* Authenticated state*/ 147 } TIWLN_SECURITY_STATE; 148 149 PACKED_STRUCT( _OS_802_11_DRIVER_CAPABILITIES , 150 151 tiUINT8 EXCVersion; 152 ); 153 typedef _OS_802_11_DRIVER_CAPABILITIES OS_802_11_DRIVER_CAPABILITIES; 154 155 156 /* SME SM definitions - Need to update this whenever the SME SM states change */ 157 /* Table is used for "translating" SME SM states into more "simple" states reported by the TI_GetDriverState API call */ 158 typedef enum 159 { 160 SM_STATE_IDLE = 0, 161 SM_STATE_SCANNING = 1, 162 SM_STATE_SELECTING = 2, 163 SM_STATE_CONNECTING = 3, 164 SM_STATE_CONNECTED = 4, 165 SM_STATE_QUIET_SCAN = 5, 166 SM_STATE_INTER_SCAN_TIMEOUT = 6, 167 SM_STATE_ROAMING_QUIET_SCAN = 7, 168 SM_STATE_RADIO_STAND_BY = 8, 169 SM_STATE_MEASUREMENT = 9, 170 SM_STATE_POWER_MNGR_PENDS_QUIET_SCAN = 10 171 } stateDrvSme_e; 172 173 typedef enum 174 { 175 DRIVER_STATE_IDLE = 0, 176 DRIVER_STATE_SCANNING = 1, 177 DRIVER_STATE_SELECTING = 2, 178 DRIVER_STATE_CONNECTING = 3, 179 DRIVER_STATE_CONNECTED = 4, 180 DRIVER_STATE_DISCONNECTED = 5, 181 } driverState_e; 182 183 PACKED_STRUCT( _TIWLAN_CONFIG_SCAN_PARAMS , 184 185 UINT32 uMaxChanScanTime; 186 UINT32 uMinChanScanTime; 187 UINT32 uEarlyTerminationMode; 188 UINT32 uETMaxNumOfAPframes; 189 UINT32 uScanInterval; 190 UINT32 uNumOfProbeReq; 191 ); 192 typedef _TIWLAN_CONFIG_SCAN_PARAMS TIWLAN_CONFIG_SCAN_PARAMS; 193 194 195 /* The Tx path delay histogram ranges in msec. */ 196 typedef enum 197 { 198 TX_DELAY_RANGE_MIN = 0, 199 200 TX_DELAY_RANGE_0_TO_1 = 0, 201 TX_DELAY_RANGE_1_TO_10 = 1, 202 TX_DELAY_RANGE_10_TO_20 = 2, 203 TX_DELAY_RANGE_20_TO_40 = 3, 204 TX_DELAY_RANGE_40_TO_60 = 4, 205 TX_DELAY_RANGE_60_TO_80 = 5, 206 TX_DELAY_RANGE_80_TO_100 = 6, 207 TX_DELAY_RANGE_100_TO_200 = 7, 208 TX_DELAY_RANGE_ABOVE_200 = 8, 209 210 TX_DELAY_RANGE_MAX = 8, 211 TX_DELAY_RANGES_NUM = 9, 212 } TxDelayRanges_e; 213 214 #define TX_RETRY_HISTOGRAM_SIZE 16 215 216 PACKED_STRUCT( txDataCounters_t , 217 218 UINT32 XmitOk; /* the number of frames that were transferred to TNET without errors */ 219 UINT32 DirectedBytesXmit; /* the number of bytes in directed packets that are transmitted without errors */ 220 UINT32 DirectedFramesXmit; /* the number of directed packets that are transmitted without errors */ 221 UINT32 MulticastBytesXmit; /* the number of bytes in multicast/functional packets that are transmitted without errors.*/ 222 UINT32 MulticastFramesXmit; /* the number of multicast/functional packets that are transmitted without errors.*/ 223 UINT32 BroadcastBytesXmit; /* the number of bytes in broadcast packets that are transmitted without */ 224 UINT32 BroadcastFramesXmit; /* the number of broadcast packets that are transmitted without errors */ 225 226 UINT32 RetryHistogram[ TX_RETRY_HISTOGRAM_SIZE ]; 227 /* Histogram counting the number of packets xfered with any retry number */ 228 UINT32 RetryFailCounter; /* Number of packets that failed transmission due to retry number exceeded */ 229 UINT32 TxTimeoutCounter; /* Number of packets that failed transmission due to lifetime expiry */ 230 UINT32 NoLinkCounter; /* Number of packets that failed transmission due to link failure */ 231 UINT32 OtherFailCounter; /* Number of packets that failed transmission due to other reasons */ 232 UINT32 MaxConsecutiveRetryFail;/* Maximum consecutive packets that failed transmission due to retry limit exceeded */ 233 234 /* TX path delay statistics */ 235 UINT32 txDelayHistogram[TX_DELAY_RANGES_NUM];/* Histogram of Tx path delay (host + MAC). */ 236 UINT32 NumPackets; /* For average calculation - Total packets counted. */ 237 UINT32 SumTotalDelayMs; /* For average calculation - the sum of packets total delay. */ 238 UINT32 SumFWDelayUs; /* For average calculation - The sum of packets FW delay. */ 239 UINT32 SumMacDelayUs; /* For average calculation - the sum of packets MAC delay. */ 240 ); 241 242 typedef struct 243 { 244 txDataCounters_t txCounters[ MAX_NUM_OF_TX_QUEUES ]; 245 } TIWLN_TX_STATISTICS; 246 247 PACKED_STRUCT( TIWLN_COUNTERS , 248 249 UINT32 RecvOk; /* num of frames that the NIC receives without errors*/ 250 UINT32 RecvError; /* num of frames that a NIC receives but does not indicate to the protocols due to errors*/ 251 UINT32 RecvNoBuffer; /* num of frames that the NIC cannot receive due to lack of NIC receive buffer space */ 252 UINT32 DirectedBytesRecv; /* num of bytes in directed packets that are received without errors */ 253 UINT32 DirectedFramesRecv; /* num of directed packets that are received without errors */ 254 UINT32 MulticastBytesRecv; /* num of bytes in multicast/functional packets that are received without errors */ 255 UINT32 MulticastFramesRecv; /* num of multicast/functional packets that are received without errors */ 256 UINT32 BroadcastBytesRecv; /* num of bytes in broadcast packets that are received without errors. */ 257 UINT32 BroadcastFramesRecv; /* num of broadcast packets that are received without errors. */ 258 259 UINT32 FragmentsRecv; 260 UINT32 FrameDuplicates; 261 UINT32 FcsErrors; 262 263 UINT32 BeaconsXmit; 264 UINT32 BeaconsRecv; 265 UINT32 AssocRejects; 266 UINT32 AssocTimeouts; 267 UINT32 AuthRejects; 268 UINT32 AuthTimeouts; 269 ); 270 271 PACKED_STRUCT( _TIWLN_STATISTICS , 272 273 /**/ 274 /* config info*/ 275 /**/ 276 tiUINT32 dot11CurrentTxRate; 277 tiUINT32 dot11CurrentChannel; 278 OS_802_11_MAC_ADDRESS currentMACAddress; 279 OS_802_11_SSID dot11DesiredSSID; 280 OS_802_11_NETWORK_MODE dot11BSSType; 281 OS_802_11_AUTHENTICATION_MODE AuthenticationMode; 282 tiBOOL bShortPreambleUsed; 283 tiUINT32 RTSThreshold; 284 tiUINT32 FragmentationThreshold; 285 tiBOOL bDefaultWEPKeyDefined; 286 OS_802_11_WEP_STATUS WEPStatus; 287 tiUINT32 TxAntenna; 288 tiUINT32 RxAntenna; 289 tiUINT32 TxPowerDbm; 290 tiUINT32 PowerMode; 291 tiINT32 RxLevel; 292 293 /**/ 294 /* status & AP info*/ 295 /**/ 296 TIWLN_DOT11_STATUS dot11State; 297 OS_802_11_BSSID targetAP; 298 299 /**/ 300 /* network layer statistics (except Tx statistics which are handled sparately)*/ 301 /**/ 302 TIWLN_COUNTERS tiCounters; 303 304 /**/ 305 /* other statistics*/ 306 /**/ 307 tiUINT32 dwSecuritySuit; /* Security suit bitmask (see defines)*/ 308 tiUINT32 dwSecurityState; /* 802.1x security protocol state*/ 309 tiUINT32 dwSecurityAuthStatus; /* Security suit authentication status*/ 310 tiUINT32 dwFeatureSuit; /* Additional features suit bitmask (see defines)*/ 311 312 ); 313 typedef _TIWLN_STATISTICS TIWLN_STATISTICS; 314 315 /* Statistics security suit bitmasks*/ 316 #define TIWLN_STAT_SECURITY_RESERVE_1 0x0001 317 #define TIWLN_STAT_SECURITY_SSN 0x0002 318 319 /* Features suit bitmasks*/ 320 #define TIWLN_FEATURE_4XENABLED 0x0001 321 #define TIWLN_FEATURE_4XACTIVE 0x0002 322 323 PACKED_STRUCT( _TIWLN_REGDOMAINS , 324 325 tiUINT8 Length; 326 tiUINT8 Table[REGDOMAIN_TABLE_SIZE]; 327 ); 328 typedef _TIWLN_REGDOMAINS TIWLN_REGDOMAINS; 329 330 PACKED_STRUCT( _TIWLN_MEDIUM_USAGE , 331 332 tiUINT32 MediumUsage; 333 tiUINT32 Period; 334 ); 335 typedef _TIWLN_MEDIUM_USAGE TIWLN_MEDIUM_USAGE; 336 337 typedef struct _RADIO_RX_QUALITY 338 { 339 tiINT32 Snr; 340 tiINT32 Rssi; 341 }TIWLN_RADIO_RX_QUALITY; 342 343 #define MAX_NUM_DATA_FILTERS 4 344 345 PACKED_STRUCT( _TIWLAN_DATA_FILTER_STATISTICS , 346 347 tiUINT32 UnmatchedPacketsCount; 348 tiUINT32 MatchedPacketsCount[MAX_NUM_DATA_FILTERS]; 349 ); 350 typedef _TIWLAN_DATA_FILTER_STATISTICS TIWLAN_DATA_FILTER_STATISTICS; 351 352 #define MAX_DATA_FILTER_MASK_LENGTH 8 353 #define MAX_DATA_FILTER_PATTERN_LENGTH 64 354 355 PACKED_STRUCT ( _TIWLAN_DATA_FILTER_REQUEST , 356 357 tiUINT8 Offset; 358 tiUINT8 MaskLength; 359 tiUINT8 Mask[MAX_DATA_FILTER_MASK_LENGTH]; 360 tiUINT8 PatternLength; 361 tiUINT8 Pattern[MAX_DATA_FILTER_PATTERN_LENGTH]; 362 ); 363 typedef _TIWLAN_DATA_FILTER_REQUEST TIWLAN_DATA_FILTER_REQUEST; 364 365 366 #define MAX_NUM_PROFILES 4 367 368 PACKED_STRUCT( _TIWLN_PROFILE , 369 370 tiBOOL bPresent; 371 OS_802_11_SSID dot11DesiredSSID; 372 OS_802_11_NETWORK_MODE dot11BSSType; 373 OS_802_11_AUTHENTICATION_MODE AuthenticationMode; 374 OS_802_11_WEP WepDefaultKey[4]; 375 tiUINT32 WepDefaultKeyID; 376 tiBOOL bWepDefaultKeySet; 377 OS_802_11_WEP_STATUS WEPStatus; 378 379 /**/ 380 /* Which one should be included???*/ 381 /**/ 382 tiUINT32 dot11TxRate; 383 tiUINT32 dot11Channel; 384 tiBOOL bShortPreambleUsed; 385 tiBOOL bHighSpeed; 386 tiUINT32 RTSThreshold; 387 tiUINT32 FragmentationThreshold; 388 389 tiUINT32 TxAntenna; 390 tiUINT32 RxAntenna; 391 tiUINT32 TxPowerDbm; 392 tiUINT32 PowerMode; 393 ); 394 typedef _TIWLN_PROFILE TIWLN_PROFILE, *PTIWLN_PROFILE; 395 396 397 /* SHA1 hash (of certificate)*/ 398 typedef struct _TI_SHA1_HASH 399 { 400 tiUINT8 aHash[20]; 401 } TI_SHA1_HASH; 402 403 PACKED_STRUCT( _TIWLAN_ANT_DIVERSITY , 404 405 tiUINT8 enableRxDiversity; 406 tiUINT8 rxSelectedAntenna; 407 tiUINT8 enableTxDiversity; 408 tiUINT8 txSelectedAntenna; 409 tiUINT8 rxTxSharedAnts; 410 ); 411 typedef _TIWLAN_ANT_DIVERSITY TIWLAN_ANT_DIVERSITY, *PTIWLAN_ANT_DIVERSITY; 412 413 #define TI_NUM_OF_SUB_BANDS 5 414 #define TI_NUM_OF_POWER_LEVEL 4 415 416 typedef struct 417 { 418 tiUINT8 uTxPower[TI_NUM_OF_SUB_BANDS][TI_NUM_OF_POWER_LEVEL]; /* Maximun Dbm in Dbm/10 units */ 419 } TIWLAN_POWER_LEVEL_TABLE; 420 421 #endif /* __TIWLNIF_H__*/ 422