Commit Graph

132 Commits

Author SHA1 Message Date
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
Visweswara Tanuku
b3518aff5c qcacmn: Genoa: SDIO: Revert WAR - Do not use HTC_FLAGS_SEND_BUNDLE
Remove the WAR, which doesnot use HTC_FLAGS_SEND_BUNDLE

This reverts commit 68f186311d

Change-Id: I7d350faca8645a5d65af708cb3fb231895a3fe37
CRs-Fixed: 2522724
2019-10-31 10:08:21 -07:00
Ajit Pal Singh
0bd6d0366c qcacmn: usb: Make HTC_MAX_MSG_PER_BUNDLE_TX configurable
Make HTC_MAX_MSG_PER_BUNDLE_TX configurable through config files.

Change-Id: I259c4b202d4fc9e44ef3f5edf8454372a9a086d4
CRs-Fixed: 2534002
2019-10-15 13:28:16 -07:00
Visweswara Tanuku
957b63aec6 qcacmn: Genoa: SDIO: Handle Tx Padding & Credits
In Genoa SDIO ADMA implementation Host sends packets to FW in
multiples of SDIO Block size.

If the packet/bundle is not block aligned Host adds padding at the
end of Packet/Bundle.

If the TX packet plus padding exceeds one FW TX Buffer, Padding data
will occupy the next FW TX buffer. Same applies for bundle TX packet.

For above scenario, HTC_FLAGS_PADDING_CHECK of HTC header Flags is used
to notify the FW that - Padding data follows the currentHTC packet

Since the padding data will take one extra FW Tx Buffer, host need to
handle the extra Tx credit being used by the padding data/buffer

CRs-Fixed: 2516617
Change-Id: I1eb394859689b281653bfd6d681804eb016a14cf
2019-09-08 07:37:36 -07:00
Visweswara Tanuku
68f186311d qcacmn: Genoa: SDIO: Tx - Do not use HTC_FLAGS_SEND_BUNDLE
Genoa SDIO FW doesn't use the HTC_FLAGS_SEND_BUNDLE
in send direction, host to fw

Do not set this flag during Tx bundling for HTC Packets
This is a WAR to avoid FW crash, until fix available from FW

Crs-Fixed: 2511297
Change-Id: Iaf178f9e1a9c07ca25a8b801c667fb0d16fac85c
2019-09-08 07:37:33 -07:00
Nirav Shah
31435bbef5 qcacmn: Fix DHCP indication to FW feature in SAP for HL
In case of HL, send tx completion bit in HTT tx descriptor
to receive tx completion from FW and disable DHCP indication
to FW properly.

Change-Id: I2540a125c84c322507acdc0647ee8839d21067ce
CRs-Fixed: 2506020
2019-08-20 14:38:41 -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
Himanshu Batra
032d352263 qcacmn: Replace void * Host Target Communications handle with abstract type
Replace void * Host Target Communications handle with abstract type handles
provided by Host Target Communications component

Change-Id: I16ca87e4f9716791d340da2fda0a8a640fa2ec34
CRs-Fixed: 2487151
2019-07-25 00:25:49 -07:00
Ajit Pal Singh
5c3ba8908f qcacmn: dp: hl: Read tx resources after single thread check
Bus TX resources are being read before the single thread check.
If the thread is pre-empted, the tx_resource variable may not
match with actual TX resources.

Change-Id: I7e8af58a5702172a4cfbea9175f333aad4a57238
CRs-Fixed: 2459253
2019-07-02 08:39:20 -07: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
Alok Kumar
5d4c6f2f17 qcacmn: Avoid NULL pointer dereference of pointer 'pPacket'
Pointer 'pPacket' returned from call to the function
'htc_packet_dequeue' may be NULL.

Add a NULL check for pPacket before dereferencing it.

Change-Id: I1ecb82cce0fc00877b3ec2de2676027dde261186
CRs-Fixed: 2478206
2019-06-28 11:08:59 -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
Nirav Shah
03c409d4a2 qcacmn: Add error handling in case of hif_send_head failure
In case of SDIO/USB TX bundling if there is hif_send_head failure
packets are not added back to Endpoint tx queue and resulting in
packet drop.

Add packet back to tx queue if hif_send_head send failure
for bundled packet.

Change-Id: Id613a414f0caa71a33c79186ae726550cb710c4a
CRs-Fixed: 2468882
2019-06-24 14:26:27 -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
Nirav Shah
0811d82877 qcacmn: Fix multiple unmap of same netbuf
Clear HTC_TX_PACKET_FLAG_FIXUP_NETBUF flag in
hif_send_head failure scenario to avoid
multiple unamap of same netbuf.

Change-Id: Id7f6aeba1eff0d23b76927fcbb03643409fc7859
CRs-Fixed: 2437034
2019-05-14 23:57:59 -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
Padma Raghunathan
2d61d53e44 qcacmn: Handle CE send completions in polling mode
When polling mode is enabled, send completions for a
CE(host->target, ULpipe) for a particular service(WMI/HTC/HTT) are handled
only when recv happens in CE(target->host, DLpipe) for the same service.

Since for services like WMI there are multiple ULpipes(Eg. CE3 for
WMI<WMAC1> and CE7 for WMI<WMAC2>) and single DLpipe(CE2). Receive on a
DLpipe is the right time to poll for send completions on all ULpipes for
that service.

Change-Id: Ie2ac30d3db1bc85c888d714b782a894539e399ff
2019-04-26 05:10:37 -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
Ajit Pal Singh
3fcc082eac qcacmn: Do not call get_htc_send_packets if no TX resource
For USB, do not call get_htc_send_packets() in htc_send_data_pkt()
if no TX resource is available.

Change-Id: I17a3dd54c2582620ab2be1e0f6c156904dc52d30
CRs-Fixed: 2412376
2019-03-26 12:02:29 -07:00
Frank Liu
d2cc13ede9 qcacmn: Restore the correct credit for EP
qcacld-2.0 to qcacmn propagation

Restore the correct credit for the flow control endpoint, add back
all the credits consumed by the queue, if fail to send packet by
HIFSend_head.

Change-Id: I480f7aba5ce8c8d1e57caaae5b2bfcd77209091c
CRs-Fixed: 2360669
2019-03-01 09:24:06 -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
Vivek Natarajan
ed3bf79dd4 qcacmn: Use htc_lock while accessing TxLookupQueue
There are other places where txLookupQueue is protected
with htc_lock instead of lookup_queue_lock.

Change-Id: I91497ce4593a14033871d3e8c3a97deab222d365
2019-01-14 08:38:17 -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
Debasis Das
5e2539c087 qcacmn: Protect TxLookupqueue while flushing
The htc TxLookupQueue needs to be protected with
relevant lock while flushing.

Change-Id: Ib6c8878c024ef623dfb63ca0745d41b140f2b1c3
2018-11-23 02:00:17 -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
phadiman
3952f2b86c qcacmn: Remove QDF_BUG in htc_completion_handler
Remove the QDF_BUG in the htc_completion handler
which detects Rx netbuf packet corruption

Host sometimes receives HTC packets with corrupted
endpoint id during rapid wifi down/up tests. This
can be ignored hence remove QDF_BUG and add QDF_TRACE

CRs-Fixed: 2286058

Change-Id: I9b2d3ee2054461258d1196d5ace7d7cfe807332a
2018-08-28 13:09:53 -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
Dustin Brown
1ec1510b48 qcacmn: Reduce the setup info console logging from hif and htc
Excessive info logging on to console is leading watchdog. Reduce info
logging

Change-Id: I0e098c95bfffb1e8d63a95226552e400cd7f610c
CRs-Fixed: 2287777
2018-08-02 18:30:10 -07:00
Yun Park
c353d6b87c qcacmn: Fix null pointer dereferenc in __htc_send_pkt
In __htc_send_pkt, pointer is checked against null but then
dereferenced later.
Fix it by checking null before dereference it.

Change-Id: I8a0dcfccbe458f5b85b8c930eb9685a75b64829b
CRs-Fixed: 2232835
2018-08-01 20:37:39 -07:00
Yun Park
ed2a224ba2 qcacmn: Fix out-of-bounds write in htc_add_receive_pkt_multiple
In htc_add_receive_pkt_multiple, out-of-bounds write to a buffer.
Fix by checking the endpoint against the max endpoint.

Change-Id: Iaa82c7e8f3ae59f007380a7697959dd79dfb81ed
CRs-Fixed: 2232836
2018-08-01 18:31:54 -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
Dustin Brown
942f939848 qcacmn: Conditionally unmap nbuf in htc_issue_packets
htc_issue_packets currently unmaps all nbufs during error handling.
However, htc_issue_packets only maps nbufs under some situations. Make
the criteria for unmapping match the criteria for mapping.

Change-Id: Ia77cffb30edbdb4d1378af38368f860c6f8c0b18
CRs-Fixed: 2266437
2018-06-27 17:41:17 -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
Nirav Shah
79ec3e999b qcacmn: Add support to configure buffer size from kbuild
Add support to configure logging buffer size from
per-OEM kbuild based on memory requirement.

Change-Id: Ia91d79e5e738b1c9787015de101c3f67ccde46aa
CRs-Fixed: 2253438
2018-06-15 21:31:16 -07:00
jitiphil
4a8f66f382 qcacmn: NULL pointer dereference in htc_issue_packets()
Inside htc_issue_packets() if the HTC frame header
associated with a packet is NULL, a NULL pointer dereference
can occur.

Add check to verify that HTC frame header is not NULL before
dereferencing.

Change-Id: I4169035286b582a91e5963c20a11c8ad0f375d17
Crs-Fixed: 2232846
2018-06-14 15:20:40 -07:00
jitiphil
fcc2488d25 qcacmn: NULL pointer dereference in free_htc_bundle_packet()
Inside free_htc_bundle_packet() if the HTC packet queue
associated with a packet is NULL, a NULL pointer dereference
can occur.

Add check to verify that HTC packet queue is not NULL before
dereferencing.

Change-Id: I1965a66de74b8954fdc59733e5ef86120f4f8898
Crs-Fixed: 2232839
2018-06-13 12:30:58 -07:00
Amar Singhal
699074598b qcacmn: Remove unused function htc_add_receive_pkt
Function htc_add_receive_pkt exposes pointer to local
variable to the caller. Since it is unused; remove it.

Change-Id: I3294fde4499a58e6872c44fd8615eff2bfb42556
CRs-Fixed: 2247626
2018-06-08 16:30:36 -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
Kabilan Kannan
2c0da266be qcacmn: Block WMI cmds before issuing HTC stop
WMI cmds should be blocked, before calling HTC stop
to avoid the race condition in the system

Change-Id: I015b154a3bc422f50d4ed82bc861dd9e054c47a3
CRs-Fixed: 2194234
2018-04-16 16:57:01 -07:00
Tiger Yu
054a6a4fd4 qcacmn: Initialize the local variable do_pm_get to false
Initialize the local variable do_pm_get to false to avoid using the
uninitialized variable potentially.

Change-Id: Ie45126b05afee1d4e5bb061189846bc8e301c2a6
CRs-fixed: 2215809
2018-04-02 15:21:59 -07:00
Vivek
2b109825ac qcacmn: Replace A_UINT with appropriate types
There are instances of use of older A_UINT/A_INT.
Replace all such instances with the qdf u_int*_t/int*_t.

Change-Id: I7ce29b03f29a0d1a0cf87cfd3c846f4694da4c2a
CR's-Fixed: 2210869
2018-03-26 04:58:12 -07:00
Dustin Brown
f74576cb84 qcacmn: Add TX credits after WMI logging
While processing a host-to-target credit report, the number of available
credits is incremented before recording the credit report event in the
WMI history log. This can lead to tricky debug scenarios where there is
an available credit, but the WMI history log does not show that a credit
report has been processed. In htc_process_credit_rpt, log the credit
report in the WMI history log before incrementing the available credits
field.

Change-Id: Id8632c85348bec38b6c46549a68f613d102b2ae5
CRs-Fixed: 2204248
2018-03-21 13:52:19 -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