developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 1 | From ffe8743a0ee8310def4abad0968fee55cf409ea6 Mon Sep 17 00:00:00 2001 |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 2 | From: MeiChia Chiu <meichia.chiu@mediatek.com> |
| 3 | Date: Thu, 27 Apr 2023 15:37:33 +0800 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 4 | Subject: [PATCH 1027/1052] wifi: mt76: mt7915: add muru user number debug |
developer | 753619c | 2024-02-22 13:42:45 +0800 | [diff] [blame] | 5 | command |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 6 | |
| 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 | |
| 13 | diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 14 | index 3fa32574..c745b31d 100644 |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 15 | --- a/mt7915/mt7915.h |
| 16 | +++ b/mt7915/mt7915.h |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 17 | @@ -662,6 +662,7 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev, |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 18 | 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); |
| 25 | diff --git a/mt7915/vendor.c b/mt7915/vendor.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 26 | index df08704b..6446439f 100644 |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 27 | --- a/mt7915/vendor.c |
| 28 | +++ b/mt7915/vendor.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 29 | @@ -47,6 +47,8 @@ static const struct nla_policy |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 30 | 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 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 38 | @@ -1189,9 +1191,10 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy, |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 39 | 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, |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 50 | @@ -1205,6 +1208,16 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy, |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 51 | 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; |
| 67 | diff --git a/mt7915/vendor.h b/mt7915/vendor.h |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 68 | index 5b8d99bf..11ccd0d8 100644 |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 69 | --- a/mt7915/vendor.h |
| 70 | +++ b/mt7915/vendor.h |
developer | 753619c | 2024-02-22 13:42:45 +0800 | [diff] [blame] | 71 | @@ -103,6 +103,8 @@ enum mtk_vendor_attr_mu_ctrl { |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 72 | |
| 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 | -- |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 81 | 2.18.0 |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 82 | |