Commit e9b0784b authored by Larry Finger's avatar Larry Finger Committed by John W. Linville

rtlwifi: rtl8192cu: Fix some code in RF handling

Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9806eacf
...@@ -85,7 +85,6 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, ...@@ -85,7 +85,6 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
if (mac->act_scanning) { if (mac->act_scanning) {
tx_agc[RF90_PATH_A] = 0x3f3f3f3f; tx_agc[RF90_PATH_A] = 0x3f3f3f3f;
tx_agc[RF90_PATH_B] = 0x3f3f3f3f; tx_agc[RF90_PATH_B] = 0x3f3f3f3f;
if (turbo_scanoff) {
for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) { for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
tx_agc[idx1] = ppowerlevel[idx1] | tx_agc[idx1] = ppowerlevel[idx1] |
(ppowerlevel[idx1] << 8) | (ppowerlevel[idx1] << 8) |
...@@ -97,7 +96,6 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, ...@@ -97,7 +96,6 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
tx_agc[idx1] = 0x20; tx_agc[idx1] = 0x20;
} }
} }
}
} else { } else {
if (rtlpriv->dm.dynamic_txhighpower_lvl == if (rtlpriv->dm.dynamic_txhighpower_lvl ==
TXHIGHPWRLEVEL_LEVEL1) { TXHIGHPWRLEVEL_LEVEL1) {
...@@ -107,7 +105,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, ...@@ -107,7 +105,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
TXHIGHPWRLEVEL_LEVEL2) { TXHIGHPWRLEVEL_LEVEL2) {
tx_agc[RF90_PATH_A] = 0x00000000; tx_agc[RF90_PATH_A] = 0x00000000;
tx_agc[RF90_PATH_B] = 0x00000000; tx_agc[RF90_PATH_B] = 0x00000000;
} else{ } else {
for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) { for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
tx_agc[idx1] = ppowerlevel[idx1] | tx_agc[idx1] = ppowerlevel[idx1] |
(ppowerlevel[idx1] << 8) | (ppowerlevel[idx1] << 8) |
...@@ -373,7 +371,12 @@ static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw, ...@@ -373,7 +371,12 @@ static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw,
regoffset == RTXAGC_B_MCS07_MCS04) regoffset == RTXAGC_B_MCS07_MCS04)
regoffset = 0xc98; regoffset = 0xc98;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
writeVal = (writeVal > 6) ? (writeVal - 6) : 0; if (i != 2)
writeVal = (writeVal > 8) ?
(writeVal - 8) : 0;
else
writeVal = (writeVal > 6) ?
(writeVal - 6) : 0;
rtl_write_byte(rtlpriv, (u32)(regoffset + i), rtl_write_byte(rtlpriv, (u32)(regoffset + i),
(u8)writeVal); (u8)writeVal);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment