Skip to content

Commit 14749fe

Browse files
Benjamin Linnbd168
authored andcommitted
wifi: mt76: mt7996: fix definition of tx descriptor
For mt7992 chipsets, the definition of TXD.DW6.BIT10~15 has different interpretations on different frame types. Driver only needs to fill MSDU_CNT for non-management frames. Fixes: 408566d ("wifi: mt76: connac: add new definition of tx descriptor") Co-developed-by: Shayne Chen <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Benjamin Lin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
1 parent 5b20557 commit 14749fe

File tree

1 file changed

+3
-2
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7996

1 file changed

+3
-2
lines changed

drivers/net/wireless/mediatek/mt76/mt7996/mac.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi,
826826
struct ieee80211_key_conf *key, int pid,
827827
enum mt76_txq_id qid, u32 changed)
828828
{
829+
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
829830
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
830831
struct ieee80211_vif *vif = info->control.vif;
831832
u8 band_idx = (info->hw_queue & MT_TX_HW_QUEUE_PHY) >> 2;
@@ -893,8 +894,9 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi,
893894
val = MT_TXD6_DIS_MAT | MT_TXD6_DAS;
894895
if (is_mt7996(&dev->mt76))
895896
val |= FIELD_PREP(MT_TXD6_MSDU_CNT, 1);
896-
else
897+
else if (is_8023 || !ieee80211_is_mgmt(hdr->frame_control))
897898
val |= FIELD_PREP(MT_TXD6_MSDU_CNT_V2, 1);
899+
898900
txwi[6] = cpu_to_le32(val);
899901
txwi[7] = 0;
900902

@@ -904,7 +906,6 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi,
904906
mt7996_mac_write_txwi_80211(dev, txwi, skb, key);
905907

906908
if (txwi[1] & cpu_to_le32(MT_TXD1_FIXED_RATE)) {
907-
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
908909
bool mcast = ieee80211_is_data(hdr->frame_control) &&
909910
is_multicast_ether_addr(hdr->addr1);
910911
u8 idx = MT7996_BASIC_RATES_TBL;

0 commit comments

Comments
 (0)