diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8192ce/phy.c')
| -rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/phy.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c index 191106033b3c..d0541e8c6012 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c | |||
| @@ -32,14 +32,13 @@ | |||
| 32 | #include "../ps.h" | 32 | #include "../ps.h" |
| 33 | #include "reg.h" | 33 | #include "reg.h" |
| 34 | #include "def.h" | 34 | #include "def.h" |
| 35 | #include "hw.h" | ||
| 35 | #include "phy.h" | 36 | #include "phy.h" |
| 36 | #include "rf.h" | 37 | #include "rf.h" |
| 37 | #include "dm.h" | 38 | #include "dm.h" |
| 38 | #include "table.h" | 39 | #include "table.h" |
| 39 | 40 | ||
| 40 | #include "../rtl8192c/phy_common.c" | 41 | u32 rtl92ce_phy_query_rf_reg(struct ieee80211_hw *hw, |
| 41 | |||
| 42 | u32 rtl92c_phy_query_rf_reg(struct ieee80211_hw *hw, | ||
| 43 | enum radio_path rfpath, u32 regaddr, u32 bitmask) | 42 | enum radio_path rfpath, u32 regaddr, u32 bitmask) |
| 44 | { | 43 | { |
| 45 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 44 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
| @@ -74,7 +73,7 @@ u32 rtl92c_phy_query_rf_reg(struct ieee80211_hw *hw, | |||
| 74 | return readback_value; | 73 | return readback_value; |
| 75 | } | 74 | } |
| 76 | 75 | ||
| 77 | void rtl92c_phy_set_rf_reg(struct ieee80211_hw *hw, | 76 | void rtl92ce_phy_set_rf_reg(struct ieee80211_hw *hw, |
| 78 | enum radio_path rfpath, | 77 | enum radio_path rfpath, |
| 79 | u32 regaddr, u32 bitmask, u32 data) | 78 | u32 regaddr, u32 bitmask, u32 data) |
| 80 | { | 79 | { |
| @@ -122,19 +121,19 @@ void rtl92c_phy_set_rf_reg(struct ieee80211_hw *hw, | |||
| 122 | bitmask, data, rfpath)); | 121 | bitmask, data, rfpath)); |
| 123 | } | 122 | } |
| 124 | 123 | ||
| 125 | bool rtl92c_phy_mac_config(struct ieee80211_hw *hw) | 124 | bool rtl92ce_phy_mac_config(struct ieee80211_hw *hw) |
| 126 | { | 125 | { |
| 127 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 126 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
| 128 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 127 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
| 129 | bool is92c = IS_92C_SERIAL(rtlhal->version); | 128 | bool is92c = IS_92C_SERIAL(rtlhal->version); |
| 130 | bool rtstatus = _rtl92c_phy_config_mac_with_headerfile(hw); | 129 | bool rtstatus = _rtl92ce_phy_config_mac_with_headerfile(hw); |
| 131 | 130 | ||
| 132 | if (is92c) | 131 | if (is92c) |
| 133 | rtl_write_byte(rtlpriv, 0x14, 0x71); | 132 | rtl_write_byte(rtlpriv, 0x14, 0x71); |
| 134 | return rtstatus; | 133 | return rtstatus; |
| 135 | } | 134 | } |
| 136 | 135 | ||
| 137 | bool rtl92c_phy_bb_config(struct ieee80211_hw *hw) | 136 | bool rtl92ce_phy_bb_config(struct ieee80211_hw *hw) |
| 138 | { | 137 | { |
| 139 | bool rtstatus = true; | 138 | bool rtstatus = true; |
| 140 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 139 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
| @@ -160,7 +159,7 @@ bool rtl92c_phy_bb_config(struct ieee80211_hw *hw) | |||
| 160 | return rtstatus; | 159 | return rtstatus; |
| 161 | } | 160 | } |
| 162 | 161 | ||
| 163 | static bool _rtl92c_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) | 162 | bool _rtl92ce_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) |
| 164 | { | 163 | { |
| 165 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 164 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
| 166 | u32 i; | 165 | u32 i; |
| @@ -177,7 +176,7 @@ static bool _rtl92c_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) | |||
| 177 | return true; | 176 | return true; |
| 178 | } | 177 | } |
| 179 | 178 | ||
| 180 | static bool _rtl92c_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | 179 | bool _rtl92ce_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, |
| 181 | u8 configtype) | 180 | u8 configtype) |
| 182 | { | 181 | { |
| 183 | int i; | 182 | int i; |
| @@ -221,7 +220,6 @@ static bool _rtl92c_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | |||
| 221 | phy_regarray_table[i], | 220 | phy_regarray_table[i], |
| 222 | phy_regarray_table[i + 1])); | 221 | phy_regarray_table[i + 1])); |
| 223 | } | 222 | } |
| 224 | rtl92c_phy_config_bb_external_pa(hw); | ||
| 225 | } else if (configtype == BASEBAND_CONFIG_AGC_TAB) { | 223 | } else if (configtype == BASEBAND_CONFIG_AGC_TAB) { |
| 226 | for (i = 0; i < agctab_arraylen; i = i + 2) { | 224 | for (i = 0; i < agctab_arraylen; i = i + 2) { |
| 227 | rtl_set_bbreg(hw, agctab_array_table[i], MASKDWORD, | 225 | rtl_set_bbreg(hw, agctab_array_table[i], MASKDWORD, |
| @@ -237,7 +235,7 @@ static bool _rtl92c_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | |||
| 237 | return true; | 235 | return true; |
| 238 | } | 236 | } |
| 239 | 237 | ||
| 240 | static bool _rtl92c_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, | 238 | bool _rtl92ce_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, |
| 241 | u8 configtype) | 239 | u8 configtype) |
| 242 | { | 240 | { |
| 243 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 241 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
| @@ -276,7 +274,7 @@ static bool _rtl92c_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, | |||
| 276 | return true; | 274 | return true; |
| 277 | } | 275 | } |
| 278 | 276 | ||
| 279 | bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, | 277 | bool rtl92ce_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, |
| 280 | enum radio_path rfpath) | 278 | enum radio_path rfpath) |
| 281 | { | 279 | { |
| 282 | 280 | ||
| @@ -331,7 +329,6 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, | |||
| 331 | udelay(1); | 329 | udelay(1); |
| 332 | } | 330 | } |
| 333 | } | 331 | } |
| 334 | _rtl92c_phy_config_rf_external_pa(hw, rfpath); | ||
| 335 | break; | 332 | break; |
| 336 | case RF90_PATH_B: | 333 | case RF90_PATH_B: |
| 337 | for (i = 0; i < radiob_arraylen; i = i + 2) { | 334 | for (i = 0; i < radiob_arraylen; i = i + 2) { |
| @@ -367,7 +364,7 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, | |||
| 367 | return true; | 364 | return true; |
| 368 | } | 365 | } |
| 369 | 366 | ||
| 370 | void rtl92c_phy_set_bw_mode_callback(struct ieee80211_hw *hw) | 367 | void rtl92ce_phy_set_bw_mode_callback(struct ieee80211_hw *hw) |
| 371 | { | 368 | { |
| 372 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 369 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
| 373 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 370 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
| @@ -435,7 +432,7 @@ void rtl92c_phy_set_bw_mode_callback(struct ieee80211_hw *hw) | |||
| 435 | RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); | 432 | RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); |
| 436 | } | 433 | } |
| 437 | 434 | ||
| 438 | static void _rtl92c_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t) | 435 | void _rtl92ce_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t) |
| 439 | { | 436 | { |
| 440 | u8 tmpreg; | 437 | u8 tmpreg; |
| 441 | u32 rf_a_mode = 0, rf_b_mode = 0, lc_cal; | 438 | u32 rf_a_mode = 0, rf_b_mode = 0, lc_cal; |
| @@ -602,7 +599,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw, | |||
| 602 | jiffies_to_msecs(jiffies - | 599 | jiffies_to_msecs(jiffies - |
| 603 | ppsc->last_awake_jiffies))); | 600 | ppsc->last_awake_jiffies))); |
| 604 | ppsc->last_sleep_jiffies = jiffies; | 601 | ppsc->last_sleep_jiffies = jiffies; |
| 605 | _rtl92ce_phy_set_rf_sleep(hw); | 602 | _rtl92c_phy_set_rf_sleep(hw); |
| 606 | break; | 603 | break; |
| 607 | } | 604 | } |
| 608 | default: | 605 | default: |
| @@ -617,7 +614,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw, | |||
| 617 | return bresult; | 614 | return bresult; |
| 618 | } | 615 | } |
| 619 | 616 | ||
| 620 | bool rtl92c_phy_set_rf_power_state(struct ieee80211_hw *hw, | 617 | bool rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw, |
| 621 | enum rf_pwrstate rfpwr_state) | 618 | enum rf_pwrstate rfpwr_state) |
| 622 | { | 619 | { |
| 623 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 620 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
