blob: 7809621e9bc0475443f61a5b8df43b2fb30f238e [file] [log] [blame]
From 4a0688cf495714841635247e4859335402f3118f 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/223] 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 70a97d29..07970e1a 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 81639a45..142c390d 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