developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 1 | From 0623b3b87fe33c6ad8037aa01cf63b2a1ab2274f Mon Sep 17 00:00:00 2001 |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 2 | From: TomLiu <tomml.liu@mediatek.com> |
| 3 | Date: Thu, 11 Aug 2022 18:09:45 -0700 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 4 | Subject: [PATCH 1017/1052] wifi: mt76: mt7915: Add mu dump support |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 5 | |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 6 | --- |
developer | 4d58186 | 2023-02-13 16:01:56 +0800 | [diff] [blame] | 7 | mt7915/vendor.c | 24 ++++++++++++++++++++++++ |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 8 | mt7915/vendor.h | 1 + |
developer | 4d58186 | 2023-02-13 16:01:56 +0800 | [diff] [blame] | 9 | 2 files changed, 25 insertions(+) |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 10 | |
| 11 | diff --git a/mt7915/vendor.c b/mt7915/vendor.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 12 | index aaa0cf1d..eb0b380d 100644 |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 13 | --- a/mt7915/vendor.c |
| 14 | +++ b/mt7915/vendor.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 15 | @@ -39,6 +39,7 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = { |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 16 | static const struct nla_policy |
developer | 2c78ce7 | 2023-02-24 11:26:12 +0800 | [diff] [blame] | 17 | mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = { |
| 18 | [MTK_VENDOR_ATTR_MU_CTRL_ONOFF] = {.type = NLA_U8 }, |
| 19 | + [MTK_VENDOR_ATTR_MU_CTRL_DUMP] = {.type = NLA_U8 }, |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | static const struct nla_policy |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 23 | @@ -1161,6 +1162,28 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy, |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 24 | return 0; |
| 25 | } |
| 26 | |
| 27 | + |
| 28 | +static int |
developer | 2c78ce7 | 2023-02-24 11:26:12 +0800 | [diff] [blame] | 29 | +mt7915_vendor_mu_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev, |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 30 | + struct sk_buff *skb, const void *data, int data_len, |
| 31 | + unsigned long *storage) |
| 32 | +{ |
| 33 | + struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); |
| 34 | + struct mt7915_phy *phy = mt7915_hw_phy(hw); |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 35 | + int len = 0; |
| 36 | + |
| 37 | + if (*storage == 1) |
| 38 | + return -ENOENT; |
| 39 | + *storage = 1; |
| 40 | + |
developer | 2c78ce7 | 2023-02-24 11:26:12 +0800 | [diff] [blame] | 41 | + if (nla_put_u8(skb, MTK_VENDOR_ATTR_MU_CTRL_DUMP, phy->muru_onoff)) |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 42 | + return -ENOMEM; |
| 43 | + len += 1; |
| 44 | + |
| 45 | + return len; |
| 46 | +} |
| 47 | + |
| 48 | + |
| 49 | static int |
| 50 | mt7915_vendor_phy_capa_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 51 | struct sk_buff *skb, const void *data, int data_len, |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 52 | @@ -1347,6 +1370,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = { |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 53 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | |
| 54 | WIPHY_VENDOR_CMD_NEED_RUNNING, |
developer | 2c78ce7 | 2023-02-24 11:26:12 +0800 | [diff] [blame] | 55 | .doit = mt7915_vendor_mu_ctrl, |
| 56 | + .dumpit = mt7915_vendor_mu_ctrl_dump, |
| 57 | .policy = mu_ctrl_policy, |
| 58 | .maxattr = MTK_VENDOR_ATTR_MU_CTRL_MAX, |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 59 | }, |
| 60 | diff --git a/mt7915/vendor.h b/mt7915/vendor.h |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 61 | index c8d30b52..c61ba260 100644 |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 62 | --- a/mt7915/vendor.h |
| 63 | +++ b/mt7915/vendor.h |
developer | 753619c | 2024-02-22 13:42:45 +0800 | [diff] [blame] | 64 | @@ -73,6 +73,7 @@ enum mtk_vendor_attr_mu_ctrl { |
developer | 2c78ce7 | 2023-02-24 11:26:12 +0800 | [diff] [blame] | 65 | MTK_VENDOR_ATTR_MU_CTRL_UNSPEC, |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 66 | |
developer | 2c78ce7 | 2023-02-24 11:26:12 +0800 | [diff] [blame] | 67 | MTK_VENDOR_ATTR_MU_CTRL_ONOFF, |
| 68 | + MTK_VENDOR_ATTR_MU_CTRL_DUMP, |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 69 | |
| 70 | /* keep last */ |
developer | 2c78ce7 | 2023-02-24 11:26:12 +0800 | [diff] [blame] | 71 | NUM_MTK_VENDOR_ATTRS_MU_CTRL, |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 72 | -- |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 73 | 2.18.0 |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 74 | |