developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 1 | From c977d69ea6fd5a6db3e889ef6d3baaae19d2aee7 Mon Sep 17 00:00:00 2001 |
developer | 6e3b5d1 | 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 | bcc85ca | 2022-12-05 11:29:56 +0800 | [diff] [blame] | 4 | Subject: [PATCH 1124/1128] mt76: mt7915: Add hemu dump support |
developer | 6e3b5d1 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 5 | |
| 6 | Change-Id: I521214f3feb6f0d528a9f550255050ffd1ec96d2 |
| 7 | --- |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 8 | mt7915/vendor.c | 25 +++++++++++++++++++++++++ |
developer | 6e3b5d1 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 9 | mt7915/vendor.h | 1 + |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 10 | 2 files changed, 26 insertions(+) |
developer | 6e3b5d1 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 11 | |
| 12 | diff --git a/mt7915/vendor.c b/mt7915/vendor.c |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 13 | index 2484e25f..f7becce9 100644 |
developer | 6e3b5d1 | 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 | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 24 | @@ -1004,6 +1005,29 @@ static int mt7915_vendor_hemu_ctrl(struct wiphy *wiphy, |
developer | 6e3b5d1 | 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; |
developer | 6e3b5d1 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 37 | + int len = 0; |
| 38 | + |
| 39 | + if (*storage == 1) |
| 40 | + return -ENOENT; |
| 41 | + *storage = 1; |
| 42 | + |
| 43 | + if (nla_put_u8(skb, MTK_VENDOR_ATTR_HEMU_CTRL_DUMP, dev->dbg.muru_onoff)) |
| 44 | + return -ENOMEM; |
| 45 | + len += 1; |
| 46 | + |
| 47 | + return len; |
| 48 | +} |
| 49 | + |
| 50 | + |
| 51 | static int |
| 52 | mt7915_vendor_phy_capa_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 53 | struct sk_buff *skb, const void *data, int data_len, |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 54 | @@ -1190,6 +1214,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = { |
developer | 6e3b5d1 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 55 | .flags = WIPHY_VENDOR_CMD_NEED_NETDEV | |
| 56 | WIPHY_VENDOR_CMD_NEED_RUNNING, |
| 57 | .doit = mt7915_vendor_hemu_ctrl, |
| 58 | + .dumpit = mt7915_vendor_hemu_ctrl_dump, |
| 59 | .policy = hemu_ctrl_policy, |
| 60 | .maxattr = MTK_VENDOR_ATTR_HEMU_CTRL_MAX, |
| 61 | }, |
| 62 | diff --git a/mt7915/vendor.h b/mt7915/vendor.h |
developer | 3d5faf2 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 63 | index 72319717..c19ffe72 100644 |
developer | 6e3b5d1 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 64 | --- a/mt7915/vendor.h |
| 65 | +++ b/mt7915/vendor.h |
developer | 3d5faf2 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 66 | @@ -72,6 +72,7 @@ enum mtk_vendor_attr_hemu_ctrl { |
developer | 6e3b5d1 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 67 | MTK_VENDOR_ATTR_HEMU_CTRL_UNSPEC, |
| 68 | |
| 69 | MTK_VENDOR_ATTR_HEMU_CTRL_ONOFF, |
| 70 | + MTK_VENDOR_ATTR_HEMU_CTRL_DUMP, |
| 71 | |
| 72 | /* keep last */ |
| 73 | NUM_MTK_VENDOR_ATTRS_HEMU_CTRL, |
| 74 | -- |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 75 | 2.25.1 |
developer | 6e3b5d1 | 2022-08-16 15:37:38 +0800 | [diff] [blame] | 76 | |