Commit Graph

765 Commits

Author SHA1 Message Date
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
Rachit Kankane
b3ba76975e qcacmn: Allocate DP_TRACE buffer dynamically
Allocate memory for g_qdf_dp_trace_tbl buffer dynamically.

Change-Id: Id5cc51776f4378ecc97d7d758d5e502055423fb2
CRs-Fixed: 2268793
2018-07-02 11:24:53 +05:30
Anurag Chouhan
15da7ce9be qcacmn: Fix compilation error on LE target
Fix compilation errors on LE target.

Change-Id: I57c337c8144e4f49a8fd7eefb22164f05beb13c5
2018-06-30 08:58:38 -07:00
Srinivas Girigowda
ea4a324ce5 qcacmn: Not to be hard to make high order page
kcompactd consumes many CPU cycles without being successful
to make high-order page. One of the reason is WIFI driver is
allocating order-3 page a lot.

It shows 46% high-order allocation comes from WIFI driver.
Of course, it should be fixed in MM layer but it is never
easy stuff to fix in near future.
Regardless of MM changes, drivers should do best effort to reduce
high-order allocation, too.

This patch fixes the problem via not waking kcompactd.

Change-Id: I2bc3bf3ec96d32dd1a93c24edf2f590f331c0ed5
CRs-Fixed: 2265578
2018-06-28 04:51:56 -07:00
Rakshith Suresh Patkar
09089f1b73 qcacmn: Remove unused APIs qdf_nbuf_set_rx_info and qdf_nbuf_get_rx_info
Currently, the APIs qdf_nbuf_set_rx_info and qdf_nbuf_get_rx_info
are no longer used in our driver code.

Cleanup the unused code for qdf_nbuf_set_rx_info and
qdf_nbuf_get_rx_info.

Change-Id: I57acbd4e5901d8922e3b650f0f3b57f056a0ae3e
CRs-Fixed: 2259212
2018-06-25 23:53:07 -07:00
Nachiket Kukade
4d5a2fe8d9 qcacmn: Clear the force_set flag while resetting a qdf_event
In case where a qdf event was waiting and an SSR has occurred,
force_set flag is set for the event. After driver recovery is
complete the same event can be reset and re-used without
resetting this flag. This may cause a failure even after the
event was successfully completed.

Clear the force_set flag while resetting a qdf_event

Change-Id: Ia8cbc04776144d40e9c59fa339f8993fdbb73368
CRs-Fixed: 2264320
2018-06-25 14:12:54 -07:00
Shiva Krishna Pittala
7d721c3baf qcacmn: Fix file name tracking logic in QDF nbuf tracker
As WIN has multiple modules and QDF is the last one to be unloaded,
QDF is crashing when it tried to print the file name of an nbuf
allocated by other modules. To fix this, copy the file name in the
QDF nbuf tracker, rather than using the pointer to file name,
to avoid access to the invalid pointer.

CRs-Fixed: 2258770
Change-Id: I27ee76e58b0f5a976840783cfeba451784de85dd
2018-06-25 03:17:57 -07:00
Rajeev Kumar
8716234661 qcacmn: Clean up excessive console logging from target if and qdf
Clean up excessive logging from target if and QDF to avoid spamming
kernel log buffers.

Change-Id: Ib81d6bb68bae9d5c477755b31dc20e10663147d5
CRs-Fixed: 2259283
2018-06-22 18:41:06 -07:00
Shiva Krishna Pittala
b52ad74361 qcacmn: debugfs support for qdf memory tracking on WIN
qdf_debugfs_init needs to be rearranged for the debugfs to work for
memory tracking on WIN.

Change-Id: I660731a22368d34a1e4f8c29539fffd9731d02cc
CRs-Fixed: 2254297
2018-06-22 13:02:36 -07:00
Sathish Kumar
18617b8638 qcacmn: Decouple netlink service and wlan logging service
Netlink service init and exit is invoked as part of wlan logging
init and exit during qdf module init and exit. This brings in a
hard dependency to enable and compile wlan logging service
even if not used.

Decouple netlink service and wlan logging service to remove
inter-dependency. WIN qdf module currently does not require wlan
logging to be enabled. This separation leads to bss savings in qdf
module.

Change-Id: Ib0afafd196106eba78ad9783eb1a6cece77c00fa
CRs-Fixed: 2258640
2018-06-22 08:18:23 -07:00
Yun Park
aadee8cc5a qcacmn: Add ol_txrx_completion_fp in ol_txrx_ops
Add ol_txrx_completion_fp in ol_txrx_ops to provide support for
callback during TX completion.

Change-Id: I7af478636badd8f8562460cefaf5db56633df8e9
CRs-Fixed: 2253569
2018-06-21 13:52:22 -07:00
Ryan Hsu
c84218fed7 qcacmn: Add SSR callbacks
As CDS is not usable by WIN, add callbacks that are
registered in QDF and correct the module dependencies.

Also moves the platform related function to qdf_platform.[c|h]

Change-Id: I3080e9df86770235ff46237b8a2ffb9c2a3c9c2c
CRs-fixed: 2130260
2018-06-20 04:05:54 -07:00
Nirav Shah
faa27fbe89 qcacmn: Fix compilation error for LINUX_VERSION_CODE
Fix compilation error for LINUX_VERSION_CODE in
i_qdf_time.h.

Change-Id: I4878594c398686d296f218b678247c5afa2f6ed0
CRs-Fixed: 2258897
2018-06-15 21:31:18 -07:00
Vinay Adella
873dc40d46 qcacmn: Beacon to replace a probe response
Cancel broadcast of probe response if beacon is already sent
in beacon offload.

Change-Id: I4fea51433fbb959e05988c2daac89fbe839b1cdf
CRs-Fixed: 2209282
2018-06-15 12:39:38 -07:00
Om Prakash Tripathi
9b56f5dc1c qcacmn: Use atomic allocation for all scheduler context scan allocations
In low memory environments using GFP_KERNEL flag may cause
scheduler thread to sleep. Scheduler thread callback handlers
are expected to be atomic in nature to ensure timely execution
of different commands. Move all allocations done by scan module
in scheduler thread context to atomic allocation.

Change-Id: Iee3eafbc00a3afea0687ba67b3041ec0816094cc
CRs-Fixed: 2232553
2018-06-13 21:00:59 -07:00
Aditya Sathish
e6168d475d qcacmn: Extend kernel version condition in i_qdf_time.h
For kernel v3.17 and above, timekeeping.h is included for
some kernel APIs such as ktime_get() but for versions prior to 3.17,
the above APIs are present in hrtimer.h.

To accommodate the usage of these APIs for older kernel versions,
include <linux/hrtimer.h> into this file for kernel versions
lower than 3.17

Change-Id: I445a1673d9067a2dd47045d6c48d73aaa239790e
CRs-Fixed: 2252563
2018-06-11 04:45:27 -07:00
Rakshith Suresh Patkar
81f4f19830 qcacmn: Add debug change to record timestamp
This change adds timestamp information for every memory
allocated and mapped for debugging purposes.

Change-Id: Iba8e720790b863ae11c528a02f5c32ea606560dd
CRs-Fixed: 2236213
2018-06-11 01:41:47 -07:00
Amar Singhal
f98d926bcf qcacmn: Validate the network buffer before processing
Check for potential buffer overflow and NULL ptr access
issues.

Change-Id: Iecb36530716dafa27a95a82392e97f662a7c25f0
CRs-Fixed: 2251345
2018-06-08 16:30:34 -07:00
Yun Park
c8a48dbe8f qcacmn: Remove ipa_add/del_hdr_proc_ctx from QDF
Remove unused IPA API ipa_add_hdr_proc_ctx and ipa_del_hdr_proc_ctx
from QDF.

Change-Id: Iffe79a040ae68e817433416f9f59b23d9029fbdf
CRs-Fixed: 2242429
2018-06-01 19:44:48 -07:00
Zhang Qian
3c724258f3 qcacmn: Add null pointer check in qdf_dp_trace
In hdd_tx_timeout(), null nbuf is passed to qdf_dp_trace(). This
results a null pointer dereference when getting data buffer.
Since data buffer is not mandory for qdf_dp_add_record(), add null
nbuf check in qdf_dp_trace().

Change-Id: If5fb4753d382d8f29bdf4d934a7910a28a7c76aa
CRs-Fixed: 2244543
2018-05-29 00:08:14 -07:00
Dustin Brown
b6c29037e6 qcacmn: Remove 2.6.19 kernel check from qdf_defer
qdf_defer contains backwards compatibility code for Linux kernel
versions <=2.6.19. At the time of writing, this version is 12 years
old. Remove backward compatibility for kernel versions <=2.6.19 from
qdf_defer.

Change-Id: I623aa5b1ed597c76997bf397d9f2114cdf8c5ece
CRs-Fixed: 2247714
2018-05-25 14:15:05 -07:00
Jeff Johnson
5a0302c53e qcacmn: Rename qdf_trace_register() param module_iD
Function qdf_trace_register() parameter module_iD has (probably
unintentional) mixed-case which violates the coding standard, so
change it to all lower case.

Change-Id: Ic2f5b76a8adb178411e3b3ac18ef4009d168a664
CRs-Fixed: 2245197
2018-05-25 12:41:41 -07:00
jiad
efc0b71831 qcacmn: Add support for SMMU IPA WDI unified API
IPA driver adds unified WDI API for ipa_wdi_create_smmu_mapping
and ipa_wdi_release_smmu_mapping. WLAN driver needs to adopt the
change accordingly.

Change-Id: Ibbf10e4beb579a6a3d3e6b0e8e6d2c853f7e629a
CRs-Fixed: 2238493
2018-05-24 07:52:02 -07:00
jitiphil
cfb14523ad qcacmn: Fix debugfs issue for DPTRACE
TX packet records in DPTRACE logs for debugfs do
not contain msdu id, while QXDM logs do contain them.

Add msdu id of packets in the DPTRACE records for
debugfs.

Change-Id: Id3f6c21d95221cd5444327189b803ac857d56525
CRs-Fixed: 2242178
2018-05-23 23:49:31 -07:00
Mohit Khanna
4b3b7e7110 qcacmn: debug prints for monitor mode TLVs
Add prints to track:
* Incoming TLVs in the monitor mode status ring.
* HE, HE-MU and HE-MU-Other values being passed to the
  stack.

Change-Id: Ib23336353dc4a2253a62444b767d2a706ce372ea
CRs-Fixed: 2242514
2018-05-22 13:00:04 -07:00
Nirav Shah
9106902215 qcacmn: Featurize dp trace
Featurize dp trace to compile out cleanly.

Change-Id: If244fba87a50cde57ec55e54249b41dd30dcc92d
CRs-Fixed: 2227771
2018-05-22 09:34:12 -07:00
Jeff Johnson
8bc5042785 qcacmn: qdf: Fix misspellings
Address the following issues in the qdf folder:
CHECK: 'arguement' may be misspelled - perhaps 'argument'?
CHECK: 'Arguement' may be misspelled - perhaps 'Argument'?
CHECK: 'continous' may be misspelled - perhaps 'continuous'?
- (actually 'contiguous')
CHECK: 'implentation' may be misspelled - perhaps 'implementation'?
CHECK: 'Initilize' may be misspelled - perhaps 'Initialize'?
CHECK: 'occurance' may be misspelled - perhaps 'occurrence'?
CHECK: 'untill' may be misspelled - perhaps 'until'?

Change-Id: I4ea13e1a6b1490082830ed67098ff174a162114b
CRs-Fixed: 2241580
2018-05-19 19:41:08 -07:00
Jeff Johnson
1974e07df2 qcacmn: qdf: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: Ia920daa3248677b9446f4203c7698cbc37648fbd
CRs-Fixed: 2230684
2018-05-18 02:17:38 -07:00
Dustin Brown
b7871f64ad qcacmn: Add qdf_status_from_os_return()
It is sometimes useful to reverse map an errno into a QDF_STATUS. For
this purpose, introduce qdf_status_from_os_return(), the logical inverse
operation of qdf_status_to_os_return().

Change-Id: I053f43867ef603c2654eca64fe76c7bd313e14e4
CRs-Fixed: 2242664
2018-05-18 00:00:33 -07:00
Wen Gong
a5dfb6d847 qcacmn: Add hdd memory dump feature flag
Add config flag to enable / disable hdd memory dump feature

CRs-Fixed: 2231694
Change-Id: I6b565bd7007223a51b67a2ea9fbafd6a737d22d9
2018-05-17 21:39:10 -07:00
Wu Gao
210778359a qcacmn: Add QDF API for ID allocation
In P2P ROC and MGMT tx cases, it use kernel address as cookie and
provides to userspace. Which has security risk. Add QDF API for ID
allocation and map ID to pointer, provides ID to userspace instead
of kernel address.

Change-Id: I4e10109988391474722df5b251fab11a87c7992b
CRs-Fixed: 2237756
2018-05-17 16:55:21 -07:00
Dundi Raviteja
dd1d8ba52a qcacmn: Possible information leak due to uninitialized data
In qdf_trace_hex_dump() API, linebuf array is not initialized where
it is used to print in the form of string in qdf_trace_msg() API,
this may cause information leak.

To address this issue, initialize the linebuf array to zero.

Change-Id: If2fe200eb16b28f7fff4413873c1d149716fb1a7
CRs-Fixed: 2232012
2018-05-17 02:38:00 -07:00
Jeff Johnson
7947f90a30 qcacmn: Fix typo "retrived"
Replace typo "retrived" with correct spelling "retrieved".

Change-Id: Icde5e2480be78bdf8bf3befd1ce09b1b427074df
CRs-Fixed: 2238309
2018-05-17 00:47:20 -07:00
Jeff Johnson
dc9c55962d qcacmn: Fix typo "lenght"
Replace typo "lenght" with correct spelling "length".

Change-Id: Ieea0c547c61248e510835d16a9fa55ace486df23
CRs-Fixed: 2238309
2018-05-17 00:47:02 -07:00
Jeff Johnson
9f2d54f039 qcacmn: Fix typo "accross"
Replace typo "accross" with correct spelling "across"

Change-Id: Ifec1b81cbc6c808784d86afe055468ff42674a57
CRs-Fixed: 2238309
2018-05-17 00:46:41 -07:00
Prathyusha Guduri
9bb99acfca qcacmn: Add skb record rx queue to qdf API
Add skb_record_rx_queue() wrapper in qdf

Change-Id: Ic14e0a39d7d62bb404b443cc240b1ed0e5176119
2018-05-14 03:00:04 -07:00
Dustin Brown
8c268a0f54 qcacmn: Use qdf_flex_mem for nbuf map metadata
nbuf map tracking requires a bit of metadata which is currently
allocated dynamically for each mapping request. Change these allocations
to use a qdf_flex_mem pool instead, amortizing each physical allocation
over many mapping requests. This reduces the runtime overhead of the
nbuf map tracking feature, and provides significant memory savings when
MEMORY_DEBUG is also enabled.

Change-Id: Ieef9b996edab135cc2e0252c3a59cb6876f36371
CRs-Fixed: 2232113
2018-05-11 13:23:02 -07:00
Dustin Brown
03a7ac6e19 qcacmn: Add reduction limit to qdf_flex_mem
Add the ability to prevent qdf_flex_mem_pool from freeing memory
segments unless there are more than some minimum number in the pool
already.

Change-Id: I20bde2ed629b97924ea71b4f7f46a2c1fc1bab28
CRs-Fixed: 2229511
2018-05-11 13:23:00 -07:00
Jeff Johnson
49dd1d9143 qcacmn: Add missing entry to VERBOSE_STR[]
In qdf_trace_msg_cmn() the VERBOSE_STR array is used to convert
a trace level into a string. This array is missing an entry for
QDF_TRACE_LEVEL_ALL, so add it.

Change-Id: Iee6337cda7e54c429d36b2fd42bbd0c143c7d5a5
CRs-Fixed: 2232820
2018-05-07 13:58:21 -07:00
Kiran Venkatappa
bc1c547b8e qcacmn: Add timekeeping.h inclusion under correct kernel version
timekeeping.h is available from kernel version 3.17. Add header
inclusion and ktime_get_boot_ns call under correct version check flag.

Change-Id: I2a1a127e1716b52af56d14c39e2e646e34b05fa3
CRs-Fixed: 2230949
2018-05-07 01:29:30 -07:00
Yun Park
538a3a6e3d qcacmn: Remove ipa_reset_hdr from QDF
Remove unused IPA API ipa_reset_hdr form QDF.

Change-Id: I749e891b74b0adb45a5c3b9dbe7ad638d62c4459
CRs-Fixed: 2233616
2018-05-03 12:55:02 -07:00