diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 86 |
1 files changed, 47 insertions, 39 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index ab7264c1d8f7..780ff1bee6f6 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -135,46 +135,45 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf, | |||
135 | struct ath_softc *sc = file->private_data; | 135 | struct ath_softc *sc = file->private_data; |
136 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 136 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
137 | struct ath_hw *ah = sc->sc_ah; | 137 | struct ath_hw *ah = sc->sc_ah; |
138 | unsigned int len = 0, size = 1024; | 138 | unsigned int len = 0; |
139 | const unsigned int size = 1024; | ||
139 | ssize_t retval = 0; | 140 | ssize_t retval = 0; |
140 | char *buf; | 141 | char *buf; |
142 | int i; | ||
143 | struct { | ||
144 | const char *name; | ||
145 | unsigned int val; | ||
146 | } ani_info[] = { | ||
147 | { "ANI RESET", ah->stats.ast_ani_reset }, | ||
148 | { "OFDM LEVEL", ah->ani.ofdmNoiseImmunityLevel }, | ||
149 | { "CCK LEVEL", ah->ani.cckNoiseImmunityLevel }, | ||
150 | { "SPUR UP", ah->stats.ast_ani_spurup }, | ||
151 | { "SPUR DOWN", ah->stats.ast_ani_spurup }, | ||
152 | { "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon }, | ||
153 | { "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff }, | ||
154 | { "MRC-CCK ON", ah->stats.ast_ani_ccklow }, | ||
155 | { "MRC-CCK OFF", ah->stats.ast_ani_cckhigh }, | ||
156 | { "FIR-STEP UP", ah->stats.ast_ani_stepup }, | ||
157 | { "FIR-STEP DOWN", ah->stats.ast_ani_stepdown }, | ||
158 | { "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero }, | ||
159 | { "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs }, | ||
160 | { "CCK ERRORS", ah->stats.ast_ani_cckerrs }, | ||
161 | }; | ||
141 | 162 | ||
142 | buf = kzalloc(size, GFP_KERNEL); | 163 | buf = kzalloc(size, GFP_KERNEL); |
143 | if (buf == NULL) | 164 | if (buf == NULL) |
144 | return -ENOMEM; | 165 | return -ENOMEM; |
145 | 166 | ||
146 | if (common->disable_ani) { | 167 | len += scnprintf(buf + len, size - len, "%15s: %s\n", "ANI", |
147 | len += scnprintf(buf + len, size - len, "%s: %s\n", | 168 | common->disable_ani ? "DISABLED" : "ENABLED"); |
148 | "ANI", "DISABLED"); | 169 | |
170 | if (common->disable_ani) | ||
149 | goto exit; | 171 | goto exit; |
150 | } | ||
151 | 172 | ||
152 | len += scnprintf(buf + len, size - len, "%15s: %s\n", | 173 | for (i = 0; i < ARRAY_SIZE(ani_info); i++) |
153 | "ANI", "ENABLED"); | 174 | len += scnprintf(buf + len, size - len, "%15s: %u\n", |
154 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | 175 | ani_info[i].name, ani_info[i].val); |
155 | "ANI RESET", ah->stats.ast_ani_reset); | 176 | |
156 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
157 | "SPUR UP", ah->stats.ast_ani_spurup); | ||
158 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
159 | "SPUR DOWN", ah->stats.ast_ani_spurup); | ||
160 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
161 | "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon); | ||
162 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
163 | "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff); | ||
164 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
165 | "MRC-CCK ON", ah->stats.ast_ani_ccklow); | ||
166 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
167 | "MRC-CCK OFF", ah->stats.ast_ani_cckhigh); | ||
168 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
169 | "FIR-STEP UP", ah->stats.ast_ani_stepup); | ||
170 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
171 | "FIR-STEP DOWN", ah->stats.ast_ani_stepdown); | ||
172 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
173 | "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero); | ||
174 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
175 | "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs); | ||
176 | len += scnprintf(buf + len, size - len, "%15s: %u\n", | ||
177 | "CCK ERRORS", ah->stats.ast_ani_cckerrs); | ||
178 | exit: | 177 | exit: |
179 | if (len > size) | 178 | if (len > size) |
180 | len = size; | 179 | len = size; |
@@ -209,7 +208,7 @@ static ssize_t write_file_ani(struct file *file, | |||
209 | common->disable_ani = !ani; | 208 | common->disable_ani = !ani; |
210 | 209 | ||
211 | if (common->disable_ani) { | 210 | if (common->disable_ani) { |
212 | clear_bit(SC_OP_ANI_RUN, &sc->sc_flags); | 211 | clear_bit(ATH_OP_ANI_RUN, &common->op_flags); |
213 | ath_stop_ani(sc); | 212 | ath_stop_ani(sc); |
214 | } else { | 213 | } else { |
215 | ath_check_ani(sc); | 214 | ath_check_ani(sc); |
@@ -307,13 +306,13 @@ static ssize_t read_file_antenna_diversity(struct file *file, | |||
307 | struct ath_antenna_stats *as_main = &sc->debug.stats.ant_stats[ANT_MAIN]; | 306 | struct ath_antenna_stats *as_main = &sc->debug.stats.ant_stats[ANT_MAIN]; |
308 | struct ath_antenna_stats *as_alt = &sc->debug.stats.ant_stats[ANT_ALT]; | 307 | struct ath_antenna_stats *as_alt = &sc->debug.stats.ant_stats[ANT_ALT]; |
309 | struct ath_hw_antcomb_conf div_ant_conf; | 308 | struct ath_hw_antcomb_conf div_ant_conf; |
310 | unsigned int len = 0, size = 1024; | 309 | unsigned int len = 0; |
310 | const unsigned int size = 1024; | ||
311 | ssize_t retval = 0; | 311 | ssize_t retval = 0; |
312 | char *buf; | 312 | char *buf; |
313 | char *lna_conf_str[4] = {"LNA1_MINUS_LNA2", | 313 | static const char *lna_conf_str[4] = { |
314 | "LNA2", | 314 | "LNA1_MINUS_LNA2", "LNA2", "LNA1", "LNA1_PLUS_LNA2" |
315 | "LNA1", | 315 | }; |
316 | "LNA1_PLUS_LNA2"}; | ||
317 | 316 | ||
318 | buf = kzalloc(size, GFP_KERNEL); | 317 | buf = kzalloc(size, GFP_KERNEL); |
319 | if (buf == NULL) | 318 | if (buf == NULL) |
@@ -716,10 +715,13 @@ static ssize_t read_file_queues(struct file *file, char __user *user_buf, | |||
716 | struct ath_softc *sc = file->private_data; | 715 | struct ath_softc *sc = file->private_data; |
717 | struct ath_txq *txq; | 716 | struct ath_txq *txq; |
718 | char *buf; | 717 | char *buf; |
719 | unsigned int len = 0, size = 1024; | 718 | unsigned int len = 0; |
719 | const unsigned int size = 1024; | ||
720 | ssize_t retval = 0; | 720 | ssize_t retval = 0; |
721 | int i; | 721 | int i; |
722 | char *qname[4] = {"VO", "VI", "BE", "BK"}; | 722 | static const char *qname[4] = { |
723 | "VO", "VI", "BE", "BK" | ||
724 | }; | ||
723 | 725 | ||
724 | buf = kzalloc(size, GFP_KERNEL); | 726 | buf = kzalloc(size, GFP_KERNEL); |
725 | if (buf == NULL) | 727 | if (buf == NULL) |
@@ -866,6 +868,12 @@ static ssize_t read_file_reset(struct file *file, char __user *user_buf, | |||
866 | "%17s: %2d\n", "PLL RX Hang", | 868 | "%17s: %2d\n", "PLL RX Hang", |
867 | sc->debug.stats.reset[RESET_TYPE_PLL_HANG]); | 869 | sc->debug.stats.reset[RESET_TYPE_PLL_HANG]); |
868 | len += scnprintf(buf + len, sizeof(buf) - len, | 870 | len += scnprintf(buf + len, sizeof(buf) - len, |
871 | "%17s: %2d\n", "MAC Hang", | ||
872 | sc->debug.stats.reset[RESET_TYPE_MAC_HANG]); | ||
873 | len += scnprintf(buf + len, sizeof(buf) - len, | ||
874 | "%17s: %2d\n", "Stuck Beacon", | ||
875 | sc->debug.stats.reset[RESET_TYPE_BEACON_STUCK]); | ||
876 | len += scnprintf(buf + len, sizeof(buf) - len, | ||
869 | "%17s: %2d\n", "MCI Reset", | 877 | "%17s: %2d\n", "MCI Reset", |
870 | sc->debug.stats.reset[RESET_TYPE_MCI]); | 878 | sc->debug.stats.reset[RESET_TYPE_MCI]); |
871 | 879 | ||