Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1075710pxb; Thu, 4 Mar 2021 02:36:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxwQrV3X0p5PWLk12dMsOKm1YYThq4m7+T+NV2SfLwsl2kFCsR145Yql2GC2ol/j1XF1AT X-Received: by 2002:a05:6402:40b:: with SMTP id q11mr3590057edv.36.1614854170163; Thu, 04 Mar 2021 02:36:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614854170; cv=none; d=google.com; s=arc-20160816; b=XLmPGNFxLBWppzowpPiK58P/VI7qQfyIwoDJ2PTDjNttguoPnByIk28aP+/5Pb2sZY FiFry/rgU2nxyyq57X8QSlLp4SpppZS6lLSLjmXrOfBdsFhZ/JxxSWtckpgRwJ4fcQQf ZuMEEIxpc97YQhRA20EtUEMxiNzNjuvn7EvJwEgBlkSNyOky7hZApCXipLLOiT2yU3Nn ITVbxh4z63pqb/cDdb0s/9MIHYKa0x3W49BKBBLjztUIGcrhCF3BBpEoUnovf/Vy81Pt XfGAJBtUqU9PaJPirOuhvHz021eLODaCIh3cV5bGdu6eFSSx5F6XkbRzrfTZfTB7xANB O+gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=0LOUjXWU9XQMlC8ukkVjP6cbdNO347+RGN85W5m8N+0=; b=aZQ9ehJVkZigKFDrJkxCCiyOT7f3+7X/NSOtKSy0C5mqIJXagikZlNkoRSawFuO6i4 f2wK4NdYvXrTonUvHZk61RdCcMsh+5zRHVufc0NrpcHFPnZLIWHQUiQtEal8i6v5f8W9 1RqiM7eE7G7T3DAf79sjdsWNFpRp/w/jo3eixyYsZYNbFVqEg5h1ft5YRLHJqt/jsNqS uGX2sAADbSXL0mKEJRIN4zTrbCtet9zQ5DQXcx2UAAPOTfqkKtlswPSyUqhQdx4W/eMH LphCPwd3hcbRUvM9s354HlgPwk4zMtqc5uRE5nFvwOhrjwZA/OyXUQ1dpUqSYc6bdvzH 9mFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="CWFi/YmI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pk25si17584235ejb.402.2021.03.04.02.35.47; Thu, 04 Mar 2021 02:36:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="CWFi/YmI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347829AbhCCRGu (ORCPT + 99 others); Wed, 3 Mar 2021 12:06:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236298AbhCCMgS (ORCPT ); Wed, 3 Mar 2021 07:36:18 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65776C061756; Wed, 3 Mar 2021 04:24:01 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id d20so22703869qkc.2; Wed, 03 Mar 2021 04:24:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=0LOUjXWU9XQMlC8ukkVjP6cbdNO347+RGN85W5m8N+0=; b=CWFi/YmIgLKQU3EsyxyA9z4dbgyph5EBnHmeINDqV77rqZogpKapQF/rcKR7XqYfUg vs0ms8ztdf+pD9KcZElRsxGN3jKdzXAQBwP5uqrSuMnAIAgTV1NmofdATzgps+aYwYwX Qrf+HllKPXiD9V69v1AcF+9SKQ1TvlLelwqkhHgLtttHToM6GMAET4H7EWFNU45JP457 X82UeZjXoSLpFhzbHhSmJzlG898qbT4J4zUB/MQlSDILgs00fdhW3oL8TPvMheTU7ZJO hhcrgMbNLfxlFPUAIzeAcZBfbzwrwBd3dvKCxpxMuJSPKoIzPymGtOGLPfXFQMT+n0bP WFVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=0LOUjXWU9XQMlC8ukkVjP6cbdNO347+RGN85W5m8N+0=; b=nzYuD1ZztnNB68t6/Iy1owrdpRhJ72bYPairSRwS8r3G4AbTLO5YjE2iAUJyPX0ofX asutb1MpP6ivk1UQPVf+bWhIzSGKTwWImaf/Xsk8hJ5rBmQZHkdH2S9I6wEFAeDTASoR upJ0hjyEXePeCMhclNKPT5xOtzAsxS+LfOm2nOkVNsBYcbdXNVY74JkBKXfS+QPjfMT5 tfFkTEqAC2j8alaUtulprm9cQZ6nnhHoKTGQ6RDZsNYzF1/f+BI50XE+K7l+f379M7L0 VH9HsYqMcwibXKaSugM1S6ObMAqv2mKKZYCjDm6Lrjj5gmtnmh6qAOOX0mhARColsWED nk/g== X-Gm-Message-State: AOAM530L74+Skv+DYccR/ZuL6m4wlkiUuJrVmKhh8czHU8yY1uhsuP7S pn8nfChQ1QnY2OKx1mlVld1UFwMfnHFiVdn/88Q= X-Received: by 2002:a05:620a:5bd:: with SMTP id q29mr17767569qkq.450.1614774240549; Wed, 03 Mar 2021 04:24:00 -0800 (PST) MIME-Version: 1.0 From: =?UTF-8?B?6YKx5ZCN56Kp?= Date: Wed, 3 Mar 2021 20:23:49 +0800 Message-ID: Subject: Questions of TX power get/set implementation for realtek WiFi driver To: pkshih@realtek.com, tehuang@realtek.com, Larry.Finger@lwfinger.net Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, kvalo@codeaurora.org, Reto Schneider Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi guys, I'm planning to implement the get_txpower hook function of the struct ieee80211_ops and handle the IEEE80211_CONF_CHANGE_POWER for rtl8xxxu driver. So that users can get the information of the current tx power limit and set a new limit value with iw commands. I found there's phy_txpwr_idx_to_dbm() of each driver in realtek/rtlwifi to translate the tx power index parsed from efuse to tx power level in dBm. Does the power level translated represent the current tx power limit in dBm? In my RTL8188CUS module, the power index of CCK/OFDM from efuse for each channel is basically 36/38, thus the translated txpower level is 11dBm. Is this the expected value for the default txpower limit value? Or do I need some other formula to compute? And for the handler of IEEE80211_CONF_CHANGE_POWER, can I translate the hw->conf.power_level with the phy_dbm_to_txpwr_idx functions I found in some rtlwifi family drivers, then directly set the txpower index with phy_set_txpower_index functions which write power index to bbreg for different rates (CCK and OFDM)? Are there some invalid values I should take care of because the TCP RX performance seems to be extremely low when I write the power index value translated from 20dBm to bbreg. Any suggestions for what I should handle before writing the bbreg? Chris