Commit Graph

132 Commits

Author SHA1 Message Date
Nirav Shah
d9dce6e18c qcacmn: [HIF] Add support for QCA9379 on x86 platform
Add support for QCA9379 chip on x86 platform for
USB and SDIO attach.

Change-Id: I1192e47f6ca186bbcaa6d1fb28d40cb16d6dfe0b
CRs-Fixed: 2181012
2018-03-12 04:15:00 -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
Pratik Gandhi
dc82a77896 qcacmn: Support to WIN for split of kernel modules
Add EXPORT_SYMBOLS to support modularization in WIN.

Change-Id: I587fe6f2c5cce4b54756358de5c488b146f61850
CRs-Fixed: 2179854
2018-02-08 06:58:35 -08:00
wadesong
4b3f37d7dc qcacmn: Stop touching HTC packet after it sent to CE
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
2018-01-29 05:25:29 -08:00
Kabilan Kannan
24895ade0c qcacmn: Increase the HTC control msg timeout
Firmware needs 6 seconds timeout for HTC control
messages.
Increase the HTC control message timeout to 6
seconds

Change-Id: I79a843afe028098a9cb7e98c274b54132357c76b
CRs-Fixed: 2170953
2018-01-26 17:21:04 -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
Dustin Brown
1e61fbc2a0 qcacmn: Address minor HTC review comments
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
2018-01-13 02:17:54 -08:00
Dustin Brown
bc9718fea2 qcacmn: Fix HTC packet map/unmap disparity
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
2018-01-05 15:30:11 -08:00
Dustin Brown
8969ad7fa8 qcacmn: Fix double dmap problem in htc
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
2018-01-05 15:30:10 -08:00
Houston Hoffman
b899cf8b8e qcacmn: Don't encapsulate packets in htc_send_pkt
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
2018-01-04 07:25:15 -08:00
Manjunathappa Prakash
cb30062355 qcacmn: enqueue back dequeued packet if mmap fails
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
2018-01-04 07:25:10 -08:00
Houston Hoffman
8868bafb8c qcacmn: Don't encapsulate packets in recv_packet_completion
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
2018-01-04 03:39:02 -08:00
Alok Kumar
967af27196 qcacmn: Add a delay before sending WMI message
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
2017-12-07 15:39:12 -08:00
Jiachao Wu
15a94747ef qcacmn: Check endpoint index range
Check endpoint range before it be used.
If endpoint is unused return with error.

Change-Id: I2888b0b66c737df677f09040133503e8ace60510
CRs-Fixed: 2138465
2017-11-16 05:32:36 -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
Yun Park
88e0b95564 qcacmn: Remove local queue from send_packet_completion
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
2017-11-07 17:43:31 -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
tfyu
052b32a5b3 qcacmn: Fix incorrect number ul_outstanding_cnt when do TX bundle
qcacld-2.0 to qcacmn propagation

The ul_outstanding_cnt is not increasing when do TX sending in the bundle.
Which will cause the count is not correct, and will drop to the negative
number.

Change-Id: If7f06b376633b3384203cc49d8e8acafdd1b4853
CRs-Fixed: 2112977
2017-09-21 19:07:22 -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
Chris Guo
33d5173722 qcacmn: Enable Bus bundle for both TX and RX
Because of the sequence of macro defination, the HTX bundle is
not enabled at all. This fix made the macro defination into the
correct sequence.

CRs-Fixed: 2070642
Change-Id: Idc62b091057da9873874f54f09ca8b76d3658516
2017-08-31 14:48:38 -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
wadesong
31d77bc18a qcacmn: Fix a NULL pointer dereference issue
In htc_send_data_pkt, netbuf will not contain a valid pointer for
TX packet count updating unless pPacket is not NULL. Move the TX
packet count updating code into the code block where pPacket is
containing a valid pointer.

Change-Id: I5cf6787b731df36c41c0c12a585e816e54ffb904
CRs-Fixed: 2053354
2017-08-10 06:12:50 -07:00
Nachiket Kukade
13e5613615 qcacmn: Remove QDF_BUG from htc_wait_recv_ctrl_message
Currently if Firmware is down during probe, driver will BUG_ON and
re-probe will not happen. Remove QDF_BUG to allow driver to fail
gracefully, allowing re-probing by the platform driver.

Change-Id: I65fca58168f1c8413eef4790c0f428e64a58f3a7
CRs-Fixed: 2027472
2017-07-18 23:35:15 -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
tfyu
60c2c9836e qcacmn: Fix the TX packet drop after doing the TX bundle
qcacld-2.0 to qcacmn propagation

The driver will drop the TX packet if remaining depth of the sending queue
is less than 2. This will casue the memory leak, credits missing and TCP stall
issue when running the iperf test.

The fix is to add back current packet before return, which just be dequeued.

Change-Id: I9e0c69c16e9562afd627d0fc222a9fbd475c468c
CRs-Fixed: 2056195
2017-06-28 21:33:30 -07:00
Nandha Kishore Easwaran
e43583f3c1 qcacmn: Dptrace changes to take per pdev stats
Initial changes for adding dp trace in common framework. Modified dp_trace
record sturcture to include pdev_id as a member to take per_pdev stats.
Dump command has been modified to dump stats per pdev.

Change-Id: I8aede0bd8ab6f381c7fa0542d077bdd8bf66b3d2
CRs-fixed: 2038944
2017-06-05 22:52:34 -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
Dustin Brown
6cb0fa1c4f qcacmn: Create qdf_log_timestamp_to_secs helper function
Create a timestamp conversion helper that returns whole seconds and
remaining micro seconds, for easier consumption by logging methods.

Change-Id: I5bc40075566485f3dc9f7e5fd81a13ec462c5da0
CRs-Fixed: 2031564
2017-04-13 21:31:10 -07:00
Houston Hoffman
adc3147da9 qcacmn: add htc_get_tx_queue_depth api
Wish to know the number of unsent packets in a given tx queue

Change-Id: I73999de9aaadbb61eea13388e583e341e1d7855a
CRs-Fixed: 2018893
2017-04-11 11:04:44 -07:00
Dustin Brown
536064a37e qcacmn: Implement WMI/Credit History log print APIs
Create output agnostic log print APIs for WMI and Credit History to
enhance the debugging experience.

Change-Id: Ie89a9cb3b54c373ac2610d62003e940da17696d8
CRs-Fixed: 2028762
2017-04-11 11:04:24 -07:00
Himanshu Agarwal
fa594d9f08 qcacmn: Handle failure scenario for qdf_nbuf_map()
Handle failure scenario for qdf_nbuf_map() API by freeing
allocated memory, returning failure/error etc.

Change-Id: I493fb063c8f57e38525e2dc1701a6e972d2ec0e6
CRs-Fixed: 2028524
2017-04-11 11:03:47 -07:00
Yue Ma
9c6f84da99 qcacmn: Resume fastpath DP in correct place for runtime PM
Fastpath DP should be resumed after WOW is disabled from FW. Move
it to correct place.

Change-Id: I9108ee4393cc4ee5f8a232c3de14d68b47aa760e
CRs-fixed: 2023358
2017-04-03 18:02:13 -07:00
Yun Park
81967e04f3 qcacmn: Check NULL before derefencing pPacket from htc_packet_dequeue
Add NULL check for pPacket returned from htc_packet_dequeue before
dereferencing it.

Change-Id: I30c4fb3a4bc6652396795305c3b8a23bba88922a
CRs-fixed: 2009829
2017-03-28 20:45:58 -07:00
Himanshu Agarwal
974d0a5275 qcacmn: Add variable to store magic pattern
Add variable to store magic pattern and APIs to set
magic cookie in a packet.

Change-Id: I4e010c2e2571398e4f7423162162cf0d2206d18b
CRs-Fixed: 2016682
2017-03-24 02:19:00 -07:00
Mukul Sharma
514201712a qcacmn: Add callback context for wake up / suspend ack callback's
Currently, Host initial wake up, suspend ack callback do not
register callback context with host-to-target communication layer.
As now PMO is handling now these callback, objmgr psoc is required
as callback context.

Hence as part of the fix, Add supports for callback context for
these API's.

Change-Id: I83d513764792b800a8540cdbe847aad552df0ab1
CRs-Fixed: 2015229
2017-03-08 13:00:40 -08: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
Liangwei Dong
6c5e33226b qcacmn: Protect the TxQueue in failure
qcacld-2.0 to qcacmn propagation

To acquire lock to protect pEndpoint->TxQueue
in the failure path.

Change-Id: I6844f1329427e7065dc3e4e64bf105087d963dd9
CRs-Fixed: 1077223
2017-02-09 15:50:10 -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
Venkateswara Swamy Bandaru
ae41b9e0ae qcacmn: Add support for asynchronous Host to Target connection
Add support for asynchronous Host to Target connection connection in
whcih packets can be queued in both interrrupt and process context.

Change-Id: I52f0f972b938a558e4ef3c13cf4d76aa3a63d58f
CRs-Fixed: 1092518
2016-11-21 17:22:54 -08:00
Liangwei Dong
2c73be828a qcacmn: Fix WMI command tx failure
qcacld-2.0 to qcacmn propagation

In USB solution, one WMI command will consume
one "resource". So, for WMI endpoint, the
"resource" number of one bundle is
HTC_MAX_MSG_PER_BUNDLE_TX rather than 2 *
HTC_MAX_MSG_PER_BUNDLE_TX.

Change-Id: Ia60e49a403a0d689d1ba8397f7c796cd911ab918
CRs-Fixed: 1013006
2016-11-09 20:25:59 -08:00
Venkateswara Swamy Bandaru
b3c810b062 qcacmn: Fix for HT_C tx lock issue
Added missed condition while locking HT_C tx lock when
htc_issue_packets returns error

Change-Id: I29ce11f20d68297bd946e0925a2e59a576744e73
CRs-Fixed: 1084979
2016-11-02 11:29:37 -07: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
Venkateswara Swamy Bandaru
9e66f4f987 qcacmn: Fix WMI cmd send issue in case of 100% cpu utilization
WMI can queue the packets in both process and tasklet context. Before
queuing the packet H-TC will increase TxProcessCount. Only one core
can increase it and proceed for queuing the packets to HIF. At 100%
cpu utilization due to locking and unlocking the H-TC TX lock, one
core is holding TXProcessCount(and went to tasklet context and stuck
there) and other core is not able to queue the packets to HIF. Which
is creating virtual CE stuck case. Fixed the issue by acquing the
H-TC tx lock before the while loop which queus the packets
in H-TC queue

Change-Id: I435be9fa34b5ae86c6edb6ee29426a9134e5b6f2
CRs-Fixed: 1083038
2016-10-29 20:52:05 -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