diff options
author | Vivek Natarajan <vnatarajan@atheros.com> | 2010-02-08 07:17:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-15 12:05:54 -0400 |
commit | b65592168721ff3800a83e081b5fbb58e8f4e9be (patch) | |
tree | eb51b8152d1e5ffe01126582d73d9ebed9b9a79f | |
parent | a19aec3d01d42adfd11ea9fe8363d11fff5cd0b4 (diff) |
mac80211: Reset dynamic ps timer in Rx path.
commit e15276a4b220c54db665cf46a92bd9ceb9aeb052 upstream.
The current mac80211 implementation enables power save if there
is no Tx traffic for a specific timeout. Hence, PS is triggered
even if there is a continuous Rx only traffic(like UDP) going on.
This makes the drivers to wait on the tim bit in the next beacon
to awake which leads to redundant sleep-wake cycles.
Fix this by restarting the dynamic ps timer on receiving every
data packet.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | net/mac80211/rx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 82a30c1bf3ab..da92cdef8287 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1788,6 +1788,7 @@ static ieee80211_rx_result debug_noinline | |||
1788 | ieee80211_rx_h_data(struct ieee80211_rx_data *rx) | 1788 | ieee80211_rx_h_data(struct ieee80211_rx_data *rx) |
1789 | { | 1789 | { |
1790 | struct ieee80211_sub_if_data *sdata = rx->sdata; | 1790 | struct ieee80211_sub_if_data *sdata = rx->sdata; |
1791 | struct ieee80211_local *local = rx->local; | ||
1791 | struct net_device *dev = sdata->dev; | 1792 | struct net_device *dev = sdata->dev; |
1792 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; | 1793 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; |
1793 | __le16 fc = hdr->frame_control; | 1794 | __le16 fc = hdr->frame_control; |
@@ -1819,6 +1820,13 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx) | |||
1819 | dev->stats.rx_packets++; | 1820 | dev->stats.rx_packets++; |
1820 | dev->stats.rx_bytes += rx->skb->len; | 1821 | dev->stats.rx_bytes += rx->skb->len; |
1821 | 1822 | ||
1823 | if (ieee80211_is_data(hdr->frame_control) && | ||
1824 | !is_multicast_ether_addr(hdr->addr1) && | ||
1825 | local->hw.conf.dynamic_ps_timeout > 0 && local->ps_sdata) { | ||
1826 | mod_timer(&local->dynamic_ps_timer, jiffies + | ||
1827 | msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); | ||
1828 | } | ||
1829 | |||
1822 | ieee80211_deliver_skb(rx); | 1830 | ieee80211_deliver_skb(rx); |
1823 | 1831 | ||
1824 | return RX_QUEUED; | 1832 | return RX_QUEUED; |