blob: 7404dae5ffd4e46c5bb3fe243b143f118750e250 [file] [log] [blame]
From 725c52a07bd4b79ad25be2d63c83277da15b6cc7 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Tue, 5 Sep 2023 20:17:19 +0800
Subject: [PATCH 1039/1048] wifi: mt76: mt7915: support enable/disable spatial
reuse through debugfs
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
---
mt7915/mcu.c | 3 +--
mt7915/mt7915.h | 1 +
mt7915/mtk_debugfs.c | 12 ++++++++++++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 609eb5b..1eb19ba 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -3739,8 +3739,7 @@ int mt7915_mcu_set_txbf(struct mt7915_dev *dev, u8 action)
sizeof(req), true);
}
-static int
-mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val)
+int mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val)
{
struct mt7915_dev *dev = phy->dev;
struct mt7915_mcu_sr_ctrl req = {
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index e21a7a6..ffc2e0b 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -781,6 +781,7 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value);
int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val);
int mt7915_mcu_ipi_hist_ctrl(struct mt7915_phy *phy, void *data, u8 cmd, bool wait_resp);
int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp);
+int mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val);
#ifdef MTK_DEBUG
int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 594989f..e706f64 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3776,6 +3776,17 @@ mt7915_sw_aci_set(void *data, u64 val)
DEFINE_DEBUGFS_ATTRIBUTE(fops_sw_aci, NULL,
mt7915_sw_aci_set, "%llx\n");
+static int
+mt7915_sr_enable_set(void *data, u64 val)
+{
+ struct mt7915_phy *phy = data;
+
+ return mt7915_mcu_enable_obss_spr(phy, SPR_ENABLE, val);
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(fops_sr_enable, NULL,
+ mt7915_sr_enable_set, "%llx\n");
+
int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
{
struct mt7915_dev *dev = phy->dev;
@@ -3866,6 +3877,7 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
mt7915_show_eeprom_mode);
debugfs_create_file("sw_aci", 0600, dir, dev,
&fops_sw_aci);
+ debugfs_create_file("sr_enable", 0200, dir, phy, &fops_sr_enable);
return 0;
}
#endif
--
2.18.0