summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath6kl/debug.h
AgeCommit message (Collapse)AuthorFilesLines
2017-04-13ath6kl: add __printf verification to ath6kl_dbgJoe Perches1-0/+2
Fix fallout too. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Steve deRosier <derosier@gmail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-10-29ath6kl: break stats gathering code into separate methodBen Greear1-0/+2
This will allow us to call it from elsewhere when implementing ethtool stats. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-09-29ath: change logging functions to return voidJoe Perches1-7/+6
The return values are not used by callers of these functions so change the functions to return void. Other miscellanea: o add __printf verification to wil6210 logging functions No format/argument mismatches found Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-03-13ath6kl: fix blank lines before and after bracesKalle Valo1-1/+1
Fixes checkpatch warnings: CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Blank lines aren't necessary before a close brace '}' Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-25ath: Remove extern from function prototypesJoe Perches1-5/+4
There are a mix of function prototypes with and without extern in the kernel sources. Standardize on not using extern for function prototypes. Function prototypes don't need to be written with extern. extern is assumed by the compiler. Its use is as unnecessary as using auto to declare automatic/local variables in a block. Signed-off-by: Joe Perches <joe@perches.com>
2013-03-18ath6kl: add tracing support to log functionsKalle Valo1-0/+1
All log messages are now sent through tracing interface as well if ATH6KL_TRACING is enabled. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-03-18ath6kl: convert ath6kl_info/err/warn macros to real functionsKalle Valo1-7/+3
After this it's cleaner to add trace calls. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-10-24ath6kl: Recover from fw crashVasanthakumar Thiagarajan1-0/+1
Re-initialize the target when fw crash is reported. This would make the device functional again after target crash. During the target re-initialization it is made sure that target is not bugged with data/cmd request, ar->state ATH6KL_STATE_RECOVERY is used for this purpose. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26ath6kl: add full USB supportKalle Valo1-0/+1
Now, with HTC pipe, it's possible to fully support USB version of AR6004. Based on code by Kevin Fang. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-06ath6kl: Fix kernel panic while receiving fwlog during bootVasanthakumar Thiagarajan1-2/+7
"ath6kl: Defer wiphy and netdev registration till the end of ath6kl_core_init()" causes kernel panic by accessing the unallocated debug resources during boot time. To fix this, split the debug initialization funtion into two, one initializes the debug resource and the other takes care of debugfs initialization. When this issue shows up the kernel crash dump would look like ath6kl_debug_fwlog_event+0x9c/0x10a [<c10666c9>] register_lock_class+0x57/0x288 [<c1065cd3>] ? trace_hardirqs_on+0xb/0xd [<f801f4c9>] ? ath6kl_debug_fwlog_event+0x9c/0x10a [<c1066a8a>] __lock_acquire+0x96/0xbe5 [<c106007b>] ? alarmtimer_suspend+0x80/0x127 [<c10258da>] ? vprintk+0x394/0x3b1 [<f801f4c9>] ? ath6kl_debug_fwlog_event+0x9c/0x10a [<c10676b3>] lock_acquire+0xda/0xf9 [<f801f4c9>] ? ath6kl_debug_fwlog_event+0x9c/0x10a [<c1532ce3>] _raw_spin_lock+0x28/0x58 [<f801f4c9>] ? ath6kl_debug_fwlog_event+0x9c/0x10a [<f801f4c9>] ath6kl_debug_fwlog_event+0x9c/0x10a [<f80310a4>] ath6kl_wmi_control_rx+0x69d/0xb50 [ath6kl_core] [<f802d2e1>] ? ath6kl_rx+0x3c/0x839 [ath6kl_core] [<f802d35d>] ath6kl_rx+0xb8/0x839 [ath6kl_core] [<c104b81e>] ? local_clock+0x2d/0x4e [<c102a0af>] ? _local_bh_enable_ip+0x94/0x98 [<f802bfc0>] ? ath6kl_alloc_amsdu_rxbuf+0xb7/0xb7 [<f8023b28>] ath6kl_htc_rxmsg_pending_handler+0x891/0x988 [ath6kl_core] [<f802bf00>] ? ath6kl_refill_amsdu_rxbufs+0x89/0x92 [<f802d2a5>] ? aggr_timeout+0xed/0xed [ath6kl_core] [<f802bfc0>] ? ath6kl_alloc_amsdu_rxbuf+0xb7/0xb7 [<f802c420>] ? ath6kl_tx_complete+0x376/0x376 [ath6kl_core] [<f8020e92>] ath6kl_hif_intr_bh_handler+0xf7/0x33e [<c138ab00>] ? mmc_host_disable+0x15/0x3a [<f8123b5c>] ath6kl_sdio_irq_handler+0x3c/0x90 [ath6kl_sdio] [<c1392f56>] sdio_irq_thread+0xb6/0x29c [<c1392ea0>] ? sdio_claim_irq+0x1cb/0x1cb [<c103d4c0>] kthread+0x67/0x6c [<c103d459>] ? __init_kthread_worker+0x42/0x42 [<c153903a>] kernel_thread_helper+0x6/0xd BUG: unable to handle kernel NULL pointer dereference at EIP: [<f801f4d4>] ath6kl_debug_fwlog_event+0xa7/0x10a kvalo: rename new function to ath6kl_debug_init_fs() and add a comment why it's needed Reported-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-02-08ath6kl: Update license headerVasanthakumar Thiagarajan1-0/+1
Update license header with the copyright to Qualcomm Atheros, Inc. for the year 2011-2012. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-01-18ath6kl: add back beginnings of USB supportKalle Valo1-0/+1
John Linville had to revert the part of USB support which was already in ath6kl due to build problems in commit cb00ec382b ("ath6kl: revert USB support"). Now that I fixed the build problems properly by adding ath6kl_core.ko kernel module it's possible to add back the (incomplete) USB support. This patch is a revert of John's patch and adds back the USB code which as already in ath6kl, only difference being minor changes in Makefile and adapting usb.c to new core function names. Note that USB support in ath6kl is not complete yet. This code only makes it possible to boot firmware but as HTC layer does not yet support USB it's not possible to send any WMI commands nor data packets to the firmware. That will be added soon. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-01-18ath6kl: convert ath6kl_dbg() and ath6kl_dbg_dump() into functionsKalle Valo1-21/+4
That way it's possible to not export debug_mask outside the upcoming ath6kl_core.ko and that makes it easier to ath6kl_core.ko in the following patch. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-01-18ath6kl: get rid of AR_DBG_LVL_CHECK()Kalle Valo1-2/+0
We don't need it as debug calls already have a log level and compiler should be smart enough to optimise away the code when ath6kl debug code is not enabled. Also it makes it easier to abstract core code to ath6kl_core.ko. In ath6kl_dump_registers() I had to change the debug level from ANY to IRQ as I removed the AR_DBG_LVL_CHECK() check before calling the function. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-01-05ath6kl: revert USB supportJohn W. Linville1-1/+0
The ath6kl driver is causing build failures when the ath6kl bits are not built as modules. A better fix is forthcoming in a future release, but for now lets revert the problematic code. This reverts the following commits: fde57764ef8751b9aca11b6f6221ac5555bda699 d70385a26ad9a122a5450d066550470107b6bc38 59d954dda4b9b3f3e61d4b87a2b26952b8c4c09d Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-16Merge remote branch 'wireless-next/master' into ath6kl-nextKalle Valo1-2/+2
Conflicts: drivers/net/wireless/ath/ath6kl/init.c
2011-11-22Merge branch 'master' of ↵John W. Linville1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux Conflicts: drivers/net/wireless/iwlegacy/iwl-debugfs.c drivers/net/wireless/iwlegacy/iwl-rx.c drivers/net/wireless/iwlegacy/iwl-scan.c drivers/net/wireless/iwlegacy/iwl-tx.c include/net/bluetooth/bluetooth.h
2011-11-13ath6kl: add USB supportKalle Valo1-0/+1
Add USB support for ar6004. Currently only firmware can be booted, no commands can be sent to firmware yet as HTC layer doesn't work with USB yet. Based on patches by Kevin Fang. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11ath6kl: cut power during suspendKalle Valo1-0/+1
If sdio controller doesn't support keep power, cut power from hardware during suspend and restart firmware during resume. If we are connected during suspend, send a disconnected event to user space. Earlier suspend failed with an error if sdio didn't support keep power. Now suspend will happen succesfully even with that case. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11ath6kl: add debug messages for credit handlingKalle Valo1-1/+1
Also take few from htc debug level which are more suitable for credit. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11ath6kl: remove unused debug levelsKalle Valo1-4/+4
Few levels had only one user so I changed them to use WLAN_CFG. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11ath6kl: add debug level for hifKalle Valo1-1/+1
That way we htc level debug messages can be removed from hif files. Also add few new messages and remove useless debug message about using synchrous irq processing (we don't support anything else). Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11ath6kl: merge htc debug levelsKalle Valo1-2/+2
It's not really necessary to have separate debug levels for htc tx and rx so combine them. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11ath6kl: Add debugfs control for keepalive and disconnection timeoutJouni Malinen1-0/+11
The new debugfs files keepalive and disconnect_timeout can be used to fetch the current values and to change the values for keepalive and disconnect event timeout (both in seconds). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11ath6kl: Add debugfs file for target roam tableJouni Malinen1-0/+8
The new roam_table debugfs file can be used to display the current roam table from the target. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11ath6kl: move remaining content from htc_hif.h to hif.hKalle Valo1-1/+1
Now htc_hif.h can be removed. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-01treewide: use __printf not __attribute__((format(printf,...)))Joe Perches1-2/+2
Standardize the style for compiler based printf format verification. Standardized the location of __printf too. Done via script and a little typing. $ grep -rPl --include=*.[ch] -w "__attribute__" * | \ grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \ xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }' [akpm@linux-foundation.org: revert arch bits] Signed-off-by: Joe Perches <joe@perches.com> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-28ath6kl: improve wmi debug messagesKalle Valo1-1/+2
Add a new debug level ATH6KL_DBG_WMI_DUMP and other minor improvements to the wmi debug messages. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-28ath6kl: add debug logs for bootingKalle Valo1-0/+1
Just to make it easier to find out why boot fails. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-28ath6kl: add sdio debug messagesKalle Valo1-0/+2
Add extensive debug messages to sdio.c. Makes it easier to debug various problems. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-28ath6kl: add prefix parameter to ath6kl_dbg_dump()Kalle Valo1-6/+8
Makes it easier to recognise longs dumps. Obligatory screenshot using "rx" prefix: ath6kl: ath6kl_rx rx 00000000: 10 10 00 00 00 00 08 30 00 00 00 00 00 00 f9 0b .......0........ rx 00000010: 2c 44 08 30 00 00 f9 0b 0c a4 02 00 00 00 73 d2 ,D.0..........s. rx 00000020: 94 00 f9 0b 04 8c 01 00 02 00 07 02 02 00 f9 0b ................ Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-28ath6kl: silence "invalid rate" warningKalle Valo1-0/+9
For some reason firmware is sending invalid rates when we try to query current bitrate from ath6kl_get_station() and a warning is issued: [ 3810.415720] ath6kl: invalid rate: 1935633515 [ 3811.105493] ath6kl: invalid rate: 1935633515 [ 3811.556063] ath6kl: invalid rate: 1935633515 As the warning happens way too often, convert the warning to a debug message once we have a proper fix. But to make it easy to follow how often the problem appears, add a debugfs to print various statistics about workarounds and make this issue the first WAR. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-27ath6kl: Fix compilation error while compiling w/o debugRajkumar Manoharan1-2/+3
drivers/net/wireless/ath/ath6kl/htc_hif.o: In function `ath6kl_debug_fwlog_event': drivers/net/wireless/ath/ath6kl/debug.h:109: multiple definition of `ath6kl_debug_fwlog_event' drivers/net/wireless/ath/ath6kl/debug.o: drivers/net/wireless/ath/ath6kl/debug.h:109: first defined here drivers/net/wireless/ath/ath6kl/htc_hif.o: In function `ath6kl_debug_cleanup': drivers/net/wireless/ath/ath6kl/debug.h:118: multiple definition of `ath6kl_debug_cleanup' drivers/net/wireless/ath/ath6kl/debug.o: drivers/net/wireless/ath/ath6kl/debug.h:118: first defined here Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-02ath6kl: add firmware log supportKalle Valo1-0/+13
Firmware sends binary logs with WMIX_DBGLOG_EVENTID event. Create a buffer which stores the latest logs and which can be copied from fwlog debugfs file with cp command. To save memory firmware log support is enabled only when CONFIG_ATH6KL_DEBUG is enabled. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-08-31ath6kl: Add initial debugfs changesVasanthakumar Thiagarajan1-1/+5
Just initial debugfs changes. The debugfs directory would be created at <debugfs_root>/ieee80211/phyX/ath6kl. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-08-09ath6kl: change aggreation timeout message from an error to a debug messageKalle Valo1-0/+1
When I connect to my Linksys WT610N AP supporting 11n I see a lot of aggreation timeout errors: [ 408.885053] ath6kl: aggr timeout (st 3109 end 3140) [ 463.872108] ath6kl: aggr timeout (st 3671 end 3702) [ 495.010060] ath6kl: aggr timeout (st 3983 end 4014) [ 503.604047] ath6kl: aggr timeout (st 4065 end 0) [ 518.963047] ath6kl: aggr timeout (st 141 end 172) [ 525.014066] ath6kl: aggr timeout (st 205 end 236) [ 573.957051] ath6kl: aggr timeout (st 701 end 732) [ 585.019067] ath6kl: aggr timeout (st 816 end 847) But still the connection seems to work. To not clutter the logs change the error message to a debug message. But add a fixme comment so that this will be investigated. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-08-09Add ath6kl cleaned up driverKalle Valo1-0/+104
Last May we started working on cleaning up ath6kl driver which is currently in staging. The work has happened in a separate ath6kl-cleanup tree: http://git.kernel.org/?p=linux/kernel/git/kvalo/ath6kl-cleanup.git;a=summary After over 1100 (!) patches we have now reached a state where I would like to start discussing about pushing the driver to the wireless trees and replacing the staging driver. The driver is now a lot smaller and looks like a proper Linux driver. The size of the driver (measured with simple wc -l) dropped from 49 kLOC to 18 kLOC and the number of the .c and .h files dropped from 107 to 22. Most importantly the number of subdirectories reduced from 26 to zero :) There are two remaining checkpatch warnings in the driver which we decided to omit for now: drivers/net/wireless/ath/ath6kl/debug.c:31: WARNING: printk() should include KERN_ facility level drivers/net/wireless/ath/ath6kl/sdio.c:527: WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt The driver has endian annotations for all the hardware specific structures and there are no sparse errors. Unfortunately I don't have any big endian hardware to test that right now. We have been testing the driver both on x86 and arm platforms. The code is also compiled with sparc and parisc cross compilers. Notable missing features compared to the current staging driver are: o HCI over SDIO support o nl80211 testmode o firmware logging o suspend support Testmode, firmware logging and suspend support will be added soon. HCI over SDIO support will be more difficult as the HCI driver needs to share code with the wifi driver. This is something we need to research more. Also I want to point out the changes I did for signed endian support. As I wasn't able to find any support for signed endian annotations I decided to follow what NTFS has done and added my own. Grep for sle16 and sle32, especially from wmi.h. Various people have been working on the cleanup, the hall of fame based on number of patches is: 543 Vasanthakumar Thiagarajan 403 Raja Mani 252 Kalle Valo 16 Vivek Natarajan 12 Suraj Sumangala 3 Joe Perches 2 Jouni Malinen Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com> Signed-off-by: Suraj Sumangala <surajs@qca.qualcomm.com> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>