Commit Graph

827 Commits

Author SHA1 Message Date
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
Yeshwanth Sriram Guntuka
06c7cbb878 qcacmn: Modify pkt string for logging to console
Modify the qdf_get_pkt_type_string API to return
the packet type in case the packet does not fall
under the tracked packet subtypes and also increase
the rate limit values for EAPOL and DHCP packets.

Change-Id: Ie9681be64572346a09529043ef38dd57338700bb
CRs-Fixed: 2636540
2020-03-09 03:12:01 -07:00
nobelj
7b76263659 qcacmn: QDF API for skb_clone_fraglist along with copy expand
Add API wrapper function for skb_clone_fraglist along
with skb_copy_expand.

Change-Id: Ib03e16566368d75a7a547fea6fd863e6411f98ef
2020-03-08 00:05:27 -08:00
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