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

Commit 16e727e8 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by John W. Linville
Browse files

iwlwifi: removes the RUN_TIME_CALIB ifdef



This patch removes the possibility not to compile the run time
calibrations. It also renames priv->sensitivity_work to
priv->run_time_calib_work, and moves bg_run_time_calib to iwl4965_base
since it is common to both: 4965 and 5000.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a78a8325
Loading
Loading
Loading
Loading
+0 −28
Original line number Diff line number Diff line
@@ -14,15 +14,6 @@ config IWLWIFI_LEDS
	bool
	default n

config IWLWIFI_RUN_TIME_CALIB
	bool
	depends on IWLCORE
	default n
	---help---
	  This option will enable run time calibration for the iwlwifi driver.
	  These calibrations are Sensitivity and Chain Noise.


config IWLWIFI_RFKILL
	boolean "IWLWIFI RF kill support"
	depends on IWLCORE
@@ -68,15 +59,6 @@ config IWL4965_SPECTRUM_MEASUREMENT
	---help---
	  This option will enable spectrum measurement for the iwl4965 driver.

config IWL4965_RUN_TIME_CALIB
	bool "Enable run time Calibration for 4965 NIC"
	select IWLWIFI_RUN_TIME_CALIB
	depends on IWL4965
	default y
	---help---
	  This option will enable run time calibration for the iwl4965 driver.
	  These calibrations are Sensitivity and Chain Noise. If unsure, say yes

config IWLWIFI_DEBUG
	bool "Enable full debugging output in iwl4965 driver"
	depends on IWL4965
@@ -110,16 +92,6 @@ config IWL5000
	  This option enables support for Intel Wireless WiFi Link 5000AGN Family
	  Dependency on 4965 is temporary

config IWL5000_RUN_TIME_CALIB
	bool "Enable run time Calibration for 5000 NIC"
	select IWLWIFI_RUN_TIME_CALIB
	depends on IWL5000
	default y
	---help---
	  This option will enable run time calibration for the iwl5000 driver.
	  These calibrations are Sensitivity and Chain Noise. If unsure, say yes


config IWLWIFI_DEBUGFS
        bool "Iwlwifi debugfs support"
        depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS
+1 −2
Original line number Diff line number Diff line
obj-$(CONFIG_IWLCORE)	+= iwlcore.o
iwlcore-objs 		:= iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o
iwlcore-objs 		:= iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o iwl-calib.o
iwlcore-objs 		+= iwl-rx.o iwl-tx.o iwl-sta.o
iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
iwlcore-$(CONFIG_IWLWIFI_LEDS) += iwl-led.o
iwlcore-$(CONFIG_IWLWIFI_RFKILL) += iwl-rfkill.o
iwlcore-$(CONFIG_IWLWIFI_RUN_TIME_CALIB) += iwl-calib.o

obj-$(CONFIG_IWL3945)	+= iwl3945.o
iwl3945-objs		:= iwl3945-base.o iwl-3945.o iwl-3945-rs.o
+1 −38
Original line number Diff line number Diff line
@@ -652,8 +652,6 @@ void iwl4965_rf_kill_ct_config(struct iwl_priv *priv)
			cmd.critical_temperature_R);
}

#ifdef CONFIG_IWL4965_RUN_TIME_CALIB

/* Reset differential Rx gains in NIC to prepare for chain noise calibration.
 * Called after every association, but this runs only once!
 *  ... once chain noise is calibrated the first time, it's good forever.  */
@@ -741,30 +739,6 @@ static void iwl4965_gain_computation(struct iwl_priv *priv,
	data->beacon_count = 0;
}

static void iwl4965_bg_sensitivity_work(struct work_struct *work)
{
	struct iwl_priv *priv = container_of(work, struct iwl_priv,
			sensitivity_work);

	mutex_lock(&priv->mutex);

	if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
	    test_bit(STATUS_SCANNING, &priv->status)) {
		mutex_unlock(&priv->mutex);
		return;
	}

	if (priv->start_calib) {
		iwl_chain_noise_calibration(priv, &priv->statistics);

		iwl_sensitivity_calibration(priv, &priv->statistics);
	}

	mutex_unlock(&priv->mutex);
	return;
}
#endif /*CONFIG_IWL4965_RUN_TIME_CALIB*/

static void iwl4965_bg_txpower_work(struct work_struct *work)
{
	struct iwl_priv *priv = container_of(work, struct iwl_priv,
@@ -920,7 +894,6 @@ int iwl4965_alive_notify(struct iwl_priv *priv)
	return ret;
}

#ifdef CONFIG_IWL4965_RUN_TIME_CALIB
static struct iwl_sensitivity_ranges iwl4965_sensitivity = {
	.min_nrg_cck = 97,
	.max_nrg_cck = 0,
@@ -943,7 +916,6 @@ static struct iwl_sensitivity_ranges iwl4965_sensitivity = {
	.nrg_th_cck = 100,
	.nrg_th_ofdm = 100,
};
#endif

/**
 * iwl4965_hw_set_hw_params
@@ -983,9 +955,7 @@ int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
	priv->hw_params.valid_rx_ant = ANT_A | ANT_B;
	priv->hw_params.ct_kill_threshold = CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD);

#ifdef CONFIG_IWL4965_RUN_TIME_CALIB
	priv->hw_params.sens = &iwl4965_sensitivity;
#endif

	return 0;
}
@@ -2123,9 +2093,7 @@ void iwl4965_hw_rx_statistics(struct iwl_priv *priv,
	if (unlikely(!test_bit(STATUS_SCANNING, &priv->status)) &&
	    (pkt->hdr.cmd == STATISTICS_NOTIFICATION)) {
		iwl4965_rx_calc_noise(priv);
#ifdef CONFIG_IWL4965_RUN_TIME_CALIB
		queue_work(priv->workqueue, &priv->sensitivity_work);
#endif
		queue_work(priv->workqueue, &priv->run_time_calib_work);
	}

	iwl_leds_background(priv);
@@ -3504,9 +3472,6 @@ static void iwl4965_rx_handler_setup(struct iwl_priv *priv)
void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv)
{
	INIT_WORK(&priv->txpower_work, iwl4965_bg_txpower_work);
#ifdef CONFIG_IWL4965_RUN_TIME_CALIB
	INIT_WORK(&priv->sensitivity_work, iwl4965_bg_sensitivity_work);
#endif
	init_timer(&priv->statistics_periodic);
	priv->statistics_periodic.data = (unsigned long)priv;
	priv->statistics_periodic.function = iwl4965_bg_statistics_periodic;
@@ -3527,10 +3492,8 @@ static struct iwl_hcmd_ops iwl4965_hcmd = {
static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
	.get_hcmd_size = iwl4965_get_hcmd_size,
	.build_addsta_hcmd = iwl4965_build_addsta_hcmd,
#ifdef CONFIG_IWL4965_RUN_TIME_CALIB
	.chain_noise_reset = iwl4965_chain_noise_reset,
	.gain_computation = iwl4965_gain_computation,
#endif
};

static struct iwl_lib_ops iwl4965_lib = {
+0 −11
Original line number Diff line number Diff line
@@ -300,8 +300,6 @@ static int iwl5000_eeprom_check_version(struct iwl_priv *priv)

}

#ifdef CONFIG_IWL5000_RUN_TIME_CALIB

static void iwl5000_gain_computation(struct iwl_priv *priv,
		u32 average_noise[NUM_RX_CHAINS],
		u16 min_average_noise_antenna_i,
@@ -354,7 +352,6 @@ static void iwl5000_gain_computation(struct iwl_priv *priv,
	data->beacon_count = 0;
}


static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
{
	struct iwl_chain_noise_data *data = &priv->chain_noise_data;
@@ -393,10 +390,6 @@ static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
	.nrg_th_ofdm = 95,
};

#endif /* CONFIG_IWL5000_RUN_TIME_CALIB */



static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
					   size_t offset)
{
@@ -847,9 +840,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
	priv->hw_params.max_bsm_size = BSM_SRAM_SIZE;
	priv->hw_params.fat_channel =  BIT(IEEE80211_BAND_2GHZ) |
					BIT(IEEE80211_BAND_5GHZ);
#ifdef CONFIG_IWL5000_RUN_TIME_CALIB
	priv->hw_params.sens = &iwl5000_sensitivity;
#endif

	switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
	case CSR_HW_REV_TYPE_5100:
@@ -1309,10 +1300,8 @@ static struct iwl_hcmd_ops iwl5000_hcmd = {
static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = {
	.get_hcmd_size = iwl5000_get_hcmd_size,
	.build_addsta_hcmd = iwl5000_build_addsta_hcmd,
#ifdef CONFIG_IWL5000_RUN_TIME_CALIB
	.gain_computation = iwl5000_gain_computation,
	.chain_noise_reset = iwl5000_chain_noise_reset,
#endif
};

static struct iwl_lib_ops iwl5000_lib = {
+0 −2
Original line number Diff line number Diff line
@@ -435,8 +435,6 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
	data = &(priv->sensitivity_data);

	if (ranges == NULL)
		/* can happen if IWLWIFI_RUN_TIME_CALIB is selected
		 * but no IWLXXXX_RUN_TIME_CALIB for specific is selected */
		return;

	memset(data, 0, sizeof(struct iwl_sensitivity_data));
Loading