Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235864
b: refs/heads/master
c: 9236928
h: refs/heads/master
v: v3
  • Loading branch information
Mike McCormack authored and Greg Kroah-Hartman committed Feb 9, 2011
1 parent 0299b6d commit b558e16
Show file tree
Hide file tree
Showing 2 changed files with 12 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: fb53c2b73f4fc1cfd3d5548b6efbb00b1d7de3a7
refs/heads/master: 9236928f155e9e4ae19310359518cedab4e64450
26 changes: 11 additions & 15 deletions trunk/drivers/staging/rtl8192e/r8192E_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,11 +1977,10 @@ void rtl8192_hw_wakeup_wq (struct work_struct *work)
static void rtl8192_hw_to_sleep(struct net_device *dev, u32 th, u32 tl)
{
struct r8192_priv *priv = ieee80211_priv(dev);

u32 tmp;
u32 rb = jiffies;
unsigned long flags;

spin_lock_irqsave(&priv->ps_lock,flags);
spin_lock(&priv->ps_lock);

// Writing HW register with 0 equals to disable
// the timer, that is not really what we want
Expand All @@ -1994,28 +1993,25 @@ static void rtl8192_hw_to_sleep(struct net_device *dev, u32 th, u32 tl)
//
if(((tl>=rb)&& (tl-rb) <= MSECS(MIN_SLEEP_TIME))
||((rb>tl)&& (rb-tl) < MSECS(MIN_SLEEP_TIME))) {
spin_unlock_irqrestore(&priv->ps_lock,flags);
printk("too short to sleep::%x, %x, %lx\n",tl, rb, MSECS(MIN_SLEEP_TIME));
return;
goto out_unlock;
}

if(((tl > rb) && ((tl-rb) > MSECS(MAX_SLEEP_TIME)))||
((tl < rb) && (tl>MSECS(69)) && ((rb-tl) > MSECS(MAX_SLEEP_TIME)))||
((tl<rb)&&(tl<MSECS(69))&&((tl+0xffffffff-rb)>MSECS(MAX_SLEEP_TIME)))) {
printk("========>too long to sleep:%x, %x, %lx\n", tl, rb, MSECS(MAX_SLEEP_TIME));
spin_unlock_irqrestore(&priv->ps_lock,flags);
return;
}
{
u32 tmp = (tl>rb)?(tl-rb):(rb-tl);
queue_delayed_work(priv->ieee80211->wq,
&priv->ieee80211->hw_wakeup_wq,tmp);
//PowerSave not supported when kernel version less 2.6.20
goto out_unlock;
}

tmp = (tl>rb)?(tl-rb):(rb-tl);
queue_delayed_work(priv->ieee80211->wq,
(void *)&priv->ieee80211->hw_sleep_wq,0);
spin_unlock_irqrestore(&priv->ps_lock,flags);
&priv->ieee80211->hw_wakeup_wq,tmp);

queue_delayed_work(priv->ieee80211->wq,
(void *)&priv->ieee80211->hw_sleep_wq,0);
out_unlock:
spin_unlock(&priv->ps_lock);
}

static void rtl8192_init_priv_variable(struct net_device* dev)
Expand Down

0 comments on commit b558e16

Please sign in to comment.