diff options
-rw-r--r-- | drivers/net/wireless/rtlwifi/ps.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c index a693feffbe72..0b04b2e7b597 100644 --- a/drivers/net/wireless/rtlwifi/ps.c +++ b/drivers/net/wireless/rtlwifi/ps.c | |||
@@ -394,7 +394,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw) | |||
394 | if (mac->link_state != MAC80211_LINKED) | 394 | if (mac->link_state != MAC80211_LINKED) |
395 | return; | 395 | return; |
396 | 396 | ||
397 | spin_lock(&rtlpriv->locks.lps_lock); | 397 | spin_lock_irq(&rtlpriv->locks.lps_lock); |
398 | 398 | ||
399 | /* Idle for a while if we connect to AP a while ago. */ | 399 | /* Idle for a while if we connect to AP a while ago. */ |
400 | if (mac->cnt_after_linked >= 2) { | 400 | if (mac->cnt_after_linked >= 2) { |
@@ -406,7 +406,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw) | |||
406 | } | 406 | } |
407 | } | 407 | } |
408 | 408 | ||
409 | spin_unlock(&rtlpriv->locks.lps_lock); | 409 | spin_unlock_irq(&rtlpriv->locks.lps_lock); |
410 | } | 410 | } |
411 | 411 | ||
412 | /*Leave the leisure power save mode.*/ | 412 | /*Leave the leisure power save mode.*/ |
@@ -415,8 +415,9 @@ void rtl_lps_leave(struct ieee80211_hw *hw) | |||
415 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 415 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
416 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 416 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
417 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 417 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
418 | unsigned long flags; | ||
418 | 419 | ||
419 | spin_lock(&rtlpriv->locks.lps_lock); | 420 | spin_lock_irqsave(&rtlpriv->locks.lps_lock, flags); |
420 | 421 | ||
421 | if (ppsc->fwctrl_lps) { | 422 | if (ppsc->fwctrl_lps) { |
422 | if (ppsc->dot11_psmode != EACTIVE) { | 423 | if (ppsc->dot11_psmode != EACTIVE) { |
@@ -437,7 +438,7 @@ void rtl_lps_leave(struct ieee80211_hw *hw) | |||
437 | rtl_lps_set_psmode(hw, EACTIVE); | 438 | rtl_lps_set_psmode(hw, EACTIVE); |
438 | } | 439 | } |
439 | } | 440 | } |
440 | spin_unlock(&rtlpriv->locks.lps_lock); | 441 | spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flags); |
441 | } | 442 | } |
442 | 443 | ||
443 | /* For sw LPS*/ | 444 | /* For sw LPS*/ |
@@ -538,9 +539,9 @@ void rtl_swlps_rf_awake(struct ieee80211_hw *hw) | |||
538 | RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM); | 539 | RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM); |
539 | } | 540 | } |
540 | 541 | ||
541 | spin_lock(&rtlpriv->locks.lps_lock); | 542 | spin_lock_irq(&rtlpriv->locks.lps_lock); |
542 | rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS); | 543 | rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS); |
543 | spin_unlock(&rtlpriv->locks.lps_lock); | 544 | spin_unlock_irq(&rtlpriv->locks.lps_lock); |
544 | } | 545 | } |
545 | 546 | ||
546 | void rtl_swlps_rfon_wq_callback(void *data) | 547 | void rtl_swlps_rfon_wq_callback(void *data) |
@@ -573,9 +574,9 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw) | |||
573 | if (rtlpriv->link_info.busytraffic) | 574 | if (rtlpriv->link_info.busytraffic) |
574 | return; | 575 | return; |
575 | 576 | ||
576 | spin_lock(&rtlpriv->locks.lps_lock); | 577 | spin_lock_irq(&rtlpriv->locks.lps_lock); |
577 | rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS); | 578 | rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS); |
578 | spin_unlock(&rtlpriv->locks.lps_lock); | 579 | spin_unlock_irq(&rtlpriv->locks.lps_lock); |
579 | 580 | ||
580 | if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && | 581 | if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && |
581 | !RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) { | 582 | !RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) { |