mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 21:36:52 +00:00
mt7603: fix aggregation tx status
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+3
-1
@@ -61,13 +61,15 @@ void mt7603_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
|
||||
{
|
||||
struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76);
|
||||
__le32 *rxd = (__le32 *) skb->data;
|
||||
__le32 *end = (__le32 *) &skb->data[skb->len];
|
||||
enum rx_pkt_type type;
|
||||
|
||||
type = MT76_GET(MT_RXD0_PKT_TYPE, le32_to_cpu(rxd[0]));
|
||||
|
||||
switch(type) {
|
||||
case PKT_TYPE_TXS:
|
||||
mt7603_mac_add_txs(dev, &rxd[1]);
|
||||
for (rxd++; rxd + 5 <= end; rxd += 5)
|
||||
mt7603_mac_add_txs(dev, rxd);
|
||||
dev_kfree_skb(skb);
|
||||
break;
|
||||
case PKT_TYPE_RX_EVENT:
|
||||
|
||||
@@ -238,6 +238,13 @@ mt7603_mac_init(struct mt7603_dev *dev)
|
||||
/* Configure all rx packets to HIF */
|
||||
mt76_wr(dev, MT_DMA_RCFR0, 0xc0200000);
|
||||
|
||||
/* Configure txs selection with aggregation */
|
||||
mt76_wr(dev, MT_DMA_TCFR1,
|
||||
MT76_SET(MT_DMA_TCFR1_TXS_AGGR_TIMEOUT, 1) | /* 32 us */
|
||||
MT_DMA_TCFR1_TXS_AGGR_COUNT | /* Maximum count */
|
||||
MT_DMA_TCFR1_TXS_QUEUE | /* Queue 1 */
|
||||
MT_DMA_TCFR1_TXS_BIT_MAP);
|
||||
|
||||
mt76_wr(dev, MT_MCU_PCIE_REMAP_1, MT_PSE_WTBL_2_PHYS_ADDR);
|
||||
|
||||
for (i = 0; i < MT7603_WTBL_SIZE; i++)
|
||||
|
||||
+7
-6
@@ -678,7 +678,7 @@ int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
static bool
|
||||
mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_sta *sta,
|
||||
struct ieee80211_tx_info *info, __le32 *txs_data)
|
||||
{
|
||||
@@ -714,16 +714,17 @@ mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_sta *sta,
|
||||
|
||||
sta->ampdu_count++;
|
||||
if (ampdu && !final_mpdu)
|
||||
return;
|
||||
return false;
|
||||
|
||||
info->status.ampdu_len = sta->ampdu_count;
|
||||
info->status.ampdu_ack_len = sta->ampdu_acked;
|
||||
|
||||
if (info->flags & IEEE80211_TX_CTL_AMPDU)
|
||||
info->flags |= IEEE80211_TX_STAT_AMPDU;
|
||||
if (ampdu || (info->flags & IEEE80211_TX_CTL_AMPDU))
|
||||
info->flags |= IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_CTL_AMPDU;
|
||||
|
||||
sta->ampdu_count = 0;
|
||||
sta->ampdu_acked = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -828,8 +829,8 @@ void mt7603_mac_add_txs(struct mt7603_dev *dev, void *data)
|
||||
if (wcidx >= MT7603_WTBL_STA)
|
||||
goto out;
|
||||
|
||||
mt7603_fill_txs(dev, msta, &info, txs_data);
|
||||
ieee80211_tx_status_noskb(mt76_hw(dev), sta, &info);
|
||||
if (mt7603_fill_txs(dev, msta, &info, txs_data))
|
||||
ieee80211_tx_status_noskb(mt76_hw(dev), sta, &info);
|
||||
|
||||
out:
|
||||
rcu_read_unlock();
|
||||
|
||||
@@ -177,6 +177,13 @@
|
||||
#define MT_DMA_DCR1 MT_WF_DMA(0x004)
|
||||
#define MT_DMA_RCFR0 MT_WF_DMA(0x070)
|
||||
#define MT_DMA_VCFR0 MT_WF_DMA(0x07c)
|
||||
|
||||
#define MT_DMA_TCFR1 MT_WF_DMA(0x084)
|
||||
#define MT_DMA_TCFR1_TXS_AGGR_TIMEOUT GENMASK(27, 16)
|
||||
#define MT_DMA_TCFR1_TXS_QUEUE BIT(14)
|
||||
#define MT_DMA_TCFR1_TXS_AGGR_COUNT GENMASK(12, 8)
|
||||
#define MT_DMA_TCFR1_TXS_BIT_MAP GENMASK(6, 0)
|
||||
|
||||
#define MT_DMA_TMCFR0 MT_WF_DMA(0x088)
|
||||
|
||||
#define MT_WF_ARB_BASE 0x21400
|
||||
|
||||
Reference in New Issue
Block a user