diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2014-03-04 17:53:48 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-06 14:29:56 -0500 |
commit | 25b13dbc38a74b76da5746d75867e306b70035bd (patch) | |
tree | f577599d398ca0fa96b32ef515b3ad0f6a04bc8d /drivers/net/wireless/rtlwifi/rtl8723be/phy.c | |
parent | f3355dd9f7c261d2a3e505ba5c62ffe3cd4df97a (diff) |
rtlwifi: Move common routines to core
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/rtl8723be/phy.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723be/phy.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/rtlwifi/rtl8723be/phy.c index ebc1e2788fca..cadae9bc4e3f 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723be/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8723be/phy.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "../wifi.h" | 26 | #include "../wifi.h" |
27 | #include "../pci.h" | 27 | #include "../pci.h" |
28 | #include "../ps.h" | 28 | #include "../ps.h" |
29 | #include "../core.h" | ||
29 | #include "reg.h" | 30 | #include "reg.h" |
30 | #include "def.h" | 31 | #include "def.h" |
31 | #include "phy.h" | 32 | #include "phy.h" |
@@ -41,9 +42,6 @@ static bool _rtl8723be_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, | |||
41 | static bool rtl8723be_phy_sw_chn_step_by_step(struct ieee80211_hw *hw, | 42 | static bool rtl8723be_phy_sw_chn_step_by_step(struct ieee80211_hw *hw, |
42 | u8 channel, u8 *stage, | 43 | u8 channel, u8 *stage, |
43 | u8 *step, u32 *delay); | 44 | u8 *step, u32 *delay); |
44 | static void _rtl8723be_config_bb_reg(struct ieee80211_hw *hw, | ||
45 | u32 addr, u32 data); | ||
46 | |||
47 | static bool _rtl8723be_check_condition(struct ieee80211_hw *hw, | 45 | static bool _rtl8723be_check_condition(struct ieee80211_hw *hw, |
48 | const u32 condition) | 46 | const u32 condition) |
49 | { | 47 | { |
@@ -114,7 +112,7 @@ static bool _rtl8723be_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | |||
114 | v1 = array_table[i]; | 112 | v1 = array_table[i]; |
115 | v2 = array_table[i+1]; | 113 | v2 = array_table[i+1]; |
116 | if (v1 < 0xcdcdcdcd) { | 114 | if (v1 < 0xcdcdcdcd) { |
117 | _rtl8723be_config_bb_reg(hw, v1, v2); | 115 | rtl_bb_delay(hw, v1, v2); |
118 | } else {/*This line is the start line of branch.*/ | 116 | } else {/*This line is the start line of branch.*/ |
119 | if (!_rtl8723be_check_condition(hw, array_table[i])) { | 117 | if (!_rtl8723be_check_condition(hw, array_table[i])) { |
120 | /*Discard the following (offset, data) pairs*/ | 118 | /*Discard the following (offset, data) pairs*/ |
@@ -135,7 +133,7 @@ static bool _rtl8723be_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | |||
135 | v2 != 0xCDEF && | 133 | v2 != 0xCDEF && |
136 | v2 != 0xCDCD && | 134 | v2 != 0xCDCD && |
137 | i < arraylen - 2) { | 135 | i < arraylen - 2) { |
138 | _rtl8723be_config_bb_reg(hw, | 136 | rtl_bb_delay(hw, |
139 | v1, v2); | 137 | v1, v2); |
140 | READ_NEXT_PAIR(v1, v2, i); | 138 | READ_NEXT_PAIR(v1, v2, i); |
141 | } | 139 | } |
@@ -389,27 +387,6 @@ static void _rtl8723be_phy_init_tx_power_by_rate(struct ieee80211_hw *hw) | |||
389 | [path][txnum][section] = 0; | 387 | [path][txnum][section] = 0; |
390 | } | 388 | } |
391 | 389 | ||
392 | static void _rtl8723be_config_bb_reg(struct ieee80211_hw *hw, | ||
393 | u32 addr, u32 data) | ||
394 | { | ||
395 | if (addr == 0xfe) { | ||
396 | mdelay(50); | ||
397 | } else if (addr == 0xfd) { | ||
398 | mdelay(5); | ||
399 | } else if (addr == 0xfc) { | ||
400 | mdelay(1); | ||
401 | } else if (addr == 0xfb) { | ||
402 | udelay(50); | ||
403 | } else if (addr == 0xfa) { | ||
404 | udelay(5); | ||
405 | } else if (addr == 0xf9) { | ||
406 | udelay(1); | ||
407 | } else { | ||
408 | rtl_set_bbreg(hw, addr, MASKDWORD, data); | ||
409 | udelay(1); | ||
410 | } | ||
411 | } | ||
412 | |||
413 | static void phy_set_txpwr_by_rate_base(struct ieee80211_hw *hw, u8 band, | 390 | static void phy_set_txpwr_by_rate_base(struct ieee80211_hw *hw, u8 band, |
414 | u8 path, u8 rate_section, | 391 | u8 path, u8 rate_section, |
415 | u8 txnum, u8 value) | 392 | u8 txnum, u8 value) |