blob: ea175e0c66cea083dcb167ea024ed7515fc84f5e [file] [log] [blame]
developerc978ea12022-11-09 15:58:31 +08001From 8db1f707b2644b1ae0c0881502c811d3ddc00c72 Mon Sep 17 00:00:00 2001
2From: Lian Chen <lian.chen@mediatek.com>
3Date: Mon, 7 Nov 2022 14:47:44 +0800
4Subject: [PATCH] mt76: HW ATF support for mt7986
5
6Signed-off-by: Lian Chen <lian.chen@mediatek.com>
7---
8 mt76_connac_mcu.h | 2 +
9 mt7915/debugfs.c | 405 +++++++++++++++++++++++++++++++++++++++++++
10 mt7915/init.c | 39 +++++
11 mt7915/main.c | 16 ++
12 mt7915/mcu.c | 165 ++++++++++++++++++
13 mt7915/mt7915.h | 68 ++++++++
14 mt7915/mtk_debugfs.c | 133 +++++++++++++-
15 7 files changed, 827 insertions(+), 1 deletion(-)
16 mode change 100755 => 100644 mt7915/debugfs.c
17
18diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
19index c7e28e3e..c2c17f06 100644
20--- a/mt76_connac_mcu.h
21+++ b/mt76_connac_mcu.h
22@@ -1117,6 +1117,7 @@ enum {
23 MCU_EXT_CMD_THERMAL_CTRL = 0x2c,
24 MCU_EXT_CMD_WTBL_UPDATE = 0x32,
25 MCU_EXT_CMD_SET_DRR_CTRL = 0x36,
26+ MCU_EXT_CMD_SET_FEATURE_CTRL = 0x38,
27 MCU_EXT_CMD_SET_RDD_CTRL = 0x3a,
28 MCU_EXT_CMD_ATE_CTRL = 0x3d,
29 MCU_EXT_CMD_PROTECT_CTRL = 0x3e,
30@@ -1126,6 +1127,7 @@ enum {
31 MCU_EXT_CMD_MUAR_UPDATE = 0x48,
32 MCU_EXT_CMD_BCN_OFFLOAD = 0x49,
33 MCU_EXT_CMD_RX_AIRTIME_CTRL = 0x4a,
34+ MCU_EXT_CMD_AT_PROC_MODULE = 0x4b,
35 MCU_EXT_CMD_SET_RX_PATH = 0x4e,
36 MCU_EXT_CMD_EFUSE_FREE_BLOCK = 0x4f,
37 MCU_EXT_CMD_TX_POWER_FEATURE_CTRL = 0x58,
38diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
39old mode 100755
40new mode 100644
41index f585eb93..71eee310
42--- a/mt7915/debugfs.c
43+++ b/mt7915/debugfs.c
44@@ -12,6 +12,10 @@
45 #define FW_BIN_LOG_MAGIC_V2 0x44d9c99a
46 #endif
47
48+#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
49+#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
50+
51+
52 /** global debugfs **/
53
54 struct hw_queue_map {
55@@ -209,6 +213,406 @@ static const struct file_operations mt7915_fw_ser_ops = {
56 .llseek = default_llseek,
57 };
58
59+static ssize_t mt7915_vow_get(struct file *file, char __user *user_buf,
60+ size_t count, loff_t *ppos)
61+{
62+ char *buff;
63+ int desc = 0;
64+ ssize_t ret;
65+ static const size_t bufsz = 1000;
66+
67+ buff = kmalloc(bufsz, GFP_KERNEL);
68+ if (!buff)
69+ return -ENOMEM;
70+
71+ desc += scnprintf(buff + desc, bufsz - desc,
72+ "======== Control =============\n"
73+ "vow_atf_en=<0/1> 0:disable, 1:enable\n"
74+ "vow_watf_en=<0/1> 0:disable, 1:enable\n"
75+ "vow_watf_quantum=<level>-<quantum> unit 256us\n"
76+ "======== Station table =============\n"
77+ "vow_sta_dwrr_quantum_id=<wlanidx>-<WMM AC>-<Qid>\n"
78+ "vow_dwrr_max_wait_time=<time> 256us\n"
79+ "======== Debug =============\n"
80+ "vow_show_en=<0/1> 0:dieable, 1:enable\n"
81+ "vow_show_sta=<STA num>\n"
82+ "show_vow_info\n"
83+ "show_vow_sta_conf=<STA num> 0:all\n");
84+ ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
85+ kfree(buff);
86+ return ret;
87+}
88+
89+static int mt7915_set_vow_sta_dwrr_quantum_id(struct mt7915_dev *dev,
90+ u32 wcid_id,
91+ u32 ac, u32 val)
92+{
93+ struct mt7915_sta *msta;
94+ struct mt76_wcid *wcid;
95+ int ret;
96+
97+ wcid = rcu_dereference(dev->mt76.wcid[wcid_id]);
98+ if ((!wcid) || (!wcid->sta)) {
99+ dev_err(dev->mt76.dev, "%s: error station.\n", __func__);
100+ return 0;
101+ }
102+
103+ msta = container_of(wcid, struct mt7915_sta, wcid);
104+
105+ msta->vow_sta_cfg.dwrr_quantum[ac] = val;
106+
107+ ret = mt7915_mcu_set_vow_drr_ctrl(dev, msta, VOW_DRR_STA_AC0_QUA_ID + ac);
108+ dev_info(dev->mt76.dev, "%s: set sta %d, ac %d, quantum id %u.\n",
109+ __func__, wcid_id, ac, val);
110+
111+ return ret;
112+}
113+
114+static int mt7915_set_vow_atf_en(struct mt7915_dev *dev, u32 val)
115+{
116+ int ret;
117+
118+ dev->vow_cfg.vow_atf_en = !!val;
119+ dev->vow_cfg.sta_max_wait_time = val ? 0x40 : 0x1;
120+ ret = mt7915_mcu_set_vow_feature_ctrl(dev);
121+ dev_info(dev->mt76.dev, "%s: set vow_atf_en %u.\n",
122+ __func__, val);
123+
124+ ret = mt7915_mcu_set_vow_drr_ctrl(dev, NULL,
125+ VOW_DRR_AIRTIME_DEFICIT_BOUND);
126+ dev_info(dev->mt76.dev, "%s: set vow_dwrr_max_wait_time %u.\n",
127+ __func__, dev->vow_cfg.sta_max_wait_time);
128+
129+ return ret;
130+}
131+
132+static int mt7915_set_vow_dwrr_max_wait_time(struct mt7915_dev *dev,
133+ u32 val)
134+{
135+ int ret;
136+
137+ dev->vow_cfg.sta_max_wait_time = val;
138+ ret = mt7915_mcu_set_vow_drr_ctrl(dev, NULL,
139+ VOW_DRR_AIRTIME_DEFICIT_BOUND);
140+ dev_info(dev->mt76.dev, "%s: set vow_dwrr_max_wait_time %u.\n",
141+ __func__, val);
142+
143+ return ret;
144+}
145+
146+static int mt7915_set_vow_watf_en(struct mt7915_dev *dev, u32 val)
147+{
148+ int ret;
149+
150+ dev->vow_cfg.vow_watf_en = !!val;
151+ ret = mt7915_mcu_set_vow_feature_ctrl(dev);
152+ dev_info(dev->mt76.dev, "%s: set vow_watf_en %u.\n", __func__, val);
153+
154+ return ret;
155+}
156+
157+static int mt7915_set_vow_watf_quantum(struct mt7915_dev *dev,
158+ u32 id, u32 val)
159+{
160+ int ret;
161+
162+ dev->vow_cfg.vow_sta_dwrr_quantum[id] = val;
163+ ret = mt7915_mcu_set_vow_drr_ctrl(dev, NULL,
164+ VOW_DRR_AIRTIME_QUANTUM_L0 + id);
165+ dev_info(dev->mt76.dev, "%s: set quantum id %u, val %d.\n",
166+ __func__, id, val);
167+
168+ return ret;
169+}
170+
171+extern int mt7915_vow_pleinfo_read(struct mt7915_dev *dev);
172+static void mt7915_show_station_tx_airtime(struct work_struct *work){
173+ struct mt7915_dev *dev = container_of(work, struct mt7915_dev,
174+ vow_work.work);
175+ static u32 vow_last_tx_time[MT7916_WTBL_SIZE];
176+ struct ieee80211_sta *ieee80211_sta;
177+ struct mt7915_sta *msta;
178+ struct mt76_wcid *wcid;
179+ int idx = 0;
180+ int i = 0;
181+ u32 addr;
182+ int tx_airtime_sum = 0;
183+ int tx_add_airtime = 0;
184+
185+ if (!dev->vow_cfg.vow_show_en)
186+ return;
187+
188+ rcu_read_lock();
189+ for (idx = 1; (idx < dev->vow_cfg.vow_show_sta) &&
190+ (idx < MT7915_WTBL_STA); idx++) {
191+ if (idx >= ARRAY_SIZE(dev->mt76.wcid))
192+ return;
193+
194+ wcid = rcu_dereference(dev->mt76.wcid[idx]);
195+ if (!wcid || !wcid->sta)
196+ continue;
197+
198+ msta = container_of(wcid, struct mt7915_sta, wcid);
199+ addr = mt7915_mac_wtbl_lmac_addr(dev, idx, 20);
200+ tx_airtime_sum = 0;
201+
202+ for (i = 0; i < IEEE80211_NUM_ACS; i++) {
203+ tx_airtime_sum += mt76_rr(dev, addr);
204+ addr += 8;
205+ }
206+ tx_add_airtime = tx_airtime_sum - vow_last_tx_time[idx];
207+ vow_last_tx_time[idx] = tx_airtime_sum;
208+
209+ ieee80211_sta = container_of((void *)msta, struct ieee80211_sta,
210+ drv_priv);
211+
212+ dev_info(dev->mt76.dev, "sta%u:" MACSTR " tx -> %u)\n",
213+ idx, MAC2STR(ieee80211_sta->addr), tx_add_airtime);
214+ }
215+ mt7915_vow_pleinfo_read(dev);
216+ ieee80211_queue_delayed_work(mt76_hw(dev), &dev->vow_work, 1 * HZ);
217+ rcu_read_unlock();
218+ return;
219+}
220+
221+
222+static int mt7915_set_vow_show_en(struct mt7915_dev *dev, u32 val)
223+{
224+ if (!!dev->vow_cfg.vow_show_en == !!val)
225+ return 0;
226+ dev->vow_cfg.vow_show_en = val;
227+ mt7915_mcu_set_vow_feature_ctrl(dev);
228+ if (dev->vow_cfg.vow_show_en) {
229+ INIT_DELAYED_WORK(&dev->vow_work, mt7915_show_station_tx_airtime);
230+ ieee80211_queue_delayed_work(mt76_hw(dev), &dev->vow_work, 1 * HZ);
231+ }
232+ else {
233+ cancel_delayed_work_sync(&dev->vow_work);
234+ }
235+ return 0;
236+}
237+
238+static int mt7915_set_vow_show_sta(struct mt7915_dev *dev, u32 val)
239+{
240+ dev->vow_cfg.vow_show_sta = val;
241+ dev_info(dev->mt76.dev, "%s: show station up to %d.\n",
242+ __func__, dev->vow_cfg.vow_show_sta);
243+ return 0;
244+}
245+static int mt7915_set_show_vow_info(struct mt7915_dev *dev)
246+{
247+ dev_info(dev->mt76.dev, "====== VOW Control Information ======\n");
248+ dev_info(dev->mt76.dev, "ATF Enbale: %d\n",
249+ dev->vow_cfg.vow_atf_en);
250+ dev_info(dev->mt76.dev, "WATF Enable: %d\n",
251+ dev->vow_cfg.vow_watf_en);
252+ dev_info(dev->mt76.dev, "refill_period: %d\n",
253+ dev->vow_cfg.refill_period);
254+ dev_info(dev->mt76.dev, "===== VOW Max Deficit Information =====\n");
255+ dev_info(dev->mt76.dev, "VOW Max Deficit(unit 256us): %d\n",
256+ dev->vow_cfg.sta_max_wait_time);
257+ dev_info(dev->mt76.dev, "===== VOW Quantum Information =====\n");
258+ dev_info(dev->mt76.dev, "Quantum ID 0 value(unit 256us): %d\n",
259+ dev->vow_cfg.vow_sta_dwrr_quantum[0]);
260+ dev_info(dev->mt76.dev, "Quantum ID 1 value(unit 256us): %d\n",
261+ dev->vow_cfg.vow_sta_dwrr_quantum[1]);
262+ dev_info(dev->mt76.dev, "Quantum ID 2 value(unit 256us): %d\n",
263+ dev->vow_cfg.vow_sta_dwrr_quantum[2]);
264+ dev_info(dev->mt76.dev, "Quantum ID 3 value(unit 256us): %d\n",
265+ dev->vow_cfg.vow_sta_dwrr_quantum[3]);
266+ return 0;
267+}
268+
269+static int mt7915_show_vow_sta_conf(struct mt7915_dev *dev, u32 val)
270+{
271+ struct ieee80211_sta *ieee80211_sta;
272+ struct mt7915_sta *msta;
273+ struct mt76_wcid *wcid;
274+ u32 i;
275+ u8 q;
276+
277+ if (val > 0 && val < MT7915_WTBL_STA) {
278+ wcid = rcu_dereference(dev->mt76.wcid[val]);
279+ if (!wcid || !wcid->sta)
280+ return 0;
281+ msta = container_of(wcid, struct mt7915_sta, wcid);
282+ ieee80211_sta = container_of((void *)msta, struct ieee80211_sta,
283+ drv_priv);
284+ dev_info(dev->mt76.dev, "%s: ****** sta%d: "MACSTR"******\n",
285+ __func__, val, MAC2STR(ieee80211_sta->addr));
286+ q = msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VO];
287+ dev_info(dev->mt76.dev, "Ac0 --> %uus(%u)\n",
288+ (dev->vow_cfg.vow_sta_dwrr_quantum[q] << 8), q);
289+ q = msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VI];
290+ dev_info(dev->mt76.dev, "Ac1 --> %uus(%u)\n",
291+ (dev->vow_cfg.vow_sta_dwrr_quantum[q] << 8), q);
292+ q = msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BE];
293+ dev_info(dev->mt76.dev, "Ac2 --> %uus(%u)\n",
294+ (dev->vow_cfg.vow_sta_dwrr_quantum[q] << 8), q);
295+ q = msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BK];
296+ dev_info(dev->mt76.dev, "Ac3 --> %uus(%u)\n",
297+ (dev->vow_cfg.vow_sta_dwrr_quantum[q] << 8), q);
298+ }
299+ else{
300+ for (i = 1; i < MT7915_WTBL_STA; i++) {
301+ wcid = rcu_dereference(dev->mt76.wcid[i]);
302+ if (!wcid || !wcid->sta)
303+ continue;
304+ msta = container_of(wcid, struct mt7915_sta, wcid);
305+ ieee80211_sta = container_of((void *)msta, struct ieee80211_sta,
306+ drv_priv);
307+ dev_info(dev->mt76.dev, "%s: ****** sta%d: "MACSTR"******\n",
308+ __func__, i, MAC2STR(ieee80211_sta->addr));
309+ q = msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VO];
310+ dev_info(dev->mt76.dev, "Ac0 --> %uus(%u)\n",
311+ (dev->vow_cfg.vow_sta_dwrr_quantum[q] << 8), q);
312+ q = msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VI];
313+ dev_info(dev->mt76.dev, "Ac1 --> %uus(%u)\n",
314+ (dev->vow_cfg.vow_sta_dwrr_quantum[q] << 8), q);
315+ q = msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BE];
316+ dev_info(dev->mt76.dev, "Ac2 --> %uus(%u)\n",
317+ (dev->vow_cfg.vow_sta_dwrr_quantum[q] << 8), q);
318+ q = msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BK];
319+ dev_info(dev->mt76.dev, "Ac3 --> %uus(%u)\n",
320+ (dev->vow_cfg.vow_sta_dwrr_quantum[q] << 8), q);
321+ }
322+ }
323+ return 0;
324+}
325+
326+static ssize_t
327+mt7915_vow_set(struct file *file, const char __user *user_buf,
328+ size_t count, loff_t *ppos)
329+{
330+ struct mt7915_phy *phy = file->private_data;
331+ struct mt7915_dev *dev = phy->dev;
332+ u32 rv, param1, param2, param3;
333+ char buf[128];
334+ int ret = 0;
335+
336+ if (count >= sizeof(buf))
337+ return -EINVAL;
338+
339+ if (copy_from_user(buf, user_buf, count))
340+ return -EFAULT;
341+
342+ if (count && buf[count - 1] == '\n')
343+ buf[count - 1] = '\0';
344+ else
345+ buf[count] = '\0';
346+
347+ if (!strncmp(buf, "vow_sta_dwrr_quantum_id",
348+ strlen("vow_sta_dwrr_quantum_id")))
349+ {
350+ rv = sscanf(buf, "vow_sta_dwrr_quantum_id=%d-%d-%d",
351+ &param1, &param2, &param3);
352+ if ((rv > 2) && (param2 < IEEE80211_NUM_ACS) &&
353+ (param3 < VOW_WATF_LEVEL_NUM)) {
354+ ret = mt7915_set_vow_sta_dwrr_quantum_id(dev, param1,
355+ param2, param3);
356+ }
357+ else {
358+ goto out;
359+ }
360+ }
361+ else if (!strncmp(buf, "vow_atf_en", strlen("vow_atf_en")))
362+ {
363+ rv = sscanf(buf, "vow_atf_en=%d", &param1);
364+ if (rv > 0) {
365+ ret = mt7915_set_vow_atf_en(dev, param1);
366+ }
367+ else {
368+ goto out;
369+ }
370+ }
371+ else if (!strncmp(buf, "vow_dwrr_max_wait_time",
372+ strlen("vow_dwrr_max_wait_time")))
373+ {
374+ rv = sscanf(buf, "vow_dwrr_max_wait_time=%d", &param1);
375+ if (rv > 0) {
376+ ret = mt7915_set_vow_dwrr_max_wait_time(dev, param1);
377+ }
378+ else {
379+ goto out;
380+ }
381+ }
382+ else if (!strncmp(buf, "vow_watf_en", strlen("vow_watf_en")))
383+ {
384+ rv = sscanf(buf, "vow_watf_en=%d", &param1);
385+ if (rv > 0) {
386+ ret = mt7915_set_vow_watf_en(dev, param1);
387+ }
388+ else {
389+ goto out;
390+ }
391+ }
392+ else if (!strncmp(buf, "vow_watf_quantum",
393+ strlen("vow_watf_quantum")))
394+ {
395+ rv = sscanf(buf, "vow_watf_quantum=%d-%d",
396+ &param1, &param2);
397+ if ((dev->vow_cfg.vow_watf_en) && (rv > 1) &&
398+ (param1 < VOW_WATF_LEVEL_NUM)) {
399+ ret = mt7915_set_vow_watf_quantum(dev, param1, param2);
400+ }
401+ else {
402+ goto out;
403+ }
404+ }
405+ else if (!strncmp(buf, "vow_show_en", strlen("vow_show_en")))
406+ {
407+ rv = sscanf(buf, "vow_show_en=%d", &param1);
408+ if (rv > 0) {
409+ ret = mt7915_set_vow_show_en(dev, param1);
410+ }
411+ else {
412+ goto out;
413+ }
414+ }
415+ else if (!strncmp(buf, "vow_show_sta", strlen("vow_show_sta")))
416+ {
417+ rv = sscanf(buf, "vow_show_sta=%d", &param1);
418+ if ((rv > 0)&& (param1 < MT7915_WTBL_STA)) {
419+ ret = mt7915_set_vow_show_sta(dev, param1);
420+ }
421+ else {
422+ goto out;
423+ }
424+ }
425+ else if (!strncmp(buf, "show_vow_info", strlen("show_vow_info")))
426+ {
427+ if (rv == 0) {
428+ ret = mt7915_set_show_vow_info(dev);
429+ }
430+ else {
431+ dev_err(dev->mt76.dev, "show_vow_info\n");
432+ goto out;
433+ }
434+ }
435+ else if (!strncmp(buf, "show_vow_sta_conf", strlen("show_vow_sta_conf")))
436+ {
437+ rv = sscanf(buf, "show_vow_sta_conf=%d", &param1);
438+ if ((rv > 0) && (param1 < MT7915_WTBL_STA)) {
439+ ret = mt7915_show_vow_sta_conf(dev, param1);
440+ }
441+ else {
442+ goto out;
443+ }
444+ }
445+
446+ if (ret)
447+ return ret;
448+out:
449+ return count;
450+}
451+
452+static const struct file_operations mt7915_vow_ops = {
453+ .write = mt7915_vow_set,
454+ .read = mt7915_vow_get,
455+ .open = simple_open,
456+ .llseek = default_llseek,
457+};
458+
459 static int
460 mt7915_radar_trigger(void *data, u64 val)
461 {
462@@ -1109,6 +1513,7 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
463 debugfs_create_devm_seqfile(dev->mt76.dev, "twt_stats", dir,
464 mt7915_twt_stats);
465 debugfs_create_file("rf_regval", 0600, dir, dev, &fops_rf_regval);
466+ debugfs_create_file("vow", 0600, dir, phy, &mt7915_vow_ops);
467
468 if (!dev->dbdc_support || phy->band_idx) {
469 debugfs_create_u32("dfs_hw_pattern", 0400, dir,
470diff --git a/mt7915/init.c b/mt7915/init.c
471index eb62816b..01f41a7a 100755
472--- a/mt7915/init.c
473+++ b/mt7915/init.c
474@@ -449,10 +449,46 @@ mt7915_mac_init_band(struct mt7915_dev *dev, u8 band)
475 mt76_clear(dev, MT_DMA_DCR0(band), MT_DMA_DCR0_RXD_G5_EN);
476 }
477
478+void mt7915_vow_init(struct mt7915_dev *dev)
479+{
480+ struct mt7915_vow_cfg *vow_cfg = &dev->vow_cfg;
481+ bool ret;
482+ int i;
483+
484+ if (!(is_mt7915(&dev->mt76)))
485+ vow_cfg->vow_feature |= VOW_FEATURE_BWCG;
486+
487+ vow_cfg->vow_atf_en = 0x1;
488+ vow_cfg->sta_max_wait_time = 0x40;
489+ vow_cfg->refill_period = 0x5;
490+
491+ vow_cfg->vow_sta_dwrr_quantum[0] = 0x06;
492+ vow_cfg->vow_sta_dwrr_quantum[1] = 0x0c;
493+ vow_cfg->vow_sta_dwrr_quantum[2] = 0x10;
494+ vow_cfg->vow_sta_dwrr_quantum[3] = 0x14;
495+ vow_cfg->vow_sta_dwrr_quantum[4] = 0x18;
496+ vow_cfg->vow_sta_dwrr_quantum[5] = 0x1c;
497+ vow_cfg->vow_sta_dwrr_quantum[6] = 0x20;
498+ vow_cfg->vow_sta_dwrr_quantum[7] = 0x24;
499+
500+ ret = mt7915_mcu_set_vow_drr_ctrl(dev, NULL,
501+ VOW_DRR_AIRTIME_DEFICIT_BOUND);
502+ ret = mt7915_mcu_set_vow_drr_ctrl(dev, NULL,
503+ VOW_DRR_AIRTIME_QUANTUM_ALL);
504+
505+ for(i = 0; i < 4; i++)
506+ ret = mt7915_mcu_set_vow_drr_ctrl(dev, NULL,
507+ VOW_DRR_AIRTIME_QUANTUM_L0 + i);
508+
509+ ret = mt7915_mcu_set_vow_feature_ctrl(dev);
510+ return;
511+}
512+
513 void mt7915_mac_init(struct mt7915_dev *dev)
514 {
515 int i;
516 u32 rx_len = is_mt7915(&dev->mt76) ? 0x400 : 0x680;
517+ struct wiphy *wiphy = dev->phy.mt76->hw->wiphy;
518
519 /* config pse qid6 wfdma port selection */
520 if (!is_mt7915(&dev->mt76) && dev->hif2)
521@@ -477,6 +513,9 @@ void mt7915_mac_init(struct mt7915_dev *dev)
522 i = dev->mt76.led_pin ? MT_LED_GPIO_MUX3 : MT_LED_GPIO_MUX2;
523 mt76_rmw_field(dev, i, MT_LED_GPIO_SEL_MASK, 4);
524 }
525+
526+ if (mt7915_is_atf_defult_on(wiphy, dev))
527+ mt7915_vow_init(dev);
528 }
529
530 int mt7915_txbf_init(struct mt7915_dev *dev)
531diff --git a/mt7915/main.c b/mt7915/main.c
532index aa18e557..ca018766 100644
533--- a/mt7915/main.c
534+++ b/mt7915/main.c
535@@ -196,6 +196,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
536 {
537 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
538 struct mt7915_dev *dev = mt7915_hw_dev(hw);
539+ struct wiphy *wiphy = dev->phy.mt76->hw->wiphy;
540 struct mt7915_phy *phy = mt7915_hw_phy(hw);
541 struct mt76_txq *mtxq;
542 bool ext_phy = phy != &dev->phy;
543@@ -265,6 +266,10 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
544 mt7915_mcu_add_sta(dev, vif, NULL, true);
545 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
546
547+ if (mt7915_is_atf_defult_on(wiphy, dev)) {
548+ mt7915_mcu_set_vow_band(dev, mvif);
549+ }
550+
551 out:
552 mutex_unlock(&dev->mt76.mutex);
553
554@@ -683,6 +688,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
555 struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
556 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
557 bool ext_phy = mvif->phy != &dev->phy;
558+ struct wiphy *wiphy = dev->phy.mt76->hw->wiphy;
559 #ifdef CONFIG_MTK_VENDOR
560 struct mt7915_phy *phy;
561 #endif
562@@ -735,6 +741,16 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
563 mt7915_mcu_set_mimo(phy, 0);
564 }
565 #endif
566+ if (mt7915_is_atf_defult_on(wiphy, dev)) {
567+ msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VO] = 2;
568+ msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VI] = 2;
569+ msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BE] = 1;
570+ msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BK] = 0;
571+ mt7915_mcu_set_vow_drr_ctrl(dev, msta, VOW_DRR_STA_BSS_GROUP);
572+ mt7915_mcu_set_vow_drr_ctrl(dev, msta, VOW_DRR_STA_PAUSE_SETTING);
573+ mt7915_mcu_set_vow_drr_ctrl(dev, msta, VOW_DRR_STA_ALL);
574+ }
575+
576 return 0;
577 }
578
579diff --git a/mt7915/mcu.c b/mt7915/mcu.c
580index 4c42a575..a75e62bc 100644
581--- a/mt7915/mcu.c
582+++ b/mt7915/mcu.c
583@@ -3378,6 +3378,171 @@ int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band)
584 &req, sizeof(req), false);
585 }
586
587+int mt7915_mcu_set_vow_drr_ctrl(struct mt7915_dev *dev,
588+ struct mt7915_sta *msta,
589+ u32 subcmd)
590+{
591+ u32 setting = 0;
592+ u32 i;
593+
594+ struct {
595+ __le32 action;
596+ u8 wlan_idx_lo;
597+ u8 status;
598+ u8 wlan_idx_hi;
599+ u8 rsv0[5];
600+ union {
601+ __le32 com_value;
602+ struct {
603+ u8 air_time_quantum[VOW_MAX_STA_DWRR_NUM];
604+ }air_time_quantum_all;
605+ }air_time_ctrl;
606+ } __packed req = {
607+ .action = cpu_to_le32(subcmd),
608+ .wlan_idx_lo = msta ? to_wcid_lo(msta->wcid.idx) : to_wcid_lo(0x0),
609+ .wlan_idx_hi = msta ? to_wcid_hi(msta->wcid.idx) : to_wcid_hi(0x0),
610+ };
611+
612+ switch (subcmd) {
613+ case VOW_DRR_STA_ALL:{
614+ setting |= 0x00;
615+ setting |= msta->vif->mt76.idx;
616+ setting |= msta->vow_sta_cfg.ac_change_rule << 4;
617+ setting |= (msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VO] << 8);
618+ setting |= (msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VI] << 12);
619+ setting |= (msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BE] << 16);
620+ setting |= (msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BK] << 20);
621+ if (dev->vow_cfg.vow_feature & VOW_FEATURE_BWCG)
622+ setting |= ((UMAC_BWC_GROUP_MIN) << 24);
623+ req.air_time_ctrl.com_value = cpu_to_le32(setting);
624+ break;
625+ }
626+
627+ case VOW_DRR_STA_BSS_GROUP:
628+ req.air_time_ctrl.com_value = cpu_to_le32(0x0);
629+ break;
630+
631+ case VOW_DRR_STA_PAUSE_SETTING:
632+ req.air_time_ctrl.com_value = cpu_to_le32(msta->vow_sta_cfg.paused);
633+ break;
634+
635+ case VOW_DRR_STA_AC0_QUA_ID:
636+ req.air_time_ctrl.com_value =
637+ cpu_to_le32(msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VO]);
638+ break;
639+
640+ case VOW_DRR_STA_AC1_QUA_ID:
641+ req.air_time_ctrl.com_value =
642+ cpu_to_le32(msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_VI]);
643+ break;
644+
645+ case VOW_DRR_STA_AC2_QUA_ID:
646+ req.air_time_ctrl.com_value =
647+ cpu_to_le32(msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BE]);
648+ break;
649+
650+ case VOW_DRR_STA_AC3_QUA_ID:
651+ req.air_time_ctrl.com_value =
652+ cpu_to_le32(msta->vow_sta_cfg.dwrr_quantum[IEEE80211_AC_BK]);
653+ break;
654+
655+ case VOW_DRR_AIRTIME_DEFICIT_BOUND:
656+ req.air_time_ctrl.com_value =
657+ cpu_to_le32(dev->vow_cfg.sta_max_wait_time);
658+ break;
659+
660+ case VOW_DRR_AIRTIME_QUANTUM_L0:
661+ case VOW_DRR_AIRTIME_QUANTUM_L1:
662+ case VOW_DRR_AIRTIME_QUANTUM_L2:
663+ case VOW_DRR_AIRTIME_QUANTUM_L3:
664+ case VOW_DRR_AIRTIME_QUANTUM_L4:
665+ case VOW_DRR_AIRTIME_QUANTUM_L5:
666+ case VOW_DRR_AIRTIME_QUANTUM_L6:
667+ case VOW_DRR_AIRTIME_QUANTUM_L7:
668+ req.air_time_ctrl.com_value =
669+ cpu_to_le32(dev->vow_cfg.vow_sta_dwrr_quantum[subcmd -
670+ VOW_DRR_AIRTIME_QUANTUM_L0]);
671+ break;
672+
673+ case VOW_DRR_AIRTIME_QUANTUM_ALL: {
674+ for (i = 0; i < VOW_MAX_STA_DWRR_NUM; i++) {
675+ req.air_time_ctrl.air_time_quantum_all.air_time_quantum[i] =
676+ dev->vow_cfg.vow_sta_dwrr_quantum[i];
677+ }
678+ break;
679+ }
680+
681+ default:
682+ break;
683+ }
684+
685+ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_DRR_CTRL),
686+ &req, sizeof(req), false);
687+}
688+
689+int mt7915_mcu_set_vow_feature_ctrl(struct mt7915_dev *dev)
690+{
691+ u16 value = 0;
692+ u32 sch_value = 0;
693+
694+ struct vow_feature_ctrl {
695+ __le16 bss_flag;
696+ __le16 vow_ctrl_flag;
697+ __le16 bss_value[9];
698+ __le16 vow_ctrl_val;
699+ __le16 time_token_value[2];
700+ __le16 length_token_value[2];
701+ __le32 tx_ctrl;
702+ __le32 sch_ctrl;
703+ } __packed req = {
704+ .bss_flag = cpu_to_le16(0xffff),
705+ .vow_ctrl_flag = cpu_to_le16(0xf231),
706+ .bss_value[0] = cpu_to_le16(0xffff),
707+ .bss_value[2] = cpu_to_le16(0xffff),
708+ .bss_value[8] = cpu_to_le16(0xffff),
709+ .time_token_value[0] = cpu_to_le16(0xffff),
710+ };
711+
712+ value |= dev->vow_cfg.refill_period;
713+ value |= 1 << 4;
714+ value |= 1 << 5;
715+ value |= dev->vow_cfg.vow_watf_en << 9;
716+ value |= 1 << 12;
717+ value |= dev->vow_cfg.vow_atf_en << 13;
718+ value |= 1 << 14;
719+ req.vow_ctrl_val = value;
720+ if (dev->vow_cfg.vow_atf_en)
721+ req.tx_ctrl = cpu_to_le32(0x6bf69e1f);
722+ sch_value |= 1 << 6;
723+ sch_value |= (((dev->vow_cfg.vow_show_en == 0) ? 0 :
724+ (dev->vow_cfg.vow_show_en - 1 )) << 4);
725+ req.sch_ctrl = sch_value;
726+
727+ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_FEATURE_CTRL),
728+ &req, sizeof(req), false);
729+}
730+
731+int mt7915_mcu_set_vow_band(struct mt7915_dev *dev, struct mt7915_vif *mvif)
732+{
733+ struct module_ctrl {
734+ __le16 action;
735+ __le16 sub_action;
736+ __le32 rsv1[5];
737+ u8 rsv2[72];
738+ u8 group_idx;
739+ u8 band_idx;
740+ u8 rsv3[2];
741+ } __packed req = {
742+ .action = cpu_to_le16(0x1),
743+ .sub_action = cpu_to_le16(0x4),
744+ .group_idx = mvif->mt76.band_idx * 4 + mvif->mt76.omac_idx % 4,
745+ .band_idx = mvif->mt76.band_idx,
746+ };
747+
748+ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(AT_PROC_MODULE),
749+ &req, sizeof(req), false);
750+}
751+
752 int mt7915_mcu_set_txbf(struct mt7915_dev *dev, u8 action)
753 {
754 struct {
755diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
756index 2874afa9..f708246f 100644
757--- a/mt7915/mt7915.h
758+++ b/mt7915/mt7915.h
759@@ -129,6 +129,58 @@ struct mt7915_twt_flow {
760 u8 sched:1;
761 };
762
763+#define VOW_MAX_STA_DWRR_NUM 8
764+#define VOW_WATF_LEVEL_NUM 4
765+#define VOW_FEATURE_BWCG BIT(3)
766+#define UMAC_BWC_GROUP_MIN 40
767+
768+
769+enum ext_cmd_vow_drr_ctrl {
770+ /* Type 1 */
771+ VOW_DRR_STA_ALL = 0x00,
772+ VOW_DRR_STA_BSS_GROUP = 0x01,
773+ VOW_DRR_STA_AC0_QUA_ID = 0x03,
774+ VOW_DRR_STA_AC1_QUA_ID = 0x04,
775+ VOW_DRR_STA_AC2_QUA_ID = 0x05,
776+ VOW_DRR_STA_AC3_QUA_ID = 0x06,
777+
778+ /* Type 2 */
779+ VOW_DRR_AIRTIME_DEFICIT_BOUND = 0x10,
780+
781+ /* Type 3 */
782+ VOW_DRR_AIRTIME_QUANTUM_L0 = 0x20,
783+ VOW_DRR_AIRTIME_QUANTUM_L1 = 0x21,
784+ VOW_DRR_AIRTIME_QUANTUM_L2 = 0x22,
785+ VOW_DRR_AIRTIME_QUANTUM_L3 = 0x23,
786+ VOW_DRR_AIRTIME_QUANTUM_L4 = 0x24,
787+ VOW_DRR_AIRTIME_QUANTUM_L5 = 0x25,
788+ VOW_DRR_AIRTIME_QUANTUM_L6 = 0x26,
789+ VOW_DRR_AIRTIME_QUANTUM_L7 = 0x27,
790+ VOW_DRR_AIRTIME_QUANTUM_ALL = 0x28,
791+ VOW_DRR_STA_PAUSE_SETTING = 0x30,
792+};
793+
794+struct mt7915_vow_sta_cfg{
795+ u8 dwrr_quantum[IEEE80211_NUM_ACS];
796+ u8 ac_change_rule;
797+ bool paused;
798+};
799+
800+struct mt7915_vow_cfg{
801+ /*ATF setting */
802+ u32 vow_feature;
803+ bool vow_atf_en;
804+ u8 refill_period;
805+ u8 sta_max_wait_time;
806+ u8 vow_sta_dwrr_quantum[VOW_MAX_STA_DWRR_NUM];
807+ u8 vow_show_en;
808+ u32 vow_show_sta;
809+
810+ /*WATF setting */
811+ bool vow_watf_en;
812+};
813+
814+
815 struct mt7915_sta {
816 struct mt76_wcid wcid; /* must be first */
817
818@@ -148,6 +200,7 @@ struct mt7915_sta {
819 u8 flowid_mask;
820 struct mt7915_twt_flow flow[MT7915_MAX_STA_TWT_AGRT];
821 } twt;
822+ struct mt7915_vow_sta_cfg vow_sta_cfg;
823 };
824
825 struct mt7915_vif_cap {
826@@ -444,6 +497,8 @@ struct mt7915_dev {
827 } dbg;
828 const struct mt7915_dbg_reg_desc *dbg_reg;
829 #endif
830+ struct delayed_work vow_work;
831+ struct mt7915_vow_cfg vow_cfg;
832 };
833
834 enum {
835@@ -482,6 +537,15 @@ enum mt7915_rdd_cmd {
836 RDD_IRQ_OFF,
837 };
838
839+static inline bool
840+mt7915_is_atf_defult_on(struct wiphy *wiphy, struct mt7915_dev *dev)
841+{
842+ return ((!wiphy_ext_feature_isset(wiphy,
843+ NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) ||
844+ mtk_wed_device_active(&dev->mt76.mmio.wed));
845+}
846+
847+
848 static inline struct mt7915_phy *
849 mt7915_hw_phy(struct ieee80211_hw *hw)
850 {
851@@ -614,6 +678,10 @@ int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band, bool enable,
852 int mt7915_mcu_set_test_param(struct mt7915_dev *dev, u8 param, bool test_mode,
853 u8 en);
854 int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band);
855+int mt7915_mcu_set_vow_drr_ctrl(struct mt7915_dev *dev, struct mt7915_sta *msta,
856+ u32 subcmd);
857+int mt7915_mcu_set_vow_feature_ctrl(struct mt7915_dev *dev);
858+int mt7915_mcu_set_vow_band(struct mt7915_dev *dev, struct mt7915_vif *mvif);
859 int mt7915_mcu_set_sku_en(struct mt7915_phy *phy, bool enable);
860 int mt7915_mcu_set_txpower_sku(struct mt7915_phy *phy);
861 int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len);
862diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
863index 41bd0ff1..12251d91 100644
864--- a/mt7915/mtk_debugfs.c
865+++ b/mt7915/mtk_debugfs.c
866@@ -1300,7 +1300,6 @@ static EMPTY_QUEUE_INFO_T ple_txcmd_queue_empty_info[] = {
867 };
868
869
870-
871 static char* sta_ctrl_reg[] = {"ENABLE", "DISABLE", "PAUSE"};
872 static u32 chip_show_sta_acq_info(struct seq_file *s, struct mt7915_dev *dev, u32 *ple_stat,
873 u32 *sta_pause, u32 *dis_sta_map,
874@@ -1454,6 +1453,138 @@ static void chip_get_sta_pause(struct mt7915_dev *dev, u32 *sta_pause)
875 }
876 }
877
878+u32 vow_chip_show_sta_acq_info(struct mt7915_dev *dev, u32 *ple_stat,
879+ u32 *sta_pause, u32 *dis_sta_map,
880+ u32 dumptxd)
881+{
882+ int i, j;
883+ u32 total_nonempty_cnt = 0;
884+ u32 ac_num = 9, all_ac_num;
885+ static char* sta_ctrl_reg[] = {"ENABLE", "DISABLE", "PAUSE"};
886+ if (!is_mt7915(&dev->mt76))
887+ ac_num = 17;
888+
889+ all_ac_num = ac_num * 4;
890+
891+ for (j = 0; j < all_ac_num; j++) { /* show AC Q info */
892+ for (i = 0; i < 32; i++) {
893+ if (((ple_stat[j + 1] & (0x1 << i)) >> i) == 0) {
894+ u32 hfid, tfid, pktcnt, ac_n = j / ac_num, ctrl = 0;
895+ u32 sta_num = i + (j % ac_num) * 32, fl_que_ctrl[3] = {0};
896+ u32 wmmidx = 0;
897+ struct mt7915_sta *msta;
898+ struct mt76_wcid *wcid;
899+ struct ieee80211_sta *sta = NULL;
900+
901+ wcid = rcu_dereference(dev->mt76.wcid[sta_num]);
902+ sta = wcid_to_sta(wcid);
903+ if (!sta) {
904+ printk("ERROR!! no found STA wcid=%d\n", sta_num);
905+ continue;
906+ }
907+ msta = container_of(wcid, struct mt7915_sta, wcid);
908+ wmmidx = msta->vif->mt76.wmm_idx;
909+
910+ dev_info(dev->mt76.dev, "\tSTA%d AC%d: ", sta_num, ac_n);
911+
912+ fl_que_ctrl[0] |= MT_DBG_PLE_FL_QUE_CTRL0_EXECUTE_MASK;
913+ fl_que_ctrl[0] |= (ENUM_UMAC_LMAC_PORT_2 <<
914+ MT_PLE_FL_QUE_CTRL0_Q_BUF_PID_SHFT);
915+ fl_que_ctrl[0] |= (ac_n << MT_PLE_FL_QUE_CTRL0_Q_BUF_QID_SHFT);
916+ fl_que_ctrl[0] |= sta_num;
917+ mt76_wr(dev, MT_DBG_PLE_FL_QUE_CTRL0, fl_que_ctrl[0]);
918+ fl_que_ctrl[1] = mt76_rr(dev, MT_DBG_PLE_FL_QUE_CTRL2);
919+ fl_que_ctrl[2] = mt76_rr(dev, MT_DBG_PLE_FL_QUE_CTRL3);
920+ hfid = FIELD_GET(MT_DBG_PLE_FL_QUE_CTRL2_Q_HEAD_FID_MASK,
921+ fl_que_ctrl[1]);
922+ tfid = FIELD_GET(MT_DBG_PLE_FL_QUE_CTRL2_Q_TAIL_FID_MASK,
923+ fl_que_ctrl[1]);
924+ pktcnt = FIELD_GET(MT_DBG_PLE_FL_QUE_CTRL3_Q_PKT_NUM_MASK,
925+ fl_que_ctrl[2]);
926+ dev_info(dev->mt76.dev, "tail/head fid = 0x%03x/0x%03x, pkt cnt = 0x%03x",
927+ tfid, hfid, pktcnt);
928+
929+ if (((sta_pause[j % 6] & 0x1 << i) >> i) == 1)
930+ ctrl = 2;
931+
932+ if (((dis_sta_map[j % 6] & 0x1 << i) >> i) == 1)
933+ ctrl = 1;
934+
935+ dev_info(dev->mt76.dev, " ctrl = %s", sta_ctrl_reg[ctrl]);
936+ dev_info(dev->mt76.dev, " (wmmidx=%d)\n", wmmidx);
937+
938+ total_nonempty_cnt++;
939+ }
940+ }
941+ }
942+
943+ return total_nonempty_cnt;
944+}
945+
946+int mt7915_vow_pleinfo_read(struct mt7915_dev *dev)
947+{
948+ u32 ple_stat[70] = {0}, pg_flow_ctrl[8] = {0};
949+ u32 ple_txcmd_stat;
950+ u32 sta_pause[CR_NUM_OF_AC] = {0}, dis_sta_map[CR_NUM_OF_AC] = {0};
951+ int i;
952+
953+ chip_get_ple_acq_stat(dev, ple_stat);
954+ ple_txcmd_stat = mt76_rr(dev, MT_DBG_PLE_TXCMD_Q_EMPTY);
955+ pg_flow_ctrl[0] = mt76_rr(dev, MT_DBG_PLE_FREEPG_CNT);
956+ pg_flow_ctrl[1] = mt76_rr(dev, MT_DBG_PLE_FREEPG_HEAD_TAIL);
957+ pg_flow_ctrl[2] = mt76_rr(dev, MT_DBG_PLE_PG_HIF_GROUP);
958+ pg_flow_ctrl[3] = mt76_rr(dev, MT_DBG_PLE_HIF_PG_INFO);
959+ pg_flow_ctrl[4] = mt76_rr(dev, MT_DBG_PLE_PG_CPU_GROUP);
960+ pg_flow_ctrl[5] = mt76_rr(dev, MT_DBG_PLE_CPU_PG_INFO);
961+ pg_flow_ctrl[6] = mt76_rr(dev, MT_DBG_PLE_PG_HIF_TXCMD_GROUP);
962+ pg_flow_ctrl[7] = mt76_rr(dev, MT_DBG_PLE_HIF_TXCMD_PG_INFO);
963+ chip_get_dis_sta_map(dev, dis_sta_map);
964+ chip_get_sta_pause(dev, sta_pause);
965+
966+ dev_info(dev->mt76.dev, "PLE Configuration Info:\n");
967+
968+ for (i = 0; i < 32; i++) {
969+ if (((ple_stat[0] & (0x1 << i)) >> i) == 0) {
970+ u32 hfid, tfid, pktcnt, fl_que_ctrl[3] = {0};
971+
972+ if (ple_queue_empty_info[i].QueueName != NULL) {
973+ fl_que_ctrl[0] |= MT_DBG_PLE_FL_QUE_CTRL0_EXECUTE_MASK;
974+ fl_que_ctrl[0] |= (ple_queue_empty_info[i].Portid <<
975+ MT_PLE_FL_QUE_CTRL0_Q_BUF_PID_SHFT);
976+ fl_que_ctrl[0] |= (ple_queue_empty_info[i].Queueid <<
977+ MT_PLE_FL_QUE_CTRL0_Q_BUF_QID_SHFT);
978+ } else
979+ continue;
980+
981+ if (ple_queue_empty_info[i].Queueid >=
982+ ENUM_UMAC_LMAC_PLE_TX_Q_ALTX_0 &&
983+ ple_queue_empty_info[i].Queueid <=
984+ ENUM_UMAC_LMAC_PLE_TX_Q_PSMP_0)
985+ /* band0 set TGID 0, bit31 = 0 */
986+ mt76_wr(dev, MT_DBG_PLE_FL_QUE_CTRL1, 0x0);
987+ else if (ple_queue_empty_info[i].Queueid >=
988+ ENUM_UMAC_LMAC_PLE_TX_Q_ALTX_1 &&
989+ ple_queue_empty_info[i].Queueid <=
990+ ENUM_UMAC_LMAC_PLE_TX_Q_PSMP_1)
991+ /* band1 set TGID 1, bit31 = 1 */
992+ mt76_wr(dev, MT_DBG_PLE_FL_QUE_CTRL1, 0x80000000);
993+
994+ mt76_wr(dev, MT_DBG_PLE_FL_QUE_CTRL0, fl_que_ctrl[0]);
995+ fl_que_ctrl[1] = mt76_rr(dev, MT_DBG_PLE_FL_QUE_CTRL2);
996+ fl_que_ctrl[2] = mt76_rr(dev, MT_DBG_PLE_FL_QUE_CTRL3);
997+ hfid = FIELD_GET(MT_DBG_PLE_FL_QUE_CTRL2_Q_HEAD_FID_MASK,
998+ fl_que_ctrl[1]);
999+ tfid = FIELD_GET(MT_DBG_PLE_FL_QUE_CTRL2_Q_TAIL_FID_MASK,
1000+ fl_que_ctrl[1]);
1001+ pktcnt = FIELD_GET(MT_DBG_PLE_FL_QUE_CTRL3_Q_PKT_NUM_MASK,
1002+ fl_que_ctrl[2]);
1003+ }
1004+ }
1005+
1006+ vow_chip_show_sta_acq_info(dev, ple_stat, sta_pause, dis_sta_map, 0);
1007+
1008+ return 0;
1009+}
1010 static int mt7915_pleinfo_read(struct seq_file *s, void *data)
1011 {
1012 struct mt7915_dev *dev = dev_get_drvdata(s->private);
1013--
10142.18.0
1015