diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 35 |
3 files changed, 65 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 9078279fab0c..244723a3ed41 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -916,6 +916,21 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, | |||
916 | len += snprintf(buf + len, size - len, | 916 | len += snprintf(buf + len, size - len, |
917 | "%22s : %10u\n", "DECRYPT BUSY ERR", | 917 | "%22s : %10u\n", "DECRYPT BUSY ERR", |
918 | sc->debug.stats.rxstats.decrypt_busy_err); | 918 | sc->debug.stats.rxstats.decrypt_busy_err); |
919 | len += snprintf(buf + len, size - len, | ||
920 | "%22s : %10u\n", "RX-LENGTH-ERR", | ||
921 | sc->debug.stats.rxstats.rx_len_err); | ||
922 | len += snprintf(buf + len, size - len, | ||
923 | "%22s : %10u\n", "RX-OOM-ERR", | ||
924 | sc->debug.stats.rxstats.rx_oom_err); | ||
925 | len += snprintf(buf + len, size - len, | ||
926 | "%22s : %10u\n", "RX-RATE-ERR", | ||
927 | sc->debug.stats.rxstats.rx_rate_err); | ||
928 | len += snprintf(buf + len, size - len, | ||
929 | "%22s : %10u\n", "RX-DROP-RXFLUSH", | ||
930 | sc->debug.stats.rxstats.rx_drop_rxflush); | ||
931 | len += snprintf(buf + len, size - len, | ||
932 | "%22s : %10u\n", "RX-TOO-MANY-FRAGS", | ||
933 | sc->debug.stats.rxstats.rx_too_many_frags_err); | ||
919 | 934 | ||
920 | PHY_ERR("UNDERRUN ERR", ATH9K_PHYERR_UNDERRUN); | 935 | PHY_ERR("UNDERRUN ERR", ATH9K_PHYERR_UNDERRUN); |
921 | PHY_ERR("TIMING ERR", ATH9K_PHYERR_TIMING); | 936 | PHY_ERR("TIMING ERR", ATH9K_PHYERR_TIMING); |
@@ -950,6 +965,12 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, | |||
950 | len += snprintf(buf + len, size - len, | 965 | len += snprintf(buf + len, size - len, |
951 | "%22s : %10u\n", "RX-Bytes-All", | 966 | "%22s : %10u\n", "RX-Bytes-All", |
952 | sc->debug.stats.rxstats.rx_bytes_all); | 967 | sc->debug.stats.rxstats.rx_bytes_all); |
968 | len += snprintf(buf + len, size - len, | ||
969 | "%22s : %10u\n", "RX-Beacons", | ||
970 | sc->debug.stats.rxstats.rx_beacons); | ||
971 | len += snprintf(buf + len, size - len, | ||
972 | "%22s : %10u\n", "RX-Frags", | ||
973 | sc->debug.stats.rxstats.rx_frags); | ||
953 | 974 | ||
954 | if (len > size) | 975 | if (len > size) |
955 | len = size; | 976 | len = size; |
@@ -964,7 +985,6 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, | |||
964 | 985 | ||
965 | void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) | 986 | void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) |
966 | { | 987 | { |
967 | #define RX_STAT_INC(c) sc->debug.stats.rxstats.c++ | ||
968 | #define RX_PHY_ERR_INC(c) sc->debug.stats.rxstats.phy_err_stats[c]++ | 988 | #define RX_PHY_ERR_INC(c) sc->debug.stats.rxstats.phy_err_stats[c]++ |
969 | #define RX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].rs\ | 989 | #define RX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].rs\ |
970 | [sc->debug.rsidx].c) | 990 | [sc->debug.rsidx].c) |
@@ -1010,7 +1030,6 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) | |||
1010 | 1030 | ||
1011 | #endif | 1031 | #endif |
1012 | 1032 | ||
1013 | #undef RX_STAT_INC | ||
1014 | #undef RX_PHY_ERR_INC | 1033 | #undef RX_PHY_ERR_INC |
1015 | #undef RX_SAMP_DBG | 1034 | #undef RX_SAMP_DBG |
1016 | } | 1035 | } |
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h index fe2b487ed6c5..17f6cc27af32 100644 --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h | |||
@@ -139,6 +139,8 @@ struct ath_tx_stats { | |||
139 | u32 txfailed; | 139 | u32 txfailed; |
140 | }; | 140 | }; |
141 | 141 | ||
142 | #define RX_STAT_INC(c) (sc->debug.stats.rxstats.c++) | ||
143 | |||
142 | /** | 144 | /** |
143 | * struct ath_rx_stats - RX Statistics | 145 | * struct ath_rx_stats - RX Statistics |
144 | * @rx_pkts_all: No. of total frames received, including ones that | 146 | * @rx_pkts_all: No. of total frames received, including ones that |
@@ -155,6 +157,13 @@ struct ath_tx_stats { | |||
155 | * @post_delim_crc_err: Post-Frame delimiter CRC error detections | 157 | * @post_delim_crc_err: Post-Frame delimiter CRC error detections |
156 | * @decrypt_busy_err: Decryption interruptions counter | 158 | * @decrypt_busy_err: Decryption interruptions counter |
157 | * @phy_err_stats: Individual PHY error statistics | 159 | * @phy_err_stats: Individual PHY error statistics |
160 | * @rx_len_err: No. of frames discarded due to bad length. | ||
161 | * @rx_oom_err: No. of frames dropped due to OOM issues. | ||
162 | * @rx_rate_err: No. of frames dropped due to rate errors. | ||
163 | * @rx_too_many_frags_err: Frames dropped due to too-many-frags received. | ||
164 | * @rx_drop_rxflush: No. of frames dropped due to RX-FLUSH. | ||
165 | * @rx_beacons: No. of beacons received. | ||
166 | * @rx_frags: No. of rx-fragements received. | ||
158 | */ | 167 | */ |
159 | struct ath_rx_stats { | 168 | struct ath_rx_stats { |
160 | u32 rx_pkts_all; | 169 | u32 rx_pkts_all; |
@@ -167,6 +176,13 @@ struct ath_rx_stats { | |||
167 | u32 post_delim_crc_err; | 176 | u32 post_delim_crc_err; |
168 | u32 decrypt_busy_err; | 177 | u32 decrypt_busy_err; |
169 | u32 phy_err_stats[ATH9K_PHYERR_MAX]; | 178 | u32 phy_err_stats[ATH9K_PHYERR_MAX]; |
179 | u32 rx_len_err; | ||
180 | u32 rx_oom_err; | ||
181 | u32 rx_rate_err; | ||
182 | u32 rx_too_many_frags_err; | ||
183 | u32 rx_drop_rxflush; | ||
184 | u32 rx_beacons; | ||
185 | u32 rx_frags; | ||
170 | }; | 186 | }; |
171 | 187 | ||
172 | enum ath_reset_type { | 188 | enum ath_reset_type { |
@@ -250,6 +266,8 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs); | |||
250 | 266 | ||
251 | #else | 267 | #else |
252 | 268 | ||
269 | #define RX_STAT_INC(c) /* NOP */ | ||
270 | |||
253 | static inline int ath9k_init_debug(struct ath_hw *ah) | 271 | static inline int ath9k_init_debug(struct ath_hw *ah) |
254 | { | 272 | { |
255 | return 0; | 273 | return 0; |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 858801735282..301ef3e57145 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -824,15 +824,20 @@ static bool ath9k_rx_accept(struct ath_common *common, | |||
824 | if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID) | 824 | if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID) |
825 | rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; | 825 | rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; |
826 | 826 | ||
827 | if (!rx_stats->rs_datalen) | 827 | if (!rx_stats->rs_datalen) { |
828 | RX_STAT_INC(rx_len_err); | ||
828 | return false; | 829 | return false; |
830 | } | ||
831 | |||
829 | /* | 832 | /* |
830 | * rs_status follows rs_datalen so if rs_datalen is too large | 833 | * rs_status follows rs_datalen so if rs_datalen is too large |
831 | * we can take a hint that hardware corrupted it, so ignore | 834 | * we can take a hint that hardware corrupted it, so ignore |
832 | * those frames. | 835 | * those frames. |
833 | */ | 836 | */ |
834 | if (rx_stats->rs_datalen > (common->rx_bufsize - rx_status_len)) | 837 | if (rx_stats->rs_datalen > (common->rx_bufsize - rx_status_len)) { |
838 | RX_STAT_INC(rx_len_err); | ||
835 | return false; | 839 | return false; |
840 | } | ||
836 | 841 | ||
837 | /* Only use error bits from the last fragment */ | 842 | /* Only use error bits from the last fragment */ |
838 | if (rx_stats->rs_more) | 843 | if (rx_stats->rs_more) |
@@ -902,6 +907,7 @@ static int ath9k_process_rate(struct ath_common *common, | |||
902 | struct ieee80211_supported_band *sband; | 907 | struct ieee80211_supported_band *sband; |
903 | enum ieee80211_band band; | 908 | enum ieee80211_band band; |
904 | unsigned int i = 0; | 909 | unsigned int i = 0; |
910 | struct ath_softc *sc = (struct ath_softc *) common->priv; | ||
905 | 911 | ||
906 | band = hw->conf.channel->band; | 912 | band = hw->conf.channel->band; |
907 | sband = hw->wiphy->bands[band]; | 913 | sband = hw->wiphy->bands[band]; |
@@ -936,7 +942,7 @@ static int ath9k_process_rate(struct ath_common *common, | |||
936 | ath_dbg(common, ANY, | 942 | ath_dbg(common, ANY, |
937 | "unsupported hw bitrate detected 0x%02x using 1 Mbit\n", | 943 | "unsupported hw bitrate detected 0x%02x using 1 Mbit\n", |
938 | rx_stats->rs_rate); | 944 | rx_stats->rs_rate); |
939 | 945 | RX_STAT_INC(rx_rate_err); | |
940 | return -EINVAL; | 946 | return -EINVAL; |
941 | } | 947 | } |
942 | 948 | ||
@@ -1823,10 +1829,14 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1823 | 1829 | ||
1824 | hdr = (struct ieee80211_hdr *) (hdr_skb->data + rx_status_len); | 1830 | hdr = (struct ieee80211_hdr *) (hdr_skb->data + rx_status_len); |
1825 | rxs = IEEE80211_SKB_RXCB(hdr_skb); | 1831 | rxs = IEEE80211_SKB_RXCB(hdr_skb); |
1826 | if (ieee80211_is_beacon(hdr->frame_control) && | 1832 | if (ieee80211_is_beacon(hdr->frame_control)) { |
1827 | !is_zero_ether_addr(common->curbssid) && | 1833 | RX_STAT_INC(rx_beacons); |
1828 | !compare_ether_addr(hdr->addr3, common->curbssid)) | 1834 | if (!is_zero_ether_addr(common->curbssid) && |
1829 | rs.is_mybeacon = true; | 1835 | !compare_ether_addr(hdr->addr3, common->curbssid)) |
1836 | rs.is_mybeacon = true; | ||
1837 | else | ||
1838 | rs.is_mybeacon = false; | ||
1839 | } | ||
1830 | else | 1840 | else |
1831 | rs.is_mybeacon = false; | 1841 | rs.is_mybeacon = false; |
1832 | 1842 | ||
@@ -1836,8 +1846,10 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1836 | * If we're asked to flush receive queue, directly | 1846 | * If we're asked to flush receive queue, directly |
1837 | * chain it back at the queue without processing it. | 1847 | * chain it back at the queue without processing it. |
1838 | */ | 1848 | */ |
1839 | if (sc->sc_flags & SC_OP_RXFLUSH) | 1849 | if (sc->sc_flags & SC_OP_RXFLUSH) { |
1850 | RX_STAT_INC(rx_drop_rxflush); | ||
1840 | goto requeue_drop_frag; | 1851 | goto requeue_drop_frag; |
1852 | } | ||
1841 | 1853 | ||
1842 | memset(rxs, 0, sizeof(struct ieee80211_rx_status)); | 1854 | memset(rxs, 0, sizeof(struct ieee80211_rx_status)); |
1843 | 1855 | ||
@@ -1867,8 +1879,10 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1867 | * tell hardware it can give us a new frame using the old | 1879 | * tell hardware it can give us a new frame using the old |
1868 | * skb and put it at the tail of the sc->rx.rxbuf list for | 1880 | * skb and put it at the tail of the sc->rx.rxbuf list for |
1869 | * processing. */ | 1881 | * processing. */ |
1870 | if (!requeue_skb) | 1882 | if (!requeue_skb) { |
1883 | RX_STAT_INC(rx_oom_err); | ||
1871 | goto requeue_drop_frag; | 1884 | goto requeue_drop_frag; |
1885 | } | ||
1872 | 1886 | ||
1873 | /* Unmap the frame */ | 1887 | /* Unmap the frame */ |
1874 | dma_unmap_single(sc->dev, bf->bf_buf_addr, | 1888 | dma_unmap_single(sc->dev, bf->bf_buf_addr, |
@@ -1899,6 +1913,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1899 | } | 1913 | } |
1900 | 1914 | ||
1901 | if (rs.rs_more) { | 1915 | if (rs.rs_more) { |
1916 | RX_STAT_INC(rx_frags); | ||
1902 | /* | 1917 | /* |
1903 | * rs_more indicates chained descriptors which can be | 1918 | * rs_more indicates chained descriptors which can be |
1904 | * used to link buffers together for a sort of | 1919 | * used to link buffers together for a sort of |
@@ -1908,6 +1923,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1908 | /* too many fragments - cannot handle frame */ | 1923 | /* too many fragments - cannot handle frame */ |
1909 | dev_kfree_skb_any(sc->rx.frag); | 1924 | dev_kfree_skb_any(sc->rx.frag); |
1910 | dev_kfree_skb_any(skb); | 1925 | dev_kfree_skb_any(skb); |
1926 | RX_STAT_INC(rx_too_many_frags_err); | ||
1911 | skb = NULL; | 1927 | skb = NULL; |
1912 | } | 1928 | } |
1913 | sc->rx.frag = skb; | 1929 | sc->rx.frag = skb; |
@@ -1919,6 +1935,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1919 | 1935 | ||
1920 | if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) { | 1936 | if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) { |
1921 | dev_kfree_skb(skb); | 1937 | dev_kfree_skb(skb); |
1938 | RX_STAT_INC(rx_oom_err); | ||
1922 | goto requeue_drop_frag; | 1939 | goto requeue_drop_frag; |
1923 | } | 1940 | } |
1924 | 1941 | ||