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 * *************************************************************/
29 #include "mp_precomp.h"
30 #include "phydm_precomp.h"
32 void odm_dynamic_tx_power_init(void *dm_void)
34 struct phy_dm_struct *dm = (struct phy_dm_struct *)dm_void;
36 dm->last_dtp_lvl = tx_high_pwr_level_normal;
37 dm->dynamic_tx_high_power_lvl = tx_high_pwr_level_normal;
38 dm->tx_agc_ofdm_18_6 =
39 odm_get_bb_reg(dm, 0xC24, MASKDWORD); /*TXAGC {18M 12M 9M 6M}*/
42 void odm_dynamic_tx_power_save_power_index(void *dm_void) {}
44 void odm_dynamic_tx_power_restore_power_index(void *dm_void) {}
46 void odm_dynamic_tx_power_write_power_index(void *dm_void, u8 value)
48 struct phy_dm_struct *dm = (struct phy_dm_struct *)dm_void;
50 u32 power_index_reg[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a};
52 for (index = 0; index < 6; index++)
53 odm_write_1byte(dm, power_index_reg[index], value);
56 static void odm_dynamic_tx_power_nic_ce(void *dm_void) {}
58 void odm_dynamic_tx_power(void *dm_void)
61 /* For AP/ADSL use struct rtl8192cd_priv* */
62 /* For CE/NIC use struct void* */
64 struct phy_dm_struct *dm = (struct phy_dm_struct *)dm_void;
66 if (!(dm->support_ability & ODM_BB_DYNAMIC_TXPWR))
68 /* 2011/09/29 MH In HW integration first stage, we provide 4 different
69 * handle to operate at the same time.
70 * In the stage2/3, we need to prive universal interface and merge all
71 * HW dynamic mechanism.
73 switch (dm->support_platform) {
75 odm_dynamic_tx_power_nic(dm);
78 odm_dynamic_tx_power_nic_ce(dm);
81 odm_dynamic_tx_power_ap(dm);
88 void odm_dynamic_tx_power_nic(void *dm_void)
90 struct phy_dm_struct *dm = (struct phy_dm_struct *)dm_void;
92 if (!(dm->support_ability & ODM_BB_DYNAMIC_TXPWR))
96 void odm_dynamic_tx_power_ap(void *dm_void
102 void odm_dynamic_tx_power_8821(void *dm_void, u8 *desc, u8 mac_id) {}