Commit Graph

805 Commits

Author SHA1 Message Date
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
Abhiram Jogadenu
7b2ba92b37 qcacmn: Add support for CFR init deinit
Add support for CFR init deinit and QDF_MODULE_ID

CRs-Fixed: 2372061
Change-Id: I8468c678e03b315ec15ff94aa603e9f2bcda408e
2019-02-20 06:21:15 -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
Dustin Brown
8f1ded29ed qcacmn: Apply timer multiplier to qdf_timer
The qdf_timer_multiplier is currently applied to qdf_mc_timer and
qdf_event. In addition to these cases, also apply qdf_timer_multiplier
to qdf_timer to enable more debugging scenarios.

Change-Id: Ie3bd340dd2e8f1bec7e5bfa7ec3f0d0ceaa32e6d
CRs-Fixed: 2393017
2019-02-05 13:37:58 -08:00
Surya Prakash
27fba324b4 qcacmn: Enhance debug message for wmi
Print endpoint ID, soc ID, target type and transmission
queue depth when queued wmi commands reaches max wmi queue size.

Change-Id: Ia781f3a2c964651d5fdb8cb54ab975021cd11566
CRs-Fixed: 2360714
2019-02-05 04:02:13 -08:00
Ashish Kumar Dhanotiya
3be335ca19 qcacmn: Avoid compilation issue with kernel 4.19
There is a compilation issue if a variable is passed to
kernel api DECLARE_HASHTABLE.
TO resolve this issue, instead of passing a variable
pass a constant to DECLARE_HASHTABLE.

Change-Id: Ie9782af541bb34cc50f79060b0007dc73881e5f4
CRs-Fixed: 2386893
2019-02-02 15:27:57 -08:00
Ashish Kumar Dhanotiya
ad85c38928 qcacmn: Update driver timer APIs according to kernel 4.19
There are some changes to timer APIs in latest kernel,
update driver APIs accordingly to invoke correct kernel
APIs for timer functionalities.

Change-Id: Ie017c8b1ef8237ca34f696c23509519a1187167c
CRs-fixed: 2383574
2019-02-02 15:27:54 -08:00
Sourav Mohapatra
6066636527 qcacmn: Fix kernel 4.15 timer list dependencies
With the changes made in Ibe0f8adc4df7bb98aceb509d438e241fac507393 and
Ic4cef0d6301230197443d4d5247188f2af643674 there are compilation issues
with converged code.

Resolve the issues by creating ifdefs for the timer_list definitions
according to kernel version.

Change-Id: Id9c29413ca0d21533a0afae245595051fa3a400f
CRs-Fixed: 2390884
2019-02-01 20:12:03 -08:00
Dustin Brown
8acb74ae9a qcacmn: Add >=4.15 kernel support to qdf_timer
The various setup_*_timer() APIs were removed from the linux kernel in
4.15, and replaced with similar timer_setup_*() APIs. Add conditional
compilation to qdf_timer to use the correct APIs depending on the
version of the kernel being compiled against.

Change-Id: Ibe0f8adc4df7bb98aceb509d438e241fac507393
CRs-Fixed: 2388570
2019-02-01 20:12:00 -08:00
Dustin Brown
bf8e81ef4c qcacmn: Do not directly alias 'struct timer_list'
There are a number of places where the kernel's timer_list type has been
used in conjunction with qdf_timer APIs. To prevent reintroduction of
similar issues in the future, do not directly alias qdf_timer_t to
timer_list.

See also: I410b7fafad18be01141008b6220fbe34ab07601e

Change-Id: Ic4cef0d6301230197443d4d5247188f2af643674
CRs-Fixed: 2388595
2019-02-01 20:11:57 -08:00
Dustin Brown
340c627dcf qcacmn: Remove os_timer_t
os_timer_t is a legacy wrapper around the kernel's timer_list type, and
is incorrectly used directly with qdf_timer APIs. Remove os_timer_t,
replacing instances with qdf_timer_t instead.

Change-Id: I410b7fafad18be01141008b6220fbe34ab07601e
CRs-Fixed: 2388575
2019-02-01 20:11:54 -08:00
Min Liu
2625b976d4 qcacmn: Clean up CONFIG_MCL for hif_bus_id
Remove CONFIG_MCL flag for hif_bus_id in __qdf_device since
it can be shared by WIN and MCL.

Change-Id: I0f88aae7f3139485b99a029fa4f53d848875b0ac
CRs-Fixed: 2368166
2019-01-30 14:31:37 -08:00
Pavankumar Nandeshwar
3dce817808 qcacmn: enable qdf prints for QDF_TRACE_PRINT_ENABLE flag
Enable printing of QDF prints for QDF_TRACE_PRINT_ENABLE flag
irrespective of the flags WLAN_DEBUG and DEBUG.

Change-Id: I0b53d1759c3d38321d66bec325b855eb1e48e75a
CRs-Fixed: 2355333
2019-01-30 08:26:22 -08:00
Vivek
d34b7d0d62 qcacmn: Change default log level for serialization
Change default log level of serialization to QDF_TRACE_LEVEL_ERROR
Change error print to debug, when pending queue is empty,
which is a possible expected case.

Change-Id: I21cd6b5f158d5dffbc6e7309c9202e7e2e0162e8
CRs-Fixed: 2387017
2019-01-29 09:58:05 -08:00
Shiva Krishna Pittala
13452334e3 qcacmn: Set the default QDF trace level to ERROR for Spectral module
To enable all the Spectral fatal and error logs by default,
set its default trace level to QDF_TRACE_LEVEL_ERROR.

Change-Id: I05d958f2206684f0e413e4e9a5576a96b228ddcd
CRs-Fixed: 2384360
2019-01-24 19:07:04 -08:00
Santosh Anbu
cdf3813a9c qcacmn: Fix debug log string
Add change to print debug log without function name and line number.

Change-Id: I0d07c42e5a3b0f6e5e17d77b94c1dc70d52fa744
CRs-Fixed: 2382526
2019-01-24 09:59:11 -08:00
Santosh Anbu
6e2fed8f5f qcacmn: Add scheduler mq handler for mlme
Add mlme message queue handler as the call back for non scan commands
getting activated in the scheduler context.
Add cmd already exists enum to be returned if the command already exists
in the serialization queue.

Change-Id: I24fe453ffddbd4341459874458f11688adebc740
CRs-Fixed: 2377219
2019-01-22 05:06:24 -08:00
Arunk Khandavalli
f15ef34107 qcacmn: Add the wrapper for dsc function operations
Add the qdf wrapper functions for the new dsc infrastructure.

Change-Id: I126b14b00b2f7ef77493a2abb7d8ec4f1394b15c
CRs-Fixed: 2364042
2019-01-21 19:21:32 -08:00
Dustin Brown
ae81599125 qcacmn: Add nbuf history for clone and copy
The network buffer (nbuf) history records the usual nbuf allocations
and frees, but does not record allocations due to copies or clones.
Record these allocations in the nbuf history as well to aid in
debugging.

Change-Id: If5bed9a41d301d43a1e610df4366d0bcf2c3efc4
CRs-Fixed: 2379866
2019-01-21 17:12:51 -08:00
Dustin Brown
631cde9525 qcacmn: Add qdf_must_check function attribute
Some compilers allow functions to be annotated such that a warning will
be emitted if the return value of that function is not used. Allow the
WLAN driver to leverage these annotations by introducing a wrapper in
QDF, qdf_must_check.

Change-Id: I9c1328ae904857717703aae3748b207967a8dd3d
CRs-Fixed: 2382837
2019-01-19 01:10:25 -08:00
Arif Hussain
61847a9ba6 qcacmn: Use function name instead of file name in debug logs
Replace all instance of file name to function name in debug logs.

Change-Id: Iff731675772859f02c975005b2656eaa41c6f360
CRs-Fixed: 2377894
2019-01-17 22:20:46 -08:00
Jeff Johnson
5b92ee0716 qcacmn: Replace session_id with vdev_id in qdf_trace APIs
To align with the converged nomenclature replace the identifier
session_id with vdev_id in qdf_trace APIs.

Change-Id: Ic97a2df848e2b687edbd29c419193f4285125f81
CRs-Fixed: 2381424
2019-01-17 22:20:38 -08:00
Bala Venkatesh
61f47a6fbd qcacmn: Fix delay in driver logging
In function qdf_trace_msg_cmn va_end is called without va_start.
This can lead to delay in driver logging.

Change-Id: I9d2c9893037f5836cf902e6e311a0a521b8389e0
CRs-Fixed: 2373637
2019-01-04 05:40:29 -08:00
chenguo
33f505ac30 qcacmn: New TLV sequence supporting for UL OFDMA in monitor mode
According to the ucode and mac team, the new TB-PPDU (UL OFDMA
Dat frame) from any other users using the TLV's fields below:

    * PHYRX_RSSI_LEGACY (has a reception type field that is
			 set to UL-MU)
    * PHYRX_RSSI_HT
    * PHYRX_COMMON_USER_INFO (has a reception type field that is
			 set to UL-MU)
    * PHYRX_USER_INFO (has more detailed modulation info)
    * PHYRX_USER_INFO (Could be more than one)
      ...
    * PHYRX_DATA
    * PHYRX_DATA (Could be more than one)

CRs-Fixed: 2329959
Change-Id: Ib5fa1734a5525d2b2d1db8756166f259be30b9c0
2019-01-03 22:29:40 -08:00
Keyur Parekh
f72cbe544a qcacmn: populate NSS value and Translate MCS value for HT
This change will resolve displaying NSS value
in stats in case of HT. And also it will give
proper NSS value to calculate rate value. Modify MCS
value to match with Tx stats from firmware.

Also retain original MCS value to use in radiotap code
for HT case.

Change-Id: I4dad068262a5e9188a5935db6b2cbf8d14138e7e
2018-12-27 17:48:03 -08:00
Sravan Kumar Kairam
8d6f762744 qcacmn: Add QDF macro for is over gsi ipa wdi out param
Add QDF abstraction macro to read ipa wdi out structure param
is over gsi member.

Change-Id: I48c848b432168cba46ded985023291077488b2be
CRs-Fixed: 2367310
2018-12-24 12:15:53 -08:00
Chaithanya Garrepalli
4ff6e41de9 qcacmn: add peer_id and msdu_len in qdf_nbuf_cb
Add peer_id and msdu_len in qdf_nbuf_cb these
fields are used for lithium rx performance
optimization

Change-Id: Iba291812397a5e7648953c2dc1b2c18a5c5a18af
2018-12-23 21:58:51 -08:00
Nachiket Kukade
c64e33df96 qcacmn: Add modules to handle and extract NAN events
As part of supporting NAN DBS, new WMI TLVs are defined so
that Host can maintain the status of NAN Discovery in sync
with the Firmware. Move the older handlers into the NAN
related files. Also add modules to extract information from
the new TLV's and fill up the event parameters to pass
them to the NAN component. add support for explicitly
disabling NAN due to concurrencies.

Add modules to handle and extract the info from NAN events.

Change-Id: Ic03baaaef45106353c211a813e11e33a90cd41ca
CRs-Fixed: 2338059
2018-12-18 14:29:29 -08:00
Dustin Brown
243d00af0b qcacmn: Adjust min zero compression to 1
The IPv6 address format allows compression of _one_ or more zero hextets
using "::". However, the current implementation accepts _zero_ or more
zero hextets as valid. Adjust the minimum required hextets for a zero
compression to 1 from 0.

Change-Id: Ibdf406b04bbdc44d4a28fafa6179c104285c915c
CRs-Fixed: 2362739
2018-12-14 14:26:22 -08:00
Jinwei Chen
73e0dd5719 qcacmn: do dma unmap for failed tso segments
Currently there is only tso segment and tso number segment
descriptor free operation when tso preparation failed, do dma
unmap for each segment as well.

Change-Id: I9a507f27341877dc062528ce77e02970d16aa098
CRs-Fixed: 2347279
2018-12-14 12:48:43 -08:00
Rakshith Suresh Patkar
e105ac141d qcacmn: Add support to dump last n dpt stat records
Add support to dump only last n dpt records of debug fs
dump_set_dpt_logs file.

Change-Id: Ic6418803d53cc2abbfc200f62df2a24c3bc55d54
CRs-Fixed: 2362523
2018-12-14 07:15:20 -08:00
Dustin Brown
7c32e412b8 qcacmn: Add qdf_talloc APIs
Add APIs for t(ree) alloc(ated) memory management.

These APIs allocate memory like malloc, but track those allocations via
a parent-child relationship, or tree. If the parent is freed while it
still has children, a panic will be triggered. This effectively gives
you the ability to limit the lifetime of an allocation by ensuring the
child allocation lifetime will be strictly less than the parent
allocation lifetime.

Change-Id: I6308c96061e125b2e5a9c424ec2d2298c1c503ab
CRs-Fixed: 2359469
2018-12-13 16:46:04 -08:00
Dustin Brown
ce57c688b9 qcacmn: Add qdf hashtable APIs
Add a thin wrapper in QDF around the kernel hashtable implementation.
Additionally, add basic unit tests for these APIs.

Change-Id: I07999e5fc8116e67b3850b866ced20af64342055
CRs-Fixed: 2359335
2018-12-13 16:46:01 -08:00
Dustin Brown
1b76d59f78 qcacmn: Add int parse unit tests to QDF
Add unit tests for the following parsing function in QDF:
 * qdf_int32_parse()
 * qdf_int64_parse()
 * qdf_uint32_parse()
 * qdf_uint64_parse()

Change-Id: I43d162d008910396df051dd18e7a1ab7fede657a
CRs-Fixed: 2362740
2018-12-11 17:26:09 -08:00
Shiva Krishna Pittala
be6dcc0bed qcacmn: Fix unknown symbol qdf_aligned_malloc_fl
When MEMORY_DEBUG is enabled on WIN, it is reporting qdf_aligned_malloc_fl
as an unknown symbol. qdf_aligned_malloc_fl is defined under
MEMORY_DEBUG flag but its prototype is exposed globally.
Make this function definition available globally to fix the issue.

Change-Id: Ieb002bb892d6f3d525409fc9c3a6b2fa71ceebd8
CRs-Fixed: 2357476
2018-12-11 15:40:39 -08:00
Dustin Brown
fbe43ca5c4 qcacmn: Add unit test cases for qdf parse APIs
Add unit test cases for bool, mac, ipv4, and ipv6 parsing APIs.

Change-Id: I7536a973141a6311662390e42da749f48239bef8
CRs-Fixed: 2359298
2018-12-11 15:40:36 -08:00
Jiachao Wu
ae6c777bd1 qcacmn: Fix a memory leak in qdf_mem_shared_mem_alloc
qdf_mem_shared_mem_alloc invokes qdf_mem_dma_get_sgtable which will alloc
memory.
This memory should be free in qdf_mem_shared_mem_free by sg_free_table.

Change-Id: I3ad4bd2ff7a80d4051f15dcb04e0265707c2712d
CRs-Fixed: 2131270
2018-12-10 03:59:46 -08:00
Shashikala Prabhu
bfd50437fd qcacmn: Use UNBOUND flag to create WMI RX workqueue
WMI RX workqueue is created with WQ_MEM_RECLAIM flag. When host receives
the WMI service ready event it queues the work. There is 50sec delay in
scheduling workqueue to process WMI service ready event. This results in
host timeout (timeout = 15sec) and wifi load failure. This cleans up the
host data structures related to data path. But work got scheduled after
50sec resulting in init path handling with inconsistent data structures.

Use workqueue UNBOUND flag to create WMI RX workqueue. Works queued to
unbound workqueues are implicitly HIGHPRI and dispatched to unbound
workers as soon as resources are available.

Change-Id: I46eb0242ad88103268df99be9fd2e0759ebec4b2
CRs-Fixed: 2343181
2018-12-06 13:44:13 -08:00
Nirav Shah
0be39b748c qcacmn: Make ipa_owned bit common for TX and RX control block
Make ipa_owned bit common for TX and RX control block union
for MCL as it is used in qdf_nbuf_free API, which is used in
both TX and RX path to free skbs.

Change-Id: I3a4279d528a1b8a72a1ec307f1672efae84d2745
CRs-Fixed: 2353137
2018-12-05 06:58:57 -08:00