From patchwork Tue Mar 31 06:51:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryder Lee X-Patchwork-Id: 11466771 X-Patchwork-Delegate: nbd@nbd.name Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92D6392A for ; Tue, 31 Mar 2020 06:51:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B31220748 for ; Tue, 31 Mar 2020 06:51:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="tuQugvTR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729853AbgCaGvt (ORCPT ); Tue, 31 Mar 2020 02:51:49 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:19038 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726299AbgCaGvt (ORCPT ); Tue, 31 Mar 2020 02:51:49 -0400 X-UUID: e0a15d4555984197a1dbd54ca4458438-20200331 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=u13/otOsZwQRNSYopzBCUAzrteMoNJLZU3KM9kEkgXI=; b=tuQugvTRNlpEBYwK7607rkL/75D+tLtPgynY0DeE9qLED17rLnHRThAQFZ9SnbtFoV9CnLsAmxvaKsiYaxfTH/cKaj2Jk7I4mTNf9jiOVosBg47Bkhnzafjttqby9rc7OwR9iaYV2byHJTHzKej4Zl5pIIovQIlGeSFPih4plU8=; X-UUID: e0a15d4555984197a1dbd54ca4458438-20200331 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 729634148; Tue, 31 Mar 2020 14:51:39 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 31 Mar 2020 14:51:39 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 31 Mar 2020 14:51:37 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Shayne Chen , Sean Wang , , , Ryder Lee Subject: [PATCH 1/4] mt76: mt7615: modify mt7615_ampdu_stat_read for each phy Date: Tue, 31 Mar 2020 14:51:35 +0800 Message-ID: <1fc90ec2a64d062ac7264aaa3dd158f2282ad7b8.1585636614.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is a preliminary patch to add more Tx counters. Signed-off-by: Ryder Lee --- .../wireless/mediatek/mt76/mt7615/debugfs.c | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c index b4d0795154e3..9fd40d723201 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c @@ -120,12 +120,17 @@ mt7615_reset_test_set(void *data, u64 val) DEFINE_DEBUGFS_ATTRIBUTE(fops_reset_test, NULL, mt7615_reset_test_set, "%lld\n"); -static int -mt7615_ampdu_stat_read(struct seq_file *file, void *data) +static void +mt7615_ampdu_stat_read_phy(struct mt7615_phy *phy, + struct seq_file *file) { struct mt7615_dev *dev = file->private; + bool ext_phy = phy != &dev->phy; int bound[7], i, range; + if (!phy) + return; + range = mt76_rr(dev, MT_AGG_ASRCR0); for (i = 0; i < 4; i++) bound[i] = MT_AGG_ASRCR_RANGE(range, i) + 1; @@ -133,6 +138,8 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data) for (i = 0; i < 3; i++) bound[i + 4] = MT_AGG_ASRCR_RANGE(range, i) + 1; + seq_printf(file, "\nPhy %d\n", ext_phy); + seq_printf(file, "Length: %8d | ", bound[0]); for (i = 0; i < ARRAY_SIZE(bound) - 1; i++) seq_printf(file, "%3d -%3d | ", @@ -141,6 +148,15 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data) for (i = 0; i < ARRAY_SIZE(bound); i++) seq_printf(file, "%8d | ", dev->mt76.aggr_stats[i]); seq_puts(file, "\n"); +} + +static int +mt7615_ampdu_stat_read(struct seq_file *file, void *data) +{ + struct mt7615_dev *dev = file->private; + + mt7615_ampdu_stat_read_phy(&dev->phy, file); + mt7615_ampdu_stat_read_phy(mt7615_ext_phy(dev), file); return 0; }