public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	Michael Krufky <mkrufky@linuxtv.org>,
	Chuck Ebbert <cebbert@redhat.com>,
	Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
	Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
	Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, mohamed abbas <mohamed.abbas@intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [patch 20/33] iwlwifi: fix rs_get_rate WARN_ON()
Date: Wed, 4 Feb 2009 10:34:56 -0800	[thread overview]
Message-ID: <20090204183456.GU13936@kroah.com> (raw)
In-Reply-To: <20090204183403.GA13936@kroah.com>

[-- Attachment #1: iwlwifi-fix-rs_get_rate-warn_on.patch --]
[-- Type: text/plain, Size: 3618 bytes --]

2.6.28-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Abbas, Mohamed <mohamed.abbas@intel.com>

commit c338ba3ca5bef2df2082d9e8d336ff7b2880c326 upstream.

In ieee80211_sta structure there is u64 supp_rates[IEEE80211_NUM_BANDS]
this is filled with all support rate from assoc_resp.  If we associate
with G-band AP only supp_rates of G-band will be set the other band
supp_rates will be set to 0. If the user type this command
this will cause mac80211 to set to new channel, mac80211
does not disassociate in setting new channel, so the active
band is now A-band. then in handling the new essid mac80211 will
kick in the assoc steps which involve sending disassociation frame.
in this mac80211 will WARN_ON sta->supp_rates[A_BAND] == 0.

This fixes:
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1822
http://www.kerneloops.org/searchweek.php?search=rs_get_rate

Signed-off-by: mohamed abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/wireless/iwlwifi/iwl-3945-rs.c |   12 +++++++++---
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c  |   12 ++++++++++--
 2 files changed, 19 insertions(+), 5 deletions(-)

--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -647,12 +647,16 @@ static void rs_get_rate(void *priv_r, st
 	s8 scale_action = 0;
 	unsigned long flags;
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
-	u16 fc, rate_mask;
+	u16 fc;
+	u16 rate_mask = 0;
 	struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r;
 	DECLARE_MAC_BUF(mac);
 
 	IWL_DEBUG_RATE("enter\n");
 
+	if (sta)
+		rate_mask = sta->supp_rates[sband->band];
+
 	/* Send management frames and broadcast/multicast data using lowest
 	 * rate. */
 	fc = le16_to_cpu(hdr->frame_control);
@@ -660,11 +664,13 @@ static void rs_get_rate(void *priv_r, st
 	    is_multicast_ether_addr(hdr->addr1) ||
 	    !sta || !priv_sta) {
 		IWL_DEBUG_RATE("leave: No STA priv data to update!\n");
-		sel->rate_idx = rate_lowest_index(sband, sta);
+		if (!rate_mask)
+			sel->rate_idx = rate_lowest_index(sband, NULL);
+		else
+			sel->rate_idx = rate_lowest_index(sband, sta);
 		return;
 	}
 
-	rate_mask = sta->supp_rates[sband->band];
 	index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1);
 
 	if (sband->band == IEEE80211_BAND_5GHZ)
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -951,7 +951,8 @@ static void rs_tx_status(void *priv_r, s
 	}
 
 	/* See if there's a better rate or modulation mode to try. */
-	rs_rate_scale_perform(priv, hdr, sta, lq_sta);
+	if (sta && sta->supp_rates[sband->band])
+		rs_rate_scale_perform(priv, hdr, sta, lq_sta);
 out:
 	return;
 }
@@ -2114,15 +2115,22 @@ static void rs_get_rate(void *priv_r, st
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 	__le16 fc;
 	struct iwl_lq_sta *lq_sta;
+	u64 mask_bit = 0;
 
 	IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");
 
+	if (sta)
+		mask_bit = sta->supp_rates[sband->band];
+
 	/* Send management frames and broadcast/multicast data using lowest
 	 * rate. */
 	fc = hdr->frame_control;
 	if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) ||
 	    !sta || !priv_sta) {
-		sel->rate_idx = rate_lowest_index(sband, sta);
+		if (!mask_bit)
+			sel->rate_idx = rate_lowest_index(sband, NULL);
+		else
+			sel->rate_idx = rate_lowest_index(sband, sta);
 		return;
 	}
 


  parent reply	other threads:[~2009-02-04 18:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090204182823.831027530@mini.kroah.org>
2009-02-04 18:34 ` [patch 00/33] 2.6.28-stable review Greg KH
2009-02-04 18:34   ` [patch 01/33] Manually revert "mlock: downgrade mmap sem while populating mlocked regions" Greg KH
2009-02-04 18:34   ` [patch 02/33] xen: make sysfs files behave as their names suggest Greg KH
2009-02-04 18:34   ` [patch 03/33] sata_mv: fix 8-port timeouts on 508x/6081 chips Greg KH
2009-02-04 18:34   ` [patch 04/33] m68knommu: set NO_DMA Greg KH
2009-02-04 18:34   ` [patch 05/33] PCI/MSI: bugfix/utilize for msi_capability_init() Greg KH
2009-02-04 18:34   ` [patch 06/33] x86: use early clobbers in usercopy*.c Greg KH
2009-02-04 18:34   ` [patch 07/33] cifs: make sure we allocate enough storage for socket address Greg KH
2009-02-04 18:34   ` [patch 08/33] netfilter: ctnetlink: fix scheduling while atomic Greg KH
2009-02-04 18:34   ` [patch 09/33] orinoco: move kmalloc(..., GFP_KERNEL) outside spinlock in orinoco_ioctl_set_genie Greg KH
2009-02-04 18:34   ` [patch 10/33] fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks Greg KH
2009-02-04 18:34   ` [patch 11/33] kmalloc: return NULL instead of link failure Greg KH
2009-02-04 18:34   ` [patch 12/33] sata_nv: rename nv_nf2_hardreset() Greg KH
2009-02-04 18:34   ` [patch 13/33] sata_nv: fix MCP5x reset Greg KH
2009-02-04 18:34   ` [patch 14/33] sata_nv: ck804 has borked hardreset too Greg KH
2009-02-04 18:34   ` [patch 15/33] Fix memory corruption in console selection Greg KH
2009-02-04 18:34   ` [patch 16/33] Add enable_ms to jsm driver Greg KH
2009-02-04 18:34   ` [patch 17/33] Input: atkbd - Samsung NC10 key repeat fix Greg KH
2009-02-04 18:34   ` [patch 18/33] nfsd: only set file_lock.fl_lmops in nfsd4_lockt if a stateowner is found Greg KH
2009-02-04 18:34   ` [patch 19/33] nfsd: Ensure nfsv4 calls the underlying filesystem on LOCKT Greg KH
2009-02-04 18:34   ` Greg KH [this message]
2009-02-04 18:34   ` [patch 21/33] p54: fix lm87 checksum endianness Greg KH
2009-02-04 18:34   ` [patch 22/33] p54: fix p54_read_eeprom to cope with tx_hdr_len Greg KH
2009-02-04 18:35   ` [patch 23/33] p54usb: rewriting rx/tx routines to make use of usb_anchors facilities Greg KH
2009-02-04 18:35   ` [patch 24/33] minstrel: fix warning if lowest supported rate index is not 0 Greg KH
2009-02-04 18:35   ` [patch 25/33] PCI: irq and pci_ids patch for Intel Tigerpoint DeviceIDs Greg KH
2009-02-04 18:35   ` [patch 26/33] cpuidle: Add decaying history logic to menu idle predictor Greg KH
2009-02-04 18:35   ` [patch 27/33] ACPI: Avoid array address overflow when _CST MWAIT hint bits are set Greg KH
2009-02-04 18:35   ` [patch 28/33] video: always update the brightness when poking "brightness" Greg KH
2009-02-04 18:35   ` [patch 29/33] Newly inserted battery might differ from one just removed, so Greg KH
2009-02-04 18:35   ` [patch 30/33] ACPI: Do not modify SCI_EN directly Greg KH
2009-02-04 18:35   ` [patch 31/33] dlm: initialize file_lock struct in GETLK before copying conflicting lock Greg KH
2009-02-04 18:35   ` [patch 32/33] sata_mv: Fix chip type for Hightpoint RocketRaid 1740/1742 Greg KH
2009-02-04 18:35   ` [patch 33/33] ACPICA: Allow multiple backslash prefix in namepaths Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090204183456.GU13936@kroah.com \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=cavokz@gmail.com \
    --cc=cebbert@redhat.com \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=eteo@redhat.com \
    --cc=jake@lwn.net \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mkrufky@linuxtv.org \
    --cc=mohamed.abbas@intel.com \
    --cc=rbranco@la.checkpoint.com \
    --cc=rdunlap@xenotime.net \
    --cc=reinette.chatre@intel.com \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=w@1wt.eu \
    --cc=zwane@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox