diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 154 |
1 files changed, 128 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 21e0f6699daf..4a2ac9311ba8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -125,7 +125,7 @@ static ssize_t iwl_dbgfs_tx_statistics_read(struct file *file, | |||
125 | char __user *user_buf, | 125 | char __user *user_buf, |
126 | size_t count, loff_t *ppos) { | 126 | size_t count, loff_t *ppos) { |
127 | 127 | ||
128 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 128 | struct iwl_priv *priv = file->private_data; |
129 | char *buf; | 129 | char *buf; |
130 | int pos = 0; | 130 | int pos = 0; |
131 | 131 | ||
@@ -184,7 +184,7 @@ static ssize_t iwl_dbgfs_rx_statistics_read(struct file *file, | |||
184 | char __user *user_buf, | 184 | char __user *user_buf, |
185 | size_t count, loff_t *ppos) { | 185 | size_t count, loff_t *ppos) { |
186 | 186 | ||
187 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 187 | struct iwl_priv *priv = file->private_data; |
188 | char *buf; | 188 | char *buf; |
189 | int pos = 0; | 189 | int pos = 0; |
190 | int cnt; | 190 | int cnt; |
@@ -232,7 +232,7 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, | |||
232 | ssize_t ret; | 232 | ssize_t ret; |
233 | int i; | 233 | int i; |
234 | int pos = 0; | 234 | int pos = 0; |
235 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 235 | struct iwl_priv *priv = file->private_data; |
236 | size_t bufsz; | 236 | size_t bufsz; |
237 | 237 | ||
238 | /* default is to dump the entire data segment */ | 238 | /* default is to dump the entire data segment */ |
@@ -306,7 +306,7 @@ static ssize_t iwl_dbgfs_sram_write(struct file *file, | |||
306 | static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, | 306 | static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, |
307 | size_t count, loff_t *ppos) | 307 | size_t count, loff_t *ppos) |
308 | { | 308 | { |
309 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 309 | struct iwl_priv *priv = file->private_data; |
310 | struct iwl_station_entry *station; | 310 | struct iwl_station_entry *station; |
311 | int max_sta = priv->hw_params.max_stations; | 311 | int max_sta = priv->hw_params.max_stations; |
312 | char *buf; | 312 | char *buf; |
@@ -376,7 +376,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, | |||
376 | loff_t *ppos) | 376 | loff_t *ppos) |
377 | { | 377 | { |
378 | ssize_t ret; | 378 | ssize_t ret; |
379 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 379 | struct iwl_priv *priv = file->private_data; |
380 | int pos = 0, ofs = 0, buf_size = 0; | 380 | int pos = 0, ofs = 0, buf_size = 0; |
381 | const u8 *ptr; | 381 | const u8 *ptr; |
382 | char *buf; | 382 | char *buf; |
@@ -420,6 +420,23 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, | |||
420 | return ret; | 420 | return ret; |
421 | } | 421 | } |
422 | 422 | ||
423 | static ssize_t iwl_dbgfs_log_event_read(struct file *file, | ||
424 | char __user *user_buf, | ||
425 | size_t count, loff_t *ppos) | ||
426 | { | ||
427 | struct iwl_priv *priv = file->private_data; | ||
428 | char *buf; | ||
429 | int pos = 0; | ||
430 | ssize_t ret = -ENOMEM; | ||
431 | |||
432 | pos = priv->cfg->ops->lib->dump_nic_event_log(priv, true, &buf, true); | ||
433 | if (pos && buf) { | ||
434 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
435 | kfree(buf); | ||
436 | } | ||
437 | return ret; | ||
438 | } | ||
439 | |||
423 | static ssize_t iwl_dbgfs_log_event_write(struct file *file, | 440 | static ssize_t iwl_dbgfs_log_event_write(struct file *file, |
424 | const char __user *user_buf, | 441 | const char __user *user_buf, |
425 | size_t count, loff_t *ppos) | 442 | size_t count, loff_t *ppos) |
@@ -436,7 +453,8 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file, | |||
436 | if (sscanf(buf, "%d", &event_log_flag) != 1) | 453 | if (sscanf(buf, "%d", &event_log_flag) != 1) |
437 | return -EFAULT; | 454 | return -EFAULT; |
438 | if (event_log_flag == 1) | 455 | if (event_log_flag == 1) |
439 | priv->cfg->ops->lib->dump_nic_event_log(priv, true); | 456 | priv->cfg->ops->lib->dump_nic_event_log(priv, true, |
457 | NULL, false); | ||
440 | 458 | ||
441 | return count; | 459 | return count; |
442 | } | 460 | } |
@@ -446,7 +464,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file, | |||
446 | static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, | 464 | static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, |
447 | size_t count, loff_t *ppos) | 465 | size_t count, loff_t *ppos) |
448 | { | 466 | { |
449 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 467 | struct iwl_priv *priv = file->private_data; |
450 | struct ieee80211_channel *channels = NULL; | 468 | struct ieee80211_channel *channels = NULL; |
451 | const struct ieee80211_supported_band *supp_band = NULL; | 469 | const struct ieee80211_supported_band *supp_band = NULL; |
452 | int pos = 0, i, bufsz = PAGE_SIZE; | 470 | int pos = 0, i, bufsz = PAGE_SIZE; |
@@ -519,7 +537,7 @@ static ssize_t iwl_dbgfs_status_read(struct file *file, | |||
519 | char __user *user_buf, | 537 | char __user *user_buf, |
520 | size_t count, loff_t *ppos) { | 538 | size_t count, loff_t *ppos) { |
521 | 539 | ||
522 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 540 | struct iwl_priv *priv = file->private_data; |
523 | char buf[512]; | 541 | char buf[512]; |
524 | int pos = 0; | 542 | int pos = 0; |
525 | const size_t bufsz = sizeof(buf); | 543 | const size_t bufsz = sizeof(buf); |
@@ -567,7 +585,7 @@ static ssize_t iwl_dbgfs_interrupt_read(struct file *file, | |||
567 | char __user *user_buf, | 585 | char __user *user_buf, |
568 | size_t count, loff_t *ppos) { | 586 | size_t count, loff_t *ppos) { |
569 | 587 | ||
570 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 588 | struct iwl_priv *priv = file->private_data; |
571 | int pos = 0; | 589 | int pos = 0; |
572 | int cnt = 0; | 590 | int cnt = 0; |
573 | char *buf; | 591 | char *buf; |
@@ -654,7 +672,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file, | |||
654 | static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf, | 672 | static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf, |
655 | size_t count, loff_t *ppos) | 673 | size_t count, loff_t *ppos) |
656 | { | 674 | { |
657 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 675 | struct iwl_priv *priv = file->private_data; |
658 | int pos = 0, i; | 676 | int pos = 0, i; |
659 | char buf[256]; | 677 | char buf[256]; |
660 | const size_t bufsz = sizeof(buf); | 678 | const size_t bufsz = sizeof(buf); |
@@ -677,7 +695,7 @@ static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf, | |||
677 | static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf, | 695 | static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf, |
678 | size_t count, loff_t *ppos) | 696 | size_t count, loff_t *ppos) |
679 | { | 697 | { |
680 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 698 | struct iwl_priv *priv = file->private_data; |
681 | int pos = 0; | 699 | int pos = 0; |
682 | char buf[256]; | 700 | char buf[256]; |
683 | const size_t bufsz = sizeof(buf); | 701 | const size_t bufsz = sizeof(buf); |
@@ -703,7 +721,7 @@ static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file, | |||
703 | char __user *user_buf, | 721 | char __user *user_buf, |
704 | size_t count, loff_t *ppos) | 722 | size_t count, loff_t *ppos) |
705 | { | 723 | { |
706 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 724 | struct iwl_priv *priv = file->private_data; |
707 | struct iwl_tt_mgmt *tt = &priv->thermal_throttle; | 725 | struct iwl_tt_mgmt *tt = &priv->thermal_throttle; |
708 | struct iwl_tt_restriction *restriction; | 726 | struct iwl_tt_restriction *restriction; |
709 | char buf[100]; | 727 | char buf[100]; |
@@ -763,7 +781,7 @@ static ssize_t iwl_dbgfs_disable_ht40_read(struct file *file, | |||
763 | char __user *user_buf, | 781 | char __user *user_buf, |
764 | size_t count, loff_t *ppos) | 782 | size_t count, loff_t *ppos) |
765 | { | 783 | { |
766 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 784 | struct iwl_priv *priv = file->private_data; |
767 | char buf[100]; | 785 | char buf[100]; |
768 | int pos = 0; | 786 | int pos = 0; |
769 | const size_t bufsz = sizeof(buf); | 787 | const size_t bufsz = sizeof(buf); |
@@ -820,7 +838,7 @@ static ssize_t iwl_dbgfs_sleep_level_override_read(struct file *file, | |||
820 | char __user *user_buf, | 838 | char __user *user_buf, |
821 | size_t count, loff_t *ppos) | 839 | size_t count, loff_t *ppos) |
822 | { | 840 | { |
823 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 841 | struct iwl_priv *priv = file->private_data; |
824 | char buf[10]; | 842 | char buf[10]; |
825 | int pos, value; | 843 | int pos, value; |
826 | const size_t bufsz = sizeof(buf); | 844 | const size_t bufsz = sizeof(buf); |
@@ -838,7 +856,7 @@ static ssize_t iwl_dbgfs_current_sleep_command_read(struct file *file, | |||
838 | char __user *user_buf, | 856 | char __user *user_buf, |
839 | size_t count, loff_t *ppos) | 857 | size_t count, loff_t *ppos) |
840 | { | 858 | { |
841 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 859 | struct iwl_priv *priv = file->private_data; |
842 | char buf[200]; | 860 | char buf[200]; |
843 | int pos = 0, i; | 861 | int pos = 0, i; |
844 | const size_t bufsz = sizeof(buf); | 862 | const size_t bufsz = sizeof(buf); |
@@ -859,7 +877,7 @@ static ssize_t iwl_dbgfs_current_sleep_command_read(struct file *file, | |||
859 | } | 877 | } |
860 | 878 | ||
861 | DEBUGFS_READ_WRITE_FILE_OPS(sram); | 879 | DEBUGFS_READ_WRITE_FILE_OPS(sram); |
862 | DEBUGFS_WRITE_FILE_OPS(log_event); | 880 | DEBUGFS_READ_WRITE_FILE_OPS(log_event); |
863 | DEBUGFS_READ_FILE_OPS(nvm); | 881 | DEBUGFS_READ_FILE_OPS(nvm); |
864 | DEBUGFS_READ_FILE_OPS(stations); | 882 | DEBUGFS_READ_FILE_OPS(stations); |
865 | DEBUGFS_READ_FILE_OPS(channels); | 883 | DEBUGFS_READ_FILE_OPS(channels); |
@@ -976,7 +994,7 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file, | |||
976 | char __user *user_buf, | 994 | char __user *user_buf, |
977 | size_t count, loff_t *ppos) { | 995 | size_t count, loff_t *ppos) { |
978 | 996 | ||
979 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 997 | struct iwl_priv *priv = file->private_data; |
980 | struct iwl_tx_queue *txq; | 998 | struct iwl_tx_queue *txq; |
981 | struct iwl_queue *q; | 999 | struct iwl_queue *q; |
982 | char *buf; | 1000 | char *buf; |
@@ -1022,7 +1040,7 @@ static ssize_t iwl_dbgfs_rx_queue_read(struct file *file, | |||
1022 | char __user *user_buf, | 1040 | char __user *user_buf, |
1023 | size_t count, loff_t *ppos) { | 1041 | size_t count, loff_t *ppos) { |
1024 | 1042 | ||
1025 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 1043 | struct iwl_priv *priv = file->private_data; |
1026 | struct iwl_rx_queue *rxq = &priv->rxq; | 1044 | struct iwl_rx_queue *rxq = &priv->rxq; |
1027 | char buf[256]; | 1045 | char buf[256]; |
1028 | int pos = 0; | 1046 | int pos = 0; |
@@ -1068,7 +1086,7 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file, | |||
1068 | char __user *user_buf, | 1086 | char __user *user_buf, |
1069 | size_t count, loff_t *ppos) | 1087 | size_t count, loff_t *ppos) |
1070 | { | 1088 | { |
1071 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 1089 | struct iwl_priv *priv = file->private_data; |
1072 | int pos = 0; | 1090 | int pos = 0; |
1073 | char *buf; | 1091 | char *buf; |
1074 | int bufsz = sizeof(struct statistics_rx_phy) * 20 + | 1092 | int bufsz = sizeof(struct statistics_rx_phy) * 20 + |
@@ -1369,6 +1387,9 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file, | |||
1369 | accum_ht->agg_mpdu_cnt); | 1387 | accum_ht->agg_mpdu_cnt); |
1370 | pos += scnprintf(buf + pos, bufsz - pos, "agg_cnt:\t\t%u\t\t\t%u\n", | 1388 | pos += scnprintf(buf + pos, bufsz - pos, "agg_cnt:\t\t%u\t\t\t%u\n", |
1371 | le32_to_cpu(ht->agg_cnt), accum_ht->agg_cnt); | 1389 | le32_to_cpu(ht->agg_cnt), accum_ht->agg_cnt); |
1390 | pos += scnprintf(buf + pos, bufsz - pos, "unsupport_mcs:\t\t%u\t\t\t%u\n", | ||
1391 | le32_to_cpu(ht->unsupport_mcs), | ||
1392 | accum_ht->unsupport_mcs); | ||
1372 | 1393 | ||
1373 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1394 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1374 | kfree(buf); | 1395 | kfree(buf); |
@@ -1379,7 +1400,7 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file, | |||
1379 | char __user *user_buf, | 1400 | char __user *user_buf, |
1380 | size_t count, loff_t *ppos) | 1401 | size_t count, loff_t *ppos) |
1381 | { | 1402 | { |
1382 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 1403 | struct iwl_priv *priv = file->private_data; |
1383 | int pos = 0; | 1404 | int pos = 0; |
1384 | char *buf; | 1405 | char *buf; |
1385 | int bufsz = (sizeof(struct statistics_tx) * 24) + 250; | 1406 | int bufsz = (sizeof(struct statistics_tx) * 24) + 250; |
@@ -1521,7 +1542,7 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file, | |||
1521 | char __user *user_buf, | 1542 | char __user *user_buf, |
1522 | size_t count, loff_t *ppos) | 1543 | size_t count, loff_t *ppos) |
1523 | { | 1544 | { |
1524 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 1545 | struct iwl_priv *priv = file->private_data; |
1525 | int pos = 0; | 1546 | int pos = 0; |
1526 | char *buf; | 1547 | char *buf; |
1527 | int bufsz = sizeof(struct statistics_general) * 4 + 250; | 1548 | int bufsz = sizeof(struct statistics_general) * 4 + 250; |
@@ -1612,7 +1633,7 @@ static ssize_t iwl_dbgfs_sensitivity_read(struct file *file, | |||
1612 | char __user *user_buf, | 1633 | char __user *user_buf, |
1613 | size_t count, loff_t *ppos) { | 1634 | size_t count, loff_t *ppos) { |
1614 | 1635 | ||
1615 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 1636 | struct iwl_priv *priv = file->private_data; |
1616 | int pos = 0; | 1637 | int pos = 0; |
1617 | int cnt = 0; | 1638 | int cnt = 0; |
1618 | char *buf; | 1639 | char *buf; |
@@ -1693,7 +1714,7 @@ static ssize_t iwl_dbgfs_chain_noise_read(struct file *file, | |||
1693 | char __user *user_buf, | 1714 | char __user *user_buf, |
1694 | size_t count, loff_t *ppos) { | 1715 | size_t count, loff_t *ppos) { |
1695 | 1716 | ||
1696 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 1717 | struct iwl_priv *priv = file->private_data; |
1697 | int pos = 0; | 1718 | int pos = 0; |
1698 | int cnt = 0; | 1719 | int cnt = 0; |
1699 | char *buf; | 1720 | char *buf; |
@@ -1751,7 +1772,7 @@ static ssize_t iwl_dbgfs_tx_power_read(struct file *file, | |||
1751 | char __user *user_buf, | 1772 | char __user *user_buf, |
1752 | size_t count, loff_t *ppos) { | 1773 | size_t count, loff_t *ppos) { |
1753 | 1774 | ||
1754 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 1775 | struct iwl_priv *priv = file->private_data; |
1755 | char buf[128]; | 1776 | char buf[128]; |
1756 | int pos = 0; | 1777 | int pos = 0; |
1757 | ssize_t ret; | 1778 | ssize_t ret; |
@@ -1802,7 +1823,7 @@ static ssize_t iwl_dbgfs_power_save_status_read(struct file *file, | |||
1802 | char __user *user_buf, | 1823 | char __user *user_buf, |
1803 | size_t count, loff_t *ppos) | 1824 | size_t count, loff_t *ppos) |
1804 | { | 1825 | { |
1805 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 1826 | struct iwl_priv *priv = file->private_data; |
1806 | char buf[60]; | 1827 | char buf[60]; |
1807 | int pos = 0; | 1828 | int pos = 0; |
1808 | const size_t bufsz = sizeof(buf); | 1829 | const size_t bufsz = sizeof(buf); |
@@ -1845,6 +1866,80 @@ static ssize_t iwl_dbgfs_clear_ucode_statistics_write(struct file *file, | |||
1845 | return count; | 1866 | return count; |
1846 | } | 1867 | } |
1847 | 1868 | ||
1869 | static ssize_t iwl_dbgfs_csr_write(struct file *file, | ||
1870 | const char __user *user_buf, | ||
1871 | size_t count, loff_t *ppos) | ||
1872 | { | ||
1873 | struct iwl_priv *priv = file->private_data; | ||
1874 | char buf[8]; | ||
1875 | int buf_size; | ||
1876 | int csr; | ||
1877 | |||
1878 | memset(buf, 0, sizeof(buf)); | ||
1879 | buf_size = min(count, sizeof(buf) - 1); | ||
1880 | if (copy_from_user(buf, user_buf, buf_size)) | ||
1881 | return -EFAULT; | ||
1882 | if (sscanf(buf, "%d", &csr) != 1) | ||
1883 | return -EFAULT; | ||
1884 | |||
1885 | if (priv->cfg->ops->lib->dump_csr) | ||
1886 | priv->cfg->ops->lib->dump_csr(priv); | ||
1887 | |||
1888 | return count; | ||
1889 | } | ||
1890 | |||
1891 | static ssize_t iwl_dbgfs_ucode_tracing_read(struct file *file, | ||
1892 | char __user *user_buf, | ||
1893 | size_t count, loff_t *ppos) { | ||
1894 | |||
1895 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | ||
1896 | int pos = 0; | ||
1897 | char buf[128]; | ||
1898 | const size_t bufsz = sizeof(buf); | ||
1899 | ssize_t ret; | ||
1900 | |||
1901 | pos += scnprintf(buf + pos, bufsz - pos, "ucode trace timer is %s\n", | ||
1902 | priv->event_log.ucode_trace ? "On" : "Off"); | ||
1903 | pos += scnprintf(buf + pos, bufsz - pos, "non_wraps_count:\t\t %u\n", | ||
1904 | priv->event_log.non_wraps_count); | ||
1905 | pos += scnprintf(buf + pos, bufsz - pos, "wraps_once_count:\t\t %u\n", | ||
1906 | priv->event_log.wraps_once_count); | ||
1907 | pos += scnprintf(buf + pos, bufsz - pos, "wraps_more_count:\t\t %u\n", | ||
1908 | priv->event_log.wraps_more_count); | ||
1909 | |||
1910 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
1911 | return ret; | ||
1912 | } | ||
1913 | |||
1914 | static ssize_t iwl_dbgfs_ucode_tracing_write(struct file *file, | ||
1915 | const char __user *user_buf, | ||
1916 | size_t count, loff_t *ppos) | ||
1917 | { | ||
1918 | struct iwl_priv *priv = file->private_data; | ||
1919 | char buf[8]; | ||
1920 | int buf_size; | ||
1921 | int trace; | ||
1922 | |||
1923 | memset(buf, 0, sizeof(buf)); | ||
1924 | buf_size = min(count, sizeof(buf) - 1); | ||
1925 | if (copy_from_user(buf, user_buf, buf_size)) | ||
1926 | return -EFAULT; | ||
1927 | if (sscanf(buf, "%d", &trace) != 1) | ||
1928 | return -EFAULT; | ||
1929 | |||
1930 | if (trace) { | ||
1931 | priv->event_log.ucode_trace = true; | ||
1932 | /* schedule the ucode timer to occur in UCODE_TRACE_PERIOD */ | ||
1933 | mod_timer(&priv->ucode_trace, | ||
1934 | jiffies + msecs_to_jiffies(UCODE_TRACE_PERIOD)); | ||
1935 | } else { | ||
1936 | priv->event_log.ucode_trace = false; | ||
1937 | del_timer_sync(&priv->ucode_trace); | ||
1938 | } | ||
1939 | |||
1940 | return count; | ||
1941 | } | ||
1942 | |||
1848 | DEBUGFS_READ_FILE_OPS(rx_statistics); | 1943 | DEBUGFS_READ_FILE_OPS(rx_statistics); |
1849 | DEBUGFS_READ_FILE_OPS(tx_statistics); | 1944 | DEBUGFS_READ_FILE_OPS(tx_statistics); |
1850 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); | 1945 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); |
@@ -1859,6 +1954,8 @@ DEBUGFS_READ_FILE_OPS(tx_power); | |||
1859 | DEBUGFS_READ_FILE_OPS(power_save_status); | 1954 | DEBUGFS_READ_FILE_OPS(power_save_status); |
1860 | DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); | 1955 | DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); |
1861 | DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); | 1956 | DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); |
1957 | DEBUGFS_WRITE_FILE_OPS(csr); | ||
1958 | DEBUGFS_READ_WRITE_FILE_OPS(ucode_tracing); | ||
1862 | 1959 | ||
1863 | /* | 1960 | /* |
1864 | * Create the debugfs files and directories | 1961 | * Create the debugfs files and directories |
@@ -1889,7 +1986,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1889 | DEBUGFS_ADD_DIR(debug, dbgfs->dir_drv); | 1986 | DEBUGFS_ADD_DIR(debug, dbgfs->dir_drv); |
1890 | DEBUGFS_ADD_FILE(nvm, data, S_IRUSR); | 1987 | DEBUGFS_ADD_FILE(nvm, data, S_IRUSR); |
1891 | DEBUGFS_ADD_FILE(sram, data, S_IWUSR | S_IRUSR); | 1988 | DEBUGFS_ADD_FILE(sram, data, S_IWUSR | S_IRUSR); |
1892 | DEBUGFS_ADD_FILE(log_event, data, S_IWUSR); | 1989 | DEBUGFS_ADD_FILE(log_event, data, S_IWUSR | S_IRUSR); |
1893 | DEBUGFS_ADD_FILE(stations, data, S_IRUSR); | 1990 | DEBUGFS_ADD_FILE(stations, data, S_IRUSR); |
1894 | DEBUGFS_ADD_FILE(channels, data, S_IRUSR); | 1991 | DEBUGFS_ADD_FILE(channels, data, S_IRUSR); |
1895 | DEBUGFS_ADD_FILE(status, data, S_IRUSR); | 1992 | DEBUGFS_ADD_FILE(status, data, S_IRUSR); |
@@ -1909,12 +2006,14 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1909 | DEBUGFS_ADD_FILE(power_save_status, debug, S_IRUSR); | 2006 | DEBUGFS_ADD_FILE(power_save_status, debug, S_IRUSR); |
1910 | DEBUGFS_ADD_FILE(clear_ucode_statistics, debug, S_IWUSR); | 2007 | DEBUGFS_ADD_FILE(clear_ucode_statistics, debug, S_IWUSR); |
1911 | DEBUGFS_ADD_FILE(clear_traffic_statistics, debug, S_IWUSR); | 2008 | DEBUGFS_ADD_FILE(clear_traffic_statistics, debug, S_IWUSR); |
2009 | DEBUGFS_ADD_FILE(csr, debug, S_IWUSR); | ||
1912 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { | 2010 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { |
1913 | DEBUGFS_ADD_FILE(ucode_rx_stats, debug, S_IRUSR); | 2011 | DEBUGFS_ADD_FILE(ucode_rx_stats, debug, S_IRUSR); |
1914 | DEBUGFS_ADD_FILE(ucode_tx_stats, debug, S_IRUSR); | 2012 | DEBUGFS_ADD_FILE(ucode_tx_stats, debug, S_IRUSR); |
1915 | DEBUGFS_ADD_FILE(ucode_general_stats, debug, S_IRUSR); | 2013 | DEBUGFS_ADD_FILE(ucode_general_stats, debug, S_IRUSR); |
1916 | DEBUGFS_ADD_FILE(sensitivity, debug, S_IRUSR); | 2014 | DEBUGFS_ADD_FILE(sensitivity, debug, S_IRUSR); |
1917 | DEBUGFS_ADD_FILE(chain_noise, debug, S_IRUSR); | 2015 | DEBUGFS_ADD_FILE(chain_noise, debug, S_IRUSR); |
2016 | DEBUGFS_ADD_FILE(ucode_tracing, debug, S_IWUSR | S_IRUSR); | ||
1918 | } | 2017 | } |
1919 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); | 2018 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); |
1920 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, | 2019 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, |
@@ -1966,6 +2065,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
1966 | file_clear_ucode_statistics); | 2065 | file_clear_ucode_statistics); |
1967 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. | 2066 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. |
1968 | file_clear_traffic_statistics); | 2067 | file_clear_traffic_statistics); |
2068 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_csr); | ||
1969 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { | 2069 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { |
1970 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. | 2070 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. |
1971 | file_ucode_rx_stats); | 2071 | file_ucode_rx_stats); |
@@ -1977,6 +2077,8 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
1977 | file_sensitivity); | 2077 | file_sensitivity); |
1978 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. | 2078 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. |
1979 | file_chain_noise); | 2079 | file_chain_noise); |
2080 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. | ||
2081 | file_ucode_tracing); | ||
1980 | } | 2082 | } |
1981 | DEBUGFS_REMOVE(priv->dbgfs->dir_debug); | 2083 | DEBUGFS_REMOVE(priv->dbgfs->dir_debug); |
1982 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); | 2084 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); |