diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2011-02-12 21:32:49 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-14 20:52:10 (GMT) |
commit | 7a047f4f2f3a812f09f42aa784499a54dc4afcf2 (patch) | |
tree | 4396f0fbc6d4cf296994fef8b9a5a92a86a0b576 /drivers/net/wireless/p54/txrx.c | |
parent | a3162eed04ae76be710d895978478aa6d849de41 (diff) | |
download | linux-fsl-qoriq-7a047f4f2f3a812f09f42aa784499a54dc4afcf2.tar.xz |
p54: enhance rssi->dBm database import
This patch fixes several shortcomings of the
previous implementation. Features of the
rewrite include:
* handles undocumented "0x0000" word at the
start of the frequency table.
(Affected some early? DELL 1450 USB devices
and my Symbol 5GHz miniPCI card.)
* supports more than just one reference point
per band. (Also needed for the Symbol card.)
* ships with default values in case the eeprom
data is damaged, absent or unsupported.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/txrx.c')
-rw-r--r-- | drivers/net/wireless/p54/txrx.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c index f618b96..917d5d9 100644 --- a/drivers/net/wireless/p54/txrx.c +++ b/drivers/net/wireless/p54/txrx.c @@ -273,11 +273,9 @@ void p54_tx(struct p54_common *priv, struct sk_buff *skb) static int p54_rssi_to_dbm(struct p54_common *priv, int rssi) { - int band = priv->hw->conf.channel->band; - if (priv->rxhw != 5) { - return ((rssi * priv->rssical_db[band].mul) / 64 + - priv->rssical_db[band].add) / 4; + return ((rssi * priv->cur_rssi->mul) / 64 + + priv->cur_rssi->add) / 4; } else { /* * TODO: find the correct formula |