aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-12 00:41:51 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:00 -0500
commita27b9f96f21a2f15c423cca745f65de3db61e364 (patch)
tree31703fb9de80eb03279eaeb730d279296979cc26
parent23d36eec263d2c913ee651dc43472524397e4a0b (diff)
libertas: slight cleanup of netif queue stop/wake
In particular, we shouldn't be waking the queues in lbs_host_to_card_done() any more. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c14
-rw-r--r--drivers/net/wireless/libertas/join.c7
-rw-r--r--drivers/net/wireless/libertas/main.c12
-rw-r--r--drivers/net/wireless/libertas/scan.c12
4 files changed, 20 insertions, 25 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 53f73c4abdd0..a809f8f9997b 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -43,14 +43,15 @@ void lbs_mac_event_disconnected(struct lbs_private *priv)
43 msleep_interruptible(1000); 43 msleep_interruptible(1000);
44 wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); 44 wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
45 45
46 /* Free Tx and Rx packets */
47 kfree_skb(priv->currenttxskb);
48 priv->currenttxskb = NULL;
49
50 /* report disconnect to upper layer */ 46 /* report disconnect to upper layer */
51 netif_stop_queue(priv->dev); 47 netif_stop_queue(priv->dev);
52 netif_carrier_off(priv->dev); 48 netif_carrier_off(priv->dev);
53 49
50 /* Free Tx and Rx packets */
51 kfree_skb(priv->currenttxskb);
52 priv->currenttxskb = NULL;
53 priv->tx_pending_len = 0;
54
54 /* reset SNR/NF/RSSI values */ 55 /* reset SNR/NF/RSSI values */
55 memset(priv->SNR, 0x00, sizeof(priv->SNR)); 56 memset(priv->SNR, 0x00, sizeof(priv->SNR));
56 memset(priv->NF, 0x00, sizeof(priv->NF)); 57 memset(priv->NF, 0x00, sizeof(priv->NF));
@@ -883,9 +884,10 @@ int lbs_process_event(struct lbs_private *priv)
883 } 884 }
884 lbs_pr_info("EVENT: MESH_AUTO_STARTED\n"); 885 lbs_pr_info("EVENT: MESH_AUTO_STARTED\n");
885 priv->mesh_connect_status = LBS_CONNECTED; 886 priv->mesh_connect_status = LBS_CONNECTED;
886 if (priv->mesh_open == 1) { 887 if (priv->mesh_open) {
887 netif_wake_queue(priv->mesh_dev);
888 netif_carrier_on(priv->mesh_dev); 888 netif_carrier_on(priv->mesh_dev);
889 if (!priv->tx_pending_len)
890 netif_wake_queue(priv->mesh_dev);
889 } 891 }
890 priv->mode = IW_MODE_ADHOC; 892 priv->mode = IW_MODE_ADHOC;
891 schedule_work(&priv->sync_channel); 893 schedule_work(&priv->sync_channel);
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index 14425d9a198a..2d4508048b68 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -781,8 +781,8 @@ int lbs_ret_80211_associate(struct lbs_private *priv,
781 priv->numSNRNF = 0; 781 priv->numSNRNF = 0;
782 782
783 netif_carrier_on(priv->dev); 783 netif_carrier_on(priv->dev);
784 netif_wake_queue(priv->dev); 784 if (!priv->tx_pending_len)
785 785 netif_wake_queue(priv->dev);
786 786
787 memcpy(wrqu.ap_addr.sa_data, priv->curbssparams.bssid, ETH_ALEN); 787 memcpy(wrqu.ap_addr.sa_data, priv->curbssparams.bssid, ETH_ALEN);
788 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 788 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
@@ -865,7 +865,8 @@ int lbs_ret_80211_ad_hoc_start(struct lbs_private *priv,
865 priv->curbssparams.ssid_len = bss->ssid_len; 865 priv->curbssparams.ssid_len = bss->ssid_len;
866 866
867 netif_carrier_on(priv->dev); 867 netif_carrier_on(priv->dev);
868 netif_wake_queue(priv->dev); 868 if (!priv->tx_pending_len)
869 netif_wake_queue(priv->dev);
869 870
870 memset(&wrqu, 0, sizeof(wrqu)); 871 memset(&wrqu, 0, sizeof(wrqu));
871 memcpy(wrqu.ap_addr.sa_data, priv->curbssparams.bssid, ETH_ALEN); 872 memcpy(wrqu.ap_addr.sa_data, priv->curbssparams.bssid, ETH_ALEN);
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index cdf5934aaf8b..f9bdd123ec45 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -489,19 +489,9 @@ void lbs_host_to_card_done(struct lbs_private *priv)
489 priv->dnld_sent = DNLD_RES_RECEIVED; 489 priv->dnld_sent = DNLD_RES_RECEIVED;
490 490
491 /* Wake main thread if commands are pending */ 491 /* Wake main thread if commands are pending */
492 if (!priv->cur_cmd) 492 if (!priv->cur_cmd || priv->tx_pending_len > 0)
493 wake_up_interruptible(&priv->waitq); 493 wake_up_interruptible(&priv->waitq);
494 494
495 /* Don't wake netif queues if we're in monitor mode and
496 a TX packet is already pending, or if there are commands
497 queued to be sent. */
498 if (!priv->currenttxskb && list_empty(&priv->cmdpendingq)) {
499 if (priv->dev && priv->connect_status == LBS_CONNECTED)
500 netif_wake_queue(priv->dev);
501
502 if (priv->mesh_dev && priv->mesh_connect_status == LBS_CONNECTED)
503 netif_wake_queue(priv->mesh_dev);
504 }
505 spin_unlock_irqrestore(&priv->driver_lock, flags); 495 spin_unlock_irqrestore(&priv->driver_lock, flags);
506} 496}
507EXPORT_SYMBOL_GPL(lbs_host_to_card_done); 497EXPORT_SYMBOL_GPL(lbs_host_to_card_done);
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 92d84c72e2a9..9a61188b62e9 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -590,13 +590,13 @@ int lbs_scan_networks(struct lbs_private *priv,
590 netif_stop_queue(priv->dev); 590 netif_stop_queue(priv->dev);
591 netif_carrier_off(priv->dev); 591 netif_carrier_off(priv->dev);
592 if (priv->mesh_dev) { 592 if (priv->mesh_dev) {
593 netif_stop_queue(priv->mesh_dev); 593 netif_stop_queue(priv->mesh_dev);
594 netif_carrier_off(priv->mesh_dev); 594 netif_carrier_off(priv->mesh_dev);
595 } 595 }
596 596
597 /* Prepare to continue an interrupted scan */ 597 /* Prepare to continue an interrupted scan */
598 lbs_deb_scan("chan_count %d, last_scanned_channel %d\n", 598 lbs_deb_scan("chan_count %d, last_scanned_channel %d\n",
599 chan_count, priv->last_scanned_channel); 599 chan_count, priv->last_scanned_channel);
600 curr_chans = chan_list; 600 curr_chans = chan_list;
601 /* advance channel list by already-scanned-channels */ 601 /* advance channel list by already-scanned-channels */
602 if (priv->last_scanned_channel > 0) { 602 if (priv->last_scanned_channel > 0) {
@@ -659,11 +659,13 @@ out2:
659out: 659out:
660 if (priv->connect_status == LBS_CONNECTED) { 660 if (priv->connect_status == LBS_CONNECTED) {
661 netif_carrier_on(priv->dev); 661 netif_carrier_on(priv->dev);
662 netif_wake_queue(priv->dev); 662 if (!priv->tx_pending_len)
663 netif_wake_queue(priv->dev);
663 } 664 }
664 if (priv->mesh_dev && (priv->mesh_connect_status == LBS_CONNECTED)) { 665 if (priv->mesh_dev && (priv->mesh_connect_status == LBS_CONNECTED)) {
665 netif_carrier_on(priv->mesh_dev); 666 netif_carrier_on(priv->mesh_dev);
666 netif_wake_queue(priv->mesh_dev); 667 if (!priv->tx_pending_len)
668 netif_wake_queue(priv->mesh_dev);
667 } 669 }
668 kfree(chan_list); 670 kfree(chan_list);
669 671