linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Green <andy@warmcat.com>
To: linux-wireless@vger.kernel.org
Subject: [PATCH] bcm43xx-mac80211: fix rx status reported frequency
Date: Tue, 24 Apr 2007 21:51:29 +0100	[thread overview]
Message-ID: <462E6DD1.4050108@warmcat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: bcm43xx-mac80211-fix-rx-status-reported-frequency.patch --]
[-- Type: text/x-patch, Size: 1595 bytes --]

bcm43xx-mac80211: Fix reported rx frequency and channel

bcm43xx-mac80211 is reporting bogus frequencies and channels back to
mac80211 at the moment (eg, actual ch1 (2412MHz) reported as 2424MHz).

Prior to this patch, the hardware rx channel value is reported as
starting at 0x18 and rising by 0x10 per channel.  Code in bcm43xx_xmit.c
tries to take this value and add 2400 to it to get the rx frequency.
It seems the intention is that the hardware reports the (rx freq - 2400),
so we want the value starting at 0x0c and rising by 0x05 per channel.

If the value read is shifted one more bit to the right, it will
succeed in doing this.  Therefore this patch increases the shifting constant
by one and reduces the mask by one lsb.

The rx frequency reported in the radiotap rx and then, eg, tcpdump,
is then correct.  I didn't test ch 14 but I guess the hardware is
consistent about it.

Signed-off-by: Andy Green <andy@warmcat.com>

diff --git a/drivers/net/wireless/mac80211/bcm43xx/bcm43xx_xmit.h b/drivers/net/wireless/mac80211/bcm43xx/bcm43xx_xmit.h
index 44fa515..0372064 100644
--- a/drivers/net/wireless/mac80211/bcm43xx/bcm43xx_xmit.h
+++ b/drivers/net/wireless/mac80211/bcm43xx/bcm43xx_xmit.h
@@ -190,8 +190,8 @@ struct bcm43xx_rxhdr_fw4 {
 /* RX channel */
 #define BCM43xx_RX_CHAN_GAIN		0xFC00 /* Gain */
 #define BCM43xx_RX_CHAN_GAIN_SHIFT	10
-#define BCM43xx_RX_CHAN_ID		0x03FC /* Channel ID */
-#define BCM43xx_RX_CHAN_ID_SHIFT	2
+#define BCM43xx_RX_CHAN_ID		0x03F8 /* Channel ID */
+#define BCM43xx_RX_CHAN_ID_SHIFT	3
 #define BCM43xx_RX_CHAN_PHYTYPE		0x0003 /* PHY type */
 
 

             reply	other threads:[~2007-04-24 20:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-24 20:51 Andy Green [this message]
2007-04-25 12:55 ` [PATCH] bcm43xx-mac80211: fix rx status reported frequency Michael Buesch

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=462E6DD1.4050108@warmcat.com \
    --to=andy@warmcat.com \
    --cc=linux-wireless@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).