summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/utils.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-01-21 21:41:29 +0100
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-03-01 16:55:11 +0200
commit33cef9256342f200a708211958cec9c44406631d (patch)
tree376512af3ea5f674a3c758b5b5c7dc689029f2d5 /drivers/net/wireless/iwlwifi/mvm/utils.c
parent3c118cdb9cd8c8425320f5153054250c5b93d8c0 (diff)
downloadop-kernel-dev-33cef9256342f200a708211958cec9c44406631d.zip
op-kernel-dev-33cef9256342f200a708211958cec9c44406631d.tar.gz
iwlwifi: mvm: support beacon statistics for BSS client
Report the average beacon signal and the number of received beacons as measured by the firmware. Since the firmware just counts, and doesn't reset the counter at all, clear it in the firmware whenever we associate. However, accumulate it over firmware restart. Since clearing the statistics in the firmware will also clear the ones for the radio statistics, add those to the accumulator when cleared. 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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c
index 8bdfb8b..a501223 100644
--- a/drivers/net/wireless/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/iwlwifi/mvm/utils.c
@@ -643,9 +643,11 @@ 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)
+int iwl_mvm_request_statistics(struct iwl_mvm *mvm, bool clear)
{
- struct iwl_statistics_cmd scmd = {};
+ struct iwl_statistics_cmd scmd = {
+ .flags = clear ? cpu_to_le32(IWL_STATISTICS_FLG_CLEAR) : 0,
+ };
struct iwl_host_cmd cmd = {
.id = STATISTICS_CMD,
.len[0] = sizeof(scmd),
@@ -661,6 +663,9 @@ int iwl_mvm_request_statistics(struct iwl_mvm *mvm)
iwl_mvm_handle_rx_statistics(mvm, cmd.resp_pkt);
iwl_free_resp(&cmd);
+ if (clear)
+ iwl_mvm_accu_radio_stats(mvm);
+
return 0;
}
OpenPOWER on IntegriCloud