PageRenderTime 53ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/staging/prima/CORE/MAC/src/include/dphGlobal.h

https://gitlab.com/jhalayashraj/nkernel
C Header | 679 lines | 183 code | 338 blank | 158 comment | 0 complexity | 37e3e0db310d3e1f9ead916be72e97a2 MD5 | raw file
  1. /*
  2. * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /*
  27. *
  28. * Author: Sandesh Goel
  29. * Date: 02/25/02
  30. * History:-
  31. * Date Modified by Modification Information
  32. * --------------------------------------------------------------------
  33. *
  34. */
  35. #ifndef __DPH_GLOBAL_H__
  36. #define __DPH_GLOBAL_H__
  37. #include "limGlobal.h"
  38. //#include "parserApi.h"
  39. #include "sirMacProtDef.h"
  40. #include "sirMacPropExts.h"
  41. #include "sirApi.h"
  42. /// Following determines whether statistics are maintained or not
  43. #define DPH_STATS
  44. /// traffic category not allowed
  45. #define DPH_TID_NOTALLOWED 0xFF
  46. /// Periodicity of invocation of rate adaptation (in ms)
  47. #define DPH_RATE_ADAPTATION_PERIOD 20
  48. // Rate indices
  49. #define DPH_PHY_RATE_1_INDEX 0
  50. #define DPH_PHY_RATE_2_INDEX 1
  51. #define DPH_PHY_RATE_5_5_INDEX 2
  52. #define DPH_PHY_RATE_11_INDEX 3
  53. #define DPH_PHY_RATE_6_INDEX 4
  54. #define DPH_PHY_RATE_9_INDEX 5
  55. #define DPH_PHY_RATE_12_INDEX 6
  56. #define DPH_PHY_RATE_18_INDEX 7
  57. #define DPH_PHY_RATE_24_INDEX 8
  58. #define DPH_PHY_RATE_36_INDEX 9
  59. #define DPH_PHY_RATE_48_INDEX 10
  60. #define DPH_PHY_RATE_54_INDEX 11
  61. #define DPH_PHY_RATE_72_INDEX 12
  62. #define DPH_PHY_RATE_96_INDEX 13
  63. #define DPH_PHY_RATE_108_INDEX 14
  64. #define DPH_PHY_RATE_144_INDEX 15
  65. #define DPH_PHY_RATE_MAX_INDEX 16
  66. /// Maximum time to wait for a management packet to go out (ms)
  67. #define DPH_MAX_MGMT_WAIT_TIME 10000
  68. /// Step size for the wait time histogram (ms)
  69. #define DPH_WAIT_HIST_STEP 20
  70. /// Number of entries in wait time histogram
  71. #define DPH_WAIT_HIST_SIZE 100
  72. /// TCID for Management & Keep Alive Mgmt frames
  73. #define DPH_MGMT_TCID 4
  74. #define DPH_KEEPALIVE_PROBE_RESPONSE_TCID 0
  75. /// STAID for Management frames
  76. #define DPH_USE_MGMT_STAID -1
  77. // Keep Alive frames
  78. #define DPH_NON_KEEPALIVE_FRAME 0
  79. #define DPH_KEEPALIVE_FRAME 1
  80. /// Mask for subtype, type, protocol version, order and wep fields in the mac frame control
  81. #define DPH_FC_BD_FILL_MASK 0xFFCC
  82. /// Enable/Disable Txop generation in TFP for HCF mode
  83. #define DPH_ENABLE_HCF_TXOP_GEN_AT_TFP 0x00
  84. #define DPH_DISABLE_HCF_TXOP_GEN_AT_TFP 0x02
  85. /// Enable/Disable Txop generation in TFP for EDCF mode
  86. #define DPH_ENABLE_EDCF_TXOP_GEN_AT_TFP 0x00
  87. #define DPH_DISABLE_EDCF_TXOP_GEN_AT_TFP 0x01
  88. #define DPH_DUMP_ALL_STA_ID -1
  89. #define DPH_DUMP_RX_BD 0
  90. #define DPH_DUMP_TX_BD 1
  91. #define DPH_DUMP_TX_MGMT_BD 2
  92. //DPH Hash Index for BSS(STA's Peer) on station.
  93. #define DPH_STA_HASH_INDEX_PEER 1
  94. #ifdef WLAN_FEATURE_11W
  95. //DPH PMF SA Query state for station
  96. #define DPH_SA_QUERY_NOT_IN_PROGRESS 1
  97. #define DPH_SA_QUERY_IN_PROGRESS 2
  98. #define DPH_SA_QUERY_TIMED_OUT 3
  99. #endif
  100. typedef struct sDphRateBasedCtr
  101. {
  102. tANI_U32 hi;
  103. tANI_U32 lo;
  104. } tDphRateBasedCtr;
  105. typedef struct sDphPhyRates
  106. {
  107. tANI_U8 dataRateX2;
  108. tANI_U8 ackRateX2;
  109. tANI_U8 rtsRateX2;
  110. } tDphPhyRates;
  111. typedef struct sDphIFSValues
  112. {
  113. tANI_U8 sifs;
  114. tANI_U8 pifs;
  115. tANI_U8 difs;
  116. tANI_U8 preamble;
  117. } tDphIFSValues;
  118. typedef struct sDphQosParams
  119. {
  120. tANI_U8 addtsPresent;
  121. tSirAddtsReqInfo addts;
  122. tSirMacQosCapabilityStaIE capability;
  123. } tDphQosParams;
  124. /// Queue attribute structure
  125. typedef struct sDphQueueAttr
  126. {
  127. tANI_U16 valid : 1;
  128. tANI_U16 seqNum : 12;
  129. tANI_U16 ackPolicy : 2;
  130. tANI_U16 rsvd : 1;
  131. } tDphQueueAttr, *tpDphQueueAttr;
  132. typedef struct sCfgTrafficClass {
  133. //Use Block ACK on this STA/TID
  134. // Fields used to store the default TC parameters for this TSPEC.
  135. // They will be used when the TSPEC is deleted.
  136. tANI_U8 fDisableTx:1;
  137. tANI_U8 fDisableRx:1;
  138. tANI_U8 fUseBATx:1;
  139. tANI_U8 fUseBARx:1;
  140. // 1: expect to see frames with compressed BA coming from this peer MAC
  141. tANI_U8 fRxCompBA:1;
  142. tANI_U8 fTxCompBA:1;
  143. // immediate ACK or delayed ACK for frames from this peer MAC
  144. tANI_U8 fRxBApolicy:1;
  145. // immediate ACK or delayed ACK for frames to this peer MAC
  146. tANI_U8 fTxBApolicy:1;
  147. //Initiator or recipient
  148. tANI_U8 role;
  149. //Max # of MSDU received from this STA, negotiated at ADDBA
  150. // used for maintaining block ack state info
  151. tANI_U16 rxBufSize;
  152. //Max # of MSDU send to this STA, negotiated at ADDBA
  153. tANI_U16 txBufSize;
  154. //BA timeout negotiated at ADDBA. Unit: TU
  155. tANI_U16 tuTxBAWaitTimeout; //Time for Tx to wait for BA. 0 means no timeout
  156. tANI_U16 tuRxBAWaitTimeout; //Time for Rx to wait for explicit/implicit BAR. 0 means no timeout
  157. } tCfgTrafficClass;
  158. /// STA state node
  159. typedef struct sDphHashNode
  160. {
  161. //BYTE 0
  162. // HASH ENTRY FIELDS NOT NEEDED IN HAL.
  163. /// This STA valid or not
  164. tANI_U8 valid : 1;
  165. tANI_U8 encPolicy : 3;
  166. tANI_U8 defaultKey : 1;
  167. tANI_U8 defaultKeyId : 2;
  168. tANI_U8 qosMode : 1;
  169. //BYTE 1
  170. tANI_U8 erpEnabled : 1;
  171. tANI_U8 added : 1; // This has been added to the dph hash table
  172. tANI_U8 linkTestOn : 1;
  173. tANI_U8 shortPreambleEnabled : 1;
  174. tANI_U8 shortSlotTimeEnabled : 1;
  175. tANI_U8 stopTx:1;
  176. tANI_U8 wmeEnabled: 1; // set if both ap and sta are wme capable
  177. tANI_U8 lleEnabled: 1; // set if both ap and sta are 11e capable
  178. //BYTE 2
  179. tANI_U8 wsmEnabled: 1; // set if both ap and sta are wsm capable
  180. tANI_U8 versionPresent:1; // station gave version info
  181. tANI_U8 burstEnableForce:1; // allow bursting regardless of qosMode
  182. tANI_U8 staAuthenticated:1;
  183. /// Whether the peer is ANI or not
  184. tANI_U8 aniPeer:1;
  185. tANI_U8 titanPeer:1; // flag to indicate if its a titan peer
  186. tANI_U8 fAniCount:1;
  187. tANI_U8 rmfEnabled:1;
  188. /// Fragmentation size
  189. tANI_U16 fragSize;
  190. /// LIM state
  191. tLimMlmStaContext mlmStaContext;
  192. /// Number of Tim to wait if the STA doesn't respond / fetch data
  193. tANI_U8 timWaitCount;
  194. /// Number of Successfull MPDU's being sent
  195. tANI_U32 curTxMpduCnt;
  196. /// number of consecutive TIMs sent without response
  197. tANI_U8 numTimSent;
  198. // qos parameter info
  199. tDphQosParams qos;
  200. // station version info - valid only if versionPresent is set
  201. tSirMacPropVersion version;
  202. // station proprietary capability
  203. tANI_U16 propCapability;
  204. #ifdef PLM_WDS
  205. tANI_U8 wdsIndex;
  206. tANI_U8 wdsPeerBeaconSeen;
  207. #endif
  208. //Taurus capabilities
  209. tANI_U16 baPolicyFlag; //BA Policy for each TID.
  210. /*
  211. * All the legacy and airgo supported rates.
  212. */
  213. tSirSupportedRates supportedRates;
  214. tANI_U8 htGreenfield:1;
  215. tANI_U8 htShortGI40Mhz:1;
  216. tANI_U8 htShortGI20Mhz:1;
  217. // DSSS/CCK at 40 MHz: Enabled 1 or Disabled
  218. tANI_U8 htDsssCckRate40MHzSupport:1;
  219. // L-SIG TXOP Protection used only if peer support available
  220. tANI_U8 htLsigTXOPProtection:1;
  221. // A-MPDU Density
  222. // 000 - No restriction
  223. // 001 - 1/8 usec
  224. // 010 - 1/4 usec
  225. // 011 - 1/2 usec
  226. // 100 - 1 usec
  227. // 101 - 2 usec
  228. // 110 - 4 usec
  229. // 111 - 8 usec
  230. //
  231. tANI_U8 htAMpduDensity:3;
  232. //Set to 0 for 3839 octets
  233. //Set to 1 for 7935 octets
  234. tANI_U8 htMaxAmsduLength;
  235. // MIMO Power Save
  236. tSirMacHTMIMOPowerSaveState htMIMOPSState;
  237. //
  238. // Maximum Rx A-MPDU factor
  239. tANI_U8 htMaxRxAMpduFactor:2;
  240. //
  241. // Recommended Tx Width Set
  242. // 0 - use 20 MHz channel (control channel)
  243. // 1 - use 40 Mhz channel
  244. //
  245. tANI_U8 htSupportedChannelWidthSet:1;
  246. tANI_U8 htSecondaryChannelOffset:2;
  247. tANI_U8 rsvd1:3;
  248. ///////////////////////////////////////////////////////////////////////
  249. // DPH HASH ENTRY FIELDS NEEDED IN HAL ONLY
  250. ///////////////////////////////////////////////////////////////////////
  251. tANI_U8 dpuSig:4; // DPU signiture
  252. tANI_U8 staSig:4; // STA signature
  253. tANI_U8 staType;
  254. tANI_U16 bssId; // BSSID
  255. tANI_U16 assocId; // Association ID
  256. //This is the real sta index generated by HAL
  257. tANI_U16 staIndex;
  258. tANI_U8 staAddr[6];
  259. /*The DPU signatures will be sent eventually to TL to help it determine the
  260. association to which a packet belongs to*/
  261. /*Unicast DPU signature*/
  262. tANI_U8 ucUcastSig;
  263. /*Broadcast DPU signature*/
  264. tANI_U8 ucBcastSig;
  265. //
  266. // PE needs this info on a per-STA, per-TID basis
  267. // At any point in time, when this data is sampled,
  268. // it gives a measure of:
  269. // a) All the active bA sessions
  270. // b) And the BA configuration itself
  271. //
  272. tCfgTrafficClass tcCfg[STACFG_MAX_TC];
  273. // Block Ack state
  274. // This is used between PE and HAL only.
  275. // can be set to one of the values from the following enum
  276. /*typedef enum eLimBAState
  277. {
  278. eLIM_BA_STATE_IDLE, // we are not waiting for anything from HAL.
  279. eLIM_BA_STATE_WT_ADD_RSP, //We are waiting for Add rsponse from HAL.
  280. eLIM_BA_STATE_WT_DEL_RSP // We are waiting for Del response from HAL.
  281. } tLimBAState; */
  282. //BA state bitmap 2 bits per tid
  283. // BA state for tid i = (baState >> tid*2) & 0x3
  284. tANI_U32 baState;
  285. #ifdef WLAN_FEATURE_11AC
  286. tANI_U8 vhtSupportedChannelWidthSet;
  287. tANI_U8 vhtBeamFormerCapable;
  288. #endif
  289. #ifdef WLAN_FEATURE_11W
  290. tANI_U8 pmfSaQueryState;
  291. tANI_U8 pmfSaQueryRetryCount;
  292. tANI_U16 pmfSaQueryCurrentTransId;
  293. tANI_U16 pmfSaQueryStartTransId;
  294. TX_TIMER pmfSaQueryTimer;
  295. v_TIME_t last_unprot_deauth_disassoc;
  296. tANI_U8 proct_deauh_disassoc_cnt;
  297. v_TIME_t last_assoc_received_time;
  298. #endif
  299. tANI_U8 htLdpcCapable;
  300. tANI_U8 vhtLdpcCapable;
  301. /* key installed for this STA or not in the firmware */
  302. tANI_U8 isKeyInstalled;
  303. /* When a station with already an existing dph entry tries to
  304. * associate again, the old dph entry will be zeroed out except
  305. * for the next pointer. The next pointer must be defined at the
  306. * end of the structure.
  307. */
  308. tANI_U8 isDisassocDeauthInProgress;
  309. struct sDphHashNode *next;
  310. } tDphHashNode, *tpDphHashNode;
  311. #include "dphHashTable.h"
  312. // -------------------------------------------------------------------
  313. // get protection overrides from config variable
  314. // bit0: force cts to self protection for tx to Airgo peers
  315. // bit1: force cts to self protection for tx to non Airgo peers
  316. #define DPH_PROT_OVERRIDE_NONANI_PEER_GET(cfgval) ((cfgval) & 1)
  317. #define DPH_PROT_OVERRIDE_ANI_PEER_GET(cfgval) (((cfgval) & 2) >> 1)
  318. typedef struct sAniSirDph
  319. {
  320. /// The hash table object
  321. dphHashTableClass dphHashTable;
  322. } tAniSirDph, *tpAniSirDph;
  323. #endif