aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 3fa06afce86a..4c88e8715df2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -161,6 +161,7 @@ struct iwl_lq_sta {
161#ifdef CONFIG_MAC80211_DEBUGFS 161#ifdef CONFIG_MAC80211_DEBUGFS
162 struct dentry *rs_sta_dbgfs_scale_table_file; 162 struct dentry *rs_sta_dbgfs_scale_table_file;
163 struct dentry *rs_sta_dbgfs_stats_table_file; 163 struct dentry *rs_sta_dbgfs_stats_table_file;
164 struct dentry *rs_sta_dbgfs_rate_scale_data_file;
164 struct dentry *rs_sta_dbgfs_tx_agg_tid_en_file; 165 struct dentry *rs_sta_dbgfs_tx_agg_tid_en_file;
165 u32 dbg_fixed_rate; 166 u32 dbg_fixed_rate;
166#endif 167#endif
@@ -2984,6 +2985,43 @@ static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
2984 .open = open_file_generic, 2985 .open = open_file_generic,
2985}; 2986};
2986 2987
2988static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file,
2989 char __user *user_buf, size_t count, loff_t *ppos)
2990{
2991 char buff[120];
2992 int desc = 0;
2993 ssize_t ret;
2994
2995 struct iwl_lq_sta *lq_sta = file->private_data;
2996 struct iwl_priv *priv;
2997 struct iwl_scale_tbl_info *tbl = &lq_sta->lq_info[lq_sta->active_tbl];
2998
2999 priv = lq_sta->drv;
3000
3001 if (is_Ht(tbl->lq_type))
3002 desc += sprintf(buff+desc,
3003 "Bit Rate= %d Mb/s\n",
3004 tbl->expected_tpt[lq_sta->last_txrate_idx]);
3005 else
3006 desc += sprintf(buff+desc,
3007 "Bit Rate= %d Mb/s\n",
3008 iwl_rates[lq_sta->last_txrate_idx].ieee >> 1);
3009 desc += sprintf(buff+desc,
3010 "Signal Level= %d dBm\tNoise Level= %d dBm\n",
3011 priv->last_rx_rssi, priv->last_rx_noise);
3012 desc += sprintf(buff+desc,
3013 "Tsf= 0x%llx\tBeacon time= 0x%08X\n",
3014 priv->last_tsf, priv->last_beacon_time);
3015
3016 ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
3017 return ret;
3018}
3019
3020static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = {
3021 .read = rs_sta_dbgfs_rate_scale_data_read,
3022 .open = open_file_generic,
3023};
3024
2987static void rs_add_debugfs(void *priv, void *priv_sta, 3025static void rs_add_debugfs(void *priv, void *priv_sta,
2988 struct dentry *dir) 3026 struct dentry *dir)
2989{ 3027{
@@ -2994,6 +3032,9 @@ static void rs_add_debugfs(void *priv, void *priv_sta,
2994 lq_sta->rs_sta_dbgfs_stats_table_file = 3032 lq_sta->rs_sta_dbgfs_stats_table_file =
2995 debugfs_create_file("rate_stats_table", 0600, dir, 3033 debugfs_create_file("rate_stats_table", 0600, dir,
2996 lq_sta, &rs_sta_dbgfs_stats_table_ops); 3034 lq_sta, &rs_sta_dbgfs_stats_table_ops);
3035 lq_sta->rs_sta_dbgfs_rate_scale_data_file =
3036 debugfs_create_file("rate_scale_data", 0600, dir,
3037 lq_sta, &rs_sta_dbgfs_rate_scale_data_ops);
2997 lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file = 3038 lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file =
2998 debugfs_create_u8("tx_agg_tid_enable", 0600, dir, 3039 debugfs_create_u8("tx_agg_tid_enable", 0600, dir,
2999 &lq_sta->tx_agg_tid_en); 3040 &lq_sta->tx_agg_tid_en);
@@ -3005,6 +3046,7 @@ static void rs_remove_debugfs(void *priv, void *priv_sta)
3005 struct iwl_lq_sta *lq_sta = priv_sta; 3046 struct iwl_lq_sta *lq_sta = priv_sta;
3006 debugfs_remove(lq_sta->rs_sta_dbgfs_scale_table_file); 3047 debugfs_remove(lq_sta->rs_sta_dbgfs_scale_table_file);
3007 debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file); 3048 debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file);
3049 debugfs_remove(lq_sta->rs_sta_dbgfs_rate_scale_data_file);
3008 debugfs_remove(lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file); 3050 debugfs_remove(lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file);
3009} 3051}
3010#endif 3052#endif