aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-04-08 14:39:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:43 -0400
commit12b9681721adb34b7ec42aa973ab96692998153d (patch)
treef6394952e423ea0c953b823410e89d57eb22ee83 /drivers/net/wireless/iwlwifi/iwl-agn-rs.c
parentbd564261d7dd3660f7a5ba308a867c6bb23de6a2 (diff)
iwlwifi: Display decoded rate/mcs information
This patch adding MCS information in rate_scale_table, it help for debugging rate scaling algorithm, easy to understand what is the current rate scale table and matching modulation, plus the last mcs used for tx. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index b1818a3d1e5..786b11d52b4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -167,6 +167,8 @@ struct iwl_lq_sta {
167 167
168 /* used to be in sta_info */ 168 /* used to be in sta_info */
169 int last_txrate_idx; 169 int last_txrate_idx;
170 /* last tx rate_n_flags */
171 u32 last_rate_n_flags;
170}; 172};
171 173
172static void rs_rate_scale_perform(struct iwl_priv *priv, 174static void rs_rate_scale_perform(struct iwl_priv *priv,
@@ -249,6 +251,23 @@ static s32 expected_tpt_mimo3_40MHzSGI[IWL_RATE_COUNT] = {
249 0, 0, 0, 0, 160, 160, 219, 245, 261, 284, 294, 297, 300 251 0, 0, 0, 0, 160, 160, 219, 245, 261, 284, 294, 297, 300
250}; 252};
251 253
254/* mbps, mcs */
255const static struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_COUNT] = {
256 {"1", ""},
257 {"2", ""},
258 {"5.5", ""},
259 {"11", ""},
260 {"6", "BPSK 1/2"},
261 {"9", "BPSK 1/2"},
262 {"12", "QPSK 1/2"},
263 {"18", "QPSK 3/4"},
264 {"24", "16QAM 1/2"},
265 {"36", "16QAM 3/4"},
266 {"48", "64QAM 2/3"},
267 {"54", "64QAM 3/4"},
268 {"60", "64QAM 5/6"}
269};
270
252static inline u8 rs_extract_rate(u32 rate_n_flags) 271static inline u8 rs_extract_rate(u32 rate_n_flags)
253{ 272{
254 return (u8)(rate_n_flags & 0xFF); 273 return (u8)(rate_n_flags & 0xFF);
@@ -919,6 +938,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
919 * else look up the rate that was, finally, successful. 938 * else look up the rate that was, finally, successful.
920 */ 939 */
921 tx_rate = le32_to_cpu(table->rs_table[index].rate_n_flags); 940 tx_rate = le32_to_cpu(table->rs_table[index].rate_n_flags);
941 lq_sta->last_rate_n_flags = tx_rate;
922 rs_get_tbl_info_from_mcs(tx_rate, priv->band, &tbl_type, &rs_index); 942 rs_get_tbl_info_from_mcs(tx_rate, priv->band, &tbl_type, &rs_index);
923 943
924 /* Update frame history window with "success" if Tx got ACKed ... */ 944 /* Update frame history window with "success" if Tx got ACKed ... */
@@ -2826,6 +2846,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
2826 char *buff; 2846 char *buff;
2827 int desc = 0; 2847 int desc = 0;
2828 int i = 0; 2848 int i = 0;
2849 int index = 0;
2829 ssize_t ret; 2850 ssize_t ret;
2830 2851
2831 struct iwl_lq_sta *lq_sta = file->private_data; 2852 struct iwl_lq_sta *lq_sta = file->private_data;
@@ -2857,6 +2878,8 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
2857 (tbl->is_fat) ? "40MHz" : "20MHz"); 2878 (tbl->is_fat) ? "40MHz" : "20MHz");
2858 desc += sprintf(buff+desc, " %s\n", (tbl->is_SGI) ? "SGI" : ""); 2879 desc += sprintf(buff+desc, " %s\n", (tbl->is_SGI) ? "SGI" : "");
2859 } 2880 }
2881 desc += sprintf(buff+desc, "last tx rate=0x%X\n",
2882 lq_sta->last_rate_n_flags);
2860 desc += sprintf(buff+desc, "general:" 2883 desc += sprintf(buff+desc, "general:"
2861 "flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n", 2884 "flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n",
2862 lq_sta->lq.general_params.flags, 2885 lq_sta->lq.general_params.flags,
@@ -2877,10 +2900,19 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
2877 lq_sta->lq.general_params.start_rate_index[2], 2900 lq_sta->lq.general_params.start_rate_index[2],
2878 lq_sta->lq.general_params.start_rate_index[3]); 2901 lq_sta->lq.general_params.start_rate_index[3]);
2879 2902
2880 2903 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) {
2881 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) 2904 index = iwl_hwrate_to_plcp_idx(
2882 desc += sprintf(buff+desc, " rate[%d] 0x%X\n", 2905 le32_to_cpu(lq_sta->lq.rs_table[i].rate_n_flags));
2883 i, le32_to_cpu(lq_sta->lq.rs_table[i].rate_n_flags)); 2906 if (is_legacy(tbl->lq_type)) {
2907 desc += sprintf(buff+desc, " rate[%d] 0x%X %smbps\n",
2908 i, le32_to_cpu(lq_sta->lq.rs_table[i].rate_n_flags),
2909 iwl_rate_mcs[index].mbps);
2910 } else {
2911 desc += sprintf(buff+desc, " rate[%d] 0x%X %smbps (%s)\n",
2912 i, le32_to_cpu(lq_sta->lq.rs_table[i].rate_n_flags),
2913 iwl_rate_mcs[index].mbps, iwl_rate_mcs[index].mcs);
2914 }
2915 }
2884 2916
2885 ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc); 2917 ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
2886 kfree(buff); 2918 kfree(buff);