Commit Graph

765 Commits

Author SHA1 Message Date
Adil Saeed Musthafa
12205b544b qcacmn: Add timer to flush out log buffers periodically
Add timer to flush out log buffers periodically. Add command to set the
time period value.

Change-Id: I8e796a9bc7caac2661d00852420dd5fa66f5bca5
CRs-Fixed: 2296362
2018-09-21 20:50:55 -07:00
Ruchi, Agrawal
5b1028e3d3 qcacmn: Resolve compilation issue for ewma
Resolve compilation issue due to ewma.

Change-Id: I6555de6a357a04faab747b419be9e3eb1b285998
CRs-Fixed: 2308338
2018-09-17 21:29:30 -07:00
Manikandan Mohan
33cfb578b0 qcacmn: Fix NULL pointer dereference in qdf_nbuf_free
Move network buffer null check to beginning of function to
cover possible case of null pointer dereference during free.

Change-Id: I8c998d4d1711ab28c94a946d04314c26a4c74278
CRs-fixed: 2309452
2018-09-17 17:53:52 -07:00
Srinivas Pitla
be8dac4d5d qcacmn: Define VDEV MLME component object
This change defines VDEV MLME object, and registers with object manager to
be notified on creation/destroy, and also initializes MLME SM

Change-Id: I75bb7de7326e4bbed21ef9653427c4e0694c3ffc
CRs-Fixed: 2307722
2018-09-14 08:16:48 -07:00
Srinivas Pitla
bc7748c852 qcacmn: Implement State machine framework
This is generic state machine framework, which provides APIs for state
definition, state transition, event posting

Change-Id: Ie7d5a064967098fcb77a663047c479d1d1576595
CRs-Fixed: 2307722
2018-09-14 08:16:44 -07:00
Amar Singhal
413f3e289f qcacmn: Properly initialize pkt ptr record
Initialize packet pointer record is_free_pkt_ptr_record to false.
The code flow may not assign the pointer before usage.

Change-Id: I00a4dc0eaf7e426ce48ec746eba975b74d1fec34
CRs-Fixed: 2313459
2018-09-14 03:12:35 -07:00
Rakshith Suresh Patkar
ecd7d60c6a qcacmn: Add QDF APIs for dev_scratch in network buffer
Kernel 4.14 and later supports dev_scratch for network
buffer which can be used to store data in a nbuf in the
format unsigned long.

Add APIs:
 1) qdf_nbuf_is_dev_scratch_supported
 2) qdf_nbuf_get_dev_scratch
 3) qdf_nbuf_set_dev_scratch

Change-Id: I2a72d369bb53f8f86d4bcee3cf6d13f5e4aff57f
CRs-Fixed: 2313270
2018-09-12 08:50:17 -07:00
Sourav Mohapatra
474c614ddf qcacmn: Add FW Offload component UMAC ID
Add the UMAC enum ID for the new FW Offload enum.

Change-Id: Ia495ebd7d3a195839cae11a633b3bdc9ba7055ae
CRs-Fixed: 2307838
2018-09-11 12:03:15 -07:00
Om Prakash Tripathi
3c5c017507 qcacmn: Change radiotap HE log level from info to debug
Change log level for HE flags, HE data and HE MU info fields
added to radiotap header. Earlier log level of info used to
flood on console.

Change-Id: I7754df859bb315fff7e449e263e0d77cf412a852
CRs-Fixed: 2295965
2018-09-11 03:49:08 -07:00
Ruchi, Agrawal
1ee51132c5 qcacmn: Change to avoid compilation issue HK2.0
EWMA macros which were used for sojourn stats
time delay calculation, causing compilation issue
for x86 platform as x86 platform is on kernel
version less than 4.3 and EWMA macros were
introduced after that version.

Change-Id: I184844c7df8e5b317a095355c2f6a9af9e4747ff
CRs-Fixed: 2308338
2018-09-10 00:49:24 -07:00
Shiva Krishna Pittala
5f2280aa4f qcacmn: Separate out nbuf map/unmap code
Put the nbuf map/unmap code under NBUF_MAP_UNMAP_DEBUG.
nbuf map/unmap debug will be enabled on WIN once
the nbuf map/unmap related false positives are fixed.

Change-Id: I6b62539d39664db3ff62411fe8632633f53488c8
CRs-Fixed: 2284128
2018-09-06 10:20:17 -07:00
Arif Hussain
6e9fa6a725 qcacmn: Add logs in qdf_nbuf_alloc()
In qdf_nbuf_alloc() function, pass function name and
line number of caller and log the same in case of failure,
this approach helps to remove error logs in caller function
there by reducing text segment.

Also add qdf_rl and qdf_rl_nofl_* macros.

Change-Id: Ib8ce83335807cfbd2d83d1f165d6bec1dc1e4c94
CRs-Fixed: 2281983
2018-09-06 01:42:11 -07:00
Arif Hussain
c516cd4d5d qcacmn: Add logs in qdf_mem_malloc(), and qdf_mem_malloc_atomic()
In qdf_mem_malloc() and qdf_mem_malloc_atomic(), pass function
name and line number, and log the same in case of failure, this
approach helps to remove error logs in caller function there by
reducing text segment.

Change-Id: Ia4586b112c6dd64aca5b397b43bb17499a0e6e30
CRs-Fixed: 2281983
2018-09-06 01:42:06 -07:00
Vivek
e4bd23b400 qcacmn: Add API to get max size of the list
The list APIs only provides the current size of the list.
In certain cases, to be able to decide if the queue is full
we can compare the current size with the max size of the list
and not attempt to add to the list at all.

Change-Id: Ic0844ae9fccd8bcc9603d31c41692680966e1753
CRs-Fixed:2304508
2018-09-05 06:47:19 -07:00
Alok Kumar
030747ff17 qcacmn: Add flag in skb->cb for HTT packet pool
Add a flag packet_buff_pool in skb->cb to indicate
HTT packet pool buffer to use in case of HTT Rx ring
low memory scenario.

Set this flag for the buffers allocated for HTT packet pool.

Change-Id: I8e7c823f09aa8b7f686ee52f98f0984e542ff9fa
CRs-Fixed: 2301887
2018-09-04 21:15:18 -07:00
Dustin Brown
79694bd003 qcacmn: Use pm_wakeup_ws_event() for Kernels 4.12+
__pm_wakeup_event() was superseded in Linux kernel 4.12 by
pm_wakup_ws_event(). Add conditional compilation to use the new API as
appropriate.

Change-Id: I8f6ceb6de24e1ffcc909f9417595d29d50968ebc
CRs-Fixed: 2306603
2018-09-04 13:46:01 -07:00
Karthik Kantamneni
d07cfa4b67 qcacmn: Add qdf debugfs API to detect buffer overflow
Add API to query qdf debugfs buffer overflow.
Add support to dump log in different block sizes.

Change-Id: I3d5b63ef2f9b0eeb4df20dbb93a76f10ed10f556
CRs-Fixed: 2307897
2018-09-04 13:45:58 -07:00
Debasis Das
e6feafc106 qcacmn: Use appropriate dev handle in OS wrappers
The device handles used in OS wrappers should be of
the desired type.

Change-Id: I6a72c578492662e7c3907c844d9307fc0dc98e53
CRs-Fixed: 2299595
2018-09-04 11:53:51 -07:00
Alok Kumar
d32e9abf63 qcacmn: Add API qdf_nbuf_reset to reset netbuf
This API makes the reuse of sk_buff possible, by resetting
it with the reserve and align arguments passed by the caller.

This brings back the skb to the original state as
returned by qdf_nbuf_alloc without allocating the skb again.

Change-Id: Idefcbd4be9fae5d140805d55207dec01bdc90237
CRs-Fixed: 2301899
2018-09-03 11:27:26 -07:00
Manoj Ekbote
b8de937cc4 qcacmn: Initial support for 11ax MBSSID IE
1. Service ready ext includes a parameter for max
BSSID indicator.
2. Beacon template includes MBSSID IE offset.
3. Vdev create and up cmds include more parameters.

Change-Id: I71214eacdaa886725b7ea8f61db3a743ba6597e9
CRs-Fixed: 2306638
2018-08-31 19:09:55 -07:00
Ruchi, Agrawal
2cbca3b050 qcacmn: msdu time lag update for tx completion
msdu time from hwenqueue to tx completion as part of
msdu stats.

Change-Id: I71ba6f1dec0505e4fa09b5fb123f21912b08b9c5
CRs-Fixed: 2286774
2018-08-31 00:51:20 -07:00
Wu Gao
e5b5636856 qcacmn: Report err status if idr_find return NULL
It won't report err status since if idr_find return NULL, which cause
unnecessary process with NULL pointer.

Change-Id: I5813ddca11172f75fb73c9530e003c50e55beba2
CRs-Fixed: 2275848
2018-08-29 07:22:10 -07:00
Alok Singh
18fcc5548a qcacmn: Add return as int for qdf hrtimer cancel
Add return value as int to check the success and failure of hrtimer cancel.

CRs-Fixed: 2292414
Change-Id: I7bfe94882551533c3f6b4164a2a3f778216b281b
2018-08-28 14:46:33 -07:00
Mohit Khanna
7ac554bda5 qcacmn: Support for DP RX Threads
Add support for DP RX Threads as a part of the FR. Multiple RX
threads can be enabled from the ini. The code is added in a new DP
module outside of the cmn project.

Change-Id: Id966c46c2799d23c2a4fa1c884610955afed3565
CRs-Fixed: 2256470
2018-08-24 18:35:45 -07:00
Ashish Kumar Dhanotiya
27bcaf88dd qcacmn: Add qdf api support for mtrace logging
Currently mtrace messages are getting recorded in circular
queue but are not getting used for DIAG Infrastructure.
Add support to print the mtrace messages on DIAG infrastructure in
format such that there will be two 32 bit fields printed on the
logs. These two fields will be constructed as explained below:
1. First field will be constructed using below bit positions:
   a. Bit 0 – 14 ( 15 Bits Lsb ) will contain the messageIDs
   b. The bit 15-22 will represent the destination module,
      and the 23-30 will represent the source module which is
      initiating the message.
   c. Bit 31 will represent whether the message is from host
      or from FW. If bit is 0, it indicates the message is
      from host and if it is 1 it indicates the message is
      from FW.
2. Second field will be constructed using below bit positions:
   a. First 16 bits (From LSB )will be used for counter.
   b. Next 8 bits would be the vdev id.
   c. Remaining 8 bits are reserved for future use.

Here counter is static unsigned 16 bit value which will be
used to keep track of number of logs given to QXDM and out of
these logs how many logs have been missed.

Change-Id: I4cec762ef17222d6adda9fd3e283c101afb92955
CRs-Fixed: 2290898
2018-08-14 16:50:18 -07:00
Ashish Kumar Dhanotiya
9d0ed2532c qcacmn: Add a new trace level for automation of logging
Add a new logging trace level QDF_TRACE_LEVEL_TRACE for
automation scripts to process the logging.

A new logging Infrastructure is to be added where the newly
added logging level QDF_TRACE_LEVEL_TRACE will be used to
log in specific format and these logs will be used by
post processing script to figure out right FA or to figure
the module from where the path deviated. It will help out CST
to figure out the right FA if there are any issues in the driver.

Change-Id: I7b5772026e4fc2f8e5205663e9150c861b69fdfc
CRs-Fixed: 2290893
2018-08-14 16:50:16 -07:00
Debasis Das
008baa9b4d qcacmn: Abstraction mechanism for OS API's
Provide support for abstraction layer for OS API's.

Change-Id: I1f51350c2ae4c35330aa7355e9cd20fa28aad194
CRs-Fixed: 2222560
2018-08-14 16:50:12 -07:00
Ashish Kumar Dhanotiya
14e22492c5 qcacmn: Add new Module ID in enum QDF_MODULE_ID
Currently there is no module ID to represent the FW, In new
logging infrastructure messages going from host to FW also
needs to be represented.
Add a new module id QDF_MODULE_ID_TARGET to represent firmware as
a module.

Change-Id: I0551455f2867633abed88037e414deaec1c11921
CRs-Fixed: 2290895
2018-08-11 04:41:54 -07:00
Adil Saeed Musthafa
61a21697f6 qcacmn: Add new radiotap header fields
Add the following fields in Radiotap header:
Antenna noise (in dBM)
Vendor Namespace containing the following information
->L_SIG_A
->Device_ID
->L_SIG_B
->PPDU_START_TIMESTAMP

CRs-Fixed: 2285143
Change-Id: I977be73778ab27383f12214c73b56c9b80d9f02d
2018-08-10 20:45:27 -07:00
Aditya Sathish
1c42c27c80 qcacmn: Move prints to QDF framework
Move all qdf_print from printk to qdf_trace_msg so that trace level
management can be carried out at runtime
In addition to the above, change contains removal of newline
escape characters from the format string of the converged
print APIs since qdf_trace_msg appends them by default.

Change-Id: I18cd06400bb9747761bbd86bfb38fe6d06106729
CRs-Fixed: 2243843
2018-08-10 18:11:15 -07:00
Dustin Brown
75e840c4b1 qcacmn: Add QDF_DEBUG_PANIC_FL stub
QDF_DEBUG_PANIC_FL is currently not defined when PANIC_ON_BUG is not
enabled. Add a stub for this case to prevent compilation failures on
non-debug builds.

Change-Id: Id78ac189ad3e3ab096d2e44db5ce01afe599c3bb
CRs-Fixed: 2293402
2018-08-09 00:47:42 -07:00
Sathyanarayanan Esakkiappan
360ad1d34f qcacmn: Wrapper API for memset_io and memcpy_toio
Inclusion of Wrapper API for memset_io and memcpy_toio

Change-Id: I89b94e201f043d37b782e855f198dbc00b89ac15
2018-08-08 09:11:56 -07:00
Dustin Brown
ee8f625766 qcacmn: Clarify memory domain mismatch log
The current diagnostic message that gets printed in the event some
memory is freed in a different memory domain than it was allocated from
is confusing. Rather than using "found" and "expected," use "allocated"
and "current" to differentiate the different memory domains.

Change-Id: I45efeb892d2c75a3f0b13d41e43b421a2b1a139e
CRs-Fixed: 2290148
2018-08-06 20:55:27 -07:00
Dustin Brown
427357d954 qcacmn: Acquire nbuf meta lock during free
qdf_nbuf_free_debug() does a hashtable lookup for nbuf metadata without
grabbing the appropriate spinlock. This naturally leads to a variety of
issues. Acquire the nbuf metadata lock while accessing the metadata
hashtable in qdf_nbuf_free_debug().

Change-Id: I058b00abcf0162c764fc9ad5011be341a07f2b9d
CRs-Fixed: 2288522
2018-08-02 18:30:12 -07:00
Pamidipati, Vijay
121589c105 qcacmn: Move ___qdf_dmaaddr_to_32s out of FEATURE_TSO
___qdf_dmaaddr_to_32s is not related to TSO.
Move ___qdf_dmaaddr_to_32s out of FEATURE_TSO macro

Change-Id: Ieabdf6066d23b10aa61b9f999828e26f6d689d54
CRs-Fixed: 2258196
2018-08-02 02:48:49 -07:00
Sathish Kumar
8b2d1c7c05 qcacmn: Add CB ftype for DMS packets
Directed Multicast Service (DMS) allows a client to request the AP
to convert multicast frames that match a certain traffic classifier
into unicast frames for the client. This request can be sent either
as a DMS Request Information Element in the Association/Reassociation
Request frame or explicitly via a DMS Request Action Frame after the
client has completed association. If the AP accepts the DMS Request,
all multicast frames matching the traffic classifier specified in the
DMS Request will be unicasted directly to the client as an AMSDU.
The original multicast frame will still be transmitted for the benefit
of those clients that do not support or request for DMS.

Add new CB ftype to differentiate data packets intended for DMS subscribed
clients

CRs-Fixed: 2056341
Change-Id: I687e4f4d182869753e2c3670ec07aa64f95fda1b
2018-08-01 12:31:58 -07:00
Nirav Shah
c3f3f9d4a8 qcacmn: QDF: Add logging macros without function/line info
Add per module logging macros without function/line info
to avoid adding function/line info where it is not required.

Change-Id: Ibc5745eae277110e884882891d14d3714e0d3ab4
CRs-Fixed: 2278876
2018-07-27 09:09:53 -07:00
Nirav Shah
87668f872b qcacmn: Add compilation flag for enter/exit macros
Map all enter/exit log macros to enter/exit QDF TRACE macro
to provide option to compile out enter/exit logs if required

Change-Id: I913ef0fb2486fde6b2ec4dfe8465884ca4d66ce4
CRs-Fixed: 2274857
2018-07-25 09:40:54 -07:00
Shiva Krishna Pittala
9f8db12851 qcacmn: Move init and exit of nbuf debug out of MEMORY_DEBUG
Move qdf_net_buf_debug_init and qdf_net_buf_debug_exit out of
qdf_mem_debug_init and qdf_mem_debug_exit respectively so that
NBUF_MEMORY_DEBUG can be enabled irrespective of MEMORY_DEBUG.

Change-Id: Ia57badf850aad00975305a08508e63bab7cb4908
CRs-Fixed: 2284116
2018-07-25 04:34:43 -07:00
Rajeev Kumar Sirasanagandla
66970850d9 qcacmn: Add WMI layer support for action OUI extensions
Add WMI support to send action OUI extensions to firmware.
For STA interface, this feature is intended to control mode of connection,
connected AP's in-activity time, Tx rate etc.,

Change-Id: I6a0bc9d3f7f0d57805b872cae4baa1fe84fb8193
CRs-Fixed: 2254509
2018-07-24 13:20:42 -07:00
Srinivas Pitla
d898ceddfa qcacmn: Change wmi ready wait to qdf_event
In current implementation, wait_queue is used for waiting on WMI ready
event, it is now changed to event mechanism

Change-Id: I08b4f088874b7c63e20b129f14dbac01851496e5
CRs-Fixed: 2276900
2018-07-19 23:12:53 -07:00
Pavankumar Nandeshwar
205aeca91d qcacmn: Add a new qdf API for spin_trylock
This change adds a qdf wrapper api qdf_spin_trylock for spin_trylock.

Change-Id: I3406ed96f7f40df24949bd4e21ceb144d919d58d
2018-07-19 04:29:26 -07:00
Dustin Brown
828ddeb614 qcacmn: Add QDF_DEBUG_PANIC_FL macro
For logic that builds on top of QDF_DEBUG_PANIC(), it would be useful to
be able to specify function and line number explicitly. Add
QDF_DEBUG_PANIC_FL(), which is QDF_DEBUG_PANIC with explicit function
and line number parameters.

Change-Id: Idc79f2fb0e769930167766f21a54a82c4b7ff40a
CRs-Fixed: 2276964
2018-07-16 18:32:39 -07:00
Sravan Kumar Kairam
d0f08ef155 qcacmn: Assign DMA address correctly to all scatterlist elements
Assign DMA address correctly to all scatterlist elements of scatter
gather table in qdf_mem_shared_mem_alloc() func.

Change-Id: I07988d0bc35e3e0fcf7b9f6df02a9e56a0e8b083
CRS-Fixed: 2110715
2018-07-16 18:32:36 -07:00
Nirav Shah
a175314c51 qcacmn: Map all module logs to per-level log APIs
Map all module level log APIs to per-level log APIs
to compile out specific log level if required.

Change-Id: I4072b6740cb43200fd95c40943b66e1d5f8f1847
CRs-Fixed: 2266719
2018-07-13 10:36:22 -07:00
Mohit Khanna
163c3170a1 qcacmn: fix dptrace for data packets
Enable tracing for TX/RX data packets
Donot print stats with 0 value

Change-Id: I4bab6537494c4ee0fe290e3778fb5662bf5abd66
CRs-Fixed: 2269193
2018-07-13 02:58:46 -07:00
Dustin Brown
6d5b8fa8e7 qcacmn: Remove unused osdep APIs
osdep contains many legacy APIs which have better counterparts elsewhere
in QDF. Remove unused APIs from osdep to avoid reintroducing their
usage.

Change-Id: I912b6d0dae510e96f5ab520d5d5b4ac6c60fbe86
CRs-Fixed: 2276316
2018-07-11 18:45:56 -07:00
Dustin Brown
25855170f7 qcacmn: Ensure an nbuf is not mapped during free
Currently, there is no logic to ensure a given nbuf has been properly
unmapped when it is freed. This can lead to side-effects when the same
address is allocated for an nbuf in the future. Ensure a given nbuf has
been unmapped during free to ensure all nbufs are properly unmapped.

Change-Id: I925af1fbbbde6baa0f12a4468a33332bc75bdfbc
CRs-Fixed: 2271768
2018-07-11 14:29:37 -07:00
Dustin Brown
a275f21008 qcacmn: Cleanup qdf_event logs
qdf_event has a number of overly verbose logs, which use QDF_TRACE
directly. As direct use of QDF_TRACE is deprecated, optimize logs in
qdf_event and replace any remaining QDF_TRACE calls with qdf_*()
logging macros.

Change-Id: I89491d7e49ea323d1bc3a32789c005b0238f0099
CRs-Fixed: 2270770
2018-07-11 14:29:29 -07:00
Dustin Brown
98b7303494 qcacmn: Add timeout QDF_STATUS to errno mappings
QDF_STATUS_E_TIMEOUT is currently mapped to the default -EPERM in
qdf_status_to_os_return(). Add a mappings to -ETIMEDOUT instead.

Change-Id: I61af2fb00ee83118ba09b2c3fbc5995b14212d87
CRs-Fixed: 2275459
2018-07-11 14:29:19 -07:00