PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/inc/tiwlnif.h

http://github.com/CyanogenMod/cm-kernel
C Header | 421 lines | 291 code | 73 blank | 57 comment | 0 complexity | 02f805588792ec94bb52a0424b83b4bc MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
  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. #ifndef __TIWLNIF_H__
  36. #define __TIWLNIF_H__
  37. #include "osDot11.h"
  38. #ifndef TIWLNAPI_EXPORTS
  39. #include "osTIType.h"
  40. #endif
  41. #define REGDOMAIN_TABLE_SIZE 16
  42. #define MAX_NUM_OF_TX_QUEUES 4
  43. typedef enum _tiwlnOSVersion
  44. {
  45. tiwlnIsWin95 = 1,
  46. tiwlnIsWin98 = 2,
  47. tiwlnIsWinNT = 3,
  48. tiwlnIsWin98SE = 4,
  49. tiwlnIsWinME = 5,
  50. tiwlnIsWin2K = 6,
  51. tiwlnIsWinXP = 7
  52. } TIWLN_OS_VERSION;
  53. typedef enum _TIWLN_PRIVACY_MODE
  54. {
  55. TIWLN_PRIVACY_NONE = 0,
  56. TIWLN_PRIVACY_WEP,
  57. TIWLN_PRIVACY_ZCU,
  58. TIWLN_PRIVACY_EXC
  59. }TIWLN_PRIVACY_MODE;
  60. PACKED_STRUCT( _dbgBufferHdr ,
  61. tiCHAR* pBuff;
  62. tiUINT32* puIndex;
  63. tiUINT32 uSize;
  64. );
  65. typedef _dbgBufferHdr DBG_BUFFER_HDR;
  66. PACKED_STRUCT( _TIWLN_REG_RW ,
  67. tiUINT32 regSize;
  68. tiUINT32 regAddr;
  69. tiUINT32 regValue;
  70. );
  71. typedef _TIWLN_REG_RW TIWLN_REG_RW;
  72. PACKED_STRUCT( _ACX_VERSION_DEF ,
  73. tiUINT8 major;
  74. tiUINT8 minor;
  75. tiUINT8 bugfix;
  76. tiUINT8 subld;
  77. tiUINT8 build;
  78. );
  79. typedef _ACX_VERSION_DEF acxVersionDef, *pacxVersionDef;
  80. PACKED_STRUCT( _TIWLN_VERSION ,
  81. acxVersionDef AppVersion;
  82. acxVersionDef DrvVersion;
  83. acxVersionDef FWVersion;
  84. acxVersionDef HWVersion;
  85. tiUINT32 osNdisVersion; /* for OS Windows - Ndis, for Linux - WirelessExt ver.*/
  86. );
  87. typedef _TIWLN_VERSION TIWLN_VERSION, *PTIWLN_VERSION;
  88. PACKED_STRUCT( _TIWLN_VERSION_EX ,
  89. acxVersionDef AppVersion;
  90. acxVersionDef DrvVersion;
  91. acxVersionDef FWVersion;
  92. acxVersionDef HWVersion;
  93. tiUINT32 osNdisVersion; /* for OS Windows - Ndis, for Linux - WirelessExt ver.*/
  94. tiUINT32 extVerSign; /* Extended version signature*/
  95. acxVersionDef NVVersion;
  96. );
  97. typedef _TIWLN_VERSION_EX TIWLN_VERSION_EX, *PTIWLN_VERSION_EX;
  98. typedef enum _TIWLN_RATES
  99. {
  100. TIWLN_RATE_1 = 0x0A,
  101. TIWLN_RATE_2 = 0x14,
  102. TIWLN_RATE_5_5 = 0x37,
  103. TIWLN_RATE_5_5_PBCC = 0xB7,
  104. TIWLN_RATE_11 = 0x6E,
  105. TIWLN_RATE_11_PBCC = 0xEE,
  106. TIWLN_RATE_22_PBCC = 0xDC
  107. } TIWLN_RATES;
  108. typedef enum _TIWLN_DOT11_STATUS
  109. {
  110. eDot11Idle = 0,
  111. eDot11Scaning = 1,
  112. eDot11Connecting = 2,
  113. eDot11Associated = 3,
  114. eDot11Disassociated = 4,
  115. eDot11RadioDisabled = 5,
  116. eDot11Error = 1000,
  117. } TIWLN_DOT11_STATUS;
  118. typedef enum _TIWLN_SECURITY_STATE /* Values are compatible with 802.1x'S IMSTATE*/
  119. {
  120. eSecurityStateHalted = 0, /* Security state machine halted*/
  121. eSecurityStateStarting, /* state machine is starting*/
  122. eSecurityStateInitializing, /* state machine is initializing*/
  123. eSecurityStateDisabled, /* state machine is disabled*/
  124. eSecurityStateNotAuthenticated, /* Not authenticated state*/
  125. eSecurityStateAuthenticating, /* Authentication request is sent*/
  126. eSecurityStateAuthenticated /* Authenticated state*/
  127. } TIWLN_SECURITY_STATE;
  128. PACKED_STRUCT( _OS_802_11_DRIVER_CAPABILITIES ,
  129. tiUINT8 EXCVersion;
  130. );
  131. typedef _OS_802_11_DRIVER_CAPABILITIES OS_802_11_DRIVER_CAPABILITIES;
  132. /* SME SM definitions - Need to update this whenever the SME SM states change */
  133. /* Table is used for "translating" SME SM states into more "simple" states reported by the TI_GetDriverState API call */
  134. typedef enum
  135. {
  136. SM_STATE_IDLE = 0,
  137. SM_STATE_SCANNING = 1,
  138. SM_STATE_SELECTING = 2,
  139. SM_STATE_CONNECTING = 3,
  140. SM_STATE_CONNECTED = 4,
  141. SM_STATE_QUIET_SCAN = 5,
  142. SM_STATE_INTER_SCAN_TIMEOUT = 6,
  143. SM_STATE_ROAMING_QUIET_SCAN = 7,
  144. SM_STATE_RADIO_STAND_BY = 8,
  145. SM_STATE_MEASUREMENT = 9,
  146. SM_STATE_POWER_MNGR_PENDS_QUIET_SCAN = 10
  147. } stateDrvSme_e;
  148. typedef enum
  149. {
  150. DRIVER_STATE_IDLE = 0,
  151. DRIVER_STATE_SCANNING = 1,
  152. DRIVER_STATE_SELECTING = 2,
  153. DRIVER_STATE_CONNECTING = 3,
  154. DRIVER_STATE_CONNECTED = 4,
  155. DRIVER_STATE_DISCONNECTED = 5,
  156. } driverState_e;
  157. PACKED_STRUCT( _TIWLAN_CONFIG_SCAN_PARAMS ,
  158. UINT32 uMaxChanScanTime;
  159. UINT32 uMinChanScanTime;
  160. UINT32 uEarlyTerminationMode;
  161. UINT32 uETMaxNumOfAPframes;
  162. UINT32 uScanInterval;
  163. UINT32 uNumOfProbeReq;
  164. );
  165. typedef _TIWLAN_CONFIG_SCAN_PARAMS TIWLAN_CONFIG_SCAN_PARAMS;
  166. /* The Tx path delay histogram ranges in msec. */
  167. typedef enum
  168. {
  169. TX_DELAY_RANGE_MIN = 0,
  170. TX_DELAY_RANGE_0_TO_1 = 0,
  171. TX_DELAY_RANGE_1_TO_10 = 1,
  172. TX_DELAY_RANGE_10_TO_20 = 2,
  173. TX_DELAY_RANGE_20_TO_40 = 3,
  174. TX_DELAY_RANGE_40_TO_60 = 4,
  175. TX_DELAY_RANGE_60_TO_80 = 5,
  176. TX_DELAY_RANGE_80_TO_100 = 6,
  177. TX_DELAY_RANGE_100_TO_200 = 7,
  178. TX_DELAY_RANGE_ABOVE_200 = 8,
  179. TX_DELAY_RANGE_MAX = 8,
  180. TX_DELAY_RANGES_NUM = 9,
  181. } TxDelayRanges_e;
  182. #define TX_RETRY_HISTOGRAM_SIZE 16
  183. PACKED_STRUCT( txDataCounters_t ,
  184. UINT32 XmitOk; /* the number of frames that were transferred to TNET without errors */
  185. UINT32 DirectedBytesXmit; /* the number of bytes in directed packets that are transmitted without errors */
  186. UINT32 DirectedFramesXmit; /* the number of directed packets that are transmitted without errors */
  187. UINT32 MulticastBytesXmit; /* the number of bytes in multicast/functional packets that are transmitted without errors.*/
  188. UINT32 MulticastFramesXmit; /* the number of multicast/functional packets that are transmitted without errors.*/
  189. UINT32 BroadcastBytesXmit; /* the number of bytes in broadcast packets that are transmitted without */
  190. UINT32 BroadcastFramesXmit; /* the number of broadcast packets that are transmitted without errors */
  191. UINT32 RetryHistogram[ TX_RETRY_HISTOGRAM_SIZE ];
  192. /* Histogram counting the number of packets xfered with any retry number */
  193. UINT32 RetryFailCounter; /* Number of packets that failed transmission due to retry number exceeded */
  194. UINT32 TxTimeoutCounter; /* Number of packets that failed transmission due to lifetime expiry */
  195. UINT32 NoLinkCounter; /* Number of packets that failed transmission due to link failure */
  196. UINT32 OtherFailCounter; /* Number of packets that failed transmission due to other reasons */
  197. UINT32 MaxConsecutiveRetryFail;/* Maximum consecutive packets that failed transmission due to retry limit exceeded */
  198. /* TX path delay statistics */
  199. UINT32 txDelayHistogram[TX_DELAY_RANGES_NUM];/* Histogram of Tx path delay (host + MAC). */
  200. UINT32 NumPackets; /* For average calculation - Total packets counted. */
  201. UINT32 SumTotalDelayMs; /* For average calculation - the sum of packets total delay. */
  202. UINT32 SumFWDelayUs; /* For average calculation - The sum of packets FW delay. */
  203. UINT32 SumMacDelayUs; /* For average calculation - the sum of packets MAC delay. */
  204. );
  205. typedef struct
  206. {
  207. txDataCounters_t txCounters[ MAX_NUM_OF_TX_QUEUES ];
  208. } TIWLN_TX_STATISTICS;
  209. PACKED_STRUCT( TIWLN_COUNTERS ,
  210. UINT32 RecvOk; /* num of frames that the NIC receives without errors*/
  211. UINT32 RecvError; /* num of frames that a NIC receives but does not indicate to the protocols due to errors*/
  212. UINT32 RecvNoBuffer; /* num of frames that the NIC cannot receive due to lack of NIC receive buffer space */
  213. UINT32 DirectedBytesRecv; /* num of bytes in directed packets that are received without errors */
  214. UINT32 DirectedFramesRecv; /* num of directed packets that are received without errors */
  215. UINT32 MulticastBytesRecv; /* num of bytes in multicast/functional packets that are received without errors */
  216. UINT32 MulticastFramesRecv; /* num of multicast/functional packets that are received without errors */
  217. UINT32 BroadcastBytesRecv; /* num of bytes in broadcast packets that are received without errors. */
  218. UINT32 BroadcastFramesRecv; /* num of broadcast packets that are received without errors. */
  219. UINT32 FragmentsRecv;
  220. UINT32 FrameDuplicates;
  221. UINT32 FcsErrors;
  222. UINT32 BeaconsXmit;
  223. UINT32 BeaconsRecv;
  224. UINT32 AssocRejects;
  225. UINT32 AssocTimeouts;
  226. UINT32 AuthRejects;
  227. UINT32 AuthTimeouts;
  228. );
  229. PACKED_STRUCT( _TIWLN_STATISTICS ,
  230. /**/
  231. /* config info*/
  232. /**/
  233. tiUINT32 dot11CurrentTxRate;
  234. tiUINT32 dot11CurrentChannel;
  235. OS_802_11_MAC_ADDRESS currentMACAddress;
  236. OS_802_11_SSID dot11DesiredSSID;
  237. OS_802_11_NETWORK_MODE dot11BSSType;
  238. OS_802_11_AUTHENTICATION_MODE AuthenticationMode;
  239. tiBOOL bShortPreambleUsed;
  240. tiUINT32 RTSThreshold;
  241. tiUINT32 FragmentationThreshold;
  242. tiBOOL bDefaultWEPKeyDefined;
  243. OS_802_11_WEP_STATUS WEPStatus;
  244. tiUINT32 TxAntenna;
  245. tiUINT32 RxAntenna;
  246. tiUINT32 TxPowerDbm;
  247. tiUINT32 PowerMode;
  248. tiINT32 RxLevel;
  249. /**/
  250. /* status & AP info*/
  251. /**/
  252. TIWLN_DOT11_STATUS dot11State;
  253. OS_802_11_BSSID targetAP;
  254. /**/
  255. /* network layer statistics (except Tx statistics which are handled sparately)*/
  256. /**/
  257. TIWLN_COUNTERS tiCounters;
  258. /**/
  259. /* other statistics*/
  260. /**/
  261. tiUINT32 dwSecuritySuit; /* Security suit bitmask (see defines)*/
  262. tiUINT32 dwSecurityState; /* 802.1x security protocol state*/
  263. tiUINT32 dwSecurityAuthStatus; /* Security suit authentication status*/
  264. tiUINT32 dwFeatureSuit; /* Additional features suit bitmask (see defines)*/
  265. );
  266. typedef _TIWLN_STATISTICS TIWLN_STATISTICS;
  267. /* Statistics security suit bitmasks*/
  268. #define TIWLN_STAT_SECURITY_RESERVE_1 0x0001
  269. #define TIWLN_STAT_SECURITY_SSN 0x0002
  270. /* Features suit bitmasks*/
  271. #define TIWLN_FEATURE_4XENABLED 0x0001
  272. #define TIWLN_FEATURE_4XACTIVE 0x0002
  273. PACKED_STRUCT( _TIWLN_REGDOMAINS ,
  274. tiUINT8 Length;
  275. tiUINT8 Table[REGDOMAIN_TABLE_SIZE];
  276. );
  277. typedef _TIWLN_REGDOMAINS TIWLN_REGDOMAINS;
  278. PACKED_STRUCT( _TIWLN_MEDIUM_USAGE ,
  279. tiUINT32 MediumUsage;
  280. tiUINT32 Period;
  281. );
  282. typedef _TIWLN_MEDIUM_USAGE TIWLN_MEDIUM_USAGE;
  283. typedef struct _RADIO_RX_QUALITY
  284. {
  285. tiINT32 Snr;
  286. tiINT32 Rssi;
  287. }TIWLN_RADIO_RX_QUALITY;
  288. #define MAX_NUM_DATA_FILTERS 4
  289. PACKED_STRUCT( _TIWLAN_DATA_FILTER_STATISTICS ,
  290. tiUINT32 UnmatchedPacketsCount;
  291. tiUINT32 MatchedPacketsCount[MAX_NUM_DATA_FILTERS];
  292. );
  293. typedef _TIWLAN_DATA_FILTER_STATISTICS TIWLAN_DATA_FILTER_STATISTICS;
  294. #define MAX_DATA_FILTER_MASK_LENGTH 8
  295. #define MAX_DATA_FILTER_PATTERN_LENGTH 64
  296. PACKED_STRUCT ( _TIWLAN_DATA_FILTER_REQUEST ,
  297. tiUINT8 Offset;
  298. tiUINT8 MaskLength;
  299. tiUINT8 Mask[MAX_DATA_FILTER_MASK_LENGTH];
  300. tiUINT8 PatternLength;
  301. tiUINT8 Pattern[MAX_DATA_FILTER_PATTERN_LENGTH];
  302. );
  303. typedef _TIWLAN_DATA_FILTER_REQUEST TIWLAN_DATA_FILTER_REQUEST;
  304. #define MAX_NUM_PROFILES 4
  305. PACKED_STRUCT( _TIWLN_PROFILE ,
  306. tiBOOL bPresent;
  307. OS_802_11_SSID dot11DesiredSSID;
  308. OS_802_11_NETWORK_MODE dot11BSSType;
  309. OS_802_11_AUTHENTICATION_MODE AuthenticationMode;
  310. OS_802_11_WEP WepDefaultKey[4];
  311. tiUINT32 WepDefaultKeyID;
  312. tiBOOL bWepDefaultKeySet;
  313. OS_802_11_WEP_STATUS WEPStatus;
  314. /**/
  315. /* Which one should be included???*/
  316. /**/
  317. tiUINT32 dot11TxRate;
  318. tiUINT32 dot11Channel;
  319. tiBOOL bShortPreambleUsed;
  320. tiBOOL bHighSpeed;
  321. tiUINT32 RTSThreshold;
  322. tiUINT32 FragmentationThreshold;
  323. tiUINT32 TxAntenna;
  324. tiUINT32 RxAntenna;
  325. tiUINT32 TxPowerDbm;
  326. tiUINT32 PowerMode;
  327. );
  328. typedef _TIWLN_PROFILE TIWLN_PROFILE, *PTIWLN_PROFILE;
  329. /* SHA1 hash (of certificate)*/
  330. typedef struct _TI_SHA1_HASH
  331. {
  332. tiUINT8 aHash[20];
  333. } TI_SHA1_HASH;
  334. PACKED_STRUCT( _TIWLAN_ANT_DIVERSITY ,
  335. tiUINT8 enableRxDiversity;
  336. tiUINT8 rxSelectedAntenna;
  337. tiUINT8 enableTxDiversity;
  338. tiUINT8 txSelectedAntenna;
  339. tiUINT8 rxTxSharedAnts;
  340. );
  341. typedef _TIWLAN_ANT_DIVERSITY TIWLAN_ANT_DIVERSITY, *PTIWLAN_ANT_DIVERSITY;
  342. #define TI_NUM_OF_SUB_BANDS 5
  343. #define TI_NUM_OF_POWER_LEVEL 4
  344. typedef struct
  345. {
  346. tiUINT8 uTxPower[TI_NUM_OF_SUB_BANDS][TI_NUM_OF_POWER_LEVEL]; /* Maximun Dbm in Dbm/10 units */
  347. } TIWLAN_POWER_LEVEL_TABLE;
  348. #endif /* __TIWLNIF_H__*/