Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135077
b: refs/heads/master
c: a412c80
h: refs/heads/master
i:
  135075: 5e56e04
v: v3
  • Loading branch information
Frank Seidel authored and John W. Linville committed Mar 5, 2009
1 parent 197afcc commit a608b0d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 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: 64abd80330baba9d87df2b952a7eec5af5158470
refs/heads/master: a412c8040d83366dcc24962207b8beed52f29344
11 changes: 9 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,11 +846,16 @@ static ssize_t iwl3945_sta_dbgfs_stats_table_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
char buff[1024];
char *buff;
int desc = 0;
int j;
ssize_t ret;
struct iwl3945_rs_sta *lq_sta = file->private_data;

buff = kmalloc(1024, GFP_KERNEL);
if (!buff)
return -ENOMEM;

desc += sprintf(buff + desc, "tx packets=%d last rate index=%d\n"
"rate=0x%X flush time %d\n",
lq_sta->tx_packets,
Expand All @@ -863,7 +868,9 @@ static ssize_t iwl3945_sta_dbgfs_stats_table_read(struct file *file,
lq_sta->win[j].success_counter,
lq_sta->win[j].success_ratio);
}
return simple_read_from_buffer(user_buf, count, ppos, buff, desc);
ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
kfree(buff);
return ret;
}

static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
Expand Down
23 changes: 19 additions & 4 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2520,12 +2520,17 @@ static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
char __user *user_buf, size_t count, loff_t *ppos)
{
char buff[1024];
char *buff;
int desc = 0;
int i = 0;
ssize_t ret;

struct iwl_lq_sta *lq_sta = file->private_data;

buff = kmalloc(1024, GFP_KERNEL);
if (!buff)
return -ENOMEM;

desc += sprintf(buff+desc, "sta_id %d\n", lq_sta->lq.sta_id);
desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n",
lq_sta->total_failed, lq_sta->total_success,
Expand Down Expand Up @@ -2557,7 +2562,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
desc += sprintf(buff+desc, " rate[%d] 0x%X\n",
i, le32_to_cpu(lq_sta->lq.rs_table[i].rate_n_flags));

return simple_read_from_buffer(user_buf, count, ppos, buff, desc);
ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
kfree(buff);
return ret;
}

static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
Expand All @@ -2568,11 +2575,17 @@ static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
char __user *user_buf, size_t count, loff_t *ppos)
{
char buff[1024];
char *buff;
int desc = 0;
int i, j;
ssize_t ret;

struct iwl_lq_sta *lq_sta = file->private_data;

buff = kmalloc(1024, GFP_KERNEL);
if (!buff)
return -ENOMEM;

for (i = 0; i < LQ_SIZE; i++) {
desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n"
"rate=0x%X\n",
Expand All @@ -2590,7 +2603,9 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
lq_sta->lq_info[i].win[j].success_ratio);
}
}
return simple_read_from_buffer(user_buf, count, ppos, buff, desc);
ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
kfree(buff);
return ret;
}

static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
Expand Down

0 comments on commit a608b0d

Please sign in to comment.