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 //============================================================
18 //============================================================
20 #include "odm_precomp.h"
22 //======================================================
23 // when antenna test utility is on or some testing need to disable antenna diversity
24 // call this function to disable all ODM related mechanisms which will switch antenna.
25 //======================================================
27 ODM_StopAntennaSwitchDm(
31 // disable ODM antenna diversity
32 pDM_Odm->SupportAbility &= ~ODM_BB_ANT_DIV;
33 ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("STOP Antenna Diversity\n"));
39 u8 antSetting // 0=A, 1=B, 2=C, ....
42 if(antSetting == 0) // ant A
43 PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000000);
44 else if(antSetting == 1)
45 PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280);
48 //======================================================
52 ODM_SwAntDivRestAfterLink(
56 pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
57 pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
60 pDM_Odm->RSSI_test = false;
61 pDM_SWAT_Table->try_flag = 0xff;
62 pDM_SWAT_Table->RSSI_Trying = 0;
63 pDM_SWAT_Table->Double_chk_flag= 0;
65 pDM_FatTable->RxIdleAnt=MAIN_ANT;
67 for (i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++)
69 pDM_FatTable->MainAnt_Sum[i] = 0;
70 pDM_FatTable->AuxAnt_Sum[i] = 0;
71 pDM_FatTable->MainAnt_Cnt[i] = 0;
72 pDM_FatTable->AuxAnt_Cnt[i] = 0;