Commit Graph

847 Commits

Author SHA1 Message Date
Edayilliam Jayadev
915648336f qcacmn: Add APIs to split/join lists
Add following APIs.

  1. Split a list into 2 lists
  2. Join two lists

Change-Id: I9eb5cdfeeef582ef0bebe108f08fac307494b59d
CRs-Fixed: 3071041
2021-11-25 08:18:09 -08:00
Himanshu Batra
bd23cf7dcc qcacmn: QDF changes to support IPA offload
QDF changes to support IPA offload.

Change-Id: Ib3a0f667bb9c11fb65f6a41ad777ff7273288569
2021-11-24 05:31:07 -08:00
Yue Ma
41ab344f9e qcacmn: Add CONFIG_CNSS_OUT_OF_TREE flag for QDF prealloc
Use CONFIG_CNSS_OUT_OF_TREE to control if CNSS prealloc driver is
built from in-kernel-tree source or out-of-kernel-tree source since
the exposed header file will be in different paths. This is also for
backward compatibility. Use internal flag CNSS_MEM_PRE_ALLOC instead
of CONFIG_WCNSS_MEM_PRE_ALLOC which will not be defined from kernel
defconfig for out-of-kernel-tree CNSS prealloc driver. CNSS_MEM_PRE_
ALLOC will be defined in the driver Kbuild no matter where CONFIG_
WCNSS_MEM_PRE_ALLOC gets defined.

Change-Id: I6e35f3e859fb429584e83665fe0290ffeb314312
CRs-fixed: 3074638
2021-11-16 23:30:35 -08:00
Yeshwanth Sriram Guntuka
1ede276269 qcacmn: Add QDF api to get smp processor id
Add QDF api to get smp processor id.

Change-Id: If0187ca1bc609f4cb9107bbb343b2bb180910f46
CRs-Fixed: 3066767
2021-11-02 16:32:07 -07:00
Jinwei Chen
b521830197 qcacmn: get sw_exception from reo dest ring descriptor
sw_exception bit will be marked in reo dest ring descriptor for
FW re-injected frame, get this bit and save it in skb->cb,
this bit value can be used for FISA further check.
there is no reo_dest_indication field in reo dest ring on beryllium,
so share same cb member for sw_exception and reo_dest_indication.

Change-Id: I2321121be7dda68ed19faca177d868c7e8ba1dbf
CRs-Fixed: 3056156
2021-10-28 10:21:20 -07:00
Jianmin Zhu
fb1db30308 qcacmn: Fix wrong rssi in monitor mode
If ppdu rssi unit is dbm, need convert to db for API:
qdf_nbuf_update_radiotap, only need convert once for first mdpu in the
ppdu. if convert for each mpdu, wrong rssi will be saved.

Change-Id: I85e92121ddb289e3513022ff092083825197efb4
CRs-Fixed: 3057041
2021-10-27 02:36:07 -07:00
Ke Huang
a317f7c615 qcacmn: Adjust the IPA WDI2 CONS/PROD definition
Adjust IPA WDI2 CONS/PROD definition for the IPA support on
sa415m for Genoa.

Change-Id: I7d73cd8d2843875fa6208cb520d49d4f6170fef7
CRs-Fixed: 3042786
2021-10-26 21:02:53 -07:00
Jianmin Zhu
7a0af0ae4e qcacmn: channel_switch_complete_evt need wake up all waiting threads
2 threads blocked to wait channel_switch_complete_evt for SAP channel
switch is already in progress,  qdf_event_set only woke up 1st thread
later,  2nd  thread still kept blocked with hold  net_dev for debug id
NET_DEV_HOLD_COUNTRY_CHANGE_UPDATE_SAP, leak happened.

Change-Id: Ib76318dd4a613ca1852a56b7701a04385b69ba56
CRs-Fixed: 3061976
2021-10-26 04:44:10 -07:00
Rhythm Patwa
e60e11bb76 qcacmn: Add QDF module ID for AFC
Add QDF module ID for AFC debug logs.

Change-Id: I741b85df50e3bf23b0ff5096270f0dd7a20679e3
2021-10-05 07:36:50 -07:00
Edayilliam Jayadev
b8bb556398 qcacmn: Add new QDF module for management rx reorder
Add new QDF module for management rx reorder feature.

CRs-Fixed: 3026019
Change-Id: I471757f4f32ed8439d94c9cd96a330b21299140a
2021-09-30 08:38:21 -07:00
Vulupala Shashank Reddy
2da40899eb qcacmn: Add APIs to get data packets info
Add APIs to get TCP fin/fin-ack/rst packets information.

Change-Id: Ia1150c81076fa47ae7f34d14bc73efc82003258a
CRs-Fixed: 3046235
2021-09-30 08:38:16 -07:00
Pragaspathi Thilagaraj
a8d8b663b2 qcacmn: Define QDF API for vzalloc and vfree
Define QDF API for virtual memory allocation and free.
Also add new api to get time of the day in microseconds.

Change-Id: I2921055bbb6b5d2a1105d19448b2a10fa2d6ccc5
CRs-Fixed: 3038180
2021-09-28 21:12:18 -07:00
Pavankumar Nandeshwar
d6a386028b qcacmn: add qdf APIs for intra-bss
qdf APIs to save intra-bss flag in the nbuf
and to extract it later

Change-Id: I79e793d6252adc8b6e024f8b3a95959f64d9df31
2021-09-24 18:28:02 -07:00
Ananya Gupta
29d256f801 qcacmn: Log DHCP, EAPOL packets to logging queue
Log DHCP and EAPOL packets to wlan connectivity logging
queue.

Change-Id: Ib0c84c389c0f5fd7e742722c0e03c84b9732de19
CRs-Fixed: 3030936
2021-09-21 09:30:39 -07:00
Edayilliam Jayadev
6691cd953a qcacmn: Fix copyright
Fix modified year in the copyright banner.

CRs-Fixed: 3036102
Change-Id: I97c39555e7e24ed8b12687983d19f418234bd614
2021-09-16 02:47:51 -07:00
Ke Huang
1b18916173 qcacmn: Add IPA WDI2 CONS/PROD definition for the IPA support
Add IPA WDI2 CONS/PROD definition for the IPA support on
sa415m for Genoa.

Change-Id: Ic140bb1b43afc5029ba006a38534dd64ca13f6f2
CRs-Fixed: 3025213
2021-09-16 02:47:46 -07:00
Yeshwanth Sriram Guntuka
ccb6664db1 qcacmn: Dump flow pool stats as part of periodic stats display
Dump flow pool stats even for low verbosity level as
part of periodic stats display.

Change-Id: Iea59d20b0a81cfd0bfdac65ad54a11fa33f30f2f
CRs-Fixed: 3031168
2021-09-13 13:04:58 -07:00
Edayilliam Jayadev
698478886e qcacmn: Add API to get first node of a list
Add QDF API to get the first node of a linked list. If the
list is empty this API returns NULL.

Change-Id: I4569941f708634085904fd30a347facca543594a
CRs-Fixed: 3029987
2021-09-13 06:20:08 -07:00
Edayilliam Jayadev
76ba042a40 qcacmn: Add API to iterate list from a given node
Add QDF API to iterate linked list starting from
a specific node.

Change-Id: I1bf7137213eefa434c983a8d10aa8e1398fa586e
CRs-Fixed: 3029986
2021-09-13 06:20:03 -07:00
Shiva Sankar Gajula
dcbdb29d04 qcacmn: Register separate function pointer to receive EAPOL frames
Add changes to register separate function pointer to receive EAPOL
frames instead of using regular RX path and adding export symbol
for __qdf_nbuf_data_get_eapol_subtype() to access in it multiple
modules

Change-Id: Id05b982d31a7e008536d10dd5281e88cceba96db
2021-09-07 07:59:06 -07:00
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
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
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
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
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
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
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
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
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
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