diff options
author | Ben Cahill <ben.m.cahill@intel.com> | 2010-02-05 14:33:46 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-08 16:50:58 -0500 |
commit | d4fe5ac9e04e6e175a7bd7e29844b351533be591 (patch) | |
tree | bb29b50196723739ffd77096f7e6215358127777 /drivers | |
parent | 19885c4fbd79439efd6b3798bfb73f2f30e27104 (diff) |
iwlwifi: Add chain noise scaling factor
6x50 device requires a different scaling factor for Rx gain values sent to
device via PHY_CALIBRATION_CMD (CHAIN_NOISE_GAIN_CMD). Rather than create
a new iwlXXXX_gain_computation() function, add new chain_noise_scale member
to struct iwl_cfg, and keep using iwl5000_gain_computation().
Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-1000.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 |
4 files changed, 28 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 9d1820676f30..694ceef88590 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -247,6 +247,7 @@ struct iwl_cfg iwl1000_bgn_cfg = { | |||
247 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 247 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
248 | .support_ct_kill_exit = true, | 248 | .support_ct_kill_exit = true, |
249 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 249 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
250 | .chain_noise_scale = 1000, | ||
250 | }; | 251 | }; |
251 | 252 | ||
252 | struct iwl_cfg iwl1000_bg_cfg = { | 253 | struct iwl_cfg iwl1000_bg_cfg = { |
@@ -274,6 +275,7 @@ struct iwl_cfg iwl1000_bg_cfg = { | |||
274 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 275 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
275 | .support_ct_kill_exit = true, | 276 | .support_ct_kill_exit = true, |
276 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 277 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
278 | .chain_noise_scale = 1000, | ||
277 | }; | 279 | }; |
278 | 280 | ||
279 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); | 281 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 6d5988901341..f3d662c8cbcf 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)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index a9f8551e0e40..17198253b0bc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -324,6 +324,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = { | |||
324 | .adv_thermal_throttle = true, | 324 | .adv_thermal_throttle = true, |
325 | .support_ct_kill_exit = true, | 325 | .support_ct_kill_exit = true, |
326 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 326 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
327 | .chain_noise_scale = 1000, | ||
327 | }; | 328 | }; |
328 | 329 | ||
329 | struct iwl_cfg iwl6000i_2abg_cfg = { | 330 | struct iwl_cfg iwl6000i_2abg_cfg = { |
@@ -354,6 +355,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = { | |||
354 | .adv_thermal_throttle = true, | 355 | .adv_thermal_throttle = true, |
355 | .support_ct_kill_exit = true, | 356 | .support_ct_kill_exit = true, |
356 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 357 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
358 | .chain_noise_scale = 1000, | ||
357 | }; | 359 | }; |
358 | 360 | ||
359 | struct iwl_cfg iwl6000i_2bg_cfg = { | 361 | struct iwl_cfg iwl6000i_2bg_cfg = { |
@@ -384,6 +386,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = { | |||
384 | .adv_thermal_throttle = true, | 386 | .adv_thermal_throttle = true, |
385 | .support_ct_kill_exit = true, | 387 | .support_ct_kill_exit = true, |
386 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 388 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
389 | .chain_noise_scale = 1000, | ||
387 | }; | 390 | }; |
388 | 391 | ||
389 | struct iwl_cfg iwl6050_2agn_cfg = { | 392 | struct iwl_cfg iwl6050_2agn_cfg = { |
@@ -415,6 +418,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
415 | .adv_thermal_throttle = true, | 418 | .adv_thermal_throttle = true, |
416 | .support_ct_kill_exit = true, | 419 | .support_ct_kill_exit = true, |
417 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 420 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
421 | .chain_noise_scale = 1500, | ||
418 | }; | 422 | }; |
419 | 423 | ||
420 | struct iwl_cfg iwl6050_2abg_cfg = { | 424 | struct iwl_cfg iwl6050_2abg_cfg = { |
@@ -445,6 +449,7 @@ struct iwl_cfg iwl6050_2abg_cfg = { | |||
445 | .adv_thermal_throttle = true, | 449 | .adv_thermal_throttle = true, |
446 | .support_ct_kill_exit = true, | 450 | .support_ct_kill_exit = true, |
447 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 451 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
452 | .chain_noise_scale = 1500, | ||
448 | }; | 453 | }; |
449 | 454 | ||
450 | struct iwl_cfg iwl6000_3agn_cfg = { | 455 | struct iwl_cfg iwl6000_3agn_cfg = { |
@@ -476,6 +481,7 @@ struct iwl_cfg iwl6000_3agn_cfg = { | |||
476 | .adv_thermal_throttle = true, | 481 | .adv_thermal_throttle = true, |
477 | .support_ct_kill_exit = true, | 482 | .support_ct_kill_exit = true, |
478 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 483 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
484 | .chain_noise_scale = 1000, | ||
479 | }; | 485 | }; |
480 | 486 | ||
481 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); | 487 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index ec1fe1d7cc9a..49795b90246d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -293,6 +293,7 @@ struct iwl_cfg { | |||
293 | bool support_ct_kill_exit; | 293 | bool support_ct_kill_exit; |
294 | const bool support_wimax_coexist; | 294 | const bool support_wimax_coexist; |
295 | u8 plcp_delta_threshold; | 295 | u8 plcp_delta_threshold; |
296 | s32 chain_noise_scale; | ||
296 | }; | 297 | }; |
297 | 298 | ||
298 | /*************************** | 299 | /*************************** |