diff options
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 117 |
1 files changed, 74 insertions, 43 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 5bdc938ec5ed..ab7264c1d8f7 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -943,14 +943,10 @@ static const struct file_operations fops_reset = { | |||
943 | static ssize_t read_file_recv(struct file *file, char __user *user_buf, | 943 | static ssize_t read_file_recv(struct file *file, char __user *user_buf, |
944 | size_t count, loff_t *ppos) | 944 | size_t count, loff_t *ppos) |
945 | { | 945 | { |
946 | #define PHY_ERR(s, p) \ | ||
947 | len += scnprintf(buf + len, size - len, "%22s : %10u\n", s, \ | ||
948 | sc->debug.stats.rxstats.phy_err_stats[p]); | ||
949 | |||
950 | #define RXS_ERR(s, e) \ | 946 | #define RXS_ERR(s, e) \ |
951 | do { \ | 947 | do { \ |
952 | len += scnprintf(buf + len, size - len, \ | 948 | len += scnprintf(buf + len, size - len, \ |
953 | "%22s : %10u\n", s, \ | 949 | "%18s : %10u\n", s, \ |
954 | sc->debug.stats.rxstats.e);\ | 950 | sc->debug.stats.rxstats.e);\ |
955 | } while (0) | 951 | } while (0) |
956 | 952 | ||
@@ -963,6 +959,12 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, | |||
963 | if (buf == NULL) | 959 | if (buf == NULL) |
964 | return -ENOMEM; | 960 | return -ENOMEM; |
965 | 961 | ||
962 | RXS_ERR("PKTS-ALL", rx_pkts_all); | ||
963 | RXS_ERR("BYTES-ALL", rx_bytes_all); | ||
964 | RXS_ERR("BEACONS", rx_beacons); | ||
965 | RXS_ERR("FRAGS", rx_frags); | ||
966 | RXS_ERR("SPECTRAL", rx_spectral); | ||
967 | |||
966 | RXS_ERR("CRC ERR", crc_err); | 968 | RXS_ERR("CRC ERR", crc_err); |
967 | RXS_ERR("DECRYPT CRC ERR", decrypt_crc_err); | 969 | RXS_ERR("DECRYPT CRC ERR", decrypt_crc_err); |
968 | RXS_ERR("PHY ERR", phy_err); | 970 | RXS_ERR("PHY ERR", phy_err); |
@@ -970,43 +972,10 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, | |||
970 | RXS_ERR("PRE-DELIM CRC ERR", pre_delim_crc_err); | 972 | RXS_ERR("PRE-DELIM CRC ERR", pre_delim_crc_err); |
971 | RXS_ERR("POST-DELIM CRC ERR", post_delim_crc_err); | 973 | RXS_ERR("POST-DELIM CRC ERR", post_delim_crc_err); |
972 | RXS_ERR("DECRYPT BUSY ERR", decrypt_busy_err); | 974 | RXS_ERR("DECRYPT BUSY ERR", decrypt_busy_err); |
973 | RXS_ERR("RX-LENGTH-ERR", rx_len_err); | 975 | RXS_ERR("LENGTH-ERR", rx_len_err); |
974 | RXS_ERR("RX-OOM-ERR", rx_oom_err); | 976 | RXS_ERR("OOM-ERR", rx_oom_err); |
975 | RXS_ERR("RX-RATE-ERR", rx_rate_err); | 977 | RXS_ERR("RATE-ERR", rx_rate_err); |
976 | RXS_ERR("RX-TOO-MANY-FRAGS", rx_too_many_frags_err); | 978 | RXS_ERR("TOO-MANY-FRAGS", rx_too_many_frags_err); |
977 | |||
978 | PHY_ERR("UNDERRUN ERR", ATH9K_PHYERR_UNDERRUN); | ||
979 | PHY_ERR("TIMING ERR", ATH9K_PHYERR_TIMING); | ||
980 | PHY_ERR("PARITY ERR", ATH9K_PHYERR_PARITY); | ||
981 | PHY_ERR("RATE ERR", ATH9K_PHYERR_RATE); | ||
982 | PHY_ERR("LENGTH ERR", ATH9K_PHYERR_LENGTH); | ||
983 | PHY_ERR("RADAR ERR", ATH9K_PHYERR_RADAR); | ||
984 | PHY_ERR("SERVICE ERR", ATH9K_PHYERR_SERVICE); | ||
985 | PHY_ERR("TOR ERR", ATH9K_PHYERR_TOR); | ||
986 | PHY_ERR("OFDM-TIMING ERR", ATH9K_PHYERR_OFDM_TIMING); | ||
987 | PHY_ERR("OFDM-SIGNAL-PARITY ERR", ATH9K_PHYERR_OFDM_SIGNAL_PARITY); | ||
988 | PHY_ERR("OFDM-RATE ERR", ATH9K_PHYERR_OFDM_RATE_ILLEGAL); | ||
989 | PHY_ERR("OFDM-LENGTH ERR", ATH9K_PHYERR_OFDM_LENGTH_ILLEGAL); | ||
990 | PHY_ERR("OFDM-POWER-DROP ERR", ATH9K_PHYERR_OFDM_POWER_DROP); | ||
991 | PHY_ERR("OFDM-SERVICE ERR", ATH9K_PHYERR_OFDM_SERVICE); | ||
992 | PHY_ERR("OFDM-RESTART ERR", ATH9K_PHYERR_OFDM_RESTART); | ||
993 | PHY_ERR("FALSE-RADAR-EXT ERR", ATH9K_PHYERR_FALSE_RADAR_EXT); | ||
994 | PHY_ERR("CCK-TIMING ERR", ATH9K_PHYERR_CCK_TIMING); | ||
995 | PHY_ERR("CCK-HEADER-CRC ERR", ATH9K_PHYERR_CCK_HEADER_CRC); | ||
996 | PHY_ERR("CCK-RATE ERR", ATH9K_PHYERR_CCK_RATE_ILLEGAL); | ||
997 | PHY_ERR("CCK-SERVICE ERR", ATH9K_PHYERR_CCK_SERVICE); | ||
998 | PHY_ERR("CCK-RESTART ERR", ATH9K_PHYERR_CCK_RESTART); | ||
999 | PHY_ERR("CCK-LENGTH ERR", ATH9K_PHYERR_CCK_LENGTH_ILLEGAL); | ||
1000 | PHY_ERR("CCK-POWER-DROP ERR", ATH9K_PHYERR_CCK_POWER_DROP); | ||
1001 | PHY_ERR("HT-CRC ERR", ATH9K_PHYERR_HT_CRC_ERROR); | ||
1002 | PHY_ERR("HT-LENGTH ERR", ATH9K_PHYERR_HT_LENGTH_ILLEGAL); | ||
1003 | PHY_ERR("HT-RATE ERR", ATH9K_PHYERR_HT_RATE_ILLEGAL); | ||
1004 | |||
1005 | RXS_ERR("RX-Pkts-All", rx_pkts_all); | ||
1006 | RXS_ERR("RX-Bytes-All", rx_bytes_all); | ||
1007 | RXS_ERR("RX-Beacons", rx_beacons); | ||
1008 | RXS_ERR("RX-Frags", rx_frags); | ||
1009 | RXS_ERR("RX-Spectral", rx_spectral); | ||
1010 | 979 | ||
1011 | if (len > size) | 980 | if (len > size) |
1012 | len = size; | 981 | len = size; |
@@ -1017,7 +986,6 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, | |||
1017 | return retval; | 986 | return retval; |
1018 | 987 | ||
1019 | #undef RXS_ERR | 988 | #undef RXS_ERR |
1020 | #undef PHY_ERR | ||
1021 | } | 989 | } |
1022 | 990 | ||
1023 | void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) | 991 | void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) |
@@ -1056,6 +1024,67 @@ static const struct file_operations fops_recv = { | |||
1056 | .llseek = default_llseek, | 1024 | .llseek = default_llseek, |
1057 | }; | 1025 | }; |
1058 | 1026 | ||
1027 | static ssize_t read_file_phy_err(struct file *file, char __user *user_buf, | ||
1028 | size_t count, loff_t *ppos) | ||
1029 | { | ||
1030 | #define PHY_ERR(s, p) \ | ||
1031 | len += scnprintf(buf + len, size - len, "%22s : %10u\n", s, \ | ||
1032 | sc->debug.stats.rxstats.phy_err_stats[p]); | ||
1033 | |||
1034 | struct ath_softc *sc = file->private_data; | ||
1035 | char *buf; | ||
1036 | unsigned int len = 0, size = 1600; | ||
1037 | ssize_t retval = 0; | ||
1038 | |||
1039 | buf = kzalloc(size, GFP_KERNEL); | ||
1040 | if (buf == NULL) | ||
1041 | return -ENOMEM; | ||
1042 | |||
1043 | PHY_ERR("UNDERRUN ERR", ATH9K_PHYERR_UNDERRUN); | ||
1044 | PHY_ERR("TIMING ERR", ATH9K_PHYERR_TIMING); | ||
1045 | PHY_ERR("PARITY ERR", ATH9K_PHYERR_PARITY); | ||
1046 | PHY_ERR("RATE ERR", ATH9K_PHYERR_RATE); | ||
1047 | PHY_ERR("LENGTH ERR", ATH9K_PHYERR_LENGTH); | ||
1048 | PHY_ERR("RADAR ERR", ATH9K_PHYERR_RADAR); | ||
1049 | PHY_ERR("SERVICE ERR", ATH9K_PHYERR_SERVICE); | ||
1050 | PHY_ERR("TOR ERR", ATH9K_PHYERR_TOR); | ||
1051 | PHY_ERR("OFDM-TIMING ERR", ATH9K_PHYERR_OFDM_TIMING); | ||
1052 | PHY_ERR("OFDM-SIGNAL-PARITY ERR", ATH9K_PHYERR_OFDM_SIGNAL_PARITY); | ||
1053 | PHY_ERR("OFDM-RATE ERR", ATH9K_PHYERR_OFDM_RATE_ILLEGAL); | ||
1054 | PHY_ERR("OFDM-LENGTH ERR", ATH9K_PHYERR_OFDM_LENGTH_ILLEGAL); | ||
1055 | PHY_ERR("OFDM-POWER-DROP ERR", ATH9K_PHYERR_OFDM_POWER_DROP); | ||
1056 | PHY_ERR("OFDM-SERVICE ERR", ATH9K_PHYERR_OFDM_SERVICE); | ||
1057 | PHY_ERR("OFDM-RESTART ERR", ATH9K_PHYERR_OFDM_RESTART); | ||
1058 | PHY_ERR("FALSE-RADAR-EXT ERR", ATH9K_PHYERR_FALSE_RADAR_EXT); | ||
1059 | PHY_ERR("CCK-TIMING ERR", ATH9K_PHYERR_CCK_TIMING); | ||
1060 | PHY_ERR("CCK-HEADER-CRC ERR", ATH9K_PHYERR_CCK_HEADER_CRC); | ||
1061 | PHY_ERR("CCK-RATE ERR", ATH9K_PHYERR_CCK_RATE_ILLEGAL); | ||
1062 | PHY_ERR("CCK-SERVICE ERR", ATH9K_PHYERR_CCK_SERVICE); | ||
1063 | PHY_ERR("CCK-RESTART ERR", ATH9K_PHYERR_CCK_RESTART); | ||
1064 | PHY_ERR("CCK-LENGTH ERR", ATH9K_PHYERR_CCK_LENGTH_ILLEGAL); | ||
1065 | PHY_ERR("CCK-POWER-DROP ERR", ATH9K_PHYERR_CCK_POWER_DROP); | ||
1066 | PHY_ERR("HT-CRC ERR", ATH9K_PHYERR_HT_CRC_ERROR); | ||
1067 | PHY_ERR("HT-LENGTH ERR", ATH9K_PHYERR_HT_LENGTH_ILLEGAL); | ||
1068 | PHY_ERR("HT-RATE ERR", ATH9K_PHYERR_HT_RATE_ILLEGAL); | ||
1069 | |||
1070 | if (len > size) | ||
1071 | len = size; | ||
1072 | |||
1073 | retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
1074 | kfree(buf); | ||
1075 | |||
1076 | return retval; | ||
1077 | |||
1078 | #undef PHY_ERR | ||
1079 | } | ||
1080 | |||
1081 | static const struct file_operations fops_phy_err = { | ||
1082 | .read = read_file_phy_err, | ||
1083 | .open = simple_open, | ||
1084 | .owner = THIS_MODULE, | ||
1085 | .llseek = default_llseek, | ||
1086 | }; | ||
1087 | |||
1059 | static ssize_t read_file_regidx(struct file *file, char __user *user_buf, | 1088 | static ssize_t read_file_regidx(struct file *file, char __user *user_buf, |
1060 | size_t count, loff_t *ppos) | 1089 | size_t count, loff_t *ppos) |
1061 | { | 1090 | { |
@@ -1489,6 +1518,8 @@ int ath9k_init_debug(struct ath_hw *ah) | |||
1489 | &fops_reset); | 1518 | &fops_reset); |
1490 | debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, sc, | 1519 | debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, sc, |
1491 | &fops_recv); | 1520 | &fops_recv); |
1521 | debugfs_create_file("phy_err", S_IRUSR, sc->debug.debugfs_phy, sc, | ||
1522 | &fops_phy_err); | ||
1492 | debugfs_create_u8("rx_chainmask", S_IRUSR, sc->debug.debugfs_phy, | 1523 | debugfs_create_u8("rx_chainmask", S_IRUSR, sc->debug.debugfs_phy, |
1493 | &ah->rxchainmask); | 1524 | &ah->rxchainmask); |
1494 | debugfs_create_u8("tx_chainmask", S_IRUSR, sc->debug.debugfs_phy, | 1525 | debugfs_create_u8("tx_chainmask", S_IRUSR, sc->debug.debugfs_phy, |