diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-10-23 16:42:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:50:01 -0400 |
commit | 6047b4f939682ae9bf839fd00c80029cb8f073bb (patch) | |
tree | f5a45950526929e0fab6f1be46657964e943a1f6 | |
parent | c8c24872c6a90ef0298491a1c14326861ab74cab (diff) |
iwlwifi: choose thermal throttle method based on device config
Using device configuration structure to decide the type of thermal
throttle method for the device.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 8 |
3 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 5211872da880..0873322755aa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -277,6 +277,7 @@ struct iwl_cfg iwl6000h_2agn_cfg = { | |||
277 | .use_rts_for_ht = true, /* use rts/cts protection */ | 277 | .use_rts_for_ht = true, /* use rts/cts protection */ |
278 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 278 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
279 | .supports_idle = true, | 279 | .supports_idle = true, |
280 | .adv_thermal_throttle = true, | ||
280 | }; | 281 | }; |
281 | 282 | ||
282 | struct iwl_cfg iwl6000h_2abg_cfg = { | 283 | struct iwl_cfg iwl6000h_2abg_cfg = { |
@@ -304,6 +305,7 @@ struct iwl_cfg iwl6000h_2abg_cfg = { | |||
304 | .led_compensation = 51, | 305 | .led_compensation = 51, |
305 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 306 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
306 | .supports_idle = true, | 307 | .supports_idle = true, |
308 | .adv_thermal_throttle = true, | ||
307 | }; | 309 | }; |
308 | 310 | ||
309 | struct iwl_cfg iwl6000h_2bg_cfg = { | 311 | struct iwl_cfg iwl6000h_2bg_cfg = { |
@@ -331,6 +333,7 @@ struct iwl_cfg iwl6000h_2bg_cfg = { | |||
331 | .led_compensation = 51, | 333 | .led_compensation = 51, |
332 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 334 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
333 | .supports_idle = true, | 335 | .supports_idle = true, |
336 | .adv_thermal_throttle = true, | ||
334 | }; | 337 | }; |
335 | 338 | ||
336 | /* | 339 | /* |
@@ -362,6 +365,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = { | |||
362 | .use_rts_for_ht = true, /* use rts/cts protection */ | 365 | .use_rts_for_ht = true, /* use rts/cts protection */ |
363 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 366 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
364 | .supports_idle = true, | 367 | .supports_idle = true, |
368 | .adv_thermal_throttle = true, | ||
365 | }; | 369 | }; |
366 | 370 | ||
367 | struct iwl_cfg iwl6000i_2abg_cfg = { | 371 | struct iwl_cfg iwl6000i_2abg_cfg = { |
@@ -389,6 +393,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = { | |||
389 | .led_compensation = 51, | 393 | .led_compensation = 51, |
390 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 394 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
391 | .supports_idle = true, | 395 | .supports_idle = true, |
396 | .adv_thermal_throttle = true, | ||
392 | }; | 397 | }; |
393 | 398 | ||
394 | struct iwl_cfg iwl6000i_2bg_cfg = { | 399 | struct iwl_cfg iwl6000i_2bg_cfg = { |
@@ -416,6 +421,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = { | |||
416 | .led_compensation = 51, | 421 | .led_compensation = 51, |
417 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 422 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
418 | .supports_idle = true, | 423 | .supports_idle = true, |
424 | .adv_thermal_throttle = true, | ||
419 | }; | 425 | }; |
420 | 426 | ||
421 | struct iwl_cfg iwl6050_2agn_cfg = { | 427 | struct iwl_cfg iwl6050_2agn_cfg = { |
@@ -444,6 +450,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
444 | .use_rts_for_ht = true, /* use rts/cts protection */ | 450 | .use_rts_for_ht = true, /* use rts/cts protection */ |
445 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 451 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
446 | .supports_idle = true, | 452 | .supports_idle = true, |
453 | .adv_thermal_throttle = true, | ||
447 | }; | 454 | }; |
448 | 455 | ||
449 | struct iwl_cfg iwl6050_2abg_cfg = { | 456 | struct iwl_cfg iwl6050_2abg_cfg = { |
@@ -471,6 +478,7 @@ struct iwl_cfg iwl6050_2abg_cfg = { | |||
471 | .led_compensation = 51, | 478 | .led_compensation = 51, |
472 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 479 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
473 | .supports_idle = true, | 480 | .supports_idle = true, |
481 | .adv_thermal_throttle = true, | ||
474 | }; | 482 | }; |
475 | 483 | ||
476 | struct iwl_cfg iwl6000_3agn_cfg = { | 484 | struct iwl_cfg iwl6000_3agn_cfg = { |
@@ -499,6 +507,7 @@ struct iwl_cfg iwl6000_3agn_cfg = { | |||
499 | .use_rts_for_ht = true, /* use rts/cts protection */ | 507 | .use_rts_for_ht = true, /* use rts/cts protection */ |
500 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 508 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
501 | .supports_idle = true, | 509 | .supports_idle = true, |
510 | .adv_thermal_throttle = true, | ||
502 | }; | 511 | }; |
503 | 512 | ||
504 | struct iwl_cfg iwl6050_3agn_cfg = { | 513 | struct iwl_cfg iwl6050_3agn_cfg = { |
@@ -527,6 +536,7 @@ struct iwl_cfg iwl6050_3agn_cfg = { | |||
527 | .use_rts_for_ht = true, /* use rts/cts protection */ | 536 | .use_rts_for_ht = true, /* use rts/cts protection */ |
528 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 537 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
529 | .supports_idle = true, | 538 | .supports_idle = true, |
539 | .adv_thermal_throttle = true, | ||
530 | }; | 540 | }; |
531 | 541 | ||
532 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); | 542 | 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 a2d526a7b4ce..9dbf59811f45 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -225,6 +225,7 @@ struct iwl_mod_params { | |||
225 | * The detail algorithm is described in iwl-led.c | 225 | * The detail algorithm is described in iwl-led.c |
226 | * @use_rts_for_ht: use rts/cts protection for HT traffic | 226 | * @use_rts_for_ht: use rts/cts protection for HT traffic |
227 | * @chain_noise_num_beacons: number of beacons used to compute chain noise | 227 | * @chain_noise_num_beacons: number of beacons used to compute chain noise |
228 | * @adv_thermal_throttle: support advance thermal throttle | ||
228 | * | 229 | * |
229 | * We enable the driver to be backward compatible wrt API version. The | 230 | * We enable the driver to be backward compatible wrt API version. The |
230 | * driver specifies which APIs it supports (with @ucode_api_max being the | 231 | * driver specifies which APIs it supports (with @ucode_api_max being the |
@@ -278,6 +279,7 @@ struct iwl_cfg { | |||
278 | bool use_rts_for_ht; | 279 | bool use_rts_for_ht; |
279 | int chain_noise_num_beacons; | 280 | int chain_noise_num_beacons; |
280 | const bool supports_idle; | 281 | const bool supports_idle; |
282 | bool adv_thermal_throttle; | ||
281 | }; | 283 | }; |
282 | 284 | ||
283 | /*************************** | 285 | /*************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 150ff87af33b..432f4650cf2e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -893,9 +893,7 @@ void iwl_tt_initialize(struct iwl_priv *priv) | |||
893 | INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter); | 893 | INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter); |
894 | INIT_WORK(&priv->ct_exit, iwl_bg_ct_exit); | 894 | INIT_WORK(&priv->ct_exit, iwl_bg_ct_exit); |
895 | 895 | ||
896 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { | 896 | if (priv->cfg->adv_thermal_throttle) { |
897 | case CSR_HW_REV_TYPE_6x00: | ||
898 | case CSR_HW_REV_TYPE_6x50: | ||
899 | IWL_DEBUG_POWER(priv, "Advanced Thermal Throttling\n"); | 897 | IWL_DEBUG_POWER(priv, "Advanced Thermal Throttling\n"); |
900 | tt->restriction = kzalloc(sizeof(struct iwl_tt_restriction) * | 898 | tt->restriction = kzalloc(sizeof(struct iwl_tt_restriction) * |
901 | IWL_TI_STATE_MAX, GFP_KERNEL); | 899 | IWL_TI_STATE_MAX, GFP_KERNEL); |
@@ -928,11 +926,9 @@ void iwl_tt_initialize(struct iwl_priv *priv) | |||
928 | &restriction_range[0], size); | 926 | &restriction_range[0], size); |
929 | priv->thermal_throttle.advanced_tt = true; | 927 | priv->thermal_throttle.advanced_tt = true; |
930 | } | 928 | } |
931 | break; | 929 | } else { |
932 | default: | ||
933 | IWL_DEBUG_POWER(priv, "Legacy Thermal Throttling\n"); | 930 | IWL_DEBUG_POWER(priv, "Legacy Thermal Throttling\n"); |
934 | priv->thermal_throttle.advanced_tt = false; | 931 | priv->thermal_throttle.advanced_tt = false; |
935 | break; | ||
936 | } | 932 | } |
937 | } | 933 | } |
938 | EXPORT_SYMBOL(iwl_tt_initialize); | 934 | EXPORT_SYMBOL(iwl_tt_initialize); |