blob: 42c1246067f564a6fc3dd9eeb2a50beb330a3a4c [file] [log] [blame]
developerbd9fa1e2023-10-16 11:04:00 +08001From ddd20028e31060d5bbbc72bd6e465c45819adb56 Mon Sep 17 00:00:00 2001
2From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 2 Oct 2023 14:00:13 +0800
4Subject: [PATCH] wifi: mt76: mt7915: add debuffs knob for protect threshold
5
6---
7 mt7915/mt7915.h | 1 +
8 mt7915/mtk_debugfs.c | 11 +++++++++++
9 2 files changed, 12 insertions(+)
10
11diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
12index e8a6ee68..2a01bd62 100644
13--- a/mt7915/mt7915.h
14+++ b/mt7915/mt7915.h
15@@ -716,6 +716,7 @@ void mt7915_mcu_set_rfeature_starec(void *data, struct mt7915_dev *dev,
16 struct ieee80211_vif *vif, struct ieee80211_sta *sta);
17 int mt7915_mcu_set_rfeature_trig_type(struct mt7915_phy *phy, u8 enable, u8 trig_type);
18 int mt7915_mcu_set_mu_dl_ack_policy(struct mt7915_phy *phy, u8 policy_num);
19+int mt7915_mcu_set_mu_prot_frame_th(struct mt7915_phy *phy, u32 val);
20 void mt7915_mcu_set_ppdu_tx_type(struct mt7915_phy *phy, u8 ppdu_type);
21 void mt7915_mcu_set_nusers_ofdma(struct mt7915_phy *phy, u8 type, u8 ofdma_user_cnt);
22 void mt7915_mcu_set_mimo(struct mt7915_phy *phy, u8 direction);
23diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
24index ed90d346..a9570ced 100644
25--- a/mt7915/mtk_debugfs.c
26+++ b/mt7915/mtk_debugfs.c
27@@ -2838,6 +2838,16 @@ static int mt7915_sta_tx_amsdu_set(void *data, u64 tx_amsdu)
28 DEFINE_DEBUGFS_ATTRIBUTE(fops_tx_amsdu, NULL,
29 mt7915_sta_tx_amsdu_set, "%llx\n");
30
31+static int mt7915_muru_set_prot_thr(void *data, u64 val)
32+{
33+ struct mt7915_phy *phy = data;
34+
35+ return mt7915_mcu_set_mu_prot_frame_th(phy, (u32)val);
36+}
37+
38+DEFINE_DEBUGFS_ATTRIBUTE(fops_muru_set_prot_thr, NULL,
39+ mt7915_muru_set_prot_thr, "%lld\n");
40+
41 static int mt7915_red_enable_set(void *data, u64 en)
42 {
43 struct mt7915_dev *dev = data;
44@@ -3735,6 +3745,7 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
45 debugfs_create_devm_seqfile(dev->mt76.dev, "fw_wm_info", dir,
46 mt7915_fw_wm_info_read);
47
48+ debugfs_create_file("prot_thr", 0200, dir, phy, &fops_muru_set_prot_thr);
49 debugfs_create_file("red_en", 0600, dir, dev,
50 &fops_red_en);
51 debugfs_create_file("red_show_sta", 0600, dir, dev,
52--
532.18.0
54