Commit Graph

670 Commits

Author SHA1 Message Date
psimha
a079b8c678 qcacmn: Deregister HIF ext groups on rmmod
- Deregister & free the hif ext ctx when detaching DP interrupts.
- Unregister the hotcpu_notifier during rmmod.

Change-Id: Icbd3c6cee70b6b224059a4b301b9840485a96d11
CRs-Fixed: 2086729
2017-09-08 19:40:02 -07:00
Houston Hoffman
579c02f570 qcacmn: Provide special sleep_state_adjust api for srng based targets
current pci version of sleep_state_adjust is not supported on srng based targets.

Change-Id: I6ff0c78681cc15c677b6458b3a7d8b571a051925
CRs-Fixed: 2090590
2017-09-08 18:57:10 -07:00
Houston Hoffman
5645dd2803 qcacmn: Use qdf_dbg instead of qdf_print for non-error logs
Stats printing with excessive loops should not go to the console.
Avoids watch-dog bites.

Change-Id: I7b0f9d73139dff97c16f492cbd1cb2d255255b3e
CRs-Fixed: 2091039
2017-09-08 02:37:26 -07:00
Dustin Brown
2af3d67336 qcacmn: Add Wake MSI support
Using the same MSI for wake and copy engines has a number of negative
side effects. Instead, set aside a whole MSI just for the wake
notification from firmware.

Change-Id: If871b88ca255ad970dabb4a7773d2b4d3b71c3fe
CRs-Fixed: 2055359
2017-09-07 17:31:36 -07:00
Govind Singh
903165f2ef qcacmn: Reduce CE msg flush count for SLUB build
With SLUB build in Low memory condition rx processing is taking
more time, reduce CE msg flush count for fastpath in SLUB build.

Change-Id: I8901bd770ca01997299f882394bbe99871d2400e
CRs-Fixed: 2043999
2017-09-07 13:30:34 -07:00
Chris Guo
175e034a96 qcacmn: Fix RX Bus bundle error for SDIO WLAN
Fixed below errors:
1 RX bundle number calculation error.
2 Last bundled PKT block error.
3 RX bundle max checking error.

CRs-Fixed: 2071151
Change-Id: I3cf2cb7e933a47c88ac4916a18234d81ff068d2a
2017-09-05 03:21:56 -07:00
Venkateswara Swamy Bandaru
ed15e74a87 qcacmn: Add support to pass napi budget as module parameter
Add module parameter to pass napi budget for dp interrupts. Default value is
set to 128.

Change-Id: I6b3761c6908ed9cec4e40118a657b39da6ac2532
CRs-Fixed: 2095242
2017-09-01 23:17:18 -07:00
Balamurugan Mahalingam
dcb5226baf qcacmn: Fix PACKET_LOG_SVC service to ce_map for QCA8074
Add a new entry for PACKET_LOG_SVC. FW needs this entry
for initializing packet log CE pipe.

CRs-Fixed: 2094058
Change-Id: I496a2bdf78dd79cc17a60b4f0d227d4e570c93e6
2017-08-31 13:21:38 -07:00
Houston Hoffman
9b55b5fbb9 qcacmn: Fix ce ring timeout interrupt hw work arround
Interrupt was constantly firing because the low_threshold was
improperly configured.  The low threshold needs to be 1 less than
the number of buffers posted when the CE is fully posted.  The
srng backed CE's are setup with nentries - 2 buffers as the fully
posted amount, therefore the threshold needs to be nentries - 3.

Also fixes a bug where a reused variable is not cleared.  This
bug could result in the threshold being set to a garbages value.

Change-Id: Iac840bfd6677683bf2feb42d8bdbd050f42e895d
CRs-Fixed: 2090603
2017-08-31 06:27:43 -07:00
Houston Hoffman
1ef0c77b45 qcacmn: remove QCA_WIFI_NAPIER_EMULATION from pci enable
Use srng based runtime check to bypass legacy register based fw handshakes.
Also remove deprecated emulation based io_remap hack

Change-Id: Idc599bec69a191131e866a2db36d6df3e8e8057f
2017-08-29 20:55:31 -07:00
Venkateswara Swamy Bandaru
4b0ee101ca qcacmn: Fix napi polling issue
Do not enable interrupts and continue polling when there is pending work
group napi poll function.

Change-Id: I51184bc5b97f44a65e0883eb614bc47b2b5ca428
CRs-Fixed: 2094313
2017-08-28 14:47:04 -07:00
Liangwei Dong
7a3433459f qcacmn: add FW self recovery for SDIO
add hif_check_fw_reg implementation for SDIO
solution.

Change-Id: Ic6948cfc7400d93a53e27074a17d5ceac45b558b
CRs-Fixed: 2071352
2017-08-18 21:27:08 -07:00
Poddar, Siddarth
725e9f5a0d qcacmn: Add missing qdf_spinlock_destroy() to free debug cookie
Add missing qdf_spinlock_destroy() to destroy spin lock debug cookie
for SLUB build. For normal builds, qdf_spinlock_destroy() is a NO-OP
function.

Change-Id: If5a3843a468e460952dc64f0e6b5b1fba05ebbb3
CRs-Fixed: 2078940
2017-08-18 05:37:30 -07:00
tfyu
6c7625b2ca qcacmn: Add macro protection for HIF CE
Add macro protection for HIF CE, it shouldn't include the ce head file
when the module is usb or sdio.

Change-Id: Icc38ffaa24581141f86d41afe2db7c5aa944a1cd
CRs-Fixed: 2090621
2017-08-17 03:26:53 -07:00
Prashanth Bhatta
65b0eaa24b qcacmn: Change semantics of Runtime Lock APIs
Runtime PM lock init API right now returns pointer to a context
but this would cause confusion to the caller if feature is not
defined and dummy function return NULL as caller can't find real
failure versus dummy function returning because feature not being
enabled.

Fix declaring a data structure in QDF layer that caller can use
but it hides the internal details of HIF implementation for
Runtime PM locks.

CRs-fixed: 1116509
Change-Id: I4dcba604e803faa0e14fac6403610391895e382e
2017-08-15 13:27:07 -07:00
Karunakar Dasineni
9a4ddd6a40 qcacmn: Compilation fix without FEATURE_NAPI
Fix compilation failures with NAPI disabled.

Change-Id: I5ebd122436b7fc2f85b09880eddd884ca114e121
CRs-Fixed: 2080092
2017-08-14 13:58:08 -07:00
Houston Hoffman
817ff7fc72 qcacmn: Add target type for adrastea chip
Add adrastea target type definitions to hif.h.

Change-Id: Id3183287ecd749577cfc1b71a0cfd96210073612
CRs-Fixed: 2066361
2017-08-11 19:38:21 -07:00
Manjunathappa Prakash
7ddb964c75 qcacmn: Use HOST_INTEREST_ADDRESS from targaddrs.h
WIN side code already uses the address FW interface header file.
No impact on MCL side as these are addresses are for WIN chips.

Change-Id: I540de3adf749d02aa9e56cca3f1f1baa39052dc7
CRs-Fixed: 2066361
2017-08-11 19:38:20 -07:00
Chris Guo
0d276aab16 qcacmn: Enhance t-put for SDIO bus WLAN
Because of wrongly using #ifdef instead of #if, DEBUG_BUNDLE is
always on after enable bus bunlde for SDIO bus WLAN.

CRs-Fixed: 2073795
Change-Id: I7b94dbc0a63dbea2384a455eed1e46d0eb60c530
2017-08-11 05:07:12 -07:00
Venkateswara Swamy Bandaru
9b8dcb46d9 qcacmn: Fix race condition issue with enabling interrupts
Add lock before disabling and enabling group interrups to avoid race
condition between enabling and disabling group interrupts. Avoid mutiple
enabling/disabling of interrupts by maintaining the irq enabled information.

Change-Id: I79afc987e3853de84aaa05321cfcee72cdc0acb0
CRs-Fixed: 2087792
2017-08-10 03:11:59 -07:00
Will Huang
82e91e0541 qcacmn: Check pointer tbuffer always before access it
Pointer tbuffer is allocated from heap or get from other module, it
is checked in some if branch but not every possible NULL branch.

Adding NULL check of tbuffer in every possible branch.

Change-Id: Id3c9f941623995ff73a993e29c53f3b9ce66f10e
CRs-Fixed: 2064350
2017-08-09 19:36:58 -07:00
Poddar, Siddarth
0efe289db5 qcacmn: Perform napi state comparison before releasing napi lock
Release napi spinlock only after performing napi state
comparison to avoid any race condition.

Change-Id: Icd7b713e474a818dfc6d0fa402496bbe06a3af66
CRs-Fixed: 2078294
2017-08-09 19:36:57 -07:00
Will Huang
2411f76c2b qcacmn: Check pointer before dereference it
sync_completion_queue pass to function hif_dev_issue_recv_packet_bundle
may be NULL when asyncProc is true, and this queue pointer will be
dereferenced in HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE.

Add checking before dereference this pointer.

Change-Id: I7e6f7923c819a7af8ed5444853ee74ffe1dd1a76
CRs-Fixed: 2071228
2017-08-09 19:36:55 -07:00
Will Huang
408ae4c430 qcacmn: Fix possible NULL pointer dereference access
In multiple functions of hif_sdio_recv.c and hif_scatter.c, there is
A_ASSERT to check NULL pointers which might null operation if it is
not debug build.

Fix it by adding proper error handle if pointer is NULL

Change-Id: Ib183366d4a1193a3cf22aae2f3431efa761d1d35
CRs-Fixed: 2058905
2017-08-09 16:07:49 -07:00
Will Huang
f3a2ea90b8 qcacmn: Check mbox_index as index and check pointer
hif_dev_map_pipe_to_mail_box may return 255 and assign to mbox_index,
which will cause buffer overflow. Another issue is missing NULL check
after allocate memory in function hif_dev_send_buffer.

Fix it by checking NULL/invalid return pointer/index value.

Change-Id: If7b954343847097b7b5b601c684fe6b51d90daa4
CRs-Fixed: 2058300
2017-08-08 01:21:48 -07:00
Houston Hoffman
648a918927 qcacmn: Enable msi support for ext_group ring groupings
assign msi vectors to srng rings based on the ext_group they will be
serviced in.

provide support for ext_groups in hif_pci.

Change-Id: If313fdb43b939871c0d73dea9a05f757427b5b16
CRs-Fixed: 2051911
2017-08-06 10:47:16 -07:00
Houston Hoffman
4e2df40247 qcacmn: Support hal detach
Cleanup paths were missing hal detach hook.

Change-Id: I175a60b52b8d61dacf5f7040c223073bd09d7ba6
CRs-Fixed: 2051903
2017-08-06 00:59:38 -07:00
psimha
61b1a36f72 qcacmn: Add NAPI stats
Add basic stats to track NAPI polls & schedules.

Change-Id: Iea8f21fc08d4a5de62e00f32ffdc020f8364ced1
CRs-Fixed: 2083867
2017-08-04 15:35:43 -07:00
wadesong
6edf0b6d1b qcacmn: Fix build errors generated by gcc 6
Gcc 6 introduces some stricter checking for indentation,
causing warnings of misleading-indentation, which are
treated as build errors when CLD3.x drivers are compiled.

Fix all the identation warnings under qcacmn branch.

Change-Id: I50b5eb093f08be118a29ff58e1bc3d7f2518e0bf
CRs-Fixed: 2058147
2017-08-01 22:11:24 -07:00
bings
60da5a87c4 qcacmn: Fix crash caused by sdio ramdump allocation
For TF sdio chip with platform driver, ramdump is
configured in platform driver. Driver can get the
virtual memory, but it can't call ioremap again.

If there is a platform driver, ramdump should be
allocated in platform driver, and if there is no
platform driver, ramdump should be allocated in
driver.

CRs-Fixed: 2060381
Change-Id: Ia2a32a4895f354e365522a30bbfac949ccb7a391
2017-07-23 20:14:47 -07:00
Keyur Parekh
db0fa14b0e qcacmn: Pktlog modified to work for per pdev in wifi3.0
change pktlog CE ring to 5 from 11

Change-Id: I3cd3287cdda413ef9ac4ed204177300c85abfb24
2017-07-19 18:14:13 -07:00
Houston Hoffman
b3497c0daf qcacmn: Strip hif_irq_afinity of duplicate logic
Leave the duplicate logic in hif_napi.c until
more thorough cleanup can be done.

Also clean up the HELIUMPLUS macro dependency.

Change-Id: Idbfaacb3b74b358198691a288def07d454e17659
CRs-Fixed: 2051902
2017-07-13 03:38:01 -07:00
Houston Hoffman
a0ecf33aa9 qcacmn: Duplicate hif_napi files
Duplicate hif_napi files to replicate the irq afinity handling
for hif_exec objects.

Change-Id: I31429ed188e6f40bb34aa8d22225752e311d364e
CRs-Fixed: 2051902
2017-07-13 03:38:00 -07:00
Houston Hoffman
def86a361b qcacmn: Introduce hif_exec_context
hif_exec_context extends hif_ext_groups to support napi and tasklet models.
Some of the rename and enahancements have been done to support merging of
the execution context management code between the CE and DP contexts, as
well as supporting irq affinity for both napi & tasklet contexts.

Change-Id: I82c8abf2e906f027ec80faf7353a7685536bb79b
CRs-Fixed: 2051902
2017-07-13 03:37:59 -07:00
Srinivas Girigowda
43977f7e6d qcacmn: Fix kernel checkpatch warnings in QDF
Fix kernel checkpatch warnings in QDF.

Change-Id: Id2f54c6c436bde55b040012fbbe9922cb177461e
CRs-Fixed: 2028128
2017-07-12 20:12:49 -07:00
Frank Liu
a6e0694098 qcacmn: fix start modules fail on sdio card
When open sdio bus, "probed" will be checked and increased, but it's not
decreased in close sdio bus, so if driver goes through hdd_wlan_startup ->
hdd_wlan_stop_modules -> __hdd_open process, it will fail to open the sdio
bus and to bring up the interface.

The fix is to remove the static variable, since the check is trivial for
two reason:
1. driver control flow guarantee no re-enter;
2. if re-enter happen, it is no harm.

Change-Id: Ie701fb44732600440aa70ff28f62fe766d4271e7
CRs-Fixed: 2066582
2017-07-11 23:48:17 -07:00
Wu Gao
f5bb0ac31b qcacmn: Free global pointer ol_sc
For TF SDIO chip, it allocated memory for global pointer ol_sc, but
doesn't free when unloading, which cause memory leak.

Change-Id: Ia27be884ccbaaeb01c9fd5b67898e6f7e4c54364
CRs-Fixed: 2070479
2017-07-06 06:19:48 -07:00
Rakesh Pillai
13146458f9 qcacmn: Fix CLANG warnings in Data path
implicit conversion from enumeration type 'A_STATUS' to different enumeration type 'QDF_STATUS'
implicit conversion from enumeration type 'QDF_STATUS' to different enumeration type 'A_STATUS'

CRs-Fixed: 2063344
Change-Id: Id3613d0b7fca58c3d94c5af59838b0bff3ef26de
2017-06-30 22:50:37 -07:00
wadesong
c79aed0d8c qcacmn: Wakeup target when configuring PCI-E legacy ISR
Wakeup AR6320 target when PCI-E legacy ISR is configured to
avoid a subsequent crash while interrupt is handled

Change-Id: I3d24f3b7e06c05ba43f631daaeb75af419ed13a5
CRs-Fixed: 2035618
2017-06-30 05:40:32 -07:00
tfyu
2c6845fe26 qcacmn: Increase bus request number from 64 to 105 for SDIO
qcacld-2.0 to qcacmn propagation

The resource of bus request buffers will be exhaused after enabling PTP
feature, which change the data path to OTA path for SDIO solution. So
increase bus request number from 64 to 105 will fix this issue to avoid
memory leak, credits missing and throughput drop issue.

Change-Id: Ic3bb5cea72bcc6a8d3dfd910294efd871fe7e938
CRs-Fixed: 2054177
2017-06-28 21:33:29 -07:00
Keyur Parekh
fad6d088fa qcacmn: Packet log changes for wifi3.0
Change-Id: I82462f426e4e449c5bc65331e39f07a062e8e242
2017-06-27 23:37:33 -07:00
Manikandan Mohan
64c3d8438f qcacmn: Add athdiag support for QCA6290
Add support for athdiag read / write using PLD APIs.

Change-Id: I5ce8a10bb44342427c97c02d1b6d05db026ef78a
CRs-fixed: 2046045
2017-06-27 18:12:58 -07:00
Houston Hoffman
7622cd32b0 qcacmn: Kill bh execution contexts before cleaning up the hif
The interrupts are being freed, but the execution contexts are not
guaranteed to be stopped.  Ensure the execution contexts are stopped
to prevent race conditions between the cleanup and normal execution.

Change-Id: I77f2e0fb7073dbb3337e1cbbb6ed09295c7ea23e
CRs-Fixed: 2030393
2017-06-21 19:40:51 -07:00
Mohit Khanna
5d6386f288 qcacmn: Fix core_ctl_set_boost "off" ref count
In current implementation, we may call core_ctl_set_boost(false) even
if its already been turned off an a previous occasion. This leads to
excessive prints in the kmsg "Error turning off boost. Boost already
turned off"

Fix the ref_count such that we donot call the API to turn
core_ctl_set_boost "off", if it is already off.

CRs-Fixed: 2034738
Change-Id: I6e0760c9e6778087f8de6e5329bcaf110c7b264b
2017-06-21 19:40:50 -07:00
Pamidipati, Vijay
84e3394a3c qcacmn: Add a check for target_type for accessing CE legacy registers
In ce_services, check if target type is srng based and access legacy registers
only if it is not, for APIs which are common between legacy and srng-based
targets

Change-Id: I515026cd9b6d14accd4c219c6d03134a36cc3db6
2017-06-16 17:12:22 -07:00
Pamidipati, Vijay
3d8e1e8655 qcacmn: Enable interrupts for DP Rx Error release and REO status rings
Initialize correct mask values to enables Rx error and status ring interrupts

Change-Id: I717fbea492f12d983fb57d964996f4b79c73cb38
CRs-Fixed: 2004658
2017-06-16 17:12:19 -07:00
Balamurugan Mahalingam
20802b298f qcacmn: add target_ce_config and target_service_to_ce_map for ipq8074
Populating the data structure target_ce_config and target_service_to_cemap
for IPQ8074 platform. These two data structure will be passed to the Q6 target
over QMI later during wifi up for the target side initialization.

CRs-Fixed: 2051118
Change-Id: I5cbe62594b66dab18f01968b9c15d6bfaf93b585
2017-06-16 17:12:17 -07:00
Dustin Brown
ccf859d9f5 qcacmn: Refactor Unit-Test Suspend
Unit-Test suspend needs to be decoupled from the copy engine
implementation in HIF. Split the HIF portion of Unit-Test suspend into
their own files, and clean up naming, etc.

Change-Id: Ic36c5b98c505f6b62ddf94336838a9e53fe8aa78
CRs-Fixed: 2055328
2017-06-16 09:49:14 -07:00
Tallapragada Kalyan
1be17fcd6b qcacmn: replace irq name from wlan_ahb to the actual name
when we issue cat /proc/interrupts we see wlan_ahb for all
wlan interrupts, now replaced it with proper names to make
it easy to debug

Change-Id: Ib447cce7ffc2844b9f21f579aa50b6a1cfc2e001
2017-06-14 15:53:38 -07:00
Karunakar Dasineni
7b61c6ca74 qcacmn: WAR for CE status ring timer intr issue
Enable timer threshold interrupts for CE destination ring.

Change-Id: I851283a5ae6dc6d0f237aa90fdf401fd52794377
2017-06-12 17:19:24 -07:00