aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShanyu Zhao <shanyu.zhao@intel.com>2010-09-14 21:13:31 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-09-28 19:57:06 -0400
commit6d6a1afdc591e3f3ee66c39206923def43044ab6 (patch)
tree82246979540a799303e417ba117eeae06e066bb5
parent02796d77cb4cfb64b9465eabbdb13b3b7d1679e9 (diff)
iwlwifi: send DC calib config to runtime ucode
Since uCode is responsible for doing DC calibration, there's no need to let init uCode to do initial DC calibration then send results back to driver, then driver sends the results to runtime uCode. Driver can simply tell runtime uCode to do DC calibration. Actually, this patch does not disable DC calib for init uCode. It just prevent driver from saving and sending the DC calib results (from init ucode) to runtime uCode. The driver still uses 0xffffffff in CALIB_CFG_CMD for init ucode. Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h2
4 files changed, 41 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 83a5262d8bd..51444c8e69a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -199,7 +199,7 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
199 BIT(IWL_CALIB_TX_IQ) | 199 BIT(IWL_CALIB_TX_IQ) |
200 BIT(IWL_CALIB_BASE_BAND); 200 BIT(IWL_CALIB_BASE_BAND);
201 if (priv->cfg->need_dc_calib) 201 if (priv->cfg->need_dc_calib)
202 priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_DC); 202 priv->hw_params.calib_rt_cfg |= BIT(IWL_CALIB_CFG_DC_IDX);
203 203
204 priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS; 204 priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
205 205
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 005b07bea1e..e23c554b73a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2765,6 +2765,25 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
2765 } 2765 }
2766} 2766}
2767 2767
2768static int iwlagn_send_calib_cfg_rt(struct iwl_priv *priv, u32 cfg)
2769{
2770 struct iwl_calib_cfg_cmd calib_cfg_cmd;
2771 struct iwl_host_cmd cmd = {
2772 .id = CALIBRATION_CFG_CMD,
2773 .len = sizeof(struct iwl_calib_cfg_cmd),
2774 .data = &calib_cfg_cmd,
2775 };
2776
2777 memset(&calib_cfg_cmd, 0, sizeof(calib_cfg_cmd));
2778 calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL;
2779 calib_cfg_cmd.ucd_calib_cfg.once.start = cfg;
2780 calib_cfg_cmd.ucd_calib_cfg.once.send_res = 0;
2781 calib_cfg_cmd.ucd_calib_cfg.flags = 0;
2782
2783 return iwl_send_cmd(priv, &cmd);
2784}
2785
2786
2768/** 2787/**
2769 * iwl_alive_start - called after REPLY_ALIVE notification received 2788 * iwl_alive_start - called after REPLY_ALIVE notification received
2770 * from protocol/runtime uCode (initialization uCode's 2789 * from protocol/runtime uCode (initialization uCode's
@@ -2801,6 +2820,10 @@ static void iwl_alive_start(struct iwl_priv *priv)
2801 goto restart; 2820 goto restart;
2802 } 2821 }
2803 2822
2823 if (priv->hw_params.calib_rt_cfg)
2824 iwlagn_send_calib_cfg_rt(priv, priv->hw_params.calib_rt_cfg);
2825
2826
2804 /* After the ALIVE response, we can send host commands to the uCode */ 2827 /* After the ALIVE response, we can send host commands to the uCode */
2805 set_bit(STATUS_ALIVE, &priv->status); 2828 set_bit(STATUS_ALIVE, &priv->status);
2806 2829
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 27e250c8d4b..27350eebb13 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -3800,6 +3800,21 @@ enum {
3800 3800
3801#define IWL_CALIB_INIT_CFG_ALL cpu_to_le32(0xffffffff) 3801#define IWL_CALIB_INIT_CFG_ALL cpu_to_le32(0xffffffff)
3802 3802
3803/* This enum defines the bitmap of various calibrations to enable in both
3804 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
3805 */
3806enum iwl_ucode_calib_cfg {
3807 IWL_CALIB_CFG_RX_BB_IDX,
3808 IWL_CALIB_CFG_DC_IDX,
3809 IWL_CALIB_CFG_TX_IQ_IDX,
3810 IWL_CALIB_CFG_RX_IQ_IDX,
3811 IWL_CALIB_CFG_NOISE_IDX,
3812 IWL_CALIB_CFG_CRYSTAL_IDX,
3813 IWL_CALIB_CFG_TEMPERATURE_IDX,
3814 IWL_CALIB_CFG_PAPD_IDX,
3815};
3816
3817
3803struct iwl_calib_cfg_elmnt_s { 3818struct iwl_calib_cfg_elmnt_s {
3804 __le32 is_enable; 3819 __le32 is_enable;
3805 __le32 start; 3820 __le32 start;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 74d25bcbfcb..90a37a94c69 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -684,6 +684,7 @@ struct iwl_sensitivity_ranges {
684 * @ct_kill_threshold: temperature threshold 684 * @ct_kill_threshold: temperature threshold
685 * @beacon_time_tsf_bits: number of valid tsf bits for beacon time 685 * @beacon_time_tsf_bits: number of valid tsf bits for beacon time
686 * @calib_init_cfg: setup initial calibrations for the hw 686 * @calib_init_cfg: setup initial calibrations for the hw
687 * @calib_rt_cfg: setup runtime calibrations for the hw
687 * @struct iwl_sensitivity_ranges: range of sensitivity values 688 * @struct iwl_sensitivity_ranges: range of sensitivity values
688 */ 689 */
689struct iwl_hw_params { 690struct iwl_hw_params {
@@ -710,6 +711,7 @@ struct iwl_hw_params {
710 /* for 1000, 6000 series and up */ 711 /* for 1000, 6000 series and up */
711 u16 beacon_time_tsf_bits; 712 u16 beacon_time_tsf_bits;
712 u32 calib_init_cfg; 713 u32 calib_init_cfg;
714 u32 calib_rt_cfg;
713 const struct iwl_sensitivity_ranges *sens; 715 const struct iwl_sensitivity_ranges *sens;
714}; 716};
715 717