2013-05-08 21:45:39 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
2014-12-19 06:59:46 +00:00
|
|
|
*
|
2013-05-08 21:45:39 +00:00
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#include "odm_precomp.h"
|
|
|
|
|
2014-12-17 04:09:56 +00:00
|
|
|
void
|
|
|
|
odm_ConfigRFReg_8188E(
|
2015-03-13 17:06:38 +00:00
|
|
|
PDM_ODM_T pDM_Odm,
|
|
|
|
u32 Addr,
|
|
|
|
u32 Data,
|
2016-02-15 02:14:42 +00:00
|
|
|
enum rf_radio_path RF_PATH,
|
2015-03-13 17:06:38 +00:00
|
|
|
u32 RegAddr
|
2014-12-17 04:09:56 +00:00
|
|
|
)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (Addr == 0xffe)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_sleep_ms(50);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
|
|
|
else if (Addr == 0xfd)
|
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_ms(5);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
|
|
|
else if (Addr == 0xfc)
|
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_ms(1);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
|
|
|
else if (Addr == 0xfb)
|
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(50);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
|
|
|
else if (Addr == 0xfa)
|
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(5);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
|
|
|
else if (Addr == 0xf9)
|
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(1);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_SetRFReg(pDM_Odm, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
|
2015-02-20 00:51:33 +00:00
|
|
|
/* Add 1us delay between BB/RF register setting. */
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(1);
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2014-12-17 04:09:56 +00:00
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
void
|
2014-12-17 04:09:56 +00:00
|
|
|
odm_ConfigRF_RadioA_8188E(
|
2015-03-13 17:06:38 +00:00
|
|
|
PDM_ODM_T pDM_Odm,
|
|
|
|
u32 Addr,
|
|
|
|
u32 Data
|
2014-12-17 04:09:56 +00:00
|
|
|
)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2015-02-20 00:51:33 +00:00
|
|
|
u32 content = 0x1000; /* RF_Content: radioa_txt */
|
2014-12-30 22:55:10 +00:00
|
|
|
u32 maskforPhySet= (u32)(content&0xE000);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2016-02-15 02:14:42 +00:00
|
|
|
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, RF_PATH_A, Addr|maskforPhySet);
|
2014-12-17 04:09:56 +00:00
|
|
|
|
2015-03-10 16:18:03 +00:00
|
|
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", Addr, Data));
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
void
|
2014-12-17 04:09:56 +00:00
|
|
|
odm_ConfigRF_RadioB_8188E(
|
2015-03-13 17:06:38 +00:00
|
|
|
PDM_ODM_T pDM_Odm,
|
|
|
|
u32 Addr,
|
|
|
|
u32 Data
|
2014-12-17 04:09:56 +00:00
|
|
|
)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2015-02-20 00:51:33 +00:00
|
|
|
u32 content = 0x1001; /* RF_Content: radiob_txt */
|
2014-12-30 22:55:10 +00:00
|
|
|
u32 maskforPhySet= (u32)(content&0xE000);
|
2013-05-19 04:28:07 +00:00
|
|
|
|
2016-02-15 02:14:42 +00:00
|
|
|
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, RF_PATH_B, Addr|maskforPhySet);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-17 04:09:56 +00:00
|
|
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioB] %08X %08X\n", Addr, Data));
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
void
|
2014-12-17 04:09:56 +00:00
|
|
|
odm_ConfigMAC_8188E(
|
2015-03-13 17:06:38 +00:00
|
|
|
PDM_ODM_T pDM_Odm,
|
|
|
|
u32 Addr,
|
|
|
|
u8 Data
|
2014-12-19 06:59:46 +00:00
|
|
|
)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
ODM_Write1Byte(pDM_Odm, Addr, Data);
|
2014-12-17 04:09:56 +00:00
|
|
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", Addr, Data));
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
void
|
2014-12-17 04:09:56 +00:00
|
|
|
odm_ConfigBB_AGC_8188E(
|
2015-03-13 17:06:38 +00:00
|
|
|
PDM_ODM_T pDM_Odm,
|
|
|
|
u32 Addr,
|
|
|
|
u32 Bitmask,
|
|
|
|
u32 Data
|
2014-12-17 04:09:56 +00:00
|
|
|
)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2014-12-19 06:59:46 +00:00
|
|
|
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
2015-02-20 00:51:33 +00:00
|
|
|
/* Add 1us delay between BB/RF register setting. */
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(1);
|
|
|
|
|
2015-03-10 16:18:03 +00:00
|
|
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", Addr, Data));
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-17 04:09:56 +00:00
|
|
|
void
|
|
|
|
odm_ConfigBB_PHY_REG_PG_8188E(
|
2015-03-13 17:06:38 +00:00
|
|
|
PDM_ODM_T pDM_Odm,
|
|
|
|
u32 Addr,
|
|
|
|
u32 Bitmask,
|
|
|
|
u32 Data
|
2014-12-17 04:09:56 +00:00
|
|
|
)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:24:16 +00:00
|
|
|
if (Addr == 0xfe) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_sleep_ms(50);
|
2015-08-15 18:24:16 +00:00
|
|
|
} else if (Addr == 0xfd) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_ms(5);
|
2015-08-15 18:24:16 +00:00
|
|
|
} else if (Addr == 0xfc) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_ms(1);
|
2015-08-15 18:24:16 +00:00
|
|
|
} else if (Addr == 0xfb) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(50);
|
2015-08-15 18:24:16 +00:00
|
|
|
} else if (Addr == 0xfa) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(5);
|
2015-08-15 18:24:16 +00:00
|
|
|
} else if (Addr == 0xf9) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(1);
|
2015-08-15 18:27:00 +00:00
|
|
|
} else {
|
2014-12-17 04:09:56 +00:00
|
|
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> @@@@@@@ ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X %08X\n", Addr, Bitmask, Data));
|
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
storePwrIndexDiffRateOffset(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
|
|
|
}
|
2014-12-17 04:09:56 +00:00
|
|
|
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
void
|
2014-12-17 04:09:56 +00:00
|
|
|
odm_ConfigBB_PHY_8188E(
|
2015-03-13 17:06:38 +00:00
|
|
|
PDM_ODM_T pDM_Odm,
|
|
|
|
u32 Addr,
|
|
|
|
u32 Bitmask,
|
|
|
|
u32 Data
|
2014-12-17 04:09:56 +00:00
|
|
|
)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:24:16 +00:00
|
|
|
if (Addr == 0xfe) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_sleep_ms(50);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
2015-08-15 18:24:16 +00:00
|
|
|
else if (Addr == 0xfd) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_ms(5);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
2015-08-15 18:24:16 +00:00
|
|
|
else if (Addr == 0xfc) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_ms(1);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
2015-08-15 18:24:16 +00:00
|
|
|
else if (Addr == 0xfb) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(50);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
2015-08-15 18:24:16 +00:00
|
|
|
else if (Addr == 0xfa) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(5);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
2015-08-15 18:24:16 +00:00
|
|
|
else if (Addr == 0xf9) {
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(1);
|
2014-12-17 04:09:56 +00:00
|
|
|
}
|
2015-08-15 18:27:00 +00:00
|
|
|
else {
|
2013-05-08 21:45:39 +00:00
|
|
|
if (Addr == 0xa24)
|
2014-12-19 06:59:46 +00:00
|
|
|
pDM_Odm->RFCalibrateInfo.RegA24 = Data;
|
|
|
|
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
|
|
|
|
2015-02-20 00:51:33 +00:00
|
|
|
/* Add 1us delay between BB/RF register setting. */
|
2013-05-08 21:45:39 +00:00
|
|
|
ODM_delay_us(1);
|
2014-12-19 06:59:46 +00:00
|
|
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data));
|
2013-05-08 21:45:39 +00:00
|
|
|
}
|
|
|
|
}
|