hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
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
/** @file */
/******************************************************************************
 *
 * Copyright(c) 2019 Realtek Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 ******************************************************************************/
 
#ifndef _MAC_AX_TRXCFG_H_
#define _MAC_AX_TRXCFG_H_
 
#include "../type.h"
#include "hw.h"
#include "init.h"
#include "role.h"
#include "cmac_tx.h"
#include "rx_filter.h"
#include "dle.h"
#include "hci_fc.h"
#include "mport.h"
#include "spatial_reuse.h"
 
/*--------------------Define -------------------------------------------*/
#define TRXCFG_WAIT_CNT        2000
#define TRXCFG_WAIT_US        1
 
/* MPDU Processor Control */
#define TRXCFG_MPDU_PROC_ACT_FRWD    0x02A95A95
#define TRXCFG_MPDU_PROC_TF_FRWD    0x0000AA55
#define TRXCFG_MPDU_PROC_CUT_CTRL    0x010E05F0
 
/* RMAC timeout control */
#if (MAC_AX_8852C_SUPPORT) && defined(PHL_FEATURE_AP)
#define TRXCFG_RMAC_CCA_TO    128
#else
#define TRXCFG_RMAC_CCA_TO    32
#endif
#define TRXCFG_RMAC_DATA_TO    15
 
#define S_AX_TXSC_20M_0        0
#define S_AX_TXSC_20M_4        4
#define S_AX_TXSC_40M_0        0
#define S_AX_TXSC_40M_4        4
#define S_AX_TXSC_80M_0        0
#define S_AX_TXSC_80M_4        4
 
#define RRSR_OFDM_CCK_EN    3
 
/* TRXPTCL SIFS TIME*/
#define WMAC_SPEC_SIFS_OFDM_52A 0x15
#define WMAC_SPEC_SIFS_OFDM_52B 0x11
#define WMAC_SPEC_SIFS_OFDM_52C 0x11
#define WMAC_SPEC_SIFS_OFDM_51B 0x11
#define WMAC_SPEC_SIFS_OFDM_52BT 0x11
#define WMAC_SPEC_SIFS_CCK     0xA
 
/* RRSR disable 5.5M CCK*/
#define WMAC_CCK_EN_1M 0x1
#define WMAC_RRSR_RATE_LEGACY_EN 0x1
 
/* SRAM fifo address */
#define CMAC_TBL_BASE_ADDR    0x18840000
 
#define CMAC1_START_ADDR    0xE000
#define CMAC1_END_ADDR        0xFFFF
 
#if MAC_AX_ASIC_TEMP
#define R_AX_LTECOEX_CTRL 0x38
#define R_AX_LTECOEX_CTRL_2 0x3C
#endif
 
#define S_AX_CTS2S_TH_1K 4
#define S_AX_CTS2S_TH_SEC_256B 1
 
#define S_AX_PTCL_TO_2MS 0x3F
 
#define LBK_PLCP_DLY_DEF 0x28
#define LBK_PLCP_DLY_FPGA 0x46
 
#define PLD_RLS_MAX_PG 127
#define RX_MAX_LEN_UNIT 512
/* if spec max len is not align to rx max len unit, add 1 unit */
#define RX_SPEC_MAX_LEN (11454 + RX_MAX_LEN_UNIT)
 
#define SCH_PREBKF_24US 0x18
#define SCH_PREBKF_16US 0x10
 
#define BCN_IFS_25US 0x19
#define SIFS_MACTXEN_T1_V0 0x47
#define SIFS_MACTXEN_T1_V1 0x40
#define SIFS_MACTXEN_T1_V2 0x3E
 
#define SDIO_DRV_INFO_SIZE 2
 
#define DMA_MOD_PCIE_1B 0x0
#define DMA_MOD_PCIE_4B 0x1
#define DMA_MOD_USB 0x2
#define DMA_MOD_SDIO 0x3
 
#define  NAV_12MS 0x5D // (12ms, unit: 128us)
#define  NAV_25MS 0xC4 // (25ms, unit: 128us)
 
#define FWD_TO_HOST 0
#define FWD_TO_WLCPU 1
#define FWD_TO_DATACPU 2
 
#define AMPDU_MAX_LEN_VHT_262K 0x3FF80
#define SS2F_PATH_WLCPU 0x0A
 
#define NAV_UPPER_DEFAULT 0
 
#define TCR_UDF_THSD          0x6
#define TXDFIFO_HIGH_MCS_THRE 0x7
#define TXDFIFO_LOW_MCS_THRE  0x7
 
#define B_AX_TX_TO  0x2
#define DRVINFO_PATCH_SIZE  0x5
 
/* response reference rate */
#define REF2RXRATEANDCCTBL    0
#define REF2RXRATEONLY        1
 
/*The number of STA in UL SS2FRPT*/
#define MAX_ULSS2F_SU_STA_NUM 0x3
#define MAX_ULSS2F_TWT_STA_NUM 0x3
#define MAX_ULSS2F_RU_STA_NUM 0x3
 
/*The number of STA in DL SS2FRPT*/
#define MAX_DLSS2F_SU_STA_NUM 0xF
#define MAX_DLSS2F_MU_STA_NUM 0xF
#define MAX_DLSS2F_RU_STA_NUM 0xF
 
/*The bsr len threshold of UL SS2FRPT*/
#define UL_NORMAL_SS2FWRPT_BSR_THRES 0x50
#define UL_LATCY_SS2FWRPT_BSR_THRES 0x1
 
/*--------------------Define MACRO--------------------------------------*/
#define RX_FULL_MODE (B_AX_RU0_PTR_FULL_MODE | B_AX_RU1_PTR_FULL_MODE | \
             B_AX_RU2_PTR_FULL_MODE | B_AX_RU3_PTR_FULL_MODE | \
             B_AX_CSI_PTR_FULL_MODE | B_AX_RXSTS_PTR_FULL_MODE)
 
/*--------------------Define Enum---------------------------------------*/
/*--------------------Define Struct-------------------------------------*/
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_Config
 * @{
 */
 
/**
 * @brief mac_enable_imr
 *
 * @param *adapter
 * @param band
 * @param sel
 * @return Please Place Description here.
 * @retval u32
 */
u32 mac_enable_imr(struct mac_ax_adapter *adapter, u8 band,
          enum mac_ax_hwmod_sel sel);
 
u32 ser_imr_config(struct mac_ax_adapter *adapter, u8 band,
          enum mac_ax_hwmod_sel sel);
 
/**
 * @}
 * @}
 */
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_Config
 * @{
 */
 
/**
 * @brief check_mac_en
 *
 * @param *adapter
 * @param band
 * @param sel
 * @return Please Place Description here.
 * @retval u32
 */
u32 check_mac_en(struct mac_ax_adapter *adapter, u8 band,
        enum mac_ax_hwmod_sel sel);
/**
 * @}
 * @}
 */
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_Config
 * @{
 */
 
/**
 * @brief mac_check_access
 *
 * @param *adapter
 * @param offset
 * @return Please Place Description here.
 * @retval u32
 */
u32 mac_check_access(struct mac_ax_adapter *adapter, u32 offset);
/**
 * @}
 * @}
 */
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_Config
 * @{
 */
 
/**
 * @brief cmac_init
 *
 * @param *adapter
 * @param *info
 * @param band
 * @return Please Place Description here.
 * @retval u32
 */
u32 cmac_init(struct mac_ax_adapter *adapter, struct mac_ax_trx_info *info,
         enum mac_ax_band band);
/**
 * @}
 * @}
 */
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_Config
 * @{
 */
 
/**
 * @brief mac_trx_init
 *
 * @param *adapter
 * @param *info
 * @return Please Place Description here.
 * @retval u32
 */
u32 mac_trx_init(struct mac_ax_adapter *adapter, struct mac_ax_trx_info *info);
/**
 * @}
 * @}
 */
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_Config
 * @{
 */
 
/**
 * @brief mac_tx_mode_sel
 *
 * @param *adapter
 * @param *mode_sel
 * @return Please Place Description here.
 * @retval u32
 */
u32 mac_tx_mode_sel(struct mac_ax_adapter *adapter,
           struct mac_ax_mac_tx_mode_sel *mode_sel);
/**
 * @}
 * @}
 */
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_Config
 * @{
 */
 
/**
 * @brief mac_two_nav_cfg
 *
 * @param *adapter
 * @param *info
 * @return Please Place Description here.
 * @retval u32
 */
u32 mac_two_nav_cfg(struct mac_ax_adapter *adapter,
           struct mac_ax_2nav_info *info);
/**
 * @}
 * @}
 *
 *//**
 * @brief mac_sifs_chk_edcca_en
 *
 * @param *adapter
 * @param *band
 * @param *en
 * @return check cca in sifs enable/disable
 * @retval u32
 */
u32 mac_sifs_chk_cca_en(struct mac_ax_adapter *adapter, u8 band, u8 en);
/**
 * @}
 * @}
 */
 
/**
 * @}
 * @}
 *
 *//**
 * @brief _patch_rsp_ack
 *
 * @param *adapter
 * @param *band
 * @param *en
 * @return check cca in sifs enable/disable
 * @retval u32
 */
u32 _patch_rsp_ack(struct mac_ax_adapter *adapter,
          struct mac_ax_resp_chk_cca *cfg);
/**
 * @}
 * @}
 */
/**
 * @brief chk_patch_ss2f_path
 *
 * @param *adapter
 * @return Please Place Description here.
 * @retval bool
 */
bool chk_patch_ss2f_path(struct mac_ax_adapter *adapter);
 
/**
 * @brief mac_feat_init
 *
 * @param *adapter
 * @return Please Place Description here.
 * @retval bool
 */
u32 mac_feat_init(struct mac_ax_adapter *adapter, struct mac_ax_trx_info *info);
 
#endif