diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-09-05 13:49:42 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-09-17 16:17:36 -0400 |
commit | 54a9aa65f749673f851ef86481940394185c1b0e (patch) | |
tree | 57763e1d758985c3238d9d182a2c083e738bfdd0 /drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | |
parent | 91835ba401189a81e5ad1f932f880d8eed8c9db2 (diff) |
iwlagn: keep track of failure tx status
Tx command response sent to host by uCode after completed
the transmission attempt. The status parameter indicates
whether the transmission was successful, or else why if failed.
Here we keep the counters to help understand the different failure
cases.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c index d706b8afbe5a..de68dde4feee 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | |||
@@ -1011,3 +1011,100 @@ ssize_t iwl_ucode_bt_stats_read(struct file *file, | |||
1011 | kfree(buf); | 1011 | kfree(buf); |
1012 | return ret; | 1012 | return ret; |
1013 | } | 1013 | } |
1014 | |||
1015 | ssize_t iwl_reply_tx_error_read(struct file *file, | ||
1016 | char __user *user_buf, | ||
1017 | size_t count, loff_t *ppos) | ||
1018 | { | ||
1019 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | ||
1020 | int pos = 0; | ||
1021 | char *buf; | ||
1022 | int bufsz = (sizeof(struct reply_tx_error_statistics) * 24) + 200; | ||
1023 | ssize_t ret; | ||
1024 | |||
1025 | if (!iwl_is_alive(priv)) | ||
1026 | return -EAGAIN; | ||
1027 | |||
1028 | buf = kzalloc(bufsz, GFP_KERNEL); | ||
1029 | if (!buf) { | ||
1030 | IWL_ERR(priv, "Can not allocate Buffer\n"); | ||
1031 | return -ENOMEM; | ||
1032 | } | ||
1033 | |||
1034 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_TX_Error:\n"); | ||
1035 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t\t%u\n", | ||
1036 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_DELAY), | ||
1037 | priv->_agn.reply_tx_stats.pp_delay); | ||
1038 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1039 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_FEW_BYTES), | ||
1040 | priv->_agn.reply_tx_stats.pp_few_bytes); | ||
1041 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1042 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_BT_PRIO), | ||
1043 | priv->_agn.reply_tx_stats.pp_bt_prio); | ||
1044 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1045 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_QUIET_PERIOD), | ||
1046 | priv->_agn.reply_tx_stats.pp_quiet_period); | ||
1047 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1048 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_CALC_TTAK), | ||
1049 | priv->_agn.reply_tx_stats.pp_calc_ttak); | ||
1050 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | ||
1051 | iwl_get_tx_fail_reason( | ||
1052 | TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY), | ||
1053 | priv->_agn.reply_tx_stats.int_crossed_retry); | ||
1054 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1055 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_SHORT_LIMIT), | ||
1056 | priv->_agn.reply_tx_stats.short_limit); | ||
1057 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1058 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_LONG_LIMIT), | ||
1059 | priv->_agn.reply_tx_stats.long_limit); | ||
1060 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1061 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_FIFO_UNDERRUN), | ||
1062 | priv->_agn.reply_tx_stats.fifo_underrun); | ||
1063 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1064 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_DRAIN_FLOW), | ||
1065 | priv->_agn.reply_tx_stats.drain_flow); | ||
1066 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1067 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_RFKILL_FLUSH), | ||
1068 | priv->_agn.reply_tx_stats.rfkill_flush); | ||
1069 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1070 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_LIFE_EXPIRE), | ||
1071 | priv->_agn.reply_tx_stats.life_expire); | ||
1072 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1073 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_DEST_PS), | ||
1074 | priv->_agn.reply_tx_stats.dest_ps); | ||
1075 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1076 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_HOST_ABORTED), | ||
1077 | priv->_agn.reply_tx_stats.host_abort); | ||
1078 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1079 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_BT_RETRY), | ||
1080 | priv->_agn.reply_tx_stats.pp_delay); | ||
1081 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1082 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_STA_INVALID), | ||
1083 | priv->_agn.reply_tx_stats.sta_invalid); | ||
1084 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1085 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_FRAG_DROPPED), | ||
1086 | priv->_agn.reply_tx_stats.frag_drop); | ||
1087 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1088 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_TID_DISABLE), | ||
1089 | priv->_agn.reply_tx_stats.tid_disable); | ||
1090 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1091 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_FIFO_FLUSHED), | ||
1092 | priv->_agn.reply_tx_stats.fifo_flush); | ||
1093 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | ||
1094 | iwl_get_tx_fail_reason( | ||
1095 | TX_STATUS_FAIL_INSUFFICIENT_CF_POLL), | ||
1096 | priv->_agn.reply_tx_stats.insuff_cf_poll); | ||
1097 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | ||
1098 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_FW_DROP), | ||
1099 | priv->_agn.reply_tx_stats.fail_hw_drop); | ||
1100 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t%u\n", | ||
1101 | iwl_get_tx_fail_reason( | ||
1102 | TX_STATUS_FAIL_STA_COLOR_MISMATCH_DROP), | ||
1103 | priv->_agn.reply_tx_stats.sta_color_mismatch); | ||
1104 | pos += scnprintf(buf + pos, bufsz - pos, "UNKNOWN:\t\t\t%u\n", | ||
1105 | priv->_agn.reply_tx_stats.unknown); | ||
1106 | |||
1107 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
1108 | kfree(buf); | ||
1109 | return ret; | ||
1110 | } | ||