Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6131916rwn; Mon, 12 Sep 2022 22:18:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR76gn30hoCxNR2yft4MqOaxaj0BDIwFGzrk4Fyc331PRiKoWzfh9FAViv1RH54QVzjlYHMm X-Received: by 2002:a63:82c1:0:b0:434:ac18:f6e with SMTP id w184-20020a6382c1000000b00434ac180f6emr26054913pgd.120.1663046288766; Mon, 12 Sep 2022 22:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663046288; cv=none; d=google.com; s=arc-20160816; b=qMTaPMqYk+uyrpIMX+305ChOkNHQVCVQUaDwDqu5z0tc1I8dTePMrlUobsSCPfE6Bu 98xUGLFgv341AhtJhuWDxUjrh8Urvp8RAv7tF0++fFtemsu/94LOGKUjGmBOAxhjZs66 DSh+2Ww2itJ3AQ0AJ/OJlU4VI/2mfd52/EHdFEDNWYM8Qx0VQYPusPlMlRn6ggjbqqnQ kMzfHRFrk7OJRBbS+zTc1RCPXUwDSXmOeM8sgI0g522/iiF0vUlpiRlFtGbG0X0NyWMj /fnhiDhSK/R/VZoTfe6eGB0dgeW7FSRIor5IS5UW6PCetSIH8QZUKZ1PhQwB5glbp+1P w3Lg== 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=zgd1qVlzDsdTRwbLMC38OejYHwZQH64q4iPUZenfhwQ=; b=MQv2Vvl/u+RKDKld3I/uJJAEu51mI/LgLdpaIhAyVhgW8tK8zxg8+4AfzmHjFwroOa Cca4bOYak3RXMsBJcs1W3SUA+tlb7IrxyR8pqB0PhGRlxUe4o+uHnYMPA7b2JU3QCWKB JwsSBg5x9NX+5DRiyN3pEkP/+a+Lr/o/q0MgWG9U8zsuA5MHJQUNj9F71vbVxlxskWqR h/5EUXmyDLGIicamW4YghyJySJnWIhOtuLT+0Hk2WOd7eAjrj2mN9iZGXag41Fydy2jA 51wqI5kniOjIVucNyGrSM11sXmf4QbNjEd6zaFgpxMa2CuoURuS4PuQg8mHrGwnfgIYy MXLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=YWThk6Pv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a056a00248600b0052e4de9b806si230862pfv.342.2022.09.12.22.18.00; Mon, 12 Sep 2022 22:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=YWThk6Pv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230079AbiIMFQa (ORCPT + 64 others); Tue, 13 Sep 2022 01:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbiIMFQG (ORCPT ); Tue, 13 Sep 2022 01:16:06 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 049564BA74 for ; Mon, 12 Sep 2022 22:16:05 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28D4iCDB018199; Tue, 13 Sep 2022 05:15:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=zgd1qVlzDsdTRwbLMC38OejYHwZQH64q4iPUZenfhwQ=; b=YWThk6Pv3VXG086sp2cnFL5uK4Swm4nBarU3lVe5Crpc3bLbDfvGu5NKP2XFw879yr0Y aIbCQLZpIyTN5ETY8owuNUgpob83xpZPdmnJgYDLv2lusoX0NJ2hdNZtVC4ziDo4YczC pu+1puTeWKuGlHIOiuvIEupIZndyLLZ2QTjS5jSiKiRjGArQPv/MWtwq07oLIFisRY4W WdtcCDCBySOOGbn5BI2e+g5cj2ZMo0tEBzCAEDoe/++nYHv+HEQ2jGGsRYPTfxHLupi1 Ad5LPwk9Rr0MqDQgtqGj/uW9cihaXDqPeey4f0FuphDiuhFP6/sy+XU5RzRz5F0RQ0uL UA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jgk3gx4wf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Sep 2022 05:15:56 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 28D5FtVx028584 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Sep 2022 05:15:55 GMT 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.986.29; Mon, 12 Sep 2022 22:15:54 -0700 From: Wen Gong To: CC: , Subject: [PATCH v3 15/15] wifi: ath11k: send TPC power to firmware for 6 GHz station Date: Tue, 13 Sep 2022 01:15:18 -0400 Message-ID: <20220913051518.23051-16-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220913051518.23051-1-quic_wgong@quicinc.com> References: <20220913051518.23051-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: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: -02bOd5t6BW6T4wKar29PQ2l7MnM3qG4 X-Proofpoint-GUID: -02bOd5t6BW6T4wKar29PQ2l7MnM3qG4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-13_02,2022-09-12_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 priorityscore=1501 spamscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 malwarescore=0 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209130023 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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); } -- 2.31.1