iwlegacy: set tx power after rxon_assoc
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 27 Jul 2011 13:37:43 +0000 (15:37 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 1 Aug 2011 17:46:45 +0000 (13:46 -0400)
If settings of tx power was deferred during scan or changing channel we
have to setup them during commit rxon. Fix problem on 3945 (4965 already
has this fix).

Optimize code to apply tx settings only when tx power was actually
changed.

Cc: stable@kernel.org # 2.6.39+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlegacy/iwl-3945.c
drivers/net/wireless/iwlegacy/iwl-4965.c

index dab67a12d73b7c612af704bc0c7647af016d2760..73fe3cdf796b28555dcc8e044aaccedf936d7071 100644 (file)
@@ -1746,7 +1746,11 @@ int iwl3945_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
                }
 
                memcpy(active_rxon, staging_rxon, sizeof(*active_rxon));
-
+               /*
+                * We do not commit tx power settings while channel changing,
+                * do it now if tx power changed.
+                */
+               iwl_legacy_set_tx_power(priv, priv->tx_power_next, false);
                return 0;
        }
 
index bd4b000733f7c99906b42d56d8805285f955cfc4..ecdc6e557428ee4d777f955408fc8054fd1c82d5 100644 (file)
@@ -1235,7 +1235,12 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
 
                memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon));
                iwl_legacy_print_rx_config_cmd(priv, ctx);
-               goto set_tx_power;
+               /*
+                * We do not commit tx power settings while channel changing,
+                * do it now if tx power changed.
+                */
+               iwl_legacy_set_tx_power(priv, priv->tx_power_next, false);
+               return 0;
        }
 
        /* If we are currently associated and the new config requires
@@ -1315,7 +1320,6 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
 
        iwl4965_init_sensitivity(priv);
 
-set_tx_power:
        /* If we issue a new RXON command which required a tune then we must
         * send a new TXPOWER command or we won't be able to Tx any frames */
        ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true);