Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6131106rwn; Mon, 12 Sep 2022 22:16:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR56NhdQdq0aojvQQ/1DPBbNwP6zNl4zuU0cPEipNyQRIT7RHfxR95YFy5F0lFIYHF9HNDed X-Received: by 2002:a05:6a00:1503:b0:540:e2c7:2387 with SMTP id q3-20020a056a00150300b00540e2c72387mr20271130pfu.48.1663046218238; Mon, 12 Sep 2022 22:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663046218; cv=none; d=google.com; s=arc-20160816; b=E7iTw430nC8M20ROuoK433T53y0gJlprR+cup4ioOySp4e8X+VI2C9/w1Y8+/Zh8J0 IUBq2dgc8KL35djYe2l3Hy4eU2Ttjt+1rtWKf56kFHUuTo19QHUHnApIm7JgBuB7wHub ahXw50Zcd9qvAhFfAN3HQkSM+wx0lC17hJkR034pQ64YkD3Jp3t8ExpMgIUE5zPzs1op Z0dpCBxlvyb5lcPVU/WQ8PG41+kBlKLNHYOkeHvf0JhK1RqdBDR4ouYAJHye/pTu8R+4 O7RNwz30b6ba4UQfRbus9r8KKv/IsPSMwCAXzDrzPkRlMCInCFJ62rGPKyWKtZeVN0tF D5sA== 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=6pUrSYGayLlBM3YlPgtaNKECZuj3PHuIRNHg8mqvdig=; b=NIiS6IrZCP1jO/eRFgbfaI9iz4LT8n0DS8tsmKJOxv96hOxAEhm+EhZoReA/kyHm5G 9CqhZaTJ3yUjmljoPpXcUvM64pg5+YOES19SBJgqPoGeAkqE/ypSiYItueBW1CBCBGWH yW62pOEwBMiOLITaXDM8glLfdsflefvzcY2yGjNJUYtzo+KNeLXmZXU55gcnO8NvxAxM 3xXm9qX1c16yoqltaEerWw/fAX7/7JgZ9T6rq3vmLE4zrpdOJbbmDPafdsYcAQI9YvR7 OnRQ3on4BcdANV0IcQvgk4Ox7wU4G6yoFQfoeZjnxJGe60wAzeaNynAx+iYiTvImuh3o +wmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=VmFa4t0u; 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 c6-20020a056a00248600b0052e4de9b806si230862pfv.342.2022.09.12.22.16.50; Mon, 12 Sep 2022 22:16:58 -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=VmFa4t0u; 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 S229977AbiIMFQW (ORCPT + 64 others); Tue, 13 Sep 2022 01:16:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbiIMFPt (ORCPT ); Tue, 13 Sep 2022 01:15:49 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B142C4BD02 for ; Mon, 12 Sep 2022 22:15:48 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28D4hdnC018955; Tue, 13 Sep 2022 05:15:45 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=6pUrSYGayLlBM3YlPgtaNKECZuj3PHuIRNHg8mqvdig=; b=VmFa4t0utadYZwYaU4EGjlihv2YZ/GrS/TimlLWECllI8NyrqKZWe3rWoK/jEnLfiW7U DThu5PLqF72dcHUA8K/CitBVb1+IUhaqFR/IiOcWfrEUeId2RJjPn8Wknp/dH73SqXmY GhcPFS9c13+WXVbkIj1M49yVd3oZGzxFJOmQisGo8A4qfSEtL26akBbLRTso/eR6+MiQ KIoxdrkAHl4ueOFN9PIyKepFlX7o77kMb41+Xw5Hg1MobVOhzIEHCLH4fMMBfWXdcI3k FVqG6RtWEGD0xEw3t308NtHds9eDPowOGAC7b8ujhj32xLJFndREeqhigMc7TIZdFxpC Bw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jgk6ke4cw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Sep 2022 05:15:45 +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 28D5Fiht028507 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Sep 2022 05:15:44 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.29; Mon, 12 Sep 2022 22:15:43 -0700 From: Wen Gong To: CC: , Subject: [PATCH v3 07/15] wifi: ath11k: update regulatory rules when connect to AP on 6 GHz band for station Date: Tue, 13 Sep 2022 01:15:10 -0400 Message-ID: <20220913051518.23051-8-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220913051518.23051-1-quic_wgong@quicinc.com> References: <20220913051518.23051-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: r5Wv4DtmiLKs_4Uh-trSk2cgmqMfI0No X-Proofpoint-ORIG-GUID: r5Wv4DtmiLKs_4Uh-trSk2cgmqMfI0No X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-13_02,2022-09-12_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 adultscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 phishscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209130023 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 When station connect to AP on 6 GHz band, it need switch the regulatory rules according to the regulatory info subfield in HE operation element. Swith to the power type of AP for station mode. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong --- drivers/net/wireless/ath/ath11k/mac.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index fc9556a1327e..a18b12abb63d 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -6998,6 +6998,8 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, struct ath11k_vif *arvif = (void *)vif->drv_priv; 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); @@ -7005,6 +7007,17 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, "mac chanctx assign ptr %pK vdev_id %i\n", ctx, arvif->vdev_id); + if (ar->supports_6ghz && 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) + power_type = IEEE80211_REG_LPI_AP; + 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.31.1