Commit 4153e775 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

net: fix network drivers ndo_start_xmit() return values (part 3)

net: fix network drivers ndo_start_xmit() return values (part 3)

Fix up wireless drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning an requeue/retransmit the skb.

- airo: transmission not implemented for chip, intention is to free and abort
- ipw2200: transmission not implemented for promiscous mode, intention is to
           drop
- prism54: intention is to drop
- wl3501_cs: intention appears to be to drop
- zd1201: error counter indicates intention is to drop

All drivers compile tested.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4bd73ae2
...@@ -2193,7 +2193,8 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) { ...@@ -2193,7 +2193,8 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) {
if (test_bit(FLAG_MPI, &priv->flags)) { if (test_bit(FLAG_MPI, &priv->flags)) {
/* Not implemented yet for MPI350 */ /* Not implemented yet for MPI350 */
netif_stop_queue(dev); netif_stop_queue(dev);
return -ENETDOWN; dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
} }
if ( skb == NULL ) { if ( skb == NULL ) {
......
...@@ -11524,7 +11524,8 @@ static int ipw_prom_stop(struct net_device *dev) ...@@ -11524,7 +11524,8 @@ static int ipw_prom_stop(struct net_device *dev)
static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
IPW_DEBUG_INFO("prom dev->xmit\n"); IPW_DEBUG_INFO("prom dev->xmit\n");
return -EOPNOTSUPP; dev_kfree_skb(skb);
return NETDEV_TX_OK;
} }
static const struct net_device_ops ipw_prom_netdev_ops = { static const struct net_device_ops ipw_prom_netdev_ops = {
......
...@@ -87,7 +87,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -87,7 +87,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
unsigned long flags; unsigned long flags;
unsigned char wds_mac[6]; unsigned char wds_mac[6];
u32 curr_frag; u32 curr_frag;
int err = 0;
#if VERBOSE > SHOW_ERROR_MESSAGES #if VERBOSE > SHOW_ERROR_MESSAGES
DEBUG(SHOW_FUNCTION_CALLS, "islpci_eth_transmit \n"); DEBUG(SHOW_FUNCTION_CALLS, "islpci_eth_transmit \n");
...@@ -107,8 +106,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -107,8 +106,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
isl38xx_w32_flush(priv->device_base, ISL38XX_DEV_INT_UPDATE, isl38xx_w32_flush(priv->device_base, ISL38XX_DEV_INT_UPDATE,
ISL38XX_DEV_INT_REG); ISL38XX_DEV_INT_REG);
udelay(ISL38XX_WRITEIO_DELAY); udelay(ISL38XX_WRITEIO_DELAY);
err = -EBUSY;
goto drop_free; goto drop_free;
} }
/* Check alignment and WDS frame formatting. The start of the packet should /* Check alignment and WDS frame formatting. The start of the packet should
...@@ -152,7 +149,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -152,7 +149,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
if (unlikely(newskb == NULL)) { if (unlikely(newskb == NULL)) {
printk(KERN_ERR "%s: Cannot allocate skb\n", printk(KERN_ERR "%s: Cannot allocate skb\n",
ndev->name); ndev->name);
err = -ENOMEM;
goto drop_free; goto drop_free;
} }
newskb_offset = (4 - (long) newskb->data) & 0x03; newskb_offset = (4 - (long) newskb->data) & 0x03;
...@@ -197,8 +193,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -197,8 +193,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
if (unlikely(pci_map_address == 0)) { if (unlikely(pci_map_address == 0)) {
printk(KERN_WARNING "%s: cannot map buffer to PCI\n", printk(KERN_WARNING "%s: cannot map buffer to PCI\n",
ndev->name); ndev->name);
err = -EIO;
goto drop_free; goto drop_free;
} }
/* Place the fragment in the control block structure. */ /* Place the fragment in the control block structure. */
...@@ -246,7 +240,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -246,7 +240,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
ndev->stats.tx_dropped++; ndev->stats.tx_dropped++;
spin_unlock_irqrestore(&priv->slock, flags); spin_unlock_irqrestore(&priv->slock, flags);
dev_kfree_skb(skb); dev_kfree_skb(skb);
return err; return NETDEV_TX_OK;
} }
static inline int static inline int
......
...@@ -1348,6 +1348,7 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1348,6 +1348,7 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (rc) { if (rc) {
++dev->stats.tx_dropped; ++dev->stats.tx_dropped;
netif_stop_queue(dev); netif_stop_queue(dev);
rc = NETDEV_TX_OK;
} else { } else {
++dev->stats.tx_packets; ++dev->stats.tx_packets;
dev->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
......
...@@ -819,11 +819,11 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -819,11 +819,11 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (err) { if (err) {
dev->stats.tx_errors++; dev->stats.tx_errors++;
netif_start_queue(dev); netif_start_queue(dev);
return err; } else {
dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;
dev->trans_start = jiffies;
} }
dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;
dev->trans_start = jiffies;
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
......
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