Search Linux Wireless

[PATCH] p54: better rssi->dbm conversion for longbow phys

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

 



This patch should fix the dodgy signal and noise value
reports for most longbow (p54spi) users:

e.g.: (an older tcpdump extract)
> 2.0 Mb/s 2437 MHz (0x00a0) -49dB signal -41dB noise 
> 1.0 Mb/s 2437 MHz (0x00a0) 4dB signal -41dB noise

The formula is taken from stlc45xx:
http://gitorious.org/stlc45xx/mainline/blobs/master/stlc45xx.c#line1199

Signed-off-by: Christian Lamparter <chunkeey@xxxxxxxxxxxxxx>
---
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 1dc0dbf..1fe971c 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -275,15 +275,15 @@ static int p54_rssi_to_dbm(struct p54_common *priv, int rssi)
 {
 	int band = priv->hw->conf.channel->band;
 
-	if (priv->rxhw != 5)
+	if (priv->rxhw != 5) {
 		return ((rssi * priv->rssical_db[band].mul) / 64 +
 			 priv->rssical_db[band].add) / 4;
-	else
+	} else {
 		/*
 		 * TODO: find the correct formula
 		 */
-		return ((rssi * priv->rssical_db[band].mul) / 64 +
-			 priv->rssical_db[band].add) / 4;
+		return rssi / 2 - 110;
+	}
 }
 
 /*
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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