Commit Graph

473 Commits

Author SHA1 Message Date
Jeff Johnson
1974e07df2 qcacmn: qdf: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: Ia920daa3248677b9446f4203c7698cbc37648fbd
CRs-Fixed: 2230684
2018-05-18 02:17:38 -07:00
Dustin Brown
b7871f64ad qcacmn: Add qdf_status_from_os_return()
It is sometimes useful to reverse map an errno into a QDF_STATUS. For
this purpose, introduce qdf_status_from_os_return(), the logical inverse
operation of qdf_status_to_os_return().

Change-Id: I053f43867ef603c2654eca64fe76c7bd313e14e4
CRs-Fixed: 2242664
2018-05-18 00:00:33 -07:00
Dustin Brown
a487539d7d qcacmn: Pre-allocate flex-mem segments
Pre-allocate the reduction_limit number of segments during
flex-mem-pool initialization.

Change-Id: I91581e04b94597ee4314ce8691b37a45066c5273
CRs-Fixed: 2241805
2018-05-17 21:39:12 -07:00
Wen Gong
a5dfb6d847 qcacmn: Add hdd memory dump feature flag
Add config flag to enable / disable hdd memory dump feature

CRs-Fixed: 2231694
Change-Id: I6b565bd7007223a51b67a2ea9fbafd6a737d22d9
2018-05-17 21:39:10 -07:00
Wu Gao
210778359a qcacmn: Add QDF API for ID allocation
In P2P ROC and MGMT tx cases, it use kernel address as cookie and
provides to userspace. Which has security risk. Add QDF API for ID
allocation and map ID to pointer, provides ID to userspace instead
of kernel address.

Change-Id: I4e10109988391474722df5b251fab11a87c7992b
CRs-Fixed: 2237756
2018-05-17 16:55:21 -07:00
Dundi Raviteja
dd1d8ba52a qcacmn: Possible information leak due to uninitialized data
In qdf_trace_hex_dump() API, linebuf array is not initialized where
it is used to print in the form of string in qdf_trace_msg() API,
this may cause information leak.

To address this issue, initialize the linebuf array to zero.

Change-Id: If2fe200eb16b28f7fff4413873c1d149716fb1a7
CRs-Fixed: 2232012
2018-05-17 02:38:00 -07:00
Jeff Johnson
2d821eb0fe qcacmn: Fix typo "recieve"
Replace typo "recieve" with correct spelling "receive".

Change-Id: I7d88e57b97fa6d217630d4a5d5c365b56e714428
CRs-Fixed: 2238309
2018-05-17 00:47:23 -07:00
Jeff Johnson
7947f90a30 qcacmn: Fix typo "retrived"
Replace typo "retrived" with correct spelling "retrieved".

Change-Id: Icde5e2480be78bdf8bf3befd1ce09b1b427074df
CRs-Fixed: 2238309
2018-05-17 00:47:20 -07:00
Jeff Johnson
dc9c55962d qcacmn: Fix typo "lenght"
Replace typo "lenght" with correct spelling "length".

Change-Id: Ieea0c547c61248e510835d16a9fa55ace486df23
CRs-Fixed: 2238309
2018-05-17 00:47:02 -07:00
Jeff Johnson
9f2d54f039 qcacmn: Fix typo "accross"
Replace typo "accross" with correct spelling "across"

Change-Id: Ifec1b81cbc6c808784d86afe055468ff42674a57
CRs-Fixed: 2238309
2018-05-17 00:46:41 -07:00
Prathyusha Guduri
9bb99acfca qcacmn: Add skb record rx queue to qdf API
Add skb_record_rx_queue() wrapper in qdf

Change-Id: Ic14e0a39d7d62bb404b443cc240b1ed0e5176119
2018-05-14 03:00:04 -07:00
Dustin Brown
8c268a0f54 qcacmn: Use qdf_flex_mem for nbuf map metadata
nbuf map tracking requires a bit of metadata which is currently
allocated dynamically for each mapping request. Change these allocations
to use a qdf_flex_mem pool instead, amortizing each physical allocation
over many mapping requests. This reduces the runtime overhead of the
nbuf map tracking feature, and provides significant memory savings when
MEMORY_DEBUG is also enabled.

Change-Id: Ieef9b996edab135cc2e0252c3a59cb6876f36371
CRs-Fixed: 2232113
2018-05-11 13:23:02 -07:00
Dustin Brown
03a7ac6e19 qcacmn: Add reduction limit to qdf_flex_mem
Add the ability to prevent qdf_flex_mem_pool from freeing memory
segments unless there are more than some minimum number in the pool
already.

Change-Id: I20bde2ed629b97924ea71b4f7f46a2c1fc1bab28
CRs-Fixed: 2229511
2018-05-11 13:23:00 -07:00
Jeff Johnson
49dd1d9143 qcacmn: Add missing entry to VERBOSE_STR[]
In qdf_trace_msg_cmn() the VERBOSE_STR array is used to convert
a trace level into a string. This array is missing an entry for
QDF_TRACE_LEVEL_ALL, so add it.

Change-Id: Iee6337cda7e54c429d36b2fd42bbd0c143c7d5a5
CRs-Fixed: 2232820
2018-05-07 13:58:21 -07:00
Kiran Venkatappa
bc1c547b8e qcacmn: Add timekeeping.h inclusion under correct kernel version
timekeeping.h is available from kernel version 3.17. Add header
inclusion and ktime_get_boot_ns call under correct version check flag.

Change-Id: I2a1a127e1716b52af56d14c39e2e646e34b05fa3
CRs-Fixed: 2230949
2018-05-07 01:29:30 -07:00
psimha
0e8a2c6558 qcacmn: Get NSS info from SS bitmap
Get NSS info from a the MIMO SS bitmap within msdu_start info

Change-Id: I794b093783b5f1ffc7faf335da84cbc07375d520
CRs-Fixed: 2215660
2018-05-04 20:43:12 -07:00
Yun Park
538a3a6e3d qcacmn: Remove ipa_reset_hdr from QDF
Remove unused IPA API ipa_reset_hdr form QDF.

Change-Id: I749e891b74b0adb45a5c3b9dbe7ad638d62c4459
CRs-Fixed: 2233616
2018-05-03 12:55:02 -07:00
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
Naveen Rawat
34e15c4636 qcacmn: Add umac implementation of getting peer rssi
Add changes to support get peer rssi from within cp_stats
component.

Change-Id: I68c9c7e23dd14b515a71080b1b5fe3af15651ef9
CRs-Fixed: 2222777
2018-05-02 04:35:07 -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
Rhythm Patwa
f6862a6527 qcacmn: Add HE MU and HE MU Other support
Populate HE-MU and HE-MU-Other fields in the radiotap header.

Change-Id: Iab9b9c47e076007b43b7abeb296ea15f0ec2a2cb
CRs-Fixed: 2191215
2018-04-20 12:09:00 -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
Manjunathappa Prakash
2c3dba28d9 qcacmn: Fix qdf_tso_seg_dbg_bug to use qdf_print format string
Fix build issue with extra compile flags [-Werror,-Wformat-security]

Change-Id: Ia2d516f3ff35d8d3b48a337b24d74ff8f3d83363
CRs-Fixed: 2174715
2018-04-18 19:49:55 -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
Naveen Rawat
d24bebbf24 qcacmn: Add umac implementation of get_wake_lock stats
Add changes to support get wake lock stats from within cp_stats component.

Change-Id: I93855e4a1635afa97b4d5235ddb9cd92654f943d
CRs-Fixed: 2210309
2018-04-17 13:17:54 -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
Soumya Bhat
35fc699c0f qcacmn: Populate RX PPDU length
Add change to compute and populate RX ppdu length
from RX ampdu length.

Change-Id: I0e60764be1d3b0a0e69a8dc52cfb094a5df0f596
2018-04-11 09:15:12 -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