NOTE: this page is for archival only, see the note at the end of the page.

Go back –> Main ath9k driver page

ath9k and ath9k_htc debugging

This page documents the debugging facilities available for ath9k and ath9k_htc

Enabling debug

If you have issues with ath9k or ath9k_htc you can enable debug. You will first need to enable the Kconfig option (CONFIG_ATH_DEBUG):

Device Drivers  --->
  [*] Network device support  --->
        Wireless LAN  --->
          <M>   Atheros Wireless Cards  --->
                [*] Atheros wireless debugging

Then you can use the module parameter debug. We cover below the different available debug levels you can use.

enum ATH_DEBUG {
        ATH_DBG_RESET           = 0x00000001,
        ATH_DBG_QUEUE           = 0x00000002,
        ATH_DBG_EEPROM          = 0x00000004,
        ATH_DBG_CALIBRATE       = 0x00000008,
        ATH_DBG_INTERRUPT       = 0x00000010,
        ATH_DBG_REGULATORY      = 0x00000020,
        ATH_DBG_ANI             = 0x00000040,
        ATH_DBG_XMIT            = 0x00000080,
        ATH_DBG_BEACON          = 0x00000100,
        ATH_DBG_CONFIG          = 0x00000200,
        ATH_DBG_FATAL           = 0x00000400,
        ATH_DBG_PS              = 0x00000800,
        ATH_DBG_HWTIMER         = 0x00001000,
        ATH_DBG_BTCOEX          = 0x00002000,
        ATH_DBG_WMI             = 0x00004000,
        ATH_DBG_ANY             = 0xffffffff

If you want to debug calibration (0x00000008) and resets (0x00000001) for example you would use (0x00000008 | 0x00000001) = 0x00000009. To debug everything just use 0xffffffff. Below is an example of how to enable debug for just configuration changes:

modprobe ath9k debug=0x00000200 (or) modprobe ath9k_htc debug=0x00000200

You can also use modprobe.d configuration files, for example to enable ATH_DBG_CONFIG (0x00000200) and ATH_DBG_PS (0x00000800) you would have a file /etc/modprobe.d/atheros.conf with this:

options ath9k debug=0xa00 (or) options ath9k_htc debug=0xa00

Debugfs files for ath9k

ath9k has several debugfs files which you can query for information and some which allow you to insert data. This can be enabled as:

Device Drivers  --->
  [*] Network device support  --->
        Wireless LAN  --->
          <M>   Atheros Wireless Cards  --->
                [M] Atheros 802.11n wireless cards support
                [*]   Atheros ath9k debugging

To get debugfs you will need to mount it first. You can do so as follows:

mount -t debugfs debugfs /sys/kernel/debug/

Below we document each debugfs file entry specific to ath9k.



This lets you change the current driver debug level which you would normally initialize during driver probe using the debug module parameter.





Interrupt statistics. To monitor interrupts you can also use the irq-watch script provided in the ath-utils.git tree.



Displays statistics about rates used, PER, retries and excessive retries.


You will need to enable CONFIG_ATH9K_MAC_DEBUG. This option enables collection of statistics for Rx/Tx status data and some other MAC related statistics. Among many other things this displays the RSSI per chain.






TX frame statistics.



RX Error statistics.

RSSI per chain

Note: As of v3.4 these stats have moved under CONFIG_ATH9K_MAC_DEBUG and are available through the samples file

The RSSI as received per chain is exposed through the recv file.

  • RSSI-CTL0: maps to AR_RxRSSIAnt00
  • RSSI-CTL1: maps to AR_RxRSSIAnt01
  • RSSI-CTL2: maps to AR_RxRSSIAnt02


You can modify the TX chainmask on ath9k manually by using:



You can modify the RX chainmask on ath9k manually by using:


Debugfs files for ath9k_htc

ath9k_htc has a few debugfs files which show driver statistics. Enable it as:

Device Drivers  --->
  [*] Network device support  --->
        Wireless LAN  --->
          <M>   Atheros Wireless Cards  --->
                [M] Atheros 802.11n wireless cards support
                [*]   Atheros ath9k_htc debugging



Target TX statistics.



Target RX statistics.



Target Interrupt statistics.



Host TX statistics.



Host RX statistics.



Host slot management statistics.



Host queue statistics.



The current debug mask, which can also be changed.

This is a static dump of the old wiki, taken after locking it in January 2015. The new wiki is at
versions of this page: last, v19, v18, v17, v16, v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1