aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/dlci.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-09-04 01:33:46 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-07 04:56:33 -0400
commit384824281caa9ac4b76664033416f1eac4a652fe (patch)
tree335ce38565014ba7cea4a7f096794a2d23e26c1f /drivers/net/wan/dlci.c
parent5877e55f32bb50956c9a1df8e7db3fbc67dc47b6 (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.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)