Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29f5f2a19b055feabfcc6f92e1d40ec092c373ea
Commit:     29f5f2a19b055feabfcc6f92e1d40ec092c373ea
Parent:     51e6b712b5960cc7d086c3f856434ccd096c63a7
Author:     Marcelo Tosatti <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 30 10:52:46 2007 -0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sat Nov 10 04:25:11 2007 -0500

    libertas: properly account for queue commands
    
    Properly account for queue commands, this fixes a problem reported
    by Holger Schurig when using the debugfs interface.
    
    Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/libertas/cmd.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 1cbbd96..be5cfd8 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -912,6 +912,10 @@ static int wlan_cmd_set_boot2_ver(wlan_private * priv,
        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;
@@ -941,10 +945,11 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct 
cmd_ctrl_node *cmdnode, u
 
        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 @@ int libertas_prepare_and_send_command(wlan_private * priv,
        cmdnode->cmdwaitqwoken = 0;
 
        libertas_queue_cmd(adapter, cmdnode, 1);
-       adapter->nr_cmd_pending++;
        wake_up_interruptible(&priv->waitq);
 
        if (wait_option & CMD_OPTION_WAITFORRSP) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to