Commit Graph

805 Commits

Author SHA1 Message Date
Poddar, Siddarth
cc0933b151 qcacmn: Add delete node definition when MEMORY_DEBUG macro is undefined
Add qdf_net_buf_debug_delete_node definition
when MEMORY_DEBUG macro is undefined.

Change-Id: I9af90d44553f91a4c9e3021a8f4f4a36f622598e
CRs-Fixed: 2022420
2017-03-21 22:01:32 -07:00
Ishank Jain
949674c4cb qcacmn: Add DSCP_TID changes for Lithium
Add command to set mapid for each VAP using:
iwpriv athX s_dscp_mapid  N

Add command to change tid values in PDEV maps using:
iwpriv wifiX s_dscp_tid_map <MAP_ID> <TOS> <TID>

Change-Id: I510a40e71ecec5c453dd2dff1b13fd5ebedbe98a
CRs-Fixed: 1108452
2017-03-21 22:01:27 -07:00
Amar Singhal
1fd82c6c58 qcacmn: Regulatory component registration
Register the regulatory component with obj mgr. Regulatory
component only needs to listen to psoc level messages.

Change-Id: I3d060d66cb7bac2912afb1301ef1960f8bd9c0ef
CRs-Fixed: 2002892
2017-03-20 18:01:45 -07:00
Poddar, Siddarth
9a562cb5bc qcacmn: Add NULL check for dma address before calling unmap
Add NULL check for dma address of buffer before calling unmap.

Change-Id: Id10a767d97fc1328b6d42e804f5a3e8639ff8fbf
CRs-Fixed: 2021902
2017-03-20 07:47:38 -07:00
Poddar, Siddarth
01c4031969 qcacmn: Add a flag in skb->cb for packet tracking
When a packet is generated internally, host adds a debug
node entry to the table and deletes the entry once received
tx completion for that packet by calling qdf_nbuf_free.
But when a packet is coming from network stack, host doesn’t
add any debug entry to the table and on receiving tx completion,
it calls qdf_nbuf_tx_free which will simply free the skb.

In case of P2P GO mode where packets are forwarded internally,
host creates a private copy of skb and add debug node entry in
the table. But when receiving a tx completion for the same packet
host calls qdf_nbuf_tx_free which will free the skb but will not
remove this node entry from the table. Currently, this api is common
for all data tx completion packets.

Add an extra flag in control block to differentiate whether skb is
generated by driver or come from network stack. If flag is true,
that means generated internally and need to remove the entry from
debug node table.

Change-Id: I61a76fdfedf0429e1b972824dc4513065d53033f
CRs-Fixed: 2020947
2017-03-20 02:47:38 -07:00
Tushnim Bhattacharyya
e4449d3d01 qcacmn: Enable Policy Manager logging
Enable policy manager logging from host common.

Change-Id: I43d864f17b4b5f11e4cc7ff03c8af5bbd358a056
CRs-Fixed: 2009818
2017-03-17 14:09:31 -07:00
Dustin Brown
e59d03a76b qcacmn: Fix preallocation perf build compilation error
A compilation error occurs if MEMORY_DEBUG is not enabled. Fix this
issue by moving the definition of qdf_mem_prealloc_put and
qdf_mem_prealloc_get outside of the MEMORY_DEBUG region.

Change-Id: I17b4ae2cd65658e961bf7aa37518635bb94b5a95
CRs-Fixed: 2017447
2017-03-14 13:46:30 -07:00
Dustin Brown
747001c110 qcacmn: Remove CONFIG_CNSS ifdef for memory proallocatation
Memory preallocation is hidden behind two flags, CONFIG_CNSS and
CONFIG_WCNSS_MEM_PRE_ALLOC. Remove the check for CONFIG_CNSS, as the
presence of CONFIG_WCNSS_MEM_PRE_ALLOC is enough.

Change-Id: I233f6f31065c2d1da1ffb25a5013a17ac0b99246
CRs-Fixed: 2016844
2017-03-14 13:46:29 -07:00
Dhanashri Atre
1404917b6e qcacmn: Add support for hash based rx steering
This change includes:
- Adding the hooks to send LRO and hash configuration to the firmware
- Configuring the REO remap registers

Change-Id: I6d83e2a2365647f2c7a6440bd1d4b42fa7df7eff
CRs-Fixed: 1094775
2017-03-13 14:01:49 -07:00
Vijay Pamidipati
8648df62f7 qcacmn: Add new get_tso_num_seg API with address range check
Add new get_tso_num_seg API with specific address range checks
needed for QCA8074 emulation platform.

Change-Id: I00dcfa51cd8bf8b6167c68a18a2c0a1aa7661679
CRs-Fixed: 2004658
2017-03-10 09:43:55 -08:00
Tallapragada Kalyan
67ad342abe qcacmn: Add RX TLV debug prints in error path
print complete RX TLVs in human readable format
when ever we encounter an error in RX path

Change-Id: I054556fd599db75b94eadb7647f4cd589cbfb700
CRs-Fixed: 2003183
2017-03-06 04:20:06 -08:00
Yingying Tang
75b776a7cf qcacmn: Fix unknown symbol error when FEATURE_TSO is disabled
__qdf_nbuf_get_tso_num_seg is defined under FEATURE_TSO but declared in header
file without FEATURE_TSO. Compilation can be successful when FEATURE_TSO is
disabled but there is unknown symbol error in driver loading.
Add fix to resolve this issue.

Change-Id: Ie01875405d65a0f43221cbfd42940747de0df916
CRs-Fixed: 2007179
2017-03-02 19:58:50 -08:00
Tushnim Bhattacharyya
7cea3414ec qcacmn: Add ID for config component
Add config ID for object manager registration & logging

Change-Id: Ic0d6e443ff9bda385b88c52ed075ef84bfd46888
CRs-Fixed: 2003447
2017-02-27 22:08:55 -08:00
Adil Saeed Musthafa
bcf62ed43e qcacmn: Initialize utils/logging module from QDF
When LOGGING_UTILS_SUPPORT is turned on, initialize utils/logging
module

Change-Id: I07421ab8979e6f58133ba7b386b9772707be5930
CRs-Fixed: 2010251
2017-02-23 20:15:24 -08:00
Tushnim Bhattacharyya
fbce077792 qcacmn: Add ID for policy manager component
Add policy manager ID for object manager registration & logging

Change-Id: I5d665352598d84218522bf1d8a44538e4cad0368
CRs-Fixed: 2009818
2017-02-23 15:04:01 -08:00
Kalyan Tallapragada
277f45e2b1 qcacmn: Add support to handle RAW packets in RX path
API to handle pkts received on vdev which has RAW mode
enabled. Currently supports only MPDU with single MSDU.

Change-Id: Ife00699646bd97c5de0021fc32db434a544058f6
CRs-Fixed: 1111781
2017-02-23 14:05:53 -08:00
Himanshu Agarwal
846cf37306 qcacmn: Do IPA version based DMA coherent mask setting
In case of IPA hw version less than 3.0, only 32 bit DMA
address can be handled as it is only 32 bit compliant.
Because of this, setting DMA coherent mask of 37 when
IPA hw version is less than 3.0, crash is happening.

Do IPA version based DMA coherent mask setting such that
when IPA hw version is less than 3.0, set DMA coherent mask
as 32 only.

Change-Id: I8dec7da47766985ab0590f885b29f345f153cd08
CRs-Fixed: 1114605
2017-02-23 07:29:54 -08:00
Naveen Rawat
1cbd823f1b qcacmn: Send beacon frame in wmi_roam_invoke_cmd
Send beacon frame in wmi_roam_invoke_cmd to firmware
This helps firmware skip scan to connect to requested
BSSID.

Change-Id: I5c6e375309dcb3bdd6430a3d501bade5cfe2e88d
CRs-Fixed: 1116901
2017-02-22 17:46:18 -08:00
Krunal Soni
8a583437e7 qcacmn: Fix bugs in serialization module reported by reviewer
Few issues are observed and reported in serialization module, fix
them.

Change-Id: I11929f086a5f7ef227b8b8fa62d0cf8c1b5f0b9c
CRs-Fixed: 2000032
2017-02-18 18:55:11 -08:00
Wu Gao
f482dea2a7 qcacmn: Initialization of P2P component
Defines main APIs and data structures. Initial basic frame work of
P2P component.

Change-Id: I08d2e2cec734ddc535d88996f7d5ece5ef3d270a
CRs-Fixed: 1099441
2017-02-17 17:34:25 -08:00
Mukul Sharma
d8fd144d95 qcacmn: Add PMO qdf and component module ID
Add PMO qdf and component module ID's.

Change-Id: Icbd5ea96a4164dce600d5382b3bce0d38babd201
CRs-Fixed: 1115147
2017-02-14 02:53:58 -08:00
Himanshu Agarwal
2388a52210 qcacmn: Add msdu index for tso stats in msdu info
Add msdu index for tso stats in msdu info.

Change-Id: I37413ab7ccf6bd5171815af0038401925aa7831b
CRs-Fixed: 1114150
2017-02-14 00:22:21 -08:00
Himanshu Agarwal
19d5fabddc qcacmn: Allocate memory tracking node for nbuf clone and copy
When nbuf is cloned or copied, memory tracking node is not being
created as of current implementation. While freeing the nbuf,
qdf_nbuf_free API is being called as many times as the number
of copies or clones of nbuf and as memory tracking node is being
created only once, warning print of double free is coming for all
the clones and copies of nbuf.

Allocate memory tracking node for nbuf clone and nbuf copy APIs as well.

Change-Id: I95fa6e7b2789dd97c0c500d0854210240feaac17
CRs-Fixed: 1114632
2017-02-09 13:46:39 -08:00
Abhishek Singh
ff2328f3a0 qcacmn: API to insert node before/after a node in qdf list
Currently there is no support to insert a node in between
the qdf list.

This change adds API to insert a new node before/after node
in qdf list.

Change-Id: I91ad5d57ffb5d15abdd5faa36387198608369b12
CRs-Fixed: 1117206
2017-02-08 02:20:21 -08:00
Abhishek Singh
f71721f8ae qcacmn: In qdf malloc use GFP_ATOMIC if in_atomic is set
Currently GFP_KERNEL flag is used to get memory in qdf malloc
even if in_atomic is set.

So in qdf malloc use GFP_ATOMIC if in_atomic is set.

Change-Id: I1992ab4f6c868fcc18285c5cca9c9997433936bf
CRs-Fixed: 1117206
2017-02-08 02:20:19 -08:00
Ashish Kumar Dhanotiya
d199fcb394 qcacmn: Add the modules names for qdf debug framwork
Some modules are added and are not present in the category name array.

Add the names of the new modules in the qdf category name array.

Change-Id: Ie1fe5afe8b1c7ac7e97b537297bead75ddd7811e
CRs-Fixed: 2002771
2017-02-06 20:56:35 +05:30
Vijay Pamidipati
28285a0ac7 qcacmn: Add QDF WAR for x86 to allocate consistent memory from high mem
Add a WAR to ensure consistent memory allocation is
above 0x50000000 region for x86 builds for Lithium

CRs-Fixed: 1112381
Change-Id: If9e05f9d4ba05676d66e065d663a268058f0c110
2017-02-06 02:15:04 -08:00
Vivek
315fe40bee qcacmn: Enable the scheduler based timer
Exporting the QDF timer API's required for enabling scheduler based timers.
Fixed the compilation issues when scheduler code is enabled.

Change-Id: I148bb17c361fdff101fab3711af3c0a6c4158963
CRs-Fixed: 1117366
2017-02-05 02:12:31 -08:00
Himanshu Agarwal
4f162b59fc qcacmn: Add support to dump ICMPV6 RS and RA in wow wakeup stats
Propagation from qcacld-2.0 to qcacmn.

Add support to dump information for ICMPV6 RS and RA packets in
wow wakeup stats.

Change-Id: I1a2852189664fff31e29b487d7a8c66ee83931c5
CRs-Fixed: 1115364
2017-02-03 23:37:17 -08:00
Himanshu Agarwal
f30a9e9314 qcacmn: Add support to dump few bytes of rx packet in DPTRACE
Propagation from qcacld-2.0 to qcacmn.

Add support to dump few bytes of rx packets in DPTRACE by adding
QDF_DP_TRACE_HDD_RX_PACKET_RECORD in DPTRACE enum.

Change-Id: I950108b9d1c9094ce3d285493ee36bda4f9d7e41
CRs-Fixed: 1074551
2017-02-03 23:37:16 -08:00
Krunal Soni
c4e3592bbf qcacmn: Serialization Init and DeInit
Define folder and file structure for
Serialization UMAC convergence component.
Define the changes for initializing and de-initializing
the serialization component

Change-Id: I1074091a74bba8aa7426345f6fb1a5df127f1a59
CRs-Fixed: 2000032
2017-02-03 18:06:19 -08:00
Houston Hoffman
540222c531 qcacmn: Set defaults for QDF_LOCK_STATS features
Allow kbuild to enable/disable these features, but provide
defaults if the kbuild is unaware of these features.

Change-Id: Icd8054b5607749fd385f6664b8e06b31894c56c7
CRs-Fixed: 1111956
2017-01-31 18:53:10 -08:00
Houston Hoffman
8d67f466cc qcacmn: Add acquired by to lock stats
Record the last function to acquire a lock.  Improve
detectability for failure to release spinlocks.

Change-Id: I4c13dfbb2dad322c119914a325ff9edeee60fbf4
CRs-Fixed: 1111956
2017-01-31 18:53:09 -08:00
Houston Hoffman
ea5d86fe25 qcacmn: Add spinlockstats list
Keep all spinlocks on a list for offline debugging.
Also support detection of duplicate destroy calls.
Also support detection of not calling spinlock_destroy.

Change-Id: I75f520bb87c06111eabf0f610d4751e98a932c99
CRs-Fixed: 1111956
2017-01-31 18:53:08 -08:00
Houston Hoffman
805668a63d qcacmn: add stats infrastructure to trylock
Remove false positives for locks acquired with trylock.
Trylock was not recording the timestamp when the lock was
acquired. Therefore an old timestamp was used when releasing
the lock and the infrastructure would report that the lock
was held for longer than it was.

With the infrastructure set to generate a crash when a lock
is held too long, these false positives make the system unstable.

Change-Id: I87989b21daf4a2dfb74c8cfbba09be2af53dd1b2
CRs-Fixed: 1111956
2017-01-31 18:53:07 -08:00
Houston Hoffman
ee0e0bbc33 qcacmn: balance spin_lock_create (mc_timer)
Adding lock stats print upon spinlock & mutex destroy.
Without the destroy api invoked the lock stats are not printed.

Change-Id: I670bef0aeca03b61ad6d2f1ffec404b6c33f9002
CRs-Fixed: 1100505
2017-01-31 18:53:04 -08:00
Houston Hoffman
1ced412f80 qcacmn: featurize LOCK_STATS functionality
LOCK_STATS does profiling and catching of instances where
locks are held too long.  Separate out these two concerns
with separate macro flags.

Change-Id: Idb530baa23c5fcde84689bf910988da22e36123d
CRs-Fixed: 1100505
2017-01-31 15:32:48 -08:00
Houston Hoffman
b6cbf5e312 qcacmn: add stats to spinlock & mutexes
Wish to profile spinlock & mutex usage.
Bug on when spinlock is being used to protect
large regions of time.
(1mS for irq disabled, 5mS for bh disabled,
5ms for regular spinlock).

Change-Id: I95190a0d3d407a91a869f9f015e61d75e80830a7
CRs-Fixed: 1100505
2017-01-31 15:32:32 -08:00
Houston Hoffman
7dcbb86c23 qcacmn: Introduce qdf_spin_is_locked
Add a wrapper to check if a spinlock is currently
locked without acquiring it.

Change-Id: I867cfd00a61b1632e9652cdffc896b2654e3c338
CRs-Fixed: 1100505
2017-01-31 13:51:21 -08:00
Houston Hoffman
94f80a1b70 qcacmn: make qdf_print useable without qdf_trace.h (2)
qdf_trace prototype needs to be defined as well.
note: i_qdf_trace.h is still needed for qdf_print
to be used, but we have removed dependencies of
i_qdf_trace.h on other include files (so this is fine).

Change-Id: I01052d00c1619e4847de702a687554badd47882f
CRs-Fixed: 1100505
2017-01-31 13:51:17 -08:00
Houston Hoffman
125692a240 qcacmn: make qdf_print useable without qdf_trace.h
Allow qdf to print messages without including qdf_trace headers.
qdf_trace.h contents are not available in several qdf headers because
qdf_trace.h includes those headers.  By moving the log level enum
to the types.h file, qdf_print will be universally available.

Change-Id: Ia8f53ed86bdd68b79341b4526a404e5d62c91170
CRs-Fixed: 1100505
2017-01-31 13:49:51 -08:00
Houston Hoffman
14201bf72d qcacmn: support logtime conversion for qtimer
The api qdf_get_log_timestamp is the fastest way to get a
high resolution timestamp in the system, however its
scaling is not consistent.  This adds some conversion
apis for logging time differences in human readible quantities.
This also adds the reverse conversion.

Change-Id: I6c22132514c2cebb67c850260214a7f734bf8670
CRs-Fixed: 1100505
2017-01-31 13:14:50 -08:00
Sathish Kumar
febd4b7b54 qcacmn: Update QDF Debug Framework
Update QDF debug framework with API to store and to get the print index.

As a part of QDF framework convergence, we need to update the QDF framework.

Add API to handle the print index in the converged QDF framework.

Change-Id: I871c09189202d021405777db732e8821e7aaca7c
CRs-Fixed: 1108907
2017-01-31 19:33:48 +05:30
Poddar, Siddarth
d56844e3e5 qcacmn: TSO MAP-UNMAP individual segments one by one
Change the static allocation of tso common info to dynamic
allocation to use this structure later on.
Introduce one more element in tso common info structure
use to store the dma address of EIT header which can be
repeatedly use to assign to the dma address of the 0th fragment
of all the tso segments corresponding to one jumbo skb.

CRs-Fixed: 1106688
Change-Id: I572c7dcd2d29cb19b398e13e0fe7ce6f88ee1641
2017-01-26 22:27:27 -08:00
Mahesh Kumar Kalikot Veetil
66513f2083 qcacmn: Fix a compilation error on QDF mem stats
Correct a dependency between MEMORY_DEBUG and WLAN_DEBUFS. QDF memory
stats is expected to be enabled only when MEMORY_DEBUG feature is
there.

Change-Id: Id14b5ccfa532660b24087f9456f99b1d41f5420c
CRs-Fixed: 1108556
2017-01-25 18:33:02 -08:00
Mahesh Kumar Kalikot Veetil
bdcb4db461 qcacmn: Add QDF memory stats
Create debug file system entries to show current QDF memory usage.
The 'list' option adds a little overhead, which is minimized by
locking node by node while traversing the entire allocated memory
list. Major operation is lock-less, using node reference count.

Following debugfs entries are added,

	1. /sys/kernel/debug/<module_name>_qdf/mem/list
	   This lists QDF allocation by file and line number. It takes
	   some time to traverse the entire allocated list.

	2. /sys/kernel/debug/<module_name>_qdf/mem/kmalloc
	   This file shows total kmalloc done by qdf_mem_alloc().

	3. /sys/kernel/debug/<module_name>_qdf/mem/dma
	   This file shows total allocation done by qdf_mem_alloc_consistent()

Change-Id: Ie40a7cb6ee03dd58aebd0fbda0118ab06b64725a
CRs-Fixed: 1084097
2017-01-25 18:33:01 -08:00
Mahesh Kumar Kalikot Veetil
e79aee03e8 qcacmn: Add debugfs support
Create a root directory for debugfs at
/sys/kernel/debug/KBUILD_MODNAME_qdf/. The module name,
KBUILD_MODNAME, is used in the path to avoid conflict in case of
multiple instances of the same driver.

Any sub module in QDF can use this as the root directory to add
further files of directories. While unloading the driver the exit
routine does a recursive cleanup of any remaining files or
sub directories.

Even though debugfs is a Linux specific feature, a logic which is
related to file system for debugging can be added here.

This feature is protected with a compilation flag WLAN_DEBUGFS.

Change-Id: I21cae38b69f45c22121dfe70fe84f02423a26020
CRs-Fixed: 1083771
2017-01-25 18:32:59 -08:00
Sathish Kumar
fc93b2d84d qcacmn: QDF Converged Debug Framework
QDF Debug Framework is implemented that will be used across
WIN and MCL to converge the debug methods used currently.

These changes have passed basic dev validation, carried out
by exercising each of the APIs.

Also, WIN validation is complete with these framework changes tested by
registering to the framework and adapting to the new converged trace API
qdf_trace_msg_cmn.

Change-Id: I4b87c910906cf0a49e91b1000f5218402cd45fe2
CRs-Fixed: 1102956
2017-01-23 04:32:15 -08:00
Debasis Das
f3740946da qcacmn: Enable Log Level for QDF_TRACE prints
The WIN-specific macro for QDF_TRACE should use the
log-level.Currently,it is defined to printk which
results in flooding the console with debug prints of all
levels.

CR's Fixed: 1112458
Change-Id: Ic63c695fdc667af02595f9217f1bf365f76317f0
2017-01-20 02:43:42 -08:00
Poddar, Siddarth
028f0696be qcacmn: Add cookie to tso seg structure to debug double mem free
Add a field in qdf_tso_seg_t. This cookie helps to check in case of
double memory free case. When double mem free hits, it will result into
qdf_assert.

Change-Id: I3c60f2603bce23b47224ae9a5d88881c2fbb8e01
CRs-Fixed: 1102423
2017-01-17 00:40:11 -08:00