Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6766478rwr; Tue, 9 May 2023 21:57:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6MuO+10hGjK7t3IxCm+bvk29+EUD0H0Q69LB6GiERc+sKrGYTmbTgtbezTC3nY3dc9OTbK X-Received: by 2002:a05:6a20:1443:b0:101:a459:bb0d with SMTP id a3-20020a056a20144300b00101a459bb0dmr3570016pzi.2.1683694622459; Tue, 09 May 2023 21:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683694622; cv=none; d=google.com; s=arc-20160816; b=QDdsQ10fYcK/WLmeZWRT68jcX4E+lu+jmVd/JiIoQPrJLuhRqGEnGzbajX6VKvAK5M ZQeV6+WPd7Mu29EuqoP52E9lHQjeJenhBuOyBpUbISvlYWMRq3mocM+iY5j3pxOVcNpO D1X8wEUxzlHNC9LSYlN7X0RzwhYosgYxPKGYKbTn2Ck7PkM8TUUCTg4xhnlnGBRU0S2A 8BHfx8UlN1dAPBam/TY8msXqvq3ABLC5KS2EGTsr0/MkdZj7s2Spia0wbf1atmHmokFK FsHBT33Gl/9uDY4KLuOhPQOYCiwur2uevoEzh0WujLhDe1lQpkcuDT5OsW92K0Y8dJtz APNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=fYwMXsbC2TORqhM+20EAcvO2mrA9AKvCBXLLqb9xS2E=; b=WmxWsa1/zClJWOZEzKHhcdsNq9aQKNa8d69w1B56JdJ9HrQadDSH95jMqf7QlGnff/ nW/JSE/jfplzoIadhwKuPsyr8hDla9aZfoICjb14mNKCtcpCLBBbLjj/JjgwAaZ532yy 1mKo0ePIFPZnmJcBIXVF/ZjBQlgWIIp7Dy4toEMWhVlpxlYKCst0TYc1r63eETkcz2jc 6PLNa2QulEtg33TKi5EmizynmmiuI6zW33NChVVeMlf4GblII5byQLhgga+/cQArqsGp PGBkD3kUWiUOIB/5LvdMw4kgw+CAGNRvWpUAyXhpUhxjPljKJE6yhwnkK/t+xN4LdrZ/ qKWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=aev8zxhI; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a638c4d000000b0052c75ef69b1si3054444pgn.825.2023.05.09.21.56.55; Tue, 09 May 2023 21:57:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=aev8zxhI; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235447AbjEJExg (ORCPT + 61 others); Wed, 10 May 2023 00:53:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234216AbjEJExc (ORCPT ); Wed, 10 May 2023 00:53:32 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD277E4A for ; Tue, 9 May 2023 21:53:30 -0700 (PDT) X-UUID: 998c9eaaeeee11ed9cb5633481061a41-20230510 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=fYwMXsbC2TORqhM+20EAcvO2mrA9AKvCBXLLqb9xS2E=; b=aev8zxhIWZxbGgPaa4rTexkbmPhX8J33LL+n++NcUN73o7HEmayhqAOwK5NhLNvD/U5YSelHMb3MgvL7yUGQZWpdf4BppUWuoARYXCLR15c5lu9txxhMOurg0hJ/7R9Rlp9CnKZeOBzZYUxOzj/tveO8CPiSFWl/7CdAyFJzeKk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.24,REQID:a4252f77-caa9-49af-be8d-222e33abd130,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:178d4d4,CLOUDID:2fa4526b-2f20-4998-991c-3b78627e4938,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: 998c9eaaeeee11ed9cb5633481061a41-20230510 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1864050016; Wed, 10 May 2023 12:53:26 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 10 May 2023 12:53:25 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 10 May 2023 12:53:25 +0800 From: Ryder Lee To: Felix Fietkau , CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , Ryder Lee Subject: [PATCH v3 5/6] wifi: mt76: mt7915: drop return in mt7915_sta_statistics Date: Wed, 10 May 2023 12:53:20 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Avoid blocking other statistics sinfo->filled when txrate is unavailable. Signed-off-by: Ryder Lee --- .../net/wireless/mediatek/mt76/mt7915/main.c | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index b306a4fae1fc..d899bc2d0a84 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -1020,21 +1020,20 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw, sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE); } - if (!txrate->legacy && !txrate->flags) - return; - - if (txrate->legacy) { - sinfo->txrate.legacy = txrate->legacy; - } else { - sinfo->txrate.mcs = txrate->mcs; - sinfo->txrate.nss = txrate->nss; - sinfo->txrate.bw = txrate->bw; - sinfo->txrate.he_gi = txrate->he_gi; - sinfo->txrate.he_dcm = txrate->he_dcm; - sinfo->txrate.he_ru_alloc = txrate->he_ru_alloc; + if (txrate->legacy || txrate->flags) { + if (txrate->legacy) { + sinfo->txrate.legacy = txrate->legacy; + } else { + sinfo->txrate.mcs = txrate->mcs; + sinfo->txrate.nss = txrate->nss; + sinfo->txrate.bw = txrate->bw; + sinfo->txrate.he_gi = txrate->he_gi; + sinfo->txrate.he_dcm = txrate->he_dcm; + sinfo->txrate.he_ru_alloc = txrate->he_ru_alloc; + } + sinfo->txrate.flags = txrate->flags; + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); } - sinfo->txrate.flags = txrate->flags; - sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); /* offloading flows bypass networking stack, so driver counts and * reports sta statistics via NL80211_STA_INFO when WED is active. -- 2.18.0