1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 ******************************************************************************/
16 #include "odm_precomp.h"
18 void odm_ConfigRFReg_8723B(
22 ODM_RF_RADIO_PATH_E RF_PATH,
26 if (Addr == 0xfe || Addr == 0xffe)
29 PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
30 /* Add 1us delay between BB/RF register setting. */
33 /* For disable/enable test in high temperature, the B6 value will fail to fill. Suggestion by BB Stanley, 2013.06.25. */
38 getvalue = PHY_QueryRFReg(
39 pDM_Odm->Adapter, RF_PATH, Addr, bMaskDWord
44 while ((getvalue>>8) != (Data>>8)) {
46 PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
48 getvalue = PHY_QueryRFReg(pDM_Odm->Adapter, RF_PATH, Addr, bMaskDWord);
54 "===> ODM_ConfigRFWithHeaderFile: [B6] getvalue 0x%x, Data 0x%x, count %d\n",
69 getvalue = PHY_QueryRFReg(
70 pDM_Odm->Adapter, RF_PATH, Addr, bMaskDWord
75 while (getvalue != Data) {
94 getvalue = PHY_QueryRFReg(
95 pDM_Odm->Adapter, RF_PATH, Addr, bMaskDWord
102 "===> ODM_ConfigRFWithHeaderFile: [B2] getvalue 0x%x, Data 0x%x, count %d\n",
117 void odm_ConfigRF_RadioA_8723B(PDM_ODM_T pDM_Odm, u32 Addr, u32 Data)
119 u32 content = 0x1000; /* RF_Content: radioa_txt */
120 u32 maskforPhySet = (u32)(content&0xE000);
122 odm_ConfigRFReg_8723B(
135 "===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n",
142 void odm_ConfigMAC_8723B(PDM_ODM_T pDM_Odm, u32 Addr, u8 Data)
144 rtw_write8(pDM_Odm->Adapter, Addr, Data);
150 "===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n",
157 void odm_ConfigBB_AGC_8723B(
164 PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data);
165 /* Add 1us delay between BB/RF register setting. */
173 "===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n",
180 void odm_ConfigBB_PHY_REG_PG_8723B(
190 if (Addr == 0xfe || Addr == 0xffe)
193 PHY_StoreTxPowerByRate(pDM_Odm->Adapter, Band, RfPath, TxNum, Addr, Bitmask, Data);
200 "===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X %08X\n",
208 void odm_ConfigBB_PHY_8723B(
217 else if (Addr == 0xfd)
219 else if (Addr == 0xfc)
221 else if (Addr == 0xfb)
223 else if (Addr == 0xfa)
225 else if (Addr == 0xf9)
228 PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data);
231 /* Add 1us delay between BB/RF register setting. */
233 ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data));
236 void odm_ConfigBB_TXPWR_LMT_8723B(