Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c27bdc84 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

iwlagn: remove calibration knowledge



The init microcode knows very well which calibrations
are required and sends us results for those that are.
Consequently, we can just send all of those to the RT
uCode again.

The problem with having the driver know about this is
that it is a uCode feature, not a hardware feature so
the config is completely unsuitable.

The only thing we need to check is whether the device
needs crystal calibration or not, add a new parameter
to the configuration for that.

This makes new uCode work on 6000 series devices.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent aed666e5
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -147,16 +147,7 @@ static int iwl1000_hw_set_hw_params(struct iwl_priv *priv)
	iwl1000_set_ct_threshold(priv);

	/* Set initial sensitivity parameters */
	/* Set initial calibration set */
	hw_params(priv).sens = &iwl1000_sensitivity;
	hw_params(priv).calib_init_cfg =
			BIT(IWL_CALIB_XTAL)		|
			BIT(IWL_CALIB_LO)		|
			BIT(IWL_CALIB_TX_IQ) 		|
			BIT(IWL_CALIB_TX_IQ_PERD)	|
			BIT(IWL_CALIB_BASE_BAND);
	if (priv->cfg->need_dc_calib)
		hw_params(priv).calib_init_cfg |= BIT(IWL_CALIB_DC);

	return 0;
}
+0 −14
Original line number Diff line number Diff line
@@ -143,17 +143,7 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv)
	iwl2000_set_ct_threshold(priv);

	/* Set initial sensitivity parameters */
	/* Set initial calibration set */
	hw_params(priv).sens = &iwl2000_sensitivity;
	hw_params(priv).calib_init_cfg =
		BIT(IWL_CALIB_XTAL)             |
		BIT(IWL_CALIB_LO)               |
		BIT(IWL_CALIB_TX_IQ)            |
		BIT(IWL_CALIB_BASE_BAND);
	if (priv->cfg->need_dc_calib)
		hw_params(priv).calib_rt_cfg |= IWL_CALIB_CFG_DC_IDX;
	if (priv->cfg->need_temp_offset_calib)
		hw_params(priv).calib_init_cfg |= BIT(IWL_CALIB_TEMP_OFFSET);

	return 0;
}
@@ -258,7 +248,6 @@ static struct iwl_bt_params iwl2030_bt_params = {
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.lib = &iwl2000_lib,					\
	.base_params = &iwl2000_base_params,			\
	.need_dc_calib = true,					\
	.need_temp_offset_calib = true,				\
	.temp_offset_v2 = true,					\
	.led_mode = IWL_LED_RF_STATE,				\
@@ -286,7 +275,6 @@ struct iwl_cfg iwl2000_2bgn_d_cfg = {
	.lib = &iwl2030_lib,					\
	.base_params = &iwl2030_base_params,			\
	.bt_params = &iwl2030_bt_params,			\
	.need_dc_calib = true,					\
	.need_temp_offset_calib = true,				\
	.temp_offset_v2 = true,					\
	.led_mode = IWL_LED_RF_STATE,				\
@@ -308,7 +296,6 @@ struct iwl_cfg iwl2030_2bgn_cfg = {
	.eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION,	\
	.lib = &iwl2000_lib,					\
	.base_params = &iwl2000_base_params,			\
	.need_dc_calib = true,					\
	.need_temp_offset_calib = true,				\
	.temp_offset_v2 = true,					\
	.led_mode = IWL_LED_RF_STATE,				\
@@ -338,7 +325,6 @@ struct iwl_cfg iwl105_bgn_d_cfg = {
	.lib = &iwl2030_lib,					\
	.base_params = &iwl2030_base_params,			\
	.bt_params = &iwl2030_bt_params,			\
	.need_dc_calib = true,					\
	.need_temp_offset_calib = true,				\
	.temp_offset_v2 = true,					\
	.led_mode = IWL_LED_RF_STATE,				\
+1 −15
Original line number Diff line number Diff line
@@ -186,14 +186,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
	iwl5000_set_ct_threshold(priv);

	/* Set initial sensitivity parameters */
	/* Set initial calibration set */
	hw_params(priv).sens = &iwl5000_sensitivity;
	hw_params(priv).calib_init_cfg =
		BIT(IWL_CALIB_XTAL)		|
		BIT(IWL_CALIB_LO)		|
		BIT(IWL_CALIB_TX_IQ)		|
		BIT(IWL_CALIB_TX_IQ_PERD)	|
		BIT(IWL_CALIB_BASE_BAND);

	return 0;
}
@@ -222,14 +215,7 @@ static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
	iwl5150_set_ct_threshold(priv);

	/* Set initial sensitivity parameters */
	/* Set initial calibration set */
	hw_params(priv).sens = &iwl5150_sensitivity;
	hw_params(priv).calib_init_cfg =
		BIT(IWL_CALIB_LO)		|
		BIT(IWL_CALIB_TX_IQ)		|
		BIT(IWL_CALIB_BASE_BAND);
	if (priv->cfg->need_dc_calib)
		hw_params(priv).calib_init_cfg |= BIT(IWL_CALIB_DC);

	return 0;
}
@@ -433,7 +419,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
	.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,	\
	.lib = &iwl5150_lib,					\
	.base_params = &iwl5000_base_params,			\
	.need_dc_calib = true,					\
	.no_xtal_calib = true,					\
	.led_mode = IWL_LED_BLINK,				\
	.internal_wimax_coex = true

+0 −15
Original line number Diff line number Diff line
@@ -164,17 +164,7 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
	iwl6000_set_ct_threshold(priv);

	/* Set initial sensitivity parameters */
	/* Set initial calibration set */
	hw_params(priv).sens = &iwl6000_sensitivity;
	hw_params(priv).calib_init_cfg =
		BIT(IWL_CALIB_XTAL)		|
		BIT(IWL_CALIB_LO)		|
		BIT(IWL_CALIB_TX_IQ)		|
		BIT(IWL_CALIB_BASE_BAND);
	if (priv->cfg->need_dc_calib)
		hw_params(priv).calib_rt_cfg |= IWL_CALIB_CFG_DC_IDX;
	if (priv->cfg->need_temp_offset_calib)
		hw_params(priv).calib_init_cfg |= BIT(IWL_CALIB_TEMP_OFFSET);

	return 0;
}
@@ -364,7 +354,6 @@ static struct iwl_bt_params iwl6000_bt_params = {
	.eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION,	\
	.lib = &iwl6000_lib,					\
	.base_params = &iwl6000_g2_base_params,			\
	.need_dc_calib = true,					\
	.need_temp_offset_calib = true,				\
	.led_mode = IWL_LED_RF_STATE

@@ -406,7 +395,6 @@ struct iwl_cfg iwl6005_2agn_d_cfg = {
	.lib = &iwl6030_lib,					\
	.base_params = &iwl6000_g2_base_params,			\
	.bt_params = &iwl6000_bt_params,			\
	.need_dc_calib = true,					\
	.need_temp_offset_calib = true,				\
	.led_mode = IWL_LED_RF_STATE,				\
	.adv_pm = true						\
@@ -506,7 +494,6 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
	.eeprom_ver = EEPROM_6050_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,	\
	.base_params = &iwl6050_base_params,			\
	.need_dc_calib = true,					\
	.led_mode = IWL_LED_BLINK,				\
	.internal_wimax_coex = true

@@ -530,7 +517,6 @@ struct iwl_cfg iwl6050_2abg_cfg = {
	.eeprom_ver = EEPROM_6150_EEPROM_VERSION,		\
	.eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION,	\
	.base_params = &iwl6050_base_params,			\
	.need_dc_calib = true,					\
	.led_mode = IWL_LED_BLINK,				\
	.internal_wimax_coex = true

@@ -555,7 +541,6 @@ struct iwl_cfg iwl6000_3agn_cfg = {
	.lib = &iwl6000_lib,
	.base_params = &iwl6000_base_params,
	.ht_params = &iwl6000_ht_params,
	.need_dc_calib = true,
	.led_mode = IWL_LED_BLINK,
};

+13 −15
Original line number Diff line number Diff line
@@ -84,30 +84,28 @@ struct statistics_general_data {

int iwl_send_calib_results(struct iwl_priv *priv)
{
	int ret = 0;
	int i = 0;

	struct iwl_host_cmd hcmd = {
		.id = REPLY_PHY_CALIBRATION_CMD,
		.flags = CMD_SYNC,
	};
	int i = 0;

	for (i = 0; i < IWL_CALIB_MAX; i++) {
		if ((BIT(i) & hw_params(priv).calib_init_cfg) &&
		    priv->calib_results[i].buf) {
		int ret;

		if (!priv->calib_results[i].buf)
			continue;
		hcmd.len[0] = priv->calib_results[i].buf_len;
		hcmd.data[0] = priv->calib_results[i].buf;
		hcmd.dataflags[0] = IWL_HCMD_DFL_NOCOPY;
		ret = iwl_trans_send_cmd(trans(priv), &hcmd);
		if (ret) {
				IWL_ERR(priv, "Error %d iteration %d\n",
					ret, i);
				break;
			}
			IWL_ERR(priv, "Error %d iteration %d\n", ret, i);
			return ret;
		}
	}

	return ret;
	return 0;
}

int iwl_calib_set(struct iwl_calib_result *res, const u8 *buf, int len)
Loading