diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-10-09 16:20:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:00 -0400 |
commit | 92a35bda792cf9295b1d399f7c937d4560292b1e (patch) | |
tree | 4b3121359d69542286480b7b16d2b91c8149415a /drivers | |
parent | 88804e2b33b6ab3974ff2330cd045ca53d6750c5 (diff) |
iwlwifi: showing accumulative ucode statistics counters
Adding accumulative statistics counters in iwlwifi driver.
Statistics counters are reported by uCode every beacon interval; but can
be reset by uCode when needed. The accumulative statistics counters is
maintained by driver to keep track of the history of all the counters.
Update the ucode stats files in debugfs to display both latest and
accumulative counters.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 629 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 41 |
4 files changed, 447 insertions, 229 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 314cae77364..cee03e7fc2d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -361,8 +361,6 @@ void iwl3945_hw_rx_statistics(struct iwl_priv *priv, | |||
361 | memcpy(&priv->statistics_39, pkt->u.raw, sizeof(priv->statistics_39)); | 361 | memcpy(&priv->statistics_39, pkt->u.raw, sizeof(priv->statistics_39)); |
362 | 362 | ||
363 | iwl_leds_background(priv); | 363 | iwl_leds_background(priv); |
364 | |||
365 | priv->last_statistics_time = jiffies; | ||
366 | } | 364 | } |
367 | 365 | ||
368 | /****************************************************************************** | 366 | /****************************************************************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 028d4bf8dcd..2cd11ba9637 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -1079,10 +1079,10 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file, | |||
1079 | sizeof(struct statistics_rx_non_phy) * 20 + | 1079 | sizeof(struct statistics_rx_non_phy) * 20 + |
1080 | sizeof(struct statistics_rx_ht_phy) * 20 + 400; | 1080 | sizeof(struct statistics_rx_ht_phy) * 20 + 400; |
1081 | ssize_t ret; | 1081 | ssize_t ret; |
1082 | struct statistics_rx_phy *ofdm; | 1082 | struct statistics_rx_phy *ofdm, *accum_ofdm; |
1083 | struct statistics_rx_phy *cck; | 1083 | struct statistics_rx_phy *cck, *accum_cck; |
1084 | struct statistics_rx_non_phy *general; | 1084 | struct statistics_rx_non_phy *general, *accum_general; |
1085 | struct statistics_rx_ht_phy *ht; | 1085 | struct statistics_rx_ht_phy *ht, *accum_ht; |
1086 | 1086 | ||
1087 | if (!iwl_is_alive(priv)) | 1087 | if (!iwl_is_alive(priv)) |
1088 | return -EAGAIN; | 1088 | return -EAGAIN; |
@@ -1111,155 +1111,268 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file, | |||
1111 | cck = &priv->statistics.rx.cck; | 1111 | cck = &priv->statistics.rx.cck; |
1112 | general = &priv->statistics.rx.general; | 1112 | general = &priv->statistics.rx.general; |
1113 | ht = &priv->statistics.rx.ofdm_ht; | 1113 | ht = &priv->statistics.rx.ofdm_ht; |
1114 | accum_ofdm = &priv->accum_statistics.rx.ofdm; | ||
1115 | accum_cck = &priv->accum_statistics.rx.cck; | ||
1116 | accum_general = &priv->accum_statistics.rx.general; | ||
1117 | accum_ht = &priv->accum_statistics.rx.ofdm_ht; | ||
1114 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | 1118 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); |
1115 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM:\n"); | 1119 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM:\n"); |
1116 | pos += scnprintf(buf + pos, bufsz - pos, "ina_cnt: %u\n", | 1120 | pos += scnprintf(buf + pos, bufsz - pos, |
1117 | le32_to_cpu(ofdm->ina_cnt)); | 1121 | "\t\t\tcurrent\t\t\taccumulative\n"); |
1118 | pos += scnprintf(buf + pos, bufsz - pos, "fina_cnt: %u\n", | 1122 | pos += scnprintf(buf + pos, bufsz - pos, "ina_cnt:\t\t%u\t\t\t%u\n", |
1119 | le32_to_cpu(ofdm->fina_cnt)); | 1123 | le32_to_cpu(ofdm->ina_cnt), accum_ofdm->ina_cnt); |
1120 | pos += scnprintf(buf + pos, bufsz - pos, "plcp_err: %u\n", | 1124 | pos += scnprintf(buf + pos, bufsz - pos, "fina_cnt:\t\t%u\t\t\t%u\n", |
1121 | le32_to_cpu(ofdm->plcp_err)); | 1125 | le32_to_cpu(ofdm->fina_cnt), accum_ofdm->fina_cnt); |
1122 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_err: %u\n", | 1126 | pos += scnprintf(buf + pos, bufsz - pos, "plcp_err:\t\t%u\t\t\t%u\n", |
1123 | le32_to_cpu(ofdm->crc32_err)); | 1127 | le32_to_cpu(ofdm->plcp_err), accum_ofdm->plcp_err); |
1124 | pos += scnprintf(buf + pos, bufsz - pos, "overrun_err: %u\n", | 1128 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_err:\t\t%u\t\t\t%u\n", |
1125 | le32_to_cpu(ofdm->overrun_err)); | 1129 | le32_to_cpu(ofdm->crc32_err), accum_ofdm->crc32_err); |
1126 | pos += scnprintf(buf + pos, bufsz - pos, "early_overrun_err: %u\n", | 1130 | pos += scnprintf(buf + pos, bufsz - pos, |
1127 | le32_to_cpu(ofdm->early_overrun_err)); | 1131 | "overrun_err:\t\t%u\t\t\t%u\n", |
1128 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_good: %u\n", | 1132 | le32_to_cpu(ofdm->overrun_err), |
1129 | le32_to_cpu(ofdm->crc32_good)); | 1133 | accum_ofdm->overrun_err); |
1130 | pos += scnprintf(buf + pos, bufsz - pos, "false_alarm_cnt: %u\n", | 1134 | pos += scnprintf(buf + pos, bufsz - pos, |
1131 | le32_to_cpu(ofdm->false_alarm_cnt)); | 1135 | "early_overrun_err:\t%u\t\t\t%u\n", |
1132 | pos += scnprintf(buf + pos, bufsz - pos, "fina_sync_err_cnt: %u\n", | 1136 | le32_to_cpu(ofdm->early_overrun_err), |
1133 | le32_to_cpu(ofdm->fina_sync_err_cnt)); | 1137 | accum_ofdm->early_overrun_err); |
1134 | pos += scnprintf(buf + pos, bufsz - pos, "sfd_timeout: %u\n", | 1138 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_good:\t\t%u\t\t\t%u\n", |
1135 | le32_to_cpu(ofdm->sfd_timeout)); | 1139 | le32_to_cpu(ofdm->crc32_good), |
1136 | pos += scnprintf(buf + pos, bufsz - pos, "fina_timeout: %u\n", | 1140 | accum_ofdm->crc32_good); |
1137 | le32_to_cpu(ofdm->fina_timeout)); | 1141 | pos += scnprintf(buf + pos, bufsz - pos, |
1138 | pos += scnprintf(buf + pos, bufsz - pos, "unresponded_rts: %u\n", | 1142 | "false_alarm_cnt:\t%u\t\t\t%u\n", |
1139 | le32_to_cpu(ofdm->unresponded_rts)); | 1143 | le32_to_cpu(ofdm->false_alarm_cnt), |
1140 | pos += scnprintf(buf + pos, bufsz - pos, | 1144 | accum_ofdm->false_alarm_cnt); |
1141 | "rxe_frame_limit_overrun: %u\n", | 1145 | pos += scnprintf(buf + pos, bufsz - pos, |
1142 | le32_to_cpu(ofdm->rxe_frame_limit_overrun)); | 1146 | "fina_sync_err_cnt:\t%u\t\t\t%u\n", |
1143 | pos += scnprintf(buf + pos, bufsz - pos, "sent_ack_cnt: %u\n", | 1147 | le32_to_cpu(ofdm->fina_sync_err_cnt), |
1144 | le32_to_cpu(ofdm->sent_ack_cnt)); | 1148 | accum_ofdm->fina_sync_err_cnt); |
1145 | pos += scnprintf(buf + pos, bufsz - pos, "sent_cts_cnt: %u\n", | 1149 | pos += scnprintf(buf + pos, bufsz - pos, |
1146 | le32_to_cpu(ofdm->sent_cts_cnt)); | 1150 | "sfd_timeout:\t\t%u\t\t\t%u\n", |
1147 | pos += scnprintf(buf + pos, bufsz - pos, "sent_ba_rsp_cnt: %u\n", | 1151 | le32_to_cpu(ofdm->sfd_timeout), |
1148 | le32_to_cpu(ofdm->sent_ba_rsp_cnt)); | 1152 | accum_ofdm->sfd_timeout); |
1149 | pos += scnprintf(buf + pos, bufsz - pos, "dsp_self_kill: %u\n", | 1153 | pos += scnprintf(buf + pos, bufsz - pos, |
1150 | le32_to_cpu(ofdm->dsp_self_kill)); | 1154 | "fina_timeout:\t\t%u\t\t\t%u\n", |
1151 | pos += scnprintf(buf + pos, bufsz - pos, "mh_format_err: %u\n", | 1155 | le32_to_cpu(ofdm->fina_timeout), |
1152 | le32_to_cpu(ofdm->mh_format_err)); | 1156 | accum_ofdm->fina_timeout); |
1153 | pos += scnprintf(buf + pos, bufsz - pos, "re_acq_main_rssi_sum: %u\n", | 1157 | pos += scnprintf(buf + pos, bufsz - pos, |
1154 | le32_to_cpu(ofdm->re_acq_main_rssi_sum)); | 1158 | "unresponded_rts:\t%u\t\t\t%u\n", |
1159 | le32_to_cpu(ofdm->unresponded_rts), | ||
1160 | accum_ofdm->unresponded_rts); | ||
1161 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1162 | "rxe_frame_lmt_ovrun:\t%u\t\t\t%u\n", | ||
1163 | le32_to_cpu(ofdm->rxe_frame_limit_overrun), | ||
1164 | accum_ofdm->rxe_frame_limit_overrun); | ||
1165 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1166 | "sent_ack_cnt:\t\t%u\t\t\t%u\n", | ||
1167 | le32_to_cpu(ofdm->sent_ack_cnt), | ||
1168 | accum_ofdm->sent_ack_cnt); | ||
1169 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1170 | "sent_cts_cnt:\t\t%u\t\t\t%u\n", | ||
1171 | le32_to_cpu(ofdm->sent_cts_cnt), | ||
1172 | accum_ofdm->sent_cts_cnt); | ||
1173 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1174 | "sent_ba_rsp_cnt:\t%u\t\t\t%u\n", | ||
1175 | le32_to_cpu(ofdm->sent_ba_rsp_cnt), | ||
1176 | accum_ofdm->sent_ba_rsp_cnt); | ||
1177 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1178 | "dsp_self_kill:\t\t%u\t\t\t%u\n", | ||
1179 | le32_to_cpu(ofdm->dsp_self_kill), | ||
1180 | accum_ofdm->dsp_self_kill); | ||
1181 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1182 | "mh_format_err:\t\t%u\t\t\t%u\n", | ||
1183 | le32_to_cpu(ofdm->mh_format_err), | ||
1184 | accum_ofdm->mh_format_err); | ||
1185 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1186 | "re_acq_main_rssi_sum:\t%u\t\t\t%u\n", | ||
1187 | le32_to_cpu(ofdm->re_acq_main_rssi_sum), | ||
1188 | accum_ofdm->re_acq_main_rssi_sum); | ||
1155 | 1189 | ||
1156 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - CCK:\n"); | 1190 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - CCK:\n"); |
1157 | pos += scnprintf(buf + pos, bufsz - pos, "ina_cnt: %u\n", | 1191 | pos += scnprintf(buf + pos, bufsz - pos, |
1158 | le32_to_cpu(cck->ina_cnt)); | 1192 | "\t\t\tcurrent\t\t\taccumulative\n"); |
1159 | pos += scnprintf(buf + pos, bufsz - pos, "fina_cnt: %u\n", | 1193 | pos += scnprintf(buf + pos, bufsz - pos, "ina_cnt:\t\t%u\t\t\t%u\n", |
1160 | le32_to_cpu(cck->fina_cnt)); | 1194 | le32_to_cpu(cck->ina_cnt), accum_cck->ina_cnt); |
1161 | pos += scnprintf(buf + pos, bufsz - pos, "plcp_err: %u\n", | 1195 | pos += scnprintf(buf + pos, bufsz - pos, "fina_cnt:\t\t%u\t\t\t%u\n", |
1162 | le32_to_cpu(cck->plcp_err)); | 1196 | le32_to_cpu(cck->fina_cnt), accum_cck->fina_cnt); |
1163 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_err: %u\n", | 1197 | pos += scnprintf(buf + pos, bufsz - pos, "plcp_err:\t\t%u\t\t\t%u\n", |
1164 | le32_to_cpu(cck->crc32_err)); | 1198 | le32_to_cpu(cck->plcp_err), accum_cck->plcp_err); |
1165 | pos += scnprintf(buf + pos, bufsz - pos, "overrun_err: %u\n", | 1199 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_err:\t\t%u\t\t\t%u\n", |
1166 | le32_to_cpu(cck->overrun_err)); | 1200 | le32_to_cpu(cck->crc32_err), accum_cck->crc32_err); |
1167 | pos += scnprintf(buf + pos, bufsz - pos, "early_overrun_err: %u\n", | 1201 | pos += scnprintf(buf + pos, bufsz - pos, |
1168 | le32_to_cpu(cck->early_overrun_err)); | 1202 | "overrun_err:\t\t%u\t\t\t%u\n", |
1169 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_good: %u\n", | 1203 | le32_to_cpu(cck->overrun_err), |
1170 | le32_to_cpu(cck->crc32_good)); | 1204 | accum_cck->overrun_err); |
1171 | pos += scnprintf(buf + pos, bufsz - pos, "false_alarm_cnt: %u\n", | 1205 | pos += scnprintf(buf + pos, bufsz - pos, |
1172 | le32_to_cpu(cck->false_alarm_cnt)); | 1206 | "early_overrun_err:\t%u\t\t\t%u\n", |
1173 | pos += scnprintf(buf + pos, bufsz - pos, "fina_sync_err_cnt: %u\n", | 1207 | le32_to_cpu(cck->early_overrun_err), |
1174 | le32_to_cpu(cck->fina_sync_err_cnt)); | 1208 | accum_cck->early_overrun_err); |
1175 | pos += scnprintf(buf + pos, bufsz - pos, "sfd_timeout: %u\n", | 1209 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_good:\t\t%u\t\t\t%u\n", |
1176 | le32_to_cpu(cck->sfd_timeout)); | 1210 | le32_to_cpu(cck->crc32_good), accum_cck->crc32_good); |
1177 | pos += scnprintf(buf + pos, bufsz - pos, "fina_timeout: %u\n", | 1211 | pos += scnprintf(buf + pos, bufsz - pos, |
1178 | le32_to_cpu(cck->fina_timeout)); | 1212 | "false_alarm_cnt:\t%u\t\t\t%u\n", |
1179 | pos += scnprintf(buf + pos, bufsz - pos, "unresponded_rts: %u\n", | 1213 | le32_to_cpu(cck->false_alarm_cnt), |
1180 | le32_to_cpu(cck->unresponded_rts)); | 1214 | accum_cck->false_alarm_cnt); |
1181 | pos += scnprintf(buf + pos, bufsz - pos, | 1215 | pos += scnprintf(buf + pos, bufsz - pos, |
1182 | "rxe_frame_limit_overrun: %u\n", | 1216 | "fina_sync_err_cnt:\t%u\t\t\t%u\n", |
1183 | le32_to_cpu(cck->rxe_frame_limit_overrun)); | 1217 | le32_to_cpu(cck->fina_sync_err_cnt), |
1184 | pos += scnprintf(buf + pos, bufsz - pos, "sent_ack_cnt: %u\n", | 1218 | accum_cck->fina_sync_err_cnt); |
1185 | le32_to_cpu(cck->sent_ack_cnt)); | 1219 | pos += scnprintf(buf + pos, bufsz - pos, |
1186 | pos += scnprintf(buf + pos, bufsz - pos, "sent_cts_cnt: %u\n", | 1220 | "sfd_timeout:\t\t%u\t\t\t%u\n", |
1187 | le32_to_cpu(cck->sent_cts_cnt)); | 1221 | le32_to_cpu(cck->sfd_timeout), |
1188 | pos += scnprintf(buf + pos, bufsz - pos, "sent_ba_rsp_cnt: %u\n", | 1222 | accum_cck->sfd_timeout); |
1189 | le32_to_cpu(cck->sent_ba_rsp_cnt)); | 1223 | pos += scnprintf(buf + pos, bufsz - pos, |
1190 | pos += scnprintf(buf + pos, bufsz - pos, "dsp_self_kill: %u\n", | 1224 | "fina_timeout:\t\t%u\t\t\t%u\n", |
1191 | le32_to_cpu(cck->dsp_self_kill)); | 1225 | le32_to_cpu(cck->fina_timeout), |
1192 | pos += scnprintf(buf + pos, bufsz - pos, "mh_format_err: %u\n", | 1226 | accum_cck->fina_timeout); |
1193 | le32_to_cpu(cck->mh_format_err)); | 1227 | pos += scnprintf(buf + pos, bufsz - pos, |
1194 | pos += scnprintf(buf + pos, bufsz - pos, "re_acq_main_rssi_sum: %u\n", | 1228 | "unresponded_rts:\t%u\t\t\t%u\n", |
1195 | le32_to_cpu(cck->re_acq_main_rssi_sum)); | 1229 | le32_to_cpu(cck->unresponded_rts), |
1230 | accum_cck->unresponded_rts); | ||
1231 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1232 | "rxe_frame_lmt_ovrun:\t%u\t\t\t%u\n", | ||
1233 | le32_to_cpu(cck->rxe_frame_limit_overrun), | ||
1234 | accum_cck->rxe_frame_limit_overrun); | ||
1235 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1236 | "sent_ack_cnt:\t\t%u\t\t\t%u\n", | ||
1237 | le32_to_cpu(cck->sent_ack_cnt), | ||
1238 | accum_cck->sent_ack_cnt); | ||
1239 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1240 | "sent_cts_cnt:\t\t%u\t\t\t%u\n", | ||
1241 | le32_to_cpu(cck->sent_cts_cnt), | ||
1242 | accum_cck->sent_cts_cnt); | ||
1243 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1244 | "sent_ba_rsp_cnt:\t%u\t\t\t%u\n", | ||
1245 | le32_to_cpu(cck->sent_ba_rsp_cnt), | ||
1246 | accum_cck->sent_ba_rsp_cnt); | ||
1247 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1248 | "dsp_self_kill:\t\t%u\t\t\t%u\n", | ||
1249 | le32_to_cpu(cck->dsp_self_kill), | ||
1250 | accum_cck->dsp_self_kill); | ||
1251 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1252 | "mh_format_err:\t\t%u\t\t\t%u\n", | ||
1253 | le32_to_cpu(cck->mh_format_err), | ||
1254 | accum_cck->mh_format_err); | ||
1255 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1256 | "re_acq_main_rssi_sum:\t%u\t\t\t%u\n", | ||
1257 | le32_to_cpu(cck->re_acq_main_rssi_sum), | ||
1258 | accum_cck->re_acq_main_rssi_sum); | ||
1196 | 1259 | ||
1197 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - GENERAL:\n"); | 1260 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - GENERAL:\n"); |
1198 | pos += scnprintf(buf + pos, bufsz - pos, "bogus_cts: %u\n", | 1261 | pos += scnprintf(buf + pos, bufsz - pos, |
1199 | le32_to_cpu(general->bogus_cts)); | 1262 | "\t\t\tcurrent\t\t\taccumulative\n"); |
1200 | pos += scnprintf(buf + pos, bufsz - pos, "bogus_ack: %u\n", | 1263 | pos += scnprintf(buf + pos, bufsz - pos, "bogus_cts:\t\t%u\t\t\t%u\n", |
1201 | le32_to_cpu(general->bogus_ack)); | 1264 | le32_to_cpu(general->bogus_cts), |
1202 | pos += scnprintf(buf + pos, bufsz - pos, "non_bssid_frames: %u\n", | 1265 | accum_general->bogus_cts); |
1203 | le32_to_cpu(general->non_bssid_frames)); | 1266 | pos += scnprintf(buf + pos, bufsz - pos, "bogus_ack:\t\t%u\t\t\t%u\n", |
1204 | pos += scnprintf(buf + pos, bufsz - pos, "filtered_frames: %u\n", | 1267 | le32_to_cpu(general->bogus_ack), |
1205 | le32_to_cpu(general->filtered_frames)); | 1268 | accum_general->bogus_ack); |
1206 | pos += scnprintf(buf + pos, bufsz - pos, "non_channel_beacons: %u\n", | 1269 | pos += scnprintf(buf + pos, bufsz - pos, |
1207 | le32_to_cpu(general->non_channel_beacons)); | 1270 | "non_bssid_frames:\t%u\t\t\t%u\n", |
1208 | pos += scnprintf(buf + pos, bufsz - pos, "channel_beacons: %u\n", | 1271 | le32_to_cpu(general->non_bssid_frames), |
1209 | le32_to_cpu(general->channel_beacons)); | 1272 | accum_general->non_bssid_frames); |
1210 | pos += scnprintf(buf + pos, bufsz - pos, "num_missed_bcon: %u\n", | 1273 | pos += scnprintf(buf + pos, bufsz - pos, |
1211 | le32_to_cpu(general->num_missed_bcon)); | 1274 | "filtered_frames:\t%u\t\t\t%u\n", |
1212 | pos += scnprintf(buf + pos, bufsz - pos, | 1275 | le32_to_cpu(general->filtered_frames), |
1213 | "adc_rx_saturation_time: %u\n", | 1276 | accum_general->filtered_frames); |
1214 | le32_to_cpu(general->adc_rx_saturation_time)); | 1277 | pos += scnprintf(buf + pos, bufsz - pos, |
1215 | pos += scnprintf(buf + pos, bufsz - pos, | 1278 | "non_channel_beacons:\t%u\t\t\t%u\n", |
1216 | "ina_detection_search_time: %u\n", | 1279 | le32_to_cpu(general->non_channel_beacons), |
1217 | le32_to_cpu(general->ina_detection_search_time)); | 1280 | accum_general->non_channel_beacons); |
1218 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_silence_rssi_a: %u\n", | 1281 | pos += scnprintf(buf + pos, bufsz - pos, |
1219 | le32_to_cpu(general->beacon_silence_rssi_a)); | 1282 | "channel_beacons:\t%u\t\t\t%u\n", |
1220 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_silence_rssi_b: %u\n", | 1283 | le32_to_cpu(general->channel_beacons), |
1221 | le32_to_cpu(general->beacon_silence_rssi_b)); | 1284 | accum_general->channel_beacons); |
1222 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_silence_rssi_c: %u\n", | 1285 | pos += scnprintf(buf + pos, bufsz - pos, |
1223 | le32_to_cpu(general->beacon_silence_rssi_c)); | 1286 | "num_missed_bcon:\t%u\t\t\t%u\n", |
1224 | pos += scnprintf(buf + pos, bufsz - pos, | 1287 | le32_to_cpu(general->num_missed_bcon), |
1225 | "interference_data_flag: %u\n", | 1288 | accum_general->num_missed_bcon); |
1226 | le32_to_cpu(general->interference_data_flag)); | 1289 | pos += scnprintf(buf + pos, bufsz - pos, |
1227 | pos += scnprintf(buf + pos, bufsz - pos, "channel_load: %u\n", | 1290 | "adc_rx_saturation_time:\t%u\t\t\t%u\n", |
1228 | le32_to_cpu(general->channel_load)); | 1291 | le32_to_cpu(general->adc_rx_saturation_time), |
1229 | pos += scnprintf(buf + pos, bufsz - pos, "dsp_false_alarms: %u\n", | 1292 | accum_general->adc_rx_saturation_time); |
1230 | le32_to_cpu(general->dsp_false_alarms)); | 1293 | pos += scnprintf(buf + pos, bufsz - pos, |
1231 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_rssi_a: %u\n", | 1294 | "ina_detect_search_tm:\t%u\t\t\t%u\n", |
1232 | le32_to_cpu(general->beacon_rssi_a)); | 1295 | le32_to_cpu(general->ina_detection_search_time), |
1233 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_rssi_b: %u\n", | 1296 | accum_general->ina_detection_search_time); |
1234 | le32_to_cpu(general->beacon_rssi_b)); | 1297 | pos += scnprintf(buf + pos, bufsz - pos, |
1235 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_rssi_c: %u\n", | 1298 | "beacon_silence_rssi_a:\t%u\t\t\t%u\n", |
1236 | le32_to_cpu(general->beacon_rssi_c)); | 1299 | le32_to_cpu(general->beacon_silence_rssi_a), |
1237 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_energy_a: %u\n", | 1300 | accum_general->beacon_silence_rssi_a); |
1238 | le32_to_cpu(general->beacon_energy_a)); | 1301 | pos += scnprintf(buf + pos, bufsz - pos, |
1239 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_energy_b: %u\n", | 1302 | "beacon_silence_rssi_b:\t%u\t\t\t%u\n", |
1240 | le32_to_cpu(general->beacon_energy_b)); | 1303 | le32_to_cpu(general->beacon_silence_rssi_b), |
1241 | pos += scnprintf(buf + pos, bufsz - pos, "beacon_energy_c: %u\n", | 1304 | accum_general->beacon_silence_rssi_b); |
1242 | le32_to_cpu(general->beacon_energy_c)); | 1305 | pos += scnprintf(buf + pos, bufsz - pos, |
1306 | "beacon_silence_rssi_c:\t%u\t\t\t%u\n", | ||
1307 | le32_to_cpu(general->beacon_silence_rssi_c), | ||
1308 | accum_general->beacon_silence_rssi_c); | ||
1309 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1310 | "interference_data_flag:\t%u\t\t\t%u\n", | ||
1311 | le32_to_cpu(general->interference_data_flag), | ||
1312 | accum_general->interference_data_flag); | ||
1313 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1314 | "channel_load:\t\t%u\t\t\t%u\n", | ||
1315 | le32_to_cpu(general->channel_load), | ||
1316 | accum_general->channel_load); | ||
1317 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1318 | "dsp_false_alarms:\t%u\t\t\t%u\n", | ||
1319 | le32_to_cpu(general->dsp_false_alarms), | ||
1320 | accum_general->dsp_false_alarms); | ||
1321 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1322 | "beacon_rssi_a:\t\t%u\t\t\t%u\n", | ||
1323 | le32_to_cpu(general->beacon_rssi_a), | ||
1324 | accum_general->beacon_rssi_a); | ||
1325 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1326 | "beacon_rssi_b:\t\t%u\t\t\t%u\n", | ||
1327 | le32_to_cpu(general->beacon_rssi_b), | ||
1328 | accum_general->beacon_rssi_b); | ||
1329 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1330 | "beacon_rssi_c:\t\t%u\t\t\t%u\n", | ||
1331 | le32_to_cpu(general->beacon_rssi_c), | ||
1332 | accum_general->beacon_rssi_c); | ||
1333 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1334 | "beacon_energy_a:\t%u\t\t\t%u\n", | ||
1335 | le32_to_cpu(general->beacon_energy_a), | ||
1336 | accum_general->beacon_energy_a); | ||
1337 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1338 | "beacon_energy_b:\t%u\t\t\t%u\n", | ||
1339 | le32_to_cpu(general->beacon_energy_b), | ||
1340 | accum_general->beacon_energy_b); | ||
1341 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1342 | "beacon_energy_c:\t%u\t\t\t%u\n", | ||
1343 | le32_to_cpu(general->beacon_energy_c), | ||
1344 | accum_general->beacon_energy_c); | ||
1243 | 1345 | ||
1244 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM_HT:\n"); | 1346 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Rx - OFDM_HT:\n"); |
1245 | pos += scnprintf(buf + pos, bufsz - pos, "plcp_err: %u\n", | 1347 | pos += scnprintf(buf + pos, bufsz - pos, |
1246 | le32_to_cpu(ht->plcp_err)); | 1348 | "\t\t\tcurrent\t\t\taccumulative\n"); |
1247 | pos += scnprintf(buf + pos, bufsz - pos, "overrun_err: %u\n", | 1349 | pos += scnprintf(buf + pos, bufsz - pos, "plcp_err:\t\t%u\t\t\t%u\n", |
1248 | le32_to_cpu(ht->overrun_err)); | 1350 | le32_to_cpu(ht->plcp_err), accum_ht->plcp_err); |
1249 | pos += scnprintf(buf + pos, bufsz - pos, "early_overrun_err: %u\n", | 1351 | pos += scnprintf(buf + pos, bufsz - pos, |
1250 | le32_to_cpu(ht->early_overrun_err)); | 1352 | "overrun_err:\t\t%u\t\t\t%u\n", |
1251 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_good: %u\n", | 1353 | le32_to_cpu(ht->overrun_err), accum_ht->overrun_err); |
1252 | le32_to_cpu(ht->crc32_good)); | 1354 | pos += scnprintf(buf + pos, bufsz - pos, |
1253 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_err: %u\n", | 1355 | "early_overrun_err:\t%u\t\t\t%u\n", |
1254 | le32_to_cpu(ht->crc32_err)); | 1356 | le32_to_cpu(ht->early_overrun_err), |
1255 | pos += scnprintf(buf + pos, bufsz - pos, "mh_format_err: %u\n", | 1357 | accum_ht->early_overrun_err); |
1256 | le32_to_cpu(ht->mh_format_err)); | 1358 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_good:\t\t%u\t\t\t%u\n", |
1257 | pos += scnprintf(buf + pos, bufsz - pos, "agg_crc32_good: %u\n", | 1359 | le32_to_cpu(ht->crc32_good), accum_ht->crc32_good); |
1258 | le32_to_cpu(ht->agg_crc32_good)); | 1360 | pos += scnprintf(buf + pos, bufsz - pos, "crc32_err:\t\t%u\t\t\t%u\n", |
1259 | pos += scnprintf(buf + pos, bufsz - pos, "agg_mpdu_cnt: %u\n", | 1361 | le32_to_cpu(ht->crc32_err), accum_ht->crc32_err); |
1260 | le32_to_cpu(ht->agg_mpdu_cnt)); | 1362 | pos += scnprintf(buf + pos, bufsz - pos, |
1261 | pos += scnprintf(buf + pos, bufsz - pos, "agg_cnt: %u\n", | 1363 | "mh_format_err:\t\t%u\t\t\t%u\n", |
1262 | le32_to_cpu(ht->agg_cnt)); | 1364 | le32_to_cpu(ht->mh_format_err), |
1365 | accum_ht->mh_format_err); | ||
1366 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1367 | "agg_crc32_good:\t\t%u\t\t\t%u\n", | ||
1368 | le32_to_cpu(ht->agg_crc32_good), | ||
1369 | accum_ht->agg_crc32_good); | ||
1370 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1371 | "agg_mpdu_cnt:\t\t%u\t\t\t%u\n", | ||
1372 | le32_to_cpu(ht->agg_mpdu_cnt), | ||
1373 | accum_ht->agg_mpdu_cnt); | ||
1374 | pos += scnprintf(buf + pos, bufsz - pos, "agg_cnt:\t\t%u\t\t\t%u\n", | ||
1375 | le32_to_cpu(ht->agg_cnt), accum_ht->agg_cnt); | ||
1263 | 1376 | ||
1264 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1377 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1265 | kfree(buf); | 1378 | kfree(buf); |
@@ -1275,7 +1388,7 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file, | |||
1275 | char *buf; | 1388 | char *buf; |
1276 | int bufsz = (sizeof(struct statistics_tx) * 24) + 250; | 1389 | int bufsz = (sizeof(struct statistics_tx) * 24) + 250; |
1277 | ssize_t ret; | 1390 | ssize_t ret; |
1278 | struct statistics_tx *tx; | 1391 | struct statistics_tx *tx, *accum_tx; |
1279 | 1392 | ||
1280 | if (!iwl_is_alive(priv)) | 1393 | if (!iwl_is_alive(priv)) |
1281 | return -EAGAIN; | 1394 | return -EAGAIN; |
@@ -1301,62 +1414,107 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file, | |||
1301 | * might not reflect the current uCode activity | 1414 | * might not reflect the current uCode activity |
1302 | */ | 1415 | */ |
1303 | tx = &priv->statistics.tx; | 1416 | tx = &priv->statistics.tx; |
1417 | accum_tx = &priv->accum_statistics.tx; | ||
1304 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | 1418 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); |
1305 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Tx:\n"); | 1419 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_Tx:\n"); |
1306 | pos += scnprintf(buf + pos, bufsz - pos, "preamble: %u\n", | 1420 | pos += scnprintf(buf + pos, bufsz - pos, |
1307 | le32_to_cpu(tx->preamble_cnt)); | 1421 | "\t\t\tcurrent\t\t\taccumulative\n"); |
1308 | pos += scnprintf(buf + pos, bufsz - pos, "rx_detected_cnt: %u\n", | 1422 | pos += scnprintf(buf + pos, bufsz - pos, "preamble:\t\t\t%u\t\t\t%u\n", |
1309 | le32_to_cpu(tx->rx_detected_cnt)); | 1423 | le32_to_cpu(tx->preamble_cnt), |
1310 | pos += scnprintf(buf + pos, bufsz - pos, "bt_prio_defer_cnt: %u\n", | 1424 | accum_tx->preamble_cnt); |
1311 | le32_to_cpu(tx->bt_prio_defer_cnt)); | 1425 | pos += scnprintf(buf + pos, bufsz - pos, |
1312 | pos += scnprintf(buf + pos, bufsz - pos, "bt_prio_kill_cnt: %u\n", | 1426 | "rx_detected_cnt:\t\t%u\t\t\t%u\n", |
1313 | le32_to_cpu(tx->bt_prio_kill_cnt)); | 1427 | le32_to_cpu(tx->rx_detected_cnt), |
1314 | pos += scnprintf(buf + pos, bufsz - pos, "few_bytes_cnt: %u\n", | 1428 | accum_tx->rx_detected_cnt); |
1315 | le32_to_cpu(tx->few_bytes_cnt)); | 1429 | pos += scnprintf(buf + pos, bufsz - pos, |
1316 | pos += scnprintf(buf + pos, bufsz - pos, "cts_timeout: %u\n", | 1430 | "bt_prio_defer_cnt:\t\t%u\t\t\t%u\n", |
1317 | le32_to_cpu(tx->cts_timeout)); | 1431 | le32_to_cpu(tx->bt_prio_defer_cnt), |
1318 | pos += scnprintf(buf + pos, bufsz - pos, "ack_timeout: %u\n", | 1432 | accum_tx->bt_prio_defer_cnt); |
1319 | le32_to_cpu(tx->ack_timeout)); | 1433 | pos += scnprintf(buf + pos, bufsz - pos, |
1320 | pos += scnprintf(buf + pos, bufsz - pos, "expected_ack_cnt: %u\n", | 1434 | "bt_prio_kill_cnt:\t\t%u\t\t\t%u\n", |
1321 | le32_to_cpu(tx->expected_ack_cnt)); | 1435 | le32_to_cpu(tx->bt_prio_kill_cnt), |
1322 | pos += scnprintf(buf + pos, bufsz - pos, "actual_ack_cnt: %u\n", | 1436 | accum_tx->bt_prio_kill_cnt); |
1323 | le32_to_cpu(tx->actual_ack_cnt)); | 1437 | pos += scnprintf(buf + pos, bufsz - pos, |
1324 | pos += scnprintf(buf + pos, bufsz - pos, "dump_msdu_cnt: %u\n", | 1438 | "few_bytes_cnt:\t\t\t%u\t\t\t%u\n", |
1325 | le32_to_cpu(tx->dump_msdu_cnt)); | 1439 | le32_to_cpu(tx->few_bytes_cnt), |
1326 | pos += scnprintf(buf + pos, bufsz - pos, | 1440 | accum_tx->few_bytes_cnt); |
1327 | "burst_abort_next_frame_mismatch_cnt: %u\n", | 1441 | pos += scnprintf(buf + pos, bufsz - pos, |
1328 | le32_to_cpu(tx->burst_abort_next_frame_mismatch_cnt)); | 1442 | "cts_timeout:\t\t\t%u\t\t\t%u\n", |
1329 | pos += scnprintf(buf + pos, bufsz - pos, | 1443 | le32_to_cpu(tx->cts_timeout), accum_tx->cts_timeout); |
1330 | "burst_abort_missing_next_frame_cnt: %u\n", | 1444 | pos += scnprintf(buf + pos, bufsz - pos, |
1331 | le32_to_cpu(tx->burst_abort_missing_next_frame_cnt)); | 1445 | "ack_timeout:\t\t\t%u\t\t\t%u\n", |
1332 | pos += scnprintf(buf + pos, bufsz - pos, "cts_timeout_collision: %u\n", | 1446 | le32_to_cpu(tx->ack_timeout), |
1333 | le32_to_cpu(tx->cts_timeout_collision)); | 1447 | accum_tx->ack_timeout); |
1334 | pos += scnprintf(buf + pos, bufsz - pos, | 1448 | pos += scnprintf(buf + pos, bufsz - pos, |
1335 | "ack_or_ba_timeout_collision: %u\n", | 1449 | "expected_ack_cnt:\t\t%u\t\t\t%u\n", |
1336 | le32_to_cpu(tx->ack_or_ba_timeout_collision)); | 1450 | le32_to_cpu(tx->expected_ack_cnt), |
1337 | pos += scnprintf(buf + pos, bufsz - pos, "agg ba_timeout: %u\n", | 1451 | accum_tx->expected_ack_cnt); |
1338 | le32_to_cpu(tx->agg.ba_timeout)); | 1452 | pos += scnprintf(buf + pos, bufsz - pos, |
1339 | pos += scnprintf(buf + pos, bufsz - pos, | 1453 | "actual_ack_cnt:\t\t\t%u\t\t\t%u\n", |
1340 | "agg ba_reschedule_frames: %u\n", | 1454 | le32_to_cpu(tx->actual_ack_cnt), |
1341 | le32_to_cpu(tx->agg.ba_reschedule_frames)); | 1455 | accum_tx->actual_ack_cnt); |
1342 | pos += scnprintf(buf + pos, bufsz - pos, | 1456 | pos += scnprintf(buf + pos, bufsz - pos, |
1343 | "agg scd_query_agg_frame_cnt: %u\n", | 1457 | "dump_msdu_cnt:\t\t\t%u\t\t\t%u\n", |
1344 | le32_to_cpu(tx->agg.scd_query_agg_frame_cnt)); | 1458 | le32_to_cpu(tx->dump_msdu_cnt), |
1345 | pos += scnprintf(buf + pos, bufsz - pos, "agg scd_query_no_agg: %u\n", | 1459 | accum_tx->dump_msdu_cnt); |
1346 | le32_to_cpu(tx->agg.scd_query_no_agg)); | 1460 | pos += scnprintf(buf + pos, bufsz - pos, |
1347 | pos += scnprintf(buf + pos, bufsz - pos, "agg scd_query_agg: %u\n", | 1461 | "abort_nxt_frame_mismatch:" |
1348 | le32_to_cpu(tx->agg.scd_query_agg)); | 1462 | "\t%u\t\t\t%u\n", |
1349 | pos += scnprintf(buf + pos, bufsz - pos, | 1463 | le32_to_cpu(tx->burst_abort_next_frame_mismatch_cnt), |
1350 | "agg scd_query_mismatch: %u\n", | 1464 | accum_tx->burst_abort_next_frame_mismatch_cnt); |
1351 | le32_to_cpu(tx->agg.scd_query_mismatch)); | 1465 | pos += scnprintf(buf + pos, bufsz - pos, |
1352 | pos += scnprintf(buf + pos, bufsz - pos, "agg frame_not_ready: %u\n", | 1466 | "abort_missing_nxt_frame:" |
1353 | le32_to_cpu(tx->agg.frame_not_ready)); | 1467 | "\t%u\t\t\t%u\n", |
1354 | pos += scnprintf(buf + pos, bufsz - pos, "agg underrun: %u\n", | 1468 | le32_to_cpu(tx->burst_abort_missing_next_frame_cnt), |
1355 | le32_to_cpu(tx->agg.underrun)); | 1469 | accum_tx->burst_abort_missing_next_frame_cnt); |
1356 | pos += scnprintf(buf + pos, bufsz - pos, "agg bt_prio_kill: %u\n", | 1470 | pos += scnprintf(buf + pos, bufsz - pos, |
1357 | le32_to_cpu(tx->agg.bt_prio_kill)); | 1471 | "cts_timeout_collision:\t\t%u\t\t\t%u\n", |
1358 | pos += scnprintf(buf + pos, bufsz - pos, "agg rx_ba_rsp_cnt: %u\n", | 1472 | le32_to_cpu(tx->cts_timeout_collision), |
1359 | le32_to_cpu(tx->agg.rx_ba_rsp_cnt)); | 1473 | accum_tx->cts_timeout_collision); |
1474 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1475 | "ack_ba_timeout_collision:\t%u\t\t\t%u\n", | ||
1476 | le32_to_cpu(tx->ack_or_ba_timeout_collision), | ||
1477 | accum_tx->ack_or_ba_timeout_collision); | ||
1478 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1479 | "agg ba_timeout:\t\t\t%u\t\t\t%u\n", | ||
1480 | le32_to_cpu(tx->agg.ba_timeout), | ||
1481 | accum_tx->agg.ba_timeout); | ||
1482 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1483 | "agg ba_resched_frames:\t\t%u\t\t\t%u\n", | ||
1484 | le32_to_cpu(tx->agg.ba_reschedule_frames), | ||
1485 | accum_tx->agg.ba_reschedule_frames); | ||
1486 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1487 | "agg scd_query_agg_frame:\t%u\t\t\t%u\n", | ||
1488 | le32_to_cpu(tx->agg.scd_query_agg_frame_cnt), | ||
1489 | accum_tx->agg.scd_query_agg_frame_cnt); | ||
1490 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1491 | "agg scd_query_no_agg:\t\t%u\t\t\t%u\n", | ||
1492 | le32_to_cpu(tx->agg.scd_query_no_agg), | ||
1493 | accum_tx->agg.scd_query_no_agg); | ||
1494 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1495 | "agg scd_query_agg:\t\t%u\t\t\t%u\n", | ||
1496 | le32_to_cpu(tx->agg.scd_query_agg), | ||
1497 | accum_tx->agg.scd_query_agg); | ||
1498 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1499 | "agg scd_query_mismatch:\t\t%u\t\t\t%u\n", | ||
1500 | le32_to_cpu(tx->agg.scd_query_mismatch), | ||
1501 | accum_tx->agg.scd_query_mismatch); | ||
1502 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1503 | "agg frame_not_ready:\t\t%u\t\t\t%u\n", | ||
1504 | le32_to_cpu(tx->agg.frame_not_ready), | ||
1505 | accum_tx->agg.frame_not_ready); | ||
1506 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1507 | "agg underrun:\t\t\t%u\t\t\t%u\n", | ||
1508 | le32_to_cpu(tx->agg.underrun), | ||
1509 | accum_tx->agg.underrun); | ||
1510 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1511 | "agg bt_prio_kill:\t\t%u\t\t\t%u\n", | ||
1512 | le32_to_cpu(tx->agg.bt_prio_kill), | ||
1513 | accum_tx->agg.bt_prio_kill); | ||
1514 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1515 | "agg rx_ba_rsp_cnt:\t\t%u\t\t\t%u\n", | ||
1516 | le32_to_cpu(tx->agg.rx_ba_rsp_cnt), | ||
1517 | accum_tx->agg.rx_ba_rsp_cnt); | ||
1360 | 1518 | ||
1361 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1519 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1362 | kfree(buf); | 1520 | kfree(buf); |
@@ -1372,9 +1530,9 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file, | |||
1372 | char *buf; | 1530 | char *buf; |
1373 | int bufsz = sizeof(struct statistics_general) * 4 + 250; | 1531 | int bufsz = sizeof(struct statistics_general) * 4 + 250; |
1374 | ssize_t ret; | 1532 | ssize_t ret; |
1375 | struct statistics_general *general; | 1533 | struct statistics_general *general, *accum_general; |
1376 | struct statistics_dbg *dbg; | 1534 | struct statistics_dbg *dbg, *accum_dbg; |
1377 | struct statistics_div *div; | 1535 | struct statistics_div *div, *accum_div; |
1378 | 1536 | ||
1379 | if (!iwl_is_alive(priv)) | 1537 | if (!iwl_is_alive(priv)) |
1380 | return -EAGAIN; | 1538 | return -EAGAIN; |
@@ -1402,34 +1560,53 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file, | |||
1402 | general = &priv->statistics.general; | 1560 | general = &priv->statistics.general; |
1403 | dbg = &priv->statistics.general.dbg; | 1561 | dbg = &priv->statistics.general.dbg; |
1404 | div = &priv->statistics.general.div; | 1562 | div = &priv->statistics.general.div; |
1563 | accum_general = &priv->accum_statistics.general; | ||
1564 | accum_dbg = &priv->accum_statistics.general.dbg; | ||
1565 | accum_div = &priv->accum_statistics.general.div; | ||
1405 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | 1566 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); |
1406 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_General:\n"); | 1567 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_General:\n"); |
1407 | pos += scnprintf(buf + pos, bufsz - pos, "temperature: %u\n", | 1568 | pos += scnprintf(buf + pos, bufsz - pos, |
1569 | "\t\t\tcurrent\t\t\taccumulative\n"); | ||
1570 | pos += scnprintf(buf + pos, bufsz - pos, "temperature:\t\t\t%u\n", | ||
1408 | le32_to_cpu(general->temperature)); | 1571 | le32_to_cpu(general->temperature)); |
1409 | pos += scnprintf(buf + pos, bufsz - pos, "temperature_m: %u\n", | 1572 | pos += scnprintf(buf + pos, bufsz - pos, "temperature_m:\t\t\t%u\n", |
1410 | le32_to_cpu(general->temperature_m)); | 1573 | le32_to_cpu(general->temperature_m)); |
1411 | pos += scnprintf(buf + pos, bufsz - pos, "burst_check: %u\n", | 1574 | pos += scnprintf(buf + pos, bufsz - pos, |
1412 | le32_to_cpu(dbg->burst_check)); | 1575 | "burst_check:\t\t\t%u\t\t\t%u\n", |
1413 | pos += scnprintf(buf + pos, bufsz - pos, "burst_count: %u\n", | 1576 | le32_to_cpu(dbg->burst_check), |
1414 | le32_to_cpu(dbg->burst_count)); | 1577 | accum_dbg->burst_check); |
1415 | pos += scnprintf(buf + pos, bufsz - pos, "sleep_time: %u\n", | 1578 | pos += scnprintf(buf + pos, bufsz - pos, |
1416 | le32_to_cpu(general->sleep_time)); | 1579 | "burst_count:\t\t\t%u\t\t\t%u\n", |
1417 | pos += scnprintf(buf + pos, bufsz - pos, "slots_out: %u\n", | 1580 | le32_to_cpu(dbg->burst_count), |
1418 | le32_to_cpu(general->slots_out)); | 1581 | accum_dbg->burst_count); |
1419 | pos += scnprintf(buf + pos, bufsz - pos, "slots_idle: %u\n", | 1582 | pos += scnprintf(buf + pos, bufsz - pos, |
1420 | le32_to_cpu(general->slots_idle)); | 1583 | "sleep_time:\t\t\t%u\t\t\t%u\n", |
1421 | pos += scnprintf(buf + pos, bufsz - pos, "ttl_timestamp: %u\n", | 1584 | le32_to_cpu(general->sleep_time), |
1585 | accum_general->sleep_time); | ||
1586 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1587 | "slots_out:\t\t\t%u\t\t\t%u\n", | ||
1588 | le32_to_cpu(general->slots_out), | ||
1589 | accum_general->slots_out); | ||
1590 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1591 | "slots_idle:\t\t\t%u\t\t\t%u\n", | ||
1592 | le32_to_cpu(general->slots_idle), | ||
1593 | accum_general->slots_idle); | ||
1594 | pos += scnprintf(buf + pos, bufsz - pos, "ttl_timestamp:\t\t\t%u\n", | ||
1422 | le32_to_cpu(general->ttl_timestamp)); | 1595 | le32_to_cpu(general->ttl_timestamp)); |
1423 | pos += scnprintf(buf + pos, bufsz - pos, "tx_on_a: %u\n", | 1596 | pos += scnprintf(buf + pos, bufsz - pos, "tx_on_a:\t\t\t%u\t\t\t%u\n", |
1424 | le32_to_cpu(div->tx_on_a)); | 1597 | le32_to_cpu(div->tx_on_a), accum_div->tx_on_a); |
1425 | pos += scnprintf(buf + pos, bufsz - pos, "tx_on_b: %u\n", | 1598 | pos += scnprintf(buf + pos, bufsz - pos, "tx_on_b:\t\t\t%u\t\t\t%u\n", |
1426 | le32_to_cpu(div->tx_on_b)); | 1599 | le32_to_cpu(div->tx_on_b), accum_div->tx_on_b); |
1427 | pos += scnprintf(buf + pos, bufsz - pos, "exec_time: %u\n", | 1600 | pos += scnprintf(buf + pos, bufsz - pos, |
1428 | le32_to_cpu(div->exec_time)); | 1601 | "exec_time:\t\t\t%u\t\t\t%u\n", |
1429 | pos += scnprintf(buf + pos, bufsz - pos, "probe_time: %u\n", | 1602 | le32_to_cpu(div->exec_time), accum_div->exec_time); |
1430 | le32_to_cpu(div->probe_time)); | 1603 | pos += scnprintf(buf + pos, bufsz - pos, |
1431 | pos += scnprintf(buf + pos, bufsz - pos, "rx_enable_counter: %u\n", | 1604 | "probe_time:\t\t\t%u\t\t\t%u\n", |
1432 | le32_to_cpu(general->rx_enable_counter)); | 1605 | le32_to_cpu(div->probe_time), accum_div->probe_time); |
1606 | pos += scnprintf(buf + pos, bufsz - pos, | ||
1607 | "rx_enable_counter:\t\t%u\t\t\t%u\n", | ||
1608 | le32_to_cpu(general->rx_enable_counter), | ||
1609 | accum_general->rx_enable_counter); | ||
1433 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1610 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1434 | kfree(buf); | 1611 | kfree(buf); |
1435 | return ret; | 1612 | return ret; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 6d7c2350d8c..8d087f0455d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1124,7 +1124,9 @@ struct iwl_priv { | |||
1124 | struct iwl_tt_mgmt thermal_throttle; | 1124 | struct iwl_tt_mgmt thermal_throttle; |
1125 | 1125 | ||
1126 | struct iwl_notif_statistics statistics; | 1126 | struct iwl_notif_statistics statistics; |
1127 | unsigned long last_statistics_time; | 1127 | #ifdef CONFIG_IWLWIFI_DEBUG |
1128 | struct iwl_notif_statistics accum_statistics; | ||
1129 | #endif | ||
1128 | 1130 | ||
1129 | /* context information */ | 1131 | /* context information */ |
1130 | u16 rates_mask; | 1132 | u16 rates_mask; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 493626bcd3e..7ad327ef9cb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -548,6 +548,44 @@ static void iwl_rx_calc_noise(struct iwl_priv *priv) | |||
548 | priv->last_rx_noise); | 548 | priv->last_rx_noise); |
549 | } | 549 | } |
550 | 550 | ||
551 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
552 | /* | ||
553 | * based on the assumption of all statistics counter are in DWORD | ||
554 | * FIXME: This function is for debugging, do not deal with | ||
555 | * the case of counters roll-over. | ||
556 | */ | ||
557 | static void iwl_accumulative_statistics(struct iwl_priv *priv, | ||
558 | __le32 *stats) | ||
559 | { | ||
560 | int i; | ||
561 | __le32 *prev_stats; | ||
562 | u32 *accum_stats; | ||
563 | |||
564 | prev_stats = (__le32 *)&priv->statistics; | ||
565 | accum_stats = (u32 *)&priv->accum_statistics; | ||
566 | |||
567 | for (i = sizeof(__le32); i < sizeof(struct iwl_notif_statistics); | ||
568 | i += sizeof(__le32), stats++, prev_stats++, accum_stats++) | ||
569 | if (le32_to_cpu(*stats) > le32_to_cpu(*prev_stats)) | ||
570 | *accum_stats += (le32_to_cpu(*stats) - | ||
571 | le32_to_cpu(*prev_stats)); | ||
572 | |||
573 | /* reset accumulative statistics for "no-counter" type statistics */ | ||
574 | priv->accum_statistics.general.temperature = | ||
575 | priv->statistics.general.temperature; | ||
576 | priv->accum_statistics.general.temperature_m = | ||
577 | priv->statistics.general.temperature_m; | ||
578 | priv->accum_statistics.general.ttl_timestamp = | ||
579 | priv->statistics.general.ttl_timestamp; | ||
580 | priv->accum_statistics.tx.tx_power.ant_a = | ||
581 | priv->statistics.tx.tx_power.ant_a; | ||
582 | priv->accum_statistics.tx.tx_power.ant_b = | ||
583 | priv->statistics.tx.tx_power.ant_b; | ||
584 | priv->accum_statistics.tx.tx_power.ant_c = | ||
585 | priv->statistics.tx.tx_power.ant_c; | ||
586 | } | ||
587 | #endif | ||
588 | |||
551 | #define REG_RECALIB_PERIOD (60) | 589 | #define REG_RECALIB_PERIOD (60) |
552 | 590 | ||
553 | void iwl_rx_statistics(struct iwl_priv *priv, | 591 | void iwl_rx_statistics(struct iwl_priv *priv, |
@@ -566,6 +604,9 @@ void iwl_rx_statistics(struct iwl_priv *priv, | |||
566 | STATISTICS_REPLY_FLG_HT40_MODE_MSK) != | 604 | STATISTICS_REPLY_FLG_HT40_MODE_MSK) != |
567 | (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK))); | 605 | (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK))); |
568 | 606 | ||
607 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
608 | iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats); | ||
609 | #endif | ||
569 | memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics)); | 610 | memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics)); |
570 | 611 | ||
571 | set_bit(STATUS_STATISTICS, &priv->status); | 612 | set_bit(STATUS_STATISTICS, &priv->status); |