Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90813
b: refs/heads/master
c: db0589f
h: refs/heads/master
i:
  90811: 287270d
v: v3
  • Loading branch information
Abhijeet Kolekar authored and John W. Linville committed Apr 16, 2008
1 parent 95c156d commit 943a3e5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 29 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: 57aab75a39089744aba4bd126df2de526481b128
refs/heads/master: db0589f3b9443f2b57ea6daaec09c1ab0ac99cb0
71 changes: 43 additions & 28 deletions trunk/drivers/net/wireless/iwlwifi/iwl-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,14 @@ static ssize_t iwl_dbgfs_tx_statistics_read(struct file *file,
struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
char buf[256];
int pos = 0;
const size_t bufsz = sizeof(buf);

pos += sprintf(buf+pos, "mgmt: %u\n", priv->tx_stats[0].cnt);
pos += sprintf(buf+pos, "ctrl: %u\n", priv->tx_stats[1].cnt);
pos += sprintf(buf+pos, "data: %u\n", priv->tx_stats[2].cnt);
pos += scnprintf(buf + pos, bufsz - pos, "mgmt: %u\n",
priv->tx_stats[0].cnt);
pos += scnprintf(buf + pos, bufsz - pos, "ctrl: %u\n",
priv->tx_stats[1].cnt);
pos += scnprintf(buf + pos, bufsz - pos, "data: %u\n",
priv->tx_stats[2].cnt);

return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
}
Expand All @@ -117,10 +121,14 @@ static ssize_t iwl_dbgfs_rx_statistics_read(struct file *file,
struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
char buf[256];
int pos = 0;
const size_t bufsz = sizeof(buf);

pos += sprintf(buf+pos, "mgmt: %u\n", priv->rx_stats[0].cnt);
pos += sprintf(buf+pos, "ctrl: %u\n", priv->rx_stats[1].cnt);
pos += sprintf(buf+pos, "data: %u\n", priv->rx_stats[2].cnt);
pos += scnprintf(buf + pos, bufsz - pos, "mgmt: %u\n",
priv->rx_stats[0].cnt);
pos += scnprintf(buf + pos, bufsz - pos, "ctrl: %u\n",
priv->rx_stats[1].cnt);
pos += scnprintf(buf + pos, bufsz - pos, "data: %u\n",
priv->rx_stats[2].cnt);

return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
}
Expand All @@ -138,6 +146,7 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
int i;
int pos = 0;
struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
const size_t bufsz = sizeof(buf);

printk(KERN_DEBUG "offset is: 0x%x\tlen is: 0x%x\n",
priv->dbgfs->sram_offset, priv->dbgfs->sram_len);
Expand All @@ -159,9 +168,9 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
break;
}
}
pos += sprintf(buf+pos, "0x%08x ", val);
pos += scnprintf(buf + pos, bufsz - pos, "0x%08x ", val);
}
pos += sprintf(buf+pos, "\n");
pos += scnprintf(buf + pos, bufsz - pos, "\n");
iwl_release_nic_access(priv);

ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
Expand Down Expand Up @@ -210,44 +219,50 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf,
if(!buf)
return -ENOMEM;

pos += sprintf(buf+pos, "num of stations: %d\n\n",
pos += scnprintf(buf + pos, bufsz - pos, "num of stations: %d\n\n",
priv->num_stations);

for (i = 0; i < max_sta; i++) {
station = &priv->stations[i];
if (station->used) {
pos += sprintf(buf+pos, "station %d:\ngeneral data:\n",
i+1);
pos += scnprintf(buf + pos, bufsz - pos,
"station %d:\ngeneral data:\n", i+1);
print_mac(mac, station->sta.sta.addr);
pos += sprintf(buf+pos, "id: %u\n",
pos += scnprintf(buf + pos, bufsz - pos, "id: %u\n",
station->sta.sta.sta_id);
pos += sprintf(buf+pos, "mode: %u\n",
pos += scnprintf(buf + pos, bufsz - pos, "mode: %u\n",
station->sta.mode);
pos += sprintf(buf+pos, "flags: 0x%x\n",
pos += scnprintf(buf + pos, bufsz - pos,
"flags: 0x%x\n",
station->sta.station_flags_msk);
pos += sprintf(buf+pos, "ps_status: %u\n",
station->ps_status);

pos += sprintf(buf+pos, "tid data:\n");

pos += sprintf(buf+pos, "seq_num\t\ttxq_id\t");
pos += sprintf(buf+pos, "frame_count\twait_for_ba\t");
pos += sprintf(buf+pos, "start_idx\tbitmap0\t");
pos += sprintf(buf+pos, "bitmap1\trate_n_flags\n");
pos += scnprintf(buf + pos, bufsz - pos,
"ps_status: %u\n", station->ps_status);
pos += scnprintf(buf + pos, bufsz - pos, "tid data:\n");
pos += scnprintf(buf + pos, bufsz - pos,
"seq_num\t\ttxq_id\t");
pos += scnprintf(buf + pos, bufsz - pos,
"frame_count\twait_for_ba\t");
pos += scnprintf(buf + pos, bufsz - pos,
"start_idx\tbitmap0\t");
pos += scnprintf(buf + pos, bufsz - pos,
"bitmap1\trate_n_flags\n");

for (j = 0; j < MAX_TID_COUNT; j++) {
pos += sprintf(buf+pos, "[%d]:\t\t%u\t",
j, station->tid[j].seq_number);
pos += sprintf(buf+pos, "%u\t\t%u\t\t%u\t\t",
pos += scnprintf(buf + pos, bufsz - pos,
"[%d]:\t\t%u\t", j,
station->tid[j].seq_number);
pos += scnprintf(buf + pos, bufsz - pos,
"%u\t\t%u\t\t%u\t\t",
station->tid[j].agg.txq_id,
station->tid[j].agg.frame_count,
station->tid[j].agg.wait_for_ba);
pos += sprintf(buf+pos, "%u\t%llu\t%u\n",
pos += scnprintf(buf + pos, bufsz - pos,
"%u\t%llu\t%u\n",
station->tid[j].agg.start_idx,
(unsigned long long)station->tid[j].agg.bitmap,
station->tid[j].agg.rate_n_flags);
}
pos += sprintf(buf+pos, "\n");
pos += scnprintf(buf + pos, bufsz - pos, "\n");
}
}

Expand Down

0 comments on commit 943a3e5

Please sign in to comment.