Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp500856rwd; Wed, 7 Jun 2023 03:04:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BpTfmGCw5aq1cWoza7IhKVY9TvoFerN3xGpRvloGBx4mvqzc9YIKJkSn91h0JAOKszBjM X-Received: by 2002:a92:c984:0:b0:33d:1223:cd70 with SMTP id y4-20020a92c984000000b0033d1223cd70mr4632082iln.4.1686132271172; Wed, 07 Jun 2023 03:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686132271; cv=none; d=google.com; s=arc-20160816; b=m8g7jBy49YMF++FuqpTPkaxD/4Tez/FHy7vDnuFHkEuZtMHwd1d0Vl1DuEcwXBRCGJ abQgsnuzpWy2QR13QXe53q9xeclOgukrJi7wEfxs8FX3QeUZvZOqPBLgp9jbKnp+73Kj Gp/Ufo5ZyEE+b7zr74Wu2am9UmCMxalyaftKHzVdXxih/vfIaqMIlYaoCWfwfUIUFBbM lbRTPz05Gjj1uta7QTu5p+k79uJ+0J9lCSK0LexcsmuIFz8VMrhlSNxJ+V01NjTwS6j5 I8qQaUi1CEC66wSiY5RCDFYWi9Ysdda75J+Oi8wiGeeJM1l8gXlhgNMLjTOiwawGc/Nu RpDQ== 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=tiNXjNqM8wXMAhZylLl7A1A8Me1ss4cIvvLUheeZ4iM=; b=bi9+WzYbzKSWTMVrPIUSjdx3apjinfVPemqtsCwWcj+7LXx2MDF269ZFaL9kfVUi9a TIAxNW5H3vYa+F93kMKKEK3yqiGVcwW4bO3aRSCrC3WO+NE5sWeJ9e9B5X2e8qKTi11C cYo2+A2XQ8AOkU/Teci+/ILIJZUfm9olEPPMzcAnFDzW13TeEyGs29n90SptMslSoVpf HHs8d2e/NpdN/Q334NSzFId3viqtek1PyLaQsHAXEgno9Vzsk7OXO/Qa9XNu+oK+QGE6 iJi00Z0rutE4tG4WasXGLT2/dzAMGdYpPEX6e2o28HNT8Ib52F6gJuFybIa5eemhBi1O 7K8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=k1qxNDhF; 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 z15-20020a630a4f000000b00542924cbf7bsi8628912pgk.233.2023.06.07.03.04.15; Wed, 07 Jun 2023 03:04:31 -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=k1qxNDhF; 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 S239592AbjFGJsz (ORCPT + 61 others); Wed, 7 Jun 2023 05:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239354AbjFGJss (ORCPT ); Wed, 7 Jun 2023 05:48:48 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B79CAE79 for ; Wed, 7 Jun 2023 02:48:46 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3575UgP5026813; Wed, 7 Jun 2023 09:48:42 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=tiNXjNqM8wXMAhZylLl7A1A8Me1ss4cIvvLUheeZ4iM=; b=k1qxNDhFqXmY5UtE/tRJBz4OCP4Zcgf8ihB3TMwzqXs6lMcKFLAznFE7XUTHw/yJNFra dg+8oFXeHPAvnoeRVhqhBLCrIAYQrxrl5MdJnvmr9BsRIcIhs99oXE6UhuzC4Mhxoyaz 9THadCs6L8IwVyv/VjDEXqdQX+iTSa8TfoXh28qGr4Vha1a+i4reFgtZzgL7MP/nfCxn LuIVAUdfbV29I9B+G2oBA9xYCm/GYYAYhoocnIr/CDhVS6pBk0ra34rApJP4s2V6jcTF DBAwk5gYcNIT9TJiecFQFsRlAOa6TA0eJX5o9Ucvfu4gIakGAiulvJnv7jMtNn7Z/PZ4 Sg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3r2a9thfur-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jun 2023 09:48:42 +0000 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 3579mfmP026589 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Jun 2023 09:48:41 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.42; Wed, 7 Jun 2023 02:48:39 -0700 From: Wen Gong To: CC: , Wen Gong Subject: [PATCH v4 4/5] wifi: ath11k: update regulatory rules when interface added Date: Wed, 7 Jun 2023 05:48:09 -0400 Message-ID: <20230607094810.26707-5-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607094810.26707-1-quic_wgong@quicinc.com> References: <20230607094810.26707-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) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: S36FHIAOGLTcbh0y2qtPK-e-dvkTD69i X-Proofpoint-ORIG-GUID: S36FHIAOGLTcbh0y2qtPK-e-dvkTD69i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-07_06,2023-06-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 adultscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306070079 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 wlan boot up, WMI_REG_CHAN_LIST_CC_EXT_EVENTID is sent from firmware at an early stage, the interface mode is not decided at this point, then ath11k select reg rules of AP mode as default. After interface is created, it is exactly decided AP/station mode, then ath11k need to update reg rules to the exact one. 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/hw.c | 6 ++++++ drivers/net/wireless/ath/ath11k/hw.h | 2 ++ drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/hw.c b/drivers/net/wireless/ath/ath11k/hw.c index eb995f9cf0fa..15006bb67a5a 100644 --- a/drivers/net/wireless/ath/ath11k/hw.c +++ b/drivers/net/wireless/ath/ath11k/hw.c @@ -897,6 +897,12 @@ static u32 ath11k_hw_wcn6750_get_tcl_ring_selector(struct sk_buff *skb) return skb_get_hash(skb); } +bool ath11k_hw_supports_6g_cc_ext(struct ath11k *ar) +{ + return (test_bit(WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT, + ar->ab->wmi_ab.svc_map)) && ar->supports_6ghz; +} + const struct ath11k_hw_ops ipq8074_ops = { .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, .wmi_init_config = ath11k_init_wmi_config_ipq8074, diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h index 6a5dd2dbdb3a..00fe1c5edd06 100644 --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h @@ -319,6 +319,8 @@ static inline int ath11k_hw_mac_id_to_srng_id(struct ath11k_hw_params *hw, return 0; } +bool ath11k_hw_supports_6g_cc_ext(struct ath11k *ar); + struct ath11k_fw_ie { __le32 id; __le32 len; diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 75843af7bac7..f586b37336b0 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -6639,6 +6639,14 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, ret); } + if (ath11k_hw_supports_6g_cc_ext(ar)) { + struct cur_regulatory_info *reg_info; + + reg_info = &ab->reg_info_store[ar->pdev_idx]; + ath11k_dbg(ab, ATH11K_DBG_MAC, "mac interface added to change reg rules\n"); + ath11k_reg_handle_chan_list(ab, reg_info, IEEE80211_REG_LPI_AP); + } + mutex_unlock(&ar->conf_mutex); return 0; -- 2.40.1