Skip to content

Commit 290d5e4

Browse files
gomordKalle Valo
authored andcommitted
iwlwifi: mvm: beacon statistics shouldn't go backwards
We reset statistics also in case that we didn't reassoc so in this cases keep last beacon counter. Cc: [email protected] # v4.19+ Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200417100405.1f9142751fbc.Ifbfd0f928a0a761110b8f4f2ca5483a61fb21131@changeid
1 parent b98b33d commit 290d5e4

File tree

1 file changed

+11
-2
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+11
-2
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/rx.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
99
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11-
* Copyright(c) 2018 - 2019 Intel Corporation
11+
* Copyright(c) 2018 - 2020 Intel Corporation
1212
*
1313
* This program is free software; you can redistribute it and/or modify
1414
* it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
3131
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
3232
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3333
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34-
* Copyright(c) 2018 - 2019 Intel Corporation
34+
* Copyright(c) 2018 - 2020 Intel Corporation
3535
* All rights reserved.
3636
*
3737
* Redistribution and use in source and binary forms, with or without
@@ -566,6 +566,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
566566

567567
struct iwl_mvm_stat_data {
568568
struct iwl_mvm *mvm;
569+
__le32 flags;
569570
__le32 mac_id;
570571
u8 beacon_filter_average_energy;
571572
void *general;
@@ -606,6 +607,13 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac,
606607
-general->beacon_average_energy[vif_id];
607608
}
608609

610+
/* make sure that beacon statistics don't go backwards with TCM
611+
* request to clear statistics
612+
*/
613+
if (le32_to_cpu(data->flags) & IWL_STATISTICS_REPLY_FLG_CLEAR)
614+
mvmvif->beacon_stats.accu_num_beacons +=
615+
mvmvif->beacon_stats.num_beacons;
616+
609617
if (mvmvif->id != id)
610618
return;
611619

@@ -763,6 +771,7 @@ void iwl_mvm_handle_rx_statistics(struct iwl_mvm *mvm,
763771

764772
flags = stats->flag;
765773
}
774+
data.flags = flags;
766775

767776
iwl_mvm_rx_stats_check_trigger(mvm, pkt);
768777

0 commit comments

Comments
 (0)