Commit Graph

765 Commits

Author SHA1 Message Date
Yun Park
bcffecb07e qcacmn: Add QDF abstraction for IPA_CLIENT_WLAN1_CONS
Add QDF abstraction for IPA_CLIENT_WLAN1_CONS.

Change-Id: I7b93432c5ce88d13ba9e52eb04e933238fe7c836
CRs-Fixed: 2220705
2018-05-02 14:29:22 -07:00
Chaithanya Garrepalli
5142030dd9 qcacmn: add qdf API for skb_orphan
Add the qdf abstraction API for skb_orphan

Change-Id: I0fabb3fdd02e289d7bad97efebb2853e6827f458
CRs-Fixed: 2232427
2018-05-02 01:19:47 -07:00
Mohit Khanna
0425280d73 qcacmn: add DPTRACE Enhancements - Phase 2
Change data packets printing to one line
Add msdu-id to TX packets
Increase data packets size to include the complete IP packets
Indication/print when the throttling occurs

Change-Id: I07fc664ea08bc8746e31260599c5892701ae52e7
CRs-Fixed: 2157769
2018-05-01 21:37:34 -07:00
jitiphil
e5515b01bf qcacmn: Validate nbuf in dp trace function
This reverts commit Idb59f83edc09f9be8bf0bd231b8eb6ff28f37fd4.

nbuf was set to NULL and then deferenced.

To address the issue validate nbuf before processing in dp trace function.

Change-Id: I464c0dea36c0288c4bb01d6fba5255169d7ec255
CRs-Fixed: 2220892
2018-05-01 06:20:44 -07:00
Akshay Kosigi
6d34c7fb1f qcacmn: Check for radio_tap length
Check for radio_tap length so as to not exceed the maximum length for
each of the radio tap IE.

Change-Id: I009abc2117f9b756a2a2a172c2fcf8446011bbf4
CRs-Fixed: 2223344
2018-04-23 07:51:03 -07:00
Rakshith Suresh Patkar
dcd073313e qcacmn: ADD APIs to set/dump dp trace buffer
Add APIs to dump dp trace buffer and set
proto bitmap, number of records and
verbosity of dp trace.

Change-Id: I23cda36515e1f3299d6c1c28dee2489a89bb15d9
CRs-Fixed: 2180984
2018-04-23 07:51:00 -07:00
Mohit Khanna
1fe9fd414a qcacmn: add HE radiotap flags for MU cases
HE field in radiotap header are not being updated for MU frames.
Add support for MU-MIMO and MU-OFDMA frames.

Change-Id: If33e9f9039c8df6e1bb8f591879d4defed184ac8
CRs-Fixed: 2191215
2018-04-20 12:09:02 -07:00
Dustin Brown
19911f3a06 qcacmn: Add qdf_flex_mem pool allocator
It often happens that the WLAN driver needs to allocate some pool of
structures to handle bursty operations. The traditional approach is to
statically allocate the maximum number of structures that we want to be
able to handle concurrently. This has the significant down side of
requiring manual tuning for every hardware combination for optimal
behavior, and wasting large amounts of memory during non-burst periods.

Add a new flexible, segmented memory allocator in QDF to help address
such scenarios. A small static buffer segment is used to service the
vast majority of operations, while additional segments are dynamically
allocated as needed to meet demand. Critically, these additional
segments are freed when not in use to reduce memory consumption. The
result is a self-tuning buffer that combines most of the benefits of
pure dynamic allocation with most of the benefits of pure static
allocation.

Change-Id: I5c27ecce72a450826494b5d13d6c9fdebda650a6
CRs-Fixed: 2224534
2018-04-19 14:15:19 -07:00
Yun Park
c60a22b88d qcacmn: Fix use after free of SKB in DP trace path
qdf_dp_trace could access nbuf already freed after sending to CE ring.
Move trace log before sending skb and add error log when fail to send.

Change-Id: I8ce36b9d196b7d44e0e9f7dcfe05db404a77e32f
CRs-Fixed: 2090277
2018-04-18 21:02:21 -07:00
Akshay Kosigi
41da247986 qcacmn: Remove redundant initialization of array indices
Remove redundant code where some array indices are initialized more
than once

Change-Id: I72414367dad92ccc14a8d0ba9f7660b29eaf8098
CRs-Fixed: 2216642
2018-04-18 18:08:30 -07:00
Shaakir Mohamed
5369725a35 qcacmn: Fix FCS error flag set in radiotap header
Fix FCS error flag set in radiotap header

Change-Id: I55210587d07f3deabebb4dc65caa835127a6b8e5
CRs-Fixed: 2213773
2018-04-16 16:57:07 -07:00
Shaakir Mohamed
19f4f63c35 qcacmn: Fix AMPDU status info in radiotap header
AMPDU flag check is not present when radiotap header is updated.
This fix will check for rs_flags to check and set AMPDU present

Change-Id: I9e0a703a46459b1013af092f8cb8b7cd35f1a3ce
CRs-Fixed: 2204278
2018-04-16 16:57:05 -07:00
Sravan Kumar Kairam
5951a618f8 qcacmn: Remove pld smmu platform API from QDF
As part of SMMU QDF cleanup remove platform pld API from
QDF.

Change-Id: Ib257969257e88b4f6a73c661b270924ce07bf398
CRs-Fixed: 2202910
2018-04-14 15:42:03 -07:00
Orhan K AKYILDIZ
c6b4a7be50 qcacmn: Fix a race btw tx and tx-compl
While handling a multi-segment TSO packet, there is a race condition
where, if tx complete arrives fast enough, the un-sent TSO segments
may be lost forever and a previously sent segment would be attempted
to be sent over.

Fix the race condition. Dont use the entry after send to go to
next entry.

Change-Id: I023587a48bea6f3b58aac62e398cc15939bbb773
CRs-Fixed: 2174715
2018-04-14 07:37:57 -07:00
Dustin Brown
cb94e45a0e qcacmn: Add qdf_list static initializer macros
In order to use qdf_list in situations where static initialization is
preferable, add a number of macros for statically initializing the
qdf_list structures.

Change-Id: I9a1291d495e7940b57d8519da0e3d62a0dfd2064
CRs-Fixed: 2222980
2018-04-14 07:37:55 -07:00
Dustin Brown
3cb98124c1 qcacmn: Fix NBUF_MEMORY_DEBUG PERF build error
qdf_net_buf_debug_init/exit() are defined when NBUF_MEMORY_DEBUG is
disabled, but they are not declared in the nbuf header file, leading
to build errors for PERF builds. Make qdf_net_buf_debug_init/exit()
static inline stubs when NBUF_MEMORY_DEBUG is disabled.

Change-Id: I4180086f27873a48cb965abed21f4bca2a4ca3a1
CRs-Fixed: 2222969
2018-04-13 09:30:45 -07:00
Shiva Krishna Pittala
b155431361 qcacmn: Fix the limitations in enabling memory debug on WIN
Copy the file name to a QDF local array, rather than using
the pointer to file name, to avoid access to the invalid pointer.
Also, separate out SKB debug from memory debug.
SKB debug will be enabled once the SKB related false positives are fixed.

CRs-Fixed: 2216661
Change-Id: I0ada1acb84c24c961cf614c9c47261f272959874
2018-04-11 09:15:20 -07:00
Mahesh Kumar Kalikot Veetil
9d240daf92 qcacmn: Fix architecture dependency
API arch_counter_get_cntvct()/arch_counter_get_cntpct() are
specific to MSM/ARM platform. Use proper compilation flags for
QDF to compile against other platforms.

Change-Id: I7fcc5d84cd205151d839d19dfdc3432cb289807d
CRs-Fixed: 2216035
2018-04-09 11:13:26 -07:00
Naga
6d06baaa60 qcacmn: Add new component id for cp stats
Add support for new component cp stats module id,
component id, obj mgr ref id and default log level

CRs-Fixed: 2192386
Change-Id: Ibb523f3756ad5cc80d5691ab421bcaaa0c7e2e4a
2018-04-06 17:49:56 -07:00
Akshay Kosigi
428d34b091 qcacmn: Use fix length for RADIOTAP_HEADER instead of arbitary length
Use fixed max length for RADIOTAP_HEADER instead of arbitary
length. Increase the RADIOTAP_HEADER length when we add more radiotap
elements

Change-Id: I0d290b0def8408029ee787999faa4498b75b212f
CRs-Fixed: 2217245
2018-04-06 13:25:37 -07:00
Akshay Kosigi
abdf9afdea qcacmn: Initialize array indices with default value
Initialize QDF module id with default trace values.

Change-Id: I5aa5b62ea10dd217d4ea1fbfd479b731142f3b54
CRs-Fixed: 2217245
2018-04-06 13:25:35 -07:00
Manjunathappa Prakash
d345d27867 qcacmn: Remove obsolete dmac_inv_range API
Remove obsolete dmac_inv_range API, instead use
qdf_mem_dma_sync_single_for_cpu API where ever required.
https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt

Change-Id: I44f14e6c87c1086decc600f59f298b7b8a94bc82
CRs-Fixed: 2215678
2018-04-04 04:02:05 -07:00
Kabilan Kannan
0cc70bc6ff qcacmn: Add magic string for memory leak debug
Add magic string in the driver to automate the
memory debug analysis.

Change-Id: I79b6ef49fa5c1c5fb74c72b228c3dae05b483a77
CRs-Fixed: 2212167
2018-04-02 19:39:40 -07:00
Kabilan Kannan
d6c4f2209c qcacmn: Validate nbuf in dp trace function
Validate nbuf before processing in dp trace function

Change-Id: Idb59f83edc09f9be8bf0bd231b8eb6ff28f37fd4
CRs-Fixed: 2213737
2018-04-02 15:21:57 -07:00
Dustin Brown
44ece32672 qcacmn: Impl. qdf_print_thread_trace for non-ARM
qdf_print_thread_trace() depends on the kernel function
save_stack_trace_tsk() being exported. While ARM architectures export
this function in Kernel versions >=4.14, other architectures already
exported it. When compiling against non-ARM architectures, avoid
stubbing out qdf_print_thread_trace().

Change-Id: I139ea08479b44b59aef657a35125feeb0c011e2f
CRs-Fixed: 2215585
2018-03-30 14:48:22 -07:00
Dustin Brown
37244642bf qcacmn: Featurize QDF_ASSERT
QDF_ASSERT is not properly featurized with its own build time config
flag. This leads to unnecessary logs and increased driver size for
platforms which do not want the feature enabled. Use the newly
introduced WLAN_WARN_ON_ASSERT build time flag to decide if QDF_ASSERT
should be a no-op.

Change-Id: I39e3ab6499210569b6ce09d77ee72f0081741989
CRs-Fixed: 2211983
2018-03-30 02:46:47 -07:00
Venkata krishna Sundararajan
471b552ca5 qcacmn: Add OS abstraction for NSEC_PER_MSEC
Currently code that is os-abstracted is referencing the
Linux-specific macro NSEC_PER_MSEC which violates the software
architecture. Introduce a new QDF macro to os-abstract this
Linux-specific macro.

CRs-Fixed: 2210748
Change-Id: I519773f2fd2a7227a285cf3832a758005a0f3900
2018-03-29 18:57:34 -07:00
Venkata krishna Sundararajan
e456cb8400 qcacmn: Add qdf wrapper for ktime, hrtimer related APIs
Add qdf wrapper for ktime, hrtimer related functions
and abstracts in qdf layer. The  wifi driver use the
qdf wrappers for the above APIs.

ktime APIs:
=========
ktime_to_ms
ktime_set
ktime_to_ns
ktime_add_ns
ktime_get
ktime_add
ns_to_ktime

hrtimer APIs:
=====
hrtimer_forward
hrtimer_active
hrtimer_callback_running
hrtimer_cancel
hrtimer_is_queued
hrtimer_get_remaining
tasklet_hrtimer_init
tasklet_hrtimer_cancel

CRs-Fixed: 2138717
Change-Id: Ic4655d6b342f2121a5acc9b1c6bda7aabd154f8f
2018-03-29 18:57:32 -07:00
Dustin Brown
8949120a26 qcacmn: Avoid QDF_BUG logs when panic is disabled
QDF_BUG panics the system when an assertion fails and PANIC_ON_BUG is
enabled in the build config. It also prints an error message regardless
of if PANIC_ON_BUG is enabled or not. However, these prints are not of
much value when situations where PANIC_ON_BUG is disabled. When
PANIC_ON_BUG is disabled, avoid printing any logs.

Change-Id: I456ebce4d45d533d512402cd37d22e4ba1ae2cde
CRs-Fixed: 2211960
2018-03-27 13:53:10 -07:00
Mahesh Kumar Kalikot Veetil
fe276b3bc7 qcacmn: Fix qdf_get_monotonic_boottime_ns()
Fix the API implementation to account for time spent in system
suspend. This matches with API qdf_get_monotonic_boottime()
implementation.

Change-Id: I4bf8980bfc4500c035e8de7df4d8a18dfc6775ae
CRs-Fixed: 2211953
2018-03-26 16:32:28 -07:00
Santosh Anbu
efe6c5a884 qcacmn: Increase log level of HIF module
Increase log level of HIF module to ERROR so as to print the CE Ids
when dumping the CE registers as part of target failure handler.

Change-Id: I278f836590cd717c7bdeaf414023aeb646f9da2f
CRs-Fixed: 2205508
2018-03-21 05:57:50 -07:00
Sravan Kumar Kairam
376e5f1e3f qcacmn: Add IPA component related definitions
As part of IPA componentization remove IPA from HDD module
and make it as an independent component. Add qdf module ID
and Objmgr ID for IPA module.

Change-Id: Id99089f8188e8b1dbf7e1f60d3a127bec770706d
CRs-Fixed: 2180176
2018-03-21 03:39:37 -07:00
Dustin Brown
f02993c7ec qcacmn: Rename QDF_TRACE_RATE_LIMITED
Change Ie062ada403f8a31aebcde691396987ad9e5352b5 introduced level-
specific logging wrappers. Instead of using QDF_TRACE_RATE_LIMITED
directly, consumers should use the level-specific versions instead.
To prevent new consumers of QDF_TRACE_RATE_LIMITED in the future,
rename this API to __QDF_TRACE_RATE_LIMITED.

Change-Id: I06d35f5277fe2e11fbcc0e7e00b6fa99a84bda78
CRs-Fixed: 2208564
2018-03-20 20:02:18 -07:00
Manikandan Mohan
eb61d7e09f qcacmn: Add WLAN Module name as log prefix
Add WLAN module name as logging prefix in multiple wlan driver
compilation environment for differentiating the logs pertaining
to each driver module.

Change-Id: Ib3aeaa280e3beb0de8ceb105e0989cb6004964d6
CRs-fixed: 2197751
2018-03-19 19:58:20 -07:00
Manikandan Mohan
a18b86465c qcacmn: Fix export symbol for multi drivers compile
Update qdf files to use qdf_export_symbol to facilitate multiple
driver module compilation support.

Change-Id: I3bd0068bc2002b48a42da2c8f72bf84d49a6170f
CRs-fixed: 2197751
2018-03-19 19:58:06 -07:00
Sravan Kumar Kairam
cc33f70e91 qcacmn: Fix SMMU enable compilation error
Fix SMMU enable compilation error by protecting
IPA SMMU OS abstractions under feature flag.

Change-Id: Ib6a241d16a1906dad59781f1592988ce7eba1e57
CRS-Fixed: 2203169
2018-03-19 09:34:45 -07:00
Sravan Kumar Kairam
3738db4d3f qcacmn: Add QDF IPA abstraction for WDI UL params
Add QDF abstraction for WDI UL params used for IPA
WDI RX configuration.

Change-Id: If9daee345fbbd730e49fd236381273045919737e
CRS-Fixed: 2199017
2018-03-19 09:34:43 -07:00
Sravan Kumar Kairam
4e417e0ad0 qcacmn: Add APIs to get IPA SMMU status
Add APIs to get the IPA SMMU status

Change-Id: I5889f35739b220bd4ad38f4278c133cd97141b22
CRs-Fixed: 2176318
2018-03-19 09:34:41 -07:00
Himanshu Agarwal
59c25048cd qcacmn: Add QDF APIs for SMMU Stage 1 translation
Add QDF APIs for DMA buffer allocation and 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 needs to be mapped to physical address by
external module before accessing these buffers.

Change-Id: I88e938d8ebe1f32fdea79e3c3aa8a3638ddfd2b8
CRS-Fixed: 2072953
2018-03-19 09:34:37 -07:00
Dustin Brown
385b73090f qcacmn: Add per-level logging wrapper APIs
Depending on platform limitations and the intended audience of a
particular WLAN driver build, it would be useful to be able to compile
out specific logging level logs completely. To that end, introduce
per-level logging wrappers, which can be compiled in or out by the build
configuration.

Change-Id: Ie062ada403f8a31aebcde691396987ad9e5352b5
CRs-Fixed: 2205888
2018-03-16 21:51:49 -07:00
Dustin Brown
9a94c9a29d qcacmn: Rate limit logs based on elapsed time
QDF_TRACE_RATE_LIMITED() currently rate limits by only printing every
rate'th call to the function from the same location. Instead, prevent
logging messages more than some constant 'k' times per second. This
means any subsequent calls to the API from the same location within 1/k
seconds will be dropped.

Change-Id: I31a3f48f68fb6bc67f59f3157a635345943d3331
CRs-Fixed: 2205794
2018-03-16 21:51:48 -07:00
Rachit Kankane
9cc217ab6a qcacmn: Compile out MTRACE feature
Fix to disabled MTRACE feature

Change-Id: I3cc30b47a9ba9dc9f99bf1185f99f0ae621f5f31
CRs-Fixed: 2189886
2018-03-15 08:05:06 -07:00
Rajeev Kumar
0a7a3b15be qcacmn: Ignore qdf debug fs create failure during init/deinit
Debug fs create failure should not fail wifi turn on. Add logic
to allow wifi turn on even if kernel debug fs create API returns
failure.

Change-Id: I686362340d9ef0268ca7587ad30c726c33f1c427
CRs-Fixed: 2203330
2018-03-15 04:26:10 -07:00
Sravan Kumar Kairam
4af5290d97 qcacmn: Add QDF abstraction for IPA enums
Add QDF abstraction for Linux kernel IPA driver enums.

Change-Id: I9b61917768a109d12aefdc19a7822287337c9c18
CRs-Fixed: 2194166
2018-03-14 22:34:15 -07:00
Srinivas Pitla
ceae543cff qcacmn: Change object manager trace level to ERROR
Change object manager trace level to ERROR, move few
debug prints to obj_mgr_warn

Change-Id: Idc8943badb524c52694df18b035c9fc91c097e3a
CRs-Fixed: 2195292
2018-03-09 16:31:11 -08:00
Subrat Mishra
2a06b23e82 qcacmn: Change ATF default trace level
Change ATF module default trace level from NONE to ERROR

Change-Id: I7dc47968db72329ffc99f466f0db51110ac02d64
CRs-Fixed: 2201834
2018-03-09 09:35:50 -08:00
Dustin Brown
1723d45ad2 qcacmn: Don't inline QDF_DEBUG_PANIC for debug builds
Calling panic can cause a compiler to assume any subsequent code is
unreachable. Because these panics may or may not be enabled by the
build configuration, this can cause developers some pain. Consider:

	bool bit;

	if (ptr)
		bit = ptr->returns_bool();
	else
		panic();

	// do stuff with @bit

	return bit;

In this case, @bit is potentially uninitialized when we return!
However, the compiler can correctly assume this case is impossible when
PANIC_ON_BUG is enabled. Because developers typically enable this
feature, the "maybe uninitialized" warning will not be emitted, and the
issue remains uncaught until someone tries to make a build without
PANIC_ON_BUG.

A simple workaround, is to put the definition of QDF_DEBUG_PANIC in
another compilation unit, which prevents the compiler from assuming
subsequent code is unreachable. For CONFIG_SLUB_DEBUG, do this to
catch issues earlier. Otherwise, use the typical inlined approach.

Change-Id: I8901fd33781ccb8229fad16343a5b08d97cdcf68
CRs-Fixed: 2202527
2018-03-09 00:10:40 -08:00
Sravan Kumar Kairam
03e69b3098 qcacmn: Translate QDF pending status to Linux error
Translate QDF pending status to Linux error in progress
code.

Change-Id: I3a8d9d17cb4b72cdfbb6d1f1c5adecd1679fe816
CRs-Fixed: 2200900
2018-03-07 16:28:02 -08:00
Poddar, Siddarth
a9172bf24d qcacmn: Add APIs to get data packets info
Add APIs to get TCP syn/syn-ack/ack packets,
TCP src/dst port, DNS domain name/query/response,
ICMPv4 req/res, and ICMPv4 src/tgt ip information.

Change-Id: I1e4e92997a33e64fe2e4ae28a05b54b6ba5e8cff
CRs-Fixed: 2168412
2018-03-07 03:55:46 -08:00
sumedh baikady
b882f93dbc qcacmn: Fix channel info in radiotap
Fix frequency and channel flags fields in radiotap API

Change-Id: Ic991ea796d0b19f8adc16a5bc33cfde0042c167e
CRs-fixed: 2189914
2018-03-03 23:44:46 -08:00