diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-01-14 18:12:41 +0100 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-03-01 16:55:09 +0200 |
commit | 91a8bcde2e7feb2c2782ddc6a266cf5f5294d16f (patch) | |
tree | b31ec434d582c37c0e230fd38d9219c351717bae /drivers/net/wireless/iwlwifi/mvm/utils.c | |
parent | 777c9b6bba5266ea8eecb19b3fa8b63ad5251bd6 (diff) | |
download | lwn-91a8bcde2e7feb2c2782ddc6a266cf5f5294d16f.tar.gz lwn-91a8bcde2e7feb2c2782ddc6a266cf5f5294d16f.zip |
iwlwifi: mvm: support radio statistics as global survey
Export the radio statistics from the statistics v10 API (if the
firmware also has the capability to fill these statistics) using
the global survey data facility.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/utils.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/utils.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c index 8decf9953229..2b75a0d6d41e 100644 --- a/drivers/net/wireless/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/iwlwifi/mvm/utils.c @@ -643,6 +643,35 @@ void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ieee80211_request_smps(vif, smps_mode); } +int iwl_mvm_request_statistics(struct iwl_mvm *mvm) +{ + struct iwl_statistics_cmd scmd = {}; + struct iwl_host_cmd cmd = { + .id = STATISTICS_CMD, + .len[0] = sizeof(scmd), + .data[0] = &scmd, + .flags = CMD_WANT_SKB, + }; + int ret; + + ret = iwl_mvm_send_cmd(mvm, &cmd); + if (ret) + return ret; + + iwl_mvm_handle_rx_statistics(mvm, cmd.resp_pkt); + iwl_free_resp(&cmd); + + return 0; +} + +void iwl_mvm_accu_radio_stats(struct iwl_mvm *mvm) +{ + mvm->accu_radio_stats.rx_time += mvm->radio_stats.rx_time; + mvm->accu_radio_stats.tx_time += mvm->radio_stats.tx_time; + mvm->accu_radio_stats.on_time_rf += mvm->radio_stats.on_time_rf; + mvm->accu_radio_stats.on_time_scan += mvm->radio_stats.on_time_scan; +} + static void iwl_mvm_diversity_iter(void *_data, u8 *mac, struct ieee80211_vif *vif) { |