From d3a589586d1b1d9e1422e31f642a500ff0195f20 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 10 Oct 2019 22:28:49 +0200 Subject: [PATCH] mt76: fix a-mpdu boundary detection issue for airtime reporting status->ampdu_ref can be 0 if the first frame is an A-MPDU. Avoid calling mt76_airtime_flush_ampdu again without reinitializing the status wcid by checking dev->rx_ampdu_len first. Signed-off-by: Felix Fietkau --- mac80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mac80211.c b/mac80211.c index 686d9b97..833a2618 100644 --- a/mac80211.c +++ b/mac80211.c @@ -675,7 +675,8 @@ mt76_airtime_check(struct mt76_dev *dev, struct sk_buff *skb) mt76_airtime_flush_ampdu(dev); if (status->flag & RX_FLAG_AMPDU_DETAILS) { - if (status->ampdu_ref != dev->rx_ampdu_ref) { + if (!dev->rx_ampdu_len || + status->ampdu_ref != dev->rx_ampdu_ref) { dev->rx_ampdu_status = *status; dev->rx_ampdu_status.wcid_idx = wcid ? wcid->idx : 0xff; dev->rx_ampdu_ref = status->ampdu_ref;