From 2abdc0b7756ece70b1f0fd65a651bf8ce487a223 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 9 Dec 2007 12:37:27 -0500 Subject: libertas: kill internal tx queue for PS mode It was buggy as hell anyway, since it was just spewing packets at the device when it wasn't necessarily ready for them (in the USB case, while the URB was still busy). We could probably do with a better way of flushing packets to the device _immediately_, before we stick it back into sleep mode. But we can no longer just dequeue packets directly, it seems. Signed-off-by: David Woodhouse Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/tx.c | 40 +++----------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) (limited to 'drivers/net/wireless/libertas/tx.c') diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c index 4cb39d33003..749535e3f77 100644 --- a/drivers/net/wireless/libertas/tx.c +++ b/drivers/net/wireless/libertas/tx.c @@ -164,41 +164,6 @@ done: } -void lbs_tx_runqueue(struct lbs_private *priv) -{ - int i; - - spin_lock(&priv->txqueue_lock); - for (i = 0; i < priv->tx_queue_idx; i++) { - struct sk_buff *skb = priv->tx_queue_ps[i]; - spin_unlock(&priv->txqueue_lock); - SendSinglePacket(priv, skb); - spin_lock(&priv->txqueue_lock); - } - priv->tx_queue_idx = 0; - spin_unlock(&priv->txqueue_lock); -} - -static void lbs_tx_queue(struct lbs_private *priv, struct sk_buff *skb) -{ - - spin_lock(&priv->txqueue_lock); - - WARN_ON(priv->tx_queue_idx >= NR_TX_QUEUE); - priv->tx_queue_ps[priv->tx_queue_idx++] = skb; - if (priv->tx_queue_idx == NR_TX_QUEUE) { - netif_stop_queue(priv->dev); - if (priv->mesh_dev) - netif_stop_queue(priv->mesh_dev); - } else { - netif_start_queue(priv->dev); - if (priv->mesh_dev) - netif_start_queue(priv->mesh_dev); - } - - spin_unlock(&priv->txqueue_lock); -} - /** * @brief This function checks the conditions and sends packet to IF * layer if everything is ok. @@ -221,8 +186,9 @@ int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb) if ((priv->psstate == PS_STATE_SLEEP) || (priv->psstate == PS_STATE_PRE_SLEEP)) { - lbs_tx_queue(priv, skb); - return ret; + lbs_pr_alert("TX error: packet xmit in %ssleep mode\n", + priv->psstate == PS_STATE_SLEEP?"":"pre-"); + goto done; } ret = SendSinglePacket(priv, skb); -- cgit v1.2.3