aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2009-08-29 13:10:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-31 14:42:14 -0400
commit2e27cff871dec9371e41022aaaebb3452ec069c0 (patch)
treeb261921b4916755908e85a9a398234f2aecda066 /drivers
parent1ee50cd9a22fdb22ce7bdb7f978d25b79993788d (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 3f8c70ebe9ad..0647e514dde1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -206,6 +206,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
206 unsigned int header_length = ieee80211_get_hdrlen_from_skb(entry->skb); 206 unsigned int header_length = ieee80211_get_hdrlen_from_skb(entry->skb);
207 u8 rate_idx, rate_flags, retry_rates; 207 u8 rate_idx, rate_flags, retry_rates;
208 unsigned int i; 208 unsigned int i;
209 bool success;
209 210
210 /* 211 /*
211 * Unmap the skb. 212 * Unmap the skb.
@@ -234,13 +235,18 @@ void rt2x00lib_txdone(struct queue_entry *entry,
234 rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry->skb); 235 rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry->skb);
235 236
236 /* 237 /*
237 * Update TX statistics. 238 * Determine if the frame has been successfully transmitted.
238 */ 239 */
239 rt2x00dev->link.qual.tx_success += 240 success =
240 test_bit(TXDONE_SUCCESS, &txdesc->flags) || 241 test_bit(TXDONE_SUCCESS, &txdesc->flags) ||
241 test_bit(TXDONE_UNKNOWN, &txdesc->flags); 242 test_bit(TXDONE_UNKNOWN, &txdesc->flags) ||
242 rt2x00dev->link.qual.tx_failed += 243 test_bit(TXDONE_FALLBACK, &txdesc->flags);
243 test_bit(TXDONE_FAILURE, &txdesc->flags); 244
245 /*
246 * Update TX statistics.
247 */
248 rt2x00dev->link.qual.tx_success += success;
249 rt2x00dev->link.qual.tx_failed += !success;
244 250
245 rate_idx = skbdesc->tx_rate_idx; 251 rate_idx = skbdesc->tx_rate_idx;
246 rate_flags = skbdesc->tx_rate_flags; 252 rate_flags = skbdesc->tx_rate_flags;
@@ -263,22 +269,20 @@ void rt2x00lib_txdone(struct queue_entry *entry,
263 tx_info->status.rates[i].flags = rate_flags; 269 tx_info->status.rates[i].flags = rate_flags;
264 tx_info->status.rates[i].count = 1; 270 tx_info->status.rates[i].count = 1;
265 } 271 }
266 if (i < (IEEE80211_TX_MAX_RATES -1)) 272 if (i < (IEEE80211_TX_MAX_RATES - 1))
267 tx_info->status.rates[i].idx = -1; /* terminate */ 273 tx_info->status.rates[i].idx = -1; /* terminate */
268 274
269 if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { 275 if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) {
270 if (test_bit(TXDONE_SUCCESS, &txdesc->flags) || 276 if (success)
271 test_bit(TXDONE_UNKNOWN, &txdesc->flags))
272 tx_info->flags |= IEEE80211_TX_STAT_ACK; 277 tx_info->flags |= IEEE80211_TX_STAT_ACK;
273 else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) 278 else
274 rt2x00dev->low_level_stats.dot11ACKFailureCount++; 279 rt2x00dev->low_level_stats.dot11ACKFailureCount++;
275 } 280 }
276 281
277 if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) { 282 if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) {
278 if (test_bit(TXDONE_SUCCESS, &txdesc->flags) || 283 if (success)
279 test_bit(TXDONE_UNKNOWN, &txdesc->flags))
280 rt2x00dev->low_level_stats.dot11RTSSuccessCount++; 284 rt2x00dev->low_level_stats.dot11RTSSuccessCount++;
281 else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) 285 else
282 rt2x00dev->low_level_stats.dot11RTSFailureCount++; 286 rt2x00dev->low_level_stats.dot11RTSFailureCount++;
283 } 287 }
284 288