From patchwork Fri Dec 24 08:52:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 528123 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 71774C433F5 for ; Fri, 24 Dec 2021 08:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352108AbhLXIxQ (ORCPT ); Fri, 24 Dec 2021 03:53:16 -0500 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:29614 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352091AbhLXIxQ (ORCPT ); Fri, 24 Dec 2021 03:53:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1640335996; x=1671871996; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zgd1qVlzDsdTRwbLMC38OejYHwZQH64q4iPUZenfhwQ=; b=bSve3AmTa5qlt8974swdKwCvahk7RKBxCb/O17O28Jr2xlQiqyPiNQFw eqTp0dsxrUFpgsGcJe6+LfA9aXNM1JlJtdkYdD+9szlkJvVJcVguHjESw tvKjCtMGF39SPkBucpEsn31uUtJKRDqYLqt5KGVeeCm4Z62hWvshgik/b 4=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 24 Dec 2021 00:53:15 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Dec 2021 00:53:15 -0800 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.922.19; Fri, 24 Dec 2021 00:53:15 -0800 Received: from wgong-HP3-Z230-SFF-Workstation.qca.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.922.19; Fri, 24 Dec 2021 00:53:14 -0800 From: Wen Gong To: CC: , Subject: [PATCH v2 15/15] ath11k: send TPC power to firmware for 6 GHz station Date: Fri, 24 Dec 2021 03:52:36 -0500 Message-ID: <20211224085236.9064-16-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211224085236.9064-1-quic_wgong@quicinc.com> References: <20211224085236.9064-1-quic_wgong@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When station is connected to a 6 GHz AP, it has 2 way to configure the power limit to firmware. The first way is to send 2 wmi command WMI_PDEV_PARAM_TXPOWER_LIMIT2G/WMI_PDEV_PARAM_TXPOWER_LIMIT5G to firmware, the second way is to send WMI_VDEV_SET_TPC_POWER_CMDID to firmware which include more parameters for power control. The first way is disabled in previous patch "ath11k: discard BSS_CHANGED_TXPOWER when EXT_TPC_REG_SUPPORT for 6 GHz". Prepare the parameter for wmi command WMI_VDEV_SET_TPC_POWER_CMDID and send the firmware after vdev start response success from firmware, it is for the second way of power control. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong --- drivers/net/wireless/ath/ath11k/mac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 54d7327265d6..1d9eebfe84fa 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -6724,6 +6724,12 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, return ret; } + if (ath11k_mac_supports_station_tpc(ar, arvif, chandef)) { + ath11k_mac_fill_reg_tpc_info(ar, arvif->vif, &arvif->chanctx); + ath11k_wmi_send_vdev_set_tpc_power(ar, arvif->vdev_id, + &arvif->reg_tpc_info); + } + if (!restart) ar->num_started_vdevs++; @@ -7494,7 +7500,7 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, if (power_type == IEEE80211_REG_UNSET_AP) power_type = IEEE80211_REG_LPI_AP; ath11k_reg_handle_chan_list(ab, reg_info, power_type); - + arvif->chanctx = *ctx; ath11k_mac_parse_tx_pwr_env(ar, vif, ctx); }