Commit 926f2730 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

drivers: net: use NETDEV_TX_OK instead of NETDEV_TX_LOCKED

These drivers already call netif_stop_queue() so we should not be called
unless tx space is available.  Just free the skb and return TX_OK.

Followup patch will remove NETDEV_TX_LOCKED from the kernel.

Cc: linux-parisc@vger.kernel.org
Cc: linux-hams@vger.kernel.org
Cc: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4acff371
...@@ -543,11 +543,13 @@ int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -543,11 +543,13 @@ int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
static int outs; static int outs;
unsigned long flags; unsigned long flags;
if (!TX_BUFFS_AVAIL)
return NETDEV_TX_LOCKED;
netif_stop_queue(dev); netif_stop_queue(dev);
if (!TX_BUFFS_AVAIL) {
dev_consume_skb_any(skb);
return NETDEV_TX_OK;
}
skblen = skb->len; skblen = skb->len;
#ifdef DEBUG_DRIVER #ifdef DEBUG_DRIVER
......
...@@ -547,10 +547,8 @@ static netdev_tx_t lance_start_xmit(struct sk_buff *skb, ...@@ -547,10 +547,8 @@ static netdev_tx_t lance_start_xmit(struct sk_buff *skb,
local_irq_save(flags); local_irq_save(flags);
if (!lance_tx_buffs_avail(lp)) { if (!lance_tx_buffs_avail(lp))
local_irq_restore(flags); goto out_free;
return NETDEV_TX_LOCKED;
}
#ifdef DEBUG #ifdef DEBUG
/* dump the packet */ /* dump the packet */
...@@ -573,6 +571,7 @@ static netdev_tx_t lance_start_xmit(struct sk_buff *skb, ...@@ -573,6 +571,7 @@ static netdev_tx_t lance_start_xmit(struct sk_buff *skb,
/* Kick the lance: transmit now */ /* Kick the lance: transmit now */
ll->rdp = LE_C0_INEA | LE_C0_TDMD; ll->rdp = LE_C0_INEA | LE_C0_TDMD;
out_free:
dev_kfree_skb(skb); dev_kfree_skb(skb);
local_irq_restore(flags); local_irq_restore(flags);
......
...@@ -1465,7 +1465,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) ...@@ -1465,7 +1465,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
if (!lp->tx_enable) /* Cannot send for now */ if (!lp->tx_enable) /* Cannot send for now */
return NETDEV_TX_LOCKED; goto tx_err;
/* /*
** Clean out the TX ring asynchronously to interrupts - sometimes the ** Clean out the TX ring asynchronously to interrupts - sometimes the
...@@ -1478,7 +1478,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) ...@@ -1478,7 +1478,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
/* Test if cache is already locked - requeue skb if so */ /* Test if cache is already locked - requeue skb if so */
if (test_and_set_bit(0, (void *)&lp->cache.lock) && !lp->interrupt) if (test_and_set_bit(0, (void *)&lp->cache.lock) && !lp->interrupt)
return NETDEV_TX_LOCKED; goto tx_err;
/* Transmit descriptor ring full or stale skb */ /* Transmit descriptor ring full or stale skb */
if (netif_queue_stopped(dev) || (u_long) lp->tx_skb[lp->tx_new] > 1) { if (netif_queue_stopped(dev) || (u_long) lp->tx_skb[lp->tx_new] > 1) {
...@@ -1519,6 +1519,9 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) ...@@ -1519,6 +1519,9 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
lp->cache.lock = 0; lp->cache.lock = 0;
return NETDEV_TX_OK; return NETDEV_TX_OK;
tx_err:
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
} }
/* /*
......
...@@ -780,8 +780,10 @@ static int baycom_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -780,8 +780,10 @@ static int baycom_send_packet(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb(skb); dev_kfree_skb(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
if (bc->skb) if (bc->skb) {
return NETDEV_TX_LOCKED; dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
/* strip KISS byte */ /* strip KISS byte */
if (skb->len >= HDLCDRV_MAXFLEN+1 || skb->len < 3) { if (skb->len >= HDLCDRV_MAXFLEN+1 || skb->len < 3) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
......
...@@ -412,8 +412,10 @@ static netdev_tx_t hdlcdrv_send_packet(struct sk_buff *skb, ...@@ -412,8 +412,10 @@ static netdev_tx_t hdlcdrv_send_packet(struct sk_buff *skb,
dev_kfree_skb(skb); dev_kfree_skb(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
if (sm->skb) if (sm->skb) {
return NETDEV_TX_LOCKED; dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
netif_stop_queue(dev); netif_stop_queue(dev);
sm->skb = skb; sm->skb = skb;
return NETDEV_TX_OK; return NETDEV_TX_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment