blob: 43504c32247ef62265e15155efd18c7ea0b62c43 [file] [log] [blame]
From 47bd3ed95c21e49cc0c9e34daacdbd3c07ddda49 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Fri, 22 Dec 2023 17:27:10 +0800
Subject: [PATCH 046/193] mtk: mt76: mt7996: add background radar hw cap check
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
mt7996/debugfs.c | 5 +++++
mt7996/mt7996.h | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/mt7996/debugfs.c b/mt7996/debugfs.c
index 70a97d2..07970e1 100644
--- a/mt7996/debugfs.c
+++ b/mt7996/debugfs.c
@@ -262,6 +262,11 @@ mt7996_rdd_monitor(struct seq_file *s, void *data)
mutex_lock(&dev->mt76.mutex);
+ if (!mt7996_has_background_radar(dev)) {
+ seq_puts(s, "no background radar capability\n");
+ goto out;
+ }
+
if (!cfg80211_chandef_valid(chandef)) {
ret = -EINVAL;
goto out;
diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h
index 81639a4..142c390 100644
--- a/mt7996/mt7996.h
+++ b/mt7996/mt7996.h
@@ -619,7 +619,8 @@ mt7996_has_background_radar(struct mt7996_dev *dev)
return false;
break;
case 0x7992:
- if (dev->var.type == MT7992_VAR_TYPE_23)
+ if (dev->var.type == MT7992_VAR_TYPE_23 ||
+ dev->var.type == MT7992_VAR_TYPE_24)
return false;
break;
default:
--
2.45.2