aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-04-26ath6kl: add ability to set debug uart baud rateSteve deRosier1-0/+3
It's useful to permit the customization of the debug uart baud rate. Enable this and send down the value to the chip if we're enabling debug. Signed-off-by: Steve deRosier <steve.derosier@lairdtech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-30cfg80211: pass name_assign_type to rdev_add_virtual_intf()Tom Gundersen1-2/+2
This will expose in /sys whether the ifname of a device is set by userspace or generated by the kernel. The latter kind (wlanX, etc) is not deterministic, so userspace needs to rename these devices to names that are guaranteed to stay the same between reboots. The former, however should never be renamed, so userspace needs to be able to reliably tell the difference. Similar functionality was introduced for the rtnetlink core in commit 5517750f058e ("net: rtnetlink - make create_link take name_assign_type") Signed-off-by: Tom Gundersen <teg@jklm.no> Cc: Kalle Valo <kvalo@qca.qualcomm.com> Cc: Brett Rudley <brudley@broadcom.com> Cc: Arend van Spriel <arend@broadcom.com> Cc: Franky (Zhenhui) Lin <frankyl@broadcom.com> Cc: Hante Meuleman <meuleman@broadcom.com> Cc: Johannes Berg <johannes@sipsolutions.net> [reformat changelog to fit 72 cols] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-07-14ath6kl: convert ar6004 hardware flags to firmware feature flagsKalle Valo1-0/+16
The functionality defined through these flags were actually firmware features which can change between firmware versions. To make it possible to support different firmware versions with the same driver, convert the flags to firmware feature flags. For backwards compatibility support for old ar6004 firmware FW API 3 or smaller images we forcefully set the feature bits in the driver. Starting from FW API 5 the firmware image needs to set them. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-03-13ath6kl: remove unnecessary line continuationsKalle Valo1-3/+3
Fixes checkpatch warning: WARNING: Avoid unnecessary line continuations Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-10-24ath6kl: Make fw error recovery configurableVasanthakumar Thiagarajan1-2/+10
Add a modparam to configure recovery. Recovery from firmware error is disabled by default to debug the actual issue further. To recovery from error, modprobe ath6kl_core recovery_enable=1. Reported-by: Jin Navy <nhjin@qca.qualcomm.com> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-10-24ath6kl: Add support to detect fw error through heart beatVasanthakumar Thiagarajan1-0/+9
This patch adds support to detect fw error condition by sending periodic message (heart beat challenge) to firmware. Upon reception of the message, fw would send a response event to driver. When there are no reponses from fw for about 5 cmd driver would trigger the recovery logic assuming that fw has gone into an error state. Capable fw will advertise this capability through ATH6KL_FW_CAPABILITY_HEART_BEAT_POLL bit. This feature is disabled by default, can be enabled through a modparam (heart_beat_poll). This modparam also confiures the polling interval in msecs. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-10-24ath6kl: Recover from fw crashVasanthakumar Thiagarajan1-0/+4
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-07-12cfg80211: use wireless_dev for interface managementJohannes Berg1-4/+4
In order to be able to create P2P Device wdevs, move the virtual interface management over to wireless_dev structures. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-04-03ath6kl: Use vmalloc instead of kmalloc for fwVivek Natarajan1-1/+2
Sometimes it has been observed that allocating a contiguous memory of more than 100K fails with kmalloc. This has been modified to use vmalloc instead. Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26ath6kl: Add HTC pipe implementationKalle Valo1-0/+15
This is needed for USB. Based on code by Kevin Fang. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26ath6kl: add htc opsKalle Valo1-1/+11
In preparation for adding HTC pipe implementation add htc-ops.h to make it possible dynamically choose which HTC type is used. Needed for full USB support. Based on the code by Ray Chen <raychen@qca.qualcomm.com>. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Ray Chen <raychen@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07ath6kl: alignment should match open parenthesisKalle Valo1-3/+3
Fix the issues which checkpatch found and were easy to fix. Especially callers of ath6kl_bmi_write() are tricky and that needs to be fixed separately. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07ath6kl: Maintain the listen interval per VIF specificRaja Mani1-2/+0
Firmware has the option to support the listen interval per vif specific. Fix this. Listen interval can be set by the TUs or by the number of beacons. Current code enables the user to configure the listen interval in the unit of 'number of beacons' using debugfs entry "listen_interval". Going forward, we need to alter the listen interval in the unit of TUs to get good power numbers while going to WOW suspend/resume. Allowing the user to change the listen interval in the unit of "number of beacons" in debugfs and changing listen interval in wow suspend/resume in the unit of time (TUs) would lead us to confuse. This patch make sures the listen interval is changed only in the unit of time (TUs). Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07ath6kl: Add provision to define suspend policy in disconnected state.Raja Mani1-0/+9
It gives flexibility to the user to define suspend policy when the suspend mode is set to WOW and the device is in disconnected state at the time of suspend. New module parameter wow_mode is added to get the choice from the user. This parameter is valid only if the module parameter suspend_mode is set to WOW. To force WOW in connected state and cut power in disconnected state: suspend_mode=0x3 wow_mode=0x1 To force WOW in connected state and deep sleep in disconnected state (this is also the default wow_mode): suspend_mode=0x3 wow_mode=0x2 If there is no value specified to wow_mode during insmod, deep sleep mode will be tried in the disconnected state. kvalo: clarified commit log Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-06ath6kl: Fix kernel panic while receiving fwlog during bootVasanthakumar Thiagarajan1-4/+5
"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-03-01ath6kl: Defer wiphy and netdev registration till the end of ath6kl_core_init()Vasanthakumar Thiagarajan1-44/+32
This makes the wiphy and initial netdev registration the last step in dev initialization. Apart from the fact that this looks right, it can also be used to setup wiphy with the regulatory information received from firmware after uploading the firmware. Also it fixes a FIXME in ath6kl_core_init() where mac address is copied into netdev->dev_addr, ath6kl_interface_add() takes care of this as well. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-01ath6kl: Initialize netdev hw_features for every interfaceVasanthakumar Thiagarajan1-2/+0
Move netdev->hw_features setting from ath6kl_core_init() to init_netdev() so that it is done for every interface. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-01ath6kl: Group wiphy initialization into ath6kl_cfg80211_init()Vasanthakumar Thiagarajan1-14/+0
There are some code which initializes various wiphy members left outside ath6kl_cfg80211_init(), in ath6kl_core_init(). Move them into a single palce. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-02-28ath6kl: Make sure to allocate rx buffers after the endpoint connectionVasanthakumar Thiagarajan1-4/+4
Rx buffers should be allocated for control and best effort endpoints only after the enpoints connection is esablished. But this is done before the endpoint connection is complete, we don't even the control and BE endpoints that time. Move the buffer allocation after endpoint connection is over, after ath6kl_init_hw_start(). Found in review, never seen any real issue with this. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-02-27ath6kl: Add unicast mgmt frame bufferingNaveen Gangadharan1-0/+2
PS buffering of unicast Action frames that are sent in a context of a BSS. In AP mode when the recepient station goes to powersave and PS_POLL flag is not set, we would buffer the frames. Send out unicast mgmt bufferred frame when PS_POLL is received. This fixes a bug in P2P GO behavior when sending a GO Discoverability Request to a client that is in sleep mode. kvalo: indentation fixes Signed-off-by: Thirumalai Pachamuthu <tpachamu@qca.qualcomm.com> Signed-off-by: Naveen Gangadharan <ngangadh@qca.qualcomm.com> Signed-off-by: Aarthi Thiruvengadam <athiruve@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-30ath6kl: Re-architect suspend mode handling in ath6kl_sdio_suspendRaja Mani1-4/+8
Using this patch, the user can bypass existing auto suspend mode selection logic and force ath6kl to enter into the suspend mode what he/she wants. If the user doesn't choose any suspend mode while doing insmod of the driver, auto suspend mode selection logic will kick in and choose suspend mode based on the host SDIO controller capability. Generic module parameter is required to specify suspend mode including Deep Sleep and WOW while doing insmod. Renaming existing mod param variable suspend_cutpower would be sufficient to meet this requirement. New module parameter suspend_mode can take any one of the below suspend state, 1. cut power 2. deep sleep 3. wow Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-01-30ath6kl: fix testmode when fw-2.bin or fw-3.bin is usedKalle Valo1-0/+4
Testmode (TCMD and ART) was not enabled when fw-2.bin or fw-3.bin files were available, fix that by fetching testmode file just after the board file but before rest of the firmware files are fetched. I also added testmode field to struct ath6kl and moved the module parameter to core.c. Now all module parameters are grouped in one place. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-01-24ath6kl: Fix bug in maintaining aggregation state in AP modeVasanthakumar Thiagarajan1-0/+7
Currently rx aggregation related states are maintained per vif, but this will not properly work when operating in AP mode. Aggregation is completely broken when more than one 11n stations are connected to AP mode vif. Fix this issue by keeping station specific aggregation state in sta_list. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-01-18ath6kl: create ath6kl_core.koKalle Valo1-0/+9
Now ath6kl is ready for splitting core code to ath6kl_core.ko module. This also makes it possible to link both sdio and usb code to kernel at the same time, which earlier failed miserably. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-01-18ath6kl: create core.cKalle Valo1-0/+292
Currently core functions are spread between various files, group all the functions into file and rename the functions to follow the style used elsewhere in the driver. This will make it easier to a separate core module. Also fix a bug where wiphy is freed too early. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>