diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2013-11-18 12:11:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-12-05 14:55:18 -0500 |
commit | e9b0784bb9de3152e787ee779868c626b137fb3b (patch) | |
tree | ba4c3965ff4fa3d523c47d848a10566ca4b51e43 | |
parent | 9806eacf5de27ab01d680c5d75c92a3a89734e4f (diff) |
rtlwifi: rtl8192cu: Fix some code in RF handling
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c index 2119313a737b..b878d56d2f4d 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | |||
@@ -85,17 +85,15 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, | |||
85 | if (mac->act_scanning) { | 85 | if (mac->act_scanning) { |
86 | tx_agc[RF90_PATH_A] = 0x3f3f3f3f; | 86 | tx_agc[RF90_PATH_A] = 0x3f3f3f3f; |
87 | tx_agc[RF90_PATH_B] = 0x3f3f3f3f; | 87 | tx_agc[RF90_PATH_B] = 0x3f3f3f3f; |
88 | if (turbo_scanoff) { | 88 | for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) { |
89 | for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) { | 89 | tx_agc[idx1] = ppowerlevel[idx1] | |
90 | tx_agc[idx1] = ppowerlevel[idx1] | | 90 | (ppowerlevel[idx1] << 8) | |
91 | (ppowerlevel[idx1] << 8) | | 91 | (ppowerlevel[idx1] << 16) | |
92 | (ppowerlevel[idx1] << 16) | | 92 | (ppowerlevel[idx1] << 24); |
93 | (ppowerlevel[idx1] << 24); | 93 | if (rtlhal->interface == INTF_USB) { |
94 | if (rtlhal->interface == INTF_USB) { | 94 | if (tx_agc[idx1] > 0x20 && |
95 | if (tx_agc[idx1] > 0x20 && | 95 | rtlefuse->external_pa) |
96 | rtlefuse->external_pa) | 96 | tx_agc[idx1] = 0x20; |
97 | tx_agc[idx1] = 0x20; | ||
98 | } | ||
99 | } | 97 | } |
100 | } | 98 | } |
101 | } else { | 99 | } else { |
@@ -107,7 +105,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, | |||
107 | TXHIGHPWRLEVEL_LEVEL2) { | 105 | TXHIGHPWRLEVEL_LEVEL2) { |
108 | tx_agc[RF90_PATH_A] = 0x00000000; | 106 | tx_agc[RF90_PATH_A] = 0x00000000; |
109 | tx_agc[RF90_PATH_B] = 0x00000000; | 107 | tx_agc[RF90_PATH_B] = 0x00000000; |
110 | } else{ | 108 | } else { |
111 | for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) { | 109 | for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) { |
112 | tx_agc[idx1] = ppowerlevel[idx1] | | 110 | tx_agc[idx1] = ppowerlevel[idx1] | |
113 | (ppowerlevel[idx1] << 8) | | 111 | (ppowerlevel[idx1] << 8) | |
@@ -373,7 +371,12 @@ static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw, | |||
373 | regoffset == RTXAGC_B_MCS07_MCS04) | 371 | regoffset == RTXAGC_B_MCS07_MCS04) |
374 | regoffset = 0xc98; | 372 | regoffset = 0xc98; |
375 | for (i = 0; i < 3; i++) { | 373 | for (i = 0; i < 3; i++) { |
376 | writeVal = (writeVal > 6) ? (writeVal - 6) : 0; | 374 | if (i != 2) |
375 | writeVal = (writeVal > 8) ? | ||
376 | (writeVal - 8) : 0; | ||
377 | else | ||
378 | writeVal = (writeVal > 6) ? | ||
379 | (writeVal - 6) : 0; | ||
377 | rtl_write_byte(rtlpriv, (u32)(regoffset + i), | 380 | rtl_write_byte(rtlpriv, (u32)(regoffset + i), |
378 | (u8)writeVal); | 381 | (u8)writeVal); |
379 | } | 382 | } |