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