diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-02-15 16:47:48 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-18 14:17:48 -0500 |
commit | 9cc40712a082b7288d00c57e8652e3b248e2554d (patch) | |
tree | ca0fe4afd17b8a596f535fd9ed4bd1dff6ab6fa4 /drivers | |
parent | d2931bbd5471c35f55856e5a4f001160df9951dc (diff) |
iwlwifi: mvm: fix GO powersave client manipulation
All station commands must include a valid MAC ID,
the ID 0 is randomly valid in some cases, but we
must set the ID properly. Do that by passing the
right station and using its mac_id_n_color.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/sta.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/sta.h | 6 |
3 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 76794940e1f0..e8264e11b12d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -857,7 +857,6 @@ iwl_mvm_mac_allow_buffered_frames(struct ieee80211_hw *hw, | |||
857 | bool more_data) | 857 | bool more_data) |
858 | { | 858 | { |
859 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | 859 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); |
860 | struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv; | ||
861 | 860 | ||
862 | /* TODO: how do we tell the fw to send frames for a specific TID */ | 861 | /* TODO: how do we tell the fw to send frames for a specific TID */ |
863 | 862 | ||
@@ -865,8 +864,7 @@ iwl_mvm_mac_allow_buffered_frames(struct ieee80211_hw *hw, | |||
865 | * The fw will send EOSP notification when the last frame will be | 864 | * The fw will send EOSP notification when the last frame will be |
866 | * transmitted. | 865 | * transmitted. |
867 | */ | 866 | */ |
868 | iwl_mvm_sta_modify_sleep_tx_count(mvm, mvmsta->sta_id, reason, | 867 | iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames); |
869 | num_frames); | ||
870 | } | 868 | } |
871 | 869 | ||
872 | static void iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw, | 870 | static void iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw, |
@@ -890,7 +888,7 @@ static void iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw, | |||
890 | case STA_NOTIFY_AWAKE: | 888 | case STA_NOTIFY_AWAKE: |
891 | if (WARN_ON(mvmsta->sta_id == IWL_INVALID_STATION)) | 889 | if (WARN_ON(mvmsta->sta_id == IWL_INVALID_STATION)) |
892 | break; | 890 | break; |
893 | iwl_mvm_sta_modify_ps_wake(mvm, mvmsta->sta_id); | 891 | iwl_mvm_sta_modify_ps_wake(mvm, sta); |
894 | break; | 892 | break; |
895 | default: | 893 | default: |
896 | break; | 894 | break; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c index a1eb692d7fad..861a7f9f8e7f 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/iwlwifi/mvm/sta.c | |||
@@ -1188,13 +1188,16 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm, | |||
1188 | rcu_read_unlock(); | 1188 | rcu_read_unlock(); |
1189 | } | 1189 | } |
1190 | 1190 | ||
1191 | void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, int sta_id) | 1191 | void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, |
1192 | struct ieee80211_sta *sta) | ||
1192 | { | 1193 | { |
1194 | struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv; | ||
1193 | struct iwl_mvm_add_sta_cmd cmd = { | 1195 | struct iwl_mvm_add_sta_cmd cmd = { |
1194 | .add_modify = STA_MODE_MODIFY, | 1196 | .add_modify = STA_MODE_MODIFY, |
1195 | .sta_id = sta_id, | 1197 | .sta_id = mvmsta->sta_id, |
1196 | .modify_mask = STA_MODIFY_SLEEPING_STA_TX_COUNT, | 1198 | .modify_mask = STA_MODIFY_SLEEPING_STA_TX_COUNT, |
1197 | .sleep_state_flags = cpu_to_le16(STA_SLEEP_STATE_AWAKE), | 1199 | .sleep_state_flags = cpu_to_le16(STA_SLEEP_STATE_AWAKE), |
1200 | .mac_id_n_color = cpu_to_le32(mvmsta->mac_id_n_color), | ||
1198 | }; | 1201 | }; |
1199 | int ret; | 1202 | int ret; |
1200 | 1203 | ||
@@ -1208,18 +1211,21 @@ void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, int sta_id) | |||
1208 | IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); | 1211 | IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); |
1209 | } | 1212 | } |
1210 | 1213 | ||
1211 | void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, int sta_id, | 1214 | void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, |
1215 | struct ieee80211_sta *sta, | ||
1212 | enum ieee80211_frame_release_type reason, | 1216 | enum ieee80211_frame_release_type reason, |
1213 | u16 cnt) | 1217 | u16 cnt) |
1214 | { | 1218 | { |
1215 | u16 sleep_state_flags = | 1219 | u16 sleep_state_flags = |
1216 | (reason == IEEE80211_FRAME_RELEASE_UAPSD) ? | 1220 | (reason == IEEE80211_FRAME_RELEASE_UAPSD) ? |
1217 | STA_SLEEP_STATE_UAPSD : STA_SLEEP_STATE_PS_POLL; | 1221 | STA_SLEEP_STATE_UAPSD : STA_SLEEP_STATE_PS_POLL; |
1222 | struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv; | ||
1218 | struct iwl_mvm_add_sta_cmd cmd = { | 1223 | struct iwl_mvm_add_sta_cmd cmd = { |
1219 | .add_modify = STA_MODE_MODIFY, | 1224 | .add_modify = STA_MODE_MODIFY, |
1220 | .sta_id = sta_id, | 1225 | .sta_id = mvmsta->sta_id, |
1221 | .modify_mask = STA_MODIFY_SLEEPING_STA_TX_COUNT, | 1226 | .modify_mask = STA_MODIFY_SLEEPING_STA_TX_COUNT, |
1222 | .sleep_tx_count = cpu_to_le16(cnt), | 1227 | .sleep_tx_count = cpu_to_le16(cnt), |
1228 | .mac_id_n_color = cpu_to_le32(mvmsta->mac_id_n_color), | ||
1223 | /* | 1229 | /* |
1224 | * Same modify mask for sleep_tx_count and sleep_state_flags so | 1230 | * Same modify mask for sleep_tx_count and sleep_state_flags so |
1225 | * we must set the sleep_state_flags too. | 1231 | * we must set the sleep_state_flags too. |
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.h b/drivers/net/wireless/iwlwifi/mvm/sta.h index bdd7c5ed8222..896f88ac8145 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.h +++ b/drivers/net/wireless/iwlwifi/mvm/sta.h | |||
@@ -362,8 +362,10 @@ int iwl_mvm_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
362 | struct iwl_mvm_int_sta *bsta); | 362 | struct iwl_mvm_int_sta *bsta); |
363 | int iwl_mvm_rm_bcast_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *bsta); | 363 | int iwl_mvm_rm_bcast_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *bsta); |
364 | void iwl_mvm_sta_drained_wk(struct work_struct *wk); | 364 | void iwl_mvm_sta_drained_wk(struct work_struct *wk); |
365 | void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, int sta_id); | 365 | void iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm, |
366 | void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, int sta_id, | 366 | struct ieee80211_sta *sta); |
367 | void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, | ||
368 | struct ieee80211_sta *sta, | ||
367 | enum ieee80211_frame_release_type reason, | 369 | enum ieee80211_frame_release_type reason, |
368 | u16 cnt); | 370 | u16 cnt); |
369 | int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, | 371 | int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, |