diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 6d598890134..f3d662c8cbc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -179,14 +179,24 @@ static void iwl5000_gain_computation(struct iwl_priv *priv, | |||
179 | data->delta_gain_code[i] = 0; | 179 | data->delta_gain_code[i] = 0; |
180 | continue; | 180 | continue; |
181 | } | 181 | } |
182 | delta_g = (1000 * ((s32)average_noise[default_chain] - | 182 | |
183 | delta_g = (priv->cfg->chain_noise_scale * | ||
184 | ((s32)average_noise[default_chain] - | ||
183 | (s32)average_noise[i])) / 1500; | 185 | (s32)average_noise[i])) / 1500; |
186 | |||
184 | /* bound gain by 2 bits value max, 3rd bit is sign */ | 187 | /* bound gain by 2 bits value max, 3rd bit is sign */ |
185 | data->delta_gain_code[i] = | 188 | data->delta_gain_code[i] = |
186 | min(abs(delta_g), (long) CHAIN_NOISE_MAX_DELTA_GAIN_CODE); | 189 | min(abs(delta_g), (long) CHAIN_NOISE_MAX_DELTA_GAIN_CODE); |
187 | 190 | ||
188 | if (delta_g < 0) | 191 | if (delta_g < 0) |
189 | /* set negative sign */ | 192 | /* |
193 | * set negative sign ... | ||
194 | * note to Intel developers: This is uCode API format, | ||
195 | * not the format of any internal device registers. | ||
196 | * Do not change this format for e.g. 6050 or similar | ||
197 | * devices. Change format only if more resolution | ||
198 | * (i.e. more than 2 bits magnitude) is needed. | ||
199 | */ | ||
190 | data->delta_gain_code[i] |= (1 << 2); | 200 | data->delta_gain_code[i] |= (1 << 2); |
191 | } | 201 | } |
192 | 202 | ||
@@ -1587,6 +1597,7 @@ struct iwl_cfg iwl5300_agn_cfg = { | |||
1587 | .use_rts_for_ht = true, /* use rts/cts protection */ | 1597 | .use_rts_for_ht = true, /* use rts/cts protection */ |
1588 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1598 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
1589 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 1599 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
1600 | .chain_noise_scale = 1000, | ||
1590 | }; | 1601 | }; |
1591 | 1602 | ||
1592 | struct iwl_cfg iwl5100_bgn_cfg = { | 1603 | struct iwl_cfg iwl5100_bgn_cfg = { |
@@ -1612,6 +1623,7 @@ struct iwl_cfg iwl5100_bgn_cfg = { | |||
1612 | .use_rts_for_ht = true, /* use rts/cts protection */ | 1623 | .use_rts_for_ht = true, /* use rts/cts protection */ |
1613 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1624 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
1614 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 1625 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
1626 | .chain_noise_scale = 1000, | ||
1615 | }; | 1627 | }; |
1616 | 1628 | ||
1617 | struct iwl_cfg iwl5100_abg_cfg = { | 1629 | struct iwl_cfg iwl5100_abg_cfg = { |
@@ -1635,6 +1647,7 @@ struct iwl_cfg iwl5100_abg_cfg = { | |||
1635 | .led_compensation = 51, | 1647 | .led_compensation = 51, |
1636 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1648 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
1637 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 1649 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
1650 | .chain_noise_scale = 1000, | ||
1638 | }; | 1651 | }; |
1639 | 1652 | ||
1640 | struct iwl_cfg iwl5100_agn_cfg = { | 1653 | struct iwl_cfg iwl5100_agn_cfg = { |
@@ -1660,6 +1673,7 @@ struct iwl_cfg iwl5100_agn_cfg = { | |||
1660 | .use_rts_for_ht = true, /* use rts/cts protection */ | 1673 | .use_rts_for_ht = true, /* use rts/cts protection */ |
1661 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1674 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
1662 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 1675 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
1676 | .chain_noise_scale = 1000, | ||
1663 | }; | 1677 | }; |
1664 | 1678 | ||
1665 | struct iwl_cfg iwl5350_agn_cfg = { | 1679 | struct iwl_cfg iwl5350_agn_cfg = { |
@@ -1685,6 +1699,7 @@ struct iwl_cfg iwl5350_agn_cfg = { | |||
1685 | .use_rts_for_ht = true, /* use rts/cts protection */ | 1699 | .use_rts_for_ht = true, /* use rts/cts protection */ |
1686 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1700 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
1687 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 1701 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
1702 | .chain_noise_scale = 1000, | ||
1688 | }; | 1703 | }; |
1689 | 1704 | ||
1690 | struct iwl_cfg iwl5150_agn_cfg = { | 1705 | struct iwl_cfg iwl5150_agn_cfg = { |
@@ -1710,6 +1725,7 @@ struct iwl_cfg iwl5150_agn_cfg = { | |||
1710 | .use_rts_for_ht = true, /* use rts/cts protection */ | 1725 | .use_rts_for_ht = true, /* use rts/cts protection */ |
1711 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1726 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
1712 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 1727 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
1728 | .chain_noise_scale = 1000, | ||
1713 | }; | 1729 | }; |
1714 | 1730 | ||
1715 | struct iwl_cfg iwl5150_abg_cfg = { | 1731 | struct iwl_cfg iwl5150_abg_cfg = { |
@@ -1733,6 +1749,7 @@ struct iwl_cfg iwl5150_abg_cfg = { | |||
1733 | .led_compensation = 51, | 1749 | .led_compensation = 51, |
1734 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1750 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
1735 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 1751 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
1752 | .chain_noise_scale = 1000, | ||
1736 | }; | 1753 | }; |
1737 | 1754 | ||
1738 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); | 1755 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); |