2 * Copyright (c) 2008-2009 Atheros Communications Inc.
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.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #include <linux/slab.h>
18 #include <linux/vmalloc.h>
19 #include <asm/unaligned.h>
23 #define REG_WRITE_D(_ah, _reg, _val) \
24 ath9k_hw_common(_ah)->ops->write((_ah), (_val), (_reg))
25 #define REG_READ_D(_ah, _reg) \
26 ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
28 static int ath9k_debugfs_open(struct inode
*inode
, struct file
*file
)
30 file
->private_data
= inode
->i_private
;
34 static ssize_t
ath9k_debugfs_read_buf(struct file
*file
, char __user
*user_buf
,
35 size_t count
, loff_t
*ppos
)
37 u8
*buf
= file
->private_data
;
38 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, strlen(buf
));
41 static int ath9k_debugfs_release_buf(struct inode
*inode
, struct file
*file
)
43 vfree(file
->private_data
);
47 #ifdef CONFIG_ATH_DEBUG
49 static ssize_t
read_file_debug(struct file
*file
, char __user
*user_buf
,
50 size_t count
, loff_t
*ppos
)
52 struct ath_softc
*sc
= file
->private_data
;
53 struct ath_common
*common
= ath9k_hw_common(sc
->sc_ah
);
57 len
= sprintf(buf
, "0x%08x\n", common
->debug_mask
);
58 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
61 static ssize_t
write_file_debug(struct file
*file
, const char __user
*user_buf
,
62 size_t count
, loff_t
*ppos
)
64 struct ath_softc
*sc
= file
->private_data
;
65 struct ath_common
*common
= ath9k_hw_common(sc
->sc_ah
);
70 len
= min(count
, sizeof(buf
) - 1);
71 if (copy_from_user(buf
, user_buf
, len
))
75 if (strict_strtoul(buf
, 0, &mask
))
78 common
->debug_mask
= mask
;
82 static const struct file_operations fops_debug
= {
83 .read
= read_file_debug
,
84 .write
= write_file_debug
,
85 .open
= ath9k_debugfs_open
,
87 .llseek
= default_llseek
,
92 #define DMA_BUF_LEN 1024
94 static ssize_t
read_file_tx_chainmask(struct file
*file
, char __user
*user_buf
,
95 size_t count
, loff_t
*ppos
)
97 struct ath_softc
*sc
= file
->private_data
;
98 struct ath_common
*common
= ath9k_hw_common(sc
->sc_ah
);
102 len
= sprintf(buf
, "0x%08x\n", common
->tx_chainmask
);
103 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
106 static ssize_t
write_file_tx_chainmask(struct file
*file
, const char __user
*user_buf
,
107 size_t count
, loff_t
*ppos
)
109 struct ath_softc
*sc
= file
->private_data
;
110 struct ath_common
*common
= ath9k_hw_common(sc
->sc_ah
);
115 len
= min(count
, sizeof(buf
) - 1);
116 if (copy_from_user(buf
, user_buf
, len
))
120 if (strict_strtoul(buf
, 0, &mask
))
123 common
->tx_chainmask
= mask
;
124 sc
->sc_ah
->caps
.tx_chainmask
= mask
;
128 static const struct file_operations fops_tx_chainmask
= {
129 .read
= read_file_tx_chainmask
,
130 .write
= write_file_tx_chainmask
,
131 .open
= ath9k_debugfs_open
,
132 .owner
= THIS_MODULE
,
133 .llseek
= default_llseek
,
137 static ssize_t
read_file_rx_chainmask(struct file
*file
, char __user
*user_buf
,
138 size_t count
, loff_t
*ppos
)
140 struct ath_softc
*sc
= file
->private_data
;
141 struct ath_common
*common
= ath9k_hw_common(sc
->sc_ah
);
145 len
= sprintf(buf
, "0x%08x\n", common
->rx_chainmask
);
146 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
149 static ssize_t
write_file_rx_chainmask(struct file
*file
, const char __user
*user_buf
,
150 size_t count
, loff_t
*ppos
)
152 struct ath_softc
*sc
= file
->private_data
;
153 struct ath_common
*common
= ath9k_hw_common(sc
->sc_ah
);
158 len
= min(count
, sizeof(buf
) - 1);
159 if (copy_from_user(buf
, user_buf
, len
))
163 if (strict_strtoul(buf
, 0, &mask
))
166 common
->rx_chainmask
= mask
;
167 sc
->sc_ah
->caps
.rx_chainmask
= mask
;
171 static const struct file_operations fops_rx_chainmask
= {
172 .read
= read_file_rx_chainmask
,
173 .write
= write_file_rx_chainmask
,
174 .open
= ath9k_debugfs_open
,
175 .owner
= THIS_MODULE
,
176 .llseek
= default_llseek
,
180 static ssize_t
read_file_dma(struct file
*file
, char __user
*user_buf
,
181 size_t count
, loff_t
*ppos
)
183 struct ath_softc
*sc
= file
->private_data
;
184 struct ath_hw
*ah
= sc
->sc_ah
;
187 unsigned int len
= 0;
188 u32 val
[ATH9K_NUM_DMA_DEBUG_REGS
];
189 int i
, qcuOffset
= 0, dcuOffset
= 0;
190 u32
*qcuBase
= &val
[0], *dcuBase
= &val
[4];
192 buf
= kmalloc(DMA_BUF_LEN
, GFP_KERNEL
);
198 REG_WRITE_D(ah
, AR_MACMISC
,
199 ((AR_MACMISC_DMA_OBS_LINE_8
<< AR_MACMISC_DMA_OBS_S
) |
200 (AR_MACMISC_MISC_OBS_BUS_1
<<
201 AR_MACMISC_MISC_OBS_BUS_MSB_S
)));
203 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
204 "Raw DMA Debug values:\n");
206 for (i
= 0; i
< ATH9K_NUM_DMA_DEBUG_REGS
; i
++) {
208 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
, "\n");
210 val
[i
] = REG_READ_D(ah
, AR_DMADBG_0
+ (i
* sizeof(u32
)));
211 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
, "%d: %08x ",
215 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
, "\n\n");
216 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
217 "Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n");
219 for (i
= 0; i
< ATH9K_NUM_QUEUES
; i
++, qcuOffset
+= 4, dcuOffset
+= 5) {
230 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
231 "%2d %2x %1x %2x %2x\n",
232 i
, (*qcuBase
& (0x7 << qcuOffset
)) >> qcuOffset
,
233 (*qcuBase
& (0x8 << qcuOffset
)) >> (qcuOffset
+ 3),
234 val
[2] & (0x7 << (i
* 3)) >> (i
* 3),
235 (*dcuBase
& (0x1f << dcuOffset
)) >> dcuOffset
);
238 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
, "\n");
240 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
241 "qcu_stitch state: %2x qcu_fetch state: %2x\n",
242 (val
[3] & 0x003c0000) >> 18, (val
[3] & 0x03c00000) >> 22);
243 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
244 "qcu_complete state: %2x dcu_complete state: %2x\n",
245 (val
[3] & 0x1c000000) >> 26, (val
[6] & 0x3));
246 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
247 "dcu_arb state: %2x dcu_fp state: %2x\n",
248 (val
[5] & 0x06000000) >> 25, (val
[5] & 0x38000000) >> 27);
249 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
250 "chan_idle_dur: %3d chan_idle_dur_valid: %1d\n",
251 (val
[6] & 0x000003fc) >> 2, (val
[6] & 0x00000400) >> 10);
252 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
253 "txfifo_valid_0: %1d txfifo_valid_1: %1d\n",
254 (val
[6] & 0x00000800) >> 11, (val
[6] & 0x00001000) >> 12);
255 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
256 "txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n",
257 (val
[6] & 0x0001e000) >> 13, (val
[6] & 0x001e0000) >> 17);
259 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
, "pcu observe: 0x%x\n",
260 REG_READ_D(ah
, AR_OBS_BUS_1
));
261 len
+= snprintf(buf
+ len
, DMA_BUF_LEN
- len
,
262 "AR_CR: 0x%x\n", REG_READ_D(ah
, AR_CR
));
264 ath9k_ps_restore(sc
);
266 if (len
> DMA_BUF_LEN
)
269 retval
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
274 static const struct file_operations fops_dma
= {
275 .read
= read_file_dma
,
276 .open
= ath9k_debugfs_open
,
277 .owner
= THIS_MODULE
,
278 .llseek
= default_llseek
,
282 void ath_debug_stat_interrupt(struct ath_softc
*sc
, enum ath9k_int status
)
285 sc
->debug
.stats
.istats
.total
++;
286 if (sc
->sc_ah
->caps
.hw_caps
& ATH9K_HW_CAP_EDMA
) {
287 if (status
& ATH9K_INT_RXLP
)
288 sc
->debug
.stats
.istats
.rxlp
++;
289 if (status
& ATH9K_INT_RXHP
)
290 sc
->debug
.stats
.istats
.rxhp
++;
291 if (status
& ATH9K_INT_BB_WATCHDOG
)
292 sc
->debug
.stats
.istats
.bb_watchdog
++;
294 if (status
& ATH9K_INT_RX
)
295 sc
->debug
.stats
.istats
.rxok
++;
297 if (status
& ATH9K_INT_RXEOL
)
298 sc
->debug
.stats
.istats
.rxeol
++;
299 if (status
& ATH9K_INT_RXORN
)
300 sc
->debug
.stats
.istats
.rxorn
++;
301 if (status
& ATH9K_INT_TX
)
302 sc
->debug
.stats
.istats
.txok
++;
303 if (status
& ATH9K_INT_TXURN
)
304 sc
->debug
.stats
.istats
.txurn
++;
305 if (status
& ATH9K_INT_MIB
)
306 sc
->debug
.stats
.istats
.mib
++;
307 if (status
& ATH9K_INT_RXPHY
)
308 sc
->debug
.stats
.istats
.rxphyerr
++;
309 if (status
& ATH9K_INT_RXKCM
)
310 sc
->debug
.stats
.istats
.rx_keycache_miss
++;
311 if (status
& ATH9K_INT_SWBA
)
312 sc
->debug
.stats
.istats
.swba
++;
313 if (status
& ATH9K_INT_BMISS
)
314 sc
->debug
.stats
.istats
.bmiss
++;
315 if (status
& ATH9K_INT_BNR
)
316 sc
->debug
.stats
.istats
.bnr
++;
317 if (status
& ATH9K_INT_CST
)
318 sc
->debug
.stats
.istats
.cst
++;
319 if (status
& ATH9K_INT_GTT
)
320 sc
->debug
.stats
.istats
.gtt
++;
321 if (status
& ATH9K_INT_TIM
)
322 sc
->debug
.stats
.istats
.tim
++;
323 if (status
& ATH9K_INT_CABEND
)
324 sc
->debug
.stats
.istats
.cabend
++;
325 if (status
& ATH9K_INT_DTIMSYNC
)
326 sc
->debug
.stats
.istats
.dtimsync
++;
327 if (status
& ATH9K_INT_DTIM
)
328 sc
->debug
.stats
.istats
.dtim
++;
331 static ssize_t
read_file_interrupt(struct file
*file
, char __user
*user_buf
,
332 size_t count
, loff_t
*ppos
)
334 struct ath_softc
*sc
= file
->private_data
;
336 unsigned int len
= 0;
338 if (sc
->sc_ah
->caps
.hw_caps
& ATH9K_HW_CAP_EDMA
) {
339 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
340 "%8s: %10u\n", "RXLP", sc
->debug
.stats
.istats
.rxlp
);
341 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
342 "%8s: %10u\n", "RXHP", sc
->debug
.stats
.istats
.rxhp
);
343 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
344 "%8s: %10u\n", "WATCHDOG",
345 sc
->debug
.stats
.istats
.bb_watchdog
);
347 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
348 "%8s: %10u\n", "RX", sc
->debug
.stats
.istats
.rxok
);
350 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
351 "%8s: %10u\n", "RXEOL", sc
->debug
.stats
.istats
.rxeol
);
352 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
353 "%8s: %10u\n", "RXORN", sc
->debug
.stats
.istats
.rxorn
);
354 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
355 "%8s: %10u\n", "TX", sc
->debug
.stats
.istats
.txok
);
356 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
357 "%8s: %10u\n", "TXURN", sc
->debug
.stats
.istats
.txurn
);
358 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
359 "%8s: %10u\n", "MIB", sc
->debug
.stats
.istats
.mib
);
360 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
361 "%8s: %10u\n", "RXPHY", sc
->debug
.stats
.istats
.rxphyerr
);
362 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
363 "%8s: %10u\n", "RXKCM", sc
->debug
.stats
.istats
.rx_keycache_miss
);
364 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
365 "%8s: %10u\n", "SWBA", sc
->debug
.stats
.istats
.swba
);
366 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
367 "%8s: %10u\n", "BMISS", sc
->debug
.stats
.istats
.bmiss
);
368 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
369 "%8s: %10u\n", "BNR", sc
->debug
.stats
.istats
.bnr
);
370 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
371 "%8s: %10u\n", "CST", sc
->debug
.stats
.istats
.cst
);
372 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
373 "%8s: %10u\n", "GTT", sc
->debug
.stats
.istats
.gtt
);
374 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
375 "%8s: %10u\n", "TIM", sc
->debug
.stats
.istats
.tim
);
376 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
377 "%8s: %10u\n", "CABEND", sc
->debug
.stats
.istats
.cabend
);
378 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
379 "%8s: %10u\n", "DTIMSYNC", sc
->debug
.stats
.istats
.dtimsync
);
380 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
381 "%8s: %10u\n", "DTIM", sc
->debug
.stats
.istats
.dtim
);
382 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
383 "%8s: %10u\n", "TOTAL", sc
->debug
.stats
.istats
.total
);
385 if (len
> sizeof(buf
))
388 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
391 static const struct file_operations fops_interrupt
= {
392 .read
= read_file_interrupt
,
393 .open
= ath9k_debugfs_open
,
394 .owner
= THIS_MODULE
,
395 .llseek
= default_llseek
,
398 static const char *channel_type_str(enum nl80211_channel_type t
)
401 case NL80211_CHAN_NO_HT
:
403 case NL80211_CHAN_HT20
:
405 case NL80211_CHAN_HT40MINUS
:
407 case NL80211_CHAN_HT40PLUS
:
414 static ssize_t
read_file_wiphy(struct file
*file
, char __user
*user_buf
,
415 size_t count
, loff_t
*ppos
)
417 struct ath_softc
*sc
= file
->private_data
;
418 struct ieee80211_channel
*chan
= sc
->hw
->conf
.channel
;
419 struct ieee80211_conf
*conf
= &(sc
->hw
->conf
);
421 unsigned int len
= 0;
425 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
426 "%s (chan=%d center-freq: %d MHz channel-type: %d (%s))\n",
427 wiphy_name(sc
->hw
->wiphy
),
428 ieee80211_frequency_to_channel(chan
->center_freq
),
431 channel_type_str(conf
->channel_type
));
433 put_unaligned_le32(REG_READ_D(sc
->sc_ah
, AR_STA_ID0
), addr
);
434 put_unaligned_le16(REG_READ_D(sc
->sc_ah
, AR_STA_ID1
) & 0xffff, addr
+ 4);
435 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
436 "addr: %pM\n", addr
);
437 put_unaligned_le32(REG_READ_D(sc
->sc_ah
, AR_BSSMSKL
), addr
);
438 put_unaligned_le16(REG_READ_D(sc
->sc_ah
, AR_BSSMSKU
) & 0xffff, addr
+ 4);
439 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
440 "addrmask: %pM\n", addr
);
441 tmp
= ath9k_hw_getrxfilter(sc
->sc_ah
);
442 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
,
444 if (tmp
& ATH9K_RX_FILTER_UCAST
)
445 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " UCAST");
446 if (tmp
& ATH9K_RX_FILTER_MCAST
)
447 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " MCAST");
448 if (tmp
& ATH9K_RX_FILTER_BCAST
)
449 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " BCAST");
450 if (tmp
& ATH9K_RX_FILTER_CONTROL
)
451 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " CONTROL");
452 if (tmp
& ATH9K_RX_FILTER_BEACON
)
453 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " BEACON");
454 if (tmp
& ATH9K_RX_FILTER_PROM
)
455 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " PROM");
456 if (tmp
& ATH9K_RX_FILTER_PROBEREQ
)
457 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " PROBEREQ");
458 if (tmp
& ATH9K_RX_FILTER_PHYERR
)
459 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " PHYERR");
460 if (tmp
& ATH9K_RX_FILTER_MYBEACON
)
461 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " MYBEACON");
462 if (tmp
& ATH9K_RX_FILTER_COMP_BAR
)
463 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " COMP_BAR");
464 if (tmp
& ATH9K_RX_FILTER_PSPOLL
)
465 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " PSPOLL");
466 if (tmp
& ATH9K_RX_FILTER_PHYRADAR
)
467 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " PHYRADAR");
468 if (tmp
& ATH9K_RX_FILTER_MCAST_BCAST_ALL
)
469 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, " MCAST_BCAST_ALL\n");
471 len
+= snprintf(buf
+ len
, sizeof(buf
) - len
, "\n");
473 if (len
> sizeof(buf
))
476 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
479 static const struct file_operations fops_wiphy
= {
480 .read
= read_file_wiphy
,
481 .open
= ath9k_debugfs_open
,
482 .owner
= THIS_MODULE
,
483 .llseek
= default_llseek
,
486 #define PR_QNUM(_n) sc->tx.txq_map[_n]->axq_qnum
487 #define PR(str, elem) \
489 len += snprintf(buf + len, size - len, \
490 "%s%13u%11u%10u%10u\n", str, \
491 sc->debug.stats.txstats[PR_QNUM(WME_AC_BE)].elem, \
492 sc->debug.stats.txstats[PR_QNUM(WME_AC_BK)].elem, \
493 sc->debug.stats.txstats[PR_QNUM(WME_AC_VI)].elem, \
494 sc->debug.stats.txstats[PR_QNUM(WME_AC_VO)].elem); \
499 #define PRX(str, elem) \
501 len += snprintf(buf + len, size - len, \
502 "%s%13u%11u%10u%10u\n", str, \
503 (unsigned int)(sc->tx.txq_map[WME_AC_BE]->elem), \
504 (unsigned int)(sc->tx.txq_map[WME_AC_BK]->elem), \
505 (unsigned int)(sc->tx.txq_map[WME_AC_VI]->elem), \
506 (unsigned int)(sc->tx.txq_map[WME_AC_VO]->elem)); \
511 #define PRQLE(str, elem) \
513 len += snprintf(buf + len, size - len, \
514 "%s%13i%11i%10i%10i\n", str, \
515 list_empty(&sc->tx.txq_map[WME_AC_BE]->elem), \
516 list_empty(&sc->tx.txq_map[WME_AC_BK]->elem), \
517 list_empty(&sc->tx.txq_map[WME_AC_VI]->elem), \
518 list_empty(&sc->tx.txq_map[WME_AC_VO]->elem)); \
523 static ssize_t
read_file_xmit(struct file
*file
, char __user
*user_buf
,
524 size_t count
, loff_t
*ppos
)
526 struct ath_softc
*sc
= file
->private_data
;
528 unsigned int len
= 0, size
= 8000;
533 buf
= kzalloc(size
, GFP_KERNEL
);
537 len
+= sprintf(buf
, "Num-Tx-Queues: %i tx-queues-setup: 0x%x"
538 " poll-work-seen: %u\n"
539 "%30s %10s%10s%10s\n\n",
540 ATH9K_NUM_TX_QUEUES
, sc
->tx
.txqsetup
,
541 sc
->tx_complete_poll_work_seen
,
542 "BE", "BK", "VI", "VO");
544 PR("MPDUs Queued: ", queued
);
545 PR("MPDUs Completed: ", completed
);
546 PR("Aggregates: ", a_aggr
);
547 PR("AMPDUs Queued HW:", a_queued_hw
);
548 PR("AMPDUs Queued SW:", a_queued_sw
);
549 PR("AMPDUs Completed:", a_completed
);
550 PR("AMPDUs Retried: ", a_retries
);
551 PR("AMPDUs XRetried: ", a_xretries
);
552 PR("FIFO Underrun: ", fifo_underrun
);
553 PR("TXOP Exceeded: ", xtxop
);
554 PR("TXTIMER Expiry: ", timer_exp
);
555 PR("DESC CFG Error: ", desc_cfg_err
);
556 PR("DATA Underrun: ", data_underrun
);
557 PR("DELIM Underrun: ", delim_underrun
);
558 PR("TX-Pkts-All: ", tx_pkts_all
);
559 PR("TX-Bytes-All: ", tx_bytes_all
);
560 PR("hw-put-tx-buf: ", puttxbuf
);
561 PR("hw-tx-start: ", txstart
);
562 PR("hw-tx-proc-desc: ", txprocdesc
);
563 len
+= snprintf(buf
+ len
, size
- len
,
564 "%s%11p%11p%10p%10p\n", "txq-memory-address:",
565 sc
->tx
.txq_map
[WME_AC_BE
],
566 sc
->tx
.txq_map
[WME_AC_BK
],
567 sc
->tx
.txq_map
[WME_AC_VI
],
568 sc
->tx
.txq_map
[WME_AC_VO
]);
572 PRX("axq-qnum: ", axq_qnum
);
573 PRX("axq-depth: ", axq_depth
);
574 PRX("axq-ampdu_depth: ", axq_ampdu_depth
);
575 PRX("axq-stopped ", stopped
);
576 PRX("tx-in-progress ", axq_tx_inprogress
);
577 PRX("pending-frames ", pending_frames
);
578 PRX("txq_headidx: ", txq_headidx
);
579 PRX("txq_tailidx: ", txq_headidx
);
581 PRQLE("axq_q empty: ", axq_q
);
582 PRQLE("axq_acq empty: ", axq_acq
);
583 PRQLE("txq_fifo_pending: ", txq_fifo_pending
);
584 for (i
= 0; i
< ATH_TXFIFO_DEPTH
; i
++) {
585 snprintf(tmp
, sizeof(tmp
) - 1, "txq_fifo[%i] empty: ", i
);
586 PRQLE(tmp
, txq_fifo
[i
]);
589 /* Print out more detailed queue-info */
590 for (i
= 0; i
<= WME_AC_BK
; i
++) {
591 struct ath_txq
*txq
= &(sc
->tx
.txq
[i
]);
592 struct ath_atx_ac
*ac
;
593 struct ath_atx_tid
*tid
;
596 spin_lock_bh(&txq
->axq_lock
);
597 if (!list_empty(&txq
->axq_acq
)) {
598 ac
= list_first_entry(&txq
->axq_acq
, struct ath_atx_ac
,
600 len
+= snprintf(buf
+ len
, size
- len
,
601 "txq[%i] first-ac: %p sched: %i\n",
603 if (list_empty(&ac
->tid_q
) || (len
>= size
))
605 tid
= list_first_entry(&ac
->tid_q
, struct ath_atx_tid
,
607 len
+= snprintf(buf
+ len
, size
- len
,
608 " first-tid: %p sched: %i paused: %i\n",
609 tid
, tid
->sched
, tid
->paused
);
612 spin_unlock_bh(&txq
->axq_lock
);
619 retval
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
625 static ssize_t
read_file_stations(struct file
*file
, char __user
*user_buf
,
626 size_t count
, loff_t
*ppos
)
628 struct ath_softc
*sc
= file
->private_data
;
630 unsigned int len
= 0, size
= 64000;
631 struct ath_node
*an
= NULL
;
635 buf
= kzalloc(size
, GFP_KERNEL
);
639 len
+= snprintf(buf
+ len
, size
- len
,
641 " tid: addr sched paused buf_q-empty an ac\n"
642 " ac: addr sched tid_q-empty txq\n");
644 spin_lock(&sc
->nodes_lock
);
645 list_for_each_entry(an
, &sc
->nodes
, list
) {
646 len
+= snprintf(buf
+ len
, size
- len
,
647 "%pM\n", an
->sta
->addr
);
651 for (q
= 0; q
< WME_NUM_TID
; q
++) {
652 struct ath_atx_tid
*tid
= &(an
->tid
[q
]);
653 len
+= snprintf(buf
+ len
, size
- len
,
654 " tid: %p %s %s %i %p %p\n",
655 tid
, tid
->sched
? "sched" : "idle",
656 tid
->paused
? "paused" : "running",
657 list_empty(&tid
->buf_q
),
663 for (q
= 0; q
< WME_NUM_AC
; q
++) {
664 struct ath_atx_ac
*ac
= &(an
->ac
[q
]);
665 len
+= snprintf(buf
+ len
, size
- len
,
666 " ac: %p %s %i %p\n",
667 ac
, ac
->sched
? "sched" : "idle",
668 list_empty(&ac
->tid_q
), ac
->txq
);
675 spin_unlock(&sc
->nodes_lock
);
679 retval
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
685 static ssize_t
read_file_misc(struct file
*file
, char __user
*user_buf
,
686 size_t count
, loff_t
*ppos
)
688 struct ath_softc
*sc
= file
->private_data
;
689 struct ath_common
*common
= ath9k_hw_common(sc
->sc_ah
);
690 struct ath_hw
*ah
= sc
->sc_ah
;
691 struct ieee80211_hw
*hw
= sc
->hw
;
693 unsigned int len
= 0, size
= 8000;
697 struct ath9k_vif_iter_data iter_data
;
699 ath9k_calculate_iter_data(hw
, NULL
, &iter_data
);
701 buf
= kzalloc(size
, GFP_KERNEL
);
705 switch (sc
->sc_ah
->opmode
) {
706 case NL80211_IFTYPE_ADHOC
:
709 case NL80211_IFTYPE_MESH_POINT
:
712 case NL80211_IFTYPE_AP
:
715 case NL80211_IFTYPE_STATION
:
723 len
+= snprintf(buf
+ len
, size
- len
,
726 "Beacon-Timer-Register: 0x%x\n",
728 tmp
, (int)(sc
->sc_ah
->opmode
),
729 REG_READ(ah
, AR_BEACON_PERIOD
));
731 reg
= REG_READ(ah
, AR_TIMER_MODE
);
732 len
+= snprintf(buf
+ len
, size
- len
, "Timer-Mode-Register: 0x%x (",
734 if (reg
& AR_TBTT_TIMER_EN
)
735 len
+= snprintf(buf
+ len
, size
- len
, "TBTT ");
736 if (reg
& AR_DBA_TIMER_EN
)
737 len
+= snprintf(buf
+ len
, size
- len
, "DBA ");
738 if (reg
& AR_SWBA_TIMER_EN
)
739 len
+= snprintf(buf
+ len
, size
- len
, "SWBA ");
740 if (reg
& AR_HCF_TIMER_EN
)
741 len
+= snprintf(buf
+ len
, size
- len
, "HCF ");
742 if (reg
& AR_TIM_TIMER_EN
)
743 len
+= snprintf(buf
+ len
, size
- len
, "TIM ");
744 if (reg
& AR_DTIM_TIMER_EN
)
745 len
+= snprintf(buf
+ len
, size
- len
, "DTIM ");
746 len
+= snprintf(buf
+ len
, size
- len
, ")\n");
748 reg
= sc
->sc_ah
->imask
;
749 len
+= snprintf(buf
+ len
, size
- len
, "imask: 0x%x (", reg
);
750 if (reg
& ATH9K_INT_SWBA
)
751 len
+= snprintf(buf
+ len
, size
- len
, "SWBA ");
752 if (reg
& ATH9K_INT_BMISS
)
753 len
+= snprintf(buf
+ len
, size
- len
, "BMISS ");
754 if (reg
& ATH9K_INT_CST
)
755 len
+= snprintf(buf
+ len
, size
- len
, "CST ");
756 if (reg
& ATH9K_INT_RX
)
757 len
+= snprintf(buf
+ len
, size
- len
, "RX ");
758 if (reg
& ATH9K_INT_RXHP
)
759 len
+= snprintf(buf
+ len
, size
- len
, "RXHP ");
760 if (reg
& ATH9K_INT_RXLP
)
761 len
+= snprintf(buf
+ len
, size
- len
, "RXLP ");
762 if (reg
& ATH9K_INT_BB_WATCHDOG
)
763 len
+= snprintf(buf
+ len
, size
- len
, "BB_WATCHDOG ");
764 /* there are other IRQs if one wanted to add them. */
765 len
+= snprintf(buf
+ len
, size
- len
, ")\n");
767 len
+= snprintf(buf
+ len
, size
- len
,
768 "VIF Counts: AP: %i STA: %i MESH: %i WDS: %i"
769 " ADHOC: %i OTHER: %i nvifs: %hi beacon-vifs: %hi\n",
770 iter_data
.naps
, iter_data
.nstations
, iter_data
.nmeshes
,
771 iter_data
.nwds
, iter_data
.nadhocs
, iter_data
.nothers
,
772 sc
->nvifs
, sc
->nbcnvifs
);
774 len
+= snprintf(buf
+ len
, size
- len
,
775 "Calculated-BSSID-Mask: %pM\n",
781 retval
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
787 void ath_debug_stat_tx(struct ath_softc
*sc
, struct ath_buf
*bf
,
788 struct ath_tx_status
*ts
, struct ath_txq
*txq
)
790 int qnum
= txq
->axq_qnum
;
792 TX_STAT_INC(qnum
, tx_pkts_all
);
793 sc
->debug
.stats
.txstats
[qnum
].tx_bytes_all
+= bf
->bf_mpdu
->len
;
795 if (bf_isampdu(bf
)) {
796 if (bf_isxretried(bf
))
797 TX_STAT_INC(qnum
, a_xretries
);
799 TX_STAT_INC(qnum
, a_completed
);
801 TX_STAT_INC(qnum
, completed
);
804 if (ts
->ts_status
& ATH9K_TXERR_FIFO
)
805 TX_STAT_INC(qnum
, fifo_underrun
);
806 if (ts
->ts_status
& ATH9K_TXERR_XTXOP
)
807 TX_STAT_INC(qnum
, xtxop
);
808 if (ts
->ts_status
& ATH9K_TXERR_TIMER_EXPIRED
)
809 TX_STAT_INC(qnum
, timer_exp
);
810 if (ts
->ts_flags
& ATH9K_TX_DESC_CFG_ERR
)
811 TX_STAT_INC(qnum
, desc_cfg_err
);
812 if (ts
->ts_flags
& ATH9K_TX_DATA_UNDERRUN
)
813 TX_STAT_INC(qnum
, data_underrun
);
814 if (ts
->ts_flags
& ATH9K_TX_DELIM_UNDERRUN
)
815 TX_STAT_INC(qnum
, delim_underrun
);
818 static const struct file_operations fops_xmit
= {
819 .read
= read_file_xmit
,
820 .open
= ath9k_debugfs_open
,
821 .owner
= THIS_MODULE
,
822 .llseek
= default_llseek
,
825 static const struct file_operations fops_stations
= {
826 .read
= read_file_stations
,
827 .open
= ath9k_debugfs_open
,
828 .owner
= THIS_MODULE
,
829 .llseek
= default_llseek
,
832 static const struct file_operations fops_misc
= {
833 .read
= read_file_misc
,
834 .open
= ath9k_debugfs_open
,
835 .owner
= THIS_MODULE
,
836 .llseek
= default_llseek
,
839 static ssize_t
read_file_recv(struct file
*file
, char __user
*user_buf
,
840 size_t count
, loff_t
*ppos
)
842 #define PHY_ERR(s, p) \
843 len += snprintf(buf + len, size - len, "%18s : %10u\n", s, \
844 sc->debug.stats.rxstats.phy_err_stats[p]);
846 struct ath_softc
*sc
= file
->private_data
;
848 unsigned int len
= 0, size
= 1152;
851 buf
= kzalloc(size
, GFP_KERNEL
);
855 len
+= snprintf(buf
+ len
, size
- len
,
856 "%18s : %10u\n", "CRC ERR",
857 sc
->debug
.stats
.rxstats
.crc_err
);
858 len
+= snprintf(buf
+ len
, size
- len
,
859 "%18s : %10u\n", "DECRYPT CRC ERR",
860 sc
->debug
.stats
.rxstats
.decrypt_crc_err
);
861 len
+= snprintf(buf
+ len
, size
- len
,
862 "%18s : %10u\n", "PHY ERR",
863 sc
->debug
.stats
.rxstats
.phy_err
);
864 len
+= snprintf(buf
+ len
, size
- len
,
865 "%18s : %10u\n", "MIC ERR",
866 sc
->debug
.stats
.rxstats
.mic_err
);
867 len
+= snprintf(buf
+ len
, size
- len
,
868 "%18s : %10u\n", "PRE-DELIM CRC ERR",
869 sc
->debug
.stats
.rxstats
.pre_delim_crc_err
);
870 len
+= snprintf(buf
+ len
, size
- len
,
871 "%18s : %10u\n", "POST-DELIM CRC ERR",
872 sc
->debug
.stats
.rxstats
.post_delim_crc_err
);
873 len
+= snprintf(buf
+ len
, size
- len
,
874 "%18s : %10u\n", "DECRYPT BUSY ERR",
875 sc
->debug
.stats
.rxstats
.decrypt_busy_err
);
877 PHY_ERR("UNDERRUN", ATH9K_PHYERR_UNDERRUN
);
878 PHY_ERR("TIMING", ATH9K_PHYERR_TIMING
);
879 PHY_ERR("PARITY", ATH9K_PHYERR_PARITY
);
880 PHY_ERR("RATE", ATH9K_PHYERR_RATE
);
881 PHY_ERR("LENGTH", ATH9K_PHYERR_LENGTH
);
882 PHY_ERR("RADAR", ATH9K_PHYERR_RADAR
);
883 PHY_ERR("SERVICE", ATH9K_PHYERR_SERVICE
);
884 PHY_ERR("TOR", ATH9K_PHYERR_TOR
);
885 PHY_ERR("OFDM-TIMING", ATH9K_PHYERR_OFDM_TIMING
);
886 PHY_ERR("OFDM-SIGNAL-PARITY", ATH9K_PHYERR_OFDM_SIGNAL_PARITY
);
887 PHY_ERR("OFDM-RATE", ATH9K_PHYERR_OFDM_RATE_ILLEGAL
);
888 PHY_ERR("OFDM-LENGTH", ATH9K_PHYERR_OFDM_LENGTH_ILLEGAL
);
889 PHY_ERR("OFDM-POWER-DROP", ATH9K_PHYERR_OFDM_POWER_DROP
);
890 PHY_ERR("OFDM-SERVICE", ATH9K_PHYERR_OFDM_SERVICE
);
891 PHY_ERR("OFDM-RESTART", ATH9K_PHYERR_OFDM_RESTART
);
892 PHY_ERR("FALSE-RADAR-EXT", ATH9K_PHYERR_FALSE_RADAR_EXT
);
893 PHY_ERR("CCK-TIMING", ATH9K_PHYERR_CCK_TIMING
);
894 PHY_ERR("CCK-HEADER-CRC", ATH9K_PHYERR_CCK_HEADER_CRC
);
895 PHY_ERR("CCK-RATE", ATH9K_PHYERR_CCK_RATE_ILLEGAL
);
896 PHY_ERR("CCK-SERVICE", ATH9K_PHYERR_CCK_SERVICE
);
897 PHY_ERR("CCK-RESTART", ATH9K_PHYERR_CCK_RESTART
);
898 PHY_ERR("CCK-LENGTH", ATH9K_PHYERR_CCK_LENGTH_ILLEGAL
);
899 PHY_ERR("CCK-POWER-DROP", ATH9K_PHYERR_CCK_POWER_DROP
);
900 PHY_ERR("HT-CRC", ATH9K_PHYERR_HT_CRC_ERROR
);
901 PHY_ERR("HT-LENGTH", ATH9K_PHYERR_HT_LENGTH_ILLEGAL
);
902 PHY_ERR("HT-RATE", ATH9K_PHYERR_HT_RATE_ILLEGAL
);
904 len
+= snprintf(buf
+ len
, size
- len
,
905 "%18s : %10u\n", "RX-Pkts-All",
906 sc
->debug
.stats
.rxstats
.rx_pkts_all
);
907 len
+= snprintf(buf
+ len
, size
- len
,
908 "%18s : %10u\n", "RX-Bytes-All",
909 sc
->debug
.stats
.rxstats
.rx_bytes_all
);
914 retval
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
922 void ath_debug_stat_rx(struct ath_softc
*sc
, struct ath_rx_status
*rs
)
924 #define RX_STAT_INC(c) sc->debug.stats.rxstats.c++
925 #define RX_PHY_ERR_INC(c) sc->debug.stats.rxstats.phy_err_stats[c]++
929 RX_STAT_INC(rx_pkts_all
);
930 sc
->debug
.stats
.rxstats
.rx_bytes_all
+= rs
->rs_datalen
;
932 if (rs
->rs_status
& ATH9K_RXERR_CRC
)
933 RX_STAT_INC(crc_err
);
934 if (rs
->rs_status
& ATH9K_RXERR_DECRYPT
)
935 RX_STAT_INC(decrypt_crc_err
);
936 if (rs
->rs_status
& ATH9K_RXERR_MIC
)
937 RX_STAT_INC(mic_err
);
938 if (rs
->rs_status
& ATH9K_RX_DELIM_CRC_PRE
)
939 RX_STAT_INC(pre_delim_crc_err
);
940 if (rs
->rs_status
& ATH9K_RX_DELIM_CRC_POST
)
941 RX_STAT_INC(post_delim_crc_err
);
942 if (rs
->rs_status
& ATH9K_RX_DECRYPT_BUSY
)
943 RX_STAT_INC(decrypt_busy_err
);
945 if (rs
->rs_status
& ATH9K_RXERR_PHY
) {
946 RX_STAT_INC(phy_err
);
947 phyerr
= rs
->rs_phyerr
& 0x24;
948 RX_PHY_ERR_INC(phyerr
);
952 #undef RX_PHY_ERR_INC
955 static const struct file_operations fops_recv
= {
956 .read
= read_file_recv
,
957 .open
= ath9k_debugfs_open
,
958 .owner
= THIS_MODULE
,
959 .llseek
= default_llseek
,
962 static ssize_t
read_file_regidx(struct file
*file
, char __user
*user_buf
,
963 size_t count
, loff_t
*ppos
)
965 struct ath_softc
*sc
= file
->private_data
;
969 len
= sprintf(buf
, "0x%08x\n", sc
->debug
.regidx
);
970 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
973 static ssize_t
write_file_regidx(struct file
*file
, const char __user
*user_buf
,
974 size_t count
, loff_t
*ppos
)
976 struct ath_softc
*sc
= file
->private_data
;
977 unsigned long regidx
;
981 len
= min(count
, sizeof(buf
) - 1);
982 if (copy_from_user(buf
, user_buf
, len
))
986 if (strict_strtoul(buf
, 0, ®idx
))
989 sc
->debug
.regidx
= regidx
;
993 static const struct file_operations fops_regidx
= {
994 .read
= read_file_regidx
,
995 .write
= write_file_regidx
,
996 .open
= ath9k_debugfs_open
,
997 .owner
= THIS_MODULE
,
998 .llseek
= default_llseek
,
1001 static ssize_t
read_file_regval(struct file
*file
, char __user
*user_buf
,
1002 size_t count
, loff_t
*ppos
)
1004 struct ath_softc
*sc
= file
->private_data
;
1005 struct ath_hw
*ah
= sc
->sc_ah
;
1010 regval
= REG_READ_D(ah
, sc
->debug
.regidx
);
1011 len
= sprintf(buf
, "0x%08x\n", regval
);
1012 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, len
);
1015 static ssize_t
write_file_regval(struct file
*file
, const char __user
*user_buf
,
1016 size_t count
, loff_t
*ppos
)
1018 struct ath_softc
*sc
= file
->private_data
;
1019 struct ath_hw
*ah
= sc
->sc_ah
;
1020 unsigned long regval
;
1024 len
= min(count
, sizeof(buf
) - 1);
1025 if (copy_from_user(buf
, user_buf
, len
))
1029 if (strict_strtoul(buf
, 0, ®val
))
1032 REG_WRITE_D(ah
, sc
->debug
.regidx
, regval
);
1036 static const struct file_operations fops_regval
= {
1037 .read
= read_file_regval
,
1038 .write
= write_file_regval
,
1039 .open
= ath9k_debugfs_open
,
1040 .owner
= THIS_MODULE
,
1041 .llseek
= default_llseek
,
1044 #define REGDUMP_LINE_SIZE 20
1046 static int open_file_regdump(struct inode
*inode
, struct file
*file
)
1048 struct ath_softc
*sc
= inode
->i_private
;
1049 unsigned int len
= 0;
1052 unsigned long num_regs
, regdump_len
, max_reg_offset
;
1054 max_reg_offset
= AR_SREV_9300_20_OR_LATER(sc
->sc_ah
) ? 0x16bd4 : 0xb500;
1055 num_regs
= max_reg_offset
/ 4 + 1;
1056 regdump_len
= num_regs
* REGDUMP_LINE_SIZE
+ 1;
1057 buf
= vmalloc(regdump_len
);
1061 ath9k_ps_wakeup(sc
);
1062 for (i
= 0; i
< num_regs
; i
++)
1063 len
+= scnprintf(buf
+ len
, regdump_len
- len
,
1064 "0x%06x 0x%08x\n", i
<< 2, REG_READ(sc
->sc_ah
, i
<< 2));
1065 ath9k_ps_restore(sc
);
1067 file
->private_data
= buf
;
1072 static const struct file_operations fops_regdump
= {
1073 .open
= open_file_regdump
,
1074 .read
= ath9k_debugfs_read_buf
,
1075 .release
= ath9k_debugfs_release_buf
,
1076 .owner
= THIS_MODULE
,
1077 .llseek
= default_llseek
,/* read accesses f_pos */
1080 int ath9k_init_debug(struct ath_hw
*ah
)
1082 struct ath_common
*common
= ath9k_hw_common(ah
);
1083 struct ath_softc
*sc
= (struct ath_softc
*) common
->priv
;
1085 sc
->debug
.debugfs_phy
= debugfs_create_dir("ath9k",
1086 sc
->hw
->wiphy
->debugfsdir
);
1087 if (!sc
->debug
.debugfs_phy
)
1090 #ifdef CONFIG_ATH_DEBUG
1091 if (!debugfs_create_file("debug", S_IRUSR
| S_IWUSR
,
1092 sc
->debug
.debugfs_phy
, sc
, &fops_debug
))
1096 if (!debugfs_create_file("dma", S_IRUSR
, sc
->debug
.debugfs_phy
,
1100 if (!debugfs_create_file("interrupt", S_IRUSR
, sc
->debug
.debugfs_phy
,
1101 sc
, &fops_interrupt
))
1104 if (!debugfs_create_file("wiphy", S_IRUSR
| S_IWUSR
,
1105 sc
->debug
.debugfs_phy
, sc
, &fops_wiphy
))
1108 if (!debugfs_create_file("xmit", S_IRUSR
, sc
->debug
.debugfs_phy
,
1112 if (!debugfs_create_file("stations", S_IRUSR
, sc
->debug
.debugfs_phy
,
1113 sc
, &fops_stations
))
1116 if (!debugfs_create_file("misc", S_IRUSR
, sc
->debug
.debugfs_phy
,
1120 if (!debugfs_create_file("recv", S_IRUSR
, sc
->debug
.debugfs_phy
,
1124 if (!debugfs_create_file("rx_chainmask", S_IRUSR
| S_IWUSR
,
1125 sc
->debug
.debugfs_phy
, sc
, &fops_rx_chainmask
))
1128 if (!debugfs_create_file("tx_chainmask", S_IRUSR
| S_IWUSR
,
1129 sc
->debug
.debugfs_phy
, sc
, &fops_tx_chainmask
))
1132 if (!debugfs_create_file("regidx", S_IRUSR
| S_IWUSR
,
1133 sc
->debug
.debugfs_phy
, sc
, &fops_regidx
))
1136 if (!debugfs_create_file("regval", S_IRUSR
| S_IWUSR
,
1137 sc
->debug
.debugfs_phy
, sc
, &fops_regval
))
1140 if (!debugfs_create_bool("ignore_extcca", S_IRUSR
| S_IWUSR
,
1141 sc
->debug
.debugfs_phy
, &ah
->config
.cwm_ignore_extcca
))
1144 if (!debugfs_create_file("regdump", S_IRUSR
, sc
->debug
.debugfs_phy
,
1148 sc
->debug
.regidx
= 0;
1151 debugfs_remove_recursive(sc
->debug
.debugfs_phy
);
1152 sc
->debug
.debugfs_phy
= NULL
;