aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtlwifi/ps.c')
-rw-r--r--drivers/net/wireless/rtlwifi/ps.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c
index 130fdd99d573..a36dc3d5e04f 100644
--- a/drivers/net/wireless/rtlwifi/ps.c
+++ b/drivers/net/wireless/rtlwifi/ps.c
@@ -44,7 +44,7 @@ bool rtl_ps_enable_nic(struct ieee80211_hw *hw)
44 44
45 if (is_hal_stop(rtlhal)) 45 if (is_hal_stop(rtlhal))
46 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 46 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
47 ("Driver is already down!\n")); 47 "Driver is already down!\n");
48 48
49 /*<2> Enable Adapter */ 49 /*<2> Enable Adapter */
50 rtlpriv->cfg->ops->hw_init(hw); 50 rtlpriv->cfg->ops->hw_init(hw);
@@ -120,7 +120,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
120 120
121 default: 121 default:
122 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 122 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
123 ("switch case not process\n")); 123 "switch case not processed\n");
124 break; 124 break;
125 } 125 }
126 126
@@ -176,7 +176,7 @@ void rtl_ips_nic_off_wq_callback(void *data)
176 176
177 if (mac->opmode != NL80211_IFTYPE_STATION) { 177 if (mac->opmode != NL80211_IFTYPE_STATION) {
178 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 178 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
179 ("not station return\n")); 179 "not station return\n");
180 return; 180 return;
181 } 181 }
182 182
@@ -207,7 +207,7 @@ void rtl_ips_nic_off_wq_callback(void *data)
207 (mac->link_state == MAC80211_NOLINK) && 207 (mac->link_state == MAC80211_NOLINK) &&
208 !mac->act_scanning) { 208 !mac->act_scanning) {
209 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 209 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
210 ("IPSEnter(): Turn off RF.\n")); 210 "IPSEnter(): Turn off RF\n");
211 211
212 ppsc->inactive_pwrstate = ERFOFF; 212 ppsc->inactive_pwrstate = ERFOFF;
213 ppsc->in_powersavemode = true; 213 ppsc->in_powersavemode = true;
@@ -280,8 +280,7 @@ static bool rtl_get_fwlps_doze(struct ieee80211_hw *hw)
280 280
281 if (ps_timediff < 2000) { 281 if (ps_timediff < 2000) {
282 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 282 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
283 ("Delay enter Fw LPS for DHCP, ARP," 283 "Delay enter Fw LPS for DHCP, ARP, or EAPOL exchanging state\n");
284 " or EAPOL exchanging state.\n"));
285 return false; 284 return false;
286 } 285 }
287 286
@@ -328,8 +327,8 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
328 bool fw_current_inps; 327 bool fw_current_inps;
329 if (ppsc->dot11_psmode == EACTIVE) { 328 if (ppsc->dot11_psmode == EACTIVE) {
330 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 329 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
331 ("FW LPS leave ps_mode:%x\n", 330 "FW LPS leave ps_mode:%x\n",
332 FW_PS_ACTIVE_MODE)); 331 FW_PS_ACTIVE_MODE);
333 332
334 rpwm_val = 0x0C; /* RF on */ 333 rpwm_val = 0x0C; /* RF on */
335 fw_pwrmode = FW_PS_ACTIVE_MODE; 334 fw_pwrmode = FW_PS_ACTIVE_MODE;
@@ -347,8 +346,8 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
347 } else { 346 } else {
348 if (rtl_get_fwlps_doze(hw)) { 347 if (rtl_get_fwlps_doze(hw)) {
349 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 348 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
350 ("FW LPS enter ps_mode:%x\n", 349 "FW LPS enter ps_mode:%x\n",
351 ppsc->fwctrl_psmode)); 350 ppsc->fwctrl_psmode);
352 351
353 rpwm_val = 0x02; /* RF off */ 352 rpwm_val = 0x02; /* RF off */
354 fw_current_inps = true; 353 fw_current_inps = true;
@@ -402,7 +401,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw)
402 if (mac->cnt_after_linked >= 2) { 401 if (mac->cnt_after_linked >= 2) {
403 if (ppsc->dot11_psmode == EACTIVE) { 402 if (ppsc->dot11_psmode == EACTIVE) {
404 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 403 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
405 ("Enter 802.11 power save mode...\n")); 404 "Enter 802.11 power save mode...\n");
406 405
407 rtl_lps_set_psmode(hw, EAUTOPS); 406 rtl_lps_set_psmode(hw, EAUTOPS);
408 } 407 }
@@ -434,7 +433,7 @@ void rtl_lps_leave(struct ieee80211_hw *hw)
434 } 433 }
435 434
436 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 435 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
437 ("Busy Traffic,Leave 802.11 power save..\n")); 436 "Busy Traffic,Leave 802.11 power save..\n");
438 437
439 rtl_lps_set_psmode(hw, EACTIVE); 438 rtl_lps_set_psmode(hw, EACTIVE);
440 } 439 }
@@ -518,8 +517,8 @@ void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
518 queue_delayed_work(rtlpriv->works.rtl_wq, 517 queue_delayed_work(rtlpriv->works.rtl_wq,
519 &rtlpriv->works.ps_work, MSECS(5)); 518 &rtlpriv->works.ps_work, MSECS(5));
520 } else { 519 } else {
521 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, ("u_bufferd: %x, " 520 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
522 "m_buffered: %x\n", u_buffed, m_buffed)); 521 "u_bufferd: %x, m_buffered: %x\n", u_buffed, m_buffed);
523 } 522 }
524} 523}
525 524
@@ -607,8 +606,8 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw)
607 * sleep = dtim_period, that meaons, we should 606 * sleep = dtim_period, that meaons, we should
608 * awake before every dtim */ 607 * awake before every dtim */
609 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 608 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
610 ("dtim_counter:%x will sleep :%d" 609 "dtim_counter:%x will sleep :%d beacon_intv\n",
611 " beacon_intv\n", rtlpriv->psc.dtim_counter, sleep_intv)); 610 rtlpriv->psc.dtim_counter, sleep_intv);
612 611
613 /* we tested that 40ms is enough for sw & hw sw delay */ 612 /* we tested that 40ms is enough for sw & hw sw delay */
614 queue_delayed_work(rtlpriv->works.rtl_wq, &rtlpriv->works.ps_rfon_wq, 613 queue_delayed_work(rtlpriv->works.rtl_wq, &rtlpriv->works.ps_rfon_wq,