Commit Graph

52 Commits

Author SHA1 Message Date
Alok Singh
8ae5bcc124 qcacmn: Change return type to QDF_STATUS
wmi_unified_register_event return QDF_STATUS
Handle same return type in caller function

CRs-Fixed: 2764185
Change-Id: If77efc6a5b451bf2cf4acb59d5a2126ce486f02f
2020-09-15 18:24:52 -07:00
Rakshith Suresh Patkar
2bd4ec3c09 qcacmn: Add debug log to trap unsuccessful dbr vaddr lookup
In direct buf rx, if physical address is not intact or
is corrupt, the dbr lookup for vaddr will fail and result
in vaddr being NULL. There is no validation for this vaddr
in the caller and hence results in NULL access in the
callstack.

Add debug log and return error status when dbr
vaddr lookup fails, which indicates that there is
corruption in paddr received and avoid NULL access.

Change-Id: I76ee300ce3e686765dd5c4ee73fa71d1735c163a
CRs-Fixed: 2748529
2020-08-05 17:35:15 -07:00
Surabhi Vishnoi
bb9b9ec907 qcacmn: Compilation fixes when WLAN_CFR_ENABLE config is enabled
For adrastea targets, enhanced CFR is not supported. When only
CONFIG_WLAN_CFR_ENABLE is set, some compilation errors are
observed as CONFIG_WLAN_ENH_CFR_ENABLE is not set true.

Fix these compilation errors when only CONFIG_WLAN_CFR_ENABLE
is set for targets which do not support enhanced CFR.

Change-Id: I96a769d8f10144033e48e123bb68d48a54cdf8ab
CRs-Fixed: 2706904
2020-07-17 17:23:23 -07:00
Neha Bisht
4bda764146 qcacmn: remove dependency of public files from wlan_objmgr_psoc_obj.h
Remove dependency of wlan_lmac_if_def headerfiles from
wlan_objmgr_psoc_obj.h

Change-Id: Ibe2f22c4b4f22b15eef201d1a42844ccf2931fef
2020-05-15 10:41:50 -07:00
Arun Kumar Khandavalli
7c3ce2d05f qcacmn: Selectively reduce the dbr logs
Reduce loglevel of some logs from info to debug.

Change-Id: Id4cc241b48defeb5abb122a8c50ef4e81fff9760
CRs-Fixed: 2607982
2020-01-27 02:39:05 -08:00
Surya Prakash Raajen
ed8ea05a7e qcacmn: Clear console log boot up error prints
Clear console log boot up error prints by removing unnecessary
prints, modifying prints to appropriate info or debug and
by fixing the errors

Change-Id: Ica3f126280399eef59b894236849e2079a62565f
CRs-Fixed: 2597026
2020-01-21 00:29:08 -08:00
Manoj Ekbote
b91d7bee26 qcacmn: Store DBR pdev objects in psoc
In dynamic HW mode switch feature, DBR pdev object of primary device
needs to be re-assigned after HW mode change. Store the DBR objects
in psoc for all devs and then use the mapped pdev to retrieve the
corresponding DBR object.

Change-Id: Ie56bdf9d430a5a3ca7e4e9a872018257d032c908
CRs-Fixed: 2589447
2020-01-02 13:09:39 -08:00
Shwetha G K
29121213c8 qcacmn: Add debugfs support for DBR ring debug
For each DBR ring, add debugfs entry to dump at real-time the ring
parameters like head, tail index, the timestamps at which a buffer is
received and replenished. Issues that are specific to tail index
movement from the target can be identified with this debugfs entry.

CRs-Fixed: 2466514
Change-Id: Iafbc61726264464212cb783a1cce46e16b8a48ff
2019-12-02 00:42:54 -08:00
Shwetha G K
215bac70f5 qcacmn: Add poisoning support for DBR buffers
Improper/incomplete DMA by the target affects the functionality of modules
that are using DBR framework. Add debug infrastructure to poison DBR
buffers with a given poison value before handing buffers over to
the target. Buffer owner modules can explicitly check for the poison
value in order to detect the improper DMA.
All modules that use DBR framework can use this debug infrastructure.

Change-Id: Ib3923c13202990e0f1198645b680c44a20736167
CRs-Fixed: 2466518
2019-12-02 00:42:41 -08:00
Shwetha G K
df696de7cc qcacmn: Add support to track DBR ring index movement
Add debug infrastructure to track the movement of head and tail pointers
of the DBR ring along with the time at which each buffer is received and
replenished. All modules that use DBR framework can use this
infrastructure. Issues that are specific to tail index movement from
the target can be identified with this debug infrastructure.

CRs-Fixed: 2439460
Change-Id: I6b486a73cf6a3174dfa297f8fb370fd298b46b67
2019-12-02 00:42:31 -08:00
Guisen Yang
2b07141773 qcacmn: Fix the build failure of illegal usage of log
In function target_if_direct_buf_rx_register_events(), the
API direct_buf_rx_info() is used to record log, but the
format is wrong. Fix the log format.

Change-Id: I81bc128e110570d96ca95dfbe773121272eb2588
CRs-Fixed: 2547235
2019-10-28 04:16:27 -07:00
Wu Gao
5988e8b7d2 qcacmn: Remove unnecessary logs in loop
There is unnecessary logs in loop which affect useful log capturing.

Change-Id: I37b2c8123a280e4ec080ac1fb75e43135936fd79
CRs-Fixed: 2552104
2019-10-27 19:27:56 -07:00
Nisha Menon
5acef23430 qcacmn: Assert due to excessive logs
Exceeded 500 logs per second in target_if_get_dbr_data().
Move the info level logs to debug level in direct buf rx as
heavy logging is triggering an assert.

Change-Id: I725bd50f83dc65f4e5378c4a882829a0ad1b7893
CRs-Fixed: 2534298
2019-10-03 00:21:04 -07:00
Wu Gao
b63edc6a49 qcacmn: Fix compilation issue about dbr_get_pdev_and_srng_id
There is compilation issue about dbr_get_pdev_and_srng_id on hasting
platform, fix it in this change.

Change-Id: Icd5612c31341e6a5f71c65f1ec10533c164798c3
CRs-Fixed: 2530729
2019-09-23 06:03:56 -07:00
Wu Gao
fe2a6185ad qcacmn: Support multiple srng per module in DBR
It required to support multiple srng per module in direct buffer rx
component.So extend the array "dbr_mod_param" in dbr pdev object and
let it to support two more srngs per module.

Change-Id: Ia2c649dacc3787cdc13b06f0b22c1c175fb451cc
CRs-Fixed: 2523365
2019-09-17 16:30:21 -07:00
Debasis Das
285561b9ab qcacmn: Support dma_ring_caps info processing
EXT2 event carries the dma_ring_caps info.Necessary
support to process the same is being provided.

Change-Id: Id8ef1840470b272db00fa5e8f98d1fe9dc273a7e
2019-09-17 12:12:43 -07:00
Edayilliam Jayadev
78285d3861 qcacmn: Get WMI handle from pdev instead of psoc
Get WMI handle from pdev instead of psoc.

CRs-Fixed: 2510822
Change-Id: If6f191403b7f3245b3f26969d195ab4ec8793fc4
2019-08-29 22:11:04 -07:00
Shashikala Prabhu
ec527358c2 qcacmn: Fix issues in qdf aligned memory alloc function
1. Alloc size should be passed as input and output parameter since we need
   to pass the exact alloc_size while freeing the memory.

2. use qdf_align() to calculate the aligned physical address.

3. In DBR component, pass correct arguments to qdf_aligned_malloc() to fix
   the compilation errors.
   Alloc size should be passed as input and output parameter since we need
   to pass the exact alloc_size while freeing the DMA memory.

Change-Id: I83051b8aa54bbf3bb663902d8f17f2c3c55e57bf
CRs-Fixed: 2462441
2019-08-26 00:26:56 -07:00
Wu Gao
46aa5afbb3 qcacmn: Fix compilation errors for DBR enable
Fix compilation errors for direct buffer rx component enable.

Change-Id: If0913b8357267fa65e61e0c7d197025ff850930b
CRs-Fixed: 2497783
2019-08-09 13:04:45 -07:00
Wu Gao
c86454bc00 qcacmn: Reduce the log level in direct buffer rx
Frequent log in direct buffer rx component will cause platform assert,
so lower the log level. Get wmi handler by psoc since since pdev
creation is in progress and it doesn't have related information yet.

Change-Id: Iaaf5a43642f9b6dfaf07ddd3f158abd346903a87
CRs-Fixed: 2495249
2019-08-08 11:38:03 -07:00
Himanshu Batra
0a35a6afb8 qcacmn: Replace void * wmi_hdl with abstract type (6/10)
Replace void * wmi handle with abstract type handles
provided by wmi component

Change-Id: I503438fbaf3bc2d475798bc908a70902d11881af
CRs-Fixed: 2482568
2019-07-18 14:23:04 -07:00
Akshay Kosigi
dc8e095f30 qcacmn: Fix for removal of common_wmi_handle
Add changes to remove usage of common_wmi_handle
Instead use wmi_unified_t as opaque pointer

Change-Id: I85ae8581ce8e4f7fd02fb753e3f482f8a6edebac
2019-06-20 12:00:00 -07:00
Pragaspathi Thilagaraj
a7c83f7401 qcacmn: Fix possible OOB in target_if_direct_buf_rx_rsp_event_handler
The function target_if_direct_buf_rx_rsp_event_handler() handles
the WMI_PDEV_DMA_RING_BUF_RELEASE_EVENTID event from target.
This function calls extract_dbr_buf_release_fixed_tlv() to copy
the module id, pdev id number of buffer release entry and number
of meta data release entries. The value of module id is used to
index the array dbr_mod_param to get the value of mod_param.
So if the module id value greater than dbr_pdev_obj->num_modules
could result in possible OOB.

Validate mod_id received in the fixed param of the event
WMI_PDEV_DMA_RING_BUF_RELEASE_EVENTID against
dbr_pdev_obj->num_modules.

Change-Id: I1c2c0a2a9c98d8b787496aba7a7c4f8fd781de16
CRs-Fixed: 2428798
2019-05-16 12:43:19 -07:00
Abhiram Jogadenu
d2077da875 qcacmn: Add direct rx buffer changes for CFR requirements
CFR requires to configure the number of DBRs that can be packed
in a single DBR event. Currently, this is fixed value.
Make this configurable at the time of registration.

CRs-Fixed: 2415489
Change-Id: Ifcd606641f986a5345f8ccb361c3f45db07fdc37
2019-04-02 15:16:01 -07:00
Jeff Johnson
eee26f7b76 qcacmn: target_if: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within target_if replace any such comparisons with
logical operations performed on the pointer itself.

Change-Id: I436bb3ec12d331df2260507b6a9afbab84a8a54f
CRs-Fixed: 2418256
2019-03-29 00:48:05 -07:00
Abhiram Jogadenu
c528145962 qcacmn: Add support for peer tx event param extraction
Add host's copy of peer cfr tx completion event param and prototype for
extract API.

CRs-Fixed: 2406064
Change-Id: I433171fc90d3c5dbb92dd525e8b5b2c441cc1bf9
2019-03-04 15:48:08 -08:00
Kiran Venkatappa
22b6ccb1ae qcacmn: Add direct rx buffer changes for CFR requirements
CFR needs to correlate data received from direct dma ring and WMI event
for tx completion. These two events can come in any order. To facilitate
correlation CFR module has to hold on to the buffer until both events
are received and then replenish buffer back to direct dma ring. To
facilitate this requirement direct rx buf module is modified to change
callback return to bool to indicate whether buffer can be replenished
immediatley or not. Also add API to indiciate buffer release/replenish
later.

Change-Id: I848c0e7cf0118156fff7cf37ac9027cdf8e2e416
CRs-Fixed: 2403395
2019-03-04 04:00:43 -08:00
Abhiram Jogadenu
db3bb4b4a7 qcacmn: Add extract API for ring params from DBR
Extract ring parameters using dbr_rx_ops for functions in umac.

CRs-Fixed: 2404710
Change-Id: I6fa02668b4fead35ace9e1b4886954ca4cca09c6
2019-02-27 03:13:49 -08:00
Abhiram Jogadenu
880ba01add qcacmn: Add target_if support for CFR
Add target_if support for CFR.

CRs-Fixed: 2372061
Change-Id: I8ad14d714306acc20c9a7e09c8d6f17f7caeae16
2019-02-20 06:21:18 -08:00
Madhvapathi Sriram
0c5bdd7e73 qcacmn: Remove error log for qdf_mem_malloc in target_if files
qdf layer already has the error trace

Change-Id: I2d752fafb6ee805206047bae9711aa0387f22f69
CRs-Fixed: 2376430
2019-02-11 02:30:02 -08:00
Edayilliam Jayadev
2bee1aa8ad qcacmn: Add unregister API for direct buf ring
Add Unregister API to de-register and free resources in direct buf
module. Existing logic of freeing all resources as part of pdev destroy
does not take care of soc_start and soc_stop scenarios. Add this API to
enable modules to de-register as part of soc_stop and register during
start.

CRs-Fixed: 2385313
Change-Id: Ibe6f6bc5f4bd2acc5a9fe71eee09c151853073bc
2019-02-01 10:33:51 -08:00
Edayilliam Jayadev
33b7c9a31d qcacmn: Fix KW isssues in Direct DMA
Fix KW issues in Direct DMA module.

CRs-Fixed: 2366231
Change-Id: I091d6b451c142928743ff29a1e463321bad7bf4c
2018-12-16 21:36:46 -08:00
Shashikala Prabhu
dae5623949 qcacmn: Use qdf API to allocate aligned memory for direct buffers
In target_if_dbr_fill_ring(), min_buf_align (8 bytes) was added to
min_buf_size before allocating the memory for dbr_buf_pool. This leads to
extra 1MB allocation.

To avoid this extra allocation, call qdf_aligned_malloc() to allocate
aligned memory for direct rx buffers.

Change-Id: I72f7c616c7a699437b081de7149a4a67a3ad30c4
Acked-by: Shashikala Prabhu <pshashik@codeaurora.org>
CRs-Fixed : 2336697
2018-11-22 00:43: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
Shiva Krishna Pittala
3e4f08be93 qcacmn: Increase the DBR_NUM_RESP_PER_EVENT to 2
Increase the number of repsonses per dbr event to 2 to
support Spectral scan in 160MHz mode

Change-Id: I47ee933b06d94a9a02f7d448b631dfdb99e297c4
CRs-Fixed: 2297498
2018-10-31 11:50:48 -07:00
Sathish Kumar
a8dcd50683 qcacmn: Featurize WMI APIs and TLVs that are specific to WIN
In the existing converged component, WMI TLV APIs are implemented in
a generic manner without proper featurization. All the APIs exposed
outside of WMI are implemented in wmi_unified_api.c and all the APIs
forming the CMD or extracting the EVT is implemented in wmi_unified_tlv.c.

Since WIN and MCL have a unified WMI layer in the converged component and
there are features within WIN and MCL that are not common, there exists a
good number of WMI APIs which are specific to WIN but compiled by MCL and
vice-versa. Due to this inadvertent problem, there is a chunk of code and
memory used up by WIN and MCL for features that are not used in their
products.

Featurize WMI APIs and TLVs that are specific to WIN
- Air Time Fareness (ATF)
- Direct Buffer Rx (DBR)
- Smart Antenna (SMART_ANT)
- Generic WIN specific WMI (AP)

Change-Id: I7b27c8993da04c9e9651a9682de370daaa40d187
CRs-Fixed: 2320273
2018-10-05 02:14:04 -07:00
Nirav Shah
1b9674e21e qcacmn: umac: Add logging macros without function/line info
Add per module logging macros without function/line info
to avoid adding function/line info where it is not required.

Change-Id: I34ba6f6485f9b506264daf4e116052d2858bed40
CRs-Fixed: 2278876
2018-08-14 21:44:21 -07:00
Nirav Shah
87668f872b qcacmn: Add compilation flag for enter/exit macros
Map all enter/exit log macros to enter/exit QDF TRACE macro
to provide option to compile out enter/exit logs if required

Change-Id: I913ef0fb2486fde6b2ec4dfe8465884ca4d66ce4
CRs-Fixed: 2274857
2018-07-25 09:40:54 -07:00
Shiva Krishna Pittala
0baf52bdf7 qcacmn: Fix buffer alignment check in target_if_dbr_replenish_ring
target_if_dbr_replenish_ring should check the mapped physical address for
agreed byte boundary alignment. Fix the logic in the check.

Change-Id: I05058ae69df8a2ee2caf9ce1295c0a2e9026511c
CRs-Fixed: 2283230
2018-07-25 04:34:46 -07:00
Nirav Shah
a175314c51 qcacmn: Map all module logs to per-level log APIs
Map all module level log APIs to per-level log APIs
to compile out specific log level if required.

Change-Id: I4072b6740cb43200fd95c40943b66e1d5f8f1847
CRs-Fixed: 2266719
2018-07-13 10:36:22 -07:00
Sathish Kumar
5cf9805bc3 qcacmn: Changes in direct buffer Rx module
1. Add support upto 2048 buffers in the ring
2. Add API to print current ring status per module per pdev
3. Start module ID numbering from 0

Change-Id: I7954007c6c486877ffb2ab91724885af2fbaab8c
CRs-Fixed: 2263968
2018-06-25 03:17:55 -07:00
phadiman
65eb1b106f qcacmn: Add sanity checks
Add sanity checks for peer and
dbr_pdev_obj->dbr_mod_param structure

Change-Id: I9412be7b96df2ea62d5f0ec7d709fb45eb3849ce
2018-06-14 23:54:14 -07:00
Akshay Kosigi
dbbf2c45da qcacmn: Replace ucfg prefix with lmac
Replace functions with ucfg as prefix in init_deinit_ucfg file with lmac as
prefix

Change-Id: I90d77dd5ddae4854ea68eeb67dc1b4fc356c2fe3
CRs-Fixed: 2182449
2018-05-11 22:40:16 -07:00
Akshay Kosigi
2a216edab0 qcacmn: Replace void pointers with appropriate/common structure types
Void pointer usage may lead to memory corruption due to
wrong pointer is typecasted. Hence define structure for all, and modules
internally typecasting based on their type

Change-Id: I6271ed8aa3f94254fd85f41962f23ea36895154e
CRs-Fixed: 2182452
2018-05-11 22:40:13 -07:00
Sathish Kumar
77f3c438f0 qcacmn: Fix memory leaks in direct buffer receive(DBR) module
Module param capabilities stored per module per pdev and overall
target dbr ring capabilities allocated and stored during service ready
are not freed during detach.

Fix above mentioned memory leaks through below changes
1. Free module param capabilities allocated per pdev during ring deinit
2. Free DBR ring capabilities allocated during service ready event
   as part of target psoc info free.
3. Free DBR entries allocated per event received from target

Change-Id: I93d5126063d3fa0094e15d57a75f03cf63b3c494
CRs-Fixed: 2228428
2018-04-27 05:26:39 -07:00
Edayilliam Jayadev
3d32949b42 qcacmn: Extract meta data from dbr event
Extract meta data from the dbr wmi event.

CRs-Fixed: 2219818
Change-Id: Ib19588775060e75017e9777206132a0efeec6223
2018-04-25 23:49:01 -07:00
Edayilliam Jayadev
269c3deaac qcacmn: Fix for direct dma + ftm mode
This change fixes the null pointer dereference issues
observed when running spectral scan using direct dma
framework with ftm mode.

CRs-Fixed: 2214269
Change-Id: I06514b38b519da7eb972ff713feab97e7d5a9c29
2018-03-30 02:46:49 -07:00
phadiman
a2f544f294 qcacmn: Fix incorrect return type & variable access
Initialize the unintialized variables, fix return
types and fix typo errors (access map_status instead
of status)

CRs Fixed: 2200034

Change-Id: I02c5f989f1c41da07eabd165c3f45a44007b928d
2018-03-12 05:15:23 -07:00
Sathish Kumar
6b55904827 qcacmn: Fix issues in direct buffer rx module
1. Populate number of capabilities after extracting service ready ext param
2. Deinit ring during pdev destroy only if ring is configured
3. Do not allocate module param if no capability is shared for
   the pdev by target

Change-Id: Ie92b7fc882ba8b7755fea150c724459264a0ea79
CRs-Fixed: 2192671
2018-03-04 16:50:54 -08:00
Srinivas Pitla
d8781f1693 qcacmn: Define psoc/pdev target_if structures
Define psoc/pdev target_if structure and implement
alloc/free of these structures

Change-Id: Ie741d0de77c48caa843d4f2b33220a987366ba9b
CRs-Fixed: 2177109
2018-02-03 15:10:51 -08:00