iwlwifi: issue ct_kill host command based on device config
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 23 Oct 2009 20:42:28 +0000 (13:42 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:50:01 +0000 (16:50 -0400)
Using device configuration structure to decide how to configure
ct_kill host command.

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>
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-core.h

index 3da5913225e2489ae33fad950e9e896dac8f3bfa..3a645e485dda1224041fa35f76d653088c695ef7 100644 (file)
@@ -171,6 +171,7 @@ struct iwl_cfg iwl1000_bgn_cfg = {
        .ht_greenfield_support = true,
        .led_compensation = 51,
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl1000_bg_cfg = {
@@ -196,6 +197,7 @@ struct iwl_cfg iwl1000_bg_cfg = {
        .ht_greenfield_support = true,
        .led_compensation = 51,
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
+       .support_ct_kill_exit = true,
 };
 
 MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));
index 0873322755aa392a3701ff9e94f8684a841c0fc9..f5855293c767fe7a75b9884ca62000c669e8ed56 100644 (file)
@@ -278,6 +278,7 @@ struct iwl_cfg iwl6000h_2agn_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl6000h_2abg_cfg = {
@@ -306,6 +307,7 @@ struct iwl_cfg iwl6000h_2abg_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl6000h_2bg_cfg = {
@@ -334,6 +336,7 @@ struct iwl_cfg iwl6000h_2bg_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 /*
@@ -366,6 +369,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl6000i_2abg_cfg = {
@@ -394,6 +398,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl6000i_2bg_cfg = {
@@ -422,6 +427,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl6050_2agn_cfg = {
@@ -451,6 +457,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl6050_2abg_cfg = {
@@ -479,6 +486,7 @@ struct iwl_cfg iwl6050_2abg_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl6000_3agn_cfg = {
@@ -508,6 +516,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 struct iwl_cfg iwl6050_3agn_cfg = {
@@ -537,6 +546,7 @@ struct iwl_cfg iwl6050_3agn_cfg = {
        .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
        .supports_idle = true,
        .adv_thermal_throttle = true,
+       .support_ct_kill_exit = true,
 };
 
 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
index 77b9825f79ba717ad3a97e8bed76203bb2a7e963..e43469cfbbc087c93b68f6da163f8bf2d82ad7e3 100644 (file)
@@ -2165,10 +2165,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
        spin_unlock_irqrestore(&priv->lock, flags);
        priv->thermal_throttle.ct_kill_toggle = false;
 
-       switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
-       case CSR_HW_REV_TYPE_1000:
-       case CSR_HW_REV_TYPE_6x00:
-       case CSR_HW_REV_TYPE_6x50:
+       if (priv->cfg->support_ct_kill_exit) {
                adv_cmd.critical_temperature_enter =
                        cpu_to_le32(priv->hw_params.ct_kill_threshold);
                adv_cmd.critical_temperature_exit =
@@ -2185,8 +2182,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
                                        "exit is %d\n",
                                       priv->hw_params.ct_kill_threshold,
                                       priv->hw_params.ct_kill_exit_threshold);
-               break;
-       default:
+       } else {
                cmd.critical_temperature_R =
                        cpu_to_le32(priv->hw_params.ct_kill_threshold);
 
@@ -2199,7 +2195,6 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
                                        "succeeded, "
                                        "critical temperature is %d\n",
                                        priv->hw_params.ct_kill_threshold);
-               break;
        }
 }
 EXPORT_SYMBOL(iwl_rf_kill_ct_config);
index 9dbf59811f456406621c9ee502546e81e222bf88..02bacc4975f004bd46c025bf61c5d1e63e0e2cf2 100644 (file)
@@ -226,6 +226,7 @@ struct iwl_mod_params {
  * @use_rts_for_ht: use rts/cts protection for HT traffic
  * @chain_noise_num_beacons: number of beacons used to compute chain noise
  * @adv_thermal_throttle: support advance thermal throttle
+ * @support_ct_kill_exit: support ct kill exit condition
  *
  * We enable the driver to be backward compatible wrt API version. The
  * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -280,6 +281,7 @@ struct iwl_cfg {
        int chain_noise_num_beacons;
        const bool supports_idle;
        bool adv_thermal_throttle;
+       bool support_ct_kill_exit;
 };
 
 /***************************