diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-07-24 14:13:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-27 15:24:20 -0400 |
commit | 39b73fb15e4704fd4d1e33688135810637f5f3fb (patch) | |
tree | d0efed58f5a52ccdc19d8f133aa64af7a0691e70 /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | 672639de13c4db92ed6a47e68043a4317e219902 (diff) |
iwlwifi: Thermal Throttling Management - Part 1
Part 1 of Thermal Throttling Management -
Thermal Throttling feature is used to put NIC into low power state when
driver detect the Radio temperature reach pre-defined threshold
Two Thermal Throttling Management Methods; this patch introduce the
Legacy Thermal Management:
IWL_TI_0: normal temperature, system power state
IWL_TI_1: high temperature detect, low power state
IWL_TI_2: higher temperature detected, lower power state
IWL_TI_CT_KILL: critical temperature detected, lowest power state
Once get into CT_KILL state, uCode go into sleep, driver will stop all
the active queues, then move to IWL_TI_CT_KILL state; also set up 5
seconds timer to toggle CSR flag, uCode wake up upon CSR flag change,
then measure the temperature.
If temperature is above CT_KILL exit threshold, uCode go backto sleep;
if temperature is below CT_KILL exit threshold, uCode send Card State
Notification response with appropriate CT_KILL status flag, and uCode
remain awake, Driver receive Card State Notification Response and update
the card temperature to the CT_KILL exit threshold.
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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 44c7f236a7a3..23ae9914c84b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -637,7 +637,6 @@ static void iwl_rx_card_state_notif(struct iwl_priv *priv, | |||
637 | struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; | 637 | struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; |
638 | u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags); | 638 | u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags); |
639 | unsigned long status = priv->status; | 639 | unsigned long status = priv->status; |
640 | unsigned long reg_flags; | ||
641 | 640 | ||
642 | IWL_DEBUG_RF_KILL(priv, "Card state received: HW:%s SW:%s\n", | 641 | IWL_DEBUG_RF_KILL(priv, "Card state received: HW:%s SW:%s\n", |
643 | (flags & HW_CARD_DISABLED) ? "Kill" : "On", | 642 | (flags & HW_CARD_DISABLED) ? "Kill" : "On", |
@@ -657,19 +656,12 @@ static void iwl_rx_card_state_notif(struct iwl_priv *priv, | |||
657 | CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); | 656 | CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); |
658 | iwl_write_direct32(priv, HBUS_TARG_MBX_C, | 657 | iwl_write_direct32(priv, HBUS_TARG_MBX_C, |
659 | HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED); | 658 | HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED); |
660 | |||
661 | } | ||
662 | |||
663 | if (flags & RF_CARD_DISABLED) { | ||
664 | iwl_write32(priv, CSR_UCODE_DRV_GP1_SET, | ||
665 | CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); | ||
666 | iwl_read32(priv, CSR_UCODE_DRV_GP1); | ||
667 | spin_lock_irqsave(&priv->reg_lock, reg_flags); | ||
668 | if (!iwl_grab_nic_access(priv)) | ||
669 | iwl_release_nic_access(priv); | ||
670 | spin_unlock_irqrestore(&priv->reg_lock, reg_flags); | ||
671 | } | 659 | } |
660 | if (flags & RF_CARD_DISABLED) | ||
661 | iwl_tt_enter_ct_kill(priv); | ||
672 | } | 662 | } |
663 | if (!(flags & RF_CARD_DISABLED)) | ||
664 | iwl_tt_exit_ct_kill(priv); | ||
673 | 665 | ||
674 | if (flags & HW_CARD_DISABLED) | 666 | if (flags & HW_CARD_DISABLED) |
675 | set_bit(STATUS_RF_KILL_HW, &priv->status); | 667 | set_bit(STATUS_RF_KILL_HW, &priv->status); |
@@ -3015,6 +3007,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3015 | test_bit(STATUS_RF_KILL_HW, &priv->status)); | 3007 | test_bit(STATUS_RF_KILL_HW, &priv->status)); |
3016 | 3008 | ||
3017 | iwl_power_initialize(priv); | 3009 | iwl_power_initialize(priv); |
3010 | iwl_tt_initialize(priv); | ||
3018 | return 0; | 3011 | return 0; |
3019 | 3012 | ||
3020 | out_remove_sysfs: | 3013 | out_remove_sysfs: |
@@ -3067,6 +3060,8 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev) | |||
3067 | iwl_down(priv); | 3060 | iwl_down(priv); |
3068 | } | 3061 | } |
3069 | 3062 | ||
3063 | iwl_tt_exit(priv); | ||
3064 | |||
3070 | /* make sure we flush any pending irq or | 3065 | /* make sure we flush any pending irq or |
3071 | * tasklet for the driver | 3066 | * tasklet for the driver |
3072 | */ | 3067 | */ |