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
24 // need to disable antenna diversity
25 // call this function to disable all ODM related mechanisms
26 // which will switch antenna.
27 //======================================================
28 void ODM_StopAntennaSwitchDm(PDM_ODM_T pDM_Odm)
30 // disable ODM antenna diversity
31 pDM_Odm->SupportAbility &= ~ODM_BB_ANT_DIV;
36 ("STOP Antenna Diversity\n")
40 void ODM_SetAntConfig(PDM_ODM_T pDM_Odm, 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 //======================================================
51 void ODM_SwAntDivRestAfterLink(PDM_ODM_T pDM_Odm)
53 pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
54 pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
57 pDM_Odm->RSSI_test = false;
58 pDM_SWAT_Table->try_flag = 0xff;
59 pDM_SWAT_Table->RSSI_Trying = 0;
60 pDM_SWAT_Table->Double_chk_flag = 0;
62 pDM_FatTable->RxIdleAnt = MAIN_ANT;
64 for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) {
65 pDM_FatTable->MainAnt_Sum[i] = 0;
66 pDM_FatTable->AuxAnt_Sum[i] = 0;
67 pDM_FatTable->MainAnt_Cnt[i] = 0;
68 pDM_FatTable->AuxAnt_Cnt[i] = 0;