aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDor Shaish <dor.shaish@intel.com>2012-03-26 11:20:55 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-04-16 17:36:44 -0400
commitbfb45f5422deb3bbf12d8f67f5f76e4b9a7eb766 (patch)
treee932a99a3ecacf609572288e0ddc5930187151b8 /drivers/net/wireless
parent7dcf1e603d98c43bf364d46a791ce766dd7782a2 (diff)
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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-calib.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c35
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h11
4 files changed, 50 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
index 2f7310987553..61c243f7395f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
@@ -599,7 +599,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
599 struct iwl_sensitivity_data *data = NULL; 599 struct iwl_sensitivity_data *data = NULL;
600 const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens; 600 const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens;
601 601
602 if (priv->disable_sens_cal) 602 if (priv->calib_disabled & IWL_SENSITIVITY_CALIB_DISABLED)
603 return; 603 return;
604 604
605 IWL_DEBUG_CALIB(priv, "Start iwl_init_sensitivity\n"); 605 IWL_DEBUG_CALIB(priv, "Start iwl_init_sensitivity\n");
@@ -663,7 +663,7 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv)
663 struct statistics_rx_phy *ofdm, *cck; 663 struct statistics_rx_phy *ofdm, *cck;
664 struct statistics_general_data statis; 664 struct statistics_general_data statis;
665 665
666 if (priv->disable_sens_cal) 666 if (priv->calib_disabled & IWL_SENSITIVITY_CALIB_DISABLED)
667 return; 667 return;
668 668
669 data = &(priv->sensitivity_data); 669 data = &(priv->sensitivity_data);
@@ -970,7 +970,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
970 */ 970 */
971 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 971 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
972 972
973 if (priv->disable_chain_noise_cal) 973 if (priv->calib_disabled & IWL_CHAIN_NOISE_CALIB_DISABLED)
974 return; 974 return;
975 975
976 data = &(priv->chain_noise_data); 976 data = &(priv->chain_noise_data);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 69279af5a41d..88a7f3a1056c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -414,6 +414,9 @@ static int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
414 bool defer; 414 bool defer;
415 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 415 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
416 416
417 if (priv->calib_disabled & IWL_TX_POWER_CALIB_DISABLED)
418 return 0;
419
417 lockdep_assert_held(&priv->mutex); 420 lockdep_assert_held(&priv->mutex);
418 421
419 if (priv->tx_power_user_lmt == tx_power && !force) 422 if (priv->tx_power_user_lmt == tx_power && !force)
@@ -1319,6 +1322,9 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv)
1319 struct iwl_chain_noise_data *data = &priv->chain_noise_data; 1322 struct iwl_chain_noise_data *data = &priv->chain_noise_data;
1320 int ret; 1323 int ret;
1321 1324
1325 if (!(priv->calib_disabled & IWL_CHAIN_NOISE_CALIB_DISABLED))
1326 return;
1327
1322 if ((data->state == IWL_CHAIN_NOISE_ALIVE) && 1328 if ((data->state == IWL_CHAIN_NOISE_ALIVE) &&
1323 iwl_is_any_associated(priv)) { 1329 iwl_is_any_associated(priv)) {
1324 struct iwl_calib_chain_noise_reset_cmd cmd; 1330 struct iwl_calib_chain_noise_reset_cmd cmd;
@@ -1471,8 +1477,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
1471 iwl_power_update_mode(priv, false); 1477 iwl_power_update_mode(priv, false);
1472 1478
1473 /* Enable RX differential gain and sensitivity calibrations */ 1479 /* Enable RX differential gain and sensitivity calibrations */
1474 if (!priv->disable_chain_noise_cal) 1480 iwlagn_chain_noise_reset(priv);
1475 iwlagn_chain_noise_reset(priv);
1476 priv->start_calib = 1; 1481 priv->start_calib = 1;
1477 } 1482 }
1478 1483
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index a77f45790e3c..4d1f1ddb8f6f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -2471,6 +2471,34 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
2471 return count; 2471 return count;
2472} 2472}
2473 2473
2474static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file,
2475 char __user *user_buf,
2476 size_t count, loff_t *ppos)
2477{
2478 struct iwl_priv *priv = file->private_data;
2479 char buf[120];
2480 int pos = 0;
2481 const size_t bufsz = sizeof(buf);
2482
2483 pos += scnprintf(buf + pos, bufsz - pos,
2484 "Sensitivity calibrations %s\n",
2485 (priv->calib_disabled &
2486 IWL_SENSITIVITY_CALIB_DISABLED) ?
2487 "DISABLED" : "ENABLED");
2488 pos += scnprintf(buf + pos, bufsz - pos,
2489 "Chain noise calibrations %s\n",
2490 (priv->calib_disabled &
2491 IWL_CHAIN_NOISE_CALIB_DISABLED) ?
2492 "DISABLED" : "ENABLED");
2493 pos += scnprintf(buf + pos, bufsz - pos,
2494 "Tx power calibrations %s\n",
2495 (priv->calib_disabled &
2496 IWL_TX_POWER_CALIB_DISABLED) ?
2497 "DISABLED" : "ENABLED");
2498
2499 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
2500}
2501
2474DEBUGFS_READ_FILE_OPS(rx_statistics); 2502DEBUGFS_READ_FILE_OPS(rx_statistics);
2475DEBUGFS_READ_FILE_OPS(tx_statistics); 2503DEBUGFS_READ_FILE_OPS(tx_statistics);
2476DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); 2504DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -2495,6 +2523,7 @@ DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
2495DEBUGFS_READ_FILE_OPS(reply_tx_error); 2523DEBUGFS_READ_FILE_OPS(reply_tx_error);
2496DEBUGFS_WRITE_FILE_OPS(echo_test); 2524DEBUGFS_WRITE_FILE_OPS(echo_test);
2497DEBUGFS_READ_WRITE_FILE_OPS(log_event); 2525DEBUGFS_READ_WRITE_FILE_OPS(log_event);
2526DEBUGFS_READ_FILE_OPS(calib_disabled);
2498 2527
2499/* 2528/*
2500 * Create the debugfs files and directories 2529 * Create the debugfs files and directories
@@ -2562,10 +2591,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
2562 if (iwl_advanced_bt_coexist(priv)) 2591 if (iwl_advanced_bt_coexist(priv))
2563 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); 2592 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
2564 2593
2565 DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, 2594 /* Calibrations disabled/enabled status*/
2566 &priv->disable_sens_cal); 2595 DEBUGFS_ADD_FILE(calib_disabled, dir_rf, S_IRUSR);
2567 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf,
2568 &priv->disable_chain_noise_cal);
2569 2596
2570 if (iwl_trans_dbgfs_register(trans(priv), dir_debug)) 2597 if (iwl_trans_dbgfs_register(trans(priv), dir_debug))
2571 goto err; 2598 goto err;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index d56d4db79210..c235a1ea71b4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -741,6 +741,14 @@ struct iwl_wipan_noa_data {
741 u8 data[]; 741 u8 data[];
742}; 742};
743 743
744/* Calibration disabling bit mask */
745#define IWL_SENSITIVITY_CALIB_DISABLED BIT(1)
746#define IWL_CHAIN_NOISE_CALIB_DISABLED BIT(2)
747#define IWL_TX_POWER_CALIB_DISABLED BIT(3)
748
749#define IWL_CALIB_ENABLE_ALL 0
750#define IWL_CALIB_DISABLE_ALL 0xFFFFFFFF
751
744#define IWL_OP_MODE_GET_DVM(_iwl_op_mode) \ 752#define IWL_OP_MODE_GET_DVM(_iwl_op_mode) \
745 ((struct iwl_priv *) ((_iwl_op_mode)->op_mode_specific)) 753 ((struct iwl_priv *) ((_iwl_op_mode)->op_mode_specific))
746 754
@@ -1010,8 +1018,7 @@ struct iwl_priv {
1010 enum iwl_nvm_type nvm_device_type; 1018 enum iwl_nvm_type nvm_device_type;
1011 1019
1012 struct work_struct txpower_work; 1020 struct work_struct txpower_work;
1013 u32 disable_sens_cal; 1021 u32 calib_disabled;
1014 u32 disable_chain_noise_cal;
1015 struct work_struct run_time_calib_work; 1022 struct work_struct run_time_calib_work;
1016 struct timer_list statistics_periodic; 1023 struct timer_list statistics_periodic;
1017 struct timer_list ucode_trace; 1024 struct timer_list ucode_trace;