Commit Graph

1051 Commits

Author SHA1 Message Date
Surabhi Vishnoi
878eeb8f5d qcacmn: Add extension2 data to radiotap header
There is a requirement to get sequence number and tid for tx
data packets in packet capture mode. These fields are not
received as part of WBM tx completion, but are obtained from
FW in ppdu stats. As WBM tx completion and FW ppdu stats are
two different events, the ppdu_stats of previously sent ppdu
are filled in the radiotap header of current tx ppdu in packet
capture mode.

Enhance code to add required fields such as ppdu_id of tx current
ppdu and ppdu_id, tid, start_seq, ba_bitmap of previously sent ppdu
as extension2 to radiotap header. These fields will be added in
radiotap header only when add_rtap_ext2 is set.

Change-Id: I448a9c03a770b61ab802d855bc5f1a6587bd01b3
CRs-Fixed: 3004472
2021-09-06 00:55:05 -07:00
Paul Zhang
17818ac91e qcacmn: Revise to include walt.h header
Since walt is msm-only scheduler group of features,
not upstreamed. Include walt.h header when CONFIG_SCHED_WALT
has been enabled.

CRs-Fixed: 3023820
Change-Id: Ib1aacae83ca4168eff958341f0feebe8ab37a4e7
2021-09-03 05:51:01 -07:00
Vignesh Viswanathan
1a7abca3c0 qcacmn: Add option to disable Cached Descriptor support
Some platforms do not support cached descripts for DP Rings.
Add support to set WLAN_CFG_DST_RING_CACHED_DESC to 0 and make
__qdf_nbuf_dma_inv_range as stub if DP_NO_CACHE_DESC_SUPPORT flag is
enabled during compilation.

Change-Id: Ic6b483be25c32f3f3c79b170fb7d7557a232b4ac
CRs-Fixed: 3027649
2021-09-03 05:50:56 -07:00
Adwait Nayak
fec569fb1f qcacmn: Compile qal_bridge.c only if DBDC_REPEATER_SUPPORT is enabled
qal_bridge.c has dependency on kernel bridge APIs and is required only
if DBDC_REPEATER_SUPPORT is enabled.

Remove qal_bridge.o from QDK Kbuild if DBDC_REPEATER_SUPPORT is not
enabled.

Change-Id: I7e8ae6f979f5323b99f4946b13c91c2a816f74a7
CRs-Fixed: 3027649
2021-09-03 05:50:52 -07:00
Jianmin Zhu
cc74d108d0 qcacmn: Fix array out of bounds issue
In qdf_mem_multi_page_link, pages->cacheable_pages is array with elem num
pages->num_pages, but pages->cacheable_pages[pages->num_pages] is read,
out of bounds error will report if KASAN enabled.

When ini dp_tx_ext_desc is 6144 and DP_TX_DESC_POOL_SIZE is 6144,
Size in bytes of TX TSO Num Seg Desc is 16, page size is 4096, so TX TSO
Num Seq Desc need 24 pages (6144*16/4096), each address need 8 bytes,
so TSO Num Seq Desc need kmalloc 192 bytes to save address of 24 pages.

BUG: KASAN: slab-out-of-bounds in qdf_mem_multi_page_link+0x190/0x1f4
Read of size 8 at addr ffffff816b4d60c0 by task kworker/u16:0/8

CPU: 7 PID: 8 Comm: kworker/u16:0 Tainted: G S      W  O
Workqueue: cnss_driver_event cnss_driver_event_work
Call trace:
 dump_backtrace+0x0/0x204
 show_stack+0x18/0x24
 dump_stack+0xcc/0x11c
 print_address_description+0x88/0x578
 __kasan_report+0x1ac/0x20c
 kasan_report+0x14/0x20
 __asan_load8+0x98/0x9c
 qdf_mem_multi_page_link+0x190/0x1f4 [wlan]
 dp_tx_tso_num_seg_pool_init+0x84/0x170 [wlan]
 dp_soc_tx_desc_sw_pools_init+0xb4/0x128 [wlan]
 dp_soc_init+0xf78/0x18c8 [wlan]
 dp_soc_init_wifi3+0x14/0x20 [wlan]
 cds_open+0x7e8/0x15fc [wlan]
 hdd_wlan_start_modules+0x7d8/0xf10 [wlan]
 hdd_wlan_startup+0x17c/0xbd4 [wlan]
 wlan_hdd_pld_probe+0x234/0x370 [wlan]
 pld_pcie_probe+0x6c/0x88 [wlan]
 cnss_pci_call_driver_probe+0xd8/0x358
 cnss_bus_call_driver_probe+0x38/0x6c
 cnss_driver_event_work+0xf14/0x1188
 process_one_work+0x53c/0x8b8
 worker_thread+0x4f8/0x928
 kthread+0x1e8/0x200
 ret_from_fork+0x10/0x18

Allocated by task 8:
 __kasan_kmalloc+0x100/0x1c0
 kasan_kmalloc+0x10/0x1c
 __kmalloc+0x130/0x448
 kzalloc+0x14/0x20 [wlan]
 __qdf_mem_malloc+0xcc/0x120 [wlan]
 qdf_mem_multi_pages_alloc+0xc0/0x580 [wlan]
 dp_prealloc_init+0x1b0/0x48c [wlan]
 wlan_hdd_pld_probe+0x200/0x370 [wlan]
 pld_pcie_probe+0x6c/0x88 [wlan]
 cnss_pci_call_driver_probe+0xd8/0x358
 cnss_bus_call_driver_probe+0x38/0x6c
 cnss_driver_event_work+0xf14/0x1188
 process_one_work+0x53c/0x8b8
 worker_thread+0x4f8/0x928
 kthread+0x1e8/0x200
 ret_from_fork+0x10/0x18

The bad address belongs to the object
which belongs to the cache kmalloc-192 of size 192
The bad address is located 0 bytes to the right of
f816b4d60c0).

Change-Id: I6569c22bc8f900296f49a4426f085912a33aa452
CRs-Fixed: 3014390
2021-08-17 15:46:43 -07:00
Kiran Venkatappa
a41cb25122 qcacmn: Remove get API under QDF_TIMER_MULTIPLIER_FRAC
Set QDF_TIMER_MULTIPLIER_FRAC to default multiplier if it is defined.
Remove get API under this feature flag so that this can be modified using
set dynamically based on the emulation target detect.

Change-Id: If0743e6b571832ebf3319f9895350685a5cd53f0
CRs-Fixed: 2995514
2021-08-16 03:18:34 -07:00
Devender Kumar
c182e1e3e9 qcacmn: Use sw_peer_id instead of ast_index to get peer
In order to support flow overide feature,
AST table has to be split between RxPCU and DDR.
With this split, RX monitor cannot make use of
ast_index to fetch peer as it is not from DDR.
So make use of sw_peer_id to fetch peer.
This sw_peer_id is derived from RX_MPDU_STAT_START_TLV

Change-Id: Ib2a003a2640fded3287c318d2ad59fd3127af9b6
CRs-fixed: 3004363
2021-08-12 08:29:37 -07:00
aloksing
be3cc56202 qcacmn: Add separate ID for Monitor trace prints
Add a separate module ID for Monitor error/debug Information.

Change-Id: Ie784430da8000b8a527f07261e039b6d3f903503
CRs-Fixed: 3006497
2021-08-12 05:32:52 -07:00
Paul Zhang
4b21f23fdd qcacmn: Align 8 bytes for qdf_mem_header address
In the function list_empty(), there is macro READ_ONCE() and
assembler instruction "ldar" will be used. It requests 8 byptes
alignment for qdf_mem_header address or data abort will happen.

To resolve this issue, align the qdf_mem_header address when
invoking function qdf_mem_dma_get_header().

CRs-Fixed: 2997107
Change-Id: I3d079c3c7e0f3634d85f891327284aefb7a65711
2021-08-11 22:38:41 -07:00
Harsh Kumar Bijlani
43da5b8892 qcacmn: Add API for unmap with physical and virtual addr of nbuf
Tx data transfer in host mode with nbuf map_unmap debug frmwk
enabled and enhanced stats disabled results in an assert.
This is because on Tx completion path, nbuf unmap is done using API
qdf_mem_unmap_nbytes_single which takes physical address of nbuf
for unmap and does not remove nbuf from map_unmap tracking list and
when nbuf is freed, it results in assert as the tracking list still
contains that nbuf entry.

In order to fix this, define a new API for nbuf unmap passing physical
and virtual address of nbuf as arguments. Physical address is passed
as an argument in order to avoid cache miss in per packet path which
eventually helps in improving the KPI.

Change-Id: I77ab6ac3ac98556b9caff8aa3ee82bc23cd26de7
CRs-Fixed: 3006671
2021-08-09 22:25:29 -07:00
Ashish Kumar Dhanotiya
c96d5d2592 qcacmn: Add support to parse multiple ini names
Currently driver supports only one name for an ini parameter,
there is no aliasing support for ini names.

With this change add support for  multiple ini names for the
same ini parameter.

Change-Id: Ib16a258975f5c3d152fa1dfbbdb6b3e6cc222784
CRs-Fixed: 3007156
2021-08-09 22:25:25 -07:00
Vivek
f4b29f3ad5 qcacmn: Use file for include path instead of environment variable
The include path passed to the CFLAGS may get very long in few cases
and passing them to the compiler results in the error
"arguments too long" from the shell.

We can pass the same argument by writing the include paths
to a file and avoid these errors when there are many include
paths added.

Change-Id: I2788d6e97a854ae6272d665943d56d581dc002bf
CRs-Fixed: 2999763
2021-07-27 07:07:11 -07:00
Ananya Gupta
f2851b458b qcacmn: Affine rx_err srng to all CPUs except 0
IPA and rx_err ring are processed in same CPU resulting
in low Tput.
To fix this, not allow processing of rx_err ring in
CPU 0

Change-Id: Id53a03c9290607beb1a595c84bfb0fd8d9f5d105
CRs-Fixed: 2949569
2021-07-27 01:00:14 -07:00
Vivek
f8167f4dbc qcacmn: Call cfg80211 functions with context aware allocation flags
There are instances in the code where the response is sent from the
driver to the supplicant indicating the allocation flags which is
used by the supplicant to allocate memory.

In those situations, we should pass the allocation flags based on
the context in which the response is sent.

Send the response with the right allocation flags to the supplicant.

Change-Id: I85f1c29fc66ba51a9f9c645692712c3a25b7fed1
CRs-Fixed: 2987552
2021-07-26 13:54:14 -07:00
Linux Build Service Account
06312dc0bf Merge "qcacmn: Fix potential NULL pointer access in qdf_ini_parse()" 2021-07-22 11:41:59 -07:00
Vivek
3853650e2e qcacmn: Add new MBSS framework component
Add a new component for MBSS framework in object manager.

Add a new trace module for the new MBSS component framework.

Change-Id: I7ef3559d90a6bc7f558e3994a1a91f09985d90e9
CRs-Fixed: 2958764
2021-07-21 17:14:56 -07:00
Debasis Das
1ae342f91a qcacmn: Fix potential NULL pointer access in qdf_ini_parse()
In qdf_ini_parse(), verify that section_cb pointer is valid
to prevent invalid memory access.

Change-Id: Ie3d2e513e2aabf0bd5f9702578074cb1191991c1
2021-07-21 03:05:41 -07:00
Manjunathappa Prakash
036b05b69e qcacmn: Enable need idle functionality for 5.10 kernel
On 5.10 kernel need idle” functionality is moved from
<linux/sched.h> to walt (<Linux/sched/walt.h>), Replace
“PF_WAKE_UP_IDLE” checks with “IS_ENABLED(CONFIG_SCHED_WALT)”.

Change-Id: Icb89b0e6e9862ed5b82680379a1d2630c9b2b4d9
CRs-Fixed: 2990760
2021-07-15 14:34:06 -07:00
Krishna Rao
1ce921eb1a qcacmn: Add separate ID for ML IE trace prints
Add a separate module ID for Multi Link Operation (MLO) Information
Element protocol processing related QDF trace prints. These are for
use in processing of any IEs related to MLO. This would help separate
the tracing of MLO IE operations which are expected to be substantial,
and avoid confusion that might arise from reuse of MLO manager
tracing.

Change-Id: If55532a89452b6432101be07fcc6aff45045e822
CRs-Fixed: 2985731
2021-07-14 15:32:22 -07:00
sandhu
81272da21e qcacmn: Add support to log ICMP packet seq no and ID
Add support to log ICMP seq no and ID in DPTRACE.
Other protcols can use this private proto data to record
there private data accordingly. Currently it is set to 0.
Increase the record entry from 40 bytes to 50 bytes.

Change-Id: Ief5fb26a97408a364af486f3eaec2e108de71d52
CRs-Fixed: 2951916
2021-07-07 04:28:14 -07:00
Abhishek Singh
61d75799c8 qcacmn: Add new reason code in qdf_hang_reason
Add new reason code QDF_VDEV_SM_OUT_OF_SYNC, in qdf_hang_reason.

Change-Id: I528fa1d2dc32ff8d8e4b7e38f16bce04cda48b5b
CRs-Fixed: 2982366
2021-07-02 13:54:08 -07:00
Debasis Das
273d2795c6 qcacmn: Initialize variable that collects return status of functions
The variable used to collect the status of function calls
should be initialized.

Change-Id: I2716673455ca4b48c4945739f2e43343be488234
2021-07-01 11:23:30 -07:00
Arun Kumar Khandavalli
4d8b3bb683 qcacmn: Add the api to set smmu fault state
There is a time involved between the smmu fault initiated
and the eventual system panic. In this time there is a
possibility of the nbuf history being overwritten losing
the information on the nbuf which might has actually caused
the SMMU fault.

Set the ssmu state and dont track the nbuf's when the smmu
fault is detected.

Change-Id: I579da332766618161567764656005ef13667270e
CRs-Fixed: 2960070
2021-06-28 05:11:12 -07:00
Mohit Khanna
c9bcf7e494 qcacmn: Handle BUF_ADDR ring desc in dp_rx_err
Currently dp_rx_err_process expects ring descriptor to be only
LINK_DESC_TYPE. In certain cases BUF_ADDR_TYPE ring descriptor is
observed in reo_exception ring. Add logic to handle the same.

Change-Id: I5baecc3f8eafc0830672b91bc9d9607b568a6cda
CRs-Fixed: 2954653
2021-06-09 23:38:08 -07:00
Harsh Kumar Bijlani
0aeac39461 qcacmn: Enable nbuf map_unmap debug framework
Nbuf map_unmap framework requires qdf_tracker to
be compiled. Add qdf_tracker.o to Kbuild in order
to compile it.

Change-Id: I4a19e525280020583466ee7dd8621958ebe4f26a
CRs-Fixed: 2959146
2021-06-09 05:17:35 -07:00
Harsh Kumar Bijlani
0212730a84 qcacmn: Add check for memory_debug_disabled in nbuf APIs
Check for is_initial_mem_debug_disabled is missing in nbuf APIs.
Add check for is_initial_mem_debug_disabled in those APIs.

Change-Id: Ie85cae8029b5d47567da861dd84b86221a68b0f5
CRs-Fixed: 2962901
2021-06-09 05:17:30 -07:00
Himanshu Batra
0f0ee4c77c qcacmn: Add print APIs for MLO
Add print api definitions for MLO

Change-Id: I7761fe01fba85bd8fb97413f95f73d995f84c1aa
CRs-Fixed: 2958486
2021-06-08 03:16:37 -07:00
Amruta Kulkarni
6084c736c6 qcacmn: Use AES api's instead of the generic crypto api's
For Kernel version 5.4 and up use AES api's instead of
generic crypto api's referenced in qdf crypto module.

Change-Id: I92031d469d0da657dce4dcb8c603c82a1e182f1d
CRs-Fixed: 2947476
2021-05-27 06:03:32 -07:00
Kai Chen
c089dc5216 qcacmn: remove duplicate definition for radiotap header
Move duplicate radiotap header definition to header file

Change-Id: Ieb833f26c6c433c7917cc2196d4957102501672c
2021-05-13 15:32:20 -07:00
Karthik Kantamneni
6370333013 qcacmn: Make QDF NBUF history size configurable
Some of the targets require more QDF nbuf history
size, so making the size configurable keeping
default same.

Change-Id: Ic4ac43a1eacb1e58c0a05b794349525d614d7fc8
CRs-Fixed: 2929968
2021-05-12 20:57:57 -07:00
Alan Chen
0fedc36000 qcacmn: Add ksize check for calling qdf_mem_prealloc_put
In perf builds, add a ksize check and call qdf_mem_prealloc_put()
only when size is greater than 4K to avoid lookup overhead.

Change-Id: If01a7cbeaf1ee7f514f16296340169a937dafa78
CRs-Fixed: 2936464
2021-05-07 22:53:58 -07:00
Ananya Gupta
9f3b9ca800 qcacmn: compiling WDI3 version of IPA
Depreciated IPA APIs are currently getting compiled.
To fix this, adding linux kernel version check

Change-Id: I2288db34c09d60047c67a5df9081de08a6c2f62b
CRs-Fixed: 2927413
2021-05-06 06:23:47 -07:00
Adwait Nayak
c2c89243d8 qcacmn: Parse and update qdf module params
Read the file wifi_module_param.ini, in which wifi module params
are present and compare these module params with qdf module params
in qdf module init function.

If any of the module params belongs to qdf module is present,
then that particular module param is updted during qdf module init.

Change-Id: I76ef876f6c7be3cdffd93b6050a190438d60bf39
2021-04-27 16:13:11 -07:00
Rajeev Kumar
034e1c4507 qcacmn: Add INI file parse success and failure logs
Some times INI file is empty or wrongly formatted on device
and WiFi ON fails because of it and hence add a log message
to indicate INI file parse success or failure.

Change-Id: I2337fc4ffb4a443ac191f584e283fdc9699a4e04
CRs-Fixed: 2931228
2021-04-26 20:37:14 -07:00
Jingxiang Ge
5b31c536c4 qcacmn: trigger recovery in hif_check_detection_latency
Replace as qdf_trigger_self_recovery here, so it can trigger
fw dump firstly.

Change-Id: I39e3bc11829a1969ac60bd3bbd71f3e2d1fa4f43
CRs-Fixed: 2928096
2021-04-26 00:17:53 -07:00
Rajeev Kumar
c0a7a9dfe2 qcacmn: Replace request_firmware by firmware_request_nowarn
Replace request_firmware by firmware_request_nowarn to avoid warning
message when the file is not found and sysfs fallback mechanism is
enabled if direct filesystem lookup fails.

Change-Id: Ib55d257aa01c52523b1f1137165c842e139ce614
CRs-Fixed: 2912039
2021-04-02 12:02:49 -07:00
Vevek Venkatesan
da069e5990 qcacmn: add qdf wrapper API for is_driver_state_module_stop
Add qdf wrapper API support for is_driver_state_module_stop.

Change-Id: I6965b4049aebcbe9ec612cf3d70398eb269450e4
CRs-Fixed: 2912016
2021-04-01 20:34:10 -07:00
Jeff Johnson
79b61afd8f qcacmn: Do not export static functions
Linux kernel commit 15bfc2348d54 ("modpost: check for static
EXPORT_SYMBOL* functions") adds a check to make sure that static
functions are not exported.

With this in place the following fatal errors are reported:
FATAL: modpost: "__qdf_nbuf_get_ether_type" is a static EXPORT_SYMBOL
FATAL: modpost: "os_if_spectral_free_skb" is a static EXPORT_SYMBOL
FATAL: modpost: "qdf_nbuf_tx_desc_count_update" is a static EXPORT_SYMBOL
FATAL: modpost: "__qdf_nbuf_get_ip_offset" is a static EXPORT_SYMBOL

To fix these errors do not export the static functions.

Change-Id: Ib5caab904401900bafb23dee23b119daa76d4055
CRs-Fixed: 2910980
2021-03-31 10:07:30 -07:00
Jia Ding
4737cf81c4 qcacmn: Add qdf macros for IPA TX two pipes
Add qdf macros to support IPA TX two pipes configuration.

Change-Id: I9d8b960355c084c49a664efafa7aac3153602572
CRs-Fixed: 2750078
2021-03-24 09:48:30 -07:00
Li Feng
8055c97ed3 qcacmn: Use ktime_get_real_ts64() api from kernel v5.4.0
Use ktime_get_real_ts64() api from kernel v5.4.0.

Change-Id: Ica8b5d2daa7560472eed084145587e3ad189503f
CRs-Fixed: 2900092
2021-03-20 20:45:49 -07:00
Chaithanya Garrepalli
20500d66ae qcacmn: Fix double free false positive with qdf_nbuf_unshare
In qdf_nbuf_unshare_debug() API remove the refernce of old nbuf
before calling skb_unshare(). As skb_unshare() will free old nbuf
and allocate a new one for a cloned skb.

Change-Id: I2a2f0277934268a346e13a0779e204f02c9bcf5b
2021-03-19 18:51:26 -07:00
Aditya Kodukula
45e98f35da qcacmn: Enable the minidump API based on Kernel Version
The minidump API msm_minidump_remove_region() was added to the
msm-kernel from version 4.19 so, to avoid compilation failures in
older kernel versions, enable the feature flag WLAN_QCOM_MINIDUMP
for kernel beginnig with 4.19 version.

Change-Id: Iba7a293fb9ca3e5ffe967e8d610251df8c2a3969
CRs-Fixed: 2901746
2021-03-18 11:51:39 -07:00
Jingxiang Ge
2c6d25c0ad qcacmn: Add detection for tasklet delay
This feature is used to detect CE tasklet scheduling delay
and credit response delay issues.

Change-Id: I9a8fcb425edd5cf96fae5f6cd3bfc7f51172c814
CRs-Fixed: 2874874
2021-03-16 00:45:23 -07:00
Aditya Kodukula
20380cee21 qcacmn: Add QDF infra for the minidump feature
Add QDF infra for minidump feature and define the
minidump_log and minidump_remove functions.

Change-Id: I875b991b7a7d9295f8b2acd95a7551a747ec962c
CRs-Fixed: 2856193
2021-03-09 21:06:54 -08:00
Bapiraju Alla
e9dd7d1d40 qcacmn: Update error if failed to read at least one INI parameter
INI parameters parsing can fail because of fail to read INI file or
failed to parse at least one parameter. In some scenarios, driver should
assert if parsing is failed for atleast one INI parameter.

To differentiate these two failures, return different error status
values.

Change-Id: I187d2b2e8f55af47a14561302d8b62e84de7da5a
CRs-Fixed: 2878966
2021-02-19 13:45:01 -08:00
Karthik Kantamneni
3c3d944246 qcacmn: Enhance error signature in qdf_check_state_before_panic
Improve error signature in qdf_check_state_before_panic API.

Change-Id: I5774c07e9359b711f0863c40072962b802318f2f
CRs-Fixed: 2879026
2021-02-18 07:47:05 -08:00
Vevek Venkatesan
fdf0a167e5 qcacmn: change the return type of qdf_queue_work to bool
Currently the return type of qdf_queue_work is void,
whereas queue_work return type is bool denoting the status,
so changing the return type of qdf_queue_work to bool,
helps to check the status of the function.

Change-Id: Ifd07923a18641790314b88d38a7eba2a73e498b3
CRs-Fixed: 2876197
2021-02-12 12:27:25 -08:00
Bapiraju Alla
ded2573351 qcacmn: Add bug_on incase of skb set packet length failure
Add bug_on incase of set packet length failure for debugging purpose

Change-Id: Ie91da71c2420c585b27625ec241e62a2706606c4
CRs-Fixed: 2849081
2021-02-11 04:43:34 -08:00
Debasis Das
eba308d926 qcacmn: Include relevant header-file
Include relevant header-file to use QDF_BUG macro.

Change-Id: I9ad43a05410cf6641f76a94e0e9f40e323997c50
2021-02-04 08:50:31 -08:00
Yeshwanth Sriram Guntuka
28c395b59d qcacmn: Add iova to nbuf map history event
Record iova address in the nbuf map history
events.

Change-Id: I1bb415537ffe68c839c4c2f69901394ad047022b
CRs-Fixed: 2856038
2021-02-02 07:49:39 -08:00