aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/tx.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-09 12:37:27 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:06:22 -0500
commit2abdc0b7756ece70b1f0fd65a651bf8ce487a223 (patch)
tree02f4e118f0e7eaa8ee05dbcdfa6ec7f4cffb1263 /drivers/net/wireless/libertas/tx.c
parent020bb19e2f8cfebb314b8bce4bc48a511c6f5940 (diff)
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 <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/tx.c')
-rw-r--r--drivers/net/wireless/libertas/tx.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
index 4cb39d33003c..749535e3f770 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -164,41 +164,6 @@ done:
164} 164}
165 165
166 166
167void lbs_tx_runqueue(struct lbs_private *priv)
168{
169 int i;
170
171 spin_lock(&priv->txqueue_lock);
172 for (i = 0; i < priv->tx_queue_idx; i++) {
173 struct sk_buff *skb = priv->tx_queue_ps[i];
174 spin_unlock(&priv->txqueue_lock);
175 SendSinglePacket(priv, skb);
176 spin_lock(&priv->txqueue_lock);
177 }
178 priv->tx_queue_idx = 0;
179 spin_unlock(&priv->txqueue_lock);
180}
181
182static void lbs_tx_queue(struct lbs_private *priv, struct sk_buff *skb)
183{
184
185 spin_lock(&priv->txqueue_lock);
186
187 WARN_ON(priv->tx_queue_idx >= NR_TX_QUEUE);
188 priv->tx_queue_ps[priv->tx_queue_idx++] = skb;
189 if (priv->tx_queue_idx == NR_TX_QUEUE) {
190 netif_stop_queue(priv->dev);
191 if (priv->mesh_dev)
192 netif_stop_queue(priv->mesh_dev);
193 } else {
194 netif_start_queue(priv->dev);
195 if (priv->mesh_dev)
196 netif_start_queue(priv->mesh_dev);
197 }
198
199 spin_unlock(&priv->txqueue_lock);
200}
201
202/** 167/**
203 * @brief This function checks the conditions and sends packet to IF 168 * @brief This function checks the conditions and sends packet to IF
204 * layer if everything is ok. 169 * layer if everything is ok.
@@ -221,8 +186,9 @@ int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
221 186
222 if ((priv->psstate == PS_STATE_SLEEP) || 187 if ((priv->psstate == PS_STATE_SLEEP) ||
223 (priv->psstate == PS_STATE_PRE_SLEEP)) { 188 (priv->psstate == PS_STATE_PRE_SLEEP)) {
224 lbs_tx_queue(priv, skb); 189 lbs_pr_alert("TX error: packet xmit in %ssleep mode\n",
225 return ret; 190 priv->psstate == PS_STATE_SLEEP?"":"pre-");
191 goto done;
226 } 192 }
227 193
228 ret = SendSinglePacket(priv, skb); 194 ret = SendSinglePacket(priv, skb);