debug.h (38fd2c202a3d82bc12430bce5789fa2c2a406f71) debug.h (350e2dcb4647d144000db1505c94d586fcd57919)
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 13 unchanged lines hidden (view full) ---

22#include "dfs_debug.h"
23
24struct ath_txq;
25struct ath_buf;
26struct fft_sample_tlv;
27
28#ifdef CONFIG_ATH9K_DEBUGFS
29#define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 13 unchanged lines hidden (view full) ---

22#include "dfs_debug.h"
23
24struct ath_txq;
25struct ath_buf;
26struct fft_sample_tlv;
27
28#ifdef CONFIG_ATH9K_DEBUGFS
29#define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++
30#define RX_STAT_INC(c) (sc->debug.stats.rxstats.c++)
30#define RESET_STAT_INC(sc, type) sc->debug.stats.reset[type]++
31#define ANT_STAT_INC(i, c) sc->debug.stats.ant_stats[i].c++
32#define ANT_LNA_INC(i, c) sc->debug.stats.ant_stats[i].lna_recv_cnt[c]++;
33#else
34#define TX_STAT_INC(q, c) do { } while (0)
31#define RESET_STAT_INC(sc, type) sc->debug.stats.reset[type]++
32#define ANT_STAT_INC(i, c) sc->debug.stats.ant_stats[i].c++
33#define ANT_LNA_INC(i, c) sc->debug.stats.ant_stats[i].lna_recv_cnt[c]++;
34#else
35#define TX_STAT_INC(q, c) do { } while (0)
36#define RX_STAT_INC(c)
35#define RESET_STAT_INC(sc, type) do { } while (0)
36#define ANT_STAT_INC(i, c) do { } while (0)
37#define ANT_LNA_INC(i, c) do { } while (0)
38#endif
39
40enum ath_reset_type {
41 RESET_TYPE_BB_HANG,
42 RESET_TYPE_BB_WATCHDOG,

--- 153 unchanged lines hidden (view full) ---

196 len += scnprintf(buf + len, size - len, \
197 "%s%13u%11u%10u%10u\n", str, \
198 TXSTATS[PR_QNUM(IEEE80211_AC_BE)].elem,\
199 TXSTATS[PR_QNUM(IEEE80211_AC_BK)].elem,\
200 TXSTATS[PR_QNUM(IEEE80211_AC_VI)].elem,\
201 TXSTATS[PR_QNUM(IEEE80211_AC_VO)].elem); \
202 } while(0)
203
37#define RESET_STAT_INC(sc, type) do { } while (0)
38#define ANT_STAT_INC(i, c) do { } while (0)
39#define ANT_LNA_INC(i, c) do { } while (0)
40#endif
41
42enum ath_reset_type {
43 RESET_TYPE_BB_HANG,
44 RESET_TYPE_BB_WATCHDOG,

--- 153 unchanged lines hidden (view full) ---

198 len += scnprintf(buf + len, size - len, \
199 "%s%13u%11u%10u%10u\n", str, \
200 TXSTATS[PR_QNUM(IEEE80211_AC_BE)].elem,\
201 TXSTATS[PR_QNUM(IEEE80211_AC_BK)].elem,\
202 TXSTATS[PR_QNUM(IEEE80211_AC_VI)].elem,\
203 TXSTATS[PR_QNUM(IEEE80211_AC_VO)].elem); \
204 } while(0)
205
204#define RX_STAT_INC(c) (sc->debug.stats.rxstats.c++)
206struct ath_rx_rate_stats {
207 struct {
208 u32 ht20_cnt;
209 u32 ht40_cnt;
210 u32 sgi_cnt;
211 u32 lgi_cnt;
212 } ht_stats[24];
205
213
214 struct {
215 u32 ofdm_cnt;
216 } ofdm_stats[8];
217
218 struct {
219 u32 cck_lp_cnt;
220 u32 cck_sp_cnt;
221 } cck_stats[4];
222};
223
206/**
207 * struct ath_rx_stats - RX Statistics
208 * @rx_pkts_all: No. of total frames received, including ones that
209 may have had errors.
210 * @rx_bytes_all: No. of total bytes received, including ones that
211 may have had errors.
212 * @crc_err: No. of frames with incorrect CRC value
213 * @decrypt_crc_err: No. of frames whose CRC check failed after

--- 73 unchanged lines hidden (view full) ---

287 struct ethtool_stats *stats, u64 *data);
288void ath9k_get_et_strings(struct ieee80211_hw *hw,
289 struct ieee80211_vif *vif,
290 u32 sset, u8 *data);
291void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
292 struct ieee80211_vif *vif,
293 struct ieee80211_sta *sta,
294 struct dentry *dir);
224/**
225 * struct ath_rx_stats - RX Statistics
226 * @rx_pkts_all: No. of total frames received, including ones that
227 may have had errors.
228 * @rx_bytes_all: No. of total bytes received, including ones that
229 may have had errors.
230 * @crc_err: No. of frames with incorrect CRC value
231 * @decrypt_crc_err: No. of frames whose CRC check failed after

--- 73 unchanged lines hidden (view full) ---

305 struct ethtool_stats *stats, u64 *data);
306void ath9k_get_et_strings(struct ieee80211_hw *hw,
307 struct ieee80211_vif *vif,
308 u32 sset, u8 *data);
309void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
310 struct ieee80211_vif *vif,
311 struct ieee80211_sta *sta,
312 struct dentry *dir);
295void ath_debug_send_fft_sample(struct ath_softc *sc,
296 struct fft_sample_tlv *fft_sample);
297void ath9k_debug_stat_ant(struct ath_softc *sc,
298 struct ath_hw_antcomb_conf *div_ant_conf,
299 int main_rssi_avg, int alt_rssi_avg);
313void ath9k_debug_stat_ant(struct ath_softc *sc,
314 struct ath_hw_antcomb_conf *div_ant_conf,
315 int main_rssi_avg, int alt_rssi_avg);
316void ath9k_debug_sync_cause(struct ath_softc *sc, u32 sync_cause);
317
300#else
301
318#else
319
302#define RX_STAT_INC(c) /* NOP */
303
304static inline int ath9k_init_debug(struct ath_hw *ah)
305{
306 return 0;
307}
308
309static inline void ath9k_deinit_debug(struct ath_softc *sc)
310{
311}

--- 14 unchanged lines hidden (view full) ---

326}
327static inline void ath9k_debug_stat_ant(struct ath_softc *sc,
328 struct ath_hw_antcomb_conf *div_ant_conf,
329 int main_rssi_avg, int alt_rssi_avg)
330{
331
332}
333
320static inline int ath9k_init_debug(struct ath_hw *ah)
321{
322 return 0;
323}
324
325static inline void ath9k_deinit_debug(struct ath_softc *sc)
326{
327}

--- 14 unchanged lines hidden (view full) ---

342}
343static inline void ath9k_debug_stat_ant(struct ath_softc *sc,
344 struct ath_hw_antcomb_conf *div_ant_conf,
345 int main_rssi_avg, int alt_rssi_avg)
346{
347
348}
349
350static inline void
351ath9k_debug_sync_cause(struct ath_softc *sc, u32 sync_cause)
352{
353}
354
334#endif /* CONFIG_ATH9K_DEBUGFS */
335
355#endif /* CONFIG_ATH9K_DEBUGFS */
356
357#ifdef CONFIG_ATH9K_STATION_STATISTICS
358void ath_debug_rate_stats(struct ath_softc *sc,
359 struct ath_rx_status *rs,
360 struct sk_buff *skb);
361#else
362static inline void ath_debug_rate_stats(struct ath_softc *sc,
363 struct ath_rx_status *rs,
364 struct sk_buff *skb)
365{
366}
367#endif /* CONFIG_ATH9K_STATION_STATISTICS */
368
336#endif /* DEBUG_H */
369#endif /* DEBUG_H */