mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Arend van Spriel <arend@broadcom.com>
Subject: [16/26] staging: brcm80211: fill in proper rx rate in mac80211 rx status
Date: Fri, 18 Nov 2011 16:02:52 -0800	[thread overview]
Message-ID: <20111119000329.329959267@clark.kroah.org> (raw)
In-Reply-To: <20111119000336.GA8452@kroah.com>

3.1-stable review patch.  If anyone has any objections, please let me know.

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

From: Arend van Spriel <arend@broadcom.com>

commit 5a84d6ad4c9306afb467a600a4c6d7b50da49440 upstream.

The brcmsmac driver supports different rates on 5GHz but this is not
taken into account when providing the rate index in the receive
status information passed to mac80211.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Henry Ptasinski <henryp@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c |    9 +++++++--
 drivers/staging/brcm80211/brcmsmac/mac80211_if.h |    6 ++++++
 drivers/staging/brcm80211/brcmsmac/main.c        |    8 ++++++++
 3 files changed, 21 insertions(+), 2 deletions(-)

--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -975,6 +975,10 @@ static struct ieee80211_channel brcms_5g
 	.hw_value = (rate100m / 5), \
 }
 
+/*
+ * The rate table is used for both 2.4G and 5G rates. The
+ * latter being a subset as it does not support CCK rates.
+ */
 static struct ieee80211_rate legacy_ratetable[] = {
 	RATE(10, 0),
 	RATE(20, IEEE80211_RATE_SHORT_PREAMBLE),
@@ -1016,8 +1020,9 @@ static struct ieee80211_supported_band b
 	.band = IEEE80211_BAND_5GHZ,
 	.channels = brcms_5ghz_nphy_chantable,
 	.n_channels = ARRAY_SIZE(brcms_5ghz_nphy_chantable),
-	.bitrates = legacy_ratetable + 4,
-	.n_bitrates = ARRAY_SIZE(legacy_ratetable) - 4,
+	.bitrates = legacy_ratetable + BRCMS_LEGACY_5G_RATE_OFFSET,
+	.n_bitrates = ARRAY_SIZE(legacy_ratetable) -
+			BRCMS_LEGACY_5G_RATE_OFFSET,
 	.ht_cap = {
 		   /* use IEEE80211_HT_CAP_* from include/linux/ieee80211.h */
 		   .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_40MHZ_INTOLERANT,	/* No 40 mhz yet */
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
@@ -20,6 +20,12 @@
 #include <linux/timer.h>
 #include <linux/interrupt.h>
 
+/*
+ * Starting index for 5G rates in the
+ * legacy rate table.
+ */
+#define BRCMS_LEGACY_5G_RATE_OFFSET	4
+
 /* softmac ioctl definitions */
 #define BRCMS_SET_SHORTSLOT_OVERRIDE		146
 
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -4608,6 +4608,14 @@ prep_mac80211_status(struct brcms_c_info
 			wiphy_err(wlc->wiphy, "%s: Unknown rate\n", __func__);
 		}
 
+		/*
+		 * For 5GHz, we should decrease the index as it is
+		 * a subset of the 2.4G rates. See bitrates field
+		 * of brcms_band_5GHz_nphy (in mac80211_if.c).
+		 */
+		if (rx_status->band == IEEE80211_BAND_5GHZ)
+			rx_status->rate_idx -= BRCMS_LEGACY_5G_RATE_OFFSET;
+
 		/* Determine short preamble and rate_idx */
 		preamble = 0;
 		if (IS_CCK(rspec)) {



  parent reply	other threads:[~2011-11-19  0:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-19  0:03 [00/26] 3.1.2-stable review Greg KH
2011-11-19  0:02 ` [01/26] ALSA: hda - fix internal mic on Dell Vostro 3500 laptop Greg KH
2011-11-19  0:02 ` [02/26] ALSA: hda - Dont add elements of other codecs to vmaster slave Greg KH
2011-11-19  0:02 ` [03/26] virtio-pci: fix use after free Greg KH
2011-11-19  0:02 ` [04/26] ARM: at91: Fix USBA gadget registration Greg KH
2011-11-19  0:02 ` [05/26] ASoC: Dont use wm8994->control_data in wm8994_readable_register() Greg KH
2011-11-19  0:02 ` [06/26] sh: Fix cached/uncaced address calculation in 29bit mode Greg KH
2011-11-19  0:02 ` [07/26] drm/i915: Fix object refcount leak on mmappable size limit error path Greg KH
2011-11-19  0:02 ` [08/26] drm/nouveau: initialize chan->fence.lock before use Greg KH
2011-11-19  0:02 ` [09/26] drm/radeon/kms: make an aux failure debug only Greg KH
2011-11-19  0:02 ` [10/26] ALSA: usb-audio - Check the dB-range validity in the later read, too Greg KH
2011-11-19  0:02 ` [11/26] ALSA: usb-audio - Fix the missing volume quirks at delayed init Greg KH
2011-11-19  0:02 ` [12/26] KEYS: Fix a NULL pointer deref in the user-defined key type Greg KH
2011-11-19  0:02 ` [13/26] hfs: add sanity check for file name length Greg KH
2011-11-19  0:02 ` [14/26] Revert "leds: save the delay values after a successful call to blink_set()" Greg KH
2011-11-19  0:02 ` [15/26] drm/radeon: add some missing FireMV pci ids Greg KH
2011-11-19  0:02 ` Greg KH [this message]
2011-11-19  0:02 ` [17/26] b43: refuse to load unsupported firmware Greg KH
2011-11-19 17:22   ` Ben Hutchings
2011-11-19 19:05     ` Greg KH
2011-11-19 19:49       ` Ben Hutchings
2011-11-19  0:02 ` [18/26] mfd: Fix twl4030 dependencies for audio codec Greg KH
2011-11-19  0:02 ` [19/26] xen:pvhvm: enable PVHVM VCPU placement when using more than 32 CPUs Greg KH
2011-11-19  0:02 ` [20/26] xen-gntalloc: integer overflow in gntalloc_ioctl_alloc() Greg KH
2011-11-19  0:02 ` [21/26] xen-gntalloc: signedness bug in add_grefs() Greg KH
2011-11-19  0:02 ` [22/26] powerpc/ps3: Fix lost SMP IPIs Greg KH
2011-11-19  0:02 ` [23/26] powerpc: Add hvcall.h include to book3s_hv.c Greg KH
2011-11-19  0:03 ` [24/26] powerpc: Copy down exception vectors after feature fixups Greg KH
2011-11-19  0:03 ` [25/26] backing-dev: ensure wakeup_timer is deleted Greg KH
2011-11-19  0:03 ` [26/26] block: Always check length of all iov entries in blk_rq_map_user_iov() Greg KH
2011-11-19 19:57 ` [00/26] 3.1.2-stable review Woody Suwalski
2011-11-20  0:43   ` 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=20111119000329.329959267@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arend@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®