Commit 1a6afe8a authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

clip: convert to internal network_device_stats

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0ba25ff4
...@@ -50,7 +50,6 @@ struct atmarp_entry { ...@@ -50,7 +50,6 @@ struct atmarp_entry {
struct clip_priv { struct clip_priv {
int number; /* for convenience ... */ int number; /* for convenience ... */
spinlock_t xoff_lock; /* ensures that pop is atomic (SMP) */ spinlock_t xoff_lock; /* ensures that pop is atomic (SMP) */
struct net_device_stats stats;
struct net_device *next; /* next CLIP interface */ struct net_device *next; /* next CLIP interface */
}; };
......
...@@ -214,15 +214,15 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb) ...@@ -214,15 +214,15 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb)
skb->protocol = ((__be16 *) skb->data)[3]; skb->protocol = ((__be16 *) skb->data)[3];
skb_pull(skb, RFC1483LLC_LEN); skb_pull(skb, RFC1483LLC_LEN);
if (skb->protocol == htons(ETH_P_ARP)) { if (skb->protocol == htons(ETH_P_ARP)) {
PRIV(skb->dev)->stats.rx_packets++; skb->dev->stats.rx_packets++;
PRIV(skb->dev)->stats.rx_bytes += skb->len; skb->dev->stats.rx_bytes += skb->len;
clip_arp_rcv(skb); clip_arp_rcv(skb);
return; return;
} }
} }
clip_vcc->last_use = jiffies; clip_vcc->last_use = jiffies;
PRIV(skb->dev)->stats.rx_packets++; skb->dev->stats.rx_packets++;
PRIV(skb->dev)->stats.rx_bytes += skb->len; skb->dev->stats.rx_bytes += skb->len;
memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data)); memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data));
netif_rx(skb); netif_rx(skb);
} }
...@@ -372,7 +372,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -372,7 +372,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (!skb->dst) { if (!skb->dst) {
printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n"); printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n");
dev_kfree_skb(skb); dev_kfree_skb(skb);
clip_priv->stats.tx_dropped++; dev->stats.tx_dropped++;
return 0; return 0;
} }
if (!skb->dst->neighbour) { if (!skb->dst->neighbour) {
...@@ -380,13 +380,13 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -380,13 +380,13 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb->dst->neighbour = clip_find_neighbour(skb->dst, 1); skb->dst->neighbour = clip_find_neighbour(skb->dst, 1);
if (!skb->dst->neighbour) { if (!skb->dst->neighbour) {
dev_kfree_skb(skb); /* lost that one */ dev_kfree_skb(skb); /* lost that one */
clip_priv->stats.tx_dropped++; dev->stats.tx_dropped++;
return 0; return 0;
} }
#endif #endif
printk(KERN_ERR "clip_start_xmit: NO NEIGHBOUR !\n"); printk(KERN_ERR "clip_start_xmit: NO NEIGHBOUR !\n");
dev_kfree_skb(skb); dev_kfree_skb(skb);
clip_priv->stats.tx_dropped++; dev->stats.tx_dropped++;
return 0; return 0;
} }
entry = NEIGH2ENTRY(skb->dst->neighbour); entry = NEIGH2ENTRY(skb->dst->neighbour);
...@@ -400,7 +400,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -400,7 +400,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb_queue_tail(&entry->neigh->arp_queue, skb); skb_queue_tail(&entry->neigh->arp_queue, skb);
else { else {
dev_kfree_skb(skb); dev_kfree_skb(skb);
clip_priv->stats.tx_dropped++; dev->stats.tx_dropped++;
} }
return 0; return 0;
} }
...@@ -423,8 +423,8 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -423,8 +423,8 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n"); printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n");
return 0; return 0;
} }
clip_priv->stats.tx_packets++; dev->stats.tx_packets++;
clip_priv->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
vcc->send(vcc, skb); vcc->send(vcc, skb);
if (atm_may_send(vcc, 0)) { if (atm_may_send(vcc, 0)) {
entry->vccs->xoff = 0; entry->vccs->xoff = 0;
...@@ -443,11 +443,6 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -443,11 +443,6 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0; return 0;
} }
static struct net_device_stats *clip_get_stats(struct net_device *dev)
{
return &PRIV(dev)->stats;
}
static int clip_mkip(struct atm_vcc *vcc, int timeout) static int clip_mkip(struct atm_vcc *vcc, int timeout)
{ {
struct clip_vcc *clip_vcc; struct clip_vcc *clip_vcc;
...@@ -501,8 +496,8 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout) ...@@ -501,8 +496,8 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout)
skb_get(skb); skb_get(skb);
clip_push(vcc, skb); clip_push(vcc, skb);
PRIV(skb->dev)->stats.rx_packets--; skb->dev->stats.rx_packets--;
PRIV(skb->dev)->stats.rx_bytes -= len; skb->dev->stats.rx_bytes -= len;
kfree_skb(skb); kfree_skb(skb);
} }
...@@ -561,7 +556,6 @@ static void clip_setup(struct net_device *dev) ...@@ -561,7 +556,6 @@ static void clip_setup(struct net_device *dev)
{ {
dev->hard_start_xmit = clip_start_xmit; dev->hard_start_xmit = clip_start_xmit;
/* sg_xmit ... */ /* sg_xmit ... */
dev->get_stats = clip_get_stats;
dev->type = ARPHRD_ATM; dev->type = ARPHRD_ATM;
dev->hard_header_len = RFC1483LLC_LEN; dev->hard_header_len = RFC1483LLC_LEN;
dev->mtu = RFC1626_MTU; dev->mtu = RFC1626_MTU;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment