Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278930
b: refs/heads/master
c: 6539306
h: refs/heads/master
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Dec 13, 2011
1 parent 6376430 commit 2b3e747
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41affd5286fb91176eb99b34ecd8eb522ba22369
refs/heads/master: 6539306b2c3ceafbc4094cf68c58094c282da053
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/rtlwifi/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,11 @@ int rtl_init_core(struct ieee80211_hw *hw)

/* <4> locks */
mutex_init(&rtlpriv->locks.conf_mutex);
spin_lock_init(&rtlpriv->locks.ips_lock);
mutex_init(&rtlpriv->locks.ps_mutex);
spin_lock_init(&rtlpriv->locks.irq_th_lock);
spin_lock_init(&rtlpriv->locks.h2c_lock);
spin_lock_init(&rtlpriv->locks.rf_ps_lock);
spin_lock_init(&rtlpriv->locks.rf_lock);
spin_lock_init(&rtlpriv->locks.lps_lock);
spin_lock_init(&rtlpriv->locks.waitq_lock);
spin_lock_init(&rtlpriv->locks.cck_and_rw_pagea_lock);

Expand Down
21 changes: 10 additions & 11 deletions trunk/drivers/net/wireless/rtlwifi/ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw)
if (mac->opmode != NL80211_IFTYPE_STATION)
return;

spin_lock(&rtlpriv->locks.ips_lock);
mutex_lock(&rtlpriv->locks.ps_mutex);

if (ppsc->inactiveps) {
rtstate = ppsc->rfpwr_state;
Expand All @@ -257,7 +257,7 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw)
}
}

spin_unlock(&rtlpriv->locks.ips_lock);
mutex_unlock(&rtlpriv->locks.ps_mutex);
}

/*for FW LPS*/
Expand Down Expand Up @@ -395,7 +395,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw)
if (mac->link_state != MAC80211_LINKED)
return;

spin_lock_irq(&rtlpriv->locks.lps_lock);
mutex_lock(&rtlpriv->locks.ps_mutex);

/* Idle for a while if we connect to AP a while ago. */
if (mac->cnt_after_linked >= 2) {
Expand All @@ -407,7 +407,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw)
}
}

spin_unlock_irq(&rtlpriv->locks.lps_lock);
mutex_unlock(&rtlpriv->locks.ps_mutex);
}

/*Leave the leisure power save mode.*/
Expand All @@ -416,9 +416,8 @@ void rtl_lps_leave(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
unsigned long flags;

spin_lock_irqsave(&rtlpriv->locks.lps_lock, flags);
mutex_lock(&rtlpriv->locks.ps_mutex);

if (ppsc->fwctrl_lps) {
if (ppsc->dot11_psmode != EACTIVE) {
Expand All @@ -439,7 +438,7 @@ void rtl_lps_leave(struct ieee80211_hw *hw)
rtl_lps_set_psmode(hw, EACTIVE);
}
}
spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flags);
mutex_unlock(&rtlpriv->locks.ps_mutex);
}

/* For sw LPS*/
Expand Down Expand Up @@ -540,9 +539,9 @@ void rtl_swlps_rf_awake(struct ieee80211_hw *hw)
RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM);
}

spin_lock_irq(&rtlpriv->locks.lps_lock);
mutex_lock(&rtlpriv->locks.ps_mutex);
rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS);
spin_unlock_irq(&rtlpriv->locks.lps_lock);
mutex_unlock(&rtlpriv->locks.ps_mutex);
}

void rtl_swlps_rfon_wq_callback(void *data)
Expand Down Expand Up @@ -575,9 +574,9 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw)
if (rtlpriv->link_info.busytraffic)
return;

spin_lock_irq(&rtlpriv->locks.lps_lock);
mutex_lock(&rtlpriv->locks.ps_mutex);
rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS);
spin_unlock_irq(&rtlpriv->locks.lps_lock);
mutex_unlock(&rtlpriv->locks.ps_mutex);

if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM &&
!RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) {
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/rtlwifi/wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1544,14 +1544,13 @@ struct rtl_hal_cfg {
struct rtl_locks {
/* mutex */
struct mutex conf_mutex;
struct mutex ps_mutex;

/*spin lock */
spinlock_t ips_lock;
spinlock_t irq_th_lock;
spinlock_t h2c_lock;
spinlock_t rf_ps_lock;
spinlock_t rf_lock;
spinlock_t lps_lock;
spinlock_t waitq_lock;

/*Dual mac*/
Expand Down

0 comments on commit 2b3e747

Please sign in to comment.