Commit Graph

765 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Dustin Brown
40bd452c5b qcacmn: Abstract qdf_mem_validate_list_node()
Currently qdf_mem contains a function, qdf_mem_validate_list_node(), for
validating a list node and ensuring it is currently part of a list.
Instead, abstract this function from qdf_mem, and move the definition to
qdf_list_node_in_any_list() in qdf_list. This is a more reasonable
location for the list-specific logic, and allows its reuse by other
callers.

Change-Id: I56a5d54e3c81470a111f168533faedf7fa525ff3
CRs-Fixed: 2359358
2018-12-04 16:45:21 -08:00
Dustin Brown
0497d105b0 qcacmn: Panic before unlock on missing unmap
Currently, qdf_nbuf_map_check_for_leaks() logs the leak information
under spinlock before inducing a panic. This can cause a confusing false
positive panic upon releasing the spinlock if the logging took longer
than the spinlock timeout threshold. Since we already know we are going
to panic, panic under spinlock to ensure the panic message is always
appropriate.

Change-Id: Ib98b21e8feac0314b7c1f00f08b9e81112c4f2ba
CRs-Fixed: 2357806
2018-11-29 18:12:36 -08:00
Shashikala Prabhu
f09216fe1b qcacmn: Add qdf API to align the allocated memory
Define qdf_aligned_mem_alloc_consistent() and qdf_aligned_malloc() which
allocates the memory and checks if allocated base address is aligned with
ring_base_align. If not, it frees the memory and re-allocates by adding
7 bytes to alloc_size and returns aligned address to the caller.

Change-Id: I412153c20e4e4566450b006356fe78d98f1fd3f0
Acked-by: Shashikala Prabhu <pshashik@codeaurora.org>
CRs-Fixed: 2336697
2018-11-22 00:43:51 -08:00
Lin Bai
5c0d751414 qcacmn: Typecast variable to same type before comparison
Typecast 'rowsize' to qdf_size_t, to avoid compiler error
'comparison of distinct pointer types lacks a cast'.

Change-Id: I29e05a1f0d165accf3bebefc0af2b9f97cac0f5d
CRs-Fixed: 2350601
2018-11-20 05:28:55 -08:00
Venkata Sharath Chandra Manchala
443b9b4da2 qcacmn: Print HP/TP Stats
Extend txrx_stats to print current HP/TP
Status for UMAC rings.

Change-Id: I50332f7507fdf1841dee51f0b1e97ef4ea68f04f
CRs-Fixed: 2332191
2018-11-13 06:56:15 -08:00
Dustin Brown
75e3c8cc7e qcacmn: Panic on uninitialized lock destroy
Currently, if an uninitialized QDF mutex or spinlock is destroyed, the
issue is logged in dmesg. This has allowed multiple uninitialized
spinlock issues to merge into mainline and remain unnoticed for several
weeks. Instead, if an uninitialized lock is detected during destroy,
panic.

Change-Id: I929cfa3f295cb1e76634653bbd4aec3a6f1268b7
CRs-Fixed: 2347717
2018-11-13 01:11:46 -08:00
Rajeev Kumar
1803278802 qcacmn: Fix excessive console logging from qdf set print level
qdf set print verbose level is using pr_info to log debug logs
and pr_info logs are logged on console hence change pr_info
to pr_debug to avoid logging debug logs on console.

Change-Id: I43ccef244c9576483f1520c0a5027ac88e0cbb07
CRs-Fixed: 2342962
2018-11-06 18:02:55 -08:00
Will Huang
0f5ddf9578 qcacmn: Add bi-direction dma map flag to qdf_nbuf_cb
In case of 11w PMF tx frame, some target would dma write to this tx
buffer, it may cause smmu check fault.

Add a bi-direction map flag to mcl skb.cb[] for this special case.

Change-Id: I72a2c11abb9f3e7e8fb9c6f5290cd4f8d209b19a
CRs-Fixed: 2337204
2018-10-30 00:24:04 -07:00
Sandhya Mahadevan
e650d1d287 qcacmn: Suppress NBUF alloc fail prints
NBUF alloc fail prints are flooding the console,
which is not allowing watchdog resetting to occur

ratelimit is added to reduce the print statements
flooding the console.

Change-Id: Ib6531070c8b80d64ffea62209912e5166e0414c1
2018-10-25 12:33:07 -07:00
Dustin Brown
aaa97751a6 qcacmn: Add excessive logging detection
One of the most common stability issues encountered by the stability
team is watchdog bite due to excessive logging. Add a feature to track
logging to dmesg using a tumbling window and counter, and panic if the
configured maximum number of logs for that window is exceeded.

Change-Id: If83c6dfccb9d191b02a3a7166b065c0a0704f969
CRs-Fixed: 2338385
2018-10-25 12:33:04 -07:00
Manjunathappa Prakash
ed42ca3f2d qcacmn: DPT: special packets NULL nbuf argument
For special packets DP tracing enable_check is called with
NULL nbuf, it returned false, preventing special packets from
logging. So ignore NULL nbuf and return true to enable DPT
logging.

Change-Id: Ieccc9e77195f5c8ff590c6964972705c362c16ba
CRs-Fixed: 2335301
2018-10-25 01:38:03 -07:00
Dustin Brown
edd12697e4 qcacmn: Return success when debugfs is disabled
Currently, the QDF debugfs feature returns a no-support error code for
the init call when the feature is compiled out. Instead, return success
to avoid wlan load failure on some configurations and to make error
checking by the caller more straight forward under all configurations.

The deinit call also has the same problem, but none of the callers pay
attention to the return status. Additionally, the deinit function
returns success unconditionally when the feature is compiled in.
Rather than changing the return status to success when the feature is
compiled out, change the return type of the deinit function to void.

Change-Id: Iac3a47505142e149f70c67c5ba6cf0b2428d9488
CRs-Fixed: 2336872
2018-10-23 12:06:25 -07:00
Dundi Raviteja
ddf4501aba qcacmn: Use qdf_snprintf in mlme_vdev_sm_create() API
Use qdf_snprintf instead of snprintf in mlme_vdev_sm_create() API

Change-Id: Ie6bb710bfb3baeaab33fdfc386ead57284bc9f08
CRs-Fixed: 2324849
2018-10-23 02:46:00 -07:00
Mohit Khanna
f83015ce04 qcacmn: Support for WDI3.0 in the Unified WDI APIs
Add support for WDI3.0 in the Unified WDI APIs.

Change-Id: Ic2bd68791e68b8bac5c948839f0258adb7d3f4b9
CRs-Fixed: 2183519
2018-10-17 17:42:32 -07:00
Dustin Brown
e72b7f7e4c qcacmn: Add nbuf alloc failure to nbuf history
In addition to the other nbuf history events, track allocation failures.
This allows root causing issues due to nbuf exhaustion.

Change-Id: Ia0bbc6f12d26e32fcdb4cf7d0efef328417436ce
CRs-Fixed: 2329461
2018-10-11 05:35:30 -07:00
Gyanranjan Hazarika
2c54581814 qcacmn: Changes for BSS Color Enahancement FR40903
1. QDF_MODULE_ID_BSSCOLOR added for logging
2. BSS Color Offload supported trace added
   as target_if_info

Change-Id: I00db87f6619f7857dd83cf1eb5d805780c501805
CRs-fixed: 2242109
2018-10-05 22:10:06 -07:00
Dustin Brown
121d7d1bff qcacmn: Return QDF_STATUS from qdf_timer_init()
In preparation for QDF timer tracking, return QDF_STATUS from
qdf_timer_init(). This allows callers to handle the eventual possibility
of a QDF timer init failure.

Change-Id: I9da4643610099d32b002bda9218af26247a4edc6
CRs-Fixed: 2327724
2018-10-05 19:58:09 -07:00
Dundi Raviteja
1c6217a666 qcacmn: Add qdf abstraction for kstrtouint
Add QDF abstraction for kstrtouint

Change-Id: I02711b4d0e528e1db546dde18f1b65539ad55cc6
CRs-Fixed: 2327693
2018-10-05 15:46:50 -07:00
Rakshith Suresh Patkar
169fce61ef qcacmn: Add QDF API to update debug node for nbuf
In case of preallocation of nbufs, the debug nodes contain
allocation information with respect to the allocator
and not the user.
For more accurate debug info, add new QDF API
qdf_net_buf_debug_update_node to update the debug info
when the nbuf is requested.

Change-Id: Idfbcd15b6c561bbb57ba98a6b8376557ba909eec
CRs-Fixed: 2322989
2018-10-01 08:04:55 -07:00
Sravan Kumar Kairam
9066ad3aa7 qcacmn: Fix implicit conversion compilation error
Fix compilation error of  implicit conversion from enumeration
type 'enum ipa_wlan_fw_ssr_event' to different enumeration type
'enum ipa_wlan_event' in function __qdf_to_ipa_wlan_event.

Change-Id: I7b5d3e964a5fa070a89aaf21bcb4ea2237a85a58
CRs-Fixed: 2324656
2018-09-28 23:38:52 -07:00
jitiphil
67a658da1c qcacmn: Add QDF abstraction for FW rejuvenate event
During FW rejuvenate, a message needs to be sent to
IPA driver to indicate of the event's occurrence.

Add a QDF abstraction for the FW rejuvenate event to
be sent as a message to IPA driver.

Change-Id: I3ffa220234f9690306c408a24ddd31ac94015124
CRs-Fixed: 2290656
2018-09-27 16:36:55 -07:00