1 /******************************************************************************
2 *
3 * Copyright(c) 2019 Realtek Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 *****************************************************************************/
15 #define _HAL_API_BB_C_
16 #include "hal_headers.h"
17 #include "phy/bb/halbb_export_fun.h"
18
19 //kevin-cmd
20 #include "phy/bb/halbb_hw_cfg_ex.h"
21
22 #ifdef USE_TRUE_PHY
rtw_hal_bb_band_to_phy_idx(struct rtw_hal_com_t * hal_com,u8 band_idx)23 enum phl_phy_idx rtw_hal_bb_band_to_phy_idx(struct rtw_hal_com_t *hal_com, u8 band_idx)
24 {
25 enum phl_phy_idx p_idx = HW_PHY_0;
26
27 if (band_idx == 1)
28 p_idx = HW_PHY_1;
29
30 return p_idx;
31 }
32
rtw_hal_bb_dfs_en(struct hal_info_t * hal_info,bool en)33 void rtw_hal_bb_dfs_en(struct hal_info_t *hal_info, bool en)
34 {
35 halbb_dfs_en(hal_info->bb, en);
36 }
37
rtw_hal_bb_tssi_cont_en(struct hal_info_t * hal_info,bool en,enum rf_path path)38 void rtw_hal_bb_tssi_cont_en(struct hal_info_t *hal_info, bool en, enum rf_path path)
39 {
40 halbb_tssi_cont_en(hal_info->bb, en, path);
41 }
42
rtw_hal_bb_adc_en(struct hal_info_t * hal_info,bool en)43 void rtw_hal_bb_adc_en(struct hal_info_t *hal_info, bool en)
44 {
45 halbb_adc_en(hal_info->bb, en);
46 }
47
rtw_hal_bb_reset_en(struct hal_info_t * hal_info,bool en,enum phl_phy_idx phy_idx)48 void rtw_hal_bb_reset_en(struct hal_info_t *hal_info, bool en, enum phl_phy_idx phy_idx)
49 {
50 halbb_bb_reset_en(hal_info->bb, en, phy_idx);
51 }
52
rtw_hal_bb_proc_cmd(struct hal_info_t * hal_info,struct rtw_proc_cmd * incmd,char * output,u32 out_len)53 bool rtw_hal_bb_proc_cmd(struct hal_info_t *hal_info, struct rtw_proc_cmd *incmd,
54 char *output, u32 out_len)
55 {
56 if(incmd->in_type == RTW_ARG_TYPE_BUF)
57 halbb_cmd(hal_info->bb, incmd->in.buf, output, out_len);
58 else if(incmd->in_type == RTW_ARG_TYPE_ARRAY){
59 halbb_cmd_parser(hal_info->bb, incmd->in.vector,
60 incmd->in_cnt_len, output, out_len);
61 }
62
63 return true;
64 }
65
rtw_hal_bb_watchdog(struct hal_info_t * hal_info,u8 is_lps)66 enum rtw_hal_status rtw_hal_bb_watchdog(struct hal_info_t *hal_info, u8 is_lps)
67 {
68 enum bb_watchdog_mode_t mode = BB_WATCHDOG_NORMAL;
69
70 if (is_lps)
71 mode = BB_WATCHDOG_LOW_IO;
72
73 halbb_watchdog(hal_info->bb, mode, HW_PHY_0);
74
75 return RTW_HAL_STATUS_SUCCESS;
76 }
77
rtw_hal_bb_simple_watchdog(struct hal_info_t * hal_info,u8 io_en)78 enum rtw_hal_status rtw_hal_bb_simple_watchdog(struct hal_info_t *hal_info, u8 io_en)
79 {
80 enum bb_watchdog_mode_t mode = BB_WATCHDOG_NON_IO;
81
82 if (io_en)
83 mode = BB_WATCHDOG_LOW_IO;
84
85 halbb_watchdog(hal_info->bb, mode, HW_PHY_0);
86
87 return RTW_HAL_STATUS_SUCCESS;
88 }
89
rtw_hal_bb_reset(struct hal_info_t * hal_info)90 void rtw_hal_bb_reset(struct hal_info_t *hal_info)
91 {
92 halbb_watchdog_reset(hal_info->bb);
93 }
94
rtw_hal_bb_fw_edcca(struct hal_info_t * hal_info)95 void rtw_hal_bb_fw_edcca(struct hal_info_t *hal_info)
96 {
97 PHL_INFO("[Cert], %s() ==> !! \n", __func__);
98
99 halbb_fw_edcca(hal_info->bb);
100 }
101
rtw_hal_bb_dm_init(struct hal_info_t * hal_info)102 void rtw_hal_bb_dm_init(struct hal_info_t *hal_info)
103 {
104 halbb_dm_init(hal_info->bb, HW_PHY_0);
105 }
106
rtw_hal_bb_dm_deinit(struct rtw_phl_com_t * phl_com,struct hal_info_t * hal_info)107 void rtw_hal_bb_dm_deinit(struct rtw_phl_com_t *phl_com, struct hal_info_t *hal_info)
108 {
109 halbb_dm_deinit(phl_com, hal_info->bb);
110 }
111
rtw_hal_bb_ctrl_rx_cca(struct rtw_hal_com_t * hal_com,bool cca_en,enum phl_phy_idx phy_idx)112 enum rtw_hal_status rtw_hal_bb_ctrl_rx_cca(struct rtw_hal_com_t *hal_com,
113 bool cca_en, enum phl_phy_idx phy_idx)
114 {
115 struct hal_info_t *hal = (struct hal_info_t *)hal_com->hal_priv;
116
117 halbb_ctrl_rx_cca(hal->bb, cca_en, phy_idx);
118
119 return RTW_HAL_STATUS_SUCCESS;
120 }
121
rtw_hal_bb_ctrl_dbcc(struct hal_info_t * hal_info,bool dbcc_en)122 enum rtw_hal_status rtw_hal_bb_ctrl_dbcc(struct hal_info_t *hal_info, bool dbcc_en)
123 {
124 halbb_ctrl_dbcc(hal_info->bb, dbcc_en);
125
126 return RTW_HAL_STATUS_SUCCESS;
127 }
128
rtw_hal_bb_cfg_dbcc(struct hal_info_t * hal_info,bool dbcc_en)129 enum rtw_hal_status rtw_hal_bb_cfg_dbcc(struct hal_info_t *hal_info, bool dbcc_en)
130 {
131 halbb_cfg_dbcc(hal_info->bb, dbcc_en);
132
133 return RTW_HAL_STATUS_SUCCESS;
134 }
135
rtw_hal_bb_init(struct rtw_phl_com_t * phl_com,struct hal_info_t * hal_info)136 u32 rtw_hal_bb_init(struct rtw_phl_com_t *phl_com, struct hal_info_t *hal_info)
137 {
138 struct rtw_hal_com_t *hal_com = hal_info->hal_com;
139 enum rtw_hal_status hal_status;
140
141 hal_status = halbb_buffer_init(phl_com, hal_com, &(hal_info->bb));
142
143 if ((hal_status != RTW_HAL_STATUS_SUCCESS) || (hal_info->bb == NULL))
144 PHL_ERR("[PHL] rtw_hal_bb_init failed status(%d), hal_info->bb(%p)\n",
145 hal_status, hal_info->bb);
146
147 return hal_status;
148 }
149
rtw_hal_bb_deinit(struct rtw_phl_com_t * phl_com,struct hal_info_t * hal_info)150 void rtw_hal_bb_deinit(struct rtw_phl_com_t *phl_com,
151 struct hal_info_t *hal_info)
152 {
153 struct rtw_hal_com_t *hal_com = hal_info->hal_com;
154
155 halbb_buffer_deinit(phl_com, hal_com, hal_info->bb);
156 }
157
rtw_hal_init_bb_reg(struct hal_info_t * hal_info)158 void rtw_hal_init_bb_reg(struct hal_info_t *hal_info)
159 {
160 halbb_init_reg(hal_info->bb);
161 halbb_reset_bb(hal_info->bb);
162 }
163
rtw_hal_read_rf_reg(struct rtw_hal_com_t * hal_com,enum rf_path path,u32 addr,u32 mask)164 u32 rtw_hal_read_rf_reg(struct rtw_hal_com_t *hal_com,
165 enum rf_path path, u32 addr, u32 mask)
166 {
167 struct hal_info_t *hal = (struct hal_info_t *)hal_com->hal_priv;
168
169 return halbb_read_rf_reg(hal->bb, path, addr, mask);
170 }
171
rtw_hal_write_rf_reg(struct rtw_hal_com_t * hal_com,enum rf_path path,u32 addr,u32 mask,u32 data)172 bool rtw_hal_write_rf_reg(struct rtw_hal_com_t *hal_com,
173 enum rf_path path, u32 addr, u32 mask, u32 data)
174 {
175 struct hal_info_t *hal = (struct hal_info_t *)hal_com->hal_priv;
176
177 return halbb_write_rf_reg(hal->bb, path, addr, mask, data);
178 }
179
rtw_hal_read_bb_reg(struct rtw_hal_com_t * hal_com,u32 addr,u32 mask)180 u32 rtw_hal_read_bb_reg(struct rtw_hal_com_t *hal_com, u32 addr, u32 mask)
181 {
182 struct hal_info_t *hal = (struct hal_info_t *)hal_com->hal_priv;
183
184 return halbb_get_reg(hal->bb, addr, mask);
185 }
186
rtw_hal_write_bb_reg(struct rtw_hal_com_t * hal_com,u32 addr,u32 mask,u32 data)187 bool rtw_hal_write_bb_reg(struct rtw_hal_com_t *hal_com,
188 u32 addr, u32 mask, u32 data)
189 {
190 struct hal_info_t *hal = (struct hal_info_t *)hal_com->hal_priv;
191
192 halbb_set_reg(hal->bb, addr, mask, data);
193 return true;
194 }
195
rtw_hal_bb_read_cr(struct rtw_hal_com_t * hal_com,u32 addr,u32 mask)196 u32 rtw_hal_bb_read_cr(struct rtw_hal_com_t *hal_com, u32 addr, u32 mask)
197 {
198 struct hal_info_t *hal = (struct hal_info_t *)hal_com->hal_priv;
199
200 return halbb_rf_get_bb_reg(hal->bb, addr, mask);
201 }
202
rtw_hal_bb_write_cr(struct rtw_hal_com_t * hal_com,u32 addr,u32 mask,u32 data)203 bool rtw_hal_bb_write_cr(struct rtw_hal_com_t *hal_com,
204 u32 addr, u32 mask, u32 data)
205 {
206 struct hal_info_t *hal = (struct hal_info_t *)hal_com->hal_priv;
207
208 return halbb_rf_set_bb_reg(hal->bb, addr, mask, data);
209 }
210
211 enum rtw_hal_status
rtw_hal_bb_stainfo_init(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)212 rtw_hal_bb_stainfo_init(struct hal_info_t *hal_info,
213 struct rtw_phl_stainfo_t *sta)
214 {
215 enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
216
217 if (halbb_sta_info_init(hal_info->bb, sta))
218 hal_status = RTW_HAL_STATUS_SUCCESS;
219 else
220 PHL_ERR("[HAL] halbb_stainfo_init failed status(%d)\n",
221 hal_status);
222
223 return hal_status;
224 }
225
226 enum rtw_hal_status
rtw_hal_bb_stainfo_deinit(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)227 rtw_hal_bb_stainfo_deinit(struct hal_info_t *hal_info,
228 struct rtw_phl_stainfo_t *sta)
229 {
230 enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
231
232 if (halbb_sta_info_deinit(hal_info->bb, sta))
233 hal_status = RTW_HAL_STATUS_SUCCESS;
234 else
235 PHL_ERR("[HAL] rtw_hal_bb_stainfo_deinit failed status(%d)\n",
236 hal_status);
237
238 return hal_status;
239 }
240
241 enum rtw_hal_status
rtw_hal_bb_stainfo_add(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)242 rtw_hal_bb_stainfo_add(struct hal_info_t *hal_info,
243 struct rtw_phl_stainfo_t *sta)
244 {
245 enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
246
247 if (halbb_sta_info_add_entry(hal_info->bb, sta))
248 hal_status = RTW_HAL_STATUS_SUCCESS;
249 else
250 PHL_ERR("[HAL] halbb_stainfo_init failed status(%d)\n",
251 hal_status);
252
253 return hal_status;
254 }
255
256 enum rtw_hal_status
rtw_hal_bb_stainfo_delete(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)257 rtw_hal_bb_stainfo_delete(struct hal_info_t *hal_info,
258 struct rtw_phl_stainfo_t *sta)
259 {
260 enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
261
262 if (halbb_sta_info_delete_entry(hal_info->bb, sta))
263 hal_status = RTW_HAL_STATUS_SUCCESS;
264 else
265 PHL_ERR("[HAL] rtw_hal_bb_stainfo_deinit failed status(%d)\n",
266 hal_status);
267
268 return hal_status;
269 }
270
rtw_hal_bb_media_status_update(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta,bool is_connected)271 void rtw_hal_bb_media_status_update(struct hal_info_t *hal_info,
272 struct rtw_phl_stainfo_t *sta, bool is_connected)
273 {
274 halbb_media_status_update(hal_info->bb, sta, is_connected);
275 }
276
277 enum rtw_hal_status
rtw_hal_bb_upt_ramask(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)278 rtw_hal_bb_upt_ramask(struct hal_info_t *hal_info,
279 struct rtw_phl_stainfo_t *sta)
280 {
281 if (!rtw_halbb_dft_mask(hal_info->bb, sta)) {
282 PHL_ERR("rtw_halbb_set_dft_mask failed\n");
283 return RTW_HAL_STATUS_FAILURE;
284 }
285
286 PHL_INFO("sta's cur_ra_mask : 0x%016llx\n", sta->hal_sta->ra_info.cur_ra_mask);
287
288 if (sta->hal_sta->ra_info.ra_mask) {
289 sta->hal_sta->ra_info.cur_ra_mask &= sta->hal_sta->ra_info.ra_mask;
290 PHL_INFO("ra_mask : 0x%016llx, cur_ra_mask : 0x%016llx\n",
291 sta->hal_sta->ra_info.ra_mask, sta->hal_sta->ra_info.cur_ra_mask);
292 }
293 return RTW_HAL_STATUS_SUCCESS;
294 }
295
296 enum rtw_hal_status
rtw_hal_bb_ra_register(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)297 rtw_hal_bb_ra_register(struct hal_info_t *hal_info,
298 struct rtw_phl_stainfo_t *sta)
299 {
300 if (!rtw_halbb_raregistered(hal_info->bb, sta))
301 return RTW_HAL_STATUS_FAILURE;
302
303 sta->hal_sta->ra_info.ra_registered = true;
304 return RTW_HAL_STATUS_SUCCESS;
305 }
306
307 enum rtw_hal_status
rtw_hal_bb_ra_deregister(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)308 rtw_hal_bb_ra_deregister(struct hal_info_t *hal_info,
309 struct rtw_phl_stainfo_t *sta)
310 {
311 if (!rtw_halbb_ra_deregistered(hal_info->bb, sta))
312 PHL_ERR("rtw_halbb_ra_deregistered failed\n");
313
314 sta->hal_sta->ra_info.ra_registered = false;
315 return RTW_HAL_STATUS_SUCCESS;
316 }
317
318 enum rtw_hal_status
rtw_hal_bb_ra_update(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)319 rtw_hal_bb_ra_update(struct hal_info_t *hal_info,
320 struct rtw_phl_stainfo_t *sta)
321 {
322 if (!sta->hal_sta->ra_info.ra_registered) {
323 PHL_WARN("%s mac-id:%d not register RA\n", __func__, sta->macid);
324 return RTW_HAL_STATUS_SUCCESS;
325 }
326
327 if (sta->hal_sta->ra_info.ra_mask) {
328 sta->hal_sta->ra_info.cur_ra_mask &= sta->hal_sta->ra_info.ra_mask;
329 PHL_INFO("ra_mask : 0x%016llx, cur_ra_mask : 0x%016llx\n",
330 sta->hal_sta->ra_info.ra_mask, sta->hal_sta->ra_info.cur_ra_mask);
331 }
332
333 if (rtw_halbb_raupdate(hal_info->bb, sta) == true)
334 return RTW_HAL_STATUS_SUCCESS;
335 else
336 return RTW_HAL_STATUS_FAILURE;
337 }
338
339 #ifdef CONFIG_BTCOEX
rtw_hal_btc_cfg_tx_1ss(struct rtw_hal_com_t * hal_com,struct rtw_phl_com_t * phl_com,u8 rid,bool enable)340 enum rtw_hal_status rtw_hal_btc_cfg_tx_1ss(struct rtw_hal_com_t *hal_com,
341 struct rtw_phl_com_t *phl_com, u8 rid, bool enable)
342 {
343 enum rtw_hal_status hstats = RTW_HAL_STATUS_FAILURE;
344 struct hal_info_t *hal_i = (struct hal_info_t *)hal_com->hal_priv;
345 void *drv = halcom_to_drvpriv(hal_com);
346 struct rtw_wifi_role_t *wrole = rtw_phl_get_wrole_by_ridx(phl_com, rid);
347 struct phl_queue *sta_queue = NULL;
348 struct rtw_phl_stainfo_t *sta = NULL;
349 u8 ra_nss_limit = enable ? 1 : 0;
350
351 PHL_PRINT("%s: rid(%d), enable(%d)\n", __FUNCTION__, rid, enable);
352 if (wrole == NULL) {
353 PHL_ERR("%s: Get role failed\n", __FUNCTION__);
354 goto exit;
355 }
356 sta_queue = &wrole->assoc_sta_queue;
357 _os_spinlock(drv, &sta_queue->lock, _bh, NULL);
358 phl_list_for_loop(sta, struct rtw_phl_stainfo_t,
359 &sta_queue->queue, list) {
360 if (!sta)
361 continue;
362 sta->hal_sta->ra_info.ra_nss_limit = ra_nss_limit;
363 hstats = rtw_hal_bb_ra_update(hal_i, sta);
364 if (RTW_HAL_STATUS_SUCCESS != hstats) {
365 PHL_ERR("%s: macid(%d), Fail to cfg ra_nss_limit(%d)\n",
366 __FUNCTION__, sta->macid, ra_nss_limit);
367 break;
368 } else {
369 PHL_PRINT("%s: macid(%d), succee to cfg ra_nss_limit(%d)\n",
370 __FUNCTION__, sta->macid, ra_nss_limit);
371 }
372 }
373 _os_spinunlock(drv, &sta_queue->lock, _bh, NULL);
374 exit:
375 return hstats;
376 }
377 #endif /* CONFIG_BTCOEX */
378
379 enum rtw_hal_status
rtw_hal_bb_query_txsts_rpt(struct hal_info_t * hal_info,u16 macid0,u16 macid1)380 rtw_hal_bb_query_txsts_rpt(struct hal_info_t *hal_info,
381 u16 macid0, u16 macid1)
382 {
383 if (!rtw_halbb_query_txsts(hal_info->bb, macid0, macid1))
384 return RTW_HAL_STATUS_FAILURE;
385
386 return RTW_HAL_STATUS_SUCCESS;
387 }
388
389 #define INVALID_ARFR_IDX 0xFF
390 #define rtw_halbb_get_arfr_idx(_bb, _sta) INVALID_ARFR_IDX
rtw_hal_bb_get_arfr_idx(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)391 u8 rtw_hal_bb_get_arfr_idx(struct hal_info_t *hal_info,
392 struct rtw_phl_stainfo_t *sta)
393 {
394 return rtw_halbb_get_arfr_idx(hal_info->bb, sta);
395 }
396
397 enum rtw_hal_status
rtw_hal_bb_get_efuse_info(struct rtw_hal_com_t * hal_com,u8 * efuse_map,enum rtw_efuse_info info_type,void * value,u8 size,u8 map_valid)398 rtw_hal_bb_get_efuse_info(struct rtw_hal_com_t *hal_com,
399 u8 *efuse_map, enum rtw_efuse_info info_type, void *value,
400 u8 size, u8 map_valid)
401 {
402 PHL_INFO("%s\n", __FUNCTION__);
403 return RTW_HAL_STATUS_SUCCESS;
404 }
405
hal_get_primary_channel_idx(u8 pri_ch,u8 central_ch,enum channel_width bw,enum chan_offset bw_offset)406 u8 hal_get_primary_channel_idx(u8 pri_ch,
407 u8 central_ch, enum channel_width bw,
408 enum chan_offset bw_offset)
409 {
410 u8 idx = 255;
411
412 if(bw == CHANNEL_WIDTH_80) {
413 if(bw_offset == CHAN_OFFSET_NO_EXT ||
414 bw_offset == CHAN_OFFSET_NO_DEF) {
415 PHL_ERR("%s invalid bw offset\n",__FUNCTION__);
416 return idx;
417 }
418 if (central_ch > pri_ch)
419 idx = (bw_offset == CHAN_OFFSET_UPPER) ? (4) : (2);
420 else
421 idx = (bw_offset == CHAN_OFFSET_UPPER) ? (1) : (3);
422 }
423 else if(bw == CHANNEL_WIDTH_40) {
424 if(bw_offset == CHAN_OFFSET_NO_EXT ||
425 bw_offset == CHAN_OFFSET_NO_DEF) {
426 PHL_ERR("%s invalid bw offset\n",__FUNCTION__);
427 return idx;
428 }
429 idx = (bw_offset == CHAN_OFFSET_UPPER) ? (2) : (1);
430 }
431 else {
432 idx = 0;
433 }
434 PHL_INFO("Using SC index %u for P%u C%u B%u O%u\n",
435 idx, pri_ch, central_ch, bw, bw_offset);
436 return idx;
437 }
438
rtw_hal_bb_set_ch_bw(struct hal_info_t * hal_info,enum phl_phy_idx phy_idx,u8 pri_ch,u8 central_ch_seg0,u8 central_ch_seg1,enum band_type band,enum channel_width bw)439 enum rtw_hal_status rtw_hal_bb_set_ch_bw(struct hal_info_t *hal_info,
440 enum phl_phy_idx phy_idx,
441 u8 pri_ch,
442 u8 central_ch_seg0,
443 u8 central_ch_seg1,
444 enum band_type band,
445 enum channel_width bw)
446 {
447 if(halbb_ctrl_bw_ch(hal_info->bb, pri_ch, central_ch_seg0,
448 central_ch_seg1, band, bw, phy_idx) == false)
449 return RTW_HAL_STATUS_FAILURE;
450 return RTW_HAL_STATUS_SUCCESS;
451 }
452
453 #ifdef CONFIG_PHL_CUSTOM_FEATURE
454 /**
455 * Early Weak Interference Rejection (EWIR)
456 * rtw_hal_bb_set_pop_en: configure bb feature about packet on packet.
457 * @hal_info: see struct hal_info_t
458 * @en: enable: true, disable: false
459 * @phy_idx: corresponding to the hw_band in wifi_role.
460 * returns enum rtw_hal_status
461 */
rtw_hal_bb_set_pop_en(struct hal_info_t * hal_info,bool en,enum phl_phy_idx phy_idx)462 enum rtw_hal_status rtw_hal_bb_set_pop_en(struct hal_info_t *hal_info,
463 bool en,
464 enum phl_phy_idx phy_idx)
465 {
466 PHL_INFO(" %s, pop_enable(%d)\n", __FUNCTION__, en);
467 halbb_pop_en(hal_info->bb, en, phy_idx);
468 return RTW_HAL_STATUS_SUCCESS;
469 }
470
471 /**
472 * Early Weak Interference Rejection (EWIR)
473 * rtw_hal_bb_query_pop_en: query the status of packet on packet operation.
474 * @hal_info: see struct hal_info_t
475 * @phy_idx: corresponding to the hw_band in wifi_role.
476 * returns true: running; false: not running.
477 */
rtw_hal_bb_query_pop_en(struct hal_info_t * hal_info,enum phl_phy_idx phy_idx)478 bool rtw_hal_bb_query_pop_en(struct hal_info_t *hal_info,
479 enum phl_phy_idx phy_idx)
480 {
481 return halbb_querry_pop_en(hal_info->bb, phy_idx);
482 }
483
484 /**
485 * rtw_hal_bb_set_pkt_detect_thold: configure packet threshold(dbm) detection
486 * It would pause DIG while pd threshold enabling(value > 0)
487 * @hal_info: see struct hal_info_t
488 * @bound: pd threshold value
489 * returns enum rtw_hal_status
490 */
rtw_hal_bb_set_pkt_detect_thold(struct hal_info_t * hal_info,u32 bound)491 enum rtw_hal_status rtw_hal_bb_set_pkt_detect_thold(struct hal_info_t *hal_info,
492 u32 bound)
493 {
494 enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
495 enum halbb_pause_type pause_type = HALBB_PAUSE;
496 u8 pause_result = 0;
497 u32 val[5] = {0};
498 val[0] = bound;
499 val[1] = 0;
500 if (bound == 0) {
501 pause_type = HALBB_RESUME;
502 } else if ((bound > 102) || (bound < 40)) {
503 PHL_INFO(" %s, invalid boundary!\n", __FUNCTION__);
504 return hal_status;
505 }
506 pause_result = halbb_pause_func(hal_info->bb,
507 F_DIG, pause_type,
508 HALBB_PAUSE_LV_2,
509 2,
510 val);
511 if (pause_result == PAUSE_SUCCESS)
512 hal_status = RTW_HAL_STATUS_SUCCESS;
513 return hal_status;
514 }
515
516 /**
517 * rtw_hal_bb_query_pkt_detect_thold: query packet threshold(dbm) value.
518 * @hal_info: see struct hal_info_t
519 * @get_en_info: Caller can confirm the feature running or not with true value.
520 * 1. true: for query pd threshold detection enabling or not.
521 * 2. false:for query pd threshold value.
522 * @phy_idx: corresponding to the hw_band in wifi_role.
523 * returns pd threshold value
524 */
rtw_hal_bb_query_pkt_detect_thold(struct hal_info_t * hal_info,bool get_en_info,enum phl_phy_idx phy_idx)525 u8 rtw_hal_bb_query_pkt_detect_thold(struct hal_info_t *hal_info,
526 bool get_en_info,
527 enum phl_phy_idx phy_idx)
528 {
529 return halbb_querry_pd_lower_bound(hal_info->bb, get_en_info, phy_idx);
530 }
531 #endif
532
533 #ifdef CONFIG_PHL_DFS
rtw_hal_in_radar_domain(void * hal,u8 ch,enum channel_width bw)534 bool rtw_hal_in_radar_domain(void *hal,
535 u8 ch, enum channel_width bw)
536 {
537 struct hal_info_t *hal_info = (struct hal_info_t *)hal;
538
539 return halbb_is_dfs_band(hal_info->bb, ch, bw);
540 }
541
542 enum rtw_hal_status
rtw_hal_bb_dfs_rpt_cfg(struct hal_info_t * hal_info,bool dfs_en)543 rtw_hal_bb_dfs_rpt_cfg(struct hal_info_t *hal_info, bool dfs_en)
544 {
545 if (dfs_en)
546 halbb_radar_detect_enable(hal_info->bb);
547 else
548 halbb_radar_detect_disable(hal_info->bb);
549 return RTW_HAL_STATUS_SUCCESS;
550 }
551
552 bool
rtw_hal_bb_radar_detect(struct hal_info_t * hal_info,struct hal_dfs_rpt * hal_dfs)553 rtw_hal_bb_radar_detect(struct hal_info_t *hal_info,
554 struct hal_dfs_rpt *hal_dfs)
555 {
556
557 return halbb_radar_detect(hal_info->bb, hal_dfs);
558 }
559 #endif /*CONFIG_PHL_DFS*/
560
561 #ifdef CONFIG_PHL_CHANNEL_INFO
562 enum rtw_hal_status
rtw_hal_bb_ch_info_parsing(struct hal_info_t * hal_info,u8 * addr,u32 len,u8 * rpt_buf,struct ch_rpt_hdr_info * ch_hdr_rpt,struct phy_info_rpt * phy_rpt,struct ch_info_drv_rpt * drv)563 rtw_hal_bb_ch_info_parsing(struct hal_info_t *hal_info,
564 u8 *addr, u32 len, u8 *rpt_buf, struct ch_rpt_hdr_info *ch_hdr_rpt,
565 struct phy_info_rpt *phy_rpt, struct ch_info_drv_rpt *drv)
566 {
567 enum bb_ch_info_t chinfo_status = BB_CH_INFO_SUCCESS;
568
569 chinfo_status = halbb_ch_info_parsing(hal_info->bb, addr, len, rpt_buf
570 , (void*)ch_hdr_rpt, (void *)phy_rpt, (void *)drv);
571
572 if (chinfo_status == BB_CH_INFO_SUCCESS)
573 return RTW_HAL_STATUS_SUCCESS;
574 else if (chinfo_status == BB_CH_INFO_LAST_SEG)
575 return RTW_HAL_STATUS_BB_CH_INFO_LAST_SEG;
576 else
577 return RTW_HAL_STATUS_FAILURE;
578 }
579
580 void
rtw_hal_bb_chan_info_cfg(struct hal_info_t * hal_info,struct chinfo_bbcr_cfg * bbcr)581 rtw_hal_bb_chan_info_cfg(struct hal_info_t *hal_info, struct chinfo_bbcr_cfg *bbcr)
582 {
583 halbb_cfg_ch_info_cr(hal_info->bb, (void*)bbcr);
584 }
585 #endif /* CONFIG_PHL_CHANNEL_INFO */
586
587 enum rtw_hal_status
rtw_hal_bb_ctrl_btg(struct rtw_hal_com_t * hal_com,bool btg)588 rtw_hal_bb_ctrl_btg(struct rtw_hal_com_t *hal_com, bool btg)
589 {
590 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
591 enum rtw_hal_status status = RTW_HAL_STATUS_FAILURE;
592
593 PHL_INFO("[HAL] call rtw_hal_bb_ctrl_btg !!!\n");
594
595 halbb_ctrl_btg(hal_info->bb, btg);
596
597 return status;
598 }
599
600 enum rtw_hal_status
rtw_hal_bb_ctrl_btc_preagc(struct rtw_hal_com_t * hal_com,bool bt_en)601 rtw_hal_bb_ctrl_btc_preagc(struct rtw_hal_com_t *hal_com, bool bt_en)
602 {
603 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
604 enum rtw_hal_status status = RTW_HAL_STATUS_FAILURE;
605
606 PHL_INFO("[HAL] call rtw_hal_bb_ctrl_btc_preagc !!!\n");
607
608 halbb_ctrl_btc_preagc(hal_info->bb, bt_en);
609
610 return status;
611 }
612
613 enum rtw_hal_status
rtw_hal_bb_cfg_rx_path(struct rtw_hal_com_t * hal_com,u8 rx_path)614 rtw_hal_bb_cfg_rx_path(struct rtw_hal_com_t *hal_com, u8 rx_path)
615 {
616 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
617 enum rtw_hal_status status = RTW_HAL_STATUS_FAILURE;
618
619 PHL_INFO("[HAL] call halbb_ctrl_rx_path !!!\n");
620
621 if(halbb_ctrl_rx_path(hal_info->bb, rx_path))
622 status = RTW_HAL_STATUS_SUCCESS;
623 else
624 status = RTW_HAL_STATUS_FAILURE;
625
626 return status;
627
628 }
629
630 enum rtw_hal_status
rtw_hal_bb_cfg_tx_path(struct rtw_hal_com_t * hal_com,u8 tx_path)631 rtw_hal_bb_cfg_tx_path(struct rtw_hal_com_t *hal_com, u8 tx_path)
632 {
633 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
634 enum rtw_hal_status status = RTW_HAL_STATUS_FAILURE;
635
636 PHL_INFO("[HAL] call halbb_ctrl_tx_path !!!\n");
637
638 if(halbb_ctrl_tx_path(hal_info->bb, tx_path))
639 status = RTW_HAL_STATUS_SUCCESS;
640 else
641 status = RTW_HAL_STATUS_FAILURE;
642 return status;
643 }
644
rtw_hal_bb_get_rx_ok(struct hal_info_t * hal_info,u8 cur_phy_idx,u32 * rx_ok)645 enum rtw_hal_status rtw_hal_bb_get_rx_ok(struct hal_info_t *hal_info, u8 cur_phy_idx, u32 *rx_ok)
646 {
647 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
648
649 PHL_INFO("[MP HAL BB API]%s\n", __FUNCTION__);
650
651 *rx_ok = halbb_mp_get_rx_crc_ok(hal_info->bb, cur_phy_idx);
652
653 return ret;
654 }
655
rtw_hal_bb_get_rx_crc(struct hal_info_t * hal_info,u8 cur_phy_idx,u32 * rx_crc_err)656 enum rtw_hal_status rtw_hal_bb_get_rx_crc(struct hal_info_t *hal_info, u8 cur_phy_idx, u32 *rx_crc_err)
657 {
658 enum rtw_hal_status ret = RTW_HAL_STATUS_SUCCESS;
659
660 PHL_INFO("[MP HAL BB API]%s\n", __FUNCTION__);
661
662 *rx_crc_err = halbb_mp_get_rx_crc_err(hal_info->bb, cur_phy_idx);
663
664 return ret;
665 }
666
rtw_hal_bb_set_reset_cnt(void * hal)667 enum rtw_hal_status rtw_hal_bb_set_reset_cnt(void *hal)
668 {
669 struct hal_info_t *hal_info = (struct hal_info_t *)hal;
670
671 PHL_INFO("[HAL] call halbb_mp_seset_cnt !!!\n");
672 halbb_mp_reset_cnt(hal_info->bb);
673 return RTW_HAL_STATUS_SUCCESS;
674 }
675
676 enum rtw_hal_status
rtw_hal_bb_set_power(struct rtw_hal_com_t * hal_com,s16 power_dbm,enum phl_phy_idx phy_idx)677 rtw_hal_bb_set_power(struct rtw_hal_com_t *hal_com, s16 power_dbm,
678 enum phl_phy_idx phy_idx)
679 {
680 enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
681 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
682
683 PHL_INFO("[MP HAL API] %s: call halbb_set_txpwr_dbm \n", __FUNCTION__);
684 PHL_INFO("[MP HAL API] %s: power_dbm = %d\n", __FUNCTION__, power_dbm);
685
686 if(halbb_set_txpwr_dbm(hal_info->bb, power_dbm, phy_idx))
687 hal_status = RTW_HAL_STATUS_SUCCESS;
688 else
689 hal_status = RTW_HAL_STATUS_FAILURE;
690
691 return hal_status;
692 }
693
694 enum rtw_hal_status
rtw_hal_bb_get_power(struct rtw_hal_com_t * hal_com,s16 * power_dbm,enum phl_phy_idx phy_idx)695 rtw_hal_bb_get_power(struct rtw_hal_com_t *hal_com, s16 *power_dbm,
696 enum phl_phy_idx phy_idx)
697 {
698 int ret = RTW_HAL_STATUS_SUCCESS;
699 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
700
701 PHL_INFO("[MP HAL API] %s: call halbb_get_txpwr_dbm \n", __FUNCTION__);
702 *power_dbm = halbb_get_txpwr_dbm(hal_info->bb, phy_idx);
703 PHL_INFO("[MP HAL API] %s: power_dbm = %d\n", __FUNCTION__, *power_dbm);
704 return ret;
705 }
706
707 enum rtw_hal_status
rtw_hal_bb_set_pwr_index(void * hal,u16 pwr_idx,enum rf_path tx_path,bool is_cck)708 rtw_hal_bb_set_pwr_index(void *hal, u16 pwr_idx, enum rf_path tx_path, bool is_cck)
709 {
710 enum rtw_hal_status hal_status = RTW_HAL_STATUS_FAILURE;
711 struct hal_info_t *hal_info = (struct hal_info_t *)hal;
712
713 PHL_INFO("[MP HAL API] %s: call halbb_set_txpwr_idx\n", __FUNCTION__);
714
715 if (is_cck) {
716 if(halbb_set_cck_txpwr_idx(hal_info->bb, pwr_idx, tx_path))
717 hal_status = RTW_HAL_STATUS_SUCCESS;
718 else
719 hal_status = RTW_HAL_STATUS_FAILURE;
720
721 } else {
722 if(halbb_set_ofdm_txpwr_idx(hal_info->bb, pwr_idx, tx_path))
723 hal_status = RTW_HAL_STATUS_SUCCESS;
724 else
725 hal_status = RTW_HAL_STATUS_FAILURE;
726 }
727 return hal_status;
728 }
729
rtw_hal_bb_get_pwr_index(void * hal,u16 * pwr_idx,enum rf_path tx_path,bool is_cck)730 enum rtw_hal_status rtw_hal_bb_get_pwr_index(void *hal, u16 *pwr_idx, enum rf_path tx_path, bool is_cck){
731 int ret = RTW_HAL_STATUS_SUCCESS;
732 struct hal_info_t *hal_info = (struct hal_info_t *)hal;
733
734 PHL_INFO("[MP HAL API] %s: call halbb_get_txpwr_idx\n", __FUNCTION__);
735
736 if (is_cck) {
737 PHL_INFO("[MP HAL API] call halbb_get_cck_txpwr_idx\n");
738 *pwr_idx = halbb_get_cck_txpwr_idx(hal_info->bb, tx_path);
739
740 } else {
741 PHL_INFO("[MP HAL API] call halbb_get_ofdm_txpwr_idx\n");
742 *pwr_idx = halbb_get_ofdm_txpwr_idx(hal_info->bb, tx_path);
743 }
744
745
746 return ret;
747 }
748
rtw_hal_bb_set_plcp_tx(struct rtw_hal_com_t * hal_com,struct mp_plcp_param_t * plcp_tx_struct,struct mp_usr_plcp_gen_in * plcp_usr_info,enum phl_phy_idx plcp_phy_idx,u8 * plcp_sts)749 enum rtw_hal_status rtw_hal_bb_set_plcp_tx(struct rtw_hal_com_t *hal_com,
750 struct mp_plcp_param_t *plcp_tx_struct,
751 struct mp_usr_plcp_gen_in *plcp_usr_info,
752 enum phl_phy_idx plcp_phy_idx,
753 u8 *plcp_sts)
754 {
755 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
756
757 PHL_INFO("%s\n", __FUNCTION__);
758
759 *plcp_sts = halbb_plcp_gen(hal_info->bb, (void*)plcp_tx_struct,(void*)plcp_usr_info,plcp_phy_idx);
760 return RTW_HAL_STATUS_SUCCESS;
761 }
762
763 enum rtw_hal_status
rtw_hal_bb_set_pmac_cont_tx(struct rtw_hal_com_t * hal_com,u8 enable,u8 is_cck,enum phl_phy_idx phy_idx)764 rtw_hal_bb_set_pmac_cont_tx(struct rtw_hal_com_t *hal_com, u8 enable, u8 is_cck,
765 enum phl_phy_idx phy_idx)
766 {
767 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
768 struct halbb_pmac_info tx_info = {0};
769
770 PHL_INFO("%s: enable = %d is_cck = %d phy_idx = %d\n",
771 __FUNCTION__, enable, is_cck, phy_idx);
772
773 tx_info.en_pmac_tx = enable;
774 tx_info.is_cck = is_cck;
775 tx_info.mode = CONT_TX;
776
777 halbb_set_pmac_tx(hal_info->bb, &tx_info, phy_idx);
778 return RTW_HAL_STATUS_SUCCESS;
779 }
780
781 enum rtw_hal_status
rtw_hal_bb_set_pmac_packet_tx(struct rtw_hal_com_t * hal_com,u8 enable,u8 is_cck,u16 tx_cnt,u16 period,u16 tx_time,enum phl_phy_idx phy_idx)782 rtw_hal_bb_set_pmac_packet_tx(struct rtw_hal_com_t *hal_com, u8 enable,
783 u8 is_cck, u16 tx_cnt ,u16 period, u16 tx_time,
784 enum phl_phy_idx phy_idx)
785 {
786 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
787 struct halbb_pmac_info tx_info = {0};
788
789 PHL_INFO("%s: enable = %d is_cck = %d phy_idx = %d\n",
790 __FUNCTION__, enable, is_cck, phy_idx);
791 PHL_INFO("%s: tx_cnt = %d period = %d tx_time = %d\n",
792 __FUNCTION__, tx_cnt, period, tx_time);
793
794 tx_info.en_pmac_tx = enable;
795 tx_info.is_cck = is_cck;
796 tx_info.mode = PKTS_TX;
797 tx_info.tx_cnt = tx_cnt;
798 tx_info.period = period;
799 tx_info.tx_time = tx_time;
800
801 halbb_set_pmac_tx(hal_info->bb, &tx_info, phy_idx);
802 return RTW_HAL_STATUS_SUCCESS;
803 }
804
805 enum rtw_hal_status
rtw_hal_bb_set_pmac_fw_trigger_tx(struct rtw_hal_com_t * hal_com,u8 enable,u8 is_cck,u16 tx_cnt,u8 tx_duty,enum phl_phy_idx phy_idx)806 rtw_hal_bb_set_pmac_fw_trigger_tx(struct rtw_hal_com_t *hal_com, u8 enable,
807 u8 is_cck, u16 tx_cnt, u8 tx_duty,
808 enum phl_phy_idx phy_idx)
809 {
810 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
811 struct halbb_pmac_info tx_info = {0};
812
813 PHL_INFO("%s: enable = %d is_cck = %d phy_idx = %d\n",
814 __FUNCTION__, enable, is_cck, phy_idx);
815 PHL_INFO("%s: tx_cnt = %d\n", __FUNCTION__, tx_cnt);
816 PHL_INFO("%s: tx_duty = %d\n", __FUNCTION__, tx_duty);
817
818 tx_info.en_pmac_tx = enable;
819 tx_info.is_cck = is_cck;
820 tx_info.mode = FW_TRIG_TX;
821 tx_info.tx_cnt = tx_cnt;
822 tx_info.duty_cycle = tx_duty;
823
824 halbb_set_pmac_tx(hal_info->bb, &tx_info, phy_idx);
825 return RTW_HAL_STATUS_SUCCESS;
826 }
827
828 enum rtw_hal_status
rtw_hal_bb_parse_phy_sts(void * hal,void * ppdu_sts,struct rtw_phl_rx_pkt * phl_rx,u8 is_su)829 rtw_hal_bb_parse_phy_sts(void *hal, void *ppdu_sts,
830 struct rtw_phl_rx_pkt *phl_rx, u8 is_su)
831 {
832 enum rtw_hal_status hstutus = RTW_HAL_STATUS_SUCCESS;
833
834 struct hal_info_t *hal_info = (struct hal_info_t *)hal;
835 struct hal_ppdu_sts *hal_ppdu = (struct hal_ppdu_sts *)ppdu_sts;
836 struct rtw_r_meta_data *mdata = &(phl_rx->r.mdata);
837 struct rtw_phl_ppdu_phy_info *phy_info = &(phl_rx->r.phy_info);
838 struct physts_rxd rxdesc = {0};
839 struct physts_result bb_rpt = {0};
840 u8 i = 0;
841 bool valid = false;
842
843 rxdesc.data_rate = mdata->rx_rate;
844 rxdesc.gi_ltf = mdata->rx_gi_ltf;
845 rxdesc.is_su = is_su;
846 rxdesc.macid_su = (u8)mdata->macid;
847 rxdesc.user_num = hal_ppdu->usr_num;
848 rxdesc.is_to_self = mdata->a1_match;
849 rxdesc.phy_idx = (mdata->bb_sel == 0) ? HW_PHY_0 : HW_PHY_1;
850
851 for (i = 0; i < rxdesc.user_num; i++) {
852 rxdesc.user_i[i].macid = (u8)hal_ppdu->usr[i].macid;
853 rxdesc.user_i[i].is_data = hal_ppdu->usr[i].has_data;
854 rxdesc.user_i[i].is_ctrl = hal_ppdu->usr[i].has_ctrl;
855 rxdesc.user_i[i].is_mgnt = hal_ppdu->usr[i].has_ctrl;
856 rxdesc.user_i[i].is_bcn = hal_ppdu->usr[i].has_bcn;
857 }
858
859 valid = halbb_physts_parsing(hal_info->bb, hal_ppdu->phy_st_ptr,
860 (u16)hal_ppdu->phy_st_size,
861 &rxdesc, &bb_rpt);
862 if (valid != true) {
863 PHL_TRACE(COMP_PHL_PSTS, _PHL_DEBUG_,
864 "halbb_physts_parsing Fail!\n");
865 hstutus = RTW_HAL_STATUS_FAILURE;
866 }
867
868 if ((bb_rpt.rssi_avg != 0) || (bb_rpt.physts_rpt_valid == 1)) {
869 phy_info->is_valid = true;
870 /* rssi from bb rpt, bit 0 is 0.0 ~ 0.9, removed it */
871 phy_info->rssi = (bb_rpt.rssi_avg >> 1);
872 phy_info->ch_idx = bb_rpt.ch_idx;
873 phy_info->tx_bf = bb_rpt.is_bf;
874 for (i = 0; i < RTW_PHL_MAX_RF_PATH; i++) {
875 /* rssi from bb rpt, bit 0 is 0.0 ~ 0.9, removed it */
876 phy_info->rssi_path[i] = (bb_rpt.rssi[i] >> 1);
877 PHL_TRACE(COMP_PHL_PSTS, _PHL_INFO_,
878 "phy_info->rssi_path[%d] = %d\n",
879 i, phy_info->rssi_path[i]);
880 }
881 #ifdef RTW_WKARD_SINGLE_PATH_RSSI
882 if (RF_PATH_A == hal_info->hal_com->cur_rx_rfpath) {
883 phy_info->rssi = phy_info->rssi_path[0];
884 } else if (RF_PATH_B == hal_info->hal_com->cur_rx_rfpath) {
885 phy_info->rssi = phy_info->rssi_path[1];
886 } else if (RF_PATH_C == hal_info->hal_com->cur_rx_rfpath) {
887 phy_info->rssi = phy_info->rssi_path[2];
888 } else if (RF_PATH_D == hal_info->hal_com->cur_rx_rfpath) {
889 phy_info->rssi = phy_info->rssi_path[3];
890 }
891 #endif
892 PHL_TRACE(COMP_PHL_PSTS, _PHL_INFO_,
893 "avg_rssi %d ; ch_idx %d\n",
894 phy_info->rssi, phy_info->ch_idx);
895 }
896
897 return hstutus;
898 }
899
rtw_hal_bb_get_tx_ok(void * hal,u8 cur_phy_idx,u32 * tx_ok)900 enum rtw_hal_status rtw_hal_bb_get_tx_ok(void *hal, u8 cur_phy_idx, u32 *tx_ok)
901 {
902 /* struct hal_info_t *hal_info = (struct hal_info_t *)hal; */
903
904 PHL_INFO("[HAL] call get halbb_mp_get_tx_ok !!!\n");
905 /*tx_ok = halbb_mp_get_tx_ok(hal_info->bb, cur_phy_idx);*/
906 return RTW_HAL_STATUS_SUCCESS;
907 }
908
rtw_hal_bb_get_txpwr_ref(struct hal_info_t * hal_info,u8 is_cck,u8 tx_path,s16 * txpwr_ref)909 enum rtw_hal_status rtw_hal_bb_get_txpwr_ref(struct hal_info_t *hal_info, u8 is_cck, u8 tx_path, s16 *txpwr_ref)
910 {
911 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
912
913 PHL_INFO("[MP HAL API]%s\n", __FUNCTION__);
914
915 if (is_cck)
916 *txpwr_ref = halbb_get_cck_ref_dbm(hal_info->bb, tx_path);
917 else
918 *txpwr_ref = halbb_get_ofdm_ref_dbm(hal_info->bb, tx_path);
919
920 PHL_INFO("[MP HAL API] %s: txpwr_ref = %x\n", __FUNCTION__, *txpwr_ref);
921
922 return ret;
923 }
924
rtw_hal_bb_get_rssi(struct hal_info_t * hal_info,enum rf_path rx_path,u8 * rssi)925 enum rtw_hal_status rtw_hal_bb_get_rssi(struct hal_info_t *hal_info, enum rf_path rx_path, u8 *rssi)
926 {
927 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
928
929 PHL_INFO("[MP HAL API]%s\n", __FUNCTION__);
930
931 *rssi = halbb_mp_get_rssi(hal_info->bb, rx_path);
932
933 return ret;
934 }
935
rtw_hal_bb_get_rssi_ex(struct hal_info_t * hal_info,enum rf_path rx_path,s16 * rssi,u8 cur_phy_idx)936 enum rtw_hal_status rtw_hal_bb_get_rssi_ex(struct hal_info_t *hal_info, enum rf_path rx_path, s16 *rssi, u8 cur_phy_idx)
937 {
938 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
939
940 PHL_INFO("[MP HAL API]%s\n", __FUNCTION__);
941
942 /*
943 ToDo: Should follow halbb master
944 [HALBB][8852A][B-Cut] Refine rssi structure from s32 to s8
945 sha-1:f301ebb0e7cd0c1521d3c67e94c2dd4434d87f44
946
947 struct rssi_physts rssi_t;
948 *rssi_t = halbb_get_mp_rssi_physts(hal_info->bb, RF_PATH_AB, cur_phy_idx);
949 *rssi = rssi_t.rssi_seg[cur_phy_idx].rssi[0];
950 *rssi = (*rssi<<8)|rssi_t.rssi_seg[cur_phy_idx].rssi[1];
951 */
952 return ret;
953 }
954
rtw_hal_bb_get_rxevm(struct hal_info_t * hal_info,u8 user,u8 strm,u8 rxevm_table,u8 * rx_evm)955 enum rtw_hal_status rtw_hal_bb_get_rxevm(struct hal_info_t *hal_info, u8 user, u8 strm, u8 rxevm_table, u8 *rx_evm)
956 {
957 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
958
959 PHL_INFO("[MP HAL API]%s\n", __FUNCTION__);
960
961 *rx_evm = halbb_mp_get_rxevm(hal_info->bb, user, strm, rxevm_table);
962
963 return ret;
964 }
965
rtw_hal_bb_trigger_rxevm(struct hal_info_t * hal_info,u8 cur_phy_idx,u32 * phy0_user0_rxevm,u32 * phy0_user1_rxevm,u32 * phy0_user2_rxevm,u32 * phy0_user3_rxevm,u32 * phy1_user0_rxevm,u32 * phy1_user1_rxevm,u32 * phy1_user2_rxevm,u32 * phy1_user3_rxevm)966 enum rtw_hal_status rtw_hal_bb_trigger_rxevm(struct hal_info_t *hal_info, u8 cur_phy_idx,
967 u32 *phy0_user0_rxevm, u32 *phy0_user1_rxevm, u32 *phy0_user2_rxevm, u32 *phy0_user3_rxevm,
968 u32 *phy1_user0_rxevm, u32 *phy1_user1_rxevm, u32 *phy1_user2_rxevm, u32 *phy1_user3_rxevm)
969 {
970
971 struct rxevm_physts evm;
972 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
973
974 PHL_INFO("[MP HAL API]%s\n", __FUNCTION__);
975
976 evm = halbb_mp_get_rxevm_physts(hal_info->bb, cur_phy_idx);
977 *phy0_user0_rxevm = evm.rxevm_seg[0].rxevm_user[0].rxevm_ss_3;
978 *phy0_user0_rxevm = (*phy0_user0_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[0].rxevm_ss_2;
979 *phy0_user0_rxevm = (*phy0_user0_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[0].rxevm_ss_1;
980 *phy0_user0_rxevm = (*phy0_user0_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[0].rxevm_ss_0;
981
982 *phy0_user1_rxevm = evm.rxevm_seg[0].rxevm_user[1].rxevm_ss_3;
983 *phy0_user1_rxevm = (*phy0_user1_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[1].rxevm_ss_2;
984 *phy0_user1_rxevm = (*phy0_user1_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[1].rxevm_ss_1;
985 *phy0_user1_rxevm = (*phy0_user1_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[1].rxevm_ss_0;
986
987 *phy0_user2_rxevm = evm.rxevm_seg[0].rxevm_user[2].rxevm_ss_3;
988 *phy0_user2_rxevm = (*phy0_user2_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[2].rxevm_ss_2;
989 *phy0_user2_rxevm = (*phy0_user2_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[2].rxevm_ss_1;
990 *phy0_user2_rxevm = (*phy0_user2_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[2].rxevm_ss_0;
991
992 *phy0_user3_rxevm = evm.rxevm_seg[0].rxevm_user[3].rxevm_ss_3;
993 *phy0_user3_rxevm = (*phy0_user3_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[3].rxevm_ss_2;
994 *phy0_user3_rxevm = (*phy0_user3_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[3].rxevm_ss_1;
995 *phy0_user3_rxevm = (*phy0_user3_rxevm<<8)|evm.rxevm_seg[0].rxevm_user[3].rxevm_ss_0;
996
997 *phy1_user0_rxevm = evm.rxevm_seg[1].rxevm_user[0].rxevm_ss_3;
998 *phy1_user0_rxevm = (*phy1_user0_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[0].rxevm_ss_2;
999 *phy1_user0_rxevm = (*phy1_user0_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[0].rxevm_ss_1;
1000 *phy1_user0_rxevm = (*phy1_user0_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[0].rxevm_ss_0;
1001
1002 *phy1_user1_rxevm = evm.rxevm_seg[1].rxevm_user[1].rxevm_ss_3;
1003 *phy1_user1_rxevm = (*phy1_user1_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[1].rxevm_ss_2;
1004 *phy1_user1_rxevm = (*phy1_user1_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[1].rxevm_ss_1;
1005 *phy1_user1_rxevm = (*phy1_user1_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[1].rxevm_ss_0;
1006
1007 *phy1_user2_rxevm = evm.rxevm_seg[1].rxevm_user[2].rxevm_ss_3;
1008 *phy1_user2_rxevm = (*phy1_user2_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[2].rxevm_ss_2;
1009 *phy1_user2_rxevm = (*phy1_user2_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[2].rxevm_ss_1;
1010 *phy1_user2_rxevm = (*phy1_user2_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[2].rxevm_ss_0;
1011
1012 *phy1_user3_rxevm = evm.rxevm_seg[1].rxevm_user[3].rxevm_ss_3;
1013 *phy1_user3_rxevm = (*phy1_user3_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[3].rxevm_ss_2;
1014 *phy1_user3_rxevm = (*phy1_user3_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[3].rxevm_ss_1;
1015 *phy1_user3_rxevm = (*phy1_user3_rxevm<<8)|evm.rxevm_seg[1].rxevm_user[3].rxevm_ss_0;
1016
1017 return ret;
1018 }
1019
1020 /* mode: 0 = tmac, 1 = pmac */
1021 enum rtw_hal_status
rtw_hal_bb_tx_mode_switch(struct rtw_hal_com_t * hal_com,enum phl_phy_idx phy_idx,u8 mode)1022 rtw_hal_bb_tx_mode_switch(struct rtw_hal_com_t *hal_com,
1023 enum phl_phy_idx phy_idx,
1024 u8 mode)
1025 {
1026 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
1027 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
1028
1029 if(mode == 0) {
1030 PHL_INFO("%s: tmac mode\n", __FUNCTION__);
1031 halbb_set_tmac_tx(hal_info->bb, phy_idx);
1032 }
1033 else {
1034 PHL_INFO("%s: pmac mode\n", __FUNCTION__);
1035 }
1036
1037 return ret;
1038 }
1039
rtw_hal_bb_set_txsc(struct hal_info_t * hal_info,u8 txsc,enum phl_phy_idx phy_idx)1040 enum rtw_hal_status rtw_hal_bb_set_txsc(struct hal_info_t *hal_info, u8 txsc,
1041 enum phl_phy_idx phy_idx)
1042 {
1043 enum rtw_hal_status status = RTW_HAL_STATUS_FAILURE;
1044 PHL_INFO("[HAL] call halbb_set_txsc !!!\n");
1045
1046 if(halbb_set_txsc(hal_info->bb, txsc, phy_idx))
1047 status = RTW_HAL_STATUS_SUCCESS;
1048 else
1049 status = RTW_HAL_STATUS_FAILURE;
1050
1051 return status;
1052 }
1053
1054
rtw_hal_bb_get_txsc(struct rtw_hal_com_t * hal_com,u8 pri_ch,u8 central_ch,enum channel_width cbw,enum channel_width dbw)1055 u8 rtw_hal_bb_get_txsc(struct rtw_hal_com_t *hal_com, u8 pri_ch,
1056 u8 central_ch, enum channel_width cbw, enum channel_width dbw)
1057 {
1058 struct hal_info_t *hal_info = (struct hal_info_t *)(hal_com->hal_priv);
1059
1060 return halbb_get_txsc(hal_info->bb, pri_ch, central_ch, cbw, dbw);
1061 }
1062
rtw_hal_bb_process_c2h(void * hal,struct rtw_c2h_info * c2h)1063 u32 rtw_hal_bb_process_c2h(void *hal, struct rtw_c2h_info *c2h)
1064 {
1065 #ifdef RTW_WKARD_BB_C2H
1066 struct hal_info_t *hal_info = (struct hal_info_t *)hal;
1067 u8 cls = c2h->c2h_class;
1068 u8 func = c2h->c2h_func;
1069 u16 len = c2h->content_len;
1070 u8 *buf = c2h->content;
1071
1072 return rtw_halbb_c2h_parsing(hal_info->bb, cls, func, (u8)len, buf);
1073 #else
1074 return 0;
1075 #endif
1076 }
1077
rtw_hal_bb_get_su_rx_rate(struct rtw_hal_com_t * hal_com)1078 u16 rtw_hal_bb_get_su_rx_rate(struct rtw_hal_com_t *hal_com)
1079 {
1080 struct hal_info_t *hal_info = (struct hal_info_t *)(hal_com->hal_priv);
1081 struct bb_pkt_cnt_su_info rpt;
1082 u16 max_num_tmp = 0;
1083 u16 rx_rate = 0;
1084 u16 i = 0;
1085 u16 *pkt_cnt_tmp;
1086 u8 rate_num_tmp;
1087 u16 ofst_mode = 0;
1088 u16 ofst_ss = 0;
1089 u16 idx = 0;
1090 bool is_ht_mode = false;
1091 bool is_legacy_rate = true;
1092
1093 halbb_get_rx_pkt_cnt_rpt_su(hal_info->bb, &rpt);
1094
1095 /*Legacy rate*/
1096 if (rpt.pkt_cnt_cck || rpt.pkt_cnt_ofdm) {
1097 for (i = 0; i < 12; i++) {
1098 if (rpt.pkt_cnt_legacy[i] >= max_num_tmp) {
1099 max_num_tmp = rpt.pkt_cnt_legacy[i];
1100 rx_rate = i;
1101 }
1102 }
1103 }
1104 if (rpt.pkt_cnt_t == 0) {
1105 return rx_rate;
1106 }
1107 /*HT, VHT, HE*/
1108 if (rpt.he_pkt_not_zero) {
1109 pkt_cnt_tmp = rpt.pkt_cnt_he;
1110 rate_num_tmp = 24;
1111 ofst_mode = 0x180;
1112 } else if (rpt.vht_pkt_not_zero) {
1113 pkt_cnt_tmp = rpt.pkt_cnt_vht;
1114 rate_num_tmp = 24;
1115 ofst_mode = 0x100;
1116 } else if (rpt.ht_pkt_not_zero) {
1117 pkt_cnt_tmp = rpt.pkt_cnt_ht;
1118 rate_num_tmp = 16;
1119 ofst_mode = 0x80;
1120 is_ht_mode = true;
1121 } else {
1122 return rx_rate;
1123 }
1124 for (i = 0; i < rate_num_tmp; i++) {
1125 if (pkt_cnt_tmp[i] >= max_num_tmp) {
1126 max_num_tmp = pkt_cnt_tmp[i];
1127 idx = i;
1128 is_legacy_rate = false;
1129 }
1130 }
1131 if (is_legacy_rate)
1132 return rx_rate;
1133 if (!is_ht_mode) {
1134 ofst_ss = idx / HE_VHT_NUM_MCS;
1135
1136 if (ofst_ss >= 0) /*>=2SS*/
1137 idx -= (ofst_ss * HE_VHT_NUM_MCS);
1138 }
1139 rx_rate = ofst_mode + (ofst_ss << 4) + idx;
1140 return rx_rate;
1141 }
1142
1143 #ifdef CONFIG_DBCC_SUPPORT
1144 enum rtw_hal_status
rtw_hal_phy_dbcc_pre_cfg(struct hal_info_t * hal_info,struct rtw_phl_com_t * phl_com,bool dbcc_en)1145 rtw_hal_phy_dbcc_pre_cfg(struct hal_info_t *hal_info,
1146 struct rtw_phl_com_t *phl_com, bool dbcc_en)
1147 {
1148
1149 rtw_hal_init_bb_reg(hal_info);
1150
1151 return RTW_HAL_STATUS_SUCCESS;
1152 }
1153
1154 enum rtw_hal_status
rtw_hal_phy_dbcc_cfg(struct hal_info_t * hal_info,struct rtw_phl_com_t * phl_com,bool dbcc_en)1155 rtw_hal_phy_dbcc_cfg(struct hal_info_t *hal_info,
1156 struct rtw_phl_com_t *phl_com, bool dbcc_en)
1157 {
1158 enum rtw_hal_status hal_status = RTW_HAL_STATUS_SUCCESS;
1159
1160 /* BB DBCC Settings */
1161 rtw_hal_bb_cfg_dbcc(hal_info, dbcc_en);
1162 /* enable/disable rf */
1163 hal_status = rtw_hal_rf_ctrl_dbcc(hal_info->hal_com, dbcc_en);
1164 if (RTW_HAL_STATUS_SUCCESS != hal_status) {
1165 hal_status = RTW_HAL_STATUS_FAILURE;
1166 }
1167
1168 return hal_status;
1169 }
1170 #endif
1171
1172 enum rtw_hal_status
rtw_hal_bb_get_txinfo_power(struct hal_info_t * hal_info,s16 * txinfo_power_dbm)1173 rtw_hal_bb_get_txinfo_power(struct hal_info_t *hal_info,
1174 s16 *txinfo_power_dbm)
1175 {
1176 int ret = RTW_HAL_STATUS_SUCCESS;
1177
1178 PHL_INFO("[MP HAL API] %s: call halbb_get_txinfo_txpwr_dbm \n",
1179 __FUNCTION__);
1180
1181 *txinfo_power_dbm = halbb_get_txinfo_txpwr_dbm(hal_info->bb);
1182
1183 PHL_INFO("[MP HAL API] %s: txinfo_power_dbm = %d\n",
1184 __FUNCTION__, *txinfo_power_dbm);
1185 return ret;
1186 }
1187
1188 enum rtw_hal_status
rtw_hal_bb_ctrl_rf_mode(struct hal_info_t * hal_info,enum phl_rf_mode rf_mode)1189 rtw_hal_bb_ctrl_rf_mode(struct hal_info_t *hal_info,
1190 enum phl_rf_mode rf_mode){
1191 int ret = RTW_HAL_STATUS_SUCCESS;
1192
1193 PHL_INFO("[MP HAL API] %s: call rtw_hal_bb_ctrl_rf_mode \n",
1194 __FUNCTION__);
1195
1196 halbb_ctrl_rf_mode(hal_info->bb, rf_mode);
1197
1198 return ret;
1199 }
1200
1201 enum rtw_hal_status
rtw_hal_bb_set_sta_id(struct hal_info_t * hal_info,u16 staid,enum phl_phy_idx phy_idx)1202 rtw_hal_bb_set_sta_id(struct hal_info_t *hal_info,
1203 u16 staid, enum phl_phy_idx phy_idx)
1204 {
1205 int ret = RTW_HAL_STATUS_SUCCESS;
1206
1207 halbb_set_sta_id(hal_info->bb, staid, phy_idx);
1208
1209 return ret;
1210 }
1211
1212 enum rtw_hal_status
rtw_hal_bb_set_bss_color(struct hal_info_t * hal_info,u8 bsscolor,enum phl_phy_idx phy_idx)1213 rtw_hal_bb_set_bss_color(struct hal_info_t *hal_info,
1214 u8 bsscolor, enum phl_phy_idx phy_idx)
1215 {
1216 int ret = RTW_HAL_STATUS_SUCCESS;
1217
1218 halbb_set_bss_color(hal_info->bb, bsscolor, phy_idx);
1219
1220 return ret;
1221 }
1222
1223 #ifdef RTW_WKARD_DEF_CMACTBL_CFG
1224 enum rtw_hal_status
rtw_hal_bb_trx_path_cfg(struct hal_info_t * hal_info,enum rf_path tx,u8 tx_nss,enum rf_path rx,u8 rx_nss)1225 rtw_hal_bb_trx_path_cfg(struct hal_info_t *hal_info,
1226 enum rf_path tx, u8 tx_nss, enum rf_path rx, u8 rx_nss)
1227 {
1228 int ret = RTW_HAL_STATUS_SUCCESS;
1229
1230 halbb_ctrl_trx_path(hal_info->bb, tx, tx_nss, rx, rx_nss);
1231 PHL_TRACE(COMP_PHL_DBG, _PHL_INFO_,
1232 "tx_ant(%d) tx_nss(%d) rx_ant(%d) rx_nss(%d)\n",
1233 tx, tx_nss, rx, rx_nss);
1234 return ret;
1235 }
1236
rtw_hal_bb_cfg_cmac_tx_ant(struct hal_info_t * hal_info,enum rf_path tx_path)1237 u16 rtw_hal_bb_cfg_cmac_tx_ant(struct hal_info_t *hal_info,
1238 enum rf_path tx_path)
1239 {
1240 u16 ret;
1241
1242 ret = (BIT(RF_PATH_A) | BIT(RF_PATH_B))|(RF_PATH_A<<4)|(RF_PATH_B<<6);
1243 ret = halbb_cfg_cmac_tx_ant(hal_info->bb, tx_path);
1244
1245 return ret;
1246 }
1247 #endif
1248
1249 enum rtw_hal_status
rtw_hal_bb_backup_info(struct rtw_hal_com_t * hal_com,u8 cur_phy_idx)1250 rtw_hal_bb_backup_info(struct rtw_hal_com_t *hal_com, u8 cur_phy_idx)
1251 {
1252 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
1253 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
1254
1255 PHL_INFO("[MP HAL API] %s ==>start\n", __FUNCTION__);
1256
1257 halbb_backup_info(hal_info->bb, cur_phy_idx);
1258
1259 PHL_INFO("[MP HAL API] %s ==>end\n", __FUNCTION__);
1260
1261 return ret;
1262 }
1263
1264 enum rtw_hal_status
rtw_hal_bb_restore_info(struct rtw_hal_com_t * hal_com,u8 cur_phy_idx)1265 rtw_hal_bb_restore_info(struct rtw_hal_com_t *hal_com, u8 cur_phy_idx)
1266 {
1267 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
1268 enum rtw_hal_status ret=RTW_HAL_STATUS_SUCCESS;
1269
1270 PHL_INFO("[MP HAL API] %s ==>start\n", __FUNCTION__);
1271
1272 halbb_restore_info(hal_info->bb, cur_phy_idx);
1273
1274 PHL_INFO("[MP HAL API] %s ==>end\n", __FUNCTION__);
1275
1276 return ret;
1277 }
1278
rtw_hal_bb_set_tx_pow_ref(struct rtw_hal_com_t * hal_com,enum phl_phy_idx phy_idx)1279 void rtw_hal_bb_set_tx_pow_ref(struct rtw_hal_com_t *hal_com,
1280 enum phl_phy_idx phy_idx)
1281 {
1282 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
1283
1284 halbb_set_tx_pow_ref(hal_info->bb, phy_idx);
1285 }
1286
1287 #ifdef CONFIG_RTW_ACS
rtw_hal_bb_acs_mntr_trigger(struct hal_info_t * hal_info,u16 monitor_time)1288 void rtw_hal_bb_acs_mntr_trigger(struct hal_info_t *hal_info, u16 monitor_time)
1289 {
1290 struct ccx_para_info para = {0};
1291 struct env_trig_rpt trig_rpt = {0};
1292
1293 para.rac_lv = RAC_LV_3;
1294 para.mntr_time = monitor_time;
1295 /*clm para*/
1296 para.clm_app = CLM_ACS;
1297 para.clm_input_opt = CLM_CCA_P20;
1298
1299 /*nhm para*/
1300 para.nhm_app = NHM_ACS;
1301 para.nhm_incld_cca = NHM_INCLUDE_CCA;
1302
1303 halbb_env_mntr_trigger(hal_info->bb, ¶, &trig_rpt);
1304 }
1305
rtw_hal_bb_acs_mntr_result(struct hal_info_t * hal_info,void * rpt)1306 enum rtw_hal_status rtw_hal_bb_acs_mntr_result(struct hal_info_t *hal_info, void *rpt)
1307 {
1308 u8 result = 0;
1309 struct env_mntr_rpt mntr_rpt = {0};
1310 struct auto_chan_sel_report *acs_rpt = (struct auto_chan_sel_report *)rpt;
1311
1312 result = halbb_env_mntr_result(hal_info->bb, &mntr_rpt);
1313
1314 if ((result & (CLM_SUCCESS | NHM_SUCCESS)) != (CLM_SUCCESS | NHM_SUCCESS)) {
1315 return RTW_HAL_STATUS_FAILURE;
1316 } else {
1317 acs_rpt->clm_ratio = mntr_rpt.clm_ratio;
1318 acs_rpt->nhm_pwr = mntr_rpt.nhm_pwr;
1319 return RTW_HAL_STATUS_SUCCESS;
1320 }
1321 }
1322 #endif /* CONFIG_RTW_ACS */
1323
1324 enum rtw_hal_status
rtw_hal_bb_tssi_bb_reset(struct rtw_hal_com_t * hal_com)1325 rtw_hal_bb_tssi_bb_reset(struct rtw_hal_com_t *hal_com)
1326 {
1327 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
1328
1329 halbb_tssi_bb_reset(hal_info->bb);
1330
1331 return RTW_HAL_STATUS_SUCCESS;
1332 }
1333 #ifdef RTW_WKARD_DYNAMIC_BFEE_CAP
rtw_hal_bb_dcr_en(struct hal_info_t * hal_info,bool en)1334 void rtw_hal_bb_dcr_en(struct hal_info_t *hal_info, bool en)
1335 {
1336 halbb_dcr_en(hal_info->bb, en);
1337 PHL_TRACE(COMP_PHL_DBG, _PHL_DEBUG_,
1338 "rtw_hal_bb_dcr_en : %d \n", (en ? 1 : 0));
1339 return;
1340 }
1341
rtw_hal_bb_csi_rsp(struct hal_info_t * hal_info)1342 bool rtw_hal_bb_csi_rsp(struct hal_info_t *hal_info)
1343 {
1344 bool ret = true;
1345 if (0 == halbb_dyn_csi_rsp_rlt_get(hal_info->bb)) {
1346 ret = false;
1347 }
1348 PHL_TRACE(COMP_PHL_DBG, _PHL_DEBUG_,
1349 "rtw_hal_bb_csi_rsp : %d \n", (ret ? 1 : 0));
1350 return ret;
1351 }
1352 #endif
1353
rtw_hal_bb_notification(struct hal_info_t * hal_info,enum phl_msg_evt_id event,enum phl_phy_idx phy_idx)1354 void rtw_hal_bb_notification(struct hal_info_t *hal_info,
1355 enum phl_msg_evt_id event,
1356 enum phl_phy_idx phy_idx)
1357 {
1358 halbb_wifi_event_notify(hal_info->bb, event, phy_idx);
1359 }
1360
rtw_hal_bb_cmd_notification(struct hal_info_t * hal_info,void * hal_cmd,enum phl_phy_idx phy_idx)1361 void rtw_hal_bb_cmd_notification(struct hal_info_t *hal_info,
1362 void *hal_cmd,
1363 enum phl_phy_idx phy_idx)
1364 {
1365 halbb_bb_cmd_notify(hal_info->bb, hal_cmd, phy_idx);
1366 }
1367
1368 enum rtw_hal_status
rtw_hal_bb_set_gain_offset(struct hal_info_t * hal_info,s8 rx_gain_offset,enum rf_path rx_path,enum phl_phy_idx phy_idx,u8 iscck)1369 rtw_hal_bb_set_gain_offset(struct hal_info_t *hal_info, s8 rx_gain_offset,
1370 enum rf_path rx_path, enum phl_phy_idx phy_idx, u8 iscck)
1371 {
1372 if(iscck)
1373 halbb_normal_efuse_verify_cck(hal_info->bb, rx_gain_offset, rx_path, phy_idx);
1374 else
1375 halbb_normal_efuse_verify(hal_info->bb, rx_gain_offset, rx_path, phy_idx);
1376
1377 return RTW_HAL_STATUS_SUCCESS;
1378 }
1379
rtw_hal_bb_get_efuse_init(struct rtw_hal_com_t * hal_com)1380 void rtw_hal_bb_get_efuse_init(struct rtw_hal_com_t *hal_com)
1381 {
1382 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
1383
1384 halbb_get_efuse_init(hal_info->bb);
1385 PHL_INFO("[HAL API] %s ==>end\n", __FUNCTION__);
1386 }
1387 enum rtw_hal_status
rtw_hal_bb_set_dpd_bypass(struct rtw_hal_com_t * hal_com,bool pdp_bypass,enum phl_phy_idx phy_idx)1388 rtw_hal_bb_set_dpd_bypass(struct rtw_hal_com_t *hal_com, bool pdp_bypass,
1389 enum phl_phy_idx phy_idx)
1390 {
1391 struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv;
1392 PHL_INFO("%s: pdp_bypass = %d phy_idx = %d\n",
1393 __FUNCTION__, pdp_bypass, phy_idx);
1394
1395 halbb_dpd_bypass(hal_info->bb, pdp_bypass, phy_idx);
1396 return RTW_HAL_STATUS_SUCCESS;
1397 }
1398
1399
rtw_hal_bb_gpio_setting(struct rtw_hal_com_t * hal_com,u8 gpio_idx,u8 path,bool inv,u8 src)1400 void rtw_hal_bb_gpio_setting(struct rtw_hal_com_t *hal_com, u8 gpio_idx, u8 path,
1401 bool inv, u8 src)
1402 {
1403 struct hal_info_t *hal_info = (struct hal_info_t *)(hal_com->hal_priv);
1404
1405 halbb_gpio_setting(hal_info->bb, gpio_idx, path, inv, src);
1406 }
1407
rtw_hal_bb_gpio_setting_all(struct rtw_hal_com_t * hal_com,u8 rfe_idx)1408 void rtw_hal_bb_gpio_setting_all(struct rtw_hal_com_t *hal_com, u8 rfe_idx)
1409 {
1410 struct hal_info_t *hal_info = (struct hal_info_t *)(hal_com->hal_priv);
1411
1412 halbb_gpio_setting_all(hal_info->bb, rfe_idx);
1413 }
1414
rtw_hal_bb_check_tx_idle(struct hal_info_t * hal_info,enum phl_phy_idx phy_idx)1415 bool rtw_hal_bb_check_tx_idle(struct hal_info_t *hal_info, enum phl_phy_idx phy_idx)
1416 {
1417 return halbb_chk_tx_idle(hal_info->bb, phy_idx);
1418 }
1419
1420 static enum rtw_hal_status
_cnvrt_rainfo_to_rate(enum hal_rate_mode rate_mode,u8 mcs_ss_idx,enum rtw_data_rate * data_rate)1421 _cnvrt_rainfo_to_rate(enum hal_rate_mode rate_mode, u8 mcs_ss_idx,
1422 enum rtw_data_rate *data_rate)
1423 {
1424 enum rtw_hal_status hal_sts = RTW_HAL_STATUS_FAILURE;
1425 u16 rate_idx = 0, ss = 0;
1426
1427 switch(rate_mode) {
1428 case HAL_LEGACY_MODE:
1429 rate_idx = (u16)(mcs_ss_idx & 0xf);
1430 ss = 0;
1431 hal_sts = RTW_HAL_STATUS_SUCCESS;
1432 break;
1433 case HAL_HT_MODE:
1434 rate_idx = (u16)(mcs_ss_idx & 0x1f);
1435 ss = 0;
1436 hal_sts = RTW_HAL_STATUS_SUCCESS;
1437 break;
1438 case HAL_VHT_MODE:
1439 case HAL_HE_MODE:
1440 rate_idx = (u16)(mcs_ss_idx & 0xf);
1441 ss = (mcs_ss_idx & 0x30) >> 4;
1442 hal_sts = RTW_HAL_STATUS_SUCCESS;
1443 break;
1444 default:
1445 PHL_TRACE(COMP_PHL_XMIT, _PHL_ERR_,
1446 "%s : incorrect rate mode(0x%x), fail to covert rate\n",
1447 __func__, rate_mode);
1448 hal_sts = RTW_HAL_STATUS_FAILURE;
1449 break;
1450 }
1451
1452 if (RTW_HAL_STATUS_SUCCESS == hal_sts)
1453 *data_rate = rate_idx | (ss << 4) | (rate_mode << 7);
1454
1455 return hal_sts;
1456 }
1457
1458 enum rtw_hal_status
rtw_hal_bb_ic_hw_setting_init(struct hal_info_t * hal_info)1459 rtw_hal_bb_ic_hw_setting_init(struct hal_info_t *hal_info)
1460 {
1461 halbb_dm_init(hal_info->bb, HW_PHY_0);
1462
1463 return RTW_HAL_STATUS_SUCCESS;
1464 }
1465
1466 enum rtw_hal_status
rtw_hal_bb_query_rainfo(void * hal,struct rtw_hal_stainfo_t * hal_sta,struct rtw_phl_rainfo * phl_rainfo)1467 rtw_hal_bb_query_rainfo(void *hal, struct rtw_hal_stainfo_t *hal_sta,
1468 struct rtw_phl_rainfo *phl_rainfo)
1469 {
1470 enum rtw_hal_status hal_sts = RTW_HAL_STATUS_FAILURE;
1471 struct rtw_rate_info *rainfo = NULL;
1472
1473 do {
1474 if (NULL == hal_sta) {
1475 PHL_TRACE(COMP_PHL_XMIT, _PHL_ERR_,
1476 "%s : hal_sta is NULL\n",
1477 __func__);
1478 break;
1479 }
1480
1481 if (NULL == phl_rainfo) {
1482 PHL_TRACE(COMP_PHL_XMIT, _PHL_ERR_,
1483 "%s : Input parameter is NULL\n",
1484 __func__);
1485 break;
1486 }
1487
1488 rainfo = &hal_sta->ra_info.rpt_rt_i;
1489
1490 phl_rainfo->gi_ltf = rainfo->gi_ltf;
1491 if (HAL_RATE_BW_20 == rainfo->bw) {
1492 phl_rainfo->bw = CHANNEL_WIDTH_20;
1493 } else if (HAL_RATE_BW_40 == rainfo->bw) {
1494 phl_rainfo->bw = CHANNEL_WIDTH_40;
1495 } else if (HAL_RATE_BW_80 == rainfo->bw) {
1496 phl_rainfo->bw = CHANNEL_WIDTH_80;
1497 } else if (HAL_RATE_BW_160 == rainfo->bw) {
1498 phl_rainfo->bw = CHANNEL_WIDTH_160;
1499 } else {
1500 PHL_TRACE(COMP_PHL_XMIT, _PHL_ERR_,
1501 "%s : incorrect bw(0x%x), fail to covert rate\n",
1502 __func__, rainfo->bw);
1503 break;
1504 }
1505
1506 if (RTW_HAL_STATUS_SUCCESS ==
1507 _cnvrt_rainfo_to_rate(rainfo->mode,
1508 rainfo->mcs_ss_idx,
1509 &phl_rainfo->rate)) {
1510 hal_sts = RTW_HAL_STATUS_SUCCESS;
1511 break;
1512 } else {
1513 break;
1514 }
1515 } while (false);
1516
1517 return hal_sts;
1518 }
1519
rtw_hal_bb_nhm_mntr_result(struct rtw_hal_com_t * hal_com,void * rpt,enum phl_phy_idx phy_idx)1520 void rtw_hal_bb_nhm_mntr_result(struct rtw_hal_com_t *hal_com, void *rpt, enum phl_phy_idx phy_idx)
1521 {
1522 struct hal_info_t *hal_info = (struct hal_info_t *)(hal_com->hal_priv);
1523 struct env_mntr_rpt mntr_rpt = {0};
1524 struct watchdog_nhm_report *nhm_rpt = (struct watchdog_nhm_report *)rpt;
1525
1526 halbb_env_mntr_get_bg_result(hal_info->bb, &mntr_rpt, phy_idx);
1527
1528 nhm_rpt->ccx_rpt_stamp = mntr_rpt.ccx_rpt_stamp;
1529 nhm_rpt->ccx_rpt_result = mntr_rpt.ccx_rpt_result;
1530 nhm_rpt->nhm_pwr_dbm = (s8) ((s16) mntr_rpt.nhm_pwr - 110);
1531 nhm_rpt->nhm_ratio = mntr_rpt.nhm_ratio;
1532 }
1533
rtw_hal_bb_set_pow_patten_sharp(struct rtw_hal_com_t * hal_com,u8 channel,u8 is_cck,u8 sharp_id,enum phl_phy_idx phy_idx)1534 void rtw_hal_bb_set_pow_patten_sharp(struct rtw_hal_com_t *hal_com, u8 channel, u8 is_cck, u8 sharp_id, enum phl_phy_idx phy_idx)
1535 {
1536 u8 is_ofdm = (is_cck == 0)?1:0;
1537 struct hal_info_t *hal_info = (struct hal_info_t *)(hal_com->hal_priv);
1538 struct rtw_tpu_info *tpu = &hal_info->hal_com->band[phy_idx].rtw_tpu_i;
1539 tpu->tx_ptrn_shap_idx = sharp_id;
1540
1541 halbb_set_tx_pow_pattern_shap(hal_info->bb, channel, is_ofdm, phy_idx);
1542 }
1543
rtw_hal_bb_env_rpt(struct rtw_hal_com_t * hal_com,struct rtw_env_report * env_rpt,enum phl_phy_idx phy_indx)1544 void rtw_hal_bb_env_rpt(struct rtw_hal_com_t *hal_com, struct rtw_env_report *env_rpt,
1545 enum phl_phy_idx phy_indx)
1546 {
1547 struct hal_info_t *hal_info = (struct hal_info_t *)(hal_com->hal_priv);
1548 struct env_mntr_rpt bg_rpt = {0};
1549 u8 env_rpt_status = 0;
1550
1551 halbb_env_mntr_get_bg_result(hal_info->bb, &bg_rpt, phy_indx);
1552 env_rpt_status = bg_rpt.ccx_rpt_result;
1553 env_rpt_status = env_rpt_status & CCX_SUCCESS;
1554
1555 /*if ok update env rpt */
1556 if (env_rpt_status == CCX_SUCCESS) {
1557 env_rpt->clm_ratio = bg_rpt.clm_ratio;
1558 env_rpt->nhm_pwr = bg_rpt.nhm_pwr;
1559 env_rpt->nhm_ratio = bg_rpt.nhm_ratio;
1560 env_rpt->nhm_cca_ratio = bg_rpt.nhm_cca_ratio;
1561 env_rpt->rpt_status = 1;
1562 } else {
1563 env_rpt->rpt_status = 0;
1564 }
1565 }
1566
1567 enum rtw_hal_status
rtw_hal_bb_set_tb_pwr_ofst(struct hal_info_t * hal_info,s16 ofst,enum phl_phy_idx phy_idx)1568 rtw_hal_bb_set_tb_pwr_ofst(struct hal_info_t *hal_info,
1569 s16 ofst, enum phl_phy_idx phy_idx)
1570 {
1571 bool ret = false;
1572
1573 ret = halbb_set_pwr_ul_tb_ofst(hal_info->bb, ofst, phy_idx);
1574 if (ret == true)
1575 return RTW_HAL_STATUS_SUCCESS;
1576 else
1577 return RTW_HAL_STATUS_FAILURE;
1578 }
1579
1580 #ifdef CONFIG_MCC_SUPPORT
1581 enum rtw_hal_status
rtw_hal_bb_upd_mcc_macid(struct hal_info_t * hal_info,struct rtw_phl_mcc_role * mrole)1582 rtw_hal_bb_upd_mcc_macid(struct hal_info_t *hal_info,
1583 struct rtw_phl_mcc_role *mrole)
1584 {
1585 bool ret = false;
1586 struct bb_mcc_i mi = {0};
1587
1588 mi.type = mrole->wrole->type;
1589 mi.self_macid = (u8)mrole->macid;
1590 mi.chandef = mrole->chandef;
1591 mi.macid_bitmap = mrole->used_macid.bitmap;
1592 mi.macid_map_len = mrole->used_macid.len;
1593
1594 ret = halbb_upd_mcc_macid(hal_info->bb, &mi);
1595
1596 if (ret == true)
1597 return RTW_HAL_STATUS_SUCCESS;
1598 else
1599 return RTW_HAL_STATUS_FAILURE;
1600 }
1601
1602 void
rtw_hal_bb_mcc_stop(struct hal_info_t * hal_info)1603 rtw_hal_bb_mcc_stop(struct hal_info_t *hal_info)
1604 {
1605 halbb_mcc_stop(hal_info->bb);
1606 }
1607
1608 enum rtw_hal_status
rtw_hal_bb_mcc_start(struct hal_info_t * hal_info,struct rtw_phl_mcc_role * m_role1,struct rtw_phl_mcc_role * m_role2)1609 rtw_hal_bb_mcc_start(struct hal_info_t *hal_info,
1610 struct rtw_phl_mcc_role *m_role1,
1611 struct rtw_phl_mcc_role *m_role2)
1612 {
1613 bool ret = false;
1614 struct bb_mcc_i mi_1 = {0}, mi_2 = {0};
1615
1616 mi_1.type = m_role1->wrole->type;
1617 mi_1.self_macid = (u8)m_role1->macid;
1618 mi_1.chandef = m_role1->chandef;
1619 mi_1.macid_bitmap = m_role1->used_macid.bitmap;
1620 mi_1.macid_map_len = m_role1->used_macid.len;
1621
1622 mi_2.type = m_role2->wrole->type;
1623 mi_2.self_macid = (u8)m_role2->macid;
1624 mi_2.chandef = m_role2->chandef;
1625 mi_2.macid_bitmap = m_role2->used_macid.bitmap;
1626 mi_2.macid_map_len = m_role2->used_macid.len;
1627
1628 ret = halbb_mcc_start(hal_info->bb, &mi_1, &mi_2);
1629
1630 if (ret == true)
1631 return RTW_HAL_STATUS_SUCCESS;
1632 else
1633 return RTW_HAL_STATUS_FAILURE;
1634 }
1635 #endif
1636
1637
1638 #else /*ifndef USE_TRUE_PHY*/
rtw_hal_bb_band_to_phy_idx(struct rtw_hal_com_t * hal_com,u8 band_idx)1639 enum phl_phy_idx rtw_hal_bb_band_to_phy_idx(struct rtw_hal_com_t *hal_com, u8 band_idx)
1640 {
1641 return HW_PHY_0;
1642 }
1643
rtw_hal_bb_dfs_en(struct hal_info_t * hal_info,bool en)1644 void rtw_hal_bb_dfs_en(struct hal_info_t *hal_info, bool en)
1645 {
1646 }
1647
rtw_hal_bb_tssi_cont_en(struct hal_info_t * hal_info,bool en,enum rf_path path)1648 void rtw_hal_bb_tssi_cont_en(struct hal_info_t *hal_info, bool en, enum rf_path path)
1649 {
1650 }
1651
rtw_hal_bb_adc_en(struct hal_info_t * hal_info,bool en)1652 void rtw_hal_bb_adc_en(struct hal_info_t *hal_info, bool en)
1653 {
1654 }
1655
rtw_hal_bb_reset_en(struct hal_info_t * hal_info,bool en,enum phl_phy_idx phy_idx)1656 void rtw_hal_bb_reset_en(struct hal_info_t *hal_info, bool en, enum phl_phy_idx phy_idx)
1657 {
1658 }
rtw_hal_bb_proc_cmd(struct hal_info_t * hal_info,struct rtw_proc_cmd * incmd,char * output,u32 out_len)1659 bool rtw_hal_bb_proc_cmd(struct hal_info_t *hal_info, struct rtw_proc_cmd *incmd,
1660 char *output, u32 out_len)
1661 {
1662 return true;
1663 }
1664
rtw_hal_bb_watchdog(struct hal_info_t * hal_info,u8 is_lps)1665 enum rtw_hal_status rtw_hal_bb_watchdog(struct hal_info_t *hal_info, u8 is_lps)
1666 {
1667 return RTW_HAL_STATUS_SUCCESS;
1668 }
1669
rtw_hal_bb_simple_watchdog(struct hal_info_t * hal_info,u8 io_en)1670 enum rtw_hal_status rtw_hal_bb_simple_watchdog(struct hal_info_t *hal_info, u8 io_en)
1671 {
1672 return RTW_HAL_STATUS_SUCCESS;
1673 }
1674
rtw_hal_bb_reset(struct hal_info_t * hal_info)1675 void rtw_hal_bb_reset(struct hal_info_t *hal_info)
1676 {
1677 }
1678
rtw_hal_bb_fw_edcca(struct hal_info_t * hal_info)1679 void rtw_hal_bb_fw_edcca(struct hal_info_t *hal_info)
1680 {
1681 }
1682
rtw_hal_bb_dm_init(struct hal_info_t * hal_info)1683 void rtw_hal_bb_dm_init(struct hal_info_t *hal_info)
1684 {
1685 }
1686
rtw_hal_bb_dm_deinit(struct rtw_phl_com_t * phl_com,struct hal_info_t * hal_info)1687 void rtw_hal_bb_dm_deinit(struct rtw_phl_com_t *phl_com, struct hal_info_t *hal_info)
1688 {
1689 }
1690
rtw_hal_bb_ctrl_rx_cca(struct rtw_hal_com_t * hal_com,bool cca_en,enum phl_phy_idx phy_idx)1691 enum rtw_hal_status rtw_hal_bb_ctrl_rx_cca(struct rtw_hal_com_t *hal_com,
1692 bool cca_en, enum phl_phy_idx phy_idx)
1693 {
1694 return RTW_HAL_STATUS_SUCCESS;
1695 }
1696
rtw_hal_bb_ctrl_dbcc(struct hal_info_t * hal_info,bool dbcc_en)1697 enum rtw_hal_status rtw_hal_bb_ctrl_dbcc(struct hal_info_t *hal_info, bool dbcc_en)
1698 {
1699 return RTW_HAL_STATUS_SUCCESS;
1700 }
1701
rtw_hal_bb_cfg_dbcc(struct hal_info_t * hal_info,bool dbcc_en)1702 enum rtw_hal_status rtw_hal_bb_cfg_dbcc(struct hal_info_t *hal_info, bool dbcc_en)
1703 {
1704 return RTW_HAL_STATUS_SUCCESS;
1705 }
1706
rtw_hal_bb_init(struct rtw_phl_com_t * phl_com,struct hal_info_t * hal_info)1707 u32 rtw_hal_bb_init(struct rtw_phl_com_t *phl_com, struct hal_info_t *hal_info)
1708 {
1709 return RTW_HAL_STATUS_SUCCESS;
1710 }
1711
rtw_hal_bb_deinit(struct rtw_phl_com_t * phl_com,struct hal_info_t * hal_info)1712 void rtw_hal_bb_deinit(struct rtw_phl_com_t *phl_com,
1713 struct hal_info_t *hal_info)
1714 {
1715 }
1716
rtw_hal_init_bb_reg(struct hal_info_t * hal_info)1717 void rtw_hal_init_bb_reg(struct hal_info_t *hal_info)
1718 {
1719 }
1720
rtw_hal_bb_init_reg_by_hdr(struct hal_info_t * hal_info,u32 * folder_array,u32 folder_len,u8 is_form_folder,enum phl_phy_idx phy_idx)1721 void rtw_hal_bb_init_reg_by_hdr(struct hal_info_t *hal_info, u32 *folder_array,
1722 u32 folder_len, u8 is_form_folder, enum phl_phy_idx phy_idx)
1723
1724 {
1725 }
1726
rtw_hal_read_rf_reg(struct rtw_hal_com_t * hal_com,enum rf_path path,u32 addr,u32 mask)1727 u32 rtw_hal_read_rf_reg(struct rtw_hal_com_t *hal_com,
1728 enum rf_path path, u32 addr, u32 mask)
1729 {
1730 return RTW_HAL_STATUS_SUCCESS;
1731 }
1732
rtw_hal_write_rf_reg(struct rtw_hal_com_t * hal_com,enum rf_path path,u32 addr,u32 mask,u32 data)1733 bool rtw_hal_write_rf_reg(struct rtw_hal_com_t *hal_com,
1734 enum rf_path path, u32 addr, u32 mask, u32 data)
1735 {
1736 return RTW_HAL_STATUS_SUCCESS;
1737 }
1738
rtw_hal_read_bb_reg(struct rtw_hal_com_t * hal_com,u32 addr,u32 mask)1739 u32 rtw_hal_read_bb_reg(struct rtw_hal_com_t *hal_com,
1740 u32 addr, u32 mask)
1741 {
1742 return RTW_HAL_STATUS_SUCCESS;
1743 }
1744
rtw_hal_write_bb_reg(struct rtw_hal_com_t * hal_com,u32 addr,u32 mask,u32 data)1745 bool rtw_hal_write_bb_reg(struct rtw_hal_com_t *hal_com,
1746 u32 addr, u32 mask, u32 data)
1747 {
1748 return true;
1749 }
1750
rtw_hal_bb_read_cr(struct rtw_hal_com_t * hal_com,u32 addr,u32 mask)1751 u32 rtw_hal_bb_read_cr(struct rtw_hal_com_t *hal_com, u32 addr, u32 mask)
1752 {
1753 return RTW_HAL_STATUS_SUCCESS;
1754 }
1755
rtw_hal_bb_write_cr(struct rtw_hal_com_t * hal_com,u32 addr,u32 mask,u32 data)1756 bool rtw_hal_bb_write_cr(struct rtw_hal_com_t *hal_com, u32 addr, u32 mask,
1757 u32 data)
1758 {
1759 return true;
1760 }
1761
1762 enum rtw_hal_status
rtw_hal_bb_stainfo_init(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1763 rtw_hal_bb_stainfo_init(struct hal_info_t *hal_info,
1764 struct rtw_phl_stainfo_t *sta)
1765 {
1766 return RTW_HAL_STATUS_SUCCESS;
1767 }
1768
1769 enum rtw_hal_status
rtw_hal_bb_stainfo_deinit(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1770 rtw_hal_bb_stainfo_deinit(struct hal_info_t *hal_info,
1771 struct rtw_phl_stainfo_t *sta)
1772 {
1773 return RTW_HAL_STATUS_SUCCESS;
1774 }
1775
1776 enum rtw_hal_status
rtw_hal_bb_stainfo_add(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1777 rtw_hal_bb_stainfo_add(struct hal_info_t *hal_info,
1778 struct rtw_phl_stainfo_t *sta)
1779 {
1780 return RTW_HAL_STATUS_SUCCESS;
1781 }
1782
1783 enum rtw_hal_status
rtw_hal_bb_stainfo_delete(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1784 rtw_hal_bb_stainfo_delete(struct hal_info_t *hal_info,
1785 struct rtw_phl_stainfo_t *sta)
1786 {
1787 return RTW_HAL_STATUS_SUCCESS;
1788 }
1789
rtw_hal_bb_media_status_update(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta,bool is_connected)1790 void rtw_hal_bb_media_status_update(struct hal_info_t *hal_info,
1791 struct rtw_phl_stainfo_t *sta, bool is_connected)
1792 {
1793 }
1794
1795 enum rtw_hal_status
rtw_hal_bb_upt_ramask(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1796 rtw_hal_bb_upt_ramask(struct hal_info_t *hal_info,
1797 struct rtw_phl_stainfo_t *sta)
1798 {
1799 return RTW_HAL_STATUS_SUCCESS;
1800 }
1801
1802 enum rtw_hal_status
rtw_hal_bb_ra_register(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1803 rtw_hal_bb_ra_register(struct hal_info_t *hal_info,
1804 struct rtw_phl_stainfo_t *sta)
1805 {
1806 return RTW_HAL_STATUS_SUCCESS;
1807 }
1808
1809 enum rtw_hal_status
rtw_hal_bb_ra_deregister(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1810 rtw_hal_bb_ra_deregister(struct hal_info_t *hal_info,
1811 struct rtw_phl_stainfo_t *sta)
1812 {
1813 return RTW_HAL_STATUS_SUCCESS;
1814 }
1815
1816 enum rtw_hal_status
rtw_hal_bb_ra_update(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1817 rtw_hal_bb_ra_update(struct hal_info_t *hal_info,
1818 struct rtw_phl_stainfo_t *sta)
1819 {
1820 return RTW_HAL_STATUS_SUCCESS;
1821 }
1822
rtw_hal_bb_get_arfr_idx(struct hal_info_t * hal_info,struct rtw_phl_stainfo_t * sta)1823 u8 rtw_hal_bb_get_arfr_idx(struct hal_info_t *hal_info,
1824 struct rtw_phl_stainfo_t *sta)
1825 {
1826 return RTW_HAL_STATUS_SUCCESS;
1827 }
1828
1829 enum rtw_hal_status
rtw_hal_bb_get_efuse_info(struct rtw_hal_com_t * hal_com,u8 * efuse_map,enum rtw_efuse_info info_type,void * value,u8 size,u8 map_valid)1830 rtw_hal_bb_get_efuse_info(struct rtw_hal_com_t *hal_com, u8 *efuse_map,
1831 enum rtw_efuse_info info_type, void *value,
1832 u8 size, u8 map_valid)
1833 {
1834 return RTW_HAL_STATUS_SUCCESS;
1835 }
1836
hal_get_primary_channel_idx(u8 pri_ch,u8 central_ch,enum channel_width bw,enum chan_offset bw_offset)1837 u8 hal_get_primary_channel_idx(u8 pri_ch, u8 central_ch, enum channel_width bw,
1838 enum chan_offset bw_offset)
1839 {
1840 return 0;
1841 }
1842
rtw_hal_bb_set_ch_bw(struct hal_info_t * hal_info,enum phl_phy_idx phy_idx,u8 pri_ch,u8 central_ch_seg0,u8 central_ch_seg1,enum band_type band,enum channel_width bw)1843 enum rtw_hal_status rtw_hal_bb_set_ch_bw(struct hal_info_t *hal_info,
1844 enum phl_phy_idx phy_idx,
1845 u8 pri_ch,
1846 u8 central_ch_seg0,
1847 u8 central_ch_seg1,
1848 enum band_type band,
1849 enum channel_width bw)
1850 {
1851 return RTW_HAL_STATUS_SUCCESS;
1852 }
1853
rtw_hal_in_radar_domain(void * hal,u8 ch,enum channel_width bw)1854 bool rtw_hal_in_radar_domain(void *hal, u8 ch, enum channel_width bw)
1855 {
1856 return RTW_HAL_STATUS_SUCCESS;
1857 }
1858
1859 enum rtw_hal_status
rtw_hal_bb_dfs_rpt_cfg(struct hal_info_t * hal_info,bool dfs_en)1860 rtw_hal_bb_dfs_rpt_cfg(struct hal_info_t *hal_info, bool dfs_en)
1861 {
1862 return RTW_HAL_STATUS_SUCCESS;
1863 }
1864
rtw_hal_bb_radar_detect(struct hal_info_t * hal_info,struct hal_dfs_rpt * hal_dfs)1865 bool rtw_hal_bb_radar_detect(struct hal_info_t *hal_info,
1866 struct hal_dfs_rpt *hal_dfs)
1867 {
1868 return RTW_HAL_STATUS_SUCCESS;
1869 }
1870
1871 enum rtw_hal_status
rtw_hal_bb_ctrl_btg(struct rtw_hal_com_t * hal_com,bool btg)1872 rtw_hal_bb_ctrl_btg(struct rtw_hal_com_t *hal_com, bool btg)
1873 {
1874 return RTW_HAL_STATUS_SUCCESS;
1875 }
1876
1877 enum rtw_hal_status
rtw_hal_bb_ctrl_btc_preagc(struct rtw_hal_com_t * hal_com,bool bt_en)1878 rtw_hal_bb_ctrl_btc_preagc(struct rtw_hal_com_t *hal_com, bool bt_en)
1879 {
1880 return RTW_HAL_STATUS_SUCCESS;
1881 }
1882
1883 enum rtw_hal_status
rtw_hal_bb_cfg_rx_path(struct rtw_hal_com_t * hal_com,u8 rx_path)1884 rtw_hal_bb_cfg_rx_path(struct rtw_hal_com_t *hal_com, u8 rx_path)
1885 {
1886 return RTW_HAL_STATUS_SUCCESS;
1887 }
1888
1889 enum rtw_hal_status
rtw_hal_bb_cfg_tx_path(struct rtw_hal_com_t * hal_com,u8 tx_path)1890 rtw_hal_bb_cfg_tx_path(struct rtw_hal_com_t *hal_com, u8 tx_path)
1891 {
1892 return RTW_HAL_STATUS_SUCCESS;
1893 }
1894
rtw_hal_bb_get_rx_ok(struct hal_info_t * hal_info,u8 cur_phy_idx,u32 * rx_ok)1895 enum rtw_hal_status rtw_hal_bb_get_rx_ok(struct hal_info_t *hal_info,
1896 u8 cur_phy_idx, u32 *rx_ok)
1897 {
1898 return RTW_HAL_STATUS_SUCCESS;
1899 }
1900
rtw_hal_bb_get_rx_crc(struct hal_info_t * hal_info,u8 cur_phy_idx,u32 * rx_crc_err)1901 enum rtw_hal_status rtw_hal_bb_get_rx_crc(struct hal_info_t *hal_info,
1902 u8 cur_phy_idx, u32 *rx_crc_err)
1903 {
1904 return RTW_HAL_STATUS_SUCCESS;
1905 }
1906
rtw_hal_bb_set_reset_cnt(void * hal)1907 enum rtw_hal_status rtw_hal_bb_set_reset_cnt(void *hal)
1908 {
1909 return RTW_HAL_STATUS_SUCCESS;
1910 }
1911
1912 enum rtw_hal_status
rtw_hal_bb_set_power(struct rtw_hal_com_t * hal_com,s16 power_dbm,enum phl_phy_idx phy_idx)1913 rtw_hal_bb_set_power(struct rtw_hal_com_t *hal_com, s16 power_dbm,
1914 enum phl_phy_idx phy_idx)
1915 {
1916 return RTW_HAL_STATUS_SUCCESS;
1917 }
1918
1919 enum rtw_hal_status
rtw_hal_bb_get_power(struct rtw_hal_com_t * hal_com,s16 * power_dbm,enum phl_phy_idx phy_idx)1920 rtw_hal_bb_get_power(struct rtw_hal_com_t *hal_com, s16 *power_dbm,
1921 enum phl_phy_idx phy_idx)
1922 {
1923 return RTW_HAL_STATUS_SUCCESS;
1924 }
1925
1926 enum rtw_hal_status
rtw_hal_bb_set_pwr_index(void * hal,u16 pwr_idx,enum rf_path tx_path,bool is_cck)1927 rtw_hal_bb_set_pwr_index(void *hal, u16 pwr_idx, enum rf_path tx_path, bool is_cck)
1928 {
1929 return RTW_HAL_STATUS_SUCCESS;
1930 }
1931
rtw_hal_bb_get_pwr_index(void * hal,u16 * pwr_idx,enum rf_path tx_path,bool is_cck)1932 enum rtw_hal_status rtw_hal_bb_get_pwr_index(void *hal, u16 *pwr_idx,
1933 enum rf_path tx_path, bool is_cck)
1934 {
1935 return RTW_HAL_STATUS_SUCCESS;
1936 }
1937
1938 enum rtw_hal_status
rtw_hal_bb_set_plcp_tx(struct rtw_hal_com_t * hal_com,struct mp_plcp_param_t * plcp_tx_struct,struct mp_usr_plcp_gen_in * plcp_usr_info,enum phl_phy_idx plcp_phy_idx,u8 * plcp_sts)1939 rtw_hal_bb_set_plcp_tx(struct rtw_hal_com_t *hal_com,
1940 struct mp_plcp_param_t *plcp_tx_struct,
1941 struct mp_usr_plcp_gen_in *plcp_usr_info,
1942 enum phl_phy_idx plcp_phy_idx,
1943 u8 *plcp_sts)
1944 {
1945 return RTW_HAL_STATUS_SUCCESS;
1946 }
1947
1948 enum rtw_hal_status
rtw_hal_bb_set_pmac_cont_tx(struct rtw_hal_com_t * hal_com,u8 enable,u8 is_cck,enum phl_phy_idx phy_idx)1949 rtw_hal_bb_set_pmac_cont_tx(struct rtw_hal_com_t *hal_com, u8 enable,
1950 u8 is_cck, enum phl_phy_idx phy_idx)
1951 {
1952 return RTW_HAL_STATUS_SUCCESS;
1953 }
1954
1955 enum rtw_hal_status
rtw_hal_bb_set_pmac_packet_tx(struct rtw_hal_com_t * hal_com,u8 enable,u8 is_cck,u16 tx_cnt,u16 period,u16 tx_time,enum phl_phy_idx phy_idx)1956 rtw_hal_bb_set_pmac_packet_tx(struct rtw_hal_com_t *hal_com, u8 enable,
1957 u8 is_cck, u16 tx_cnt ,u16 period, u16 tx_time,
1958 enum phl_phy_idx phy_idx)
1959 {
1960 return RTW_HAL_STATUS_SUCCESS;
1961 }
1962
1963 enum rtw_hal_status
rtw_hal_bb_set_pmac_fw_trigger_tx(struct rtw_hal_com_t * hal_com,u8 enable,u8 is_cck,u16 tx_cnt,u8 tx_duty,enum phl_phy_idx phy_idx)1964 rtw_hal_bb_set_pmac_fw_trigger_tx(struct rtw_hal_com_t *hal_com, u8 enable,
1965 u8 is_cck, u16 tx_cnt, u8 tx_duty,
1966 enum phl_phy_idx phy_idx)
1967 {
1968 return RTW_HAL_STATUS_SUCCESS;
1969 }
1970
1971 enum rtw_hal_status
rtw_hal_bb_parse_phy_sts(void * hal,void * ppdu_sts,struct rtw_phl_rx_pkt * phl_rx,u8 is_su)1972 rtw_hal_bb_parse_phy_sts(void *hal, void *ppdu_sts,
1973 struct rtw_phl_rx_pkt *phl_rx, u8 is_su)
1974 {
1975 return RTW_HAL_STATUS_SUCCESS;
1976 }
1977
rtw_hal_bb_get_tx_ok(void * hal,u8 cur_phy_idx,u32 * tx_ok)1978 enum rtw_hal_status rtw_hal_bb_get_tx_ok(void *hal, u8 cur_phy_idx, u32 *tx_ok)
1979 {
1980 return RTW_HAL_STATUS_SUCCESS;
1981 }
1982
1983 enum rtw_hal_status
rtw_hal_bb_get_txpwr_ref(struct hal_info_t * hal_info,u8 is_cck,u8 tx_path,s16 * txpwr_ref)1984 rtw_hal_bb_get_txpwr_ref(struct hal_info_t *hal_info, u8 is_cck, u8 tx_path,
1985 s16 *txpwr_ref)
1986 {
1987 return RTW_HAL_STATUS_SUCCESS;
1988 }
1989
rtw_hal_bb_get_rssi(struct hal_info_t * hal_info,enum rf_path rx_path,u8 * rssi)1990 enum rtw_hal_status rtw_hal_bb_get_rssi(struct hal_info_t *hal_info,
1991 enum rf_path rx_path, u8 *rssi)
1992 {
1993 return RTW_HAL_STATUS_SUCCESS;
1994 }
1995
rtw_hal_bb_get_rssi_ex(struct hal_info_t * hal_info,enum rf_path rx_path,s16 * rssi,u8 cur_phy_idx)1996 enum rtw_hal_status rtw_hal_bb_get_rssi_ex(struct hal_info_t *hal_info,
1997 enum rf_path rx_path, s16 *rssi, u8 cur_phy_idx)
1998 {
1999 return RTW_HAL_STATUS_SUCCESS;
2000 }
2001
rtw_hal_bb_get_rxevm(struct hal_info_t * hal_info,u8 user,u8 strm,u8 rxevm_table,u8 * rx_evm)2002 enum rtw_hal_status rtw_hal_bb_get_rxevm(struct hal_info_t *hal_info, u8 user,
2003 u8 strm, u8 rxevm_table, u8 *rx_evm)
2004 {
2005 return RTW_HAL_STATUS_SUCCESS;
2006 }
2007
rtw_hal_bb_trigger_rxevm(struct hal_info_t * hal_info,u8 cur_phy_idx,u32 * phy0_user0_rxevm,u32 * phy0_user1_rxevm,u32 * phy0_user2_rxevm,u32 * phy0_user3_rxevm,u32 * phy1_user0_rxevm,u32 * phy1_user1_rxevm,u32 * phy1_user2_rxevm,u32 * phy1_user3_rxevm)2008 enum rtw_hal_status rtw_hal_bb_trigger_rxevm(struct hal_info_t *hal_info, u8 cur_phy_idx,
2009 u32 *phy0_user0_rxevm, u32 *phy0_user1_rxevm, u32 *phy0_user2_rxevm, u32 *phy0_user3_rxevm,
2010 u32 *phy1_user0_rxevm, u32 *phy1_user1_rxevm, u32 *phy1_user2_rxevm, u32 *phy1_user3_rxevm)
2011 {
2012 return RTW_HAL_STATUS_SUCCESS;
2013 }
2014
2015 /* mode: 0 = tmac, 1 = pmac */
2016 enum rtw_hal_status
rtw_hal_bb_tx_mode_switch(struct rtw_hal_com_t * hal_com,enum phl_phy_idx phy_idx,u8 mode)2017 rtw_hal_bb_tx_mode_switch(struct rtw_hal_com_t *hal_com,
2018 enum phl_phy_idx phy_idx, u8 mode)
2019 {
2020 return RTW_HAL_STATUS_SUCCESS;
2021 }
2022
rtw_hal_bb_set_txsc(struct hal_info_t * hal_info,u8 txsc,enum phl_phy_idx phy_idx)2023 enum rtw_hal_status rtw_hal_bb_set_txsc(struct hal_info_t *hal_info, u8 txsc,
2024 enum phl_phy_idx phy_idx)
2025 {
2026 return RTW_HAL_STATUS_FAILURE;
2027 }
2028
rtw_hal_bb_get_txsc(struct rtw_hal_com_t * hal_com,u8 pri_ch,u8 central_ch,enum channel_width cbw,enum channel_width dbw)2029 u8 rtw_hal_bb_get_txsc(struct rtw_hal_com_t *hal_com, u8 pri_ch,
2030 u8 central_ch, enum channel_width cbw, enum channel_width dbw)
2031 {
2032 return 0;
2033 }
2034
rtw_hal_bb_process_c2h(void * hal,struct rtw_c2h_info * c2h)2035 u32 rtw_hal_bb_process_c2h(void *hal, struct rtw_c2h_info *c2h)
2036 {
2037 return 0;
2038 }
2039
2040 #ifdef CONFIG_DBCC_SUPPORT
2041 enum rtw_hal_status
rtw_hal_phy_dbcc_pre_cfg(struct hal_info_t * hal_info,struct rtw_phl_com_t * phl_com,bool dbcc_en)2042 rtw_hal_phy_dbcc_pre_cfg(struct hal_info_t *hal_info,
2043 struct rtw_phl_com_t *phl_com, bool dbcc_en)
2044 {
2045 return RTW_HAL_STATUS_SUCCESS;
2046 }
2047 enum rtw_hal_status
rtw_hal_phy_dbcc_cfg(struct hal_info_t * hal_info,struct rtw_phl_com_t * phl_com,bool dbcc_en)2048 rtw_hal_phy_dbcc_cfg(struct hal_info_t *hal_info,
2049 struct rtw_phl_com_t *phl_com, bool dbcc_en)
2050 {
2051 return RTW_HAL_STATUS_SUCCESS;
2052 }
2053 #endif
2054
2055 enum rtw_hal_status
rtw_hal_bb_get_txinfo_power(struct hal_info_t * hal_info,s16 * txinfo_power_dbm)2056 rtw_hal_bb_get_txinfo_power(struct hal_info_t *hal_info,
2057 s16 *txinfo_power_dbm)
2058 {
2059 return RTW_HAL_STATUS_SUCCESS;
2060 }
2061
2062 enum rtw_hal_status
rtw_hal_bb_ctrl_rf_mode(struct hal_info_t * hal_info,enum phl_rf_mode rf_mode)2063 rtw_hal_bb_ctrl_rf_mode(struct hal_info_t *hal_info,
2064 enum phl_rf_mode rf_mode){
2065 return RTW_HAL_STATUS_SUCCESS;
2066 }
2067
2068 enum rtw_hal_status
rtw_hal_bb_set_sta_id(struct hal_info_t * hal_info,u16 staid,enum phl_phy_idx phy_idx)2069 rtw_hal_bb_set_sta_id(struct hal_info_t *hal_info,
2070 u16 staid, enum phl_phy_idx phy_idx)
2071 {
2072 return RTW_HAL_STATUS_SUCCESS;
2073 }
2074
2075 enum rtw_hal_status
rtw_hal_bb_set_bss_color(struct hal_info_t * hal_info,u8 bsscolor,enum phl_phy_idx phy_idx)2076 rtw_hal_bb_set_bss_color(struct hal_info_t *hal_info,
2077 u8 bsscolor, enum phl_phy_idx phy_idx)
2078 {
2079 return RTW_HAL_STATUS_SUCCESS;
2080 }
2081
2082 #ifdef RTW_WKARD_DEF_CMACTBL_CFG
2083 enum rtw_hal_status
rtw_hal_bb_trx_path_cfg(struct hal_info_t * hal_info,enum rf_path tx,u8 tx_nss,enum rf_path rx,u8 rx_nss)2084 rtw_hal_bb_trx_path_cfg(struct hal_info_t *hal_info,
2085 enum rf_path tx, u8 tx_nss, enum rf_path rx, u8 rx_nss)
2086 {
2087 return RTW_HAL_STATUS_SUCCESS;
2088 }
2089
rtw_hal_bb_cfg_cmac_tx_ant(struct hal_info_t * hal_info,enum rf_path tx_path)2090 u16 rtw_hal_bb_cfg_cmac_tx_ant(struct hal_info_t *hal_info,
2091 enum rf_path tx_path)
2092 {
2093 return 0;
2094 }
2095 #endif
2096
2097 enum rtw_hal_status
rtw_hal_bb_backup_info(struct rtw_hal_com_t * hal_com,u8 cur_phy_idx)2098 rtw_hal_bb_backup_info(struct rtw_hal_com_t *hal_com, u8 cur_phy_idx)
2099 {
2100 return RTW_HAL_STATUS_SUCCESS;
2101 }
2102
2103 enum rtw_hal_status
rtw_hal_bb_restore_info(struct rtw_hal_com_t * hal_com,u8 cur_phy_idx)2104 rtw_hal_bb_restore_info(struct rtw_hal_com_t *hal_com, u8 cur_phy_idx)
2105 {
2106 return RTW_HAL_STATUS_SUCCESS;
2107 }
2108
rtw_hal_bb_set_tx_pow_ref(struct rtw_hal_com_t * hal_com,enum phl_phy_idx phy_idx)2109 void rtw_hal_bb_set_tx_pow_ref(struct rtw_hal_com_t *hal_com,
2110 enum phl_phy_idx phy_idx)
2111 {
2112 }
2113
2114 enum rtw_hal_status
rtw_hal_bb_tssi_bb_reset(struct rtw_hal_com_t * hal_com)2115 rtw_hal_bb_tssi_bb_reset(struct rtw_hal_com_t *hal_com)
2116 {
2117 return RTW_HAL_STATUS_SUCCESS;
2118 }
2119
2120 #ifdef CONFIG_RTW_ACS
rtw_hal_bb_acs_mntr_trigger(struct hal_info_t * hal_info,u16 monitor_time)2121 void rtw_hal_bb_acs_mntr_trigger(struct hal_info_t *hal_info, u16 monitor_time)
2122 {
2123
2124 }
2125
rtw_hal_bb_acs_mntr_result(struct hal_info_t * hal_info,void * rpt)2126 enum rtw_hal_status rtw_hal_bb_acs_mntr_result(struct hal_info_t *hal_info, void *rpt)
2127 {
2128 return RTW_HAL_STATUS_FAILURE;
2129 }
2130 #endif /* CONFIG_RTW_ACS */
2131 #ifdef RTW_WKARD_DYNAMIC_BFEE_CAP
rtw_hal_bb_dcr_en(struct hal_info_t * hal_info,bool en)2132 void rtw_hal_bb_dcr_en(struct hal_info_t *hal_info, bool en)
2133 {
2134 return;
2135 }
2136
rtw_hal_bb_csi_rsp(struct hal_info_t * hal_info)2137 bool rtw_hal_bb_csi_rsp(struct hal_info_t *hal_info)
2138 {
2139 return true;
2140 }
2141
2142
2143 #endif
2144
rtw_hal_bb_get_efuse_init(struct rtw_hal_com_t * hal_com)2145 void rtw_hal_bb_get_efuse_init(struct rtw_hal_com_t *hal_com)
2146 {
2147
2148 }
2149
rtw_hal_bb_notification(struct hal_info_t * hal_info,enum phl_msg_evt_id event,enum phl_phy_idx phy_idx)2150 void rtw_hal_bb_notification(struct hal_info_t *hal_info,
2151 enum phl_msg_evt_id event,
2152 enum phl_phy_idx phy_idx)
2153 {
2154
2155 }
2156
rtw_hal_bb_cmd_notification(struct hal_info_t * hal_info,void * hal_cmd,enum phl_phy_idx phy_idx)2157 void rtw_hal_bb_cmd_notification(struct hal_info_t *hal_info,
2158 void *hal_cmd,
2159 enum phl_phy_idx phy_idx)
2160 {
2161
2162 }
2163
2164 enum rtw_hal_status
rtw_hal_bb_set_dpd_bypass(struct rtw_hal_com_t * hal_com,bool pdp_bypass,enum phl_phy_idx phy_idx)2165 rtw_hal_bb_set_dpd_bypass(struct rtw_hal_com_t *hal_com, bool pdp_bypass,
2166 enum phl_phy_idx phy_idx)
2167 {
2168 return RTW_HAL_STATUS_SUCCESS;
2169 }
2170
2171
2172 enum rtw_hal_status
rtw_hal_bb_set_gain_offset(struct hal_info_t * hal_info,s8 rx_gain_offset,enum rf_path rx_path,enum phl_phy_idx phy_idx,u8 iscck)2173 rtw_hal_bb_set_gain_offset(struct hal_info_t *hal_info, s8 rx_gain_offset,
2174 enum rf_path rx_path, enum phl_phy_idx phy_idx, u8 iscck)
2175 {
2176 return RTW_HAL_STATUS_SUCCESS;
2177 }
2178
2179
rtw_hal_bb_check_tx_idle(struct hal_info_t * hal_info,enum phl_phy_idx phy_idx)2180 bool rtw_hal_bb_check_tx_idle(struct hal_info_t *hal_info, enum phl_phy_idx phy_idx)
2181 {
2182 return false;
2183 }
2184
2185 enum rtw_hal_status
rtw_hal_bb_ic_hw_setting_init(struct hal_info_t * hal_info)2186 rtw_hal_bb_ic_hw_setting_init(struct hal_info_t *hal_info)
2187 {
2188
2189 return RTW_HAL_STATUS_FAILURE;
2190 }
2191
2192 enum rtw_hal_status
rtw_hal_bb_query_rainfo(void * hal,struct rtw_hal_stainfo_t * hal_sta,struct rtw_phl_rainfo * phl_rainfo)2193 rtw_hal_bb_query_rainfo(void *hal, struct rtw_hal_stainfo_t *hal_sta,
2194 struct rtw_phl_rainfo *phl_rainfo)
2195 {
2196 return RTW_HAL_STATUS_FAILURE;
2197 }
2198
2199
rtw_hal_bb_nhm_mntr_result(struct rtw_hal_com_t * hal_com,void * rpt,enum phl_phy_idx phy_idx)2200 void rtw_hal_bb_nhm_mntr_result(struct rtw_hal_com_t *hal_com, void *rpt, enum phl_phy_idx phy_idx)
2201 {
2202
2203 }
2204
2205
rtw_hal_bb_set_pow_patten_sharp(struct rtw_hal_com_t * hal_com,u8 channel,u8 is_cck,u8 sharp_id,enum phl_phy_idx phy_idx)2206 void rtw_hal_bb_set_pow_patten_sharp(struct rtw_hal_com_t *hal_com, u8 channel, u8 is_cck, u8 sharp_id, enum phl_phy_idx phy_idx)
2207 {
2208
2209 }
2210
rtw_hal_bb_env_rpt(struct rtw_hal_com_t * hal_com,struct rtw_env_report * env_rpt,enum phl_phy_idx phy_indx)2211 void rtw_hal_bb_env_rpt(struct rtw_hal_com_t *hal_com, struct rtw_env_report *env_rpt,
2212 enum phl_phy_idx phy_indx)
2213 {
2214
2215 }
2216
2217
2218 enum rtw_hal_status
rtw_hal_bb_set_tb_pwr_ofst(struct hal_info_t * hal_info,s16 ofst,enum phl_phy_idx phy_idx)2219 rtw_hal_bb_set_tb_pwr_ofst(struct hal_info_t *hal_info,
2220 s16 ofst, enum phl_phy_idx phy_idx)
2221 {
2222 return RTW_HAL_STATUS_SUCCESS;
2223 }
2224
2225 #ifdef CONFIG_MCC_SUPPORT
2226 enum rtw_hal_status
rtw_hal_bb_upd_mcc_macid(struct hal_info_t * hal_info,struct rtw_phl_mcc_role * mrole)2227 rtw_hal_bb_upd_mcc_macid(struct hal_info_t *hal_info,
2228 struct rtw_phl_mcc_role *mrole)
2229 {
2230 return RTW_HAL_STATUS_SUCCESS;
2231 }
2232
2233 void
rtw_hal_bb_mcc_stop(struct hal_info_t * hal_info)2234 rtw_hal_bb_mcc_stop(struct hal_info_t *hal_info)
2235 {
2236
2237 }
2238
2239 enum rtw_hal_status
rtw_hal_bb_mcc_start(struct hal_info_t * hal_info,struct rtw_phl_mcc_role * m_role1,struct rtw_phl_mcc_role * m_role2)2240 rtw_hal_bb_mcc_start(struct hal_info_t *hal_info,
2241 struct rtw_phl_mcc_role *m_role1,
2242 struct rtw_phl_mcc_role *m_role2)
2243 {
2244 return RTW_HAL_STATUS_SUCCESS;
2245 }
2246 #endif
2247 #endif /*ifdef USE_TRUE_PHY*/
2248