Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp882549rdf; Tue, 21 Nov 2023 22:07:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpuzpJZBKVuJAUE/8s3aDp1x+J3Lz4sSJk+6bPtx8Ig0afx1rkX3TswKHE8bL5Fwn16dmH X-Received: by 2002:a05:6358:5e13:b0:16b:c4ca:19b8 with SMTP id q19-20020a0563585e1300b0016bc4ca19b8mr1707508rwn.22.1700633226538; Tue, 21 Nov 2023 22:07:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700633226; cv=none; d=google.com; s=arc-20160816; b=s+vz4Fs/Xk+Oy1hwgVQrqKx6E/+kIl/93J0xXW9mmIdG8Q4VQaVxu4D0FQHFg2I0iE K2Eic9ubup4D8cPWo+yjnfQ+iWEgdGCzV+RrWSdY7UVw7KExq58aHNPiiNMbyeO0LCSq E6upMw/2a6e7rJjxSYIPu1bHZtdUXYxUjofBE9qwsbOVG9MeIYEHYNZkaUgPfNQiJ90u oTAmcUAHdCviiLNWJldQhFtqLFLZA///BdSbgBNlERswO6U0nD3Gz1Bv3z8hX3yYs8Tz cHKRjDzgMjHKPkAQovmo5XOyiEA4HQHR4DCLz54IpuV42dpCkMqjsNBjcaYj6Eh3WjUo Ghvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Mjh55RA6T+xYbbk3rouL5pz/iXpicqgFJhFUwdrcTM4=; fh=Yhg3/DrKkR4Hs3egnKzF2Sj5quBOazakYbmcsFQvz8A=; b=rBH1HLYvbCuqu12io4e6qe5O2gjj6buS+Go+fypCQdwYR7sVJ8VPcdo94yDZziWECW Dr+ZKmO68bfOK8+PHWDtsZmyTD9DmdkkZo3ZaajTk/ASOY4bExccqdHNFm2z/9fIJYsj sqQpThh4cnXfTz/8HB3Nd8GX/XDI+AJzY7u4fw8wOdVrV/3XRjX20wdFRsqhHb9h53Bv m28S81i+Q04OLUP7m4H5AI81oyL4UE/pKPsnZI/JIk89V1Z8Pu9lL2Pc0mxBE59tNmHW rI16TyybCJJ83B94Z3s1g/EtwB/5QYKTFuyIWTjMDVzAuOoDULCkJ4/bkiSYFqRbIG0O WyEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u24-20020a63df18000000b005c1ccaca5c4si11948867pgg.873.2023.11.21.22.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 22:07:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C7D60804C4A9; Tue, 21 Nov 2023 22:06:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234563AbjKVGGN (ORCPT + 54 others); Wed, 22 Nov 2023 01:06:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjKVGGL (ORCPT ); Wed, 22 Nov 2023 01:06:11 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90E5C195 for ; Tue, 21 Nov 2023 22:06:05 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3AM65v4oA2079013, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 3AM65v4oA2079013 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Nov 2023 14:05:58 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Wed, 22 Nov 2023 14:05:58 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 22 Nov 2023 14:05:57 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 1/4] wifi: rtw89: debug: add to check if debug mask is enabled Date: Wed, 22 Nov 2023 14:04:55 +0800 Message-ID: <20231122060458.30878-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231122060458.30878-1-pkshih@realtek.com> References: <20231122060458.30878-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.94] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 22:06:12 -0800 (PST) The coming dynamic mechanism of EDCCA adjustment will add a function to dump registers to reflect status. However, if we are not debugging the mechanism, we don't print anything, so avoid reading registers by checking debug mask to reduce IO. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/debug.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/debug.h b/drivers/net/wireless/realtek/rtw89/debug.h index b663ee24555a..f18021f9046d 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.h +++ b/drivers/net/wireless/realtek/rtw89/debug.h @@ -74,6 +74,12 @@ static inline void rtw89_hex_dump(struct rtw89_dev *rtwdev, print_hex_dump_bytes(prefix_str, DUMP_PREFIX_OFFSET, buf, len); } + +static inline bool rtw89_debug_is_enabled(struct rtw89_dev *rtwdev, + enum rtw89_debug_mask mask) +{ + return !!(rtw89_debug_mask & mask); +} #else static inline void rtw89_debug(struct rtw89_dev *rtwdev, enum rtw89_debug_mask mask, @@ -82,6 +88,11 @@ static inline void rtw89_hex_dump(struct rtw89_dev *rtwdev, enum rtw89_debug_mask mask, const char *prefix_str, const void *buf, size_t len) {} +static inline bool rtw89_debug_is_enabled(struct rtw89_dev *rtwdev, + enum rtw89_debug_mask mask) +{ + return false; +} #endif #endif -- 2.25.1