Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3499095pxm; Mon, 28 Feb 2022 22:33:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+8rgETHP6OFaUnbzsTmoQODB1Dd11AvTEJexddaIBjPsR8QDQ4B9f3ijL8hlxpcJVCyY4 X-Received: by 2002:a05:6a00:21c8:b0:4e1:69f6:1c23 with SMTP id t8-20020a056a0021c800b004e169f61c23mr25797643pfj.8.1646116439075; Mon, 28 Feb 2022 22:33:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646116439; cv=none; d=google.com; s=arc-20160816; b=VtbN6DjTltuqpi3W6Zt2VNQF7BZHsEOd9vUa8qyoIpN70yYrBB7p5PYPLcnMhoMChq 0NuqIyglpUBglABM0EycX0v9pPmGlrQjthCm3JgL1rp+70zQth8em5MHZVKzh3NoQbaj 3p4jqfOiFEfjG/N2QE3D4Wmyi3FfjmgGRAJCejrJ98haAnkxo/SziIo266CM+LRG4su0 VIPe/meUbfm/w1Yw5Tab+KHIAQgcnpoFJ89aKZ/haRbmG3GOtO10T3xEoCQChAqnpvVD BK0FbnWOCfD5dSOOLnnVGWQ971KxBKg1oYNPtS5D6LRTslFaFxtXv6ldknMNq6wkthWD Sxzg== 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; bh=ooRKW6fEbuxa+DXMMyLDPKxaNd1TdHUGifoKizQOXr0=; b=t17Q6rCCk6hs2LqnMsFVPl3aywyD6pKXwd2Zi/KA/owJEH92vACAoo0rxjWL+YHEeG /tXSwu8GMNKkiga5Wgpb7oCLN1fN3rAY2cRABZQeNYBAdF/9wpLbbk9fkUctXb1eXs/5 fppwiqvNdPUl/x5q7t0D/rMo5UY+MsnZrsZzs4/72ykzE4GT5Bll9mRXW0i81dGOz+XT Rv+ri40dJ7DlALE48JqE3Mn8s9+BWtskDx1LlGy35aE1zAiQPfFBTR37QdkeVWG/keCn D0jteH1mENJq6vZE3hWMiLU1LAPOTdDj5OTrkfFhvtuiOMPVKt6EIy/BpQVmJju3gMRy Cv9Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a1709026b8200b0014f206ce405si10792986plk.373.2022.02.28.22.33.41; Mon, 28 Feb 2022 22:33:59 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231509AbiCAFaT (ORCPT + 72 others); Tue, 1 Mar 2022 00:30:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbiCAFaT (ORCPT ); Tue, 1 Mar 2022 00:30:19 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24EF9344C0 for ; Mon, 28 Feb 2022 21:29:33 -0800 (PST) X-UUID: c0df0add839243bb83746a507f8aaccd-20220301 X-UUID: c0df0add839243bb83746a507f8aaccd-20220301 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1351570571; Tue, 01 Mar 2022 13:29:27 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Tue, 1 Mar 2022 13:29:26 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 1 Mar 2022 13:29:26 +0800 From: Evelyn Tsai To: Felix Fietkau CC: Lorenzo Bianconi , Ryder Lee , Shayne Chen , , , Evelyn Tsai , Rubio Lu Subject: [PATCH] mt76: mt7915: fix DFS no radar detection event Date: Tue, 1 Mar 2022 13:29:10 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY 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 Driver needs to carry region definition when radar detection starts. Need to remap nl80211 DFS regions to chip region definition. Signed-off-by: Evelyn Tsai Signed-off-by: Rubio Lu --- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index 1da551f0b389..a99079313ac2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -2364,10 +2364,23 @@ static void mt7915_dfs_stop_radar_detector(struct mt7915_phy *phy) static int mt7915_dfs_start_rdd(struct mt7915_dev *dev, int chain) { - int err; + int err, region; + + switch (dev->mt76.region) { + case NL80211_DFS_ETSI: + region = 0; + break; + case NL80211_DFS_JP: + region = 2; + break; + case NL80211_DFS_FCC: + default: + region = 1; + break; + } err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_START, chain, - MT_RX_SEL0, 0); + MT_RX_SEL0, region); if (err < 0) return err; -- 2.18.0