diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 912 |
1 files changed, 81 insertions, 831 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index b6e1b0ebe230..9659c5d01df9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -106,6 +106,26 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \ | |||
106 | .open = iwl_dbgfs_open_file_generic, \ | 106 | .open = iwl_dbgfs_open_file_generic, \ |
107 | }; | 107 | }; |
108 | 108 | ||
109 | int iwl_dbgfs_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz) | ||
110 | { | ||
111 | int p = 0; | ||
112 | |||
113 | p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", | ||
114 | le32_to_cpu(priv->statistics.flag)); | ||
115 | if (le32_to_cpu(priv->statistics.flag) & UCODE_STATISTICS_CLEAR_MSK) | ||
116 | p += scnprintf(buf + p, bufsz - p, | ||
117 | "\tStatistics have been cleared\n"); | ||
118 | p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", | ||
119 | (le32_to_cpu(priv->statistics.flag) & | ||
120 | UCODE_STATISTICS_FREQUENCY_MSK) | ||
121 | ? "2.4 GHz" : "5.2 GHz"); | ||
122 | p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", | ||
123 | (le32_to_cpu(priv->statistics.flag) & | ||
124 | UCODE_STATISTICS_NARROW_BAND_MSK) | ||
125 | ? "enabled" : "disabled"); | ||
126 | return p; | ||
127 | } | ||
128 | EXPORT_SYMBOL(iwl_dbgfs_statistics_flag); | ||
109 | 129 | ||
110 | static ssize_t iwl_dbgfs_tx_statistics_read(struct file *file, | 130 | static ssize_t iwl_dbgfs_tx_statistics_read(struct file *file, |
111 | char __user *user_buf, | 131 | char __user *user_buf, |
@@ -561,8 +581,6 @@ static ssize_t iwl_dbgfs_status_read(struct file *file, | |||
561 | test_bit(STATUS_POWER_PMI, &priv->status)); | 581 | test_bit(STATUS_POWER_PMI, &priv->status)); |
562 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_FW_ERROR:\t %d\n", | 582 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_FW_ERROR:\t %d\n", |
563 | test_bit(STATUS_FW_ERROR, &priv->status)); | 583 | test_bit(STATUS_FW_ERROR, &priv->status)); |
564 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_MODE_PENDING:\t %d\n", | ||
565 | test_bit(STATUS_MODE_PENDING, &priv->status)); | ||
566 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 584 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
567 | } | 585 | } |
568 | 586 | ||
@@ -661,7 +679,6 @@ static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf, | |||
661 | int pos = 0, i; | 679 | int pos = 0, i; |
662 | char buf[256]; | 680 | char buf[256]; |
663 | const size_t bufsz = sizeof(buf); | 681 | const size_t bufsz = sizeof(buf); |
664 | ssize_t ret; | ||
665 | 682 | ||
666 | for (i = 0; i < AC_NUM; i++) { | 683 | for (i = 0; i < AC_NUM; i++) { |
667 | pos += scnprintf(buf + pos, bufsz - pos, | 684 | pos += scnprintf(buf + pos, bufsz - pos, |
@@ -673,8 +690,7 @@ static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf, | |||
673 | priv->qos_data.def_qos_parm.ac[i].aifsn, | 690 | priv->qos_data.def_qos_parm.ac[i].aifsn, |
674 | priv->qos_data.def_qos_parm.ac[i].edca_txop); | 691 | priv->qos_data.def_qos_parm.ac[i].edca_txop); |
675 | } | 692 | } |
676 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 693 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
677 | return ret; | ||
678 | } | 694 | } |
679 | 695 | ||
680 | static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf, | 696 | static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf, |
@@ -684,7 +700,6 @@ static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf, | |||
684 | int pos = 0; | 700 | int pos = 0; |
685 | char buf[256]; | 701 | char buf[256]; |
686 | const size_t bufsz = sizeof(buf); | 702 | const size_t bufsz = sizeof(buf); |
687 | ssize_t ret; | ||
688 | 703 | ||
689 | pos += scnprintf(buf + pos, bufsz - pos, | 704 | pos += scnprintf(buf + pos, bufsz - pos, |
690 | "allow blinking: %s\n", | 705 | "allow blinking: %s\n", |
@@ -698,8 +713,7 @@ static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf, | |||
698 | priv->last_blink_time); | 713 | priv->last_blink_time); |
699 | } | 714 | } |
700 | 715 | ||
701 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 716 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
702 | return ret; | ||
703 | } | 717 | } |
704 | 718 | ||
705 | static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file, | 719 | static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file, |
@@ -712,7 +726,6 @@ static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file, | |||
712 | char buf[100]; | 726 | char buf[100]; |
713 | int pos = 0; | 727 | int pos = 0; |
714 | const size_t bufsz = sizeof(buf); | 728 | const size_t bufsz = sizeof(buf); |
715 | ssize_t ret; | ||
716 | 729 | ||
717 | pos += scnprintf(buf + pos, bufsz - pos, | 730 | pos += scnprintf(buf + pos, bufsz - pos, |
718 | "Thermal Throttling Mode: %s\n", | 731 | "Thermal Throttling Mode: %s\n", |
@@ -732,8 +745,7 @@ static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file, | |||
732 | "HT mode: %d\n", | 745 | "HT mode: %d\n", |
733 | restriction->is_ht); | 746 | restriction->is_ht); |
734 | } | 747 | } |
735 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 748 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
736 | return ret; | ||
737 | } | 749 | } |
738 | 750 | ||
739 | static ssize_t iwl_dbgfs_disable_ht40_write(struct file *file, | 751 | static ssize_t iwl_dbgfs_disable_ht40_write(struct file *file, |
@@ -770,13 +782,11 @@ static ssize_t iwl_dbgfs_disable_ht40_read(struct file *file, | |||
770 | char buf[100]; | 782 | char buf[100]; |
771 | int pos = 0; | 783 | int pos = 0; |
772 | const size_t bufsz = sizeof(buf); | 784 | const size_t bufsz = sizeof(buf); |
773 | ssize_t ret; | ||
774 | 785 | ||
775 | pos += scnprintf(buf + pos, bufsz - pos, | 786 | pos += scnprintf(buf + pos, bufsz - pos, |
776 | "11n 40MHz Mode: %s\n", | 787 | "11n 40MHz Mode: %s\n", |
777 | priv->disable_ht40 ? "Disabled" : "Enabled"); | 788 | priv->disable_ht40 ? "Disabled" : "Enabled"); |
778 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 789 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
779 | return ret; | ||
780 | } | 790 | } |
781 | 791 | ||
782 | static ssize_t iwl_dbgfs_sleep_level_override_write(struct file *file, | 792 | static ssize_t iwl_dbgfs_sleep_level_override_write(struct file *file, |
@@ -1044,474 +1054,13 @@ static ssize_t iwl_dbgfs_rx_queue_read(struct file *file, | |||
1044 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1054 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1045 | } | 1055 | } |
1046 | 1056 | ||
1047 | static int iwl_dbgfs_statistics_flag(struct iwl_priv *priv, char *buf, | ||
1048 | int bufsz) | ||
1049 | { | ||
1050 | int p = 0; | ||
1051 | |||
1052 | p += scnprintf(buf + p, bufsz - p, | ||
1053 | "Statistics Flag(0x%X):\n", | ||
1054 | le32_to_cpu(priv->statistics.flag)); | ||
1055 | if (le32_to_cpu(priv->statistics.flag) & UCODE_STATISTICS_CLEAR_MSK) | ||
1056 | p += scnprintf(buf + p, bufsz - p, | ||
1057 | "\tStatistics have been cleared\n"); | ||
1058 | p += scnprintf(buf + p, bufsz - p, | ||
1059 | "\tOperational Frequency: %s\n", | ||
1060 | (le32_to_cpu(priv->statistics.flag) & | ||
1061 | UCODE_STATISTICS_FREQUENCY_MSK) | ||
1062 | ? "2.4 GHz" : "5.2 GHz"); | ||
1063 | p += scnprintf(buf + p, bufsz - p, | ||
1064 | "\tTGj Narrow Band: %s\n", | ||
1065 | (le32_to_cpu(priv->statistics.flag) & | ||
1066 | UCODE_STATISTICS_NARROW_BAND_MSK) | ||
1067 | ? "enabled" : "disabled"); | ||
1068 | return p; | ||
1069 | } | ||
1070 | |||
1071 | static const char ucode_stats_header[] = | ||
1072 | "%-32s current acumulative delta max\n"; | ||
1073 | static const char ucode_stats_short_format[] = | ||
1074 | " %-30s %10u\n"; | ||
1075 | static const char ucode_stats_format[] = | ||
1076 | " %-30s %10u %10u %10u %10u\n"; | ||
1077 | |||
1078 | static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file, | 1057 | static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file, |
1079 | char __user *user_buf, | 1058 | char __user *user_buf, |
1080 | size_t count, loff_t *ppos) | 1059 | size_t count, loff_t *ppos) |
1081 | { | 1060 | { |
1082 | struct iwl_priv *priv = file->private_data; | 1061 | struct iwl_priv *priv = file->private_data; |
1083 | int pos = 0; | 1062 | return priv->cfg->ops->lib->debugfs_ops.rx_stats_read(file, |
1084 | char *buf; | 1063 | user_buf, count, ppos); |
1085 | int bufsz = sizeof(struct statistics_rx_phy) * 40 + | ||
1086 | sizeof(struct statistics_rx_non_phy) * 40 + | ||
1087 | sizeof(struct statistics_rx_ht_phy) * 40 + 400; | ||
1088 | ssize_t ret; | ||
1089 | struct statistics_rx_phy *ofdm, *accum_ofdm, *delta_ofdm, *max_ofdm; | ||
1090 | struct statistics_rx_phy *cck, *accum_cck, *delta_cck, *max_cck; | ||
1091 | struct statistics_rx_non_phy *general, *accum_general; | ||
1092 | struct statistics_rx_non_phy *delta_general, *max_general; | ||
1093 | struct statistics_rx_ht_phy *ht, *accum_ht, *delta_ht, *max_ht; | ||
1094 | |||
1095 | if (!iwl_is_alive(priv)) | ||
1096 | return -EAGAIN; | ||
1097 | |||
1098 | buf = kzalloc(bufsz, GFP_KERNEL); | ||
1099 | if (!buf) { | ||
1100 | IWL_ERR(priv, "Can not allocate Buffer\n"); | ||
1101 | return -ENOMEM; | ||
1102 | } | ||
1103 | |||
1104 | /* the statistic information display here is based on | ||
1105 | * the last statistics notification from uCode | ||
1106 | * might not reflect the current uCode activity | ||
1107 | */ | ||
1108 | ofdm = &priv->statistics.rx.ofdm; | ||
1109 | cck = &priv->statistics.rx.cck; | ||
1110 | general = &priv->statistics.rx.general; | ||
1111 | ht = &priv->statistics.rx.ofdm_ht; | ||
1112 | accum_ofdm = &priv->accum_statistics.rx.ofdm; | ||
1113 | accum_cck = &priv->accum_statistics.rx.cck; | ||
1114 | accum_general = &priv->accum_statistics.rx.general; | ||
1115 | accum_ht = &priv->accum_statistics.rx.ofdm_ht; | ||
1116 | delta_ofdm = &priv->delta_statistics.rx.ofdm; | ||
1117 | delta_cck = &priv->delta_statistics.rx.cck; | ||
1118 | delta_general = &priv->delta_statistics.rx.general; | ||
1119 | delta_ht = &priv->delta_statistics.rx.ofdm_ht; | ||
1120 | max_ofdm = &priv->max_delta.rx.ofdm; | ||
1121 | max_cck = &priv->max_delta.rx.cck; | ||
1122 | max_general = &priv->max_delta.rx.general; | ||
1123 | max_ht = &priv->max_delta.rx.ofdm_ht; | ||
1124 | |||
1125 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | ||
1126 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_header, | ||
1127 | "Statistics_Rx - OFDM:"); | ||
1128 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1129 | "ina_cnt:", le32_to_cpu(ofdm->ina_cnt), | ||
1130 | accum_ofdm->ina_cnt, | ||
1131 | delta_ofdm->ina_cnt, max_ofdm->ina_cnt); | ||
1132 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1133 | "fina_cnt:", | ||
1134 | le32_to_cpu(ofdm->fina_cnt), accum_ofdm->fina_cnt, | ||
1135 | delta_ofdm->fina_cnt, max_ofdm->fina_cnt); | ||
1136 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1137 | "plcp_err:", | ||
1138 | le32_to_cpu(ofdm->plcp_err), accum_ofdm->plcp_err, | ||
1139 | delta_ofdm->plcp_err, max_ofdm->plcp_err); | ||
1140 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1141 | "crc32_err:", | ||
1142 | le32_to_cpu(ofdm->crc32_err), accum_ofdm->crc32_err, | ||
1143 | delta_ofdm->crc32_err, max_ofdm->crc32_err); | ||
1144 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1145 | "overrun_err:", | ||
1146 | le32_to_cpu(ofdm->overrun_err), | ||
1147 | accum_ofdm->overrun_err, | ||
1148 | delta_ofdm->overrun_err, max_ofdm->overrun_err); | ||
1149 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1150 | "early_overrun_err:", | ||
1151 | le32_to_cpu(ofdm->early_overrun_err), | ||
1152 | accum_ofdm->early_overrun_err, | ||
1153 | delta_ofdm->early_overrun_err, | ||
1154 | max_ofdm->early_overrun_err); | ||
1155 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1156 | "crc32_good:", | ||
1157 | le32_to_cpu(ofdm->crc32_good), | ||
1158 | accum_ofdm->crc32_good, | ||
1159 | delta_ofdm->crc32_good, max_ofdm->crc32_good); | ||
1160 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1161 | "false_alarm_cnt:", | ||
1162 | le32_to_cpu(ofdm->false_alarm_cnt), | ||
1163 | accum_ofdm->false_alarm_cnt, | ||
1164 | delta_ofdm->false_alarm_cnt, | ||
1165 | max_ofdm->false_alarm_cnt); | ||
1166 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1167 | "fina_sync_err_cnt:", | ||
1168 | le32_to_cpu(ofdm->fina_sync_err_cnt), | ||
1169 | accum_ofdm->fina_sync_err_cnt, | ||
1170 | delta_ofdm->fina_sync_err_cnt, | ||
1171 | max_ofdm->fina_sync_err_cnt); | ||
1172 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1173 | "sfd_timeout:", | ||
1174 | le32_to_cpu(ofdm->sfd_timeout), | ||
1175 | accum_ofdm->sfd_timeout, | ||
1176 | delta_ofdm->sfd_timeout, | ||
1177 | max_ofdm->sfd_timeout); | ||
1178 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1179 | "fina_timeout:", | ||
1180 | le32_to_cpu(ofdm->fina_timeout), | ||
1181 | accum_ofdm->fina_timeout, | ||
1182 | delta_ofdm->fina_timeout, | ||
1183 | max_ofdm->fina_timeout); | ||
1184 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1185 | "unresponded_rts:", | ||
1186 | le32_to_cpu(ofdm->unresponded_rts), | ||
1187 | accum_ofdm->unresponded_rts, | ||
1188 | delta_ofdm->unresponded_rts, | ||
1189 | max_ofdm->unresponded_rts); | ||
1190 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1191 | "rxe_frame_lmt_ovrun:", | ||
1192 | le32_to_cpu(ofdm->rxe_frame_limit_overrun), | ||
1193 | accum_ofdm->rxe_frame_limit_overrun, | ||
1194 | delta_ofdm->rxe_frame_limit_overrun, | ||
1195 | max_ofdm->rxe_frame_limit_overrun); | ||
1196 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1197 | "sent_ack_cnt:", | ||
1198 | le32_to_cpu(ofdm->sent_ack_cnt), | ||
1199 | accum_ofdm->sent_ack_cnt, | ||
1200 | delta_ofdm->sent_ack_cnt, | ||
1201 | max_ofdm->sent_ack_cnt); | ||
1202 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1203 | "sent_cts_cnt:", | ||
1204 | le32_to_cpu(ofdm->sent_cts_cnt), | ||
1205 | accum_ofdm->sent_cts_cnt, | ||
1206 | delta_ofdm->sent_cts_cnt, max_ofdm->sent_cts_cnt); | ||
1207 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1208 | "sent_ba_rsp_cnt:", | ||
1209 | le32_to_cpu(ofdm->sent_ba_rsp_cnt), | ||
1210 | accum_ofdm->sent_ba_rsp_cnt, | ||
1211 | delta_ofdm->sent_ba_rsp_cnt, | ||
1212 | max_ofdm->sent_ba_rsp_cnt); | ||
1213 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1214 | "dsp_self_kill:", | ||
1215 | le32_to_cpu(ofdm->dsp_self_kill), | ||
1216 | accum_ofdm->dsp_self_kill, | ||
1217 | delta_ofdm->dsp_self_kill, | ||
1218 | max_ofdm->dsp_self_kill); | ||
1219 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1220 | "mh_format_err:", | ||
1221 | le32_to_cpu(ofdm->mh_format_err), | ||
1222 | accum_ofdm->mh_format_err, | ||
1223 | delta_ofdm->mh_format_err, | ||
1224 | max_ofdm->mh_format_err); | ||
1225 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1226 | "re_acq_main_rssi_sum:", | ||
1227 | le32_to_cpu(ofdm->re_acq_main_rssi_sum), | ||
1228 | accum_ofdm->re_acq_main_rssi_sum, | ||
1229 | delta_ofdm->re_acq_main_rssi_sum, | ||
1230 | max_ofdm->re_acq_main_rssi_sum); | ||
1231 | |||
1232 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_header, | ||
1233 | "Statistics_Rx - CCK:"); | ||
1234 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1235 | "ina_cnt:", | ||
1236 | le32_to_cpu(cck->ina_cnt), accum_cck->ina_cnt, | ||
1237 | delta_cck->ina_cnt, max_cck->ina_cnt); | ||
1238 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1239 | "fina_cnt:", | ||
1240 | le32_to_cpu(cck->fina_cnt), accum_cck->fina_cnt, | ||
1241 | delta_cck->fina_cnt, max_cck->fina_cnt); | ||
1242 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1243 | "plcp_err:", | ||
1244 | le32_to_cpu(cck->plcp_err), accum_cck->plcp_err, | ||
1245 | delta_cck->plcp_err, max_cck->plcp_err); | ||
1246 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1247 | "crc32_err:", | ||
1248 | le32_to_cpu(cck->crc32_err), accum_cck->crc32_err, | ||
1249 | delta_cck->crc32_err, max_cck->crc32_err); | ||
1250 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1251 | "overrun_err:", | ||
1252 | le32_to_cpu(cck->overrun_err), | ||
1253 | accum_cck->overrun_err, | ||
1254 | delta_cck->overrun_err, max_cck->overrun_err); | ||
1255 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1256 | "early_overrun_err:", | ||
1257 | le32_to_cpu(cck->early_overrun_err), | ||
1258 | accum_cck->early_overrun_err, | ||
1259 | delta_cck->early_overrun_err, | ||
1260 | max_cck->early_overrun_err); | ||
1261 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1262 | "crc32_good:", | ||
1263 | le32_to_cpu(cck->crc32_good), accum_cck->crc32_good, | ||
1264 | delta_cck->crc32_good, | ||
1265 | max_cck->crc32_good); | ||
1266 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1267 | "false_alarm_cnt:", | ||
1268 | le32_to_cpu(cck->false_alarm_cnt), | ||
1269 | accum_cck->false_alarm_cnt, | ||
1270 | delta_cck->false_alarm_cnt, max_cck->false_alarm_cnt); | ||
1271 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1272 | "fina_sync_err_cnt:", | ||
1273 | le32_to_cpu(cck->fina_sync_err_cnt), | ||
1274 | accum_cck->fina_sync_err_cnt, | ||
1275 | delta_cck->fina_sync_err_cnt, | ||
1276 | max_cck->fina_sync_err_cnt); | ||
1277 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1278 | "sfd_timeout:", | ||
1279 | le32_to_cpu(cck->sfd_timeout), | ||
1280 | accum_cck->sfd_timeout, | ||
1281 | delta_cck->sfd_timeout, max_cck->sfd_timeout); | ||
1282 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1283 | "fina_timeout:", | ||
1284 | le32_to_cpu(cck->fina_timeout), | ||
1285 | accum_cck->fina_timeout, | ||
1286 | delta_cck->fina_timeout, max_cck->fina_timeout); | ||
1287 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1288 | "unresponded_rts:", | ||
1289 | le32_to_cpu(cck->unresponded_rts), | ||
1290 | accum_cck->unresponded_rts, | ||
1291 | delta_cck->unresponded_rts, | ||
1292 | max_cck->unresponded_rts); | ||
1293 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1294 | "rxe_frame_lmt_ovrun:", | ||
1295 | le32_to_cpu(cck->rxe_frame_limit_overrun), | ||
1296 | accum_cck->rxe_frame_limit_overrun, | ||
1297 | delta_cck->rxe_frame_limit_overrun, | ||
1298 | max_cck->rxe_frame_limit_overrun); | ||
1299 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1300 | "sent_ack_cnt:", | ||
1301 | le32_to_cpu(cck->sent_ack_cnt), | ||
1302 | accum_cck->sent_ack_cnt, | ||
1303 | delta_cck->sent_ack_cnt, | ||
1304 | max_cck->sent_ack_cnt); | ||
1305 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1306 | "sent_cts_cnt:", | ||
1307 | le32_to_cpu(cck->sent_cts_cnt), | ||
1308 | accum_cck->sent_cts_cnt, | ||
1309 | delta_cck->sent_cts_cnt, | ||
1310 | max_cck->sent_cts_cnt); | ||
1311 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1312 | "sent_ba_rsp_cnt:", | ||
1313 | le32_to_cpu(cck->sent_ba_rsp_cnt), | ||
1314 | accum_cck->sent_ba_rsp_cnt, | ||
1315 | delta_cck->sent_ba_rsp_cnt, | ||
1316 | max_cck->sent_ba_rsp_cnt); | ||
1317 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1318 | "dsp_self_kill:", | ||
1319 | le32_to_cpu(cck->dsp_self_kill), | ||
1320 | accum_cck->dsp_self_kill, | ||
1321 | delta_cck->dsp_self_kill, | ||
1322 | max_cck->dsp_self_kill); | ||
1323 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1324 | "mh_format_err:", | ||
1325 | le32_to_cpu(cck->mh_format_err), | ||
1326 | accum_cck->mh_format_err, | ||
1327 | delta_cck->mh_format_err, max_cck->mh_format_err); | ||
1328 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1329 | "re_acq_main_rssi_sum:", | ||
1330 | le32_to_cpu(cck->re_acq_main_rssi_sum), | ||
1331 | accum_cck->re_acq_main_rssi_sum, | ||
1332 | delta_cck->re_acq_main_rssi_sum, | ||
1333 | max_cck->re_acq_main_rssi_sum); | ||
1334 | |||
1335 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_header, | ||
1336 | "Statistics_Rx - GENERAL:"); | ||
1337 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1338 | "bogus_cts:", | ||
1339 | le32_to_cpu(general->bogus_cts), | ||
1340 | accum_general->bogus_cts, | ||
1341 | delta_general->bogus_cts, max_general->bogus_cts); | ||
1342 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1343 | "bogus_ack:", | ||
1344 | le32_to_cpu(general->bogus_ack), | ||
1345 | accum_general->bogus_ack, | ||
1346 | delta_general->bogus_ack, max_general->bogus_ack); | ||
1347 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1348 | "non_bssid_frames:", | ||
1349 | le32_to_cpu(general->non_bssid_frames), | ||
1350 | accum_general->non_bssid_frames, | ||
1351 | delta_general->non_bssid_frames, | ||
1352 | max_general->non_bssid_frames); | ||
1353 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1354 | "filtered_frames:", | ||
1355 | le32_to_cpu(general->filtered_frames), | ||
1356 | accum_general->filtered_frames, | ||
1357 | delta_general->filtered_frames, | ||
1358 | max_general->filtered_frames); | ||
1359 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1360 | "non_channel_beacons:", | ||
1361 | le32_to_cpu(general->non_channel_beacons), | ||
1362 | accum_general->non_channel_beacons, | ||
1363 | delta_general->non_channel_beacons, | ||
1364 | max_general->non_channel_beacons); | ||
1365 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1366 | "channel_beacons:", | ||
1367 | le32_to_cpu(general->channel_beacons), | ||
1368 | accum_general->channel_beacons, | ||
1369 | delta_general->channel_beacons, | ||
1370 | max_general->channel_beacons); | ||
1371 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1372 | "num_missed_bcon:", | ||
1373 | le32_to_cpu(general->num_missed_bcon), | ||
1374 | accum_general->num_missed_bcon, | ||
1375 | delta_general->num_missed_bcon, | ||
1376 | max_general->num_missed_bcon); | ||
1377 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1378 | "adc_rx_saturation_time:", | ||
1379 | le32_to_cpu(general->adc_rx_saturation_time), | ||
1380 | accum_general->adc_rx_saturation_time, | ||
1381 | delta_general->adc_rx_saturation_time, | ||
1382 | max_general->adc_rx_saturation_time); | ||
1383 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1384 | "ina_detect_search_tm:", | ||
1385 | le32_to_cpu(general->ina_detection_search_time), | ||
1386 | accum_general->ina_detection_search_time, | ||
1387 | delta_general->ina_detection_search_time, | ||
1388 | max_general->ina_detection_search_time); | ||
1389 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1390 | "beacon_silence_rssi_a:", | ||
1391 | le32_to_cpu(general->beacon_silence_rssi_a), | ||
1392 | accum_general->beacon_silence_rssi_a, | ||
1393 | delta_general->beacon_silence_rssi_a, | ||
1394 | max_general->beacon_silence_rssi_a); | ||
1395 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1396 | "beacon_silence_rssi_b:", | ||
1397 | le32_to_cpu(general->beacon_silence_rssi_b), | ||
1398 | accum_general->beacon_silence_rssi_b, | ||
1399 | delta_general->beacon_silence_rssi_b, | ||
1400 | max_general->beacon_silence_rssi_b); | ||
1401 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1402 | "beacon_silence_rssi_c:", | ||
1403 | le32_to_cpu(general->beacon_silence_rssi_c), | ||
1404 | accum_general->beacon_silence_rssi_c, | ||
1405 | delta_general->beacon_silence_rssi_c, | ||
1406 | max_general->beacon_silence_rssi_c); | ||
1407 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1408 | "interference_data_flag:", | ||
1409 | le32_to_cpu(general->interference_data_flag), | ||
1410 | accum_general->interference_data_flag, | ||
1411 | delta_general->interference_data_flag, | ||
1412 | max_general->interference_data_flag); | ||
1413 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1414 | "channel_load:", | ||
1415 | le32_to_cpu(general->channel_load), | ||
1416 | accum_general->channel_load, | ||
1417 | delta_general->channel_load, | ||
1418 | max_general->channel_load); | ||
1419 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1420 | "dsp_false_alarms:", | ||
1421 | le32_to_cpu(general->dsp_false_alarms), | ||
1422 | accum_general->dsp_false_alarms, | ||
1423 | delta_general->dsp_false_alarms, | ||
1424 | max_general->dsp_false_alarms); | ||
1425 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1426 | "beacon_rssi_a:", | ||
1427 | le32_to_cpu(general->beacon_rssi_a), | ||
1428 | accum_general->beacon_rssi_a, | ||
1429 | delta_general->beacon_rssi_a, | ||
1430 | max_general->beacon_rssi_a); | ||
1431 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1432 | "beacon_rssi_b:", | ||
1433 | le32_to_cpu(general->beacon_rssi_b), | ||
1434 | accum_general->beacon_rssi_b, | ||
1435 | delta_general->beacon_rssi_b, | ||
1436 | max_general->beacon_rssi_b); | ||
1437 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1438 | "beacon_rssi_c:", | ||
1439 | le32_to_cpu(general->beacon_rssi_c), | ||
1440 | accum_general->beacon_rssi_c, | ||
1441 | delta_general->beacon_rssi_c, | ||
1442 | max_general->beacon_rssi_c); | ||
1443 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1444 | "beacon_energy_a:", | ||
1445 | le32_to_cpu(general->beacon_energy_a), | ||
1446 | accum_general->beacon_energy_a, | ||
1447 | delta_general->beacon_energy_a, | ||
1448 | max_general->beacon_energy_a); | ||
1449 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1450 | "beacon_energy_b:", | ||
1451 | le32_to_cpu(general->beacon_energy_b), | ||
1452 | accum_general->beacon_energy_b, | ||
1453 | delta_general->beacon_energy_b, | ||
1454 | max_general->beacon_energy_b); | ||
1455 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1456 | "beacon_energy_c:", | ||
1457 | le32_to_cpu(general->beacon_energy_c), | ||
1458 | accum_general->beacon_energy_c, | ||
1459 | delta_general->beacon_energy_c, | ||
1460 | max_general->beacon_energy_c); | ||
1461 | |||
1462 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM_HT:\n"); | ||
1463 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_header, | ||
1464 | "Statistics_Rx - OFDM_HT:"); | ||
1465 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1466 | "plcp_err:", | ||
1467 | le32_to_cpu(ht->plcp_err), accum_ht->plcp_err, | ||
1468 | delta_ht->plcp_err, max_ht->plcp_err); | ||
1469 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1470 | "overrun_err:", | ||
1471 | le32_to_cpu(ht->overrun_err), accum_ht->overrun_err, | ||
1472 | delta_ht->overrun_err, max_ht->overrun_err); | ||
1473 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1474 | "early_overrun_err:", | ||
1475 | le32_to_cpu(ht->early_overrun_err), | ||
1476 | accum_ht->early_overrun_err, | ||
1477 | delta_ht->early_overrun_err, | ||
1478 | max_ht->early_overrun_err); | ||
1479 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1480 | "crc32_good:", | ||
1481 | le32_to_cpu(ht->crc32_good), accum_ht->crc32_good, | ||
1482 | delta_ht->crc32_good, max_ht->crc32_good); | ||
1483 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1484 | "crc32_err:", | ||
1485 | le32_to_cpu(ht->crc32_err), accum_ht->crc32_err, | ||
1486 | delta_ht->crc32_err, max_ht->crc32_err); | ||
1487 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1488 | "mh_format_err:", | ||
1489 | le32_to_cpu(ht->mh_format_err), | ||
1490 | accum_ht->mh_format_err, | ||
1491 | delta_ht->mh_format_err, max_ht->mh_format_err); | ||
1492 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1493 | "agg_crc32_good:", | ||
1494 | le32_to_cpu(ht->agg_crc32_good), | ||
1495 | accum_ht->agg_crc32_good, | ||
1496 | delta_ht->agg_crc32_good, max_ht->agg_crc32_good); | ||
1497 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1498 | "agg_mpdu_cnt:", | ||
1499 | le32_to_cpu(ht->agg_mpdu_cnt), | ||
1500 | accum_ht->agg_mpdu_cnt, | ||
1501 | delta_ht->agg_mpdu_cnt, max_ht->agg_mpdu_cnt); | ||
1502 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1503 | "agg_cnt:", | ||
1504 | le32_to_cpu(ht->agg_cnt), accum_ht->agg_cnt, | ||
1505 | delta_ht->agg_cnt, max_ht->agg_cnt); | ||
1506 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1507 | "unsupport_mcs:", | ||
1508 | le32_to_cpu(ht->unsupport_mcs), | ||
1509 | accum_ht->unsupport_mcs, | ||
1510 | delta_ht->unsupport_mcs, max_ht->unsupport_mcs); | ||
1511 | |||
1512 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
1513 | kfree(buf); | ||
1514 | return ret; | ||
1515 | } | 1064 | } |
1516 | 1065 | ||
1517 | static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file, | 1066 | static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file, |
@@ -1519,173 +1068,8 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file, | |||
1519 | size_t count, loff_t *ppos) | 1068 | size_t count, loff_t *ppos) |
1520 | { | 1069 | { |
1521 | struct iwl_priv *priv = file->private_data; | 1070 | struct iwl_priv *priv = file->private_data; |
1522 | int pos = 0; | 1071 | return priv->cfg->ops->lib->debugfs_ops.tx_stats_read(file, |
1523 | char *buf; | 1072 | user_buf, count, ppos); |
1524 | int bufsz = (sizeof(struct statistics_tx) * 48) + 250; | ||
1525 | ssize_t ret; | ||
1526 | struct statistics_tx *tx, *accum_tx, *delta_tx, *max_tx; | ||
1527 | |||
1528 | if (!iwl_is_alive(priv)) | ||
1529 | return -EAGAIN; | ||
1530 | |||
1531 | buf = kzalloc(bufsz, GFP_KERNEL); | ||
1532 | if (!buf) { | ||
1533 | IWL_ERR(priv, "Can not allocate Buffer\n"); | ||
1534 | return -ENOMEM; | ||
1535 | } | ||
1536 | |||
1537 | /* the statistic information display here is based on | ||
1538 | * the last statistics notification from uCode | ||
1539 | * might not reflect the current uCode activity | ||
1540 | */ | ||
1541 | tx = &priv->statistics.tx; | ||
1542 | accum_tx = &priv->accum_statistics.tx; | ||
1543 | delta_tx = &priv->delta_statistics.tx; | ||
1544 | max_tx = &priv->max_delta.tx; | ||
1545 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | ||
1546 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_header, | ||
1547 | "Statistics_Tx:"); | ||
1548 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1549 | "preamble:", | ||
1550 | le32_to_cpu(tx->preamble_cnt), | ||
1551 | accum_tx->preamble_cnt, | ||
1552 | delta_tx->preamble_cnt, max_tx->preamble_cnt); | ||
1553 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1554 | "rx_detected_cnt:", | ||
1555 | le32_to_cpu(tx->rx_detected_cnt), | ||
1556 | accum_tx->rx_detected_cnt, | ||
1557 | delta_tx->rx_detected_cnt, max_tx->rx_detected_cnt); | ||
1558 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1559 | "bt_prio_defer_cnt:", | ||
1560 | le32_to_cpu(tx->bt_prio_defer_cnt), | ||
1561 | accum_tx->bt_prio_defer_cnt, | ||
1562 | delta_tx->bt_prio_defer_cnt, | ||
1563 | max_tx->bt_prio_defer_cnt); | ||
1564 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1565 | "bt_prio_kill_cnt:", | ||
1566 | le32_to_cpu(tx->bt_prio_kill_cnt), | ||
1567 | accum_tx->bt_prio_kill_cnt, | ||
1568 | delta_tx->bt_prio_kill_cnt, | ||
1569 | max_tx->bt_prio_kill_cnt); | ||
1570 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1571 | "few_bytes_cnt:", | ||
1572 | le32_to_cpu(tx->few_bytes_cnt), | ||
1573 | accum_tx->few_bytes_cnt, | ||
1574 | delta_tx->few_bytes_cnt, max_tx->few_bytes_cnt); | ||
1575 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1576 | "cts_timeout:", | ||
1577 | le32_to_cpu(tx->cts_timeout), accum_tx->cts_timeout, | ||
1578 | delta_tx->cts_timeout, max_tx->cts_timeout); | ||
1579 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1580 | "ack_timeout:", | ||
1581 | le32_to_cpu(tx->ack_timeout), | ||
1582 | accum_tx->ack_timeout, | ||
1583 | delta_tx->ack_timeout, max_tx->ack_timeout); | ||
1584 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1585 | "expected_ack_cnt:", | ||
1586 | le32_to_cpu(tx->expected_ack_cnt), | ||
1587 | accum_tx->expected_ack_cnt, | ||
1588 | delta_tx->expected_ack_cnt, | ||
1589 | max_tx->expected_ack_cnt); | ||
1590 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1591 | "actual_ack_cnt:", | ||
1592 | le32_to_cpu(tx->actual_ack_cnt), | ||
1593 | accum_tx->actual_ack_cnt, | ||
1594 | delta_tx->actual_ack_cnt, | ||
1595 | max_tx->actual_ack_cnt); | ||
1596 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1597 | "dump_msdu_cnt:", | ||
1598 | le32_to_cpu(tx->dump_msdu_cnt), | ||
1599 | accum_tx->dump_msdu_cnt, | ||
1600 | delta_tx->dump_msdu_cnt, | ||
1601 | max_tx->dump_msdu_cnt); | ||
1602 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1603 | "abort_nxt_frame_mismatch:", | ||
1604 | le32_to_cpu(tx->burst_abort_next_frame_mismatch_cnt), | ||
1605 | accum_tx->burst_abort_next_frame_mismatch_cnt, | ||
1606 | delta_tx->burst_abort_next_frame_mismatch_cnt, | ||
1607 | max_tx->burst_abort_next_frame_mismatch_cnt); | ||
1608 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1609 | "abort_missing_nxt_frame:", | ||
1610 | le32_to_cpu(tx->burst_abort_missing_next_frame_cnt), | ||
1611 | accum_tx->burst_abort_missing_next_frame_cnt, | ||
1612 | delta_tx->burst_abort_missing_next_frame_cnt, | ||
1613 | max_tx->burst_abort_missing_next_frame_cnt); | ||
1614 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1615 | "cts_timeout_collision:", | ||
1616 | le32_to_cpu(tx->cts_timeout_collision), | ||
1617 | accum_tx->cts_timeout_collision, | ||
1618 | delta_tx->cts_timeout_collision, | ||
1619 | max_tx->cts_timeout_collision); | ||
1620 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1621 | "ack_ba_timeout_collision:", | ||
1622 | le32_to_cpu(tx->ack_or_ba_timeout_collision), | ||
1623 | accum_tx->ack_or_ba_timeout_collision, | ||
1624 | delta_tx->ack_or_ba_timeout_collision, | ||
1625 | max_tx->ack_or_ba_timeout_collision); | ||
1626 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1627 | "agg ba_timeout:", | ||
1628 | le32_to_cpu(tx->agg.ba_timeout), | ||
1629 | accum_tx->agg.ba_timeout, | ||
1630 | delta_tx->agg.ba_timeout, | ||
1631 | max_tx->agg.ba_timeout); | ||
1632 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1633 | "agg ba_resched_frames:", | ||
1634 | le32_to_cpu(tx->agg.ba_reschedule_frames), | ||
1635 | accum_tx->agg.ba_reschedule_frames, | ||
1636 | delta_tx->agg.ba_reschedule_frames, | ||
1637 | max_tx->agg.ba_reschedule_frames); | ||
1638 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1639 | "agg scd_query_agg_frame:", | ||
1640 | le32_to_cpu(tx->agg.scd_query_agg_frame_cnt), | ||
1641 | accum_tx->agg.scd_query_agg_frame_cnt, | ||
1642 | delta_tx->agg.scd_query_agg_frame_cnt, | ||
1643 | max_tx->agg.scd_query_agg_frame_cnt); | ||
1644 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1645 | "agg scd_query_no_agg:", | ||
1646 | le32_to_cpu(tx->agg.scd_query_no_agg), | ||
1647 | accum_tx->agg.scd_query_no_agg, | ||
1648 | delta_tx->agg.scd_query_no_agg, | ||
1649 | max_tx->agg.scd_query_no_agg); | ||
1650 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1651 | "agg scd_query_agg:", | ||
1652 | le32_to_cpu(tx->agg.scd_query_agg), | ||
1653 | accum_tx->agg.scd_query_agg, | ||
1654 | delta_tx->agg.scd_query_agg, | ||
1655 | max_tx->agg.scd_query_agg); | ||
1656 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1657 | "agg scd_query_mismatch:", | ||
1658 | le32_to_cpu(tx->agg.scd_query_mismatch), | ||
1659 | accum_tx->agg.scd_query_mismatch, | ||
1660 | delta_tx->agg.scd_query_mismatch, | ||
1661 | max_tx->agg.scd_query_mismatch); | ||
1662 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1663 | "agg frame_not_ready:", | ||
1664 | le32_to_cpu(tx->agg.frame_not_ready), | ||
1665 | accum_tx->agg.frame_not_ready, | ||
1666 | delta_tx->agg.frame_not_ready, | ||
1667 | max_tx->agg.frame_not_ready); | ||
1668 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1669 | "agg underrun:", | ||
1670 | le32_to_cpu(tx->agg.underrun), | ||
1671 | accum_tx->agg.underrun, | ||
1672 | delta_tx->agg.underrun, max_tx->agg.underrun); | ||
1673 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1674 | "agg bt_prio_kill:", | ||
1675 | le32_to_cpu(tx->agg.bt_prio_kill), | ||
1676 | accum_tx->agg.bt_prio_kill, | ||
1677 | delta_tx->agg.bt_prio_kill, | ||
1678 | max_tx->agg.bt_prio_kill); | ||
1679 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1680 | "agg rx_ba_rsp_cnt:", | ||
1681 | le32_to_cpu(tx->agg.rx_ba_rsp_cnt), | ||
1682 | accum_tx->agg.rx_ba_rsp_cnt, | ||
1683 | delta_tx->agg.rx_ba_rsp_cnt, | ||
1684 | max_tx->agg.rx_ba_rsp_cnt); | ||
1685 | |||
1686 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
1687 | kfree(buf); | ||
1688 | return ret; | ||
1689 | } | 1073 | } |
1690 | 1074 | ||
1691 | static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file, | 1075 | static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file, |
@@ -1693,107 +1077,8 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file, | |||
1693 | size_t count, loff_t *ppos) | 1077 | size_t count, loff_t *ppos) |
1694 | { | 1078 | { |
1695 | struct iwl_priv *priv = file->private_data; | 1079 | struct iwl_priv *priv = file->private_data; |
1696 | int pos = 0; | 1080 | return priv->cfg->ops->lib->debugfs_ops.general_stats_read(file, |
1697 | char *buf; | 1081 | user_buf, count, ppos); |
1698 | int bufsz = sizeof(struct statistics_general) * 10 + 300; | ||
1699 | ssize_t ret; | ||
1700 | struct statistics_general *general, *accum_general; | ||
1701 | struct statistics_general *delta_general, *max_general; | ||
1702 | struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg; | ||
1703 | struct statistics_div *div, *accum_div, *delta_div, *max_div; | ||
1704 | |||
1705 | if (!iwl_is_alive(priv)) | ||
1706 | return -EAGAIN; | ||
1707 | |||
1708 | buf = kzalloc(bufsz, GFP_KERNEL); | ||
1709 | if (!buf) { | ||
1710 | IWL_ERR(priv, "Can not allocate Buffer\n"); | ||
1711 | return -ENOMEM; | ||
1712 | } | ||
1713 | |||
1714 | /* the statistic information display here is based on | ||
1715 | * the last statistics notification from uCode | ||
1716 | * might not reflect the current uCode activity | ||
1717 | */ | ||
1718 | general = &priv->statistics.general; | ||
1719 | dbg = &priv->statistics.general.dbg; | ||
1720 | div = &priv->statistics.general.div; | ||
1721 | accum_general = &priv->accum_statistics.general; | ||
1722 | delta_general = &priv->delta_statistics.general; | ||
1723 | max_general = &priv->max_delta.general; | ||
1724 | accum_dbg = &priv->accum_statistics.general.dbg; | ||
1725 | delta_dbg = &priv->delta_statistics.general.dbg; | ||
1726 | max_dbg = &priv->max_delta.general.dbg; | ||
1727 | accum_div = &priv->accum_statistics.general.div; | ||
1728 | delta_div = &priv->delta_statistics.general.div; | ||
1729 | max_div = &priv->max_delta.general.div; | ||
1730 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | ||
1731 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_header, | ||
1732 | "Statistics_General:"); | ||
1733 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_short_format, | ||
1734 | "temperature:", | ||
1735 | le32_to_cpu(general->temperature)); | ||
1736 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_short_format, | ||
1737 | "temperature_m:", | ||
1738 | le32_to_cpu(general->temperature_m)); | ||
1739 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1740 | "burst_check:", | ||
1741 | le32_to_cpu(dbg->burst_check), | ||
1742 | accum_dbg->burst_check, | ||
1743 | delta_dbg->burst_check, max_dbg->burst_check); | ||
1744 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1745 | "burst_count:", | ||
1746 | le32_to_cpu(dbg->burst_count), | ||
1747 | accum_dbg->burst_count, | ||
1748 | delta_dbg->burst_count, max_dbg->burst_count); | ||
1749 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1750 | "sleep_time:", | ||
1751 | le32_to_cpu(general->sleep_time), | ||
1752 | accum_general->sleep_time, | ||
1753 | delta_general->sleep_time, max_general->sleep_time); | ||
1754 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1755 | "slots_out:", | ||
1756 | le32_to_cpu(general->slots_out), | ||
1757 | accum_general->slots_out, | ||
1758 | delta_general->slots_out, max_general->slots_out); | ||
1759 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1760 | "slots_idle:", | ||
1761 | le32_to_cpu(general->slots_idle), | ||
1762 | accum_general->slots_idle, | ||
1763 | delta_general->slots_idle, max_general->slots_idle); | ||
1764 | pos += scnprintf(buf + pos, bufsz - pos, "ttl_timestamp:\t\t\t%u\n", | ||
1765 | le32_to_cpu(general->ttl_timestamp)); | ||
1766 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1767 | "tx_on_a:", | ||
1768 | le32_to_cpu(div->tx_on_a), accum_div->tx_on_a, | ||
1769 | delta_div->tx_on_a, max_div->tx_on_a); | ||
1770 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1771 | "tx_on_b:", | ||
1772 | le32_to_cpu(div->tx_on_b), accum_div->tx_on_b, | ||
1773 | delta_div->tx_on_b, max_div->tx_on_b); | ||
1774 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1775 | "exec_time:", | ||
1776 | le32_to_cpu(div->exec_time), accum_div->exec_time, | ||
1777 | delta_div->exec_time, max_div->exec_time); | ||
1778 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1779 | "probe_time:", | ||
1780 | le32_to_cpu(div->probe_time), accum_div->probe_time, | ||
1781 | delta_div->probe_time, max_div->probe_time); | ||
1782 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1783 | "rx_enable_counter:", | ||
1784 | le32_to_cpu(general->rx_enable_counter), | ||
1785 | accum_general->rx_enable_counter, | ||
1786 | delta_general->rx_enable_counter, | ||
1787 | max_general->rx_enable_counter); | ||
1788 | pos += scnprintf(buf + pos, bufsz - pos, ucode_stats_format, | ||
1789 | "num_of_sos_states:", | ||
1790 | le32_to_cpu(general->num_of_sos_states), | ||
1791 | accum_general->num_of_sos_states, | ||
1792 | delta_general->num_of_sos_states, | ||
1793 | max_general->num_of_sos_states); | ||
1794 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
1795 | kfree(buf); | ||
1796 | return ret; | ||
1797 | } | 1082 | } |
1798 | 1083 | ||
1799 | static ssize_t iwl_dbgfs_sensitivity_read(struct file *file, | 1084 | static ssize_t iwl_dbgfs_sensitivity_read(struct file *file, |
@@ -1935,46 +1220,6 @@ static ssize_t iwl_dbgfs_chain_noise_read(struct file *file, | |||
1935 | return ret; | 1220 | return ret; |
1936 | } | 1221 | } |
1937 | 1222 | ||
1938 | static ssize_t iwl_dbgfs_tx_power_read(struct file *file, | ||
1939 | char __user *user_buf, | ||
1940 | size_t count, loff_t *ppos) { | ||
1941 | |||
1942 | struct iwl_priv *priv = file->private_data; | ||
1943 | char buf[128]; | ||
1944 | int pos = 0; | ||
1945 | const size_t bufsz = sizeof(buf); | ||
1946 | struct statistics_tx *tx; | ||
1947 | |||
1948 | if (!iwl_is_alive(priv)) | ||
1949 | pos += scnprintf(buf + pos, bufsz - pos, "N/A\n"); | ||
1950 | else { | ||
1951 | tx = &priv->statistics.tx; | ||
1952 | if (tx->tx_power.ant_a || | ||
1953 | tx->tx_power.ant_b || | ||
1954 | tx->tx_power.ant_c) { | ||
1955 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1956 | "tx power: (1/2 dB step)\n"); | ||
1957 | if ((priv->cfg->valid_tx_ant & ANT_A) && | ||
1958 | tx->tx_power.ant_a) | ||
1959 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1960 | "\tantenna A: 0x%X\n", | ||
1961 | tx->tx_power.ant_a); | ||
1962 | if ((priv->cfg->valid_tx_ant & ANT_B) && | ||
1963 | tx->tx_power.ant_b) | ||
1964 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1965 | "\tantenna B: 0x%X\n", | ||
1966 | tx->tx_power.ant_b); | ||
1967 | if ((priv->cfg->valid_tx_ant & ANT_C) && | ||
1968 | tx->tx_power.ant_c) | ||
1969 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1970 | "\tantenna C: 0x%X\n", | ||
1971 | tx->tx_power.ant_c); | ||
1972 | } else | ||
1973 | pos += scnprintf(buf + pos, bufsz - pos, "N/A\n"); | ||
1974 | } | ||
1975 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
1976 | } | ||
1977 | |||
1978 | static ssize_t iwl_dbgfs_power_save_status_read(struct file *file, | 1223 | static ssize_t iwl_dbgfs_power_save_status_read(struct file *file, |
1979 | char __user *user_buf, | 1224 | char __user *user_buf, |
1980 | size_t count, loff_t *ppos) | 1225 | size_t count, loff_t *ppos) |
@@ -2052,7 +1297,6 @@ static ssize_t iwl_dbgfs_ucode_tracing_read(struct file *file, | |||
2052 | int pos = 0; | 1297 | int pos = 0; |
2053 | char buf[128]; | 1298 | char buf[128]; |
2054 | const size_t bufsz = sizeof(buf); | 1299 | const size_t bufsz = sizeof(buf); |
2055 | ssize_t ret; | ||
2056 | 1300 | ||
2057 | pos += scnprintf(buf + pos, bufsz - pos, "ucode trace timer is %s\n", | 1301 | pos += scnprintf(buf + pos, bufsz - pos, "ucode trace timer is %s\n", |
2058 | priv->event_log.ucode_trace ? "On" : "Off"); | 1302 | priv->event_log.ucode_trace ? "On" : "Off"); |
@@ -2063,8 +1307,7 @@ static ssize_t iwl_dbgfs_ucode_tracing_read(struct file *file, | |||
2063 | pos += scnprintf(buf + pos, bufsz - pos, "wraps_more_count:\t\t %u\n", | 1307 | pos += scnprintf(buf + pos, bufsz - pos, "wraps_more_count:\t\t %u\n", |
2064 | priv->event_log.wraps_more_count); | 1308 | priv->event_log.wraps_more_count); |
2065 | 1309 | ||
2066 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1310 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
2067 | return ret; | ||
2068 | } | 1311 | } |
2069 | 1312 | ||
2070 | static ssize_t iwl_dbgfs_ucode_tracing_write(struct file *file, | 1313 | static ssize_t iwl_dbgfs_ucode_tracing_write(struct file *file, |
@@ -2096,6 +1339,31 @@ static ssize_t iwl_dbgfs_ucode_tracing_write(struct file *file, | |||
2096 | return count; | 1339 | return count; |
2097 | } | 1340 | } |
2098 | 1341 | ||
1342 | static ssize_t iwl_dbgfs_rxon_flags_read(struct file *file, | ||
1343 | char __user *user_buf, | ||
1344 | size_t count, loff_t *ppos) { | ||
1345 | |||
1346 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | ||
1347 | int len = 0; | ||
1348 | char buf[20]; | ||
1349 | |||
1350 | len = sprintf(buf, "0x%04X\n", le32_to_cpu(priv->active_rxon.flags)); | ||
1351 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
1352 | } | ||
1353 | |||
1354 | static ssize_t iwl_dbgfs_rxon_filter_flags_read(struct file *file, | ||
1355 | char __user *user_buf, | ||
1356 | size_t count, loff_t *ppos) { | ||
1357 | |||
1358 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | ||
1359 | int len = 0; | ||
1360 | char buf[20]; | ||
1361 | |||
1362 | len = sprintf(buf, "0x%04X\n", | ||
1363 | le32_to_cpu(priv->active_rxon.filter_flags)); | ||
1364 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
1365 | } | ||
1366 | |||
2099 | static ssize_t iwl_dbgfs_fh_reg_read(struct file *file, | 1367 | static ssize_t iwl_dbgfs_fh_reg_read(struct file *file, |
2100 | char __user *user_buf, | 1368 | char __user *user_buf, |
2101 | size_t count, loff_t *ppos) | 1369 | size_t count, loff_t *ppos) |
@@ -2125,13 +1393,11 @@ static ssize_t iwl_dbgfs_missed_beacon_read(struct file *file, | |||
2125 | int pos = 0; | 1393 | int pos = 0; |
2126 | char buf[12]; | 1394 | char buf[12]; |
2127 | const size_t bufsz = sizeof(buf); | 1395 | const size_t bufsz = sizeof(buf); |
2128 | ssize_t ret; | ||
2129 | 1396 | ||
2130 | pos += scnprintf(buf + pos, bufsz - pos, "%d\n", | 1397 | pos += scnprintf(buf + pos, bufsz - pos, "%d\n", |
2131 | priv->missed_beacon_threshold); | 1398 | priv->missed_beacon_threshold); |
2132 | 1399 | ||
2133 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1400 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
2134 | return ret; | ||
2135 | } | 1401 | } |
2136 | 1402 | ||
2137 | static ssize_t iwl_dbgfs_missed_beacon_write(struct file *file, | 1403 | static ssize_t iwl_dbgfs_missed_beacon_write(struct file *file, |
@@ -2160,27 +1426,6 @@ static ssize_t iwl_dbgfs_missed_beacon_write(struct file *file, | |||
2160 | return count; | 1426 | return count; |
2161 | } | 1427 | } |
2162 | 1428 | ||
2163 | static ssize_t iwl_dbgfs_internal_scan_write(struct file *file, | ||
2164 | const char __user *user_buf, | ||
2165 | size_t count, loff_t *ppos) | ||
2166 | { | ||
2167 | struct iwl_priv *priv = file->private_data; | ||
2168 | char buf[8]; | ||
2169 | int buf_size; | ||
2170 | int scan; | ||
2171 | |||
2172 | memset(buf, 0, sizeof(buf)); | ||
2173 | buf_size = min(count, sizeof(buf) - 1); | ||
2174 | if (copy_from_user(buf, user_buf, buf_size)) | ||
2175 | return -EFAULT; | ||
2176 | if (sscanf(buf, "%d", &scan) != 1) | ||
2177 | return -EINVAL; | ||
2178 | |||
2179 | iwl_internal_short_hw_scan(priv); | ||
2180 | |||
2181 | return count; | ||
2182 | } | ||
2183 | |||
2184 | static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file, | 1429 | static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file, |
2185 | char __user *user_buf, | 1430 | char __user *user_buf, |
2186 | size_t count, loff_t *ppos) { | 1431 | size_t count, loff_t *ppos) { |
@@ -2189,13 +1434,11 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file, | |||
2189 | int pos = 0; | 1434 | int pos = 0; |
2190 | char buf[12]; | 1435 | char buf[12]; |
2191 | const size_t bufsz = sizeof(buf); | 1436 | const size_t bufsz = sizeof(buf); |
2192 | ssize_t ret; | ||
2193 | 1437 | ||
2194 | pos += scnprintf(buf + pos, bufsz - pos, "%u\n", | 1438 | pos += scnprintf(buf + pos, bufsz - pos, "%u\n", |
2195 | priv->cfg->plcp_delta_threshold); | 1439 | priv->cfg->plcp_delta_threshold); |
2196 | 1440 | ||
2197 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1441 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
2198 | return ret; | ||
2199 | } | 1442 | } |
2200 | 1443 | ||
2201 | static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file, | 1444 | static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file, |
@@ -2288,7 +1531,6 @@ DEBUGFS_READ_FILE_OPS(ucode_tx_stats); | |||
2288 | DEBUGFS_READ_FILE_OPS(ucode_general_stats); | 1531 | DEBUGFS_READ_FILE_OPS(ucode_general_stats); |
2289 | DEBUGFS_READ_FILE_OPS(sensitivity); | 1532 | DEBUGFS_READ_FILE_OPS(sensitivity); |
2290 | DEBUGFS_READ_FILE_OPS(chain_noise); | 1533 | DEBUGFS_READ_FILE_OPS(chain_noise); |
2291 | DEBUGFS_READ_FILE_OPS(tx_power); | ||
2292 | DEBUGFS_READ_FILE_OPS(power_save_status); | 1534 | DEBUGFS_READ_FILE_OPS(power_save_status); |
2293 | DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); | 1535 | DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); |
2294 | DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); | 1536 | DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); |
@@ -2296,9 +1538,10 @@ DEBUGFS_WRITE_FILE_OPS(csr); | |||
2296 | DEBUGFS_READ_WRITE_FILE_OPS(ucode_tracing); | 1538 | DEBUGFS_READ_WRITE_FILE_OPS(ucode_tracing); |
2297 | DEBUGFS_READ_FILE_OPS(fh_reg); | 1539 | DEBUGFS_READ_FILE_OPS(fh_reg); |
2298 | DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon); | 1540 | DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon); |
2299 | DEBUGFS_WRITE_FILE_OPS(internal_scan); | ||
2300 | DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta); | 1541 | DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta); |
2301 | DEBUGFS_READ_WRITE_FILE_OPS(force_reset); | 1542 | DEBUGFS_READ_WRITE_FILE_OPS(force_reset); |
1543 | DEBUGFS_READ_FILE_OPS(rxon_flags); | ||
1544 | DEBUGFS_READ_FILE_OPS(rxon_filter_flags); | ||
2302 | 1545 | ||
2303 | /* | 1546 | /* |
2304 | * Create the debugfs files and directories | 1547 | * Create the debugfs files and directories |
@@ -2334,8 +1577,11 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
2334 | DEBUGFS_ADD_FILE(interrupt, dir_data, S_IWUSR | S_IRUSR); | 1577 | DEBUGFS_ADD_FILE(interrupt, dir_data, S_IWUSR | S_IRUSR); |
2335 | DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR); | 1578 | DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR); |
2336 | DEBUGFS_ADD_FILE(led, dir_data, S_IRUSR); | 1579 | DEBUGFS_ADD_FILE(led, dir_data, S_IRUSR); |
2337 | DEBUGFS_ADD_FILE(sleep_level_override, dir_data, S_IWUSR | S_IRUSR); | 1580 | if (!priv->cfg->broken_powersave) { |
2338 | DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR); | 1581 | DEBUGFS_ADD_FILE(sleep_level_override, dir_data, |
1582 | S_IWUSR | S_IRUSR); | ||
1583 | DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR); | ||
1584 | } | ||
2339 | DEBUGFS_ADD_FILE(thermal_throttling, dir_data, S_IRUSR); | 1585 | DEBUGFS_ADD_FILE(thermal_throttling, dir_data, S_IRUSR); |
2340 | DEBUGFS_ADD_FILE(disable_ht40, dir_data, S_IWUSR | S_IRUSR); | 1586 | DEBUGFS_ADD_FILE(disable_ht40, dir_data, S_IWUSR | S_IRUSR); |
2341 | DEBUGFS_ADD_FILE(rx_statistics, dir_debug, S_IRUSR); | 1587 | DEBUGFS_ADD_FILE(rx_statistics, dir_debug, S_IRUSR); |
@@ -2343,29 +1589,33 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
2343 | DEBUGFS_ADD_FILE(traffic_log, dir_debug, S_IWUSR | S_IRUSR); | 1589 | DEBUGFS_ADD_FILE(traffic_log, dir_debug, S_IWUSR | S_IRUSR); |
2344 | DEBUGFS_ADD_FILE(rx_queue, dir_debug, S_IRUSR); | 1590 | DEBUGFS_ADD_FILE(rx_queue, dir_debug, S_IRUSR); |
2345 | DEBUGFS_ADD_FILE(tx_queue, dir_debug, S_IRUSR); | 1591 | DEBUGFS_ADD_FILE(tx_queue, dir_debug, S_IRUSR); |
2346 | DEBUGFS_ADD_FILE(tx_power, dir_debug, S_IRUSR); | ||
2347 | DEBUGFS_ADD_FILE(power_save_status, dir_debug, S_IRUSR); | 1592 | DEBUGFS_ADD_FILE(power_save_status, dir_debug, S_IRUSR); |
2348 | DEBUGFS_ADD_FILE(clear_ucode_statistics, dir_debug, S_IWUSR); | 1593 | DEBUGFS_ADD_FILE(clear_ucode_statistics, dir_debug, S_IWUSR); |
2349 | DEBUGFS_ADD_FILE(clear_traffic_statistics, dir_debug, S_IWUSR); | 1594 | DEBUGFS_ADD_FILE(clear_traffic_statistics, dir_debug, S_IWUSR); |
2350 | DEBUGFS_ADD_FILE(csr, dir_debug, S_IWUSR); | 1595 | DEBUGFS_ADD_FILE(csr, dir_debug, S_IWUSR); |
2351 | DEBUGFS_ADD_FILE(fh_reg, dir_debug, S_IRUSR); | 1596 | DEBUGFS_ADD_FILE(fh_reg, dir_debug, S_IRUSR); |
2352 | DEBUGFS_ADD_FILE(missed_beacon, dir_debug, S_IWUSR); | 1597 | DEBUGFS_ADD_FILE(missed_beacon, dir_debug, S_IWUSR); |
2353 | DEBUGFS_ADD_FILE(internal_scan, dir_debug, S_IWUSR); | ||
2354 | DEBUGFS_ADD_FILE(plcp_delta, dir_debug, S_IWUSR | S_IRUSR); | 1598 | DEBUGFS_ADD_FILE(plcp_delta, dir_debug, S_IWUSR | S_IRUSR); |
2355 | DEBUGFS_ADD_FILE(force_reset, dir_debug, S_IWUSR | S_IRUSR); | 1599 | DEBUGFS_ADD_FILE(force_reset, dir_debug, S_IWUSR | S_IRUSR); |
2356 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { | 1600 | DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); |
2357 | DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); | 1601 | DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); |
2358 | DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); | 1602 | DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR); |
2359 | DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR); | 1603 | |
1604 | if (priv->cfg->sensitivity_calib_by_driver) | ||
2360 | DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); | 1605 | DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); |
1606 | if (priv->cfg->chain_noise_calib_by_driver) | ||
2361 | DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); | 1607 | DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); |
1608 | if (priv->cfg->ucode_tracing) | ||
2362 | DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR); | 1609 | DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR); |
2363 | } | 1610 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); |
2364 | DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, &priv->disable_sens_cal); | 1611 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); |
2365 | DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf, | 1612 | if (priv->cfg->sensitivity_calib_by_driver) |
2366 | &priv->disable_chain_noise_cal); | 1613 | DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, |
2367 | if (((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) || | 1614 | &priv->disable_sens_cal); |
2368 | ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_3945)) | 1615 | if (priv->cfg->chain_noise_calib_by_driver) |
1616 | DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf, | ||
1617 | &priv->disable_chain_noise_cal); | ||
1618 | if (priv->cfg->tx_power_by_driver) | ||
2369 | DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf, | 1619 | DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf, |
2370 | &priv->disable_tx_power_cal); | 1620 | &priv->disable_tx_power_cal); |
2371 | return 0; | 1621 | return 0; |