diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-05-15 01:54:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:48:06 -0400 |
commit | 445c2dff409ef9de5d2f964d20917ab238fd266f (patch) | |
tree | fb4c9b7d31cd274a2a116aebd360ca1fedb27e43 /drivers/net/wireless | |
parent | da6833cb05cd76f4367fa7e4a783bf358c096faf (diff) |
iwlwifi: add debugfs to disable/enable run time calibration
This patch adds functionality to debugfs to enable or disable chain
noise or sensitivity calibrations.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-calib.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-calib.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 6 |
5 files changed, 44 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.c b/drivers/net/wireless/iwlwifi/iwl-calib.c index 1289d4c91abe..beb9716165c3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-calib.c +++ b/drivers/net/wireless/iwlwifi/iwl-calib.c | |||
@@ -426,6 +426,9 @@ void iwl_init_sensitivity(struct iwl_priv *priv) | |||
426 | struct iwl_sensitivity_data *data = NULL; | 426 | struct iwl_sensitivity_data *data = NULL; |
427 | const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens; | 427 | const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens; |
428 | 428 | ||
429 | if (priv->disable_sens_cal) | ||
430 | return; | ||
431 | |||
429 | IWL_DEBUG_CALIB("Start iwl_init_sensitivity\n"); | 432 | IWL_DEBUG_CALIB("Start iwl_init_sensitivity\n"); |
430 | 433 | ||
431 | /* Clear driver's sensitivity algo data */ | 434 | /* Clear driver's sensitivity algo data */ |
@@ -486,6 +489,9 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv, | |||
486 | unsigned long flags; | 489 | unsigned long flags; |
487 | struct statistics_general_data statis; | 490 | struct statistics_general_data statis; |
488 | 491 | ||
492 | if (priv->disable_sens_cal) | ||
493 | return; | ||
494 | |||
489 | data = &(priv->sensitivity_data); | 495 | data = &(priv->sensitivity_data); |
490 | 496 | ||
491 | if (!iwl_is_associated(priv)) { | 497 | if (!iwl_is_associated(priv)) { |
@@ -608,6 +614,9 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv, | |||
608 | unsigned long flags; | 614 | unsigned long flags; |
609 | struct statistics_rx_non_phy *rx_info = &(stat_resp->rx.general); | 615 | struct statistics_rx_non_phy *rx_info = &(stat_resp->rx.general); |
610 | 616 | ||
617 | if (priv->disable_chain_noise_cal) | ||
618 | return; | ||
619 | |||
611 | data = &(priv->chain_noise_data); | 620 | data = &(priv->chain_noise_data); |
612 | 621 | ||
613 | /* Accumulate just the first 20 beacons after the first association, | 622 | /* Accumulate just the first 20 beacons after the first association, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.h b/drivers/net/wireless/iwlwifi/iwl-calib.h index 933b0b0a797b..e690668f08a1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-calib.h +++ b/drivers/net/wireless/iwlwifi/iwl-calib.h | |||
@@ -81,7 +81,9 @@ void iwl_init_sensitivity(struct iwl_priv *priv); | |||
81 | 81 | ||
82 | static inline void iwl_chain_noise_reset(struct iwl_priv *priv) | 82 | static inline void iwl_chain_noise_reset(struct iwl_priv *priv) |
83 | { | 83 | { |
84 | if (priv->cfg->ops->utils->chain_noise_reset) | 84 | |
85 | if (!priv->disable_chain_noise_cal && | ||
86 | priv->cfg->ops->utils->chain_noise_reset) | ||
85 | priv->cfg->ops->utils->chain_noise_reset(priv); | 87 | priv->cfg->ops->utils->chain_noise_reset(priv); |
86 | } | 88 | } |
87 | #else | 89 | #else |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 2f24594c5fea..c3f8e90c5ba7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
@@ -45,13 +45,20 @@ struct iwl_debugfs { | |||
45 | const char *name; | 45 | const char *name; |
46 | struct dentry *dir_drv; | 46 | struct dentry *dir_drv; |
47 | struct dentry *dir_data; | 47 | struct dentry *dir_data; |
48 | struct dir_data_files{ | 48 | struct dentry *dir_rf; |
49 | struct dir_data_files { | ||
49 | struct dentry *file_sram; | 50 | struct dentry *file_sram; |
50 | struct dentry *file_eeprom; | 51 | struct dentry *file_eeprom; |
51 | struct dentry *file_stations; | 52 | struct dentry *file_stations; |
52 | struct dentry *file_rx_statistics; | 53 | struct dentry *file_rx_statistics; |
53 | struct dentry *file_tx_statistics; | 54 | struct dentry *file_tx_statistics; |
54 | } dbgfs_data_files; | 55 | } dbgfs_data_files; |
56 | struct dir_rf_files { | ||
57 | #ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB | ||
58 | struct dentry *file_disable_sensitivity; | ||
59 | struct dentry *file_disable_chain_noise; | ||
60 | #endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ | ||
61 | } dbgfs_rf_files; | ||
55 | u32 sram_offset; | 62 | u32 sram_offset; |
56 | u32 sram_len; | 63 | u32 sram_len; |
57 | }; | 64 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index ad25806dfaf1..f7ec2009cdf9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -55,6 +55,13 @@ | |||
55 | goto err; \ | 55 | goto err; \ |
56 | } while (0) | 56 | } while (0) |
57 | 57 | ||
58 | #define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \ | ||
59 | dbgfs->dbgfs_##parent##_files.file_##name = \ | ||
60 | debugfs_create_bool(#name, 0644, dbgfs->dir_##parent, ptr); \ | ||
61 | if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name)) \ | ||
62 | goto err; \ | ||
63 | } while (0) | ||
64 | |||
58 | #define DEBUGFS_REMOVE(name) do { \ | 65 | #define DEBUGFS_REMOVE(name) do { \ |
59 | debugfs_remove(name); \ | 66 | debugfs_remove(name); \ |
60 | name = NULL; \ | 67 | name = NULL; \ |
@@ -344,12 +351,17 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
344 | } | 351 | } |
345 | 352 | ||
346 | DEBUGFS_ADD_DIR(data, dbgfs->dir_drv); | 353 | DEBUGFS_ADD_DIR(data, dbgfs->dir_drv); |
354 | DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv); | ||
347 | DEBUGFS_ADD_FILE(eeprom, data); | 355 | DEBUGFS_ADD_FILE(eeprom, data); |
348 | DEBUGFS_ADD_FILE(sram, data); | 356 | DEBUGFS_ADD_FILE(sram, data); |
349 | DEBUGFS_ADD_FILE(stations, data); | 357 | DEBUGFS_ADD_FILE(stations, data); |
350 | DEBUGFS_ADD_FILE(rx_statistics, data); | 358 | DEBUGFS_ADD_FILE(rx_statistics, data); |
351 | DEBUGFS_ADD_FILE(tx_statistics, data); | 359 | DEBUGFS_ADD_FILE(tx_statistics, data); |
352 | 360 | #ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB | |
361 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); | ||
362 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, | ||
363 | &priv->disable_chain_noise_cal); | ||
364 | #endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ | ||
353 | return 0; | 365 | return 0; |
354 | 366 | ||
355 | err: | 367 | err: |
@@ -374,6 +386,11 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
374 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_sram); | 386 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_sram); |
375 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_stations); | 387 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_stations); |
376 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); | 388 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); |
389 | #ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB | ||
390 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); | ||
391 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); | ||
392 | #endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ | ||
393 | DEBUGFS_REMOVE(priv->dbgfs->dir_rf); | ||
377 | DEBUGFS_REMOVE(priv->dbgfs->dir_drv); | 394 | DEBUGFS_REMOVE(priv->dbgfs->dir_drv); |
378 | kfree(priv->dbgfs); | 395 | kfree(priv->dbgfs); |
379 | priv->dbgfs = NULL; | 396 | priv->dbgfs = NULL; |
@@ -381,3 +398,4 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
381 | EXPORT_SYMBOL(iwl_dbgfs_unregister); | 398 | EXPORT_SYMBOL(iwl_dbgfs_unregister); |
382 | 399 | ||
383 | 400 | ||
401 | |||
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index b1ff0afd8286..820542bac443 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1212,9 +1212,13 @@ struct iwl_priv { | |||
1212 | #endif /* CONFIG_IWLWIFI_DEBUG */ | 1212 | #endif /* CONFIG_IWLWIFI_DEBUG */ |
1213 | 1213 | ||
1214 | struct work_struct txpower_work; | 1214 | struct work_struct txpower_work; |
1215 | #ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB | ||
1216 | u32 disable_sens_cal; | ||
1217 | u32 disable_chain_noise_cal; | ||
1218 | #endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ | ||
1215 | #ifdef CONFIG_IWL4965_RUN_TIME_CALIB | 1219 | #ifdef CONFIG_IWL4965_RUN_TIME_CALIB |
1216 | struct work_struct sensitivity_work; | 1220 | struct work_struct sensitivity_work; |
1217 | #endif | 1221 | #endif /* CONFIG_IWL4965_RUN_TIME_CALIB */ |
1218 | struct timer_list statistics_periodic; | 1222 | struct timer_list statistics_periodic; |
1219 | }; /*iwl_priv */ | 1223 | }; /*iwl_priv */ |
1220 | 1224 | ||