diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 28 |
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 | ||