From 3848ab66827bddd7eb760c58dec909f0af1c00a5 Mon Sep 17 00:00:00 2001 From: Matti Gottlieb Date: Tue, 30 Jul 2013 15:29:37 +0300 Subject: iwlwifi: mvm: Add RX statistics debugfs entry Add a debugfs entry for the RX statistics received from the firmware. Signed-off-by: Matti Gottlieb Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- drivers/net/wireless/iwlwifi/mvm/rx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/net/wireless/iwlwifi/mvm/rx.c') diff --git a/drivers/net/wireless/iwlwifi/mvm/rx.c b/drivers/net/wireless/iwlwifi/mvm/rx.c index 6fd7fae30c0a..5057fd3bcb50 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/iwlwifi/mvm/rx.c @@ -378,6 +378,18 @@ int iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb, return 0; } +static void iwl_mvm_update_rx_statistics(struct iwl_mvm *mvm, + struct iwl_notif_statistics *stats) +{ + /* + * NOTE FW aggregates the statistics - BUT the statistics are cleared + * when the driver issues REPLY_STATISTICS_CMD 0x9c with CLEAR_STATS + * bit set. + */ + lockdep_assert_held(&mvm->mutex); + memcpy(&mvm->rx_stats, &stats->rx, sizeof(struct mvm_statistics_rx)); +} + /* * iwl_mvm_rx_statistics - STATISTICS_NOTIFICATION handler * @@ -396,6 +408,7 @@ int iwl_mvm_rx_statistics(struct iwl_mvm *mvm, mvm->temperature = le32_to_cpu(common->temperature); iwl_mvm_tt_handler(mvm); } + iwl_mvm_update_rx_statistics(mvm, stats); return 0; } -- cgit v1.2.1