Commit Graph

44 Commits

Author SHA1 Message Date
Jeff Johnson
b9fcc44fd3 qcacmn: Fix QDF MC Timer documentation
The kernel-doc script identified documentation issues in the QDF MC
Timer abstractions, so fix those issues. In addition, there are a
number of instances where public functions have their implementation
documented. In those cases make sure only the interface is documented.

Change-Id: Ied6cf02d2091099351cd82245a667fd1e6cad461
CRs-Fixed: 3405262
2023-02-24 08:50:01 -08:00
Tiger Yu
ba6c61a462 qcacmn: Remove the export symbol for static variable and function
Fix the compiling issue by removing the export symbol for static
qdf_timer_clean and mem_debug_disabled.

Change-Id: I01f886e04af2f294ed9cb93afdbb69d7d8b9f2ee
CRs-Fixed: 3363506
2022-12-22 07:04:24 -08:00
Jeff Johnson
3bdf954afc qcacmn: qdf: Fix misspellings
Fix misspellings in qdf/...

Change-Id: If61ee47fba94b2bb60f33ab74feda56dbe5cb7bd
CRs-Fixed: 3277902
2022-10-12 23:22:37 -07:00
abhinav kumar
2888b71da7 qcacmn: Save jiffies value for QDF timer
Save the jiffies value in a per-timer context
in qdf_mc_timer_t while processing qdf_mc_timer_start
and scheduler_mc_timer_callback. It will help the
debugger to know the exact time gap between the
start and stop/expiry of the QDF timer.

Change-Id: Ia79011971184de9390632253417ee35dc7d26cf8
CRs-Fixed: 3283746
2022-09-10 10:42:23 -07:00
Pragaspathi Thilagaraj
a8d8b663b2 qcacmn: Define QDF API for vzalloc and vfree
Define QDF API for virtual memory allocation and free.
Also add new api to get time of the day in microseconds.

Change-Id: I2921055bbb6b5d2a1105d19448b2a10fa2d6ccc5
CRs-Fixed: 3038180
2021-09-28 21:12:18 -07:00
Kiran Venkatappa
a41cb25122 qcacmn: Remove get API under QDF_TIMER_MULTIPLIER_FRAC
Set QDF_TIMER_MULTIPLIER_FRAC to default multiplier if it is defined.
Remove get API under this feature flag so that this can be modified using
set dynamically based on the emulation target detect.

Change-Id: If0743e6b571832ebf3319f9895350685a5cd53f0
CRs-Fixed: 2995514
2021-08-16 03:18:34 -07:00
Alan Chen
64782f823f qcacmn: Return proper value of qdf timer multiplier
Return proper value of qdf timer multiplier based on this
Kbuild option QDF_TIMER_MULTIPLIER_FRAC.

Change-Id: I10c08ba900aad49fb9134d2e4d337f04a19dec7b
CRs-Fixed: 2855512
2021-01-19 23:24:33 -08:00
bings
67ae88ddbb qcacmn: rtc_time64_to_tm support for 4.0+ kernel
rtc_time64_to_tm in defined from kernel 4.0+. Use rtc_time64_to_tm
instead of rtc_time_to_tm from kernel 4.0+.

Change-Id: I6335150300cd4cd7a91d771dd86bf11592d1ff11
CRs-Fixed: 2666521
2020-06-08 13:50:21 -07:00
Ashish Kumar Dhanotiya
18d4b6fe84 qcacmn: Update the mc timer state after its deleted
Currently qdf mc timer stop api updates mc timer state
to QDF_TIMER_STATE_STOPPED before it deletes the timer which
may lead to race condition where if any other thread tries to
read the state of the timer and re-start the timer considering
it is stopped which may get deleted after that.

To address above issue, update the timer state after timer
delete.

Change-Id: I302b89bdedf23f8277eacb6d42b5bd8e6daa4d05
CRs-Fixed: 2643254
2020-03-27 06:29:16 -07:00
Sourav Mohapatra
e8a1cf3c70 qcacmn: Reduce unnecessary logs in various QDF modules
Various QDF logs being printed to the driver log are not necessary for
debugging purposes.

Cleanup the logs that are not required.

Change-Id: I9c5685b4d31a741703667943ac458921fa0d480e
CRs-Fixed: 2616210
2020-02-13 11:39:22 -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
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
Alan Chen
8fbc8c2941 qcacmn: Add QDF timer multiplier for all timers on host
Some QDF timers on host do not use the QDF timer multiplier. Add QDF timer
multiplier so that all timers on host have it.

Change-Id: I57acb28240ea815aaed685b5a193e492332cad69
CRs-Fixed: 2498149
2019-08-01 05:13:48 -07:00
Bala Venkatesh
94b9ce4320 qcacmn: Release the platform_info spin lock before del_timer_sync
In qdf_mc_timer_stop_sync acquires the platform_info spinlock
and call's the del_tymer_sync. del_timer_sync waits for callbacks
to execute all CPU's. But callback scheduler_mc_timer_callback
tries to acquire the platform_info lock to execute. This can
lead to deadlock.

Change-Id: Ib21ee5b57e11d1c98e1308ee5318fb47d78a6ba2
CRs-Fixed: 2453603
2019-05-21 06:14:20 -07:00
Vivek
2ec3781464 qcacmn: Define qdf timer multiplier as a macro
The current QDF timer multiplier factor is of type
uint32 which takes whole number, so we cannot have multiplier
factors like 0.5 or 1.5

To provide such timer multiplier,
we define timer multiplier, as a macro, provided though
build options and support values like 0.5 or 1.5 through
1/2 and 3/2 respectively and this is used to configure the
timeout value.

Change-Id: I3f5441e33cca71f4a399cbbf9c6f61e2f21ee828
CRs-Fixed: 2450710
2019-05-20 07:54:01 -07:00
Bala Venkatesh
c88eb85707 qcacmn: Stop ROC timer synchronously
Mc timer is used to initialize the p2p roc timer.
And the actual timer runs in the soft irq thread and
when the timer exipres it posts the message to mc thread.
Currently, qdf_mc_timer_stop is called to stop the timer.
It calls the del_timer internally to delete the timer.
del_timer() ensures that the given timer is not queued
to run anywhere in the system. But the callback may
be running on another CPU core can create race conditions.

So use del_timer_sync to delete the roc timer.

Change-Id: I2c0fd6e335fc342a3acf06ede534c84d40e19346
CRs-Fixed: 2447236
2019-05-08 02:51:46 -07:00
Jeff Johnson
2831229bd7 qcacmn: qdf: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within qdf replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: Ie7662617dad8138b803dc54e7759d3b6d76c53ce
CRs-Fixed: 2418255
2019-03-26 15:38:28 -07:00
Madhvapathi Sriram
2750c27818 qcacmn: Remove error log for qdf_mem_malloc in qdf files
qdf layer already has the error trace

Change-Id: I451e8a008585d80c9d3ccb619461362a74d0a52b
CRs-Fixed: 2374111
2019-02-11 02:30:06 -08:00
Dustin Brown
8f1ded29ed qcacmn: Apply timer multiplier to qdf_timer
The qdf_timer_multiplier is currently applied to qdf_mc_timer and
qdf_event. In addition to these cases, also apply qdf_timer_multiplier
to qdf_timer to enable more debugging scenarios.

Change-Id: Ie3bd340dd2e8f1bec7e5bfa7ec3f0d0ceaa32e6d
CRs-Fixed: 2393017
2019-02-05 13:37:58 -08:00
Ashish Kumar Dhanotiya
ad85c38928 qcacmn: Update driver timer APIs according to kernel 4.19
There are some changes to timer APIs in latest kernel,
update driver APIs accordingly to invoke correct kernel
APIs for timer functionalities.

Change-Id: Ie017c8b1ef8237ca34f696c23509519a1187167c
CRs-fixed: 2383574
2019-02-02 15:27:54 -08: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
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
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
Mahesh Kumar Kalikot Veetil
fe276b3bc7 qcacmn: Fix qdf_get_monotonic_boottime_ns()
Fix the API implementation to account for time spent in system
suspend. This matches with API qdf_get_monotonic_boottime()
implementation.

Change-Id: I4bf8980bfc4500c035e8de7df4d8a18dfc6775ae
CRs-Fixed: 2211953
2018-03-26 16:32:28 -07:00
Manikandan Mohan
a18b86465c qcacmn: Fix export symbol for multi drivers compile
Update qdf files to use qdf_export_symbol to facilitate multiple
driver module compilation support.

Change-Id: I3bd0068bc2002b48a42da2c8f72bf84d49a6170f
CRs-fixed: 2197751
2018-03-19 19:58:06 -07:00
gaurank kathpalia
1435fba5e0 qcacmn: Add qdf time api to get time of the day in millisec
qcacld-2.0 to qcacmn propagation

Adds qdf time api to get time of the day in millisec

Also send host timestamp to firmware, so that firmware can print the
logs timestamp in sync with host via the wmi interface,with
api wmi_send_time_stamp_sync_cmd_tlv()

Change-Id: Id6acfc5227fdca2fbf8d266998fdfc4046adc5f4
CRs-Fixed: 2193978
2018-02-28 23:35:53 -08:00
Dustin Brown
47452e942b qcacmn: Add QDF_DEBUG_PANIC API
A very common pattern in the Wlan driver is to test for a fatal
condition, and then call QDF_BUG with some falsy value. Add a sugar
API for these cases, which effectively does 'QDF_BUG(false)'.
Additionally, include 'debug' in the name to remind consumers that
the panic will not occur on end user devices.

Current syntax:

	if (fatal_condition)
		QDF_BUG(false);

New syntax:

	if (fatal_condition)
		QDF_DEBUG_PANIC();

Change-Id: Ifa03e9109be5efdbd061ca32363d5719fb91da0f
CRs-Fixed: 2191582
2018-02-23 15:33:16 -08:00
Dustin Brown
f7fb76bd5e qcacmn: Add qdf_mc_timer_check_for_leaks API
Add a new  QDF MC Timer API for asserting that there are no active MC
Timers allocated. This is useful for detecting MC Timer leaks at
runtime.

Change-Id: I272ce806111b01b5c7f6b0dfef2e992c27b83529
CRs-Fixed: 2125800
2017-12-12 15:56:48 -08:00
Poddar, Siddarth
725e9f5a0d qcacmn: Add missing qdf_spinlock_destroy() to free debug cookie
Add missing qdf_spinlock_destroy() to destroy spin lock debug cookie
for SLUB build. For normal builds, qdf_spinlock_destroy() is a NO-OP
function.

Change-Id: If5a3843a468e460952dc64f0e6b5b1fba05ebbb3
CRs-Fixed: 2078940
2017-08-18 05:37:30 -07:00
Srinivas Girigowda
43977f7e6d qcacmn: Fix kernel checkpatch warnings in QDF
Fix kernel checkpatch warnings in QDF.

Change-Id: Id2f54c6c436bde55b040012fbbe9922cb177461e
CRs-Fixed: 2028128
2017-07-12 20:12:49 -07:00
Dustin Brown
c7e0c63260 qcacmn: Create QDF timer multiplier get/set APIs
In order to provide greater flexibility on emulation platforms, replace
the current hard-coded QDF_TIMER_MULTIPLIER with a pair of get/set
methods, configurable at runtime.

Change-Id: I0757da6c2129db08459411eaef75b6183f1aa557
CRs-Fixed: 2049309
2017-05-24 23:56:53 -07: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
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
Arunk Khandavalli
cae132b6a9 qcacmn: Get monotonic boottime from kernel in nano sec
qcacld-2.0 to qca-wifi-host-cmn propogation

Add support to get the boot time from kernel in nano seconds.

Change-Id: Iaa512248a5e56d77cff39da562e0c9ee4eaeeefd
CRs-Fixed: 1107219
2017-01-16 01:14:59 -08:00
Krunal Soni
616c11233a qcacmn: Delete obsolete CONFIG_MCL from qdf_mc_timer.c
Delete obsolete CONFIG_MCL from qdf_mc_timer.c as cds_mc_timer.h/.c
are going away.

Change-Id: I9aaa7301ce46b001a1ce99ea46d5d92db0cfe73c
CRs-Fixed: 1095867
2016-12-14 21:17:05 -08:00
Krunal Soni
66eabcfdcc qcacmn: Add control path scheduler to common driver
Add control path converged scheduler functionality to common
driver.

Change-Id: I2087b985b4bed661c03e667dbcc082714add1266
CRs-Fixed: 1095867
2016-12-12 22:24:34 -08:00
Ankit Gupta
7ee2ab073b qcacmn: Increase timeout values for napier emu
Increase the timeout duration for protocol events
for napier emulation platform.

Change-Id: I358259801018dc7ce48bd85f35594dec44704017
CRs-Fixed: 1089638
2016-11-21 15:20:02 -08:00
Sreelakshmi Konamki
e2e313532a qcacmn: Change time format of MTRACE logs
qcacld-2.0 to qcacld-3.0 propagation

MTRACE logs timestamp format is different from logcat logs,
and it's difficult to correlate with other logs.

This fix changes the timeformat of MTRACE logs
from qtimer ticks to hr:min:sec:msec

Change-Id: I45e5d28fbeccd757648f05ce4e593d8ca4fe7804
CRS-Fixed: 1049125
2016-11-08 22:54:45 -08:00
Sathish Kumar
79c2bf597e qcacmn: Fix compilation errors in QDF for Big Endian platform
Fix compilation issues faced on the WIN big endian
platform due to QDF convergence related changes.

Change-Id: I33b2a4bbe063acb4585b86e12fa79f96dc12ac73
CRs-Fixed: 1039318
2016-10-04 16:49:48 -07:00
Arun Khandavalli
75ea891eca qcacmn: Add bus_id memeber to qdf_device
With Load once unload never architecture, the cds modules
will be opened/closed several times. As part of configuration
of modules bus id needs to passed. So, add a new member to save
the bus_id passed by the platform driver during the driver
intialization,

Change-Id: Ic580e03076e5e8c557dde1879e223606a14f79b8
CRs-Fixed: 1049224
2016-08-04 10:34:22 +05:30
Abhishek Singh
06c3f0a7a8 qcacmn: Reduce the info level logs in STA/SAP
qcacld-2.0 to qcacmn propagation

Reduce the info level logs in STA/SAP

Change-Id: I5918ea8e9dd2f7654e5a994ad366f92d2ca3cd77
CRs-Fixed: 988195
2016-06-23 12:32:50 -07:00
Anurag Chouhan
8bfdee0154 qcacmn: Add WIN Driver compilation fix
Fix compilation errors for WIN driver

Change-Id: I2b7344c9632ea673754aa1f4d7003473b2527ada
CRs-Fixed: 981187
2016-04-28 13:02:20 -07:00
Anurag Chouhan
19717c09c9 qcacmn: Replace linux API with QDF API's
Replace linux spinlock API's with OS abstracted spinlock API's.

Change-Id: I6292b306a92b853eaddb19839fe0f976edf2f93f
CRs-Fixed: 981187
2016-03-24 03:08:20 -07:00
Chouhan, Anurag
5776318d19 qcacmn: Add QDF OS abstraction convergence
Converge ADF and CDF API's and move them to
QDF folder. MCL/WIN driver use this QDF converged
module for OS abstraction.

Change-Id: I1d0cdfd8730a5c021aaa50b7dc8549d491d760b3
CRs-Fixed: 981187
2016-03-16 12:18:26 -07:00