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

lapbether: 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 d9b06c47
...@@ -55,7 +55,6 @@ struct lapbethdev { ...@@ -55,7 +55,6 @@ struct lapbethdev {
struct list_head node; struct list_head node;
struct net_device *ethdev; /* link to ethernet device */ struct net_device *ethdev; /* link to ethernet device */
struct net_device *axdev; /* lapbeth device (lapb#) */ struct net_device *axdev; /* lapbeth device (lapb#) */
struct net_device_stats stats; /* some statistics */
}; };
static LIST_HEAD(lapbeth_devices); static LIST_HEAD(lapbeth_devices);
...@@ -107,10 +106,9 @@ static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packe ...@@ -107,10 +106,9 @@ static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
if (!netif_running(lapbeth->axdev)) if (!netif_running(lapbeth->axdev))
goto drop_unlock; goto drop_unlock;
lapbeth->stats.rx_packets++;
len = skb->data[0] + skb->data[1] * 256; len = skb->data[0] + skb->data[1] * 256;
lapbeth->stats.rx_bytes += len; dev->stats.rx_packets++;
dev->stats.rx_bytes += len;
skb_pull(skb, 2); /* Remove the length bytes */ skb_pull(skb, 2); /* Remove the length bytes */
skb_trim(skb, len); /* Set the length of the data */ skb_trim(skb, len); /* Set the length of the data */
...@@ -210,8 +208,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) ...@@ -210,8 +208,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb)
*ptr++ = size % 256; *ptr++ = size % 256;
*ptr++ = size / 256; *ptr++ = size / 256;
lapbeth->stats.tx_packets++; ndev->stats.tx_packets++;
lapbeth->stats.tx_bytes += size; ndev->stats.tx_bytes += size;
skb->dev = dev = lapbeth->ethdev; skb->dev = dev = lapbeth->ethdev;
...@@ -254,15 +252,6 @@ static void lapbeth_disconnected(struct net_device *dev, int reason) ...@@ -254,15 +252,6 @@ static void lapbeth_disconnected(struct net_device *dev, int reason)
netif_rx(skb); netif_rx(skb);
} }
/*
* Statistics
*/
static struct net_device_stats *lapbeth_get_stats(struct net_device *dev)
{
struct lapbethdev *lapbeth = netdev_priv(dev);
return &lapbeth->stats;
}
/* /*
* Set AX.25 callsign * Set AX.25 callsign
*/ */
...@@ -321,7 +310,6 @@ static void lapbeth_setup(struct net_device *dev) ...@@ -321,7 +310,6 @@ static void lapbeth_setup(struct net_device *dev)
dev->stop = lapbeth_close; dev->stop = lapbeth_close;
dev->destructor = free_netdev; dev->destructor = free_netdev;
dev->set_mac_address = lapbeth_set_mac_address; dev->set_mac_address = lapbeth_set_mac_address;
dev->get_stats = lapbeth_get_stats;
dev->type = ARPHRD_X25; dev->type = ARPHRD_X25;
dev->hard_header_len = 3; dev->hard_header_len = 3;
dev->mtu = 1000; dev->mtu = 1000;
......
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