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
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* include files */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
#include "odm_precomp.h"
|
|
|
|
|
2013-07-27 03:47:25 +00:00
|
|
|
#define READ_AND_CONFIG READ_AND_CONFIG_MP
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
#define READ_AND_CONFIG_MP(ic, txt) (ODM_ReadAndConfig##txt##ic(dm_odm))
|
|
|
|
#define READ_AND_CONFIG_TC(ic, txt) (ODM_ReadAndConfig_TC##txt##ic(dm_odm))
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-14 17:03:28 +00:00
|
|
|
static u8 odm_QueryRxPwrPercentage(s8 AntPower)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
if ((AntPower <= -100) || (AntPower >= 20))
|
|
|
|
return 0;
|
|
|
|
else if (AntPower >= 0)
|
|
|
|
return 100;
|
|
|
|
else
|
2013-08-07 19:30:06 +00:00
|
|
|
return 100+AntPower;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 2012/01/12 MH MOve some signal strength smooth method to MP HAL layer. */
|
|
|
|
/* IF other SW team do not support the feature, remove this section.?? */
|
2013-08-14 17:03:28 +00:00
|
|
|
static s32 odm_sig_patch_lenove(struct odm_dm_struct *dm_odm, s32 CurrSig)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-10-19 17:45:47 +00:00
|
|
|
return 0;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-14 17:03:28 +00:00
|
|
|
static s32 odm_sig_patch_netcore(struct odm_dm_struct *dm_odm, s32 CurrSig)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-10-19 17:45:47 +00:00
|
|
|
return 0;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-14 17:03:28 +00:00
|
|
|
static s32 odm_SignalScaleMapping_92CSeries(struct odm_dm_struct *dm_odm, s32 CurrSig)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-10-19 17:45:47 +00:00
|
|
|
s32 RetSig = 0;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
if ((dm_odm->SupportInterface == ODM_ITRF_USB) ||
|
|
|
|
(dm_odm->SupportInterface == ODM_ITRF_SDIO)) {
|
2013-05-19 04:28:07 +00:00
|
|
|
if (CurrSig >= 51 && CurrSig <= 100)
|
|
|
|
RetSig = 100;
|
|
|
|
else if (CurrSig >= 41 && CurrSig <= 50)
|
|
|
|
RetSig = 80 + ((CurrSig - 40)*2);
|
|
|
|
else if (CurrSig >= 31 && CurrSig <= 40)
|
|
|
|
RetSig = 66 + (CurrSig - 30);
|
|
|
|
else if (CurrSig >= 21 && CurrSig <= 30)
|
|
|
|
RetSig = 54 + (CurrSig - 20);
|
|
|
|
else if (CurrSig >= 10 && CurrSig <= 20)
|
|
|
|
RetSig = 42 + (((CurrSig - 10) * 2) / 3);
|
|
|
|
else if (CurrSig >= 5 && CurrSig <= 9)
|
|
|
|
RetSig = 22 + (((CurrSig - 5) * 3) / 2);
|
|
|
|
else if (CurrSig >= 1 && CurrSig <= 4)
|
|
|
|
RetSig = 6 + (((CurrSig - 1) * 3) / 2);
|
|
|
|
else
|
|
|
|
RetSig = CurrSig;
|
|
|
|
}
|
|
|
|
return RetSig;
|
|
|
|
}
|
|
|
|
|
2013-08-14 17:03:28 +00:00
|
|
|
static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
|
2013-08-07 19:30:06 +00:00
|
|
|
{
|
|
|
|
if ((dm_odm->SupportPlatform == ODM_MP) &&
|
|
|
|
(dm_odm->SupportInterface != ODM_ITRF_PCIE) && /* USB & SDIO */
|
|
|
|
(dm_odm->PatchID == 10))
|
|
|
|
return odm_sig_patch_netcore(dm_odm, CurrSig);
|
|
|
|
else if ((dm_odm->SupportPlatform == ODM_MP) &&
|
|
|
|
(dm_odm->SupportInterface == ODM_ITRF_PCIE) &&
|
|
|
|
(dm_odm->PatchID == 19))
|
|
|
|
return odm_sig_patch_lenove(dm_odm, CurrSig);
|
|
|
|
else
|
|
|
|
return odm_SignalScaleMapping_92CSeries(dm_odm, CurrSig);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* pMgntInfo->CustomerID == RT_CID_819x_Lenovo */
|
2013-08-14 17:03:28 +00:00
|
|
|
static u8 odm_SQ_process_patch_RT_CID_819x_Lenovo(struct odm_dm_struct *dm_odm,
|
|
|
|
u8 isCCKrate, u8 PWDB_ALL, u8 path, u8 RSSI)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-10-19 17:45:47 +00:00
|
|
|
return 0;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-14 17:03:28 +00:00
|
|
|
static u8 odm_EVMdbToPercentage(s8 Value)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-10 18:25:07 +00:00
|
|
|
/* -33dB~0dB to 0%~99% */
|
2013-08-14 17:03:28 +00:00
|
|
|
s8 ret_val;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
ret_val = Value;
|
|
|
|
|
|
|
|
if (ret_val >= 0)
|
|
|
|
ret_val = 0;
|
|
|
|
if (ret_val <= -33)
|
|
|
|
ret_val = -33;
|
|
|
|
|
|
|
|
ret_val = 0 - ret_val;
|
2013-08-07 19:30:06 +00:00
|
|
|
ret_val *= 3;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
if (ret_val == 99)
|
|
|
|
ret_val = 100;
|
2013-08-07 19:30:06 +00:00
|
|
|
return ret_val;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
|
2013-07-26 16:20:42 +00:00
|
|
|
struct odm_phy_status_info *pPhyInfo,
|
2013-08-14 17:03:28 +00:00
|
|
|
u8 *pPhyStatus,
|
2013-12-31 03:18:17 +00:00
|
|
|
struct odm_per_pkt_info *pPktinfo,
|
|
|
|
struct adapter *adapt)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-07 19:30:06 +00:00
|
|
|
struct sw_ant_switch *pDM_SWAT_Table = &dm_odm->DM_SWAT_Table;
|
2013-08-14 17:03:28 +00:00
|
|
|
u8 i, Max_spatial_stream;
|
|
|
|
s8 rx_pwr[4], rx_pwr_all = 0;
|
|
|
|
u8 EVM, PWDB_ALL = 0, PWDB_ALL_BT;
|
|
|
|
u8 RSSI, total_rssi = 0;
|
|
|
|
u8 isCCKrate = 0;
|
|
|
|
u8 rf_rx_num = 0;
|
|
|
|
u8 cck_highpwr = 0;
|
|
|
|
u8 LNA_idx, VGA_idx;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-26 21:52:36 +00:00
|
|
|
struct phy_status_rpt *pPhyStaRpt = (struct phy_status_rpt *)pPhyStatus;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-06-21 18:41:29 +00:00
|
|
|
isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M) && (pPktinfo->Rate <= DESC92C_RATE11M)) ? true : false;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2016-02-15 01:23:53 +00:00
|
|
|
pPhyInfo->RxMIMOSignalQuality[RF_PATH_A] = -1;
|
|
|
|
pPhyInfo->RxMIMOSignalQuality[RF_PATH_B] = -1;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-06-21 18:41:29 +00:00
|
|
|
if (isCCKrate) {
|
2013-08-14 17:03:28 +00:00
|
|
|
u8 report;
|
|
|
|
u8 cck_agc_rpt;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
dm_odm->PhyDbgInfo.NumQryPhyStatusCCK++;
|
2013-07-10 18:25:07 +00:00
|
|
|
/* (1)Hardware does not provide RSSI for CCK */
|
|
|
|
/* (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive) */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
cck_highpwr = dm_odm->bCckHighPower;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
cck_agc_rpt = pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a ;
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 2011.11.28 LukeLee: 88E use different LNA & VGA gain table */
|
|
|
|
/* The RSSI formula should be modified according to the gain table */
|
|
|
|
/* In 88E, cck_highpwr is always set to 1 */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (dm_odm->SupportICType & (ODM_RTL8188E|ODM_RTL8812)) {
|
|
|
|
LNA_idx = ((cck_agc_rpt & 0xE0) >> 5);
|
2013-05-19 04:28:07 +00:00
|
|
|
VGA_idx = (cck_agc_rpt & 0x1F);
|
2013-06-21 18:41:29 +00:00
|
|
|
switch (LNA_idx) {
|
|
|
|
case 7:
|
|
|
|
if (VGA_idx <= 27)
|
2013-07-10 18:25:07 +00:00
|
|
|
rx_pwr_all = -100 + 2*(27-VGA_idx); /* VGA_idx = 27~2 */
|
2013-06-21 18:41:29 +00:00
|
|
|
else
|
|
|
|
rx_pwr_all = -100;
|
|
|
|
break;
|
|
|
|
case 6:
|
2013-07-10 18:25:07 +00:00
|
|
|
rx_pwr_all = -48 + 2*(2-VGA_idx); /* VGA_idx = 2~0 */
|
2013-06-21 18:41:29 +00:00
|
|
|
break;
|
|
|
|
case 5:
|
2013-07-10 18:25:07 +00:00
|
|
|
rx_pwr_all = -42 + 2*(7-VGA_idx); /* VGA_idx = 7~5 */
|
2013-06-21 18:41:29 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2013-07-10 18:25:07 +00:00
|
|
|
rx_pwr_all = -36 + 2*(7-VGA_idx); /* VGA_idx = 7~4 */
|
2013-06-21 18:41:29 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2013-07-10 18:25:07 +00:00
|
|
|
rx_pwr_all = -24 + 2*(7-VGA_idx); /* VGA_idx = 7~0 */
|
2013-06-21 18:41:29 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (cck_highpwr)
|
2013-07-10 18:25:07 +00:00
|
|
|
rx_pwr_all = -12 + 2*(5-VGA_idx); /* VGA_idx = 5~0 */
|
2013-06-21 18:41:29 +00:00
|
|
|
else
|
2013-08-07 19:30:06 +00:00
|
|
|
rx_pwr_all = -6 + 2*(5-VGA_idx);
|
2013-06-21 18:41:29 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
rx_pwr_all = 8-2*VGA_idx;
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
rx_pwr_all = 14-2*VGA_idx;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
rx_pwr_all += 6;
|
|
|
|
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
|
2013-08-07 19:30:06 +00:00
|
|
|
if (!cck_highpwr) {
|
2013-05-19 04:28:07 +00:00
|
|
|
if (PWDB_ALL >= 80)
|
|
|
|
PWDB_ALL = ((PWDB_ALL-80)<<1)+((PWDB_ALL-80)>>1)+80;
|
|
|
|
else if ((PWDB_ALL <= 78) && (PWDB_ALL >= 20))
|
|
|
|
PWDB_ALL += 3;
|
2013-08-07 19:30:06 +00:00
|
|
|
if (PWDB_ALL > 100)
|
2013-05-19 04:28:07 +00:00
|
|
|
PWDB_ALL = 100;
|
|
|
|
}
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
|
|
|
if (!cck_highpwr) {
|
|
|
|
report = (cck_agc_rpt & 0xc0)>>6;
|
|
|
|
switch (report) {
|
|
|
|
/* 03312009 modified by cosa */
|
|
|
|
/* Modify the RF RNA gain value to -40, -20, -2, 14 by Jenyu's suggestion */
|
|
|
|
/* Note: different RF with the different RNA gain. */
|
|
|
|
case 0x3:
|
|
|
|
rx_pwr_all = -46 - (cck_agc_rpt & 0x3e);
|
|
|
|
break;
|
|
|
|
case 0x2:
|
|
|
|
rx_pwr_all = -26 - (cck_agc_rpt & 0x3e);
|
|
|
|
break;
|
|
|
|
case 0x1:
|
|
|
|
rx_pwr_all = -12 - (cck_agc_rpt & 0x3e);
|
|
|
|
break;
|
|
|
|
case 0x0:
|
|
|
|
rx_pwr_all = 16 - (cck_agc_rpt & 0x3e);
|
|
|
|
break;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
report = (cck_agc_rpt & 0x60)>>5;
|
2013-08-07 19:30:06 +00:00
|
|
|
switch (report) {
|
|
|
|
case 0x3:
|
|
|
|
rx_pwr_all = -46 - ((cck_agc_rpt & 0x1f)<<1) ;
|
|
|
|
break;
|
|
|
|
case 0x2:
|
|
|
|
rx_pwr_all = -26 - ((cck_agc_rpt & 0x1f)<<1);
|
|
|
|
break;
|
|
|
|
case 0x1:
|
|
|
|
rx_pwr_all = -12 - ((cck_agc_rpt & 0x1f)<<1);
|
|
|
|
break;
|
|
|
|
case 0x0:
|
|
|
|
rx_pwr_all = 16 - ((cck_agc_rpt & 0x1f)<<1);
|
|
|
|
break;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Modification for ext-LNA board */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (dm_odm->BoardType == ODM_BOARD_HIGHPWR) {
|
|
|
|
if ((cck_agc_rpt>>7) == 0) {
|
|
|
|
PWDB_ALL = (PWDB_ALL > 94) ? 100 : (PWDB_ALL+6);
|
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
if (PWDB_ALL > 38)
|
|
|
|
PWDB_ALL -= 16;
|
|
|
|
else
|
2013-08-07 19:30:06 +00:00
|
|
|
PWDB_ALL = (PWDB_ALL <= 16) ? (PWDB_ALL>>2) : (PWDB_ALL-12);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* CCK modification */
|
2013-05-19 04:28:07 +00:00
|
|
|
if (PWDB_ALL > 25 && PWDB_ALL <= 60)
|
|
|
|
PWDB_ALL += 6;
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {/* Modification for int-LNA board */
|
2013-05-19 04:28:07 +00:00
|
|
|
if (PWDB_ALL > 99)
|
|
|
|
PWDB_ALL -= 8;
|
|
|
|
else if (PWDB_ALL > 50 && PWDB_ALL <= 68)
|
|
|
|
PWDB_ALL += 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pPhyInfo->RxPWDBAll = PWDB_ALL;
|
|
|
|
pPhyInfo->BTRxRSSIPercentage = PWDB_ALL;
|
|
|
|
pPhyInfo->RecvSignalPower = rx_pwr_all;
|
2013-07-10 18:25:07 +00:00
|
|
|
/* (3) Get Signal Quality (EVM) */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (pPktinfo->bPacketMatchBSSID) {
|
2013-08-14 17:03:28 +00:00
|
|
|
u8 SQ, SQ_rpt;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
if ((dm_odm->SupportPlatform == ODM_MP) && (dm_odm->PatchID == 19)) {
|
|
|
|
SQ = odm_SQ_process_patch_RT_CID_819x_Lenovo(dm_odm, isCCKrate, PWDB_ALL, 0, 0);
|
|
|
|
} else if (pPhyInfo->RxPWDBAll > 40 && !dm_odm->bInHctTest) {
|
2013-05-19 04:28:07 +00:00
|
|
|
SQ = 100;
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
SQ_rpt = pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all;
|
|
|
|
|
|
|
|
if (SQ_rpt > 64)
|
|
|
|
SQ = 0;
|
|
|
|
else if (SQ_rpt < 20)
|
|
|
|
SQ = 100;
|
|
|
|
else
|
|
|
|
SQ = ((64-SQ_rpt) * 100) / 44;
|
|
|
|
}
|
|
|
|
pPhyInfo->SignalQuality = SQ;
|
2016-02-15 01:23:53 +00:00
|
|
|
pPhyInfo->RxMIMOSignalQuality[RF_PATH_A] = SQ;
|
|
|
|
pPhyInfo->RxMIMOSignalQuality[RF_PATH_B] = -1;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
2013-08-07 19:30:06 +00:00
|
|
|
} else { /* is OFDM rate */
|
|
|
|
dm_odm->PhyDbgInfo.NumQryPhyStatusOFDM++;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* (1)Get RSSI for HT rate */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2016-02-15 01:23:53 +00:00
|
|
|
for (i = RF_PATH_A; i < RF_PATH_MAX; i++) {
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 2008/01/30 MH we will judge RF RX path now. */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (dm_odm->RFPathRxEnable & BIT(i))
|
2013-05-19 04:28:07 +00:00
|
|
|
rf_rx_num++;
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
rx_pwr[i] = ((pPhyStaRpt->path_agc[i].gain & 0x3F)*2) - 110;
|
2013-12-31 03:18:17 +00:00
|
|
|
if (i == RF_PATH_A)
|
|
|
|
adapt->signal_strength = rx_pwr[i];
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
pPhyInfo->RxPwr[i] = rx_pwr[i];
|
|
|
|
|
|
|
|
/* Translate DBM to percentage. */
|
|
|
|
RSSI = odm_QueryRxPwrPercentage(rx_pwr[i]);
|
|
|
|
total_rssi += RSSI;
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Modification for ext-LNA board */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (dm_odm->BoardType == ODM_BOARD_HIGHPWR) {
|
2013-05-19 04:28:07 +00:00
|
|
|
if ((pPhyStaRpt->path_agc[i].trsw) == 1)
|
2013-08-07 19:30:06 +00:00
|
|
|
RSSI = (RSSI > 94) ? 100 : (RSSI + 6);
|
2013-05-19 04:28:07 +00:00
|
|
|
else
|
2013-08-07 19:30:06 +00:00
|
|
|
RSSI = (RSSI <= 16) ? (RSSI >> 3) : (RSSI - 16);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
if ((RSSI <= 34) && (RSSI >= 4))
|
2013-05-19 04:28:07 +00:00
|
|
|
RSSI -= 4;
|
|
|
|
}
|
|
|
|
|
2013-08-14 17:03:28 +00:00
|
|
|
pPhyInfo->RxMIMOSignalStrength[i] = (u8)RSSI;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Get Rx snr value in DB */
|
2013-08-14 17:03:28 +00:00
|
|
|
pPhyInfo->RxSNR[i] = (s32)(pPhyStaRpt->path_rxsnr[i]/2);
|
|
|
|
dm_odm->PhyDbgInfo.RxSNRdB[i] = (s32)(pPhyStaRpt->path_rxsnr[i]/2);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
/* Record Signal Strength for next packet */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (pPktinfo->bPacketMatchBSSID) {
|
|
|
|
if ((dm_odm->SupportPlatform == ODM_MP) && (dm_odm->PatchID == 19)) {
|
2016-02-15 01:23:53 +00:00
|
|
|
if (i == RF_PATH_A)
|
2013-08-07 19:30:06 +00:00
|
|
|
pPhyInfo->SignalQuality = odm_SQ_process_patch_RT_CID_819x_Lenovo(dm_odm, isCCKrate, PWDB_ALL, i, RSSI);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-07-10 18:25:07 +00:00
|
|
|
/* (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive) */
|
2013-08-07 19:30:06 +00:00
|
|
|
rx_pwr_all = (((pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all) >> 1) & 0x7f) - 110;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
|
|
|
|
PWDB_ALL_BT = PWDB_ALL;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
pPhyInfo->RxPWDBAll = PWDB_ALL;
|
|
|
|
pPhyInfo->BTRxRSSIPercentage = PWDB_ALL_BT;
|
|
|
|
pPhyInfo->RxPower = rx_pwr_all;
|
|
|
|
pPhyInfo->RecvSignalPower = rx_pwr_all;
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
if ((dm_odm->SupportPlatform == ODM_MP) && (dm_odm->PatchID == 19)) {
|
2013-07-10 18:25:07 +00:00
|
|
|
/* do nothing */
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-07-10 18:25:07 +00:00
|
|
|
/* (3)EVM of HT rate */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (pPktinfo->Rate >= DESC92C_RATEMCS8 && pPktinfo->Rate <= DESC92C_RATEMCS15)
|
2013-07-10 18:25:07 +00:00
|
|
|
Max_spatial_stream = 2; /* both spatial stream make sense */
|
2013-05-19 04:28:07 +00:00
|
|
|
else
|
2013-07-10 18:25:07 +00:00
|
|
|
Max_spatial_stream = 1; /* only spatial stream 1 makes sense */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
for (i = 0; i < Max_spatial_stream; i++) {
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Do not use shift operation like "rx_evmX >>= 1" because the compilor of free build environment */
|
|
|
|
/* fill most significant bit to "zero" when doing shifting operation which may change a negative */
|
|
|
|
/* value to positive one, then the dbm value (which is supposed to be negative) is not correct anymore. */
|
|
|
|
EVM = odm_EVMdbToPercentage((pPhyStaRpt->stream_rxevm[i])); /* dbm */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
if (pPktinfo->bPacketMatchBSSID) {
|
2016-02-15 01:23:53 +00:00
|
|
|
if (i == RF_PATH_A) /* Fill value in RFD, Get the first spatial stream only */
|
2013-08-14 17:03:28 +00:00
|
|
|
pPhyInfo->SignalQuality = (u8)(EVM & 0xff);
|
|
|
|
pPhyInfo->RxMIMOSignalQuality[i] = (u8)(EVM & 0xff);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-07-10 18:25:07 +00:00
|
|
|
/* UI BSS List signal strength(in percentage), make it good looking, from 0~100. */
|
|
|
|
/* It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp(). */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (isCCKrate) {
|
2013-08-14 17:03:28 +00:00
|
|
|
pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(dm_odm, PWDB_ALL));/* PWDB_ALL; */
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
if (rf_rx_num != 0)
|
2013-08-14 17:03:28 +00:00
|
|
|
pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(dm_odm, total_rssi /= rf_rx_num));
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* For 92C/92D HW (Hybrid) Antenna Diversity */
|
2013-05-19 04:28:07 +00:00
|
|
|
pDM_SWAT_Table->antsel = pPhyStaRpt->ant_sel;
|
2013-07-10 18:25:07 +00:00
|
|
|
/* For 88E HW Antenna Diversity */
|
2013-08-07 19:30:06 +00:00
|
|
|
dm_odm->DM_FatTable.antsel_rx_keep_0 = pPhyStaRpt->ant_sel;
|
|
|
|
dm_odm->DM_FatTable.antsel_rx_keep_1 = pPhyStaRpt->ant_sel_b;
|
|
|
|
dm_odm->DM_FatTable.antsel_rx_keep_2 = pPhyStaRpt->antsel_rx_keep_2;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
void odm_Init_RSSIForDM(struct odm_dm_struct *dm_odm)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
static void odm_Process_RSSIForDM(struct odm_dm_struct *dm_odm,
|
|
|
|
struct odm_phy_status_info *pPhyInfo,
|
|
|
|
struct odm_per_pkt_info *pPktinfo)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-14 17:03:28 +00:00
|
|
|
s32 UndecoratedSmoothedPWDB, UndecoratedSmoothedCCK;
|
|
|
|
s32 UndecoratedSmoothedOFDM, RSSI_Ave;
|
|
|
|
u8 isCCKrate = 0;
|
|
|
|
u8 RSSI_max, RSSI_min, i;
|
|
|
|
u32 OFDM_pkt = 0;
|
|
|
|
u32 Weighting = 0;
|
2013-08-07 19:30:06 +00:00
|
|
|
struct sta_info *pEntry;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
if (pPktinfo->StationID == 0xFF)
|
|
|
|
return;
|
2013-08-07 19:30:06 +00:00
|
|
|
pEntry = dm_odm->pODM_StaInfo[pPktinfo->StationID];
|
|
|
|
if (!IS_STA_VALID(pEntry))
|
2013-05-19 04:28:07 +00:00
|
|
|
return;
|
|
|
|
if ((!pPktinfo->bPacketMatchBSSID))
|
|
|
|
return;
|
|
|
|
|
2013-06-21 18:41:29 +00:00
|
|
|
isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M) && (pPktinfo->Rate <= DESC92C_RATE11M)) ? true : false;
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Smart Antenna Debug Message------------------ */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (dm_odm->SupportICType == ODM_RTL8188E) {
|
2013-08-14 17:03:28 +00:00
|
|
|
u8 antsel_tr_mux;
|
2013-08-07 19:30:06 +00:00
|
|
|
struct fast_ant_train *pDM_FatTable = &dm_odm->DM_FatTable;
|
|
|
|
|
|
|
|
if (dm_odm->AntDivType == CG_TRX_SMART_ANTDIV) {
|
|
|
|
if (pDM_FatTable->FAT_State == FAT_TRAINING_STATE) {
|
|
|
|
if (pPktinfo->bPacketToSelf) {
|
|
|
|
antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2<<2) |
|
|
|
|
(pDM_FatTable->antsel_rx_keep_1<<1) |
|
|
|
|
pDM_FatTable->antsel_rx_keep_0;
|
2013-05-19 04:28:07 +00:00
|
|
|
pDM_FatTable->antSumRSSI[antsel_tr_mux] += pPhyInfo->RxPWDBAll;
|
|
|
|
pDM_FatTable->antRSSIcnt[antsel_tr_mux]++;
|
|
|
|
}
|
|
|
|
}
|
2013-08-07 19:30:06 +00:00
|
|
|
} else if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV)) {
|
|
|
|
if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon) {
|
|
|
|
antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2<<2) |
|
|
|
|
(pDM_FatTable->antsel_rx_keep_1<<1) | pDM_FatTable->antsel_rx_keep_0;
|
|
|
|
ODM_AntselStatistics_88E(dm_odm, antsel_tr_mux, pPktinfo->StationID, pPhyInfo->RxPWDBAll);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-08-07 19:30:06 +00:00
|
|
|
/* Smart Antenna Debug Message------------------ */
|
2013-05-19 04:28:07 +00:00
|
|
|
|
|
|
|
UndecoratedSmoothedCCK = pEntry->rssi_stat.UndecoratedSmoothedCCK;
|
|
|
|
UndecoratedSmoothedOFDM = pEntry->rssi_stat.UndecoratedSmoothedOFDM;
|
|
|
|
UndecoratedSmoothedPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB;
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon) {
|
|
|
|
if (!isCCKrate) { /* ofdm rate */
|
2016-02-15 01:23:53 +00:00
|
|
|
if (pPhyInfo->RxMIMOSignalStrength[RF_PATH_B] == 0) {
|
|
|
|
RSSI_Ave = pPhyInfo->RxMIMOSignalStrength[RF_PATH_A];
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2016-02-15 01:23:53 +00:00
|
|
|
if (pPhyInfo->RxMIMOSignalStrength[RF_PATH_A] > pPhyInfo->RxMIMOSignalStrength[RF_PATH_B]) {
|
|
|
|
RSSI_max = pPhyInfo->RxMIMOSignalStrength[RF_PATH_A];
|
|
|
|
RSSI_min = pPhyInfo->RxMIMOSignalStrength[RF_PATH_B];
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2016-02-15 01:23:53 +00:00
|
|
|
RSSI_max = pPhyInfo->RxMIMOSignalStrength[RF_PATH_B];
|
|
|
|
RSSI_min = pPhyInfo->RxMIMOSignalStrength[RF_PATH_A];
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
2013-08-07 19:30:06 +00:00
|
|
|
if ((RSSI_max - RSSI_min) < 3)
|
2013-05-19 04:28:07 +00:00
|
|
|
RSSI_Ave = RSSI_max;
|
2013-08-07 19:30:06 +00:00
|
|
|
else if ((RSSI_max - RSSI_min) < 6)
|
2013-05-19 04:28:07 +00:00
|
|
|
RSSI_Ave = RSSI_max - 1;
|
2013-08-07 19:30:06 +00:00
|
|
|
else if ((RSSI_max - RSSI_min) < 10)
|
2013-05-19 04:28:07 +00:00
|
|
|
RSSI_Ave = RSSI_max - 2;
|
|
|
|
else
|
|
|
|
RSSI_Ave = RSSI_max - 3;
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 1 Process OFDM RSSI */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (UndecoratedSmoothedOFDM <= 0) { /* initialize */
|
2013-05-19 04:28:07 +00:00
|
|
|
UndecoratedSmoothedOFDM = pPhyInfo->RxPWDBAll;
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-08-14 17:03:28 +00:00
|
|
|
if (pPhyInfo->RxPWDBAll > (u32)UndecoratedSmoothedOFDM) {
|
2013-05-19 04:28:07 +00:00
|
|
|
UndecoratedSmoothedOFDM =
|
|
|
|
(((UndecoratedSmoothedOFDM)*(Rx_Smooth_Factor-1)) +
|
2013-08-07 19:30:06 +00:00
|
|
|
(RSSI_Ave)) / (Rx_Smooth_Factor);
|
2013-05-19 04:28:07 +00:00
|
|
|
UndecoratedSmoothedOFDM = UndecoratedSmoothedOFDM + 1;
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
UndecoratedSmoothedOFDM =
|
|
|
|
(((UndecoratedSmoothedOFDM)*(Rx_Smooth_Factor-1)) +
|
2013-08-07 19:30:06 +00:00
|
|
|
(RSSI_Ave)) / (Rx_Smooth_Factor);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pEntry->rssi_stat.PacketMap = (pEntry->rssi_stat.PacketMap<<1) | BIT0;
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
RSSI_Ave = pPhyInfo->RxPWDBAll;
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 1 Process CCK RSSI */
|
2013-08-07 19:30:06 +00:00
|
|
|
if (UndecoratedSmoothedCCK <= 0) { /* initialize */
|
2013-05-19 04:28:07 +00:00
|
|
|
UndecoratedSmoothedCCK = pPhyInfo->RxPWDBAll;
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-08-14 17:03:28 +00:00
|
|
|
if (pPhyInfo->RxPWDBAll > (u32)UndecoratedSmoothedCCK) {
|
2013-05-19 04:28:07 +00:00
|
|
|
UndecoratedSmoothedCCK =
|
2013-08-07 19:30:06 +00:00
|
|
|
((UndecoratedSmoothedCCK * (Rx_Smooth_Factor-1)) +
|
|
|
|
pPhyInfo->RxPWDBAll) / Rx_Smooth_Factor;
|
2013-05-19 04:28:07 +00:00
|
|
|
UndecoratedSmoothedCCK = UndecoratedSmoothedCCK + 1;
|
2013-08-07 19:30:06 +00:00
|
|
|
} else {
|
2013-05-19 04:28:07 +00:00
|
|
|
UndecoratedSmoothedCCK =
|
2013-08-07 19:30:06 +00:00
|
|
|
((UndecoratedSmoothedCCK * (Rx_Smooth_Factor-1)) +
|
|
|
|
pPhyInfo->RxPWDBAll) / Rx_Smooth_Factor;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
pEntry->rssi_stat.PacketMap = pEntry->rssi_stat.PacketMap<<1;
|
|
|
|
}
|
2013-08-07 19:30:06 +00:00
|
|
|
/* 2011.07.28 LukeLee: modified to prevent unstable CCK RSSI */
|
|
|
|
if (pEntry->rssi_stat.ValidBit >= 64)
|
|
|
|
pEntry->rssi_stat.ValidBit = 64;
|
|
|
|
else
|
|
|
|
pEntry->rssi_stat.ValidBit++;
|
|
|
|
|
|
|
|
for (i = 0; i < pEntry->rssi_stat.ValidBit; i++)
|
2013-08-14 17:03:28 +00:00
|
|
|
OFDM_pkt += (u8)(pEntry->rssi_stat.PacketMap>>i)&BIT0;
|
2013-08-07 19:30:06 +00:00
|
|
|
|
|
|
|
if (pEntry->rssi_stat.ValidBit == 64) {
|
|
|
|
Weighting = ((OFDM_pkt<<4) > 64) ? 64 : (OFDM_pkt<<4);
|
|
|
|
UndecoratedSmoothedPWDB = (Weighting*UndecoratedSmoothedOFDM+(64-Weighting)*UndecoratedSmoothedCCK)>>6;
|
|
|
|
} else {
|
|
|
|
if (pEntry->rssi_stat.ValidBit != 0)
|
|
|
|
UndecoratedSmoothedPWDB = (OFDM_pkt * UndecoratedSmoothedOFDM +
|
|
|
|
(pEntry->rssi_stat.ValidBit-OFDM_pkt) *
|
|
|
|
UndecoratedSmoothedCCK)/pEntry->rssi_stat.ValidBit;
|
2013-05-19 04:28:07 +00:00
|
|
|
else
|
2013-08-07 19:30:06 +00:00
|
|
|
UndecoratedSmoothedPWDB = 0;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
2013-08-07 19:30:06 +00:00
|
|
|
pEntry->rssi_stat.UndecoratedSmoothedCCK = UndecoratedSmoothedCCK;
|
|
|
|
pEntry->rssi_stat.UndecoratedSmoothedOFDM = UndecoratedSmoothedOFDM;
|
|
|
|
pEntry->rssi_stat.UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB;
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Endianness before calling this API */
|
2013-08-07 19:30:06 +00:00
|
|
|
static void ODM_PhyStatusQuery_92CSeries(struct odm_dm_struct *dm_odm,
|
|
|
|
struct odm_phy_status_info *pPhyInfo,
|
2013-08-14 17:03:28 +00:00
|
|
|
u8 *pPhyStatus,
|
2013-12-31 03:18:17 +00:00
|
|
|
struct odm_per_pkt_info *pPktinfo,
|
|
|
|
struct adapter *adapt)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-07 19:30:06 +00:00
|
|
|
odm_RxPhyStatus92CSeries_Parsing(dm_odm, pPhyInfo, pPhyStatus,
|
2013-12-31 03:18:17 +00:00
|
|
|
pPktinfo, adapt);
|
2013-08-07 19:30:06 +00:00
|
|
|
if (dm_odm->RSSI_test) {
|
2013-07-10 18:25:07 +00:00
|
|
|
/* Select the packets to do RSSI checking for antenna switching. */
|
2013-05-19 04:28:07 +00:00
|
|
|
if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon)
|
2013-08-07 19:30:06 +00:00
|
|
|
ODM_SwAntDivChkPerPktRssi(dm_odm, pPktinfo->StationID, pPhyInfo);
|
2013-05-19 04:28:07 +00:00
|
|
|
} else {
|
2013-08-07 19:30:06 +00:00
|
|
|
odm_Process_RSSIForDM(dm_odm, pPhyInfo, pPktinfo);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
void ODM_PhyStatusQuery(struct odm_dm_struct *dm_odm,
|
2013-07-26 16:20:42 +00:00
|
|
|
struct odm_phy_status_info *pPhyInfo,
|
2013-12-31 03:18:17 +00:00
|
|
|
u8 *pPhyStatus, struct odm_per_pkt_info *pPktinfo,
|
|
|
|
struct adapter *adapt)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-12-31 03:18:17 +00:00
|
|
|
ODM_PhyStatusQuery_92CSeries(dm_odm, pPhyInfo, pPhyStatus, pPktinfo, adapt);
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-07-10 18:25:07 +00:00
|
|
|
/* For future use. */
|
2013-08-14 17:03:28 +00:00
|
|
|
void ODM_MacStatusQuery(struct odm_dm_struct *dm_odm, u8 *mac_stat,
|
|
|
|
u8 macid, bool pkt_match_bssid,
|
2013-08-07 19:30:06 +00:00
|
|
|
bool pkttoself, bool pkt_beacon)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-07-10 18:25:07 +00:00
|
|
|
/* 2011/10/19 Driver team will handle in the future. */
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
enum HAL_STATUS ODM_ConfigRFWithHeaderFile(struct odm_dm_struct *dm_odm,
|
2016-02-15 01:23:53 +00:00
|
|
|
enum rf_radio_path content,
|
|
|
|
enum rf_radio_path rfpath)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-07 19:30:06 +00:00
|
|
|
ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===>ODM_ConfigRFWithHeaderFile\n"));
|
|
|
|
if (dm_odm->SupportICType == ODM_RTL8188E) {
|
2016-02-15 01:23:53 +00:00
|
|
|
if (rfpath == RF_PATH_A)
|
2013-08-07 19:30:06 +00:00
|
|
|
READ_AND_CONFIG(8188E, _RadioA_1T_);
|
|
|
|
ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, (" ===> ODM_ConfigRFWithHeaderFile() Radio_A:Rtl8188ERadioA_1TArray\n"));
|
|
|
|
ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, (" ===> ODM_ConfigRFWithHeaderFile() Radio_B:Rtl8188ERadioB_1TArray\n"));
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("ODM_ConfigRFWithHeaderFile: Radio No %x\n", rfpath));
|
2013-05-19 04:28:07 +00:00
|
|
|
return HAL_STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
enum HAL_STATUS ODM_ConfigBBWithHeaderFile(struct odm_dm_struct *dm_odm,
|
|
|
|
enum odm_bb_config_type config_tp)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-07 19:30:06 +00:00
|
|
|
if (dm_odm->SupportICType == ODM_RTL8188E) {
|
|
|
|
if (config_tp == CONFIG_BB_PHY_REG) {
|
|
|
|
READ_AND_CONFIG(8188E, _PHY_REG_1T_);
|
|
|
|
} else if (config_tp == CONFIG_BB_AGC_TAB) {
|
|
|
|
READ_AND_CONFIG(8188E, _AGC_TAB_1T_);
|
|
|
|
} else if (config_tp == CONFIG_BB_PHY_REG_PG) {
|
|
|
|
READ_AND_CONFIG(8188E, _PHY_REG_PG_);
|
|
|
|
ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD,
|
|
|
|
(" ===> phy_ConfigBBWithHeaderFile() agc:Rtl8188EPHY_REG_PGArray\n"));
|
2013-05-19 04:28:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return HAL_STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-08-07 19:30:06 +00:00
|
|
|
enum HAL_STATUS ODM_ConfigMACWithHeaderFile(struct odm_dm_struct *dm_odm)
|
2013-05-19 04:28:07 +00:00
|
|
|
{
|
2013-08-14 17:03:28 +00:00
|
|
|
u8 result = HAL_STATUS_SUCCESS;
|
2013-08-07 19:30:06 +00:00
|
|
|
if (dm_odm->SupportICType == ODM_RTL8188E)
|
|
|
|
result = READ_AND_CONFIG(8188E, _MAC_REG_);
|
2013-05-19 04:28:07 +00:00
|
|
|
return result;
|
|
|
|
}
|