developer | 5bea732 | 2023-04-13 18:50:55 +0800 | [diff] [blame^] | 1 | From f189e6091ebfe4ffd55647450fa860aaf983d751 Mon Sep 17 00:00:00 2001 |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 2 | From: "himanshu.goyal" <himanshu.goyal@mediatek.com> |
| 3 | Date: Tue, 24 Jan 2023 14:32:08 +0800 |
developer | c923344 | 2023-04-04 06:06:17 +0800 | [diff] [blame] | 4 | Subject: [PATCH 1030/1031] wifi: mt76: mt7915: Add vendor command attribute |
| 5 | for RTS BW signaling. |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 6 | |
| 7 | Signed-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 | |
| 15 | diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
developer | 5bea732 | 2023-04-13 18:50:55 +0800 | [diff] [blame^] | 16 | index 13b86ed9..0fe15a54 100644 |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 17 | --- a/mt7915/mcu.c |
| 18 | +++ b/mt7915/mcu.c |
developer | 5bea732 | 2023-04-13 18:50:55 +0800 | [diff] [blame^] | 19 | @@ -4531,6 +4531,12 @@ int mt7915_mcu_set_cfg(struct mt7915_phy *phy, u8 cfg_info, u8 type) |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 20 | 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); |
| 32 | diff --git a/mt7915/mcu.h b/mt7915/mcu.h |
developer | 5bea732 | 2023-04-13 18:50:55 +0800 | [diff] [blame^] | 33 | index a999e0c3..acfd7152 100644 |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 34 | --- a/mt7915/mcu.h |
| 35 | +++ b/mt7915/mcu.h |
developer | 5bea732 | 2023-04-13 18:50:55 +0800 | [diff] [blame^] | 36 | @@ -905,6 +905,13 @@ struct three_wire_cfg { |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 37 | 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]; |
developer | 5bea732 | 2023-04-13 18:50:55 +0800 | [diff] [blame^] | 50 | @@ -912,11 +919,13 @@ struct cfg_basic_info { |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 51 | 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 | |
| 64 | diff --git a/mt7915/vendor.c b/mt7915/vendor.c |
developer | 5bea732 | 2023-04-13 18:50:55 +0800 | [diff] [blame^] | 65 | index 2e5f07c3..3b7ac098 100644 |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 66 | --- 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 |
| 76 | @@ -992,6 +993,9 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy, |
| 77 | } 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; |
| 86 | diff --git a/mt7915/vendor.h b/mt7915/vendor.h |
developer | 5bea732 | 2023-04-13 18:50:55 +0800 | [diff] [blame^] | 87 | index 33c75dc9..6001ce4a 100644 |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 88 | --- 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 | -- |
developer | 2324aa2 | 2023-04-12 11:30:15 +0800 | [diff] [blame] | 99 | 2.18.0 |
developer | 295120d | 2023-01-24 14:36:37 +0800 | [diff] [blame] | 100 | |