Commit Graph

700 Commits

Author SHA1 Message Date
Rajeev Kumar Sirasanagandla
ed4d1b34fd qcacld-3.0: Fix function type for ol_txrx_pdev_attach_target
To address kernel control flow integrity (CFI) issues related to type
mismatch, correct the return type of ol_txrx_pdev_attach_target().

Change-Id: Icb170ad1e57513519f3d9b122ab4feed6a4efcb8
CRs-Fixed: 2402963
2019-02-23 00:25:53 -08:00
Rajeev Kumar Sirasanagandla
0ce92bf6d5 qcacld-3.0: Fix function type for wdi_event_sub
To address kernel control flow integrity (CFI) issues related to type
mismatch, correct the return type of wdi_event_sub().

Change-Id: Id51c6523ddd5d6f5835f7aa08a3a7b2940d2c50b
CRs-Fixed: 2402961
2019-02-23 00:25:49 -08:00
Rajeev Kumar Sirasanagandla
815a7dfa5d qcacld-3.0: Fix function type for wdi_event_unsub
To address kernel control flow integrity (CFI) issues related to type
mismatch, correct the return type of wdi_event_unsub().

Change-Id: I45d090cb4011ca659e30b2f7be6c2b7d32bbba4b
CRs-Fixed: 2402957
2019-02-23 00:25:45 -08:00
Nirav Shah
da761ede23 qcacld-3.0: Fix datapath statistics print format
Fix datapath statistics print format.

Change-Id: Id1c95fc93f1d7335eb199afa59b2077a36641dc3
CRS-Fixed: 2401250
2019-02-20 02:55:51 -08:00
Lin Bai
1a73a41b4c qcacld-3.0: Implement converged packetdump API
Packetdump invokes legacy data path API directly without
considering underlying HW:
1. ol_register_packetdump_callback
2. ol_deregister_packetdump_callback
Global pointer pdev_txrx_ctx will be casted to struct ol_txrx_pdev_t
always even Lithium (use struct dp_pdev) underlying, and overwrite
struct dp_pdev unexpected.

Wrap with cdp API to avoid.

Change-Id: I4f587c5378726b7cc4b340760f1112b054610da1
CRs-Fixed: 2400472
2019-02-18 09:14:10 -08:00
Rakshith Suresh Patkar
da3aa3367d qcacld-3.0: Unpause priority queue before all netif queues
In ol_tx_flow_pool_map_handler, we will unpause all netif
queues. Unpausing will fail if any queue bitmap is not
cleared and pause_map remains non zero.

To avoid this, unpause priority queue before unpausing all
non priority queues.

Change-Id: If9a4e5d923b300aa03f01847da1ad64e8d6c61ef
CRs-Fixed: 2391158
2019-02-04 13:07:51 -08:00
Alok Kumar
604b033e71 qcacld-3.0: Send peer unmap conf based on peer unmap count
Send the peer unmap conf commnad to FW for a peer_id only if
UNMAP for that peer_id is received either for three times if
RFS is enabled or one time if RFS is not enabled.

Change-Id: Idba2c406f7ad7d770fe8326e8a0d6ac7fab10252
CRs-Fixed: 2387480
2019-01-28 14:37:34 -08:00
Sravan Kumar Kairam
5c65634429 qcacld-3.0: Check if peer id exists before adding
Currently peer id is added to map unmap array with out
checking if its already added before. This leads to having
duplicate entries and host sends peer unmap conformation
to FW with duplicates which leads to FW assert. So check
if peer id exists before adding to the array.

Change-Id: Ifcf73145f241e8ad48ff0eba9d87880565e65bb6
CRs-Fixed: 2381577
2019-01-24 12:30:15 -08:00
Manjunathappa Prakash
8b68663ddc qcacld-3.0: Hold peer reference when handling unmap_timer_work
There is race when unamp_timer_work and peer is deleted. Hold the
reference to peer while handling the peer_unmap_timer_work.

Change-Id: Ie6cef3f13e55ab7d2310f0fff4254cde3e3c96e1
CRs-Fixed: 2381036
2019-01-22 05:06:06 -08:00
Madhvapathi Sriram
3e6627a9f9 qcacld-3.0: Optimize schedule msg post error logging
Change-Id: Ieaddca5f141c99c42ed4a7c954dea2788e353640
CRs-Fixed: 2373015
2019-01-22 02:37:31 -08:00
Sravan Kumar Kairam
dd5a74a70f qcacld-3.0: Set skb cb for rx peer cache frames
There is a race condition while flushing the rx cache frames
from MC thread and same time from RX thread. So for rx cache
frames set QDF_NBUF_CB_RX_PEER_CACHED_FRM to avoid using gro
receive and use skb receive with local bh disable.

Change-Id: I5ece8ddf876d27ad3d24b0ba751fe3e3886608e2
CRs-Fixed: 2378342
2019-01-14 15:15:47 -08:00
hangtian
127c953c7f qcacld-3.0: Use qdf_mem_zero for zero initialization
Use qdf_mem_zero for zero initialization.

Change-Id: Ic2b8d907623cf67a4569aaf01398c1b3a2bff707
CRs-Fixed: 2376644
2019-01-14 08:38:03 -08:00
Mohit Khanna
c9649650d2 qcacld-3.0: Support to dump DP RX Thread stats
Add DP RX Thread Stats support. Stats can be retrieved using iwpriv
dumpStats command.
Remove print from hdd_gro_rx_dp_thread function. This condition is
expected when gro is disabled on low throughput. Print is not needed.

CRs-Fixed: 2346997
Change-Id: I3619844b66e845184a4b8c77763bf9f2d2ea0a38
2019-01-13 18:45:47 -08:00
Sravan Kumar Kairam
8433f90213 qcacld-3.0: Fix cdp api cdp_tx_desc_thresh_reached
The CDP api cdp_tx_desc_thresh_reached should return true
if the available data path tx desc reaches threshold. But
this api returns wrong value in case of helium targets. Fix
this by returning correct value.

Change-Id: I571841ab1e4a4b24242fadc21bd13a85ef8da781
CRs-Fixed: 2378898
2019-01-10 10:33:29 -08:00
Jeff Johnson
40d289ec79 qcacld-3.0: Remove macro HTT_TX_DESC_PADDR()
Macro HTT_TX_DESC_PADDR() is unused. Furthermore, it references
tx_descs fields which do not exist. Since it couldn't possibly be
used in its current form, remove the macro.

Change-Id: I62b2d7bc3291ba6c2dc486196076827cfc22d8ec
CRs-Fixed: 2375421
2019-01-07 08:47:15 -08:00
Sravan Kumar Kairam
f48210cb66 qcacld-3.0: Add cdp api for dp tx desc availability
Add cdp api to check if tx desc pool available descriptor
threshold has reached.

Change-Id: I12cc38b56a68ca7ee8f4560677fcdabccb38928b
CRs-Fixed: 2369244
2019-01-07 00:07:14 -08:00
hangtian
06a41355e6 qcacld-3.0: Discard msdu and do not try to access vdev and vdev->pdev
Discard msdu and do not try to access vdev and vdev->pdev, because in
some cases, vdev or vdev->pdev is already freed, but some packet just
received right after wmi vdev delete command is sent.

Change-Id: Ia38768d800da97e361ffa1688ce53c25be6cd597
CRs-Fixed: 2372557
2019-01-01 23:28:20 -08:00
Rakshith Suresh Patkar
c107967468 qcacld-3.0: Use new accessor macro for map_index in qdf_nbuf_cb
The existing accessor macro NBUF_MAP_ID is obsoleted due to
restructuring of qdf_nbuf_cb.

Use new macro QDF_NBUF_CB_RX_MAP_IDX to access map_index.

Change-Id: I23650781cdd770f25b72a0a5fe55acc12d71cb64
CRs-Fixed: 2370724
2018-12-23 21:58:36 -08:00
Alok Kumar
6f20e30949 qcacld-3.0: Avoid rx_ring.refill_debt count to become negative
Here rx_ring.refill_debt can become negative if filled count
returned from htt_rx_ring_fill_n() exceeds the rx_ring.refill_debt.

This is possible because inside htt_rx_ring_fill_n() we always refill
num = qdf_atomic_read(&pdev->rx_ring.refill_debt). Here we do not take
care of already served debt.

Taken care of above by subtracting debt_served from refill debt.

Change-Id: I0c154c978b711da2d8497c50f730619767787188
CRs-Fixed: 2365566
2018-12-21 02:40:32 -08:00
Mohit Khanna
8141877926 qcacld-3.0: changes for GRO for TCP packets
Add support for GRO functionality for TCP packets.

CRs-Fixed: 2346997
Change-Id: I9d38c926af4114e90427f5b5c632cd02b9eb3160
2018-12-18 00:07:46 -08:00
Jeff Johnson
ba0773ae95 qcacld-3.0: Remove ol_params.h
Change Ifbb38adba434aa19fade4838e30d39884b6e4615 ("qcacld-3.0: Remove
unnecessary includes from ol_if_athvar.h") removed the only place
where ol_params.h was referenced. Since this file is unused, remove
it.

Change-Id: I8c0e5335f30a0307e7ebac5d33828db41bb8156d
CRs-Fixed: 2366966
2018-12-17 13:12:01 -08:00
Jeff Johnson
c44540a879 qcacld-3.0: Remove unused htt_fw_stats macro ROUND_UP_TO_4
Macro ROUND_UP_TO_4 in htt_fw_stats.c is unused, so remove it.

Change-Id: I2aea830bee4d9e40546a02ee8715995e662cbeb2
CRs-Fixed: 2366962
2018-12-17 13:12:01 -08:00
Chaoli Zhou
50bc9ad9e8 qcacld-3.0: Fix build error at SDX24.le.1.7 platform
Fix 'for' loop initial declarations are only allowed in C99 or C11 mode
build error at SDX24.le.1.7 platform.

Change-Id: I08cc4ee7558f0b390a8c848828272497f517ef08
CRs-Fixed: 2365266
2018-12-14 12:48:29 -08:00
Rakshith Suresh Patkar
9c46af1764 qcacld-3.0: Add support to dump last n dpt stat records
Add an argument to dump only last n dpt records of debug fs
dump_set_dpt_logs file.

Change-Id: I6ce96d1e57db773386e8ebc29436b33b2211a94f
CRs-Fixed: 2362507
2018-12-14 07:15:02 -08:00
chenguo
2201c0ae46 qcacld-3.0: Fix NULL VDEV pointer during register in monitor mode
After gerrit#2436786(which the Change-ID is
Ie64a05d795660d557d928cb9b874fa5e702f4f55), vdev in monitor mode
is removed from vdev list of pdev. So it is needed to use the new
cdp api, which is cdp_get_mon_vdev_from_pdev instead of
cdp_get_vdev_from_vdev_id in monitor mode to register vdev.

CRs-Fixed: 2350720
Change-Id: Idd36cdb09666783db2042f77708be4dcc6b9d82b
2018-12-14 05:34:50 -08:00
Jeff Johnson
e2e0e337eb qcacld-3.0: Remove ol_ctrl_addba_api.h
The definitions in file ol_ctrl_addba_api.h are unused, so remove the
file and remove the #include directive in the one place it appears.

Change-Id: I9056791b1a21dc8c8e113db2d49468e3abafab34
CRs-Fixed: 2364105
2018-12-11 10:18:26 -08:00
Alok Kumar
8df4c76c58 qcacld-3.0: Set self_peer to NULL in monitor mode if ref cnt is 0
In monitor mode, pdev->self_peer is not updated before deleting the
peer in ol_txrx_peer_release_ref when peer ref_cnt becomes 0. This
leads the stale peer stored in pdev->self_peer. The pdev->self_peer
is not updated during peer creation due to this stale peer.

Update the pdev->self_peer to NULL when peer ref cnt becomes 0

Change-Id: Id09771a1a7c5a363cf3251af829ac8ff50d38a5b
CRs-Fixed: 2356492
2018-12-11 01:42:56 -08:00
Jeff Johnson
58894a1df3 qcacld-3.0: Remove PERE_IP_HDR_ALIGNMENT_WAR feature
The PERE_IP_HDR_ALIGNMENT_WAR feature does not apply to hardware
supported by this driver, and the code would not build correctly
if the feature was enabled, so completely remove the feature.

Change-Id: I4697e798dc57ab7e51c88d40e4d0f9a26a98de6d
CRs-Fixed: 2363232
2018-12-10 20:20:47 -08:00
Jeff Johnson
8feaa63728 qcacld-3.0: Remove obsolete txrx.h
Almost all of the definitions in txrx.h are obsolete. Rather than
remove the obsolete definitions and leave behind a file containing
only the two definitions that are used, move those useful definitions
to ol_txrx_types.h and completely remove txrx.h.

A side effect of this change is that a couple of unrelated files no
longer build because some of their dependencies were being met as a
side effect by txrx.h including other files. To solve the build issues
explicitly include the necessary header files where they are needed.

Change-Id: Ic3e3b36939e4ab04831d41a1e230bfab3da086a2
CRs-Fixed: 2363231
2018-12-10 20:20:45 -08:00
Rakshith Suresh Patkar
0f6375c2b7 qcacld-3.0: Enable use of new htt header format
If FW supports new htt format include only payload length in
the header length.

Change-Id: Ia668d73dcae3eb4adc1a4cfb0498b34d8c38f522
CRs-Fixed: 2361564
2018-12-10 05:36:45 -08:00
Alok Kumar
e197744efb qcacld-3.0: Send peer unmap confirmation cmd to FW
Send WMI_PEER_UNMAP_CONF_CMDID to FW after getting all
UNMAPs for the peer. This will ensure synchronization
between MAP/UNMAP and same peer_id won't be used for
different MAC address until all UNMAPs are processed.

Change-Id: I2c7793b527d5dbab0f9571185e6c16e0c6b7fcc3
CRs-Fixed: 2357245
2018-12-07 15:53:01 -08:00
Alok Kumar
3f3000fd73 qcacld-3.0: Add INI parameter for PEER UNMAP CONF SUPPORT
Add INI parameter "gEnablePeerUnmapConfSupport" to enable/disable
peer unmap confirmation support. When enabled Host will send
this support to the FW only if FW support is also enabled.
Default Value: False

Change-Id: Id368e61b5a99354e25a1fa2a0ff61b1262217521
CRs-Fixed: 2358126
2018-12-04 04:04:03 -08:00
Mohit Khanna
4079b4b464 qcacld-3.0: Remove un-initialized lock from DP thread
DP RX thread is using an un-initialized lock during suspend/resume
routine. This lock is not needed as the code is executed only by a
single execution context.

Remove usage of un-initialized lock.

CRs-Fixed: 2351010
Change-Id: I656562fe3ca73a5044163008a44ffae416a6a7fa
2018-11-29 18:11:58 -08:00
jiad
391c528b3e qcacld-3.0: Properly featurize mobile router
When CONFIG_MOBILE_ROUTER is enabled there are build failures
due to improper featurization of mobile router, so fix the
featurization.

Change-Id: Ic9e1f608bc631409fbb5bcf84fc3f4520d69a7c9
CRs-Fixed: 2355786
2018-11-29 18:10:55 -08:00
Lin Bai
6abb0f08e5 qcacld-3.0: Typecast DMA address properly when printing
Change Icdcfcdd10400aa2fad64441aa863087cc1c3766e use %llx to print
qdf_dma_addr_t. While qdf_dma_addr_t defined as 'unsigned long',
if without definition from kernel header.
Typecast DMA address to 'unsigned long long', before using %llx to
print DMA address directly.

Change-Id: Ic9527b494ac1aa2d47567a7dab5f0786913f4921
CRs-Fixed: 2355624
2018-11-28 01:36:43 -08:00
jitiphil
8e15ea6d1e qcacld-3.0: Relocate legacy DP INI items
Relocate below legacy  DP ini items as per
converged infrastructure.

1. maxMSDUsPerRxInd
2. gEnableTxSchedWrrVO
3. gEnableTxSchedWrrVI
4. gEnableTxSchedWrrBE
5. gEnableTxSchedWrrBK

Change-Id: Iebded11869c55c1797f0521af05585284f46f544
CRs-Fixed: 2351663
2018-11-23 03:38:20 -08:00
jitiphil
ebf3a9204f qcacld-3.0: New HTT H2T msg support
Current HTT_H2T messages from host driver does not have
consistency in message length set by host driver. Some
message types include HTC header length also within the
message length, while other types have message length
itself only.

Fix the same by sending same message format based on
firmware capability.

Change-Id: I885a21530a2d8f852387ae54cf7ee0751aad2516
CRs-Fixed: 2145560
2018-11-22 16:38:32 -08:00
jiad
af210c01e9 Revert "qcacld-3.0: Fix WDI 1.0 MCC TX SMMU fault"
This reverts commit 2459533, which fixes WDI 1.0 MCC SMMU fault
but it's only a partial fix. And we also need 2490501 to be a
complete fix. But 2490501 has regressions and leads to NULL
dereference, and it's reverted in 2517642 until a new complete
fix is ready.

Based on above, revert 2459533 and WDI 1.0 MCC SMMU datapath
will be a known issue.

Change-Id: I6444bfd8552906d889531b7e77ca6aa6b6fa7d6d
CRs-Fixed: 2352927
2018-11-22 00:43:27 -08:00
Lin Bai
e8ce5c5744 qcacld-3.0: Fix format error when printing DMA address
Compiler threw error as -Werror=int-to-pointer-cast when casting
DMA address to void pointer.
Use %llx to print DMA address directly.

Change-Id: Icdcfcdd10400aa2fad64441aa863087cc1c3766e
CRs-Fixed: 2350605
2018-11-21 13:47:22 -08:00
Mohit Khanna
c908646fa9 Revert "qcacld-3.0: Fix WDI 1.0 MCC TX SMMU unmap"
This reverts change I7d04e9b01fbd973601ee9e4e74c6bf4dd3d0f7bb

This patchset is causing wlan_ipa_nbuf_cb to be called even when ipa_ctx
is null. wlan_ipa_nbuf_cb should not be called for non-IPA packets. Also
there should be a NULL check for ipa_ctx in the function.

Reverting the change may lead to SMMU errors during AP-AP MCC mode.

CRs-Fixed: 2352812
Change-Id: I2f2382ca12a14a09ed124ccd18a7f450282c5975
2018-11-21 14:46:31 +08:00
Nirav Shah
7c8c171e05 qcacld-3.0: Remove unnecessary prints from data path
1. Remove error prints for qdf_mem_malloc APIs.
2. Remove unnecessary __func__ from data path prints.

Change-Id: I6c4b110f626d84da055821c5f210a3d000b6ff15
CRs-Fixed: 2317315
2018-11-16 05:08:30 -08:00
jiad
15fb83796a qcacld-3.0: Fix WDI 1.0 MCC TX SMMU unmap
For WDI 1.0 MCC TX, wlan driver is involved for TX and skb is
provided from IPA driver. With SMMU enabled, dma_addr is of
IPA domain. In such case, wlan driver needs to do DMA map
itself. After doing DMA map, an offset of frag_header
and ipa_header is added to the iova and skb->cb is updated
with the new iova. After TX completion, skb DMA unmap is done
but with the iova of the above offset included, which leads to
unmapped iova error.

Fix is to recalculate the iova and update skb->cb with new iova,
which has frag_header and ipa_header length removed.

Change-Id: I7d04e9b01fbd973601ee9e4e74c6bf4dd3d0f7bb
CRs-Fixed: 2338049
2018-11-14 22:06:05 -08:00
Jingxiang Ge
7cdb955b0f qcacld-3.0: Fix tx queue is paused forever
Put flow control setting in the flow_pool_lock, which can avoid
race condition between ol_tx_desc_free and ol_tx_desc_alloc.
This is a refine based on Ib60139fd94a4fb88c92a7f8aaf886ae9d3ca4c75.

Change-Id: I8d89323b5631039d7ff5a141775cc5825389c18b
CRs-Fixed: 2297190
2018-11-13 04:20:48 -08:00
jiad
a244137e66 qcacld-3.0: Fix WDI 1.0 MCC TX SMMU fault
SMMU fault is observed for WDI 1.0 MCC TX when SMMU is enabled.
Issue is that dma_addr passed from IPA driver is iova of IPA
domain. WLAN driver directly uses the iova to do transmission.
Since iova is not mapped in WLAN domain, SMMU fault occurs.

Fix is to map skb to WLAN domain for TX when SMMU is enabled.

Change-Id: I4c029a1e4dfff149e2784f5b95fe1f3cf3e3719e
CRs-Fixed: 2318537
2018-11-12 18:28:03 -08:00
Venkata Sharath Chandra Manchala
cd660986d1 qcacld-3.0: Enable Rate events in pktlog
Support Rate control and rate control update events
for pktlog by enabling the events in
WMI_PDEV_PKTLOG_ENABLE_CMDID message.

Change-Id: I9281fcd7c632ba19a84a6eb2c0dff49a172fd70d
CRs-Fixed: 2340635
2018-11-11 09:27:20 -08:00
Rakshith Suresh Patkar
384a28ae48 qcacld-3.0: Add timestamp debug info in ol_tx_desc_t
Add descriptor timestamp debug info in ol_tx_desc_t and
add APIs to set these values.

Change-Id: I686fccff4268811474630dbea8369fabe82d1517
CRs-Fixed: 2333654
2018-11-10 04:02:04 -08:00
jitiphil
377bcc1227 qcacld-3.0: Add legacy DP CFG items and APIs
Add the basic infra for legacy DP CFG items and the APIs
to be used from other components.

Change-Id: If7ad0e02c65e04ea13a308e680c9ba3b3d84ae25
CRs-Fixed: 2324099
2018-11-01 05:42:07 -07:00
Will Huang
a47dca3872 qcacld-3.0: Map as QDF_DMA_BIDIRECTIONAL for PMF tx frame
Some target which support sending mgmt frame based on htt would DMA
write this PMF tx frame buffer, it may cause smmu check permission
fault, set a flag to do special DMA map.

Change-Id: I3686be211374d2c316726fa3248dedce87c3faed
CRs-Fixed: 2332329
2018-10-30 01:46:01 -07:00
Tiger Yu
f1551cbacc qcacld-3.0: doing tx desc init earlier in ol_tx_hl_base
Doing the tx desc initialization earlier in ol_tx_hl_base to make sure
all msdu buffers have been mapped before msdu frame is freed if encouter
error.

Change-Id: Iefded014b4a179889e67fa7cc0e0c36e8218dd83
CRs-Fixed: 2337167
2018-10-26 10:39:20 -07:00
Venkata Sharath Chandra Manchala
598f503a01 qcacld-3.0: Change return status
Return QDF_STATUS as return status
over an integer value.

Change-Id: Ib6083de9b3581e6d92ec18f39ca552a5ae0cfc2d
CRs-Fixed: 2311561
2018-10-26 10:39:16 -07:00