From patchwork Tue Apr 4 06:18:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 96693 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp48391qgd; Mon, 3 Apr 2017 23:18:47 -0700 (PDT) X-Received: by 10.98.204.25 with SMTP id a25mr21178567pfg.6.1491286727723; Mon, 03 Apr 2017 23:18:47 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si746909pgf.57.2017.04.03.23.18.47; Mon, 03 Apr 2017 23:18:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752545AbdDDGSr (ORCPT + 6 others); Tue, 4 Apr 2017 02:18:47 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:33580 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbdDDGSq (ORCPT ); Tue, 4 Apr 2017 02:18:46 -0400 Received: by mail-pg0-f45.google.com with SMTP id x125so142571083pgb.0 for ; Mon, 03 Apr 2017 23:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Wx1vHvIgNYKWT5D1ylzbYtfsrrBH7Yk1egsYxj7/3bw=; b=MSkFZZ+BeC8FScSBjo2zC0wTSg0qfbd8++Y3K9QEe9lpa+m3XguDDUVlZEX2nyt+vr SYQrqNSoNJoIrswJxGmix2VxzUGSvmYmSpODaBx70KsVOP9Dfm6howAZzfB39s0CVvh+ OKP24TVKJUVE/vFX5mMAAK128Pm0SGtC2bPEM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Wx1vHvIgNYKWT5D1ylzbYtfsrrBH7Yk1egsYxj7/3bw=; b=M08KLTuThhkSbsE6A3UGFTcsrYcQsqktfeg2LnIgm1i9V6apQoPVWZ39cZQSF5Je0Y IQi61d0t8cgMjk0feRF+0tEpyKXCnzI5Z+Ax9xhyJjA2cA+0pqnH5X14mpd4RhwbjIAL +a5NwuYgZ5VZYxGxorwevjht8jjG9fKkHFoGn5D0z9oObA3ggbP7u+Q0pCbsLPxzo17n MojTZDTwEQ0uWjOEPYF2B7RsAbwch1WauA+yH1EhOD4SHCf3sDJmdLjJZLa4CBKRqkn3 00LKGWxgiRC1IU5uW9DX9C3Zmfy6tNOgFRGHJP6M1JKPm0LBe9saHHMO5X8oHILgDDsU Q4bg== X-Gm-Message-State: AFeK/H1l/m+i7mf3qEDpf6w4CJIaB3O029+hzl32CrTnYZW5vREXyRu6Uij6+uajEBZsCLON X-Received: by 10.98.52.5 with SMTP id b5mr21406000pfa.206.1491286725709; Mon, 03 Apr 2017 23:18:45 -0700 (PDT) Received: from localhost.localdomain ([106.51.240.246]) by smtp.gmail.com with ESMTPSA id y70sm29190878pfa.96.2017.04.03.23.18.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 23:18:45 -0700 (PDT) From: Amit Pundir To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Tobias Klauser , Kalle Valo Subject: [PATCH 31/33] brcmfmac: Use net_device_stats from struct net_device Date: Tue, 4 Apr 2017 11:48:37 +0530 Message-Id: <1491286719-31388-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491286719-31388-1-git-send-email-amit.pundir@linaro.org> References: <1491286719-31388-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tobias Klauser Instead of using a private copy of struct net_device_stats in struct brcm_if, use stats from struct net_device. Also remove the now unnecessary .ndo_get_stats function. Signed-off-by: Tobias Klauser Acked-by: Arend van Spriel Signed-off-by: Kalle Valo (cherry picked from commit 91b632803ee4e47c5a5c4dc3d8bf5abf9c16107a) Signed-off-by: Amit Pundir --- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 26 +++++++--------------- .../wireless/broadcom/brcm80211/brcmfmac/core.h | 2 -- 2 files changed, 8 insertions(+), 20 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index 5eaac13..cf1ae5a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -243,10 +243,10 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, done: if (ret) { - ifp->stats.tx_dropped++; + ndev->stats.tx_dropped++; } else { - ifp->stats.tx_packets++; - ifp->stats.tx_bytes += skb->len; + ndev->stats.tx_packets++; + ndev->stats.tx_bytes += skb->len; } /* Return ok: we always eat the packet */ @@ -290,15 +290,15 @@ void brcmf_txflowblock(struct device *dev, bool state) void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb) { if (skb->pkt_type == PACKET_MULTICAST) - ifp->stats.multicast++; + ifp->ndev->stats.multicast++; if (!(ifp->ndev->flags & IFF_UP)) { brcmu_pkt_buf_free_skb(skb); return; } - ifp->stats.rx_bytes += skb->len; - ifp->stats.rx_packets++; + ifp->ndev->stats.rx_bytes += skb->len; + ifp->ndev->stats.rx_packets++; brcmf_dbg(DATA, "rx proto=0x%X\n", ntohs(skb->protocol)); if (in_interrupt()) @@ -321,7 +321,7 @@ static int brcmf_rx_hdrpull(struct brcmf_pub *drvr, struct sk_buff *skb, if (ret || !(*ifp) || !(*ifp)->ndev) { if (ret != -ENODATA && *ifp) - (*ifp)->stats.rx_errors++; + (*ifp)->ndev->stats.rx_errors++; brcmu_pkt_buf_free_skb(skb); return -ENODATA; } @@ -382,7 +382,7 @@ void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success) } if (!success) - ifp->stats.tx_errors++; + ifp->ndev->stats.tx_errors++; brcmu_pkt_buf_free_skb(txp); } @@ -405,15 +405,6 @@ void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success) } } -static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *ndev) -{ - struct brcmf_if *ifp = netdev_priv(ndev); - - brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); - - return &ifp->stats; -} - static void brcmf_ethtool_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo *info) { @@ -486,7 +477,6 @@ static int brcmf_netdev_open(struct net_device *ndev) static const struct net_device_ops brcmf_netdev_ops_pri = { .ndo_open = brcmf_netdev_open, .ndo_stop = brcmf_netdev_stop, - .ndo_get_stats = brcmf_netdev_get_stats, .ndo_start_xmit = brcmf_netdev_start_xmit, .ndo_set_mac_address = brcmf_netdev_set_mac_address, .ndo_set_rx_mode = brcmf_netdev_set_multicast_list diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h index c94dcab..397c912 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h @@ -171,7 +171,6 @@ enum brcmf_netif_stop_reason { * @drvr: points to device related information. * @vif: points to cfg80211 specific interface information. * @ndev: associated network device. - * @stats: interface specific network statistics. * @multicast_work: worker object for multicast provisioning. * @ndoffload_work: worker object for neighbor discovery offload configuration. * @fws_desc: interface specific firmware-signalling descriptor. @@ -187,7 +186,6 @@ struct brcmf_if { struct brcmf_pub *drvr; struct brcmf_cfg80211_vif *vif; struct net_device *ndev; - struct net_device_stats stats; struct work_struct multicast_work; struct work_struct ndoffload_work; struct brcmf_fws_mac_descriptor *fws_desc;