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
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
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
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
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
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
There are other places where txLookupQueue is protected
with htc_lock instead of lookup_queue_lock.
Change-Id: I91497ce4593a14033871d3e8c3a97deab222d365
If FW supports new htt format include only payload length in
the header length.
Change-Id: Ia5ec9a474bc5fe68de28273e6f9615d36de94a7c
CRs-Fixed: 2359253
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
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
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
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
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
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
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
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
Add support to configure logging buffer size from
per-OEM kbuild based on memory requirement.
Change-Id: Ia91d79e5e738b1c9787015de101c3f67ccde46aa
CRs-Fixed: 2253438
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
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
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
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
WMI cmds should be blocked, before calling HTC stop
to avoid the race condition in the system
Change-Id: I015b154a3bc422f50d4ed82bc861dd9e054c47a3
CRs-Fixed: 2194234
Initialize the local variable do_pm_get to false to avoid using the
uninitialized variable potentially.
Change-Id: Ie45126b05afee1d4e5bb061189846bc8e301c2a6
CRs-fixed: 2215809
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
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
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
Add compilation flag to compile out HTC credit History
feature cleanly from the cld-3.2 driver binary
Change-Id: I615f0e4d6de150924b99b3444cebf00571ddc088
CRs-Fixed: 2190546
When HTC packet is sent to CE for physical tx, the tx compl
interrupt can get triggered very quickly, resulting the
HTC buffer being freed at a very early time. Any memory
access into the same HTC buffer after HTC tx compl returns
will be a use-after-free case.
Relocate all HTC packet touching code to places before
it gets populated to CE for tx.
Change-Id: I8bcac16566156104063013c7eb17b2f0debd32e6
CRs-Fixed: 2178880
Firmware needs 6 seconds timeout for HTC control
messages.
Increase the HTC control message timeout to 6
seconds
Change-Id: I79a843afe028098a9cb7e98c274b54132357c76b
CRs-Fixed: 2170953
Optimize HIF layer driver load time console logging
to avoid any logging related side effect.
Change-Id: I3549256559b3565ab62bfba998a64cda8a971840
CRs-Fixed: 2174888
Address minor review comments raised against previous change
Ic417f6b008fdc769227c7a23bc8e01a2064ce928. Specifically, remove function
recv_packet_completion() and member EpRecvPktMultiple from struct
htc_ep_callbacks.
Change-Id: I431579356664ad6a6274f58352adf8ce273e084f
CRs-Fixed: 2168647
When a data packet is sent via HTC, it is mapped before being inserted
into the TX queue. However, for control packets, the mapping is done
after being inserted into the queue. This leads to a situation where the
TX queue flush can unmap a pending control packet that was never mapped.
Make sure the TX flush function only unmaps packets that have previously
been mapped.
Change-Id: I48572fb34ae940923012d495625a33a00f74b9ed
CRs-Fixed: 2157006
For control messages, a path in HTC was performing double dmamaps
and this was, in time, causing dmamap failures on SMMU.
Change-Id: I19f7e13a0a19404fe1161127b10f52225b6a4248
CRs-Fixed: 2151773
Avoid leaking pointers to freed stack memory by not enqueing packets
onto a stack local queue in htc_send_pkt
In particular, the packet was not being removed from the stack queue
when a dma map error occurs.
Change-Id: I4519a302b3d6cc19f52e8cefa71dbd750ede0a0b
CRs-Fixed: 2119792
In htc_issue_packet takecare to enqueue back the dequeued packet.
Otherwise we will be leaking the packet.
Also takecare to unmap the mapped netbuf if we fail to send.
Change-Id: I48dbe537ae5b0fe89785f4309325c7089b2ace56
CRs-Fixed: 2151122
Avoid leaking pointers to freed stack memory by not enqueing packets
onto a stack local queue in recv_packet_completion
Change-Id: Ic417f6b008fdc769227c7a23bc8e01a2064ce928
CRs-Fixed: 2119792
Add a delay of 20ms before sending WMI message.
A delay of 20msec was added to slow down sending of WMI message
to give time for processing WMI in Napier FPGA platform.
Change-Id: Ib64972a92e638f2fe92f669657a5ab9eb326e744
CRs-Fixed: 2087330
Check endpoint range before it be used.
If endpoint is unused return with error.
Change-Id: I2888b0b66c737df677f09040133503e8ace60510
CRs-Fixed: 2138465
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
Static analys complains about the htc_pkt having a pointer
to the local queue when the function returned. Remove the
local queue so that it is not an issue.
Requires epping to support individual single completions.
Change-Id: I8f96420f5f6305c43051a21073607cdd6c603855
CRs-Fixed: 2125394
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