developer | d5789dc | 2023-03-27 11:22:06 +0800 | [diff] [blame^] | 1 | From 96c6a8e68b5fd3dacdb5239a6ce9a26e5a08c07f Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Mon, 20 Mar 2023 19:09:59 +0800 |
| 4 | Subject: [PATCH 24/29] wifi: mt76: mt7996: update wmm queue mapping |
| 5 | |
| 6 | The mac80211 use mac80211 queue (MQ) and the firmware |
| 7 | use access class index (ACI) so convert the MQ to ACI |
| 8 | in mt7996_conf_tx. |
| 9 | |
| 10 | Signed-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 | |
| 16 | diff --git a/mt7996/main.c b/mt7996/main.c |
| 17 | index cb0e0d31..4e9536e7 100644 |
| 18 | --- 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; |
| 47 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| 48 | index a0d468df..deb6e1eb 100644 |
| 49 | --- 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 | -- |
| 61 | 2.39.2 |
| 62 | |