diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2014-02-28 16:16:49 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-04 13:19:38 -0500 |
commit | 57d9d9630a6b3f289ae87b1fc00e83ae44636766 (patch) | |
tree | 93c638ca278eb9b669eab8688f5a6dae8e4cb854 /drivers/net/wireless/rtlwifi/rtl8723ae | |
parent | cbd0c8512f3b06c86849c554eb092862c46885d5 (diff) |
rtlwifi: rtl8723ae: rtl8723-common: Copy common dynamic power management code
The drivers for RTL8723AE and RTL8723BE have some code in common.
This commit copies the common power management routines into the shared
code.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8723ae')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723ae/dm.c | 42 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723ae/dm.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | 5 |
3 files changed, 7 insertions, 41 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c index a36eee28f9e7..863ddb3e2888 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "def.h" | 35 | #include "def.h" |
36 | #include "phy.h" | 36 | #include "phy.h" |
37 | #include "dm.h" | 37 | #include "dm.h" |
38 | #include "../rtl8723com/dm_common.h" | ||
38 | #include "fw.h" | 39 | #include "fw.h" |
39 | #include "hal_btc.h" | 40 | #include "hal_btc.h" |
40 | 41 | ||
@@ -483,16 +484,6 @@ static void rtl8723ae_dm_dig(struct ieee80211_hw *hw) | |||
483 | rtl8723ae_dm_ctrl_initgain_by_twoport(hw); | 484 | rtl8723ae_dm_ctrl_initgain_by_twoport(hw); |
484 | } | 485 | } |
485 | 486 | ||
486 | static void rtl8723ae_dm_init_dynamic_txpower(struct ieee80211_hw *hw) | ||
487 | { | ||
488 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
489 | |||
490 | rtlpriv->dm.dynamic_txpower_enable = false; | ||
491 | |||
492 | rtlpriv->dm.last_dtp_lvl = TXHIGHPWRLEVEL_NORMAL; | ||
493 | rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; | ||
494 | } | ||
495 | |||
496 | static void rtl8723ae_dm_dynamic_txpower(struct ieee80211_hw *hw) | 487 | static void rtl8723ae_dm_dynamic_txpower(struct ieee80211_hw *hw) |
497 | { | 488 | { |
498 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 489 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -585,19 +576,6 @@ void rtl8723ae_dm_write_dig(struct ieee80211_hw *hw) | |||
585 | } | 576 | } |
586 | } | 577 | } |
587 | 578 | ||
588 | static void rtl8723ae_dm_pwdmonitor(struct ieee80211_hw *hw) | ||
589 | { | ||
590 | } | ||
591 | |||
592 | void rtl8723ae_dm_init_edca_turbo(struct ieee80211_hw *hw) | ||
593 | { | ||
594 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
595 | |||
596 | rtlpriv->dm.current_turbo_edca = false; | ||
597 | rtlpriv->dm.is_any_nonbepkts = false; | ||
598 | rtlpriv->dm.is_cur_rdlstate = false; | ||
599 | } | ||
600 | |||
601 | static void rtl8723ae_dm_check_edca_turbo(struct ieee80211_hw *hw) | 579 | static void rtl8723ae_dm_check_edca_turbo(struct ieee80211_hw *hw) |
602 | { | 580 | { |
603 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 581 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -778,17 +756,6 @@ static void rtl8723ae_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) | |||
778 | } | 756 | } |
779 | } | 757 | } |
780 | 758 | ||
781 | static void rtl8723ae_dm_init_dynamic_bpowersaving(struct ieee80211_hw *hw) | ||
782 | { | ||
783 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
784 | |||
785 | rtlpriv->dm_pstable.pre_ccastate = CCA_MAX; | ||
786 | rtlpriv->dm_pstable.cur_ccasate = CCA_MAX; | ||
787 | rtlpriv->dm_pstable.pre_rfstate = RF_MAX; | ||
788 | rtlpriv->dm_pstable.cur_rfstate = RF_MAX; | ||
789 | rtlpriv->dm_pstable.rssi_val_min = 0; | ||
790 | } | ||
791 | |||
792 | void rtl8723ae_dm_rf_saving(struct ieee80211_hw *hw, u8 force_in_normal) | 759 | void rtl8723ae_dm_rf_saving(struct ieee80211_hw *hw, u8 force_in_normal) |
793 | { | 760 | { |
794 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 761 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -905,11 +872,11 @@ void rtl8723ae_dm_init(struct ieee80211_hw *hw) | |||
905 | 872 | ||
906 | rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER; | 873 | rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER; |
907 | rtl8723ae_dm_diginit(hw); | 874 | rtl8723ae_dm_diginit(hw); |
908 | rtl8723ae_dm_init_dynamic_txpower(hw); | 875 | rtl8723_dm_init_dynamic_txpower(hw); |
909 | rtl8723ae_dm_init_edca_turbo(hw); | 876 | rtl8723_dm_init_edca_turbo(hw); |
910 | rtl8723ae_dm_init_rate_adaptive_mask(hw); | 877 | rtl8723ae_dm_init_rate_adaptive_mask(hw); |
911 | rtl8723ae_dm_initialize_txpower_tracking(hw); | 878 | rtl8723ae_dm_initialize_txpower_tracking(hw); |
912 | rtl8723ae_dm_init_dynamic_bpowersaving(hw); | 879 | rtl8723_dm_init_dynamic_bb_powersaving(hw); |
913 | } | 880 | } |
914 | 881 | ||
915 | void rtl8723ae_dm_watchdog(struct ieee80211_hw *hw) | 882 | void rtl8723ae_dm_watchdog(struct ieee80211_hw *hw) |
@@ -930,7 +897,6 @@ void rtl8723ae_dm_watchdog(struct ieee80211_hw *hw) | |||
930 | if ((ppsc->rfpwr_state == ERFON) && | 897 | if ((ppsc->rfpwr_state == ERFON) && |
931 | ((!fw_current_inpsmode) && fw_ps_awake) && | 898 | ((!fw_current_inpsmode) && fw_ps_awake) && |
932 | (!ppsc->rfchange_inprogress)) { | 899 | (!ppsc->rfchange_inprogress)) { |
933 | rtl8723ae_dm_pwdmonitor(hw); | ||
934 | rtl8723ae_dm_dig(hw); | 900 | rtl8723ae_dm_dig(hw); |
935 | rtl8723ae_dm_false_alarm_counter_statistics(hw); | 901 | rtl8723ae_dm_false_alarm_counter_statistics(hw); |
936 | rtl8723ae_dm_dynamic_bpowersaving(hw); | 902 | rtl8723ae_dm_dynamic_bpowersaving(hw); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h index a372b0204456..d253bb53d03e 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h | |||
@@ -147,7 +147,6 @@ enum dm_dig_connect_e { | |||
147 | void rtl8723ae_dm_init(struct ieee80211_hw *hw); | 147 | void rtl8723ae_dm_init(struct ieee80211_hw *hw); |
148 | void rtl8723ae_dm_watchdog(struct ieee80211_hw *hw); | 148 | void rtl8723ae_dm_watchdog(struct ieee80211_hw *hw); |
149 | void rtl8723ae_dm_write_dig(struct ieee80211_hw *hw); | 149 | void rtl8723ae_dm_write_dig(struct ieee80211_hw *hw); |
150 | void rtl8723ae_dm_init_edca_turbo(struct ieee80211_hw *hw); | ||
151 | void rtl8723ae_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw); | 150 | void rtl8723ae_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw); |
152 | void rtl8723ae_dm_rf_saving(struct ieee80211_hw *hw, u8 bforce_in_normal); | 151 | void rtl8723ae_dm_rf_saving(struct ieee80211_hw *hw, u8 bforce_in_normal); |
153 | void rtl8723ae_dm_bt_coexist(struct ieee80211_hw *hw); | 152 | void rtl8723ae_dm_bt_coexist(struct ieee80211_hw *hw); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c index 7eff1c51539c..8a8577a1783b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "def.h" | 38 | #include "def.h" |
39 | #include "phy.h" | 39 | #include "phy.h" |
40 | #include "dm.h" | 40 | #include "dm.h" |
41 | #include "../rtl8723com/dm_common.h" | ||
41 | #include "fw.h" | 42 | #include "fw.h" |
42 | #include "../rtl8723com/fw_common.h" | 43 | #include "../rtl8723com/fw_common.h" |
43 | #include "led.h" | 44 | #include "led.h" |
@@ -305,7 +306,7 @@ void rtl8723ae_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
305 | break; } | 306 | break; } |
306 | case HW_VAR_AC_PARAM:{ | 307 | case HW_VAR_AC_PARAM:{ |
307 | u8 e_aci = *((u8 *) val); | 308 | u8 e_aci = *((u8 *) val); |
308 | rtl8723ae_dm_init_edca_turbo(hw); | 309 | rtl8723_dm_init_edca_turbo(hw); |
309 | 310 | ||
310 | if (rtlpci->acm_method != EACMWAY2_SW) | 311 | if (rtlpci->acm_method != EACMWAY2_SW) |
311 | rtlpriv->cfg->ops->set_hw_reg(hw, | 312 | rtlpriv->cfg->ops->set_hw_reg(hw, |
@@ -1155,7 +1156,7 @@ void rtl8723ae_set_qos(struct ieee80211_hw *hw, int aci) | |||
1155 | { | 1156 | { |
1156 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1157 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
1157 | 1158 | ||
1158 | rtl8723ae_dm_init_edca_turbo(hw); | 1159 | rtl8723_dm_init_edca_turbo(hw); |
1159 | switch (aci) { | 1160 | switch (aci) { |
1160 | case AC1_BK: | 1161 | case AC1_BK: |
1161 | rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, 0xa44f); | 1162 | rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, 0xa44f); |