Commit Graph

472 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
gaurank kathpalia
674d06dd08 qcacmn: Add TDLS device mode in QDF_OPMODE
Add TDLS device mode to get the nss chains shift params
and store the ini and dynamic nss config in vdev.

Change-Id: Ia2f3dba1860eda23018e6b930866931886834879
CRs-Fixed: 2349203
2018-11-16 05:10:20 -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
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
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
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
90556671c5 qcacmn: Add qdf_opmode_str()
It is often useful to print the human readable version of an operating
mode in a log message or some other user-facing string. Add a function
for mapping QDF_OPMODE to human readable strings, qdf_opmode_str(), in
QDF such that various consumers do not have to implement it themselves.

Change-Id: I8756fb2ea97b3b8c7af2633b07694ad1e74d6d3e
CRs-Fixed: 2331888
2018-10-17 17:42:29 -07:00
jiad
b9264e89c6 qcacmn: Fix cpuhp compile errors on UP system
Compiler throws no previous prototype build error for cpuhp
on UP system.

Fix is to add static inline for UP build.

Change-Id: Ib867a19ac526b44766a8cbb1838e7e5b2b18b4b1
CRs-Fixed: 2328927
2018-10-11 12:22:16 -07:00
Balamurugan Mahalingam
af1db01d92 qcacmn: Add QDF_GLOBAL_WALTEST_MODE enum
wifi driver uses this enum to configure the force the target into
waltest mode

Change-Id: I8de3d12b5e81744cd16bbb72900bd73877d16ced
CRs-Fixed: 2229936
2018-10-10 09:18:06 -07:00
Liangwei Dong
89fdd82b93 qcacmn: Skip chanlist event during recovering
Add new qdf API: qdf_is_recovering and
qdf_register_recovering_state_query_callback.
Client driver will register the state query callback
to common driver to report the recovering state.

Regulatory skip the chanlist update event during SSR
to keep the current regulatory setting.

Change-Id: I58e503cce162a0351d566148c1897a5012889c62
CRs-Fixed: 2321820
2018-10-09 10:54:33 -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
Anish Nataraj
eb30aa7f83 qcacmn: Correct the Frame control info valid in hal API
Instead of frame control info valid parameter data sequence
control parameter was passed, corrected it

Change-Id: Iccaeb286c1003cbb58c5ebcacf4b0d99c979cbbc
2018-10-01 04:19:59 -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
Amir Patel
20a0efabb1 qcacmn: Add qdf_platform source file to qdf/Kbuild
Add qdf_platform source file to qdf/Kbuild and
clean-up WAR introduced in change
I8172f3dbe0716be24a4dda739afb49f94528a4f6

Change-Id: Icb76d53544590b8bcace275ef52870606fb5d826
2018-09-24 18:55:20 -07:00
Adil Saeed Musthafa
12205b544b qcacmn: Add timer to flush out log buffers periodically
Add timer to flush out log buffers periodically. Add command to set the
time period value.

Change-Id: I8e796a9bc7caac2661d00852420dd5fa66f5bca5
CRs-Fixed: 2296362
2018-09-21 20:50:55 -07:00
Manikandan Mohan
33cfb578b0 qcacmn: Fix NULL pointer dereference in qdf_nbuf_free
Move network buffer null check to beginning of function to
cover possible case of null pointer dereference during free.

Change-Id: I8c998d4d1711ab28c94a946d04314c26a4c74278
CRs-fixed: 2309452
2018-09-17 17:53:52 -07:00
Srinivas Pitla
be8dac4d5d qcacmn: Define VDEV MLME component object
This change defines VDEV MLME object, and registers with object manager to
be notified on creation/destroy, and also initializes MLME SM

Change-Id: I75bb7de7326e4bbed21ef9653427c4e0694c3ffc
CRs-Fixed: 2307722
2018-09-14 08:16:48 -07:00
Srinivas Pitla
bc7748c852 qcacmn: Implement State machine framework
This is generic state machine framework, which provides APIs for state
definition, state transition, event posting

Change-Id: Ie7d5a064967098fcb77a663047c479d1d1576595
CRs-Fixed: 2307722
2018-09-14 08:16:44 -07:00
Rakshith Suresh Patkar
ecd7d60c6a qcacmn: Add QDF APIs for dev_scratch in network buffer
Kernel 4.14 and later supports dev_scratch for network
buffer which can be used to store data in a nbuf in the
format unsigned long.

Add APIs:
 1) qdf_nbuf_is_dev_scratch_supported
 2) qdf_nbuf_get_dev_scratch
 3) qdf_nbuf_set_dev_scratch

Change-Id: I2a72d369bb53f8f86d4bcee3cf6d13f5e4aff57f
CRs-Fixed: 2313270
2018-09-12 08:50:17 -07:00
Rajeev Kumar
f60c3457b4 qcacmn: Use QDF_TRACE to log under spin lock debug feature
Use QDF_TRACE log macro to log spin lock abuse when spin lock
debug feature is defined.

Change-Id: I1e5db79f5e6f5fc343f1be000efff6907c4857e1
CRs-Fixed: 2312614
2018-09-11 18:27:27 -07:00
Sourav Mohapatra
474c614ddf qcacmn: Add FW Offload component UMAC ID
Add the UMAC enum ID for the new FW Offload enum.

Change-Id: Ia495ebd7d3a195839cae11a633b3bdc9ba7055ae
CRs-Fixed: 2307838
2018-09-11 12:03:15 -07:00
Ruchi, Agrawal
1ee51132c5 qcacmn: Change to avoid compilation issue HK2.0
EWMA macros which were used for sojourn stats
time delay calculation, causing compilation issue
for x86 platform as x86 platform is on kernel
version less than 4.3 and EWMA macros were
introduced after that version.

Change-Id: I184844c7df8e5b317a095355c2f6a9af9e4747ff
CRs-Fixed: 2308338
2018-09-10 00:49:24 -07:00
Ashish Kumar Dhanotiya
308f575884 qcacmn: Add wmi wrapper function for mtrace logging
For qdf_mtrace 15 bits are reserved for message id and currently
WMI message IDs are getting used as 32 bit IDs.

Write a wrapper function which accepts 32 bit message IDs and
converts this 32 bit message id to 15 bit by extracting
WMI_GRP_ID and WMI_MESSAGE_ID in that group. New 15 bit
message ID for qdf_mtrace will be constucted as 8 bits
(From LSB) specifies the WMI_GRP_ID and remaining 7 bits
specifies the actual WMI command. With this notation there
can be maximum 256 groups and each group can have max 128
commands which can be supported.

Change-Id: Ia5adfc079b63c2311bdc8ae4c73488d89afd462f
CRs-Fixed: 2298877
2018-09-09 09:36:44 -07:00
Ashish Kumar Dhanotiya
89921da033 qcacmn: Define qdf_mtrace api within TRACE_RECORD macro
Currently qdf_mtrace is defined outside TRACE_RECORD macro which
is using qdf_trace api and this is defined inside TRACE_RECORD
macro for MCL. since qdf_trace is having different definitions
for MCL and WIN as for MCL it is defined as a function and for
WIN it is defined as a MACRO.

To resolve this put qdf_mtrace inside TRACE_RECORD macro

Change-Id: I5de2cdff3942ca10b6d5d562f28d359f7f655ed4
CRs-Fixed: 2310167
2018-09-09 01:27:05 -07:00
sumedh baikady
59a2d33a2d qcacmn: Use monitor direct for smart monitor
Set monitor direct filter when smart monitor is
enabled. Deliver header from NAC if md bit is set
and smart mesh feature is used.

Change-Id: If1ef865e013c21bbb58bcb89a87856b12d6c7278
Crs-fixed: 2246660
2018-09-08 12:29:31 -07:00
Shiva Krishna Pittala
5f2280aa4f qcacmn: Separate out nbuf map/unmap code
Put the nbuf map/unmap code under NBUF_MAP_UNMAP_DEBUG.
nbuf map/unmap debug will be enabled on WIN once
the nbuf map/unmap related false positives are fixed.

Change-Id: I6b62539d39664db3ff62411fe8632633f53488c8
CRs-Fixed: 2284128
2018-09-06 10:20:17 -07:00
Karthik Kantamneni
4113fb7d13 qcacmn: Add qdf api which converts string to array
Added api which parses given input string to 8-bit unsigned array.

Change-Id: I2d6800f550b37970b9a0d48508a49e6354a94f9a
CRs-Fixed: 2306890
2018-09-06 03:18:36 -07:00
Arif Hussain
6e9fa6a725 qcacmn: Add logs in qdf_nbuf_alloc()
In qdf_nbuf_alloc() function, pass function name and
line number of caller and log the same in case of failure,
this approach helps to remove error logs in caller function
there by reducing text segment.

Also add qdf_rl and qdf_rl_nofl_* macros.

Change-Id: Ib8ce83335807cfbd2d83d1f165d6bec1dc1e4c94
CRs-Fixed: 2281983
2018-09-06 01:42:11 -07:00