developer | 8f0d89b | 2023-07-28 07:16:44 +0800 | [diff] [blame^] | 1 | From 88764ab562d2d901426ee789f0ee3225c00fa291 Mon Sep 17 00:00:00 2001 |
developer | c634bb1 | 2023-05-02 17:31:30 +0800 | [diff] [blame] | 2 | From: MeiChia Chiu <meichia.chiu@mediatek.com> |
| 3 | Date: Thu, 27 Apr 2023 15:37:33 +0800 |
developer | 8f0d89b | 2023-07-28 07:16:44 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 1030/1034] wifi: mt76: mt7915: add muru user number debug |
developer | c634bb1 | 2023-05-02 17:31:30 +0800 | [diff] [blame] | 5 | command |
| 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 | 8f0d89b | 2023-07-28 07:16:44 +0800 | [diff] [blame^] | 14 | index 4ba57c6..b3bf8a2 100644 |
developer | c634bb1 | 2023-05-02 17:31:30 +0800 | [diff] [blame] | 15 | --- a/mt7915/mt7915.h |
| 16 | +++ b/mt7915/mt7915.h |
developer | 8f0d89b | 2023-07-28 07:16:44 +0800 | [diff] [blame^] | 17 | @@ -584,6 +584,7 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev, |
developer | c634bb1 | 2023-05-02 17:31:30 +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 | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 26 | index 94c4aad..b450808 100644 |
developer | c634bb1 | 2023-05-02 17:31:30 +0800 | [diff] [blame] | 27 | --- a/mt7915/vendor.c |
| 28 | +++ b/mt7915/vendor.c |
| 29 | @@ -45,6 +45,8 @@ static const struct nla_policy |
| 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 | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 38 | @@ -1034,9 +1036,10 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy, |
developer | c634bb1 | 2023-05-02 17:31:30 +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 | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 50 | @@ -1050,6 +1053,16 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy, |
developer | c634bb1 | 2023-05-02 17:31:30 +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 |
| 68 | index 358a16f..20526ea 100644 |
| 69 | --- a/mt7915/vendor.h |
| 70 | +++ b/mt7915/vendor.h |
| 71 | @@ -102,6 +102,8 @@ enum mtk_vendor_attr_mu_ctrl { |
| 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 | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 81 | 2.18.0 |
developer | c634bb1 | 2023-05-02 17:31:30 +0800 | [diff] [blame] | 82 | |