diff options
Diffstat (limited to 'net/atm/clip.c')
-rw-r--r-- | net/atm/clip.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/net/atm/clip.c b/net/atm/clip.c index 2d33a83be799..3dc0a3a42a57 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -214,15 +214,15 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb) | |||
214 | skb->protocol = ((__be16 *) skb->data)[3]; | 214 | skb->protocol = ((__be16 *) skb->data)[3]; |
215 | skb_pull(skb, RFC1483LLC_LEN); | 215 | skb_pull(skb, RFC1483LLC_LEN); |
216 | if (skb->protocol == htons(ETH_P_ARP)) { | 216 | if (skb->protocol == htons(ETH_P_ARP)) { |
217 | PRIV(skb->dev)->stats.rx_packets++; | 217 | skb->dev->stats.rx_packets++; |
218 | PRIV(skb->dev)->stats.rx_bytes += skb->len; | 218 | skb->dev->stats.rx_bytes += skb->len; |
219 | clip_arp_rcv(skb); | 219 | clip_arp_rcv(skb); |
220 | return; | 220 | return; |
221 | } | 221 | } |
222 | } | 222 | } |
223 | clip_vcc->last_use = jiffies; | 223 | clip_vcc->last_use = jiffies; |
224 | PRIV(skb->dev)->stats.rx_packets++; | 224 | skb->dev->stats.rx_packets++; |
225 | PRIV(skb->dev)->stats.rx_bytes += skb->len; | 225 | skb->dev->stats.rx_bytes += skb->len; |
226 | memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data)); | 226 | memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data)); |
227 | netif_rx(skb); | 227 | netif_rx(skb); |
228 | } | 228 | } |
@@ -372,7 +372,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
372 | if (!skb->dst) { | 372 | if (!skb->dst) { |
373 | printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n"); | 373 | printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n"); |
374 | dev_kfree_skb(skb); | 374 | dev_kfree_skb(skb); |
375 | clip_priv->stats.tx_dropped++; | 375 | dev->stats.tx_dropped++; |
376 | return 0; | 376 | return 0; |
377 | } | 377 | } |
378 | if (!skb->dst->neighbour) { | 378 | if (!skb->dst->neighbour) { |
@@ -380,13 +380,13 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
380 | skb->dst->neighbour = clip_find_neighbour(skb->dst, 1); | 380 | skb->dst->neighbour = clip_find_neighbour(skb->dst, 1); |
381 | if (!skb->dst->neighbour) { | 381 | if (!skb->dst->neighbour) { |
382 | dev_kfree_skb(skb); /* lost that one */ | 382 | dev_kfree_skb(skb); /* lost that one */ |
383 | clip_priv->stats.tx_dropped++; | 383 | dev->stats.tx_dropped++; |
384 | return 0; | 384 | return 0; |
385 | } | 385 | } |
386 | #endif | 386 | #endif |
387 | printk(KERN_ERR "clip_start_xmit: NO NEIGHBOUR !\n"); | 387 | printk(KERN_ERR "clip_start_xmit: NO NEIGHBOUR !\n"); |
388 | dev_kfree_skb(skb); | 388 | dev_kfree_skb(skb); |
389 | clip_priv->stats.tx_dropped++; | 389 | dev->stats.tx_dropped++; |
390 | return 0; | 390 | return 0; |
391 | } | 391 | } |
392 | entry = NEIGH2ENTRY(skb->dst->neighbour); | 392 | entry = NEIGH2ENTRY(skb->dst->neighbour); |
@@ -400,7 +400,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
400 | skb_queue_tail(&entry->neigh->arp_queue, skb); | 400 | skb_queue_tail(&entry->neigh->arp_queue, skb); |
401 | else { | 401 | else { |
402 | dev_kfree_skb(skb); | 402 | dev_kfree_skb(skb); |
403 | clip_priv->stats.tx_dropped++; | 403 | dev->stats.tx_dropped++; |
404 | } | 404 | } |
405 | return 0; | 405 | return 0; |
406 | } | 406 | } |
@@ -423,8 +423,8 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
423 | printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n"); | 423 | printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n"); |
424 | return 0; | 424 | return 0; |
425 | } | 425 | } |
426 | clip_priv->stats.tx_packets++; | 426 | dev->stats.tx_packets++; |
427 | clip_priv->stats.tx_bytes += skb->len; | 427 | dev->stats.tx_bytes += skb->len; |
428 | vcc->send(vcc, skb); | 428 | vcc->send(vcc, skb); |
429 | if (atm_may_send(vcc, 0)) { | 429 | if (atm_may_send(vcc, 0)) { |
430 | entry->vccs->xoff = 0; | 430 | entry->vccs->xoff = 0; |
@@ -443,11 +443,6 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
443 | return 0; | 443 | return 0; |
444 | } | 444 | } |
445 | 445 | ||
446 | static struct net_device_stats *clip_get_stats(struct net_device *dev) | ||
447 | { | ||
448 | return &PRIV(dev)->stats; | ||
449 | } | ||
450 | |||
451 | static int clip_mkip(struct atm_vcc *vcc, int timeout) | 446 | static int clip_mkip(struct atm_vcc *vcc, int timeout) |
452 | { | 447 | { |
453 | struct clip_vcc *clip_vcc; | 448 | struct clip_vcc *clip_vcc; |
@@ -501,8 +496,8 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout) | |||
501 | 496 | ||
502 | skb_get(skb); | 497 | skb_get(skb); |
503 | clip_push(vcc, skb); | 498 | clip_push(vcc, skb); |
504 | PRIV(skb->dev)->stats.rx_packets--; | 499 | skb->dev->stats.rx_packets--; |
505 | PRIV(skb->dev)->stats.rx_bytes -= len; | 500 | skb->dev->stats.rx_bytes -= len; |
506 | kfree_skb(skb); | 501 | kfree_skb(skb); |
507 | } | 502 | } |
508 | 503 | ||
@@ -557,11 +552,13 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip) | |||
557 | return error; | 552 | return error; |
558 | } | 553 | } |
559 | 554 | ||
555 | static const struct net_device_ops clip_netdev_ops = { | ||
556 | .ndo_start_xmit = clip_start_xmit, | ||
557 | }; | ||
558 | |||
560 | static void clip_setup(struct net_device *dev) | 559 | static void clip_setup(struct net_device *dev) |
561 | { | 560 | { |
562 | dev->hard_start_xmit = clip_start_xmit; | 561 | dev->netdev_ops = &clip_netdev_ops; |
563 | /* sg_xmit ... */ | ||
564 | dev->get_stats = clip_get_stats; | ||
565 | dev->type = ARPHRD_ATM; | 562 | dev->type = ARPHRD_ATM; |
566 | dev->hard_header_len = RFC1483LLC_LEN; | 563 | dev->hard_header_len = RFC1483LLC_LEN; |
567 | dev->mtu = RFC1626_MTU; | 564 | dev->mtu = RFC1626_MTU; |
@@ -621,7 +618,7 @@ static int clip_device_event(struct notifier_block *this, unsigned long event, | |||
621 | } | 618 | } |
622 | 619 | ||
623 | /* ignore non-CLIP devices */ | 620 | /* ignore non-CLIP devices */ |
624 | if (dev->type != ARPHRD_ATM || dev->hard_start_xmit != clip_start_xmit) | 621 | if (dev->type != ARPHRD_ATM || dev->netdev_ops != &clip_netdev_ops) |
625 | return NOTIFY_DONE; | 622 | return NOTIFY_DONE; |
626 | 623 | ||
627 | switch (event) { | 624 | switch (event) { |