aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/cmd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 1cbbd96fdbde..be5cfd8402c7 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,
912 return 0; 912 return 0;
913} 913}
914 914
915/*
916 * Note: NEVER use libertas_queue_cmd() with addtail==0 other than for
917 * the command timer, because it does not account for queued commands.
918 */
915void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) 919void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail)
916{ 920{
917 unsigned long flags; 921 unsigned long flags;
@@ -941,10 +945,11 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u
941 945
942 spin_lock_irqsave(&adapter->driver_lock, flags); 946 spin_lock_irqsave(&adapter->driver_lock, flags);
943 947
944 if (addtail) 948 if (addtail) {
945 list_add_tail((struct list_head *)cmdnode, 949 list_add_tail((struct list_head *)cmdnode,
946 &adapter->cmdpendingq); 950 &adapter->cmdpendingq);
947 else 951 adapter->nr_cmd_pending++;
952 } else
948 list_add((struct list_head *)cmdnode, &adapter->cmdpendingq); 953 list_add((struct list_head *)cmdnode, &adapter->cmdpendingq);
949 954
950 spin_unlock_irqrestore(&adapter->driver_lock, flags); 955 spin_unlock_irqrestore(&adapter->driver_lock, flags);
@@ -1412,7 +1417,6 @@ int libertas_prepare_and_send_command(wlan_private * priv,
1412 cmdnode->cmdwaitqwoken = 0; 1417 cmdnode->cmdwaitqwoken = 0;
1413 1418
1414 libertas_queue_cmd(adapter, cmdnode, 1); 1419 libertas_queue_cmd(adapter, cmdnode, 1);
1415 adapter->nr_cmd_pending++;
1416 wake_up_interruptible(&priv->waitq); 1420 wake_up_interruptible(&priv->waitq);
1417 1421
1418 if (wait_option & CMD_OPTION_WAITFORRSP) { 1422 if (wait_option & CMD_OPTION_WAITFORRSP) {