1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-27 07:34:04 +00:00
rtl8812au/hal/phydm/txbf/halcomtxbf.c

521 lines
14 KiB
C
Raw Normal View History

2018-06-22 16:48:32 +00:00
/******************************************************************************
*
* Copyright(c) 2016 - 2017 Realtek Corporation.
*
* 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.
*
*****************************************************************************/
2019-05-24 19:43:57 +00:00
/*@************************************************************
2018-06-22 16:48:32 +00:00
* Description:
*
* This file is for TXBF mechanism
*
2019-05-24 19:43:57 +00:00
************************************************************/
2018-06-22 16:48:32 +00:00
#include "mp_precomp.h"
#include "../phydm_precomp.h"
2019-05-24 19:43:57 +00:00
#ifdef PHYDM_BEAMFORMING_SUPPORT
/*@Beamforming halcomtxbf API create by YuChen 2015/05*/
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
void hal_com_txbf_beamform_init(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
boolean is_iqgen_setting_ok = false;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
if (dm->support_ic_type & ODM_RTL8814A) {
is_iqgen_setting_ok = phydm_beamforming_set_iqgen_8814A(dm);
2019-05-24 19:43:57 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] is_iqgen_setting_ok = %d\n",
__func__, is_iqgen_setting_ok);
2018-06-22 16:48:32 +00:00
}
}
2019-05-24 19:43:57 +00:00
/*Only used for MU BFer Entry when get GID management frame (self as MU STA)*/
void hal_com_txbf_config_gtab(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (dm->support_ic_type & ODM_RTL8822B)
2018-08-24 20:52:34 +00:00
hal_txbf_8822b_config_gtab(dm);
2018-06-22 16:48:32 +00:00
}
2019-05-24 19:43:57 +00:00
void phydm_beamform_set_sounding_enter(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (!odm_is_work_item_scheduled(&p_txbf_info->txbf_enter_work_item))
odm_schedule_work_item(&p_txbf_info->txbf_enter_work_item);
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
hal_com_txbf_enter_work_item_callback(dm);
2018-06-22 16:48:32 +00:00
#endif
}
2019-05-24 19:43:57 +00:00
void phydm_beamform_set_sounding_leave(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (!odm_is_work_item_scheduled(&p_txbf_info->txbf_leave_work_item))
odm_schedule_work_item(&p_txbf_info->txbf_leave_work_item);
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
hal_com_txbf_leave_work_item_callback(dm);
2018-06-22 16:48:32 +00:00
#endif
}
2019-05-24 19:43:57 +00:00
void phydm_beamform_set_sounding_rate(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (!odm_is_work_item_scheduled(&p_txbf_info->txbf_rate_work_item))
odm_schedule_work_item(&p_txbf_info->txbf_rate_work_item);
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
hal_com_txbf_rate_work_item_callback(dm);
2018-06-22 16:48:32 +00:00
#endif
}
2019-05-24 19:43:57 +00:00
void phydm_beamform_set_sounding_status(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (!odm_is_work_item_scheduled(&p_txbf_info->txbf_status_work_item))
odm_schedule_work_item(&p_txbf_info->txbf_status_work_item);
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
hal_com_txbf_status_work_item_callback(dm);
2018-06-22 16:48:32 +00:00
#endif
}
2019-05-24 19:43:57 +00:00
void phydm_beamform_set_sounding_fw_ndpa(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
if (*dm->is_fw_dw_rsvd_page_in_progress)
2019-05-24 19:43:57 +00:00
odm_set_timer(dm, &p_txbf_info->txbf_fw_ndpa_timer, 5);
2018-06-22 16:48:32 +00:00
else
2019-05-24 19:43:57 +00:00
odm_schedule_work_item(&p_txbf_info->txbf_fw_ndpa_work_item);
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
hal_com_txbf_fw_ndpa_work_item_callback(dm);
2018-06-22 16:48:32 +00:00
#endif
}
2019-05-24 19:43:57 +00:00
void phydm_beamform_set_sounding_clk(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (!odm_is_work_item_scheduled(&p_txbf_info->txbf_clk_work_item))
odm_schedule_work_item(&p_txbf_info->txbf_clk_work_item);
2018-06-22 16:48:32 +00:00
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
2019-05-24 19:43:57 +00:00
phydm_run_in_thread_cmd(dm, hal_com_txbf_clk_work_item_callback, dm);
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
hal_com_txbf_clk_work_item_callback(dm);
2018-06-22 16:48:32 +00:00
#endif
}
2019-05-24 19:43:57 +00:00
void phydm_beamform_set_reset_tx_path(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
struct _RT_WORK_ITEM *pwi = &p_txbf_info->txbf_reset_tx_path_work_item;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (!odm_is_work_item_scheduled(pwi))
odm_schedule_work_item(pwi);
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
hal_com_txbf_reset_tx_path_work_item_callback(dm);
2018-06-22 16:48:32 +00:00
#endif
}
2019-05-24 19:43:57 +00:00
void phydm_beamform_set_get_tx_rate(
void *dm_void)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
struct _RT_WORK_ITEM *pwi = &p_txbf_info->txbf_get_tx_rate_work_item;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (!odm_is_work_item_scheduled(pwi))
odm_schedule_work_item(pwi);
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
hal_com_txbf_get_tx_rate_work_item_callback(dm);
2018-06-22 16:48:32 +00:00
#endif
}
2019-05-24 19:43:57 +00:00
void hal_com_txbf_enter_work_item_callback(
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
)
2018-06-22 16:48:32 +00:00
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
u8 idx = p_txbf_info->txbf_idx;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__);
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821))
2018-08-24 20:52:34 +00:00
hal_txbf_jaguar_enter(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8192E)
2018-08-24 20:52:34 +00:00
hal_txbf_8192e_enter(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8814A)
2018-08-24 20:52:34 +00:00
hal_txbf_8814a_enter(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8822B)
2018-08-24 20:52:34 +00:00
hal_txbf_8822b_enter(dm, idx);
2018-06-22 16:48:32 +00:00
}
2019-05-24 19:43:57 +00:00
void hal_com_txbf_leave_work_item_callback(
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
)
2018-06-22 16:48:32 +00:00
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
u8 idx = p_txbf_info->txbf_idx;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__);
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821))
2018-08-24 20:52:34 +00:00
hal_txbf_jaguar_leave(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8192E)
2018-08-24 20:52:34 +00:00
hal_txbf_8192e_leave(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8814A)
2018-08-24 20:52:34 +00:00
hal_txbf_8814a_leave(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8822B)
2018-08-24 20:52:34 +00:00
hal_txbf_8822b_leave(dm, idx);
2018-06-22 16:48:32 +00:00
}
2019-05-24 19:43:57 +00:00
void hal_com_txbf_fw_ndpa_work_item_callback(
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
)
2018-06-22 16:48:32 +00:00
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
u8 idx = p_txbf_info->ndpa_idx;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__);
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821))
2018-08-24 20:52:34 +00:00
hal_txbf_jaguar_fw_txbf(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8192E)
2018-08-24 20:52:34 +00:00
hal_txbf_8192e_fw_tx_bf(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8814A)
2018-08-24 20:52:34 +00:00
hal_txbf_8814a_fw_txbf(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8822B)
2018-08-24 20:52:34 +00:00
hal_txbf_8822b_fw_txbf(dm, idx);
2018-06-22 16:48:32 +00:00
}
2019-05-24 19:43:57 +00:00
void hal_com_txbf_clk_work_item_callback(
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
)
2018-06-22 16:48:32 +00:00
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#endif
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__);
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
if (dm->support_ic_type & ODM_RTL8812)
hal_txbf_jaguar_clk_8812a(dm);
2018-06-22 16:48:32 +00:00
}
2019-05-24 19:43:57 +00:00
void hal_com_txbf_rate_work_item_callback(
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
)
2018-06-22 16:48:32 +00:00
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
u8 BW = p_txbf_info->BW;
u8 rate = p_txbf_info->rate;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__);
if (dm->support_ic_type & ODM_RTL8812)
hal_txbf_8812a_set_ndpa_rate(dm, BW, rate);
else if (dm->support_ic_type & ODM_RTL8192E)
hal_txbf_8192e_set_ndpa_rate(dm, BW, rate);
else if (dm->support_ic_type & ODM_RTL8814A)
hal_txbf_8814a_set_ndpa_rate(dm, BW, rate);
2018-06-22 16:48:32 +00:00
}
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void hal_com_txbf_fw_ndpa_timer_callback(
struct phydm_timer_list *timer)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
void *adapter = (void *)timer->Adapter;
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__);
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
if (*dm->is_fw_dw_rsvd_page_in_progress)
odm_set_timer(dm, &(p_txbf_info->txbf_fw_ndpa_timer), 5);
2018-06-22 16:48:32 +00:00
else
odm_schedule_work_item(&(p_txbf_info->txbf_fw_ndpa_work_item));
}
#endif
2019-05-24 19:43:57 +00:00
void hal_com_txbf_status_work_item_callback(
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
)
2018-06-22 16:48:32 +00:00
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
u8 idx = p_txbf_info->txbf_idx;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__);
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
if (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821))
2018-08-24 20:52:34 +00:00
hal_txbf_jaguar_status(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8192E)
2018-08-24 20:52:34 +00:00
hal_txbf_8192e_status(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8814A)
2018-08-24 20:52:34 +00:00
hal_txbf_8814a_status(dm, idx);
2019-05-24 19:43:57 +00:00
else if (dm->support_ic_type & ODM_RTL8822B)
2018-08-24 20:52:34 +00:00
hal_txbf_8822b_status(dm, idx);
2018-06-22 16:48:32 +00:00
}
2019-05-24 19:43:57 +00:00
void hal_com_txbf_reset_tx_path_work_item_callback(
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
)
2018-06-22 16:48:32 +00:00
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
u8 idx = p_txbf_info->txbf_idx;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
if (dm->support_ic_type & ODM_RTL8814A)
hal_txbf_8814a_reset_tx_path(dm, idx);
2018-06-22 16:48:32 +00:00
}
2019-05-24 19:43:57 +00:00
void hal_com_txbf_get_tx_rate_work_item_callback(
2018-06-22 16:48:32 +00:00
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
2019-05-24 19:43:57 +00:00
)
2018-06-22 16:48:32 +00:00
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
2018-06-22 16:48:32 +00:00
#else
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
#endif
2018-08-24 20:52:34 +00:00
if (dm->support_ic_type & ODM_RTL8814A)
hal_txbf_8814a_get_tx_rate(dm);
2018-06-22 16:48:32 +00:00
}
boolean
hal_com_txbf_set(
2019-05-24 19:43:57 +00:00
void *dm_void,
u8 set_type,
void *p_in_buf)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
u8 *p_u1_tmp = (u8 *)p_in_buf;
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] set_type = 0x%X\n", __func__, set_type);
2018-06-22 16:48:32 +00:00
switch (set_type) {
case TXBF_SET_SOUNDING_ENTER:
p_txbf_info->txbf_idx = *p_u1_tmp;
2018-08-24 20:52:34 +00:00
phydm_beamform_set_sounding_enter(dm);
2018-06-22 16:48:32 +00:00
break;
case TXBF_SET_SOUNDING_LEAVE:
p_txbf_info->txbf_idx = *p_u1_tmp;
2018-08-24 20:52:34 +00:00
phydm_beamform_set_sounding_leave(dm);
2018-06-22 16:48:32 +00:00
break;
case TXBF_SET_SOUNDING_RATE:
p_txbf_info->BW = p_u1_tmp[0];
p_txbf_info->rate = p_u1_tmp[1];
2018-08-24 20:52:34 +00:00
phydm_beamform_set_sounding_rate(dm);
2018-06-22 16:48:32 +00:00
break;
case TXBF_SET_SOUNDING_STATUS:
p_txbf_info->txbf_idx = *p_u1_tmp;
2018-08-24 20:52:34 +00:00
phydm_beamform_set_sounding_status(dm);
2018-06-22 16:48:32 +00:00
break;
case TXBF_SET_SOUNDING_FW_NDPA:
p_txbf_info->ndpa_idx = *p_u1_tmp;
2018-08-24 20:52:34 +00:00
phydm_beamform_set_sounding_fw_ndpa(dm);
2018-06-22 16:48:32 +00:00
break;
case TXBF_SET_SOUNDING_CLK:
2018-08-24 20:52:34 +00:00
phydm_beamform_set_sounding_clk(dm);
2018-06-22 16:48:32 +00:00
break;
case TXBF_SET_TX_PATH_RESET:
p_txbf_info->txbf_idx = *p_u1_tmp;
2018-08-24 20:52:34 +00:00
phydm_beamform_set_reset_tx_path(dm);
2018-06-22 16:48:32 +00:00
break;
case TXBF_SET_GET_TX_RATE:
2018-08-24 20:52:34 +00:00
phydm_beamform_set_get_tx_rate(dm);
2018-06-22 16:48:32 +00:00
break;
}
return true;
}
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
boolean
hal_com_txbf_get(
2019-05-24 19:43:57 +00:00
void *adapter,
u8 get_type,
void *p_out_buf)
2018-06-22 16:48:32 +00:00
{
2019-05-24 19:43:57 +00:00
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(((PADAPTER)adapter));
struct dm_struct *dm = &hal_data->DM_OutSrc;
boolean *p_boolean = (boolean *)p_out_buf;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__);
2018-06-22 16:48:32 +00:00
if (get_type == TXBF_GET_EXPLICIT_BEAMFORMEE) {
if (IS_HARDWARE_TYPE_OLDER_THAN_8812A(adapter))
*p_boolean = false;
2019-05-24 19:43:57 +00:00
else if (/*@IS_HARDWARE_TYPE_8822B(adapter) ||*/
IS_HARDWARE_TYPE_8821B(adapter) ||
IS_HARDWARE_TYPE_8192E(adapter) ||
IS_HARDWARE_TYPE_8192F(adapter) ||
IS_HARDWARE_TYPE_JAGUAR(adapter) ||
IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(adapter) ||
IS_HARDWARE_TYPE_JAGUAR3(adapter))
2018-06-22 16:48:32 +00:00
*p_boolean = true;
else
*p_boolean = false;
} else if (get_type == TXBF_GET_EXPLICIT_BEAMFORMER) {
if (IS_HARDWARE_TYPE_OLDER_THAN_8812A(adapter))
*p_boolean = false;
2019-05-24 19:43:57 +00:00
else if (/*@IS_HARDWARE_TYPE_8822B(adapter) ||*/
IS_HARDWARE_TYPE_8821B(adapter) ||
IS_HARDWARE_TYPE_8192E(adapter) ||
IS_HARDWARE_TYPE_8192F(adapter) ||
IS_HARDWARE_TYPE_JAGUAR(adapter) ||
IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(adapter) ||
IS_HARDWARE_TYPE_JAGUAR3(adapter)) {
if (hal_data->RF_Type == RF_2T2R ||
hal_data->RF_Type == RF_3T3R ||
hal_data->RF_Type == RF_4T4R)
2018-06-22 16:48:32 +00:00
*p_boolean = true;
else
*p_boolean = false;
} else
*p_boolean = false;
} else if (get_type == TXBF_GET_MU_MIMO_STA) {
2019-05-24 19:43:57 +00:00
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) ||\
(RTL8822C_SUPPORT == 1))
if (IS_HARDWARE_TYPE_8822B(adapter) ||
IS_HARDWARE_TYPE_8821C(adapter) ||
IS_HARDWARE_TYPE_JAGUAR3(adapter))
2018-06-22 16:48:32 +00:00
*p_boolean = true;
else
#endif
*p_boolean = false;
} else if (get_type == TXBF_GET_MU_MIMO_AP) {
2019-05-24 19:43:57 +00:00
#if ((RTL8822B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1))
if (IS_HARDWARE_TYPE_8822B(adapter) ||
IS_HARDWARE_TYPE_JAGUAR3(adapter))
2018-06-22 16:48:32 +00:00
*p_boolean = true;
else
#endif
*p_boolean = false;
}
return true;
}
#endif
#endif