aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_tx.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_tx.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c
index 6d109df9a0a0..62db79508ddf 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.c
@@ -220,7 +220,7 @@ static int wl1271_tx_frame(struct wl1271 *wl, struct sk_buff *skb)
220 return ret; 220 return ret;
221} 221}
222 222
223static u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set) 223u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set)
224{ 224{
225 struct ieee80211_supported_band *band; 225 struct ieee80211_supported_band *band;
226 u32 enabled_rates = 0; 226 u32 enabled_rates = 0;
@@ -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;
@@ -413,31 +416,19 @@ void wl1271_tx_flush(struct wl1271 *wl)
413{ 416{
414 int i; 417 int i;
415 struct sk_buff *skb; 418 struct sk_buff *skb;
416 struct ieee80211_tx_info *info;
417 419
418 /* TX failure */ 420 /* TX failure */
419/* control->flags = 0; FIXME */ 421/* control->flags = 0; FIXME */
420 422
421 while ((skb = skb_dequeue(&wl->tx_queue))) { 423 while ((skb = skb_dequeue(&wl->tx_queue))) {
422 info = IEEE80211_SKB_CB(skb);
423
424 wl1271_debug(DEBUG_TX, "flushing skb 0x%p", skb); 424 wl1271_debug(DEBUG_TX, "flushing skb 0x%p", skb);
425
426 if (!(info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS))
427 continue;
428
429 ieee80211_tx_status(wl->hw, skb); 425 ieee80211_tx_status(wl->hw, skb);
430 } 426 }
431 427
432 for (i = 0; i < ACX_TX_DESCRIPTORS; i++) 428 for (i = 0; i < ACX_TX_DESCRIPTORS; i++)
433 if (wl->tx_frames[i] != NULL) { 429 if (wl->tx_frames[i] != NULL) {
434 skb = wl->tx_frames[i]; 430 skb = wl->tx_frames[i];
435 info = IEEE80211_SKB_CB(skb);
436
437 if (!(info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS))
438 continue;
439
440 ieee80211_tx_status(wl->hw, skb);
441 wl->tx_frames[i] = NULL; 431 wl->tx_frames[i] = NULL;
432 ieee80211_tx_status(wl->hw, skb);
442 } 433 }
443} 434}