Skip to contentSkip to conversation

rtlwifi: rtl8192cu: Fix performance issue.

PATCH Applied Taehee Yoo 3 participants 3 messages Jun 4, 2015 – Jun 8, 2015 Networking drivers (wireless)

lore
Share & tools
lore

Taehee Yoo

author
#0 lore raw

PATCH 1/1 rtlwifi: rtl8192cu: Fix performance issue.

After physical reconnect, the rtl8192cu chipset shows low transmission rates.It cause is that variable "iqk_initialized" do not de-initialized. So I add this code.

---
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +5 -3
index 1898596..6a4ef05 100644
@@ -987,7 +987,6 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
 	struct rtl_phy *rtlphy = &(rtlpriv->phy);
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	int err = 0;
-	static bool iqk_initialized;
 	unsigned long flags;
 
 	/* As this function can take a very long time (up to 350 ms)
@@ -1038,11 +1037,11 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
 	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr);
 	if (ppsc->rfpwr_state == ERFON) {
 		rtl92c_phy_set_rfpath_switch(hw, 1);
-		if (iqk_initialized) {
+		if (rtlphy->iqk_initialized) {
 			rtl92c_phy_iq_calibrate(hw, true);
 		} else {
 			rtl92c_phy_iq_calibrate(hw, false);
-			iqk_initialized = true;
+			rtlphy->iqk_initialized = true;
 		}
 		rtl92c_dm_check_txpower_tracking(hw);
 		rtl92c_phy_lc_calibrate(hw);
@@ -1391,6 +1390,9 @@ void rtl92cu_card_disable(struct ieee80211_hw *hw)
 		_CardDisableHWSM(hw);
 	else
 		_CardDisableWithoutHWSM(hw);
+
+	/* after power off we should do iqk again */
+	rtlpriv->phy.iqk_initialized = false;
 }
 
 void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Taehee Yoo

After physical reconnect, the rtl8192cu chipset shows low transmission rates.It cause is that variable "iqk_initialized" do not de-initialized. So I add this code.

---
  drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)

I like this patch very much. Getting rid of a static variable is always good.

Thanks,

Larry

Quoted 38 lines
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +5 -3
index 1898596..6a4ef05 100644
@@ -987,7 +987,6 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
  	struct rtl_phy *rtlphy = &(rtlpriv->phy);
  	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
  	int err = 0;
-	static bool iqk_initialized;
  	unsigned long flags;
 
  	/* As this function can take a very long time (up to 350 ms)
@@ -1038,11 +1037,11 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
  	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr);
  	if (ppsc->rfpwr_state == ERFON) {
  		rtl92c_phy_set_rfpath_switch(hw, 1);
-		if (iqk_initialized) {
+		if (rtlphy->iqk_initialized) {
  			rtl92c_phy_iq_calibrate(hw, true);
  		} else {
  			rtl92c_phy_iq_calibrate(hw, false);
-			iqk_initialized = true;
+			rtlphy->iqk_initialized = true;
  		}
  		rtl92c_dm_check_txpower_tracking(hw);
  		rtl92c_phy_lc_calibrate(hw);
@@ -1391,6 +1390,9 @@ void rtl92cu_card_disable(struct ieee80211_hw *hw)
  		_CardDisableHWSM(hw);
  	else
  		_CardDisableWithoutHWSM(hw);
+
+	/* after power off we should do iqk again */
+	rtlpriv->phy.iqk_initialized = false;
  }
 
  void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)