Commit Graph

670 Commits

Author SHA1 Message Date
Ajit Pal Singh
83301871d5 qcacmn: qcn7605: Increase TX URB count to 64
Increase TX URB count to 64 for QCN7605. It is seen that sometimes
the URB count reaches to zero on HTT endpoint.

Change-Id: If6ccf9b11a6fd13d327b47b6bef8db2b10a1d0f9
CRs-Fixed: 2412376
2019-03-26 12:02:26 -07:00
Kai Liu
f26fa0e5a4 qcacmn: cancel target sleep timer in hif suspend callback
According to PCIe controller suspend logic, RC will disable its regulator
and clock in suspend phase that means in noirq suspend phase, client EP
should not access PCIe bus anymore.
Target sleep timer will access soc register, so wlan driver needs
guarantee this timer is stopped after RC shutdown its power and clock.

CRs-Fixed: 2376675
Change-Id: If76abab1fd4d8d6f36beb13d1b62a7e0a0e7aa4f
2019-03-26 10:30:27 -07:00
Akshay Kosigi
181b2f52e6 qcacmn: Clean up HIF module to remove CONFIG_WIN macros
Replace CONFIG_WIN macro definitions with feature based macros
for HIF module.

Change-Id: I31a3ef0f70d19f838e2dff0db345e765a0aeb84e
CRs-Fixed: 2407222
2019-03-14 19:27:51 -07:00
Mohit Khanna
513781344d qcacmn: Donot update NAPI stats for CE with NAPI disabled
In case NAPI is disabled on a CE (and tasklets are used instead), donot
update NAPI stats for the CE.

Change-Id: Iaf464df9a8520d705f73f7be355736ae2f1aaf5b
CRs-Fixed: 2412599
2019-03-13 19:41:26 -07:00
Rakshith Suresh Patkar
fbe297b129 qcacmn: Move htt_rx specific macros from hif to htt
Remove htt_rx specific macros from hif layer.

Change-Id: I87a6ccce9501fa52c798195b01a1ffa873ec2d73
CRs-Fixed: 2412211
2019-03-12 10:01:34 -07:00
Vivek Natarajan
8ffebb8063 qcacmn: Fix memory leak of reset_control
The below change:
qcacmn: Use wrappers for bus-oriented OS API's
missed to release the reset_control leading to
a memory leak.

Change-Id: Ifea18db27fc78f686934b096b513128b1a65da9e
2019-03-04 23:46:14 -08:00
Nijun Gong
1eb84e39fe qcacmn: Remove improper kernel API for coherent memory
Memory allocated by dma_alloc_coherent() doesn't need cache sync, which
is only needed for stream dma mapping, eg, mapping passed-in memory
using dma_map_single().

More seriously, when SMMU enabled, physical memory returned by
dma_alloc_coherent() is no longer continuous. If pass this memory to
dma_sync_single_for_device(), a do_bad_area exception will hang system,
noting that dma_sync_single_for_device() only handles single contiguous
memory. Refer to Documentation/DMA-API.txt for more info.

Change-Id: Ia0b5bdcc2cb9335aa2e309efccd91e57e844c7cc
CRs-Fixed: 2381886
2019-02-26 21:18:50 -08:00
Ajit Pal Singh
79f6d9e609 qcacmn: Reduce hif usb logging
Remove function entry/exit logs in hif_send_head(),
usb_hif_post_recv_bundle_transfers(), usb_hif_cleanup_recv_urb() and
usb_hif_post_recv_transfers().

Change-Id: I5638d99b4c6a3ace792a81957735c3ccd2d405f9
CRs-Fixed: 2398290
2019-02-26 11:30:23 -08:00
Venkata Sharath Chandra Manchala
cad74add80 qcacmn: Add support for full pktlog
1. Enable CE5 and allow it to service
   pktlog messages from the firmware.
2. Register full pktlog callback handlers
   for handling sw_events and full tx pktlog.

Change-Id: Ifb70ac0993f2402201f88758845f730cf677b1a0
CRs-Fixed: 2388906
2019-02-21 23:25:30 -08:00
hangtian
3a6512aff1 qcacmn: Use qdf_mem_zero for zero initialization, hif part
Use qdf_mem_zero for zero initialization, hif part.

Change-Id: Iada5aa04a2bf1f04bed6a0af7ee6ba4175997025
CRs-Fixed: 2378005
2019-02-21 01:46:47 -08:00
Nirav Shah
3e6e04bc0c qcacmn: Fix epping mode for QCN7605
Epping mode is currently borken in qcacld-3.2 codebase.
Fix epping mode for QCN7605 for USB and PCIe interface.

Change-Id: I5ae5ff70b77836cdd6c3d002cf98d4949838b624
CRs-Fixed: 2400180
2019-02-21 01:46:35 -08:00
Kiran Venkatappa
c5de90ee5d qcacmn: Reduce CE1 buffers to 128 for qca8074
CE1 is used only during initial endpoint exchange and some control
exchange like cookies. On HK, there is no need to enqueue 512 buffers.
Hence reduce it to 128. This provides a savings of 384 buffers or ~1.5M.

Change-Id: I2b3a58c1d7a914194d842824945d12ae7c9ebb05
CRs-Fixed: 2401025
2019-02-20 05:02:32 -08:00
Kiran Venkatappa
e9f72e08e2 qcacmn: Reduce WMI max message size on low mem profile
Current max message size of 2048 will result in a 4K slab allocation due
to padding and shinfo additions. We observed that most of the WMI
allocations are within 1600 and there is no need to set max bu size as
2048. Hence reduce max buf size to 1700 for low memory profile so that
allocation on host result in a 2K skbs.

Change-Id: Icb25be0f4ce60112ef6293f39f9dcc57ebc0288c
CRs-Fixed: 2394768
2019-02-15 10:34:02 -08:00
Madhvapathi Sriram
bfb0112412 qcacmn: Remove error log for qdf_mem_malloc in hif/htc files
qdf layer already has the error trace

Change-Id: I83441fb5ab2e954f670f2891ecec8fccf5abf9a7
CRs-Fixed: 2376419
2019-02-12 04:47:40 -08:00
Venkata Sharath Chandra Manchala
9cfe0f763d qcacmn: Reduce log level for athdiag requests
Reduce the log level from INFO to DEBUG for
athdiag read and write requests.

Change-Id: I37c3842f498ebc85386b1fa8fbb3b228eed6d9b5
CRs-Fixed: 2393714
2019-02-11 21:32:36 -08:00
Ashish Kumar Dhanotiya
ad85c38928 qcacmn: Update driver timer APIs according to kernel 4.19
There are some changes to timer APIs in latest kernel,
update driver APIs accordingly to invoke correct kernel
APIs for timer functionalities.

Change-Id: Ie017c8b1ef8237ca34f696c23509519a1187167c
CRs-fixed: 2383574
2019-02-02 15:27:54 -08:00
Kai Liu
205e8d0726 qcacmn: Fix compile error when enable NAPI_DEBUG
Fix compile error and refine NAPI log when DEBUG option is enabled

Change-Id: Ia2bb8235f92bf4ef2d381deccec707749dbab54d
CRs-Fixed: 2389541
2019-01-30 08:26:26 -08:00
Nirav Shah
bc8daa44ae qcacmn: Changes to support rri_over_ddr support for Genoa
Changes to support rri_over_ddr support for Genoa.

Change-Id: I9b14b4622a5e4413eaee9caec1f9e540db9bab7f
CRs-Fixed: 2357346
2019-01-30 00:03:10 -08:00
Pavankumar Nandeshwar
7eddeddb17 qcacmn: Make ce-debug lock per HIF
Make ce-debug buffer lock per HIF instead
of global. Rectify the #if conditional macros.

Change-Id: I0063014ed2fd9c7716386877dcbefec40e9fa2d9
2019-01-28 12:20:49 -08:00
Jun Wang
62fe1e3f45 qcacmn: Fix core_ctl_set_boost not released issue
hdd_napi_serialize(0) will call hif_napi_event() with
NAPI_EVT_USR_NORMAL mode. But in this mode, blacklist_pending
is not set as BLACKLIST_OFF_PENDING, so the function
hif_napi_core_ctl_set_boost(false) is not called.
Then core_ctl can not resume to normal status, which
will result in performance and power issues.

Change-Id: Ia2084d9febab0ff4aadb0951bd3347f608a1d101
CRs-Fixed: 2381895
2019-01-22 05:06:39 -08:00
Debasis Das
a5e316fb7e qcacmn: Fix array out-of-bounds in target CE config array
The CE11 in target CE config array is used, but not allocated.
Fix this by allocating memory for CE11 in the global structure.

Change-Id: I85088f5a832aec037a1e46eed4b72ac4228fde44
CRs-Fixed: 2365435
2019-01-19 03:17:01 -08:00
Kiran Venkatappa
cb001d8dd4 qcacmn: Increase WMI event ring size for qca8074
QCA8074 platform supports DBS(two radio) and DBS_SBS(three radio)
modes. In these cases, same WMI event ring is shared for all the
radios. Increase the WMI event ring size two absorb host delays
due to lower clock platforms. This increase is required even to
support three radios.

Change-Id: I1aa08b8fa879f6ec54c838541a0e4c4e5871b60a
CRs-Fixed: 2378193
2019-01-16 12:57:09 -08:00
Alok Kumar
6fef0e9592 qcacmn: Reset rx_pending to avoid continuous tasklet scheduling
The rx_pending flag is never set to 0 if the check for
TARGET_REGISTER_ACCESS_ALLOWED(scn) is failed when target is
not reachable. Since, the rx_pending flag is not set to 0,
ce_check_rx_pending(CE_state) check inside ce_tasklet() will
be true and tasklet gets rescheduled again and again.

Reset the rx_pending flag before TARGET_REGISTER_ACCESS_ALLOWED(scn)
check in ce_per_engine_service() to avoid continuous scheduling of
tasklet when check for TARGET_REGISTER_ACCESS_ALLOWED(scn) fails.

Change-Id: Ib9268e6cf2bdcd0ed0bf84934e9370bcef1cdbab
CRs-Fixed: 2375307
2019-01-14 12:58:59 -08:00
Krunal Soni
3c2c211d37 qcacmn: In SAP-WOW-D0 state, wake-up FW on receiption of unicast pkt
When unit test command "iwpriv wlan0 wlan_suspend 0 0" is issued on
SAP-DUT (given that one REF-STA is connected), FW would go in WOW-D0
state. In this state, when HW receives the pkt from peer (REF-STA), it
generates MSI (REO-interrupt) and host process this pkt but it doesn't
wake-up the FW. Due to this situation, no TX is happening on SAP after
issueing wlan_suspend command.

This situation only happens when iwpriv command issued as this command
would be fool the FW by notifying that APSS is in power-down state but
actually it is not in active state. When APSS is really in power-down
state then up-on receiption of any RX pkt would wake-up the APSS and
this waking-up process would wake-up FW as well.

Fix this situation by sending explicit FW wake-up event.

CRs-Fixed: 2325860
Change-Id: I18937e5c568c742f838cdf3f815c2184a916283c
2019-01-07 19:59:13 -08:00
Nirav Shah
8e93027a2e qcacmn: Changes to support QMI BYPASS for Genoa
Changes to support QMI BYPASS for Genoa.

Change-Id: I371e7f3413d6dec95eee64babcd8f3aaebaf7f3b
CRs-Fixed: 2357361
2019-01-03 18:32:55 -08:00
Rakshith Suresh Patkar
ee84fbeea2 qcacmn: Use global variable for cpumask
Local variable is used to store cpumask to send it to
irq_set_affinity_hint and qdf_dev_set_irq_affinity APIs.
This memory is used by the kernel later outside the
current contect resulting in invalid memory access.

Fix this by using global variables to store cpumask.

Change-Id: I086f40bf1b3499d2c2ccb1ce18140b2dc2761d04
CRs-Fixed: 2373548
2019-01-02 03:53:07 -08:00
Ajit Pal Singh
d1698b6d90 qcacmn: Rename CONFIG_QCN7605 as QCN7605_SUPPORT
Rename CONFIG_QCN7605 as QCN7605_SUPPORT since QCN7605_SUPPORT
is already present/being used.

Change-Id: I1739bf86a9eb02aa6920f06bc929f686a5fa8f54
CRs-Fixed: 2369622
2018-12-26 01:21:24 -08:00
Vinay Adella
77d43a89b9 qcacmn: Fix array out-of-bounds in the during CE config
The unused CE11 is accessed in ce_construct_shadow_config_srng,
but not allocated.
Fix this by allocating memory for CE11 in the global structure

CRs-Fixed: 2365374
Change-Id: Iefd9129e486891e27f5964eecc1a2d1efc080d06
2018-12-19 09:32:25 -08:00
Krunal Soni
ce2009b364 qcacmn: Clean-up all peers in-case of SSR
Current driver doesn't clean-up all the peers because the TARGET
state is not marked as reset and due to which nobody is there to
mimic fake peer unmap events to reduce the reference count.

Also, there is no peer delete API being called as well in case of SSR.
Identify the TARGET state in-case of SSR by calling HDD callback
and mimic the unmap events and call peer delete API as well.

CRs-Fixed: 2350285
Change-Id: I878b7a15701c01ac9ef80010086f7e868a631a74
2018-12-14 16:06:30 -08:00
Edayilliam Jayadev
780b60ea90 qcacmn: Remove CONFIG_WIN from spectral
Remove CONFIG_WIN from spectral module to achieve maximum
possible convergence.

CRs-Fixed: 2354105
Change-Id: I59e4d8029fcf096042741573cf020136747e7367
2018-12-11 06:11:13 -08:00
Ajit Pal Singh
625413c918 qcacmn: Call pld_wlan_enable() from usb_bus_configure()
When PLD_USB_CNSS is enabled, call pld_wlan_enable() from
hif_usb_bus_configure().
Do not call pld_wlan_enable() when QMI is not enabled.

CRs-Fixed: 2325591
Change-Id: Ie710f8aea1b5ceb9d3a633348858775b2ff462d5
2018-12-04 12:50:41 -08:00
Rajeev Kumar
d60134e91d qcacmn: Log link up/down logs to console using info log level
PCIe link up/down voting is critical hence log it using info level
log on console.

Change-Id: Iea2be05cf9ea5231b0e2de54b508d49aec341847
CRs-Fixed: 2357793
2018-11-30 08:28:26 -08:00
Dustin Brown
da4fb2ad20 qcacmn: Avoid marking MSI as wakeable
On MSM platforms, MSI vectors are always wakeable, so calling
enable_irq_wake() on an MSI vector interrupt line is a no-op.
Additionally, on some product lines, this call will fail. This causes
suspend to fail despite the MSI already being wakeable. Simply avoid
marking the wake MSI as wakeable during suspend as a work around.

Change-Id: I32b2b4fb231681ad29b4e98b2410d0eb6e68c671
CRs-Fixed: 2357784
2018-11-29 23:33:28 -08:00
jitiphil
a3be364dfb qcacmn: Free buffer in ath_procfs_diag_read
A read buffer is allocated and used in
ath_procfs_diag_read and it is not freed
in one exit path which causes a memory leak

Free read buffer in all exit paths of
ath_procfs_diag_read

Change-Id: I1b2446a99f53c2f9130d395dd316eb4649eb24db
CRs-Fixed: 2352165
2018-11-29 18:12:12 -08:00
Basamma Yakkanahalli
5f7cfd49c2 qcacmn: Device and Target type support for qca6018
Added target and device type support for qca6018.

Change-Id: I85382bf053d0a5f34cfaf0cca78a4b66b4265989
CRs-Fixed: 2323023
2018-11-27 00:32:00 -08:00
Basamma Yakkanahalli
30265f8aeb qcacmn: add target_service_to_ce_map for ipq6018
Populating the data structure target_service_to_ce_map
for IPQ6018 platform.

Change-Id: If89f873a6124240f56b93b4b12464a1e388df272
CRs-Fixed: 2324518
2018-11-27 00:31:56 -08:00
Pavankumar Nandeshwar
ad5e0bd66f qcacmn: Change fwlogs API for smartlogs
Add function pointers for calling smartlogs init and deinit.

CRs-Fixed: 2008290
Change-Id: I4734e490394a24f5a39eb50f3ac386ad99834cb3
2018-11-19 11:05:49 -08:00
Lin Bai
e4599388bd qcacmn: Fix variable uninitialized compiler error
Initialize revision_id to avoid compiler error as
'variable may be used uninitialized'.

Change-Id: Ia76b297e0f0f745284c7d0ede72a55dcc3d0dc65
CRs-Fixed: 2350601
2018-11-18 22:08:01 -08:00
Alok Kumar
80488cef11 qcacmn: Fix NULL pointer derefence and possible OOB issue
Add validity check for possible OOB and NULL pointer dereference

Change-Id: Icc51ee44271b575bf6b7a6fb83f074c8729cd887
CRs-Fixed: 2347448
2018-11-16 13:34:45 -08:00
Pamidipati, Vijay
a59b5607c6 qcacmn: Split Tx and Rx indication handling
Add support to handle Tx completion processing and Rx processing into
different NAPI threads/contexts for Lithium DP

Change-Id: I4f5c6ef3ce969ce457e26cf3e8305df1ae782f09
2018-11-14 12:20:34 -08:00
jiad
4320219982 qcacmn: Fix format build error
This change fixes build errors with compiler option
-Werror=format=.

Change-Id: I98b93f776c7d58a12d93e1be3a6acf34486ddfab
CRs-Fixed: 2344756
2018-11-08 09:40:18 -08:00
jiad
a007ac831b qcacmn: Abstract BMI CE callbacks
As part of WIN BMI modularization, hif_bmi_register_callbacks
are removed from if_pci.c in qcacmn project. As a result,
MCL needs to invoke hif_bmi_register_callbacks in qcacld project.

Fix is to define hif_bmi_register_callbacks for SDIO and USB builds
so that SDIO and USB products can build when WLAN_FEATURE_BMI is
defined.

Change-Id: I559af0205dd4671214a8d7f2972fdba379e10b6a
CRs-Fixed: 2332250
2018-11-02 19:11:43 -07:00
Nirav Shah
eeb9962b24 qcacmn: Fix compilation error due to uninitialized variable
Fix compilation error due to uninitialized variable(write_index)
in hif_ce_bus_late_resume function.

Change-Id: Ia69e56cf74f2970dd0c047740d6499bb5ce07563
CRs-Fixed: 2317219
2018-10-30 05:08:26 -07:00
Padma Raghunathan
aa83faab41 qcacmn: Lithium_DP: HAL support for qca6018
Interface files to access QCA6018 HAL registers

Change-Id: I5152d9fe0aae31609a82a32ee405e12a02a5aa25
CRs-Fixed: 2323724
2018-10-30 00:24:01 -07:00
Aditya Sathish
80bbaef931 qcacmn: Separate WLAN fastpath featured CE service APIs
Move WLAN fastpath featured CE service APIs to ce_service_legacy.c
since they are not used by any ce_service_srng.c APIs.

Change-Id: I7bb51025c477e8e2428479e41baed274ee4f7cae
CRs-Fixed: 2324003
2018-10-29 03:11:50 -07:00
Venkateswara Swamy Bandaru
9578c2adec qcacmn: Fix napi bucket calulation issue
In case of fast patch CE_state->receive_count can go beyond
HIF_NAPI_MAX_RECEIVES as batch processing is happening. This
is causing bucket calculation working. In this case setting
receive_count to HIF_NAPI_MAX_RECEIVES as a fix.

Change-Id: I3179b6f9f893342ead68e46dc4b75fd55e6c7839
CRs-Fixed: 2331579
2018-10-25 05:32:15 -07:00
Ajit Pal Singh
63e08b3c01 qcacmn: Pass product_id to hif_get_device_type()
Pass product_id instead of vendor_id to hif_get_device_type().

CRs-Fixed: 2325562
Change-Id: I7341a97ddb58c067a3b7aa78803f57922f87c6e9
2018-10-19 04:38:36 -07:00
Dustin Brown
2f750878bc qcacmn: Statically allocate CE desc history for MCL
As part of convergence, the CE descriptor history was moved to dynamic
allocation, per HIF handle. For MCL, this caused the allocation to
consume limited pre-allocated memory, causing regressions. For the MCL
implementation of alloc_mem_ce_debug_history(), use a static buffer
instead to avoid complications.

Change-Id: I8b0c0a2502d4abfd465749328a35004ffed585ca
CRs-Fixed: 2335146
2018-10-18 08:13:36 -07:00
Pratik Gandhi
8af026a2ca qcacmn: Abstract BMI and add export symbols for ko separation
Abstract BMI callback from common module and move it to specific component.
Add Export symbols to support modularization in WIN. (BMI)

CRs-Fixed: 2324081
Change-Id: I1ec463d41d238ce81254ecc1f0bb1dc545e1248e
2018-10-18 06:32:45 -07:00
Mohit Khanna
ba7a798164 qcacmn: Fix to free ipa_ce_ring only when it is not already freed
While freeing IPA CE status ring during driver unload, hit data abort
since ipa_ce_ring data structure is already freed.
Fix not to alloc/free ipa_ce_ring for sring based target and
to alloc/free ipa_ce_ring only when it is not already allocated/freed.

Change-Id: I25081f9c2bad7ba9119926cf089f471463dff69a
CRs-Fixed: 2291969
2018-10-16 16:58:39 -07:00