aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-07-14 11:09:55 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-07-23 11:41:32 -0400
commitffb7d896b3bc21e09d77fed45b52b2ff4ce213e5 (patch)
treef3c55717a2d3dd61d73de5846d3423b9b9b50eaf /drivers/net/wireless/iwlwifi
parent7980fba54ec42f7c206b2bb469baeb3a0a2e8a93 (diff)
iwlagn: add bluetooth stats to debugfs
For WiFi/BT combo devices, add bluetooth statistics counter read function to debugfs. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c87
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c13
8 files changed, 113 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index c281d07ec5e5..8848333bc3a9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -222,6 +222,7 @@ static struct iwl_lib_ops iwl1000_lib = {
222 .rx_stats_read = iwl_ucode_rx_stats_read, 222 .rx_stats_read = iwl_ucode_rx_stats_read,
223 .tx_stats_read = iwl_ucode_tx_stats_read, 223 .tx_stats_read = iwl_ucode_tx_stats_read,
224 .general_stats_read = iwl_ucode_general_stats_read, 224 .general_stats_read = iwl_ucode_general_stats_read,
225 .bt_stats_read = iwl_ucode_bt_stats_read,
225 }, 226 },
226 .recover_from_tx_stall = iwl_bg_monitor_recover, 227 .recover_from_tx_stall = iwl_bg_monitor_recover,
227 .check_plcp_health = iwl_good_plcp_health, 228 .check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 27a776f2f8fa..d6531ad3906a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2285,6 +2285,7 @@ static struct iwl_lib_ops iwl4965_lib = {
2285 .rx_stats_read = iwl_ucode_rx_stats_read, 2285 .rx_stats_read = iwl_ucode_rx_stats_read,
2286 .tx_stats_read = iwl_ucode_tx_stats_read, 2286 .tx_stats_read = iwl_ucode_tx_stats_read,
2287 .general_stats_read = iwl_ucode_general_stats_read, 2287 .general_stats_read = iwl_ucode_general_stats_read,
2288 .bt_stats_read = iwl_ucode_bt_stats_read,
2288 }, 2289 },
2289 .recover_from_tx_stall = iwl_bg_monitor_recover, 2290 .recover_from_tx_stall = iwl_bg_monitor_recover,
2290 .check_plcp_health = iwl_good_plcp_health, 2291 .check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index a7077cd7afee..8093ce2804fb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -398,6 +398,7 @@ static struct iwl_lib_ops iwl5000_lib = {
398 .rx_stats_read = iwl_ucode_rx_stats_read, 398 .rx_stats_read = iwl_ucode_rx_stats_read,
399 .tx_stats_read = iwl_ucode_tx_stats_read, 399 .tx_stats_read = iwl_ucode_tx_stats_read,
400 .general_stats_read = iwl_ucode_general_stats_read, 400 .general_stats_read = iwl_ucode_general_stats_read,
401 .bt_stats_read = iwl_ucode_bt_stats_read,
401 }, 402 },
402 .recover_from_tx_stall = iwl_bg_monitor_recover, 403 .recover_from_tx_stall = iwl_bg_monitor_recover,
403 .check_plcp_health = iwl_good_plcp_health, 404 .check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index a4e58d85f889..58270529a0e4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -323,6 +323,7 @@ static struct iwl_lib_ops iwl6000_lib = {
323 .rx_stats_read = iwl_ucode_rx_stats_read, 323 .rx_stats_read = iwl_ucode_rx_stats_read,
324 .tx_stats_read = iwl_ucode_tx_stats_read, 324 .tx_stats_read = iwl_ucode_tx_stats_read,
325 .general_stats_read = iwl_ucode_general_stats_read, 325 .general_stats_read = iwl_ucode_general_stats_read,
326 .bt_stats_read = iwl_ucode_bt_stats_read,
326 }, 327 },
327 .recover_from_tx_stall = iwl_bg_monitor_recover, 328 .recover_from_tx_stall = iwl_bg_monitor_recover,
328 .check_plcp_health = iwl_good_plcp_health, 329 .check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
index 19d1e5e86261..f052c6d09b37 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
@@ -924,3 +924,90 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
924 kfree(buf); 924 kfree(buf);
925 return ret; 925 return ret;
926} 926}
927
928ssize_t iwl_ucode_bt_stats_read(struct file *file,
929 char __user *user_buf,
930 size_t count, loff_t *ppos)
931{
932 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
933 int pos = 0;
934 char *buf;
935 int bufsz = (sizeof(struct statistics_bt_activity) * 24) + 200;
936 ssize_t ret;
937 struct statistics_bt_activity *bt, *accum_bt;
938
939 if (!iwl_is_alive(priv))
940 return -EAGAIN;
941
942 /* make request to uCode to retrieve statistics information */
943 mutex_lock(&priv->mutex);
944 ret = iwl_send_statistics_request(priv, CMD_SYNC, false);
945 mutex_unlock(&priv->mutex);
946
947 if (ret) {
948 IWL_ERR(priv,
949 "Error sending statistics request: %zd\n", ret);
950 return -EAGAIN;
951 }
952 buf = kzalloc(bufsz, GFP_KERNEL);
953 if (!buf) {
954 IWL_ERR(priv, "Can not allocate Buffer\n");
955 return -ENOMEM;
956 }
957
958 /*
959 * the statistic information display here is based on
960 * the last statistics notification from uCode
961 * might not reflect the current uCode activity
962 */
963 bt = &priv->_agn.statistics_bt.general.activity;
964 accum_bt = &priv->_agn.accum_statistics_bt.general.activity;
965
966 pos += iwl_statistics_flag(priv, buf, bufsz);
967 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_BT:\n");
968 pos += scnprintf(buf + pos, bufsz - pos,
969 "\t\t\tcurrent\t\t\taccumulative\n");
970 pos += scnprintf(buf + pos, bufsz - pos,
971 "hi_priority_tx_req_cnt:\t\t%u\t\t\t%u\n",
972 le32_to_cpu(bt->hi_priority_tx_req_cnt),
973 accum_bt->hi_priority_tx_req_cnt);
974 pos += scnprintf(buf + pos, bufsz - pos,
975 "hi_priority_tx_denied_cnt:\t%u\t\t\t%u\n",
976 le32_to_cpu(bt->hi_priority_tx_denied_cnt),
977 accum_bt->hi_priority_tx_denied_cnt);
978 pos += scnprintf(buf + pos, bufsz - pos,
979 "lo_priority_tx_req_cnt:\t\t%u\t\t\t%u\n",
980 le32_to_cpu(bt->lo_priority_tx_req_cnt),
981 accum_bt->lo_priority_tx_req_cnt);
982 pos += scnprintf(buf + pos, bufsz - pos,
983 "lo_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
984 le32_to_cpu(bt->lo_priority_tx_denied_cnt),
985 accum_bt->lo_priority_tx_denied_cnt);
986 pos += scnprintf(buf + pos, bufsz - pos,
987 "hi_priority_rx_req_cnt:\t\t%u\t\t\t%u\n",
988 le32_to_cpu(bt->hi_priority_rx_req_cnt),
989 accum_bt->hi_priority_rx_req_cnt);
990 pos += scnprintf(buf + pos, bufsz - pos,
991 "hi_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
992 le32_to_cpu(bt->hi_priority_rx_denied_cnt),
993 accum_bt->hi_priority_rx_denied_cnt);
994 pos += scnprintf(buf + pos, bufsz - pos,
995 "lo_priority_rx_req_cnt:\t\t%u\t\t\t%u\n",
996 le32_to_cpu(bt->lo_priority_rx_req_cnt),
997 accum_bt->lo_priority_rx_req_cnt);
998 pos += scnprintf(buf + pos, bufsz - pos,
999 "lo_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
1000 le32_to_cpu(bt->lo_priority_rx_denied_cnt),
1001 accum_bt->lo_priority_rx_denied_cnt);
1002
1003 pos += scnprintf(buf + pos, bufsz - pos,
1004 "(rx)num_bt_kills:\t\t%u\t\t\t%u\n",
1005 le32_to_cpu(priv->_agn.statistics_bt.rx.
1006 general.num_bt_kills),
1007 priv->_agn.accum_statistics_bt.rx.
1008 general.num_bt_kills);
1009
1010 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1011 kfree(buf);
1012 return ret;
1013}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
index 59b1f25f0d85..bbdce5913ac7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
@@ -37,6 +37,8 @@ ssize_t iwl_ucode_tx_stats_read(struct file *file, char __user *user_buf,
37 size_t count, loff_t *ppos); 37 size_t count, loff_t *ppos);
38ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf, 38ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
39 size_t count, loff_t *ppos); 39 size_t count, loff_t *ppos);
40ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf,
41 size_t count, loff_t *ppos);
40#else 42#else
41static ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf, 43static ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf,
42 size_t count, loff_t *ppos) 44 size_t count, loff_t *ppos)
@@ -53,4 +55,9 @@ static ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user
53{ 55{
54 return 0; 56 return 0;
55} 57}
58static ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf,
59 size_t count, loff_t *ppos)
60{
61 return 0;
62}
56#endif 63#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 2954a52a5e83..b60cf4537890 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -125,6 +125,8 @@ struct iwl_debugfs_ops {
125 size_t count, loff_t *ppos); 125 size_t count, loff_t *ppos);
126 ssize_t (*general_stats_read)(struct file *file, char __user *user_buf, 126 ssize_t (*general_stats_read)(struct file *file, char __user *user_buf,
127 size_t count, loff_t *ppos); 127 size_t count, loff_t *ppos);
128 ssize_t (*bt_stats_read)(struct file *file, char __user *user_buf,
129 size_t count, loff_t *ppos);
128}; 130};
129 131
130struct iwl_temp_ops { 132struct iwl_temp_ops {
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 7b25d1468358..e96a1bb12783 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1519,6 +1519,16 @@ static ssize_t iwl_dbgfs_txfifo_flush_write(struct file *file,
1519 return count; 1519 return count;
1520} 1520}
1521 1521
1522static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,
1523 char __user *user_buf,
1524 size_t count, loff_t *ppos)
1525{
1526 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
1527
1528 return priv->cfg->ops->lib->debugfs_ops.bt_stats_read(file,
1529 user_buf, count, ppos);
1530}
1531
1522DEBUGFS_READ_FILE_OPS(rx_statistics); 1532DEBUGFS_READ_FILE_OPS(rx_statistics);
1523DEBUGFS_READ_FILE_OPS(tx_statistics); 1533DEBUGFS_READ_FILE_OPS(tx_statistics);
1524DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); 1534DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -1541,6 +1551,7 @@ DEBUGFS_READ_WRITE_FILE_OPS(force_reset);
1541DEBUGFS_READ_FILE_OPS(rxon_flags); 1551DEBUGFS_READ_FILE_OPS(rxon_flags);
1542DEBUGFS_READ_FILE_OPS(rxon_filter_flags); 1552DEBUGFS_READ_FILE_OPS(rxon_filter_flags);
1543DEBUGFS_WRITE_FILE_OPS(txfifo_flush); 1553DEBUGFS_WRITE_FILE_OPS(txfifo_flush);
1554DEBUGFS_READ_FILE_OPS(ucode_bt_stats);
1544 1555
1545/* 1556/*
1546 * Create the debugfs files and directories 1557 * Create the debugfs files and directories
@@ -1608,6 +1619,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1608 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); 1619 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR);
1609 if (priv->cfg->ucode_tracing) 1620 if (priv->cfg->ucode_tracing)
1610 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR); 1621 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
1622 if (priv->cfg->bt_statistics)
1623 DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR);
1611 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); 1624 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
1612 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); 1625 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
1613 if (priv->cfg->sensitivity_calib_by_driver) 1626 if (priv->cfg->sensitivity_calib_by_driver)