From patchwork Thu May 13 21:49:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinette Chatre X-Patchwork-Id: 99438 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4DLnt2A013677 for ; Thu, 13 May 2010 21:49:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932519Ab0EMVtw (ORCPT ); Thu, 13 May 2010 17:49:52 -0400 Received: from mga02.intel.com ([134.134.136.20]:31569 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932436Ab0EMVtu (ORCPT ); Thu, 13 May 2010 17:49:50 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 13 May 2010 14:47:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,224,1272870000"; d="scan'208";a="517743261" Received: from rchatre-desk.amr.corp.intel.com.jf.intel.com (HELO localhost.localdomain) ([134.134.15.94]) by orsmga002.jf.intel.com with ESMTP; 13 May 2010 14:49:12 -0700 From: Reinette Chatre To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, ipw3945-devel@lists.sourceforge.net, Reinette Chatre Subject: [PATCH 2/2] iwlagn: work around rate scaling reset delay Date: Thu, 13 May 2010 14:49:45 -0700 Message-Id: <1273787385-9248-3-git-send-email-reinette.chatre@intel.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1273787385-9248-1-git-send-email-reinette.chatre@intel.com> References: <1273787385-9248-1-git-send-email-reinette.chatre@intel.com> 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.3 (demeter.kernel.org [140.211.167.41]); Thu, 13 May 2010 21:49:55 +0000 (UTC) diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 4a6686f..702672d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c @@ -948,6 +948,39 @@ static inline void iwl_dump_lq_cmd(struct iwl_priv *priv, } #endif +/** + * is_lq_table_valid() - Test one aspect of LQ cmd for validity + * + * It sometimes happens when a HT rate has been in use and we + * loose connectivity with AP then mac80211 will first tell us that the + * current channel is not HT anymore before removing the station. In such a + * scenario the RXON flags will be updated to indicate we are not + * communicating HT anymore, but the LQ command may still contain HT rates. + * Test for this to prevent driver from sending LQ command between the time + * RXON flags are updated and when LQ command is updated. + */ +static bool is_lq_table_valid(struct iwl_priv *priv, + struct iwl_link_quality_cmd *lq) +{ + int i; + struct iwl_ht_config *ht_conf = &priv->current_ht_config; + + if (ht_conf->is_ht) + return true; + + IWL_DEBUG_INFO(priv, "Channel %u is not an HT channel\n", + priv->active_rxon.channel); + for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) { + if (le32_to_cpu(lq->rs_table[i].rate_n_flags) & RATE_MCS_HT_MSK) { + IWL_DEBUG_INFO(priv, + "index %d of LQ expects HT channel\n", + i); + return false; + } + } + return true; +} + int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_link_quality_cmd *lq, u8 flags) { @@ -967,7 +1000,9 @@ int iwl_send_lq_cmd(struct iwl_priv *priv, iwl_dump_lq_cmd(priv, lq); - if (iwl_is_associated(priv) && priv->assoc_station_added) + if (iwl_is_associated(priv) && + priv->assoc_station_added && + is_lq_table_valid(priv, lq)) return iwl_send_cmd(priv, &cmd); return 0;