aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-20 15:36:17 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-22 01:38:00 -0400
commitea2ebaf822ad7cf9d2a1aa5f579be34c8c840202 (patch)
tree59c5116bd8a2be6dc020432e901f79fa252ffe0c /drivers/net/wan
parentd9b06c47a9eddef7d8829f6763bdf601c435c6f2 (diff)
lapbether: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/lapbether.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index f85ca1b27f9a..d0b8d0299de4 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -55,7 +55,6 @@ struct lapbethdev {
55 struct list_head node; 55 struct list_head node;
56 struct net_device *ethdev; /* link to ethernet device */ 56 struct net_device *ethdev; /* link to ethernet device */
57 struct net_device *axdev; /* lapbeth device (lapb#) */ 57 struct net_device *axdev; /* lapbeth device (lapb#) */
58 struct net_device_stats stats; /* some statistics */
59}; 58};
60 59
61static LIST_HEAD(lapbeth_devices); 60static LIST_HEAD(lapbeth_devices);
@@ -107,10 +106,9 @@ static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
107 if (!netif_running(lapbeth->axdev)) 106 if (!netif_running(lapbeth->axdev))
108 goto drop_unlock; 107 goto drop_unlock;
109 108
110 lapbeth->stats.rx_packets++;
111
112 len = skb->data[0] + skb->data[1] * 256; 109 len = skb->data[0] + skb->data[1] * 256;
113 lapbeth->stats.rx_bytes += len; 110 dev->stats.rx_packets++;
111 dev->stats.rx_bytes += len;
114 112
115 skb_pull(skb, 2); /* Remove the length bytes */ 113 skb_pull(skb, 2); /* Remove the length bytes */
116 skb_trim(skb, len); /* Set the length of the data */ 114 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 *ptr++ = size % 256; 208 *ptr++ = size % 256;
211 *ptr++ = size / 256; 209 *ptr++ = size / 256;
212 210
213 lapbeth->stats.tx_packets++; 211 ndev->stats.tx_packets++;
214 lapbeth->stats.tx_bytes += size; 212 ndev->stats.tx_bytes += size;
215 213
216 skb->dev = dev = lapbeth->ethdev; 214 skb->dev = dev = lapbeth->ethdev;
217 215
@@ -255,15 +253,6 @@ static void lapbeth_disconnected(struct net_device *dev, int reason)
255} 253}
256 254
257/* 255/*
258 * Statistics
259 */
260static struct net_device_stats *lapbeth_get_stats(struct net_device *dev)
261{
262 struct lapbethdev *lapbeth = netdev_priv(dev);
263 return &lapbeth->stats;
264}
265
266/*
267 * Set AX.25 callsign 256 * Set AX.25 callsign
268 */ 257 */
269static int lapbeth_set_mac_address(struct net_device *dev, void *addr) 258static int lapbeth_set_mac_address(struct net_device *dev, void *addr)
@@ -321,7 +310,6 @@ static void lapbeth_setup(struct net_device *dev)
321 dev->stop = lapbeth_close; 310 dev->stop = lapbeth_close;
322 dev->destructor = free_netdev; 311 dev->destructor = free_netdev;
323 dev->set_mac_address = lapbeth_set_mac_address; 312 dev->set_mac_address = lapbeth_set_mac_address;
324 dev->get_stats = lapbeth_get_stats;
325 dev->type = ARPHRD_X25; 313 dev->type = ARPHRD_X25;
326 dev->hard_header_len = 3; 314 dev->hard_header_len = 3;
327 dev->mtu = 1000; 315 dev->mtu = 1000;