diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8192cu/phy.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/phy.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c index dc65ef2bbeac..4e020e654e6b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c | |||
@@ -37,9 +37,7 @@ | |||
37 | #include "dm.h" | 37 | #include "dm.h" |
38 | #include "table.h" | 38 | #include "table.h" |
39 | 39 | ||
40 | #include "../rtl8192c/phy_common.c" | 40 | u32 rtl92cu_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) | 41 | enum radio_path rfpath, u32 regaddr, u32 bitmask) |
44 | { | 42 | { |
45 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 43 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -65,7 +63,7 @@ u32 rtl92c_phy_query_rf_reg(struct ieee80211_hw *hw, | |||
65 | return readback_value; | 63 | return readback_value; |
66 | } | 64 | } |
67 | 65 | ||
68 | void rtl92c_phy_set_rf_reg(struct ieee80211_hw *hw, | 66 | void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw, |
69 | enum radio_path rfpath, | 67 | enum radio_path rfpath, |
70 | u32 regaddr, u32 bitmask, u32 data) | 68 | u32 regaddr, u32 bitmask, u32 data) |
71 | { | 69 | { |
@@ -104,20 +102,20 @@ void rtl92c_phy_set_rf_reg(struct ieee80211_hw *hw, | |||
104 | regaddr, bitmask, data, rfpath)); | 102 | regaddr, bitmask, data, rfpath)); |
105 | } | 103 | } |
106 | 104 | ||
107 | bool rtl92c_phy_mac_config(struct ieee80211_hw *hw) | 105 | bool rtl92cu_phy_mac_config(struct ieee80211_hw *hw) |
108 | { | 106 | { |
109 | bool rtstatus; | 107 | bool rtstatus; |
110 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 108 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
111 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 109 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
112 | bool is92c = IS_92C_SERIAL(rtlhal->version); | 110 | bool is92c = IS_92C_SERIAL(rtlhal->version); |
113 | 111 | ||
114 | rtstatus = _rtl92c_phy_config_mac_with_headerfile(hw); | 112 | rtstatus = _rtl92cu_phy_config_mac_with_headerfile(hw); |
115 | if (is92c && IS_HARDWARE_TYPE_8192CE(rtlhal)) | 113 | if (is92c && IS_HARDWARE_TYPE_8192CE(rtlhal)) |
116 | rtl_write_byte(rtlpriv, 0x14, 0x71); | 114 | rtl_write_byte(rtlpriv, 0x14, 0x71); |
117 | return rtstatus; | 115 | return rtstatus; |
118 | } | 116 | } |
119 | 117 | ||
120 | bool rtl92c_phy_bb_config(struct ieee80211_hw *hw) | 118 | bool rtl92cu_phy_bb_config(struct ieee80211_hw *hw) |
121 | { | 119 | { |
122 | bool rtstatus = true; | 120 | bool rtstatus = true; |
123 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 121 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -146,7 +144,7 @@ bool rtl92c_phy_bb_config(struct ieee80211_hw *hw) | |||
146 | return rtstatus; | 144 | return rtstatus; |
147 | } | 145 | } |
148 | 146 | ||
149 | static bool _rtl92c_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) | 147 | bool _rtl92cu_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) |
150 | { | 148 | { |
151 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 149 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
152 | struct rtl_phy *rtlphy = &(rtlpriv->phy); | 150 | struct rtl_phy *rtlphy = &(rtlpriv->phy); |
@@ -164,7 +162,7 @@ static bool _rtl92c_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) | |||
164 | return true; | 162 | return true; |
165 | } | 163 | } |
166 | 164 | ||
167 | static bool _rtl92c_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | 165 | bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, |
168 | u8 configtype) | 166 | u8 configtype) |
169 | { | 167 | { |
170 | int i; | 168 | int i; |
@@ -209,7 +207,6 @@ static bool _rtl92c_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | |||
209 | phy_regarray_table[i], | 207 | phy_regarray_table[i], |
210 | phy_regarray_table[i + 1])); | 208 | phy_regarray_table[i + 1])); |
211 | } | 209 | } |
212 | rtl92c_phy_config_bb_external_pa(hw); | ||
213 | } else if (configtype == BASEBAND_CONFIG_AGC_TAB) { | 210 | } else if (configtype == BASEBAND_CONFIG_AGC_TAB) { |
214 | for (i = 0; i < agctab_arraylen; i = i + 2) { | 211 | for (i = 0; i < agctab_arraylen; i = i + 2) { |
215 | rtl_set_bbreg(hw, agctab_array_table[i], MASKDWORD, | 212 | rtl_set_bbreg(hw, agctab_array_table[i], MASKDWORD, |
@@ -225,7 +222,7 @@ static bool _rtl92c_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | |||
225 | return true; | 222 | return true; |
226 | } | 223 | } |
227 | 224 | ||
228 | static bool _rtl92c_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, | 225 | bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, |
229 | u8 configtype) | 226 | u8 configtype) |
230 | { | 227 | { |
231 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 228 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -263,7 +260,7 @@ static bool _rtl92c_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, | |||
263 | return true; | 260 | return true; |
264 | } | 261 | } |
265 | 262 | ||
266 | bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, | 263 | bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, |
267 | enum radio_path rfpath) | 264 | enum radio_path rfpath) |
268 | { | 265 | { |
269 | int i; | 266 | int i; |
@@ -316,7 +313,6 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, | |||
316 | udelay(1); | 313 | udelay(1); |
317 | } | 314 | } |
318 | } | 315 | } |
319 | _rtl92c_phy_config_rf_external_pa(hw, rfpath); | ||
320 | break; | 316 | break; |
321 | case RF90_PATH_B: | 317 | case RF90_PATH_B: |
322 | for (i = 0; i < radiob_arraylen; i = i + 2) { | 318 | for (i = 0; i < radiob_arraylen; i = i + 2) { |
@@ -352,7 +348,7 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, | |||
352 | return true; | 348 | return true; |
353 | } | 349 | } |
354 | 350 | ||
355 | void rtl92c_phy_set_bw_mode_callback(struct ieee80211_hw *hw) | 351 | void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw) |
356 | { | 352 | { |
357 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 353 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
358 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 354 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
@@ -410,12 +406,12 @@ void rtl92c_phy_set_bw_mode_callback(struct ieee80211_hw *hw) | |||
410 | ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); | 406 | ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); |
411 | break; | 407 | break; |
412 | } | 408 | } |
413 | rtl92c_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); | 409 | rtl92cu_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); |
414 | rtlphy->set_bwmode_inprogress = false; | 410 | rtlphy->set_bwmode_inprogress = false; |
415 | RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); | 411 | RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); |
416 | } | 412 | } |
417 | 413 | ||
418 | void rtl92c_bb_block_on(struct ieee80211_hw *hw) | 414 | void rtl92cu_bb_block_on(struct ieee80211_hw *hw) |
419 | { | 415 | { |
420 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 416 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
421 | 417 | ||
@@ -425,7 +421,7 @@ void rtl92c_bb_block_on(struct ieee80211_hw *hw) | |||
425 | mutex_unlock(&rtlpriv->io.bb_mutex); | 421 | mutex_unlock(&rtlpriv->io.bb_mutex); |
426 | } | 422 | } |
427 | 423 | ||
428 | static void _rtl92c_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t) | 424 | void _rtl92cu_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t) |
429 | { | 425 | { |
430 | u8 tmpreg; | 426 | u8 tmpreg; |
431 | u32 rf_a_mode = 0, rf_b_mode = 0, lc_cal; | 427 | u32 rf_a_mode = 0, rf_b_mode = 0, lc_cal; |
@@ -463,7 +459,7 @@ static void _rtl92c_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t) | |||
463 | } | 459 | } |
464 | } | 460 | } |
465 | 461 | ||
466 | static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw, | 462 | bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, |
467 | enum rf_pwrstate rfpwr_state) | 463 | enum rf_pwrstate rfpwr_state) |
468 | { | 464 | { |
469 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 465 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -584,7 +580,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw, | |||
584 | jiffies_to_msecs(jiffies - | 580 | jiffies_to_msecs(jiffies - |
585 | ppsc->last_awake_jiffies))); | 581 | ppsc->last_awake_jiffies))); |
586 | ppsc->last_sleep_jiffies = jiffies; | 582 | ppsc->last_sleep_jiffies = jiffies; |
587 | _rtl92ce_phy_set_rf_sleep(hw); | 583 | _rtl92c_phy_set_rf_sleep(hw); |
588 | break; | 584 | break; |
589 | default: | 585 | default: |
590 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 586 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
@@ -598,7 +594,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw, | |||
598 | return bresult; | 594 | return bresult; |
599 | } | 595 | } |
600 | 596 | ||
601 | bool rtl92c_phy_set_rf_power_state(struct ieee80211_hw *hw, | 597 | bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, |
602 | enum rf_pwrstate rfpwr_state) | 598 | enum rf_pwrstate rfpwr_state) |
603 | { | 599 | { |
604 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 600 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
@@ -606,6 +602,6 @@ bool rtl92c_phy_set_rf_power_state(struct ieee80211_hw *hw, | |||
606 | 602 | ||
607 | if (rfpwr_state == ppsc->rfpwr_state) | 603 | if (rfpwr_state == ppsc->rfpwr_state) |
608 | return bresult; | 604 | return bresult; |
609 | bresult = _rtl92ce_phy_set_rf_power_state(hw, rfpwr_state); | 605 | bresult = _rtl92cu_phy_set_rf_power_state(hw, rfpwr_state); |
610 | return bresult; | 606 | return bresult; |
611 | } | 607 | } |