rlm.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm.h#2
  3. */
  4. /*! \file "rlm.h"
  5. \brief
  6. */
  7. /*
  8. ** Log: rlm.h
  9. **
  10. ** 07 12 2013 terry.wu
  11. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  12. ** 1. Update VHT IE composing function
  13. ** 2. disable bow
  14. ** 3. Exchange bss/sta rec update sequence for temp solution
  15. **
  16. ** 01 17 2013 cm.chang
  17. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  18. ** Use ucBssIndex to replace eNetworkTypeIndex
  19. **
  20. ** 11 06 2012 eason.tsai
  21. ** [BORA00002255] [MT6630 Wi-Fi][Driver] develop
  22. ** .
  23. **
  24. ** 09 17 2012 cm.chang
  25. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  26. ** Duplicate source from MT6620 v2.3 driver branch
  27. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  28. *
  29. * 07 17 2012 yuche.tsai
  30. * NULL
  31. * Compile no error before trial run.
  32. *
  33. * 09 30 2011 cm.chang
  34. * [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band
  35. * .
  36. *
  37. * 04 12 2011 cm.chang
  38. * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency
  39. * .
  40. *
  41. * 01 13 2011 cm.chang
  42. * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
  43. * Refine function when rcv a 20/40M public action frame
  44. *
  45. * 01 13 2011 cm.chang
  46. * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
  47. * Use SCO of BSS_INFO to replace user-defined setting variables
  48. *
  49. * 01 12 2011 cm.chang
  50. * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
  51. * User-defined bandwidth is for 2.4G and 5G individually
  52. *
  53. * 12 07 2010 cm.chang
  54. * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk
  55. * 1. BSSINFO include RLM parameter
  56. * 2. free all sta records when network is disconnected
  57. *
  58. * 12 07 2010 cm.chang
  59. * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
  60. * 1. Country code is from NVRAM or supplicant
  61. * 2. Change band definition in CMD/EVENT.
  62. *
  63. * 10 18 2010 cm.chang
  64. * [WCXRP00000114] [MT6620 Wi-Fi] [Driver] Fix compiling warning in Linux about RLM network index checking
  65. * Enum member cannot be used as compiling option decision in Linux
  66. *
  67. * 09 10 2010 cm.chang
  68. * NULL
  69. * Always update Beacon content if FW sync OBSS info
  70. *
  71. * 08 31 2010 kevin.huang
  72. * NULL
  73. * Use LINK LIST operation to process SCAN result
  74. *
  75. * 08 24 2010 cm.chang
  76. * NULL
  77. * Support RLM initail channel of Ad-hoc, P2P and BOW
  78. *
  79. * 08 23 2010 chinghwa.yu
  80. * NULL
  81. * Update for BOW.
  82. *
  83. * 08 20 2010 cm.chang
  84. * NULL
  85. * Migrate RLM code to host from FW
  86. *
  87. * 08 16 2010 cp.wu
  88. * NULL
  89. * Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI.
  90. * There is no CFG_SUPPORT_BOW in driver domain source.
  91. *
  92. * 08 02 2010 yuche.tsai
  93. * NULL
  94. * P2P Group Negotiation Code Check in.
  95. *
  96. * 07 08 2010 cp.wu
  97. *
  98. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  99. *
  100. * 07 08 2010 cm.chang
  101. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  102. * Check draft RLM code for HT cap
  103. *
  104. * 06 28 2010 cm.chang
  105. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  106. * 1st draft code for RLM module
  107. *
  108. * 06 02 2010 cm.chang
  109. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  110. * Add RX HT GF compiling option
  111. *
  112. * 06 02 2010 chinghwa.yu
  113. * [BORA00000563]Add WiFi CoEx BCM module
  114. * Roll back to remove CFG_SUPPORT_BCM_TEST.
  115. *
  116. * 06 01 2010 chinghwa.yu
  117. * [BORA00000563]Add WiFi CoEx BCM module
  118. * Update BCM Test and RW configuration.
  119. *
  120. * 05 31 2010 cm.chang
  121. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  122. * Add some compiling options to control 11n functions
  123. *
  124. * 05 18 2010 cm.chang
  125. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  126. * Ad-hoc Beacon should not carry HT OP and OBSS IEs
  127. *
  128. * 05 17 2010 cm.chang
  129. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  130. * MT6620 does not support L-SIG TXOP
  131. *
  132. * 05 05 2010 cm.chang
  133. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  134. * First draft support for 20/40M bandwidth for AP mode
  135. *
  136. * 04 24 2010 cm.chang
  137. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  138. * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW
  139. *
  140. * 04 22 2010 cm.chang
  141. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  142. * First draft code to support protection in AP mode
  143. *
  144. * 04 07 2010 cm.chang
  145. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  146. * Different invoking order for WTBL entry of associated AP
  147. *
  148. * 03 24 2010 cm.chang
  149. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  150. * Not carry HT cap when being associated with b/g only AP
  151. *
  152. * 03 03 2010 cm.chang
  153. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  154. * Move default value of HT capability to rlm.h
  155. *
  156. * 02 12 2010 cm.chang
  157. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  158. * Use bss info array for concurrent handle
  159. *
  160. * 01 22 2010 cm.chang
  161. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  162. * Support protection and bandwidth switch
  163. *
  164. * 01 08 2010 kevin.huang
  165. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  166. *
  167. * Modify the prototype of rlmRecAssocRspHtInfo()
  168. *
  169. * Dec 9 2009 mtk01104
  170. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  171. * Add several function prototypes for HT operation
  172. *
  173. * Nov 18 2009 mtk01104
  174. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  175. *
  176. *
  177. **
  178. */
  179. #ifndef _RLM_H
  180. #define _RLM_H
  181. /*******************************************************************************
  182. * C O M P I L E R F L A G S
  183. ********************************************************************************
  184. */
  185. /*******************************************************************************
  186. * E X T E R N A L R E F E R E N C E S
  187. ********************************************************************************
  188. */
  189. extern BOOLEAN g_bIcapEnable;
  190. extern BOOLEAN g_bCaptureDone;
  191. extern UINT_16 g_u2DumpIndex;
  192. /*******************************************************************************
  193. * C O N S T A N T S
  194. ********************************************************************************
  195. */
  196. #define ELEM_EXT_CAP_DEFAULT_VAL \
  197. (ELEM_EXT_CAP_20_40_COEXIST_SUPPORT /*| ELEM_EXT_CAP_PSMP_CAP*/)
  198. #if CFG_SUPPORT_RX_STBC
  199. #define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_1_SS
  200. #else
  201. #define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_NO_SUPPORTED
  202. #endif
  203. #if CFG_SUPPORT_RX_SGI
  204. #define FIELD_HT_CAP_INFO_SGI_20M HT_CAP_INFO_SHORT_GI_20M
  205. #define FIELD_HT_CAP_INFO_SGI_40M HT_CAP_INFO_SHORT_GI_40M
  206. #else
  207. #define FIELD_HT_CAP_INFO_SGI_20M 0
  208. #define FIELD_HT_CAP_INFO_SGI_40M 0
  209. #endif
  210. #if CFG_SUPPORT_RX_HT_GF
  211. #define FIELD_HT_CAP_INFO_HT_GF HT_CAP_INFO_HT_GF
  212. #else
  213. #define FIELD_HT_CAP_INFO_HT_GF 0
  214. #endif
  215. #define HT_CAP_INFO_DEFAULT_VAL \
  216. (HT_CAP_INFO_SUP_CHNL_WIDTH | HT_CAP_INFO_DSSS_CCK_IN_40M)
  217. #define AMPDU_PARAM_DEFAULT_VAL \
  218. (AMPDU_PARAM_MAX_AMPDU_LEN_64K | AMPDU_PARAM_MSS_NO_RESTRICIT)
  219. #define SUP_MCS_TX_DEFAULT_VAL \
  220. SUP_MCS_TX_SET_DEFINED /* TX defined and TX/RX equal (TBD) */
  221. #if CFG_SUPPORT_MFB
  222. #define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_BOTH
  223. #else
  224. #define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_NO_FB
  225. #endif
  226. #if CFG_SUPPORT_RX_RDG
  227. #define FIELD_HT_EXT_CAP_RDR HT_EXT_CAP_RD_RESPONDER
  228. #else
  229. #define FIELD_HT_EXT_CAP_RDR 0
  230. #endif
  231. #if CFG_SUPPORT_MFB || CFG_SUPPORT_RX_RDG
  232. #define FIELD_HT_EXT_CAP_HTC HT_EXT_CAP_HTC_SUPPORT
  233. #else
  234. #define FIELD_HT_EXT_CAP_HTC 0
  235. #endif
  236. #define HT_EXT_CAP_DEFAULT_VAL \
  237. (HT_EXT_CAP_PCO | HT_EXT_CAP_PCO_TRANS_TIME_NONE | \
  238. FIELD_HT_EXT_CAP_MFB | FIELD_HT_EXT_CAP_HTC | \
  239. FIELD_HT_EXT_CAP_RDR)
  240. #define TX_BEAMFORMING_CAP_DEFAULT_VAL 0
  241. #if CFG_SUPPORT_BFEE
  242. #define TX_BEAMFORMING_CAP_BFEE \
  243. (TXBF_RX_NDP_CAPABLE | \
  244. TXBF_EXPLICIT_COMPRESSED_FEEDBACK_IMMEDIATE_CAPABLE | \
  245. TXBF_MINIMAL_GROUPING_1_2_3_CAPABLE | \
  246. TXBF_COMPRESSED_TX_ANTENNANUM_4_SUPPORTED | \
  247. TXBF_CHANNEL_ESTIMATION_4STS_CAPABILITY)
  248. #else
  249. #define TX_BEAMFORMING_CAP_BFEE 0
  250. #endif
  251. #define ASEL_CAP_DEFAULT_VAL 0
  252. /* Define bandwidth from user setting */
  253. #define CONFIG_BW_20_40M 0
  254. #define CONFIG_BW_20M 1 /* 20MHz only */
  255. #if CFG_SUPPORT_802_11AC
  256. #if CFG_SUPPORT_BFEE
  257. #define FIELD_VHT_CAP_INFO_BF \
  258. (VHT_CAP_INFO_SU_BEAMFORMEE_CAPABLE | \
  259. VHT_CAP_INFO_COMPRESSED_STEERING_NUMBER_OF_BEAMFORMER_ANTENNAS_4_SUPPOERTED | \
  260. VHT_CAP_INFO_MU_BEAMFOMEE_CAPABLE)
  261. #else
  262. #define FIELD_VHT_CAP_INFO_BF 0
  263. #endif
  264. #define VHT_CAP_INFO_DEFAULT_VAL \
  265. (VHT_CAP_INFO_MAX_MPDU_LEN_3K | \
  266. (AMPDU_PARAM_MAX_AMPDU_LEN_1024K << VHT_CAP_INFO_MAX_AMPDU_LENGTH_OFFSET))
  267. #define VHT_CAP_INFO_DEFAULT_HIGHEST_DATA_RATE 0
  268. #endif
  269. /*******************************************************************************
  270. * D A T A T Y P E S
  271. ********************************************************************************
  272. */
  273. /*******************************************************************************
  274. * P U B L I C D A T A
  275. ********************************************************************************
  276. */
  277. /*******************************************************************************
  278. * P R I V A T E D A T A
  279. ********************************************************************************
  280. */
  281. /*******************************************************************************
  282. * M A C R O S
  283. ********************************************************************************
  284. */
  285. /* It is used for RLM module to judge if specific network is valid
  286. * Note: Ad-hoc mode of AIS is not included now. (TBD)
  287. */
  288. #define RLM_NET_PARAM_VALID(_prBssInfo) \
  289. (IS_BSS_ACTIVE(_prBssInfo) && \
  290. ((_prBssInfo)->eConnectionState == PARAM_MEDIA_STATE_CONNECTED || \
  291. (_prBssInfo)->eCurrentOPMode == OP_MODE_ACCESS_POINT || \
  292. (_prBssInfo)->eCurrentOPMode == OP_MODE_IBSS || \
  293. IS_BSS_BOW(_prBssInfo)) \
  294. )
  295. #define RLM_NET_IS_11N(_prBssInfo) \
  296. ((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11N)
  297. #define RLM_NET_IS_11GN(_prBssInfo) \
  298. ((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11GN)
  299. #if CFG_SUPPORT_802_11AC
  300. #define RLM_NET_IS_11AC(_prBssInfo) \
  301. ((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11AC)
  302. #endif
  303. /* The bandwidth modes are not used anymore. They represent if AP
  304. * can use 20/40 bandwidth, not all modes. (20110411)
  305. */
  306. #define RLM_AP_IS_BW_40_ALLOWED(_prAdapter, _prBssInfo) \
  307. (((_prBssInfo)->eBand == BAND_2G4 && \
  308. (_prAdapter)->rWifiVar.rConnSettings.uc2G4BandwidthMode \
  309. == CONFIG_BW_20_40M) || \
  310. ((_prBssInfo)->eBand == BAND_5G && \
  311. (_prAdapter)->rWifiVar.rConnSettings.uc5GBandwidthMode \
  312. == CONFIG_BW_20_40M))
  313. /*******************************************************************************
  314. * F U N C T I O N D E C L A R A T I O N S
  315. ********************************************************************************
  316. */
  317. VOID rlmFsmEventInit(P_ADAPTER_T prAdapter);
  318. VOID rlmFsmEventUninit(P_ADAPTER_T prAdapter);
  319. VOID rlmReqGenerateHtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  320. VOID rlmReqGenerateExtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  321. VOID rlmRspGenerateHtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  322. VOID rlmRspGenerateExtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  323. VOID rlmRspGenerateHtOpIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  324. VOID rlmRspGenerateErpIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  325. VOID rlmGenerateMTKOuiIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  326. BOOLEAN rlmParseCheckMTKOuiIE(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBuf, IN PUINT_32 pu4Cap);
  327. VOID rlmProcessBcn(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, PUINT_8 pucIE, UINT_16 u2IELength);
  328. VOID rlmProcessAssocRsp(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, PUINT_8 pucIE, UINT_16 u2IELength);
  329. VOID rlmFillSyncCmdParam(P_CMD_SET_BSS_RLM_PARAM_T prCmdBody, P_BSS_INFO_T prBssInfo);
  330. VOID rlmSyncOperationParams(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
  331. VOID rlmBssInitForAPandIbss(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
  332. VOID rlmProcessAssocReq(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, PUINT_8 pucIE, UINT_16 u2IELength);
  333. VOID rlmBssAborted(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
  334. #if CFG_SUPPORT_TDLS
  335. UINT_32
  336. rlmFillHtCapIEByParams(BOOLEAN fg40mAllowed,
  337. BOOLEAN fgShortGIDisabled,
  338. UINT_8 u8SupportRxSgi20,
  339. UINT_8 u8SupportRxSgi40, UINT_8 u8SupportRxGf, ENUM_OP_MODE_T eCurrentOPMode, UINT_8 *pOutBuf);
  340. UINT_32 rlmFillHtCapIEByAdapter(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, UINT_8 *pOutBuf);
  341. UINT_32 rlmFillVhtCapIEByAdapter(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, UINT_8 *pOutBuf);
  342. #endif
  343. #if CFG_SUPPORT_802_11AC
  344. VOID rlmReqGenerateVhtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  345. VOID rlmRspGenerateVhtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  346. VOID rlmRspGenerateVhtOpIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  347. VOID rlmFillVhtOpIE(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, P_MSDU_INFO_T prMsduInfo);
  348. #endif
  349. #if CFG_SUPPORT_DFS
  350. VOID rlmProcessSpecMgtAction(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
  351. VOID
  352. rlmSendOpModeNotificationFrame(P_ADAPTER_T prAdapter, P_STA_RECORD_T prStaRec, UINT_8 ucChannelWidth, UINT_8 ucNss);
  353. #endif
  354. /*******************************************************************************
  355. * F U N C T I O N S
  356. ********************************************************************************
  357. */
  358. #ifndef _lint
  359. static __KAL_INLINE__ VOID rlmDataTypeCheck(VOID)
  360. {
  361. }
  362. #endif /* _lint */
  363. #endif /* _RLM_H */