From patchwork Thu May 12 09:55:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 779462 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4C9tSWu024597 for ; Thu, 12 May 2011 09:55:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756941Ab1ELJz1 (ORCPT ); Thu, 12 May 2011 05:55:27 -0400 Received: from cantor.suse.de ([195.135.220.2]:51659 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756829Ab1ELJz0 (ORCPT ); Thu, 12 May 2011 05:55:26 -0400 Received: from localhost.localdomain (charybdis-ext.suse.de [195.135.221.2]) by mx1.suse.de (Postfix) with ESMTP id 405A374609; Thu, 12 May 2011 11:55:25 +0200 (CEST) From: Jiri Slaby To: wey-yi.w.guy@intel.com Cc: ilw@linux.intel.com, linux-wireless@vger.kernel.org, linville@tuxdriver.com, jirislaby@gmail.com, Reinette Chatre , Jiri Slaby Subject: [PATCH] iwlwifi: fix TX power configuration on 3945 and 4965 devices Date: Thu, 12 May 2011 11:55:24 +0200 Message-Id: <1305194124-46828-1-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 1.6.0.2 Patch-mainline: submitted May 12 2011 References: bnc#619440 bnc#610421 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 12 May 2011 09:55:29 +0000 (UTC) From: Reinette Chatre 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 Acked-by: Jeff Mahoney Signed-off-by: Jiri Slaby --- drivers/net/wireless/iwlegacy/iwl-core.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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);