1 /******************************************************************************
3 * Copyright(c) 2007 - 2016 Realtek Corporation.
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 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
22 * Larry Finger <Larry.Finger@lwfinger.net>
24 *****************************************************************************/
26 /* ************************************************************
28 * *************************************************************/
30 #include "mp_precomp.h"
31 #include "phydm_precomp.h"
33 /* ******************************************************
34 * when antenna test utility is on or some testing need to disable antenna
35 * diversity, call this function to disable all ODM related mechanisms which
36 * will switch antenna.
37 * *******************************************************/
38 void odm_stop_antenna_switch_dm(void *dm_void)
40 struct phy_dm_struct *dm = (struct phy_dm_struct *)dm_void;
42 /* disable ODM antenna diversity */
43 dm->support_ability &= ~ODM_BB_ANT_DIV;
44 ODM_RT_TRACE(dm, ODM_COMP_ANT_DIV, "STOP Antenna Diversity\n");
47 void phydm_enable_antenna_diversity(void *dm_void)
49 struct phy_dm_struct *dm = (struct phy_dm_struct *)dm_void;
51 dm->support_ability |= ODM_BB_ANT_DIV;
52 ODM_RT_TRACE(dm, ODM_COMP_ANT_DIV,
53 "AntDiv is enabled & Re-Init AntDiv\n");
54 odm_antenna_diversity_init(dm);
57 void odm_set_ant_config(void *dm_void, u8 ant_setting /* 0=A, 1=B, 2=C, .... */
60 struct phy_dm_struct *dm = (struct phy_dm_struct *)dm_void;
62 if (dm->support_ic_type == ODM_RTL8723B) {
63 if (ant_setting == 0) /* ant A*/
64 odm_set_bb_reg(dm, 0x948, MASKDWORD, 0x00000000);
65 else if (ant_setting == 1)
66 odm_set_bb_reg(dm, 0x948, MASKDWORD, 0x00000280);
67 } else if (dm->support_ic_type == ODM_RTL8723D) {
68 if (ant_setting == 0) /* ant A*/
69 odm_set_bb_reg(dm, 0x948, MASKLWORD, 0x0000);
70 else if (ant_setting == 1)
71 odm_set_bb_reg(dm, 0x948, MASKLWORD, 0x0280);
75 /* ****************************************************** */
77 void odm_sw_ant_div_rest_after_link(void *dm_void) {}
79 void odm_ant_div_reset(void *dm_void) {}
81 void odm_antenna_diversity_init(void *dm_void) {}
83 void odm_antenna_diversity(void *dm_void) {}