aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-08 15:56:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:06:20 -0500
commita63b22bb5bb58d7a1d1b38aeac9a55c51565131c (patch)
treefe7b43d270e761edf630e499233f750da53005c9 /drivers/net/wireless/libertas/main.c
parentaa21c004f80bdf943736c62dccf0c0398d7824f3 (diff)
libertas: use lbs_host_to_card_done() in lbs_tx_timeout()
Also attempt some locking in lbs_host_to_card_done() 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.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 243cdea419c2..2ff5f1b77b12 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -601,31 +601,24 @@ static void lbs_tx_timeout(struct net_device *dev)
601 601
602 lbs_pr_err("tx watch dog timeout\n"); 602 lbs_pr_err("tx watch dog timeout\n");
603 603
604 priv->dnld_sent = DNLD_RES_RECEIVED;
605 dev->trans_start = jiffies; 604 dev->trans_start = jiffies;
606 605
607 if (priv->currenttxskb) { 606 if (priv->currenttxskb) {
608 if (priv->monitormode != LBS_MONITOR_OFF) { 607 priv->eventcause = 0x01000000;
609 /* If we are here, we have not received feedback from 608 lbs_send_tx_feedback(priv);
610 the previous packet. Assume TX_FAIL and move on. */
611 priv->eventcause = 0x01000000;
612 lbs_send_tx_feedback(priv);
613 } else
614 wake_up_interruptible(&priv->waitq);
615 } else if (dev == priv->dev) {
616 if (priv->connect_status == LBS_CONNECTED)
617 netif_wake_queue(priv->dev);
618
619 } else if (dev == priv->mesh_dev) {
620 if (priv->mesh_connect_status == LBS_CONNECTED)
621 netif_wake_queue(priv->mesh_dev);
622 } 609 }
610 /* XX: Shouldn't we also call into the hw-specific driver
611 to kick it somehow? */
612 lbs_host_to_card_done(priv);
623 613
624 lbs_deb_leave(LBS_DEB_TX); 614 lbs_deb_leave(LBS_DEB_TX);
625} 615}
626 616
627void lbs_host_to_card_done(struct lbs_private *priv) 617void lbs_host_to_card_done(struct lbs_private *priv)
628{ 618{
619 unsigned long flags;
620
621 spin_lock_irqsave(&priv->driver_lock, flags);
629 622
630 priv->dnld_sent = DNLD_RES_RECEIVED; 623 priv->dnld_sent = DNLD_RES_RECEIVED;
631 624
@@ -634,15 +627,16 @@ void lbs_host_to_card_done(struct lbs_private *priv)
634 wake_up_interruptible(&priv->waitq); 627 wake_up_interruptible(&priv->waitq);
635 628
636 /* Don't wake netif queues if we're in monitor mode and 629 /* Don't wake netif queues if we're in monitor mode and
637 a TX packet is already pending. */ 630 a TX packet is already pending, or if there are commands
638 if (priv->currenttxskb) 631 queued to be sent. */
639 return; 632 if (!priv->currenttxskb && list_empty(&priv->cmdpendingq)) {
640 633 if (priv->dev && priv->connect_status == LBS_CONNECTED)
641 if (priv->dev && priv->connect_status == LBS_CONNECTED) 634 netif_wake_queue(priv->dev);
642 netif_wake_queue(priv->dev);
643 635
644 if (priv->mesh_dev && priv->mesh_connect_status == LBS_CONNECTED) 636 if (priv->mesh_dev && priv->mesh_connect_status == LBS_CONNECTED)
645 netif_wake_queue(priv->mesh_dev); 637 netif_wake_queue(priv->mesh_dev);
638 }
639 spin_unlock_irqrestore(&priv->driver_lock, flags);
646} 640}
647EXPORT_SYMBOL_GPL(lbs_host_to_card_done); 641EXPORT_SYMBOL_GPL(lbs_host_to_card_done);
648 642