diff options
author | Arik Nemtsov <arik@wizery.com> | 2011-08-14 06:17:00 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-08-22 05:35:22 -0400 |
commit | 7bb5d6ce9e6ebb3bb71915cb0224523d3c284b4f (patch) | |
tree | 27ee1bc483626ad1425c32072c57e750cc0cd05b /drivers/net/wireless/wl12xx/tx.c | |
parent | 6f07b72adaeddc9a90306ab4f2237b90967fd3ce (diff) |
wl12xx: Revert "wl12xx: schedule TX packets according to FW occupancy"
This does not make sense in fw >= 6/7.3.0.0.75 (wl127x/wl128x) -
we don't use Tx blocks to measure FW occupancy anymore.
This reverts commit 9e374a37b6fa2310b71d3c5657cd0c1e693120c6.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/tx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/tx.c | 68 |
1 files changed, 23 insertions, 45 deletions
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index 48fde96ce0d4..0696aedaf806 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c | |||
@@ -168,7 +168,7 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra, | |||
168 | u32 total_len = skb->len + sizeof(struct wl1271_tx_hw_descr) + extra; | 168 | u32 total_len = skb->len + sizeof(struct wl1271_tx_hw_descr) + extra; |
169 | u32 len; | 169 | u32 len; |
170 | u32 total_blocks; | 170 | u32 total_blocks; |
171 | int id, ret = -EBUSY, ac; | 171 | int id, ret = -EBUSY; |
172 | u32 spare_blocks; | 172 | u32 spare_blocks; |
173 | 173 | ||
174 | if (unlikely(wl->quirks & WL12XX_QUIRK_USE_2_SPARE_BLOCKS)) | 174 | if (unlikely(wl->quirks & WL12XX_QUIRK_USE_2_SPARE_BLOCKS)) |
@@ -206,9 +206,7 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra, | |||
206 | desc->id = id; | 206 | desc->id = id; |
207 | 207 | ||
208 | wl->tx_blocks_available -= total_blocks; | 208 | wl->tx_blocks_available -= total_blocks; |
209 | 209 | wl->tx_allocated_blocks += total_blocks; | |
210 | ac = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); | ||
211 | wl->tx_allocated_blocks[ac] += total_blocks; | ||
212 | 210 | ||
213 | if (wl->bss_type == BSS_TYPE_AP_BSS) | 211 | if (wl->bss_type == BSS_TYPE_AP_BSS) |
214 | wl->links[hlid].allocated_blks += total_blocks; | 212 | wl->links[hlid].allocated_blks += total_blocks; |
@@ -459,41 +457,21 @@ void wl1271_handle_tx_low_watermark(struct wl1271 *wl) | |||
459 | } | 457 | } |
460 | } | 458 | } |
461 | 459 | ||
462 | static struct sk_buff_head *wl1271_select_queue(struct wl1271 *wl, | ||
463 | struct sk_buff_head *queues) | ||
464 | { | ||
465 | int i, q = -1; | ||
466 | u32 min_blks = 0xffffffff; | ||
467 | |||
468 | /* | ||
469 | * Find a non-empty ac where: | ||
470 | * 1. There are packets to transmit | ||
471 | * 2. The FW has the least allocated blocks | ||
472 | */ | ||
473 | for (i = 0; i < NUM_TX_QUEUES; i++) | ||
474 | if (!skb_queue_empty(&queues[i]) && | ||
475 | (wl->tx_allocated_blocks[i] < min_blks)) { | ||
476 | q = i; | ||
477 | min_blks = wl->tx_allocated_blocks[q]; | ||
478 | } | ||
479 | |||
480 | if (q == -1) | ||
481 | return NULL; | ||
482 | |||
483 | return &queues[q]; | ||
484 | } | ||
485 | |||
486 | static struct sk_buff *wl1271_sta_skb_dequeue(struct wl1271 *wl) | 460 | static struct sk_buff *wl1271_sta_skb_dequeue(struct wl1271 *wl) |
487 | { | 461 | { |
488 | struct sk_buff *skb = NULL; | 462 | struct sk_buff *skb = NULL; |
489 | unsigned long flags; | 463 | unsigned long flags; |
490 | struct sk_buff_head *queue; | ||
491 | 464 | ||
492 | queue = wl1271_select_queue(wl, wl->tx_queue); | 465 | skb = skb_dequeue(&wl->tx_queue[CONF_TX_AC_VO]); |
493 | if (!queue) | 466 | if (skb) |
494 | goto out; | 467 | goto out; |
495 | 468 | skb = skb_dequeue(&wl->tx_queue[CONF_TX_AC_VI]); | |
496 | skb = skb_dequeue(queue); | 469 | if (skb) |
470 | goto out; | ||
471 | skb = skb_dequeue(&wl->tx_queue[CONF_TX_AC_BE]); | ||
472 | if (skb) | ||
473 | goto out; | ||
474 | skb = skb_dequeue(&wl->tx_queue[CONF_TX_AC_BK]); | ||
497 | 475 | ||
498 | out: | 476 | out: |
499 | if (skb) { | 477 | if (skb) { |
@@ -511,7 +489,6 @@ static struct sk_buff *wl1271_ap_skb_dequeue(struct wl1271 *wl) | |||
511 | struct sk_buff *skb = NULL; | 489 | struct sk_buff *skb = NULL; |
512 | unsigned long flags; | 490 | unsigned long flags; |
513 | int i, h, start_hlid; | 491 | int i, h, start_hlid; |
514 | struct sk_buff_head *queue; | ||
515 | 492 | ||
516 | /* start from the link after the last one */ | 493 | /* start from the link after the last one */ |
517 | start_hlid = (wl->last_tx_hlid + 1) % AP_MAX_LINKS; | 494 | start_hlid = (wl->last_tx_hlid + 1) % AP_MAX_LINKS; |
@@ -520,20 +497,21 @@ static struct sk_buff *wl1271_ap_skb_dequeue(struct wl1271 *wl) | |||
520 | for (i = 0; i < AP_MAX_LINKS; i++) { | 497 | for (i = 0; i < AP_MAX_LINKS; i++) { |
521 | h = (start_hlid + i) % AP_MAX_LINKS; | 498 | h = (start_hlid + i) % AP_MAX_LINKS; |
522 | 499 | ||
523 | /* only consider connected stations */ | 500 | skb = skb_dequeue(&wl->links[h].tx_queue[CONF_TX_AC_VO]); |
524 | if (h >= WL1271_AP_STA_HLID_START && | ||
525 | !test_bit(h - WL1271_AP_STA_HLID_START, wl->ap_hlid_map)) | ||
526 | continue; | ||
527 | |||
528 | queue = wl1271_select_queue(wl, wl->links[h].tx_queue); | ||
529 | if (!queue) | ||
530 | continue; | ||
531 | |||
532 | skb = skb_dequeue(queue); | ||
533 | if (skb) | 501 | if (skb) |
534 | break; | 502 | goto out; |
503 | skb = skb_dequeue(&wl->links[h].tx_queue[CONF_TX_AC_VI]); | ||
504 | if (skb) | ||
505 | goto out; | ||
506 | skb = skb_dequeue(&wl->links[h].tx_queue[CONF_TX_AC_BE]); | ||
507 | if (skb) | ||
508 | goto out; | ||
509 | skb = skb_dequeue(&wl->links[h].tx_queue[CONF_TX_AC_BK]); | ||
510 | if (skb) | ||
511 | goto out; | ||
535 | } | 512 | } |
536 | 513 | ||
514 | out: | ||
537 | if (skb) { | 515 | if (skb) { |
538 | int q = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); | 516 | int q = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); |
539 | wl->last_tx_hlid = h; | 517 | wl->last_tx_hlid = h; |