Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp678809rwo; Wed, 2 Aug 2023 02:18:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlFSr6rF576VMp2DmYbeeGiAABWP9PNn90FJuERf+dNQskGz5q1i4gOuU/ToJy+Jzdd64Ybm X-Received: by 2002:a17:902:7c88:b0:1b8:a2af:fe23 with SMTP id y8-20020a1709027c8800b001b8a2affe23mr11491162pll.2.1690967905663; Wed, 02 Aug 2023 02:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690967905; cv=none; d=google.com; s=arc-20160816; b=N6vMk4avFZffmL/Yr2W6gRARKeRnsL4aqkREZVb4ZioORhbHDEJkcPwxdYNL0CoYVI XBZSIEqI1cCiUUy89M3v9e6XUGA9tKFTl42KxG3JFKjv6FfIzCddMxHcduzWAeFI3jRI ebw8MJQrFfafnRLnHrTcj0eOf69D8ttxO8fb9wbMnZFsqqavoRDK6cYqKnsijbuhxke4 ONSIuDYKKal9IeZaK9VzE5DKZLYOXH2AE0L50KZX5qoeOf/JZ4z0bB/5xO6D3xgYs17K XCGhnSLabdEo/Kyg7Mhksdxudq0gbFABshsPphqWfiWenrX2wGq3Ww7MZ9hy1WgNj7gG 5xcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Wk4hq+6eu2PlB1HSXuD/GuvakDHvYqsRv33yHeeROKg=; fh=j1RjdbeyxPCJT/goGl5MBgQQ0s6NTeY2Ciprb8+n+Ug=; b=GGlp+aLayYascyy9zAPtF+0gWnxG00CcoELAiygEAyDDaahdkab1aD0J9chUD/XqHo a8qzLicVtOW68YopVBHh8+wnH6korIg7ikgaZgMT9fLzWcGNw0cfkU8ryGTUnxVG1gAY ZJC1/9VuhT0BNjU9ElKci7JKKAgGFSR1XK259hcYIxoWBKrTYoRmVHfsDkaQflaSKvQf aYyynxfM16q7WhYO+ZdRLNPbohMJIX43fCKQgOt/EbJalSxEuxrwe0y7oVsTtNK35d6U FsFPYQTG/UlU5UwrJDxJh+Y3HNst2+rnI9uT9mEyHKEHqaMb7sPz4n0BWsRsB5B40pHN 704w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=N6goUYgx; 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 n4-20020a170902e54400b001b9e9fa3a38si2789531plf.646.2023.08.02.02.18.18; Wed, 02 Aug 2023 02:18:25 -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=N6goUYgx; 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 S231148AbjHBJAM (ORCPT + 58 others); Wed, 2 Aug 2023 05:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232848AbjHBJAL (ORCPT ); Wed, 2 Aug 2023 05:00:11 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4032721 for ; Wed, 2 Aug 2023 02:00:09 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3724MRM9014667; Wed, 2 Aug 2023 09:00:06 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-type; s=qcppdkim1; bh=Wk4hq+6eu2PlB1HSXuD/GuvakDHvYqsRv33yHeeROKg=; b=N6goUYgxiL6ZQd776aXAM1F2f4VO6vGvTqsENTym7Jn7DU2g72qhY3mslsyKEc01u9ro pf9dqlqdr4SsfRKOY8uoGfPKYTvnSl4m7Mi4fnaIX2tZCQIA91QDklAoWW0UrcXarSTl VzFJC4cZR88J5PH6WfJC8PFbcmmSWrcco28EjwJl9DhVTB+17FgAD2FyX5Wwicv6d76s ceKgA51BZPvUYs1Ewrh5qIdzOAJE+i0DE8W6tb3Xj6FIG6snm1RsrhtpYIPlkqarMDNg /SymSlLBHP/nZ+mKqX9ImIsyFThlALuczV5eYOWHSaT19JwJeEZKdQjv6FOGsGzmA6Ww IQ== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s6rhaun5b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Aug 2023 09:00:06 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 372905GP015800 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 2 Aug 2023 09:00:05 GMT Received: from mdharane-linux.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 2 Aug 2023 02:00:03 -0700 From: Manish Dharanenthiran To: CC: , Manish Dharanenthiran Subject: [PATCH 2/2] wifi: ath12k: fix radar detection in 160 MHz Date: Wed, 2 Aug 2023 14:28:52 +0530 Message-ID: <20230802085852.19821-3-quic_mdharane@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230802085852.19821-1-quic_mdharane@quicinc.com> References: <20230802085852.19821-1-quic_mdharane@quicinc.com> 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 nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Gk8iFmFdeh5p9nlUn4L9Uf-njCM-eDuq X-Proofpoint-ORIG-GUID: Gk8iFmFdeh5p9nlUn4L9Uf-njCM-eDuq 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-02_03,2023-08-01_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 priorityscore=1501 adultscore=0 clxscore=1015 impostorscore=0 spamscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308020080 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 Radar detection fails in the secondary 80 MHz when the the AP's primary 80 MHz is in non-DFS region in 160 MHz. This is due to WMI channel flag WMI_CHAN_INFO_DFS_FREQ2 is not set properly in case of the primary 80 MHz is in non-DFS region. HALPHY detects the radar pulses in the secondary 80 MHz only when WMI_CHAN_INFO_DFS_FREQ2 is set. Fix this issue by setting WMI channel flag WMI_CHAN_INFO_DFS_FREQ2 based on the radar_enabled flag from the channel context. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manish Dharanenthiran --- drivers/net/wireless/ath/ath12k/mac.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 0ab95e138d1d..78177861e38f 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5450,12 +5450,13 @@ static void ath12k_mac_op_remove_chanctx(struct ieee80211_hw *hw, static int ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif, - const struct cfg80211_chan_def *chandef, + struct ieee80211_chanctx_conf *ctx, bool restart) { struct ath12k *ar = arvif->ar; struct ath12k_base *ab = ar->ab; struct wmi_vdev_start_req_arg arg = {}; + const struct cfg80211_chan_def *chandef = &ctx->def; int he_support = arvif->vif->bss_conf.he_support; int ret; @@ -5488,6 +5489,8 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif, /* For now allow DFS for AP mode */ arg.chan_radar = !!(chandef->chan->flags & IEEE80211_CHAN_RADAR); + arg.freq2_radar = ctx->radar_enabled; + arg.passive = arg.chan_radar; spin_lock_bh(&ab->base_lock); @@ -5595,15 +5598,15 @@ static int ath12k_mac_vdev_stop(struct ath12k_vif *arvif) } static int ath12k_mac_vdev_start(struct ath12k_vif *arvif, - const struct cfg80211_chan_def *chandef) + struct ieee80211_chanctx_conf *ctx) { - return ath12k_mac_vdev_start_restart(arvif, chandef, false); + return ath12k_mac_vdev_start_restart(arvif, ctx, false); } static int ath12k_mac_vdev_restart(struct ath12k_vif *arvif, - const struct cfg80211_chan_def *chandef) + struct ieee80211_chanctx_conf *ctx) { - return ath12k_mac_vdev_start_restart(arvif, chandef, true); + return ath12k_mac_vdev_start_restart(arvif, ctx, true); } struct ath12k_mac_change_chanctx_arg { @@ -5702,7 +5705,7 @@ ath12k_mac_update_vif_chan(struct ath12k *ar, * If vdev is down then it expect vdev_stop->vdev_start. */ if (arvif->is_up) { - ret = ath12k_mac_vdev_restart(arvif, &vifs[i].new_ctx->def); + ret = ath12k_mac_vdev_restart(arvif, vifs[i].new_ctx); if (ret) { ath12k_warn(ab, "failed to restart vdev %d: %d\n", arvif->vdev_id, ret); @@ -5716,7 +5719,7 @@ ath12k_mac_update_vif_chan(struct ath12k *ar, continue; } - ret = ath12k_mac_vdev_start(arvif, &vifs[i].new_ctx->def); + ret = ath12k_mac_vdev_start(arvif, vifs[i].new_ctx); if (ret) ath12k_warn(ab, "failed to start vdev %d: %d\n", arvif->vdev_id, ret); @@ -5792,7 +5795,8 @@ static void ath12k_mac_op_change_chanctx(struct ieee80211_hw *hw, if (WARN_ON(changed & IEEE80211_CHANCTX_CHANGE_CHANNEL)) goto unlock; - if (changed & IEEE80211_CHANCTX_CHANGE_WIDTH) + if (changed & IEEE80211_CHANCTX_CHANGE_WIDTH || + changed & IEEE80211_CHANCTX_CHANGE_RADAR) ath12k_mac_update_active_vif_chan(ar, ctx); /* TODO: Recalc radar detection */ @@ -5812,7 +5816,7 @@ static int ath12k_start_vdev_delay(struct ieee80211_hw *hw, if (WARN_ON(arvif->is_started)) return -EBUSY; - ret = ath12k_mac_vdev_start(arvif, &arvif->chanctx.def); + ret = ath12k_mac_vdev_start(arvif, &arvif->chanctx); if (ret) { ath12k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n", arvif->vdev_id, vif->addr, @@ -5890,7 +5894,7 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, goto out; } - ret = ath12k_mac_vdev_start(arvif, &ctx->def); + ret = ath12k_mac_vdev_start(arvif, ctx); if (ret) { ath12k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n", arvif->vdev_id, vif->addr, -- 2.17.1