blob: 0cfc7586030a71d4a84a332de96c9cec4f2d7647 [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From ffe8743a0ee8310def4abad0968fee55cf409ea6 Mon Sep 17 00:00:00 2001
developer5e0a8d72023-05-12 18:58:17 +08002From: MeiChia Chiu <meichia.chiu@mediatek.com>
3Date: Thu, 27 Apr 2023 15:37:33 +0800
developer05f3b2b2024-08-19 19:17:34 +08004Subject: [PATCH 1027/1052] wifi: mt76: mt7915: add muru user number debug
developer753619c2024-02-22 13:42:45 +08005 command
developer5e0a8d72023-05-12 18:58:17 +08006
7---
8 mt7915/mt7915.h | 1 +
9 mt7915/vendor.c | 15 ++++++++++++++-
10 mt7915/vendor.h | 2 ++
11 3 files changed, 17 insertions(+), 1 deletion(-)
12
13diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
developer05f3b2b2024-08-19 19:17:34 +080014index 3fa32574..c745b31d 100644
developer5e0a8d72023-05-12 18:58:17 +080015--- a/mt7915/mt7915.h
16+++ b/mt7915/mt7915.h
developer05f3b2b2024-08-19 19:17:34 +080017@@ -662,6 +662,7 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev,
developer5e0a8d72023-05-12 18:58:17 +080018 int mt7915_mcu_set_radar_th(struct mt7915_dev *dev, int index,
19 const struct mt7915_dfs_pattern *pattern);
20 int mt7915_mcu_set_muru_ctrl(struct mt7915_dev *dev, u32 cmd, u32 val);
21+int mt7915_set_muru_cfg(struct mt7915_phy *phy, u8 mode, u8 val);
22 int mt7915_mcu_apply_group_cal(struct mt7915_dev *dev);
23 int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy);
24 int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch);
25diff --git a/mt7915/vendor.c b/mt7915/vendor.c
developer05f3b2b2024-08-19 19:17:34 +080026index df08704b..6446439f 100644
developer5e0a8d72023-05-12 18:58:17 +080027--- a/mt7915/vendor.c
28+++ b/mt7915/vendor.c
developer05f3b2b2024-08-19 19:17:34 +080029@@ -47,6 +47,8 @@ static const struct nla_policy
developer5e0a8d72023-05-12 18:58:17 +080030 mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = {
31 [MTK_VENDOR_ATTR_MU_CTRL_ONOFF] = {.type = NLA_U8 },
32 [MTK_VENDOR_ATTR_MU_CTRL_DUMP] = {.type = NLA_U8 },
33+ [MTK_VENDOR_ATTR_MU_CTRL_OFDMA_MODE] = { .type = NLA_U8 },
34+ [MTK_VENDOR_ATTR_MU_CTRL_OFDMA_VAL] { .type = NLA_U8 },
35 };
36
37 static const struct nla_policy
developer05f3b2b2024-08-19 19:17:34 +080038@@ -1189,9 +1191,10 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
developer5e0a8d72023-05-12 18:58:17 +080039 int data_len)
40 {
41 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
42+ struct mt7915_phy *phy = mt7915_hw_phy(hw);
43 struct nlattr *tb[NUM_MTK_VENDOR_ATTRS_MU_CTRL];
44 int err;
45- u8 val8;
46+ u8 val8, mode;
47 u32 val32 = 0;
48
49 err = nla_parse(tb, MTK_VENDOR_ATTR_MU_CTRL_MAX, data, data_len,
developer05f3b2b2024-08-19 19:17:34 +080050@@ -1205,6 +1208,16 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
developer5e0a8d72023-05-12 18:58:17 +080051 FIELD_PREP(RATE_CFG_VAL, val8);
52 ieee80211_iterate_active_interfaces_atomic(hw, IEEE80211_IFACE_ITER_RESUME_ALL,
53 mt7915_set_wireless_vif, &val32);
54+ } else if (tb[MTK_VENDOR_ATTR_MU_CTRL_OFDMA_MODE]) {
55+ mode = nla_get_u8(tb[MTK_VENDOR_ATTR_MU_CTRL_OFDMA_MODE]);
56+
57+ if (!tb[MTK_VENDOR_ATTR_MU_CTRL_OFDMA_VAL])
58+ return -EINVAL;
59+
60+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_MU_CTRL_OFDMA_VAL]);
61+ err = mt7915_set_muru_cfg(phy, mode, val8);
62+ if (err)
63+ return err;
64 }
65
66 return 0;
67diff --git a/mt7915/vendor.h b/mt7915/vendor.h
developer05f3b2b2024-08-19 19:17:34 +080068index 5b8d99bf..11ccd0d8 100644
developer5e0a8d72023-05-12 18:58:17 +080069--- a/mt7915/vendor.h
70+++ b/mt7915/vendor.h
developer753619c2024-02-22 13:42:45 +080071@@ -103,6 +103,8 @@ enum mtk_vendor_attr_mu_ctrl {
developer5e0a8d72023-05-12 18:58:17 +080072
73 MTK_VENDOR_ATTR_MU_CTRL_ONOFF,
74 MTK_VENDOR_ATTR_MU_CTRL_DUMP,
75+ MTK_VENDOR_ATTR_MU_CTRL_OFDMA_MODE,
76+ MTK_VENDOR_ATTR_MU_CTRL_OFDMA_VAL,
77
78 /* keep last */
79 NUM_MTK_VENDOR_ATTRS_MU_CTRL,
80--
developerbd9fa1e2023-10-16 11:04:00 +0800812.18.0
developer5e0a8d72023-05-12 18:58:17 +080082