aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c4
-rw-r--r--drivers/net/wireless/p54/p54common.c18
-rw-r--r--include/net/mac80211.h27
-rw-r--r--net/mac80211/rx.c12
4 files changed, 21 insertions, 40 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 530648b39935..fd5a537ac51d 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -522,6 +522,10 @@ static void mac80211_hwsim_sta_notify(struct ieee80211_hw *hw,
522 case STA_NOTIFY_REMOVE: 522 case STA_NOTIFY_REMOVE:
523 hwsim_clear_sta_magic(sta); 523 hwsim_clear_sta_magic(sta);
524 break; 524 break;
525 case STA_NOTIFY_SLEEP:
526 case STA_NOTIFY_AWAKE:
527 /* TODO: make good use of these flags */
528 break;
525 } 529 }
526} 530}
527 531
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 89968a5bff84..409ae930d766 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -1051,19 +1051,6 @@ static int p54_sta_unlock(struct ieee80211_hw *dev, u8 *addr)
1051 return 0; 1051 return 0;
1052} 1052}
1053 1053
1054static void p54_sta_notify_ps(struct ieee80211_hw *dev,
1055 enum sta_notify_ps_cmd notify_cmd,
1056 struct ieee80211_sta *sta)
1057{
1058 switch (notify_cmd) {
1059 case STA_NOTIFY_AWAKE:
1060 p54_sta_unlock(dev, sta->addr);
1061 break;
1062 default:
1063 break;
1064 }
1065}
1066
1067static void p54_sta_notify(struct ieee80211_hw *dev, struct ieee80211_vif *vif, 1054static void p54_sta_notify(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
1068 enum sta_notify_cmd notify_cmd, 1055 enum sta_notify_cmd notify_cmd,
1069 struct ieee80211_sta *sta) 1056 struct ieee80211_sta *sta)
@@ -1078,6 +1065,10 @@ static void p54_sta_notify(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
1078 1065
1079 p54_sta_unlock(dev, sta->addr); 1066 p54_sta_unlock(dev, sta->addr);
1080 break; 1067 break;
1068 case STA_NOTIFY_AWAKE:
1069 /* update the firmware's filter table */
1070 p54_sta_unlock(dev, sta->addr);
1071 break;
1081 default: 1072 default:
1082 break; 1073 break;
1083 } 1074 }
@@ -2027,7 +2018,6 @@ static const struct ieee80211_ops p54_ops = {
2027 .add_interface = p54_add_interface, 2018 .add_interface = p54_add_interface,
2028 .remove_interface = p54_remove_interface, 2019 .remove_interface = p54_remove_interface,
2029 .set_tim = p54_set_tim, 2020 .set_tim = p54_set_tim,
2030 .sta_notify_ps = p54_sta_notify_ps,
2031 .sta_notify = p54_sta_notify, 2021 .sta_notify = p54_sta_notify,
2032 .set_key = p54_set_key, 2022 .set_key = p54_set_key,
2033 .config = p54_config, 2023 .config = p54_config,
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5ecc686c1f1a..046ce692a906 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -773,25 +773,16 @@ struct ieee80211_sta {
773 * enum sta_notify_cmd - sta notify command 773 * enum sta_notify_cmd - sta notify command
774 * 774 *
775 * Used with the sta_notify() callback in &struct ieee80211_ops, this 775 * Used with the sta_notify() callback in &struct ieee80211_ops, this
776 * indicates addition and removal of a station to station table. 776 * indicates addition and removal of a station to station table,
777 * or if a associated station made a power state transition.
777 * 778 *
778 * @STA_NOTIFY_ADD: a station was added to the station table 779 * @STA_NOTIFY_ADD: a station was added to the station table
779 * @STA_NOTIFY_REMOVE: a station being removed from the station table 780 * @STA_NOTIFY_REMOVE: a station being removed from the station table
780 */
781enum sta_notify_cmd {
782 STA_NOTIFY_ADD, STA_NOTIFY_REMOVE
783};
784
785/**
786 * enum sta_notify_ps_cmd - sta power save notify command
787 *
788 * Used with the sta_notify_ps() callback in &struct ieee80211_ops to
789 * notify the driver if a station made a power state transition.
790 *
791 * @STA_NOTIFY_SLEEP: a station is now sleeping 781 * @STA_NOTIFY_SLEEP: a station is now sleeping
792 * @STA_NOTIFY_AWAKE: a sleeping station woke up 782 * @STA_NOTIFY_AWAKE: a sleeping station woke up
793 */ 783 */
794enum sta_notify_ps_cmd { 784enum sta_notify_cmd {
785 STA_NOTIFY_ADD, STA_NOTIFY_REMOVE,
795 STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE, 786 STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE,
796}; 787};
797 788
@@ -1258,11 +1249,9 @@ enum ieee80211_ampdu_mlme_action {
1258 * 1249 *
1259 * @set_rts_threshold: Configuration of RTS threshold (if device needs it) 1250 * @set_rts_threshold: Configuration of RTS threshold (if device needs it)
1260 * 1251 *
1261 * @sta_notify: Notifies low level driver about addition or removal of an 1252 * @sta_notify: Notifies low level driver about addition, removal or power
1262 * associated station, AP, IBSS/WDS/mesh peer etc. Must be atomic. 1253 * state transition of an associated station, AP, IBSS/WDS/mesh peer etc.
1263 * 1254 * Must be atomic.
1264 * @sta_ps_notify: Notifies low level driver about the power state transition
1265 * of a associated station. Must be atomic.
1266 * 1255 *
1267 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1256 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1268 * bursting) for a hardware TX queue. 1257 * bursting) for a hardware TX queue.
@@ -1329,8 +1318,6 @@ struct ieee80211_ops {
1329 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); 1318 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
1330 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1319 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1331 enum sta_notify_cmd, struct ieee80211_sta *sta); 1320 enum sta_notify_cmd, struct ieee80211_sta *sta);
1332 void (*sta_notify_ps)(struct ieee80211_hw *hw,
1333 enum sta_notify_ps_cmd, struct ieee80211_sta *sta);
1334 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1321 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
1335 const struct ieee80211_tx_queue_params *params); 1322 const struct ieee80211_tx_queue_params *params);
1336 int (*get_tx_stats)(struct ieee80211_hw *hw, 1323 int (*get_tx_stats)(struct ieee80211_hw *hw,
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 14be095b8528..23443de7ee4e 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -658,9 +658,9 @@ static void ap_sta_ps_start(struct sta_info *sta)
658 658
659 atomic_inc(&sdata->bss->num_sta_ps); 659 atomic_inc(&sdata->bss->num_sta_ps);
660 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) 661 if (local->ops->sta_notify)
662 local->ops->sta_notify_ps(local_to_hw(local), STA_NOTIFY_SLEEP, 662 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
663 &sta->sta); 663 STA_NOTIFY_SLEEP, &sta->sta);
664#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 664#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
665 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",
666 sdata->dev->name, sta->sta.addr, sta->sta.aid); 666 sdata->dev->name, sta->sta.addr, sta->sta.aid);
@@ -677,9 +677,9 @@ static int ap_sta_ps_end(struct sta_info *sta)
677 atomic_dec(&sdata->bss->num_sta_ps); 677 atomic_dec(&sdata->bss->num_sta_ps);
678 678
679 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) 680 if (local->ops->sta_notify)
681 local->ops->sta_notify_ps(local_to_hw(local), STA_NOTIFY_AWAKE, 681 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
682 &sta->sta); 682 STA_NOTIFY_AWAKE, &sta->sta);
683 683
684 if (!skb_queue_empty(&sta->ps_tx_buf)) 684 if (!skb_queue_empty(&sta->ps_tx_buf))
685 sta_info_clear_tim_bit(sta); 685 sta_info_clear_tim_bit(sta);