This source file includes following definitions.
- ath9k_init_debug
- ath9k_deinit_debug
- ath_debug_stat_interrupt
- ath_debug_stat_tx
- ath_debug_stat_rx
- ath9k_debug_stat_ant
- ath9k_debug_sync_cause
- ath_debug_rate_stats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef DEBUG_H
18 #define DEBUG_H
19
20 #include "hw.h"
21 #include "dfs_debug.h"
22
23 struct ath_txq;
24 struct ath_buf;
25 struct fft_sample_tlv;
26
27 #ifdef CONFIG_ATH9K_DEBUGFS
28 #define TX_STAT_INC(sc, q, c) do { (sc)->debug.stats.txstats[q].c++; } while (0)
29 #define RX_STAT_INC(sc, c) do { (sc)->debug.stats.rxstats.c++; } while (0)
30 #define RESET_STAT_INC(sc, type) do { (sc)->debug.stats.reset[type]++; } while (0)
31 #define ANT_STAT_INC(sc, i, c) do { (sc)->debug.stats.ant_stats[i].c++; } while (0)
32 #define ANT_LNA_INC(sc, i, c) do { (sc)->debug.stats.ant_stats[i].lna_recv_cnt[c]++; } while (0)
33 #else
34 #define TX_STAT_INC(sc, q, c) do { (void)(sc); } while (0)
35 #define RX_STAT_INC(sc, c) do { (void)(sc); } while (0)
36 #define RESET_STAT_INC(sc, type) do { (void)(sc); } while (0)
37 #define ANT_STAT_INC(sc, i, c) do { (void)(sc); } while (0)
38 #define ANT_LNA_INC(sc, i, c) do { (void)(sc); } while (0)
39 #endif
40
41 enum ath_reset_type {
42 RESET_TYPE_BB_HANG,
43 RESET_TYPE_BB_WATCHDOG,
44 RESET_TYPE_FATAL_INT,
45 RESET_TYPE_TX_ERROR,
46 RESET_TYPE_TX_GTT,
47 RESET_TYPE_TX_HANG,
48 RESET_TYPE_PLL_HANG,
49 RESET_TYPE_MAC_HANG,
50 RESET_TYPE_BEACON_STUCK,
51 RESET_TYPE_MCI,
52 RESET_TYPE_CALIBRATION,
53 RESET_TX_DMA_ERROR,
54 RESET_RX_DMA_ERROR,
55 __RESET_TYPE_MAX
56 };
57
58 #ifdef CONFIG_ATH9K_DEBUGFS
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90 struct ath_interrupt_stats {
91 u32 total;
92 u32 rxok;
93 u32 rxlp;
94 u32 rxhp;
95 u32 rxeol;
96 u32 rxorn;
97 u32 txok;
98 u32 txeol;
99 u32 txurn;
100 u32 mib;
101 u32 rxphyerr;
102 u32 rx_keycache_miss;
103 u32 swba;
104 u32 bmiss;
105 u32 bnr;
106 u32 cst;
107 u32 gtt;
108 u32 tim;
109 u32 cabend;
110 u32 dtimsync;
111 u32 dtim;
112 u32 bb_watchdog;
113 u32 tsfoor;
114 u32 mci;
115 u32 gen_timer;
116
117
118 u32 sync_cause_all;
119 u32 sync_rtc_irq;
120 u32 sync_mac_irq;
121 u32 eeprom_illegal_access;
122 u32 apb_timeout;
123 u32 pci_mode_conflict;
124 u32 host1_fatal;
125 u32 host1_perr;
126 u32 trcv_fifo_perr;
127 u32 radm_cpl_ep;
128 u32 radm_cpl_dllp_abort;
129 u32 radm_cpl_tlp_abort;
130 u32 radm_cpl_ecrc_err;
131 u32 radm_cpl_timeout;
132 u32 local_timeout;
133 u32 pm_access;
134 u32 mac_awake;
135 u32 mac_asleep;
136 u32 mac_sleep_access;
137 };
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168 struct ath_tx_stats {
169 u32 tx_pkts_all;
170 u32 tx_bytes_all;
171 u32 queued;
172 u32 completed;
173 u32 xretries;
174 u32 a_aggr;
175 u32 a_queued_hw;
176 u32 a_completed;
177 u32 a_retries;
178 u32 a_xretries;
179 u32 txerr_filtered;
180 u32 fifo_underrun;
181 u32 xtxop;
182 u32 timer_exp;
183 u32 desc_cfg_err;
184 u32 data_underrun;
185 u32 delim_underrun;
186 u32 puttxbuf;
187 u32 txstart;
188 u32 txprocdesc;
189 u32 txfailed;
190 };
191
192
193
194
195 #define PR_QNUM(_n) sc->tx.txq_map[_n]->axq_qnum
196 #define TXSTATS sc->debug.stats.txstats
197 #define PR(str, elem) \
198 do { \
199 seq_printf(file, "%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
206 struct 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];
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
224 struct ath_airtime_stats {
225 u32 rx_airtime;
226 u32 tx_airtime;
227 };
228
229 #define ANT_MAIN 0
230 #define ANT_ALT 1
231
232 struct ath_antenna_stats {
233 u32 recv_cnt;
234 u32 rssi_avg;
235 u32 lna_recv_cnt[4];
236 u32 lna_attempt_cnt[4];
237 };
238
239 struct ath_stats {
240 struct ath_interrupt_stats istats;
241 struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES];
242 struct ath_rx_stats rxstats;
243 struct ath_dfs_stats dfs_stats;
244 struct ath_antenna_stats ant_stats[2];
245 u32 reset[__RESET_TYPE_MAX];
246 };
247
248 struct ath9k_debug {
249 struct dentry *debugfs_phy;
250 u32 regidx;
251 struct ath_stats stats;
252 };
253
254 int ath9k_init_debug(struct ath_hw *ah);
255 void ath9k_deinit_debug(struct ath_softc *sc);
256
257 void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
258 void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
259 struct ath_tx_status *ts, struct ath_txq *txq,
260 unsigned int flags);
261 void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs);
262 int ath9k_get_et_sset_count(struct ieee80211_hw *hw,
263 struct ieee80211_vif *vif, int sset);
264 void ath9k_get_et_stats(struct ieee80211_hw *hw,
265 struct ieee80211_vif *vif,
266 struct ethtool_stats *stats, u64 *data);
267 void ath9k_get_et_strings(struct ieee80211_hw *hw,
268 struct ieee80211_vif *vif,
269 u32 sset, u8 *data);
270 void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
271 struct ieee80211_vif *vif,
272 struct ieee80211_sta *sta,
273 struct dentry *dir);
274 void ath9k_debug_stat_ant(struct ath_softc *sc,
275 struct ath_hw_antcomb_conf *div_ant_conf,
276 int main_rssi_avg, int alt_rssi_avg);
277 void ath9k_debug_sync_cause(struct ath_softc *sc, u32 sync_cause);
278
279 #else
280
281 static inline int ath9k_init_debug(struct ath_hw *ah)
282 {
283 return 0;
284 }
285
286 static inline void ath9k_deinit_debug(struct ath_softc *sc)
287 {
288 }
289 static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
290 enum ath9k_int status)
291 {
292 }
293 static inline void ath_debug_stat_tx(struct ath_softc *sc,
294 struct ath_buf *bf,
295 struct ath_tx_status *ts,
296 struct ath_txq *txq,
297 unsigned int flags)
298 {
299 }
300 static inline void ath_debug_stat_rx(struct ath_softc *sc,
301 struct ath_rx_status *rs)
302 {
303 }
304 static inline void ath9k_debug_stat_ant(struct ath_softc *sc,
305 struct ath_hw_antcomb_conf *div_ant_conf,
306 int main_rssi_avg, int alt_rssi_avg)
307 {
308
309 }
310
311 static inline void
312 ath9k_debug_sync_cause(struct ath_softc *sc, u32 sync_cause)
313 {
314 }
315
316 #endif
317
318 #ifdef CONFIG_ATH9K_STATION_STATISTICS
319 void ath_debug_rate_stats(struct ath_softc *sc,
320 struct ath_rx_status *rs,
321 struct sk_buff *skb);
322 #else
323 static inline void ath_debug_rate_stats(struct ath_softc *sc,
324 struct ath_rx_status *rs,
325 struct sk_buff *skb)
326 {
327 }
328 #endif
329
330 #endif