diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-09 23:54:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:06:30 -0500 |
commit | 2eb188a1c57ae79283cee951c317bd191cf1ca56 (patch) | |
tree | 6fa459e2d171f035c97af88bfa5957dd544b4413 /drivers/net/wireless/libertas/main.c | |
parent | b8d40bc9c9099943cbcf18d285bf241f1f080a44 (diff) |
libertas: Move actual transmission to main thread
The locking issues with TX, especially TX from multiple netdevs, get
_so_ much easier if you do it like this.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 42b64b5ad083..f16c93ba6efd 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -739,6 +739,8 @@ static int lbs_thread(void *data) | |||
739 | shouldsleep = 0; /* Interrupt pending. Deal with it now */ | 739 | shouldsleep = 0; /* Interrupt pending. Deal with it now */ |
740 | else if (priv->dnld_sent) | 740 | else if (priv->dnld_sent) |
741 | shouldsleep = 1; /* Something is en route to the device already */ | 741 | shouldsleep = 1; /* Something is en route to the device already */ |
742 | else if (priv->tx_pending_len > 0) | ||
743 | shouldsleep = 0; /* We've a packet to send */ | ||
742 | else if (priv->cur_cmd) | 744 | else if (priv->cur_cmd) |
743 | shouldsleep = 1; /* Can't send a command; one already running */ | 745 | shouldsleep = 1; /* Can't send a command; one already running */ |
744 | else if (!list_empty(&priv->cmdpendingq)) | 746 | else if (!list_empty(&priv->cmdpendingq)) |
@@ -852,6 +854,28 @@ static int lbs_thread(void *data) | |||
852 | */ | 854 | */ |
853 | if (!list_empty(&priv->cmdpendingq)) | 855 | if (!list_empty(&priv->cmdpendingq)) |
854 | wake_up_all(&priv->cmd_pending); | 856 | wake_up_all(&priv->cmd_pending); |
857 | |||
858 | spin_lock_irq(&priv->driver_lock); | ||
859 | if (!priv->dnld_sent && priv->tx_pending_len > 0) { | ||
860 | int ret = priv->hw_host_to_card(priv, MVMS_DAT, | ||
861 | priv->tx_pending_buf, | ||
862 | priv->tx_pending_len); | ||
863 | if (ret) { | ||
864 | lbs_deb_tx("host_to_card failed %d\n", ret); | ||
865 | priv->dnld_sent = DNLD_RES_RECEIVED; | ||
866 | } | ||
867 | priv->tx_pending_len = 0; | ||
868 | if (!priv->currenttxskb) { | ||
869 | /* We can wake the queues immediately if we aren't | ||
870 | waiting for TX feedback */ | ||
871 | if (priv->connect_status == LBS_CONNECTED) | ||
872 | netif_wake_queue(priv->dev); | ||
873 | if (priv->mesh_dev && | ||
874 | priv->mesh_connect_status == LBS_CONNECTED) | ||
875 | netif_wake_queue(priv->mesh_dev); | ||
876 | } | ||
877 | } | ||
878 | spin_unlock_irq(&priv->driver_lock); | ||
855 | } | 879 | } |
856 | 880 | ||
857 | del_timer(&priv->command_timer); | 881 | del_timer(&priv->command_timer); |