]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rtlwifi: rtl8192cu: Update the power index registers
authorLarry Finger <Larry.Finger@lwfinger.net>
Mon, 18 Nov 2013 17:11:33 +0000 (11:11 -0600)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 5 Dec 2013 19:55:16 +0000 (14:55 -0500)
This patch uses the newly introduced power index register routines.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8192cu/dm.c
drivers/net/wireless/rtlwifi/rtl8192cu/dm.h

index 16a0b9e59acf726745d3ad90c5480f2c4151096d..c16209a336eac66c6b7ad78afa6ac3d24b197796 100644 (file)
@@ -101,6 +101,15 @@ void rtl92cu_dm_dynamic_txpower(struct ieee80211_hw *hw)
                         "PHY_SetTxPowerLevel8192S() Channel = %d\n",
                         rtlphy->current_channel);
                rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel);
+               if (rtlpriv->dm.dynamic_txhighpower_lvl ==
+                   TXHIGHPWRLEVEL_NORMAL)
+                       dm_restorepowerindex(hw);
+               else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
+                        TXHIGHPWRLEVEL_LEVEL1)
+                       dm_writepowerindex(hw, 0x14);
+               else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
+                        TXHIGHPWRLEVEL_LEVEL2)
+                       dm_writepowerindex(hw, 0x10);
        }
 
        rtlpriv->dm.last_dtp_lvl = rtlpriv->dm.dynamic_txhighpower_lvl;
index d947e7d350bbc146d7b56b1c463c9dce829b5dce..fafa6bac2a3f5062b98911dc5802dd9e82fc2b95 100644 (file)
@@ -30,3 +30,6 @@
 #include "../rtl8192ce/dm.h"
 
 void rtl92cu_dm_dynamic_txpower(struct ieee80211_hw *hw);
+void dm_savepowerindex(struct ieee80211_hw *hw);
+void dm_writepowerindex(struct ieee80211_hw *hw, u8 value);
+void dm_restorepowerindex(struct ieee80211_hw *hw);