aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-10-07 21:37:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:02 -0400
commitbe5d56ed885a2897ec813eab4a8055d495816e9a (patch)
tree26cada5850d10ec41b912f66f33130727e866a33 /drivers/net/wireless/iwlwifi/iwl-5000.c
parent1397dcebd8f1d66528e8f86b0dfb603281558f79 (diff)
iwlwifi: make initial calibration set configurable
This patch adds ability to configure initial calibration set. Not all HW supported by iwlwifi use the same calibration set, XTAL is one example. Some clean ups are also included in this patch. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 5155b8a760a7..c1300fb71615 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -429,20 +429,19 @@ static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
429/* 429/*
430 * Calibration 430 * Calibration
431 */ 431 */
432static int iwl5000_send_Xtal_calib(struct iwl_priv *priv) 432static int iwl5000_set_Xtal_calib(struct iwl_priv *priv)
433{ 433{
434 u8 data[sizeof(struct iwl5000_calib_hdr) +
435 sizeof(struct iwl_cal_xtal_freq)];
436 struct iwl5000_calib_cmd *cmd = (struct iwl5000_calib_cmd *)data;
437 struct iwl_cal_xtal_freq *xtal = (struct iwl_cal_xtal_freq *)cmd->data;
434 u16 *xtal_calib = (u16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_XTAL); 438 u16 *xtal_calib = (u16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_XTAL);
435 439
436 struct iwl5000_calibration cal_cmd = { 440 cmd->hdr.op_code = IWL5000_PHY_CALIBRATE_CRYSTAL_FRQ_CMD;
437 .op_code = IWL5000_PHY_CALIBRATE_CRYSTAL_FRQ_CMD, 441 xtal->cap_pin1 = (u8)xtal_calib[0];
438 .data = { 442 xtal->cap_pin2 = (u8)xtal_calib[1];
439 (u8)xtal_calib[0], 443 return iwl_calib_set(&priv->calib_results[IWL5000_CALIB_XTAL],
440 (u8)xtal_calib[1], 444 data, sizeof(data));
441 }
442 };
443
444 return iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
445 sizeof(cal_cmd), &cal_cmd);
446} 445}
447 446
448static int iwl5000_send_calib_cfg(struct iwl_priv *priv) 447static int iwl5000_send_calib_cfg(struct iwl_priv *priv)
@@ -784,10 +783,8 @@ static int iwl5000_alive_notify(struct iwl_priv *priv)
784 783
785 iwl5000_send_wimax_coex(priv); 784 iwl5000_send_wimax_coex(priv);
786 785
787 iwl5000_send_Xtal_calib(priv); 786 iwl5000_set_Xtal_calib(priv);
788 787 iwl_send_calib_results(priv);
789 if (priv->ucode_type == UCODE_RT)
790 iwl_send_calib_results(priv);
791 788
792 return 0; 789 return 0;
793} 790}
@@ -844,6 +841,23 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
844 break; 841 break;
845 } 842 }
846 843
844 /* Set initial calibration set */
845 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
846 case CSR_HW_REV_TYPE_5100:
847 case CSR_HW_REV_TYPE_5300:
848 case CSR_HW_REV_TYPE_5350:
849 priv->hw_params.calib_init_cfg =
850 BIT(IWL5000_CALIB_XTAL) |
851 BIT(IWL5000_CALIB_LO) |
852 BIT(IWL5000_CALIB_TX_IQ) |
853 BIT(IWL5000_CALIB_TX_IQ_PERD);
854 break;
855 case CSR_HW_REV_TYPE_5150:
856 priv->hw_params.calib_init_cfg = 0;
857 break;
858 }
859
860
847 return 0; 861 return 0;
848} 862}
849 863