Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1343497pxb; Tue, 26 Oct 2021 07:22:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWaTy5x0o4RhRJudB8CiPSxkBH5UTvgJucYFluFLDvFDJKvy4MKd8r4NVRMdaj6XTkE2Fe X-Received: by 2002:a65:6643:: with SMTP id z3mr19249118pgv.16.1635258137434; Tue, 26 Oct 2021 07:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635258137; cv=none; d=google.com; s=arc-20160816; b=HctkMCC+Z4oAyo5Fmwq2EBgfWpqsJGyAM5WxN648NEj4NJe9Gr8F1oHFfPCg7wLwgf dXQkrQNAWGn2v6GTXgCMxC+rk9oInW7+MCmBEJi3m0YpxTuUnOXgVlmA2kl67czXxTnY SXnj36vNn8kNbmgcglG9QAIHZpFbSODKPxt6BreJ3s2L11KTLnR6qu08wBMAsQW06Rgy qzSx7sGwSFv+xgv/5QX1KroOZu64uKpc4nAMXum7bKRS1pOe0VnEHXdvgU2Yh866Fhg4 cz18/+uiRAeYOh5fp8P4DUZBJu5EC4O3+I8SWwAy/qmNdPOYWeM/MBTW44qNET10mKDi o53g== 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 :dkim-signature; bh=0ZhUzRgAxpp99YUc6DckpZ0gEBQu58giLRw4uQmyJXE=; b=q6Pi48+sG0J5As2hETUVoZYC/c3EO4EoJ4Up/P+MG9iBDrTj7A0s10Sv2FXfD2EFxg k6P2yVsL+dLphFQfGt8nmZQen/cEUU/k/yZSdZnT5p8qUUB4kzxKW1DgZbbFjthNKc1Z /BZ9qKrjO5wMr8PazOI84ARFkfiojttJm6aa8PWKw82oPheQDAul3CNj7QKAzvcQjmvE 6AVOt7EexzZr36D2NWE51xol4aULTEP8Sw2KDKHVrOUliAgpw2Jtnrc7nEiTwdtzIB/t 3AjC/yt88MRlRi3HfYHWR9wTzzu1q88adknEVKwB0hVyZx8x/JVsl26f0I/jl5K9xwOX ddGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=zELk4Tzq; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si7605638plh.291.2021.10.26.07.22.08; Tue, 26 Oct 2021 07:22:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@quicinc.com header.s=qcdkim header.b=zELk4Tzq; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234910AbhJZLWd (ORCPT + 67 others); Tue, 26 Oct 2021 07:22:33 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:47817 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235527AbhJZLWc (ORCPT ); Tue, 26 Oct 2021 07:22:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1635247209; x=1666783209; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0ZhUzRgAxpp99YUc6DckpZ0gEBQu58giLRw4uQmyJXE=; b=zELk4TzqYixmi6UyTMlEvPumVNUPaM6VtuuiVJ6ohg8Yjz6rN1dW59Nn k30UfWiFGUxQtPBl8Fe4xSmgJb1W0Ggd5FoyYn11Zg4ZKfnQiXWLTUlxq 5kTFVAbIgRWTvzZ1CkCYWmUcF191g787pVYAu3M5Z24ktO8H3HDrlGePJ k=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 26 Oct 2021 04:20:09 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 04:20:09 -0700 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.7; Tue, 26 Oct 2021 04:20:07 -0700 From: Wen Gong To: CC: , Subject: [PATCH 15/15] ath11k: send TPC power to firmware for 6 GHz station Date: Tue, 26 Oct 2021 07:19:13 -0400 Message-ID: <20211026111913.7346-16-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026111913.7346-1-quic_wgong@quicinc.com> References: <20211026111913.7346-1-quic_wgong@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 301e08a85f47..88c18ffee7a3 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -5312,6 +5312,12 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, return ret; } + if (ath11k_mac_station_support_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); + } + ar->num_started_vdevs++; ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM started, vdev_id %d\n", arvif->vif->addr, arvif->vdev_id); @@ -6098,7 +6104,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); } -- 2.31.1