return strlen(buf);
adapter->monitormode = LBS_MONITOR_OFF;
lbs_remove_rtap(priv);
- netif_wake_queue(priv->dev);
- netif_wake_queue(priv->mesh_dev);
+
+ if (adapter->currenttxskb) {
+ dev_kfree_skb_any(adapter->currenttxskb);
+ adapter->currenttxskb = NULL;
+ }
+
+ /* Wake queues, command thread, etc. */
+ lbs_host_to_card_done(priv);
}
lbs_prepare_and_send_command(priv,
lbs_deb_enter(LBS_DEB_TX);
- if (priv->dnld_sent || priv->adapter->TxLockFlag) {
+ /* We could return NETDEV_TX_BUSY here, but I'd actually
+ like to get the point where we can BUG() */
+ if (priv->dnld_sent) {
+ lbs_pr_err("%s while dnld_sent\n", __func__);
+ priv->stats.tx_dropped++;
+ goto done;
+ }
+ if (priv->adapter->currenttxskb) {
+ lbs_pr_err("%s while TX skb pending\n", __func__);
priv->stats.tx_dropped++;
goto done;
}
if (!adapter->cur_cmd)
wake_up_interruptible(&priv->waitq);
+ /* Don't wake netif queues if we're in monitor mode and
+ a TX packet is already pending. */
+ if (priv->adapter->currenttxskb)
+ return;
+
if (priv->dev && adapter->connect_status == LBS_CONNECTED)
netif_wake_queue(priv->dev);
netif_stop_queue(priv->dev);
if (priv->mesh_dev)
netif_stop_queue(priv->mesh_dev);
- /* freeze any packets already in our queues */
- priv->adapter->TxLockFlag = 1;
+
+ /* Keep the skb around for when we get feedback */
+ priv->adapter->currenttxskb = skb;
} else {
dev_kfree_skb_any(skb);
- priv->adapter->currenttxskb = NULL;
}
lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret);
return ret;
}
- priv->adapter->currenttxskb = skb;
-
ret = SendSinglePacket(priv, skb);
done:
lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret);
(1 + adapter->txretrycount - try_count) : 0;
lbs_upload_rx_packet(priv, adapter->currenttxskb);
adapter->currenttxskb = NULL;
- priv->adapter->TxLockFlag = 0;
if (adapter->connect_status == LBS_CONNECTED)
netif_wake_queue(priv->dev);