Commit graph

126 Commits

Autor SHA1 Nachricht Datum
phadiman
ae1507637a 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
e7110f00cf 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
84180fc472 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
44811d0e0f 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
539912b8fe 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
b64e128cb7 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
9eb15ee08e 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
f1ab58a9ad 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
fa613b4c33 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
496e66ed0f 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
bc8d329295 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
07d902a873 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
f4440388b8 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
3f6ad3d6d6 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
45d7adaa1c 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
b5f94a86e6 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
66d1ed5dac 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
eaf8a8bd28 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
Vignesh Viswanathan
737cef775f qcacmn: Fix Uninitialized byte sent to FW in wmi_unified_cmd_send
In wmi_unified_cmd_send, the skb head is pushed by size of WMI_CMD_HDR
and then the commandId is initialized in the header. However 1 byte of
reserved memory in the WMI_CMD_HDR is not initialized and is sent to
the FW as it is and this might lead to exposure of 1 byte of kernel
memory to FW.

Initialize the WMI_CMD_HDR to zero once the skb head is pushed and
then set the commandId in the header.

Change-Id: I89fd5401105cd9c61674a63aac5aa88fb20cc41a
CRs-Fixed: 2257688
2018-06-18 16:33:57 -07:00
Jeff Johnson
03ba7db97a qcacmn: wmi: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: Ic86284ff527bb55b681149e38f5c708edda5ce8b
CRs-Fixed: 2230684
2018-05-18 02:17:53 -07:00
Abhiram Jogadenu
429ab53de2 qcacmn: Check to validate wmi tartget_type
This target type is used as an array index for wmi_attach_register.
If the index is greater than or equal to  WMI_MAX_TARGET_TYPE,
it may lead to invalid memory access.
KW issue id is 294041

Change-Id: Ibb49d77413517173c24aae44ae5a3f17069425d2
2018-05-14 06:04:51 -07:00
Kabilan Kannan
66084ce918 qcacmn: Block WMI cmds before issuing HTC stop
WMI cmds should be blocked, before calling HTC stop
to avoid the race condition in the system

Change-Id: I015b154a3bc422f50d4ed82bc861dd9e054c47a3
CRs-Fixed: 2194234
2018-04-16 16:57:01 -07:00
Shiva Krishna Pittala
792933748b qcacmn: Fix the limitations in enabling memory debug on WIN
Copy the file name to a QDF local array, rather than using
the pointer to file name, to avoid access to the invalid pointer.
Also, separate out SKB debug from memory debug.
SKB debug will be enabled once the SKB related false positives are fixed.

CRs-Fixed: 2216661
Change-Id: I0ada1acb84c24c961cf614c9c47261f272959874
2018-04-11 09:15:20 -07:00
Kabilan Kannan
f1311ecc8d qcacmn: Add magic string for debug enhancement
Add magic string in the driver to automate the
stability analysis.

Change-Id: Ic4989d70827bbb680de428f8065e2fff6ea8ad2f
CRs-Fixed: 2212155
2018-04-02 19:39:42 -07:00
Vivek
c582309f9a qcacmn: Replace A_UINT with appropriate types
There are instances of use of older A_UINT/A_INT.
Replace all such instances with the qdf u_int*_t/int*_t.

Change-Id: I7ce29b03f29a0d1a0cf87cfd3c846f4694da4c2a
CR's-Fixed: 2210869
2018-03-26 04:58:12 -07:00
Chaithanya Garrepalli
6327e8ad49 qcacmn: Send max commands as param to wmi_unified_attach
Modify arguments of wmi_unified_attach to use struct to
send attach params instead of individual params. Add max
WMI commands as a param. Based on requirement MAX WMI
commands value is different. In case of AP that supports
16 VAPs and more than 512 clients, 1024 commands is not
enough. Use this param to configure this value based on
the requirement.

Change-Id: I4e778475481e509051dfbac70980614b644e1b4a
CRs-fixed: 2034438
2018-03-15 04:26:08 -07:00
Pratik Gandhi
cf3b8b97c7 qcacmn: Fix compilation issues for FW header abstraction
fwhdr_abstrct: Fix compilation issues for WIN firmware header abstraction.

Change-Id: Id76a6f29fd41ae559cf377029428224d59bd03fb
CRs-Fixed: 2140921
2018-03-09 07:28:50 -08:00
Rachit Kankane
799d2c9655 qcacmn: Compile out WMI logging feature
Fix to compile cleanly when WMI_INTERFACE_EVENT_LOGGING
feature is disabled.

Change-Id: I1c7d687e685b8b2dcdb35667c425afc3d09c73da
CRs-Fixed: 2192125
2018-03-06 23:45:19 -08:00
Arunk Khandavalli
b6ba21fef9 qcacmn: Increase the wmi watchdog timeout to 30sec
Under low memory conditions skb allocation sleeps
and results in kernel work queue watchdog.

Increase the wmi timeout to check if the system
recovers to allocate the SKB.

Change-Id: Ie4e42fdc71703c687ba2e5a4d995481ea7931c97
CRs-Fixed: 2158198
2018-02-27 16:04:41 -08:00
Pratik Gandhi
67da1bb4af qcacmn: WMI registration change to support to WIN modularization
Change WMI initialization sequence to support WMI modularization.
TLV and Non-TLV modules calls WMI module registration based on target type.
WMI attach will call respective attach routines based on registration.

Change-Id: Id56446f491d129758537913d2d5d6633f8dec918
CRs-Fixed: 2179854
2018-02-07 12:12:05 -08:00
Kris Muthusamy
76e2241d3b qcacmn: Fix host panic due to missing WMI service handles
WMI service handle is not attached for all Pdev with recent
WMI changes. Fix host panic due to missing WMI service handles
for all Pdev.

Change-Id: Ic6107120ea4a49e49b86ebbfe385e440de3f49a9
2018-02-02 07:46:00 -08:00
Sourav Mohapatra
a7b454df56 qcacmn: Converge on wmi service/ext service is enable
Converge on wmi service/ext service is enable

Change-Id: Ib246befa72cce927bee157394cd22c7d1562d341
CRs-Fixed: 2152751
2018-01-24 13:19:48 -08:00
jiad
36c94d2d50 qcacmn: Fix WMI mgmt cmd tx comp record
wmi_mgmt_cmd_record is used to add WMI mgmt cmd record. But mgmt
cmd tx comp record is missing due to mismatch of is_management_record.
Fix is to change is_management_record WMI cmd id to match those who
call wmi_mgmt_cmd_record. In wmi_unified_cmd_send, mgmt cmd record
add is no longer needed since already added in wmi_mgmt_cmd_record.

Change-Id: I41daf428ac0848dabaf4d87e3ecb7dca5e1c2774
CRs-Fixed: 2168104
2018-01-24 01:43:33 -08:00
Adil Saeed Musthafa
b85851dac4 Revert "qcacmn: Add debug print before calling WMI event handler"
This reverts change-id: Ie1b758a17882743fa4871b6ce4725c986769b01b

CRs-Fixed: 2155931
Change-Id: I54e0e1b2af868bc22da59410af405e970fe5678e
2018-01-15 13:25:18 -08:00
nobelj
2a6da6fb08 qcacmn: Add support to print time on event log and command log
print event time and command time along event/command logging

Change-Id: I4562f76d4d15f9c42080795007af94422c14e33c
2018-01-13 21:31:13 -08:00
Rakesh Pillai
24c7f8acad qcacmn: Fix wmi debugfs creation after interface creation timeout
After driver init, if not interface is created and the stop modules
gets called, the wmi debugfs dir is removed. After this it is not
created again during start modules. Due to this the wmi debugfs will
be unavailable after this.

Fix the wmi debugfs entry creation when interface creation timeout
happens after driver init.

CRs-Fixed: 2164039
Change-Id: Ib1a9c655b5144b11d506a09268918b63f82adcc0
2018-01-11 03:48:48 -08:00
Rakesh Pillai
0511046ae5 qcacmn: Unify the wmi command and event record offset
The wmi data buffer offset passed to record command and event
buffer uses different offset and type for command and event.

Change the recorded wmi data buffer type to uin8_t pointer
for both, wmi command and wmi event record.

CRs-Fixed: 2164395
Change-Id: Ie759248a6a32632dd93f751a856a0588d9a11c25
2018-01-11 03:48:45 -08:00
Surabhi Vishnoi
209f7d4ade qcacmn: Change the data type of message type id
The datatype of wd_msg_type_id was uint16_t which truncates the
upper bytes of msg id.

Changing the datatype of wd_msg_type_id from uint16_t to uint32_t.

Change-Id: I49b5eefd878660f6ba3d0b7da451df99661c59df
2017-12-16 14:08:06 -08:00
Govind Singh
c646e102cf qcacmn: Dump WMI work queue stack for watchdog bite
In the event of an WMI work queue watchdog bite, dump the stack
trace to aid in debugging.

Change-Id: I7f3df5a56904748fb80afb1aef1aed90d20fbbc0
CRs-Fixed: 2145913
2017-12-15 19:26:25 -08:00
Mukul Sharma
2c66f7e844 qcacmn: Converge on wmi event registration / unregistration
Converge on wmi event registration / unregistration method.

Change-Id: If03a38d74a47cc1d900bc5734a7c8f950513efaa
CRs-Fixed: 2148479
2017-11-30 03:40:33 -08:00
Houston Hoffman
c85276b73a qcacmn: Allways do WMI_RX_EVENT_RECORD when wmi event recieved
Receipt of the wmi events wasn't being recoreded when the event
was being processed in the mc thread or tasklet.  Log the receipt
in all cases to root-cause unprocessed wmi events faster.

Change-Id: I2543a9ff9049e7d177c1ffa5df1e899035860f91
CRs-Fixed: 2125232
2017-10-24 19:19:12 -07:00
Ashish Kumar Dhanotiya
4f873ffc59 qcacmn: Remove wmi_id_to_name from wmi_unified.c
Remove wmi_id_to_name from wmi_unified.c as this
function is define in fw_api project.

Change-Id: I4b7d83ed79fe9a5d3a867149972a9ccb1e2f34c8
CRs-Fixed: 2002773
2017-10-24 15:38:22 -07:00
Govind Singh
97b8e7c606 qcacmn: Add watchdog timer for WMI work queue lock-up
WMI work queue rx context can block other work queue
shared on the same CPU if it takes more time.

Add watchdog timer for WMI work queue housekeeping and
assert if takes more time in SLUB DEBUG build

Change-Id: I60b1dad21afbf93a5b88aa855a2835bb0f85b82f
CRs-Fixed: 2104106
2017-09-28 01:57:28 -07:00
Kiran Venkatappa
7d73914da9 qcacmn: Add support of extended service bitmap handling
Extended service bitmap is used by FW to indicate supported services
bitmap for services excedding the current limitation of 128. Add support
to save and use this bitmap to check services supported in FW. Also,
change exisiting services bitmap to be dynamic allocated buffer to
optimize the buffer used to save the bitmap.

Change-Id: I24a0321bc1a06ee3aedf1c6acbc379e907bbd464
CRs-Fixed: 2103617
2017-09-23 10:32:47 -07:00
Ravi Kumar Bokka
7aec5b5e9b qcacmn: Add ini param to control the crash inject
qcacld-2.0 to qcacmn propagation

Currently the crash can be injected by iwpriv command and FW
gets crashed.
Changes are done to add the gEnableCrashInject ini parameter

1) This ini param is disabled by default.
2) If this param is disabled the crash inject is ignored.

Change-Id: I7e908be1e37090a9d343dc04411fe387f776a937
CRs-Fixed: 1087774
2017-09-19 02:28:14 -07:00
yeshwanth sriram guntuka
0a050d77c1 qcacmn: Fix excessive logging
kmsg is flooded with excessive logs from wmi_control_rx.

Fix is to change log level to debug.

Change-Id: I327463387a5dac318ecc0ad7e773006cfc09b42a
CRs-Fixed: 2073718
2017-08-10 04:25:49 -07:00
Adil Saeed Musthafa
5ffc0c21d3 qcacmn: Add debug print before calling WMI event handler
Print the Event ID before calling WMI event handler

CRs-Fixed: 2086665
Change-Id: Ie1b758a17882743fa4871b6ce4725c986769b01b
2017-08-09 16:07:47 -07:00
Govind Singh
2d8bfc63c4 qcacmn: Remove redundant header file inclusion from wmi layer
Remove redundant header file inclusion from wmi layer by abstracting
the dependency with in WMI layer.

Change-Id: Ie113b69006a960b70d781134775bc44c7508fc4c
CRs-Fixed: 2023825
2017-07-26 08:14:52 -07:00
Wu Gao
21e6938191 qcacmn: Free events logs list of wmi handle
Free events logs list of wmi handle, avoid memory leak.

Change-Id: I7660239f3808ebf0f56baf5900c1290218507406
CRs-Fixed: 2062407
2017-07-21 20:15:16 -07:00
Srinivas Girigowda
245fa9e277 qcacmn: WMI: Reduce the log spam in kmsg
Move the logs to appropriate log levels to reduce
the log spam in kmsg.

Change-Id: Icc2d55626908b6e6448567b259af106e3314827e
CRs-Fixed: 2017427
2017-07-12 20:12:51 -07:00