blob: cdb3a91b84c657e89a02e9450db3214453d9b0f8 [file] [log] [blame]
developer9237f442024-06-14 17:13:04 +08001From c9230b110a7c2db2d8863499d7a1d72b9fc74cad Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: MeiChia Chiu <meichia.chiu@mediatek.com>
3Date: Mon, 14 Aug 2023 13:36:58 +0800
developer9237f442024-06-14 17:13:04 +08004Subject: [PATCH 044/116] mtk: wifi: mt76: mt7996: add cert patch
developer66e89bc2024-04-23 14:50:01 +08005
6This patch includes TGac and TGax
7
8Commit histroy:
9
10Add vendor cmd set ap wireless rts_sigta support
11
developer66e89bc2024-04-23 14:50:01 +080012Signed-off-by: ye he <ye.he@mediatek.com>
13---
14 mt7996/mac.c | 9 ++
15 mt7996/main.c | 31 ++++++-
16 mt7996/mcu.c | 40 +++++++++
17 mt7996/mcu.h | 6 ++
18 mt7996/mt7996.h | 13 +++
19 mt7996/mtk_mcu.c | 205 ++++++++++++++++++++++++++++++++++++++++++
20 mt7996/mtk_mcu.h | 184 +++++++++++++++++++++++++++++++++++--
21 mt7996/vendor.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++-
22 mt7996/vendor.h | 67 ++++++++++++++
23 9 files changed, 778 insertions(+), 7 deletions(-)
24
25diff --git a/mt7996/mac.c b/mt7996/mac.c
developer9237f442024-06-14 17:13:04 +080026index 18616fd..70f0c56 100644
developer66e89bc2024-04-23 14:50:01 +080027--- a/mt7996/mac.c
28+++ b/mt7996/mac.c
29@@ -10,6 +10,7 @@
30 #include "../dma.h"
31 #include "mac.h"
32 #include "mcu.h"
33+#include "vendor.h"
34
35 #define to_rssi(field, rcpi) ((FIELD_GET(field, rcpi) - 220) / 2)
36
37@@ -2284,6 +2285,14 @@ void mt7996_mac_update_stats(struct mt7996_phy *phy)
38 }
39 }
40
41+void mt7996_set_wireless_amsdu(struct ieee80211_hw *hw, u8 en)
42+{
43+ if (en)
44+ ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU);
45+ else
46+ ieee80211_hw_clear(hw, SUPPORTS_AMSDU_IN_AMPDU);
47+}
48+
49 void mt7996_mac_sta_rc_work(struct work_struct *work)
50 {
51 struct mt7996_dev *dev = container_of(work, struct mt7996_dev, rc_work);
52diff --git a/mt7996/main.c b/mt7996/main.c
developer9237f442024-06-14 17:13:04 +080053index 92b2834..8e67616 100644
developer66e89bc2024-04-23 14:50:01 +080054--- a/mt7996/main.c
55+++ b/mt7996/main.c
56@@ -613,6 +613,7 @@ mt7996_get_rates_table(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
57 bool beacon, bool mcast)
58 {
59 struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
60+ struct mt7996_dev *dev = mt7996_hw_dev(hw);
61 struct mt76_phy *mphy = hw->priv;
62 u16 rate;
63 u8 i, idx;
64@@ -622,6 +623,9 @@ mt7996_get_rates_table(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
65 if (beacon) {
66 struct mt7996_phy *phy = mphy->priv;
67
68+ if (dev->cert_mode && phy->mt76->band_idx == MT_BAND2)
69+ rate = 0x0200;
70+
71 /* odd index for driver, even index for firmware */
72 idx = MT7996_BEACON_RATES_TBL + 2 * phy->mt76->band_idx;
73 if (phy->beacon_rate != rate)
74@@ -749,6 +753,10 @@ int mt7996_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
75 u8 band_idx = mvif->phy->mt76->band_idx;
76 int ret, idx;
77
78+#ifdef CONFIG_MTK_VENDOR
79+ struct mt7996_phy *phy = &dev->phy;
80+#endif
81+
82 idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7996_WTBL_STA);
83 if (idx < 0)
84 return -ENOSPC;
85@@ -774,7 +782,28 @@ int mt7996_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
86 if (ret)
87 return ret;
88
89- return mt7996_mcu_add_rate_ctrl(dev, vif, sta, false);
90+ ret = mt7996_mcu_add_rate_ctrl(dev, vif, sta, false);
91+ if (ret)
92+ return ret;
93+
94+#ifdef CONFIG_MTK_VENDOR
95+ switch (band_idx) {
96+ case MT_BAND1:
97+ phy = mt7996_phy2(dev);
98+ break;
99+ case MT_BAND2:
100+ phy = mt7996_phy3(dev);
101+ break;
102+ case MT_BAND0:
103+ default:
104+ break;
105+ }
106+
107+ if (phy && phy->muru_onoff & MUMIMO_DL_CERT)
108+ mt7996_mcu_set_mimo(phy);
109+#endif
110+
111+ return 0;
112 }
113
114 void mt7996_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
115diff --git a/mt7996/mcu.c b/mt7996/mcu.c
developer9237f442024-06-14 17:13:04 +0800116index d39a73f..423d918 100644
developer66e89bc2024-04-23 14:50:01 +0800117--- a/mt7996/mcu.c
118+++ b/mt7996/mcu.c
119@@ -1352,6 +1352,10 @@ mt7996_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
120 {
121 struct sta_rec_vht *vht;
122 struct tlv *tlv;
123+#ifdef CONFIG_MTK_VENDOR
124+ struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
125+ struct mt7996_phy *phy = (struct mt7996_phy *)msta->vif->phy;
126+#endif
127
128 /* For 6G band, this tlv is necessary to let hw work normally */
129 if (!sta->deflink.he_6ghz_capa.capa && !sta->deflink.vht_cap.vht_supported)
130@@ -1363,6 +1367,9 @@ mt7996_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
131 vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
132 vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
133 vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
134+#ifdef CONFIG_MTK_VENDOR
135+ vht->rts_bw_sig = phy->rts_bw_sig;
136+#endif
137 }
138
139 static void
140@@ -4440,6 +4447,27 @@ int mt7996_mcu_set_rts_thresh(struct mt7996_phy *phy, u32 val)
141 &req, sizeof(req), true);
142 }
143
144+int mt7996_mcu_set_band_confg(struct mt7996_phy *phy, u16 option, bool enable)
145+{
146+ struct {
147+ u8 band_idx;
148+ u8 _rsv[3];
149+
150+ __le16 tag;
151+ __le16 len;
152+ bool enable;
153+ u8 _rsv2[3];
154+ } __packed req = {
155+ .band_idx = phy->mt76->band_idx,
156+ .tag = cpu_to_le16(option),
157+ .len = cpu_to_le16(sizeof(req) - 4),
158+ .enable = enable,
159+ };
160+
161+ return mt76_mcu_send_msg(&phy->dev->mt76, MCU_WM_UNI_CMD(BAND_CONFIG),
162+ &req, sizeof(req), true);
163+}
164+
165 int mt7996_mcu_set_radio_en(struct mt7996_phy *phy, bool enable)
166 {
167 struct {
168@@ -5007,6 +5035,18 @@ void mt7996_set_wireless_vif(void *data, u8 *mac, struct ieee80211_vif *vif)
169 val = FIELD_GET(RATE_CFG_VAL, *((u32 *)data));
170
171 switch (mode) {
172+ case RATE_PARAM_FIXED_OFDMA:
173+ if (val == 3)
174+ phy->muru_onoff = OFDMA_DL;
175+ else
176+ phy->muru_onoff = val;
177+ break;
178+ case RATE_PARAM_FIXED_MIMO:
179+ if (val == 0)
180+ phy->muru_onoff = MUMIMO_DL_CERT | MUMIMO_DL;
181+ else
182+ phy->muru_onoff = MUMIMO_UL;
183+ break;
184 case RATE_PARAM_AUTO_MU:
185 if (val < 0 || val > 15) {
186 printk("Wrong value! The value is between 0-15.\n");
187diff --git a/mt7996/mcu.h b/mt7996/mcu.h
developer9237f442024-06-14 17:13:04 +0800188index 848c85d..8061638 100644
developer66e89bc2024-04-23 14:50:01 +0800189--- a/mt7996/mcu.h
190+++ b/mt7996/mcu.h
191@@ -755,6 +755,8 @@ enum {
192 RATE_PARAM_FIXED_GI = 11,
193 RATE_PARAM_AUTO = 20,
194 #ifdef CONFIG_MTK_VENDOR
195+ RATE_PARAM_FIXED_MIMO = 30,
196+ RATE_PARAM_FIXED_OFDMA = 31,
197 RATE_PARAM_AUTO_MU = 32,
198 #endif
199 };
200@@ -767,6 +769,7 @@ enum {
201 #define OFDMA_UL BIT(1)
202 #define MUMIMO_DL BIT(2)
203 #define MUMIMO_UL BIT(3)
204+#define MUMIMO_DL_CERT BIT(4)
205
206 enum {
207 BF_SOUNDING_ON = 1,
208@@ -853,11 +856,14 @@ enum {
209 UNI_BAND_CONFIG_EDCCA_ENABLE = 0x05,
210 UNI_BAND_CONFIG_EDCCA_THRESHOLD = 0x06,
211 UNI_BAND_CONFIG_RTS_THRESHOLD = 0x08,
212+ UNI_BAND_CONFIG_RTS_SIGTA_EN = 0x09,
213+ UNI_BAND_CONFIG_DIS_SECCH_CCA_DET = 0x0a,
214 };
215
216 enum {
217 UNI_WSYS_CONFIG_FW_LOG_CTRL,
218 UNI_WSYS_CONFIG_FW_DBG_CTRL,
219+ UNI_CMD_CERT_CFG = 6,
220 };
221
222 enum {
223diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h
developer9237f442024-06-14 17:13:04 +0800224index 205a3c7..30ceb00 100644
developer66e89bc2024-04-23 14:50:01 +0800225--- a/mt7996/mt7996.h
226+++ b/mt7996/mt7996.h
227@@ -354,6 +354,7 @@ struct mt7996_phy {
228 } test;
229 #endif
230 #ifdef CONFIG_MTK_VENDOR
231+ u8 rts_bw_sig;
232 spinlock_t amnt_lock;
233 struct mt7996_air_monitor_ctrl amnt_ctrl;
234 #endif
235@@ -482,6 +483,9 @@ struct mt7996_dev {
236 } dbg;
237 const struct mt7996_dbg_reg_desc *dbg_reg;
238 #endif
239+#ifdef CONFIG_MTK_VENDOR
240+ bool cert_mode;
241+#endif
242 };
243
244 enum {
245@@ -679,6 +683,7 @@ void mt7996_tm_rf_test_event(struct mt7996_dev *dev, struct sk_buff *skb);
246 int mt7996_mcu_get_tx_power_info(struct mt7996_phy *phy, u8 category, void *event);
247 int mt7996_mcu_set_scs(struct mt7996_phy *phy, u8 enable);
248 void mt7996_mcu_scs_sta_poll(struct work_struct *work);
249+int mt7996_mcu_set_band_confg(struct mt7996_phy *phy, u16 option, bool enable);
250
251 static inline u8 mt7996_max_interface_num(struct mt7996_dev *dev)
252 {
253@@ -797,6 +802,10 @@ void mt7996_vendor_register(struct mt7996_phy *phy);
254 void mt7996_vendor_amnt_fill_rx(struct mt7996_phy *phy, struct sk_buff *skb);
255 int mt7996_vendor_amnt_sta_remove(struct mt7996_phy *phy,
256 struct ieee80211_sta *sta);
257+void mt7996_set_wireless_amsdu(struct ieee80211_hw *hw, u8 en);
258+void mt7996_mcu_set_mimo(struct mt7996_phy *phy);
259+int mt7996_set_muru_cfg(struct mt7996_phy *phy, u8 action, u8 val);
260+int mt7996_mcu_set_muru_cfg(struct mt7996_phy *phy, void *data);
261 #endif
262
263 int mt7996_mcu_edcca_enable(struct mt7996_phy *phy, bool enable);
264@@ -824,6 +833,10 @@ int mt7996_mcu_set_txbf_snd_info(struct mt7996_phy *phy, void *para);
265 int mt7996_mcu_set_muru_cmd(struct mt7996_dev *dev, u16 action, int val);
266 int mt7996_mcu_muru_set_prot_frame_thr(struct mt7996_dev *dev, u32 val);
267 int mt7996_mcu_set_bypass_smthint(struct mt7996_phy *phy, u8 val);
268+int mt7996_mcu_set_rfeature_trig_type(struct mt7996_phy *phy, u8 enable, u8 trig_type);
269+void mt7996_mcu_set_ppdu_tx_type(struct mt7996_phy *phy, u8 ppdu_type);
270+void mt7996_mcu_set_nusers_ofdma(struct mt7996_phy *phy, u8 type, u8 ofdma_user_cnt);
271+void mt7996_mcu_set_cert(struct mt7996_phy *phy, u8 type);
272 #endif
273
274 #ifdef CONFIG_NET_MEDIATEK_SOC_WED
275diff --git a/mt7996/mtk_mcu.c b/mt7996/mtk_mcu.c
developer9237f442024-06-14 17:13:04 +0800276index 6865062..b67d366 100644
developer66e89bc2024-04-23 14:50:01 +0800277--- a/mt7996/mtk_mcu.c
278+++ b/mt7996/mtk_mcu.c
279@@ -982,4 +982,209 @@ int mt7996_mcu_set_bypass_smthint(struct mt7996_phy *phy, u8 val)
280 true);
281 }
282
283+int mt7996_mcu_set_bsrp_ctrl(struct mt7996_phy *phy, u16 interval,
284+ u16 ru_alloc, u32 trig_type, u8 trig_flow, u8 ext_cmd)
285+{
286+ struct mt7996_dev *dev = phy->dev;
287+ struct {
288+ u8 _rsv[4];
289+
290+ __le16 tag;
291+ __le16 len;
292+
293+ __le16 interval;
294+ __le16 ru_alloc;
295+ __le32 trigger_type;
296+ u8 trigger_flow;
297+ u8 ext_cmd_bsrp;
298+ u8 band_bitmap;
299+ u8 _rsv2;
300+ } __packed req = {
301+ .tag = cpu_to_le16(UNI_CMD_MURU_BSRP_CTRL),
302+ .len = cpu_to_le16(sizeof(req) - 4),
303+ .interval = cpu_to_le16(interval),
304+ .ru_alloc = cpu_to_le16(ru_alloc),
305+ .trigger_type = cpu_to_le32(trig_type),
306+ .trigger_flow = trig_flow,
307+ .ext_cmd_bsrp = ext_cmd,
308+ .band_bitmap = BIT(phy->mt76->band_idx),
309+ };
310+
311+ return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(MURU), &req,
312+ sizeof(req), false);
313+}
314+
315+int mt7996_mcu_set_rfeature_trig_type(struct mt7996_phy *phy, u8 enable, u8 trig_type)
316+{
317+ struct mt7996_dev *dev = phy->dev;
318+ int ret = 0;
319+ char buf[] = "01:00:00:1B";
320+
321+ if (enable) {
322+ ret = mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SET_TRIG_TYPE, trig_type);
323+ if (ret)
324+ return ret;
325+ }
326+
327+ switch (trig_type) {
328+ case CAPI_BASIC:
329+ return mt7996_mcu_set_bsrp_ctrl(phy, 5, 67, 0, 0, enable);
330+ case CAPI_BRP:
331+ return mt7996_mcu_set_txbf_snd_info(phy, buf);
332+ case CAPI_MU_BAR:
333+ return mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SET_MUDL_ACK_POLICY,
334+ MU_DL_ACK_POLICY_MU_BAR);
335+ case CAPI_BSRP:
336+ return mt7996_mcu_set_bsrp_ctrl(phy, 5, 67, 4, 0, enable);
337+ default:
338+ return 0;
339+ }
340+}
341+
342+int mt7996_mcu_set_muru_cfg(struct mt7996_phy *phy, void *data)
343+{
344+ struct mt7996_dev *dev = phy->dev;
345+ struct mt7996_muru *muru;
346+ struct {
347+ u8 _rsv[4];
348+
349+ __le16 tag;
350+ __le16 len;
351+
352+ u8 version;
353+ u8 revision;
354+ u8 _rsv2[2];
355+
356+ struct mt7996_muru muru;
357+ } __packed req = {
358+ .tag = cpu_to_le16(UNI_CMD_MURU_MUNUAL_CONFIG),
359+ .len = cpu_to_le16(sizeof(req) - 4),
360+ .version = UNI_CMD_MURU_VER_EHT,
361+ };
362+
363+ muru = (struct mt7996_muru *) data;
364+ memcpy(&req.muru, muru, sizeof(struct mt7996_muru));
365+
366+ return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(MURU), &req,
367+ sizeof(req), false);
368+}
369+
370+int mt7996_set_muru_cfg(struct mt7996_phy *phy, u8 action, u8 val)
371+{
372+ struct mt7996_muru *muru;
373+ struct mt7996_muru_dl *dl;
374+ struct mt7996_muru_ul *ul;
375+ struct mt7996_muru_comm *comm;
376+ int ret = 0;
377+
378+ muru = kzalloc(sizeof(struct mt7996_muru), GFP_KERNEL);
379+ dl = &muru->dl;
380+ ul = &muru->ul;
381+ comm = &muru->comm;
382+
383+ switch (action) {
384+ case MU_CTRL_DL_USER_CNT:
385+ dl->user_num = val;
386+ comm->ppdu_format = MURU_PPDU_HE_MU;
387+ comm->sch_type = MURU_OFDMA_SCH_TYPE_DL;
388+ muru->cfg_comm = cpu_to_le32(MURU_COMM_SET);
389+ muru->cfg_dl = cpu_to_le32(MURU_FIXED_DL_TOTAL_USER_CNT);
390+ ret = mt7996_mcu_set_muru_cfg(phy, muru);
391+ break;
392+ case MU_CTRL_UL_USER_CNT:
393+ ul->user_num = val;
394+ comm->ppdu_format = MURU_PPDU_HE_TRIG;
395+ comm->sch_type = MURU_OFDMA_SCH_TYPE_UL;
396+ muru->cfg_comm = cpu_to_le32(MURU_COMM_SET);
397+ muru->cfg_ul = cpu_to_le32(MURU_FIXED_UL_TOTAL_USER_CNT);
398+ ret = mt7996_mcu_set_muru_cfg(phy, muru);
399+ break;
400+ default:
401+ break;
402+ }
403+
404+ kfree(muru);
405+ return ret;
406+}
407+
408+void mt7996_mcu_set_ppdu_tx_type(struct mt7996_phy *phy, u8 ppdu_type)
409+{
410+ struct mt7996_dev *dev = phy->dev;
411+ int enable_su;
412+
413+ switch (ppdu_type) {
414+ case CAPI_SU:
415+ enable_su = 1;
416+ mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SUTX_CTRL, enable_su);
417+ mt7996_set_muru_cfg(phy, MU_CTRL_DL_USER_CNT, 0);
418+ break;
419+ case CAPI_MU:
420+ enable_su = 0;
421+ mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SUTX_CTRL, enable_su);
422+ break;
423+ default:
424+ break;
425+ }
426+}
427+
428+void mt7996_mcu_set_nusers_ofdma(struct mt7996_phy *phy, u8 type, u8 user_cnt)
429+{
430+ struct mt7996_dev *dev = phy->dev;
431+ int enable_su = 0;
432+
433+ mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SUTX_CTRL, enable_su);
434+ mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SET_MUDL_ACK_POLICY, MU_DL_ACK_POLICY_SU_BAR);
435+ mt7996_mcu_muru_set_prot_frame_thr(dev, 9999);
436+
437+ mt7996_set_muru_cfg(phy, type, user_cnt);
438+}
439+
440+void mt7996_mcu_set_mimo(struct mt7996_phy *phy)
441+{
442+ struct mt7996_dev *dev = phy->dev;
443+ struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
444+ int disable_ra = 1;
445+ char buf[] = "2 134 0 1 0 1 2 2 2";
446+ int force_mu = 1;
447+
448+ switch (chandef->width) {
449+ case NL80211_CHAN_WIDTH_20_NOHT:
450+ case NL80211_CHAN_WIDTH_20:
451+ strscpy(buf, "2 122 0 1 0 1 2 2 2", sizeof(buf));
452+ break;
453+ case NL80211_CHAN_WIDTH_80:
454+ break;
455+ case NL80211_CHAN_WIDTH_160:
456+ strscpy(buf, "2 137 0 1 0 1 2 2 2", sizeof(buf));
457+ break;
458+ default:
459+ break;
460+ }
461+
462+ mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SET_MUDL_ACK_POLICY, MU_DL_ACK_POLICY_SU_BAR);
463+ mt7996_mcu_set_muru_fixed_rate_enable(dev, UNI_CMD_MURU_FIXED_RATE_CTRL, disable_ra);
464+ mt7996_mcu_set_muru_fixed_rate_parameter(dev, UNI_CMD_MURU_FIXED_GROUP_RATE_CTRL, buf);
465+ mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SET_FORCE_MU, force_mu);
466+}
467+
468+void mt7996_mcu_set_cert(struct mt7996_phy *phy, u8 type)
469+{
470+ struct mt7996_dev *dev = phy->dev;
471+ struct {
472+ u8 _rsv[4];
473+
474+ __le16 tag;
475+ __le16 len;
476+ u8 action;
477+ u8 _rsv2[3];
478+ } __packed req = {
479+ .tag = cpu_to_le16(UNI_CMD_CERT_CFG),
480+ .len = cpu_to_le16(sizeof(req) - 4),
481+ .action = type, /* 1: CAPI Enable */
482+ };
483+
484+ mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(WSYS_CONFIG), &req,
485+ sizeof(req), false);
486+}
487+
488 #endif
489diff --git a/mt7996/mtk_mcu.h b/mt7996/mtk_mcu.h
developer9237f442024-06-14 17:13:04 +0800490index d9686eb..7a4140b 100644
developer66e89bc2024-04-23 14:50:01 +0800491--- a/mt7996/mtk_mcu.h
492+++ b/mt7996/mtk_mcu.h
493@@ -122,14 +122,15 @@ enum {
494 };
495
496 enum {
497+ UNI_CMD_MURU_BSRP_CTRL = 0x01,
498 UNI_CMD_MURU_SUTX_CTRL = 0x10,
499- UNI_CMD_MURU_FIXED_RATE_CTRL,
500- UNI_CMD_MURU_FIXED_GROUP_RATE_CTRL,
501+ UNI_CMD_MURU_FIXED_RATE_CTRL = 0x11,
502+ UNI_CMD_MURU_FIXED_GROUP_RATE_CTRL = 0x12,
503 UNI_CMD_MURU_SET_FORCE_MU = 0x33,
504 UNI_CMD_MURU_MUNUAL_CONFIG = 0x64,
505- UNI_CMD_MURU_SET_MUDL_ACK_POLICY = 0xC9,
506- UNI_CMD_MURU_SET_TRIG_TYPE,
507- UNI_CMD_MURU_SET_20M_DYN_ALGO,
508+ UNI_CMD_MURU_SET_MUDL_ACK_POLICY = 0xC8,
509+ UNI_CMD_MURU_SET_TRIG_TYPE = 0xC9,
510+ UNI_CMD_MURU_SET_20M_DYN_ALGO = 0xCA,
511 UNI_CMD_MURU_PROT_FRAME_THR = 0xCC,
512 UNI_CMD_MURU_SET_CERT_MU_EDCA_OVERRIDE,
513 };
514@@ -533,6 +534,179 @@ struct mt7996_mcu_sr_hw_ind_event {
515 __le32 sr_ampdu_mpdu_cnt;
516 __le32 sr_ampdu_mpdu_acked_cnt;
517 };
518+
519+struct mt7996_muru_comm {
520+ u8 pda_pol;
521+ u8 band;
522+ u8 spe_idx;
523+ u8 proc_type;
524+
525+ __le16 mlo_ctrl;
526+ u8 sch_type;
527+ u8 ppdu_format;
528+ u8 ac;
529+ u8 _rsv[3];
530+};
531+
532+struct mt7996_muru_dl {
533+ u8 user_num;
534+ u8 tx_mode;
535+ u8 bw;
536+ u8 gi;
537+
538+ u8 ltf;
539+ u8 mcs;
540+ u8 dcm;
541+ u8 cmprs;
542+
543+ __le16 ru[16];
544+
545+ u8 c26[2];
546+ u8 ack_policy;
547+ u8 tx_power;
548+
549+ __le16 mu_ppdu_duration;
550+ u8 agc_disp_order;
551+ u8 _rsv1;
552+
553+ u8 agc_disp_pol;
554+ u8 agc_disp_ratio;
555+ __le16 agc_disp_linkMFG;
556+
557+ __le16 prmbl_punc_bmp;
558+ u8 _rsv2[2];
559+
560+ struct {
561+ __le16 wlan_idx;
562+ u8 ru_alloc_seg;
563+ u8 ru_idx;
564+ u8 ldpc;
565+ u8 nss;
566+ u8 mcs;
567+ u8 mu_group_idx;
568+ u8 vht_groud_id;
569+ u8 vht_up;
570+ u8 he_start_stream;
571+ u8 he_mu_spatial;
572+ __le16 tx_power_alpha;
573+ u8 ack_policy;
574+ u8 ru_allo_ps160;
575+ } usr[16];
576+};
577+
578+struct mt7996_muru_ul {
579+ u8 user_num;
580+ u8 tx_mode;
581+
582+ u8 ba_type;
583+ u8 _rsv;
584+
585+ u8 bw;
586+ u8 gi_ltf;
587+ __le16 ul_len;
588+
589+ __le16 trig_cnt;
590+ u8 pad;
591+ u8 trig_type;
592+
593+ __le16 trig_intv;
594+ u8 trig_ta[ETH_ALEN];
595+ __le16 ul_ru[16];
596+
597+ u8 c26[2];
598+ __le16 agc_disp_linkMFG;
599+
600+ u8 agc_disp_mu_len;
601+ u8 agc_disp_pol;
602+ u8 agc_disp_ratio;
603+ u8 agc_disp_pu_idx;
604+
605+ struct {
606+ __le16 wlan_idx;
607+ u8 ru_alloc_seg;
608+ u8 ru_idx;
609+ u8 ldpc;
610+ u8 nss;
611+ u8 mcs;
612+ u8 target_rssi;
613+ __le32 trig_pkt_size;
614+ u8 ru_allo_ps160;
615+ u8 _rsv2[3];
616+ } usr[16];
617+};
618+
619+struct mt7996_muru_dbg {
620+ /* HE TB RX Debug */
621+ __le32 rx_hetb_nonsf_en_bitmap;
622+ __le32 rx_hetb_cfg[2];
623+};
624+
625+struct mt7996_muru {
626+ __le32 cfg_comm;
627+ __le32 cfg_dl;
628+ __le32 cfg_ul;
629+ __le32 cfg_dbg;
630+
631+ struct mt7996_muru_comm comm;
632+ struct mt7996_muru_dl dl;
633+ struct mt7996_muru_ul ul;
634+ struct mt7996_muru_dbg dbg;
635+};
636+
637+
638+#define MURU_PPDU_HE_TRIG BIT(2)
639+#define MURU_PPDU_HE_MU BIT(3)
640+
641+#define MURU_OFDMA_SCH_TYPE_DL BIT(0)
642+#define MURU_OFDMA_SCH_TYPE_UL BIT(1)
643+
644+/* Common Config */
645+#define MURU_COMM_PPDU_FMT BIT(0)
646+#define MURU_COMM_SCH_TYPE BIT(1)
647+#define MURU_COMM_BAND BIT(2)
648+#define MURU_COMM_WMM BIT(3)
649+#define MURU_COMM_SPE_IDX BIT(4)
650+#define MURU_COMM_PROC_TYPE BIT(5)
651+#define MURU_COMM_SET (MURU_COMM_PPDU_FMT | MURU_COMM_SCH_TYPE)
652+#define MURU_COMM_SET_TM (MURU_COMM_PPDU_FMT | MURU_COMM_BAND | \
653+ MURU_COMM_WMM | MURU_COMM_SPE_IDX)
654+
655+/* DL Common config */
656+#define MURU_FIXED_DL_TOTAL_USER_CNT BIT(4)
657+
658+/* UL Common Config */
659+#define MURU_FIXED_UL_TOTAL_USER_CNT BIT(4)
660+
661+enum {
662+ CAPI_SU,
663+ CAPI_MU,
664+ CAPI_ER_SU,
665+ CAPI_TB,
666+ CAPI_LEGACY
667+};
668+
669+enum {
670+ CAPI_BASIC,
671+ CAPI_BRP,
672+ CAPI_MU_BAR,
673+ CAPI_MU_RTS,
674+ CAPI_BSRP,
675+ CAPI_GCR_MU_BAR,
676+ CAPI_BQRP,
677+ CAPI_NDP_FRP,
678+};
679+
680+enum {
681+ MU_DL_ACK_POLICY_MU_BAR = 3,
682+ MU_DL_ACK_POLICY_TF_FOR_ACK = 4,
683+ MU_DL_ACK_POLICY_SU_BAR = 5,
684+};
685+
686+enum muru_vendor_ctrl {
687+ MU_CTRL_UPDATE,
688+ MU_CTRL_DL_USER_CNT,
689+ MU_CTRL_UL_USER_CNT,
690+};
691 #endif
692
693 #endif
694diff --git a/mt7996/vendor.c b/mt7996/vendor.c
developer9237f442024-06-14 17:13:04 +0800695index 0d6fa77..7ab6447 100644
developer66e89bc2024-04-23 14:50:01 +0800696--- a/mt7996/vendor.c
697+++ b/mt7996/vendor.c
698@@ -10,10 +10,31 @@
699 #include "vendor.h"
700 #include "mtk_mcu.h"
701
702+#ifdef CONFIG_MTK_VENDOR
703 static const struct nla_policy
704 mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = {
705 [MTK_VENDOR_ATTR_MU_CTRL_ONOFF] = {.type = NLA_U8 },
706 [MTK_VENDOR_ATTR_MU_CTRL_DUMP] = {.type = NLA_U8 },
707+ [MTK_VENDOR_ATTR_MU_CTRL_STRUCT] = {.type = NLA_BINARY },
708+};
709+
710+static const struct nla_policy
711+wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
712+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU] = {.type = NLA_U8 },
713+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_AMPDU] = {.type = NLA_U8 },
714+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
715+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA] = {.type = NLA_U8 },
716+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_FIXED_MCS] = {.type = NLA_U8 },
717+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_OFDMA] = {.type = NLA_U8 },
718+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_PPDU_TX_TYPE] = {.type = NLA_U8 },
719+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA] = {.type = NLA_U8 },
720+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO] = {.type = NLA_U8 },
721+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE] = {.type = NLA_U16 },
722+};
723+
724+static const struct nla_policy
725+wireless_dump_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP] = {
726+ [MTK_VENDOR_ATTR_WIRELESS_DUMP_AMSDU] = { .type = NLA_U8 },
727 };
728
729 static const struct nla_policy
730@@ -76,6 +97,17 @@ pp_ctrl_policy[NUM_MTK_VENDOR_ATTRS_PP_CTRL] = {
731 [MTK_VENDOR_ATTR_PP_BAND_IDX] = { .type = NLA_U8 },
732 };
733
734+static const struct nla_policy
735+rfeature_ctrl_policy[NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL] = {
736+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_GI] = {.type = NLA_U8 },
737+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_LTF] = { .type = NLA_U8 },
738+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_CFG] = { .type = NLA_NESTED },
739+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_EN] = { .type = NLA_U8 },
740+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE] = { .type = NLA_U8 },
741+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY] = { .type = NLA_U8 },
742+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TXBF] = { .type = NLA_U8 },
743+};
744+
745 struct mt7996_amnt_data {
746 u8 idx;
747 u8 addr[ETH_ALEN];
748@@ -90,6 +122,8 @@ static int mt7996_vendor_mu_ctrl(struct wiphy *wiphy,
749 {
750 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
751 struct nlattr *tb[NUM_MTK_VENDOR_ATTRS_MU_CTRL];
752+ struct mt7996_phy *phy = mt7996_hw_phy(hw);
753+ struct mt7996_muru *muru;
754 int err;
755 u8 val8;
756 u32 val32 = 0;
757@@ -105,9 +139,17 @@ static int mt7996_vendor_mu_ctrl(struct wiphy *wiphy,
758 FIELD_PREP(RATE_CFG_VAL, val8);
759 ieee80211_iterate_active_interfaces_atomic(hw, IEEE80211_IFACE_ITER_RESUME_ALL,
760 mt7996_set_wireless_vif, &val32);
761+ } else if (tb[MTK_VENDOR_ATTR_MU_CTRL_STRUCT]) {
762+ muru = kzalloc(sizeof(struct mt7996_muru), GFP_KERNEL);
763+
764+ nla_memcpy(muru, tb[MTK_VENDOR_ATTR_MU_CTRL_STRUCT],
765+ sizeof(struct mt7996_muru));
766+
767+ err = mt7996_mcu_set_muru_cfg(phy, muru);
768+ kfree(muru);
769 }
770
771- return 0;
772+ return err;
773 }
774
775 static int
776@@ -130,6 +172,48 @@ mt7996_vendor_mu_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
777 return len;
778 }
779
780+void mt7996_set_wireless_rts_sigta(struct ieee80211_hw *hw, u8 value) {
781+ struct mt7996_phy *phy = mt7996_hw_phy(hw);
782+
783+ switch (value) {
784+ case BW_SIGNALING_STATIC:
785+ case BW_SIGNALING_DYNAMIC:
786+ mt7996_mcu_set_band_confg(phy, UNI_BAND_CONFIG_RTS_SIGTA_EN, true);
787+ mt7996_mcu_set_band_confg(phy, UNI_BAND_CONFIG_DIS_SECCH_CCA_DET, false);
788+ break;
789+ default:
790+ value = BW_SIGNALING_DISABLE;
791+ mt7996_mcu_set_band_confg(phy, UNI_BAND_CONFIG_RTS_SIGTA_EN, false);
792+ mt7996_mcu_set_band_confg(phy, UNI_BAND_CONFIG_DIS_SECCH_CCA_DET, true);
793+ break;
794+ }
795+
796+ phy->rts_bw_sig = value;
797+
798+ /* Set RTS Threshold to a lower Value */
799+ mt7996_mcu_set_rts_thresh(phy, 500);
800+}
801+
802+static int
803+mt7996_vendor_wireless_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
804+ struct sk_buff *skb, const void *data, int data_len,
805+ unsigned long *storage)
806+{
807+ struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
808+ int len = 0;
809+
810+ if (*storage == 1)
811+ return -ENOENT;
812+ *storage = 1;
813+
814+ if (nla_put_u8(skb, MTK_VENDOR_ATTR_WIRELESS_DUMP_AMSDU,
815+ ieee80211_hw_check(hw, SUPPORTS_AMSDU_IN_AMPDU)))
816+ return -ENOMEM;
817+ len += 1;
818+
819+ return len;
820+ }
821+
822 void mt7996_vendor_amnt_fill_rx(struct mt7996_phy *phy, struct sk_buff *skb)
823 {
824 struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb;
825@@ -712,6 +796,126 @@ error:
826 return -EINVAL;
827 }
828
829+static int mt7996_vendor_rfeature_ctrl(struct wiphy *wiphy,
830+ struct wireless_dev *wdev,
831+ const void *data,
832+ int data_len)
833+{
834+ struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
835+ struct mt7996_phy *phy = mt7996_hw_phy(hw);
836+ struct mt7996_dev *dev = phy->dev;
837+ struct nlattr *tb[NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL];
838+ int err;
839+ u32 val;
840+
841+ err = nla_parse(tb, MTK_VENDOR_ATTR_RFEATURE_CTRL_MAX, data, data_len,
842+ rfeature_ctrl_policy, NULL);
843+ if (err)
844+ return err;
845+
846+ val = CAPI_RFEATURE_CHANGED;
847+
848+ if (tb[MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_CFG]) {
849+ u8 enable, trig_type;
850+ int rem;
851+ struct nlattr *cur;
852+
853+ nla_for_each_nested(cur, tb[MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_CFG], rem) {
854+ switch (nla_type(cur)) {
855+ case MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_EN:
856+ enable = nla_get_u8(cur);
857+ break;
858+ case MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE:
859+ trig_type = nla_get_u8(cur);
860+ break;
861+ default:
862+ return -EINVAL;
863+ };
864+ }
865+
866+ err = mt7996_mcu_set_rfeature_trig_type(phy, enable, trig_type);
867+ if (err)
868+ return err;
869+ } else if (tb[MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY]) {
870+ u8 ack_policy;
871+
872+ ack_policy = nla_get_u8(tb[MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY]);
873+ switch (ack_policy) {
874+ case MU_DL_ACK_POLICY_TF_FOR_ACK:
875+ return mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SET_MUDL_ACK_POLICY,
876+ ack_policy);
877+ default:
878+ return 0;
879+ }
880+ }
881+
882+ return 0;
883+}
884+
885+static int mt7996_vendor_wireless_ctrl(struct wiphy *wiphy,
886+ struct wireless_dev *wdev,
887+ const void *data,
888+ int data_len)
889+{
890+ struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
891+ struct mt7996_phy *phy = mt7996_hw_phy(hw);
892+ struct mt7996_dev *dev = phy->dev;
893+ struct nlattr *tb[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL];
894+ int err;
895+ u8 val8;
896+ u16 val16;
897+ u32 val32;
898+
899+ err = nla_parse(tb, MTK_VENDOR_ATTR_WIRELESS_CTRL_MAX, data, data_len,
900+ wireless_ctrl_policy, NULL);
901+ if (err)
902+ return err;
903+
904+ val32 = CAPI_WIRELESS_CHANGED;
905+
906+ if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_OFDMA]) {
907+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_OFDMA]);
908+ val32 |= FIELD_PREP(RATE_CFG_MODE, RATE_PARAM_FIXED_OFDMA) |
909+ FIELD_PREP(RATE_CFG_VAL, val8);
910+ ieee80211_iterate_active_interfaces_atomic(hw, IEEE80211_IFACE_ITER_RESUME_ALL,
911+ mt7996_set_wireless_vif, &val32);
912+ if (val8 == 3) /* DL20and80 */
913+ mt7996_mcu_set_muru_cmd(dev, UNI_CMD_MURU_SET_20M_DYN_ALGO, 1);
914+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE]) {
915+ val16 = nla_get_u16(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE]);
916+ hw->max_tx_aggregation_subframes = val16;
917+ hw->max_rx_aggregation_subframes = val16;
918+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_PPDU_TX_TYPE]) {
919+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_PPDU_TX_TYPE]);
920+ mt7996_mcu_set_ppdu_tx_type(phy, val8);
921+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA]) {
922+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA]);
923+ if (phy->muru_onoff & OFDMA_UL)
924+ mt7996_mcu_set_nusers_ofdma(phy, MU_CTRL_UL_USER_CNT, val8);
925+ else
926+ mt7996_mcu_set_nusers_ofdma(phy, MU_CTRL_DL_USER_CNT, val8);
927+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO]) {
928+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO]);
929+ val32 |= FIELD_PREP(RATE_CFG_MODE, RATE_PARAM_FIXED_MIMO) |
930+ FIELD_PREP(RATE_CFG_VAL, val8);
931+ ieee80211_iterate_active_interfaces_atomic(hw, IEEE80211_IFACE_ITER_RESUME_ALL,
932+ mt7996_set_wireless_vif, &val32);
933+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT]) {
934+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT]);
935+ dev->cert_mode = val8;
936+ mt7996_mcu_set_cert(phy, val8);
937+ mt7996_mcu_set_bypass_smthint(phy, val8);
938+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU]) {
939+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU]);
940+ mt7996_set_wireless_amsdu(hw, val8);
941+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA]) {
942+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA]);
943+ mt7996_set_wireless_rts_sigta(hw, val8);
944+ }
945+
946+ return 0;
947+}
948+
949 static const struct wiphy_vendor_command mt7996_vendor_commands[] = {
950 {
951 .info = {
952@@ -725,6 +929,18 @@ static const struct wiphy_vendor_command mt7996_vendor_commands[] = {
953 .policy = mu_ctrl_policy,
954 .maxattr = MTK_VENDOR_ATTR_MU_CTRL_MAX,
955 },
956+ {
957+ .info = {
958+ .vendor_id = MTK_NL80211_VENDOR_ID,
959+ .subcmd = MTK_NL80211_VENDOR_SUBCMD_WIRELESS_CTRL,
960+ },
961+ .flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
962+ WIPHY_VENDOR_CMD_NEED_RUNNING,
963+ .doit = mt7996_vendor_wireless_ctrl,
964+ .dumpit = mt7996_vendor_wireless_ctrl_dump,
965+ .policy = wireless_ctrl_policy,
966+ .maxattr = MTK_VENDOR_ATTR_WIRELESS_CTRL_MAX,
967+ },
968 {
969 .info = {
970 .vendor_id = MTK_NL80211_VENDOR_ID,
971@@ -794,6 +1010,17 @@ static const struct wiphy_vendor_command mt7996_vendor_commands[] = {
972 .policy = pp_ctrl_policy,
973 .maxattr = MTK_VENDOR_ATTR_PP_CTRL_MAX,
974 },
975+ {
976+ .info = {
977+ .vendor_id = MTK_NL80211_VENDOR_ID,
978+ .subcmd = MTK_NL80211_VENDOR_SUBCMD_RFEATURE_CTRL,
979+ },
980+ .flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
981+ WIPHY_VENDOR_CMD_NEED_RUNNING,
982+ .doit = mt7996_vendor_rfeature_ctrl,
983+ .policy = rfeature_ctrl_policy,
984+ .maxattr = MTK_VENDOR_ATTR_RFEATURE_CTRL_MAX,
985+ },
986 };
987
988 void mt7996_vendor_register(struct mt7996_phy *phy)
989@@ -803,3 +1030,4 @@ void mt7996_vendor_register(struct mt7996_phy *phy)
990
991 spin_lock_init(&phy->amnt_lock);
992 }
993+#endif
994diff --git a/mt7996/vendor.h b/mt7996/vendor.h
developer9237f442024-06-14 17:13:04 +0800995index 8aaa18e..2ee1339 100644
developer66e89bc2024-04-23 14:50:01 +0800996--- a/mt7996/vendor.h
997+++ b/mt7996/vendor.h
998@@ -3,8 +3,12 @@
999
1000 #define MTK_NL80211_VENDOR_ID 0x0ce7
1001
1002+#ifdef CONFIG_MTK_VENDOR
1003+
1004 enum mtk_nl80211_vendor_subcmds {
1005 MTK_NL80211_VENDOR_SUBCMD_AMNT_CTRL = 0xae,
1006+ MTK_NL80211_VENDOR_SUBCMD_RFEATURE_CTRL = 0xc3,
1007+ MTK_NL80211_VENDOR_SUBCMD_WIRELESS_CTRL = 0xc4,
1008 MTK_NL80211_VENDOR_SUBCMD_MU_CTRL = 0xc5,
1009 MTK_NL80211_VENDOR_SUBCMD_EDCCA_CTRL = 0xc7,
1010 MTK_NL80211_VENDOR_SUBCMD_3WIRE_CTRL = 0xc8,
1011@@ -61,6 +65,7 @@ enum mtk_vendor_attr_mu_ctrl {
1012
1013 MTK_VENDOR_ATTR_MU_CTRL_ONOFF,
1014 MTK_VENDOR_ATTR_MU_CTRL_DUMP,
1015+ MTK_VENDOR_ATTR_MU_CTRL_STRUCT,
1016
1017 /* keep last */
1018 NUM_MTK_VENDOR_ATTRS_MU_CTRL,
1019@@ -68,6 +73,66 @@ enum mtk_vendor_attr_mu_ctrl {
1020 NUM_MTK_VENDOR_ATTRS_MU_CTRL - 1
1021 };
1022
1023+enum mtk_capi_control_changed {
1024+ CAPI_RFEATURE_CHANGED = BIT(16),
1025+ CAPI_WIRELESS_CHANGED = BIT(17),
1026+};
1027+
1028+enum mtk_vendor_attr_rfeature_ctrl {
1029+ MTK_VENDOR_ATTR_RFEATURE_CTRL_UNSPEC,
1030+
1031+ MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_GI,
1032+ MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_LTF,
1033+ MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_CFG,
1034+ MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_EN,
1035+ MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE,
1036+ MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY,
1037+ MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TXBF,
1038+
1039+ /* keep last */
1040+ NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL,
1041+ MTK_VENDOR_ATTR_RFEATURE_CTRL_MAX =
1042+ NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL - 1
1043+};
1044+
1045+enum mtk_vendor_attr_wireless_ctrl {
1046+ MTK_VENDOR_ATTR_WIRELESS_CTRL_UNSPEC,
1047+
1048+ MTK_VENDOR_ATTR_WIRELESS_CTRL_FIXED_MCS,
1049+ MTK_VENDOR_ATTR_WIRELESS_CTRL_OFDMA,
1050+ MTK_VENDOR_ATTR_WIRELESS_CTRL_PPDU_TX_TYPE,
1051+ MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA,
1052+ MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE,
1053+ MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO,
1054+ MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU,
1055+ MTK_VENDOR_ATTR_WIRELESS_CTRL_AMPDU,
1056+ MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT = 9,
1057+ MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA,
1058+ MTK_VENDOR_ATTR_WIRELESS_CTRL_MU_EDCA, /* reserve */
1059+
1060+ /* keep last */
1061+ NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL,
1062+ MTK_VENDOR_ATTR_WIRELESS_CTRL_MAX =
1063+ NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL - 1
1064+};
1065+
1066+enum mtk_vendor_attr_wireless_dump {
1067+ MTK_VENDOR_ATTR_WIRELESS_DUMP_UNSPEC,
1068+
1069+ MTK_VENDOR_ATTR_WIRELESS_DUMP_AMSDU,
1070+
1071+ /* keep last */
1072+ NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP,
1073+ MTK_VENDOR_ATTR_WIRELESS_DUMP_MAX =
1074+ NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP - 1
1075+};
1076+
1077+enum bw_sig {
1078+ BW_SIGNALING_DISABLE,
1079+ BW_SIGNALING_STATIC,
1080+ BW_SIGNALING_DYNAMIC
1081+};
1082+
1083 enum mtk_vendor_attr_mnt_ctrl {
1084 MTK_VENDOR_ATTR_AMNT_CTRL_UNSPEC,
1085
1086@@ -151,3 +216,5 @@ enum mtk_vendor_attr_pp_ctrl {
1087 };
1088
1089 #endif
1090+
1091+#endif
1092--
developer9237f442024-06-14 17:13:04 +080010932.18.0
developer66e89bc2024-04-23 14:50:01 +08001094