Commit Graph

765 Commits

Author SHA1 Message Date
Shiva Krishna Pittala
92e3f61248 qcacmn: Use ksize to update kmalloc counters under memory debug
qdf_mem_malloc/free wrappers are using ksize to update the kmalloc counters
of the driver whereas the debug versions of this wrappers are using
requested size itself. To figure out the actual dynamic memory held by
the driver on the debug profile, use ksize for debug versions as well.

Change-Id: I4311f9a450e3fa3e04ac45b1bf7f36a7ff677057
CRs-Fixed: 2449995
2019-05-29 16:46:58 -07:00
Aditya Sathish
8e8f71952b qcacmn: Add NULL check while iterating sgl entries
__qdf_dma_get_sgtable_dma_addr() iterates through sgl entries
without appropriately checking for NULL pointers before attempting
to access them.

Fix the above-mentioned issue by adding a NULL check before access.

Change-Id: I7456db834f71b9b5cf3cb254526177b9fdcee664
CRs-Fixed: 2448239
2019-05-29 11:08:28 -07:00
Ashish Kumar Dhanotiya
f38970bcdc qcacmn: Update feature flag for qdf_shared_print_ctrl_cleanup
Currently qdf_shared_print_ctrl_cleanup api is defined based on
CONFIG_MCL feature flag, as MCL is not using this api, move
this api under correct WIN specific feature flag
QDF_TRACE_PRINT_ENABLE.

Change-Id: I80117f351e45ad2106524c333f219bba77d49115
CRs-fixed: 2448447
2019-05-29 11:08:18 -07:00
Chaithanya Garrepalli
ab234e56f6 qcacmn: Add Cached Descriptor support for DP SRNGs
Add support to configure any HAL SRNG descriptor to
be allocated from cached memory area. This is to
optimize of CPU cycles spent on uncached
memory accesses. Also added prefetch of cached
descriptors

Change-Id: I2544e8596d48e2f5549bf687a764c16d73397545
CRs-fixed: 2267945
2019-05-29 11:08:12 -07:00
Tiger Yu
6f1fc0070f qcacmn: Add support for TCP delayed ack in driver
qcacld-2.0 to qcacmn propagation

This change adds support for driver supported TCP
delayed ack to increase TCP RX performance in
third-party platform which don't support kernel
TCP delayed ack feature.

TCP delayed ack is dependent on count and timer
values. Whatever is achieved first will trigger
sending TCP ack.

This feature can be controlled through ini values.
gDriverDelAckTimerValue - timer value in ms
gDriverDelAckPktCount - delayed ack count
gDriverDelAckEnable - enable/disable feature

Change-Id: I8105bbb90965295b5a4aefeb00d344a90155974d
CRs-fixed: 2414231
2019-05-28 03:46:49 -07:00
Paul Zhang
5ea0a91a89 qcacmn: Implement api for interop issues ap
Implement the interface to transfer the info between
host driver and firmware about the ap which has interop
issues with the DUT. It is detected by firmware and
forwarded to user sapce for persistent storage. User
space configs these APs to firmware when the DUT
starts up next time.

CRs-Fixed: 2425197
Change-Id: I3857d2a605baa2673af333a7a0412f1690b59769
2019-05-24 16:01:00 -07:00
Ankit Kumar
e222775d39 qcacmn: Extract tid from REO descriptor and save to skb cb
earlier we were extracting the tid from the rx tlvs, this
was in the last cache line of the 384 byte tlv. we are
extracting various fields from REO descriptor, now we are
also getting tid from the descriptor to avoid accessing
the last cache line of rx TLV there by avoiding one
cache miss per packet.

Change-Id: I1f4f12dca402604692ea374599add6763d68ab01
CRs-fixed: 2449706
2019-05-21 14:43:21 -07:00
Bala Venkatesh
94b9ce4320 qcacmn: Release the platform_info spin lock before del_timer_sync
In qdf_mc_timer_stop_sync acquires the platform_info spinlock
and call's the del_tymer_sync. del_timer_sync waits for callbacks
to execute all CPU's. But callback scheduler_mc_timer_callback
tries to acquire the platform_info lock to execute. This can
lead to deadlock.

Change-Id: Ib21ee5b57e11d1c98e1308ee5318fb47d78a6ba2
CRs-Fixed: 2453603
2019-05-21 06:14:20 -07:00
Vivek
2ec3781464 qcacmn: Define qdf timer multiplier as a macro
The current QDF timer multiplier factor is of type
uint32 which takes whole number, so we cannot have multiplier
factors like 0.5 or 1.5

To provide such timer multiplier,
we define timer multiplier, as a macro, provided though
build options and support values like 0.5 or 1.5 through
1/2 and 3/2 respectively and this is used to configure the
timeout value.

Change-Id: I3f5441e33cca71f4a399cbbf9c6f61e2f21ee828
CRs-Fixed: 2450710
2019-05-20 07:54:01 -07:00
Karunakar Dasineni
23d22c6d8a qcacmn: Add minidump support in QDF
Add QDF wrappers for minidump logging, which logs
memory locations to be collected as part of minidump.

Change-Id: I2c6b648d3fbb3aed9aaf7eb4872df5befcae971f
CRs-Fixed: 2444081
2019-05-14 16:23:05 -07:00
nobelj
debe2b3b9c qcacmn: support enhance TX capture
support TX capture mode to deliver msdu along with meta data.

Change-Id: Ic84416cc4892e37bfb831dada136a4ff6b615a61
2019-05-10 12:39:30 -07:00
Bala Venkatesh
c88eb85707 qcacmn: Stop ROC timer synchronously
Mc timer is used to initialize the p2p roc timer.
And the actual timer runs in the soft irq thread and
when the timer exipres it posts the message to mc thread.
Currently, qdf_mc_timer_stop is called to stop the timer.
It calls the del_timer internally to delete the timer.
del_timer() ensures that the given timer is not queued
to run anywhere in the system. But the callback may
be running on another CPU core can create race conditions.

So use del_timer_sync to delete the roc timer.

Change-Id: I2c0fd6e335fc342a3acf06ede534c84d40e19346
CRs-Fixed: 2447236
2019-05-08 02:51:46 -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
Srinivas Girigowda
fe5bb2e588 qcacmn: No need to include the file cds_if_upperproto.h
The file cds_if_upperproto.h is now removed from qcacld-3.0
project and hence remove from including this file.

Change-Id: I8a9974e70bf71916911b994e058b9892c4b5725d
CRs-Fixed: 2436678
2019-04-30 22:27:33 -07:00
Karunakar Dasineni
142f9baf47 qcacmn: Add new feature to support protocol tags
With this feature, using appropriate commands, link layer, network layer,
transport layer and some of the application protocols can be tagged with
the user provided tag values for easier identification of protocols. The
supported protocols today are as follows.

ARP, DHCPv4, DHCPv6, DNS over TCP (v4), DNS over TCP (v6), DNS over UDP
(v4), DNS over UDP (v6), ICMPv4, ICMPv6, TCPv4, TCPv6, UDPv4,
UDPv6, IPv4, IPv6, EAP.

Receive packets are tagged by hardware. Tags are applied after the first
matching rule. Hence it is recommended that the rules are
programmed in such a way that tags are configured from application layer
to data link layer to get expected results.

Change-Id: Ibdc2bd2b78234f482074955e89fb93f05988eaca
2019-04-26 15:31:10 -07:00
Kai Chen
52ef33fca3 qcacmn: Support enhanced Rx capture
Support Rx capture mode to deliver first 128 bytes of
each MSDU, along with some meta data.

Change-Id: I1ffa8b1a029d46f68aa78520bacc019de8af7a82
2019-04-19 04:08:56 -07:00
Rajeev Kumar
ad8457136c qcacmn: Use qdf_tracker for nbuf mapping
qdf_tracker generically implements all of the logic necessary to
implement the qdf_nbuf map tracking. Rather than using the current
custom tracking solution for qdf_nbuf map tracking, use qdf_tracker
instead.

Change-Id: Id33138a9035653b45c66b712bd11e54873266a17
CRs-Fixed: 2425623
2019-04-18 13:26:22 -07:00
jiad
443059e723 qcacmn: Set pcie addr flag for IPA rings
IPA driver adds is_txr_rn_db_pcie_addr and
is_evt_rn_db_pcie_addr in ipa_wdi_pipe_setup_info and
ipa_wdi_pipe_setup_info_smmu structure to check if doorbell
address is DDR address or PCIe memory mapped address. Thus
set the addr flag accordingly for IPA transfer and event
rings.

Change-Id: Ia55d14535db3818439e3884cfb61c3a1d81b86fb
CRs-Fixed: 2422162
2019-04-08 06:23:35 -07:00
Sravan Kumar Kairam
44f3efb9e7 qcacmn: Cleanup CONFIG_MCL from qdf nbuff replenish apis
In the current implementation, qdf nbuff replenish timer apis
invocation is controlled by macro CONFIG_MCL. So replace the
CONFIG_MCL with new flag FEATURE_NBUFF_REPLENISH_TIMER.

Change-Id: I8231483b791edf25c08ec4a794b5cc7b638daec7
CRs-Fixed: 2421538
2019-04-05 18:45:50 -07:00
Dustin Brown
778ebe552a qcacmn: Add periodic work tracking
Add debug tracking to qdf_periodic_work for create and destroy calls.

Change-Id: Id595ba05493ba196e497533ffb4f4e86e33df4b8
CRs-Fixed: 2423644
2019-04-03 15:45:08 -07:00
Dustin Brown
2698eab0b5 qcacmn: Add delayed work tracking
Add debug tracking to qdf_delayed_work for create and destroy calls.

Change-Id: Ie02c3577acd443e3f252b9b3a47207e5e2d5fe81
CRs-Fixed: 2423645
2019-04-02 15:16:22 -07:00
Dustin Brown
9c62f7d939 qcacmn: Add qdf_tracker
A common problem in any C code base is the proper management of various
resources, such as memory allocations, timers, works, locks, etc. To
that end, WLAN has added various one-off leak tracking features for
different resources over the years, to great benefit. However, this
approach is tedious, and prone to copy/paste and fix propagation issues,
making maintaining these various tracking features onerous.

Add a generic leak tracking data structure to WLAN for general use,
which implements these tracking logics. This will allow the various
resource tracking features to leverage this shared implementation for
ease of maintenance. Build on the hash table implementation added as
part of I7f5fc0c59ed220bde43044e7013b3c8573f1bf39.

Change-Id: I3247ace583108139dfb699ca077db3bdf5cfeace
CRs-Fixed: 2422958
2019-04-02 15:16:18 -07:00
Ashish Kumar Dhanotiya
affc485658 qcacmn: Move print_to_console api under correct feature flag
Currently print_to_console api is defined based on CONFIG_MCL
feature flag and MCL is not using it, move this api under
WIN specific feature flag QDF_TRACE_PRINT_ENABLE.

Change-Id: I2af2e21eb1cde395568cc1879a2df8c65e56a275
CRs-fixed: 2425040
2019-04-02 15:16:08 -07:00
Dustin Brown
fdea3c7af7 qcacmn: Remove qdf_delayed_work_t
qdf_delayed_work_t has been superseded by qdf_delayed_work (via
I76bc59dcd4222643d70c6a763e5bc4ee9f0a487c). Remove the now obsolete
qdf_delayed_work_t.

Change-Id: I4e50521b469dcf9e1782e9412729f197552ee408
CRs-Fixed: 2420191
2019-03-28 13:13:36 -07:00
Sravan Kumar Kairam
dda9f66849 qcacmn: Resolve ipa compilation issue
Resolve compilation for targets with config ipa unified
api enable and have kernel version 4.9.

Change-Id: Ice0bba024c11c4d5222a58941ac50fd90b139aaa
CRs-Fixed: 2422170
2019-03-28 09:04:48 -07:00
Rajeev Kumar
7c2431dc95 qcacmn: Remove adrastea compile time flag from logging API
Time stamp logging API needs to use msm timer tick on all
MSM platforms hence remove the adrastea compile time flag
from qdf time stamp get api.

Change-Id: I9628646091a818acbca83ce75186308bdfd9453e
CRs-Fixed: 2419279
2019-03-26 20:56:19 -07:00
Srinivas Girigowda
22953dc004 qcacmn: Enable EAPOL/DHCP message tracing in Wifi driver
Enable EAPOL/DHCP message tracing in Wifi driver.

Change-Id: I010c9295fd6ca42a950f84f0d7a19b00d8b0c0da
CRs-Fixed: 2421835
2019-03-26 17:16:45 -07:00
Jeff Johnson
2831229bd7 qcacmn: qdf: 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 qdf replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: Ie7662617dad8138b803dc54e7759d3b6d76c53ce
CRs-Fixed: 2418255
2019-03-26 15:38:28 -07:00
Dustin Brown
6577bea1d6 qcacmn: Add qdf_ptr_hash
While the Linux kernel provides a generic hash table data structure, it
makes the assumption that it will always be referred to statically, so
as to avoid having to store the size of the hash table's internal array.
This limitation means reusing this data type generically is difficult or
impossible.

Add a very simple hash table implementation to WLAN for general use,
which stores its own size information, and assumes all input keys will
be pointers. Build on top of the recently added single-linked list
implementation added in I2959f34649a0d8e0b312d9d67c81de17753b9b6c to
reduce memory overhead.

Change-Id: I7f5fc0c59ed220bde43044e7013b3c8573f1bf39
CRs-Fixed: 2421829
2019-03-26 02:51:12 -07:00
Dustin Brown
d48a842b4b qcacmn: Add qdf_delayed_work
Add a new deferred work type, qdf_delayed_work, which executes a
callback after a delay. This type is meant to supersede
qdf_delayed_work_t, with a more consistent API and without typedefs.

Change-Id: I76bc59dcd4222643d70c6a763e5bc4ee9f0a487c
CRs-Fixed: 2419155
2019-03-21 16:15:22 -07:00
Dustin Brown
5e919958d2 qcacmn: Add qdf_periodic_work
Add a new deferred work type, qdf_periodic_work, which executes a
callback periodically until stopped.

Change-Id: Iedf5486474fccadb35e146e6d289c27a7c1002d3
CRs-Fixed: 2410005
2019-03-21 13:02:30 -07:00
Debasis Das
017bc12dc3 qcacmn: Enhancement of OS abstraction API's
The API's added in qal & qdf for abstracting the
OS calls are inlined and moved to the OS-specific
src directories.

Change-Id: I9c9c2cbba7702c97fbe343ceb63b330c2296084d
2019-03-20 22:10:24 -07:00
Dustin Brown
b5b21cac42 qcacmn: Remove qdf_*_outline() APIs
Several qdf_*_outline() APIs exist which are straight aliases to their
regular qdf_*() counterparts. Remove them, and update any callers to use
the regular APIs instead.

Change-Id: Ibe6e9cced521b93061e89690ab817ceafe49a469
CRs-Fixed: 2408267
2019-03-12 13:58:27 -07:00
Varsha Mishra
a331e6e55f qcacmn: Implement delay VOW stats for hawkeye
Delay counters per TID have been implemented for following types:
1. Linux stack to hw enqueue delay
2. HW enqueue delay to tx completion delay
3. TX interframe delay
4. RX interframe delay
5. RX frame delay from ring reap to networking stack

Change-Id: I836596cbd878a43955c18b4981cb5b7b43d4df5e
2019-03-12 06:10:05 -07:00
Rajeev Kumar Sirasanagandla
d540e70a22 qcacmn: Cleanup CONFIG_MCL from qdf wake lock api
In the current implementation, from qdf wake lock api, diag log api
invocation is controlled by macro CONFIG_MCL.

Aim is to clean CONFIG_MCL in qdf_lock.c

Change-Id: I16a1a46a2ebc255ed092a1fdd05f127c7e542a5e
CRs-Fixed: 2411636
2019-03-11 19:23:07 -07:00
Dustin Brown
c9681754d0 qcacmn: Use panic in qdf_mem_copy/move/set/zero/cmp()
It has been observed at that several issues have crept into mainline due
to qdf_mem_copy() gracefully returning when the source or destination
pointers are NULL. In order to prevent such regressions in the future,
change calls to qdf_mem_copy/move/set/zero/cmp() with NULL pointer
parameters so they panic in debug builds.

Change-Id: I6df4c42245ed1d0d8a85477f59552f8243488924
CRs-Fixed: 2408266
2019-03-05 14:23:46 -08:00
Abhiram Jogadenu
c528145962 qcacmn: Add support for peer tx event param extraction
Add host's copy of peer cfr tx completion event param and prototype for
extract API.

CRs-Fixed: 2406064
Change-Id: I433171fc90d3c5dbb92dd525e8b5b2c441cc1bf9
2019-03-04 15:48:08 -08:00
Dustin Brown
8ddef7dd9a qcacmn: Remove qdf_flex_mem_release()
Due to a limitation in the memory leak detection logic when qdf_flex_mem
was written, qdf_flex_mem_release() was necessary to free any
dynamically allocated memory in the qdf_flex_mem_pool during certain
points in the WLAN driver lifecycle. This was done to avoid flagging any
dynamically allocated qdf_flex_mem_segments as false positive leaks
when the memory domains were changed and leak checking was performed.
With the introduction of qdf_talloc(), this workaround is no longer
required. Replace the calls to qdf_mem_malloc/free with qdf_talloc/free,
and remove qdf_flex_mem_release() altogether.

Change-Id: Ia5fd21386b94fc117af5f27853db5d8341601738
CRs-Fixed: 2404955
2019-03-01 11:14:48 -08:00
Dustin Brown
8d41f62018 qcacmn: Use qdf_timer shim for all kernel versions
qdf_timer_t has repeatedly been identified as a problem area by Control-
Flow Integrity (CFI) analysis. This is because qdf_timer_init casts the
callback from a signature taking a "void *" into one which takes an
"unsigned long." While this "works," it is technically undefined
behavior, and CFI is correct in flagging it. Unfortunately, CFI
indicates the issue is with the callbacks themselves, which is incorrect.

Using unsigned long as the callback parameter has a number serious
drawbacks. Most significant is the fact that pointer size is not
guaranteed to be the same size as an unsigned long on platforms other
than Linux. For example, this is not the case on 64 bit Windows. As QDF
is supposed to be a platform abstraction, it cannot use unsigned longs
for memory addresses.

Instead of casting the timer callback in qdf_timer_init, use a callback
shim which takes an unsigned long, and handles the appropriate
conversions needed to call the actual callback function.

Change-Id: Id9149169f35f619f649934310a2a673a685690f0
CRs-Fixed: 2403021
2019-02-27 08:12:09 -08:00
Amir Patel
78824b1d4e qcacmn: Add changes for RDK statistics
Change API signature for dp_getrateindex to populate rate index
and add additional stats required for RDK.
Add QDF abstraction for EWMA average rssi

CRs-Fixed: 2397918
Change-Id: Id878971799c5df2ae60057a86b2769724ee0dcc5
2019-02-27 03:13:56 -08:00
Dustin Brown
d33659b98d qcacmn: Provide reason to QDF_DEBUG_PANIC()
A common pattern in WLAN to panic the driver is to log the reason and
then unconditionally panic. QDF_DEBUG_PANIC() takes a reason string to
help make the reason for the panic more obvious, but it is not always
used. Ensure all callers of QDF_DEBUG_PANIC() provide a reason string.

Additionally, make the reason string parameter of QDF_DEBUG_PANIC()
mandatory.

Change-Id: Ia3c7acfe590f7f465823fff3f2393653b2d20fe5
CRs-Fixed: 2403830
2019-02-26 14:21:37 -08:00
Min Liu
ae79cfd733 qcacmn: Cleanup CONFIG_MCL for qdf_mem.c
Remove CONFIG_MCL and include the header file for both MCL and
WIN code since this feature is already handled by the feature macro
FEATURE_WLAN_DIAG_SUPPORT.

Change-Id: I4d4ed46ed5cb62950bb8b25af0a173bfe5f86474
CRs-Fixed: 2399386
2019-02-25 20:13:36 -08:00
hangtian
f08f9461ff qcacmn: Add warning message on qdf_mem_set() document
Add warning message on qdf_mem_set() document.

Change-Id: I82afa828f6bce295533c63b42515e526f1b01110
CRs-Fixed: 2380158
2019-02-23 14:06:59 -08:00
Srinivas Pitla
8d19efa7c2 qcacmn: Optimize VDEV MLME SM prints
Reduced VDEV SM debug level, and added prints for state abd substates at
event handling API

Change-Id: I3076c590131581a8728548592e0a9b4e66db377e
CRs-Fixed: 2394012
2019-02-23 11:06:11 -08:00
Dustin Brown
e6c7bff8d9 qcacmn: Revert "Fix kernel 4.15 timer list dependencies"
This reverts change Id9c29413ca0d21533a0afae245595051fa3a400f. This
change was a work around to allow compiling against legacy code. Now
that these compilation issues have been resolved, remove the work
around.

Change-Id: I38a474f50076320cf961d6fd340960e4c9b148a0
CRs-Fixed: 2401315
2019-02-23 05:19:10 -08:00
hangtian
67ebc3de24 qcacmn: Use qdf_mem_zero for zero initialization, qdf part
Use qdf_mem_zero for zero initialization, qdf part.

Change-Id: I9c8980c2d2355e315f13541db65c4b11b12c5124
CRs-Fixed: 2378005
2019-02-21 01:46:59 -08:00
Vivek
ea6a02fef9 qcacmn: Change log level for qdf_mem_malloc failure
The non debug version of qdf_mem_malloc logs
allocation failures at WARN trace level
and the debug version uses ERROR trace level.

Also the default log level for QDF component is set to ERROR,
so with this, for failures in the non debug version
of qdf_mem_malloc, we would not see any logs.

Changing the log level to ERROR for failures logs in
the non debug version of qdf_mem_malloc.

Change-Id: I1e28cddfac8f909dec6e3bf6c3beb368953cd357
CRs-Fixed: 2397096
2019-02-14 04:25:51 -08:00
Dustin Brown
1475aad768 qcacmn: Move qdf_status_to/from_os_return()
QDF_STATUS is defined in qdf_status, but related APIs
qdf_status_to_os_return() and qdf_status_from_os_return() are defined
in qdf_util. Create a new file, qdf_status.c, and move these functions
there instead.

Change-Id: Iaa2efa5f662be014a61a8490c3fab411ec0f2054
CRs-Fixed: 2395178
2019-02-12 13:09:59 -08:00
Madhvapathi Sriram
2750c27818 qcacmn: Remove error log for qdf_mem_malloc in qdf files
qdf layer already has the error trace

Change-Id: I451e8a008585d80c9d3ccb619461362a74d0a52b
CRs-Fixed: 2374111
2019-02-11 02:30:06 -08:00
Shiva Krishna Pittala
e587b2d1a3 qcacmn: Remove TSO check in nbuf reference tracking
Currently, QDF tracks nbuf reference of only TSO packets.
Remove the TSO check to extend the supprt to all the packets.
This will help in tracking enhanced multicast packets.

Change-Id: Iacf7d4fc0492470d405d9644d480ad9463bcb543
CRs-Fixed: 2384334
2019-02-08 04:03:41 -08:00