Commit 1a6afe8a733a3edaa1816c10ec2a7353ae0ff47b

Authored by Stephen Hemminger
Committed by David S. Miller
1 parent 0ba25ff4c6

clip: convert to internal network_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 2 changed files with 12 additions and 19 deletions Side-by-side Diff

include/net/atmclip.h
... ... @@ -50,7 +50,6 @@
50 50 struct clip_priv {
51 51 int number; /* for convenience ... */
52 52 spinlock_t xoff_lock; /* ensures that pop is atomic (SMP) */
53   - struct net_device_stats stats;
54 53 struct net_device *next; /* next CLIP interface */
55 54 };
56 55  
... ... @@ -214,15 +214,15 @@
214 214 skb->protocol = ((__be16 *) skb->data)[3];
215 215 skb_pull(skb, RFC1483LLC_LEN);
216 216 if (skb->protocol == htons(ETH_P_ARP)) {
217   - PRIV(skb->dev)->stats.rx_packets++;
218   - PRIV(skb->dev)->stats.rx_bytes += skb->len;
  217 + skb->dev->stats.rx_packets++;
  218 + skb->dev->stats.rx_bytes += skb->len;
219 219 clip_arp_rcv(skb);
220 220 return;
221 221 }
222 222 }
223 223 clip_vcc->last_use = jiffies;
224   - PRIV(skb->dev)->stats.rx_packets++;
225   - PRIV(skb->dev)->stats.rx_bytes += skb->len;
  224 + skb->dev->stats.rx_packets++;
  225 + skb->dev->stats.rx_bytes += skb->len;
226 226 memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data));
227 227 netif_rx(skb);
228 228 }
... ... @@ -372,7 +372,7 @@
372 372 if (!skb->dst) {
373 373 printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n");
374 374 dev_kfree_skb(skb);
375   - clip_priv->stats.tx_dropped++;
  375 + dev->stats.tx_dropped++;
376 376 return 0;
377 377 }
378 378 if (!skb->dst->neighbour) {
379 379  
... ... @@ -380,13 +380,13 @@
380 380 skb->dst->neighbour = clip_find_neighbour(skb->dst, 1);
381 381 if (!skb->dst->neighbour) {
382 382 dev_kfree_skb(skb); /* lost that one */
383   - clip_priv->stats.tx_dropped++;
  383 + dev->stats.tx_dropped++;
384 384 return 0;
385 385 }
386 386 #endif
387 387 printk(KERN_ERR "clip_start_xmit: NO NEIGHBOUR !\n");
388 388 dev_kfree_skb(skb);
389   - clip_priv->stats.tx_dropped++;
  389 + dev->stats.tx_dropped++;
390 390 return 0;
391 391 }
392 392 entry = NEIGH2ENTRY(skb->dst->neighbour);
... ... @@ -400,7 +400,7 @@
400 400 skb_queue_tail(&entry->neigh->arp_queue, skb);
401 401 else {
402 402 dev_kfree_skb(skb);
403   - clip_priv->stats.tx_dropped++;
  403 + dev->stats.tx_dropped++;
404 404 }
405 405 return 0;
406 406 }
... ... @@ -423,8 +423,8 @@
423 423 printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n");
424 424 return 0;
425 425 }
426   - clip_priv->stats.tx_packets++;
427   - clip_priv->stats.tx_bytes += skb->len;
  426 + dev->stats.tx_packets++;
  427 + dev->stats.tx_bytes += skb->len;
428 428 vcc->send(vcc, skb);
429 429 if (atm_may_send(vcc, 0)) {
430 430 entry->vccs->xoff = 0;
... ... @@ -443,11 +443,6 @@
443 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 446 static int clip_mkip(struct atm_vcc *vcc, int timeout)
452 447 {
453 448 struct clip_vcc *clip_vcc;
... ... @@ -501,8 +496,8 @@
501 496  
502 497 skb_get(skb);
503 498 clip_push(vcc, skb);
504   - PRIV(skb->dev)->stats.rx_packets--;
505   - PRIV(skb->dev)->stats.rx_bytes -= len;
  499 + skb->dev->stats.rx_packets--;
  500 + skb->dev->stats.rx_bytes -= len;
506 501 kfree_skb(skb);
507 502 }
508 503  
... ... @@ -561,7 +556,6 @@
561 556 {
562 557 dev->hard_start_xmit = clip_start_xmit;
563 558 /* sg_xmit ... */
564   - dev->get_stats = clip_get_stats;
565 559 dev->type = ARPHRD_ATM;
566 560 dev->hard_header_len = RFC1483LLC_LEN;
567 561 dev->mtu = RFC1626_MTU;