developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 1 | From c31547ef67fd39b10eefc4516020383c822a55ee Mon Sep 17 00:00:00 2001 |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Thu, 16 Feb 2023 10:52:22 +0800 |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 4 | Subject: [PATCH 02/29] wifi: mt76: mt7996: let non-bufferable MMPDUs use |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 5 | correct hw queue |
| 6 | |
| 7 | non-bufferable MMPDUs are expected to use ALTX hw queue, but current |
| 8 | condition in mt7996_mac_write_txwi() won't let their tx descriptor |
| 9 | be filled with correct q_idx. Fix this by passing qid parameter into |
| 10 | the funciton. |
| 11 | |
| 12 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 13 | Change-Id: I18bd1a5ea698912c7aa8f4d4317d4a428d4ac440 |
| 14 | --- |
| 15 | mt7996/mac.c | 9 +++++---- |
| 16 | mt7996/mcu.c | 4 ++-- |
| 17 | mt7996/mt7996.h | 3 ++- |
| 18 | 3 files changed, 9 insertions(+), 7 deletions(-) |
| 19 | |
| 20 | diff --git a/mt7996/mac.c b/mt7996/mac.c |
| 21 | index d811b4e0..198eb711 100644 |
| 22 | --- a/mt7996/mac.c |
| 23 | +++ b/mt7996/mac.c |
| 24 | @@ -982,7 +982,8 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi, |
| 25 | } |
| 26 | |
| 27 | void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi, |
| 28 | - struct sk_buff *skb, struct mt76_wcid *wcid, int pid, |
| 29 | + struct sk_buff *skb, struct mt76_wcid *wcid, |
| 30 | + enum mt76_txq_id qid, int pid, |
| 31 | struct ieee80211_key_conf *key, u32 changed) |
| 32 | { |
| 33 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
| 34 | @@ -1014,7 +1015,7 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi, |
| 35 | } else if (beacon) { |
| 36 | p_fmt = MT_TX_TYPE_FW; |
| 37 | q_idx = MT_LMAC_BCN0; |
| 38 | - } else if (skb_get_queue_mapping(skb) >= MT_TXQ_PSD) { |
| 39 | + } else if (qid >= MT_TXQ_PSD) { |
| 40 | p_fmt = MT_TX_TYPE_CT; |
| 41 | q_idx = MT_LMAC_ALTX0; |
| 42 | } else { |
| 43 | @@ -1123,8 +1124,8 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, |
| 44 | memset(txwi_ptr, 0, MT_TXD_SIZE); |
| 45 | /* Transmit non qos data by 802.11 header and need to fill txd by host*/ |
| 46 | if (!is_8023 || pid >= MT_PACKET_ID_FIRST) |
| 47 | - mt7996_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, pid, |
| 48 | - key, 0); |
| 49 | + mt7996_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, qid, |
| 50 | + pid, key, 0); |
| 51 | |
| 52 | txp = (struct mt76_connac_txp_common *)(txwi + MT_TXD_SIZE); |
| 53 | for (i = 0; i < nbuf; i++) { |
| 54 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| 55 | index 8ad51cbf..dbe10576 100644 |
| 56 | --- a/mt7996/mcu.c |
| 57 | +++ b/mt7996/mcu.c |
| 58 | @@ -1906,7 +1906,7 @@ mt7996_mcu_beacon_cont(struct mt7996_dev *dev, struct ieee80211_vif *vif, |
| 59 | } |
| 60 | |
| 61 | buf = (u8 *)bcn + sizeof(*bcn) - MAX_BEACON_SIZE; |
| 62 | - mt7996_mac_write_txwi(dev, (__le32 *)buf, skb, wcid, 0, NULL, |
| 63 | + mt7996_mac_write_txwi(dev, (__le32 *)buf, skb, wcid, 0, 0, NULL, |
| 64 | BSS_CHANGED_BEACON); |
| 65 | memcpy(buf + MT_TXD_SIZE, skb->data, skb->len); |
| 66 | } |
| 67 | @@ -2115,7 +2115,7 @@ int mt7996_mcu_beacon_inband_discov(struct mt7996_dev *dev, |
| 68 | |
| 69 | buf = (u8 *)tlv + sizeof(*discov) - MAX_INBAND_FRAME_SIZE; |
| 70 | |
| 71 | - mt7996_mac_write_txwi(dev, (__le32 *)buf, skb, wcid, 0, NULL, |
| 72 | + mt7996_mac_write_txwi(dev, (__le32 *)buf, skb, wcid, 0, 0, NULL, |
| 73 | changed); |
| 74 | |
| 75 | memcpy(buf + MT_TXD_SIZE, skb->data, skb->len); |
| 76 | diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
| 77 | index 018dfd2b..d20aa5f2 100644 |
| 78 | --- a/mt7996/mt7996.h |
| 79 | +++ b/mt7996/mt7996.h |
| 80 | @@ -487,7 +487,8 @@ void mt7996_mac_enable_nf(struct mt7996_dev *dev, u8 band); |
| 81 | void mt7996_mac_enable_rtscts(struct mt7996_dev *dev, |
| 82 | struct ieee80211_vif *vif, bool enable); |
| 83 | void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi, |
| 84 | - struct sk_buff *skb, struct mt76_wcid *wcid, int pid, |
| 85 | + struct sk_buff *skb, struct mt76_wcid *wcid, |
| 86 | + enum mt76_txq_id qid, int pid, |
| 87 | struct ieee80211_key_conf *key, u32 changed); |
| 88 | void mt7996_mac_set_timing(struct mt7996_phy *phy); |
| 89 | int mt7996_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, |
| 90 | -- |
| 91 | 2.39.2 |
| 92 | |