Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1859190rwo; Thu, 3 Aug 2023 00:21:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlG6OY8SuJCfViXUzM3YAmPOFauA1dysCszqfCAxfEEibUwTJ26tABigOltn+zYUJvVKwc33 X-Received: by 2002:a17:907:6e04:b0:99c:10b5:7650 with SMTP id sd4-20020a1709076e0400b0099c10b57650mr10236857ejc.1.1691047288039; Thu, 03 Aug 2023 00:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691047288; cv=none; d=google.com; s=arc-20160816; b=zRKmKqgbFobJ7nuBnE7tk8o5Db+BETazUbddZr2erI9MsDQVIPHqx0pkmj/95FwhOe qyqMfSNl0nFKaNsvZyUIDf3kfdhpbQ+/oHLjjL/P3TI/4m27BZGDmx1nImwNY4/tzfF3 2tqF8sDHT/v1TxK9jLrAvaAhIDhyU2GjPBWicu1AUqlcxlxpvfNmRs8eMUBkmggk/1tt SQKhAawtbBBb9isp1qK4t5QqRDTKaXmwP0BrKZOD6xGpnv+m5+CpT4OaWtzeeSe7oclh iRiu6QOSdlNQ7bDfiXpThUGDSXTPSMgTlkOui+Sn6DwjjeS/NnUq1rGbUdTl2s0VZb3e slWQ== 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=Tit6hcvJ3/QjBlvADZq4NfSLBl0vxQsMgWLL7FKFX3Q=; fh=9X4uyrLVy+sUpC9tSxcxDdRtPZz2EQPYPqoz97nK9c8=; b=0x4Grcduvvcw8cEE4i3tLs3/ld1tVD7KO2Fn/ZiyrFdnn6z5/TLC1AZbGylEuerZFV Dw/ZxDBDYUbTSQrZsUcfjXQm4RnLwMdf6BqKs0WAD4t9Am2ntV2TAgE50uuOE4RA4qPU aAlltuE6NYjpecDRTdpamje2sc26dhAtBsviKp4G/ndzs+UGSSH19xvRd/nX8g+YRsvr fElkH7Xaq1hu5dajgnAs5xRhuKpGtVV8jGgbWMFrT7s/3aaeiylwvbibvzQirOq/VdW6 PGXi9sAK1ZE3066VGrkgLXX1wBlJbErEbH6Lx6DtDHKAXZn8QxOmeOfN3OXdqjJm58TK UyNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gTI18zta; 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 oq26-20020a170906cc9a00b0099b5c6c643fsi6966020ejb.316.2023.08.03.00.21.12; Thu, 03 Aug 2023 00:21:28 -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=gTI18zta; 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 S233564AbjHCHRb (ORCPT + 58 others); Thu, 3 Aug 2023 03:17:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233243AbjHCHR3 (ORCPT ); Thu, 3 Aug 2023 03:17:29 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97F2F2D5F for ; Thu, 3 Aug 2023 00:17:28 -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 3735trZR004327; Thu, 3 Aug 2023 07:17:24 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=Tit6hcvJ3/QjBlvADZq4NfSLBl0vxQsMgWLL7FKFX3Q=; b=gTI18ztazdLoZgD3XwN/qWNZ8hox3uKXVRPTGCfQYceOpPQya7QhnmFS47YuPP1pg/xj XqMqnE+MXLmgvEe+b5iOidD+Hsnu0pswB2P9v12CrtteZi1oN9BTKwesAmoU3sKUioa0 cGvVgpdMACB0FlQ9yiS4Pa3znbmTdKYU935eqUC2wbwZiiD/SVpZKA1m+2qA0R90BiND wuW+xTJ1BIrEFN6a5XmC05f5axw9pqfBv9PKmPB4hM9b8FClmxiGGvx2ZG03reQS0d3L eehTsAm/W/hIZywFdrC3/iHoz1n6CbmixJSjdp5oUJqfDv3WP14yTqX/jb/koYgE3fdX QA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s7sgnhhef-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Aug 2023 07:17:24 +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 3737HNLB030945 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Aug 2023 07:17:23 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.30; Thu, 3 Aug 2023 00:17:21 -0700 From: Wen Gong To: CC: , Wen Gong Subject: [PATCH v5 4/5] wifi: ath11k: update regulatory rules when interface added Date: Thu, 3 Aug 2023 03:17:00 -0400 Message-ID: <20230803071701.15084-5-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230803071701.15084-1-quic_wgong@quicinc.com> References: <20230803071701.15084-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-ORIG-GUID: X8AcQHSAIFz9u2_FXwFUyKwnikUEpf18 X-Proofpoint-GUID: X8AcQHSAIFz9u2_FXwFUyKwnikUEpf18 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-03_05,2023-08-01_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308030064 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 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 --- drivers/net/wireless/ath/ath11k/mac.c | 14 ++++++++++++++ drivers/net/wireless/ath/ath11k/mac.h | 2 +- 2 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 8c77ade49437..d9d223d80819 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -6714,6 +6714,12 @@ static int ath11k_mac_vdev_delete(struct ath11k *ar, struct ath11k_vif *arvif) return ret; } +bool ath11k_mac_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; +} + static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { @@ -6939,6 +6945,14 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, ret); } + if (ath11k_mac_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; diff --git a/drivers/net/wireless/ath/ath11k/mac.h b/drivers/net/wireless/ath/ath11k/mac.h index e4835e0b7998..db59d6cac4c9 100644 --- a/drivers/net/wireless/ath/ath11k/mac.h +++ b/drivers/net/wireless/ath/ath11k/mac.h @@ -155,7 +155,7 @@ 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); - +bool ath11k_mac_supports_6g_cc_ext(struct ath11k *ar); 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); -- 2.40.1