aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-07 19:35:00 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:06:15 -0500
commitac47246e246c183ed68b3fdb307a83d00313a325 (patch)
treebe16670a7fd60c0acd07a6914b424b6b1bebb4ff /drivers/net/wireless
parent99c893f34ab932171af27264c0cba4946ca0c355 (diff)
libertas: kill adapter->nr_cmd_pending
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/libertas/cmd.c6
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c5
-rw-r--r--drivers/net/wireless/libertas/debugfs.c3
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/main.c4
5 files changed, 5 insertions, 14 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index cf1ab8a345fe..092c295e3802 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1009,10 +1009,9 @@ void lbs_queue_cmd(struct lbs_adapter *adapter,
1009 1009
1010 spin_lock_irqsave(&adapter->driver_lock, flags); 1010 spin_lock_irqsave(&adapter->driver_lock, flags);
1011 1011
1012 if (addtail) { 1012 if (addtail)
1013 list_add_tail(&cmdnode->list, &adapter->cmdpendingq); 1013 list_add_tail(&cmdnode->list, &adapter->cmdpendingq);
1014 adapter->nr_cmd_pending++; 1014 else
1015 } else
1016 list_add(&cmdnode->list, &adapter->cmdpendingq); 1015 list_add(&cmdnode->list, &adapter->cmdpendingq);
1017 1016
1018 spin_unlock_irqrestore(&adapter->driver_lock, flags); 1017 spin_unlock_irqrestore(&adapter->driver_lock, flags);
@@ -1078,7 +1077,6 @@ static int DownloadcommandToStation(struct lbs_private *priv,
1078 spin_lock_irqsave(&adapter->driver_lock, flags); 1077 spin_lock_irqsave(&adapter->driver_lock, flags);
1079 adapter->cur_cmd_retcode = ret; 1078 adapter->cur_cmd_retcode = ret;
1080 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); 1079 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd);
1081 adapter->nr_cmd_pending--;
1082 adapter->cur_cmd = NULL; 1080 adapter->cur_cmd = NULL;
1083 spin_unlock_irqrestore(&adapter->driver_lock, flags); 1081 spin_unlock_irqrestore(&adapter->driver_lock, flags);
1084 goto done; 1082 goto done;
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index f6c1016b2bb6..44865bf12ba4 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -791,7 +791,6 @@ int lbs_process_rx_command(struct lbs_private *priv)
791 lbs_deb_host("invalid response!\n"); 791 lbs_deb_host("invalid response!\n");
792 adapter->cur_cmd_retcode = -1; 792 adapter->cur_cmd_retcode = -1;
793 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); 793 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd);
794 adapter->nr_cmd_pending--;
795 adapter->cur_cmd = NULL; 794 adapter->cur_cmd = NULL;
796 spin_unlock_irqrestore(&adapter->driver_lock, flags); 795 spin_unlock_irqrestore(&adapter->driver_lock, flags);
797 ret = -1; 796 ret = -1;
@@ -848,7 +847,6 @@ int lbs_process_rx_command(struct lbs_private *priv)
848 } 847 }
849 848
850 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); 849 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd);
851 adapter->nr_cmd_pending--;
852 adapter->cur_cmd = NULL; 850 adapter->cur_cmd = NULL;
853 spin_unlock_irqrestore(&adapter->driver_lock, flags); 851 spin_unlock_irqrestore(&adapter->driver_lock, flags);
854 852
@@ -872,7 +870,6 @@ int lbs_process_rx_command(struct lbs_private *priv)
872 } 870 }
873 871
874 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); 872 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd);
875 adapter->nr_cmd_pending--;
876 adapter->cur_cmd = NULL; 873 adapter->cur_cmd = NULL;
877 spin_unlock_irqrestore(&adapter->driver_lock, flags); 874 spin_unlock_irqrestore(&adapter->driver_lock, flags);
878 875
@@ -892,8 +889,6 @@ int lbs_process_rx_command(struct lbs_private *priv)
892 if (adapter->cur_cmd) { 889 if (adapter->cur_cmd) {
893 /* Clean up and Put current command back to cmdfreeq */ 890 /* Clean up and Put current command back to cmdfreeq */
894 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd); 891 __lbs_cleanup_and_insert_cmd(priv, adapter->cur_cmd);
895 adapter->nr_cmd_pending--;
896 WARN_ON(adapter->nr_cmd_pending > 128);
897 adapter->cur_cmd = NULL; 892 adapter->cur_cmd = NULL;
898 } 893 }
899 spin_unlock_irqrestore(&adapter->driver_lock, flags); 894 spin_unlock_irqrestore(&adapter->driver_lock, flags);
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index b0a76c5bec66..9a041e5b209c 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -322,7 +322,8 @@ static ssize_t lbs_setuserscan(struct file *file,
322 322
323 lbs_scan_networks(priv, scan_cfg, 1); 323 lbs_scan_networks(priv, scan_cfg, 1);
324 wait_event_interruptible(priv->adapter->cmd_pending, 324 wait_event_interruptible(priv->adapter->cmd_pending,
325 priv->adapter->surpriseremoved || !priv->adapter->nr_cmd_pending); 325 priv->adapter->surpriseremoved ||
326 (!priv->adapter->cur_cmd && list_empty(&priv->adapter->cmdpendingq)));
326 327
327 if (priv->adapter->surpriseremoved) 328 if (priv->adapter->surpriseremoved)
328 goto out_scan_cfg; 329 goto out_scan_cfg;
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 96a34c5bce80..fb26f18e446e 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -231,7 +231,6 @@ struct lbs_adapter {
231 struct list_head cmdpendingq; 231 struct list_head cmdpendingq;
232 232
233 wait_queue_head_t cmd_pending; 233 wait_queue_head_t cmd_pending;
234 u8 nr_cmd_pending;
235 /* command related variables protected by adapter->driver_lock */ 234 /* command related variables protected by adapter->driver_lock */
236 235
237 /** Async and Sync Event variables */ 236 /** Async and Sync Event variables */
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index a5b573ce5454..500357ba48db 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -929,14 +929,13 @@ static int lbs_thread(void *data)
929 /* Wake-up command waiters which can't sleep in 929 /* Wake-up command waiters which can't sleep in
930 * lbs_prepare_and_send_command 930 * lbs_prepare_and_send_command
931 */ 931 */
932 if (!adapter->nr_cmd_pending) 932 if (!list_empty(&adapter->cmdpendingq))
933 wake_up_all(&adapter->cmd_pending); 933 wake_up_all(&adapter->cmd_pending);
934 934
935 lbs_tx_runqueue(priv); 935 lbs_tx_runqueue(priv);
936 } 936 }
937 937
938 del_timer(&adapter->command_timer); 938 del_timer(&adapter->command_timer);
939 adapter->nr_cmd_pending = 0;
940 wake_up_all(&adapter->cmd_pending); 939 wake_up_all(&adapter->cmd_pending);
941 940
942 lbs_deb_leave(LBS_DEB_THREAD); 941 lbs_deb_leave(LBS_DEB_THREAD);
@@ -1105,7 +1104,6 @@ static int lbs_init_adapter(struct lbs_private *priv)
1105 1104
1106 spin_lock_init(&adapter->driver_lock); 1105 spin_lock_init(&adapter->driver_lock);
1107 init_waitqueue_head(&adapter->cmd_pending); 1106 init_waitqueue_head(&adapter->cmd_pending);
1108 adapter->nr_cmd_pending = 0;
1109 1107
1110 /* Allocate the command buffers */ 1108 /* Allocate the command buffers */
1111 if (lbs_allocate_cmd_buffer(priv)) { 1109 if (lbs_allocate_cmd_buffer(priv)) {