blob: d28ba310b8c6693fed2ecd5308831646dc5b83ad [file] [log] [blame]
developerbbd45e12023-05-19 08:22:06 +08001From 680ee306a830525879b8d972f8cd894b01514225 Mon Sep 17 00:00:00 2001
developer295120d2023-01-24 14:36:37 +08002From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
3Date: Tue, 24 Jan 2023 14:32:08 +0800
developerbbd45e12023-05-19 08:22:06 +08004Subject: [PATCH 1029/1033] wifi: mt76: mt7915: Add vendor command attribute
developerc9233442023-04-04 06:06:17 +08005 for RTS BW signaling.
developer295120d2023-01-24 14:36:37 +08006
7Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
8---
9 mt7915/mcu.c | 6 ++++++
10 mt7915/mcu.h | 9 +++++++++
11 mt7915/vendor.c | 4 ++++
12 mt7915/vendor.h | 1 +
13 4 files changed, 20 insertions(+)
14
15diff --git a/mt7915/mcu.c b/mt7915/mcu.c
developerbbd45e12023-05-19 08:22:06 +080016index 0bec0bc..3939768 100644
developer295120d2023-01-24 14:36:37 +080017--- a/mt7915/mcu.c
18+++ b/mt7915/mcu.c
developerbbd45e12023-05-19 08:22:06 +080019@@ -4497,6 +4497,12 @@ int mt7915_mcu_set_cfg(struct mt7915_phy *phy, u8 cfg_info, u8 type)
developer295120d2023-01-24 14:36:37 +080020 req.cert.length = cpu_to_le16(tlv_len);
21 req.cert.cert_program = type;
22 break;
23+ case CFGINFO_RTS_SIGTA_EN_FEATURE:
24+ tlv_len = sizeof(struct rts_sigta_cfg);
25+ req.rts_sigta.tag = cpu_to_le16(cfg_info);
26+ req.rts_sigta.length = cpu_to_le16(tlv_len);
27+ req.rts_sigta.enable = type ? 1: 0;
28+ break;
29 case CFGINFO_3WIRE_EN_CFG:
30 tlv_len = sizeof(struct three_wire_cfg);
31 req.three_wire.tag = cpu_to_le16(cfg_info);
32diff --git a/mt7915/mcu.h b/mt7915/mcu.h
developerbbd45e12023-05-19 08:22:06 +080033index 240a315..8ac70e5 100644
developer295120d2023-01-24 14:36:37 +080034--- a/mt7915/mcu.h
35+++ b/mt7915/mcu.h
developerbbd45e12023-05-19 08:22:06 +080036@@ -924,6 +924,13 @@ struct three_wire_cfg {
developer295120d2023-01-24 14:36:37 +080037 u8 rsv[3];
38 } __packed;
39
40+struct rts_sigta_cfg {
41+ __le16 tag;
42+ __le16 length;
43+ bool enable; /* 0: Disable, 1: Enable */
44+ u8 rsv[3];
45+} __packed;
46+
47 struct cfg_basic_info {
48 u8 dbdc_idx;
49 u8 rsv[3];
developerbbd45e12023-05-19 08:22:06 +080050@@ -931,11 +938,13 @@ struct cfg_basic_info {
developer295120d2023-01-24 14:36:37 +080051 union {
52 struct cert_cfg cert;
53 struct three_wire_cfg three_wire;
54+ struct rts_sigta_cfg rts_sigta;
55 };
56 } __packed;
57
58 enum {
59 CFGINFO_CERT_CFG = 4,
60+ CFGINFO_RTS_SIGTA_EN_FEATURE = 7,
61 CFGINFO_3WIRE_EN_CFG = 10,
62 };
63
64diff --git a/mt7915/vendor.c b/mt7915/vendor.c
developerbbd45e12023-05-19 08:22:06 +080065index 3d1984b..6bbdc6f 100644
developer295120d2023-01-24 14:36:37 +080066--- a/mt7915/vendor.c
67+++ b/mt7915/vendor.c
68@@ -33,6 +33,7 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
69 [MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU] = {.type = NLA_U8 },
70 [MTK_VENDOR_ATTR_WIRELESS_CTRL_MU_EDCA] = {.type = NLA_U8 },
71 [MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
72+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA] = {.type = NLA_U8 },
73 };
74
75 static const struct nla_policy
developerbbd45e12023-05-19 08:22:06 +080076@@ -994,6 +995,9 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
developer295120d2023-01-24 14:36:37 +080077 } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU]) {
78 val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU]);
79 mt7915_set_wireless_amsdu(hw, val8);
80+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA]) {
81+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA]);
82+ mt7915_mcu_set_cfg(phy, CFGINFO_RTS_SIGTA_EN_FEATURE, val8);
83 }
84
85 return 0;
86diff --git a/mt7915/vendor.h b/mt7915/vendor.h
developer1d9da7d2023-04-15 12:45:34 +080087index 33c75dc..6001ce4 100644
developer295120d2023-01-24 14:36:37 +080088--- a/mt7915/vendor.h
89+++ b/mt7915/vendor.h
90@@ -76,6 +76,7 @@ enum mtk_vendor_attr_wireless_ctrl {
91 MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO,
92 MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU,
93 MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT = 9,
94+ MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA,
95
96 MTK_VENDOR_ATTR_WIRELESS_CTRL_MU_EDCA, /* reserve */
97 /* keep last */
98--
developer2324aa22023-04-12 11:30:15 +0800992.18.0
developer295120d2023-01-24 14:36:37 +0800100