~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/wireless/ath/ath9k/debug.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#ifndef DEBUG_H
18
18
#define DEBUG_H
19
19
 
20
 
enum ATH_DEBUG {
21
 
        ATH_DBG_RESET           = 0x00000001,
22
 
        ATH_DBG_QUEUE           = 0x00000002,
23
 
        ATH_DBG_EEPROM          = 0x00000004,
24
 
        ATH_DBG_CALIBRATE       = 0x00000008,
25
 
        ATH_DBG_INTERRUPT       = 0x00000010,
26
 
        ATH_DBG_REGULATORY      = 0x00000020,
27
 
        ATH_DBG_ANI             = 0x00000040,
28
 
        ATH_DBG_XMIT            = 0x00000080,
29
 
        ATH_DBG_BEACON          = 0x00000100,
30
 
        ATH_DBG_CONFIG          = 0x00000200,
31
 
        ATH_DBG_FATAL           = 0x00000400,
32
 
        ATH_DBG_PS              = 0x00000800,
33
 
        ATH_DBG_HWTIMER         = 0x00001000,
34
 
        ATH_DBG_BTCOEX          = 0x00002000,
35
 
        ATH_DBG_ANY             = 0xffffffff
36
 
};
37
 
 
38
 
#define DBG_DEFAULT (ATH_DBG_FATAL)
 
20
#include "hw.h"
 
21
#include "rc.h"
39
22
 
40
23
struct ath_txq;
41
24
struct ath_buf;
42
25
 
43
 
#ifdef CONFIG_ATH9K_DEBUG
 
26
#ifdef CONFIG_ATH9K_DEBUGFS
44
27
#define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++
45
28
#else
46
29
#define TX_STAT_INC(q, c) do { } while (0)
47
30
#endif
48
31
 
49
 
#ifdef CONFIG_ATH9K_DEBUG
 
32
#ifdef CONFIG_ATH9K_DEBUGFS
50
33
 
51
34
/**
52
35
 * struct ath_interrupt_stats - Contains statistics about interrupts
53
36
 * @total: Total no. of interrupts generated so far
54
37
 * @rxok: RX with no errors
 
38
 * @rxlp: RX with low priority RX
 
39
 * @rxhp: RX with high priority, uapsd only
55
40
 * @rxeol: RX with no more RXDESC available
56
41
 * @rxorn: RX FIFO overrun
57
42
 * @txok: TX completed at the requested rate
68
53
 * @cabend: RX End of CAB traffic
69
54
 * @dtimsync: DTIM sync lossage
70
55
 * @dtim: RX Beacon with DTIM
 
56
 * @bb_watchdog: Baseband watchdog
71
57
 */
72
58
struct ath_interrupt_stats {
73
59
        u32 total;
74
60
        u32 rxok;
 
61
        u32 rxlp;
 
62
        u32 rxhp;
75
63
        u32 rxeol;
76
64
        u32 rxorn;
77
65
        u32 txok;
89
77
        u32 cabend;
90
78
        u32 dtimsync;
91
79
        u32 dtim;
92
 
};
93
 
 
94
 
struct ath_rc_stats {
95
 
        u32 success;
96
 
        u32 retries;
97
 
        u32 xretries;
98
 
        u8 per;
 
80
        u32 bb_watchdog;
99
81
};
100
82
 
101
83
/**
102
84
 * struct ath_tx_stats - Statistics about TX
 
85
 * @tx_pkts_all:  No. of total frames transmitted, including ones that
 
86
        may have had errors.
 
87
 * @tx_bytes_all:  No. of total bytes transmitted, including ones that
 
88
        may have had errors.
103
89
 * @queued: Total MPDUs (non-aggr) queued
104
90
 * @completed: Total MPDUs (non-aggr) completed
105
91
 * @a_aggr: Total no. of aggregates queued
118
104
 * @delim_urn: TX delimiter underrun errors
119
105
 */
120
106
struct ath_tx_stats {
 
107
        u32 tx_pkts_all;
 
108
        u32 tx_bytes_all;
121
109
        u32 queued;
122
110
        u32 completed;
123
111
        u32 a_aggr;
133
121
        u32 delim_underrun;
134
122
};
135
123
 
 
124
/**
 
125
 * struct ath_rx_stats - RX Statistics
 
126
 * @rx_pkts_all:  No. of total frames received, including ones that
 
127
        may have had errors.
 
128
 * @rx_bytes_all:  No. of total bytes received, including ones that
 
129
        may have had errors.
 
130
 * @crc_err: No. of frames with incorrect CRC value
 
131
 * @decrypt_crc_err: No. of frames whose CRC check failed after
 
132
        decryption process completed
 
133
 * @phy_err: No. of frames whose reception failed because the PHY
 
134
        encountered an error
 
135
 * @mic_err: No. of frames with incorrect TKIP MIC verification failure
 
136
 * @pre_delim_crc_err: Pre-Frame delimiter CRC error detections
 
137
 * @post_delim_crc_err: Post-Frame delimiter CRC error detections
 
138
 * @decrypt_busy_err: Decryption interruptions counter
 
139
 * @phy_err_stats: Individual PHY error statistics
 
140
 */
 
141
struct ath_rx_stats {
 
142
        u32 rx_pkts_all;
 
143
        u32 rx_bytes_all;
 
144
        u32 crc_err;
 
145
        u32 decrypt_crc_err;
 
146
        u32 phy_err;
 
147
        u32 mic_err;
 
148
        u32 pre_delim_crc_err;
 
149
        u32 post_delim_crc_err;
 
150
        u32 decrypt_busy_err;
 
151
        u32 phy_err_stats[ATH9K_PHYERR_MAX];
 
152
};
 
153
 
136
154
struct ath_stats {
137
155
        struct ath_interrupt_stats istats;
138
 
        struct ath_rc_stats rcstats[RATE_TABLE_SIZE];
139
156
        struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES];
 
157
        struct ath_rx_stats rxstats;
140
158
};
141
159
 
142
160
struct ath9k_debug {
143
 
        int debug_mask;
144
161
        struct dentry *debugfs_phy;
145
 
        struct dentry *debugfs_debug;
146
 
        struct dentry *debugfs_dma;
147
 
        struct dentry *debugfs_interrupt;
148
 
        struct dentry *debugfs_rcstat;
149
 
        struct dentry *debugfs_wiphy;
150
 
        struct dentry *debugfs_xmit;
 
162
        u32 regidx;
151
163
        struct ath_stats stats;
152
164
};
153
165
 
154
 
void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...);
155
 
int ath9k_init_debug(struct ath_softc *sc);
156
 
void ath9k_exit_debug(struct ath_softc *sc);
157
 
int ath9k_debug_create_root(void);
158
 
void ath9k_debug_remove_root(void);
 
166
int ath9k_init_debug(struct ath_hw *ah);
 
167
 
159
168
void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
160
 
void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb);
161
 
void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq,
162
 
                       struct ath_buf *bf);
163
 
void ath_debug_stat_retries(struct ath_softc *sc, int rix,
164
 
                            int xretries, int retries, u8 per);
 
169
void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
 
170
                       struct ath_tx_status *ts);
 
171
void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs);
165
172
 
166
173
#else
167
174
 
168
 
static inline void DPRINTF(struct ath_softc *sc, int dbg_mask,
169
 
                           const char *fmt, ...)
170
 
{
171
 
}
172
 
 
173
 
static inline int ath9k_init_debug(struct ath_softc *sc)
174
 
{
175
 
        return 0;
176
 
}
177
 
 
178
 
static inline void ath9k_exit_debug(struct ath_softc *sc)
179
 
{
180
 
}
181
 
 
182
 
static inline int ath9k_debug_create_root(void)
183
 
{
184
 
        return 0;
185
 
}
186
 
 
187
 
static inline void ath9k_debug_remove_root(void)
188
 
{
 
175
static inline int ath9k_init_debug(struct ath_hw *ah)
 
176
{
 
177
        return 0;
189
178
}
190
179
 
191
180
static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
193
182
{
194
183
}
195
184
 
196
 
static inline void ath_debug_stat_rc(struct ath_softc *sc,
197
 
                                     struct sk_buff *skb)
198
 
{
199
 
}
200
 
 
201
185
static inline void ath_debug_stat_tx(struct ath_softc *sc,
202
 
                                     struct ath_txq *txq,
203
 
                                     struct ath_buf *bf)
204
 
{
205
 
}
206
 
 
207
 
static inline void ath_debug_stat_retries(struct ath_softc *sc, int rix,
208
 
                                          int xretries, int retries, u8 per)
209
 
{
210
 
}
211
 
 
212
 
#endif /* CONFIG_ATH9K_DEBUG */
 
186
                                     struct ath_buf *bf,
 
187
                                     struct ath_tx_status *ts)
 
188
{
 
189
}
 
190
 
 
191
static inline void ath_debug_stat_rx(struct ath_softc *sc,
 
192
                                     struct ath_rx_status *rs)
 
193
{
 
194
}
 
195
 
 
196
#endif /* CONFIG_ATH9K_DEBUGFS */
213
197
 
214
198
#endif /* DEBUG_H */