iwlwifi: Disabling calibrations variable

Add a variable for disabling specific calibrations.
Merged old variables for calibrations disabling.

Signed-off-by: Dor Shaish <dor.shaish@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
This commit is contained in:
Dor Shaish 2012-03-26 08:20:55 -07:00 committed by Wey-Yi Guy
parent 7dcf1e603d
commit bfb45f5422
4 changed files with 50 additions and 11 deletions

View File

@ -599,7 +599,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
struct iwl_sensitivity_data *data = NULL; struct iwl_sensitivity_data *data = NULL;
const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens; const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens;
if (priv->disable_sens_cal) if (priv->calib_disabled & IWL_SENSITIVITY_CALIB_DISABLED)
return; return;
IWL_DEBUG_CALIB(priv, "Start iwl_init_sensitivity\n"); IWL_DEBUG_CALIB(priv, "Start iwl_init_sensitivity\n");
@ -663,7 +663,7 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv)
struct statistics_rx_phy *ofdm, *cck; struct statistics_rx_phy *ofdm, *cck;
struct statistics_general_data statis; struct statistics_general_data statis;
if (priv->disable_sens_cal) if (priv->calib_disabled & IWL_SENSITIVITY_CALIB_DISABLED)
return; return;
data = &(priv->sensitivity_data); data = &(priv->sensitivity_data);
@ -970,7 +970,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
*/ */
struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
if (priv->disable_chain_noise_cal) if (priv->calib_disabled & IWL_CHAIN_NOISE_CALIB_DISABLED)
return; return;
data = &(priv->chain_noise_data); data = &(priv->chain_noise_data);

View File

@ -414,6 +414,9 @@ static int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
bool defer; bool defer;
struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
if (priv->calib_disabled & IWL_TX_POWER_CALIB_DISABLED)
return 0;
lockdep_assert_held(&priv->mutex); lockdep_assert_held(&priv->mutex);
if (priv->tx_power_user_lmt == tx_power && !force) if (priv->tx_power_user_lmt == tx_power && !force)
@ -1319,6 +1322,9 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv)
struct iwl_chain_noise_data *data = &priv->chain_noise_data; struct iwl_chain_noise_data *data = &priv->chain_noise_data;
int ret; int ret;
if (!(priv->calib_disabled & IWL_CHAIN_NOISE_CALIB_DISABLED))
return;
if ((data->state == IWL_CHAIN_NOISE_ALIVE) && if ((data->state == IWL_CHAIN_NOISE_ALIVE) &&
iwl_is_any_associated(priv)) { iwl_is_any_associated(priv)) {
struct iwl_calib_chain_noise_reset_cmd cmd; struct iwl_calib_chain_noise_reset_cmd cmd;
@ -1471,8 +1477,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
iwl_power_update_mode(priv, false); iwl_power_update_mode(priv, false);
/* Enable RX differential gain and sensitivity calibrations */ /* Enable RX differential gain and sensitivity calibrations */
if (!priv->disable_chain_noise_cal) iwlagn_chain_noise_reset(priv);
iwlagn_chain_noise_reset(priv);
priv->start_calib = 1; priv->start_calib = 1;
} }

View File

@ -2471,6 +2471,34 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
return count; return count;
} }
static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct iwl_priv *priv = file->private_data;
char buf[120];
int pos = 0;
const size_t bufsz = sizeof(buf);
pos += scnprintf(buf + pos, bufsz - pos,
"Sensitivity calibrations %s\n",
(priv->calib_disabled &
IWL_SENSITIVITY_CALIB_DISABLED) ?
"DISABLED" : "ENABLED");
pos += scnprintf(buf + pos, bufsz - pos,
"Chain noise calibrations %s\n",
(priv->calib_disabled &
IWL_CHAIN_NOISE_CALIB_DISABLED) ?
"DISABLED" : "ENABLED");
pos += scnprintf(buf + pos, bufsz - pos,
"Tx power calibrations %s\n",
(priv->calib_disabled &
IWL_TX_POWER_CALIB_DISABLED) ?
"DISABLED" : "ENABLED");
return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
}
DEBUGFS_READ_FILE_OPS(rx_statistics); DEBUGFS_READ_FILE_OPS(rx_statistics);
DEBUGFS_READ_FILE_OPS(tx_statistics); DEBUGFS_READ_FILE_OPS(tx_statistics);
DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@ -2495,6 +2523,7 @@ DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
DEBUGFS_READ_FILE_OPS(reply_tx_error); DEBUGFS_READ_FILE_OPS(reply_tx_error);
DEBUGFS_WRITE_FILE_OPS(echo_test); DEBUGFS_WRITE_FILE_OPS(echo_test);
DEBUGFS_READ_WRITE_FILE_OPS(log_event); DEBUGFS_READ_WRITE_FILE_OPS(log_event);
DEBUGFS_READ_FILE_OPS(calib_disabled);
/* /*
* Create the debugfs files and directories * Create the debugfs files and directories
@ -2562,10 +2591,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
if (iwl_advanced_bt_coexist(priv)) if (iwl_advanced_bt_coexist(priv))
DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, /* Calibrations disabled/enabled status*/
&priv->disable_sens_cal); DEBUGFS_ADD_FILE(calib_disabled, dir_rf, S_IRUSR);
DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf,
&priv->disable_chain_noise_cal);
if (iwl_trans_dbgfs_register(trans(priv), dir_debug)) if (iwl_trans_dbgfs_register(trans(priv), dir_debug))
goto err; goto err;

View File

@ -741,6 +741,14 @@ struct iwl_wipan_noa_data {
u8 data[]; u8 data[];
}; };
/* Calibration disabling bit mask */
#define IWL_SENSITIVITY_CALIB_DISABLED BIT(1)
#define IWL_CHAIN_NOISE_CALIB_DISABLED BIT(2)
#define IWL_TX_POWER_CALIB_DISABLED BIT(3)
#define IWL_CALIB_ENABLE_ALL 0
#define IWL_CALIB_DISABLE_ALL 0xFFFFFFFF
#define IWL_OP_MODE_GET_DVM(_iwl_op_mode) \ #define IWL_OP_MODE_GET_DVM(_iwl_op_mode) \
((struct iwl_priv *) ((_iwl_op_mode)->op_mode_specific)) ((struct iwl_priv *) ((_iwl_op_mode)->op_mode_specific))
@ -1010,8 +1018,7 @@ struct iwl_priv {
enum iwl_nvm_type nvm_device_type; enum iwl_nvm_type nvm_device_type;
struct work_struct txpower_work; struct work_struct txpower_work;
u32 disable_sens_cal; u32 calib_disabled;
u32 disable_chain_noise_cal;
struct work_struct run_time_calib_work; struct work_struct run_time_calib_work;
struct timer_list statistics_periodic; struct timer_list statistics_periodic;
struct timer_list ucode_trace; struct timer_list ucode_trace;