Search Linux Wireless

[PATCH] bcm43xx-mac80211: fix rx status reported frequency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>

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 */
 
 

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux