aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2010-08-24 17:29:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-25 14:34:56 -0400
commit45f7e3116fad77e6dd15cb0e2eaccb7de7b806c9 (patch)
treebd1b652a84a8bf37eb941aa50719b3aab833ee60 /drivers
parent2c15a0cf27a74213a714cc7be31685b841f7c1ac (diff)
p54: better rssi->dbm conversion for longbow phys
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@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/p54/txrx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 34447d1ad80d..8f67db487f57 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)
275{ 275{
276 int band = priv->hw->conf.channel->band; 276 int band = priv->hw->conf.channel->band;
277 277
278 if (priv->rxhw != 5) 278 if (priv->rxhw != 5) {
279 return ((rssi * priv->rssical_db[band].mul) / 64 + 279 return ((rssi * priv->rssical_db[band].mul) / 64 +
280 priv->rssical_db[band].add) / 4; 280 priv->rssical_db[band].add) / 4;
281 else 281 } else {
282 /* 282 /*
283 * TODO: find the correct formula 283 * TODO: find the correct formula
284 */ 284 */
285 return ((rssi * priv->rssical_db[band].mul) / 64 + 285 return rssi / 2 - 110;
286 priv->rssical_db[band].add) / 4; 286 }
287} 287}
288 288
289/* 289/*