aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2007-09-26 23:27:38 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:53:24 -0400
commit5ae212c9273deb417bcc458d1dfb54ef880e5516 (patch)
tree4f3a940e748b15889925c03ed5c9aeb25d0edb38 /drivers/net/wireless/iwlwifi
parent93dc646adb94127ca1c2e74275a85265ec57b9af (diff)
[PATCH] iwlwifi: add read rate scale table debugfs function
This patch adds read rate scale table debugfs function for 4965 rate scaling module. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c67
1 files changed, 61 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index e849ab5aa80f..e3a0ccaf71fe 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -121,6 +121,9 @@ struct iwl_rate_scale_priv {
121 u16 active_rate_basic; 121 u16 active_rate_basic;
122 struct iwl_link_quality_cmd lq; 122 struct iwl_link_quality_cmd lq;
123 struct iwl_scale_tbl_info lq_info[LQ_SIZE]; 123 struct iwl_scale_tbl_info lq_info[LQ_SIZE];
124#ifdef CONFIG_MAC80211_DEBUGFS
125 struct dentry *rs_sta_dbgfs_scale_table_file;
126#endif
124}; 127};
125 128
126static void rs_rate_scale_perform(struct iwl_priv *priv, 129static void rs_rate_scale_perform(struct iwl_priv *priv,
@@ -2000,19 +2003,71 @@ static void rs_free_sta(void *priv, void *priv_sta)
2000 2003
2001 2004
2002#ifdef CONFIG_MAC80211_DEBUGFS 2005#ifdef CONFIG_MAC80211_DEBUGFS
2006static int open_file_generic(struct inode *inode, struct file *file)
2007{
2008 file->private_data = inode->i_private;
2009 return 0;
2010}
2011
2012static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
2013 char __user *user_buf, size_t count, loff_t *ppos)
2014{
2015 char buff[1024];
2016 int desc = 0;
2017 int i = 0;
2018
2019 struct iwl_rate_scale_priv *rs_priv = file->private_data;
2020
2021 desc += sprintf(buff+desc, "sta_id %d\n", rs_priv->lq.sta_id);
2022 desc += sprintf(buff+desc, "failed=%d success=%d rate=%X\n",
2023 rs_priv->total_failed, rs_priv->total_success,
2024 rs_priv->active_rate);
2025 desc += sprintf(buff+desc, "general:"
2026 "flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n",
2027 rs_priv->lq.general_params.flags,
2028 rs_priv->lq.general_params.mimo_delimiter,
2029 rs_priv->lq.general_params.single_stream_ant_msk,
2030 rs_priv->lq.general_params.dual_stream_ant_msk);
2031
2032 desc += sprintf(buff+desc, "agg:"
2033 "time_limit=%d dist_start_th=%d frame_cnt_limit=%d\n",
2034 le16_to_cpu(rs_priv->lq.agg_params.agg_time_limit),
2035 rs_priv->lq.agg_params.agg_dis_start_th,
2036 rs_priv->lq.agg_params.agg_frame_cnt_limit);
2037
2038 desc += sprintf(buff+desc,
2039 "Start idx [0]=0x%x [1]=0x%x [2]=0x%x [3]=0x%x\n",
2040 rs_priv->lq.general_params.start_rate_index[0],
2041 rs_priv->lq.general_params.start_rate_index[1],
2042 rs_priv->lq.general_params.start_rate_index[2],
2043 rs_priv->lq.general_params.start_rate_index[3]);
2044
2045
2046 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++)
2047 desc += sprintf(buff+desc, " rate[%d] 0x%X\n",
2048 i, le32_to_cpu(rs_priv->lq.rs_table[i].rate_n_flags));
2049
2050 return simple_read_from_buffer(user_buf, count, ppos, buff, desc);
2051}
2052
2053static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
2054 .read = rs_sta_dbgfs_scale_table_read,
2055 .open = open_file_generic,
2056};
2057
2003static void rs_add_debugfs(void *priv, void *priv_sta, 2058static void rs_add_debugfs(void *priv, void *priv_sta,
2004 struct dentry *dir) 2059 struct dentry *dir)
2005{ 2060{
2006 /* struct iwl_rate_scale_priv *rs_priv = priv_sta; */ 2061 struct iwl_rate_scale_priv *rs_priv = priv_sta;
2007 IWL_DEBUG_RATE("%s enter\n", __FUNCTION__); 2062 rs_priv->rs_sta_dbgfs_scale_table_file =
2008 IWL_DEBUG_RATE("%s leave\n", __FUNCTION__); 2063 debugfs_create_file("rate_scale_table", 0444, dir,
2064 rs_priv, &rs_sta_dbgfs_scale_table_ops);
2009} 2065}
2010 2066
2011static void rs_remove_debugfs(void *priv, void *priv_sta) 2067static void rs_remove_debugfs(void *priv, void *priv_sta)
2012{ 2068{
2013 /* struct iwl_rate_scale_priv *rs_priv = priv_sta; */ 2069 struct iwl_rate_scale_priv *rs_priv = priv_sta;
2014 IWL_DEBUG_RATE("%s enter\n", __FUNCTION__); 2070 debugfs_remove(rs_priv->rs_sta_dbgfs_scale_table_file);
2015 IWL_DEBUG_RATE("%s leave\n", __FUNCTION__);
2016} 2071}
2017#endif 2072#endif
2018 2073