blob: 4e4abd2fe3a330b3e5cc6978264a54fcf64a7eab [file] [log] [blame]
developer8eb72a32023-03-30 08:32:07 +08001From a2453d9011651714108a899aa791eb80925613c7 Mon Sep 17 00:00:00 2001
developer1bc2ce22023-03-25 00:47:41 +08002From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 20 Mar 2023 19:09:59 +0800
4Subject: [PATCH 24/29] wifi: mt76: mt7996: update wmm queue mapping
5
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
developer8eb72a32023-03-30 08:32:07 +080017index cb0e0d3..4e9536e 100644
developer1bc2ce22023-03-25 00:47:41 +080018--- a/mt7996/main.c
19+++ b/mt7996/main.c
20@@ -197,7 +197,7 @@ static int mt7996_add_interface(struct ieee80211_hw *hw,
21 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)
29@@ -419,9 +419,16 @@ mt7996_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
30 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
developer8eb72a32023-03-30 08:32:07 +080048index a0d468d..deb6e1e 100644
developer1bc2ce22023-03-25 00:47:41 +080049--- a/mt7996/mcu.c
50+++ b/mt7996/mcu.c
51@@ -2902,7 +2902,7 @@ int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif)
52
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--
developer8eb72a32023-03-30 08:32:07 +0800612.18.0
developer1bc2ce22023-03-25 00:47:41 +080062