aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-12 07:10:44 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-12 10:52:26 -0500
commit7a4539736eaeecb6bec25a718492fed6377a23af (patch)
treee1beaf9b544735af39752afb8aa7b478fe0d96a1
parentffdf968d878f85620c1d4685b9543f894ef56db0 (diff)
iwlwifi: mvm: update station when marked associated
In managed mode, the HT/VHT capabilities aren't set when the station is initially added, so update the station when it is marked associated. In AP/GO mode, the station will typically be added with full capabilities today, but an upcoming change in hostapd may mean a similar scenario as for managed mode, therefore do the update unconditionally. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/d3.c2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c6
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/sta.c21
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/sta.h6
4 files changed, 26 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index a00267f6bc05..c64d864799cd 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -490,7 +490,7 @@ static int iwl_mvm_d3_reprogram(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
490 return -EIO; 490 return -EIO;
491 } 491 }
492 492
493 ret = iwl_mvm_sta_add_to_fw(mvm, ap_sta); 493 ret = iwl_mvm_sta_send_to_fw(mvm, ap_sta, false);
494 if (ret) 494 if (ret)
495 return ret; 495 return ret;
496 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], ap_sta); 496 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], ap_sta);
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 6bfcb3b5bfa6..5bdcbcfee0c5 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -926,8 +926,10 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
926 ret = 0; 926 ret = 0;
927 } else if (old_state == IEEE80211_STA_AUTH && 927 } else if (old_state == IEEE80211_STA_AUTH &&
928 new_state == IEEE80211_STA_ASSOC) { 928 new_state == IEEE80211_STA_ASSOC) {
929 iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band); 929 ret = iwl_mvm_update_sta(mvm, vif, sta);
930 ret = 0; 930 if (ret == 0)
931 iwl_mvm_rs_rate_init(mvm, sta,
932 mvmvif->phy_ctxt->channel->band);
931 } else if (old_state == IEEE80211_STA_ASSOC && 933 } else if (old_state == IEEE80211_STA_ASSOC &&
932 new_state == IEEE80211_STA_AUTHORIZED) { 934 new_state == IEEE80211_STA_AUTHORIZED) {
933 ret = 0; 935 ret = 0;
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c
index 6b22bacdc1df..a1eb692d7fad 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
@@ -81,8 +81,9 @@ static int iwl_mvm_find_free_sta_id(struct iwl_mvm *mvm)
81 return IWL_MVM_STATION_COUNT; 81 return IWL_MVM_STATION_COUNT;
82} 82}
83 83
84/* add a NEW station to fw */ 84/* send station add/update command to firmware */
85int iwl_mvm_sta_add_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta) 85int iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
86 bool update)
86{ 87{
87 struct iwl_mvm_sta *mvm_sta = (void *)sta->drv_priv; 88 struct iwl_mvm_sta *mvm_sta = (void *)sta->drv_priv;
88 struct iwl_mvm_add_sta_cmd add_sta_cmd; 89 struct iwl_mvm_add_sta_cmd add_sta_cmd;
@@ -94,8 +95,11 @@ int iwl_mvm_sta_add_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta)
94 95
95 add_sta_cmd.sta_id = mvm_sta->sta_id; 96 add_sta_cmd.sta_id = mvm_sta->sta_id;
96 add_sta_cmd.mac_id_n_color = cpu_to_le32(mvm_sta->mac_id_n_color); 97 add_sta_cmd.mac_id_n_color = cpu_to_le32(mvm_sta->mac_id_n_color);
97 add_sta_cmd.tfd_queue_msk = cpu_to_le32(mvm_sta->tfd_queue_msk); 98 if (!update) {
98 memcpy(&add_sta_cmd.addr, sta->addr, ETH_ALEN); 99 add_sta_cmd.tfd_queue_msk = cpu_to_le32(mvm_sta->tfd_queue_msk);
100 memcpy(&add_sta_cmd.addr, sta->addr, ETH_ALEN);
101 }
102 add_sta_cmd.add_modify = update ? 1 : 0;
99 103
100 /* STA_FLG_FAT_EN_MSK ? */ 104 /* STA_FLG_FAT_EN_MSK ? */
101 /* STA_FLG_MIMO_EN_MSK ? */ 105 /* STA_FLG_MIMO_EN_MSK ? */
@@ -181,7 +185,7 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
181 /* for HW restart - need to reset the seq_number etc... */ 185 /* for HW restart - need to reset the seq_number etc... */
182 memset(mvm_sta->tid_data, 0, sizeof(mvm_sta->tid_data)); 186 memset(mvm_sta->tid_data, 0, sizeof(mvm_sta->tid_data));
183 187
184 ret = iwl_mvm_sta_add_to_fw(mvm, sta); 188 ret = iwl_mvm_sta_send_to_fw(mvm, sta, false);
185 if (ret) 189 if (ret)
186 return ret; 190 return ret;
187 191
@@ -195,6 +199,13 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
195 return 0; 199 return 0;
196} 200}
197 201
202int iwl_mvm_update_sta(struct iwl_mvm *mvm,
203 struct ieee80211_vif *vif,
204 struct ieee80211_sta *sta)
205{
206 return iwl_mvm_sta_send_to_fw(mvm, sta, true);
207}
208
198int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, 209int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
199 bool drain) 210 bool drain)
200{ 211{
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.h b/drivers/net/wireless/iwlwifi/mvm/sta.h
index 1bf301097984..bdd7c5ed8222 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.h
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.h
@@ -309,10 +309,14 @@ struct iwl_mvm_int_sta {
309 u32 tfd_queue_msk; 309 u32 tfd_queue_msk;
310}; 310};
311 311
312int iwl_mvm_sta_add_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta); 312int iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
313 bool update);
313int iwl_mvm_add_sta(struct iwl_mvm *mvm, 314int iwl_mvm_add_sta(struct iwl_mvm *mvm,
314 struct ieee80211_vif *vif, 315 struct ieee80211_vif *vif,
315 struct ieee80211_sta *sta); 316 struct ieee80211_sta *sta);
317int iwl_mvm_update_sta(struct iwl_mvm *mvm,
318 struct ieee80211_vif *vif,
319 struct ieee80211_sta *sta);
316int iwl_mvm_rm_sta(struct iwl_mvm *mvm, 320int iwl_mvm_rm_sta(struct iwl_mvm *mvm,
317 struct ieee80211_vif *vif, 321 struct ieee80211_vif *vif,
318 struct ieee80211_sta *sta); 322 struct ieee80211_sta *sta);