From patchwork Thu Aug 20 08:46:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taku Izumi X-Patchwork-Id: 7042211 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 59363C05AC for ; Thu, 20 Aug 2015 08:53:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9051020390 for ; Thu, 20 Aug 2015 08:53:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2DFE203DC for ; Thu, 20 Aug 2015 08:53:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753120AbbHTIvm (ORCPT ); Thu, 20 Aug 2015 04:51:42 -0400 Received: from mgwym01.jp.fujitsu.com ([211.128.242.40]:32703 "EHLO mgwym01.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751755AbbHTIvi (ORCPT ); Thu, 20 Aug 2015 04:51:38 -0400 Received: from yt-mxoi2.gw.nic.fujitsu.com (unknown [192.168.229.69]) by mgwym01.jp.fujitsu.com with smtp id 3e19_23bd_123204a4_086b_44af_9152_b30289f4aad9; Thu, 20 Aug 2015 17:51:36 +0900 Received: from m3051.s.css.fujitsu.com (m3051.s.css.fujitsu.com [10.134.21.209]) by yt-mxoi2.gw.nic.fujitsu.com (Postfix) with ESMTP id 4FD65AC03BC; Thu, 20 Aug 2015 17:51:36 +0900 (JST) Received: from localhost.localdomain (unknown [10.124.196.197]) by m3051.s.css.fujitsu.com (Postfix) with ESMTP id 090FAEA; Thu, 20 Aug 2015 17:51:36 +0900 (JST) From: Taku Izumi To: netdev@vger.kernel.org, davem@davemloft.net Cc: platform-driver-x86@vger.kernel.org, dvhart@infradead.org, rkhan@redhat.com, alexander.h.duyck@redhat.com, linux-acpi@vger.kernel.org, joe@perches.com, sergei.shtylyov@cogentembedded.com, stephen@networkplumber.org, yasu.isimatu@gmail.com, Taku Izumi Subject: [PATCH v2.2 12/22] fjes: net_device_ops.ndo_get_stats64 Date: Thu, 20 Aug 2015 17:46:16 +0900 Message-Id: <1440060386-13189-12-git-send-email-izumi.taku@jp.fujitsu.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1440060386-13189-1-git-send-email-izumi.taku@jp.fujitsu.com> References: <1440060306-13040-1-git-send-email-izumi.taku@jp.fujitsu.com> <1440060386-13189-1-git-send-email-izumi.taku@jp.fujitsu.com> X-TM-AS-MML: disable Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds net_device_ops.ndo_get_stats64 callback. Signed-off-by: Taku Izumi --- drivers/net/fjes/fjes_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c index 186197d..842edbb 100644 --- a/drivers/net/fjes/fjes_main.c +++ b/drivers/net/fjes/fjes_main.c @@ -55,6 +55,8 @@ static netdev_tx_t fjes_xmit_frame(struct sk_buff *, struct net_device *); static void fjes_raise_intr_rxdata_task(struct work_struct *); static void fjes_tx_stall_task(struct work_struct *); static irqreturn_t fjes_intr(int, void*); +static struct rtnl_link_stats64 * +fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *); static int fjes_acpi_add(struct acpi_device *); static int fjes_acpi_remove(struct acpi_device *); @@ -219,6 +221,7 @@ static const struct net_device_ops fjes_netdev_ops = { .ndo_open = fjes_open, .ndo_stop = fjes_close, .ndo_start_xmit = fjes_xmit_frame, + .ndo_get_stats64 = fjes_get_stats64, }; /* fjes_open - Called when a network interface is made active */ @@ -702,6 +705,16 @@ fjes_xmit_frame(struct sk_buff *skb, struct net_device *netdev) return ret; } +static struct rtnl_link_stats64 * +fjes_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) +{ + struct fjes_adapter *adapter = netdev_priv(netdev); + + memcpy(stats, &adapter->stats64, sizeof(struct rtnl_link_stats64)); + + return stats; +} + static irqreturn_t fjes_intr(int irq, void *data) { struct fjes_adapter *adapter = data;