Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1682661rdb; Mon, 2 Oct 2023 18:55:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPucuVT0kUZ190cLSAysGWlkbHsvhCiSpM7odf9mAf66mYkLIVqB89U4OQoH893PV2kEtF X-Received: by 2002:a0d:ea44:0:b0:59b:61c2:e8db with SMTP id t65-20020a0dea44000000b0059b61c2e8dbmr13169627ywe.49.1696298146065; Mon, 02 Oct 2023 18:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696298146; cv=none; d=google.com; s=arc-20160816; b=rsG+MEOPZeH0O+o2+1k1Trwmlp8NzLk3KL9v58YCAlfS58TkyC0o2egxrJQz9lJKQm F0cUSMXQkDfF7FUzI7z9rYq3dEJWrkiF1XxnbguQHtxMuUI0eEzpDoHCWKqtTqdc25py rpS3mw1fS6oq7ZSiguV0u3GBqlSp8G08GT2oQ3OgMPWcaT0PvorWeMK0CuQ+AMleBnXe 4SYeru34wRPLpvP5wLr0TZjktz4VJQ7fredT14HEPgrenIiP1IegySAGpXEh8fxCr0BL 66Sd4dsnmaUnQy6/0mIXsL2k7EjVlziGm9fOdqAS+UwSqi943OJxQI27Rmbh0HSo80Fw RUlA== 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 :message-id:date:subject:cc:to:from; bh=K+vA/rZWmCd1N/JNvWHJxmNein1FOg43iwOMJD7pmPY=; fh=TSuyMlfOTyCx0zt3ucDyTttlN37QPvmvgk5pf20rBgY=; b=oZrZYUr64hyrm6boOs2hO9EagTI1pR+OYvlwOrGvpoz6GQuuDAQ1urmb5CDTdoO7h5 OT0zuV2YFvoDR9x039fV+OSK2+WqGr0Ud+nkilaBDBy60rH2U4gbjTcNbfqrpaZOZ8NV PF2L6PIp6Mzz7nGOn7bBOuExV0ni6IvT2Lb/bjxrxtKW5GvELIeBf7hp/+Y7Gw1yOSh/ LuXcbcZ9ZcCqw5kYROR9RDZb0O+N0JiBx/zTzRFhr3GhJ5TZK+cwrFfYOeuVyOPUYl2y D63eXRQUUkwZ8p/kXmTCuDDX4A+cJwvJttFBZASk6IujN46ZR9d+Ut5N6QJDn53ECu5s HlQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u7-20020a17090341c700b001c362510a4esi312027ple.613.2023.10.02.18.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 18:55:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id C2BE3809B0B5; Mon, 2 Oct 2023 18:55:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjJCBzR (ORCPT + 53 others); Mon, 2 Oct 2023 21:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjJCBzR (ORCPT ); Mon, 2 Oct 2023 21:55:17 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BA19BD for ; Mon, 2 Oct 2023 18:55:12 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3931t2Qj91334478, 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.92/5.92) with ESMTPS id 3931t2Qj91334478 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Oct 2023 09:55:02 +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; Tue, 3 Oct 2023 09:55:03 +0800 Received: from [127.0.1.1] (172.21.69.25) 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; Tue, 3 Oct 2023 09:55:02 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 0/7] wifi: rtw89: apply TX power read from firmware file Date: Tue, 3 Oct 2023 09:54:39 +0800 Message-ID: <20231003015446.14658-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.25] 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 18:55:27 -0700 (PDT) We have read TX power from firmware file (named firmware elements), and then write TX power values to registers by this patchset. The register addresses between WiFi 6 and 7 chips are different, and tables for WiFi 7 are larger. But we still try to reuse functions if possible, otherwise implement separate functions for each of them. The registers of TX power can be categorized: 1. TX power by rate: a value for a rate section (RS for short in code) 2. TX power offset: a offset value from base of rate section above. This uses less register bits than TX power by rate. 3. TX power limit: the power to follow regulation, so output power is min(TX_power_by_rate, TX_power_limit) basically. 4. TX power RU limit: like above, but for OFDMA RU. Since there are many TX power values, we need to convert them to human readable format to quickly check if values are expected. The last two patches of this patchset are to extend existing debugfs to show current TX power for all chips. Zong-Zhe Yang (7): wifi: rtw89: mac: get TX power control register according to chip gen wifi: rtw89: phy: set TX power by rate according to chip gen wifi: rtw89: phy: set TX power offset according to chip gen wifi: rtw89: phy: set TX power limit according to chip gen wifi: rtw89: phy: set TX power RU limit according to chip gen wifi: rtw89: debug: show txpwr table according to chip gen wifi: rtw89: debug: txpwr table supports Wi-Fi 7 chips drivers/net/wireless/realtek/rtw89/core.h | 30 -- drivers/net/wireless/realtek/rtw89/debug.c | 272 +++++++++- drivers/net/wireless/realtek/rtw89/mac.c | 14 +- drivers/net/wireless/realtek/rtw89/mac.h | 16 +- drivers/net/wireless/realtek/rtw89/mac_be.c | 40 ++ drivers/net/wireless/realtek/rtw89/phy.c | 173 +++--- drivers/net/wireless/realtek/rtw89/phy.h | 120 ++++- drivers/net/wireless/realtek/rtw89/phy_be.c | 568 ++++++++++++++++++++ drivers/net/wireless/realtek/rtw89/reg.h | 50 +- 9 files changed, 1126 insertions(+), 157 deletions(-) -- 2.25.1