Commit Graph

63 Commits

Author SHA1 Message Date
Alan Chen
75c2cf25ab qcacmn: Add debug log to print link vote id
Add debug log to print details about the link vote id.

Change-Id: I2e89a3d6f06a0f3ec38ea9e8345d854553dbe86d
CRs-Fixed: 2964961
2021-06-24 16:32:11 -07:00
Aditya Kodukula
45daa78c52 qcacmn: Add credit history into the minidump
As part of minidump enhancement feature, incorporate
credit_history data structure into the minidump.

Change-Id: I66a899f6d4054677f25453e87ebf672a575e1b9a
CRs-Fixed: 2946301
2021-06-21 23:14:21 -07:00
Basamma Yakkanahalli
00bcc8cbd3 qcacmn: Initial changes for ipq9574 target compilation
Added device ID and target type checks for ipq9574 traget
compilation.

Change-Id: Ie337d1256f828987ed469a609c8fb74de2180dca
2021-06-18 11:07:50 -07:00
Sajini R
ffc4a9de53 qcacmn: Add option to configure H-T-C pipe ready message timeout
Add INI option to configure Host-Target communication pipe ready
message timeout for debug.

Change-Id: I0b29ced69b67debcc4059b3ffb6578f3e808bf5c
2021-06-17 11:14:19 -07:00
Manikanta Pubbisetty
42c4fca998 qcacmn: add runtime PM stats for HTC layer
Runtime PM for HTC layer has multiple cases of GET/PUT operations.
Adding runtime PM stats for HTC layer, this helps in debugging
RTPM GET/PUT out of sync issues.

Change-Id: Ib27efd73dce0bb5bd3ff030bd7ae1bc833f29610
CRs-Fixed: 2923250
2021-04-21 04:23:30 -07:00
Rakesh Pillai
6ee7aeb0bd qcacmn: Avoid logging in packet transmission path
Currently if the driver is in runtime suspend/suspending
state, any packet transmission will request for resume
via hif_pm_runtime_get.

Unfortunately there is a logging in the above API which
will lead to more time consumption in the NET_TX softirq
context. This can lead to other delay in processing other
softirqs in the system.

Fix this by skipping the logging in the packet transmission
path.

Change-Id: Icc9f5b67794f7666243eb059f2e07a06a987002e
CRs-Fixed: 2844126
2021-01-12 14:34:40 -08:00
Yeshwanth Sriram Guntuka
478749a365 qcacmn: Do RTPM put during cleanup when HTT ver resp is not received
For HTT h2t message which has a response from FW, runtime
get is done in HTC layer and the corresponding runtime_put
is done as part of the HTT response processing. In a scenario
where the HTT response is not received from FW or not processed
by host, runtime_put is not done as part of cleanup and panic
is triggered due to get/put imbalance.

Fix is to do RTPM put as part of htc cleanup when the HTT
response from FW is not received or processed.

Change-Id: I17ccb7c3e2293c95f5f233d36c6ef38a75733cce
CRs-Fixed: 2779113
2020-10-02 10:37:14 -07:00
Jingxiang Ge
e7d41574f3 qcacmn: Add dbgid for each runtime put/get
This is to enhance statics for runtime put/get, which is
to detect if there is mismatch for usage_count.

Change-Id: I24cddb9d10e4cb675c8375cbd0f589c7718bd680
CRs-Fixed: 2647972
2020-04-07 01:20:41 -07:00
Arun Kumar Khandavalli
1f76b82659 qcacmn: update the hang data for htc
whenever there is a wmi command timeout and recovery is triggered,
the htc credit history gives insight into whether host had the credits
to send the command to firmware. Add the credit history from the
htc module.

Change-Id: Iaa760981296862f8af496a23e3c24bc2fda0fb55
CRs-Fixed: 2651744
2020-04-01 21:16:54 -07:00
Manoj Ekbote
1c1ef8c2bd qcacmn: Print re-queue message based on threshold
When packet tx fails at transport layer, packet is re-queued and given to
HIF layer again. In this change, print the warning message about re-queue
only when tx fails for 5 consecutive attempts due to no resources
available at HIF layer.
Since re-queuing is not fatal, it need not be printed on every attempt.

Change-Id: I00082470420e29dfe4fb7a745ac709a682ba032e
CRs-Fixed: 2621763
2020-03-26 20:18:56 -07:00
Tiger Yu
a3a9160cf8 qcacmn: Destroy the queue_kicker work which is triggered by RPM resume
There might be a race condition between htc_kick_queues which is sheduled
by RPM resume and hdd_wlan_stop_modules.

Here are detail info:
1. Run time resume is called, which will schedule a work to do the
   htc_kick_queues later.
2. hdd_wlan_stop_modules is called at the same time, which will call
   htc_destroy to free the HTC_TARGET.
3. the htc_kick_queues will access the HTC_TARGET, but it has been
   freed.

Change-Id: I7211a8eef2a2f1924fe91eafec5a4496eea5a507
CRs-Fixed: 2622317
2020-02-19 16:08:43 -08:00
Surya Prakash Raajen
b976076b3b qcacmn: Track tasklet execution and total time (sched+exec)
Add support to track tasklet execution and total time in different
buckets for debugging purposes

Change-Id: Ide459c385b2a44c0f16d05b37879c8b462782d72
CRs-Fixed: 2589199
2020-01-05 10:16:57 -08:00
Rakesh Pillai
4863352e53 qcacmn: Unmap the htc connect buffer after connect failure
The htc connect message buffer is not unmapped,
if the firmware does not send wmi ready event to the
host.

Scenario:
- Host sends htc init command.
- The command is queued into the src ring.
- The firmware has crashed before the Copy Engine
  could copy the message to the destination ring
- Due to the above point, no copy completion
  interrupt is received.
- The host times out during its wait for the wmi
  ready event.
- Hence the htc init command buffer stays unmapped
  and unfreed.

As a part of the wma ready event missing cleanup,
the htc connect buffer is not unmapped. Fix this
to avoid missing to unmap the buffer.

To avoid a side effect of sending a completion for
HTC connect command, all the commands are freed in
the htc completion handler in case of SSR.

CRs-Fixed: 2512344
Change-Id: I05026b3cbb764197e6df85c41634002d271a50e5
2019-12-25 22:11:36 -08:00
Nirav Shah
eb26831637 qcacmn: Update tx/rx bundle statistics for USB interface
Update tx/rx bundle statistics for USB interface.

Change-Id: Ia7951f9feb88ca28e055d9f32f0dfee65c7f0bf9
CRs-Fixed: 2571550
2019-12-06 08:40:56 -08:00
Vevek Venkatesan
bd2837220b qcacmn: featurize wmi multi mac service
Featurize wmi multi mac service with the feature flag
WMI_MULTI_MAC_SVC, to cleanup CONFIG_MCL dependency.

Change-Id: I34a513a90096c586091034029fc17b6bf23a7278
2019-07-02 02:40:15 -07:00
Vevek Venkatesan
9448b3ab90 qcacmn: add more debug logs in htc stop
Add more debug logs in HTC stop routine.

Change-Id: Ic192da68e7c420281db3066616f7768bb7ef4c5c
2019-06-03 12:27:58 -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
Ajit Pal Singh
ed6f03ba6e qcacmn: Set MaxMsgsPerBundledRecv in HTC_SETUP_COMPLETE_EX_MSG
Set MaxMsgsPerBundledRecv in HTC_SETUP_COMPLETE_EX_MSG for USB,SDIO
interfaces.
This is required for enabling RX bundling.

Change-Id: Ifb6a9a7167701c051d405bfae125fcfd0c8c55c5
CRs-Fixed: 2414409
2019-04-10 02:13:32 -07:00
Manjunathappa Prakash
0159f81bca qcacmn: Use INI configured WMI credit count
Use INI configured WMI credit for exchanging WMI messages.
Make sure INI configured value is less than FW advertised capability.
This credit configuration should be non zero.

Change-Id: I26b2dfbee0fc095aca3d37f21cd22c974189bb49
CRs-Fixed: 2411028
2019-03-29 11:05:51 -07:00
Jeff Johnson
5a6cc79b9e qcacmn: htc: 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 htc replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: Ibb6d24aff9824d7e7cf253c1fe3081443cbfb63b
CRs-Fixed: 2418252
2019-03-27 06:09:57 -07: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
Rakshith Suresh Patkar
5aeabd612d qcacmn: Add support to handle new htt format
If FW supports new htt format include only payload length in
the header length.

Change-Id: Ia5ec9a474bc5fe68de28273e6f9615d36de94a7c
CRs-Fixed: 2359253
2018-12-06 08:39:32 -08:00
chenguo
6609dbbddd qcacmn: Remove an obsolete lock in host to target layer
After gerrit#2176826, which the change ID is
I615f0e4d6de150924b99b3444cebf00571ddc088, HTCCreditLock is
removed from creation. However, the destroy of this lock is
missed. Need to remove this obsolete lock completely.

CRs-Fixed: 2345978
Change-Id: I4b67aa2a12befcd94a04a8a6acd43e31ae0b837f
2018-11-13 01:11:49 -08:00
Ajit Pal Singh
47f2d05e03 qcacmn: Do epping credit allocation for USB also
Do Epping credit allocation for USB also.

Change-Id: If86a65b0e61a09b8e064d2b606cac8a2b4c72c49
CRs-Fixed: 2295724
2018-10-08 08:11:43 -07:00
Manjunathappa Prakash
85b801ee9d qcacmn: Reduce HTC/WMI init log message log level
Reduce the log level so that logs appear on cnss-diag log instead on
console.

Change-Id: I6ee4b6ba22ddfe56eb7e93a7242555b8a087c204
CRs-Fixed: 2296956
2018-08-17 10:30:33 -07:00
Aditya Sathish
648ce114ab qcacmn: Clean up hif and htc component prints
Clean up hif and htc component prints by correcting trace levels
for regularly occurring prints and removing newlines from converged
print APIs since qdf_trace_msg appends them by default.

Change-Id: I45b1bbe7b16ab7fb8e229b59a094c7382561d658
CRs-Fixed: 2243843
2018-08-10 18:11:24 -07:00
Zhang Qian
edaa38708e qcacmn: Flush TxLookupQueue for WMI_CONTROL_SVC during htc_stop
TX comletion for WMI_FORCE_FW_HANG_CMDID would come after
TARGET_STATUS_RESET is set. In such a senario, there would
be memory leak.

Flush TxLookupQueue for WMI_CONTROL_SVC during htc_stop.
Since netbuf is freed in ISR, just free HTC frame here.

Change-Id: I5fab3effda1db70fa9b1208c854231a88b48309b
CRs-Fixed: 2242862
2018-07-13 08:27:21 -07:00
Alok Kumar
9bd8152057 qcacmn: Flush TxLookupQueue for ENDPOINT_0 during htc_cleanup
When driver unload is triggered, check_for_leaks complains,
saying it finds pending entries in TxLookupQueue of ENDPOINT_0.

Flush pending entries in TxLookupQueue for ENDPOINT_0 during htc_cleanup.

Change-Id: Ica661453d5cef283526cfa1e7267d5349b5e2310
CRs-Fixed: 2249980
2018-06-23 20:10:16 -07:00
Jeff Johnson
4b253f0e56 qcacmn: htc: Fix misspellings
Address the following issues in the htc folder:
CHECK: 'mesage' may be misspelled - perhaps 'message'?
CHECK: 'packtes' may be misspelled - perhaps 'packets'?
CHECK: 'throught' may be misspelled - perhaps 'through'?

Change-Id: Ied03e5a720ca1cd872c88df4e5cb4e014210b729
CRs-Fixed: 2241577
2018-05-19 19:40:29 -07:00
Jeff Johnson
19a4014b6b qcacmn: htc: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: Ieacfc963de0aa362d695ebddcd1231ca5128f55e
CRs-Fixed: 2230684
2018-05-18 02:17:30 -07:00
Sravan Kumar Kairam
58e0adfb53 qcacmn: Add support for WLAN-IPA WDI2 with SMMU Stage 1
Update WLAN-IPA WDI-2 datapath for DMA buffer sharing with SMMU
Stage 1 translation support. When SMMU Stage 1 is enabled DMA
APIs return IO virtual address(IOVA) instead of physical address.
This IOVA need to mapped to physical address by IPA module
before accessing them.

Change-Id: I33082bc74760b0f12c348238c6f48f5ce5750172
CRS-Fixed: 2072953
2018-03-19 09:34:39 -07:00
Pratik Gandhi
7846150f2b qcacmn: Fix compilation issues for FW header abstraction
fwhdr_abstrct: Fix compilation issues for WIN firmware header abstraction.

Change-Id: Id76a6f29fd41ae559cf377029428224d59bd03fb
CRs-Fixed: 2140921
2018-03-09 07:28:50 -08:00
Rachit Kankane
1bc1149747 qcacmn: Add HTC Credit History Feature flag
Add compilation flag to compile out HTC credit History
feature cleanly from the cld-3.2 driver binary

Change-Id: I615f0e4d6de150924b99b3444cebf00571ddc088
CRs-Fixed: 2190546
2018-03-08 18:47:17 -08:00
Rajeev Kumar
885f275c26 qcacmn: Optimize HIF module driver load time logs
Optimize HIF layer driver load time console logging
to avoid any logging related side effect.

Change-Id: I3549256559b3565ab62bfba998a64cda8a971840
CRs-Fixed: 2174888
2018-01-24 12:29:40 -08:00
wadesong
fbf643a4fc qcacmn: Fix a memory leak in HTC tx bundle packet allocation
When HTC_PACKETs are allocated for bundle tx, netbuf and bundle
queue will also be allocated and stored in the context of
HTC_PACKET, but these two structures are not freed when the
bundle HTC_PACKETs are removed from pBundleFreeList and freed.

Retrieve the netbuf and bundle queue pointers from HTC_PACKET
context and free them when HTC_PACKET is freed.

Change-Id: I61d9eb18027b12f8b9491c696e4e16d793edf0d2
CRs-Fixed: 2127098
2017-11-13 03:42:25 -08:00
Dustin Brown
bbba9176f8 qcacmn: Set the initial wake flag on MSI resume
When the wlan driver is suspending, the last thing it does is check to
see if the firmware has indicated a wakeup during the suspend process.
This is done by checking the initial wakeup flag, which is set when a
specific copy engine payload is received from firmware. For the new
dedicated wake MSI, only the wake signal is received, no payload. When
the wake MSI is toggled, set the initial wakeup flag to prevent race
conditions during the suspend process.

Change-Id: Id53cc7884431a437136d8dca068449bc5a25b87c
CRs-Fixed: 2133469
2017-11-01 13:57:00 -07:00
Jeff Johnson
a79b1114d1 qcacmn: htc: Replace instances of unadorned %p
Replace instances of unadorned %p in htc.

Change-Id: I10dbde19510476e8c4f36ea199c598a3db0a4f65
CRs-Fixed: 2111274
2017-10-03 16:02:37 -07:00
Wu Gao
77b6e57eb0 qcacmn: Remove log in pm runtime get and put
Run throughput with Rome chip, crash happens since of too many logs
in pm runtime put and get. So remove log in these functions.

Change-Id: I9ca4ddef328ade7fef63d04f19603927cf8ee6d8
CRs-Fixed: 2112431
2017-09-21 16:41:50 -07:00
Govind Singh
c505cdc689 qcacmn: Fix race condition in tx lookup queue during tx completion
Tx lookup queue holds the reference of the packet that is successfully
transmitted via CE pipe. Tx lookup queue  method can be called from
tx path and from tasklet simultaneously for the same endpoint.
One context can get the packet reference in its local lookup Queue and the
other context may not find the reference as this is not brought back
from lookupQueue to TxLookupQueue.

Fix this by adding a per endpoint lookup queue lock.

Change-Id: I0f4872f695e9ab15c27c91e733449f03871f4262
CRs-Fixed: 2047390
2017-08-30 22:06:17 -07:00
Chris Guo
37cf36d2e6 qcacmn: Fix TX Bus bundle error for SDIO WLAN
For SDIO WLAN, the creditsize is different for data EP than other
EPs. This change using alt credit size to replace of original
credit size.

CRs-Fixed: 2072158
Change-Id: I105db55da66e6123b2a53326d53758c24eca21ec
2017-08-29 20:57:12 -07:00
Srinivas Girigowda
38ee305644 qcacmn: HTC: Reduce the log spam in kmsg
Move the logs to appropriate log levels to reduce
the log spam in kmsg.

Change-Id: I1a20a6b9e4c9de8c79517aafed70f0e7eea920fb
CRs-Fixed: 2017427
2017-07-12 20:12:50 -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
Manikandan Mohan
e3e209e1fd qcacmn: Fix kernel module check patch warnings
Fix kernel module check patch warnings in Host Target Communication
module files

Change-Id: I151f597142d93a26e5e037cf7fce944f86fba72a
CRs-fixed: 2033001
2017-05-02 13:29:31 -07:00
Kiran Venkatappa
e17e3b63e0 qcacmn: Support per mac CE for WMI commands
Firmware requires WMI commands to be sent on different copy engine for
each MAC. Change CE assignement to support this.

Change-Id: I91a2422a944741dc25c3bf45b18cde30e7409632
CRs-Fixed: 2005214
2017-02-22 11:13:16 -08:00
yeshwanth sriram guntuka
78ee68fa4a qcacmn: Remove redundant qdf_mem_zero calls
qcacmn to qcacmn-2.0 propagation

qdf_mem_zero is called after qdf_mem_malloc to set the memory
value to zero. qdf_mem_malloc uses kzalloc internally to allocate
memory which sets memory to zero.

Removing redundant qdf_mem_zero which are called after
qdf_mem_malloc.

Change-Id: I8e1faf6099f8fbc869c8af42b7511a13e66e6bed
CRs-Fixed: 1079697
2017-01-08 22:34:01 -08:00
Poddar, Siddarth
f176340b9e qcacmn: Fix to avoid skb buff leak when NBUF alloc fail
propagation from qcacld-2.0 to qcacmn.

If host fail to allocate receive packet bundle buffer
it will return no memory without freeing receive pkt queue.
Fix is to free the receive pkt queue before returning from message handler.
Also, fill the rx free list during driver load time itself with the
pre allocated memory so that Tx won’t take away this memory.

Change-Id: I4bf2aeb7bc85cc68cfa1314e6dbf5057665ba7ce
CRs-Fixed: 1079623
2017-01-04 04:02:46 -08:00
Jeff Johnson
c66399a1ce qcacmn: Fix -Wmissing-prototypes in Host Transport layer
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code that is generating warnings. Fix all warnings
in the Host Transport layer.

Change-Id: Ic9c7f920883f41176d89419de25b7e02df0b895e
CRs-Fixed: 1093231
2016-11-23 14:44:53 -08:00
gbian
b417db2f04 qcacmn: improve mboxping TX t-put for SDIO project
qcacld-2.0 to qcacmn propagation

Return HTC_SEND_FULL_KEEP directly in epping_tx_queue_full function
and give nodrop pkts higher priority over normal pkts

Change-Id: Ib36e1a9f34eb9054b12f0e8ba54a86ace7d6c8f8
CRs-Fixed: 990726
2016-11-01 23:18:51 -07:00
Srinivas Girigowda
8a0b665897 qcacmn: Replace DEBUG macro with WLAN_DEBUG
This is a qcacld-2.0 to qcacld-3.0 propagation.

pr_debug() should not appear by default in kernel log (kmsg).
DEBUG is a kernel macro, since host driver is using the same name macro,
pr_debug log statements are appearing in kmsg.

Fix this by moving the code under DEBUG to WLAN_DEBUG and
remove DEBUG macro from Kbuild.

Change-Id: I5bb385f91f9b6ba15629a5878625fefc21d4a7e1
CRs-Fixed: 1003261
2016-10-20 01:39:05 -07:00
Houston Hoffman
4d9b0808da qcacmn: Add htc_pm_runtime put/get apis
htc_runtime_pm apis are needed to deprecate the qdf_runtime_pm apis.
The qdf_runtime_pm apis rely on cds_get_context which is not being
converged and thus qdf_runtime_pm needs to be deprecated.
Since the htc_handle wraps the hif context for most upper layers,
htc_module is providing a wrapper functions.

Change-Id: Ic66a0891db53b610fd4373e7528a08f2787f45fc
CRs-Fixed: 1044150
2016-08-30 23:28:34 -07:00