Skip to content

Commit

Permalink
iwlwifi: mvm: add debugfs file for fixed reduced tx power
Browse files Browse the repository at this point in the history
Allow fixing the tx power reduction through debugfs
file.

The change doesn't take affect immediately, but
will be considered the next time tpc is evaluated.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  • Loading branch information
Eliad Peller authored and Emmanuel Grumbach committed Apr 13, 2014
1 parent 2fd647f commit 9a75b3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/net/wireless/iwlwifi/mvm/rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,15 @@ static bool rs_tpc_perform(struct iwl_mvm *mvm,
int weak, strong;
int weak_tpt = IWL_INVALID_VALUE, strong_tpt = IWL_INVALID_VALUE;

#ifdef CONFIG_MAC80211_DEBUGFS
if (lq_sta->dbg_fixed_txp_reduction <= TPC_MAX_REDUCTION) {
IWL_DEBUG_RATE(mvm, "fixed tpc: %d",
lq_sta->dbg_fixed_txp_reduction);
lq_sta->lq.reduced_tpc = lq_sta->dbg_fixed_txp_reduction;
return cur != lq_sta->dbg_fixed_txp_reduction;
}
#endif

rcu_read_lock();
chanctx_conf = rcu_dereference(vif->chanctx_conf);
if (WARN_ON(!chanctx_conf))
Expand Down Expand Up @@ -2613,6 +2622,7 @@ void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
lq_sta->is_agg = 0;
#ifdef CONFIG_MAC80211_DEBUGFS
lq_sta->dbg_fixed_rate = 0;
lq_sta->dbg_fixed_txp_reduction = TPC_INVALID;
#endif
#ifdef CONFIG_IWLWIFI_DEBUGFS
iwl_mvm_reset_frame_stats(mvm, &mvm->drv_rx_stats);
Expand Down Expand Up @@ -3076,6 +3086,9 @@ static void rs_add_debugfs(void *mvm, void *mvm_sta, struct dentry *dir)
lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file =
debugfs_create_u8("tx_agg_tid_enable", S_IRUSR | S_IWUSR, dir,
&lq_sta->tx_agg_tid_en);
lq_sta->rs_sta_dbgfs_reduced_txp_file =
debugfs_create_u8("reduced_tpc", S_IRUSR | S_IWUSR, dir,
&lq_sta->dbg_fixed_txp_reduction);
}

static void rs_remove_debugfs(void *mvm, void *mvm_sta)
Expand All @@ -3084,6 +3097,7 @@ static void rs_remove_debugfs(void *mvm, void *mvm_sta)
debugfs_remove(lq_sta->rs_sta_dbgfs_scale_table_file);
debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file);
debugfs_remove(lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file);
debugfs_remove(lq_sta->rs_sta_dbgfs_reduced_txp_file);
}
#endif

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/iwlwifi/mvm/rs.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ struct iwl_lq_sta {
struct dentry *rs_sta_dbgfs_scale_table_file;
struct dentry *rs_sta_dbgfs_stats_table_file;
struct dentry *rs_sta_dbgfs_tx_agg_tid_en_file;
struct dentry *rs_sta_dbgfs_reduced_txp_file;
u32 dbg_fixed_rate;
u8 dbg_fixed_txp_reduction;
#endif
struct iwl_mvm *drv;

Expand Down

0 comments on commit 9a75b3d

Please sign in to comment.