aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-01-28 10:47:44 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-28 15:46:24 -0500
commitf844a709a7d8f8be61a571afc31dfaca9e779621 (patch)
treeebccd8b84ff00ad01ceca017d1b3370374882319 /drivers/net/wireless
parentefe1cf0c5743caf4daccb57b399ef63edad41c9d (diff)
iwlwifi: do not set tx power when channel is changing
Mac80211 can request for tx power and channel change in one ->config call. If that happens, *_send_tx_power functions will try to setup tx power for old channel, what can be not correct because we already change the band. I.e error "Failed to get channel info for channel 140 [0]", can be printed frequently when operating in software scanning mode. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c13
4 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 1d9dcd7e3b82..294221b06813 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -1890,7 +1890,7 @@ int iwl3945_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
1890 1890
1891 /* If we issue a new RXON command which required a tune then we must 1891 /* If we issue a new RXON command which required a tune then we must
1892 * send a new TXPOWER command or we won't be able to Tx any frames */ 1892 * send a new TXPOWER command or we won't be able to Tx any frames */
1893 rc = priv->cfg->ops->lib->send_tx_power(priv); 1893 rc = iwl_set_tx_power(priv, priv->tx_power_next, true);
1894 if (rc) { 1894 if (rc) {
1895 IWL_ERR(priv, "Error setting Tx power (%d).\n", rc); 1895 IWL_ERR(priv, "Error setting Tx power (%d).\n", rc);
1896 return rc; 1896 return rc;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index d9a7d93def6c..053240642b50 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -1571,7 +1571,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
1571 1571
1572 /* If we issue a new RXON command which required a tune then we must 1572 /* If we issue a new RXON command which required a tune then we must
1573 * send a new TXPOWER command or we won't be able to Tx any frames */ 1573 * send a new TXPOWER command or we won't be able to Tx any frames */
1574 ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); 1574 ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
1575 if (ret) { 1575 if (ret) {
1576 IWL_ERR(priv, "Error sending TX power (%d)\n", ret); 1576 IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
1577 return ret; 1577 return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 2a4ff832fbb8..6c2adc58d654 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -316,10 +316,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
316 * 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
317 * 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.
318 * 318 *
319 * FIXME: which RXON requires a tune? Can we optimise this out in 319 * It's expected we set power here if channel is changing.
320 * some cases?
321 */ 320 */
322 ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); 321 ret = iwl_set_tx_power(priv, priv->tx_power_next, true);
323 if (ret) { 322 if (ret) {
324 IWL_ERR(priv, "Error sending TX power (%d)\n", ret); 323 IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
325 return ret; 324 return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index a46ad60216a0..92724cbf18ca 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1162,6 +1162,8 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
1162{ 1162{
1163 int ret; 1163 int ret;
1164 s8 prev_tx_power; 1164 s8 prev_tx_power;
1165 bool defer;
1166 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
1165 1167
1166 lockdep_assert_held(&priv->mutex); 1168 lockdep_assert_held(&priv->mutex);
1167 1169
@@ -1189,10 +1191,15 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
1189 if (!iwl_is_ready_rf(priv)) 1191 if (!iwl_is_ready_rf(priv))
1190 return -EIO; 1192 return -EIO;
1191 1193
1192 /* scan complete use tx_power_next, need to be updated */ 1194 /* scan complete and commit_rxon use tx_power_next value,
1195 * it always need to be updated for newest request */
1193 priv->tx_power_next = tx_power; 1196 priv->tx_power_next = tx_power;
1194 if (test_bit(STATUS_SCANNING, &priv->status) && !force) { 1197
1195 IWL_DEBUG_INFO(priv, "Deferring tx power set while scanning\n"); 1198 /* do not set tx power when scanning or channel changing */
1199 defer = test_bit(STATUS_SCANNING, &priv->status) ||
1200 memcmp(&ctx->active, &ctx->staging, sizeof(ctx->staging));
1201 if (defer && !force) {
1202 IWL_DEBUG_INFO(priv, "Deferring tx power set\n");
1196 return 0; 1203 return 0;
1197 } 1204 }
1198 1205