Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2479948rdb; Wed, 4 Oct 2023 02:27:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1gopz/wR9lb7p/jJtC/h2ImGmNyNEhLgwnEpqQzxrDdGnaG3ghdeWXUbUBTYwDWAkmr42 X-Received: by 2002:a05:6358:2817:b0:12b:da97:aba6 with SMTP id k23-20020a056358281700b0012bda97aba6mr2015432rwb.24.1696411643142; Wed, 04 Oct 2023 02:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696411643; cv=none; d=google.com; s=arc-20160816; b=sIQJPzEmuUMhqjsieBRdPfBVYh8RDsO7OhQ+THCCHjccgsw0C6V6xjHzcFUoVi2RTZ anqyp05j8U6zrJduKy7UC26YdmGy8VkXtvGHDh5Y+66d3VgQkrhewzH7/YvkDDf17MJn YGUx0+O0F0aDRt3XTkmLmFb9xTw+H+OUlQFhPR+rC7eZXjNuU8KFqwCExYF6I+yr0XQu Pk23EWfD4IVJ8gRix4x/0kRaUb99Tg6/gup0C86H55ZT5850MFqbi1U7JQ2jiWo+/J6q t5rKVBj2qywB7TFumQa+RlKetmeeB00KKLTjBMBBipmGQw0rg3AqpZzEXbbUZZd1GCvK VgTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=TL/VZuhUuPOqA3p7Frj3xe/JUomdScXO27AxeCPEM2s=; fh=fn+Zqo73oZtzcXZdwuzvRJO8zfOs/ZAYnpgW3+3ni4M=; b=Vza0yw7db2DWObNCpu2KkDJPaSPAQ+nqwEYqWe5BhqOk7KLisx83bWIfecoYjx5BPp b9+h+7XO5kCaR9R8qkJc2kv+xWrNNxq5B3yy3zT1eA7xzCnh4QcADZ+t07ufv/W2Ntcx 19qJ8I8Kbp0/YoNsCfjgcMf4uCUxkOttxe6NYSxYi4ptVfA9qpLbkoCRudAP7Y7U5hGW uCQcd4Vp0HPwLN+W+psHbvEtGqv0ULtT4W+0z10Zr6O9cfMKz2tAouxeANhzUfY3NODJ 3f6Gfq2sTHy+9sXAQJsYIgnKIU/PcsHpqkSKVRG73dm/6hhN/tdMbjGxqvq2TRnpYF/8 ZRgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OaXelCvm; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f4-20020a17090aa78400b0026d40e6a819si1059845pjq.157.2023.10.04.02.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 02:27:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OaXelCvm; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4031881972C1; Wed, 4 Oct 2023 02:27:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241786AbjJDJ1T (ORCPT + 53 others); Wed, 4 Oct 2023 05:27:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232947AbjJDJ1S (ORCPT ); Wed, 4 Oct 2023 05:27:18 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1754A7 for ; Wed, 4 Oct 2023 02:27:15 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3946fJ0Q026552; Wed, 4 Oct 2023 09:27:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=TL/VZuhUuPOqA3p7Frj3xe/JUomdScXO27AxeCPEM2s=; b=OaXelCvmQVDwQKrA9b8xXHbf86pf2hUVecVOHq3TssH/J3INSttQuROb3fTJ2VEPmoSB +gosNB+PPe16j8rHES6dhhylPWEQ/AKdpvvuNuL/Xkzs1CKN/iGfRgaIWy0l4b8P0Plb 9/+nZPGP8bt/VEvDs7nHy82CNs7rEm5+wEDL+8zzdEzo9x9xEBRUNjI+VSp9C6nLbG4s qd7cZUK7mwjyWR7FKWGk+Ir8yCcev+T/XqDGvhP8RjWHR85xPqPwZ908PoFRV2CH1MI0 LZq/X7UKXTatBTNX/zT5s0ZxfW+EvS9FXLivYpVaGhPpE8BuskamJLG4agChYa3FVrLG tQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tgbjgug8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 09:27:11 +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 3949RA4B026650 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 4 Oct 2023 09:27:10 GMT Received: from adisi-linux.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.36; Wed, 4 Oct 2023 02:27:08 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH] wifi: ath11k: add parsing of phy bitmap for reg rules Date: Wed, 4 Oct 2023 14:56:55 +0530 Message-ID: <20231004092655.25020-1-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 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-ORIG-GUID: n6CrF58gvDrlCznk04yztdPNKXxni92C X-Proofpoint-GUID: n6CrF58gvDrlCznk04yztdPNKXxni92C X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 suspectscore=0 bulkscore=0 impostorscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310040067 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 04 Oct 2023 02:27:19 -0700 (PDT) Certain regulatory domains could put restrictions on phy mode operation. For example, in a few countries HE Operation is not allowed. For such countries, firmware indicates this via phy bitmap in each reg rule. Currently, there is no logic to parse this info and then pass it on to the cfg80211/regulatory. Add parsing of this phy bitmap from the regulatory channel change event and then accordingly map it to cfg80211/regulatory flags and pass it on to it. While at it, correct typo in debug print s/dsf/dfs. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh --- drivers/net/wireless/ath/ath11k/reg.c | 11 +++++++++++ drivers/net/wireless/ath/ath11k/reg.h | 3 +++ drivers/net/wireless/ath/ath11k/wmi.c | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c index 7f9fb968dac6..3c7debae800a 100644 --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c @@ -352,6 +352,16 @@ static u32 ath11k_map_fw_reg_flags(u16 reg_flags) return flags; } +static u32 ath11k_map_fw_phy_flags(u32 phy_flags) +{ + u32 flags = 0; + + if (phy_flags & ATH11K_REG_PHY_BITMAP_NO11AX) + flags |= NL80211_RRF_NO_HE; + + return flags; +} + static bool ath11k_reg_can_intersect(struct ieee80211_reg_rule *rule1, struct ieee80211_reg_rule *rule2) @@ -685,6 +695,7 @@ ath11k_reg_build_regd(struct ath11k_base *ab, } flags |= ath11k_map_fw_reg_flags(reg_rule->flags); + flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); ath11k_reg_update_rule(tmp_regd->reg_rules + i, reg_rule->start_freq, diff --git a/drivers/net/wireless/ath/ath11k/reg.h b/drivers/net/wireless/ath/ath11k/reg.h index 2f284f26378d..84daa6543b6a 100644 --- a/drivers/net/wireless/ath/ath11k/reg.h +++ b/drivers/net/wireless/ath/ath11k/reg.h @@ -24,6 +24,9 @@ enum ath11k_dfs_region { ATH11K_DFS_REG_UNDEF, }; +/* Phy bitmaps */ +#define ATH11K_REG_PHY_BITMAP_NO11AX BIT(5) + /* ATH11K Regulatory API's */ void ath11k_reg_init(struct ath11k *ar); void ath11k_reg_free(struct ath11k_base *ab); diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index e93601fe7bcb..1542c2b0a981 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -5440,10 +5440,11 @@ static int ath11k_pull_reg_chan_list_ext_update_ev(struct ath11k_base *ab, } ath11k_dbg(ab, ATH11K_DBG_WMI, - "cc_ext %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d", + "cc_ext %s dfs %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d, phy_bitmap: 0x%x", reg_info->alpha2, reg_info->dfs_region, reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, - reg_info->min_bw_5ghz, reg_info->max_bw_5ghz); + reg_info->min_bw_5ghz, reg_info->max_bw_5ghz, + reg_info->phybitmap); ath11k_dbg(ab, ATH11K_DBG_WMI, "num_2ghz_reg_rules %d num_5ghz_reg_rules %d", base-commit: 140accd3f29eee6507f8a51bc38e85c119aedf14 -- 2.17.1