blob: 6b1d6841b61406c0b379a505bea7c49c6df944c4 [file] [log] [blame]
developer692ed9b2023-06-19 12:03:50 +08001From 88577bcf928a15c2e8e78b7684ccb75dfc693eac Mon Sep 17 00:00:00 2001
developerf552fec2023-03-27 11:22:06 +08002From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 20 Mar 2023 19:09:59 +0800
developer692ed9b2023-06-19 12:03:50 +08004Subject: [PATCH 21/39] wifi: mt76: mt7996: update wmm queue mapping
developerf552fec2023-03-27 11:22:06 +08005
6The mac80211 use mac80211 queue (MQ) and the firmware
7use access class index (ACI) so convert the MQ to ACI
8in mt7996_conf_tx.
9
10Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
11---
12 mt7996/main.c | 11 +++++++++--
13 mt7996/mcu.c | 2 +-
14 2 files changed, 10 insertions(+), 3 deletions(-)
15
16diff --git a/mt7996/main.c b/mt7996/main.c
developer692ed9b2023-06-19 12:03:50 +080017index 9c80839..8e38ebc 100644
developerf552fec2023-03-27 11:22:06 +080018--- a/mt7996/main.c
19+++ b/mt7996/main.c
developer7af0f762023-05-22 15:16:16 +080020@@ -198,7 +198,7 @@ static int mt7996_add_interface(struct ieee80211_hw *hw,
developerf552fec2023-03-27 11:22:06 +080021 mvif->mt76.omac_idx = idx;
22 mvif->phy = phy;
23 mvif->mt76.band_idx = band_idx;
24- mvif->mt76.wmm_idx = band_idx;
25+ mvif->mt76.wmm_idx = vif->type != NL80211_IFTYPE_AP;
26
27 ret = mt7996_mcu_add_dev_info(phy, vif, true);
28 if (ret)
developer692ed9b2023-06-19 12:03:50 +080029@@ -422,9 +422,16 @@ mt7996_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
developerf552fec2023-03-27 11:22:06 +080030 const struct ieee80211_tx_queue_params *params)
31 {
32 struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
33+ const u8 MQ_to_ACI[IEEE80211_NUM_ACS] = {
34+ [IEEE80211_AC_VO] = 3,
35+ [IEEE80211_AC_VI] = 2,
36+ [IEEE80211_AC_BE] = 0,
37+ [IEEE80211_AC_BK] = 1,
38+ };
39
40 /* no need to update right away, we'll get BSS_CHANGED_QOS */
41- queue = mt76_connac_lmac_mapping(queue);
42+ /* convert mac80211 queue to ACI */
43+ queue = MQ_to_ACI[queue];
44 mvif->queue_params[queue] = *params;
45
46 return 0;
47diff --git a/mt7996/mcu.c b/mt7996/mcu.c
developer692ed9b2023-06-19 12:03:50 +080048index b27b88c..4359ede 100644
developerf552fec2023-03-27 11:22:06 +080049--- a/mt7996/mcu.c
50+++ b/mt7996/mcu.c
developer692ed9b2023-06-19 12:03:50 +080051@@ -2835,7 +2835,7 @@ int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif)
developerf552fec2023-03-27 11:22:06 +080052
53 e = (struct edca *)tlv;
54 e->set = WMM_PARAM_SET;
55- e->queue = ac + mvif->mt76.wmm_idx * MT7996_MAX_WMM_SETS;
56+ e->queue = ac;
57 e->aifs = q->aifs;
58 e->txop = cpu_to_le16(q->txop);
59
60--
developer692ed9b2023-06-19 12:03:50 +0800612.18.0
developerf552fec2023-03-27 11:22:06 +080062