aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2014-08-15 18:30:30 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-09-14 05:56:38 -0400
commitf58220f6b9ba69c782eafbfe703be8c4bca6b33d (patch)
tree2b34f32766f85a1607d7a8ac7f5204c92230e8e4
parentf3bd58f486acd954ca8d90f8733d752dbd98eec6 (diff)
iwlwifi: mvm: rs: don't zero tx stats after idle
Move the tx stats to the persistent area of lq_sta to avoid them being zeroed out every time rs reinitializes which happens after tx idle for 5 secs for example. The automatic zeroing out made them difficult to use. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rs.c10
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rs.h7
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c
index 94c5299e823a..f77dfe4df074 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.c
@@ -672,8 +672,10 @@ static int rs_collect_tx_data(struct iwl_lq_sta *lq_sta,
672 return -EINVAL; 672 return -EINVAL;
673 673
674 if (tbl->column != RS_COLUMN_INVALID) { 674 if (tbl->column != RS_COLUMN_INVALID) {
675 lq_sta->tx_stats[tbl->column][scale_index].total += attempts; 675 struct lq_sta_pers *pers = &lq_sta->pers;
676 lq_sta->tx_stats[tbl->column][scale_index].success += successes; 676
677 pers->tx_stats[tbl->column][scale_index].total += attempts;
678 pers->tx_stats[tbl->column][scale_index].success += successes;
677 } 679 }
678 680
679 /* Select window for current tx bit rate */ 681 /* Select window for current tx bit rate */
@@ -3171,7 +3173,7 @@ static ssize_t rs_sta_dbgfs_drv_tx_stats_read(struct file *file,
3171 "%s,", column_name[col]); 3173 "%s,", column_name[col]);
3172 3174
3173 for (rate = 0; rate < IWL_RATE_COUNT; rate++) { 3175 for (rate = 0; rate < IWL_RATE_COUNT; rate++) {
3174 stats = &(lq_sta->tx_stats[col][rate]); 3176 stats = &(lq_sta->pers.tx_stats[col][rate]);
3175 pos += scnprintf(pos, endpos - pos, 3177 pos += scnprintf(pos, endpos - pos,
3176 "%llu/%llu,", 3178 "%llu/%llu,",
3177 stats->success, 3179 stats->success,
@@ -3190,7 +3192,7 @@ static ssize_t rs_sta_dbgfs_drv_tx_stats_write(struct file *file,
3190 size_t count, loff_t *ppos) 3192 size_t count, loff_t *ppos)
3191{ 3193{
3192 struct iwl_lq_sta *lq_sta = file->private_data; 3194 struct iwl_lq_sta *lq_sta = file->private_data;
3193 memset(lq_sta->tx_stats, 0, sizeof(lq_sta->tx_stats)); 3195 memset(lq_sta->pers.tx_stats, 0, sizeof(lq_sta->pers.tx_stats));
3194 3196
3195 return count; 3197 return count;
3196} 3198}
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.h b/drivers/net/wireless/iwlwifi/mvm/rs.h
index 98bb9b7d69be..95c4b960fd71 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.h
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.h
@@ -333,8 +333,6 @@ struct iwl_lq_sta {
333 bool ldpc; /* LDPC Rx is supported by the STA */ 333 bool ldpc; /* LDPC Rx is supported by the STA */
334 enum ieee80211_band band; 334 enum ieee80211_band band;
335 335
336 struct rs_rate_stats tx_stats[RS_COLUMN_COUNT][IWL_RATE_COUNT];
337
338 /* The following are bitmaps of rates; IWL_RATE_6M_MASK, etc. */ 336 /* The following are bitmaps of rates; IWL_RATE_6M_MASK, etc. */
339 unsigned long active_legacy_rate; 337 unsigned long active_legacy_rate;
340 unsigned long active_siso_rate; 338 unsigned long active_siso_rate;
@@ -362,11 +360,14 @@ struct iwl_lq_sta {
362 int tpc_reduce; 360 int tpc_reduce;
363 361
364 /* persistent fields - initialized only once - keep last! */ 362 /* persistent fields - initialized only once - keep last! */
365 struct { 363 struct lq_sta_pers {
366#ifdef CONFIG_MAC80211_DEBUGFS 364#ifdef CONFIG_MAC80211_DEBUGFS
367 u32 dbg_fixed_rate; 365 u32 dbg_fixed_rate;
368 u8 dbg_fixed_txp_reduction; 366 u8 dbg_fixed_txp_reduction;
369#endif 367#endif
368 u8 chains;
369 s8 chain_signal[IEEE80211_MAX_CHAINS];
370 struct rs_rate_stats tx_stats[RS_COLUMN_COUNT][IWL_RATE_COUNT];
370 struct iwl_mvm *drv; 371 struct iwl_mvm *drv;
371 } pers; 372 } pers;
372}; 373};