Commit Graph

805 Commits

Author SHA1 Message Date
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
Kiran Venkatappa
08bf93bbaf qcacmn: Use multi-page alloc for tso descs
Regular allocs usually result in allocation of size aligned to
slab boundary resulting in more memory than the requested. Use
multi-page allocation to avoid allocation of more memory than
requested.

Change-Id: Id6562f2fe419179e27206ff5b1d543090b931607
CRs-Fixed: 2294213
2018-09-03 05:11:16 -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
Pranita Solanke
afcd0f1289 qcacmn: Add Video/all TID Counters framework for both tx/rx
Add struct in cdp required to display VoW stats
for hawkeye and akronite

Change-Id: Ibd3a3b5e5933841cc28c9ce1b36d69615234720a
2018-08-31 04:01:24 -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
Dustin Brown
ed22a65b66 qcacmn: Add caller/line info to recovery log
To speed up recovery trigger debugging, pass the caller's function name
and line number, such that the group needing to do the initial triage
can be easily identified via the panic message.

Change-Id: I64f62ec30de657deeff037ee99610e716cfc4377
CRs-Fixed: 2298195
2018-08-17 16:13:22 -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
Krunal Soni
37bf7f4d22 qcacmn: Update radiotap header with LTF symbol value
As per the updated spec, 11AX PPDU's HE SIG_A data-5 field has added
LTF symbol field which is 3bits in size.

Add logic to parse the TLV coming from hardware and update the
LTF symbol value.

Change-Id: I05e2ff8ece7e14dc22ce747e9a9b906bf130462f
CRs-Fixed: 2235233
2018-07-17 00:58:29 -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
Dustin Brown
352de8a613 qcacmn: Add qdf_thread_run and qdf_thread_join APIs
For cases where you want to create and immediately start a thread, the
Linux kernel has the kthread_run() API. Create a QDF wrapper for
kthread_run() as well as companion APIs for waiting for a thread to exit
and one to check if the current thread should exit.

Change-Id: Ia4e107010fc400f764661a9b36aceea970841ade
CRs-Fixed: 2270827
2018-07-11 14:29:13 -07:00
Rajeev Kumar Sirasanagandla
6b6b91db11 qcacmn: Update QDF API to convert ASCII hex char to decimal value
To convert ASCII hexa decimal character to unsigned value and similarly
to convert string of ASCII hexa decimal characters to array of decimal
values, there is need of QDF API.

Therfore, add QDF wrapper functions to kernel API hex_to_bin() and
hex2bin().

Change-Id: I4692961eeba9067f9b737f7deeefca397ff1a7bf
CRs-Fixed: 2274320
2018-07-10 18:42:07 -07:00
Ashish Kumar Dhanotiya
587df12305 qcacmn: Invalid dependency of header files
There is an invalid circular dependency of header files in the
driver. qdf_nbuf.h file includes itself as qdf_nbuf.h file
includes i_qdf_nbuf.h and i_qdf_nbuf.h again includes qdf_nbuf.h.

To resolve this issue, do not include qdf_nbuf.h in i_qdf_nbuf.h

Change-Id: I940321b23e95a81601657d149ff31826db2522ba
CRs-Fixed: 2267066
2018-07-10 15:40:08 -07:00
Dustin Brown
fe41df9c00 qcacmn: Move panic messages into QDF_DEBUG_PANIC
QDF_DEBUG_PANIC has recently gained a reason parameter. Move instance of
logging followed immediately by QDF_DEBUG_PANIC to single calls.

Change-Id: Ifc00be410621005e8494074ed00b1b7e44cc6a03
CRs-Fixed: 2271769
2018-07-09 15:55:35 -07:00
Rachit Kankane
dfd97f38f6 qcacmn: Call blocking functions in right context
Call blocking functions free_g_qdf_dp_trace_tbl_buffer and
allocate_log_msg_buffer under non-atomic context.

Change-Id: I534c95b19cb08472db4a4a0f8285769841b00326
CRs-Fixed: 2273581
2018-07-09 05:32:55 -07:00
Rachit Kankane
371fce287d qcacmn: Allocate MAC Trace buffer dynamically
Allocate memory for g_qdf_trace_tbl buffer dynamically.

Change-Id: I5e9ba0a33e220ead36e0775f00000346aae68373
CRs-Fixed: 2267922
2018-07-08 23:30:46 -07:00
Wu Gao
661ec9d74a qcacmn: Verify id before removing idr
It causes kernel warning if remove an invalid id. So, verify id before
removing idr.

Change-Id: I22cd5753a6e4fae0087faaee1c722017523b311e
CRs-Fixed: 2271235
2018-07-05 19:32:04 -07:00
Dustin Brown
ce28cb1bdb qcacmn: Add optional reason to QDF_DEBUG_PANIC
It is generally useful to log the reason for a panic at the time of
panic. The Linux panic API accepts a reason string, so to aid in moving
from panic() to QDF_DEBUG_PANIC(), add an optional reason parameter.

Change-Id: If4ed0e664f6b15deb4c6edf76bdc25f55ba82fac
CRs-Fixed: 2271764
2018-07-04 06:54:52 -07:00
Linux Build Service Account
cb090521de Merge "qcacmn: Allocate DP_TRACE buffer dynamically" 2018-07-03 05:33:24 -07:00
Manjunathappa Prakash
cf4286b730 qcacmn: DPtrace: Do not log to memory during high throughput
During high TPUT scenario logging of DPT trace is not useful,
require more MIPS. Disable datapacket DPtrace logging during
TPUT runs, but contiue to log special packets like ARP/DHCP/ICMP etc..

Change-Id: I70c9368de4cb2423901449b267452a34d652213d
CRs-Fixed: 2255756
2018-07-02 12:23:38 -07:00