Commit Graph

663 Commits

Author SHA1 Message Date
Liangwei Dong
bdd5fcef82 qcacmn: Clear lock->lock.dev to NULL after wake lock destroyed
In kernel 5.4, Wake lock API wakeup_source_register requires
"struct device *" parameter, and it can be NULL value. If it is
NULL, the wakeup_source_register will create a "device" node and return
it by wakeup_source struct.
In qcacld driver, the qdf_wake_lock_create will save the "wakeup_source"
to cld's private struct qdf_wake_lock->lock.
When the cld driver destroy os wake lock by wakeup_source_unregister,
"dev" will also be invalid in kernel, we need to clear the "dev"
field in local copy of wakeup_source in qdf_wake_lock->lock.
This will fix the potential reuse of qdf_wake_lock->lock.dev after it has
been destroyed.

Change-Id: I1de6e95c64b35929bef8be2cdeeb86422bc38515
CRs-Fixed: 2634032
2020-03-04 11:17:25 -08:00
Mohit Khanna
e05c287f31 qcacmn: Add high priority ordered workqueue APIs
Add APIs to support creation of a high priority, ordered, unbound
workqueue.

Change-Id: Ib7e39a7ca3fcc9ee1ed8886ca62c312a3e3e46a2
CRs-Fixed: 2602029
2020-03-02 17:46:21 -08:00
Ankit Kumar
7e0bf6da72 qcacmn: Corrects function scope typo in function definition
This patch corrects function scope typo in function definition.

Change-Id: I51abda732173a26751fcc68a125cdd04367d0e87
CRs-Fixed: 2620147
2020-03-01 02:07:04 -08:00
Vulupala Shashank Reddy
616976e2ce qcacmn: Add support to include ACK status and tx retry count
Extend radiotap header to append ACK status and tx retry count
for packets sent to virtual mon interface.

Change-Id: I51037ffd11dfdee49278d43643fb7861a514ee18
CRs-Fixed: 2627710
2020-02-26 22:39:17 -08:00
Manjunathappa Prakash
c4667b8b12 qcacmn: Save Rx TLV offset info so as to recover in FISA
Packets delivered to FISA via exception err path doesnot have TLVs.
FISA handling requires additional TLVs. dp rx core handling
skips TLVs, save TLV length info in nbuf->cb so that TLVs
are recovered back in FISA.

Change-Id: I53fab2e19abcbf82697ea6f53a4ddf3ea0dd0699
CRs-Fixed: 2620844
2020-02-20 06:39:48 -08:00
Nisha Menon
3e5b005e4e qcacmn: Break up DMA mem alloc for HW desc banks in multi pages
Break up the 2MB descriptor bank memory allocations for WBM
idle link ring. Use multiple page allocation and populate the
WBM idle link descriptor ring with physical addresses of each
DMA page allocated in the descriptor bank.
This is to ensure that no requests for contiguous memory
allocations are made that might result in allocation failures.

For MCL set the page size to 4KB and leave it to max_alloc_size
cfg ini param for WIN specific code.

Change-Id: Iec30321044827c0174366cc02df25a42d38309e0
CRs-Fixed: 2565817
2020-02-18 16:38:43 -08:00
Linux Build Service Account
67ef957780 Merge "qcacmn: Rename cmd ring to cmd_credit ring" 2020-02-15 11:08:15 -08:00
Chaoli Zhou
1047ea9c6b qcacmn: Support get is_over_gsi from IPA driver
For Genoa, it use IPA GSI, and whether gsi enabled
or not decided by ipa dts setting, which should get
from IPA driver, so add such information.

Change-Id: I6321afaf35c57d7d5865b896193ab1d44042ee4c
2020-02-13 23:39:00 -08:00
Sourav Mohapatra
e8a1cf3c70 qcacmn: Reduce unnecessary logs in various QDF modules
Various QDF logs being printed to the driver log are not necessary for
debugging purposes.

Cleanup the logs that are not required.

Change-Id: I9c5685b4d31a741703667943ac458921fa0d480e
CRs-Fixed: 2616210
2020-02-13 11:39:22 -08:00
Linux Build Service Account
8f7b57c903 Merge "qcacmn: Add dcs component" 2020-02-13 07:38:30 -08:00
hqu
fed4bfb049 qcacmn: Add dcs component
Add dcs component to implement interference detection algorithm
and dynamic channel selection frequency control.

Change-Id: Ia201d77e77feb9de3aff03d6e389d4891dde118e
CRs-Fixed: 2594837
2020-02-13 04:12:30 -08:00
Alan Chen
4631007d0c qcacmn: QDF wake lock API changes to support various kernel versions
Kernel 5.4+ is returning created wake lock pointer which needs to be
stored in driver wakelock structure, which needs to be used in
acquire, release, and destroy APIs. This change updates the QDF wake
lock structure accordingly to handle both older and new kernels.

Change-Id: Id0c5279613fa4c4c84205905fef7557c6b852017
CRs-Fixed: 2615065
2020-02-11 12:40:59 -08:00
Shwetha G K
ffaff47f6d qcacmn: Do not update nbuf_count when mem debug disabled runtime
Don not update nbuf_count when mem debug disabled runtime

Change-Id: Ib9c09210e5b91fd1db160444c0e3e2e315e12853
CRs-Fixed: 2618970
2020-02-11 11:05:30 -08:00
Adil Saeed Musthafa
ab1127c636 qcacmn: export __qdf_nbuf_data_is_icmp_pkt to outside QDF
Export __qdf_nbuf_data_is_icmp_pkt to outside QDF. This is needed for
implementing the per-peer protocol counters

Change-Id: I40db2b95347e95f2a5a7dbf6650fa873f564f1c3
CRs-Fixed: 2604877
2020-02-04 14:16:55 -08:00
Aniruddha Paul
fe67c34963 qcacmn: Add debug module ID for Monitor Filter
Add the new debug module ID for the monitor filter.

Change-Id: I35edbfe908c2133a3a0a37cb1e7a7b4eec82774f
2020-02-03 04:22:49 -08:00
Abhiram Jogadenu
9ca3392a13 qcacmn: Correct the boundaries for qdf_dbg_mask
QDF_TRACE_LEVEL_NONE(= 0) is a valid value for qdf_dbg_mask,
which is currently being treated as error. Correct the
condition with this change

Change-Id: Id8ddebc4774ccf721ce7ff14b035f287b3a4b5ee
CRs-Fixed: 2587010
2020-02-02 16:40:01 -08:00
Vulupala Shashank Reddy
3b6d1f238e qcacmn: Add packet capture component support param
Add module id, component id for packet capture feature.

Change-Id: I576cd288dbe325c1b2b19f095482ca317c3112a1
CRs-Fixed: 2611061
2020-02-01 03:16:30 -08:00
Nandha Kishore Easwaran
b7c18849ae qcacmn: Replace 8074_VP with WIFI_EMULATION_3_0
Replace QCA_WIFI_QCA8074_VP with CONFIG_WIFI_EMULATION_WIFI_3_0
since VP platform is not being used anymore.
Most of the parameters present inside QCA_WIFI_QCA8074_VP are related
to emulation timeouts. Hence replacing it with a more meaningful flag.

Change-Id: I22a0e5803e765333947f1613b376dcc6bd25b5af
2020-01-31 02:34:19 -08:00
Yeshwanth Sriram Guntuka
70ea6afc3f qcacmn: Add qdf APIs to support data pkt diag logging
Add support to send protocol data packet info via diag log
command to userspace at tx entry point, on receiving tx
completion indication and in rx path, before delivering the
packet to network stack.

Change-Id: I6a95a16b7ebedf505ecb501107b1bbb89b16b67d
CRs-Fixed: 2595799
2020-01-27 07:54:57 -08:00
Uraj Sasan
acb460015b qcacmn: Compile qdf as part of single module
Adds support to include qdf as part of single module.
This is needed for WHUNT testing where we need to have
single module, one inserted as AP and one as STA.

Change-Id: I8c2aef4cc18391e92f537e2ce791bd5b58b6e764
2020-01-25 04:18:03 -08:00
Chaithanya Garrepalli
06f280e5b5 qcacmn: add QDF wrapper for qdf_atomic_inc_not_zero
Add API to increment atomic variable only when current
value is non zero

Change-Id: I3d0df35e39fb1b08b45e0731a86f002b5dbcb662
2020-01-22 09:25:48 -08:00
Shwetha G K
7b81f682b0 qcacmn: Support to not consider mem_debug_disabled mod arg
Support to not consider mem_debug_disabled mod arg

Change-Id: If58f6fbabf1b2cf3bed9da00ca920bfcb2a91a27
CRs-Fixed: 2607383
2020-01-22 02:46:17 -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
Nisha Menon
7e8f67cfca qcacmn: Update Wifi netdevs for IPA exception path NAPI
Starting Kernel 4.19 IPA LAN RX supports NAPI polling
mechanism. Netdevs that hook into IPA need to call
netif_receive_skb() or similar to deliver the packet
to network stack instead of using netif_rx_ni().

IPA driver exports ipa_get_lan_rx_napi(void) API for
this purpose. If this API call returns true use
netif_receive_skb() or fallback on legacy api.

Add the changes under a feature flag IPA_LAN_RX_NAPI_SUPPORT
which is enabled under a linux kernel version check for 4.19
and above.

Change-Id: I449404e86e934fd6113cb71e494575e67602f678
CRs-Fixed: 2588500
2020-01-20 14:02:13 -08:00
Saket Jha
540da9a56c qcacmn: Add 6GHz Monitor Mode Support
Add monitor mode support to capture packets over 6GHz frequencies by
getting capture frequency from pdev.

Change freq type to qdf_freq_t.

Change-Id: I7b6edc43e254dc98a3c2939c369874bec9d16ddd
CRs-Fixed: 2568970
2020-01-15 11:30:21 -08:00
Rakesh Pillai
374e7c25dc qcacmn: Support IPCI bus type in QDF
Add newly added IPCI bus type support in QDF.

CRs-Fixed: 2597341
Change-Id: I476556e831d41be9ee71f8083a95d8d9da6ceb85
2020-01-15 04:44:03 -08:00
Tallapragada Kalyan
ccf5b37f7d qcacmn: re-arrange is_raw_frame bit in qdf_nbuf_cb
"qdf_nbuf_cb.u.rx.lro_eligible",
"qdf_nbuf_cb.u.rx.is_raw_frame"
bits occupy same memmory as
"qdf_nbuf_cb.u.tx.flags.bits.flag_efrag",
"qdf_nbuf_cb.u.tx.flags.bits.flag_nbuf" as it is a union
but flag_efrag and flag_nbuf are always set during
qdf_nbuf_alloc, this is resulting in is_raw_frame to be
explicitly set even when the received frame is not RAW

memory location of these fields in qdf_nbuf_cb
D:0xBCDFE0F4.0 lro_eligible = 1
D:0xBCDFE0F4.1 is_raw_frame = 1

D:0xBCDFE0F4.0 flag_efrag = 1
D:0xBCDFE0F4.1 flag_nbuf = 1

in qdf_nbuf_alloc the flag_efrag & flag_nbuf is set.
skb_alloc:
memset(skb->cb, 0x0, sizeof(skb->cb));

/*
 * * The default is for netbuf fragments to be interpreted
 * * as wordstreams rather than bytestreams.
 * */
QDF_NBUF_CB_TX_EXTRA_FRAG_WORDSTR_EFRAG(skb) = 1;
QDF_NBUF_CB_TX_EXTRA_FRAG_WORDSTR_NBUF(skb) = 1;

As discussed over email this is a temporary WAR
until a long term solution is in place.

Below is the email conversation

	This is a temporary change to unblock the present sanity issues
	There seems to be a basic issue with nbuf_alloc, with following logic

	QDF_NBUF_CB_TX_EXTRA_FRAG_WORDSTR_EFRAG(skb) = 1;
	QDF_NBUF_CB_TX_EXTRA_FRAG_WORDSTR_NBUF(skb) = 1;

	nbuf_lloc is assuming that the buffer is allocated for TX always
	and setting fields in the area of TX portion of union.
	If that skb is used for RX can lead to wrong interpretation of the RX
       	union fields, which is causing present issue.

	This got exposed with a recent change that shuffled the fields of
	RX union which made the imp fields got manipulated with this TX setting.

	We need to resolve this basic issue with wider consent and validations,
	while this fix unblocks the basic sanity issues.

Change-Id: I24a6d0faf3a874c54b4859dc027e059c693d6759
2020-01-14 15:03:43 -08:00
Linux Build Service Account
8967ce71a8 Merge "qcacmn: Unified scheduler watchdog handler implementation" 2020-01-12 19:35:58 -08:00
Vivek
bea437e229 qcacmn: Unified scheduler watchdog handler implementation
The scheduler watchdog timer handler currently either prints error or
prints error and panics based on CONFIG_SLUB_DEBUG_ON.

Considering the panic through QDF_DEBUG_PANIC is configurable and is
disabled on relevant builds, we can just have one version of the
function and depend on QDF macro for panic and dependency on
CONFIG_SLUB_DEBUG_ON is redundant

Change the default log levels from none to fatal for scheduler.

Change-Id: If588455ea2779311eb86bb39b3ab0f7fc67b6ccc
CRs-Fixed: 2593790
2020-01-12 18:58:25 -08:00
Shwetha G K
d4e0f6104e qcacmn: Provide sys entries to list down top allocations
Provide sys entries to list down top mem and dma allocations (based on
configurable threshold). This can help to check allocations at run-time
and can provide clue if some function is allocates memory continuously.

CRs-Fixed: 2589632

Change-Id: If9a6da535233fc48828f2e9fb2bdacb8153270e4
2020-01-10 16:55:58 -08:00
Shwetha G K
9be8b1fe75 qcacmn: Add support to disable the panics in memory debug
Support to disable panics in qdf memory debug. This can be used when KASAN
or SLUB or SKB debug options are enabled

CRs-Fixed: 2580399
Change-Id: If8617a16d0b96279f0afef8299632662dea498bf
2020-01-10 16:55:39 -08:00
Shwetha G K
21378e0c93 qcacmn: Support to disable the memory debug at load time
Disable the mem_debug when qdf argument mem_debug_disabled=1 is passed
through uci command "uci set wireless.qcawifi.mem_debug_disabled=1".

CRs-Fixed: 2572159
Change-Id: I6ab5e1f28ce4c58d46c7467bac3853054f4cf56c
2020-01-10 16:55:18 -08:00
Yu Wang
e7f177ac80 qcacmn: add new component id QDF_MODULE_ID_COEX
This new component COEX is added for coex related
configurations/operations.

CRs-Fixed: 2565088
Change-Id: I3faa2d18b341d91278268f52d9d7d05a1eba445f
2020-01-09 02:40:11 -08:00
aloksing
18f309c7f4 qcacmn: Add debug support for vdev/peer reference and release
Allocate node for new entry and add it to existing list of function or line
If function or line already present in list then increment count

Change-Id: I3d737dcd33862f133b52c6d694c89f6d6b1517a5
2020-01-02 05:18:15 -08:00
Chaithanya Garrepalli
52511a17d1 qcacmn: check for vdev_id mismatch to deliver NBUFs to stack
Check for vdev_id mismatch to deliver NBUFs to stack to avoid
hold peer reference while giving nbuf list to stack

Change-Id: Ic475e00d5b1793ada7b26b7af3322ca2fa51836f
2019-12-31 01:24:43 -08:00
Alan Chen
7253be1b4c qcacmn: Use save_stack_trace_tsk() to save task stack trace
qdf_print_thread_trace() currently uses stack_trace_save_tsk() to save
task stack strace into a storage array, but stack_trace_save_tsk() is
undefined because it is not exported. Switch to using
save_stack_trace_tsk() as originally was done.

Change-Id: Ie90cdd87233581718e9a40436128a92691fc9a17
CRs-Fixed: 2587454
2019-12-24 02:21:30 -08:00
Hangtian Zhu
7788a89ccd qcacmn: Fix compile issues when some features are disabled
Fix compile issues when some features are disabled, the features are:
BUILD_DEBUG_VERSION
CONFIG_CP_STATS
CONFIG_HOST_OPCLASS
CONFIG_FEATURE_ROAM_DEBUG
There are some other features depends on each other, so enabled features to
qcs40x.snoc.perf_defconfig, the features are:
CONFIG_WLAN_FEATURE_FILS
CONFIG_WMI_ROAM_SUPPORT
CONFIG_WMI_STA_SUPPORT
CONFIG_REG_CLIENT
CONFIG_WLAN_FEATURE_DP_BUS_BANDWIDTH
CONFIG_WMI_CONCURRENCY_SUPPORT
CONFIG_LL_DP_SUPPORT

Change-Id: I6fa1eacb79576a955e593dbb9ac52083742275e3
CRs-Fixed: 2584839
2019-12-18 23:55:00 -08:00
Nirav Shah
8f44a7e494 qcacmn: Add credit tracking for HL Data Path
Add credit tracking for HL Data Path in DPTRACE.

Change-Id: I6e2971209940c16a13a8ca7f1f0a3d7c1a26e305
CRs-Fixed: 2574057
2019-12-13 07:04:10 -08:00
Rajeev Kumar
ff153cc83d qcacmn: Add kernel version check for set_wake_up_idle
set_wake_up_idle together with PF_WAKE_UP_IDLE is removed from
kernel 5.4 and hence kernel version check to avoid compilation
issues with 5.4 kernel.

Change-Id: If44e275eed1d639d90fc7fb4c93a5a2386ffba15
CRs-Fixed: 2580955
2019-12-09 15:58:54 -08:00
Pragaspathi Thilagaraj
4715adc0f1 qcacmn: Fix zero size malloc when memory debug is disabled
In SLUB disabled builds, the qdf_mem_malloc calls the
qdf_mem_malloc_fl function which doesn't
validate if the size provided is 0 and returns the value
ZERO_SIZE_PTR(((void *)16)) for the pointer. When this pointer
is dereferenced, it causes invalid address dereference.

Validate if the size parameter provided to qdf_mem_malloc is
0 or greater than QDF_MEM_MAX_MALLOC. Return failure if the
validation fails.

Change-Id: I8fc6bc796847e9dd3dfd5186b0386d323560d0cf
CRs-Fixed: 2571505
2019-12-09 05:20:25 -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
Alan Chen
0a26d8d2c1 qcacmn: Add conditional macros for creating/destroying wakelocks
Kernel 5.4 and 5.1 have removed the functions wakeup_source_init()
and wakeup_source_trash() respectively. Add conditional preprocessor
directives to use wakeup_source_register() and wakeup_source_unregister()
for Kernels 5.4 and 5.1 respectively.

Change-Id: I05597eb54b2988f7bc203b53427e17980a7473f9
CRs-Fixed: 2559016
2019-12-01 19:17:25 -08:00
Linux Build Service Account
a42e04b272 Merge "qcacmn: Add conditional macros for tasklet_hrtimer struct" 2019-11-29 07:07:27 -08:00
Karunakar Dasineni
8e25a3077a qcacmn: Add qdf API to find last set bit
Add qdf wrapper for Linux fls() to find last set bit.

Change-Id: I089fee397d619515c768521bda1f4d4c35526fe0
2019-11-27 09:15:30 -08:00
Karunakar Dasineni
91da9dce36 qcacmn: QDF API for skb_copy_expand
Add QDF wrappers for skb_copy_expand

Change-Id: I401241259c87a067ed4773bee9fdfc7ee3cdcc23
2019-11-27 09:15:15 -08:00
Alan Chen
337cb1cb88 qcacmn: Create set_desc_flags() to set desc->flags conditionally
Kernel 5.2 onward has removed the flags variable from the shash_desc
struct. Create a new function set_desc_flags() to set the desc->flags
variable conditionally for kernel versions older than 5.2.

Change-Id: I2c9b9b00147beff8600fbc9149594c11bb403a66
CRs-Fixed: 2559017
2019-11-26 05:31:02 -08:00
Alan Chen
2a25844f08 qcacmn: Add conditional macro for tracing threads
Kernel 5.2 has removed the stack_trace struct and replaced
print_stack_trace() and save_stack_trace_tsk() with stack_trace_print()
and stack_trace_save_tsk() respectively. Add a conditional preprocessor
directive to use save_trace_print() and stack_trace_save_tsk() and call
them with the appropriate updated parameters.

Change-Id: I99643e1b93251de7453f511d13f5a4a39c56f99c
CRs-Fixed: 2559033
2019-11-26 05:30:56 -08:00
Nandha Kishore Easwaran
bcf953583a qcacmn: Use multi window write and read for pine
Write into hal register using three floating windows instead of one.
This change is done to avoid frequent window changes for writing into
DP and CE registers. Instead 3 windows are used. One window is statically
mapped to CE block and another window is mapped statically to DP block.
Due to this design there is no need to change the window register to
write into these blocks and write can be done on corresponding window
with single iowrite32. Similar loginc is used for ioread32.

Also modified the hp_addr and tp_addr in initialisation stage so that
hal_write will not have multiple if checks.

Change-Id: Ibb99ec4da7f63323082e46a28afbe90e1f555545
CRs-fixed: 2507441
2019-11-26 02:15:26 -08:00
Alan Chen
4f3f01b122 qcacmn: Replace skb_frag_struct pointer with skb_frag_t
skb_frag_t typedef was modified in kernel version 5.4. Change code to
use the typedef rather than the underlying type so that the same code
will be built on both 5.4 and pre-5.4 kernels.

Change-Id: Id491ab5edf0dec7cd09426d6c6b0a607ff66b66f
CRs-Fixed: 2559037
2019-11-25 16:15:31 -08:00
Alan Chen
4b73a35f26 qcacmn: Add conditional macros for tasklet_hrtimer struct
Kernel 5.2 onwards no longer uses the tasklet_hrtimer struct. Add
conditional preprocessor directives to only use hrtimer structs for all
functions that use the tasklet_hrtimer struct for Kernel 5.2 onwards.

Change-Id: Ib691022de5c751ee88da78c081740dc1df923926
CRs-Fixed: 2558916
2019-11-25 14:34:04 -08:00