* [PATCH] libertas: properly account for queue commands
@ 2007-10-30 14:52 Dan Williams
0 siblings, 0 replies; only message in thread
From: Dan Williams @ 2007-10-30 14:52 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Marcelo Tosatti
Target for 2.6.24 and a candidate for stable as well.
From: Marcelo Tosatti <marcelo@kvack.org>
Properly account for queue commands, this fixes a problem reported
by Holger Schurig when using the debugfs interface.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index ce28417..23783b9 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -901,6 +901,10 @@ static int wlan_cmd_mesh_access(wlan_pri
return 0;
}
+/*
+ * Note: NEVER use libertas_queue_cmd() with addtail==0 other than for
+ * the command timer, because it does not account for queued commands.
+ */
void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail)
{
unsigned long flags;
@@ -930,10 +934,11 @@ void libertas_queue_cmd(wlan_adapter * a
spin_lock_irqsave(&adapter->driver_lock, flags);
- if (addtail)
+ if (addtail) {
list_add_tail((struct list_head *)cmdnode,
&adapter->cmdpendingq);
- else
+ adapter->nr_cmd_pending++;
+ } else
list_add((struct list_head *)cmdnode, &adapter->cmdpendingq);
spin_unlock_irqrestore(&adapter->driver_lock, flags);
@@ -1412,7 +1417,6 @@ #define ACTION_NUMLED_TLVTYPE_LEN_FIELDS
cmdnode->cmdwaitqwoken = 0;
libertas_queue_cmd(adapter, cmdnode, 1);
- adapter->nr_cmd_pending++;
wake_up_interruptible(&priv->waitq);
if (wait_option & CMD_OPTION_WAITFORRSP) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-10-30 14:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-30 14:52 [PATCH] libertas: properly account for queue commands Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox