developer | 3609d78 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 1 | From cf6ba9d0fb09e2c7975b15ede8a5389b700e1f1a Mon Sep 17 00:00:00 2001 |
developer | f2548b0 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 2 | From: TomLiu <tomml.liu@mediatek.com> |
| 3 | Date: Thu, 11 Aug 2022 18:09:45 -0700 |
developer | 3609d78 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 4 | Subject: [PATCH 1123/1127] mt76: HEMU: Add dump support |
developer | f2548b0 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 5 | |
| 6 | Change-Id: I521214f3feb6f0d528a9f550255050ffd1ec96d2 |
| 7 | --- |
| 8 | mt7915/vendor.c | 26 ++++++++++++++++++++++++++ |
| 9 | mt7915/vendor.h | 1 + |
| 10 | 2 files changed, 27 insertions(+) |
| 11 | |
| 12 | diff --git a/mt7915/vendor.c b/mt7915/vendor.c |
developer | 3609d78 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 13 | index cd5c3b83..5e34b852 100644 |
developer | f2548b0 | 2022-08-16 15:37:38 +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 |
| 18 | hemu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_HEMU_CTRL] = { |
| 19 | [MTK_VENDOR_ATTR_HEMU_CTRL_ONOFF] = {.type = NLA_U8 }, |
| 20 | + [MTK_VENDOR_ATTR_HEMU_CTRL_DUMP] = {.type = NLA_U8 }, |
| 21 | }; |
| 22 | |
| 23 | static const struct nla_policy |
developer | 3609d78 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 24 | @@ -1004,6 +1005,30 @@ static int mt7915_vendor_hemu_ctrl(struct wiphy *wiphy, |
developer | f2548b0 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | + |
| 29 | +static int |
| 30 | +mt7915_vendor_hemu_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 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); |
| 36 | + struct mt7915_dev *dev = phy->dev; |
| 37 | + void *a; |
| 38 | + int len = 0; |
| 39 | + |
| 40 | + if (*storage == 1) |
| 41 | + return -ENOENT; |
| 42 | + *storage = 1; |
| 43 | + |
| 44 | + if (nla_put_u8(skb, MTK_VENDOR_ATTR_HEMU_CTRL_DUMP, dev->dbg.muru_onoff)) |
| 45 | + return -ENOMEM; |
| 46 | + len += 1; |
| 47 | + |
| 48 | + return len; |
| 49 | +} |
| 50 | + |
| 51 | + |
| 52 | static int |
| 53 | mt7915_vendor_phy_capa_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 54 | struct sk_buff *skb, const void *data, int data_len, |
developer | 3609d78 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 55 | @@ -1192,6 +1217,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = { |
developer | f2548b0 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 56 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | |
| 57 | WIPHY_VENDOR_CMD_NEED_RUNNING, |
| 58 | .doit = mt7915_vendor_hemu_ctrl, |
| 59 | + .dumpit = mt7915_vendor_hemu_ctrl_dump, |
| 60 | .policy = hemu_ctrl_policy, |
| 61 | .maxattr = MTK_VENDOR_ATTR_HEMU_CTRL_MAX, |
| 62 | }, |
| 63 | diff --git a/mt7915/vendor.h b/mt7915/vendor.h |
developer | 3609d78 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 64 | index 72319717..c19ffe72 100644 |
developer | f2548b0 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 65 | --- a/mt7915/vendor.h |
| 66 | +++ b/mt7915/vendor.h |
developer | 3609d78 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 67 | @@ -72,6 +72,7 @@ enum mtk_vendor_attr_hemu_ctrl { |
developer | f2548b0 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 68 | MTK_VENDOR_ATTR_HEMU_CTRL_UNSPEC, |
| 69 | |
| 70 | MTK_VENDOR_ATTR_HEMU_CTRL_ONOFF, |
| 71 | + MTK_VENDOR_ATTR_HEMU_CTRL_DUMP, |
| 72 | |
| 73 | /* keep last */ |
| 74 | NUM_MTK_VENDOR_ATTRS_HEMU_CTRL, |
| 75 | -- |
developer | b403ad0 | 2022-11-08 10:16:29 +0800 | [diff] [blame] | 76 | 2.18.0 |
developer | f2548b0 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 77 | |