Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2556401rdb; Mon, 4 Dec 2023 00:14:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaTVLzYkZDfpsMAE3MS1xzDpqV9tS4zw8ZrKHOoSRIPykJXcH8i2GJziFnvqPhWbDGCmgc X-Received: by 2002:a9d:748b:0:b0:6d9:9ef8:84b7 with SMTP id t11-20020a9d748b000000b006d99ef884b7mr1323555otk.26.1701677644991; Mon, 04 Dec 2023 00:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701677644; cv=none; d=google.com; s=arc-20160816; b=s41il2UbWCofnKaTU1bkVbYqrVhd9ssi0rpWF4NAfp+M1cfAxKNvRqjDX3J+kuPDmk /0quUAMpK16LZlTR/GBDavZev6hgncgoLGsG4tfgcv66qBn6U0VYPZFZsdKwv0QApMBW u0/eUw6K1vYHRarwXnKV0bFyP2+QXCemOg/UfahSOPOGlHJ1t4tHJshLgcOxEwE+izjV b0D2FiYY7f24cc0GZS5TqlrIqaoH0eBw5yCCRjW7Frxgi70Y9YrwUJMz0XOvNFUC0pT/ zFlFy0mrx508e25Tw9bNFSZ+t2XpfH+ba5cNJyT6gxIQOatm0C/D629N8pjL9Ryf8+S/ W8AA== 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=zckhU6XXrFTdhtAORHJZy/WUb4YCCPg2rHd44PDAeGA=; fh=HNEfiow5aIDtnUkYYiB/tbonwaEcG8+i6SMa583BOko=; b=aL63qiIwum/PMxwE0TKiAauuwBuR+cYbpbxwR6O+8fg5Aa0u9omAjqs0/X49YtLxkw KVfZlhFGD2WddbyI9nfI9f5nfFP6uFpphhh/pZQjt+mUsy+JdWmONq4kDs+aE1q+BlMt ICjHIQMwvBLpL/vwpudDx9hGkjmiP3Q46EpT6L7JMqgjeG3up0auHLStEhE7PI4bii/C xM1ijCusSo4tqE+bAMVoq/4gePTQRVZ1Psz0EScALPVcIuth/TRzIz1+lBV3HlnxCd+O uHYI8uWl+T3N93z3DE834Ngrzrf0yGaYIG1IaxBoHhY7B1GEHJFs4vHC8Vk9cggfHjvd DvsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QzRryxFw; spf=pass (google.com: domain of linux-wireless+bounces-361-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j34-20020a63fc22000000b005c179c00758si7530431pgi.891.2023.12.04.00.14.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 00:14:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-361-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QzRryxFw; spf=pass (google.com: domain of linux-wireless+bounces-361-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-361-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 17EEE280E33 for ; Mon, 4 Dec 2023 08:14:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D35F2F9EA; Mon, 4 Dec 2023 08:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="QzRryxFw" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87076F0 for ; Mon, 4 Dec 2023 00:13:46 -0800 (PST) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B469wZB013912; Mon, 4 Dec 2023 08:13: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=zckhU6XXrFTdhtAORHJZy/WUb4YCCPg2rHd44PDAeGA=; b=QzRryxFw0TZthy9Z0/QOoX8TkEudqPb5jqQKXQw8JojjSJ9sRTJtvlOqhmJ/hA30pFBY AkhBhHeT54oTmw8r/I/Dl8gMGtcCcV9Xd59eLGGlhwHwvZ/iOtFZ5mAuKp11YMdYx+pC S6+J8wIjm03V0Ok78+3MNyVEmWm2SkL+rloJVrwWuUn8GEMrB0tmMcTAELKttPwreWjE eVdQsvPshGfdel2A0f90PUVx//BGzH8PC1BBDgSjPWoSwvRkwmWYGDQVeAUNfRYvtSaF HSF0Qg/Cjyg2MhFcbGtdwpl9Q/kH9RI50qvYELpg9g/cTbOywJPzvvRnuV0jjH88m0py gA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uqvp13cem-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Dec 2023 08:13:42 +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 3B48DfI8026271 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Dec 2023 08:13:41 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, 4 Dec 2023 00:13:40 -0800 From: Baochen Qiang To: CC: Subject: [PATCH v8 04/12] wifi: ath11k: update regulatory rules when interface added Date: Mon, 4 Dec 2023 16:13:15 +0800 Message-ID: <20231204081323.5582-5-quic_bqiang@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204081323.5582-1-quic_bqiang@quicinc.com> References: <20231204081323.5582-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: r_tfC2Smy9Kvf5Hdv0XnwfVZ-8t_PGrI X-Proofpoint-ORIG-GUID: r_tfC2Smy9Kvf5Hdv0XnwfVZ-8t_PGrI 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-04_06,2023-11-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 clxscore=1015 priorityscore=1501 adultscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2312040061 From: Wen Gong There are two power types for 6 GHz regulatory, one is AP, another is client. 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 type as default. After interface is created, it is exactly decided the interface type such as AP/mesh point/station. Then ath11k need to update reg rules to the exact power type matched to the interface type. The client power type is used for station interface, and AP power type is used for AP/mesh point 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 --- v8: no change. v7: 1. move ath11k_mac_supports_6ghz_cc_ext() to wmi.c and renamed as ath11k_wmi_supports_6ghz_cc_ext(). drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++ drivers/net/wireless/ath/ath11k/mac.h | 1 - drivers/net/wireless/ath/ath11k/wmi.c | 6 ++++++ drivers/net/wireless/ath/ath11k/wmi.h | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 7f7b39817773..1e314fcab41b 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -6943,6 +6943,14 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, ret); } + if (ath11k_wmi_supports_6ghz_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; diff --git a/drivers/net/wireless/ath/ath11k/mac.h b/drivers/net/wireless/ath/ath11k/mac.h index 774a9f01c030..498e537cd695 100644 --- a/drivers/net/wireless/ath/ath11k/mac.h +++ b/drivers/net/wireless/ath/ath11k/mac.h @@ -156,7 +156,6 @@ struct ath11k_vif *ath11k_mac_get_arvif_by_vdev_id(struct ath11k_base *ab, u8 ath11k_mac_get_target_pdev_id(struct ath11k *ar); u8 ath11k_mac_get_target_pdev_id_from_vif(struct ath11k_vif *arvif); struct ath11k_vif *ath11k_mac_get_vif_up(struct ath11k_base *ab); - struct ath11k *ath11k_mac_get_ar_by_vdev_id(struct ath11k_base *ab, u32 vdev_id); struct ath11k *ath11k_mac_get_ar_by_pdev_id(struct ath11k_base *ab, u32 pdev_id); void ath11k_mac_drain_tx(struct ath11k *ar); diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 6f0a35fcc9c1..9a0568676a74 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -9858,3 +9858,9 @@ int ath11k_wmi_sta_keepalive(struct ath11k *ar, return ath11k_wmi_cmd_send(wmi, skb, WMI_STA_KEEPALIVE_CMDID); } + +bool ath11k_wmi_supports_6ghz_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; +} diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index d46c70704774..fa85e6eb4ab4 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -6485,4 +6485,5 @@ void ath11k_reg_reset_info(struct cur_regulatory_info *reg_info); int ath11k_reg_handle_chan_list(struct ath11k_base *ab, struct cur_regulatory_info *reg_info, enum ieee80211_ap_reg_power power_type); +bool ath11k_wmi_supports_6ghz_cc_ext(struct ath11k *ar); #endif -- 2.25.1