Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3864453pxj; Mon, 7 Jun 2021 23:59:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqH+XudeRcGUnh6sJiO6RibWNS8ujh8yzEm5ejiuoAsYfMVbH4rI7Hp/PPUHN8rhGWQrAu X-Received: by 2002:a05:6402:695:: with SMTP id f21mr23339921edy.96.1623135596624; Mon, 07 Jun 2021 23:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623135596; cv=none; d=google.com; s=arc-20160816; b=jcEErLJrL2C/a2Be1vm32aBRckeGh4Nk+7ZLC8ytTt1zem6roQ2bBvgAtqjfiuN2JR SuHXiwZTmJIIsaQddVHRSM0KOvw5Z5ZO+RA5v6VSByRL5aJ8TM3nll7UZMZ6Ro3H0pqf t6S7mmiY+PT6XRlg2sgLOa2aSmz71g6+PQHGYelzL0/zZjJEPbj96hudzdJYwn5Z7tyn A+w5CHzATwd5BwA6eml+tbMPqBSY5+FQHuvLpHZqDocdhsobwcRF0QdLc3Ua9Et7WRYr 6j0Gy/KbbgCfWbFPWIqvF82mMUXcIQnwgqVsvjotaHzl2w3ZSvfSnkmmRtYXiTAm9ydY ygug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=xmaOeNcsTUhyjTC3wQRrLv6j22OcJgJQt39R3ZfUKxM=; b=rKoasLYyF5jTWHjhkD78DryvxAxD7eHljBIkuaF0kRFnkzAzxYJ5K4matuIWcMpan6 fkwQcVsgfuN+av8NtLuFxOEIw3SxUWpozwJAfIWERO4LD7a0XF8PPK9VNN7Yo8FIxUAu YwA87iAOOSOjj9RKnZPE7+SwCTfUb5sZpH6aFTvSeL5oTzWXUhcV3VObrrxDWuBNz5cf ehAEhTWkxQk/nply69lYh9gACTDdJGpgv0LkFRyd2lyub3AzXIdhdOuRaJBnOSmQcorM GbpOUrD0ROkvvJEyKLS1tt8EjciaaVsOy3K1cmX7vJy9hsUUrSDoICbzxg83vFsdUweG 7ugg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si16874440ede.317.2021.06.07.23.59.33; Mon, 07 Jun 2021 23:59:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230302AbhFHG6P (ORCPT + 99 others); Tue, 8 Jun 2021 02:58:15 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:34861 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230197AbhFHG6P (ORCPT ); Tue, 8 Jun 2021 02:58:15 -0400 X-UUID: 03260d55308f4dd0a8eaca91bc462469-20210608 X-UUID: 03260d55308f4dd0a8eaca91bc462469-20210608 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1187886286; Tue, 08 Jun 2021 14:56:20 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 8 Jun 2021 14:56:19 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 8 Jun 2021 14:56:18 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH 1/2] mt76: testmode: move chip-specific stats dump before common stats Date: Tue, 8 Jun 2021 14:55:57 +0800 Message-ID: <20210608065558.8117-1-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Move chip-specific stats dumping part before common stats dumping to provide flexibility for per-chip driver to modify the value of common stats. Signed-off-by: Shayne Chen --- drivers/net/wireless/mediatek/mt76/testmode.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/testmode.c b/drivers/net/wireless/mediatek/mt76/testmode.c index c6a85a0..f73ffbd 100644 --- a/drivers/net/wireless/mediatek/mt76/testmode.c +++ b/drivers/net/wireless/mediatek/mt76/testmode.c @@ -521,6 +521,14 @@ mt76_testmode_dump_stats(struct mt76_phy *phy, struct sk_buff *msg) u64 rx_fcs_error = 0; int i; + if (dev->test_ops->dump_stats) { + int ret; + + ret = dev->test_ops->dump_stats(phy, msg); + if (ret) + return ret; + } + for (i = 0; i < ARRAY_SIZE(td->rx_stats.packets); i++) { rx_packets += td->rx_stats.packets[i]; rx_fcs_error += td->rx_stats.fcs_error[i]; @@ -535,9 +543,6 @@ mt76_testmode_dump_stats(struct mt76_phy *phy, struct sk_buff *msg) MT76_TM_STATS_ATTR_PAD)) return -EMSGSIZE; - if (dev->test_ops->dump_stats) - return dev->test_ops->dump_stats(phy, msg); - return 0; } -- 2.18.0