|
@@ -1114,6 +1114,8 @@ int iwl_legacy_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
|
|
|
{
|
|
|
int ret;
|
|
|
s8 prev_tx_power;
|
|
|
+ bool defer;
|
|
|
+ struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
|
|
|
|
|
|
lockdep_assert_held(&priv->mutex);
|
|
|
|
|
@@ -1141,10 +1143,15 @@ int iwl_legacy_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
|
|
|
if (!iwl_legacy_is_ready_rf(priv))
|
|
|
return -EIO;
|
|
|
|
|
|
- /* scan complete use tx_power_next, need to be updated */
|
|
|
+ /* scan complete and commit_rxon use tx_power_next value,
|
|
|
+ * it always need to be updated for newest request */
|
|
|
priv->tx_power_next = tx_power;
|
|
|
- if (test_bit(STATUS_SCANNING, &priv->status) && !force) {
|
|
|
- IWL_DEBUG_INFO(priv, "Deferring tx power set while scanning\n");
|
|
|
+
|
|
|
+ /* do not set tx power when scanning or channel changing */
|
|
|
+ defer = test_bit(STATUS_SCANNING, &priv->status) ||
|
|
|
+ memcmp(&ctx->active, &ctx->staging, sizeof(ctx->staging));
|
|
|
+ if (defer && !force) {
|
|
|
+ IWL_DEBUG_INFO(priv, "Deferring tx power set\n");
|
|
|
return 0;
|
|
|
}
|
|
|
|