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