Commit 07d117cf authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

dlci: convert to internal net_device_stats

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 48f26ad5
...@@ -114,7 +114,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) ...@@ -114,7 +114,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
if (!pskb_may_pull(skb, sizeof(*hdr))) { if (!pskb_may_pull(skb, sizeof(*hdr))) {
printk(KERN_NOTICE "%s: invalid data no header\n", printk(KERN_NOTICE "%s: invalid data no header\n",
dev->name); dev->name);
dlp->stats.rx_errors++; dev->stats.rx_errors++;
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
...@@ -127,7 +127,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) ...@@ -127,7 +127,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
if (hdr->control != FRAD_I_UI) if (hdr->control != FRAD_I_UI)
{ {
printk(KERN_NOTICE "%s: Invalid header flag 0x%02X.\n", dev->name, hdr->control); printk(KERN_NOTICE "%s: Invalid header flag 0x%02X.\n", dev->name, hdr->control);
dlp->stats.rx_errors++; dev->stats.rx_errors++;
} }
else else
switch(hdr->IP_NLPID) switch(hdr->IP_NLPID)
...@@ -136,14 +136,14 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) ...@@ -136,14 +136,14 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
if (hdr->NLPID != FRAD_P_SNAP) if (hdr->NLPID != FRAD_P_SNAP)
{ {
printk(KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n", dev->name, hdr->NLPID); printk(KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n", dev->name, hdr->NLPID);
dlp->stats.rx_errors++; dev->stats.rx_errors++;
break; break;
} }
if (hdr->OUI[0] + hdr->OUI[1] + hdr->OUI[2] != 0) if (hdr->OUI[0] + hdr->OUI[1] + hdr->OUI[2] != 0)
{ {
printk(KERN_NOTICE "%s: Unsupported organizationally unique identifier 0x%02X-%02X-%02X.\n", dev->name, hdr->OUI[0], hdr->OUI[1], hdr->OUI[2]); printk(KERN_NOTICE "%s: Unsupported organizationally unique identifier 0x%02X-%02X-%02X.\n", dev->name, hdr->OUI[0], hdr->OUI[1], hdr->OUI[2]);
dlp->stats.rx_errors++; dev->stats.rx_errors++;
break; break;
} }
...@@ -164,12 +164,12 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) ...@@ -164,12 +164,12 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
case FRAD_P_Q933: case FRAD_P_Q933:
case FRAD_P_CLNP: case FRAD_P_CLNP:
printk(KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n", dev->name, hdr->pad); printk(KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n", dev->name, hdr->pad);
dlp->stats.rx_errors++; dev->stats.rx_errors++;
break; break;
default: default:
printk(KERN_NOTICE "%s: Invalid pad byte 0x%02X.\n", dev->name, hdr->pad); printk(KERN_NOTICE "%s: Invalid pad byte 0x%02X.\n", dev->name, hdr->pad);
dlp->stats.rx_errors++; dev->stats.rx_errors++;
break; break;
} }
...@@ -178,9 +178,9 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) ...@@ -178,9 +178,9 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
/* we've set up the protocol, so discard the header */ /* we've set up the protocol, so discard the header */
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb_pull(skb, header); skb_pull(skb, header);
dlp->stats.rx_bytes += skb->len; dev->stats.rx_bytes += skb->len;
netif_rx(skb); netif_rx(skb);
dlp->stats.rx_packets++; dev->stats.rx_packets++;
} }
else else
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -204,15 +204,15 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev) ...@@ -204,15 +204,15 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev)
switch (ret) switch (ret)
{ {
case DLCI_RET_OK: case DLCI_RET_OK:
dlp->stats.tx_packets++; dev->stats.tx_packets++;
ret = 0; ret = 0;
break; break;
case DLCI_RET_ERR: case DLCI_RET_ERR:
dlp->stats.tx_errors++; dev->stats.tx_errors++;
ret = 0; ret = 0;
break; break;
case DLCI_RET_DROP: case DLCI_RET_DROP:
dlp->stats.tx_dropped++; dev->stats.tx_dropped++;
ret = 1; ret = 1;
break; break;
} }
...@@ -342,15 +342,6 @@ static int dlci_close(struct net_device *dev) ...@@ -342,15 +342,6 @@ static int dlci_close(struct net_device *dev)
return 0; return 0;
} }
static struct net_device_stats *dlci_get_stats(struct net_device *dev)
{
struct dlci_local *dlp;
dlp = netdev_priv(dev);
return(&dlp->stats);
}
static int dlci_add(struct dlci_add *dlci) static int dlci_add(struct dlci_add *dlci)
{ {
struct net_device *master, *slave; struct net_device *master, *slave;
...@@ -498,7 +489,6 @@ static void dlci_setup(struct net_device *dev) ...@@ -498,7 +489,6 @@ static void dlci_setup(struct net_device *dev)
dev->do_ioctl = dlci_dev_ioctl; dev->do_ioctl = dlci_dev_ioctl;
dev->hard_start_xmit = dlci_transmit; dev->hard_start_xmit = dlci_transmit;
dev->header_ops = &dlci_header_ops; dev->header_ops = &dlci_header_ops;
dev->get_stats = dlci_get_stats;
dev->change_mtu = dlci_change_mtu; dev->change_mtu = dlci_change_mtu;
dev->destructor = free_netdev; dev->destructor = free_netdev;
......
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