aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-11-10 12:56:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:26:52 -0500
commit52d980c01353202332ff4322f3f41db0c49816a5 (patch)
treefc730451ac0b41800612da19b1b7fe674a82b7a7 /drivers
parent2e1fea43aa170e18beb8378465e595e18cd08f6e (diff)
iwlagn: fix RXON issues
The RXON rework resulted in a massive loss of throughput because we weren't programming the device completely correctly -- the BSSID has to be programmed into the device before the AP station is uploaded. To fix this, simply always send the unassoc RXON, i.e. even when it was already unassoc so that the BSSID and some other parameters are updated properly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 1fab1bb5f2b4..d594a1658a9e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -96,7 +96,6 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
96{ 96{
97 /* cast away the const for active_rxon in this function */ 97 /* cast away the const for active_rxon in this function */
98 struct iwl_rxon_cmd *active = (void *)&ctx->active; 98 struct iwl_rxon_cmd *active = (void *)&ctx->active;
99 bool old_assoc = !!(ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK);
100 bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK); 99 bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK);
101 int ret; 100 int ret;
102 101
@@ -172,37 +171,30 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
172 ctx->staging.bssid_addr); 171 ctx->staging.bssid_addr);
173 172
174 /* 173 /*
175 * If we are currently associated and the new config is also 174 * Always clear associated first, but with the correct config.
176 * going to be associated, OR if the new config is simply not 175 * This is required as for example station addition for the
177 * associated, clear associated. 176 * AP station must be done after the BSSID is set to correctly
177 * set up filters in the device.
178 */ 178 */
179 if ((old_assoc && new_assoc) || !new_assoc) { 179 if (ctx->ctxid == IWL_RXON_CTX_BSS)
180 struct iwl_rxon_cmd *send = active; 180 ret = iwlagn_disable_bss(priv, ctx, &ctx->staging);
181 181 else
182 if (!new_assoc) 182 ret = iwlagn_disable_pan(priv, ctx, &ctx->staging);
183 send = &ctx->staging; 183 if (ret)
184 184 return ret;
185 if (ctx->ctxid == IWL_RXON_CTX_BSS)
186 ret = iwlagn_disable_bss(priv, ctx, send);
187 else
188 ret = iwlagn_disable_pan(priv, ctx, send);
189 if (ret)
190 return ret;
191 185
192 if (send != active) 186 memcpy(active, &ctx->staging, sizeof(*active));
193 memcpy(active, send, sizeof(*active));
194 187
195 /* 188 /*
196 * Un-assoc RXON clears the station table and WEP 189 * Un-assoc RXON clears the station table and WEP
197 * keys, so we have to restore those afterwards. 190 * keys, so we have to restore those afterwards.
198 */ 191 */
199 iwl_clear_ucode_stations(priv, ctx); 192 iwl_clear_ucode_stations(priv, ctx);
200 iwl_restore_stations(priv, ctx); 193 iwl_restore_stations(priv, ctx);
201 ret = iwl_restore_default_wep_keys(priv, ctx); 194 ret = iwl_restore_default_wep_keys(priv, ctx);
202 if (ret) { 195 if (ret) {
203 IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret); 196 IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
204 return ret; 197 return ret;
205 }
206 } 198 }
207 199
208 /* RXON timing must be before associated RXON */ 200 /* RXON timing must be before associated RXON */