Skip to contentSkip to conversation

mac80211: Enhancements to dynamic power save.

PATCH In review Vivek Natarajan 1 participant 2 messages Dec 23, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Enhancements to dynamic power save.

This patch enables mac80211 to send a null frame and also to check for tim in the beacon if dynamic power save is enabled.

---
 net/mac80211/ieee80211_i.h |    3 +++
 net/mac80211/mlme.c        |   41 ++++++++++++++++++++++++++++++++++++++++-
 net/mac80211/scan.c        |    2 +-
 net/mac80211/wext.c        |   13 +++++++++----
 4 files changed, 53 insertions(+), 6 deletions(-)
net/mac80211/ieee80211_i.h +3 -0
index f3eec98..2038498 100644
@@ -986,6 +986,9 @@ u64 ieee80211_mandatory_rates(struct ieee80211_local *local,
 void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
 void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
 void ieee80211_dynamic_ps_timer(unsigned long data);
+void ieee80211_send_nullfunc(struct ieee80211_local *local,
+			     struct ieee80211_sub_if_data *sdata,
+			     int powersave);
 
 void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
 				     enum queue_stop_reason reason);
net/mac80211/mlme.c +40 -1

75 lines not on this page · raw message

net/mac80211/scan.c +1 -1
index f5c7c33..a2caeed 100644
@@ -395,7 +395,7 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
 	return RX_QUEUED;
 }
 
-static void ieee80211_send_nullfunc(struct ieee80211_local *local,
+void ieee80211_send_nullfunc(struct ieee80211_local *local,
 				    struct ieee80211_sub_if_data *sdata,
 				    int powersave)
 {
net/mac80211/wext.c +9 -4
index 673c5d7..6470614 100644
@@ -871,12 +871,17 @@ set:
 			mod_timer(&local->dynamic_ps_timer, jiffies +
 				  msecs_to_jiffies(local->dynamic_ps_timeout));
 		else {
-			if (local->powersave)
+			if (local->powersave) {
+				ieee80211_send_nullfunc(local, sdata, 1);
 				conf->flags |= IEEE80211_CONF_PS;
-			else
+				ret = ieee80211_hw_config(local,
+						IEEE80211_CONF_CHANGE_PS);
+			} else {
 				conf->flags &= ~IEEE80211_CONF_PS;
-			ret = ieee80211_hw_config(local,
-					IEEE80211_CONF_CHANGE_PS);
+				ret = ieee80211_hw_config(local,
+						IEEE80211_CONF_CHANGE_PS);
+				ieee80211_send_nullfunc(local, sdata, 0);
+			}
 		}
 	}
 
Signature · 1 line
1.6.0.1
#1 lore raw

This patch is to be applied on top of my previous patch,' A couple of fixes to dynamic power save'.

Thanks,
Vivek.