Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203786
b: refs/heads/master
c: ffb7d89
h: refs/heads/master
v: v3
  • Loading branch information
Wey-Yi Guy committed Jul 23, 2010
1 parent 2a3d8b1 commit 9fbb1b6
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7980fba54ec42f7c206b2bb469baeb3a0a2e8a93
refs/heads/master: ffb7d896b3bc21e09d77fed45b52b2ff4ce213e5
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ static struct iwl_lib_ops iwl1000_lib = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
.bt_stats_read = iwl_ucode_bt_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,7 @@ static struct iwl_lib_ops iwl4965_lib = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
.bt_stats_read = iwl_ucode_bt_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ static struct iwl_lib_ops iwl5000_lib = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
.bt_stats_read = iwl_ucode_bt_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-6000.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ static struct iwl_lib_ops iwl6000_lib = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
.bt_stats_read = iwl_ucode_bt_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health,
Expand Down
87 changes: 87 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,3 +924,90 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
kfree(buf);
return ret;
}

ssize_t iwl_ucode_bt_stats_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
int pos = 0;
char *buf;
int bufsz = (sizeof(struct statistics_bt_activity) * 24) + 200;
ssize_t ret;
struct statistics_bt_activity *bt, *accum_bt;

if (!iwl_is_alive(priv))
return -EAGAIN;

/* make request to uCode to retrieve statistics information */
mutex_lock(&priv->mutex);
ret = iwl_send_statistics_request(priv, CMD_SYNC, false);
mutex_unlock(&priv->mutex);

if (ret) {
IWL_ERR(priv,
"Error sending statistics request: %zd\n", ret);
return -EAGAIN;
}
buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) {
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM;
}

/*
* the statistic information display here is based on
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
bt = &priv->_agn.statistics_bt.general.activity;
accum_bt = &priv->_agn.accum_statistics_bt.general.activity;

pos += iwl_statistics_flag(priv, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "Statistics_BT:\n");
pos += scnprintf(buf + pos, bufsz - pos,
"\t\t\tcurrent\t\t\taccumulative\n");
pos += scnprintf(buf + pos, bufsz - pos,
"hi_priority_tx_req_cnt:\t\t%u\t\t\t%u\n",
le32_to_cpu(bt->hi_priority_tx_req_cnt),
accum_bt->hi_priority_tx_req_cnt);
pos += scnprintf(buf + pos, bufsz - pos,
"hi_priority_tx_denied_cnt:\t%u\t\t\t%u\n",
le32_to_cpu(bt->hi_priority_tx_denied_cnt),
accum_bt->hi_priority_tx_denied_cnt);
pos += scnprintf(buf + pos, bufsz - pos,
"lo_priority_tx_req_cnt:\t\t%u\t\t\t%u\n",
le32_to_cpu(bt->lo_priority_tx_req_cnt),
accum_bt->lo_priority_tx_req_cnt);
pos += scnprintf(buf + pos, bufsz - pos,
"lo_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
le32_to_cpu(bt->lo_priority_tx_denied_cnt),
accum_bt->lo_priority_tx_denied_cnt);
pos += scnprintf(buf + pos, bufsz - pos,
"hi_priority_rx_req_cnt:\t\t%u\t\t\t%u\n",
le32_to_cpu(bt->hi_priority_rx_req_cnt),
accum_bt->hi_priority_rx_req_cnt);
pos += scnprintf(buf + pos, bufsz - pos,
"hi_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
le32_to_cpu(bt->hi_priority_rx_denied_cnt),
accum_bt->hi_priority_rx_denied_cnt);
pos += scnprintf(buf + pos, bufsz - pos,
"lo_priority_rx_req_cnt:\t\t%u\t\t\t%u\n",
le32_to_cpu(bt->lo_priority_rx_req_cnt),
accum_bt->lo_priority_rx_req_cnt);
pos += scnprintf(buf + pos, bufsz - pos,
"lo_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
le32_to_cpu(bt->lo_priority_rx_denied_cnt),
accum_bt->lo_priority_rx_denied_cnt);

pos += scnprintf(buf + pos, bufsz - pos,
"(rx)num_bt_kills:\t\t%u\t\t\t%u\n",
le32_to_cpu(priv->_agn.statistics_bt.rx.
general.num_bt_kills),
priv->_agn.accum_statistics_bt.rx.
general.num_bt_kills);

ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
kfree(buf);
return ret;
}
7 changes: 7 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ssize_t iwl_ucode_tx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
#else
static ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
Expand All @@ -53,4 +55,9 @@ static ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user
{
return 0;
}
static ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}
#endif
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ struct iwl_debugfs_ops {
size_t count, loff_t *ppos);
ssize_t (*general_stats_read)(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
ssize_t (*bt_stats_read)(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
};

struct iwl_temp_ops {
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,16 @@ static ssize_t iwl_dbgfs_txfifo_flush_write(struct file *file,
return count;
}

static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct iwl_priv *priv = (struct iwl_priv *)file->private_data;

return priv->cfg->ops->lib->debugfs_ops.bt_stats_read(file,
user_buf, count, ppos);
}

DEBUGFS_READ_FILE_OPS(rx_statistics);
DEBUGFS_READ_FILE_OPS(tx_statistics);
DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
Expand All @@ -1541,6 +1551,7 @@ DEBUGFS_READ_WRITE_FILE_OPS(force_reset);
DEBUGFS_READ_FILE_OPS(rxon_flags);
DEBUGFS_READ_FILE_OPS(rxon_filter_flags);
DEBUGFS_WRITE_FILE_OPS(txfifo_flush);
DEBUGFS_READ_FILE_OPS(ucode_bt_stats);

/*
* Create the debugfs files and directories
Expand Down Expand Up @@ -1608,6 +1619,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR);
if (priv->cfg->ucode_tracing)
DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
if (priv->cfg->bt_statistics)
DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR);
DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
if (priv->cfg->sensitivity_calib_by_driver)
Expand Down

0 comments on commit 9fbb1b6

Please sign in to comment.