Permalink
Browse files

wl18xx: handle dbg aggr size vs rate in a dedicated function (DEBUG)

Size of the output is approximately 2 pages. I am using seq_file API
to avoid overflow of the output buffer and ensure that all chars are
going through to the user space.

Signed-off-by: Arkady Miasnikov <a-miasnikov@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information...
1 parent 5204326 commit 0858c6eb2f4717470231eeadc25c715e195dc0e4 Arkady Miasnikov committed with ariknem Jun 13, 2012
Showing with 45 additions and 2 deletions.
  1. +45 −2 drivers/net/wireless/ti/wl18xx/debugfs.c
@@ -138,8 +138,6 @@ WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, max_arp_queue_dep, "%u");
WL18XX_DEBUGFS_FWSTATS_FILE(rx_rate, rx_frames_per_rates, "%u");
-WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, tx_agg_vs_rate,
- AGGR_STATS_TX_AGG*AGGR_STATS_TX_RATE);
WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, rx_size,
AGGR_STATS_RX_SIZE_LEN);
@@ -169,6 +167,51 @@ WL18XX_DEBUGFS_FWSTATS_FILE(mem, tx_free_mem_blks, "%u");
WL18XX_DEBUGFS_FWSTATS_FILE(mem, fwlog_free_mem_blks, "%u");
WL18XX_DEBUGFS_FWSTATS_FILE(mem, fw_gen_free_mem_blks, "%u");
+static int aggr_size_tx_agg_vs_rate_print(struct seq_file *s, void *p)
+{
+ struct wl1271 *wl = s->private;
+ struct wl18xx_acx_statistics *stats = wl->stats.fw_stats;
+ int len = ARRAY_SIZE(stats->aggr_size.tx_agg_vs_rate);
+ u32 *tx_agg_vs_rate = stats->aggr_size.tx_agg_vs_rate;
+ int i, rate, agg_size;
+
+
+ wl1271_debugfs_update_stats(wl);
+
+ seq_printf(s, " ");
+ for (i = 0; i < AGGR_STATS_TX_AGG; i++)
+ seq_printf(s, "%02d ", i);
+ seq_printf(s, "\n");
+
+ for (i = 0; i < len; i++) {
+ rate = i / AGGR_STATS_TX_RATE;
+ agg_size = i % AGGR_STATS_TX_AGG;
+
+ if (agg_size == 0)
+ seq_printf(s, "MCS%02d ", rate);
+
+ seq_printf(s, "% 7d ", tx_agg_vs_rate[i]);
+
+ if (agg_size == (AGGR_STATS_TX_AGG - 1))
+ seq_printf(s, "\n");
+ }
+
+ return 0;
+}
+
+static int aggr_size_tx_agg_vs_rate_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, aggr_size_tx_agg_vs_rate_print,
+ inode->i_private);
+}
+
+static const struct file_operations aggr_size_tx_agg_vs_rate_ops = {
+ .open = aggr_size_tx_agg_vs_rate_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
+
static ssize_t conf_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{

0 comments on commit 0858c6e

Please sign in to comment.