Commit Graph

158 Commits

Author SHA1 Message Date
Manoj Ekbote
9c0ec6c2d8 qcacmn: Add API to allow WMI commands
Add API to restart sending WMI commands after they have been
stopped using wmi_stop() API.

Change-Id: Id65e5d1310cd7076ca47c6e7e19221492c10a868
2019-11-18 00:46:05 -08:00
Jianmin Zhu
ed37c7cbca qcacmn: Clean up legacy F/W event handler
target_if F/W event handler is moved from wma to cmn part per
MCL/WIN converge requirement, clean up legacy call back.

Change-Id: Ifacc6bb46e6bde1a73d9953e3403551dd2e92939
CRs-Fixed: 2555080
2019-11-04 01:57:51 -08:00
Sandeep Puligilla
9304a97961 qcacmn: Add WMI scheduler thread context execution
Add WMI scheduler thread context execution framework
to process firmware events in the common project.

Change-Id: If56a4767ee9428d2f93d54ccbf5a8bb17e89e0f4
CRs-Fixed: 2554727
2019-11-01 08:17:25 -07:00
Alan Chen
b2bc55909c qcacmn: Add a qdf counter for qmi stats requests
Add a qdf counter to know number of qmi stats requests. Reset the
counter when WoW is exited.

Change-Id: Ie0c51fbd6eb2e7530dba01912443e7fc85726e52
CRs-Fixed: 2539999
2019-10-28 18:03:13 -07:00
Shaakir Mohamed
af7c6e0445 qcacmn: Support pdevid conversion map for wmi_handle
Support pdevid conversion map for dynamic mode switch

Change-Id: I350d66b142c7206f87e4182abfbe990bdc0faa7d
CRs-Fixed: 2509336
2019-10-15 14:49:23 -07:00
Manikandan Mohan
9b1b93cfcd qcacmn: Add support for WMI over QMI
Add support for WMI over QMI to reduce power consumption for
periodic stats report.

Change-Id: Ic57b2bd18be803c97ffeea2e0073751d31e02202
CRs-fixed: 2521835
2019-09-19 18:56:11 -07:00
Yue Ma
a720310823 qcacmn: Log runtime PM wake source in debug level
Since callers who log runtime PM resume source may be invoked within
spinlocks or in other atomic contexts, log using info level will log
to console as well which may result overhead. Log using debug level
which will be logged to buffer only to avoid such issues.

Change-Id: I0497c7b7528200af9a34d816865e9bbbfd8bacf2
CRs-fixed: 2518800
2019-09-13 17:37:17 -07:00
Tushnim Bhattacharyya
33087cb402 qcacmn: Include wmi.h on the correct header files
Include wmi.h in wmi files.

Change-Id: I0584e58c5ae64e8ed93d024aa7943a9cdcdb07c8
CRs-Fixed: 2514753
2019-08-29 22:11:16 -07:00
Surya Prakash Raajen
c59f7dc66e qcacmn: Fix wrap-around condition check in DIAG_RX_EVENT_RECORD
Diag_log_max_entry should be used to determine wrap around condition
in DIAG_RX_EVENT_RECORD. Using incorrect max value results in invalid
access and memory corruption. Fix DIAG_RX_EVENT_RECORD to use diag_log
max entry instead of mgmt_max entry.

Change-Id: Icae3ce843b1fd76e15139fae1a867448ad032cf8
CRs-Fixed: 2488783
2019-07-31 22:18:42 -07:00
Yue Ma
4986b2588b qcacmn: Log runtime PM resume source
It is very critical to know the source of who requests runtime
PM resume to debug all kinds of runtime PM related issues. Hence
log them accordingly.

Change-Id: I9551830b1cb567fd29e9d9bbec18705f9cc5e9ec
CRs-fixed: 2496481
2019-07-27 02:49:10 -07:00
Himanshu Batra
032d352263 qcacmn: Replace void * Host Target Communications handle with abstract type
Replace void * Host Target Communications handle with abstract type handles
provided by Host Target Communications component

Change-Id: I16ca87e4f9716791d340da2fda0a8a640fa2ec34
CRs-Fixed: 2487151
2019-07-25 00:25:49 -07:00
Bala Venkatesh
63b4f6a57e qcacmn: Remove MCL_CONFIG flag
In file wmi_unified.c use appropriate config
flags instead of MCL_CONFIG flag.

Change-Id: I9e43f8853ddd93221679cefa50b4f7b239d2abdb
CRs-Fixed: 2491383
2019-07-18 07:17:29 -07:00
lifeng
12ed18959c qcacmn: Support to issue legacy d0wow disable wmi command
Support to issue legacy d0wow disable wmi command in resume.

Change-Id: I7bdf979f5b268112b7f40ae32ca2f0a5c61125bf
CRs-fixed: 2462274
2019-06-10 02:37:47 -07:00
Surya Prakash Raajen
9d48cd993c qcacmn: Clean up of CONFIG_MCL flag
Clean up of  CONFIG_MCL flag and introduce
WMI_INTERFACE_EVENT_LOGGING_DYNAMIC_ALLOC, new speicific-feature
flag for dynamically allocated buffers for debug logging.

Change-Id: Iec4c26faa28400d257332f72dcdf77e18d0fda31
CRs-Fixed: 2450565
2019-05-29 11:07:52 -07:00
Uraj Sasan
485478ae4e qcacmn: Disable bottom half in wmi show routine
We have a case in which user context was reading
wmi debugfs entries and then an interrupt context
waits on same lock resulting in deadlock and cpu stall.

Disable bh to prevent cpu stall.

Change-Id: I8e2b443317950b4cf2c8c228a98f638dd165ca2b
2019-05-23 22:57:48 -07:00
Surya Prakash
4e517d7795 qcacmn: Use arrays for param conversion from host to target type
Convert host param id to target param id using arrays
instead of switch case. This enables removal of CONFIG_MCL
compile time macro and use specific macro
ENABLE_HOST_TO_TARGET_CONVERSION for conversions

Change-Id: I223141d47e92521e6600fc0e160ab2deef43d7d2
CRs-Fixed: 2418030
2019-05-13 03:31:48 -07:00
Rajeev Kumar
6b276f6a8f qcacmn: Log error and fail WMI send if target is suspended
Replace qdf_bug by error log becasue when using wow unit test
framework its very common for higher layer components to send wmi
commands and in this case WMI should fail the request rather than
asserting.

Change-Id: Ie09e4b6014468bcd6b5d75e7f64a78d069855f4f
CRs-Fixed: 2442275
2019-04-29 04:17:55 -07:00
Jingxiang Ge
4218f02cef qcacmn: Pass hang reason to qdf_trigger_self_recovery
To identify the reason for recovery, add parameter
"reason" for qdf_trigger_self_recovery.

And revise comment for qdf_hang_reason, replace "CDS"
with "QDF".

Change-Id: I8b388b5e83dbbdf29246c264ada56290f0dd3bfc
CRs-Fixed: 2431282
2019-04-19 01:56:52 -07:00
Jingxiang Ge
23c5658da6 qcacmn: Trigger recovery while wmi stuck
Replace QDF_BUG with qdf_trigger_self_recovery while wmi stuck.

Change-Id: If366fbdff356d16b78324051aad99fd4455978b5
CRs-Fixed: 2430743
2019-04-11 01:14:05 -07:00
Ajit Pal Singh
eb5bf8cfc7 qcacmn: Add new WMI API to check target suspend status
Add new WMI API to check target suspend status

Change-Id: Ie4ba55fc3db2d8de7354377b26325d3510a1e228
CRs-Fixed: 2425368
2019-04-05 08:37:31 -07:00
Jeff Johnson
ab5b78df17 qcacmn: wmi: 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 wmi replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: Ida6b1b32330d97392bd879f84929782a64f4fc85
CRs-Fixed: 2418250
2019-03-20 10:10:28 -07:00
Surya Prakash Raajen
80638517c2 qcacmn: Redefine pdev and vdev param to remove CONFIG_MCL
Convert pdev and vdev param conversion array to pointers
and allocate them only if conversion is required.Use run-time
NULL check of pdev and vdev param pointers for conversion
and remove CONFIG_MCL compiler flag.

CRs-Fixed: 2393422
Change-Id: Ica1c81f5f3c3a4b7e31dcb70c63471898c36933d
2019-03-15 18:04:02 -07:00
hangtian
032a78de3c qcacmn: Allow SSR during driver resume
Allow SSR during driver resume. Assume firmware goes down during driver
is in suspend state. Avoid get into bad state and wmi access during driver
resume.

Change-Id: Ie1689e0b080f940666fbbb19c9f0e3b0fecfe564
CRs-Fixed: 2390031
2019-03-11 01:35:17 -07:00
Dustin Brown
3fe77afae9 qcacmn: Remove references to EOK
EOK is a legacy definition and frequently misused. Remove references to
it from qcacmn.

Change-Id: Ic3179ad95beb75edb97e1dda7ac879a65a86a2e4
CRs-Fixed: 2404900
2019-03-01 11:14:45 -08:00
Dustin Brown
d33659b98d qcacmn: Provide reason to QDF_DEBUG_PANIC()
A common pattern in WLAN to panic the driver is to log the reason and
then unconditionally panic. QDF_DEBUG_PANIC() takes a reason string to
help make the reason for the panic more obvious, but it is not always
used. Ensure all callers of QDF_DEBUG_PANIC() provide a reason string.

Additionally, make the reason string parameter of QDF_DEBUG_PANIC()
mandatory.

Change-Id: Ia3c7acfe590f7f465823fff3f2393653b2d20fe5
CRs-Fixed: 2403830
2019-02-26 14:21:37 -08:00
Madhvapathi Sriram
610c0c8e41 qcacmn: Remove error log for qdf_mem_malloc in wmi files
qdf layer already has the error trace

Change-Id: I4c63264f6674c6c2710368de4b5c9f24817ac74c
CRs-Fixed: 2376431
2019-02-11 11:58:37 -08:00
Surya Prakash
1f0930190b qcacmn: Clear compilation warnings
Clear compilation warnings for wmi files which
has unsued functions in case of some macros
aren't defined.

Change-Id: If3a9ee68206a44e35f459e3c39d9da2d6f7ba4ba
2019-02-05 04:02:24 -08:00
Surya Prakash
27fba324b4 qcacmn: Enhance debug message for wmi
Print endpoint ID, soc ID, target type and transmission
queue depth when queued wmi commands reaches max wmi queue size.

Change-Id: Ia781f3a2c964651d5fdb8cb54ab975021cd11566
CRs-Fixed: 2360714
2019-02-05 04:02:13 -08:00
Harprit Chhabada
71c9846f58 qcacmn: Use the same callback signature for MCL as WIN
Callback signature in wmi_process_fw_event_default_ctx
is different for WIN and MCL. Make it same.

Change-Id: I28ad8e6068742095bdb9bc265e46dead8bfb217d
CRs-Fixed: 2372980
2019-01-21 03:55:04 -08:00
Arif Hussain
61847a9ba6 qcacmn: Use function name instead of file name in debug logs
Replace all instance of file name to function name in debug logs.

Change-Id: Iff731675772859f02c975005b2656eaa41c6f360
CRs-Fixed: 2377894
2019-01-17 22:20:46 -08:00
Akshay Kosigi
46050aa104 qcacmn: Add NULL check for WMI handle
Adding NULL checks for WMI handle while registering or unregistering
events or event handlers

Change-Id: Icdf7032bad7289e62f5d7b17aab9780bcdf0ab1d
2018-12-21 10:05:40 -08:00
Shashikala Prabhu
bfd50437fd qcacmn: Use UNBOUND flag to create WMI RX workqueue
WMI RX workqueue is created with WQ_MEM_RECLAIM flag. When host receives
the WMI service ready event it queues the work. There is 50sec delay in
scheduling workqueue to process WMI service ready event. This results in
host timeout (timeout = 15sec) and wifi load failure. This cleans up the
host data structures related to data path. But work got scheduled after
50sec resulting in init path handling with inconsistent data structures.

Use workqueue UNBOUND flag to create WMI RX workqueue. Works queued to
unbound workqueues are implicitly HIGHPRI and dispatched to unbound
workers as soon as resources are available.

Change-Id: I46eb0242ad88103268df99be9fd2e0759ebec4b2
CRs-Fixed: 2343181
2018-12-06 13:44:13 -08:00
phadiman
e5a330acf6 qcacmn: Set WMI Endpoint as Async
Conditionally set WMI enpoint as
async only for WIN and revert it
for MCL

Change-Id: I8969fffb4ba72909839baea2bdd12723665a8a4f
2018-11-15 01:38:33 -08:00
Dustin Brown
f88a90fad9 qcacmn: Reduce 'no event handler registered' log
Change I9a14a3defc61462bf4c7a8f0278e258603b781c7 moved a log in
wmi_control_rx indicating that a specific event Id has no associated
handler from debug-level to error-level. This resulted in excessive
logging, as the driver has no obligation to handle every event type
received from firmware and very well might not want to handle every
event type received from firmware. Restore the original debug-level to
the log.

Change-Id: I4b1118fef7e4752dbaaf796db2f9444927c7e178
CRs-Fixed: 2341953
2018-10-31 19:20:52 -07:00
phadiman
1a2f48a775 qcacmn: Set WMI endpoint as async
WMI endpoint will receive commands
from both user context and kernel
context

Hence making the it as asynchronous

Change-Id: Ia969bb9db6a8978a7f50bc19f9f602dfbc1c83ea
CRs-Fixed: 2313262
2018-10-18 16:58:46 -07:00
Pratik Gandhi
5526a55fa2 qcacmn: wmi logging - buffer offset for multi-radio
Move buffer offset to wmi soc as buffer offsets are same for all
pdevs in soc.

Change-Id: I7822ae18212d66420ce6c68341c38c9737de2f58
CRs-Fixed: 2330630
2018-10-17 05:50:44 -07:00
Rakshith Suresh Patkar
5c881ec3ec qcacmn: Update debug info in wbuff_buff_get()
The debug node for all the nbufs allocated by wbuff
for a module contains the file and line info
pertaining to wbuff_module_register().

To enhance debugging, Use qdf_net_buf_debug_update_node()
to update debug info when nbuf is requested through
wbuff_buff_get().

Change-Id: Ie8b148ef6313bd3b265cfa3f141e8d0de8b75597
CRs-Fixed: 2328257
2018-10-16 21:21:15 -07:00
Rajeev Kumar
8047370dfc qcacmn: Separate WMI diag rx event logging
FW generates too many diag events and these diag events
also come on CE-2 together with other critical control
path WMI events and easily over-run useful control path
WMI RX even log buffer. Separate WMI diag rx event loggig
in a separate log buffer such that useful control path WMI
log event buffer is not over-run.

Change-Id: I89b5d88036bc9d7e57e8e16858bc556be4e2ed41
CRs-Fixed: 2318083
2018-09-27 15:00:49 -07:00
Rakshith Suresh Patkar
1f18454889 qcacmn: Enable wbuff support for WMI
Register WMI with wbuff for pre-allocation of
skbs. Register at wmi_unified_attach() and
de-register at wmi wmi_unified_detach().

Change-Id: I9d6df1a8480324dd2a258de12672669a8fbe8940
CRs-Fixed: 2313935
2018-09-24 05:07:30 -07:00
Sathish Kumar
4c46c87ce0 qcacmn: Replace qdf_print calls with appropriate WMI_LOGx APIs
WMI APIs currently use qdf_print() calls to print the messages onto
the console irrespective of whether it is an error, info or debug
message.

Replace qdf_print() calls with appropriate WMI_LOGX() APIs to ensure
they align with the debug framework.

Change-Id: I9a14a3defc61462bf4c7a8f0278e258603b781c7
CRs-Fixed: 2319398
2018-09-21 05:28:48 -07:00
Karthik Kantamneni
574d2147c3 qcacmn: Filter diag events in WMI extended debug mode
Filter diag events while recording WMI extended debug log messages.

Change-Id: I4071c66eee5880fbe336ea8c21081b3054dfb835
CRs-Fixed: 2316702
2018-09-20 14:54:53 -07:00
gaurank kathpalia
8a339e8a87 qcacmn: Enable ML logging for wmi_control_rx
Enable ML logging in wmi_control_rx and capture all
responses from firmware.
This would result in knowledge of whether the wmi_response
or any wmi_event was received by the host.

Change-Id: I0206a5b9bd357d06a8621747473dedecaa1779f2
CRs-Fixed: 2306047
2018-09-18 06:17:15 -07:00
Venkat Karthik Kantamneni
f902e52618 qcacmn: WMI command/event Extended dump using qdf_debugfs APIs
Currently only 16 bytes of wmi command/event messages are logged
excluding wmi header information.

By enabling WMI_EXT_DBG whole command/event messages can be dumped
using qdf debugfs apis. This will help if it is needed to
collect whole command/event messages information.

Change-Id: I72dff1279b1145b8d2ee415db97656f457c0136f
CRs-Fixed: 2309286
2018-09-12 10:23:27 -07:00
Arif Hussain
ffcaef4344 qcacmn: Add logs in wmi_unified_cmd_send()
In wmi_unified_cmd_send() 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.

Change-Id: Ib70d55959087021c4495c175d5363375037afe00
CRs-Fixed: 2281983
2018-09-06 01:42:14 -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
58189eb0bd qcacmn: Add logs in wmi_buf_alloc()
In wmi_buf_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 wmi_nofl_* macros.

Change-Id: Ib1ac8bf2bbcefa7f0015aff2733d3dc4773b185d
CRs-Fixed: 2281983
2018-09-06 01:42:09 -07:00
Aditya Sathish
ca0ebcdbaa qcacmn: Clean up wmi component prints
Clean up WMI component prints by correcting trace levels for
regularly occurring prints and removing newlines from converged
print APIs since qdf_trace_msg appends them by default.

Change-Id: Ie375e6fda2943f5f2b7287da4374ef9d7470d593
CRs-Fixed: 2243843
2018-08-10 18:11:27 -07:00
c_priys
b214c2454c qcacmn: WMI Recording Failure on Multi-radio RDPs
WMI recording is done per pdev and hence an instance of
debugfs directory (eg: WMI0, WMI1, WMI2 for 3 radio boards)
has to be created in /sys/kernel/debug/ path.

The wmi handle is per pdev and hence is causing the problem of wmi_instance
being 0 always as each pdev has its own wmi_handle.
WMI1 and WMI2 debugfs directories are not created as wmi_instance
is always 0.

WMI debugfs directory is created for every pdev of the psoc and naming
convention is changed to WMI_SOCx_PDEVx.

Change-Id: Ieb7e9d072d84f699588a8f719508c5cd8d9873fb
CRs-Fixed: 2232472
2018-07-06 00:16:36 -07:00
Amar Singhal
dbff0cc4f2 qcacmn: Make worker thread processing API non static
Worker thread WMI processing API has more broader use now. So make it
non-static.

CRs-Fixed: 2268243
Change-Id: Iae51e1115f5f3664d08c891e8a42d24bd3ef7bcf
2018-06-30 00:18:01 -07:00
Debasis Das
78495ce966 qcacmn: Fix Integer Overflow Leading to Buffer Overflow
wmi_buf_alloc() API expects length to be passed of type
uint16_t. However, the callers pass uint32_t to it.
This might result in overflow and illegal memory access
thereafter. The fix is to modify the API signature accordingly.

Change-Id: If09da4978d421269b884f7d3c933c49c81651475
CRs-Fixed: 2218346
2018-06-20 06:33:47 -07:00