aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-08 11:14:56 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-04-08 11:19:00 -0400
commit0da0e5bf1522d75d446f5124e17016628d0a149e (patch)
tree86d9c4986be873fb834b54a4d9075330743c0f03 /drivers/net/wireless/iwlwifi/iwl-agn.c
parent703bc583cb98a24eeedd297ee59dfa12852897d1 (diff)
iwlagn: clean up & autodetect statistics
There's no need to keep both normal and BT statistics versions around all the time in memory when we only use a subset of both. So keep only the subsets that we need in memory, depending on the debug config). Also, in doing so, we can remove all the calls to iwl_bt_statistics() in the driver as we'll just access the copied statistics now. Finally, also remove this call from the one place where it might still be needed and automatically detect what kind of statistics the device is sending based on their size. This way, we don't need to keep track of which devices do what any more, which is good since this is subject to change based on the ucode version (as some ucode even for non-BT devices will in fact use BT statistics). Warn upon encountering a statistics command from the ucode that isn't known, so we will find such issues earlier in the future. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Tested-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 23b89c2e71da..20499b764430 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1705,10 +1705,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1705 else 1705 else
1706 priv->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM; 1706 priv->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
1707 1707
1708 if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BTSTATS ||
1709 (priv->cfg->bt_params && priv->cfg->bt_params->bt_statistics))
1710 priv->bt_statistics = true;
1711
1712 /* Copy images into buffers for card's bus-master reads ... */ 1708 /* Copy images into buffers for card's bus-master reads ... */
1713 1709
1714 /* Runtime instructions (first block of data in file) */ 1710 /* Runtime instructions (first block of data in file) */
@@ -2626,17 +2622,8 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
2626 } 2622 }
2627 2623
2628 if (priv->start_calib) { 2624 if (priv->start_calib) {
2629 if (iwl_bt_statistics(priv)) { 2625 iwl_chain_noise_calibration(priv);
2630 iwl_chain_noise_calibration(priv, 2626 iwl_sensitivity_calibration(priv);
2631 (void *)&priv->_agn.statistics_bt);
2632 iwl_sensitivity_calibration(priv,
2633 (void *)&priv->_agn.statistics_bt);
2634 } else {
2635 iwl_chain_noise_calibration(priv,
2636 (void *)&priv->_agn.statistics);
2637 iwl_sensitivity_calibration(priv,
2638 (void *)&priv->_agn.statistics);
2639 }
2640 } 2627 }
2641 2628
2642 mutex_unlock(&priv->mutex); 2629 mutex_unlock(&priv->mutex);