developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 1 | From b27e931f19dd74515c6082b494d263becc852377 Mon Sep 17 00:00:00 2001 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 2 | From: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 3 | Date: Tue, 5 Sep 2023 20:17:19 +0800 |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 1036/1051] wifi: mt76: mt7915: support enable/disable spatial |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 5 | reuse through debugfs |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 6 | |
| 7 | Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 8 | --- |
| 9 | mt7915/mcu.c | 3 +-- |
| 10 | mt7915/mt7915.h | 1 + |
| 11 | mt7915/mtk_debugfs.c | 12 ++++++++++++ |
| 12 | 3 files changed, 14 insertions(+), 2 deletions(-) |
| 13 | |
| 14 | diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 15 | index b9beb4f6..4b5fb53a 100644 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 16 | --- a/mt7915/mcu.c |
| 17 | +++ b/mt7915/mcu.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 18 | @@ -3756,8 +3756,7 @@ int mt7915_mcu_set_txbf(struct mt7915_dev *dev, u8 action) |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 19 | sizeof(req), true); |
| 20 | } |
| 21 | |
| 22 | -static int |
| 23 | -mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val) |
| 24 | +int mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val) |
| 25 | { |
| 26 | struct mt7915_dev *dev = phy->dev; |
| 27 | struct mt7915_mcu_sr_ctrl req = { |
| 28 | diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 29 | index ea91611d..bfd87bc3 100644 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 30 | --- a/mt7915/mt7915.h |
| 31 | +++ b/mt7915/mt7915.h |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 32 | @@ -795,6 +795,7 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value); |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 33 | int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val); |
| 34 | int mt7915_mcu_ipi_hist_ctrl(struct mt7915_phy *phy, void *data, u8 cmd, bool wait_resp); |
| 35 | int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp); |
| 36 | +int mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val); |
| 37 | |
| 38 | #ifdef MTK_DEBUG |
| 39 | int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir); |
| 40 | diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 41 | index e7be3d6c..6405aa32 100644 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 42 | --- a/mt7915/mtk_debugfs.c |
| 43 | +++ b/mt7915/mtk_debugfs.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 44 | @@ -3799,6 +3799,17 @@ mt7915_sw_aci_set(void *data, u64 val) |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 45 | DEFINE_DEBUGFS_ATTRIBUTE(fops_sw_aci, NULL, |
| 46 | mt7915_sw_aci_set, "%llx\n"); |
| 47 | |
| 48 | +static int |
| 49 | +mt7915_sr_enable_set(void *data, u64 val) |
| 50 | +{ |
| 51 | + struct mt7915_phy *phy = data; |
| 52 | + |
| 53 | + return mt7915_mcu_enable_obss_spr(phy, SPR_ENABLE, val); |
| 54 | +} |
| 55 | + |
| 56 | +DEFINE_DEBUGFS_ATTRIBUTE(fops_sr_enable, NULL, |
| 57 | + mt7915_sr_enable_set, "%llx\n"); |
| 58 | + |
| 59 | int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir) |
| 60 | { |
| 61 | struct mt7915_dev *dev = phy->dev; |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame^] | 62 | @@ -3889,6 +3900,7 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir) |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 63 | mt7915_show_eeprom_mode); |
| 64 | debugfs_create_file("sw_aci", 0600, dir, dev, |
| 65 | &fops_sw_aci); |
| 66 | + debugfs_create_file("sr_enable", 0200, dir, phy, &fops_sr_enable); |
| 67 | return 0; |
| 68 | } |
| 69 | #endif |
| 70 | -- |
| 71 | 2.18.0 |
| 72 | |