From patchwork Sat Mar 21 05:36:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 24812 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id B6B40DDED1 for ; Sat, 21 Mar 2009 16:49:47 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761379AbZCUFtX (ORCPT ); Sat, 21 Mar 2009 01:49:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761132AbZCUFtT (ORCPT ); Sat, 21 Mar 2009 01:49:19 -0400 Received: from suva.vyatta.com ([76.74.103.44]:36657 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760813AbZCUFsT (ORCPT ); Sat, 21 Mar 2009 01:48:19 -0400 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id n2L5mGhb027246; Fri, 20 Mar 2009 22:48:16 -0700 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id n2L5mGON027245; Fri, 20 Mar 2009 22:48:16 -0700 Message-Id: <20090321053716.346826057@vyatta.com> References: <20090321053527.316395697@vyatta.com> User-Agent: quilt/0.46-1 Date: Fri, 20 Mar 2009 22:36:17 -0700 From: Stephen Hemminger To: David Miller Cc: netdev@vger.kernel.org Subject: [PATCH 50/77] lapbether: convert to internal net_device_stats Content-Disposition: inline; filename=lapbether-stats.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Stephen Hemminger --- a/drivers/net/wan/lapbether.c 2009-03-20 21:45:41.177964217 -0700 +++ b/drivers/net/wan/lapbether.c 2009-03-20 22:04:49.754653610 -0700 @@ -55,7 +55,6 @@ struct lapbethdev { struct list_head node; struct net_device *ethdev; /* link to ethernet device */ struct net_device *axdev; /* lapbeth device (lapb#) */ - struct net_device_stats stats; /* some statistics */ }; static LIST_HEAD(lapbeth_devices); @@ -107,10 +106,9 @@ static int lapbeth_rcv(struct sk_buff *s if (!netif_running(lapbeth->axdev)) goto drop_unlock; - lapbeth->stats.rx_packets++; - 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_trim(skb, len); /* Set the length of the data */ @@ -210,8 +208,8 @@ static void lapbeth_data_transmit(struct *ptr++ = size % 256; *ptr++ = size / 256; - lapbeth->stats.tx_packets++; - lapbeth->stats.tx_bytes += size; + ndev->stats.tx_packets++; + ndev->stats.tx_bytes += size; skb->dev = dev = lapbeth->ethdev; @@ -255,15 +253,6 @@ static void lapbeth_disconnected(struct } /* - * 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 */ static int lapbeth_set_mac_address(struct net_device *dev, void *addr) @@ -321,7 +310,6 @@ static void lapbeth_setup(struct net_dev dev->stop = lapbeth_close; dev->destructor = free_netdev; dev->set_mac_address = lapbeth_set_mac_address; - dev->get_stats = lapbeth_get_stats; dev->type = ARPHRD_X25; dev->hard_header_len = 3; dev->mtu = 1000;