aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c676
1 files changed, 446 insertions, 230 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 1794b9c4e6ac..8784911fd56e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -801,15 +801,20 @@ static ssize_t iwl_dbgfs_sleep_level_override_write(struct file *file,
801 * valid here. However, let's not confuse them and present 801 * valid here. However, let's not confuse them and present
802 * IWL_POWER_INDEX_1 as "1", not "0". 802 * IWL_POWER_INDEX_1 as "1", not "0".
803 */ 803 */
804 if (value > 0) 804 if (value == 0)
805 return -EINVAL;
806 else if (value > 0)
805 value -= 1; 807 value -= 1;
806 808
807 if (value != -1 && (value < 0 || value >= IWL_POWER_NUM)) 809 if (value != -1 && (value < 0 || value >= IWL_POWER_NUM))
808 return -EINVAL; 810 return -EINVAL;
809 811
812 if (!iwl_is_ready_rf(priv))
813 return -EAGAIN;
814
810 priv->power_data.debug_sleep_level_override = value; 815 priv->power_data.debug_sleep_level_override = value;
811 816
812 iwl_power_update_mode(priv, false); 817 iwl_power_update_mode(priv, true);
813 818
814 return count; 819 return count;
815} 820}
@@ -882,10 +887,14 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file,
882 struct iwl_rx_queue *rxq = &priv->rxq; 887 struct iwl_rx_queue *rxq = &priv->rxq;
883 char *buf; 888 char *buf;
884 int bufsz = ((IWL_TRAFFIC_ENTRIES * IWL_TRAFFIC_ENTRY_SIZE * 64) * 2) + 889 int bufsz = ((IWL_TRAFFIC_ENTRIES * IWL_TRAFFIC_ENTRY_SIZE * 64) * 2) +
885 (IWL_MAX_NUM_QUEUES * 32 * 8) + 400; 890 (priv->cfg->num_of_queues * 32 * 8) + 400;
886 const u8 *ptr; 891 const u8 *ptr;
887 ssize_t ret; 892 ssize_t ret;
888 893
894 if (!priv->txq) {
895 IWL_ERR(priv, "txq not ready\n");
896 return -EAGAIN;
897 }
889 buf = kzalloc(bufsz, GFP_KERNEL); 898 buf = kzalloc(bufsz, GFP_KERNEL);
890 if (!buf) { 899 if (!buf) {
891 IWL_ERR(priv, "Can not allocate buffer\n"); 900 IWL_ERR(priv, "Can not allocate buffer\n");
@@ -977,8 +986,12 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file,
977 int pos = 0; 986 int pos = 0;
978 int cnt; 987 int cnt;
979 int ret; 988 int ret;
980 const size_t bufsz = sizeof(char) * 60 * IWL_MAX_NUM_QUEUES; 989 const size_t bufsz = sizeof(char) * 60 * priv->cfg->num_of_queues;
981 990
991 if (!priv->txq) {
992 IWL_ERR(priv, "txq not ready\n");
993 return -EAGAIN;
994 }
982 buf = kzalloc(bufsz, GFP_KERNEL); 995 buf = kzalloc(bufsz, GFP_KERNEL);
983 if (!buf) 996 if (!buf)
984 return -ENOMEM; 997 return -ENOMEM;
@@ -1069,10 +1082,10 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file,
1069 sizeof(struct statistics_rx_non_phy) * 20 + 1082 sizeof(struct statistics_rx_non_phy) * 20 +
1070 sizeof(struct statistics_rx_ht_phy) * 20 + 400; 1083 sizeof(struct statistics_rx_ht_phy) * 20 + 400;
1071 ssize_t ret; 1084 ssize_t ret;
1072 struct statistics_rx_phy *ofdm; 1085 struct statistics_rx_phy *ofdm, *accum_ofdm;
1073 struct statistics_rx_phy *cck; 1086 struct statistics_rx_phy *cck, *accum_cck;
1074 struct statistics_rx_non_phy *general; 1087 struct statistics_rx_non_phy *general, *accum_general;
1075 struct statistics_rx_ht_phy *ht; 1088 struct statistics_rx_ht_phy *ht, *accum_ht;
1076 1089
1077 if (!iwl_is_alive(priv)) 1090 if (!iwl_is_alive(priv))
1078 return -EAGAIN; 1091 return -EAGAIN;
@@ -1101,155 +1114,268 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file,
1101 cck = &priv->statistics.rx.cck; 1114 cck = &priv->statistics.rx.cck;
1102 general = &priv->statistics.rx.general; 1115 general = &priv->statistics.rx.general;
1103 ht = &priv->statistics.rx.ofdm_ht; 1116 ht = &priv->statistics.rx.ofdm_ht;
1117 accum_ofdm = &priv->accum_statistics.rx.ofdm;
1118 accum_cck = &priv->accum_statistics.rx.cck;
1119 accum_general = &priv->accum_statistics.rx.general;
1120 accum_ht = &priv->accum_statistics.rx.ofdm_ht;
1104 pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); 1121 pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz);
1105 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM:\n"); 1122 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM:\n");
1106 pos += scnprintf(buf + pos, bufsz - pos, "ina_cnt: %u\n", 1123 pos += scnprintf(buf + pos, bufsz - pos,
1107 le32_to_cpu(ofdm->ina_cnt)); 1124 "\t\t\tcurrent\t\t\taccumulative\n");
1108 pos += scnprintf(buf + pos, bufsz - pos, "fina_cnt: %u\n", 1125 pos += scnprintf(buf + pos, bufsz - pos, "ina_cnt:\t\t%u\t\t\t%u\n",
1109 le32_to_cpu(ofdm->fina_cnt)); 1126 le32_to_cpu(ofdm->ina_cnt), accum_ofdm->ina_cnt);
1110 pos += scnprintf(buf + pos, bufsz - pos, "plcp_err: %u\n", 1127 pos += scnprintf(buf + pos, bufsz - pos, "fina_cnt:\t\t%u\t\t\t%u\n",
1111 le32_to_cpu(ofdm->plcp_err)); 1128 le32_to_cpu(ofdm->fina_cnt), accum_ofdm->fina_cnt);
1112 pos += scnprintf(buf + pos, bufsz - pos, "crc32_err: %u\n", 1129 pos += scnprintf(buf + pos, bufsz - pos, "plcp_err:\t\t%u\t\t\t%u\n",
1113 le32_to_cpu(ofdm->crc32_err)); 1130 le32_to_cpu(ofdm->plcp_err), accum_ofdm->plcp_err);
1114 pos += scnprintf(buf + pos, bufsz - pos, "overrun_err: %u\n", 1131 pos += scnprintf(buf + pos, bufsz - pos, "crc32_err:\t\t%u\t\t\t%u\n",
1115 le32_to_cpu(ofdm->overrun_err)); 1132 le32_to_cpu(ofdm->crc32_err), accum_ofdm->crc32_err);
1116 pos += scnprintf(buf + pos, bufsz - pos, "early_overrun_err: %u\n", 1133 pos += scnprintf(buf + pos, bufsz - pos,
1117 le32_to_cpu(ofdm->early_overrun_err)); 1134 "overrun_err:\t\t%u\t\t\t%u\n",
1118 pos += scnprintf(buf + pos, bufsz - pos, "crc32_good: %u\n", 1135 le32_to_cpu(ofdm->overrun_err),
1119 le32_to_cpu(ofdm->crc32_good)); 1136 accum_ofdm->overrun_err);
1120 pos += scnprintf(buf + pos, bufsz - pos, "false_alarm_cnt: %u\n", 1137 pos += scnprintf(buf + pos, bufsz - pos,
1121 le32_to_cpu(ofdm->false_alarm_cnt)); 1138 "early_overrun_err:\t%u\t\t\t%u\n",
1122 pos += scnprintf(buf + pos, bufsz - pos, "fina_sync_err_cnt: %u\n", 1139 le32_to_cpu(ofdm->early_overrun_err),
1123 le32_to_cpu(ofdm->fina_sync_err_cnt)); 1140 accum_ofdm->early_overrun_err);
1124 pos += scnprintf(buf + pos, bufsz - pos, "sfd_timeout: %u\n", 1141 pos += scnprintf(buf + pos, bufsz - pos, "crc32_good:\t\t%u\t\t\t%u\n",
1125 le32_to_cpu(ofdm->sfd_timeout)); 1142 le32_to_cpu(ofdm->crc32_good),
1126 pos += scnprintf(buf + pos, bufsz - pos, "fina_timeout: %u\n", 1143 accum_ofdm->crc32_good);
1127 le32_to_cpu(ofdm->fina_timeout)); 1144 pos += scnprintf(buf + pos, bufsz - pos,
1128 pos += scnprintf(buf + pos, bufsz - pos, "unresponded_rts: %u\n", 1145 "false_alarm_cnt:\t%u\t\t\t%u\n",
1129 le32_to_cpu(ofdm->unresponded_rts)); 1146 le32_to_cpu(ofdm->false_alarm_cnt),
1130 pos += scnprintf(buf + pos, bufsz - pos, 1147 accum_ofdm->false_alarm_cnt);
1131 "rxe_frame_limit_overrun: %u\n", 1148 pos += scnprintf(buf + pos, bufsz - pos,
1132 le32_to_cpu(ofdm->rxe_frame_limit_overrun)); 1149 "fina_sync_err_cnt:\t%u\t\t\t%u\n",
1133 pos += scnprintf(buf + pos, bufsz - pos, "sent_ack_cnt: %u\n", 1150 le32_to_cpu(ofdm->fina_sync_err_cnt),
1134 le32_to_cpu(ofdm->sent_ack_cnt)); 1151 accum_ofdm->fina_sync_err_cnt);
1135 pos += scnprintf(buf + pos, bufsz - pos, "sent_cts_cnt: %u\n", 1152 pos += scnprintf(buf + pos, bufsz - pos,
1136 le32_to_cpu(ofdm->sent_cts_cnt)); 1153 "sfd_timeout:\t\t%u\t\t\t%u\n",
1137 pos += scnprintf(buf + pos, bufsz - pos, "sent_ba_rsp_cnt: %u\n", 1154 le32_to_cpu(ofdm->sfd_timeout),
1138 le32_to_cpu(ofdm->sent_ba_rsp_cnt)); 1155 accum_ofdm->sfd_timeout);
1139 pos += scnprintf(buf + pos, bufsz - pos, "dsp_self_kill: %u\n", 1156 pos += scnprintf(buf + pos, bufsz - pos,
1140 le32_to_cpu(ofdm->dsp_self_kill)); 1157 "fina_timeout:\t\t%u\t\t\t%u\n",
1141 pos += scnprintf(buf + pos, bufsz - pos, "mh_format_err: %u\n", 1158 le32_to_cpu(ofdm->fina_timeout),
1142 le32_to_cpu(ofdm->mh_format_err)); 1159 accum_ofdm->fina_timeout);
1143 pos += scnprintf(buf + pos, bufsz - pos, "re_acq_main_rssi_sum: %u\n", 1160 pos += scnprintf(buf + pos, bufsz - pos,
1144 le32_to_cpu(ofdm->re_acq_main_rssi_sum)); 1161 "unresponded_rts:\t%u\t\t\t%u\n",
1162 le32_to_cpu(ofdm->unresponded_rts),
1163 accum_ofdm->unresponded_rts);
1164 pos += scnprintf(buf + pos, bufsz - pos,
1165 "rxe_frame_lmt_ovrun:\t%u\t\t\t%u\n",
1166 le32_to_cpu(ofdm->rxe_frame_limit_overrun),
1167 accum_ofdm->rxe_frame_limit_overrun);
1168 pos += scnprintf(buf + pos, bufsz - pos,
1169 "sent_ack_cnt:\t\t%u\t\t\t%u\n",
1170 le32_to_cpu(ofdm->sent_ack_cnt),
1171 accum_ofdm->sent_ack_cnt);
1172 pos += scnprintf(buf + pos, bufsz - pos,
1173 "sent_cts_cnt:\t\t%u\t\t\t%u\n",
1174 le32_to_cpu(ofdm->sent_cts_cnt),
1175 accum_ofdm->sent_cts_cnt);
1176 pos += scnprintf(buf + pos, bufsz - pos,
1177 "sent_ba_rsp_cnt:\t%u\t\t\t%u\n",
1178 le32_to_cpu(ofdm->sent_ba_rsp_cnt),
1179 accum_ofdm->sent_ba_rsp_cnt);
1180 pos += scnprintf(buf + pos, bufsz - pos,
1181 "dsp_self_kill:\t\t%u\t\t\t%u\n",
1182 le32_to_cpu(ofdm->dsp_self_kill),
1183 accum_ofdm->dsp_self_kill);
1184 pos += scnprintf(buf + pos, bufsz - pos,
1185 "mh_format_err:\t\t%u\t\t\t%u\n",
1186 le32_to_cpu(ofdm->mh_format_err),
1187 accum_ofdm->mh_format_err);
1188 pos += scnprintf(buf + pos, bufsz - pos,
1189 "re_acq_main_rssi_sum:\t%u\t\t\t%u\n",
1190 le32_to_cpu(ofdm->re_acq_main_rssi_sum),
1191 accum_ofdm->re_acq_main_rssi_sum);
1145 1192
1146 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - CCK:\n"); 1193 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - CCK:\n");
1147 pos += scnprintf(buf + pos, bufsz - pos, "ina_cnt: %u\n", 1194 pos += scnprintf(buf + pos, bufsz - pos,
1148 le32_to_cpu(cck->ina_cnt)); 1195 "\t\t\tcurrent\t\t\taccumulative\n");
1149 pos += scnprintf(buf + pos, bufsz - pos, "fina_cnt: %u\n", 1196 pos += scnprintf(buf + pos, bufsz - pos, "ina_cnt:\t\t%u\t\t\t%u\n",
1150 le32_to_cpu(cck->fina_cnt)); 1197 le32_to_cpu(cck->ina_cnt), accum_cck->ina_cnt);
1151 pos += scnprintf(buf + pos, bufsz - pos, "plcp_err: %u\n", 1198 pos += scnprintf(buf + pos, bufsz - pos, "fina_cnt:\t\t%u\t\t\t%u\n",
1152 le32_to_cpu(cck->plcp_err)); 1199 le32_to_cpu(cck->fina_cnt), accum_cck->fina_cnt);
1153 pos += scnprintf(buf + pos, bufsz - pos, "crc32_err: %u\n", 1200 pos += scnprintf(buf + pos, bufsz - pos, "plcp_err:\t\t%u\t\t\t%u\n",
1154 le32_to_cpu(cck->crc32_err)); 1201 le32_to_cpu(cck->plcp_err), accum_cck->plcp_err);
1155 pos += scnprintf(buf + pos, bufsz - pos, "overrun_err: %u\n", 1202 pos += scnprintf(buf + pos, bufsz - pos, "crc32_err:\t\t%u\t\t\t%u\n",
1156 le32_to_cpu(cck->overrun_err)); 1203 le32_to_cpu(cck->crc32_err), accum_cck->crc32_err);
1157 pos += scnprintf(buf + pos, bufsz - pos, "early_overrun_err: %u\n", 1204 pos += scnprintf(buf + pos, bufsz - pos,
1158 le32_to_cpu(cck->early_overrun_err)); 1205 "overrun_err:\t\t%u\t\t\t%u\n",
1159 pos += scnprintf(buf + pos, bufsz - pos, "crc32_good: %u\n", 1206 le32_to_cpu(cck->overrun_err),
1160 le32_to_cpu(cck->crc32_good)); 1207 accum_cck->overrun_err);
1161 pos += scnprintf(buf + pos, bufsz - pos, "false_alarm_cnt: %u\n", 1208 pos += scnprintf(buf + pos, bufsz - pos,
1162 le32_to_cpu(cck->false_alarm_cnt)); 1209 "early_overrun_err:\t%u\t\t\t%u\n",
1163 pos += scnprintf(buf + pos, bufsz - pos, "fina_sync_err_cnt: %u\n", 1210 le32_to_cpu(cck->early_overrun_err),
1164 le32_to_cpu(cck->fina_sync_err_cnt)); 1211 accum_cck->early_overrun_err);
1165 pos += scnprintf(buf + pos, bufsz - pos, "sfd_timeout: %u\n", 1212 pos += scnprintf(buf + pos, bufsz - pos, "crc32_good:\t\t%u\t\t\t%u\n",
1166 le32_to_cpu(cck->sfd_timeout)); 1213 le32_to_cpu(cck->crc32_good), accum_cck->crc32_good);
1167 pos += scnprintf(buf + pos, bufsz - pos, "fina_timeout: %u\n", 1214 pos += scnprintf(buf + pos, bufsz - pos,
1168 le32_to_cpu(cck->fina_timeout)); 1215 "false_alarm_cnt:\t%u\t\t\t%u\n",
1169 pos += scnprintf(buf + pos, bufsz - pos, "unresponded_rts: %u\n", 1216 le32_to_cpu(cck->false_alarm_cnt),
1170 le32_to_cpu(cck->unresponded_rts)); 1217 accum_cck->false_alarm_cnt);
1171 pos += scnprintf(buf + pos, bufsz - pos, 1218 pos += scnprintf(buf + pos, bufsz - pos,
1172 "rxe_frame_limit_overrun: %u\n", 1219 "fina_sync_err_cnt:\t%u\t\t\t%u\n",
1173 le32_to_cpu(cck->rxe_frame_limit_overrun)); 1220 le32_to_cpu(cck->fina_sync_err_cnt),
1174 pos += scnprintf(buf + pos, bufsz - pos, "sent_ack_cnt: %u\n", 1221 accum_cck->fina_sync_err_cnt);
1175 le32_to_cpu(cck->sent_ack_cnt)); 1222 pos += scnprintf(buf + pos, bufsz - pos,
1176 pos += scnprintf(buf + pos, bufsz - pos, "sent_cts_cnt: %u\n", 1223 "sfd_timeout:\t\t%u\t\t\t%u\n",
1177 le32_to_cpu(cck->sent_cts_cnt)); 1224 le32_to_cpu(cck->sfd_timeout),
1178 pos += scnprintf(buf + pos, bufsz - pos, "sent_ba_rsp_cnt: %u\n", 1225 accum_cck->sfd_timeout);
1179 le32_to_cpu(cck->sent_ba_rsp_cnt)); 1226 pos += scnprintf(buf + pos, bufsz - pos,
1180 pos += scnprintf(buf + pos, bufsz - pos, "dsp_self_kill: %u\n", 1227 "fina_timeout:\t\t%u\t\t\t%u\n",
1181 le32_to_cpu(cck->dsp_self_kill)); 1228 le32_to_cpu(cck->fina_timeout),
1182 pos += scnprintf(buf + pos, bufsz - pos, "mh_format_err: %u\n", 1229 accum_cck->fina_timeout);
1183 le32_to_cpu(cck->mh_format_err)); 1230 pos += scnprintf(buf + pos, bufsz - pos,
1184 pos += scnprintf(buf + pos, bufsz - pos, "re_acq_main_rssi_sum: %u\n", 1231 "unresponded_rts:\t%u\t\t\t%u\n",
1185 le32_to_cpu(cck->re_acq_main_rssi_sum)); 1232 le32_to_cpu(cck->unresponded_rts),
1233 accum_cck->unresponded_rts);
1234 pos += scnprintf(buf + pos, bufsz - pos,
1235 "rxe_frame_lmt_ovrun:\t%u\t\t\t%u\n",
1236 le32_to_cpu(cck->rxe_frame_limit_overrun),
1237 accum_cck->rxe_frame_limit_overrun);
1238 pos += scnprintf(buf + pos, bufsz - pos,
1239 "sent_ack_cnt:\t\t%u\t\t\t%u\n",
1240 le32_to_cpu(cck->sent_ack_cnt),
1241 accum_cck->sent_ack_cnt);
1242 pos += scnprintf(buf + pos, bufsz - pos,
1243 "sent_cts_cnt:\t\t%u\t\t\t%u\n",
1244 le32_to_cpu(cck->sent_cts_cnt),
1245 accum_cck->sent_cts_cnt);
1246 pos += scnprintf(buf + pos, bufsz - pos,
1247 "sent_ba_rsp_cnt:\t%u\t\t\t%u\n",
1248 le32_to_cpu(cck->sent_ba_rsp_cnt),
1249 accum_cck->sent_ba_rsp_cnt);
1250 pos += scnprintf(buf + pos, bufsz - pos,
1251 "dsp_self_kill:\t\t%u\t\t\t%u\n",
1252 le32_to_cpu(cck->dsp_self_kill),
1253 accum_cck->dsp_self_kill);
1254 pos += scnprintf(buf + pos, bufsz - pos,
1255 "mh_format_err:\t\t%u\t\t\t%u\n",
1256 le32_to_cpu(cck->mh_format_err),
1257 accum_cck->mh_format_err);
1258 pos += scnprintf(buf + pos, bufsz - pos,
1259 "re_acq_main_rssi_sum:\t%u\t\t\t%u\n",
1260 le32_to_cpu(cck->re_acq_main_rssi_sum),
1261 accum_cck->re_acq_main_rssi_sum);
1186 1262
1187 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - GENERAL:\n"); 1263 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - GENERAL:\n");
1188 pos += scnprintf(buf + pos, bufsz - pos, "bogus_cts: %u\n", 1264 pos += scnprintf(buf + pos, bufsz - pos,
1189 le32_to_cpu(general->bogus_cts)); 1265 "\t\t\tcurrent\t\t\taccumulative\n");
1190 pos += scnprintf(buf + pos, bufsz - pos, "bogus_ack: %u\n", 1266 pos += scnprintf(buf + pos, bufsz - pos, "bogus_cts:\t\t%u\t\t\t%u\n",
1191 le32_to_cpu(general->bogus_ack)); 1267 le32_to_cpu(general->bogus_cts),
1192 pos += scnprintf(buf + pos, bufsz - pos, "non_bssid_frames: %u\n", 1268 accum_general->bogus_cts);
1193 le32_to_cpu(general->non_bssid_frames)); 1269 pos += scnprintf(buf + pos, bufsz - pos, "bogus_ack:\t\t%u\t\t\t%u\n",
1194 pos += scnprintf(buf + pos, bufsz - pos, "filtered_frames: %u\n", 1270 le32_to_cpu(general->bogus_ack),
1195 le32_to_cpu(general->filtered_frames)); 1271 accum_general->bogus_ack);
1196 pos += scnprintf(buf + pos, bufsz - pos, "non_channel_beacons: %u\n", 1272 pos += scnprintf(buf + pos, bufsz - pos,
1197 le32_to_cpu(general->non_channel_beacons)); 1273 "non_bssid_frames:\t%u\t\t\t%u\n",
1198 pos += scnprintf(buf + pos, bufsz - pos, "channel_beacons: %u\n", 1274 le32_to_cpu(general->non_bssid_frames),
1199 le32_to_cpu(general->channel_beacons)); 1275 accum_general->non_bssid_frames);
1200 pos += scnprintf(buf + pos, bufsz - pos, "num_missed_bcon: %u\n", 1276 pos += scnprintf(buf + pos, bufsz - pos,
1201 le32_to_cpu(general->num_missed_bcon)); 1277 "filtered_frames:\t%u\t\t\t%u\n",
1202 pos += scnprintf(buf + pos, bufsz - pos, 1278 le32_to_cpu(general->filtered_frames),
1203 "adc_rx_saturation_time: %u\n", 1279 accum_general->filtered_frames);
1204 le32_to_cpu(general->adc_rx_saturation_time)); 1280 pos += scnprintf(buf + pos, bufsz - pos,
1205 pos += scnprintf(buf + pos, bufsz - pos, 1281 "non_channel_beacons:\t%u\t\t\t%u\n",
1206 "ina_detection_search_time: %u\n", 1282 le32_to_cpu(general->non_channel_beacons),
1207 le32_to_cpu(general->ina_detection_search_time)); 1283 accum_general->non_channel_beacons);
1208 pos += scnprintf(buf + pos, bufsz - pos, "beacon_silence_rssi_a: %u\n", 1284 pos += scnprintf(buf + pos, bufsz - pos,
1209 le32_to_cpu(general->beacon_silence_rssi_a)); 1285 "channel_beacons:\t%u\t\t\t%u\n",
1210 pos += scnprintf(buf + pos, bufsz - pos, "beacon_silence_rssi_b: %u\n", 1286 le32_to_cpu(general->channel_beacons),
1211 le32_to_cpu(general->beacon_silence_rssi_b)); 1287 accum_general->channel_beacons);
1212 pos += scnprintf(buf + pos, bufsz - pos, "beacon_silence_rssi_c: %u\n", 1288 pos += scnprintf(buf + pos, bufsz - pos,
1213 le32_to_cpu(general->beacon_silence_rssi_c)); 1289 "num_missed_bcon:\t%u\t\t\t%u\n",
1214 pos += scnprintf(buf + pos, bufsz - pos, 1290 le32_to_cpu(general->num_missed_bcon),
1215 "interference_data_flag: %u\n", 1291 accum_general->num_missed_bcon);
1216 le32_to_cpu(general->interference_data_flag)); 1292 pos += scnprintf(buf + pos, bufsz - pos,
1217 pos += scnprintf(buf + pos, bufsz - pos, "channel_load: %u\n", 1293 "adc_rx_saturation_time:\t%u\t\t\t%u\n",
1218 le32_to_cpu(general->channel_load)); 1294 le32_to_cpu(general->adc_rx_saturation_time),
1219 pos += scnprintf(buf + pos, bufsz - pos, "dsp_false_alarms: %u\n", 1295 accum_general->adc_rx_saturation_time);
1220 le32_to_cpu(general->dsp_false_alarms)); 1296 pos += scnprintf(buf + pos, bufsz - pos,
1221 pos += scnprintf(buf + pos, bufsz - pos, "beacon_rssi_a: %u\n", 1297 "ina_detect_search_tm:\t%u\t\t\t%u\n",
1222 le32_to_cpu(general->beacon_rssi_a)); 1298 le32_to_cpu(general->ina_detection_search_time),
1223 pos += scnprintf(buf + pos, bufsz - pos, "beacon_rssi_b: %u\n", 1299 accum_general->ina_detection_search_time);
1224 le32_to_cpu(general->beacon_rssi_b)); 1300 pos += scnprintf(buf + pos, bufsz - pos,
1225 pos += scnprintf(buf + pos, bufsz - pos, "beacon_rssi_c: %u\n", 1301 "beacon_silence_rssi_a:\t%u\t\t\t%u\n",
1226 le32_to_cpu(general->beacon_rssi_c)); 1302 le32_to_cpu(general->beacon_silence_rssi_a),
1227 pos += scnprintf(buf + pos, bufsz - pos, "beacon_energy_a: %u\n", 1303 accum_general->beacon_silence_rssi_a);
1228 le32_to_cpu(general->beacon_energy_a)); 1304 pos += scnprintf(buf + pos, bufsz - pos,
1229 pos += scnprintf(buf + pos, bufsz - pos, "beacon_energy_b: %u\n", 1305 "beacon_silence_rssi_b:\t%u\t\t\t%u\n",
1230 le32_to_cpu(general->beacon_energy_b)); 1306 le32_to_cpu(general->beacon_silence_rssi_b),
1231 pos += scnprintf(buf + pos, bufsz - pos, "beacon_energy_c: %u\n", 1307 accum_general->beacon_silence_rssi_b);
1232 le32_to_cpu(general->beacon_energy_c)); 1308 pos += scnprintf(buf + pos, bufsz - pos,
1309 "beacon_silence_rssi_c:\t%u\t\t\t%u\n",
1310 le32_to_cpu(general->beacon_silence_rssi_c),
1311 accum_general->beacon_silence_rssi_c);
1312 pos += scnprintf(buf + pos, bufsz - pos,
1313 "interference_data_flag:\t%u\t\t\t%u\n",
1314 le32_to_cpu(general->interference_data_flag),
1315 accum_general->interference_data_flag);
1316 pos += scnprintf(buf + pos, bufsz - pos,
1317 "channel_load:\t\t%u\t\t\t%u\n",
1318 le32_to_cpu(general->channel_load),
1319 accum_general->channel_load);
1320 pos += scnprintf(buf + pos, bufsz - pos,
1321 "dsp_false_alarms:\t%u\t\t\t%u\n",
1322 le32_to_cpu(general->dsp_false_alarms),
1323 accum_general->dsp_false_alarms);
1324 pos += scnprintf(buf + pos, bufsz - pos,
1325 "beacon_rssi_a:\t\t%u\t\t\t%u\n",
1326 le32_to_cpu(general->beacon_rssi_a),
1327 accum_general->beacon_rssi_a);
1328 pos += scnprintf(buf + pos, bufsz - pos,
1329 "beacon_rssi_b:\t\t%u\t\t\t%u\n",
1330 le32_to_cpu(general->beacon_rssi_b),
1331 accum_general->beacon_rssi_b);
1332 pos += scnprintf(buf + pos, bufsz - pos,
1333 "beacon_rssi_c:\t\t%u\t\t\t%u\n",
1334 le32_to_cpu(general->beacon_rssi_c),
1335 accum_general->beacon_rssi_c);
1336 pos += scnprintf(buf + pos, bufsz - pos,
1337 "beacon_energy_a:\t%u\t\t\t%u\n",
1338 le32_to_cpu(general->beacon_energy_a),
1339 accum_general->beacon_energy_a);
1340 pos += scnprintf(buf + pos, bufsz - pos,
1341 "beacon_energy_b:\t%u\t\t\t%u\n",
1342 le32_to_cpu(general->beacon_energy_b),
1343 accum_general->beacon_energy_b);
1344 pos += scnprintf(buf + pos, bufsz - pos,
1345 "beacon_energy_c:\t%u\t\t\t%u\n",
1346 le32_to_cpu(general->beacon_energy_c),
1347 accum_general->beacon_energy_c);
1233 1348
1234 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM_HT:\n"); 1349 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM_HT:\n");
1235 pos += scnprintf(buf + pos, bufsz - pos, "plcp_err: %u\n", 1350 pos += scnprintf(buf + pos, bufsz - pos,
1236 le32_to_cpu(ht->plcp_err)); 1351 "\t\t\tcurrent\t\t\taccumulative\n");
1237 pos += scnprintf(buf + pos, bufsz - pos, "overrun_err: %u\n", 1352 pos += scnprintf(buf + pos, bufsz - pos, "plcp_err:\t\t%u\t\t\t%u\n",
1238 le32_to_cpu(ht->overrun_err)); 1353 le32_to_cpu(ht->plcp_err), accum_ht->plcp_err);
1239 pos += scnprintf(buf + pos, bufsz - pos, "early_overrun_err: %u\n", 1354 pos += scnprintf(buf + pos, bufsz - pos,
1240 le32_to_cpu(ht->early_overrun_err)); 1355 "overrun_err:\t\t%u\t\t\t%u\n",
1241 pos += scnprintf(buf + pos, bufsz - pos, "crc32_good: %u\n", 1356 le32_to_cpu(ht->overrun_err), accum_ht->overrun_err);
1242 le32_to_cpu(ht->crc32_good)); 1357 pos += scnprintf(buf + pos, bufsz - pos,
1243 pos += scnprintf(buf + pos, bufsz - pos, "crc32_err: %u\n", 1358 "early_overrun_err:\t%u\t\t\t%u\n",
1244 le32_to_cpu(ht->crc32_err)); 1359 le32_to_cpu(ht->early_overrun_err),
1245 pos += scnprintf(buf + pos, bufsz - pos, "mh_format_err: %u\n", 1360 accum_ht->early_overrun_err);
1246 le32_to_cpu(ht->mh_format_err)); 1361 pos += scnprintf(buf + pos, bufsz - pos, "crc32_good:\t\t%u\t\t\t%u\n",
1247 pos += scnprintf(buf + pos, bufsz - pos, "agg_crc32_good: %u\n", 1362 le32_to_cpu(ht->crc32_good), accum_ht->crc32_good);
1248 le32_to_cpu(ht->agg_crc32_good)); 1363 pos += scnprintf(buf + pos, bufsz - pos, "crc32_err:\t\t%u\t\t\t%u\n",
1249 pos += scnprintf(buf + pos, bufsz - pos, "agg_mpdu_cnt: %u\n", 1364 le32_to_cpu(ht->crc32_err), accum_ht->crc32_err);
1250 le32_to_cpu(ht->agg_mpdu_cnt)); 1365 pos += scnprintf(buf + pos, bufsz - pos,
1251 pos += scnprintf(buf + pos, bufsz - pos, "agg_cnt: %u\n", 1366 "mh_format_err:\t\t%u\t\t\t%u\n",
1252 le32_to_cpu(ht->agg_cnt)); 1367 le32_to_cpu(ht->mh_format_err),
1368 accum_ht->mh_format_err);
1369 pos += scnprintf(buf + pos, bufsz - pos,
1370 "agg_crc32_good:\t\t%u\t\t\t%u\n",
1371 le32_to_cpu(ht->agg_crc32_good),
1372 accum_ht->agg_crc32_good);
1373 pos += scnprintf(buf + pos, bufsz - pos,
1374 "agg_mpdu_cnt:\t\t%u\t\t\t%u\n",
1375 le32_to_cpu(ht->agg_mpdu_cnt),
1376 accum_ht->agg_mpdu_cnt);
1377 pos += scnprintf(buf + pos, bufsz - pos, "agg_cnt:\t\t%u\t\t\t%u\n",
1378 le32_to_cpu(ht->agg_cnt), accum_ht->agg_cnt);
1253 1379
1254 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1380 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1255 kfree(buf); 1381 kfree(buf);
@@ -1265,7 +1391,7 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file,
1265 char *buf; 1391 char *buf;
1266 int bufsz = (sizeof(struct statistics_tx) * 24) + 250; 1392 int bufsz = (sizeof(struct statistics_tx) * 24) + 250;
1267 ssize_t ret; 1393 ssize_t ret;
1268 struct statistics_tx *tx; 1394 struct statistics_tx *tx, *accum_tx;
1269 1395
1270 if (!iwl_is_alive(priv)) 1396 if (!iwl_is_alive(priv))
1271 return -EAGAIN; 1397 return -EAGAIN;
@@ -1291,62 +1417,107 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file,
1291 * might not reflect the current uCode activity 1417 * might not reflect the current uCode activity
1292 */ 1418 */
1293 tx = &priv->statistics.tx; 1419 tx = &priv->statistics.tx;
1420 accum_tx = &priv->accum_statistics.tx;
1294 pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); 1421 pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz);
1295 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Tx:\n"); 1422 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Tx:\n");
1296 pos += scnprintf(buf + pos, bufsz - pos, "preamble: %u\n", 1423 pos += scnprintf(buf + pos, bufsz - pos,
1297 le32_to_cpu(tx->preamble_cnt)); 1424 "\t\t\tcurrent\t\t\taccumulative\n");
1298 pos += scnprintf(buf + pos, bufsz - pos, "rx_detected_cnt: %u\n", 1425 pos += scnprintf(buf + pos, bufsz - pos, "preamble:\t\t\t%u\t\t\t%u\n",
1299 le32_to_cpu(tx->rx_detected_cnt)); 1426 le32_to_cpu(tx->preamble_cnt),
1300 pos += scnprintf(buf + pos, bufsz - pos, "bt_prio_defer_cnt: %u\n", 1427 accum_tx->preamble_cnt);
1301 le32_to_cpu(tx->bt_prio_defer_cnt)); 1428 pos += scnprintf(buf + pos, bufsz - pos,
1302 pos += scnprintf(buf + pos, bufsz - pos, "bt_prio_kill_cnt: %u\n", 1429 "rx_detected_cnt:\t\t%u\t\t\t%u\n",
1303 le32_to_cpu(tx->bt_prio_kill_cnt)); 1430 le32_to_cpu(tx->rx_detected_cnt),
1304 pos += scnprintf(buf + pos, bufsz - pos, "few_bytes_cnt: %u\n", 1431 accum_tx->rx_detected_cnt);
1305 le32_to_cpu(tx->few_bytes_cnt)); 1432 pos += scnprintf(buf + pos, bufsz - pos,
1306 pos += scnprintf(buf + pos, bufsz - pos, "cts_timeout: %u\n", 1433 "bt_prio_defer_cnt:\t\t%u\t\t\t%u\n",
1307 le32_to_cpu(tx->cts_timeout)); 1434 le32_to_cpu(tx->bt_prio_defer_cnt),
1308 pos += scnprintf(buf + pos, bufsz - pos, "ack_timeout: %u\n", 1435 accum_tx->bt_prio_defer_cnt);
1309 le32_to_cpu(tx->ack_timeout)); 1436 pos += scnprintf(buf + pos, bufsz - pos,
1310 pos += scnprintf(buf + pos, bufsz - pos, "expected_ack_cnt: %u\n", 1437 "bt_prio_kill_cnt:\t\t%u\t\t\t%u\n",
1311 le32_to_cpu(tx->expected_ack_cnt)); 1438 le32_to_cpu(tx->bt_prio_kill_cnt),
1312 pos += scnprintf(buf + pos, bufsz - pos, "actual_ack_cnt: %u\n", 1439 accum_tx->bt_prio_kill_cnt);
1313 le32_to_cpu(tx->actual_ack_cnt)); 1440 pos += scnprintf(buf + pos, bufsz - pos,
1314 pos += scnprintf(buf + pos, bufsz - pos, "dump_msdu_cnt: %u\n", 1441 "few_bytes_cnt:\t\t\t%u\t\t\t%u\n",
1315 le32_to_cpu(tx->dump_msdu_cnt)); 1442 le32_to_cpu(tx->few_bytes_cnt),
1316 pos += scnprintf(buf + pos, bufsz - pos, 1443 accum_tx->few_bytes_cnt);
1317 "burst_abort_next_frame_mismatch_cnt: %u\n", 1444 pos += scnprintf(buf + pos, bufsz - pos,
1318 le32_to_cpu(tx->burst_abort_next_frame_mismatch_cnt)); 1445 "cts_timeout:\t\t\t%u\t\t\t%u\n",
1319 pos += scnprintf(buf + pos, bufsz - pos, 1446 le32_to_cpu(tx->cts_timeout), accum_tx->cts_timeout);
1320 "burst_abort_missing_next_frame_cnt: %u\n", 1447 pos += scnprintf(buf + pos, bufsz - pos,
1321 le32_to_cpu(tx->burst_abort_missing_next_frame_cnt)); 1448 "ack_timeout:\t\t\t%u\t\t\t%u\n",
1322 pos += scnprintf(buf + pos, bufsz - pos, "cts_timeout_collision: %u\n", 1449 le32_to_cpu(tx->ack_timeout),
1323 le32_to_cpu(tx->cts_timeout_collision)); 1450 accum_tx->ack_timeout);
1324 pos += scnprintf(buf + pos, bufsz - pos, 1451 pos += scnprintf(buf + pos, bufsz - pos,
1325 "ack_or_ba_timeout_collision: %u\n", 1452 "expected_ack_cnt:\t\t%u\t\t\t%u\n",
1326 le32_to_cpu(tx->ack_or_ba_timeout_collision)); 1453 le32_to_cpu(tx->expected_ack_cnt),
1327 pos += scnprintf(buf + pos, bufsz - pos, "agg ba_timeout: %u\n", 1454 accum_tx->expected_ack_cnt);
1328 le32_to_cpu(tx->agg.ba_timeout)); 1455 pos += scnprintf(buf + pos, bufsz - pos,
1329 pos += scnprintf(buf + pos, bufsz - pos, 1456 "actual_ack_cnt:\t\t\t%u\t\t\t%u\n",
1330 "agg ba_reschedule_frames: %u\n", 1457 le32_to_cpu(tx->actual_ack_cnt),
1331 le32_to_cpu(tx->agg.ba_reschedule_frames)); 1458 accum_tx->actual_ack_cnt);
1332 pos += scnprintf(buf + pos, bufsz - pos, 1459 pos += scnprintf(buf + pos, bufsz - pos,
1333 "agg scd_query_agg_frame_cnt: %u\n", 1460 "dump_msdu_cnt:\t\t\t%u\t\t\t%u\n",
1334 le32_to_cpu(tx->agg.scd_query_agg_frame_cnt)); 1461 le32_to_cpu(tx->dump_msdu_cnt),
1335 pos += scnprintf(buf + pos, bufsz - pos, "agg scd_query_no_agg: %u\n", 1462 accum_tx->dump_msdu_cnt);
1336 le32_to_cpu(tx->agg.scd_query_no_agg)); 1463 pos += scnprintf(buf + pos, bufsz - pos,
1337 pos += scnprintf(buf + pos, bufsz - pos, "agg scd_query_agg: %u\n", 1464 "abort_nxt_frame_mismatch:"
1338 le32_to_cpu(tx->agg.scd_query_agg)); 1465 "\t%u\t\t\t%u\n",
1339 pos += scnprintf(buf + pos, bufsz - pos, 1466 le32_to_cpu(tx->burst_abort_next_frame_mismatch_cnt),
1340 "agg scd_query_mismatch: %u\n", 1467 accum_tx->burst_abort_next_frame_mismatch_cnt);
1341 le32_to_cpu(tx->agg.scd_query_mismatch)); 1468 pos += scnprintf(buf + pos, bufsz - pos,
1342 pos += scnprintf(buf + pos, bufsz - pos, "agg frame_not_ready: %u\n", 1469 "abort_missing_nxt_frame:"
1343 le32_to_cpu(tx->agg.frame_not_ready)); 1470 "\t%u\t\t\t%u\n",
1344 pos += scnprintf(buf + pos, bufsz - pos, "agg underrun: %u\n", 1471 le32_to_cpu(tx->burst_abort_missing_next_frame_cnt),
1345 le32_to_cpu(tx->agg.underrun)); 1472 accum_tx->burst_abort_missing_next_frame_cnt);
1346 pos += scnprintf(buf + pos, bufsz - pos, "agg bt_prio_kill: %u\n", 1473 pos += scnprintf(buf + pos, bufsz - pos,
1347 le32_to_cpu(tx->agg.bt_prio_kill)); 1474 "cts_timeout_collision:\t\t%u\t\t\t%u\n",
1348 pos += scnprintf(buf + pos, bufsz - pos, "agg rx_ba_rsp_cnt: %u\n", 1475 le32_to_cpu(tx->cts_timeout_collision),
1349 le32_to_cpu(tx->agg.rx_ba_rsp_cnt)); 1476 accum_tx->cts_timeout_collision);
1477 pos += scnprintf(buf + pos, bufsz - pos,
1478 "ack_ba_timeout_collision:\t%u\t\t\t%u\n",
1479 le32_to_cpu(tx->ack_or_ba_timeout_collision),
1480 accum_tx->ack_or_ba_timeout_collision);
1481 pos += scnprintf(buf + pos, bufsz - pos,
1482 "agg ba_timeout:\t\t\t%u\t\t\t%u\n",
1483 le32_to_cpu(tx->agg.ba_timeout),
1484 accum_tx->agg.ba_timeout);
1485 pos += scnprintf(buf + pos, bufsz - pos,
1486 "agg ba_resched_frames:\t\t%u\t\t\t%u\n",
1487 le32_to_cpu(tx->agg.ba_reschedule_frames),
1488 accum_tx->agg.ba_reschedule_frames);
1489 pos += scnprintf(buf + pos, bufsz - pos,
1490 "agg scd_query_agg_frame:\t%u\t\t\t%u\n",
1491 le32_to_cpu(tx->agg.scd_query_agg_frame_cnt),
1492 accum_tx->agg.scd_query_agg_frame_cnt);
1493 pos += scnprintf(buf + pos, bufsz - pos,
1494 "agg scd_query_no_agg:\t\t%u\t\t\t%u\n",
1495 le32_to_cpu(tx->agg.scd_query_no_agg),
1496 accum_tx->agg.scd_query_no_agg);
1497 pos += scnprintf(buf + pos, bufsz - pos,
1498 "agg scd_query_agg:\t\t%u\t\t\t%u\n",
1499 le32_to_cpu(tx->agg.scd_query_agg),
1500 accum_tx->agg.scd_query_agg);
1501 pos += scnprintf(buf + pos, bufsz - pos,
1502 "agg scd_query_mismatch:\t\t%u\t\t\t%u\n",
1503 le32_to_cpu(tx->agg.scd_query_mismatch),
1504 accum_tx->agg.scd_query_mismatch);
1505 pos += scnprintf(buf + pos, bufsz - pos,
1506 "agg frame_not_ready:\t\t%u\t\t\t%u\n",
1507 le32_to_cpu(tx->agg.frame_not_ready),
1508 accum_tx->agg.frame_not_ready);
1509 pos += scnprintf(buf + pos, bufsz - pos,
1510 "agg underrun:\t\t\t%u\t\t\t%u\n",
1511 le32_to_cpu(tx->agg.underrun),
1512 accum_tx->agg.underrun);
1513 pos += scnprintf(buf + pos, bufsz - pos,
1514 "agg bt_prio_kill:\t\t%u\t\t\t%u\n",
1515 le32_to_cpu(tx->agg.bt_prio_kill),
1516 accum_tx->agg.bt_prio_kill);
1517 pos += scnprintf(buf + pos, bufsz - pos,
1518 "agg rx_ba_rsp_cnt:\t\t%u\t\t\t%u\n",
1519 le32_to_cpu(tx->agg.rx_ba_rsp_cnt),
1520 accum_tx->agg.rx_ba_rsp_cnt);
1350 1521
1351 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1522 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1352 kfree(buf); 1523 kfree(buf);
@@ -1362,9 +1533,9 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file,
1362 char *buf; 1533 char *buf;
1363 int bufsz = sizeof(struct statistics_general) * 4 + 250; 1534 int bufsz = sizeof(struct statistics_general) * 4 + 250;
1364 ssize_t ret; 1535 ssize_t ret;
1365 struct statistics_general *general; 1536 struct statistics_general *general, *accum_general;
1366 struct statistics_dbg *dbg; 1537 struct statistics_dbg *dbg, *accum_dbg;
1367 struct statistics_div *div; 1538 struct statistics_div *div, *accum_div;
1368 1539
1369 if (!iwl_is_alive(priv)) 1540 if (!iwl_is_alive(priv))
1370 return -EAGAIN; 1541 return -EAGAIN;
@@ -1392,34 +1563,53 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file,
1392 general = &priv->statistics.general; 1563 general = &priv->statistics.general;
1393 dbg = &priv->statistics.general.dbg; 1564 dbg = &priv->statistics.general.dbg;
1394 div = &priv->statistics.general.div; 1565 div = &priv->statistics.general.div;
1566 accum_general = &priv->accum_statistics.general;
1567 accum_dbg = &priv->accum_statistics.general.dbg;
1568 accum_div = &priv->accum_statistics.general.div;
1395 pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); 1569 pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz);
1396 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_General:\n"); 1570 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_General:\n");
1397 pos += scnprintf(buf + pos, bufsz - pos, "temperature: %u\n", 1571 pos += scnprintf(buf + pos, bufsz - pos,
1572 "\t\t\tcurrent\t\t\taccumulative\n");
1573 pos += scnprintf(buf + pos, bufsz - pos, "temperature:\t\t\t%u\n",
1398 le32_to_cpu(general->temperature)); 1574 le32_to_cpu(general->temperature));
1399 pos += scnprintf(buf + pos, bufsz - pos, "temperature_m: %u\n", 1575 pos += scnprintf(buf + pos, bufsz - pos, "temperature_m:\t\t\t%u\n",
1400 le32_to_cpu(general->temperature_m)); 1576 le32_to_cpu(general->temperature_m));
1401 pos += scnprintf(buf + pos, bufsz - pos, "burst_check: %u\n", 1577 pos += scnprintf(buf + pos, bufsz - pos,
1402 le32_to_cpu(dbg->burst_check)); 1578 "burst_check:\t\t\t%u\t\t\t%u\n",
1403 pos += scnprintf(buf + pos, bufsz - pos, "burst_count: %u\n", 1579 le32_to_cpu(dbg->burst_check),
1404 le32_to_cpu(dbg->burst_count)); 1580 accum_dbg->burst_check);
1405 pos += scnprintf(buf + pos, bufsz - pos, "sleep_time: %u\n", 1581 pos += scnprintf(buf + pos, bufsz - pos,
1406 le32_to_cpu(general->sleep_time)); 1582 "burst_count:\t\t\t%u\t\t\t%u\n",
1407 pos += scnprintf(buf + pos, bufsz - pos, "slots_out: %u\n", 1583 le32_to_cpu(dbg->burst_count),
1408 le32_to_cpu(general->slots_out)); 1584 accum_dbg->burst_count);
1409 pos += scnprintf(buf + pos, bufsz - pos, "slots_idle: %u\n", 1585 pos += scnprintf(buf + pos, bufsz - pos,
1410 le32_to_cpu(general->slots_idle)); 1586 "sleep_time:\t\t\t%u\t\t\t%u\n",
1411 pos += scnprintf(buf + pos, bufsz - pos, "ttl_timestamp: %u\n", 1587 le32_to_cpu(general->sleep_time),
1588 accum_general->sleep_time);
1589 pos += scnprintf(buf + pos, bufsz - pos,
1590 "slots_out:\t\t\t%u\t\t\t%u\n",
1591 le32_to_cpu(general->slots_out),
1592 accum_general->slots_out);
1593 pos += scnprintf(buf + pos, bufsz - pos,
1594 "slots_idle:\t\t\t%u\t\t\t%u\n",
1595 le32_to_cpu(general->slots_idle),
1596 accum_general->slots_idle);
1597 pos += scnprintf(buf + pos, bufsz - pos, "ttl_timestamp:\t\t\t%u\n",
1412 le32_to_cpu(general->ttl_timestamp)); 1598 le32_to_cpu(general->ttl_timestamp));
1413 pos += scnprintf(buf + pos, bufsz - pos, "tx_on_a: %u\n", 1599 pos += scnprintf(buf + pos, bufsz - pos, "tx_on_a:\t\t\t%u\t\t\t%u\n",
1414 le32_to_cpu(div->tx_on_a)); 1600 le32_to_cpu(div->tx_on_a), accum_div->tx_on_a);
1415 pos += scnprintf(buf + pos, bufsz - pos, "tx_on_b: %u\n", 1601 pos += scnprintf(buf + pos, bufsz - pos, "tx_on_b:\t\t\t%u\t\t\t%u\n",
1416 le32_to_cpu(div->tx_on_b)); 1602 le32_to_cpu(div->tx_on_b), accum_div->tx_on_b);
1417 pos += scnprintf(buf + pos, bufsz - pos, "exec_time: %u\n", 1603 pos += scnprintf(buf + pos, bufsz - pos,
1418 le32_to_cpu(div->exec_time)); 1604 "exec_time:\t\t\t%u\t\t\t%u\n",
1419 pos += scnprintf(buf + pos, bufsz - pos, "probe_time: %u\n", 1605 le32_to_cpu(div->exec_time), accum_div->exec_time);
1420 le32_to_cpu(div->probe_time)); 1606 pos += scnprintf(buf + pos, bufsz - pos,
1421 pos += scnprintf(buf + pos, bufsz - pos, "rx_enable_counter: %u\n", 1607 "probe_time:\t\t\t%u\t\t\t%u\n",
1422 le32_to_cpu(general->rx_enable_counter)); 1608 le32_to_cpu(div->probe_time), accum_div->probe_time);
1609 pos += scnprintf(buf + pos, bufsz - pos,
1610 "rx_enable_counter:\t\t%u\t\t\t%u\n",
1611 le32_to_cpu(general->rx_enable_counter),
1612 accum_general->rx_enable_counter);
1423 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1613 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1424 kfree(buf); 1614 kfree(buf);
1425 return ret; 1615 return ret;
@@ -1615,6 +1805,29 @@ static ssize_t iwl_dbgfs_tx_power_read(struct file *file,
1615 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1805 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1616} 1806}
1617 1807
1808static ssize_t iwl_dbgfs_power_save_status_read(struct file *file,
1809 char __user *user_buf,
1810 size_t count, loff_t *ppos)
1811{
1812 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
1813 char buf[60];
1814 int pos = 0;
1815 const size_t bufsz = sizeof(buf);
1816 u32 pwrsave_status;
1817
1818 pwrsave_status = iwl_read32(priv, CSR_GP_CNTRL) &
1819 CSR_GP_REG_POWER_SAVE_STATUS_MSK;
1820
1821 pos += scnprintf(buf + pos, bufsz - pos, "Power Save Status: ");
1822 pos += scnprintf(buf + pos, bufsz - pos, "%s\n",
1823 (pwrsave_status == CSR_GP_REG_NO_POWER_SAVE) ? "none" :
1824 (pwrsave_status == CSR_GP_REG_MAC_POWER_SAVE) ? "MAC" :
1825 (pwrsave_status == CSR_GP_REG_PHY_POWER_SAVE) ? "PHY" :
1826 "error");
1827
1828 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1829}
1830
1618DEBUGFS_READ_WRITE_FILE_OPS(rx_statistics); 1831DEBUGFS_READ_WRITE_FILE_OPS(rx_statistics);
1619DEBUGFS_READ_WRITE_FILE_OPS(tx_statistics); 1832DEBUGFS_READ_WRITE_FILE_OPS(tx_statistics);
1620DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); 1833DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -1626,6 +1839,7 @@ DEBUGFS_READ_FILE_OPS(ucode_general_stats);
1626DEBUGFS_READ_FILE_OPS(sensitivity); 1839DEBUGFS_READ_FILE_OPS(sensitivity);
1627DEBUGFS_READ_FILE_OPS(chain_noise); 1840DEBUGFS_READ_FILE_OPS(chain_noise);
1628DEBUGFS_READ_FILE_OPS(tx_power); 1841DEBUGFS_READ_FILE_OPS(tx_power);
1842DEBUGFS_READ_FILE_OPS(power_save_status);
1629 1843
1630/* 1844/*
1631 * Create the debugfs files and directories 1845 * Create the debugfs files and directories
@@ -1673,6 +1887,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1673 DEBUGFS_ADD_FILE(rx_queue, debug); 1887 DEBUGFS_ADD_FILE(rx_queue, debug);
1674 DEBUGFS_ADD_FILE(tx_queue, debug); 1888 DEBUGFS_ADD_FILE(tx_queue, debug);
1675 DEBUGFS_ADD_FILE(tx_power, debug); 1889 DEBUGFS_ADD_FILE(tx_power, debug);
1890 DEBUGFS_ADD_FILE(power_save_status, debug);
1676 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { 1891 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
1677 DEBUGFS_ADD_FILE(ucode_rx_stats, debug); 1892 DEBUGFS_ADD_FILE(ucode_rx_stats, debug);
1678 DEBUGFS_ADD_FILE(ucode_tx_stats, debug); 1893 DEBUGFS_ADD_FILE(ucode_tx_stats, debug);
@@ -1725,6 +1940,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
1725 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_rx_queue); 1940 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_rx_queue);
1726 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_queue); 1941 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_queue);
1727 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_power); 1942 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_power);
1943 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_power_save_status);
1728 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { 1944 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
1729 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. 1945 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
1730 file_ucode_rx_stats); 1946 file_ucode_rx_stats);