Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1834217rdb; Thu, 21 Sep 2023 00:16:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6+63+cuH0NM8MhRf4e9v27JxOHV+r0FoXgob6MIuksxs+33fOjgseIZX3RP2VeKKzScfn X-Received: by 2002:a17:903:2786:b0:1c5:6309:e1e2 with SMTP id jw6-20020a170903278600b001c56309e1e2mr4492597plb.48.1695280590679; Thu, 21 Sep 2023 00:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695280590; cv=none; d=google.com; s=arc-20160816; b=Z04WI0VFkv4sMxwrJi+mk/fv4WceR1OAr9y7tnU2YSyNJzvqSFXZ4Rrr/oFea5CxNh oyPtB2ggYQ1UUAsIYpDHl1RELBRYmQaXMNl06rX9qRcAxJlP4gTsz/BNNlN0VI9ugNwY lbm/OLN780HWF4RYrfVjQ49oBb7K0S6cyqti/Mg+UY2D9T21mis1Bf9E+lXY3hKyS/pK 6C6qFpvEeFqNi3OmFmPyOLA/jpxCgTj2ya7YptVWkK44byhjttXnflWnhb7bg5IBCfPL CIJQrgEA+1GGlT0J00VTlCz4FzO4ZwJvcOKyr7vaxM1lqV0XlfzOKfVR15MCFp7oTNBH RGSA== 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=VLJpq2idVqH8ykfT5tytYv41EGlmcWFkQ0RuFhFvsZA=; fh=a9RQep1hjU/4gjvnAyyZ/jgKZXxYhr894cgqq3v+6lI=; b=L9hgvlML3iYGyF/xXzYRG195RGR5766kSK7lsoqUcnS0kCfwZGSR21XezOyFEGwxBg +1TNWYn5ypF3wMPuOTf9JEpPVXpiiLDg3eH6brYQZ8z8oZUN5avJx9J1FVxVgmz2p5up k3F9QBDYJCj8ta7JnzL2qtKLIHaotG2NigN0b7Cgl58XEJoAkllK+R6fUawSmKYfndFY nO3X1ybvV2IofPc7lsdifcu3s8HUTYTJhJu8QJXRHGPkH4daLgpiUwYd5tt9onadDrNH Mv/4qQPCDBKsreFtvDqkPya9ZwTw3l1IkCgNtXfhxYxw6D9qM60QAsVNSrVsxvZc5PcA jMlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mZJQ7YXi; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id e18-20020a170902e0d200b001bd9c43c896si764386pla.287.2023.09.21.00.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 00:16:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mZJQ7YXi; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0BEF7826376A; Wed, 20 Sep 2023 01:24:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233409AbjITIY5 (ORCPT + 56 others); Wed, 20 Sep 2023 04:24:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233756AbjITIYq (ORCPT ); Wed, 20 Sep 2023 04:24:46 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1EBAEC for ; Wed, 20 Sep 2023 01:24:31 -0700 (PDT) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38K6ovmD022153; Wed, 20 Sep 2023 08:24:28 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=VLJpq2idVqH8ykfT5tytYv41EGlmcWFkQ0RuFhFvsZA=; b=mZJQ7YXiFJRB6N8/De1lgFqegBUYL3aWnIVdDFz4S4N/D0iG6l81Ucm0c3nv7MV/BZNT B7QBVbSGRvE1p/IbEJnrV0Hz0oiJFJHqyZP8q0x6ZyQ992Bs/aZbX+mnshiMmPDkqXzf UWQw8EzlpgNoFdcolQOKdDChfO28lgG3HE4S05yX180OokjiRbGLZLyUHmgmu5KHyxdk PjHnY5LWQQ+tpE430wdOsTvDTAXORccP1pjSjlH8wehAIk/e0jlS9eh554AgEn3w+A0K IUsKMF0msncghdAzGbWlCK42P2M4zZ357vPMnOE1EZ8KiboZZRQCLadjHrqlqpdy1mih CA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t78upjmj8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Sep 2023 08:24:28 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38K8ORi6006204 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Sep 2023 08:24:27 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.1118.36; Wed, 20 Sep 2023 01:24:25 -0700 From: Wen Gong To: CC: , , , Subject: [PATCH v6 11/13] wifi: ath11k: discard BSS_CHANGED_TXPOWER when EXT_TPC_REG_SUPPORT for 6 GHz Date: Wed, 20 Sep 2023 04:23:47 -0400 Message-ID: <20230920082349.29111-12-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920082349.29111-1-quic_wgong@quicinc.com> References: <20230920082349.29111-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-GUID: owjiQHBUJd9khcJdJyLW6RPc-DSSRMqa X-Proofpoint-ORIG-GUID: owjiQHBUJd9khcJdJyLW6RPc-DSSRMqa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-20_02,2023-09-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309200067 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 20 Sep 2023 01:24:55 -0700 (PDT) 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. When firmware support SERVICE_EXT_TPC_REG, it means firmware support the second way for WMI_VDEV_SET_TPC_POWER_CMDID, then ath11k discard BSS_CHANGED_TXPOWER flag from mac80211 which is used to the first way for 6 GHz band in this patch and select the second way in the subsequent patch. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Wen Gong --- drivers/net/wireless/ath/ath11k/mac.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index f05d66913abd..a8ae281d2635 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -3396,6 +3396,18 @@ static int ath11k_mac_config_obss_pd(struct ath11k *ar, return 0; } +static bool ath11k_mac_supports_station_tpc(struct ath11k *ar, + struct ath11k_vif *arvif, + const struct cfg80211_chan_def *chandef) +{ + return ath11k_mac_supports_6ghz_cc_ext(ar) && + test_bit(WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT, ar->ab->wmi_ab.svc_map) && + arvif->vdev_type == WMI_VDEV_TYPE_STA && + arvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE && + chandef->chan && + chandef->chan->band == NL80211_BAND_6GHZ; +} + static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, @@ -3595,9 +3607,13 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_TXPOWER) { ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "vdev_id %i txpower %d\n", arvif->vdev_id, info->txpower); - - arvif->txpower = info->txpower; - ath11k_mac_txpower_recalc(ar); + if (ath11k_mac_supports_station_tpc(ar, arvif, &info->chandef)) { + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, + "discard tx power, change to set TPC power\n"); + } else { + arvif->txpower = info->txpower; + ath11k_mac_txpower_recalc(ar); + } } if (changed & BSS_CHANGED_PS && -- 2.40.1