diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-02-24 08:23:55 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-25 15:32:33 -0500 |
commit | 43f12d47f0580e04e26c14c03cb19cea9687854e (patch) | |
tree | 1674d9f8a2a8d692f34e5dd664a45c1941e0720e | |
parent | 3083e83c86e604ac7005c100b7d7242389407ba5 (diff) |
iwlegacy: do not set tx power when channel is changing
Same fix as f844a709a7d8f8be61a571afc31dfaca9e779621
"iwlwifi: do not set tx power when channel is changing".
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>
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-4965.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-core.c | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.c b/drivers/net/wireless/iwlegacy/iwl-4965.c index 080444c89022..f5433c74b845 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965.c | |||
@@ -1319,7 +1319,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c | |||
1319 | 1319 | ||
1320 | /* If we issue a new RXON command which required a tune then we must | 1320 | /* If we issue a new RXON command which required a tune then we must |
1321 | * send a new TXPOWER command or we won't be able to Tx any frames */ | 1321 | * send a new TXPOWER command or we won't be able to Tx any frames */ |
1322 | ret = iwl_legacy_set_tx_power(priv, priv->tx_power_user_lmt, true); | 1322 | ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true); |
1323 | if (ret) { | 1323 | if (ret) { |
1324 | IWL_ERR(priv, "Error sending TX power (%d)\n", ret); | 1324 | IWL_ERR(priv, "Error sending TX power (%d)\n", ret); |
1325 | return ret; | 1325 | return ret; |
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c index c95c3bcb724d..7cc560bc4f95 100644 --- a/drivers/net/wireless/iwlegacy/iwl-core.c +++ b/drivers/net/wireless/iwlegacy/iwl-core.c | |||
@@ -1114,6 +1114,8 @@ int iwl_legacy_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force) | |||
1114 | { | 1114 | { |
1115 | int ret; | 1115 | int ret; |
1116 | s8 prev_tx_power; | 1116 | s8 prev_tx_power; |
1117 | bool defer; | ||
1118 | struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; | ||
1117 | 1119 | ||
1118 | lockdep_assert_held(&priv->mutex); | 1120 | lockdep_assert_held(&priv->mutex); |
1119 | 1121 | ||
@@ -1141,10 +1143,15 @@ int iwl_legacy_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force) | |||
1141 | if (!iwl_legacy_is_ready_rf(priv)) | 1143 | if (!iwl_legacy_is_ready_rf(priv)) |
1142 | return -EIO; | 1144 | return -EIO; |
1143 | 1145 | ||
1144 | /* scan complete use tx_power_next, need to be updated */ | 1146 | /* scan complete and commit_rxon use tx_power_next value, |
1147 | * it always need to be updated for newest request */ | ||
1145 | priv->tx_power_next = tx_power; | 1148 | priv->tx_power_next = tx_power; |
1146 | if (test_bit(STATUS_SCANNING, &priv->status) && !force) { | 1149 | |
1147 | IWL_DEBUG_INFO(priv, "Deferring tx power set while scanning\n"); | 1150 | /* do not set tx power when scanning or channel changing */ |
1151 | defer = test_bit(STATUS_SCANNING, &priv->status) || | ||
1152 | memcmp(&ctx->active, &ctx->staging, sizeof(ctx->staging)); | ||
1153 | if (defer && !force) { | ||
1154 | IWL_DEBUG_INFO(priv, "Deferring tx power set\n"); | ||
1148 | return 0; | 1155 | return 0; |
1149 | } | 1156 | } |
1150 | 1157 | ||