Commit Graph

805 Commits

Author SHA1 Message Date
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
Nisha Menon
4d77312b6d qcacmn: Check if FW or host in recovery before invoking assert
Force wake request is sent before register write. If this req
fails check if FW is down or host is in recovery before
asserting.

Change-Id: I6d31b1f95b68ae4e462f59ed32ed933de55cacae
CRs-Fixed: 2601364
2020-01-17 07:28: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
Srinivas Dasari
5567f874e7 qcacmn: Define QDF_MAX_CONCURRENCY_PERSONA based on WLAN_MAX_VDEVS
Currently, QDF_MAX_CONCURRENCY_PERSONA allows a maximum of 4
MAC addresses to be assigned to different interfaces. NAN
discovery interface is a new interface and it needs a MAC address
to be assigned. QDF_MAX_CONCURRENCY_PERSONA needs to be increased
to 5 to provide the same.
WLAN_MAX_VDEVS defined in Kbuild already takes care of the
maximum no.of vdevs(6) supported. QDF_MAX_CONCURRENCY_PERSONA can
be made dependent of WLAN_MAX_VDEVS which caters the same purpose.
Define QDF_MAX_CONCURRENCY_PERSONA accordingly.

Change-Id: If5085703ab9c0cc70ce4fc0d20bedc20f382b4bd
CRs-Fixed: 2592018
2020-01-02 03:48:16 -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
Mohit Khanna
63055510e0 qcacmn: Add IEEE 802.11 control frame type/subtypes
Add 802.11 CTRL frame type and subtype subfields.

Change-Id: I2105d0ee52cf948f79b6614a063238312443fa6d
CRs-Fixed: 2580876
2019-12-16 14:19:57 -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
Alok Kumar
3d15ae8780 qcacmn: Define CDP Ops for packet capture mode
Define CDP Ops for packet capture mode

Change-Id: If08191f47060210f4340940d01be8eb2cf8cc426
CRs-Fixed: 2528432
2019-12-09 17:29:15 -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
Abhijit Pradhan
a305445a5f qcacmn: Control the size of the freq and chan_num (QDF)
Depending on the requirement, a bigger size or a smaller size for
the frequency variable can be chosen. The advantages of each size
are described below:

Advantage of a bigger size:
When two technologies (e.g. 802.11AX and 802.11AD) are controlled
by the same driver software, the frequency range may be very large
and a bigger size (e.g. 32bit integer) is more appropriate.

Advantage of a smaller size:
When the frequency range is not very large, a smaller size
(e.g. 16bit integer) can be used. It saves a large amount of space
especially when many large arrays containing elements of this
type/size are defined in the driver.

Change-Id: I6c8fb2a4dc117e2535ef96009362923557cee398
CRs-Fixed: 2570456
2019-12-09 05:20:43 -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
Kai Chen
a8cf59455e qcacmn: Add stats on OFDMA and MU-MIMO packet
Add MCS, NSS, MPDU FCS OK, MPDU FCS ERR stats
classified by SU, OFDMA and MU-MIMO.

Change-Id: I3ade03acc06bd924fdeb8dfcaf6b18fb01f01d68
2019-12-01 19:16:58 -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
Alan Chen
76036f10e7 qcacmn: Add conditional macro for arch_counter_get_cntvct()
Kernel 5.2 onwards calls __arch_counter_get_cntvct() instead of
arch_counter_get_cntvct(). Add conditional preprocessor directive to
use the appropriate function call for the correct kernel version.

Change-Id: I86041fdfd36f0c4522397f632910cdaa26780035
CRs-Fixed: 2558917
2019-11-24 22:35:21 -08:00
Alan Chen
1e9c5f488d qcacmn: Replace get_monotonic_boottime() with ktime_get_boottime()
get_monotonic_boottime() and similar functions have been replaced with
ktime_get_boottime() in newer driver versions. Change the calls to
get_monotonic_boottime() in the qdf wrapper to ktime_get_boottime().

Change-Id: I066ffbbcb3a51f8a080fd445397be028ee73ab2e
CRs-Fixed: 2558910
2019-11-24 22:35:16 -08:00
Jinwei Chen
08de3a02e5 qcacmn: add debugging code to detect duplicated hash_node
One hash_node is still left in hash bucket list while the memory
has been freed by normal operation, suspect that maybe two same
hash_node is existed in hash bucket list before, add debugging code
to detect this problem earlier.

Change-Id: I1497ae29c0e09e35dc140c7c37e228e02eb000e4
CRs-Fixed: 2562952
2019-11-18 20:00:15 -08:00
Shiva Krishna Pittala
5c0f59fd3c qcacmn: Route variable argument list logs through QDF
Currently, the variable argument list messages are going through vprintk.
As a result, these messages are appearing only on dmesg, but not on any
external logger. Use QDF logging functions instead to fix this.

CRs-Fixed: 2561051
Change-Id: I9cfc6aaa7b81de4945f7cfd5f7cd15540c3fc1f2
2019-11-14 00:55:16 -08:00
Tiger Yu
987de79182 qcacmn: Wake up system for early interrupt wakeup during suspending
During system suspending, the target might request wakeup early to the
host. The host will wakeup the system directly to abort current suspend
to avoid mismatching PM state between host & target.

Change-Id: Icf6e58ff24cbe072ef56aa22820432efb2ca1932
CRs-Fixed: 2559306
2019-11-13 06:53:29 -08:00
Vivek
72924111f9 qcacmn: Add include path for common queue.h file
Two copies of the same queue.h was used in WIN and MCL
and each had its own copy, so the file is now moved to
common code and and both WIN/MCL can use the same file.

Updated the Kbuild to include the new path where queue.h is
available

Change-Id: I9f362173c7ae05d1613629787a5f3be61879efbe
CRs-Fixed: 2545115
2019-11-05 02:13:02 -08:00
Ashish Kumar Dhanotiya
84ac2013af qcacmn: Add queue.h file
Currently MCL and WIN both have there separate queue.h
files with the same declarations and definitions.
As part of cleanup create single queue.h in common
code and update the usage of existing queue.h to this
newly added queue.h.

Change-Id: Ie381c3553d6361cf7f8c97f14a91ed24e332b51a
CRs-fixed: 2505617
2019-11-05 02:12:54 -08:00
Rakesh Pillai
534a143d8f qcacmn: Add support to flush rx packets for a vdev
When a particular vdev is deleted, the corresponding rx
packets which have been queued to the rx thread are not
flushed. Hence when such packets are submitted to the
network stack, the dev for this skb will be invalid,
since we have already freed the adapter.

Flush out the packets in the rx thread queues, before
deleting the vdev.

CRs-Fixed: 2543392
Change-Id: I2490d0f5ce965f62152613a17a59232521ca058f
2019-11-01 00:18:13 -07:00
Alan Chen
ddcff963a2 qcacmn: Replace panic by QDF_DEBUG_PANIC
Replace panic by QDF_DEBUG_PANIC because if PANIC_ON_BUG is compiled out,
we do not want to panic the system.

Change-Id: Idae89d6881ed5543273b047a0b77bc3ae55132b5
CRs-Fixed: 2545292
2019-10-28 18:03:08 -07:00
Venkata Sharath Chandra Manchala
8a4812f7fc qcacmn: Enable TSO Stats for Lithium based products
Add support to account for TSO jumbo packets on the
Tx path and print the statistics using dumpStats 3.

Change-Id: I6cc446df5c84e3ac436d922935fcd559e0704ec5
CRs-Fixed: 2356244
2019-10-28 07:11:53 -07:00
Chaithanya Garrepalli
45ecf4361c qcacmn: Fix false alarm of double nbuf allocation
In qdf_nbuf_unshare do not add new debug record when
allocation fails

Change-Id: Icece871a9e75af19841cf6824f286735660b09e3
2019-10-23 10:32:38 -07:00
Alan Chen
0fdc03e41e qcacmn: Log timer callback info
If qdf timer is already running and a module calls it again, log the
timer callback info to see why that module is calling it again.

Change-Id: I47e9d33a2a144a0a779f71b50dbabea227c4b362
CRs-Fixed: 2546070
2019-10-22 20:17:32 -07:00
Sourav Mohapatra
20bc724ca1 qcacmn: Add qdf wrapper for hash_for_each_safe
Add qdf wrapper API for hash_for_each_safe which iterates over a
hashtable safe against removal of hash entry

Change-Id: I89d8b6520a4bee583d44a771b4359ed287d0c2fa
CRs-Fixed: 2528484
2019-10-15 00:49:24 -07:00
Sravan Kumar Kairam
aedfbffdfd qcacmn: Add qdf abstraction for ipa uc bw monitor
Add qdf abstraction for ipa uc bandwidth monitor for
wlan client.

Change-Id: I64718f118dd4982b060c72e2a2e7bd3e317bdb73
CRs-Fixed: 2526548
2019-10-14 05:47:45 -07:00
Sravan Kumar Kairam
3a37692ec1 qcacmn: Add qdf abstraction for ipa wdi stats api
Add qdf abstraction for ipa wlan wdi stats api.

Change-Id: If325950f7151199cf1f720ac0da05274bb307786
CRs-Fixed: 2517709
2019-10-14 05:47:41 -07:00
Saket Jha
d8d9d99f94 Revert "qcacmn: Enable EAPOL/DHCP message tracing in Wifi driver"
This reverts commit I010c9295fd6ca42a950f84f0d7a19b00d8b0c0da due to
crash caused by excessive logging.

Change-Id: I38701eb5be9a25f38e4cb5738824b635a2b0442c
CRs-Fixed: 2535471
2019-10-03 12:34:48 -07:00
Hangtian Zhu
24dab77dbe qcacmn: Add CONFIG_MULTI_IF_LOG to support multi if log
This is a propagation of qcacld-2.0 commit 98821c7dcf49d ("qcacld-2.0:
Add CONFIG_MULTI_IF_LOG to support multi if log"). Add CONFIG_MULTI_IF_LOG
to support multi if log by assigning the specific netlink protocol
when dual wlan cards are loaded.

Change-Id: I827fbd46893c47ed2d9b123bf753c06b2e115fbb
CRs-Fixed: 2525488
2019-09-20 01:06:29 -07:00