diff options
author | Stephen Hemminger | 2009-09-04 05:33:46 +0000 |
---|---|---|
committer | David S. Miller | 2009-09-07 01:56:33 -0700 |
commit | 384824281caa9ac4b76664033416f1eac4a652fe (patch) | |
tree | 335ce38565014ba7cea4a7f096794a2d23e26c1f /drivers/net/wan/dlci.c | |
parent | 5877e55f32bb50956c9a1df8e7db3fbc67dc47b6 (diff) |
wan: dlci/sdla transmit return dehacking
This is a brute force removal of the wierd slave interface done for
DLCI -> SDLA transmit. Before it was using non-standard return values
and freeing skb in caller. This changes it to using normal return
values, and freeing in the callee. Luckly only one driver pair was
doing this. Not tested on real hardware, in fact I wonder if this
driver pair is even being used by any users.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/dlci.c')
-rw-r--r-- | drivers/net/wan/dlci.c | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index 69d269d32b5b..15d353f268b5 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c @@ -186,46 +186,13 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) dev_kfree_skb(skb); } -static netdev_tx_t dlci_transmit(struct sk_buff *skb, - struct net_device *dev) +static netdev_tx_t dlci_transmit(struct sk_buff *skb, struct net_device *dev) { - struct dlci_local *dlp; - netdev_tx_t ret; - - if (!skb || !dev) - return NETDEV_TX_OK; - - dlp = netdev_priv(dev); - - netif_stop_queue(dev); - - /* This is hackish, overloads driver specific return values - on top of normal transmit return! */ - ret = dlp->slave->netdev_ops->ndo_start_xmit(skb, dlp->slave); - switch (ret) - { - case DLCI_RET_OK: - dev->stats.tx_packets++; - ret = NETDEV_TX_OK; - break; - case DLCI_RET_ERR: - dev->stats.tx_errors++; - ret = NETDEV_TX_OK; - break; - case DLCI_RET_DROP: - dev->stats.tx_dropped++; - ret = NETDEV_TX_BUSY; - break; - } - /* Alan Cox recommends always returning 0, and always freeing the packet */ - /* experience suggest a slightly more conservative approach */ + struct dlci_local *dlp = netdev_priv(dev); - if (ret == NETDEV_TX_OK) - { - dev_kfree_skb(skb); - netif_wake_queue(dev); - } - return(ret); + if (skb) + dlp->slave->netdev_ops->ndo_start_xmit(skb, dlp->slave); + return NETDEV_TX_OK; } static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, int get) |