blob: 286936ed16e406f2f47a91b334af47c1b55590ce [file] [log] [blame]
developerf1313102022-10-11 11:02:55 +08001From a56e9413d6604dcec4fe5c21f240ad8d3e82eb7b Mon Sep 17 00:00:00 2001
developer6e3b5d12022-08-16 15:37:38 +08002From: TomLiu <tomml.liu@mediatek.com>
3Date: Thu, 11 Aug 2022 18:09:45 -0700
developer33907d42022-09-19 14:33:58 +08004Subject: [PATCH 1122/1124] mt76: HEMU: Add dump support
developer6e3b5d12022-08-16 15:37:38 +08005
6Change-Id: I521214f3feb6f0d528a9f550255050ffd1ec96d2
7---
8 mt7915/vendor.c | 26 ++++++++++++++++++++++++++
9 mt7915/vendor.h | 1 +
10 2 files changed, 27 insertions(+)
11
12diff --git a/mt7915/vendor.c b/mt7915/vendor.c
developerf1313102022-10-11 11:02:55 +080013index 5a28a55..7acb330 100644
developer6e3b5d12022-08-16 15:37:38 +080014--- 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
24@@ -997,6 +998,30 @@ static int mt7915_vendor_hemu_ctrl(struct wiphy *wiphy,
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,
55@@ -1122,6 +1147,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
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 },
63diff --git a/mt7915/vendor.h b/mt7915/vendor.h
developerf1313102022-10-11 11:02:55 +080064index 83c41bc..57f52f3 100644
developer6e3b5d12022-08-16 15:37:38 +080065--- a/mt7915/vendor.h
66+++ b/mt7915/vendor.h
67@@ -58,6 +58,7 @@ enum mtk_vendor_attr_hemu_ctrl {
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--
developerf1313102022-10-11 11:02:55 +0800762.18.0
developer6e3b5d12022-08-16 15:37:38 +080077