From 3e7fc1573c6fdee20b42a32f9bcb66540c1cb3bc Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 12 Jun 2019 16:40:00 +0200 Subject: [PATCH] mt76x02: fix reporting of non-probing frames with tx status requested If the first rate index is not set, pull it from the sta default rate Signed-off-by: Felix Fietkau --- mt76x02_mac.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mt76x02_mac.c b/mt76x02_mac.c index dd711bac..82bafb5a 100644 --- a/mt76x02_mac.c +++ b/mt76x02_mac.c @@ -456,7 +456,7 @@ mt76x02_tx_rate_fallback(struct ieee80211_tx_rate *rates, int idx, int phy) } static void -mt76x02_mac_fill_tx_status(struct mt76x02_dev *dev, +mt76x02_mac_fill_tx_status(struct mt76x02_dev *dev, struct mt76x02_sta *msta, struct ieee80211_tx_info *info, struct mt76x02_tx_status *st, int n_frames) { @@ -478,6 +478,12 @@ mt76x02_mac_fill_tx_status(struct mt76x02_dev *dev, mt76x02_mac_process_tx_rate(&rate[0], first_rate, dev->mt76.chandef.chan->band); + } else if (rate[0].idx < 0) { + if (!msta) + return; + + mt76x02_mac_process_tx_rate(&rate[0], msta->wcid.tx_info, + dev->mt76.chandef.chan->band); } mt76x02_mac_process_tx_rate(&last_rate, st->rate, @@ -574,14 +580,14 @@ void mt76x02_send_tx_status(struct mt76x02_dev *dev, return; } - mt76x02_mac_fill_tx_status(dev, status.info, &msta->status, - msta->n_frames); + mt76x02_mac_fill_tx_status(dev, msta, status.info, + &msta->status, msta->n_frames); msta->status = *stat; msta->n_frames = 1; *update = 0; } else { - mt76x02_mac_fill_tx_status(dev, status.info, stat, 1); + mt76x02_mac_fill_tx_status(dev, msta, status.info, stat, 1); *update = 1; }