aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/dlci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan/dlci.c')
-rw-r--r--drivers/net/wan/dlci.c43
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)
186 dev_kfree_skb(skb); 186 dev_kfree_skb(skb);
187} 187}
188 188
189static netdev_tx_t dlci_transmit(struct sk_buff *skb, 189static netdev_tx_t dlci_transmit(struct sk_buff *skb, struct net_device *dev)
190 struct net_device *dev)
191{ 190{
192 struct dlci_local *dlp; 191 struct dlci_local *dlp = netdev_priv(dev);
193 netdev_tx_t ret;
194
195 if (!skb || !dev)
196 return NETDEV_TX_OK;
197
198 dlp = netdev_priv(dev);
199
200 netif_stop_queue(dev);
201
202 /* This is hackish, overloads driver specific return values
203 on top of normal transmit return! */
204 ret = dlp->slave->netdev_ops->ndo_start_xmit(skb, dlp->slave);
205 switch (ret)
206 {
207 case DLCI_RET_OK:
208 dev->stats.tx_packets++;
209 ret = NETDEV_TX_OK;
210 break;
211 case DLCI_RET_ERR:
212 dev->stats.tx_errors++;
213 ret = NETDEV_TX_OK;
214 break;
215 case DLCI_RET_DROP:
216 dev->stats.tx_dropped++;
217 ret = NETDEV_TX_BUSY;
218 break;
219 }
220 /* Alan Cox recommends always returning 0, and always freeing the packet */
221 /* experience suggest a slightly more conservative approach */
222 192
223 if (ret == NETDEV_TX_OK) 193 if (skb)
224 { 194 dlp->slave->netdev_ops->ndo_start_xmit(skb, dlp->slave);
225 dev_kfree_skb(skb); 195 return NETDEV_TX_OK;
226 netif_wake_queue(dev);
227 }
228 return(ret);
229} 196}
230 197
231static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, int get) 198static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, int get)