* [PATCH] bcm43xx-mac80211: fix rx status reported frequency
@ 2007-04-24 20:51 Andy Green
2007-04-25 12:55 ` Michael Buesch
0 siblings, 1 reply; 2+ messages in thread
From: Andy Green @ 2007-04-24 20:51 UTC (permalink / raw)
To: linux-wireless
[-- 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 */
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] bcm43xx-mac80211: fix rx status reported frequency
2007-04-24 20:51 [PATCH] bcm43xx-mac80211: fix rx status reported frequency Andy Green
@ 2007-04-25 12:55 ` Michael Buesch
0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2007-04-25 12:55 UTC (permalink / raw)
To: Andy Green; +Cc: linux-wireless, Joseph Jezak, Johannes Berg
Always inline patches, please.
On Tuesday 24 April 2007 22:51, Andy Green wrote:
> 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 {
> =A0/* RX channel */
> =A0#define BCM43xx_RX_CHAN_GAIN=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A00xFC0=
0 /* Gain */
> =A0#define BCM43xx_RX_CHAN_GAIN_SHIFT=A0=A0=A0=A0=A010
> -#define BCM43xx_RX_CHAN_ID=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A00x0=
3FC /* Channel ID */
> -#define BCM43xx_RX_CHAN_ID_SHIFT=A0=A0=A0=A0=A0=A0=A02
> +#define BCM43xx_RX_CHAN_ID=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A00x0=
3F8 /* Channel ID */
> +#define BCM43xx_RX_CHAN_ID_SHIFT=A0=A0=A0=A0=A0=A0=A03
> =A0#define BCM43xx_RX_CHAN_PHYTYPE=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A00x0003 /* PHY type */
according to the specs the value 0x3FC is right.
Johannes, Joe?
--=20
Greetings Michael.
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-25 12:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-24 20:51 [PATCH] bcm43xx-mac80211: fix rx status reported frequency Andy Green
2007-04-25 12:55 ` Michael Buesch
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).