aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-10-10 04:13:17 -0400
committerLuciano Coelho <coelho@ti.com>2011-10-11 08:29:57 -0400
commite4120df982c2051f3cfc02f6278798c5166a72f8 (patch)
treee3a9ddc2b7fed63e1b24881d67c7f08e87271586 /drivers/net/wireless/wl12xx
parentf750c82045d8f5d0d6d59e517eb485ffbbe014b2 (diff)
wl12xx: use round-robin policy for tx
Currently, a single vif might starve all the other vifs. Save the last vif we dequeued a packet from, and continue with the following one using a round-robin policy. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r--drivers/net/wireless/wl12xx/main.c2
-rw-r--r--drivers/net/wireless/wl12xx/tx.c26
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h6
3 files changed, 28 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 6e6ac63fb8cd..f29d18daaa82 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2282,6 +2282,8 @@ deinit:
2282 2282
2283 wl12xx_tx_reset_wlvif(wl, wlvif); 2283 wl12xx_tx_reset_wlvif(wl, wlvif);
2284 wl1271_free_ap_keys(wl, wlvif); 2284 wl1271_free_ap_keys(wl, wlvif);
2285 if (wl->last_wlvif == wlvif)
2286 wl->last_wlvif = NULL;
2285 list_del(&wlvif->list); 2287 list_del(&wlvif->list);
2286 memset(wlvif->ap.sta_hlid_map, 0, sizeof(wlvif->ap.sta_hlid_map)); 2288 memset(wlvif->ap.sta_hlid_map, 0, sizeof(wlvif->ap.sta_hlid_map));
2287 wlvif->role_id = WL12XX_INVALID_ROLE_ID; 2289 wlvif->role_id = WL12XX_INVALID_ROLE_ID;
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index 69ac03f5d54b..5aeef95229eb 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -590,14 +590,28 @@ static struct sk_buff *wl12xx_vif_skb_dequeue(struct wl1271 *wl,
590static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl) 590static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
591{ 591{
592 unsigned long flags; 592 unsigned long flags;
593 struct wl12xx_vif *wlvif; 593 struct wl12xx_vif *wlvif = wl->last_wlvif;
594 struct sk_buff *skb = NULL; 594 struct sk_buff *skb = NULL;
595 595
596 /* TODO: rememeber last vif and consider it */ 596 if (wlvif) {
597 wl12xx_for_each_wlvif(wl, wlvif) { 597 wl12xx_for_each_wlvif_continue(wl, wlvif) {
598 skb = wl12xx_vif_skb_dequeue(wl, wlvif); 598 skb = wl12xx_vif_skb_dequeue(wl, wlvif);
599 if (skb) 599 if (skb) {
600 break; 600 wl->last_wlvif = wlvif;
601 break;
602 }
603 }
604 }
605
606 /* do another pass */
607 if (!skb) {
608 wl12xx_for_each_wlvif(wl, wlvif) {
609 skb = wl12xx_vif_skb_dequeue(wl, wlvif);
610 if (skb) {
611 wl->last_wlvif = wlvif;
612 break;
613 }
614 }
601 } 615 }
602 616
603 if (!skb && 617 if (!skb &&
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index d169d52f6d1c..8815fd9a0f47 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -552,6 +552,9 @@ struct wl1271 {
552 552
553 /* AP-mode - number of currently connected stations */ 553 /* AP-mode - number of currently connected stations */
554 int active_sta_count; 554 int active_sta_count;
555
556 /* last wlvif we transmitted from */
557 struct wl12xx_vif *last_wlvif;
555}; 558};
556 559
557struct wl1271_station { 560struct wl1271_station {
@@ -693,6 +696,9 @@ struct ieee80211_vif *wl12xx_wlvif_to_vif(struct wl12xx_vif *wlvif)
693#define wl12xx_for_each_wlvif(wl, wlvif) \ 696#define wl12xx_for_each_wlvif(wl, wlvif) \
694 list_for_each_entry(wlvif, &wl->wlvif_list, list) 697 list_for_each_entry(wlvif, &wl->wlvif_list, list)
695 698
699#define wl12xx_for_each_wlvif_continue(wl, wlvif) \
700 list_for_each_entry_continue(wlvif, &wl->wlvif_list, list)
701
696#define wl12xx_for_each_wlvif_bss_type(wl, wlvif, _bss_type) \ 702#define wl12xx_for_each_wlvif_bss_type(wl, wlvif, _bss_type) \
697 wl12xx_for_each_wlvif(wl, wlvif) \ 703 wl12xx_for_each_wlvif(wl, wlvif) \
698 if (wlvif->bss_type == _bss_type) 704 if (wlvif->bss_type == _bss_type)