aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rxon.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c43
1 files changed, 34 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 6d140bd5329..6c2adc58d65 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -52,10 +52,14 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
52 struct iwl_rxon_context *ctx, 52 struct iwl_rxon_context *ctx,
53 struct iwl_rxon_cmd *send) 53 struct iwl_rxon_cmd *send)
54{ 54{
55 struct iwl_notification_wait disable_wait;
55 __le32 old_filter = send->filter_flags; 56 __le32 old_filter = send->filter_flags;
56 u8 old_dev_type = send->dev_type; 57 u8 old_dev_type = send->dev_type;
57 int ret; 58 int ret;
58 59
60 iwlagn_init_notification_wait(priv, &disable_wait, NULL,
61 REPLY_WIPAN_DEACTIVATION_COMPLETE);
62
59 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 63 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
60 send->dev_type = RXON_DEV_TYPE_P2P; 64 send->dev_type = RXON_DEV_TYPE_P2P;
61 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send); 65 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send);
@@ -63,11 +67,18 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
63 send->filter_flags = old_filter; 67 send->filter_flags = old_filter;
64 send->dev_type = old_dev_type; 68 send->dev_type = old_dev_type;
65 69
66 if (ret) 70 if (ret) {
67 IWL_ERR(priv, "Error disabling PAN (%d)\n", ret); 71 IWL_ERR(priv, "Error disabling PAN (%d)\n", ret);
68 72 iwlagn_remove_notification(priv, &disable_wait);
69 /* FIXME: WAIT FOR PAN DISABLE */ 73 } else {
70 msleep(300); 74 signed long wait_res;
75
76 wait_res = iwlagn_wait_notification(priv, &disable_wait, HZ);
77 if (wait_res == 0) {
78 IWL_ERR(priv, "Timed out waiting for PAN disable\n");
79 ret = -EIO;
80 }
81 }
71 82
72 return ret; 83 return ret;
73} 84}
@@ -145,6 +156,23 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
145 /* always get timestamp with Rx frame */ 156 /* always get timestamp with Rx frame */
146 ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK; 157 ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK;
147 158
159 if (ctx->ctxid == IWL_RXON_CTX_PAN && priv->_agn.hw_roc_channel) {
160 struct ieee80211_channel *chan = priv->_agn.hw_roc_channel;
161
162 iwl_set_rxon_channel(priv, chan, ctx);
163 iwl_set_flags_for_band(priv, ctx, chan->band, NULL);
164 ctx->staging.filter_flags |=
165 RXON_FILTER_ASSOC_MSK |
166 RXON_FILTER_PROMISC_MSK |
167 RXON_FILTER_CTL2HOST_MSK;
168 ctx->staging.dev_type = RXON_DEV_TYPE_P2P;
169 new_assoc = true;
170
171 if (memcmp(&ctx->staging, &ctx->active,
172 sizeof(ctx->staging)) == 0)
173 return 0;
174 }
175
148 if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) || 176 if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
149 !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK)) 177 !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK))
150 ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK; 178 ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
@@ -288,10 +316,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
288 * If we issue a new RXON command which required a tune then we must 316 * If we issue a new RXON command which required a tune then we must
289 * send a new TXPOWER command or we won't be able to Tx any frames. 317 * send a new TXPOWER command or we won't be able to Tx any frames.
290 * 318 *
291 * FIXME: which RXON requires a tune? Can we optimise this out in 319 * It's expected we set power here if channel is changing.
292 * some cases?
293 */ 320 */
294 ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); 321 ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
295 if (ret) { 322 if (ret) {
296 IWL_ERR(priv, "Error sending TX power (%d)\n", ret); 323 IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
297 return ret; 324 return ret;
@@ -546,12 +573,10 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
546 573
547 if (changes & BSS_CHANGED_ASSOC) { 574 if (changes & BSS_CHANGED_ASSOC) {
548 if (bss_conf->assoc) { 575 if (bss_conf->assoc) {
549 iwl_led_associate(priv);
550 priv->timestamp = bss_conf->timestamp; 576 priv->timestamp = bss_conf->timestamp;
551 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; 577 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
552 } else { 578 } else {
553 ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 579 ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
554 iwl_led_disassociate(priv);
555 } 580 }
556 } 581 }
557 582