Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224333
b: refs/heads/master
c: 52d980c
h: refs/heads/master
i:
  224331: e109333
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Nov 15, 2010
1 parent 7d78f03 commit cb61051
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e1fea43aa170e18beb8378465e595e18cd08f6e
refs/heads/master: 52d980c01353202332ff4322f3f41db0c49816a5
50 changes: 21 additions & 29 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
{
/* cast away the const for active_rxon in this function */
struct iwl_rxon_cmd *active = (void *)&ctx->active;
bool old_assoc = !!(ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK);
bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK);
int ret;

Expand Down Expand Up @@ -172,37 +171,30 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
ctx->staging.bssid_addr);

/*
* If we are currently associated and the new config is also
* going to be associated, OR if the new config is simply not
* associated, clear associated.
* Always clear associated first, but with the correct config.
* This is required as for example station addition for the
* AP station must be done after the BSSID is set to correctly
* set up filters in the device.
*/
if ((old_assoc && new_assoc) || !new_assoc) {
struct iwl_rxon_cmd *send = active;

if (!new_assoc)
send = &ctx->staging;

if (ctx->ctxid == IWL_RXON_CTX_BSS)
ret = iwlagn_disable_bss(priv, ctx, send);
else
ret = iwlagn_disable_pan(priv, ctx, send);
if (ret)
return ret;
if (ctx->ctxid == IWL_RXON_CTX_BSS)
ret = iwlagn_disable_bss(priv, ctx, &ctx->staging);
else
ret = iwlagn_disable_pan(priv, ctx, &ctx->staging);
if (ret)
return ret;

if (send != active)
memcpy(active, send, sizeof(*active));
memcpy(active, &ctx->staging, sizeof(*active));

/*
* Un-assoc RXON clears the station table and WEP
* keys, so we have to restore those afterwards.
*/
iwl_clear_ucode_stations(priv, ctx);
iwl_restore_stations(priv, ctx);
ret = iwl_restore_default_wep_keys(priv, ctx);
if (ret) {
IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
return ret;
}
/*
* Un-assoc RXON clears the station table and WEP
* keys, so we have to restore those afterwards.
*/
iwl_clear_ucode_stations(priv, ctx);
iwl_restore_stations(priv, ctx);
ret = iwl_restore_default_wep_keys(priv, ctx);
if (ret) {
IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
return ret;
}

/* RXON timing must be before associated RXON */
Expand Down

0 comments on commit cb61051

Please sign in to comment.