2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm.h#2 $
14 * 07 17 2012 yuche.tsai
16 * Compile no error before trial run.
19 * [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band
23 * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency
27 * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
28 * Refine function when rcv a 20/40M public action frame
31 * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
32 * Use SCO of BSS_INFO to replace user-defined setting variables
35 * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
36 * User-defined bandwidth is for 2.4G and 5G individually
39 * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk
40 * 1. BSSINFO include RLM parameter
41 * 2. free all sta records when network is disconnected
44 * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
45 * 1. Country code is from NVRAM or supplicant
46 * 2. Change band definition in CMD/EVENT.
49 * [WCXRP00000114] [MT6620 Wi-Fi] [Driver] Fix compiling warning in Linux about RLM network index checking
50 * Enum member cannot be used as compiling option decision in Linux
54 * Always update Beacon content if FW sync OBSS info
56 * 08 31 2010 kevin.huang
58 * Use LINK LIST operation to process SCAN result
62 * Support RLM initail channel of Ad-hoc, P2P and BOW
64 * 08 23 2010 chinghwa.yu
70 * Migrate RLM code to host from FW
74 * Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI.
75 * There is no CFG_SUPPORT_BOW in driver domain source.
77 * 08 02 2010 yuche.tsai
79 * P2P Group Negotiation Code Check in.
83 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
86 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
87 * Check draft RLM code for HT cap
90 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
91 * 1st draft code for RLM module
94 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
95 * Add RX HT GF compiling option
97 * 06 02 2010 chinghwa.yu
98 * [BORA00000563]Add WiFi CoEx BCM module
99 * Roll back to remove CFG_SUPPORT_BCM_TEST.
101 * 06 01 2010 chinghwa.yu
102 * [BORA00000563]Add WiFi CoEx BCM module
103 * Update BCM Test and RW configuration.
105 * 05 31 2010 cm.chang
106 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
107 * Add some compiling options to control 11n functions
109 * 05 18 2010 cm.chang
110 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
111 * Ad-hoc Beacon should not carry HT OP and OBSS IEs
113 * 05 17 2010 cm.chang
114 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
115 * MT6620 does not support L-SIG TXOP
117 * 05 05 2010 cm.chang
118 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
119 * First draft support for 20/40M bandwidth for AP mode
121 * 04 24 2010 cm.chang
122 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
123 * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW
125 * 04 22 2010 cm.chang
126 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
127 * First draft code to support protection in AP mode
129 * 04 07 2010 cm.chang
130 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
131 * Different invoking order for WTBL entry of associated AP
133 * 03 24 2010 cm.chang
134 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
135 * Not carry HT cap when being associated with b/g only AP
137 * 03 03 2010 cm.chang
138 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
139 * Move default value of HT capability to rlm.h
141 * 02 12 2010 cm.chang
142 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
143 * Use bss info array for concurrent handle
145 * 01 22 2010 cm.chang
146 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
147 * Support protection and bandwidth switch
149 * 01 08 2010 kevin.huang
150 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
152 * Modify the prototype of rlmRecAssocRspHtInfo()
154 * Dec 9 2009 mtk01104
155 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
156 * Add several function prototypes for HT operation
158 * Nov 18 2009 mtk01104
159 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
168 /*******************************************************************************
169 * C O M P I L E R F L A G S
170 ********************************************************************************
173 /*******************************************************************************
174 * E X T E R N A L R E F E R E N C E S
175 ********************************************************************************
178 /*******************************************************************************
180 ********************************************************************************
182 #define ELEM_EXT_CAP_DEFAULT_VAL \
183 (ELEM_EXT_CAP_20_40_COEXIST_SUPPORT /*| ELEM_EXT_CAP_PSMP_CAP*/)
186 #if CFG_SUPPORT_RX_STBC
187 #define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_1_SS
189 #define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_NO_SUPPORTED
192 #if CFG_SUPPORT_RX_SGI
193 #define FIELD_HT_CAP_INFO_SGI_20M HT_CAP_INFO_SHORT_GI_20M
194 #define FIELD_HT_CAP_INFO_SGI_40M HT_CAP_INFO_SHORT_GI_40M
196 #define FIELD_HT_CAP_INFO_SGI_20M 0
197 #define FIELD_HT_CAP_INFO_SGI_40M 0
200 #if CFG_SUPPORT_RX_HT_GF
201 #define FIELD_HT_CAP_INFO_HT_GF HT_CAP_INFO_HT_GF
203 #define FIELD_HT_CAP_INFO_HT_GF 0
206 #define HT_CAP_INFO_DEFAULT_VAL \
207 (HT_CAP_INFO_SUP_CHNL_WIDTH | FIELD_HT_CAP_INFO_HT_GF | \
208 FIELD_HT_CAP_INFO_SGI_20M | FIELD_HT_CAP_INFO_SGI_40M | \
209 FIELD_HT_CAP_INFO_RX_STBC | HT_CAP_INFO_DSSS_CCK_IN_40M)
213 #define AMPDU_PARAM_DEFAULT_VAL \
214 (AMPDU_PARAM_MAX_AMPDU_LEN_64K | AMPDU_PARAM_MSS_NO_RESTRICIT)
217 #define SUP_MCS_TX_DEFAULT_VAL \
218 SUP_MCS_TX_SET_DEFINED /* TX defined and TX/RX equal (TBD) */
221 #define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_BOTH
223 #define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_NO_FB
226 #if CFG_SUPPORT_RX_RDG
227 #define FIELD_HT_EXT_CAP_RDR HT_EXT_CAP_RD_RESPONDER
229 #define FIELD_HT_EXT_CAP_RDR 0
232 #if CFG_SUPPORT_MFB || CFG_SUPPORT_RX_RDG
233 #define FIELD_HT_EXT_CAP_HTC HT_EXT_CAP_HTC_SUPPORT
235 #define FIELD_HT_EXT_CAP_HTC 0
238 #define HT_EXT_CAP_DEFAULT_VAL \
239 (HT_EXT_CAP_PCO | HT_EXT_CAP_PCO_TRANS_TIME_NONE | \
240 FIELD_HT_EXT_CAP_MFB | FIELD_HT_EXT_CAP_HTC | \
241 FIELD_HT_EXT_CAP_RDR)
243 #define TX_BEAMFORMING_CAP_DEFAULT_VAL 0
244 #define ASEL_CAP_DEFAULT_VAL 0
247 /* Define bandwidth from user setting */
248 #define CONFIG_BW_20_40M 0
249 #define CONFIG_BW_20M 1 /* 20MHz only */
251 /*******************************************************************************
253 ********************************************************************************
256 /*******************************************************************************
257 * P U B L I C D A T A
258 ********************************************************************************
261 /*******************************************************************************
262 * P R I V A T E D A T A
263 ********************************************************************************
266 /*******************************************************************************
268 ********************************************************************************
271 /* It is used for RLM module to judge if specific network is valid
272 * Note: Ad-hoc mode of AIS is not included now. (TBD)
274 #define RLM_NET_PARAM_VALID(_prBssInfo) \
275 (IS_BSS_ACTIVE(_prBssInfo) && \
276 ((_prBssInfo)->eConnectionState == PARAM_MEDIA_STATE_CONNECTED || \
277 (_prBssInfo)->eCurrentOPMode == OP_MODE_ACCESS_POINT || \
278 (_prBssInfo)->eCurrentOPMode == OP_MODE_IBSS || \
279 RLM_NET_IS_BOW(_prBssInfo)) \
282 #define RLM_NET_IS_11N(_prBssInfo) \
283 ((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11N)
284 #define RLM_NET_IS_11GN(_prBssInfo) \
285 ((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11GN)
288 /* This macro is used to sweep all 3 networks */
289 #define RLM_NET_FOR_EACH(_ucNetIdx) \
290 for ((_ucNetIdx) = 0; \
291 (_ucNetIdx) < NETWORK_TYPE_INDEX_NUM; \
294 /* This macro is used to sweep all networks excluding BOW */
295 #if CFG_ENABLE_BT_OVER_WIFI
296 /* Note: value of enum NETWORK_TYPE_BOW_INDEX is validated in
297 * rlmStuctureCheck().
299 #define RLM_NET_FOR_EACH_NO_BOW(_ucNetIdx) \
300 for ((_ucNetIdx) = 0; \
301 (_ucNetIdx) < NETWORK_TYPE_BOW_INDEX; \
304 #define RLM_NET_IS_BOW(_prBssInfo) \
305 ((_prBssInfo)->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX)
308 #define RLM_NET_FOR_EACH_NO_BOW(_ucNetIdx) RLM_NET_FOR_EACH(_ucNetIdx)
309 #define RLM_NET_IS_BOW(_prBssInfo) (FALSE)
311 #endif /* end of CFG_ENABLE_BT_OVER_WIFI */
314 /* The bandwidth modes are not used anymore. They represent if AP
315 * can use 20/40 bandwidth, not all modes. (20110411)
317 #define RLM_AP_IS_BW_40_ALLOWED(_prAdapter, _prBssInfo) \
318 (((_prBssInfo)->eBand == BAND_2G4 && \
319 (_prAdapter)->rWifiVar.rConnSettings.uc2G4BandwidthMode \
320 == CONFIG_BW_20_40M) || \
321 ((_prBssInfo)->eBand == BAND_5G && \
322 (_prAdapter)->rWifiVar.rConnSettings.uc5GBandwidthMode \
323 == CONFIG_BW_20_40M))
325 /*******************************************************************************
326 * F U N C T I O N D E C L A R A T I O N S
327 ********************************************************************************
331 P_ADAPTER_T prAdapter
336 P_ADAPTER_T prAdapter
340 rlmReqGenerateHtCapIE (
341 P_ADAPTER_T prAdapter,
342 P_MSDU_INFO_T prMsduInfo
346 rlmReqGenerateExtCapIE (
347 P_ADAPTER_T prAdapter,
348 P_MSDU_INFO_T prMsduInfo
352 rlmRspGenerateHtCapIE (
353 P_ADAPTER_T prAdapter,
354 P_MSDU_INFO_T prMsduInfo
358 rlmRspGenerateExtCapIE (
359 P_ADAPTER_T prAdapter,
360 P_MSDU_INFO_T prMsduInfo
364 rlmRspGenerateHtOpIE (
365 P_ADAPTER_T prAdapter,
366 P_MSDU_INFO_T prMsduInfo
370 rlmRspGenerateErpIE (
371 P_ADAPTER_T prAdapter,
372 P_MSDU_INFO_T prMsduInfo
377 P_ADAPTER_T prAdapter,
385 P_ADAPTER_T prAdapter,
392 rlmFillSyncCmdParam (
393 P_CMD_SET_BSS_RLM_PARAM_T prCmdBody,
394 P_BSS_INFO_T prBssInfo
398 rlmSyncOperationParams (
399 P_ADAPTER_T prAdapter,
400 P_BSS_INFO_T prBssInfo
404 rlmBssInitForAPandIbss (
405 P_ADAPTER_T prAdapter,
406 P_BSS_INFO_T prBssInfo
411 P_ADAPTER_T prAdapter,
419 P_ADAPTER_T prAdapter,
420 P_BSS_INFO_T prBssInfo
424 /*******************************************************************************
426 ********************************************************************************
435 #if CFG_ENABLE_BT_OVER_WIFI
436 DATA_STRUC_INSPECTING_ASSERT(
437 NETWORK_TYPE_AIS_INDEX < NETWORK_TYPE_BOW_INDEX);
439 #if CFG_ENABLE_WIFI_DIRECT
440 DATA_STRUC_INSPECTING_ASSERT(
441 NETWORK_TYPE_P2P_INDEX < NETWORK_TYPE_BOW_INDEX);