Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79144
b: refs/heads/master
c: b8d40bc
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent acf8159 commit e647543
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 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: 45c24903b7026ec99c059d690f3618e3f95f2790
refs/heads/master: b8d40bc9c9099943cbcf18d285bf241f1f080a44
20 changes: 18 additions & 2 deletions trunk/drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,15 +722,31 @@ static int lbs_thread(void *data)
set_freezable();

for (;;) {
int shouldsleep;

lbs_deb_thread( "main-thread 111: intcounter=%d currenttxskb=%p dnld_sent=%d\n",
priv->intcounter, priv->currenttxskb, priv->dnld_sent);

add_wait_queue(&priv->waitq, &wait);
set_current_state(TASK_INTERRUPTIBLE);
spin_lock_irq(&priv->driver_lock);

if ((priv->psstate == PS_STATE_SLEEP) ||
(!priv->intcounter && (priv->dnld_sent || priv->cur_cmd || list_empty(&priv->cmdpendingq)))) {
if (priv->surpriseremoved)
shouldsleep = 0; /* Bye */
else if (priv->psstate == PS_STATE_SLEEP)
shouldsleep = 1; /* Sleep mode. Nothing we can do till it wakes */
else if (priv->intcounter)
shouldsleep = 0; /* Interrupt pending. Deal with it now */
else if (priv->dnld_sent)
shouldsleep = 1; /* Something is en route to the device already */
else if (priv->cur_cmd)
shouldsleep = 1; /* Can't send a command; one already running */
else if (!list_empty(&priv->cmdpendingq))
shouldsleep = 0; /* We have a command to send */
else
shouldsleep = 1; /* No command */

if (shouldsleep) {
lbs_deb_thread("main-thread sleeping... Conn=%d IntC=%d PS_mode=%d PS_State=%d\n",
priv->connect_status, priv->intcounter,
priv->psmode, priv->psstate);
Expand Down

0 comments on commit e647543

Please sign in to comment.