aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wan/dlci.c43
-rw-r--r--drivers/net/wan/sdla.c8
2 files changed, 9 insertions, 42 deletions
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 69d269d32b5..15d353f268b 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)
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index 63c76458431..2b15a7e40d5 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -652,7 +652,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
/* NOTE: the DLCI driver deals with freeing the SKB!! */
static netdev_tx_t sdla_transmit(struct sk_buff *skb,
- struct net_device *dev)
+ struct net_device *dev)
{
struct frad_local *flp;
int ret, addr, accept, i;
@@ -712,23 +712,21 @@ static netdev_tx_t sdla_transmit(struct sk_buff *skb,
}
break;
}
+
switch (ret)
{
case SDLA_RET_OK:
dev->stats.tx_packets++;
- ret = DLCI_RET_OK;
break;
case SDLA_RET_CIR_OVERFLOW:
case SDLA_RET_BUF_OVERSIZE:
case SDLA_RET_NO_BUFS:
dev->stats.tx_dropped++;
- ret = DLCI_RET_DROP;
break;
default:
dev->stats.tx_errors++;
- ret = DLCI_RET_ERR;
break;
}
}
@@ -738,6 +736,8 @@ static netdev_tx_t sdla_transmit(struct sk_buff *skb,
if(flp->master[i]!=NULL)
netif_wake_queue(flp->master[i]);
}
+
+ dev_kfree_skb(skb);
return NETDEV_TX_OK;
}