OpenWrt Forum Archive

Topic: debugging ath9k

The content of this topic has been archived on 11 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

I have Mikrotik RB 433AH with R52N-m adapter. I want to have a closer look on ath9k driver, see how it is working, set breakpoint etc. So I've made some researches and found out that I would need to use JTAG and ICE. I have some ICEs but none of them supports MIPS32 arch. Is there some kind of way to debug ath9k driver without ICE?

- there is a build option available when you compile Barrier Breaker (trunk) yourself:
Kernel modules -> Wireless drivers -> kmod-ath -> Atheros wireless debugging

- load the module with debug parameters, see
http://wireless.kernel.org/en/users/Drivers/ath9k/debug
for more information

- maybe modify the kernel cmdline / kernel loading parameters or
select more debug options in "make kernel_menuconfig" after you selected your packages

- remember: OpenWrt is using the backports project (compat-wireless/compat-drivers previously)
and not those wireless driver inside the kernel
and especially ath9k is heavily patched - see
https://dev.openwrt.org/browser/trunk/p … 11/patches
esp. file 300-pending_work.patch contains changes in TX/RX flow

(Last edited by zloop on 12 Nov 2013, 21:14)

Thank you for advices, I'll try this all out

(Last edited by valentin2208 on 13 Nov 2013, 06:43)

zloop wrote:

esp. file 300-pending_work.patch contains changes in TX/RX flow

Do you know how to properly apply all this patches? Cause, first of all, some of the patches from link you gave me are different from what I have in my buildroot (e.g this 300-pending_work.patch), second, when I try to apply them 1 by 1 with patch command, I've got many hunk fails. But when I compile new firmware, all this patches are apllied to source code, am I right? So the problem is I can't get patched code thus it is very difficult to see changes.

zloop wrote:

-there is a build option available when you compile Barrier Breaker (trunk) yourself:
Kernel modules -> Wireless drivers -> kmod-ath -> Atheros wireless debugging

I've applied this option, recompile firmware and that's what I got

root@OpenWrt:/# modprobe ath9k debug=0xffffffff                                 
kmod: Usage:                                                                    
        modprobe module                                                         
root@OpenWrt:/# modprobe ath9k                                                  
[  130.170000] cfg80211: exports duplicate symbol __ieee80211_get_channel (owne)
kmod: 6 modules could not be probed                                             
kmod: - ath                                                                     
kmod: - ath9k                                                                   
kmod: - ath9k_common                                                            
kmod: - ath9k_hw                                                                
kmod: - cfg80211                                                                
kmod: - mac80211                                                                
root@OpenWrt:/# modprobe ath9k debug=0x00000020                                 
kmod: Usage:                                                                    
        modprobe module                                                         
root@OpenWrt:/# 

(Last edited by valentin2208 on 19 Nov 2013, 15:20)

valentin2208 wrote:

Do you know how to properly apply all this patches? Cause, first of all, some of the patches from link you gave me are different from what I have in my buildroot (e.g this 300-pending_work.patch), second, when I try to apply them 1 by 1 with patch command, I've got many hunk fails.

No, sorry.
I already asked about that on the mailing list but didn't receive a response:
https://lists.openwrt.org/pipermail/ope … 21209.html

The link points to the version currently in trunk. mac80211 was updated recently -see
"Journal" on dev.openwrt.org, direct link: https://dev.openwrt.org/timeline

300-pending_work contains patches from linux-wireless mailing list - very old and new ones
Searching there for parts of the diffs might yield some results

Obviously the differences get pretty large when you only update those mac80211/backports every 1/2 year:
2013-06-27 -> 2013-11-05 was the last update
You might want to have a closer look at the commits of the backport/next ... git trees too (because they are different too)

valentin2208 wrote:
root@OpenWrt:/# modprobe ath9k debug=0xffffffff                                 
kmod: Usage:                                                                    
        modprobe module                                                         
root@OpenWrt:/# modprobe ath9k                                                  
[  130.170000] cfg80211: exports duplicate symbol __ieee80211_get_channel (owne)

Obviously: the module is already loaded.
Use rmmod to remove modules+depending mods first; then try again; try "insmod"
Maybe add the debug flag to the loading file in: /etc/modules.d/ath9k ?
maybe some feature of busybox is missing ? - don't know
(for features google found: http://git.busybox.net/busybox/tree/mod … _15_stable )

Thank you again. Then I'll just dig this ath9k debug thing further to see what happen.

The discussion might have continued from here.