[PATCH] Retry frame transmission when libertas driver is busy.
Ashish Shukla
javier at cozybit.com
Fri Nov 2 15:54:35 EDT 2007
The driver silently discards frames when some command is pending -- returns
NETDEV_TX_OK to kernel. The following patch fixes this problem. This
significantly improves file transfers while scanning (ticket #3341).
Signed-off-by: Javier Cardona <javier at cozybit.com>
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 83d534b..f72ebe2 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -520,22 +520,25 @@ static int libertas_close(struct net_device *dev)
static int libertas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
- int ret = 0;
+ int ret = NETDEV_TX_OK;
wlan_private *priv = dev->priv;
lbs_deb_enter(LBS_DEB_NET);
- if (priv->dnld_sent || priv->adapter->TxLockFlag) {
- priv->stats.tx_dropped++;
- goto done;
- }
-
netif_stop_queue(priv->dev);
if (priv->mesh_dev)
netif_stop_queue(priv->mesh_dev);
- if (libertas_process_tx(priv, skb) == 0)
+ if (priv->dnld_sent || priv->adapter->TxLockFlag) {
+ ret = NETDEV_TX_BUSY;
+ goto done;
+ }
+
+ ret = libertas_process_tx(priv, skb);
+ if (ret == NETDEV_TX_OK)
dev->trans_start = jiffies;
+ else if (ret == -1)
+ ret = NETDEV_TX_OK;
done:
lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
return ret;
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
index bc9c2e1..1dc92ee 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -218,6 +218,7 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb)
if (priv->dnld_sent) {
lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n",
priv->dnld_sent);
+ ret = NETDEV_TX_BUSY;
goto done;
}
--
1.5.2.4
More information about the Devel
mailing list