rt2x00: Fix TX status reporting
Not all values of the TX status enumeration were covered during updating of the TX statistics. This could lead to wrong bitrate tuning but also wrong behavior in tools like hostapd. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
1ee50cd9a2
commit
2e27cff871
|
@ -206,6 +206,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
|
||||||
unsigned int header_length = ieee80211_get_hdrlen_from_skb(entry->skb);
|
unsigned int header_length = ieee80211_get_hdrlen_from_skb(entry->skb);
|
||||||
u8 rate_idx, rate_flags, retry_rates;
|
u8 rate_idx, rate_flags, retry_rates;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
bool success;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unmap the skb.
|
* Unmap the skb.
|
||||||
|
@ -233,14 +234,19 @@ void rt2x00lib_txdone(struct queue_entry *entry,
|
||||||
*/
|
*/
|
||||||
rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry->skb);
|
rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry->skb);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Determine if the frame has been successfully transmitted.
|
||||||
|
*/
|
||||||
|
success =
|
||||||
|
test_bit(TXDONE_SUCCESS, &txdesc->flags) ||
|
||||||
|
test_bit(TXDONE_UNKNOWN, &txdesc->flags) ||
|
||||||
|
test_bit(TXDONE_FALLBACK, &txdesc->flags);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update TX statistics.
|
* Update TX statistics.
|
||||||
*/
|
*/
|
||||||
rt2x00dev->link.qual.tx_success +=
|
rt2x00dev->link.qual.tx_success += success;
|
||||||
test_bit(TXDONE_SUCCESS, &txdesc->flags) ||
|
rt2x00dev->link.qual.tx_failed += !success;
|
||||||
test_bit(TXDONE_UNKNOWN, &txdesc->flags);
|
|
||||||
rt2x00dev->link.qual.tx_failed +=
|
|
||||||
test_bit(TXDONE_FAILURE, &txdesc->flags);
|
|
||||||
|
|
||||||
rate_idx = skbdesc->tx_rate_idx;
|
rate_idx = skbdesc->tx_rate_idx;
|
||||||
rate_flags = skbdesc->tx_rate_flags;
|
rate_flags = skbdesc->tx_rate_flags;
|
||||||
|
@ -263,22 +269,20 @@ void rt2x00lib_txdone(struct queue_entry *entry,
|
||||||
tx_info->status.rates[i].flags = rate_flags;
|
tx_info->status.rates[i].flags = rate_flags;
|
||||||
tx_info->status.rates[i].count = 1;
|
tx_info->status.rates[i].count = 1;
|
||||||
}
|
}
|
||||||
if (i < (IEEE80211_TX_MAX_RATES -1))
|
if (i < (IEEE80211_TX_MAX_RATES - 1))
|
||||||
tx_info->status.rates[i].idx = -1; /* terminate */
|
tx_info->status.rates[i].idx = -1; /* terminate */
|
||||||
|
|
||||||
if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) {
|
if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) {
|
||||||
if (test_bit(TXDONE_SUCCESS, &txdesc->flags) ||
|
if (success)
|
||||||
test_bit(TXDONE_UNKNOWN, &txdesc->flags))
|
|
||||||
tx_info->flags |= IEEE80211_TX_STAT_ACK;
|
tx_info->flags |= IEEE80211_TX_STAT_ACK;
|
||||||
else if (test_bit(TXDONE_FAILURE, &txdesc->flags))
|
else
|
||||||
rt2x00dev->low_level_stats.dot11ACKFailureCount++;
|
rt2x00dev->low_level_stats.dot11ACKFailureCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) {
|
if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) {
|
||||||
if (test_bit(TXDONE_SUCCESS, &txdesc->flags) ||
|
if (success)
|
||||||
test_bit(TXDONE_UNKNOWN, &txdesc->flags))
|
|
||||||
rt2x00dev->low_level_stats.dot11RTSSuccessCount++;
|
rt2x00dev->low_level_stats.dot11RTSSuccessCount++;
|
||||||
else if (test_bit(TXDONE_FAILURE, &txdesc->flags))
|
else
|
||||||
rt2x00dev->low_level_stats.dot11RTSFailureCount++;
|
rt2x00dev->low_level_stats.dot11RTSFailureCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue