2013-05-19 04:28:07 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
#define _RTL8188E_MP_C_
|
|
|
|
|
|
|
|
#include <drv_types.h>
|
|
|
|
#include <rtw_mp.h>
|
|
|
|
#include <rtl8188e_hal.h>
|
|
|
|
#include <rtl8188e_dm.h>
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
s32 Hal_SetPowerTracking(struct adapter *padapter, u8 enable)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
2013-08-08 14:31:29 +00:00
|
|
|
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!netif_running(padapter->pnetdev)) {
|
2013-08-08 14:31:29 +00:00
|
|
|
RT_TRACE(_module_mp_, _drv_warning_,
|
|
|
|
("SetPowerTracking! Fail: interface not opened!\n"));
|
2013-05-19 04:28:07 +00:00
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
if (!check_fwstate(&padapter->mlmepriv, WIFI_MP_STATE)) {
|
|
|
|
RT_TRACE(_module_mp_, _drv_warning_,
|
|
|
|
("SetPowerTracking! Fail: not in MP mode!\n"));
|
2013-05-19 04:28:07 +00:00
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enable)
|
2013-08-08 14:31:29 +00:00
|
|
|
pDM_Odm->RFCalibrateInfo.bTXPowerTracking = true;
|
2013-05-19 04:28:07 +00:00
|
|
|
else
|
2013-08-08 14:31:29 +00:00
|
|
|
pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = false;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
return _SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_GetPowerTracking(struct adapter *padapter, u8 *enable)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
2013-08-08 14:31:29 +00:00
|
|
|
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
*enable = pDM_Odm->RFCalibrateInfo.TxPowerTrackControl;
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
static void Hal_disable_dm(struct adapter *padapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
u8 v8;
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
2013-08-08 14:31:29 +00:00
|
|
|
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 3 1. disable firmware dynamic mechanism */
|
|
|
|
/* disable Power Training, Rate Adaptive */
|
2013-05-19 04:28:07 +00:00
|
|
|
v8 = rtw_read8(padapter, REG_BCN_CTRL);
|
|
|
|
v8 &= ~EN_BCN_FUNCTION;
|
|
|
|
rtw_write8(padapter, REG_BCN_CTRL, v8);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 3 2. disable driver dynamic mechanism */
|
|
|
|
/* disable Dynamic Initial Gain */
|
|
|
|
/* disable High Power */
|
|
|
|
/* disable Power Tracking */
|
2013-05-26 03:02:10 +00:00
|
|
|
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* enable APK, LCK and IQK but disable power tracking */
|
2013-05-26 03:02:10 +00:00
|
|
|
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = false;
|
|
|
|
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, true);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------------
|
|
|
|
* Function: mpt_SwitchRfSetting
|
|
|
|
*
|
|
|
|
* Overview: Change RF Setting when we siwthc channel/rate/BW for MP.
|
|
|
|
*
|
2013-08-08 14:31:29 +00:00
|
|
|
* Input: struct adapter * pAdapter
|
2013-05-19 04:28:07 +00:00
|
|
|
*
|
|
|
|
* Output: NONE
|
|
|
|
*
|
|
|
|
* Return: NONE
|
|
|
|
*
|
|
|
|
* Revised History:
|
|
|
|
* When Who Remark
|
|
|
|
* 01/08/2009 MHC Suggestion from SD3 Willis for 92S series.
|
|
|
|
* 01/09/2009 MHC Add CCK modification for 40MHZ. Suggestion from SD3.
|
|
|
|
*
|
|
|
|
*---------------------------------------------------------------------------*/
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_mpt_SwitchRfSetting(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-22 23:18:19 +00:00
|
|
|
/* struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter); */
|
2013-05-19 04:28:07 +00:00
|
|
|
struct mp_priv *pmp = &pAdapter->mppriv;
|
2013-08-14 17:03:28 +00:00
|
|
|
u8 ChannelToSw = pmp->channel;
|
|
|
|
u32 ulRateIdx = pmp->rateidx;
|
|
|
|
u32 ulbandwidth = pmp->bandwidth;
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* <20120525, Kordan> Dynamic mechanism for APK, asked by Dennis. */
|
2013-08-14 17:03:28 +00:00
|
|
|
pmp->MptCtx.backup0x52_RF_A = (u8)PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0);
|
|
|
|
pmp->MptCtx.backup0x52_RF_B = (u8)PHY_QueryRFReg(pAdapter, RF_PATH_B, RF_0x52, 0x000F0);
|
2013-05-19 04:28:07 +00:00
|
|
|
PHY_SetRFReg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0, 0xD);
|
|
|
|
PHY_SetRFReg(pAdapter, RF_PATH_B, RF_0x52, 0x000F0, 0xD);
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
return;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
/*---------------------------hal\rtl8192c\MPT_Phy.c---------------------------*/
|
|
|
|
|
|
|
|
/*---------------------------hal\rtl8192c\MPT_HelperFunc.c---------------------------*/
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_MPT_CCKTxPowerAdjust(struct adapter *Adapter, bool bInCH14)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
u32 TempVal = 0, TempVal2 = 0, TempVal3 = 0;
|
|
|
|
u32 CurrCCKSwingVal = 0, CCKSwingIndex = 12;
|
|
|
|
u8 i;
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* get current cck swing value and check 0xa22 & 0xa23 later to match the table. */
|
2013-05-19 04:28:07 +00:00
|
|
|
CurrCCKSwingVal = read_bbreg(Adapter, rCCK0_TxFilter1, bMaskHWord);
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
if (!bInCH14) {
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Readback the current bb cck swing value and compare with the table to */
|
|
|
|
/* get the current swing index */
|
2013-08-08 14:31:29 +00:00
|
|
|
for (i = 0; i < CCK_TABLE_SIZE; i++) {
|
2013-05-19 04:28:07 +00:00
|
|
|
if (((CurrCCKSwingVal&0xff) == (u32)CCKSwingTable_Ch1_Ch13[i][0]) &&
|
2013-08-08 14:31:29 +00:00
|
|
|
(((CurrCCKSwingVal&0xff00)>>8) == (u32)CCKSwingTable_Ch1_Ch13[i][1])) {
|
2013-05-19 04:28:07 +00:00
|
|
|
CCKSwingIndex = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Write 0xa22 0xa23 */
|
2013-05-19 04:28:07 +00:00
|
|
|
TempVal = CCKSwingTable_Ch1_Ch13[CCKSwingIndex][0] +
|
2013-08-08 14:31:29 +00:00
|
|
|
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][1]<<8);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Write 0xa24 ~ 0xa27 */
|
2013-05-19 04:28:07 +00:00
|
|
|
TempVal2 = 0;
|
|
|
|
TempVal2 = CCKSwingTable_Ch1_Ch13[CCKSwingIndex][2] +
|
|
|
|
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][3]<<8) +
|
2013-08-08 14:31:29 +00:00
|
|
|
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][4]<<16)+
|
2013-05-19 04:28:07 +00:00
|
|
|
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][5]<<24);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Write 0xa28 0xa29 */
|
2013-05-19 04:28:07 +00:00
|
|
|
TempVal3 = 0;
|
|
|
|
TempVal3 = CCKSwingTable_Ch1_Ch13[CCKSwingIndex][6] +
|
2013-08-08 14:31:29 +00:00
|
|
|
(CCKSwingTable_Ch1_Ch13[CCKSwingIndex][7]<<8);
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < CCK_TABLE_SIZE; i++) {
|
2013-05-19 04:28:07 +00:00
|
|
|
if (((CurrCCKSwingVal&0xff) == (u32)CCKSwingTable_Ch14[i][0]) &&
|
2013-08-08 14:31:29 +00:00
|
|
|
(((CurrCCKSwingVal&0xff00)>>8) == (u32)CCKSwingTable_Ch14[i][1])) {
|
2013-05-19 04:28:07 +00:00
|
|
|
CCKSwingIndex = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Write 0xa22 0xa23 */
|
2013-05-19 04:28:07 +00:00
|
|
|
TempVal = CCKSwingTable_Ch14[CCKSwingIndex][0] +
|
2013-08-08 14:31:29 +00:00
|
|
|
(CCKSwingTable_Ch14[CCKSwingIndex][1]<<8);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Write 0xa24 ~ 0xa27 */
|
2013-05-19 04:28:07 +00:00
|
|
|
TempVal2 = 0;
|
|
|
|
TempVal2 = CCKSwingTable_Ch14[CCKSwingIndex][2] +
|
|
|
|
(CCKSwingTable_Ch14[CCKSwingIndex][3]<<8) +
|
2013-08-08 14:31:29 +00:00
|
|
|
(CCKSwingTable_Ch14[CCKSwingIndex][4]<<16)+
|
2013-05-19 04:28:07 +00:00
|
|
|
(CCKSwingTable_Ch14[CCKSwingIndex][5]<<24);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Write 0xa28 0xa29 */
|
2013-05-19 04:28:07 +00:00
|
|
|
TempVal3 = 0;
|
|
|
|
TempVal3 = CCKSwingTable_Ch14[CCKSwingIndex][6] +
|
2013-08-08 14:31:29 +00:00
|
|
|
(CCKSwingTable_Ch14[CCKSwingIndex][7]<<8);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
write_bbreg(Adapter, rCCK0_TxFilter1, bMaskHWord, TempVal);
|
|
|
|
write_bbreg(Adapter, rCCK0_TxFilter2, bMaskDWord, TempVal2);
|
|
|
|
write_bbreg(Adapter, rCCK0_DebugPort, bMaskLWord, TempVal3);
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_MPT_CCKTxPowerAdjustbyIndex(struct adapter *pAdapter, bool beven)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
s32 TempCCk;
|
|
|
|
u8 CCK_index, CCK_index_old;
|
2013-07-10 18:25:07 +00:00
|
|
|
u8 Action = 0; /* 0: no action, 1: even->odd, 2:odd->even */
|
2013-05-19 04:28:07 +00:00
|
|
|
u8 TimeOut = 100;
|
|
|
|
s32 i = 0;
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-08-08 14:31:29 +00:00
|
|
|
struct mpt_context *pMptCtx = &pAdapter->mppriv.MptCtx;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
2013-08-08 14:31:29 +00:00
|
|
|
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!IS_92C_SERIAL(pHalData->VersionID))
|
|
|
|
return;
|
2013-08-08 14:31:29 +00:00
|
|
|
if (beven && !pMptCtx->bMptIndexEven) {
|
|
|
|
/* odd->even */
|
2013-05-19 04:28:07 +00:00
|
|
|
Action = 2;
|
2013-05-26 03:02:10 +00:00
|
|
|
pMptCtx->bMptIndexEven = true;
|
2013-08-08 14:31:29 +00:00
|
|
|
} else if (!beven && pMptCtx->bMptIndexEven) {
|
|
|
|
/* even->odd */
|
2013-05-19 04:28:07 +00:00
|
|
|
Action = 1;
|
2013-05-26 03:02:10 +00:00
|
|
|
pMptCtx->bMptIndexEven = false;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
if (Action != 0) {
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Query CCK default setting From 0xa24 */
|
2013-05-19 04:28:07 +00:00
|
|
|
TempCCk = read_bbreg(pAdapter, rCCK0_TxFilter2, bMaskDWord) & bMaskCCK;
|
2013-08-08 14:31:29 +00:00
|
|
|
for (i = 0; i < CCK_TABLE_SIZE; i++) {
|
|
|
|
if (pDM_Odm->RFCalibrateInfo.bCCKinCH14) {
|
|
|
|
if (_rtw_memcmp((void *)&TempCCk, (void *)&CCKSwingTable_Ch14[i][2], 4)) {
|
|
|
|
CCK_index_old = (u8)i;
|
2013-05-19 04:28:07 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-08-08 14:31:29 +00:00
|
|
|
} else {
|
|
|
|
if (_rtw_memcmp((void *)&TempCCk, (void *)&CCKSwingTable_Ch1_Ch13[i][2], 4)) {
|
|
|
|
CCK_index_old = (u8)i;
|
2013-05-19 04:28:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Action == 1)
|
|
|
|
CCK_index = CCK_index_old - 1;
|
|
|
|
else
|
|
|
|
CCK_index = CCK_index_old + 1;
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Adjust CCK according to gain index */
|
2013-05-19 04:28:07 +00:00
|
|
|
if (!pDM_Odm->RFCalibrateInfo.bCCKinCH14) {
|
|
|
|
rtw_write8(pAdapter, 0xa22, CCKSwingTable_Ch1_Ch13[CCK_index][0]);
|
|
|
|
rtw_write8(pAdapter, 0xa23, CCKSwingTable_Ch1_Ch13[CCK_index][1]);
|
|
|
|
rtw_write8(pAdapter, 0xa24, CCKSwingTable_Ch1_Ch13[CCK_index][2]);
|
|
|
|
rtw_write8(pAdapter, 0xa25, CCKSwingTable_Ch1_Ch13[CCK_index][3]);
|
|
|
|
rtw_write8(pAdapter, 0xa26, CCKSwingTable_Ch1_Ch13[CCK_index][4]);
|
|
|
|
rtw_write8(pAdapter, 0xa27, CCKSwingTable_Ch1_Ch13[CCK_index][5]);
|
|
|
|
rtw_write8(pAdapter, 0xa28, CCKSwingTable_Ch1_Ch13[CCK_index][6]);
|
|
|
|
rtw_write8(pAdapter, 0xa29, CCKSwingTable_Ch1_Ch13[CCK_index][7]);
|
|
|
|
} else {
|
|
|
|
rtw_write8(pAdapter, 0xa22, CCKSwingTable_Ch14[CCK_index][0]);
|
|
|
|
rtw_write8(pAdapter, 0xa23, CCKSwingTable_Ch14[CCK_index][1]);
|
|
|
|
rtw_write8(pAdapter, 0xa24, CCKSwingTable_Ch14[CCK_index][2]);
|
|
|
|
rtw_write8(pAdapter, 0xa25, CCKSwingTable_Ch14[CCK_index][3]);
|
|
|
|
rtw_write8(pAdapter, 0xa26, CCKSwingTable_Ch14[CCK_index][4]);
|
|
|
|
rtw_write8(pAdapter, 0xa27, CCKSwingTable_Ch14[CCK_index][5]);
|
|
|
|
rtw_write8(pAdapter, 0xa28, CCKSwingTable_Ch14[CCK_index][6]);
|
|
|
|
rtw_write8(pAdapter, 0xa29, CCKSwingTable_Ch14[CCK_index][7]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*---------------------------hal\rtl8192c\MPT_HelperFunc.c---------------------------*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SetChannel
|
|
|
|
* Description
|
|
|
|
* Use H2C command to change channel,
|
|
|
|
* not only modify rf register, but also other setting need to be done.
|
|
|
|
*/
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetChannel(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
u8 eRFPath;
|
|
|
|
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
struct mp_priv *pmp = &pAdapter->mppriv;
|
|
|
|
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
2013-08-08 14:31:29 +00:00
|
|
|
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
u8 channel = pmp->channel;
|
|
|
|
u8 bandwidth = pmp->bandwidth;
|
|
|
|
u8 rate = pmp->rateidx;
|
|
|
|
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* set RF channel register */
|
2013-08-08 14:31:29 +00:00
|
|
|
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) {
|
2013-05-19 04:28:07 +00:00
|
|
|
if (IS_HARDWARE_TYPE_8192D(pAdapter))
|
2013-07-26 18:36:38 +00:00
|
|
|
_write_rfreg(pAdapter, (enum rf_radio_path)eRFPath, ODM_CHANNEL, 0xFF, channel);
|
2013-05-19 04:28:07 +00:00
|
|
|
else
|
|
|
|
_write_rfreg(pAdapter, eRFPath, ODM_CHANNEL, 0x3FF, channel);
|
|
|
|
}
|
|
|
|
Hal_mpt_SwitchRfSetting(pAdapter);
|
|
|
|
|
|
|
|
SelectChannel(pAdapter, channel);
|
|
|
|
|
|
|
|
if (pHalData->CurrentChannel == 14 && !pDM_Odm->RFCalibrateInfo.bCCKinCH14) {
|
2013-05-26 03:02:10 +00:00
|
|
|
pDM_Odm->RFCalibrateInfo.bCCKinCH14 = true;
|
2013-05-19 04:28:07 +00:00
|
|
|
Hal_MPT_CCKTxPowerAdjust(pAdapter, pDM_Odm->RFCalibrateInfo.bCCKinCH14);
|
2013-08-08 14:31:29 +00:00
|
|
|
} else if (pHalData->CurrentChannel != 14 && pDM_Odm->RFCalibrateInfo.bCCKinCH14) {
|
2013-05-26 03:02:10 +00:00
|
|
|
pDM_Odm->RFCalibrateInfo.bCCKinCH14 = false;
|
2013-05-19 04:28:07 +00:00
|
|
|
Hal_MPT_CCKTxPowerAdjust(pAdapter, pDM_Odm->RFCalibrateInfo.bCCKinCH14);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Notice
|
|
|
|
* Switch bandwitdth may change center frequency(channel)
|
|
|
|
*/
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetBandwidth(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
struct mp_priv *pmp = &pAdapter->mppriv;
|
|
|
|
|
|
|
|
|
|
|
|
SetBWMode(pAdapter, pmp->bandwidth, pmp->prime_channel_offset);
|
|
|
|
Hal_mpt_SwitchRfSetting(pAdapter);
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetCCKTxPower(struct adapter *pAdapter, u8 *TxPower)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
u32 tmpval = 0;
|
|
|
|
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* rf-A cck tx power */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, TxPower[RF_PATH_A]);
|
|
|
|
tmpval = (TxPower[RF_PATH_A]<<16) | (TxPower[RF_PATH_A]<<8) | TxPower[RF_PATH_A];
|
|
|
|
write_bbreg(pAdapter, rTxAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* rf-B cck tx power */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, TxPower[RF_PATH_B]);
|
|
|
|
tmpval = (TxPower[RF_PATH_B]<<16) | (TxPower[RF_PATH_B]<<8) | TxPower[RF_PATH_B];
|
|
|
|
write_bbreg(pAdapter, rTxAGC_B_CCK1_55_Mcs32, 0xffffff00, tmpval);
|
|
|
|
|
|
|
|
RT_TRACE(_module_mp_, _drv_notice_,
|
|
|
|
("-SetCCKTxPower: A[0x%02x] B[0x%02x]\n",
|
|
|
|
TxPower[RF_PATH_A], TxPower[RF_PATH_B]));
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetOFDMTxPower(struct adapter *pAdapter, u8 *TxPower)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
u32 TxAGC = 0;
|
|
|
|
u8 tmpval = 0;
|
2013-07-26 21:08:55 +00:00
|
|
|
struct mpt_context *pMptCtx = &pAdapter->mppriv.MptCtx;
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* HT Tx-rf(A) */
|
2013-05-19 04:28:07 +00:00
|
|
|
tmpval = TxPower[RF_PATH_A];
|
|
|
|
TxAGC = (tmpval<<24) | (tmpval<<16) | (tmpval<<8) | tmpval;
|
|
|
|
|
|
|
|
write_bbreg(pAdapter, rTxAGC_A_Rate18_06, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_A_Rate54_24, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_A_Mcs03_Mcs00, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_A_Mcs07_Mcs04, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_A_Mcs11_Mcs08, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_A_Mcs15_Mcs12, bMaskDWord, TxAGC);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* HT Tx-rf(B) */
|
2013-05-19 04:28:07 +00:00
|
|
|
tmpval = TxPower[RF_PATH_B];
|
|
|
|
TxAGC = (tmpval<<24) | (tmpval<<16) | (tmpval<<8) | tmpval;
|
|
|
|
|
|
|
|
write_bbreg(pAdapter, rTxAGC_B_Rate18_06, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_B_Rate54_24, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_B_Mcs03_Mcs00, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_B_Mcs07_Mcs04, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_B_Mcs11_Mcs08, bMaskDWord, TxAGC);
|
|
|
|
write_bbreg(pAdapter, rTxAGC_B_Mcs15_Mcs12, bMaskDWord, TxAGC);
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetAntennaPathPower(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
u8 TxPowerLevel[MAX_RF_PATH_NUMS];
|
|
|
|
u8 rfPath;
|
|
|
|
|
|
|
|
TxPowerLevel[RF_PATH_A] = pAdapter->mppriv.txpoweridx;
|
|
|
|
TxPowerLevel[RF_PATH_B] = pAdapter->mppriv.txpoweridx_b;
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
switch (pAdapter->mppriv.antenna_tx) {
|
|
|
|
case ANTENNA_A:
|
|
|
|
default:
|
|
|
|
rfPath = RF_PATH_A;
|
|
|
|
break;
|
|
|
|
case ANTENNA_B:
|
|
|
|
rfPath = RF_PATH_B;
|
|
|
|
break;
|
|
|
|
case ANTENNA_C:
|
|
|
|
rfPath = RF_PATH_C;
|
|
|
|
break;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
switch (pHalData->rf_chip) {
|
|
|
|
case RF_8225:
|
|
|
|
case RF_8256:
|
|
|
|
case RF_6052:
|
|
|
|
Hal_SetCCKTxPower(pAdapter, TxPowerLevel);
|
|
|
|
if (pAdapter->mppriv.rateidx < MPT_RATE_6M) /* CCK rate */
|
|
|
|
Hal_MPT_CCKTxPowerAdjustbyIndex(pAdapter, TxPowerLevel[rfPath]%2 == 0);
|
|
|
|
Hal_SetOFDMTxPower(pAdapter, TxPowerLevel);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetTxPower(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
u8 TxPower = pAdapter->mppriv.txpoweridx;
|
|
|
|
u8 TxPowerLevel[MAX_RF_PATH_NUMS];
|
|
|
|
u8 rf, rfPath;
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
for (rf = 0; rf < MAX_RF_PATH_NUMS; rf++)
|
2013-05-19 04:28:07 +00:00
|
|
|
TxPowerLevel[rf] = TxPower;
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
switch (pAdapter->mppriv.antenna_tx) {
|
|
|
|
case ANTENNA_A:
|
|
|
|
default:
|
|
|
|
rfPath = RF_PATH_A;
|
|
|
|
break;
|
|
|
|
case ANTENNA_B:
|
|
|
|
rfPath = RF_PATH_B;
|
|
|
|
break;
|
|
|
|
case ANTENNA_C:
|
|
|
|
rfPath = RF_PATH_C;
|
|
|
|
break;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
switch (pHalData->rf_chip) {
|
|
|
|
/* 2008/09/12 MH Test only !! We enable the TX power tracking for MP!!!!! */
|
|
|
|
/* We should call normal driver API later!! */
|
|
|
|
case RF_8225:
|
|
|
|
case RF_8256:
|
|
|
|
case RF_6052:
|
|
|
|
Hal_SetCCKTxPower(pAdapter, TxPowerLevel);
|
|
|
|
if (pAdapter->mppriv.rateidx < MPT_RATE_6M) /* CCK rate */
|
|
|
|
Hal_MPT_CCKTxPowerAdjustbyIndex(pAdapter, TxPowerLevel[rfPath]%2 == 0);
|
|
|
|
Hal_SetOFDMTxPower(pAdapter, TxPowerLevel);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetDataRate(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
Hal_mpt_SwitchRfSetting(pAdapter);
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetAntenna(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-26 18:36:38 +00:00
|
|
|
struct ant_sel_ofdm *p_ofdm_tx; /* OFDM Tx register */
|
|
|
|
struct ant_sel_cck *p_cck_txrx;
|
2013-05-19 04:28:07 +00:00
|
|
|
u8 r_rx_antenna_ofdm = 0, r_ant_select_cck_val = 0;
|
|
|
|
u8 chgTx = 0, chgRx = 0;
|
|
|
|
u32 r_ant_sel_cck_val = 0, r_ant_select_ofdm_val = 0, r_ofdm_tx_en_val = 0;
|
|
|
|
|
|
|
|
|
2013-07-26 18:36:38 +00:00
|
|
|
p_ofdm_tx = (struct ant_sel_ofdm *)&r_ant_select_ofdm_val;
|
|
|
|
p_cck_txrx = (struct ant_sel_cck *)&r_ant_select_cck_val;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
p_ofdm_tx->r_ant_ht1 = 0x1;
|
2013-07-10 18:25:07 +00:00
|
|
|
p_ofdm_tx->r_ant_ht2 = 0x2; /* Second TX RF path is A */
|
|
|
|
p_ofdm_tx->r_ant_non_ht = 0x3; /* 0x1+0x2=0x3 */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
switch (pAdapter->mppriv.antenna_tx) {
|
|
|
|
case ANTENNA_A:
|
|
|
|
p_ofdm_tx->r_tx_antenna = 0x1;
|
|
|
|
r_ofdm_tx_en_val = 0x1;
|
|
|
|
p_ofdm_tx->r_ant_l = 0x1;
|
|
|
|
p_ofdm_tx->r_ant_ht_s1 = 0x1;
|
|
|
|
p_ofdm_tx->r_ant_non_ht_s1 = 0x1;
|
|
|
|
p_cck_txrx->r_ccktx_enable = 0x8;
|
|
|
|
chgTx = 1;
|
|
|
|
|
|
|
|
/* From SD3 Willis suggestion !!! Set RF A=TX and B as standby */
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter2, 0xe, 2);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter2, 0xe, 1);
|
|
|
|
r_ofdm_tx_en_val = 0x3;
|
|
|
|
|
|
|
|
/* Power save */
|
|
|
|
|
|
|
|
/* We need to close RFB by SW control */
|
|
|
|
if (pHalData->rf_type == RF_2T2R) {
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT10, 0);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT26, 1);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT10, 0);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT1, 1);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT17, 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ANTENNA_B:
|
|
|
|
p_ofdm_tx->r_tx_antenna = 0x2;
|
|
|
|
r_ofdm_tx_en_val = 0x2;
|
|
|
|
p_ofdm_tx->r_ant_l = 0x2;
|
|
|
|
p_ofdm_tx->r_ant_ht_s1 = 0x2;
|
|
|
|
p_ofdm_tx->r_ant_non_ht_s1 = 0x2;
|
|
|
|
p_cck_txrx->r_ccktx_enable = 0x4;
|
|
|
|
chgTx = 1;
|
|
|
|
/* From SD3 Willis suggestion !!! Set RF A as standby */
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XA_HSSIParameter2, 0xe, 1);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XB_HSSIParameter2, 0xe, 2);
|
|
|
|
|
|
|
|
/* Power save */
|
|
|
|
/* cosa r_ant_select_ofdm_val = 0x22222222; */
|
|
|
|
|
|
|
|
/* 2008/10/31 MH From SD3 Willi's suggestion. We must read RF 1T table. */
|
|
|
|
/* 2009/01/08 MH From Sd3 Willis. We need to close RFA by SW control */
|
|
|
|
if (pHalData->rf_type == RF_2T2R || pHalData->rf_type == RF_1T2R) {
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT10, 1);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, BIT10, 0);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT26, 0);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT1, 0);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT17, 1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ANTENNA_AB: /* For 8192S */
|
|
|
|
p_ofdm_tx->r_tx_antenna = 0x3;
|
|
|
|
r_ofdm_tx_en_val = 0x3;
|
|
|
|
p_ofdm_tx->r_ant_l = 0x3;
|
|
|
|
p_ofdm_tx->r_ant_ht_s1 = 0x3;
|
|
|
|
p_ofdm_tx->r_ant_non_ht_s1 = 0x3;
|
|
|
|
p_cck_txrx->r_ccktx_enable = 0xC;
|
|
|
|
chgTx = 1;
|
|
|
|
|
|
|
|
/* From SD3 Willis suggestion !!! Set RF B as standby */
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XA_HSSIParameter2, 0xe, 2);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XB_HSSIParameter2, 0xe, 2);
|
|
|
|
|
|
|
|
/* Disable Power save */
|
|
|
|
/* cosa r_ant_select_ofdm_val = 0x3321333; */
|
|
|
|
/* 2009/01/08 MH From Sd3 Willis. We need to enable RFA/B by SW control */
|
|
|
|
if (pHalData->rf_type == RF_2T2R) {
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT10, 0);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFInterfaceSW, BIT26, 0);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT1, 1);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT17, 1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2013-05-19 04:28:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* r_rx_antenna_ofdm, bit0=A, bit1=B, bit2=C, bit3=D */
|
|
|
|
/* r_cckrx_enable : CCK default, 0=A, 1=B, 2=C, 3=D */
|
|
|
|
/* r_cckrx_enable_2 : CCK option, 0=A, 1=B, 2=C, 3=D */
|
2013-08-08 14:31:29 +00:00
|
|
|
switch (pAdapter->mppriv.antenna_rx) {
|
|
|
|
case ANTENNA_A:
|
|
|
|
r_rx_antenna_ofdm = 0x1; /* A */
|
|
|
|
p_cck_txrx->r_cckrx_enable = 0x0; /* default: A */
|
|
|
|
p_cck_txrx->r_cckrx_enable_2 = 0x0; /* option: A */
|
|
|
|
chgRx = 1;
|
|
|
|
break;
|
|
|
|
case ANTENNA_B:
|
|
|
|
r_rx_antenna_ofdm = 0x2; /* B */
|
|
|
|
p_cck_txrx->r_cckrx_enable = 0x1; /* default: B */
|
|
|
|
p_cck_txrx->r_cckrx_enable_2 = 0x1; /* option: B */
|
|
|
|
chgRx = 1;
|
|
|
|
break;
|
|
|
|
case ANTENNA_AB:
|
|
|
|
r_rx_antenna_ofdm = 0x3; /* AB */
|
|
|
|
p_cck_txrx->r_cckrx_enable = 0x0; /* default:A */
|
|
|
|
p_cck_txrx->r_cckrx_enable_2 = 0x1; /* option:B */
|
|
|
|
chgRx = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
if (chgTx && chgRx) {
|
|
|
|
switch (pHalData->rf_chip) {
|
|
|
|
case RF_8225:
|
|
|
|
case RF_8256:
|
|
|
|
case RF_6052:
|
|
|
|
/* r_ant_sel_cck_val = r_ant_select_cck_val; */
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA1_TxInfo, 0x7fffffff, r_ant_select_ofdm_val); /* OFDM Tx */
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_TxInfo, 0x0000000f, r_ofdm_tx_en_val); /* OFDM Tx */
|
|
|
|
PHY_SetBBReg(pAdapter, rOFDM0_TRxPathEnable, 0x0000000f, r_rx_antenna_ofdm); /* OFDM Rx */
|
|
|
|
PHY_SetBBReg(pAdapter, rOFDM1_TRxPathEnable, 0x0000000f, r_rx_antenna_ofdm); /* OFDM Rx */
|
|
|
|
PHY_SetBBReg(pAdapter, rCCK0_AFESetting, bMaskByte3, r_ant_select_cck_val); /* CCK TxRx */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_mp_, _drv_notice_, ("-SwitchAntenna: finished\n"));
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
s32 Hal_SetThermalMeter(struct adapter *pAdapter, u8 target_ther)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!netif_running(pAdapter->pnetdev)) {
|
|
|
|
RT_TRACE(_module_mp_, _drv_warning_, ("SetThermalMeter! Fail: interface not opened!\n"));
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
|
2013-05-26 03:02:10 +00:00
|
|
|
if (check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE) == false) {
|
2013-05-19 04:28:07 +00:00
|
|
|
RT_TRACE(_module_mp_, _drv_warning_, ("SetThermalMeter: Fail! not in MP mode!\n"));
|
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
target_ther &= 0xff;
|
|
|
|
if (target_ther < 0x07)
|
|
|
|
target_ther = 0x07;
|
|
|
|
else if (target_ther > 0x1d)
|
|
|
|
target_ther = 0x1d;
|
|
|
|
|
|
|
|
pHalData->EEPROMThermalMeter = target_ther;
|
|
|
|
|
|
|
|
return _SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_TriggerRFThermalMeter(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-08 14:31:29 +00:00
|
|
|
_write_rfreg(pAdapter, RF_PATH_A , RF_T_METER_88E , BIT17 | BIT16 , 0x03);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
u8 Hal_ReadRFThermalMeter(struct adapter *pAdapter)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
u32 ThermalValue = 0;
|
|
|
|
|
|
|
|
ThermalValue = _read_rfreg(pAdapter, RF_PATH_A, RF_T_METER_88E, 0xfc00);
|
|
|
|
return (u8)ThermalValue;
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_GetThermalMeter(struct adapter *pAdapter, u8 *value)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
Hal_TriggerRFThermalMeter(pAdapter);
|
|
|
|
rtw_msleep_os(1000);
|
|
|
|
*value = Hal_ReadRFThermalMeter(pAdapter);
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetSingleCarrierTx(struct adapter *pAdapter, u8 bStart)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-08 14:31:29 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
|
|
|
|
2013-05-19 04:28:07 +00:00
|
|
|
pAdapter->mppriv.MptCtx.bSingleCarrier = bStart;
|
2013-08-08 14:31:29 +00:00
|
|
|
if (bStart) {
|
|
|
|
/* Start Single Carrier. */
|
|
|
|
RT_TRACE(_module_mp_, _drv_alert_, ("SetSingleCarrierTx: test start\n"));
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 1. if OFDM block on? */
|
2013-05-19 04:28:07 +00:00
|
|
|
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn))
|
2013-07-10 18:25:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, bEnable);/* set OFDM block on */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 2. set CCK test mode off, set to CCK normal mode */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, bDisable);
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 3. turn on scramble setting */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable);
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 4. Turn On Single Carrier Tx and turn off the other test modes. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bEnable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
2013-07-10 18:25:07 +00:00
|
|
|
/* for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
2013-08-08 14:31:29 +00:00
|
|
|
} else {
|
|
|
|
/* Stop Single Carrier. */
|
|
|
|
RT_TRACE(_module_mp_, _drv_alert_, ("SetSingleCarrierTx: test stop\n"));
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Turn off all test modes. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
|
|
|
rtw_msleep_os(10);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* BB Reset */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
|
|
|
|
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Stop for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetSingleToneTx(struct adapter *pAdapter, u8 bStart)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-22 23:18:19 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:48:10 +00:00
|
|
|
bool is92C = IS_92C_SERIAL(pHalData->VersionID);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
u8 rfPath;
|
|
|
|
u32 reg58 = 0x0;
|
2013-08-08 14:31:29 +00:00
|
|
|
switch (pAdapter->mppriv.antenna_tx) {
|
|
|
|
case ANTENNA_A:
|
|
|
|
default:
|
|
|
|
rfPath = RF_PATH_A;
|
|
|
|
break;
|
|
|
|
case ANTENNA_B:
|
|
|
|
rfPath = RF_PATH_B;
|
|
|
|
break;
|
|
|
|
case ANTENNA_C:
|
|
|
|
rfPath = RF_PATH_C;
|
|
|
|
break;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pAdapter->mppriv.MptCtx.bSingleTone = bStart;
|
2013-08-08 14:31:29 +00:00
|
|
|
if (bStart) {
|
|
|
|
/* Start Single Tone. */
|
|
|
|
RT_TRACE(_module_mp_, _drv_alert_, ("SetSingleToneTx: test start\n"));
|
|
|
|
/* <20120326, Kordan> To amplify the power of tone for Xtal calibration. (asked by Edlu) */
|
|
|
|
if (IS_HARDWARE_TYPE_8188E(pAdapter)) {
|
|
|
|
reg58 = PHY_QueryRFReg(pAdapter, RF_PATH_A, LNA_Low_Gain_3, bRFRegOffsetMask);
|
|
|
|
reg58 &= 0xFFFFFFF0;
|
|
|
|
reg58 += 2;
|
|
|
|
PHY_SetRFReg(pAdapter, RF_PATH_A, LNA_Low_Gain_3, bRFRegOffsetMask, reg58);
|
|
|
|
}
|
2013-05-19 04:28:07 +00:00
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_RFMOD, bCCKEn, 0x0);
|
|
|
|
PHY_SetBBReg(pAdapter, rFPGA0_RFMOD, bOFDMEn, 0x0);
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
if (is92C) {
|
2013-05-19 04:28:07 +00:00
|
|
|
_write_rfreg(pAdapter, RF_PATH_A, 0x21, BIT19, 0x01);
|
|
|
|
rtw_usleep_os(100);
|
|
|
|
if (rfPath == RF_PATH_A)
|
2013-07-10 18:25:07 +00:00
|
|
|
write_rfreg(pAdapter, RF_PATH_B, 0x00, 0x10000); /* PAD all on. */
|
2013-05-19 04:28:07 +00:00
|
|
|
else if (rfPath == RF_PATH_B)
|
2013-07-10 18:25:07 +00:00
|
|
|
write_rfreg(pAdapter, RF_PATH_A, 0x00, 0x10000); /* PAD all on. */
|
|
|
|
write_rfreg(pAdapter, rfPath, 0x00, 0x2001f); /* PAD all on. */
|
2013-05-19 04:28:07 +00:00
|
|
|
rtw_usleep_os(100);
|
2013-08-08 14:31:29 +00:00
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
write_rfreg(pAdapter, rfPath, 0x21, 0xd4000);
|
|
|
|
rtw_usleep_os(100);
|
2013-07-10 18:25:07 +00:00
|
|
|
write_rfreg(pAdapter, rfPath, 0x00, 0x2001f); /* PAD all on. */
|
2013-05-19 04:28:07 +00:00
|
|
|
rtw_usleep_os(100);
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
} else {
|
|
|
|
/* Stop Single Tone. */
|
|
|
|
RT_TRACE(_module_mp_, _drv_alert_, ("SetSingleToneTx: test stop\n"));
|
|
|
|
|
|
|
|
/* <20120326, Kordan> To amplify the power of tone for Xtal calibration. (asked by Edlu) */
|
|
|
|
/* <20120326, Kordan> Only in single tone mode. (asked by Edlu) */
|
|
|
|
if (IS_HARDWARE_TYPE_8188E(pAdapter)) {
|
|
|
|
reg58 = PHY_QueryRFReg(pAdapter, RF_PATH_A, LNA_Low_Gain_3, bRFRegOffsetMask);
|
|
|
|
reg58 &= 0xFFFFFFF0;
|
|
|
|
PHY_SetRFReg(pAdapter, RF_PATH_A, LNA_Low_Gain_3, bRFRegOffsetMask, reg58);
|
|
|
|
}
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, 0x1);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, 0x1);
|
|
|
|
if (is92C) {
|
|
|
|
_write_rfreg(pAdapter, RF_PATH_A, 0x21, BIT19, 0x00);
|
|
|
|
rtw_usleep_os(100);
|
2013-07-10 18:25:07 +00:00
|
|
|
write_rfreg(pAdapter, RF_PATH_A, 0x00, 0x32d75); /* PAD all on. */
|
|
|
|
write_rfreg(pAdapter, RF_PATH_B, 0x00, 0x32d75); /* PAD all on. */
|
2013-05-19 04:28:07 +00:00
|
|
|
rtw_usleep_os(100);
|
|
|
|
} else {
|
|
|
|
write_rfreg(pAdapter, rfPath, 0x21, 0x54000);
|
|
|
|
rtw_usleep_os(100);
|
2013-07-10 18:25:07 +00:00
|
|
|
write_rfreg(pAdapter, rfPath, 0x00, 0x30000); /* PAD all on. */
|
2013-05-19 04:28:07 +00:00
|
|
|
rtw_usleep_os(100);
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Stop for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetCarrierSuppressionTx(struct adapter *pAdapter, u8 bStart)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
pAdapter->mppriv.MptCtx.bCarrierSuppression = bStart;
|
2013-08-08 14:31:29 +00:00
|
|
|
if (bStart) {
|
|
|
|
/* Start Carrier Suppression. */
|
|
|
|
RT_TRACE(_module_mp_, _drv_alert_, ("SetCarrierSuppressionTx: test start\n"));
|
|
|
|
if (pAdapter->mppriv.rateidx <= MPT_RATE_11M) {
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 1. if CCK block on? */
|
2013-05-19 04:28:07 +00:00
|
|
|
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn))
|
2013-07-10 18:25:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, bEnable);/* set CCK block on */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Turn Off All Test Mode */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x2); /* transmit mode */
|
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, 0x0); /* turn off scramble setting */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Set CCK Tx Test Rate */
|
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKTxRate, 0x0); /* Set FTxRate to 1Mbps */
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
2013-08-08 14:31:29 +00:00
|
|
|
} else {
|
|
|
|
/* Stop Carrier Suppression. */
|
|
|
|
RT_TRACE(_module_mp_, _drv_alert_, ("SetCarrierSuppressionTx: test stop\n"));
|
|
|
|
if (pAdapter->mppriv.rateidx <= MPT_RATE_11M) {
|
2013-07-10 18:25:07 +00:00
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x0); /* normal mode */
|
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, 0x1); /* turn on scramble setting */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* BB Reset */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
|
|
|
|
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Stop for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetCCKContinuousTx(struct adapter *pAdapter, u8 bStart)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
u32 cckrate;
|
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
if (bStart) {
|
2013-05-19 04:28:07 +00:00
|
|
|
RT_TRACE(_module_mp_, _drv_alert_,
|
|
|
|
("SetCCKContinuousTx: test start\n"));
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 1. if CCK block on? */
|
2013-05-19 04:28:07 +00:00
|
|
|
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn))
|
2013-07-10 18:25:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, bEnable);/* set CCK block on */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Turn Off All Test Mode */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Set CCK Tx Test Rate */
|
2013-05-19 04:28:07 +00:00
|
|
|
cckrate = pAdapter->mppriv.rateidx;
|
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKTxRate, cckrate);
|
2013-07-10 18:25:07 +00:00
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x2); /* transmit mode */
|
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable); /* turn on scramble setting */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
2013-08-08 14:31:29 +00:00
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
RT_TRACE(_module_mp_, _drv_info_,
|
|
|
|
("SetCCKContinuousTx: test stop\n"));
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x0); /* normal mode */
|
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable); /* turn on scramble setting */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* BB Reset */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
|
|
|
|
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Stop for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
}
|
|
|
|
|
|
|
|
pAdapter->mppriv.MptCtx.bCckContTx = bStart;
|
2013-05-26 03:02:10 +00:00
|
|
|
pAdapter->mppriv.MptCtx.bOfdmContTx = false;
|
2013-08-08 14:31:29 +00:00
|
|
|
} /* mpt_StartCckContTx */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetOFDMContinuousTx(struct adapter *pAdapter, u8 bStart)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-08 14:31:29 +00:00
|
|
|
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
if (bStart) {
|
|
|
|
RT_TRACE(_module_mp_, _drv_info_, ("SetOFDMContinuousTx: test start\n"));
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 1. if OFDM block on? */
|
2013-05-19 04:28:07 +00:00
|
|
|
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn))
|
2013-07-10 18:25:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, bEnable);/* set OFDM block on */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 2. set CCK test mode off, set to CCK normal mode */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, bDisable);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 3. turn on scramble setting */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, bEnable);
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 4. Turn On Continue Tx and turn off the other test modes. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bEnable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000500);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000500);
|
|
|
|
|
|
|
|
} else {
|
2013-08-08 14:31:29 +00:00
|
|
|
RT_TRACE(_module_mp_, _drv_info_, ("SetOFDMContinuousTx: test stop\n"));
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMContinueTx, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleCarrier, bDisable);
|
|
|
|
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Delay 10 ms */
|
2013-05-19 04:28:07 +00:00
|
|
|
rtw_msleep_os(10);
|
2013-07-10 18:25:07 +00:00
|
|
|
/* BB Reset */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
|
|
|
|
write_bbreg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Stop for dynamic set Power index. */
|
2013-05-19 04:28:07 +00:00
|
|
|
write_bbreg(pAdapter, rFPGA0_XA_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
write_bbreg(pAdapter, rFPGA0_XB_HSSIParameter1, bMaskDWord, 0x01000100);
|
|
|
|
}
|
|
|
|
|
2013-05-26 03:02:10 +00:00
|
|
|
pAdapter->mppriv.MptCtx.bCckContTx = false;
|
2013-05-19 04:28:07 +00:00
|
|
|
pAdapter->mppriv.MptCtx.bOfdmContTx = bStart;
|
2013-08-08 14:31:29 +00:00
|
|
|
} /* mpt_StartOfdmContTx */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-08 14:31:29 +00:00
|
|
|
void Hal_SetContinuousTx(struct adapter *pAdapter, u8 bStart)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
RT_TRACE(_module_mp_, _drv_info_,
|
|
|
|
("SetContinuousTx: rate:%d\n", pAdapter->mppriv.rateidx));
|
|
|
|
|
|
|
|
pAdapter->mppriv.MptCtx.bStartContTx = bStart;
|
|
|
|
if (pAdapter->mppriv.rateidx <= MPT_RATE_11M)
|
|
|
|
Hal_SetCCKContinuousTx(pAdapter, bStart);
|
|
|
|
else if ((pAdapter->mppriv.rateidx >= MPT_RATE_6M) &&
|
|
|
|
(pAdapter->mppriv.rateidx <= MPT_RATE_MCS15))
|
|
|
|
Hal_SetOFDMContinuousTx(pAdapter, bStart);
|
|
|
|
}
|