Commit Graph

670 Commits

Author SHA1 Message Date
Jayachandran Sreekumaran
f24399cc78 qcacmn: Enable mission mode through qmi signalling
Enable mission mode in fw through qmi signalling.

Change-Id: I539d7b8bb1f38b2cb526704c225bf4535fcc8543
CRs-Fixed: 2504541
2019-08-12 22:19:16 -07:00
Nandha Kishore Easwaran
5d3475b985 qcacmn: Initial changes for pine
Add device ID change and target type checks for pine.
Also remove memory war added for Hk emulation.

Change-Id: Idf531a48a03202d4fb241a92a1d671ee2b94cfbd
CRs-fixed: 2453899
2019-08-11 02:11:41 -07:00
Vignesh Viswanathan
7c974c29d3 qcacmn: Add support for separate FTM Coldboot Calibration mode
Add support for separate Coldboot calibration mode (10) for Coldboot
Calibration in FTM Mode.

Change-Id: I8e4e2c370053b55c3755339d7ead863ba950856e
CRs-Fixed: 2497548
2019-08-08 11:38:07 -07:00
Saket Jha
5cdfcc879e qcacmn: Change return type to QDF_STATUS
Changing return type of ce_send_single and hif_send_single functions
to return QDF_STATUS instead of int so caller can handle as needed.

Change-Id: Ifa0db300982e22c2784662492727923e4614c2b7
CRs-Fixed: 2468534
2019-08-06 02:48:59 -07:00
Yue Ma
5b5238a050 qcacmn: Add runtime PM put sync API
Runtime PM put sync API will make sure runtime PM suspend happen
right away if usage count is 0.

Change-Id: I70f6fe4ed015195874ef4cac61de9ef5d739b689
CRs-fixed: 2502382
2019-08-05 15:32:08 -07:00
Nirav Shah
69fd90a11c qcacmn: Increase Source ring size of HTT TX Copy Engine for QCN7605
Increase Source ring size of HTT TX Copy Engine for QCN7605
to avoid packet drop in DBS throughput scenarios.

Change-Id: I3f48579b88034a1eddb53d67ee161bd920ac848a
CRs-Fixed: 2496049
2019-08-02 05:00:25 -07:00
Visweswara Tanuku
cf1f958b5f qcacmn: SDIO HIF Layer refactor
1. Add ADMA channel registration APIs
2. Add ADMA support for TX and RX path
3. Remove async_task thread for ADMA, since transfer thread is
   present in the SDIO AL layer
4. Move hif functions which are legacy only to mailbox.c
5. get_hif_device and hif_sdio_set_drvdata changes for mailbox and adma
6. Add rx buffer allocation offload work

Change-Id: Ie98b302176381035b1bd590ef35a977aeef4f09c
CRs-Fixed: 2274807
2019-08-01 01:40:14 -07:00
Yue Ma
e92fe029df qcacmn: Do runtime pm sync resume when printing ring stats
Printing ring stats from requesting txrx stats needs access PCIe link
so make sure it is resumed by doing a sync resume if it is runtime PM
suspended. Also response of h2t_ext_stats_msg from FW is not guaranteed
so tag it properly so that in HTC layer, corresponding "put" API will
be called right after sending the packet.

Change-Id: Idc5797b38557ed5779d920c72200b9d28769ab58
CRs-fixed: 2487521
2019-07-27 18:21:26 -07:00
Akshay Kosigi
8eda31cab3 qcacmn: Remove void ptr usage in HAL
Add code to replace usage of void pointers from
HAL layer and instead use appropriate opaque pointers

Change-Id: Id950bd9130a99014305738937aed736cf0144aca
CRs-Fixed: 2487250
2019-07-27 13:43:07 -07:00
Akshay Kosigi
4002f765f1 qcacmn: Change to remove void pointer usage for HIF handle
Add code to remove void pointer usage for hif_handle
and use opaque pointer hif_opaque_softc and also use
cdp_soc for opaque DP soc handle

Change-Id: I2896f7704ffb809214c5b08756c4b8673307fd9e
CRs-Fixed: 2487247
2019-07-27 13:43:00 -07:00
Yue Ma
4986b2588b qcacmn: Log runtime PM resume source
It is very critical to know the source of who requests runtime
PM resume to debug all kinds of runtime PM related issues. Hence
log them accordingly.

Change-Id: I9551830b1cb567fd29e9d9bbec18705f9cc5e9ec
CRs-fixed: 2496481
2019-07-27 02:49:10 -07:00
Yue Ma
41e3af09f7 qcacmn: Set WAKE MSI monitor variable before enabling WAKE IRQ
After enabling WAKE IRQ during runtime PM suspend, it is able to come
anytime because device wants to wake up. In order to avoid missing
to handle the IRQ and missing resume, set WAKE MSI monitor variable
before enabling WAKE IRQ.

Change-Id: I450e2d7a28f68818e12ff000a36275707a9b97b0
CRs-fixed: 2496603
2019-07-27 02:49:07 -07:00
Yue Ma
99ffbda5dc qcacmn: Avoid disable/enable twice for runtime PM suspend/resume
Commit 13835b1aa2 ("qcacmn: Do not access bus in suspend_noirq")
adds enable/disable WAKE IRQ through hif_apps_irqs_enable/disable
APIs to bus suspend/resume routine which are also called by runtime
PM routine. However, runtime PM suspend/resume routine will also
enable/disable WAKE IRQ by itself so WAKE IRQ will be disabled twice
and only enabled once before entering suspend so the WAKE MSI will
be masked which results device requested resume failure. It is also
same for resume path. Hence remove enable/disable WAKE IRQ from
runtime PM routine.

Change-Id: I5774d0450c70f3ff74ea81dc44ef3656eb8c7a96
CRs-fixed: 2495897
2019-07-27 02:49:04 -07:00
Yue Ma
fd75cd2948 qcacmn: Remove WLAN_SUSPEND_RESUME_TEST flag for WAKE MSI handler
WAKE MSI can be triggered and handled properly for both unit test
framework and runtime PM feature in runtime, so there is no need
to have a compile time flag. Hence remove it.

Change-Id: I97127575114d6be40b36a7417cc7c177cec69808
CRs-fixed: 2496366
2019-07-26 12:16:08 -07:00
Kiran Venkatappa
a516abcc57 qcacmn: Mark CE5 as unused when pkt log is disabled
Mark CE5 as unused when pktlog feature is disabled. This provides memory
savings by skip configuration and replenish of the copy engine used for
packet log

Change-Id: I1bdd3355b84f257a2dbfe58a2752824a096b81e8
CRs-Fixed: 2495320
2019-07-26 09:27:12 -07:00
Vevek Venkatesan
ad55b14e32 qcacmn: converge target type defines for both MCL and WIN
Converge definitions of target types for both MCL and WIN.

Change-Id: I501d39ff5989747ddd22b08cb390bb4601c5dd0b
CRs-Fixed: 2484512
2019-07-24 21:43:24 -07:00
Mahesh Kumar Kalikot Veetil
bde1772622 qcacmn: Enable ASPM for FTM mode
Modify hif_pci_enable_power_management() API to enable pci ASPM for
FTM mode.

CRs-Fixed: 2491213
Change-Id: Ia421ee2af9ae270f5138ac5b8ff52680fbfe9679
2019-07-18 14:23:13 -07:00
Surabhi Vishnoi
b30b9176a2 qcacmn: Add target ce configs based on pktlog feature for Adrastea
When pktlog feature is disabled then the target CE11 attributes
should be set to CE_ATTR_DISABLE_INTR. Currently, the target ce configs
are attached unconditionally. This leads to incorrect attribute set for
CE11 in case when pktlog feature is disabled and thereby abortion of
HWDTIM in target as target checks host_ie for CE11. Currently host_ie
is not set for CE11, this results in aborting of suspend mode as
target assumes that host is using CE11.

To mitigate this issue, attach the target ce configs based on pktlog
feature. When pktlog feature is disabled then set the host_ie for
CE11 which will indicate to target that host is not using CE11 and
target will not abort HWDTIM mode.

Change-Id: I331d3bd8eda0c2aba9d86fb7601ac2b74c9e2c31
CRs-Fixed: 2459887
2019-07-12 02:05:28 -07:00
Nandha Kishore Easwaran
aa28cc38a3 qcacmn: Adding hal for pine
Added new hal folder for pine. Included hkv2 functions whereever possible
to make sure there is not much code duplication.

Change-Id: I13247beb1af0b250f8e1bf182005f2513bdf9902
2019-07-11 04:53:43 -07:00
Yu Ouyang
5936495779 qcacmn: fix pcie card enable issue without CNSS module
For 3rd party platform, without CNSS module, PCIe card failed
to enable.

Function hif_pci_enable_bus() should call hif_enable_pci_nopld(),
not hif_enable_pci_pld(). So, checking platform driver supported
or not before enable bus. If platform driver is not supported,
return false in function hif_is_pld_based_target().

CRs-Fixed: 2439335
Change-Id: I57a1272f082e7ba1fbeee43d58a81997f3d0e6d7
2019-07-08 12:10:04 -07:00
Vevek Venkatesan
0ac9aafb9a qcacmn: remove qwlan version string dependency
Remove QWLAN_VERSIONSTR dependency in cmn code, so that it would
be used in driver itself, part of CONFIG_MCL/CONFIG_WIN cleanup.

Change-Id: Iec0cefe1d9e39a5b5546c7b007cc0858044cdc7b
CRs-Fixed: 2481053
2019-07-02 08:39:23 -07:00
Vevek Venkatesan
94a976d817 qcacmn: move HIF_CONFIG_SLUB_DEBUG_ON define to driver Kbuild
Move definition of HIF_CONFIG_SLUB_DEBUG_ON to driver Kbuild,
to cleanup CONFIG_MCL/CONFIG_WIN dependency.

Change-Id: I563d248413c98d7704e32ae06c260c02d915495a
2019-07-02 02:40:18 -07:00
Yue Ma
fab77ad949 qcacmn: Do not request runtime PM resume for system resume
Firmware will trigger WAKE MSI for both runtime PM and system
resume. There is no need to request runtime PM resume again if
it is a system resume. Check the flags to avoid doing so.

Change-Id: I70bdfadf1d7c0ffd4e2849458c6aee6931037cd3
CRs-fixed: 2479631
2019-06-29 00:16:31 -07:00
Jinwei Chen
5372d55f63 qcacmn: fix invalid access to hif_ext_group issue
hif_ext_group is not initialized if DP interrupt is not registed
like monitor mode, invalid access will happen in function
hif_hist_record_event.

if hif_num_extgroup is 0, stop access to hif_ext_group member.

Change-Id: Id4432577446caa8887ca6d1fb8b669dda8c9fdf3
CRs-Fixed: 2475506
2019-06-27 12:30:25 -07:00
Venkata Sharath Chandra Manchala
d8b05b54d7 qcacmn: Add support to log CE DST and STATUS ring events
1. Record hp/tp for ce dst and status ring to keep
   a track of the last reaped and posted buffers.
2. Add union ce_srng_desc to record ce srng descriptor
   information.

Change-Id: I6f4728893d629c60f676826bf806b725326fb83d
CRs-Fixed: 2465492
2019-06-25 13:06:54 -07:00
Akshay Kosigi
af98d7cbbe qcacmn: CONFIG_WIN Macros to be moved out of HIF/HTC
Remove CONFIG_WIN from HIF and HTC module

Change-Id: If5001a16047f802b077e6cd9b211a912df5ca55e
CRs-Fixed: 2349905
2019-06-24 15:44:32 -07:00
Ajit Pal Singh
a1378a3d27 qcacmn: usb: Add support for QCN7605 v2
Add device IDs for QCN7605v2 USB variant.

Change-Id: I5d9d2731068c0d31b78197f3732fb253bf440ea2
CRs-Fixed: 2474407
2019-06-21 08:12:01 -07:00
Rakesh Pillai
2529ae1c8a qcacmn: Add event history logs for datapath
Add support to log the important events in
datapath, which will help in debugging the
datapath issues.

IRQ handler, Napi poll and srng access start/end
are the events which are currently logged.

CRs-Fixed: 2457854
Change-Id: Iba105b0e79443b670a01a929f999f94e00ea92f2
2019-06-17 10:23:01 -07:00
Shashikala Prabhu
5d8eb1544a qcacmn: Increase the number of entries in CE2 ring from 32 to 512
Target assert seen due to host was not reaping the buffers. Therefore,
increase the CE2 entries from 32 to 512 for regular profile build.

Change-Id: I6160ecb070bb98dba0d858f2bef3522ad0b60aa3
CRs-Fixed: 2462117
2019-06-14 10:21:13 -07:00
Shashikala Prabhu
f7b7f5e929 Revert "qcacmn: Reduce WMI max message size on low mem profile"
This reverts commit Change-Id: Icb25be0f4ce60112ef6293f39f9dcc57ebc0288c.

CE2 pipe source ring size is configured as 1700 bytes in LM build where
2048 bytes in regular build. WMI msg size is always hard coded in FW to
2048 bytes in both build. WMI/QMI Pipe configuration is not matching.

Revert CE2 pipe configuration to 2k in the LM build temporarily till FW
updates wmi msg size based ring size configuration.

Change-Id: I2b66097ff9aa23c49fa77fa78b865828f244d108
CRs-Fixed: 2457381
2019-06-14 10:21:07 -07:00
Ajit Pal Singh
cd43faa16b qcacmn: Use highprio work queue
Use highprio system workqueue instead of normal work queue for
USB io_complete_work.
This is to avoid latency for receive and TX complete processing.

Change-Id: I34859a748b607d633b4905b3f06e3345029d4cba
CRs-Fixed: 2456887
2019-06-12 02:49:08 -07:00
Vevek Venkatesan
f48333d03b qcacmn: Remove WCSS_VERSION macros used inside hif
Remove WCSS_VERSION macros which were used for emulation inside
HIF in cmn driver.

Change-Id: I3e7ea5fb795e0cb9dd8c2bc718d8b523e442109d
2019-06-10 09:15:48 -07:00
Yue Ma
e933efffd9 qcacmn: Use IRQF_NO_SUSPEND for WAKE MSI
WAKE MSI needs to be always enabled when system enters suspend so
that firmware can use it to wake up host for PCIe link up cases.
Hence use IRQF_NO_SUSPEND when request IRQ for WAKE MSI.

Change-Id: Ife6171b68319d963e32170c7ef73aef42643ccec
CRs-fixed: 2466873
2019-06-07 11:39:05 -07:00
Ajit Pal Singh
6bc40004ea qcacmn: Protect read of urb_cnt with spin lock
Protect read of device pipe urb count with spin lock.

Change-Id: Ia5d3860e4030155bbc78f47ddda79ae0573465ec
CRs-Fixed: 2451406
2019-06-07 07:05:55 -07:00
Yue Ma
ac6b275768 qcacmn: Record caller and timestamp for pm_runtime_mark_last_busy
pm_runtime_mark_last_busy will extend the timer for runtime suspend.
Recording caller and timestamp can help to debug who may prevent
runtime PM suspend.

Change-Id: I4848a2558197e0fc9b7300421a5a1993817333e4
CRs-fixed: 2457803
2019-05-30 19:29:48 -07:00
Yue Ma
2bdc2baea6 qcacmn: Request runtime PM resume after receiving WAKE MSI
For PCIe DRV (L1SS sleep) suspend, firmware will trigger a WAKE MSI
to wake up host so that request runtime PM resume for this case.

Change-Id: I959d3b1053b7aef5fe80889553958cf9394c8c38
CRs-fixed: 2450284
2019-05-30 19:29:45 -07:00
Rakesh Pillai
51264a63e1 qcacmn: Disable excessive logging during dp init
Excessive logging during dp init causes watchdog
bite when multiple init-deinit cycle is followed.

Change the loglevel to debug, so that it does not
flood the console with logs.

CRs-Fixed: 2444944
Change-Id: I43daab413800424651e3f5edf558360886d7d7fe
2019-05-29 11:08:25 -07:00
Kiran Venkatappa
0df30dd0a0 qcacmn: Mark CE10 as unused for qca8074
CE10 is not used in any endpoint service map. Mark this as unused CE so
that buffer are not enqueued in this CE. This gives a savings of 512
buffers or ~2M

Change-Id: I32f0d332becadb3536a0cb40c4ea88e518f448f6
CRs-Fixed: 2451745
2019-05-21 13:14:35 -07:00
Lin Bai
ec7b3cfb47 qcacmn: Fix driver loading failure on 32-bit ARM
long long div on 32-bit ARM will fail the driver load by -
unknown symbol __aeabi_uldivmod.

Use qdf wrapped do_div() instead.

Change-Id: I689a28c7ee3c7b9bfc87a6b727f2968a59231892
CRs-Fixed: 2433430
2019-05-20 19:05:29 -07:00
Kiran Venkatappa
110d691272 qcacmn: Increase CE1 buffers to 512 for qca8074
CE1 is used for HTT RX after initial HTC control exchange. Hence
increase it back to 512. This reverts  the change
I2b3a58c1d7a914194d842824945d12ae7c9ebb05

Change-Id: Idd7fdcb45f2f8d4188d4e36431b92b6ee443a982
CRs-Fixed: 2450563
2019-05-16 05:57:37 -07:00
Mohit Khanna
e5a6e94464 qcacmn: Restrict RX softirq poll times
The following changes are made

-Yield dp_rx_process if poll time exceeds
-Yield dp_tx_comp_handler if poll time exceeds
-Interrupt statistics to track various interrupt contexts and
 corresponding interrupt masks
-Add poll times histogram buckets to NAPI stats

Change-Id: I8c7a6bbbb97c7b3dd1dde6ac3a97113c433086a2
CRs-Fixed: 2423879
2019-05-14 18:39:59 -07:00
Venkata Sharath Chandra Manchala
ec01bbcfbe qcacmn: Copy HTC Packet data
Make a local copy of HTC buffer before giving it
to Firmware through CE

Change-Id: Ib11ee7f0d7cd7b055768c0fe10627b81383257f3
CRs-Fixed: 2434881
2019-05-13 13:11:33 -07:00
Basamma Yakkanahalli
b85768e4e5 qcacmn: Remove HK header dependencies for ipq6018 compilation
Add target specific HW header for ipq6018 compilation.
Remove the 8074 header dependencies for 6018 compilation.

Change-Id: I8e45e3e039a4596c6722538405dcd381918fa6b1
2019-05-02 01:25:01 -07:00
hangtian
c572f5f517 qcacmn: Memory optimize for QCS403 platform
Memory optimize for QCS403 platform, 1x1 chip. Reduce CE1 htt data
dest ring buffer from 512 to 256, reduce CE2 wmi dest ring buffer from
128 to 64, reduce CE9 & CE10 desg ring buffer from 512 to 64, disable
CE11 pktlog. Note: this change only affect specific WLAN build config for
extremely saving memory, for debug purose, there is another build
selecting default WLAN config for reference HW.

Change-Id: I868e74b09cdb11df3dccaa3f9e051da55724983d
CRs-Fixed: 2432632
2019-04-25 21:54:04 -07:00
Nirav Shah
a9366e3e96 qcacmn: Update copy engine configuration for QCN7605
Update copy engine configuration for QCN7605 to
reduce memory utilization in FW.

Change-Id: Icb387d72eb9cbab55cd665e7400dd1bf2f1201af
CRs-Fixed: 2371184
2019-04-19 06:12:59 -07:00
Manjunathappa Prakash
05f70da365 qcacmn: Do not update source ring hp in completion process
ce_send_entries_done_nolock_srng() source ring Tx completion processing
callback function making the redundant update of previous HP. Further
when actual Tx updates the HP results in 2nd HP update.
Because of race in hardware HP update detection, second write is lost.
Avoid this scenario by not updating HP in Tx completion processing.

Also remove unused ce_send_entries_done and ce_recv_entries_done APIs.

Change-Id: I1eb288cd7fb0ff418d4cec4f8d127cff8fc9822d
CRs-Fixed: 2407394
2019-04-15 15:21:20 -07:00
Ajit Pal Singh
5fc9a33c2e qcacmn: usb: Remove usb_set_intfdata()
Remove usb_set_intfdata() as usb interface private data is not being
used in driver.

Change-Id: I65f718b8abe2f33ec7f180ec265baab9772d30d0
CRs-Fixed: 2427944
2019-04-09 11:56:54 -07:00
Pamidipati, Vijay
37d107d2d1 qcacmn: HIF schedule latency measurement
Add support to measure interrupt latencies, store them
in different "bins" and display the constructed histogram
through user command.

Change-Id: I268be6b39745d550ac7db5d321c2d1fdb2d17d41
CRs-Fixed: 2365812
2019-04-09 04:00:32 -07:00
Jeff Johnson
8d639a00e4 qcacmn: hif: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within hif replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I929cb64ee0523d11bc86d5145aade1ec5a713071
CRs-Fixed: 2418257
2019-03-28 13:13:29 -07:00
Dustin Brown
13835b1aa2 qcacmn: Do not access bus in suspend_noirq
The WLAN suspend process has three phases:
	1) protocol suspend
	2) bus suspend
	3) bus suspend, no-irq

Currently, it is assumed by the WLAN driver that the bus will not be put
down until after step 3. Moving forward, however, the PCIe driver will
be putting the bus link down between steps 2 and 3. In order to
accommodate this, move flushing the tasklets to phase 2, up from phase
3. This will ensure the WLAN driver is done accessing the bus before the
PCIe driver puts it down.

Change-Id: I47a22b7fd940ddc1bad78265b59461c178ee7ad4
CRs-Fixed: 2423628
2019-03-27 12:52:06 -07:00