From patchwork Fri Jun 3 05:26:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 578714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7193C43334 for ; Fri, 3 Jun 2022 05:26:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240419AbiFCF0y (ORCPT ); Fri, 3 Jun 2022 01:26:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240378AbiFCF0x (ORCPT ); Fri, 3 Jun 2022 01:26:53 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A977EB18 for ; Thu, 2 Jun 2022 22:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654234012; x=1685770012; h=from:to:cc:subject:date:message-id:mime-version; bh=zdDYBhK+04G5Dd6DBtMQpBl6Gq+biOkesGZwnFYBR5I=; b=Ap6WVXLrJEI+HxKN7ighY6kFgHypOG2eMV+06ihHqC1ifoRXExIjExQu N8Vnc8T6hqRH/tU6gxq9MiIvBQIcx0M56LWJwAcC9KR5VTGf41ak36h3Z 4bLUDaBfzyZDHzHGcTNXKQ0jfGdbDP+syKRIODz3AMgOs0f6ibeBTGDhv 0=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Jun 2022 22:26:52 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 22:26:52 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 2 Jun 2022 22:26:52 -0700 Received: from adisi-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 2 Jun 2022 22:26:50 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH v2 0/2] ath11k: add support for get_txpower mac ops Date: Fri, 3 Jun 2022 10:56:34 +0530 Message-ID: <20220603052636.22854-1-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently, driver does not support get_txpower mac ops because of which cfg80211 returns vif->bss_conf.txpower to user space. bss_conf.txpower gets its value from ieee80211_channel->max_reg_power. However, the final txpower is dependent on few other parameters apart from max regulatory supported power. It is the firmware which knows about all these parameters and considers the minimum for each packet transmission. Firmware reports the final tx power in firmware pdev stats which falls under fw_stats. But currently, fw_stats is under debugfs. Add support for get_txpower mac ops to get the tx power from firmware leveraging fw_stats and return it accordingly. Also, move fw_stats out of debugfs so that get_txpower mac ops can function properly even when debugfs is disabled. Aditya Kumar Singh (2): ath11k: move firmware stats out of debugfs ath11k: add get_txpower mac ops --- v2: removed unnecessary line breaks and made debug logs more clear --- drivers/net/wireless/ath/ath11k/core.c | 46 ++++++++ drivers/net/wireless/ath/ath11k/core.h | 12 +- drivers/net/wireless/ath/ath11k/debugfs.c | 137 +++++----------------- drivers/net/wireless/ath/ath11k/debugfs.h | 6 +- drivers/net/wireless/ath/ath11k/mac.c | 92 +++++++++++++++ drivers/net/wireless/ath/ath11k/wmi.c | 48 +++++++- 6 files changed, 229 insertions(+), 112 deletions(-)