]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/tx.c
mac80211: implement dynamic power save
[linux-2.6-omap-h63xx.git] / net / mac80211 / tx.c
index b098c58d216f29cb047f986aac4cc740c014212a..a4af3a124cce7d895426b9e49e36ef53a5c54601 100644 (file)
@@ -1473,6 +1473,19 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
                goto fail;
        }
 
+       if (!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS) &&
+           local->dynamic_ps_timeout > 0) {
+               if (local->hw.conf.flags & IEEE80211_CONF_PS) {
+                       ieee80211_stop_queues_by_reason(&local->hw,
+                                                       IEEE80211_QUEUE_STOP_REASON_PS);
+                       queue_work(local->hw.workqueue,
+                                  &local->dynamic_ps_disable_work);
+               }
+
+               mod_timer(&local->dynamic_ps_timer, jiffies +
+                         msecs_to_jiffies(local->dynamic_ps_timeout));
+       }
+
        nh_pos = skb_network_header(skb) - skb->data;
        h_pos = skb_transport_header(skb) - skb->data;