diff options
-rw-r--r-- | drivers/net/wireless/rtlwifi/base.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/ps.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/wifi.h | 3 |
3 files changed, 12 insertions, 15 deletions
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index a13ecfce4825..d81a6021a30f 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -448,12 +448,11 @@ int rtl_init_core(struct ieee80211_hw *hw) | |||
448 | 448 | ||
449 | /* <4> locks */ | 449 | /* <4> locks */ |
450 | mutex_init(&rtlpriv->locks.conf_mutex); | 450 | mutex_init(&rtlpriv->locks.conf_mutex); |
451 | spin_lock_init(&rtlpriv->locks.ips_lock); | 451 | mutex_init(&rtlpriv->locks.ps_mutex); |
452 | spin_lock_init(&rtlpriv->locks.irq_th_lock); | 452 | spin_lock_init(&rtlpriv->locks.irq_th_lock); |
453 | spin_lock_init(&rtlpriv->locks.h2c_lock); | 453 | spin_lock_init(&rtlpriv->locks.h2c_lock); |
454 | spin_lock_init(&rtlpriv->locks.rf_ps_lock); | 454 | spin_lock_init(&rtlpriv->locks.rf_ps_lock); |
455 | spin_lock_init(&rtlpriv->locks.rf_lock); | 455 | spin_lock_init(&rtlpriv->locks.rf_lock); |
456 | spin_lock_init(&rtlpriv->locks.lps_lock); | ||
457 | spin_lock_init(&rtlpriv->locks.waitq_lock); | 456 | spin_lock_init(&rtlpriv->locks.waitq_lock); |
458 | spin_lock_init(&rtlpriv->locks.cck_and_rw_pagea_lock); | 457 | spin_lock_init(&rtlpriv->locks.cck_and_rw_pagea_lock); |
459 | 458 | ||
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c index 55c8e50f45fd..a14a68b24635 100644 --- a/drivers/net/wireless/rtlwifi/ps.c +++ b/drivers/net/wireless/rtlwifi/ps.c | |||
@@ -241,7 +241,7 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw) | |||
241 | if (mac->opmode != NL80211_IFTYPE_STATION) | 241 | if (mac->opmode != NL80211_IFTYPE_STATION) |
242 | return; | 242 | return; |
243 | 243 | ||
244 | spin_lock(&rtlpriv->locks.ips_lock); | 244 | mutex_lock(&rtlpriv->locks.ps_mutex); |
245 | 245 | ||
246 | if (ppsc->inactiveps) { | 246 | if (ppsc->inactiveps) { |
247 | rtstate = ppsc->rfpwr_state; | 247 | rtstate = ppsc->rfpwr_state; |
@@ -257,7 +257,7 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw) | |||
257 | } | 257 | } |
258 | } | 258 | } |
259 | 259 | ||
260 | spin_unlock(&rtlpriv->locks.ips_lock); | 260 | mutex_unlock(&rtlpriv->locks.ps_mutex); |
261 | } | 261 | } |
262 | 262 | ||
263 | /*for FW LPS*/ | 263 | /*for FW LPS*/ |
@@ -395,7 +395,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw) | |||
395 | if (mac->link_state != MAC80211_LINKED) | 395 | if (mac->link_state != MAC80211_LINKED) |
396 | return; | 396 | return; |
397 | 397 | ||
398 | spin_lock_irq(&rtlpriv->locks.lps_lock); | 398 | mutex_lock(&rtlpriv->locks.ps_mutex); |
399 | 399 | ||
400 | /* Idle for a while if we connect to AP a while ago. */ | 400 | /* Idle for a while if we connect to AP a while ago. */ |
401 | if (mac->cnt_after_linked >= 2) { | 401 | if (mac->cnt_after_linked >= 2) { |
@@ -407,7 +407,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw) | |||
407 | } | 407 | } |
408 | } | 408 | } |
409 | 409 | ||
410 | spin_unlock_irq(&rtlpriv->locks.lps_lock); | 410 | mutex_unlock(&rtlpriv->locks.ps_mutex); |
411 | } | 411 | } |
412 | 412 | ||
413 | /*Leave the leisure power save mode.*/ | 413 | /*Leave the leisure power save mode.*/ |
@@ -416,9 +416,8 @@ void rtl_lps_leave(struct ieee80211_hw *hw) | |||
416 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 416 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
417 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 417 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
418 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 418 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
419 | unsigned long flags; | ||
420 | 419 | ||
421 | spin_lock_irqsave(&rtlpriv->locks.lps_lock, flags); | 420 | mutex_lock(&rtlpriv->locks.ps_mutex); |
422 | 421 | ||
423 | if (ppsc->fwctrl_lps) { | 422 | if (ppsc->fwctrl_lps) { |
424 | if (ppsc->dot11_psmode != EACTIVE) { | 423 | if (ppsc->dot11_psmode != EACTIVE) { |
@@ -439,7 +438,7 @@ void rtl_lps_leave(struct ieee80211_hw *hw) | |||
439 | rtl_lps_set_psmode(hw, EACTIVE); | 438 | rtl_lps_set_psmode(hw, EACTIVE); |
440 | } | 439 | } |
441 | } | 440 | } |
442 | spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flags); | 441 | mutex_unlock(&rtlpriv->locks.ps_mutex); |
443 | } | 442 | } |
444 | 443 | ||
445 | /* For sw LPS*/ | 444 | /* For sw LPS*/ |
@@ -540,9 +539,9 @@ void rtl_swlps_rf_awake(struct ieee80211_hw *hw) | |||
540 | RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM); | 539 | RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM); |
541 | } | 540 | } |
542 | 541 | ||
543 | spin_lock_irq(&rtlpriv->locks.lps_lock); | 542 | mutex_lock(&rtlpriv->locks.ps_mutex); |
544 | rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS); | 543 | rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS); |
545 | spin_unlock_irq(&rtlpriv->locks.lps_lock); | 544 | mutex_unlock(&rtlpriv->locks.ps_mutex); |
546 | } | 545 | } |
547 | 546 | ||
548 | void rtl_swlps_rfon_wq_callback(void *data) | 547 | void rtl_swlps_rfon_wq_callback(void *data) |
@@ -575,9 +574,9 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw) | |||
575 | if (rtlpriv->link_info.busytraffic) | 574 | if (rtlpriv->link_info.busytraffic) |
576 | return; | 575 | return; |
577 | 576 | ||
578 | spin_lock_irq(&rtlpriv->locks.lps_lock); | 577 | mutex_lock(&rtlpriv->locks.ps_mutex); |
579 | rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS); | 578 | rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS); |
580 | spin_unlock_irq(&rtlpriv->locks.lps_lock); | 579 | mutex_unlock(&rtlpriv->locks.ps_mutex); |
581 | 580 | ||
582 | if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && | 581 | if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && |
583 | !RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) { | 582 | !RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) { |
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index 6e6353bbc7b4..085dccdbd1b6 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -1544,14 +1544,13 @@ struct rtl_hal_cfg { | |||
1544 | struct rtl_locks { | 1544 | struct rtl_locks { |
1545 | /* mutex */ | 1545 | /* mutex */ |
1546 | struct mutex conf_mutex; | 1546 | struct mutex conf_mutex; |
1547 | struct mutex ps_mutex; | ||
1547 | 1548 | ||
1548 | /*spin lock */ | 1549 | /*spin lock */ |
1549 | spinlock_t ips_lock; | ||
1550 | spinlock_t irq_th_lock; | 1550 | spinlock_t irq_th_lock; |
1551 | spinlock_t h2c_lock; | 1551 | spinlock_t h2c_lock; |
1552 | spinlock_t rf_ps_lock; | 1552 | spinlock_t rf_ps_lock; |
1553 | spinlock_t rf_lock; | 1553 | spinlock_t rf_lock; |
1554 | spinlock_t lps_lock; | ||
1555 | spinlock_t waitq_lock; | 1554 | spinlock_t waitq_lock; |
1556 | 1555 | ||
1557 | /*Dual mac*/ | 1556 | /*Dual mac*/ |