diff options
author | Eliad Peller <eliad@wizery.com> | 2011-05-15 04:10:29 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-06-27 03:15:49 -0400 |
commit | 77ddaa108f727b5ef3be004b952d2c3d3ffc48e5 (patch) | |
tree | f8eea67a0930d2eb4879024abf2ce1df8ee66ccd /drivers/net/wireless/wl12xx/tx.c | |
parent | f84673d59773ded6efab640c5ee5f44b34116b75 (diff) |
wl12xx: add automatic rx streaming triggers
When rx_streaming.interval is non-zero, use automatic rx streaming.
Enable rx streaming on the each rx/tx packet, and disable it
rx_streaming.duration msecs later.
When rx_streaming.always=0 (default), rx streaming is enabled only
when there is a coex operation.
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 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index ca3ab1c1acef..6603e60da04d 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c | |||
@@ -562,17 +562,29 @@ static void wl1271_skb_queue_head(struct wl1271 *wl, struct sk_buff *skb) | |||
562 | spin_unlock_irqrestore(&wl->wl_lock, flags); | 562 | spin_unlock_irqrestore(&wl->wl_lock, flags); |
563 | } | 563 | } |
564 | 564 | ||
565 | static bool wl1271_tx_is_data_present(struct sk_buff *skb) | ||
566 | { | ||
567 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); | ||
568 | |||
569 | return ieee80211_is_data_present(hdr->frame_control); | ||
570 | } | ||
571 | |||
565 | void wl1271_tx_work_locked(struct wl1271 *wl) | 572 | void wl1271_tx_work_locked(struct wl1271 *wl) |
566 | { | 573 | { |
567 | struct sk_buff *skb; | 574 | struct sk_buff *skb; |
568 | u32 buf_offset = 0; | 575 | u32 buf_offset = 0; |
569 | bool sent_packets = false; | 576 | bool sent_packets = false; |
577 | bool had_data = false; | ||
578 | bool is_ap = (wl->bss_type == BSS_TYPE_AP_BSS); | ||
570 | int ret; | 579 | int ret; |
571 | 580 | ||
572 | if (unlikely(wl->state == WL1271_STATE_OFF)) | 581 | if (unlikely(wl->state == WL1271_STATE_OFF)) |
573 | return; | 582 | return; |
574 | 583 | ||
575 | while ((skb = wl1271_skb_dequeue(wl))) { | 584 | while ((skb = wl1271_skb_dequeue(wl))) { |
585 | if (wl1271_tx_is_data_present(skb)) | ||
586 | had_data = true; | ||
587 | |||
576 | ret = wl1271_prepare_tx_frame(wl, skb, buf_offset); | 588 | ret = wl1271_prepare_tx_frame(wl, skb, buf_offset); |
577 | if (ret == -EAGAIN) { | 589 | if (ret == -EAGAIN) { |
578 | /* | 590 | /* |
@@ -619,6 +631,19 @@ out_ack: | |||
619 | 631 | ||
620 | wl1271_handle_tx_low_watermark(wl); | 632 | wl1271_handle_tx_low_watermark(wl); |
621 | } | 633 | } |
634 | if (!is_ap && wl->conf.rx_streaming.interval && had_data && | ||
635 | (wl->conf.rx_streaming.always || | ||
636 | test_bit(WL1271_FLAG_SOFT_GEMINI, &wl->flags))) { | ||
637 | u32 timeout = wl->conf.rx_streaming.duration; | ||
638 | |||
639 | /* enable rx streaming */ | ||
640 | if (!test_bit(WL1271_FLAG_RX_STREAMING_STARTED, &wl->flags)) | ||
641 | ieee80211_queue_work(wl->hw, | ||
642 | &wl->rx_streaming_enable_work); | ||
643 | |||
644 | mod_timer(&wl->rx_streaming_timer, | ||
645 | jiffies + msecs_to_jiffies(timeout)); | ||
646 | } | ||
622 | } | 647 | } |
623 | 648 | ||
624 | void wl1271_tx_work(struct work_struct *work) | 649 | void wl1271_tx_work(struct work_struct *work) |