2013-05-08 16:45:39 -05: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
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
2014-12-19 00:59:46 -06:00
|
|
|
|
2013-05-08 16:45:39 -05:00
|
|
|
#include "odm_precomp.h"
|
2014-12-19 00:59:46 -06:00
|
|
|
|
2015-02-19 18:51:33 -06:00
|
|
|
/* 3============================================================ */
|
|
|
|
/* 3 IQ Calibration */
|
|
|
|
/* 3============================================================ */
|
2014-12-16 22:09:56 -06:00
|
|
|
|
2014-12-28 20:06:17 -06:00
|
|
|
void
|
2014-12-16 22:09:56 -06:00
|
|
|
ODM_ResetIQKResult(
|
2015-03-13 12:06:38 -05:00
|
|
|
PDM_ODM_T pDM_Odm
|
2014-12-16 22:09:56 -06:00
|
|
|
)
|
|
|
|
{
|
2014-12-30 17:50:44 -06:00
|
|
|
u8 i;
|
2014-12-17 17:13:53 -06:00
|
|
|
struct adapter *Adapter = pDM_Odm->Adapter;
|
2014-12-16 22:09:56 -06:00
|
|
|
|
|
|
|
if (!IS_HARDWARE_TYPE_8192D(Adapter))
|
|
|
|
return;
|
|
|
|
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD,("PHY_ResetIQKResult:: settings regs %d default regs %d\n", (u32)(sizeof(pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting)/sizeof(IQK_MATRIX_REGS_SETTING)), IQK_Matrix_Settings_NUM));
|
2015-02-19 18:51:33 -06:00
|
|
|
/* 0xe94, 0xe9c, 0xea4, 0xeac, 0xeb4, 0xebc, 0xec4, 0xecc */
|
2014-12-16 22:09:56 -06:00
|
|
|
|
2015-08-15 13:06:32 -05:00
|
|
|
for (i = 0; i < IQK_Matrix_Settings_NUM; i++)
|
2014-12-16 22:09:56 -06:00
|
|
|
{
|
|
|
|
{
|
2014-12-19 00:59:46 -06:00
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][0] =
|
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][2] =
|
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][4] =
|
2014-12-16 22:09:56 -06:00
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][6] = 0x100;
|
|
|
|
|
2014-12-19 00:59:46 -06:00
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][1] =
|
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][3] =
|
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][5] =
|
2014-12-16 22:09:56 -06:00
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][7] = 0x0;
|
|
|
|
|
2015-03-02 17:25:27 -06:00
|
|
|
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].bIQKDone = false;
|
2014-12-19 00:59:46 -06:00
|
|
|
|
2014-12-16 22:09:56 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2014-12-30 17:50:44 -06:00
|
|
|
u8 ODM_GetRightChnlPlaceforIQK(u8 chnl)
|
2014-12-16 22:09:56 -06:00
|
|
|
{
|
2014-12-30 17:50:44 -06:00
|
|
|
u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] =
|
2014-12-16 22:09:56 -06:00
|
|
|
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,149,151,153,155,157,159,161,163,165};
|
2014-12-30 17:50:44 -06:00
|
|
|
u8 place = chnl;
|
2014-12-16 22:09:56 -06:00
|
|
|
|
2014-12-19 00:59:46 -06:00
|
|
|
|
2015-08-15 13:02:34 -05:00
|
|
|
if (chnl > 14)
|
2014-12-16 22:09:56 -06:00
|
|
|
{
|
2015-08-15 13:06:32 -05:00
|
|
|
for (place = 14; place<sizeof(channel_all); place++)
|
2014-12-16 22:09:56 -06:00
|
|
|
{
|
2015-08-15 13:02:34 -05:00
|
|
|
if (channel_all[place] == chnl)
|
2014-12-16 22:09:56 -06:00
|
|
|
{
|
|
|
|
return place-13;
|
|
|
|
}
|
|
|
|
}
|
2014-12-19 00:59:46 -06:00
|
|
|
}
|
2013-05-08 16:45:39 -05:00
|
|
|
return 0;
|
2014-12-16 22:09:56 -06:00
|
|
|
|
2013-05-08 16:45:39 -05:00
|
|
|
}
|