linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: fix TX power configuration on 3945 and 4965 devices
@ 2011-05-12  9:55 Jiri Slaby
  2011-05-12 10:37 ` Stanislaw Gruszka
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2011-05-12  9:55 UTC (permalink / raw)
  To: wey-yi.w.guy
  Cc: ilw, linux-wireless, linville, jirislaby, Reinette Chatre,
	Jiri Slaby

From: Reinette Chatre <reinette.chatre@intel.com>

When receiving a TX power change request from mac80211 the functions
servicing these requests for 3945 and 4965 uses information in the
active RXON. In iwl_mac_config the staging RXON is prepared based on
various directions from mac80211 and only at the end is the staging
RXON committed to the device and the active RXON updated.

By servicing the TX power change request while servicing the other
requests that modify the staging RXON we loose the new information
provided by mac80211.

Fix this by servicing the TX power change request after the RXON has
been committed to the device and active RXON thus contains accurate
information.

References: https://bugzilla.novell.com/show_bug.cgi?id=610421
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/net/wireless/iwlegacy/iwl-core.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -2220,13 +2220,6 @@ int iwl_legacy_mac_config(struct ieee802
 			IWL_DEBUG_MAC80211(priv, "Error setting sleep level\n");
 	}
 
-	if (changed & IEEE80211_CONF_CHANGE_POWER) {
-		IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
-			priv->tx_power_user_lmt, conf->power_level);
-
-		iwl_legacy_set_tx_power(priv, conf->power_level, false);
-	}
-
 	if (!iwl_legacy_is_ready(priv)) {
 		IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
 		goto out;
@@ -2245,6 +2238,14 @@ int iwl_legacy_mac_config(struct ieee802
 			iwl_legacy_update_qos(priv, ctx);
 	}
 
+	if (changed & IEEE80211_CONF_CHANGE_POWER) {
+		IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
+			priv->tx_power_user_lmt, conf->power_level);
+
+		iwl_legacy_set_tx_power(priv, conf->power_level, false);
+	}
+
+
 out:
 	IWL_DEBUG_MAC80211(priv, "leave\n");
 	mutex_unlock(&priv->mutex);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] iwlwifi: fix TX power configuration on 3945 and 4965 devices
  2011-05-12  9:55 [PATCH] iwlwifi: fix TX power configuration on 3945 and 4965 devices Jiri Slaby
@ 2011-05-12 10:37 ` Stanislaw Gruszka
  0 siblings, 0 replies; 2+ messages in thread
From: Stanislaw Gruszka @ 2011-05-12 10:37 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: wey-yi.w.guy, ilw, linux-wireless, linville, jirislaby,
	Reinette Chatre

On Thu, May 12, 2011 at 11:55:24AM +0200, Jiri Slaby wrote:
> From: Reinette Chatre <reinette.chatre@intel.com>
> 
> When receiving a TX power change request from mac80211 the functions
> servicing these requests for 3945 and 4965 uses information in the
> active RXON. In iwl_mac_config the staging RXON is prepared based on
> various directions from mac80211 and only at the end is the staging
> RXON committed to the device and the active RXON updated.
> 
> By servicing the TX power change request while servicing the other
> requests that modify the staging RXON we loose the new information
> provided by mac80211.
> 
> Fix this by servicing the TX power change request after the RXON has
> been committed to the device and active RXON thus contains accurate
> information.
> 
> References: https://bugzilla.novell.com/show_bug.cgi?id=610421

That problem is already fixed in 2.6.38 by:

commit 21db55a9dc4e52d8d2cac30f47efcec3afccb0c5
Author:     Stanislaw Gruszka <sgruszka@redhat.com>
AuthorDate: Fri Jan 28 16:47:44 2011 +0100
Commit:     Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Mon May 2 09:19:48 2011 -0700

    iwlwifi: do not set tx power when channel is changing

> --- a/drivers/net/wireless/iwlegacy/iwl-core.c
> +++ b/drivers/net/wireless/iwlegacy/iwl-core.c
> @@ -2220,13 +2220,6 @@ int iwl_legacy_mac_config(struct ieee802
>  			IWL_DEBUG_MAC80211(priv, "Error setting sleep level\n");
>  	}
>  
> -	if (changed & IEEE80211_CONF_CHANGE_POWER) {
> -		IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
> -			priv->tx_power_user_lmt, conf->power_level);
> -
> -		iwl_legacy_set_tx_power(priv, conf->power_level, false);
> -	}
> -
>  	if (!iwl_legacy_is_ready(priv)) {
>  		IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
>  		goto out;
> @@ -2245,6 +2238,14 @@ int iwl_legacy_mac_config(struct ieee802
>  			iwl_legacy_update_qos(priv, ctx);
>  	}
>  
> +	if (changed & IEEE80211_CONF_CHANGE_POWER) {
> +		IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
> +			priv->tx_power_user_lmt, conf->power_level);
> +
> +		iwl_legacy_set_tx_power(priv, conf->power_level, false);
> +	}

This disallow to set tx power during scan process, NACK.

Stanislaw

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-12 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-12  9:55 [PATCH] iwlwifi: fix TX power configuration on 3945 and 4965 devices Jiri Slaby
2011-05-12 10:37 ` Stanislaw Gruszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).