developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 1 | From 88577bcf928a15c2e8e78b7684ccb75dfc693eac Mon Sep 17 00:00:00 2001 |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Mon, 20 Mar 2023 19:09:59 +0800 |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 4 | Subject: [PATCH 21/39] wifi: mt76: mt7996: update wmm queue mapping |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 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 |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 17 | index 9c80839..8e38ebc 100644 |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 18 | --- a/mt7996/main.c |
| 19 | +++ b/mt7996/main.c |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 20 | @@ -198,7 +198,7 @@ static int mt7996_add_interface(struct ieee80211_hw *hw, |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 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) |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 29 | @@ -422,9 +422,16 @@ mt7996_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 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 |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 48 | index b27b88c..4359ede 100644 |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 49 | --- a/mt7996/mcu.c |
| 50 | +++ b/mt7996/mcu.c |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 51 | @@ -2835,7 +2835,7 @@ int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif) |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 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 | -- |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 61 | 2.18.0 |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 62 | |