Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clip: convert to internal network_device_stats

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

authored by

Stephen Hemminger and committed by
David S. Miller
1a6afe8a 0ba25ff4

+12 -19
-1
include/net/atmclip.h
··· 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
+12 -18
net/atm/clip.c
··· 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 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) { ··· 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 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 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; ··· 441 441 changes, use netif_wake_queue instead. */ 442 442 spin_unlock_irqrestore(&clip_priv->xoff_lock, flags); 443 443 return 0; 444 - } 445 - 446 - static struct net_device_stats *clip_get_stats(struct net_device *dev) 447 - { 448 - return &PRIV(dev)->stats; 449 444 } 450 445 451 446 static int clip_mkip(struct atm_vcc *vcc, int timeout) ··· 496 501 497 502 skb_get(skb); 498 503 clip_push(vcc, skb); 499 - PRIV(skb->dev)->stats.rx_packets--; 500 - PRIV(skb->dev)->stats.rx_bytes -= len; 504 + skb->dev->stats.rx_packets--; 505 + skb->dev->stats.rx_bytes -= len; 501 506 kfree_skb(skb); 502 507 } 503 508 ··· 556 561 { 557 562 dev->hard_start_xmit = clip_start_xmit; 558 563 /* sg_xmit ... */ 559 - dev->get_stats = clip_get_stats; 560 564 dev->type = ARPHRD_ATM; 561 565 dev->hard_header_len = RFC1483LLC_LEN; 562 566 dev->mtu = RFC1626_MTU;