aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-06-11 21:47:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:09 -0400
commit95483b69c8c0d49e43c97ecb5eb3cbec48a02d61 (patch)
tree81261960fe03b9d6898a1690da103fcaf62d42e2
parent91dbc5bdbaccc3e89f757afb53c6956c40b80306 (diff)
iwlwifi: remove dead code iwl4965_calc_db_from_ratio
This patch removes iwl4965_calc_db_from_ratio which is dead code. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 14d44321771f..8f1ab23e9d61 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1597,42 +1597,6 @@ void iwl_rx_handle(struct iwl_priv *priv)
1597 priv->rxq.read = i; 1597 priv->rxq.read = i;
1598 iwl_rx_queue_restock(priv); 1598 iwl_rx_queue_restock(priv);
1599} 1599}
1600/* Convert linear signal-to-noise ratio into dB */
1601static u8 ratio2dB[100] = {
1602/* 0 1 2 3 4 5 6 7 8 9 */
1603 0, 0, 6, 10, 12, 14, 16, 17, 18, 19, /* 00 - 09 */
1604 20, 21, 22, 22, 23, 23, 24, 25, 26, 26, /* 10 - 19 */
1605 26, 26, 26, 27, 27, 28, 28, 28, 29, 29, /* 20 - 29 */
1606 29, 30, 30, 30, 31, 31, 31, 31, 32, 32, /* 30 - 39 */
1607 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, /* 40 - 49 */
1608 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, /* 50 - 59 */
1609 36, 36, 36, 36, 36, 36, 36, 37, 37, 37, /* 60 - 69 */
1610 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, /* 70 - 79 */
1611 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, /* 80 - 89 */
1612 39, 39, 39, 39, 39, 40, 40, 40, 40, 40 /* 90 - 99 */
1613};
1614
1615/* Calculates a relative dB value from a ratio of linear
1616 * (i.e. not dB) signal levels.
1617 * Conversion assumes that levels are voltages (20*log), not powers (10*log). */
1618int iwl4965_calc_db_from_ratio(int sig_ratio)
1619{
1620 /* 1000:1 or higher just report as 60 dB */
1621 if (sig_ratio >= 1000)
1622 return 60;
1623
1624 /* 100:1 or higher, divide by 10 and use table,
1625 * add 20 dB to make up for divide by 10 */
1626 if (sig_ratio >= 100)
1627 return (20 + (int)ratio2dB[sig_ratio/10]);
1628
1629 /* We shouldn't see this */
1630 if (sig_ratio < 1)
1631 return 0;
1632
1633 /* Use table for ratios 1:1 - 99:1 */
1634 return (int)ratio2dB[sig_ratio];
1635}
1636 1600
1637#define PERFECT_RSSI (-20) /* dBm */ 1601#define PERFECT_RSSI (-20) /* dBm */
1638#define WORST_RSSI (-95) /* dBm */ 1602#define WORST_RSSI (-95) /* dBm */