Received: by 2002:a05:7412:b112:b0:f9:3106:f1c0 with SMTP id az18csp128134rdb; Mon, 18 Dec 2023 00:59:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/GmKbNOToLuQNHcRN51yOox3kr7kdpYSezfv/9oUMprYOqdMV9T09w4v+73TQ2CfTcNIw X-Received: by 2002:a05:620a:2a0b:b0:772:6400:f111 with SMTP id o11-20020a05620a2a0b00b007726400f111mr19276564qkp.47.1702889963250; Mon, 18 Dec 2023 00:59:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702889963; cv=none; d=google.com; s=arc-20160816; b=MZ/OG2t/DgGbe2JarGONvKzXUBJ4LItWlZjxjrw+MJfa2ZqL9GKWZpUh6ChXcAKcBI LLanY4dHD0WhCjvz6FEbv3LjNzLVtNcmsbXlsfWr5JRG3qGpknvPDOP6q/4JVpmZI586 0O8Bz2pQGR31oh4o56K0/+Whc/U3M6se5fW4SEBHjIv1v6cAKI4T3R1BBtNNyU+s5Pf6 /hCJLNgh0hhfoO2Q3wAk+La+Cvdmr4gBK8woRpA9lLN6YxEfCfIR7M17XTkU5up4IRNW gDmGk6clQox/JQG4D5w4KxI8F4DZPQNdo3W+wcT7M5wEG8nvAUSwSEShnEC8YXlBXDpG yugA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ekHcqUVUyY7PLtUDeiVj/QlQArz1zheyHRzhJd7iycI=; fh=HNEfiow5aIDtnUkYYiB/tbonwaEcG8+i6SMa583BOko=; b=MIXE0TQu0osRUGpDULSuHMR1foSXf5YM5D8af1U9syUeLUKef7CgtrnqPtP0AnFzsf slGgv3c61htz2ITuFuWpT9ZCqmlzjQDP4OACqKpAmblYcHVA81ig0xfV9HWBg9YVzFhA kq/2BdXjcmk2EG3rpmceWB/U5oweBqf1/1Qr/y+RIVGxgei5i/zdpeLvUmQv2EUuneje 9iCnJ4HR1nz7lszbcRT4otdq132hkgwvzxo72oZZtm7lKIeuUrYfFEoZmUmH9tNMAKLh 6wyZks0WJMS4Nl/nSAR+oD5zRHkl6nLRc8vSQbXuSpg7UmfCzDJR0A0EcEl820ajExIc jMkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IjES8jjp; spf=pass (google.com: domain of linux-wireless+bounces-897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id oq2-20020a05620a610200b0077dcec33533si21747182qkn.201.2023.12.18.00.59.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 00:59:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IjES8jjp; spf=pass (google.com: domain of linux-wireless+bounces-897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 07CF41C22387 for ; Mon, 18 Dec 2023 08:59:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3BA3111B9; Mon, 18 Dec 2023 08:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="IjES8jjp" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E05E11185 for ; Mon, 18 Dec 2023 08:59:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BI7tQL2010567; Mon, 18 Dec 2023 08:59:03 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=ekHcqUVUyY7PLtUDeiVj/QlQArz1zheyHRzhJd7iycI=; b=Ij ES8jjpdzikktPj5DWeU6k3DBJZ9xCIMqOxGNDvX1M0IiAEPexiat93zKsT2rDeNE 03R79Ebw0+rVNr6uB8DiUiAuvM6fYIypKsgfXOacUBGJs8zFic5jxKG9Izjvjnvt 5HttquGL7mOTctub+cY/XIug/rC3878Gor0YLmkUsMR6OFOcqfnH37Ygq10P7ftJ 0OykM5d56DdWgLusWBBBeKmDfwZzuoxsj866R5Qk3Yh3E0js96WrQKIrCwkT+Drx h7MomJmr5+kCOLDaXwQfIyEvxgLx2IbiSTQxwAgFBsat8N9aWBQJKz5J2am24pGG ZMu8P6AbqzCCZqgrTIRw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v14xy3sdy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Dec 2023 08:59:03 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BI8x23b003160 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Dec 2023 08:59:02 GMT Received: from bqiang-Celadon-RN.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.40; Mon, 18 Dec 2023 00:59:01 -0800 From: Baochen Qiang To: CC: Subject: [PATCH v10 05/12] wifi: ath11k: update regulatory rules when connect to AP on 6 GHz band for station Date: Mon, 18 Dec 2023 16:58:37 +0800 Message-ID: <20231218085844.2658-6-quic_bqiang@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231218085844.2658-1-quic_bqiang@quicinc.com> References: <20231218085844.2658-1-quic_bqiang@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: T-aTVh-TBjOozNwOyoiGctKHtDzkAMGH X-Proofpoint-ORIG-GUID: T-aTVh-TBjOozNwOyoiGctKHtDzkAMGH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 phishscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312180063 From: Wen Gong When station connect to AP on 6 GHz band, it needs switch the regulatory rules according to the regulatory info sub field in HE operation element. Switch to the power type which AP used for station interface. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Wen Gong Acked-by: Jeff Johnson Signed-off-by: Baochen Qiang --- v10: no change. v9: no change. v8: no change. v7: 1. return -EINVAL for IEEE80211_REG_UNSET_AP. drivers/net/wireless/ath/ath11k/mac.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index c7e7fef7946f..8eed1be63a8a 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -7619,6 +7619,8 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); int ret; struct peer_create_params param; + struct cur_regulatory_info *reg_info; + enum ieee80211_ap_reg_power power_type; mutex_lock(&ar->conf_mutex); @@ -7626,6 +7628,20 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, "chanctx assign ptr %p vdev_id %i\n", ctx, arvif->vdev_id); + if (ath11k_wmi_supports_6ghz_cc_ext(ar) && + ctx->def.chan->band == NL80211_BAND_6GHZ && + arvif->vdev_type == WMI_VDEV_TYPE_STA) { + reg_info = &ab->reg_info_store[ar->pdev_idx]; + power_type = vif->bss_conf.power_type; + ath11k_dbg(ab, ATH11K_DBG_MAC, "mac chanctx power type %d\n", + power_type); + if (power_type == IEEE80211_REG_UNSET_AP) { + ret = -EINVAL; + goto out; + } + ath11k_reg_handle_chan_list(ab, reg_info, power_type); + } + /* for QCA6390 bss peer must be created before vdev_start */ if (ab->hw_params.vdev_start_delay && arvif->vdev_type != WMI_VDEV_TYPE_AP && -- 2.25.1