Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66804
b: refs/heads/master
c: 98d7e09
h: refs/heads/master
v: v3
  • Loading branch information
Zhu Yi authored and David S. Miller committed Oct 10, 2007
1 parent a02b29d commit 1245223
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b696de23bb21b89f4a4c4fd6b12e26fe2cc4a37
refs/heads/master: 98d7e09af513da19389128f23d49893b11de81fa
72 changes: 70 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ struct iwl_rate_scale_priv {
struct iwl_link_quality_cmd lq;
struct iwl_scale_tbl_info lq_info[LQ_SIZE];
#ifdef CONFIG_MAC80211_DEBUGFS
struct dentry *rs_sta_dbgfs_scale_table_file;
struct dentry *rs_sta_dbgfs_scale_table_file;
struct iwl_rate dbg_fixed;
struct iwl_priv *drv;
#endif
};

Expand All @@ -136,6 +138,14 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
struct iwl_link_quality_cmd *tbl);


#ifdef CONFIG_MAC80211_DEBUGFS
static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
struct iwl_rate *mcs, int index);
#else
static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
struct iwl_rate *mcs, int index)
{}
#endif
static s32 expected_tpt_A[IWL_RATE_COUNT] = {
0, 0, 0, 0, 40, 57, 72, 98, 121, 154, 177, 186, 186
};
Expand Down Expand Up @@ -1866,6 +1876,9 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
IWL_DEBUG_HT("MIMO RATE 0x%X SISO MASK 0x%X\n", crl->active_siso_rate,
crl->active_mimo_rate);
#endif /*CONFIG_IWLWIFI_HT*/
#ifdef CONFIG_MAC80211_DEBUGFS
crl->drv = priv;
#endif

if (priv->assoc_station_added)
priv->lq_mngr.lq_ready = 1;
Expand All @@ -1885,6 +1898,8 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
struct iwl_rate new_rate;
struct iwl_scale_tbl_info tbl_type = { 0 };

rs_dbgfs_set_mcs(lq_data, tx_mcs, index);

rs_get_tbl_info_from_mcs(tx_mcs, lq_data->phymode,
&tbl_type, &rate_idx);

Expand Down Expand Up @@ -1919,6 +1934,8 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
ant_toggle_count = 1;
}
}

rs_dbgfs_set_mcs(lq_data, &new_rate, index);
lq_cmd->rs_table[index].rate_n_flags =
cpu_to_le32(new_rate.rate_n_flags);
repeat_rate--;
Expand Down Expand Up @@ -1947,6 +1964,7 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,

use_ht_possible = 0;

rs_dbgfs_set_mcs(lq_data, &new_rate, index);
lq_cmd->rs_table[index].rate_n_flags =
cpu_to_le32(new_rate.rate_n_flags);

Expand Down Expand Up @@ -2002,7 +2020,54 @@ static int open_file_generic(struct inode *inode, struct file *file)
file->private_data = inode->i_private;
return 0;
}
static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
struct iwl_rate *mcs, int index)
{
const u32 cck_rate = 0x820A;
if (rs_priv->dbg_fixed.rate_n_flags) {
if (index < 12)
mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags;
else
mcs->rate_n_flags = cck_rate;
IWL_DEBUG_RATE("Fixed rate ON\n");
return;
}

IWL_DEBUG_RATE("Fixed rate OFF\n");
}

static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
const char __user *user_buf, size_t count, loff_t *ppos)
{
struct iwl_rate_scale_priv *rs_priv = file->private_data;
char buf[64];
int buf_size;
u32 parsed_rate;

memset(buf, 0, sizeof(buf));
buf_size = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, buf_size))
return -EFAULT;

if (sscanf(buf, "%x", &parsed_rate) == 1)
rs_priv->dbg_fixed.rate_n_flags = parsed_rate;
else
rs_priv->dbg_fixed.rate_n_flags = 0;

rs_priv->active_rate = 0x0FFF;
rs_priv->active_siso_rate = 0x1FD0;
rs_priv->active_mimo_rate = 0x1FD0;

IWL_DEBUG_RATE("sta_id %d rate 0x%X\n",
rs_priv->lq.sta_id, rs_priv->dbg_fixed.rate_n_flags);

if (rs_priv->dbg_fixed.rate_n_flags) {
rs_fill_link_cmd(rs_priv, &rs_priv->dbg_fixed, &rs_priv->lq);
rs_send_lq_cmd(rs_priv->drv, &rs_priv->lq, CMD_ASYNC);
}

return count;
}
static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
char __user *user_buf, size_t count, loff_t *ppos)
{
Expand All @@ -2013,9 +2078,11 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
struct iwl_rate_scale_priv *rs_priv = file->private_data;

desc += sprintf(buff+desc, "sta_id %d\n", rs_priv->lq.sta_id);
desc += sprintf(buff+desc, "failed=%d success=%d rate=%X\n",
desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n",
rs_priv->total_failed, rs_priv->total_success,
rs_priv->active_rate);
desc += sprintf(buff+desc, "fixed rate 0x%X\n",
rs_priv->dbg_fixed.rate_n_flags);
desc += sprintf(buff+desc, "general:"
"flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n",
rs_priv->lq.general_params.flags,
Expand Down Expand Up @@ -2045,6 +2112,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
}

static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
.write = rs_sta_dbgfs_scale_table_write,
.read = rs_sta_dbgfs_scale_table_read,
.open = open_file_generic,
};
Expand Down

0 comments on commit 1245223

Please sign in to comment.