1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-23 13:49:57 +00:00
rtl8812au/hal/phydm/txbf/halcomtxbf.c

558 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.
*
*****************************************************************************/
/* ************************************************************
* Description:
*
* This file is for TXBF mechanism
*
* ************************************************************ */
#include "mp_precomp.h"
#include "../phydm_precomp.h"
#if (BEAMFORMING_SUPPORT == 1)
/*Beamforming halcomtxbf API create by YuChen 2015/05*/
void
hal_com_txbf_beamform_init(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
boolean is_iqgen_setting_ok = false;
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);
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
}
}
/*Only used for MU BFer Entry when get GID management frame (self is as MU STA)*/
void
hal_com_txbf_config_gtab(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +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
}
void
phydm_beamform_set_sounding_enter(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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)
2018-08-24 20:52:34 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
if (odm_is_work_item_scheduled(&(p_txbf_info->txbf_enter_work_item)) == false)
odm_schedule_work_item(&(p_txbf_info->txbf_enter_work_item));
#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
}
void
phydm_beamform_set_sounding_leave(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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)
2018-08-24 20:52:34 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
if (odm_is_work_item_scheduled(&(p_txbf_info->txbf_leave_work_item)) == false)
odm_schedule_work_item(&(p_txbf_info->txbf_leave_work_item));
#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
}
void
phydm_beamform_set_sounding_rate(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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)
2018-08-24 20:52:34 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
if (odm_is_work_item_scheduled(&(p_txbf_info->txbf_rate_work_item)) == false)
odm_schedule_work_item(&(p_txbf_info->txbf_rate_work_item));
#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
}
void
phydm_beamform_set_sounding_status(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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)
2018-08-24 20:52:34 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
if (odm_is_work_item_scheduled(&(p_txbf_info->txbf_status_work_item)) == false)
odm_schedule_work_item(&(p_txbf_info->txbf_status_work_item));
#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
}
void
phydm_beamform_set_sounding_fw_ndpa(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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)
2018-08-24 20:52:34 +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)
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));
#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
}
void
phydm_beamform_set_sounding_clk(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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)
2018-08-24 20:52:34 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
if (odm_is_work_item_scheduled(&(p_txbf_info->txbf_clk_work_item)) == false)
odm_schedule_work_item(&(p_txbf_info->txbf_clk_work_item));
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
2018-08-24 20:52:34 +00:00
void *padapter = dm->adapter;
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
rtw_run_in_thread_cmd(padapter, 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
}
void
phydm_beamform_set_reset_tx_path(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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)
2018-08-24 20:52:34 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
if (odm_is_work_item_scheduled(&(p_txbf_info->txbf_reset_tx_path_work_item)) == false)
odm_schedule_work_item(&(p_txbf_info->txbf_reset_tx_path_work_item));
#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
}
void
phydm_beamform_set_get_tx_rate(
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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)
2018-08-24 20:52:34 +00:00
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
if (odm_is_work_item_scheduled(&(p_txbf_info->txbf_get_tx_rate_work_item)) == false)
odm_schedule_work_item(&(p_txbf_info->txbf_get_tx_rate_work_item));
#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
}
void
hal_com_txbf_enter_work_item_callback(
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
u8 idx = p_txbf_info->txbf_idx;
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 (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821)) {
2018-08-24 20:52:34 +00:00
hal_txbf_jaguar_enter(dm, idx);
} else if (dm->support_ic_type & ODM_RTL8192E) {
2018-08-24 20:52:34 +00:00
hal_txbf_8192e_enter(dm, idx);
} else if (dm->support_ic_type & ODM_RTL8814A) {
2018-08-24 20:52:34 +00:00
hal_txbf_8814a_enter(dm, idx);
} 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
}
void
hal_com_txbf_leave_work_item_callback(
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
u8 idx = p_txbf_info->txbf_idx;
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 (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821)) {
2018-08-24 20:52:34 +00:00
hal_txbf_jaguar_leave(dm, idx);
} else if (dm->support_ic_type & ODM_RTL8192E) {
2018-08-24 20:52:34 +00:00
hal_txbf_8192e_leave(dm, idx);
} else if (dm->support_ic_type & ODM_RTL8814A) {
2018-08-24 20:52:34 +00:00
hal_txbf_8814a_leave(dm, idx);
} 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
}
void
hal_com_txbf_fw_ndpa_work_item_callback(
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
u8 idx = p_txbf_info->ndpa_idx;
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 (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821)) {
2018-08-24 20:52:34 +00:00
hal_txbf_jaguar_fw_txbf(dm, idx);
} else if (dm->support_ic_type & ODM_RTL8192E) {
2018-08-24 20:52:34 +00:00
hal_txbf_8192e_fw_tx_bf(dm, idx);
} else if (dm->support_ic_type & ODM_RTL8814A) {
2018-08-24 20:52:34 +00:00
hal_txbf_8814a_fw_txbf(dm, idx);
} 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
}
void
hal_com_txbf_clk_work_item_callback(
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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
}
void
hal_com_txbf_rate_work_item_callback(
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
u8 BW = p_txbf_info->BW;
u8 rate = p_txbf_info->rate;
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)
void
hal_com_txbf_fw_ndpa_timer_callback(
2018-08-24 20:52:34 +00:00
struct phydm_timer_list *timer
2018-06-22 16:48:32 +00:00
)
{
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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
void
hal_com_txbf_status_work_item_callback(
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
u8 idx = p_txbf_info->txbf_idx;
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 (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821)) {
2018-08-24 20:52:34 +00:00
hal_txbf_jaguar_status(dm, idx);
} else if (dm->support_ic_type & ODM_RTL8192E) {
2018-08-24 20:52:34 +00:00
hal_txbf_8192e_status(dm, idx);
} else if (dm->support_ic_type & ODM_RTL8814A) {
2018-08-24 20:52:34 +00:00
hal_txbf_8814a_status(dm, idx);
} 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
}
void
hal_com_txbf_reset_tx_path_work_item_callback(
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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
struct _HAL_TXBF_INFO *p_txbf_info = &dm->beamforming_info.txbf_info;
2018-06-22 16:48:32 +00:00
u8 idx = p_txbf_info->txbf_idx;
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
}
void
hal_com_txbf_get_tx_rate_work_item_callback(
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +00:00
void *adapter
2018-06-22 16:48:32 +00:00
#else
2018-08-24 20:52:34 +00:00
void *dm_void
2018-06-22 16:48:32 +00:00
#endif
)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
2018-08-24 20:52:34 +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
2018-08-24 20:52:34 +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(
2018-08-24 20:52:34 +00:00
void *dm_void,
2018-06-22 16:48:32 +00:00
u8 set_type,
void *p_in_buf
)
{
2018-08-24 20:52:34 +00:00
struct dm_struct *dm = (struct dm_struct *)dm_void;
2018-06-22 16:48:32 +00:00
u8 *p_u1_tmp = (u8 *)p_in_buf;
2018-08-24 20:52:34 +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] 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(
2018-08-24 20:52:34 +00:00
void *adapter,
2018-06-22 16:48:32 +00:00
u8 get_type,
void *p_out_buf
)
{
2018-08-24 20:52:34 +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
boolean *p_boolean = (boolean *)p_out_buf;
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;
else if (/*IS_HARDWARE_TYPE_8822B(adapter) ||*/
IS_HARDWARE_TYPE_8821B(adapter) ||
IS_HARDWARE_TYPE_8192E(adapter) ||
IS_HARDWARE_TYPE_JAGUAR(adapter) || IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(adapter))
*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;
else if (/*IS_HARDWARE_TYPE_8822B(adapter) ||*/
IS_HARDWARE_TYPE_8821B(adapter) ||
IS_HARDWARE_TYPE_8192E(adapter) ||
IS_HARDWARE_TYPE_JAGUAR(adapter) || IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(adapter)) {
2018-08-24 20:52:34 +00:00
if (hal_data->RF_Type == RF_2T2R || hal_data->RF_Type == RF_3T3R)
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) {
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1))
if (IS_HARDWARE_TYPE_8822B(adapter) || IS_HARDWARE_TYPE_8821C(adapter))
*p_boolean = true;
else
#endif
*p_boolean = false;
} else if (get_type == TXBF_GET_MU_MIMO_AP) {
#if (RTL8822B_SUPPORT == 1)
if (IS_HARDWARE_TYPE_8822B(adapter))
*p_boolean = true;
else
#endif
*p_boolean = false;
}
return true;
}
#endif
#endif