diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-03-26 06:53:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-31 14:39:11 -0400 |
commit | 31627dc59b4a87c4198b4245a7de1b8ccf4424fa (patch) | |
tree | a7ded2c4c2b539cf672fa1d75b5feda07a36a597 /drivers/net/wireless/wl12xx/wl1271_tx.c | |
parent | f876bb9aafc71d8ea395eec99666faaffec5df49 (diff) |
wl1271: Add TX rate reporting
Add reporting of the used TX rate to mac80211 in the tx_status.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_tx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_tx.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c index 6d109df9a0a0..5712489f5ddb 100644 --- a/drivers/net/wireless/wl12xx/wl1271_tx.c +++ b/drivers/net/wireless/wl12xx/wl1271_tx.c | |||
@@ -304,6 +304,8 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
304 | struct ieee80211_tx_info *info; | 304 | struct ieee80211_tx_info *info; |
305 | struct sk_buff *skb; | 305 | struct sk_buff *skb; |
306 | int id = result->id; | 306 | int id = result->id; |
307 | int rate = -1; | ||
308 | u8 retries = 0; | ||
307 | 309 | ||
308 | /* check for id legality */ | 310 | /* check for id legality */ |
309 | if (unlikely(id >= ACX_TX_DESCRIPTORS || wl->tx_frames[id] == NULL)) { | 311 | if (unlikely(id >= ACX_TX_DESCRIPTORS || wl->tx_frames[id] == NULL)) { |
@@ -314,19 +316,22 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
314 | skb = wl->tx_frames[id]; | 316 | skb = wl->tx_frames[id]; |
315 | info = IEEE80211_SKB_CB(skb); | 317 | info = IEEE80211_SKB_CB(skb); |
316 | 318 | ||
317 | /* update packet status */ | 319 | /* update the TX status info */ |
318 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { | 320 | if (result->status == TX_SUCCESS) { |
319 | if (result->status == TX_SUCCESS) | 321 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
320 | info->flags |= IEEE80211_TX_STAT_ACK; | 322 | info->flags |= IEEE80211_TX_STAT_ACK; |
321 | if (result->status & TX_RETRY_EXCEEDED) { | 323 | rate = wl1271_rate_to_idx(wl, result->rate_class_index); |
322 | /* FIXME */ | 324 | retries = result->ack_failures; |
323 | /* info->status.excessive_retries = 1; */ | 325 | } else if (result->status == TX_RETRY_EXCEEDED) { |
324 | wl->stats.excessive_retries++; | 326 | wl->stats.excessive_retries++; |
325 | } | 327 | retries = result->ack_failures; |
326 | } | 328 | } |
327 | 329 | ||
328 | /* FIXME */ | 330 | info->status.rates[0].idx = rate; |
329 | /* info->status.retry_count = result->ack_failures; */ | 331 | info->status.rates[0].count = retries; |
332 | info->status.rates[0].flags = 0; | ||
333 | info->status.ack_signal = -1; | ||
334 | |||
330 | wl->stats.retry_count += result->ack_failures; | 335 | wl->stats.retry_count += result->ack_failures; |
331 | 336 | ||
332 | /* update security sequence number */ | 337 | /* update security sequence number */ |
@@ -350,8 +355,6 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
350 | result->id, skb, result->ack_failures, | 355 | result->id, skb, result->ack_failures, |
351 | result->rate_class_index, result->status); | 356 | result->rate_class_index, result->status); |
352 | 357 | ||
353 | /* FIXME: do we need to tell the stack about the used rate? */ | ||
354 | |||
355 | /* return the packet to the stack */ | 358 | /* return the packet to the stack */ |
356 | ieee80211_tx_status(wl->hw, skb); | 359 | ieee80211_tx_status(wl->hw, skb); |
357 | wl->tx_frames[result->id] = NULL; | 360 | wl->tx_frames[result->id] = NULL; |