developer | b885304 | 2023-02-17 11:50:45 +0800 | [diff] [blame] | 1 | From dc1ea53db698073c61765925cdb17d28043c6f2d Mon Sep 17 00:00:00 2001 |
developer | 6a1998b | 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 | e0a1e0e | 2023-02-24 11:26:12 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 1124/1133] mt76: mt7915: Add mu dump support |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 5 | |
| 6 | Change-Id: I521214f3feb6f0d528a9f550255050ffd1ec96d2 |
| 7 | --- |
developer | 5eddc51 | 2023-02-13 16:01:56 +0800 | [diff] [blame] | 8 | mt7915/vendor.c | 24 ++++++++++++++++++++++++ |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 9 | mt7915/vendor.h | 1 + |
developer | 5eddc51 | 2023-02-13 16:01:56 +0800 | [diff] [blame] | 10 | 2 files changed, 25 insertions(+) |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 11 | |
| 12 | diff --git a/mt7915/vendor.c b/mt7915/vendor.c |
developer | b885304 | 2023-02-17 11:50:45 +0800 | [diff] [blame] | 13 | index f712d67c..83f38e07 100644 |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [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 | e0a1e0e | 2023-02-24 11:26:12 +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 | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 21 | }; |
| 22 | |
| 23 | static const struct nla_policy |
developer | e0a1e0e | 2023-02-24 11:26:12 +0800 | [diff] [blame^] | 24 | @@ -1004,6 +1005,28 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy, |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | + |
| 29 | +static int |
developer | e0a1e0e | 2023-02-24 11:26:12 +0800 | [diff] [blame^] | 30 | +mt7915_vendor_mu_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev, |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [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 | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 36 | + int len = 0; |
| 37 | + |
| 38 | + if (*storage == 1) |
| 39 | + return -ENOENT; |
| 40 | + *storage = 1; |
| 41 | + |
developer | e0a1e0e | 2023-02-24 11:26:12 +0800 | [diff] [blame^] | 42 | + if (nla_put_u8(skb, MTK_VENDOR_ATTR_MU_CTRL_DUMP, phy->muru_onoff)) |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [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 | 5eddc51 | 2023-02-13 16:01:56 +0800 | [diff] [blame] | 53 | @@ -1190,6 +1213,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = { |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 54 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | |
| 55 | WIPHY_VENDOR_CMD_NEED_RUNNING, |
developer | e0a1e0e | 2023-02-24 11:26:12 +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 | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 60 | }, |
| 61 | diff --git a/mt7915/vendor.h b/mt7915/vendor.h |
developer | b885304 | 2023-02-17 11:50:45 +0800 | [diff] [blame] | 62 | index 72319717..c19ffe72 100644 |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 63 | --- a/mt7915/vendor.h |
| 64 | +++ b/mt7915/vendor.h |
developer | e0a1e0e | 2023-02-24 11:26:12 +0800 | [diff] [blame^] | 65 | @@ -72,6 +72,7 @@ enum mtk_vendor_attr_mu_ctrl { |
| 66 | MTK_VENDOR_ATTR_MU_CTRL_UNSPEC, |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 67 | |
developer | e0a1e0e | 2023-02-24 11:26:12 +0800 | [diff] [blame^] | 68 | MTK_VENDOR_ATTR_MU_CTRL_ONOFF, |
| 69 | + MTK_VENDOR_ATTR_MU_CTRL_DUMP, |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 70 | |
| 71 | /* keep last */ |
developer | e0a1e0e | 2023-02-24 11:26:12 +0800 | [diff] [blame^] | 72 | NUM_MTK_VENDOR_ATTRS_MU_CTRL, |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 73 | -- |
developer | b885304 | 2023-02-17 11:50:45 +0800 | [diff] [blame] | 74 | 2.18.0 |
developer | 6a1998b | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 75 | |