Commit Graph

765 Commits

Author SHA1 Message Date
Mohammed Siddiq
61d47a3695 qcacmn: Use IS_ENABLED for the definition of kernel module
Add code to use IS_ENABLED for CONFIG_WCNSS_MEM_PRE_ALLOC
kernel modules and remove inclusion of reduntant header
file cnss.h.

Change-Id: If1d098c7c6f326d12700f06318909a7fc0e7895a
CRs-fixed: 2702368
2020-06-30 12:30:17 -07:00
phadiman
c90e1dc372 qcacmn: Fix incorrect verbose level debug print
If QDF_TRACE is called with wrong verbose level then
the actual print is supressed and a error log will be
printed indicating wrong verbose level

This change is introduced because of an issue wherein
the prints flooded with wrong verbose level and could
not identify the incorrect caller

Add change to concatenate the actual print along with
failure message to help identify such incorrect callers

CRs-Fixed: 2716564
Change-Id: I19c4e80958c1ab5d621eea3a6d32308ce4c51558
2020-06-30 12:30:13 -07:00
Vevek Venkatesan
d04ad531c8 qcacmn: fix format specifier in qdf_dpt_dump_stats_debugfs
Fix proper format specifier for qdf_debugfs_printf in
qdf_dpt_dump_stats_debugfs.

Change-Id: I3d357cb677c6419e13c3c2333b43d4cae2f2df41
CRs-Fixed: 2717408
2020-06-29 21:35:31 -07:00
Debasis Das
dd686ad391 qcacmn: Enable EWMA for appropriate kernel version
EWMA-related macros are available from version 4.3.0 onwards.

Change-Id: I94ffae3a72894e7494903445f752e926942f9af7
2020-06-29 07:44:00 -07:00
Aniruddha Paul
ea81d9ac47 qcacmn: Add qdf API wrapper for ktime_real_get
Add qdf wrapper API to the ktime_real(). This gives the
current wallclock in ktime format.

Change-Id: If869985007225606075fb936593d5798ea0746e9
2020-06-29 02:38:43 -07:00
nakul kachhwaha
c5cdd1eaaf qcacmn: iot_sim add support for drop operation
Adding support for iot_sim drop operation.
Drop operation will be handled in Rx direction.

Change-Id: If2e1c9663a69fcd16715cdd1d28639a388ea1c0c
CRs-Fixed: 2686309
2020-06-24 03:34:57 -07:00
Zhaoyang Liu
d83a21ba68 qcacmn: use kzalloc for memory instead of kmalloc
Try to request memory using kzalloc instead of kmalloc.

Change-Id: Ib35097f76257733b3663c112b8255b587ff19bd6
CRs-Fixed: 2706674
2020-06-20 12:04:29 -07:00
Aditya Kodukula
aad7669d56 qcacmn: Revert "qcacmn: Not set "force_set" if event completed"
This reverts commit I31f947169153ccbeb8435c539faab1059c055c04 since
it has introduced, use after free issue during dp_rx_thread shutdown.

Change-Id: If8318b28883ae8ddd4fee36013f28c45f30fa426
CRs-Fixed: 2707451
2020-06-17 19:38:05 -07:00
Nisha Menon
0bbaedb23c qcacmn: Log memory stats in host driver
Add logs in driver to log current memory footprint
in init functions. Add wlan_mem_stats to sysfs node
in both perf and defconfig builds.
The stats are included under MCL feature
DCONFIG_WLAN_SYSFS_MEM_STATS.

Change-Id: I79c6d418a5762cddf52ab3bc0b0c93993fa7fd84
CRs-Fixed: 2635192
2020-06-11 02:04:46 -07:00
Ashish Kumar Dhanotiya
7bcac49e55 qcacmn: Add driver command to dump function call mapping
Add driver command support to dump all the function call mapping
which is cached in global buffer.

Change-Id: I6df9273c641e2cf3ecefe64c8f3c15d8ec2f9b20
CRs-Fixed: 2677981
2020-06-09 21:53:33 -07:00
bings
131d1bf176 qcacmn: remove return value of qdf_debugfs_create_u*
According to Kernel comment, no one checks the return value of routines:
debugfs_create_u8
debugfs_create_u16
debugfs_create_u32
debugfs_create_u64
debugfs_create_atomic_t
so remove return value of related qdf api.

Change-Id: I7d260bccfce463dddae963c54a776813df116eac
CRs-Fixed: 2666506
2020-06-08 13:50:24 -07:00
bings
67ae88ddbb qcacmn: rtc_time64_to_tm support for 4.0+ kernel
rtc_time64_to_tm in defined from kernel 4.0+. Use rtc_time64_to_tm
instead of rtc_time_to_tm from kernel 4.0+.

Change-Id: I6335150300cd4cd7a91d771dd86bf11592d1ff11
CRs-Fixed: 2666521
2020-06-08 13:50:21 -07:00
Vevek Venkatesan
eed5d30c55 qcacmn: Use IS_ENABLED for the definition of kernel module
Add support in code to use IS_ENABLED, if CONFIG_ARM_SMMU
config as kernel module.

Change-Id: I64c1e0c7918d520ed36a7a9e22fdf39f66e1c150
CRs-Fixed: 2701645
2020-06-05 10:22:51 -07:00
Jeevan Kukkalli
8bcf1b75d2 qcacmn: Register for panic notification
If wlan logging is enabled then register a notifier block
to kernel's panic notifier chain. Notifier block contains a
callback function to print buffered wlan logs in the event
of kernel panic.

Change-Id: Id8cae651afe45e411e1ddf122c2bc9b5f6688327
CRs-Fixed: 2692163
2020-06-05 02:04:10 -07:00
bings
2be79bf9fd qcacmn: sizeof_field support for 4.16+ kernel
sizeof_field is defined from kernel 4.16. So use sizeof_field
instead of FIELD_SIZEOF from kernel 4.16.

Change-Id: I291531ea86499a7c0ba52fbb6607b19dff533111
CRs-Fixed: 2666512
2020-06-03 09:27:52 -07:00
Chaoli Zhou
47e9c6a997 qcacmn: Fix htt_status & A_STATUS map dp status wrong issue
The packet tx complete status from wlan fw define in htt_tx_status
doesn't match with packet trace feature used in qdf_dp_tx_rx_status,
Meanwhile A_STATUS also doesn't convert to correct qdf_dp_tx_rx_status,
so add two according APIs to fix it

Change-Id: Ic250175dd270632f40af14ad9499ddcafbb3033b
2020-06-01 05:23:26 -07:00
bings
1740435d49 qcacmn: Use ktime_get_real_ts64 for kernel 3.17.0+
ktime_get_real_ts64 is defined from kernel 3.17.0.
Use ktime_get_real_ts64 instead of ktime_get_ts from
kernel 3.17.0.

Change-Id: Ica72545fe5224966fbb350813bf3c2d849946dbc
CRs-Fixed: 2666404
2020-06-01 00:04:08 -07:00
Baowei Liu
ca3412698e qcacmn: Not set "force_set" if event completed
"qdf_complete_wait_events" set force_set flag for all event in
"qdf_wait_event_list". This cause qdf_wait_for_event_completion
return QDF_STATUS_E_FAULT, even if event have completed

Add new flag "done" to record event completed. Use this flag to
detect event have completed or not.

Change-Id: I31f947169153ccbeb8435c539faab1059c055c04
2020-05-28 17:28:50 -07:00
Alok Kumar
163a364d27 qcacmn: Set TCP PSH flag only for the last segment of TSO packet
Currently, if TCP PSH flag is set in TSO packet then
PSH flag is set for each TSO segment in the driver.
This causes GRO flush for each segment received in the receiver side.

Set this PSH flag only in last TSO segment so that GRO flush
happens for the last segment in the receiver end.

Change-Id: I6d6b34fab71ab2984ea68d8197f2979d25b36c6b
CRs-Fixed: 2692251
2020-05-28 07:57:09 -07:00
Santosh Anbu
453e7a3240 qcacmn: Add qdf bitmap AND and EMPTY APIs
Add qdf API to check if a given bitmap is empty and API to compute
bitwise AND operation of two given bitmaps.
1. qdf_bitmap_and
2. qdf_bitmap_empty

Change-Id: Ibc26e0f515c3804f1b627e8eaa8bf6f796c40324
CRs-Fixed: 2635330
2020-05-17 23:12:47 -07:00
Jinwei Chen
c1ab9eee8e qcacmn: add exception frame flag in qdf_nbuf_cb
add exception frame flag in qdf_nbuf_cb structure.

Change-Id: I97f61973cc1c0d00fe66cc0e8aac0c7b4b16bb56
CRs-Fixed: 2680255
2020-05-14 13:04:23 -07:00
Sourav Mohapatra
294b74babf qcacmn: Resolve compilation errors after disabling DEBUGFS
On disabling debugfs, there are various compilation issues
involving missing stub functions and incorrect declarations.

In this change, resolve those issues.

Change-Id: I7b3047dac2aaf4eb68c64505186ca51e22ab0928
CRs-Fixed: 2670460
2020-05-12 15:36:27 -07:00
nakul kachhwaha
861af9fad3 qcacmn: Add files for IOT Simulation module
Adding files to support IOT Simulation module

Change-Id: I3c145f43e846ae5db032df748943c4d0ff531585
CRs-Fixed: 2657904
2020-05-12 06:43:02 -07:00
Sourav Mohapatra
3b4cb57737 qcacmn: Use wakeup_source_register when WAKEUP_SOURCE_DEV is def
Currently, the kernel APIs wakeup_source_register are used for kernel
version 4.19.110 and higher in sync with the upstream kernel. But in
downstream kernel, the same has been introduced from 4.19.80.

To accommodate compatibility with both, use a downstream compiler flag to
indicate when to use the kernel APIs.

Change-Id: I7c2d439aa8c859d92b4bbdbdd5034861c0c98e75
CRs-Fixed: 2679523
2020-05-11 05:24:36 -07:00
Uraj Sasan
0608b9dfbe qcacmn: Add cache invalidation for ARM platforms
Add cache invalidation api for ARM platforms.
The API is not supported, for non-ARM platforms.

Change-Id: Iec7d4878a0fcd0f1ae8257cfd9cc0865ad5825c2
2020-05-06 03:10:28 -07:00
Abhishek Singh
d96c0dbfbf qcacmn: In crypto use QDF api to calculate MIC for OS derivatives
For WLAN_CRYPTO_OMAC1_OS_DERIVATIVE and
WLAN_CRYPTO_GCM_OS_DERIVATIVE set use QDF API to calculate MIC

Change-Id: I5971eb39414a292534981753805df6d9beb54be0
CRs-Fixed: 2664275
2020-05-04 03:50:18 -07:00
Nisha Menon
12cc7c6558 qcacmn: SKB buf memory Leak@ Func dp_pdev_nbuf_alloc_and_map
Fix the skb leak in dp_rx_process where rx descriptor cookie
validity fails. This skb should be cleaned up as part of the
rx desc and nbuf free function called during the driver unload.
However this will ensure that the skb released and added rx desc
added to the free list during dp_rx_process itself.

Add skb map, unmap functions, line numbers and if the nbuf is
mapped or unmapped to the nbuf tracking table. This debug info
will be logged once the skb is leaked.

Change-Id: I52dbf38922be20fc0aaea380e0e572af16de773e
CRs-Fixed: 2662992
2020-04-30 18:21:23 -07:00
Sumedh Baikady
b83a21dd94 qcacmn: Add 6Ghz module Id in QDF
Add 6Ghz module ID in QDF for debug
purposes.

Change-Id: Iea2677ac4d91e64fb324eabfc55970f019ae8a56
2020-04-28 07:32:30 -07:00
nobelj
01dcfedca1 qcacmn: Support MU in tx capture mode
Support fix for MU related data frame in tx capture mode.

Change-Id: I8b63eaf320463a3a068beb589089582cafe05001
CRs-Fixed: 2656346
2020-04-27 23:26:50 -07:00
Jeevan Kukkalli
31004de4c2 qcacmn: Make cnss diag kernel level logging unlikely
Module param qdf_log_dump_at_kernel_enable is set to
false by default in wifi script when no value configured
through UCI so make kernel level logging unlikely.

Change-Id: I4aa3547c4049562b1cad63eb20d75b5b166a04c2
CRs-Fixed: 2664926
2020-04-23 16:26:54 -07:00
Varsha Mishra
1fb9b10ac1 qcacmn: Make _qdf_nbuf_unmap_nbytes_single API inline
Make _qdf_nbuf_unmap_nbytes_single to use in dp_rx_process.
Non-inline version takes more CPU.

Change-Id: Iaf5e9f5f734d81b6d2c234bd8e579cf2a81c7e2c
CRs-Fixed: 2634679
2020-04-23 02:18:13 -07:00
Subhranil Choudhury
9e9fb6a437 qcacmn: QDF Module ID for new Repeater
Addition of QDF id for new wifi repeater module.

Change-Id: Id9adc5d3524e9406fafaca67e4d5e6bc3215bada
2020-04-20 22:31:32 -07:00
Varsha Mishra
5cd2a434e1 qcacmn: Add QDF abstraction for dmac_inv_range
Add qdf wrapper for function dmac_inv_range. This
invalidates the specified virtual address range.

Change-Id: Ia3f92cb5136dbdbfea1e9cda8a52b474456a4e0a
CRs-Fixed: 2634679
2020-04-17 20:38:34 -07:00
Vivek
a7412197a6 qcacmn: Add QDF type to define a bitmap based on bits size
The bitmaps used in the driver are defined either as a single
or array of unsigned longs or some other types.

The bitmap variable size is different based on the platform(32/64 bit),
for unsigned long types.

Add support to have a platform agnostic consistent bitmap size
using the Linux provided interface for defining bitmaps.

CRs-Fixed: 2660881
Change-Id: I901778625ef9aaccc994d914c8adf98fbffeb980
2020-04-15 12:12:05 -07:00
Liangwei Dong
560f438d7b qcacmn: Add rate limit for HEX DUMP qdf api
Add rate limit for QDF_TRACE_HEX_DUMP API to avoid hex dump
message flood in kmsg and driver log.

Change-Id: I34fa16f3723169a07e66c0c806885c06abc2fa57
CRs-Fixed: 2660367
2020-04-13 21:14:55 -07:00
Shwetha G K
119f16a3b1 qcacmn: Fix build error when MEMORY_DEBUG disabled
Move is_initial_mem_debug_disabled under MEMORY_DEBUG flag as it
does not depend on NBUF_MEMORY_DEBUG to fix un-usued symbol error
when MEMORY_DEBUG is disable and NBUF_MEMORY_DEBUG is enable.

Change-Id: Idb54544321a0fd9dda7a6e98d91d22d01be50e41
2020-04-09 16:17:25 -07:00
Padma Raghunathan
be65ea9002 qcacmn: CFR: Abstract retrieval of netdevice name
Since netdevice name retrieval is tied to OS,
move it to qdf OS layer instead of doing it
inside CFR ucfg layer.

Change-Id: Ia9dcbdf56bcb36a1f0788be9964ea87fdf5beb3f
CRs-Fixed: 2643682
2020-04-09 07:31:34 -07:00
Nisha Menon
046f3623de qcacmn: Back pressure in REO2SW1 ring resulting in REO panic
Update QCA_NAPI_DEF_SCALE_BIN_SHIFT for defconfig builds to
the same value as the perf build.
Move the WLAN ext irqs to gold cores for defconfig builds.
Disable cpu isolation before moving the IRQs to gold cores.
Add the ability to move IRQs to gold cores when the cpus
hotplug in.

Change-Id: I4cfecd02a1a2200dc99adee9a324b90c877c13fd
CRs-Fixed: 2638820
2020-04-09 05:21:20 -07:00
Naman Padhiar
87be18b922 qcacmn: Use to wakeup_source_register from 4.19.110 kernels
As part of new kernels it is suggested to move to the upstreamed
wakelock apis for registration and unregistration.

Change-Id: I80b8dd85c6ad1b50951fff9da810e8e96a402752
CRs-Fixed: 2658888
2020-04-08 08:19:22 -07:00
sumedh baikady
a8f35820f4 qcacmn: Change minidump API name
Change the following minidump API names:
1. fill_minidump_segments -> minidump_fill_segments
2. remove_minidump_segments -> minidump_remove_segments

Change-Id: I7340a09cc7d82f8470ecfc0b7b4532107a25aa54
2020-04-07 06:17:18 -07:00
Jingxiang Ge
e7d41574f3 qcacmn: Add dbgid for each runtime put/get
This is to enhance statics for runtime put/get, which is
to detect if there is mismatch for usage_count.

Change-Id: I24cddb9d10e4cb675c8375cbd0f589c7718bd680
CRs-Fixed: 2647972
2020-04-07 01:20:41 -07:00
Arun Kumar Khandavalli
48063f9d05 qcacmn: Move to Use wakeup_source_register from 4.19 kernels
As part of new kernels it is suggested to move to the upstreamed
wakelock apis for registration and unregistration.

Change-Id: Icc2bdeb6201fc65d351f75c5b49968fd23e2bba8
CRs-Fixed: 2639311
2020-04-02 22:16:57 -07:00
Arun Kumar Khandavalli
cf6efc2a39 qcacmn: Add the notifier chain infrastructure
Notifier chains are simple function list executed when an event
occurs. In qdf block and atomic notifier chains are defined.
Blocking notifier chains can be used to invoke a list of functions
based on event in a process context wherein atomic notifier chain
can be used in an interrupt context.

Change-Id: I9020b9f19915e084b017932fb6d0bfad792d745c
CRs-Fixed: 2648224
2020-03-31 11:38:44 -07:00
Ashish Kumar Dhanotiya
18d4b6fe84 qcacmn: Update the mc timer state after its deleted
Currently qdf mc timer stop api updates mc timer state
to QDF_TIMER_STATE_STOPPED before it deletes the timer which
may lead to race condition where if any other thread tries to
read the state of the timer and re-start the timer considering
it is stopped which may get deleted after that.

To address above issue, update the timer state after timer
delete.

Change-Id: I302b89bdedf23f8277eacb6d42b5bd8e6daa4d05
CRs-Fixed: 2643254
2020-03-27 06:29:16 -07:00
Yeshwanth Sriram Guntuka
4326a54376 qcacmn: Add qdf API to check for configured packet types
Add qdf API support to check if the packet should be
tracked as per the configured protocol types.

Change-Id: Ia9e937865d3d440f1350307a67e32b20ea218e54
CRs-Fixed: 2642156
2020-03-27 01:21:14 -07:00
Lihua Liu
286b038d12 qcacmn: Add workaround for TXDMA HW limitation
Per HW team's analysis, we find a TXDMA HW limitation:
ADDR0&0x1FFFFFFF8 should not equal ADDR1&0x1FFFFFFF8.
Otherwise, TXDMA will run into exception, which cause TX fail.
ADDR0: the address of last words in previous buffer;
ADDR1: the address of first words in next buffer;

We hit this limitation in NAT forward TSO jumbo case whose buffer
address of two fragments like below:
tso_frags = (
(length = 0x42, vaddr = 0xFFFFFFD0F5FA2F82, paddr = 0x1F5FA2F82),
(length = 0x05A8, vaddr = 0xFFFFFFD0F5FA2FC4, paddr = 0x1F5FA2FC4)
In this case, ADDR0 = 0x1F5FA2F82 + 0x42 -2 = 0x1F5FA2FC2,
ADDR1 = 0x1F5FA2FC4, then
ADDR0&0x1FFFFFFF8 = ADDR1&0x1FFFFFFF8.
To avoid this, shift server bytes for ADDR0.

Change-Id: Ib09afd7e4c14a33bb5347c68b602b360a9e36619
CRs-Fixed: 2585868
2020-03-24 10:25:14 -07:00
Wu Gao
51bac7676d qcacmn: Add stream file system support
Stream file system is wrapper for Relayfs - a Linux specific feature,
which provides efficient method to indicate data to user space. It
depends on qdf debugfs APIs. This feature is protected with
compilation flags WLAN_STREAMFS and WLAN_DEBUGFS.

Change-Id: I1401112ece290e6d0560623cf10faaf498ebb1b7
CRs-Fixed: 2635481
2020-03-21 03:55:27 -07:00
Alan Chen
23af24db1f qcacmn: Add null check in qdf_runtime_lock_deinit()
qdf_runtime_lock_deinit() is currently using the lock blindly without
checking if it is null. Add a null check to prevent it from using a
null pointer.

Change-Id: I3aa13c436f3668de7b1070c2c40bc69c7a4cc9fc
CRs-Fixed: 2642914
2020-03-20 06:03:08 -07:00
Manjunathappa Prakash
c2fc9f7ba9 qcacmn: Remove unused dma-iommu.h inclusion
asm/dma-iommu.h file is removed in latest 5.4 kernel,
resulting in include failure. Remove as it is unused.

Change-Id: I9eac7bee5a9a8d5da21d15c2f7d8f3fc4fbe00df
CRs-Fixed: 2638583
2020-03-18 23:53:41 -07:00
Sravan Goud
e7eff14c56 qcacmn: Reduce excessive qdf update radiotap logs
For monitor mode update radiotap he flags logs are
flooding the driver logs as update of radio tap header
is done for each msdu. So rate limit the logs to reduce
excessive logging.

Change-Id: Ica75ccf98afc069b80fe6c75b3d9b04815c82ced
CRs-Fixed: 2644241
2020-03-18 23:53:12 -07:00