aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/mac80211.h18
-rw-r--r--net/mac80211/rx.c7
2 files changed, 25 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 6e823cc6a4b1..0a0c59365db6 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -782,6 +782,19 @@ enum sta_notify_cmd {
782}; 782};
783 783
784/** 784/**
785 * enum sta_notify_ps_cmd - sta power save notify command
786 *
787 * Used with the sta_notify_ps() callback in &struct ieee80211_ops to
788 * notify the driver if a station made a power state transition.
789 *
790 * @STA_NOTIFY_SLEEP: a station is now sleeping
791 * @STA_NOTIFY_AWAKE: a sleeping station woke up
792 */
793enum sta_notify_ps_cmd {
794 STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE,
795};
796
797/**
785 * enum ieee80211_tkip_key_type - get tkip key 798 * enum ieee80211_tkip_key_type - get tkip key
786 * 799 *
787 * Used by drivers which need to get a tkip key for skb. Some drivers need a 800 * Used by drivers which need to get a tkip key for skb. Some drivers need a
@@ -1251,6 +1264,9 @@ enum ieee80211_ampdu_mlme_action {
1251 * @sta_notify: Notifies low level driver about addition or removal 1264 * @sta_notify: Notifies low level driver about addition or removal
1252 * of associated station or AP. 1265 * of associated station or AP.
1253 * 1266 *
1267 * @sta_ps_notify: Notifies low level driver about the power state transition
1268 * of a associated station. Must be atomic.
1269 *
1254 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1270 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1255 * bursting) for a hardware TX queue. 1271 * bursting) for a hardware TX queue.
1256 * 1272 *
@@ -1317,6 +1333,8 @@ struct ieee80211_ops {
1317 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); 1333 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
1318 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1334 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1319 enum sta_notify_cmd, struct ieee80211_sta *sta); 1335 enum sta_notify_cmd, struct ieee80211_sta *sta);
1336 void (*sta_notify_ps)(struct ieee80211_hw *hw,
1337 enum sta_notify_ps_cmd, struct ieee80211_sta *sta);
1320 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1338 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
1321 const struct ieee80211_tx_queue_params *params); 1339 const struct ieee80211_tx_queue_params *params);
1322 int (*get_tx_stats)(struct ieee80211_hw *hw, 1340 int (*get_tx_stats)(struct ieee80211_hw *hw,
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 68a6e973c72c..14be095b8528 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -654,9 +654,13 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
654static void ap_sta_ps_start(struct sta_info *sta) 654static void ap_sta_ps_start(struct sta_info *sta)
655{ 655{
656 struct ieee80211_sub_if_data *sdata = sta->sdata; 656 struct ieee80211_sub_if_data *sdata = sta->sdata;
657 struct ieee80211_local *local = sdata->local;
657 658
658 atomic_inc(&sdata->bss->num_sta_ps); 659 atomic_inc(&sdata->bss->num_sta_ps);
659 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL); 660 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL);
661 if (local->ops->sta_notify_ps)
662 local->ops->sta_notify_ps(local_to_hw(local), STA_NOTIFY_SLEEP,
663 &sta->sta);
660#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 664#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
661 printk(KERN_DEBUG "%s: STA %pM aid %d enters power save mode\n", 665 printk(KERN_DEBUG "%s: STA %pM aid %d enters power save mode\n",
662 sdata->dev->name, sta->sta.addr, sta->sta.aid); 666 sdata->dev->name, sta->sta.addr, sta->sta.aid);
@@ -673,6 +677,9 @@ static int ap_sta_ps_end(struct sta_info *sta)
673 atomic_dec(&sdata->bss->num_sta_ps); 677 atomic_dec(&sdata->bss->num_sta_ps);
674 678
675 clear_sta_flags(sta, WLAN_STA_PS | WLAN_STA_PSPOLL); 679 clear_sta_flags(sta, WLAN_STA_PS | WLAN_STA_PSPOLL);
680 if (local->ops->sta_notify_ps)
681 local->ops->sta_notify_ps(local_to_hw(local), STA_NOTIFY_AWAKE,
682 &sta->sta);
676 683
677 if (!skb_queue_empty(&sta->ps_tx_buf)) 684 if (!skb_queue_empty(&sta->ps_tx_buf))
678 sta_info_clear_tim_bit(sta); 685 sta_info_clear_tim_bit(sta);